aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--HOWTO/INSTALL.md4
-rw-r--r--OTP_VERSION1
-rw-r--r--README.md7
-rw-r--r--bootstrap/bin/start.bootbin5306 -> 5343 bytes
-rw-r--r--bootstrap/bin/start_clean.bootbin5306 -> 5343 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_asm.beambin11524 -> 11428 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_block.beambin9656 -> 9688 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_bool.beambin15652 -> 15648 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_bs.beambin5928 -> 5924 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_bsm.beambin12636 -> 12632 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_dead.beambin12972 -> 12972 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_disasm.beambin26216 -> 26204 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_peep.beambin2424 -> 2544 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_receive.beambin6384 -> 6380 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_split.beambin2396 -> 2496 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_trim.beambin7864 -> 7856 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_type.beambin17148 -> 17144 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_utils.beambin13756 -> 13912 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_validator.beambin29988 -> 30028 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_z.beambin2636 -> 2888 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/cerl.beambin31940 -> 32080 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/cerl_inline.beambin38716 -> 38692 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/cerl_trees.beambin20676 -> 20908 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/compile.beambin38704 -> 38976 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/compiler.app4
-rw-r--r--bootstrap/lib/compiler/ebin/compiler.appup4
-rw-r--r--bootstrap/lib/compiler/ebin/core_lint.beambin13580 -> 13572 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/core_parse.beambin50896 -> 57124 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/core_pp.beambin13148 -> 12796 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/sys_core_dsetel.beambin7184 -> 7180 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/sys_core_fold.beambin52236 -> 52184 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/sys_pre_expand.beambin13472 -> 13472 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/v3_codegen.beambin55864 -> 55848 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/v3_core.beambin53740 -> 53896 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/v3_kernel.beambin46880 -> 46656 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/code.beambin12140 -> 12140 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/code_server.beambin24740 -> 24808 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/disk_log.beambin35860 -> 35836 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/dist_util.beambin10352 -> 10672 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/erl_distribution.beambin1832 -> 1648 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/error_handler.beambin1660 -> 1656 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/erts_debug.beambin5548 -> 5544 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/file.beambin14460 -> 14452 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/file_io_server.beambin15564 -> 15544 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/gen_sctp.beambin3612 -> 3604 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/global.beambin32252 -> 32244 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/global_group.beambin17568 -> 17548 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/group.beambin14040 -> 14036 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/hipe_unified_loader.beambin13792 -> 13792 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/inet.beambin23320 -> 23312 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/inet_db.beambin27044 -> 27024 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/inet_dns.beambin19596 -> 19596 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/inet_gethost_native.beambin10436 -> 10436 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/inet_parse.beambin12924 -> 12916 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/inet_res.beambin14868 -> 14868 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/kernel.app6
-rw-r--r--bootstrap/lib/kernel/ebin/kernel.appup12
-rw-r--r--bootstrap/lib/kernel/ebin/net_kernel.beambin22600 -> 22968 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/ram_file.beambin6996 -> 6984 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/rpc.beambin8580 -> 8132 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/seq_trace.beambin1440 -> 1608 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/user_drv.beambin11412 -> 11408 bytes
-rw-r--r--bootstrap/lib/kernel/include/dist.hrl3
-rw-r--r--bootstrap/lib/kernel/include/dist_util.hrl2
-rw-r--r--bootstrap/lib/kernel/include/inet.hrl2
-rw-r--r--bootstrap/lib/kernel/include/inet_sctp.hrl2
-rw-r--r--bootstrap/lib/kernel/include/net_address.hrl2
-rw-r--r--bootstrap/lib/stdlib/ebin/array.beambin12008 -> 12000 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/beam_lib.beambin18612 -> 18580 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/c.beambin14608 -> 14600 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/dets.beambin53688 -> 53660 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/dets_server.beambin6988 -> 6984 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/dets_utils.beambin28756 -> 28748 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/dets_v9.beambin49844 -> 49832 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/dict.beambin9332 -> 9324 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/digraph_utils.beambin6824 -> 6816 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/epp.beambin28212 -> 28828 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/erl_bits.beambin2528 -> 2524 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/erl_compile.beambin7280 -> 7280 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/erl_eval.beambin30640 -> 30636 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/erl_expand_records.beambin21764 -> 21760 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/erl_lint.beambin89756 -> 90264 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/erl_parse.beambin82296 -> 82864 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/erl_pp.beambin26796 -> 27352 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/erl_scan.beambin28844 -> 28840 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/erl_tar.beambin17156 -> 17152 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/escript.beambin17592 -> 17576 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/ets.beambin22604 -> 22592 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/eval_bits.beambin8096 -> 8092 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/file_sorter.beambin30408 -> 30400 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/filelib.beambin8056 -> 8044 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/filename.beambin14756 -> 14884 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/gen.beambin4276 -> 5412 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/gen_event.beambin13524 -> 13468 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/gen_fsm.beambin10476 -> 9536 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/gen_server.beambin13744 -> 12500 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/gen_statem.beambin0 -> 13588 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/io_lib_pretty.beambin15156 -> 15152 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/lib.beambin9600 -> 9596 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/lists.beambin29768 -> 29912 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/maps.beambin2404 -> 2892 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/otp_internal.beambin11896 -> 9632 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/proc_lib.beambin10656 -> 10676 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/qlc.beambin70148 -> 70116 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/qlc_pt.beambin76244 -> 76228 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/re.beambin13600 -> 13580 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/shell.beambin30236 -> 30232 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/sofs.beambin40656 -> 40600 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/stdlib.app5
-rw-r--r--bootstrap/lib/stdlib/ebin/stdlib.appup12
-rw-r--r--bootstrap/lib/stdlib/ebin/supervisor.beambin23456 -> 23436 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/unicode.beambin11612 -> 11592 bytes
-rw-r--r--bootstrap/lib/stdlib/include/assert.hrl31
-rw-r--r--bootstrap/lib/stdlib/include/erl_compile.hrl2
-rw-r--r--bootstrap/lib/stdlib/include/ms_transform.hrl2
-rw-r--r--bootstrap/lib/stdlib/include/qlc.hrl2
-rw-r--r--bootstrap/lib/stdlib/include/zip.hrl2
-rw-r--r--configure.in65
-rw-r--r--erts/AUTHORS2
-rw-r--r--erts/Makefile.in2
-rw-r--r--erts/aclocal.m42
-rwxr-xr-xerts/autoconf/configure.vxworks2
-rw-r--r--erts/autoconf/vxworks/sed.general2
-rw-r--r--erts/autoconf/vxworks/sed.vxworks_cpu322
-rw-r--r--erts/autoconf/vxworks/sed.vxworks_ppc322
-rw-r--r--erts/autoconf/vxworks/sed.vxworks_ppc6032
-rw-r--r--erts/autoconf/vxworks/sed.vxworks_ppc603_nolongcall2
-rw-r--r--erts/autoconf/vxworks/sed.vxworks_ppc8602
-rw-r--r--erts/autoconf/vxworks/sed.vxworks_simlinux2
-rw-r--r--erts/autoconf/vxworks/sed.vxworks_simso2
-rw-r--r--erts/autoconf/vxworks/sed.vxworks_sparc2
-rw-r--r--erts/configure.in171
-rw-r--r--erts/doc/Makefile2
-rw-r--r--erts/doc/src/Makefile17
-rw-r--r--erts/doc/src/absform.xml13
-rw-r--r--erts/doc/src/alt_dist.xml2
-rw-r--r--erts/doc/src/book.xml2
-rw-r--r--erts/doc/src/communication.xml2
-rw-r--r--erts/doc/src/crash_dump.xml2
-rw-r--r--erts/doc/src/driver.xml2
-rw-r--r--erts/doc/src/epmd.xml2
-rw-r--r--erts/doc/src/erl.xml26
-rw-r--r--erts/doc/src/erl_dist_protocol.xml4
-rw-r--r--erts/doc/src/erl_driver.xml2
-rw-r--r--erts/doc/src/erl_nif.xml317
-rw-r--r--erts/doc/src/erl_prim_loader.xml2
-rw-r--r--erts/doc/src/erl_tracer.xml668
-rw-r--r--erts/doc/src/erlang.xml482
-rw-r--r--erts/doc/src/erlc.xml2
-rw-r--r--erts/doc/src/erlsrv.xml2
-rw-r--r--erts/doc/src/erts_alloc.xml20
-rw-r--r--erts/doc/src/inet_cfg.xml2
-rw-r--r--erts/doc/src/init.xml2
-rw-r--r--erts/doc/src/match_spec.xml54
-rw-r--r--erts/doc/src/notes.xml67
-rw-r--r--erts/doc/src/notes_history.xml2
-rw-r--r--erts/doc/src/part.xml2
-rw-r--r--erts/doc/src/part_notes.xml2
-rw-r--r--erts/doc/src/part_notes_history.xml2
-rw-r--r--erts/doc/src/ref_man.xml3
-rw-r--r--erts/doc/src/run_erl.xml2
-rw-r--r--erts/doc/src/specs.xml1
-rw-r--r--erts/doc/src/start.xml2
-rw-r--r--erts/doc/src/start_erl.xml2
-rw-r--r--erts/doc/src/tty.xml2
-rw-r--r--erts/doc/src/werl.xml2
-rw-r--r--erts/doc/src/zlib.xml2
-rw-r--r--erts/emulator/Makefile2
-rw-r--r--erts/emulator/Makefile.in26
-rw-r--r--erts/emulator/beam/atom.c2
-rw-r--r--erts/emulator/beam/atom.h2
-rw-r--r--erts/emulator/beam/atom.names23
-rw-r--r--erts/emulator/beam/beam_bif_load.c92
-rw-r--r--erts/emulator/beam/beam_bp.c177
-rw-r--r--erts/emulator/beam/beam_bp.h30
-rw-r--r--erts/emulator/beam/beam_catches.c2
-rw-r--r--erts/emulator/beam/beam_catches.h2
-rw-r--r--erts/emulator/beam/beam_debug.c4
-rw-r--r--erts/emulator/beam/beam_emu.c177
-rw-r--r--erts/emulator/beam/beam_load.c284
-rw-r--r--erts/emulator/beam/beam_load.h3
-rw-r--r--erts/emulator/beam/beam_ranges.c2
-rw-r--r--erts/emulator/beam/benchmark.c2
-rw-r--r--erts/emulator/beam/benchmark.h2
-rw-r--r--erts/emulator/beam/bif.c164
-rw-r--r--erts/emulator/beam/bif.h3
-rw-r--r--erts/emulator/beam/bif.tab9
-rw-r--r--erts/emulator/beam/big.c2
-rw-r--r--erts/emulator/beam/big.h2
-rw-r--r--erts/emulator/beam/binary.c2
-rw-r--r--erts/emulator/beam/break.c12
-rw-r--r--erts/emulator/beam/code_ix.c3
-rw-r--r--erts/emulator/beam/code_ix.h2
-rw-r--r--erts/emulator/beam/copy.c2
-rw-r--r--erts/emulator/beam/dist.c34
-rw-r--r--erts/emulator/beam/dist.h6
-rw-r--r--erts/emulator/beam/dtrace-wrapper.h2
-rw-r--r--erts/emulator/beam/elib_memmove.c2
-rw-r--r--erts/emulator/beam/erl_afit_alloc.c2
-rw-r--r--erts/emulator/beam/erl_afit_alloc.h2
-rw-r--r--erts/emulator/beam/erl_alloc.c94
-rw-r--r--erts/emulator/beam/erl_alloc.h10
-rw-r--r--erts/emulator/beam/erl_alloc.types24
-rw-r--r--erts/emulator/beam/erl_alloc_util.c132
-rw-r--r--erts/emulator/beam/erl_alloc_util.h39
-rw-r--r--erts/emulator/beam/erl_ao_firstfit_alloc.c2
-rw-r--r--erts/emulator/beam/erl_ao_firstfit_alloc.h2
-rw-r--r--erts/emulator/beam/erl_arith.c2
-rw-r--r--erts/emulator/beam/erl_async.c18
-rw-r--r--erts/emulator/beam/erl_async.h2
-rw-r--r--erts/emulator/beam/erl_bestfit_alloc.c2
-rw-r--r--erts/emulator/beam/erl_bestfit_alloc.h2
-rw-r--r--erts/emulator/beam/erl_bif_binary.c2
-rw-r--r--erts/emulator/beam/erl_bif_chksum.c2
-rw-r--r--erts/emulator/beam/erl_bif_ddll.c6
-rw-r--r--erts/emulator/beam/erl_bif_guard.c2
-rw-r--r--erts/emulator/beam/erl_bif_info.c23
-rw-r--r--erts/emulator/beam/erl_bif_lists.c95
-rw-r--r--erts/emulator/beam/erl_bif_op.c2
-rw-r--r--erts/emulator/beam/erl_bif_os.c2
-rw-r--r--erts/emulator/beam/erl_bif_port.c31
-rw-r--r--erts/emulator/beam/erl_bif_re.c2
-rw-r--r--erts/emulator/beam/erl_bif_trace.c602
-rw-r--r--erts/emulator/beam/erl_bif_unique.c22
-rw-r--r--erts/emulator/beam/erl_bif_unique.h14
-rw-r--r--erts/emulator/beam/erl_binary.h2
-rw-r--r--erts/emulator/beam/erl_bits.c2
-rw-r--r--erts/emulator/beam/erl_bits.h2
-rw-r--r--erts/emulator/beam/erl_cpu_topology.c2
-rw-r--r--erts/emulator/beam/erl_cpu_topology.h2
-rw-r--r--erts/emulator/beam/erl_db.c2
-rw-r--r--erts/emulator/beam/erl_db.h2
-rw-r--r--erts/emulator/beam/erl_db_hash.c2
-rw-r--r--erts/emulator/beam/erl_db_hash.h2
-rw-r--r--erts/emulator/beam/erl_db_tree.c2
-rw-r--r--erts/emulator/beam/erl_db_tree.h2
-rw-r--r--erts/emulator/beam/erl_db_util.c76
-rw-r--r--erts/emulator/beam/erl_db_util.h2
-rw-r--r--erts/emulator/beam/erl_debug.c2
-rw-r--r--erts/emulator/beam/erl_driver.h2
-rw-r--r--erts/emulator/beam/erl_drv_nif.h2
-rw-r--r--erts/emulator/beam/erl_drv_thread.c2
-rw-r--r--erts/emulator/beam/erl_fun.c2
-rw-r--r--erts/emulator/beam/erl_fun.h2
-rw-r--r--erts/emulator/beam/erl_gc.c129
-rw-r--r--erts/emulator/beam/erl_gc.h4
-rw-r--r--erts/emulator/beam/erl_goodfit_alloc.c2
-rw-r--r--erts/emulator/beam/erl_goodfit_alloc.h2
-rw-r--r--erts/emulator/beam/erl_hl_timer.c8
-rw-r--r--erts/emulator/beam/erl_init.c61
-rw-r--r--erts/emulator/beam/erl_instrument.c2
-rw-r--r--erts/emulator/beam/erl_instrument.h2
-rw-r--r--erts/emulator/beam/erl_lock_check.c7
-rw-r--r--erts/emulator/beam/erl_lock_check.h2
-rw-r--r--erts/emulator/beam/erl_lock_count.c2
-rw-r--r--erts/emulator/beam/erl_lock_count.h2
-rw-r--r--erts/emulator/beam/erl_map.c91
-rw-r--r--erts/emulator/beam/erl_map.h5
-rw-r--r--erts/emulator/beam/erl_math.c2
-rw-r--r--erts/emulator/beam/erl_message.c183
-rw-r--r--erts/emulator/beam/erl_message.h112
-rw-r--r--erts/emulator/beam/erl_monitors.c2
-rw-r--r--erts/emulator/beam/erl_monitors.h2
-rw-r--r--erts/emulator/beam/erl_msacc.c2
-rw-r--r--erts/emulator/beam/erl_mtrace.c2
-rw-r--r--erts/emulator/beam/erl_mtrace.h2
-rw-r--r--erts/emulator/beam/erl_nif.c667
-rw-r--r--erts/emulator/beam/erl_nif.h28
-rw-r--r--erts/emulator/beam/erl_nif_api_funcs.h20
-rw-r--r--erts/emulator/beam/erl_node_container_utils.h2
-rw-r--r--erts/emulator/beam/erl_node_tables.c30
-rw-r--r--erts/emulator/beam/erl_node_tables.h4
-rw-r--r--erts/emulator/beam/erl_port.h53
-rw-r--r--erts/emulator/beam/erl_port_task.c51
-rw-r--r--erts/emulator/beam/erl_port_task.h4
-rw-r--r--erts/emulator/beam/erl_printf_term.c2
-rw-r--r--erts/emulator/beam/erl_printf_term.h2
-rw-r--r--erts/emulator/beam/erl_process.c522
-rw-r--r--erts/emulator/beam/erl_process.h140
-rw-r--r--erts/emulator/beam/erl_process_dict.c2
-rw-r--r--erts/emulator/beam/erl_process_dict.h2
-rw-r--r--erts/emulator/beam/erl_process_dump.c4
-rw-r--r--erts/emulator/beam/erl_process_lock.c193
-rw-r--r--erts/emulator/beam/erl_process_lock.h40
-rw-r--r--erts/emulator/beam/erl_ptab.c2
-rw-r--r--erts/emulator/beam/erl_ptab.h10
-rw-r--r--erts/emulator/beam/erl_sched_spec_pre_alloc.c2
-rw-r--r--erts/emulator/beam/erl_sched_spec_pre_alloc.h2
-rw-r--r--erts/emulator/beam/erl_smp.h2
-rw-r--r--erts/emulator/beam/erl_sock.h2
-rw-r--r--erts/emulator/beam/erl_sys_driver.h2
-rw-r--r--erts/emulator/beam/erl_term.c92
-rw-r--r--erts/emulator/beam/erl_term.h93
-rw-r--r--erts/emulator/beam/erl_thr_progress.c2
-rw-r--r--erts/emulator/beam/erl_thr_progress.h2
-rw-r--r--erts/emulator/beam/erl_thr_queue.c34
-rw-r--r--erts/emulator/beam/erl_thr_queue.h6
-rw-r--r--erts/emulator/beam/erl_threads.h2
-rw-r--r--erts/emulator/beam/erl_time.h2
-rw-r--r--erts/emulator/beam/erl_time_sup.c4
-rw-r--r--erts/emulator/beam/erl_trace.c3039
-rw-r--r--erts/emulator/beam/erl_trace.h92
-rw-r--r--erts/emulator/beam/erl_unicode.c2
-rw-r--r--erts/emulator/beam/erl_unicode.h2
-rw-r--r--erts/emulator/beam/erl_unicode_normalize.h2
-rw-r--r--erts/emulator/beam/erl_utils.h2
-rw-r--r--erts/emulator/beam/erl_vm.h3
-rw-r--r--erts/emulator/beam/erl_zlib.c2
-rw-r--r--erts/emulator/beam/erl_zlib.h2
-rw-r--r--erts/emulator/beam/erlang_dtrace.d31
-rw-r--r--erts/emulator/beam/erlang_lttng.c32
-rw-r--r--erts/emulator/beam/erlang_lttng.h424
-rw-r--r--erts/emulator/beam/error.h2
-rw-r--r--erts/emulator/beam/export.c2
-rw-r--r--erts/emulator/beam/export.h2
-rw-r--r--erts/emulator/beam/external.c227
-rw-r--r--erts/emulator/beam/external.h9
-rw-r--r--erts/emulator/beam/global.h32
-rw-r--r--erts/emulator/beam/hash.c2
-rw-r--r--erts/emulator/beam/hash.h2
-rw-r--r--erts/emulator/beam/index.c2
-rw-r--r--erts/emulator/beam/index.h2
-rw-r--r--erts/emulator/beam/io.c604
-rw-r--r--erts/emulator/beam/lttng-wrapper.h107
-rw-r--r--erts/emulator/beam/module.c2
-rw-r--r--erts/emulator/beam/module.h2
-rw-r--r--erts/emulator/beam/ops.tab35
-rw-r--r--erts/emulator/beam/packet_parser.c2
-rw-r--r--erts/emulator/beam/packet_parser.h2
-rw-r--r--erts/emulator/beam/register.c16
-rw-r--r--erts/emulator/beam/register.h2
-rw-r--r--erts/emulator/beam/safe_hash.c2
-rw-r--r--erts/emulator/beam/safe_hash.h2
-rw-r--r--erts/emulator/beam/sys.h17
-rw-r--r--erts/emulator/beam/time.c2
-rw-r--r--erts/emulator/beam/utils.c39
-rw-r--r--erts/emulator/beam/version.h2
-rw-r--r--erts/emulator/drivers/common/efile_drv.c14
-rw-r--r--erts/emulator/drivers/common/erl_efile.h8
-rw-r--r--erts/emulator/drivers/common/gzio.h2
-rw-r--r--erts/emulator/drivers/common/gzio_zutil.h2
-rw-r--r--erts/emulator/drivers/common/inet_drv.c2
-rw-r--r--erts/emulator/drivers/common/ram_file_drv.c2
-rw-r--r--erts/emulator/drivers/common/zlib_drv.c2
-rw-r--r--erts/emulator/drivers/unix/bin_drv.c2
-rw-r--r--erts/emulator/drivers/unix/multi_drv.c2
-rw-r--r--erts/emulator/drivers/unix/sig_drv.c2
-rw-r--r--erts/emulator/drivers/unix/ttsl_drv.c7
-rw-r--r--erts/emulator/drivers/unix/unix_efile.c23
-rw-r--r--erts/emulator/drivers/vxworks/vxworks_resolv.c2
-rw-r--r--erts/emulator/drivers/win32/registry_drv.c2
-rw-r--r--erts/emulator/drivers/win32/ttsl_drv.c2
-rw-r--r--erts/emulator/drivers/win32/win_con.c2
-rw-r--r--erts/emulator/drivers/win32/win_con.h2
-rw-r--r--erts/emulator/drivers/win32/win_efile.c2
-rw-r--r--erts/emulator/hipe/TODO2
-rw-r--r--erts/emulator/hipe/elf64ppc.x2
-rw-r--r--erts/emulator/hipe/hipe_amd64.c118
-rw-r--r--erts/emulator/hipe/hipe_amd64.h2
-rw-r--r--erts/emulator/hipe/hipe_amd64.tab2
-rw-r--r--erts/emulator/hipe/hipe_amd64_asm.m42
-rw-r--r--erts/emulator/hipe/hipe_amd64_bifs.m42
-rw-r--r--erts/emulator/hipe/hipe_amd64_gc.h2
-rw-r--r--erts/emulator/hipe/hipe_amd64_glue.S2
-rw-r--r--erts/emulator/hipe/hipe_amd64_glue.h2
-rw-r--r--erts/emulator/hipe/hipe_amd64_primops.h2
-rw-r--r--erts/emulator/hipe/hipe_arch.h2
-rw-r--r--erts/emulator/hipe/hipe_arm.c2
-rw-r--r--erts/emulator/hipe/hipe_arm.h2
-rw-r--r--erts/emulator/hipe/hipe_arm.tab2
-rw-r--r--erts/emulator/hipe/hipe_arm_asm.m42
-rw-r--r--erts/emulator/hipe/hipe_arm_bifs.m42
-rw-r--r--erts/emulator/hipe/hipe_arm_gc.h2
-rw-r--r--erts/emulator/hipe/hipe_arm_glue.S2
-rw-r--r--erts/emulator/hipe/hipe_arm_glue.h2
-rw-r--r--erts/emulator/hipe/hipe_arm_primops.h2
-rw-r--r--erts/emulator/hipe/hipe_bif0.c2
-rw-r--r--erts/emulator/hipe/hipe_bif0.h2
-rw-r--r--erts/emulator/hipe/hipe_bif0.tab2
-rw-r--r--erts/emulator/hipe/hipe_bif1.c2
-rw-r--r--erts/emulator/hipe/hipe_bif1.h2
-rw-r--r--erts/emulator/hipe/hipe_bif1.tab2
-rw-r--r--erts/emulator/hipe/hipe_bif2.c2
-rw-r--r--erts/emulator/hipe/hipe_bif2.tab2
-rw-r--r--erts/emulator/hipe/hipe_bif64.c2
-rw-r--r--erts/emulator/hipe/hipe_bif64.h2
-rw-r--r--erts/emulator/hipe/hipe_bif64.tab2
-rw-r--r--erts/emulator/hipe/hipe_bif_list.m42
-rw-r--r--erts/emulator/hipe/hipe_debug.c4
-rw-r--r--erts/emulator/hipe/hipe_debug.h2
-rw-r--r--erts/emulator/hipe/hipe_gbif_list.h2
-rw-r--r--erts/emulator/hipe/hipe_gc.c2
-rw-r--r--erts/emulator/hipe/hipe_gc.h2
-rw-r--r--erts/emulator/hipe/hipe_mkliterals.c2
-rw-r--r--erts/emulator/hipe/hipe_mode_switch.c104
-rw-r--r--erts/emulator/hipe/hipe_mode_switch.h2
-rw-r--r--erts/emulator/hipe/hipe_native_bif.c2
-rw-r--r--erts/emulator/hipe/hipe_native_bif.h2
-rw-r--r--erts/emulator/hipe/hipe_ops.tab2
-rw-r--r--erts/emulator/hipe/hipe_ppc.c2
-rw-r--r--erts/emulator/hipe/hipe_ppc.h2
-rw-r--r--erts/emulator/hipe/hipe_ppc.tab2
-rw-r--r--erts/emulator/hipe/hipe_ppc64.tab2
-rw-r--r--erts/emulator/hipe/hipe_ppc_asm.m42
-rw-r--r--erts/emulator/hipe/hipe_ppc_bifs.m42
-rw-r--r--erts/emulator/hipe/hipe_ppc_gc.h2
-rw-r--r--erts/emulator/hipe/hipe_ppc_glue.S2
-rw-r--r--erts/emulator/hipe/hipe_ppc_glue.h2
-rw-r--r--erts/emulator/hipe/hipe_ppc_primops.h2
-rw-r--r--erts/emulator/hipe/hipe_primops.h2
-rw-r--r--erts/emulator/hipe/hipe_process.h2
-rw-r--r--erts/emulator/hipe/hipe_risc_gc.h2
-rw-r--r--erts/emulator/hipe/hipe_risc_glue.h2
-rw-r--r--erts/emulator/hipe/hipe_risc_stack.c2
-rw-r--r--erts/emulator/hipe/hipe_signal.h2
-rw-r--r--erts/emulator/hipe/hipe_sparc.c2
-rw-r--r--erts/emulator/hipe/hipe_sparc.h2
-rw-r--r--erts/emulator/hipe/hipe_sparc.tab2
-rw-r--r--erts/emulator/hipe/hipe_sparc_asm.m42
-rw-r--r--erts/emulator/hipe/hipe_sparc_bifs.m42
-rw-r--r--erts/emulator/hipe/hipe_sparc_gc.h2
-rw-r--r--erts/emulator/hipe/hipe_sparc_glue.S2
-rw-r--r--erts/emulator/hipe/hipe_sparc_glue.h2
-rw-r--r--erts/emulator/hipe/hipe_sparc_primops.h2
-rw-r--r--erts/emulator/hipe/hipe_stack.c2
-rw-r--r--erts/emulator/hipe/hipe_stack.h2
-rw-r--r--erts/emulator/hipe/hipe_x86.c2
-rw-r--r--erts/emulator/hipe/hipe_x86.h2
-rw-r--r--erts/emulator/hipe/hipe_x86.tab2
-rw-r--r--erts/emulator/hipe/hipe_x86_abi.txt2
-rw-r--r--erts/emulator/hipe/hipe_x86_asm.m42
-rw-r--r--erts/emulator/hipe/hipe_x86_bifs.m42
-rw-r--r--erts/emulator/hipe/hipe_x86_gc.h2
-rw-r--r--erts/emulator/hipe/hipe_x86_glue.S2
-rw-r--r--erts/emulator/hipe/hipe_x86_glue.h2
-rw-r--r--erts/emulator/hipe/hipe_x86_primops.h2
-rw-r--r--erts/emulator/hipe/hipe_x86_signal.c2
-rw-r--r--erts/emulator/hipe/hipe_x86_stack.c2
-rw-r--r--erts/emulator/internal_doc/dec.erl2
-rw-r--r--erts/emulator/internal_doc/erl_ext_dist.txt2
-rw-r--r--erts/emulator/nifs/common/erl_tracer_nif.c257
-rw-r--r--erts/emulator/pcre/pcre.mk2
-rw-r--r--erts/emulator/sys/common/erl_check_io.c5
-rw-r--r--erts/emulator/sys/common/erl_check_io.h2
-rw-r--r--erts/emulator/sys/common/erl_mmap.c117
-rw-r--r--erts/emulator/sys/common/erl_mmap.h22
-rw-r--r--erts/emulator/sys/common/erl_mseg.c13
-rw-r--r--erts/emulator/sys/common/erl_mseg.h6
-rw-r--r--erts/emulator/sys/common/erl_mtrace_sys_wrap.c2
-rw-r--r--erts/emulator/sys/common/erl_os_monotonic_time_extender.c2
-rw-r--r--erts/emulator/sys/common/erl_poll.c2
-rw-r--r--erts/emulator/sys/common/erl_poll.h2
-rw-r--r--erts/emulator/sys/common/erl_sys_common_misc.c2
-rw-r--r--erts/emulator/sys/common/erl_util_queue.h2
-rw-r--r--erts/emulator/sys/unix/driver_int.h2
-rw-r--r--erts/emulator/sys/unix/erl_child_setup.c2
-rw-r--r--erts/emulator/sys/unix/erl_main.c2
-rw-r--r--erts/emulator/sys/unix/erl_unix_sys.h3
-rw-r--r--erts/emulator/sys/unix/erl_unix_sys_ddll.c2
-rw-r--r--erts/emulator/sys/unix/sys.c22
-rw-r--r--erts/emulator/sys/unix/sys_drivers.c2
-rw-r--r--erts/emulator/sys/unix/sys_float.c86
-rw-r--r--erts/emulator/sys/unix/sys_time.c2
-rw-r--r--erts/emulator/sys/unix/sys_uds.c2
-rw-r--r--erts/emulator/sys/unix/sys_uds.h2
-rw-r--r--erts/emulator/sys/win32/dosmap.c2
-rw-r--r--erts/emulator/sys/win32/driver_int.h2
-rw-r--r--erts/emulator/sys/win32/erl_main.c2
-rw-r--r--erts/emulator/sys/win32/erl_poll.c2
-rw-r--r--erts/emulator/sys/win32/erl_win32_sys_ddll.c2
-rw-r--r--erts/emulator/sys/win32/erl_win_dyn_driver.h2
-rw-r--r--erts/emulator/sys/win32/erl_win_sys.h2
-rw-r--r--erts/emulator/sys/win32/sys.c5
-rw-r--r--erts/emulator/sys/win32/sys_env.c2
-rw-r--r--erts/emulator/sys/win32/sys_float.c5
-rw-r--r--erts/emulator/sys/win32/sys_interrupt.c2
-rw-r--r--erts/emulator/sys/win32/sys_time.c2
-rw-r--r--erts/emulator/test/Makefile6
-rw-r--r--erts/emulator/test/a_SUITE.erl2
-rw-r--r--erts/emulator/test/after_SUITE.erl2
-rw-r--r--erts/emulator/test/alloc_SUITE.erl53
-rw-r--r--erts/emulator/test/alloc_SUITE_data/cpool.c2
-rw-r--r--erts/emulator/test/alloc_SUITE_data/migration.c2
-rw-r--r--erts/emulator/test/beam_SUITE.erl124
-rw-r--r--erts/emulator/test/beam_literals_SUITE.erl2
-rw-r--r--erts/emulator/test/bif_SUITE.erl2
-rw-r--r--erts/emulator/test/big_SUITE.erl2
-rw-r--r--erts/emulator/test/big_SUITE_data/literal_test.erl2
-rw-r--r--erts/emulator/test/binary_SUITE.erl2
-rw-r--r--erts/emulator/test/bs_bincomp_SUITE.erl2
-rw-r--r--erts/emulator/test/bs_bit_binaries_SUITE.erl2
-rw-r--r--erts/emulator/test/bs_construct_SUITE.erl2
-rw-r--r--erts/emulator/test/bs_match_bin_SUITE.erl2
-rw-r--r--erts/emulator/test/bs_match_int_SUITE.erl2
-rw-r--r--erts/emulator/test/bs_match_misc_SUITE.erl2
-rw-r--r--erts/emulator/test/bs_match_tail_SUITE.erl2
-rw-r--r--erts/emulator/test/bs_utf_SUITE.erl2
-rw-r--r--erts/emulator/test/busy_port_SUITE.erl2
-rw-r--r--erts/emulator/test/busy_port_SUITE_data/Makefile.src2
-rw-r--r--erts/emulator/test/busy_port_SUITE_data/hard_busy_drv.c2
-rw-r--r--erts/emulator/test/busy_port_SUITE_data/hs_busy_drv.c2
-rw-r--r--erts/emulator/test/busy_port_SUITE_data/scheduling_drv.c2
-rw-r--r--erts/emulator/test/busy_port_SUITE_data/soft_busy_drv.c2
-rw-r--r--erts/emulator/test/call_trace_SUITE.erl68
-rw-r--r--erts/emulator/test/code_SUITE.erl2
-rw-r--r--erts/emulator/test/code_SUITE_data/another_code_test.erl2
-rw-r--r--erts/emulator/test/code_SUITE_data/cpbugx.erl2
-rw-r--r--erts/emulator/test/code_SUITE_data/fun_confusion.erl2
-rw-r--r--erts/emulator/test/code_SUITE_data/literals.erl2
-rw-r--r--erts/emulator/test/code_SUITE_data/many_funs.erl2
-rw-r--r--erts/emulator/test/code_SUITE_data/my_code_test.erl2
-rw-r--r--erts/emulator/test/code_SUITE_data/versions.erl2
-rw-r--r--erts/emulator/test/code_parallel_load_SUITE.erl2
-rw-r--r--erts/emulator/test/crypto_SUITE.erl2
-rw-r--r--erts/emulator/test/crypto_reference.erl2
-rw-r--r--erts/emulator/test/ddll_SUITE.erl2
-rw-r--r--erts/emulator/test/decode_packet_SUITE.erl2
-rw-r--r--erts/emulator/test/dgawd_handler.erl2
-rw-r--r--erts/emulator/test/distribution_SUITE.erl3
-rw-r--r--erts/emulator/test/distribution_SUITE_data/run.erl2
-rw-r--r--erts/emulator/test/driver_SUITE.erl2
-rw-r--r--erts/emulator/test/driver_SUITE_data/async_blast_drv.c2
-rw-r--r--erts/emulator/test/driver_SUITE_data/consume_timeslice_drv.c2
-rw-r--r--erts/emulator/test/driver_SUITE_data/ioq_exit_drv.c2
-rw-r--r--erts/emulator/test/driver_SUITE_data/otp_9302_drv.c2
-rw-r--r--erts/emulator/test/driver_SUITE_data/thr_free_drv.c2
-rw-r--r--erts/emulator/test/driver_SUITE_data/thr_msg_blast_drv.c2
-rw-r--r--erts/emulator/test/efile_SUITE.erl2
-rw-r--r--erts/emulator/test/erl_drv_thread_SUITE.erl4
-rw-r--r--erts/emulator/test/erl_link_SUITE.erl2
-rw-r--r--erts/emulator/test/erts_debug_SUITE.erl2
-rw-r--r--erts/emulator/test/estone_SUITE.erl2
-rw-r--r--erts/emulator/test/evil_SUITE.erl2
-rw-r--r--erts/emulator/test/exception_SUITE.erl2
-rw-r--r--erts/emulator/test/float_SUITE.erl2
-rw-r--r--erts/emulator/test/float_SUITE_data/has_fpe_bug.erl2
-rw-r--r--erts/emulator/test/fun_SUITE.erl2
-rw-r--r--erts/emulator/test/fun_r13_SUITE.erl2
-rw-r--r--erts/emulator/test/gc_SUITE.erl2
-rw-r--r--erts/emulator/test/guard_SUITE.erl2
-rw-r--r--erts/emulator/test/hash_SUITE.erl2
-rw-r--r--erts/emulator/test/hibernate_SUITE.erl2
-rw-r--r--erts/emulator/test/ignore_cores.erl4
-rw-r--r--erts/emulator/test/list_bif_SUITE.erl2
-rw-r--r--erts/emulator/test/long_timers_test.erl2
-rw-r--r--erts/emulator/test/lttng_SUITE.erl499
-rw-r--r--erts/emulator/test/lttng_SUITE_data/Makefile.src7
-rw-r--r--erts/emulator/test/lttng_SUITE_data/caller_drv.c159
-rw-r--r--erts/emulator/test/map_SUITE.erl74
-rw-r--r--erts/emulator/test/match_spec_SUITE.erl97
-rw-r--r--erts/emulator/test/message_queue_data_SUITE.erl34
-rw-r--r--erts/emulator/test/module_info_SUITE.erl2
-rw-r--r--erts/emulator/test/monitor_SUITE.erl2
-rw-r--r--erts/emulator/test/mtx_SUITE.erl2
-rw-r--r--erts/emulator/test/mtx_SUITE_data/Makefile.src2
-rw-r--r--erts/emulator/test/mtx_SUITE_data/mtx_SUITE.c2
-rw-r--r--erts/emulator/test/multi_load_SUITE.erl31
-rw-r--r--erts/emulator/test/nested_SUITE.erl2
-rw-r--r--erts/emulator/test/nif_SUITE.erl176
-rw-r--r--erts/emulator/test/nif_SUITE_data/Makefile.src3
-rw-r--r--erts/emulator/test/nif_SUITE_data/echo_drv.c62
-rw-r--r--erts/emulator/test/nif_SUITE_data/nif_SUITE.c145
-rw-r--r--erts/emulator/test/nif_SUITE_data/nif_mod.c2
-rw-r--r--erts/emulator/test/nif_SUITE_data/nif_mod.erl2
-rw-r--r--erts/emulator/test/node_container_SUITE.erl138
-rw-r--r--erts/emulator/test/nofrag_SUITE.erl2
-rw-r--r--erts/emulator/test/num_bif_SUITE.erl2
-rw-r--r--erts/emulator/test/old_mod.erl2
-rw-r--r--erts/emulator/test/old_scheduler_SUITE.erl2
-rw-r--r--erts/emulator/test/op_SUITE.erl17
-rw-r--r--erts/emulator/test/port_SUITE.erl35
-rw-r--r--erts/emulator/test/port_SUITE_data/dead_port.c2
-rw-r--r--erts/emulator/test/port_SUITE_data/port_test.erl2
-rw-r--r--erts/emulator/test/port_bif_SUITE.erl2
-rw-r--r--erts/emulator/test/port_trace_SUITE.erl614
-rw-r--r--erts/emulator/test/port_trace_SUITE_data/Makefile.src3
-rw-r--r--erts/emulator/test/port_trace_SUITE_data/echo_drv.c241
-rw-r--r--erts/emulator/test/process_SUITE.erl4
-rw-r--r--erts/emulator/test/pseudoknot_SUITE.erl2
-rw-r--r--erts/emulator/test/random_iolist.erl2
-rw-r--r--erts/emulator/test/receive_SUITE.erl2
-rw-r--r--erts/emulator/test/ref_SUITE.erl2
-rw-r--r--erts/emulator/test/register_SUITE.erl2
-rw-r--r--erts/emulator/test/save_calls_SUITE.erl19
-rw-r--r--erts/emulator/test/scheduler_SUITE.erl6
-rw-r--r--erts/emulator/test/scheduler_SUITE_data/scheduler_SUITE.c6
-rw-r--r--erts/emulator/test/send_term_SUITE.erl2
-rw-r--r--erts/emulator/test/sensitive_SUITE.erl4
-rw-r--r--erts/emulator/test/signal_SUITE.erl2
-rw-r--r--erts/emulator/test/smoke_test_SUITE.erl2
-rw-r--r--erts/emulator/test/statistics_SUITE.erl2
-rw-r--r--erts/emulator/test/system_info_SUITE.erl2
-rw-r--r--erts/emulator/test/system_profile_SUITE.erl34
-rw-r--r--erts/emulator/test/time_SUITE.erl2
-rw-r--r--erts/emulator/test/timer_bif_SUITE.erl2
-rw-r--r--erts/emulator/test/trace_SUITE.erl279
-rw-r--r--erts/emulator/test/trace_bif_SUITE.erl11
-rw-r--r--erts/emulator/test/trace_call_count_SUITE.erl2
-rw-r--r--erts/emulator/test/trace_call_time_SUITE.erl2
-rw-r--r--erts/emulator/test/trace_local_SUITE.erl26
-rw-r--r--erts/emulator/test/trace_local_SUITE_data/trace_local_dummy.erl2
-rw-r--r--erts/emulator/test/trace_meta_SUITE.erl2
-rw-r--r--erts/emulator/test/trace_nif_SUITE.erl2
-rw-r--r--erts/emulator/test/trace_port_SUITE.erl177
-rw-r--r--erts/emulator/test/tracer_SUITE.erl627
-rw-r--r--erts/emulator/test/tracer_SUITE_data/Makefile.src8
-rw-r--r--erts/emulator/test/tracer_SUITE_data/tracer_test.c122
-rw-r--r--erts/emulator/test/tracer_test.erl55
-rw-r--r--erts/emulator/test/tuple_SUITE.erl2
-rw-r--r--erts/emulator/test/unique_SUITE.erl2
-rw-r--r--erts/emulator/test/z_SUITE.erl2
-rwxr-xr-xerts/emulator/utils/beam_makeops332
-rwxr-xr-xerts/emulator/utils/beam_strip2
-rwxr-xr-xerts/emulator/utils/count2
-rw-r--r--erts/emulator/utils/loaded2
-rwxr-xr-xerts/emulator/utils/make_alloc_types2
-rwxr-xr-xerts/emulator/utils/make_compiler_flags2
-rwxr-xr-xerts/emulator/utils/make_driver_tab15
-rwxr-xr-xerts/emulator/utils/make_preload2
-rwxr-xr-xerts/emulator/utils/make_tables2
-rwxr-xr-xerts/emulator/utils/make_version2
-rw-r--r--erts/emulator/utils/mkver.c2
-rw-r--r--erts/emulator/zlib/zlib.mk2
-rw-r--r--erts/epmd/Makefile2
-rw-r--r--erts/epmd/epmd.mk2
-rw-r--r--erts/epmd/src/Makefile2
-rw-r--r--erts/epmd/src/Makefile.in2
-rw-r--r--erts/epmd/src/epmd.c8
-rw-r--r--erts/epmd/src/epmd.h2
-rw-r--r--erts/epmd/src/epmd_cli.c2
-rw-r--r--erts/epmd/src/epmd_int.h6
-rw-r--r--erts/epmd/src/epmd_srv.c10
-rw-r--r--erts/epmd/test/Makefile2
-rw-r--r--erts/epmd/test/epmd_SUITE.erl2
-rw-r--r--erts/etc/Makefile2
-rw-r--r--erts/etc/common/Makefile2
-rw-r--r--erts/etc/common/Makefile.in2
-rw-r--r--erts/etc/common/ct_run.c26
-rw-r--r--erts/etc/common/dialyzer.c26
-rw-r--r--erts/etc/common/erlc.c26
-rw-r--r--erts/etc/common/erlexec.c27
-rw-r--r--erts/etc/common/escript.c26
-rw-r--r--erts/etc/common/heart.c2
-rw-r--r--erts/etc/common/inet_gethost.c4
-rw-r--r--erts/etc/common/typer.c26
-rw-r--r--erts/etc/unix/Install.src2
-rw-r--r--erts/etc/unix/Makefile2
-rw-r--r--erts/etc/unix/README2
-rw-r--r--erts/etc/unix/RELNOTES2
-rw-r--r--erts/etc/unix/cerl.src2
-rw-r--r--erts/etc/unix/dyn_erl.c2
-rw-r--r--erts/etc/unix/erl.src.src2
-rw-r--r--erts/etc/unix/etp-commands.in4
-rw-r--r--erts/etc/unix/etp-thr.py2
-rw-r--r--erts/etc/unix/etp_commands.erl2
-rw-r--r--erts/etc/unix/etp_commands.mk2
-rw-r--r--erts/etc/unix/format_man_pages2
-rw-r--r--erts/etc/unix/run_erl.c11
-rw-r--r--erts/etc/unix/run_erl.h2
-rw-r--r--erts/etc/unix/safe_string.c2
-rw-r--r--erts/etc/unix/safe_string.h2
-rw-r--r--erts/etc/unix/setuid_socket_wrap.c2
-rw-r--r--erts/etc/unix/start.src2
-rw-r--r--erts/etc/unix/start_erl.src2
-rw-r--r--erts/etc/win32/Install.c2
-rw-r--r--erts/etc/win32/Makefile2
-rw-r--r--erts/etc/win32/Nmakefile.start_erl2
-rw-r--r--erts/etc/win32/beam.rc2
-rwxr-xr-xerts/etc/win32/cygwin_tools/erl2
-rwxr-xr-xerts/etc/win32/cygwin_tools/erlc2
-rwxr-xr-xerts/etc/win32/cygwin_tools/javac.sh2
-rwxr-xr-xerts/etc/win32/cygwin_tools/make_bootstrap_ini.sh2
-rwxr-xr-xerts/etc/win32/cygwin_tools/make_local_ini.sh2
-rwxr-xr-xerts/etc/win32/cygwin_tools/mingw/ar.sh2
-rwxr-xr-xerts/etc/win32/cygwin_tools/mingw/cc.sh2
-rw-r--r--erts/etc/win32/cygwin_tools/mingw/coffix.c2
-rwxr-xr-xerts/etc/win32/cygwin_tools/mingw/emu_cc.sh2
-rwxr-xr-xerts/etc/win32/cygwin_tools/mingw/ld.sh2
-rwxr-xr-xerts/etc/win32/cygwin_tools/mingw/mc.sh2
-rwxr-xr-xerts/etc/win32/cygwin_tools/mingw/rc.sh2
-rwxr-xr-xerts/etc/win32/cygwin_tools/vc/ar.sh2
-rwxr-xr-xerts/etc/win32/cygwin_tools/vc/cc.sh2
-rw-r--r--erts/etc/win32/cygwin_tools/vc/cc_wrap.c2
-rw-r--r--erts/etc/win32/cygwin_tools/vc/coffix.c2
-rwxr-xr-xerts/etc/win32/cygwin_tools/vc/emu_cc.sh2
-rwxr-xr-xerts/etc/win32/cygwin_tools/vc/ld.sh2
-rw-r--r--erts/etc/win32/cygwin_tools/vc/ld_wrap.c2
-rwxr-xr-xerts/etc/win32/cygwin_tools/vc/mc.sh2
-rwxr-xr-xerts/etc/win32/cygwin_tools/vc/rc.sh2
-rw-r--r--erts/etc/win32/erl.c2
-rw-r--r--erts/etc/win32/erl.rc2
-rw-r--r--erts/etc/win32/erl_log.c2
-rw-r--r--erts/etc/win32/erlsrv/erlsrv_global.h2
-rw-r--r--erts/etc/win32/erlsrv/erlsrv_interactive.c2
-rw-r--r--erts/etc/win32/erlsrv/erlsrv_interactive.h2
-rw-r--r--erts/etc/win32/erlsrv/erlsrv_main.c2
-rw-r--r--erts/etc/win32/erlsrv/erlsrv_registry.c2
-rw-r--r--erts/etc/win32/erlsrv/erlsrv_registry.h2
-rw-r--r--erts/etc/win32/erlsrv/erlsrv_service.c2
-rw-r--r--erts/etc/win32/erlsrv/erlsrv_service.h2
-rw-r--r--erts/etc/win32/erlsrv/erlsrv_util.c2
-rw-r--r--erts/etc/win32/erlsrv/erlsrv_util.h2
-rw-r--r--erts/etc/win32/init_file.c2
-rw-r--r--erts/etc/win32/init_file.h2
-rw-r--r--erts/etc/win32/msys_tools/erl2
-rw-r--r--erts/etc/win32/msys_tools/erlc2
-rw-r--r--erts/etc/win32/msys_tools/javac.sh2
-rw-r--r--erts/etc/win32/msys_tools/make_bootstrap_ini.sh2
-rw-r--r--erts/etc/win32/msys_tools/make_local_ini.sh2
-rw-r--r--erts/etc/win32/msys_tools/vc/ar.sh2
-rw-r--r--erts/etc/win32/msys_tools/vc/cc.sh2
-rw-r--r--erts/etc/win32/msys_tools/vc/coffix.c2
-rw-r--r--erts/etc/win32/msys_tools/vc/emu_cc.sh2
-rw-r--r--erts/etc/win32/msys_tools/vc/ld.sh2
-rw-r--r--erts/etc/win32/msys_tools/vc/mc.sh2
-rw-r--r--erts/etc/win32/msys_tools/vc/rc.sh2
-rw-r--r--erts/etc/win32/nsis/Makefile2
-rwxr-xr-xerts/etc/win32/nsis/dll_version_helper.sh2
-rw-r--r--erts/etc/win32/nsis/erlang20.nsi2
-rwxr-xr-xerts/etc/win32/nsis/find_redist.sh2
-rw-r--r--erts/etc/win32/port_entry.c2
-rw-r--r--erts/etc/win32/resource.h2
-rw-r--r--erts/etc/win32/start_erl.c2
-rw-r--r--erts/etc/win32/win_erlexec.c2
-rw-r--r--erts/example/Makefile2
-rw-r--r--erts/example/matrix_nif.c2
-rw-r--r--erts/example/matrix_nif.erl2
-rw-r--r--erts/example/next_perm.cc2
-rw-r--r--erts/example/next_perm.erl2
-rw-r--r--erts/example/pg_async.c2
-rw-r--r--erts/example/pg_async.erl2
-rw-r--r--erts/example/pg_async2.c2
-rw-r--r--erts/example/pg_async2.erl2
-rw-r--r--erts/example/pg_encode.c2
-rw-r--r--erts/example/pg_encode.h2
-rw-r--r--erts/example/pg_encode2.c2
-rw-r--r--erts/example/pg_encode2.h2
-rw-r--r--erts/example/pg_sync.c2
-rw-r--r--erts/example/pg_sync.erl2
-rw-r--r--erts/include/erl_fixed_size_int_types.h2
-rw-r--r--erts/include/erl_int_sizes_config.h.in2
-rw-r--r--erts/include/erl_memory_trace_parser.h2
-rw-r--r--erts/include/erl_native_features_config.h.in2
-rw-r--r--erts/include/internal/README2
-rw-r--r--erts/include/internal/erl_errno.h2
-rw-r--r--erts/include/internal/erl_memory_trace_protocol.h2
-rw-r--r--erts/include/internal/erl_misc_utils.h2
-rw-r--r--erts/include/internal/erl_printf.h2
-rw-r--r--erts/include/internal/erl_printf_format.h2
-rw-r--r--erts/include/internal/erts_internal.mk.in2
-rw-r--r--erts/include/internal/ethr_atomics.h2
-rw-r--r--erts/include/internal/ethr_internal.h2
-rw-r--r--erts/include/internal/ethr_mutex.h2
-rw-r--r--erts/include/internal/ethr_optimized_fallbacks.h2
-rw-r--r--erts/include/internal/ethread.h4
-rw-r--r--erts/include/internal/ethread.mk.in2
-rw-r--r--erts/include/internal/ethread_header_config.h.in2
-rw-r--r--erts/include/internal/ethread_inline.h2
-rw-r--r--erts/include/internal/i386/atomic.h2
-rw-r--r--erts/include/internal/i386/ethr_dw_atomic.h2
-rw-r--r--erts/include/internal/i386/ethr_membar.h2
-rw-r--r--erts/include/internal/i386/ethread.h2
-rw-r--r--erts/include/internal/i386/rwlock.h2
-rw-r--r--erts/include/internal/i386/spinlock.h2
-rw-r--r--erts/include/internal/libatomic_ops/ethr_atomic.h2
-rw-r--r--erts/include/internal/libatomic_ops/ethr_dw_atomic.h2
-rw-r--r--erts/include/internal/libatomic_ops/ethr_membar.h2
-rw-r--r--erts/include/internal/libatomic_ops/ethread.h2
-rw-r--r--erts/include/internal/ppc32/atomic.h2
-rw-r--r--erts/include/internal/ppc32/ethr_membar.h2
-rw-r--r--erts/include/internal/ppc32/ethread.h2
-rw-r--r--erts/include/internal/ppc32/rwlock.h2
-rw-r--r--erts/include/internal/ppc32/spinlock.h2
-rw-r--r--erts/include/internal/pthread/ethr_event.h2
-rw-r--r--erts/include/internal/sparc32/atomic.h2
-rw-r--r--erts/include/internal/sparc32/ethr_membar.h2
-rw-r--r--erts/include/internal/sparc32/ethread.h2
-rw-r--r--erts/include/internal/sparc32/rwlock.h2
-rw-r--r--erts/include/internal/sparc32/spinlock.h2
-rw-r--r--erts/include/internal/sparc64/ethread.h2
-rw-r--r--erts/include/internal/tile/atomic.h2
-rw-r--r--erts/include/internal/tile/ethr_membar.h2
-rw-r--r--erts/include/internal/tile/ethread.h2
-rw-r--r--erts/include/internal/win/ethr_atomic.h2
-rw-r--r--erts/include/internal/win/ethr_dw_atomic.h2
-rw-r--r--erts/include/internal/win/ethr_event.h2
-rw-r--r--erts/include/internal/win/ethr_membar.h2
-rw-r--r--erts/include/internal/win/ethread.h2
-rw-r--r--erts/include/internal/x86_64/ethread.h2
-rw-r--r--erts/lib/internal/README2
-rw-r--r--erts/lib_src/Makefile2
-rw-r--r--erts/lib_src/Makefile.in2
-rw-r--r--erts/lib_src/common/erl_memory_trace_parser.c2
-rw-r--r--erts/lib_src/common/erl_misc_utils.c2
-rw-r--r--erts/lib_src/common/erl_printf.c2
-rw-r--r--erts/lib_src/common/erl_printf_format.c2
-rw-r--r--erts/lib_src/common/ethr_atomics.c2
-rw-r--r--erts/lib_src/common/ethr_aux.c2
-rw-r--r--erts/lib_src/common/ethr_cbf.c2
-rw-r--r--erts/lib_src/common/ethr_mutex.c2
-rw-r--r--erts/lib_src/pthread/ethr_event.c8
-rw-r--r--erts/lib_src/pthread/ethr_x86_sse2_asm.c2
-rw-r--r--erts/lib_src/pthread/ethread.c2
-rwxr-xr-xerts/lib_src/utils/make_atomics_api2
-rw-r--r--erts/lib_src/win/ethr_event.c2
-rw-r--r--erts/lib_src/win/ethread.c2
-rw-r--r--erts/preloaded/Makefile2
-rw-r--r--erts/preloaded/ebin/erl_prim_loader.beambin55528 -> 55800 bytes
-rw-r--r--erts/preloaded/ebin/erl_tracer.beambin0 -> 2128 bytes
-rw-r--r--erts/preloaded/ebin/erlang.beambin102200 -> 104172 bytes
-rw-r--r--erts/preloaded/ebin/erts_code_purger.beambin8704 -> 8712 bytes
-rw-r--r--erts/preloaded/ebin/erts_internal.beambin9976 -> 10552 bytes
-rw-r--r--erts/preloaded/ebin/init.beambin44608 -> 49944 bytes
-rw-r--r--erts/preloaded/ebin/otp_ring0.beambin1448 -> 1460 bytes
-rw-r--r--erts/preloaded/ebin/prim_eval.beambin1320 -> 1328 bytes
-rw-r--r--erts/preloaded/ebin/prim_file.beambin44800 -> 44780 bytes
-rw-r--r--erts/preloaded/ebin/prim_inet.beambin72608 -> 72564 bytes
-rw-r--r--erts/preloaded/ebin/prim_zip.beambin23156 -> 23172 bytes
-rw-r--r--erts/preloaded/ebin/zlib.beambin14156 -> 14152 bytes
-rw-r--r--erts/preloaded/src/Makefile5
-rw-r--r--erts/preloaded/src/add_abstract_code2
-rw-r--r--erts/preloaded/src/erl_prim_loader.erl13
-rw-r--r--erts/preloaded/src/erl_tracer.erl59
-rw-r--r--erts/preloaded/src/erlang.erl109
-rw-r--r--erts/preloaded/src/erts.app.src2
-rw-r--r--erts/preloaded/src/erts_internal.erl31
-rw-r--r--erts/preloaded/src/init.erl198
-rw-r--r--erts/preloaded/src/otp_ring0.erl2
-rw-r--r--erts/preloaded/src/prim_eval.S2
-rw-r--r--erts/preloaded/src/prim_eval.erl2
-rw-r--r--erts/preloaded/src/prim_inet.erl2
-rw-r--r--erts/preloaded/src/prim_zip.erl2
-rw-r--r--erts/preloaded/src/zip_internal.hrl2
-rw-r--r--erts/preloaded/src/zlib.erl2
-rw-r--r--erts/start_scripts/Makefile2
-rw-r--r--erts/start_scripts/no_dot_erlang.rel.src2
-rw-r--r--erts/start_scripts/start_all_example.rel.src2
-rw-r--r--erts/start_scripts/start_clean.rel.src2
-rw-r--r--erts/start_scripts/start_sasl.rel.src2
-rw-r--r--erts/test/Makefile2
-rw-r--r--erts/test/erl_print_SUITE.erl507
-rw-r--r--erts/test/erl_print_SUITE_data/Makefile.src2
-rw-r--r--erts/test/erl_print_SUITE_data/character_test.h2
-rw-r--r--erts/test/erl_print_SUITE_data/erl_print_tests.c2
-rw-r--r--erts/test/erl_print_SUITE_data/integer_64_test.h2
-rw-r--r--erts/test/erl_print_SUITE_data/integer_test.h2
-rw-r--r--erts/test/erl_print_SUITE_data/snprintf_test.h2
-rw-r--r--erts/test/erl_print_SUITE_data/string_test.h2
-rw-r--r--erts/test/erlc_SUITE.erl329
-rw-r--r--erts/test/erlc_SUITE_data/include/erl_test.hrl2
-rw-r--r--erts/test/erlc_SUITE_data/src/erl_test_bad.erl2
-rw-r--r--erts/test/erlc_SUITE_data/src/erl_test_missing_header.erl2
-rw-r--r--erts/test/erlc_SUITE_data/src/erl_test_ok.erl2
-rw-r--r--erts/test/erlc_SUITE_data/src/yecc_test_bad.yrl2
-rw-r--r--erts/test/erlc_SUITE_data/src/yecc_test_ok.yrl2
-rw-r--r--erts/test/erlexec_SUITE.erl240
-rw-r--r--erts/test/erlexec_SUITE_data/Makefile.src2
-rw-r--r--erts/test/erlexec_SUITE_data/erlexec_tests.c2
-rw-r--r--erts/test/ethread_SUITE.erl247
-rw-r--r--erts/test/ethread_SUITE_data/Makefile.src2
-rw-r--r--erts/test/ethread_SUITE_data/ethread_tests.c2
-rw-r--r--erts/test/ignore_cores.erl14
-rw-r--r--erts/test/install_SUITE.erl350
-rw-r--r--erts/test/nt_SUITE.erl703
-rw-r--r--erts/test/nt_SUITE_data/Makefile.src2
-rw-r--r--erts/test/nt_SUITE_data/nt_info.c2
-rw-r--r--erts/test/otp_SUITE.erl533
-rw-r--r--erts/test/run_erl_SUITE.erl155
-rw-r--r--erts/test/run_erl_SUITE_data/defuncter.pl2
-rw-r--r--erts/test/run_erl_SUITE_data/run_erl_test.pl2
-rw-r--r--erts/test/upgrade_SUITE.erl20
-rw-r--r--erts/test/upgrade_SUITE_data/start.src2
-rw-r--r--erts/test/utils/gccifier.c2
-rwxr-xr-xerts/test/utils/gccifier.sh2
-rw-r--r--erts/test/z_SUITE.erl47
-rw-r--r--lib/Makefile2
-rw-r--r--lib/asn1/Makefile2
-rw-r--r--lib/asn1/c_src/Makefile2
-rw-r--r--lib/asn1/c_src/asn1_erl_nif.c2
-rw-r--r--lib/asn1/doc/src/Makefile2
-rw-r--r--lib/asn1/doc/src/asn1_getting_started.xml2
-rw-r--r--lib/asn1/doc/src/asn1_introduction.xml2
-rw-r--r--lib/asn1/doc/src/asn1_overview.xml2
-rw-r--r--lib/asn1/doc/src/asn1_spec.xmlsrc2
-rw-r--r--lib/asn1/doc/src/asn1ct.xml2
-rw-r--r--lib/asn1/doc/src/asn1rt.xml2
-rw-r--r--lib/asn1/doc/src/book.xml2
-rw-r--r--lib/asn1/doc/src/notes.xml2
-rw-r--r--lib/asn1/doc/src/part.xml2
-rw-r--r--lib/asn1/doc/src/ref_man.xml2
-rw-r--r--lib/asn1/doc/users_guide/Makefile2
-rw-r--r--lib/asn1/src/Makefile2
-rw-r--r--lib/asn1/src/asn1.appup.src2
-rw-r--r--lib/asn1/src/asn1_db.erl2
-rw-r--r--lib/asn1/src/asn1_records.hrl2
-rw-r--r--lib/asn1/src/asn1ct.erl2
-rw-r--r--lib/asn1/src/asn1ct_constructed_ber_bin_v2.erl2
-rw-r--r--lib/asn1/src/asn1ct_constructed_per.erl2
-rw-r--r--lib/asn1/src/asn1ct_func.erl2
-rw-r--r--lib/asn1/src/asn1ct_gen.erl2
-rw-r--r--lib/asn1/src/asn1ct_gen_ber_bin_v2.erl2
-rw-r--r--lib/asn1/src/asn1ct_gen_check.erl2
-rw-r--r--lib/asn1/src/asn1ct_gen_per.erl2
-rw-r--r--lib/asn1/src/asn1ct_imm.erl2
-rw-r--r--lib/asn1/src/asn1ct_name.erl2
-rw-r--r--lib/asn1/src/asn1ct_parser2.erl2
-rw-r--r--lib/asn1/src/asn1ct_pretty_format.erl2
-rw-r--r--lib/asn1/src/asn1ct_table.erl2
-rw-r--r--lib/asn1/src/asn1ct_tok.erl2
-rw-r--r--lib/asn1/src/asn1ct_value.erl2
-rw-r--r--lib/asn1/src/asn1rt.erl2
-rw-r--r--lib/asn1/src/asn1rt_nif.erl2
-rw-r--r--lib/asn1/src/asn1rtt_ber.erl2
-rw-r--r--lib/asn1/src/asn1rtt_check.erl2
-rw-r--r--lib/asn1/src/asn1rtt_ext.erl2
-rw-r--r--lib/asn1/src/asn1rtt_per.erl2
-rw-r--r--lib/asn1/src/asn1rtt_per_common.erl2
-rw-r--r--lib/asn1/src/asn1rtt_real_common.erl2
-rw-r--r--lib/asn1/src/asn1rtt_uper.erl2
-rw-r--r--lib/asn1/src/prepare_templates.erl2
-rw-r--r--lib/asn1/test/External.hrl2
-rw-r--r--lib/asn1/test/Makefile2
-rw-r--r--lib/asn1/test/asn1_SUITE.erl38
-rw-r--r--lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn2
-rw-r--r--lib/asn1/test/asn1_SUITE_data/TCAPPackage_msg.erl2
-rw-r--r--lib/asn1/test/asn1_SUITE_data/a_SeqIn.erl2
-rw-r--r--lib/asn1/test/asn1_SUITE_data/b_SeqIn.erl2
-rw-r--r--lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl2
-rw-r--r--lib/asn1/test/asn1_SUITE_data/test_records.erl18
-rw-r--r--lib/asn1/test/asn1_SUITE_data/testobj.erl2
-rw-r--r--lib/asn1/test/asn1_app_test.erl26
-rw-r--r--lib/asn1/test/asn1_appup_test.erl6
-rw-r--r--lib/asn1/test/asn1_test_lib.erl23
-rw-r--r--lib/asn1/test/ber_decode_error.erl2
-rw-r--r--lib/asn1/test/error_SUITE.erl6
-rw-r--r--lib/asn1/test/h323test.erl2
-rw-r--r--lib/asn1/test/syntax_SUITE.erl4
-rw-r--r--lib/asn1/test/testChoExtension.erl2
-rw-r--r--lib/asn1/test/testChoExternal.erl2
-rw-r--r--lib/asn1/test/testChoOptional.erl2
-rw-r--r--lib/asn1/test/testChoPrim.erl2
-rw-r--r--lib/asn1/test/testChoRecursive.erl2
-rw-r--r--lib/asn1/test/testChoTypeRefCho.erl2
-rw-r--r--lib/asn1/test/testChoTypeRefPrim.erl2
-rw-r--r--lib/asn1/test/testChoTypeRefSeq.erl2
-rw-r--r--lib/asn1/test/testChoTypeRefSet.erl2
-rw-r--r--lib/asn1/test/testChoiceIndefinite.erl2
-rw-r--r--lib/asn1/test/testCompactBitString.erl2
-rw-r--r--lib/asn1/test/testConstraints.erl2
-rw-r--r--lib/asn1/test/testContextSwitchingTypes.erl4
-rw-r--r--lib/asn1/test/testDER.erl2
-rw-r--r--lib/asn1/test/testDeepTConstr.erl2
-rw-r--r--lib/asn1/test/testDef.erl2
-rw-r--r--lib/asn1/test/testDoubleEllipses.erl2
-rw-r--r--lib/asn1/test/testEnumExt.erl2
-rw-r--r--lib/asn1/test/testExtensibilityImplied.erl2
-rw-r--r--lib/asn1/test/testFragmented.erl2
-rw-r--r--lib/asn1/test/testINSTANCE_OF.erl2
-rw-r--r--lib/asn1/test/testImporting.erl2
-rw-r--r--lib/asn1/test/testInfObj.erl2
-rw-r--r--lib/asn1/test/testInfObjExtract.erl2
-rw-r--r--lib/asn1/test/testInfObjectClass.erl2
-rw-r--r--lib/asn1/test/testMegaco.erl6
-rw-r--r--lib/asn1/test/testMergeCompile.erl16
-rw-r--r--lib/asn1/test/testMultipleLevels.erl2
-rw-r--r--lib/asn1/test/testNBAPsystem.erl18
-rw-r--r--lib/asn1/test/testOpenTypeImplicitTag.erl2
-rw-r--r--lib/asn1/test/testOpt.erl2
-rw-r--r--lib/asn1/test/testParamBasic.erl2
-rw-r--r--lib/asn1/test/testParameterizedInfObj.erl8
-rw-r--r--lib/asn1/test/testPrim.erl2
-rw-r--r--lib/asn1/test/testPrimExternal.erl2
-rw-r--r--lib/asn1/test/testPrimStrings.erl2
-rw-r--r--lib/asn1/test/testRfcs.erl6
-rw-r--r--lib/asn1/test/testSSLspecs.erl52
-rw-r--r--lib/asn1/test/testSelectionTypes.erl2
-rw-r--r--lib/asn1/test/testSeq2738.erl2
-rw-r--r--lib/asn1/test/testSeqDefault.erl2
-rw-r--r--lib/asn1/test/testSeqExtension.erl2
-rw-r--r--lib/asn1/test/testSeqExternal.erl2
-rw-r--r--lib/asn1/test/testSeqOf.erl2
-rw-r--r--lib/asn1/test/testSeqOfCho.erl2
-rw-r--r--lib/asn1/test/testSeqOfExternal.erl2
-rw-r--r--lib/asn1/test/testSeqOfIndefinite.erl16
-rw-r--r--lib/asn1/test/testSeqOfTag.erl2
-rw-r--r--lib/asn1/test/testSeqOptional.erl2
-rw-r--r--lib/asn1/test/testSeqPrim.erl2
-rw-r--r--lib/asn1/test/testSeqSetDefaultVal.erl2
-rw-r--r--lib/asn1/test/testSeqSetIndefinite.erl2
-rw-r--r--lib/asn1/test/testSeqTag.erl2
-rw-r--r--lib/asn1/test/testSeqTypeRefCho.erl2
-rw-r--r--lib/asn1/test/testSeqTypeRefPrim.erl2
-rw-r--r--lib/asn1/test/testSeqTypeRefSeq.erl2
-rw-r--r--lib/asn1/test/testSeqTypeRefSet.erl2
-rw-r--r--lib/asn1/test/testSetDefault.erl2
-rw-r--r--lib/asn1/test/testSetExtension.erl2
-rw-r--r--lib/asn1/test/testSetExternal.erl2
-rw-r--r--lib/asn1/test/testSetOf.erl2
-rw-r--r--lib/asn1/test/testSetOfCho.erl2
-rw-r--r--lib/asn1/test/testSetOfExternal.erl2
-rw-r--r--lib/asn1/test/testSetOfTag.erl2
-rw-r--r--lib/asn1/test/testSetOptional.erl2
-rw-r--r--lib/asn1/test/testSetPrim.erl2
-rw-r--r--lib/asn1/test/testSetTag.erl2
-rw-r--r--lib/asn1/test/testSetTypeRefCho.erl2
-rw-r--r--lib/asn1/test/testSetTypeRefPrim.erl2
-rw-r--r--lib/asn1/test/testSetTypeRefSeq.erl2
-rw-r--r--lib/asn1/test/testSetTypeRefSet.erl2
-rw-r--r--lib/asn1/test/testTCAP.erl18
-rw-r--r--lib/asn1/test/testTcapsystem.erl2
-rw-r--r--lib/asn1/test/testTimer.erl2
-rw-r--r--lib/asn1/test/testTypeValueNotation.erl2
-rw-r--r--lib/asn1/test/testUniqueObjectSets.erl2
-rw-r--r--lib/asn1/test/testValueTest.erl2
-rw-r--r--lib/asn1/test/test_compile_options.erl85
-rw-r--r--lib/asn1/test/test_modified_x420.erl4
-rw-r--r--lib/asn1/test/test_partial_incomplete_decode.erl60
-rw-r--r--lib/asn1/test/test_selective_decode.erl2
-rw-r--r--lib/asn1/test/test_special_decode_performance.erl24
-rw-r--r--lib/asn1/test/test_undecoded_rest.erl4
-rw-r--r--lib/asn1/test/test_x691.erl2
-rw-r--r--lib/common_test/Makefile2
-rw-r--r--lib/common_test/doc/src/Makefile2
-rw-r--r--lib/common_test/doc/src/basics_chapter.xml2
-rw-r--r--lib/common_test/doc/src/book.xml2
-rw-r--r--lib/common_test/doc/src/common_test_app.xml2
-rw-r--r--lib/common_test/doc/src/config_file_chapter.xml2
-rw-r--r--lib/common_test/doc/src/cover_chapter.xml2
-rw-r--r--lib/common_test/doc/src/ct.xml15
-rw-r--r--lib/common_test/doc/src/ct_cover.xml2
-rw-r--r--lib/common_test/doc/src/ct_ftp.xml2
-rw-r--r--lib/common_test/doc/src/ct_hooks.xml2
-rw-r--r--lib/common_test/doc/src/ct_hooks_chapter.xml2
-rw-r--r--lib/common_test/doc/src/ct_master.xml2
-rw-r--r--lib/common_test/doc/src/ct_master_chapter.xml2
-rw-r--r--lib/common_test/doc/src/ct_netconfc.xml2
-rw-r--r--lib/common_test/doc/src/ct_property_test.xml2
-rw-r--r--lib/common_test/doc/src/ct_rpc.xml2
-rw-r--r--lib/common_test/doc/src/ct_run.xml7
-rw-r--r--lib/common_test/doc/src/ct_slave.xml2
-rw-r--r--lib/common_test/doc/src/ct_snmp.xml2
-rw-r--r--lib/common_test/doc/src/ct_ssh.xml2
-rw-r--r--lib/common_test/doc/src/ct_telnet.xml7
-rw-r--r--lib/common_test/doc/src/dependencies_chapter.xml2
-rw-r--r--lib/common_test/doc/src/event_handler_chapter.xml2
-rw-r--r--lib/common_test/doc/src/example_chapter.xml2
-rw-r--r--lib/common_test/doc/src/getting_started_chapter.xml2
-rw-r--r--lib/common_test/doc/src/install_chapter.xml2
-rw-r--r--lib/common_test/doc/src/introduction.xml2
-rw-r--r--lib/common_test/doc/src/notes.xml64
-rw-r--r--lib/common_test/doc/src/notes_history.xml2
-rw-r--r--lib/common_test/doc/src/part.xml2
-rw-r--r--lib/common_test/doc/src/part_notes.xml2
-rw-r--r--lib/common_test/doc/src/part_notes_history.xml2
-rw-r--r--lib/common_test/doc/src/ref_man.xml2
-rw-r--r--lib/common_test/doc/src/run_test_chapter.xml11
-rw-r--r--lib/common_test/doc/src/test_structure_chapter.xml2
-rw-r--r--lib/common_test/doc/src/unix_telnet.xml5
-rw-r--r--lib/common_test/doc/src/why_test_chapter.xml2
-rw-r--r--lib/common_test/doc/src/write_test_chapter.xml14
-rw-r--r--lib/common_test/include/ct.hrl2
-rw-r--r--lib/common_test/include/ct_event.hrl2
-rw-r--r--lib/common_test/priv/Makefile2
-rw-r--r--lib/common_test/priv/Makefile.in2
-rw-r--r--lib/common_test/src/Makefile2
-rw-r--r--lib/common_test/src/common_test.app.src8
-rw-r--r--lib/common_test/src/common_test.appup.src2
-rw-r--r--lib/common_test/src/ct.erl8
-rw-r--r--lib/common_test/src/ct_config.erl2
-rw-r--r--lib/common_test/src/ct_config_plain.erl2
-rw-r--r--lib/common_test/src/ct_config_xml.erl2
-rw-r--r--lib/common_test/src/ct_conn_log_h.erl2
-rw-r--r--lib/common_test/src/ct_cover.erl2
-rw-r--r--lib/common_test/src/ct_event.erl2
-rw-r--r--lib/common_test/src/ct_framework.erl2
-rw-r--r--lib/common_test/src/ct_ftp.erl2
-rw-r--r--lib/common_test/src/ct_gen_conn.erl2
-rw-r--r--lib/common_test/src/ct_groups.erl4
-rw-r--r--lib/common_test/src/ct_hooks.erl8
-rw-r--r--lib/common_test/src/ct_hooks_lock.erl2
-rw-r--r--lib/common_test/src/ct_logs.erl84
-rw-r--r--lib/common_test/src/ct_master.erl14
-rw-r--r--lib/common_test/src/ct_master_event.erl2
-rw-r--r--lib/common_test/src/ct_master_logs.erl2
-rw-r--r--lib/common_test/src/ct_master_status.erl2
-rw-r--r--lib/common_test/src/ct_netconfc.erl2
-rw-r--r--lib/common_test/src/ct_netconfc.hrl2
-rw-r--r--lib/common_test/src/ct_property_test.erl2
-rw-r--r--lib/common_test/src/ct_release_test.erl6
-rw-r--r--lib/common_test/src/ct_repeat.erl2
-rw-r--r--lib/common_test/src/ct_rpc.erl2
-rw-r--r--lib/common_test/src/ct_run.erl58
-rw-r--r--lib/common_test/src/ct_ssh.erl2
-rw-r--r--lib/common_test/src/ct_telnet.erl46
-rw-r--r--lib/common_test/src/ct_telnet_client.erl19
-rw-r--r--lib/common_test/src/ct_testspec.erl9
-rw-r--r--lib/common_test/src/ct_util.erl3
-rw-r--r--lib/common_test/src/ct_util.hrl3
-rw-r--r--lib/common_test/src/ct_webtool.erl2
-rw-r--r--lib/common_test/src/ct_webtool_sup.erl2
-rw-r--r--lib/common_test/src/cth_conn_log.erl2
-rw-r--r--lib/common_test/src/cth_log_redirect.erl20
-rw-r--r--lib/common_test/src/cth_surefire.erl5
-rw-r--r--lib/common_test/src/erl2html2.erl2
-rw-r--r--lib/common_test/src/test_server.erl15
-rw-r--r--lib/common_test/src/test_server_ctrl.erl2
-rw-r--r--lib/common_test/src/test_server_gl.erl8
-rw-r--r--lib/common_test/src/test_server_internal.hrl2
-rw-r--r--lib/common_test/src/test_server_io.erl2
-rw-r--r--lib/common_test/src/test_server_sup.erl2
-rw-r--r--lib/common_test/src/unix_telnet.erl18
-rw-r--r--lib/common_test/src/vts.erl2
-rw-r--r--lib/common_test/test/Makefile2
-rw-r--r--lib/common_test/test/ct_auto_compile_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_auto_compile_SUITE_data/bad_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_auto_compile_SUITE_data/dummy_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_basic_html_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_basic_html_SUITE_data/babbling_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_config_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_config_SUITE_data/config/test/config_driver.erl2
-rw-r--r--lib/common_test/test/ct_config_SUITE_data/config/test/config_dynamic_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_config_SUITE_data/config/test/config_server.erl2
-rw-r--r--lib/common_test/test/ct_config_SUITE_data/config/test/config_static_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_config_info_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_config_info_SUITE_data/config_info_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_cover_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_cover_SUITE_data/cover_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_cover_nomerge_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_cover_nomerge_SUITE_data/cover_nomerge_local_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_cover_nomerge_SUITE_data/cover_nomerge_remote_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_cover_nomerge_SUITE_data/cover_nomerge_remote_nostop_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_10_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_11_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_12_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_13_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_14_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_2_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_3_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_4_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_5_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_6_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_7_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_8_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_9_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/config_func_error_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/config_restored_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/lib_error_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/misc_error_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/no_compile_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_2_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_3_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_4_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_5_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_6_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_7_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_8_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_utils.erl2
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/verify_config.erl2
-rw-r--r--lib/common_test/test/ct_event_handler_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_event_handler_SUITE_data/eh_A.erl2
-rw-r--r--lib/common_test/test/ct_event_handler_SUITE_data/event_handling_1/test/eh_11_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_gen_conn_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_gen_conn_SUITE_data/conn_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_gen_conn_SUITE_data/proto.erl2
-rw-r--r--lib/common_test/test/ct_group_info_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_group_info_SUITE_data/group_require_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_group_info_SUITE_data/group_require_2_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_group_info_SUITE_data/group_require_3_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_2_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_3_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_group_leader_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_group_leader_SUITE_data/group_leader_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_groups_search_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_groups_search_SUITE_data/groups_search_dummy_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_groups_search_SUITE_data/groups_search_dummy_2_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_groups_spec_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_groups_spec_SUITE_data/groups_spec_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_groups_test_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_groups_test_1_SUITE_data/groups_1/test/groups_11_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_groups_test_1_SUITE_data/groups_1/test/groups_12_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_groups_test_1_SUITE_data/groups_2/test/groups_21_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_groups_test_1_SUITE_data/groups_2/test/groups_22_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_groups_test_2_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_groups_test_2_SUITE_data/groups_1/missing_conf_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_groups_test_2_SUITE_data/groups_1/repeat_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_groups_test_2_SUITE_data/groups_2/groups_21_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_groups_test_2_SUITE_data/groups_2/groups_22_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_id_cth.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_init_cth.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_empty_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_one_skip_one_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_per_suite_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_prio_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_data_dir_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_exit_in_init_scope_suite_cth_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_no_config_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_cth_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_state_cth_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_cth_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_state_cth_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_tc_cth_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_crash_in_cth_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_cth_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_state_cth_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_update_config_SUITE.erl96
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/cth_log_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl4
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_post_suite_cth.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_pre_suite_cth.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/id_no_init_cth.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_cth.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_terminate_cth.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/prio_cth.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/recover_post_suite_cth.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/same_id_cth.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_post_suite_cth.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_end_cth.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_suite_cth.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/state_update_cth.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/undef_cth.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl4
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_config_cth.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_data_dir_cth.erl2
-rw-r--r--lib/common_test/test/ct_master_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_master_SUITE_data/master/master_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_misc_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_misc_1_SUITE_data/beam_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_misc_1_SUITE_data/beam_2_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_netconfc_SUITE.erl9
-rw-r--r--lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl18
-rw-r--r--lib/common_test/test/ct_netconfc_SUITE_data/netconfc_remote_SUITE.erl34
-rw-r--r--lib/common_test/test/ct_netconfc_SUITE_data/ns.erl2
-rw-r--r--lib/common_test/test/ct_pre_post_test_io_SUITE.erl128
-rw-r--r--lib/common_test/test/ct_pre_post_test_io_SUITE_data/cth_ctrl.erl10
-rw-r--r--lib/common_test/test/ct_pre_post_test_io_SUITE_data/dummy_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_priv_dir_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_priv_dir_SUITE_data/priv_dir_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_release_test_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_release_test_SUITE_data/release_test_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_repeat_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_repeat_1_SUITE_data/repeat_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_repeat_testrun_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_repeat_testrun_SUITE_data/a_test/r1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_repeat_testrun_SUITE_data/b_test/r2_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_sequence_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_sequence_1_SUITE_data/subgroups_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_shell_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_10_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_11_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_12_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_2_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_3_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_4_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_5_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_6_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_7_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_8_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_9_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_2_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_3_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_4_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_5_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_6_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_7_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_smoke_test_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_smoke_test_SUITE_data/happy_1/test/happy_11_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_smoke_test_SUITE_data/happy_2_test/happy_21_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_snmp_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_surefire_SUITE.erl111
-rw-r--r--lib/common_test/test/ct_surefire_SUITE_data/fail_SUITE.erl (renamed from lib/compiler/test/compilation_SUITE_data/bin_syntax_1.erl)26
-rw-r--r--lib/common_test/test/ct_surefire_SUITE_data/fail_pre_init_per_suite.erl47
-rw-r--r--lib/common_test/test/ct_surefire_SUITE_data/pass_SUITE.erl (renamed from lib/compiler/test/compilation_SUITE_data/beam_compiler_5.erl)23
-rw-r--r--lib/common_test/test/ct_surefire_SUITE_data/surefire_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_system_error_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_system_error_SUITE_data/a_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_telnet_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_test_server_if_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/skipped_by_spec_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/skipped_by_spec_2_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_2_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_3_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_4_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_5_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_6_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_7_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_8_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_test_support.erl23
-rw-r--r--lib/common_test/test/ct_test_support_eh.erl2
-rw-r--r--lib/common_test/test/ct_testspec_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_testspec_1_SUITE_data/groups_1/groups_11_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_testspec_1_SUITE_data/groups_1/groups_12_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_testspec_1_SUITE_data/groups_2/groups_21_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_testspec_1_SUITE_data/groups_2/groups_22_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_testspec_1_SUITE_data/suites_1/simple_1_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_testspec_1_SUITE_data/suites_1/simple_2_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_testspec_2_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_testspec_3_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_testspec_3_SUITE_data/tests1/t11_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_testspec_3_SUITE_data/tests1/t12_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_testspec_3_SUITE_data/tests2/t21_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_testspec_3_SUITE_data/tests2/t22_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_testspec_3_SUITE_data/tests2/t23_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_userconfig_callback.erl2
-rw-r--r--lib/common_test/test/ct_verbosity_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_verbosity_SUITE_data/io_test_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_verbosity_SUITE_data/simple_evh.erl2
-rw-r--r--lib/common_test/test/erl2html2_SUITE.erl2
-rw-r--r--lib/common_test/test/test_server_SUITE.erl2
-rw-r--r--lib/common_test/test/test_server_SUITE_data/test_server_SUITE.erl2
-rw-r--r--lib/common_test/test/test_server_SUITE_data/test_server_break_SUITE.erl2
-rw-r--r--lib/common_test/test/test_server_SUITE_data/test_server_conf01_SUITE.erl2
-rw-r--r--lib/common_test/test/test_server_SUITE_data/test_server_conf02_SUITE.erl2
-rw-r--r--lib/common_test/test/test_server_SUITE_data/test_server_cover_SUITE.erl2
-rw-r--r--lib/common_test/test/test_server_SUITE_data/test_server_parallel01_SUITE.erl2
-rw-r--r--lib/common_test/test/test_server_SUITE_data/test_server_shuffle01_SUITE.erl2
-rw-r--r--lib/common_test/test/test_server_SUITE_data/test_server_skip_SUITE.erl2
-rw-r--r--lib/common_test/test/test_server_SUITE_data/test_server_unicode_SUITE.erl2
-rw-r--r--lib/common_test/test/test_server_test_lib.erl2
-rw-r--r--lib/common_test/test_server/Makefile2
-rw-r--r--lib/common_test/test_server/configure.in2
-rw-r--r--lib/common_test/test_server/ts.config4
-rw-r--r--lib/common_test/test_server/ts.erl2
-rw-r--r--lib/common_test/test_server/ts.hrl2
-rw-r--r--lib/common_test/test_server/ts_autoconf_win32.erl12
-rw-r--r--lib/common_test/test_server/ts_benchmark.erl2
-rw-r--r--lib/common_test/test_server/ts_erl_config.erl2
-rw-r--r--lib/common_test/test_server/ts_install.erl2
-rw-r--r--lib/common_test/test_server/ts_install_cth.erl2
-rw-r--r--lib/common_test/test_server/ts_lib.erl2
-rw-r--r--lib/common_test/test_server/ts_make.erl2
-rw-r--r--lib/common_test/test_server/ts_run.erl15
-rw-r--r--lib/common_test/vsn.mk2
-rw-r--r--lib/compiler/Makefile2
-rw-r--r--lib/compiler/doc/src/Makefile2
-rw-r--r--lib/compiler/doc/src/book.xml2
-rw-r--r--lib/compiler/doc/src/compile.xml2
-rw-r--r--lib/compiler/doc/src/notes.xml2
-rw-r--r--lib/compiler/doc/src/notes_history.xml2
-rw-r--r--lib/compiler/doc/src/part_notes.xml2
-rw-r--r--lib/compiler/doc/src/part_notes_history.xml2
-rw-r--r--lib/compiler/doc/src/ref_man.xml2
-rw-r--r--lib/compiler/src/Makefile2
-rw-r--r--lib/compiler/src/beam_a.erl2
-rw-r--r--lib/compiler/src/beam_asm.erl10
-rw-r--r--lib/compiler/src/beam_block.erl6
-rw-r--r--lib/compiler/src/beam_bool.erl2
-rw-r--r--lib/compiler/src/beam_bs.erl2
-rw-r--r--lib/compiler/src/beam_bsm.erl2
-rw-r--r--lib/compiler/src/beam_clean.erl2
-rw-r--r--lib/compiler/src/beam_dead.erl2
-rw-r--r--lib/compiler/src/beam_dict.erl2
-rw-r--r--lib/compiler/src/beam_disasm.erl2
-rw-r--r--lib/compiler/src/beam_disasm.hrl2
-rw-r--r--lib/compiler/src/beam_except.erl2
-rw-r--r--lib/compiler/src/beam_flatten.erl2
-rw-r--r--lib/compiler/src/beam_jump.erl2
-rw-r--r--lib/compiler/src/beam_listing.erl2
-rw-r--r--lib/compiler/src/beam_peep.erl5
-rw-r--r--lib/compiler/src/beam_receive.erl2
-rw-r--r--lib/compiler/src/beam_reorder.erl2
-rw-r--r--lib/compiler/src/beam_split.erl4
-rw-r--r--lib/compiler/src/beam_trim.erl2
-rw-r--r--lib/compiler/src/beam_type.erl2
-rw-r--r--lib/compiler/src/beam_utils.erl17
-rw-r--r--lib/compiler/src/beam_validator.erl5
-rw-r--r--lib/compiler/src/beam_z.erl14
-rw-r--r--lib/compiler/src/cerl.erl15
-rw-r--r--lib/compiler/src/cerl_clauses.erl2
-rw-r--r--lib/compiler/src/cerl_inline.erl2
-rw-r--r--lib/compiler/src/cerl_trees.erl18
-rw-r--r--lib/compiler/src/compile.erl59
-rw-r--r--lib/compiler/src/compiler.app.src2
-rw-r--r--lib/compiler/src/compiler.appup.src2
-rw-r--r--lib/compiler/src/core_lib.erl2
-rw-r--r--lib/compiler/src/core_parse.hrl2
-rw-r--r--lib/compiler/src/core_parse.yrl63
-rw-r--r--lib/compiler/src/core_pp.erl129
-rw-r--r--lib/compiler/src/core_scan.erl2
-rw-r--r--lib/compiler/src/erl_bifs.erl2
-rwxr-xr-xlib/compiler/src/genop.tab2
-rw-r--r--lib/compiler/src/rec_env.erl5
-rw-r--r--lib/compiler/src/sys_core_dsetel.erl2
-rw-r--r--lib/compiler/src/sys_core_fold.erl2
-rw-r--r--lib/compiler/src/sys_core_inline.erl2
-rw-r--r--lib/compiler/src/sys_pre_attributes.erl2
-rw-r--r--lib/compiler/src/v3_codegen.erl2
-rw-r--r--lib/compiler/src/v3_core.erl27
-rw-r--r--lib/compiler/src/v3_kernel.erl12
-rw-r--r--lib/compiler/src/v3_kernel.hrl2
-rw-r--r--lib/compiler/src/v3_kernel_pp.erl2
-rw-r--r--lib/compiler/src/v3_life.erl2
-rw-r--r--lib/compiler/src/v3_life.hrl2
-rw-r--r--lib/compiler/test/andor_SUITE.erl2
-rw-r--r--lib/compiler/test/apply_SUITE.erl2
-rw-r--r--lib/compiler/test/beam_block_SUITE.erl119
-rw-r--r--lib/compiler/test/beam_disasm_SUITE.erl2
-rw-r--r--lib/compiler/test/beam_except_SUITE.erl2
-rw-r--r--lib/compiler/test/beam_utils_SUITE.erl40
-rw-r--r--lib/compiler/test/beam_validator_SUITE.erl4
-rw-r--r--lib/compiler/test/bs_bincomp_SUITE.erl2
-rw-r--r--lib/compiler/test/bs_bit_binaries_SUITE.erl2
-rw-r--r--lib/compiler/test/bs_construct_SUITE.erl2
-rw-r--r--lib/compiler/test/bs_match_SUITE.erl98
-rw-r--r--lib/compiler/test/bs_utf_SUITE.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE.erl377
-rw-r--r--lib/compiler/test/compilation_SUITE_data/beam_compiler_1.erl32
-rw-r--r--lib/compiler/test/compilation_SUITE_data/beam_compiler_10.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/beam_compiler_11.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/beam_compiler_12.erl30
-rw-r--r--lib/compiler/test/compilation_SUITE_data/beam_compiler_2.erl36
-rw-r--r--lib/compiler/test/compilation_SUITE_data/beam_compiler_3.erl30
-rw-r--r--lib/compiler/test/compilation_SUITE_data/beam_compiler_4.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/beam_compiler_6.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/beam_compiler_8.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/beam_compiler_9.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/bin_syntax_2.erl42
-rw-r--r--lib/compiler/test/compilation_SUITE_data/bin_syntax_3.erl36
-rw-r--r--lib/compiler/test/compilation_SUITE_data/bin_syntax_4.erl33
-rw-r--r--lib/compiler/test/compilation_SUITE_data/bin_syntax_6.erl40
-rw-r--r--lib/compiler/test/compilation_SUITE_data/catch_in_catch.erl52
-rw-r--r--lib/compiler/test/compilation_SUITE_data/compiler_1.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/compiler_3.erl34
-rw-r--r--lib/compiler/test/compilation_SUITE_data/compiler_5.erl50
-rw-r--r--lib/compiler/test/compilation_SUITE_data/complex_guard.erl32
-rw-r--r--lib/compiler/test/compilation_SUITE_data/const_list_256.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/convopts.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/guards.erl107
-rw-r--r--lib/compiler/test/compilation_SUITE_data/live_var.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/long_string.erl671
-rw-r--r--lib/compiler/test/compilation_SUITE_data/nested_tuples_in_case_expr.erl37
-rw-r--r--lib/compiler/test/compilation_SUITE_data/opt_crash.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/other/vsn_1.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/other/vsn_3.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_2141.erl25
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_2173.erl32
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_2330.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_2380.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_4790.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_5076.erl28
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_5092.erl40
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_5151.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_5235.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_5244.erl48
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_5404.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_5436.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_5481.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_5553.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_5632.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_5714.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_5872.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_6121.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_6121a.erl33
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_6121b.erl34
-rw-r--r--lib/compiler/test/compilation_SUITE_data/otp_7202.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/pattern_expr.erl31
-rw-r--r--lib/compiler/test/compilation_SUITE_data/trycatch_4.erl51
-rw-r--r--lib/compiler/test/compilation_SUITE_data/vsn_1.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/vsn_2.erl2
-rw-r--r--lib/compiler/test/compilation_SUITE_data/vsn_3.erl2
-rw-r--r--lib/compiler/test/compile_SUITE.erl320
-rw-r--r--lib/compiler/test/compile_SUITE_data/attributes.erl2
-rw-r--r--lib/compiler/test/compile_SUITE_data/big.erl2
-rw-r--r--lib/compiler/test/compile_SUITE_data/include/simple.hrl2
-rw-r--r--lib/compiler/test/compile_SUITE_data/missing_testheap1.erl36
-rw-r--r--lib/compiler/test/compile_SUITE_data/missing_testheap2.erl30
-rw-r--r--lib/compiler/test/compile_SUITE_data/record_access.erl2
-rw-r--r--lib/compiler/test/compile_SUITE_data/simple.erl2
-rw-r--r--lib/compiler/test/compile_SUITE_data/wrong_module_name.erl2
-rw-r--r--lib/compiler/test/core_SUITE.erl2
-rw-r--r--lib/compiler/test/core_fold_SUITE.erl2
-rw-r--r--lib/compiler/test/error_SUITE.erl2
-rw-r--r--lib/compiler/test/error_SUITE_data/head_mismatch_line.erl2
-rw-r--r--lib/compiler/test/float_SUITE.erl2
-rw-r--r--lib/compiler/test/fun_SUITE.erl2
-rw-r--r--lib/compiler/test/guard_SUITE.erl27
-rw-r--r--lib/compiler/test/inline_SUITE.erl2
-rw-r--r--lib/compiler/test/inline_SUITE_data/attribute.erl2
-rw-r--r--lib/compiler/test/inline_SUITE_data/bsdecode.erl2
-rw-r--r--lib/compiler/test/inline_SUITE_data/bsdes.erl2
-rw-r--r--lib/compiler/test/inline_SUITE_data/decode1.erl2
-rw-r--r--lib/compiler/test/inline_SUITE_data/fname.erl2
-rw-r--r--lib/compiler/test/inline_SUITE_data/itracer.erl2
-rw-r--r--lib/compiler/test/inline_SUITE_data/maps_inline_test.erl2
-rw-r--r--lib/compiler/test/lc_SUITE.erl14
-rw-r--r--lib/compiler/test/match_SUITE.erl69
-rw-r--r--lib/compiler/test/misc_SUITE.erl5
-rw-r--r--lib/compiler/test/num_bif_SUITE.erl2
-rw-r--r--lib/compiler/test/receive_SUITE.erl2
-rw-r--r--lib/compiler/test/record_SUITE.erl62
-rw-r--r--lib/compiler/test/record_SUITE_data/record_access_in_guards.erl2
-rw-r--r--lib/compiler/test/regressions_SUITE.erl2
-rw-r--r--lib/compiler/test/test_lib.erl2
-rw-r--r--lib/compiler/test/trycatch_SUITE.erl91
-rw-r--r--lib/compiler/test/warnings_SUITE.erl2
-rw-r--r--lib/configure.in.src2
-rw-r--r--lib/cosEvent/Makefile2
-rw-r--r--lib/cosEvent/doc/src/CosEventChannelAdmin.xml2
-rw-r--r--lib/cosEvent/doc/src/CosEventChannelAdmin_ConsumerAdmin.xml2
-rw-r--r--lib/cosEvent/doc/src/CosEventChannelAdmin_EventChannel.xml2
-rw-r--r--lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPullConsumer.xml2
-rw-r--r--lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPullSupplier.xml2
-rw-r--r--lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPushConsumer.xml2
-rw-r--r--lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPushSupplier.xml2
-rw-r--r--lib/cosEvent/doc/src/CosEventChannelAdmin_SupplierAdmin.xml2
-rw-r--r--lib/cosEvent/doc/src/Makefile2
-rw-r--r--lib/cosEvent/doc/src/book.xml2
-rw-r--r--lib/cosEvent/doc/src/ch_contents.xml2
-rw-r--r--lib/cosEvent/doc/src/ch_event_service.xml2
-rw-r--r--lib/cosEvent/doc/src/ch_introduction.xml2
-rw-r--r--lib/cosEvent/doc/src/cosEventApp.xml2
-rw-r--r--lib/cosEvent/doc/src/notes.xml2
-rw-r--r--lib/cosEvent/doc/src/part.xml2
-rw-r--r--lib/cosEvent/doc/src/part_notes.xml2
-rw-r--r--lib/cosEvent/doc/src/ref_man.xml2
-rw-r--r--lib/cosEvent/src/CosEventChannelAdmin_ProxyPullConsumer_impl.erl2
-rw-r--r--lib/cosEvent/src/CosEventChannelAdmin_ProxyPushConsumer_impl.erl2
-rw-r--r--lib/cosEvent/src/CosEventChannelAdmin_SupplierAdmin_impl.erl2
-rw-r--r--lib/cosEvent/src/Makefile2
-rw-r--r--lib/cosEvent/src/cosEventApp.erl2
-rw-r--r--lib/cosEvent/src/cosEventApp.hrl2
-rw-r--r--lib/cosEvent/src/oe_CosEventComm_CAdmin_impl.erl2
-rw-r--r--lib/cosEvent/src/oe_CosEventComm_Channel_impl.erl2
-rw-r--r--lib/cosEvent/src/oe_CosEventComm_PusherS_impl.erl2
-rw-r--r--lib/cosEvent/test/Makefile2
-rw-r--r--lib/cosEvent/test/event_channel_SUITE.erl2
-rw-r--r--lib/cosEvent/test/event_test_PullC_impl.erl2
-rw-r--r--lib/cosEvent/test/event_test_PullS_impl.erl2
-rw-r--r--lib/cosEvent/test/event_test_PushC_impl.erl2
-rw-r--r--lib/cosEvent/test/event_test_PushS_impl.erl2
-rw-r--r--lib/cosEvent/test/event_test_server.idl2
-rw-r--r--lib/cosEvent/test/generated_SUITE.erl2
-rw-r--r--lib/cosEventDomain/Makefile2
-rw-r--r--lib/cosEventDomain/doc/src/CosEventDomainAdmin.xml2
-rw-r--r--lib/cosEventDomain/doc/src/CosEventDomainAdmin_EventDomain.xml2
-rw-r--r--lib/cosEventDomain/doc/src/CosEventDomainAdmin_EventDomainFactory.xml2
-rw-r--r--lib/cosEventDomain/doc/src/Makefile2
-rw-r--r--lib/cosEventDomain/doc/src/book.xml2
-rw-r--r--lib/cosEventDomain/doc/src/ch_QoS.xml2
-rw-r--r--lib/cosEventDomain/doc/src/ch_contents.xml2
-rw-r--r--lib/cosEventDomain/doc/src/ch_event_domain_service.xml2
-rw-r--r--lib/cosEventDomain/doc/src/ch_introduction.xml2
-rw-r--r--lib/cosEventDomain/doc/src/cosEventDomainApp.xml2
-rw-r--r--lib/cosEventDomain/doc/src/notes.xml2
-rw-r--r--lib/cosEventDomain/doc/src/part.xml2
-rw-r--r--lib/cosEventDomain/doc/src/part_notes.xml2
-rw-r--r--lib/cosEventDomain/doc/src/ref_man.xml2
-rw-r--r--lib/cosEventDomain/src/CosEventDomainAdmin_EventDomainFactory_impl.erl2
-rw-r--r--lib/cosEventDomain/src/CosEventDomainAdmin_EventDomain_impl.erl2
-rw-r--r--lib/cosEventDomain/src/Makefile2
-rw-r--r--lib/cosEventDomain/src/cosEventDomainApp.hrl2
-rw-r--r--lib/cosEventDomain/test/Makefile2
-rw-r--r--lib/cosEventDomain/test/event_domain_SUITE.erl2
-rw-r--r--lib/cosEventDomain/test/generated_SUITE.erl2
-rw-r--r--lib/cosFileTransfer/Makefile2
-rw-r--r--lib/cosFileTransfer/doc/src/CosFileTransfer_Directory.xml2
-rw-r--r--lib/cosFileTransfer/doc/src/CosFileTransfer_File.xml2
-rw-r--r--lib/cosFileTransfer/doc/src/CosFileTransfer_FileIterator.xml2
-rw-r--r--lib/cosFileTransfer/doc/src/CosFileTransfer_FileTransferSession.xml2
-rw-r--r--lib/cosFileTransfer/doc/src/CosFileTransfer_VirtualFileSystem.xml2
-rw-r--r--lib/cosFileTransfer/doc/src/Makefile2
-rw-r--r--lib/cosFileTransfer/doc/src/book.xml2
-rw-r--r--lib/cosFileTransfer/doc/src/ch_contents.xml2
-rw-r--r--lib/cosFileTransfer/doc/src/ch_example.xml2
-rw-r--r--lib/cosFileTransfer/doc/src/ch_install.xml2
-rw-r--r--lib/cosFileTransfer/doc/src/ch_introduction.xml2
-rw-r--r--lib/cosFileTransfer/doc/src/ch_system.xml2
-rw-r--r--lib/cosFileTransfer/doc/src/cosFileTransferApp.xml2
-rw-r--r--lib/cosFileTransfer/doc/src/notes.xml2
-rw-r--r--lib/cosFileTransfer/doc/src/part.xml2
-rw-r--r--lib/cosFileTransfer/doc/src/part_notes.xml2
-rw-r--r--lib/cosFileTransfer/doc/src/ref_man.xml2
-rw-r--r--lib/cosFileTransfer/src/CosFileTransfer_Directory_impl.erl2
-rw-r--r--lib/cosFileTransfer/src/CosFileTransfer_FileIterator_impl.erl2
-rw-r--r--lib/cosFileTransfer/src/CosFileTransfer_FileTransferSession_impl.erl2
-rw-r--r--lib/cosFileTransfer/src/CosFileTransfer_File_impl.erl2
-rw-r--r--lib/cosFileTransfer/src/CosFileTransfer_VirtualFileSystem_impl.erl2
-rw-r--r--lib/cosFileTransfer/src/Makefile2
-rw-r--r--lib/cosFileTransfer/src/cosFileTransferApp.hrl2
-rw-r--r--lib/cosFileTransfer/src/cosFileTransferNATIVE_file.erl2
-rw-r--r--lib/cosFileTransfer/test/Makefile2
-rw-r--r--lib/cosFileTransfer/test/fileTransfer_SUITE.erl2
-rw-r--r--lib/cosNotification/Makefile2
-rw-r--r--lib/cosNotification/doc/src/CosNotification.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotification_AdminPropertiesAdmin.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotification_QoSAdmin.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_ConsumerAdmin.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_EventChannel.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_EventChannelFactory.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyConsumer.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPullConsumer.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPullSupplier.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPushConsumer.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPushSupplier.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxySupplier.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPullConsumer.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPullSupplier.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPushConsumer.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPushSupplier.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPullConsumer.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPullSupplier.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPushConsumer.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPushSupplier.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyChannelAdmin_SupplierAdmin.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyComm_NotifyPublish.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyComm_NotifySubscribe.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyFilter_Filter.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyFilter_FilterAdmin.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyFilter_FilterFactory.xml2
-rw-r--r--lib/cosNotification/doc/src/CosNotifyFilter_MappingFilter.xml2
-rw-r--r--lib/cosNotification/doc/src/Makefile2
-rw-r--r--lib/cosNotification/doc/src/book.xml2
-rw-r--r--lib/cosNotification/doc/src/ch_BNF.xml2
-rw-r--r--lib/cosNotification/doc/src/ch_QoS.xml2
-rw-r--r--lib/cosNotification/doc/src/ch_contents.xml2
-rw-r--r--lib/cosNotification/doc/src/ch_example.xml2
-rw-r--r--lib/cosNotification/doc/src/ch_install.xml2
-rw-r--r--lib/cosNotification/doc/src/ch_introduction.xml2
-rw-r--r--lib/cosNotification/doc/src/ch_system.xml2
-rw-r--r--lib/cosNotification/doc/src/cosNotificationApp.xml2
-rw-r--r--lib/cosNotification/doc/src/notes.xml2
-rw-r--r--lib/cosNotification/doc/src/part.xml2
-rw-r--r--lib/cosNotification/doc/src/part_notes.xml2
-rw-r--r--lib/cosNotification/doc/src/ref_man.xml2
-rw-r--r--lib/cosNotification/src/CosNotifyChannelAdmin_ConsumerAdmin_impl.erl2
-rw-r--r--lib/cosNotification/src/CosNotifyChannelAdmin_EventChannelFactory_impl.erl2
-rw-r--r--lib/cosNotification/src/CosNotifyChannelAdmin_EventChannel_impl.erl2
-rw-r--r--lib/cosNotification/src/CosNotifyChannelAdmin_SupplierAdmin_impl.erl2
-rw-r--r--lib/cosNotification/src/CosNotifyFilter_FilterFactory_impl.erl2
-rw-r--r--lib/cosNotification/src/Makefile2
-rw-r--r--lib/cosNotification/src/PullerConsumer_impl.erl2
-rw-r--r--lib/cosNotification/src/PusherConsumer_impl.erl2
-rw-r--r--lib/cosNotification/src/PusherSupplier_impl.erl2
-rw-r--r--lib/cosNotification/src/cosNotification_Filter.erl2
-rw-r--r--lib/cosNotification/src/cosNotification_Grammar.yrl2
-rw-r--r--lib/cosNotification/src/cosNotification_Scanner.erl2
-rw-r--r--lib/cosNotification/test/Makefile2
-rw-r--r--lib/cosNotification/test/eventDB_SUITE.erl2
-rw-r--r--lib/cosNotification/test/generated_SUITE.erl2
-rw-r--r--lib/cosNotification/test/grammar_SUITE.erl2
-rw-r--r--lib/cosNotification/test/notification_SUITE.erl2
-rw-r--r--lib/cosNotification/test/notify_test_impl.erl2
-rw-r--r--lib/cosNotification/test/notify_test_server.cfg2
-rw-r--r--lib/cosNotification/test/notify_test_server.idl2
-rw-r--r--lib/cosProperty/Makefile2
-rw-r--r--lib/cosProperty/doc/src/CosPropertyService_PropertiesIterator.xml2
-rw-r--r--lib/cosProperty/doc/src/CosPropertyService_PropertyNamesIterator.xml2
-rw-r--r--lib/cosProperty/doc/src/CosPropertyService_PropertySet.xml2
-rw-r--r--lib/cosProperty/doc/src/CosPropertyService_PropertySetDef.xml2
-rw-r--r--lib/cosProperty/doc/src/CosPropertyService_PropertySetDefFactory.xml2
-rw-r--r--lib/cosProperty/doc/src/CosPropertyService_PropertySetFactory.xml2
-rw-r--r--lib/cosProperty/doc/src/Makefile2
-rw-r--r--lib/cosProperty/doc/src/book.xml2
-rw-r--r--lib/cosProperty/doc/src/ch_contents.xml2
-rw-r--r--lib/cosProperty/doc/src/ch_example.xml2
-rw-r--r--lib/cosProperty/doc/src/ch_install.xml2
-rw-r--r--lib/cosProperty/doc/src/ch_introduction.xml2
-rw-r--r--lib/cosProperty/doc/src/cosProperty.xml2
-rw-r--r--lib/cosProperty/doc/src/notes.xml2
-rw-r--r--lib/cosProperty/doc/src/part.xml2
-rw-r--r--lib/cosProperty/doc/src/part_notes.xml2
-rw-r--r--lib/cosProperty/doc/src/ref_man.xml2
-rw-r--r--lib/cosProperty/src/CosPropertyService_PropertiesIterator_impl.erl2
-rw-r--r--lib/cosProperty/src/CosPropertyService_PropertyNamesIterator_impl.erl2
-rw-r--r--lib/cosProperty/src/CosPropertyService_PropertySetDefFactory_impl.erl2
-rw-r--r--lib/cosProperty/src/CosPropertyService_PropertySetFactory_impl.erl2
-rw-r--r--lib/cosProperty/src/Makefile2
-rw-r--r--lib/cosProperty/src/cosProperty.hrl2
-rw-r--r--lib/cosProperty/test/Makefile2
-rw-r--r--lib/cosProperty/test/generated_SUITE.erl2
-rw-r--r--lib/cosProperty/test/property_SUITE.erl2
-rw-r--r--lib/cosTime/Makefile2
-rw-r--r--lib/cosTime/doc/src/CosTime_TIO.xml2
-rw-r--r--lib/cosTime/doc/src/CosTime_TimeService.xml2
-rw-r--r--lib/cosTime/doc/src/CosTime_UTO.xml2
-rw-r--r--lib/cosTime/doc/src/CosTimerEvent_TimerEventHandler.xml2
-rw-r--r--lib/cosTime/doc/src/CosTimerEvent_TimerEventService.xml2
-rw-r--r--lib/cosTime/doc/src/Makefile2
-rw-r--r--lib/cosTime/doc/src/book.xml2
-rw-r--r--lib/cosTime/doc/src/ch_contents.xml2
-rw-r--r--lib/cosTime/doc/src/ch_example.xml2
-rw-r--r--lib/cosTime/doc/src/ch_install.xml2
-rw-r--r--lib/cosTime/doc/src/ch_introduction.xml2
-rw-r--r--lib/cosTime/doc/src/cosTime.xml2
-rw-r--r--lib/cosTime/doc/src/notes.xml2
-rw-r--r--lib/cosTime/doc/src/part.xml2
-rw-r--r--lib/cosTime/doc/src/part_notes.xml2
-rw-r--r--lib/cosTime/doc/src/ref_man.xml2
-rw-r--r--lib/cosTime/src/CosTime_TIO_impl.erl2
-rw-r--r--lib/cosTime/src/CosTime_UTO_impl.erl2
-rw-r--r--lib/cosTime/src/CosTimerEvent_TimerEventHandler_impl.erl2
-rw-r--r--lib/cosTime/src/CosTimerEvent_TimerEventService_impl.erl2
-rw-r--r--lib/cosTime/src/Makefile2
-rw-r--r--lib/cosTime/src/cosTime.erl2
-rw-r--r--lib/cosTime/src/cosTimeApp.hrl2
-rw-r--r--lib/cosTime/test/Makefile2
-rw-r--r--lib/cosTime/test/generated_SUITE.erl2
-rw-r--r--lib/cosTime/test/time_SUITE.erl2
-rw-r--r--lib/cosTransactions/Makefile2
-rw-r--r--lib/cosTransactions/doc/src/CosTransactions_Control.xml2
-rw-r--r--lib/cosTransactions/doc/src/CosTransactions_Coordinator.xml2
-rw-r--r--lib/cosTransactions/doc/src/CosTransactions_RecoveryCoordinator.xml2
-rw-r--r--lib/cosTransactions/doc/src/CosTransactions_Resource.xml2
-rw-r--r--lib/cosTransactions/doc/src/CosTransactions_SubtransactionAwareResource.xml2
-rw-r--r--lib/cosTransactions/doc/src/CosTransactions_Synchronization.xml2
-rw-r--r--lib/cosTransactions/doc/src/CosTransactions_Terminator.xml2
-rw-r--r--lib/cosTransactions/doc/src/CosTransactions_TransactionFactory.xml2
-rw-r--r--lib/cosTransactions/doc/src/CosTransactions_TransactionalObject.xml2
-rw-r--r--lib/cosTransactions/doc/src/Makefile2
-rw-r--r--lib/cosTransactions/doc/src/book.xml2
-rw-r--r--lib/cosTransactions/doc/src/ch_contents.xml2
-rw-r--r--lib/cosTransactions/doc/src/ch_example.xml2
-rw-r--r--lib/cosTransactions/doc/src/ch_install.xml2
-rw-r--r--lib/cosTransactions/doc/src/ch_introduction.xml2
-rw-r--r--lib/cosTransactions/doc/src/ch_skeletons.xml2
-rw-r--r--lib/cosTransactions/doc/src/cosTransactions.xml2
-rw-r--r--lib/cosTransactions/doc/src/notes.xml2
-rw-r--r--lib/cosTransactions/doc/src/part.xml2
-rw-r--r--lib/cosTransactions/doc/src/part_notes.xml2
-rw-r--r--lib/cosTransactions/doc/src/ref_man.xml2
-rw-r--r--lib/cosTransactions/examples/Makefile2
-rw-r--r--lib/cosTransactions/src/CosTransactions_Terminator_impl.erl2
-rw-r--r--lib/cosTransactions/src/ETraP_Common.hrl2
-rw-r--r--lib/cosTransactions/src/Makefile2
-rw-r--r--lib/cosTransactions/src/cosTransactions.erl2
-rw-r--r--lib/cosTransactions/src/etrap_logmgr.erl2
-rw-r--r--lib/cosTransactions/test/Makefile2
-rw-r--r--lib/cosTransactions/test/etrap_test.cfg2
-rw-r--r--lib/cosTransactions/test/etrap_test.idl2
-rw-r--r--lib/cosTransactions/test/etrap_test_lib.erl2
-rw-r--r--lib/cosTransactions/test/etrap_test_lib.hrl2
-rw-r--r--lib/cosTransactions/test/etrap_test_server_impl.erl2
-rw-r--r--lib/cosTransactions/test/generated_SUITE.erl2
-rw-r--r--lib/cosTransactions/test/transactions_SUITE.erl2
-rw-r--r--lib/crypto/Makefile2
-rw-r--r--lib/crypto/c_src/Makefile.in2
-rw-r--r--lib/crypto/c_src/crypto.c240
-rw-r--r--lib/crypto/c_src/crypto_callback.c2
-rw-r--r--lib/crypto/c_src/crypto_callback.h2
-rw-r--r--lib/crypto/doc/src/book.xml2
-rw-r--r--lib/crypto/doc/src/crypto.xml22
-rw-r--r--lib/crypto/doc/src/crypto_app.xml2
-rw-r--r--lib/crypto/doc/src/licenses.xml2
-rw-r--r--lib/crypto/doc/src/notes.xml2
-rw-r--r--lib/crypto/doc/src/ref_man.xml2
-rw-r--r--lib/crypto/doc/src/release_notes.xml2
-rw-r--r--lib/crypto/doc/src/usersguide.xml2
-rw-r--r--lib/crypto/src/Makefile2
-rw-r--r--lib/crypto/src/crypto.app.src2
-rw-r--r--lib/crypto/src/crypto.appup.src2
-rw-r--r--lib/crypto/src/crypto.erl30
-rw-r--r--lib/crypto/test/blowfish_SUITE.erl2
-rw-r--r--lib/crypto/test/crypto_SUITE.erl53
-rw-r--r--lib/crypto/test/old_crypto_SUITE.erl10
-rw-r--r--lib/debugger/Makefile2
-rw-r--r--lib/debugger/doc/src/Makefile2
-rw-r--r--lib/debugger/doc/src/book.xml2
-rw-r--r--lib/debugger/doc/src/introduction.xml2
-rw-r--r--lib/debugger/doc/src/notes.xml2
-rw-r--r--lib/debugger/doc/src/ref_man.xml2
-rw-r--r--lib/debugger/priv/Makefile2
-rw-r--r--lib/debugger/src/Makefile2
-rw-r--r--lib/debugger/src/dbg_debugged.erl2
-rw-r--r--lib/debugger/src/dbg_idb.erl2
-rw-r--r--lib/debugger/src/dbg_iserver.erl2
-rw-r--r--lib/debugger/src/dbg_istk.erl2
-rw-r--r--lib/debugger/src/dbg_wx_break.erl2
-rw-r--r--lib/debugger/src/dbg_wx_break_win.erl2
-rw-r--r--lib/debugger/src/dbg_wx_code.erl2
-rw-r--r--lib/debugger/src/dbg_wx_filedialog_win.erl2
-rw-r--r--lib/debugger/src/dbg_wx_filedialog_win.hrl2
-rw-r--r--lib/debugger/src/dbg_wx_interpret.erl2
-rw-r--r--lib/debugger/src/dbg_wx_mon.erl2
-rw-r--r--lib/debugger/src/dbg_wx_mon_win.erl2
-rw-r--r--lib/debugger/src/dbg_wx_settings.erl2
-rw-r--r--lib/debugger/src/dbg_wx_src_view.erl2
-rw-r--r--lib/debugger/src/dbg_wx_trace_win.erl2
-rw-r--r--lib/debugger/src/dbg_wx_view.erl2
-rw-r--r--lib/debugger/src/dbg_wx_winman.erl2
-rw-r--r--lib/debugger/src/debugger.appup.src2
-rw-r--r--lib/debugger/src/debugger.erl2
-rw-r--r--lib/debugger/src/i.erl2
-rw-r--r--lib/debugger/src/int.erl2
-rw-r--r--lib/debugger/test/Makefile2
-rw-r--r--lib/debugger/test/andor_SUITE.erl183
-rw-r--r--lib/debugger/test/bs_bincomp_SUITE.erl69
-rw-r--r--lib/debugger/test/bs_construct_SUITE.erl262
-rw-r--r--lib/debugger/test/bs_match_bin_SUITE.erl73
-rw-r--r--lib/debugger/test/bs_match_int_SUITE.erl123
-rw-r--r--lib/debugger/test/bs_match_misc_SUITE.erl225
-rw-r--r--lib/debugger/test/bs_match_tail_SUITE.erl69
-rw-r--r--lib/debugger/test/bs_utf_SUITE.erl79
-rw-r--r--lib/debugger/test/bug_SUITE.erl54
-rw-r--r--lib/debugger/test/bug_SUITE_data/Makefile.src2
-rw-r--r--lib/debugger/test/bug_SUITE_data/otp2163.erl2
-rw-r--r--lib/debugger/test/bug_SUITE_data/otp4845.erl2
-rw-r--r--lib/debugger/test/cleanup.erl13
-rw-r--r--lib/debugger/test/dbg_ui_SUITE.erl124
-rw-r--r--lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/lists1.erl2
-rw-r--r--lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/ordsets1.erl2
-rw-r--r--lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/test.erl2
-rw-r--r--lib/debugger/test/debugger_SUITE.erl60
-rw-r--r--lib/debugger/test/debugger_test.erl2
-rw-r--r--lib/debugger/test/erl_eval_SUITE.erl1004
-rw-r--r--lib/debugger/test/exception_SUITE.erl293
-rw-r--r--lib/debugger/test/fun_SUITE.erl144
-rw-r--r--lib/debugger/test/guard_SUITE.erl1489
-rw-r--r--lib/debugger/test/int_SUITE.erl237
-rw-r--r--lib/debugger/test/int_SUITE_data/Emakefile1
-rw-r--r--lib/debugger/test/int_SUITE_data/Makefile.src40
-rw-r--r--lib/debugger/test/int_SUITE_data/guards.erl2
-rw-r--r--lib/debugger/test/int_SUITE_data/lists1.erl2
-rw-r--r--lib/debugger/test/int_SUITE_data/my_lists.erl2
-rw-r--r--lib/debugger/test/int_SUITE_data/ordsets1.erl2
-rw-r--r--lib/debugger/test/int_SUITE_data/test.erl2
-rw-r--r--lib/debugger/test/int_SUITE_data/test1.erl2
-rw-r--r--lib/debugger/test/int_break_SUITE.erl47
-rw-r--r--lib/debugger/test/int_break_SUITE_data/Makefile.src2
-rw-r--r--lib/debugger/test/int_break_SUITE_data/ordsets1.erl2
-rw-r--r--lib/debugger/test/int_eval_SUITE.erl247
-rw-r--r--lib/debugger/test/int_eval_SUITE_data/Makefile.src2
-rw-r--r--lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl2
-rw-r--r--lib/debugger/test/lc_SUITE.erl67
-rw-r--r--lib/debugger/test/line_number_SUITE.erl18
-rw-r--r--lib/debugger/test/map_SUITE.erl34
-rw-r--r--lib/debugger/test/record_SUITE.erl213
-rw-r--r--lib/debugger/test/test_lib.erl2
-rw-r--r--lib/debugger/test/trycatch_SUITE.erl569
-rw-r--r--lib/dialyzer/Makefile2
-rw-r--r--lib/dialyzer/README2
-rw-r--r--lib/dialyzer/doc/about.txt2
-rw-r--r--lib/dialyzer/doc/manual.txt2
-rw-r--r--lib/dialyzer/doc/src/book.xml2
-rw-r--r--lib/dialyzer/doc/src/dialyzer_chapter.xml2
-rw-r--r--lib/dialyzer/doc/src/notes.xml2
-rw-r--r--lib/dialyzer/doc/src/part.xml2
-rw-r--r--lib/dialyzer/doc/src/part_notes.xml2
-rw-r--r--lib/dialyzer/doc/src/ref_man.xml2
-rw-r--r--lib/dialyzer/info2
-rw-r--r--lib/dialyzer/src/Makefile2
-rw-r--r--lib/dialyzer/src/dialyzer.app.src8
-rw-r--r--lib/dialyzer/src/dialyzer.appup.src2
-rw-r--r--lib/dialyzer/src/dialyzer.erl3
-rw-r--r--lib/dialyzer/src/dialyzer.hrl4
-rw-r--r--lib/dialyzer/src/dialyzer_behaviours.erl2
-rw-r--r--lib/dialyzer/src/dialyzer_cl.erl2
-rw-r--r--lib/dialyzer/src/dialyzer_contracts.erl92
-rw-r--r--lib/dialyzer/src/dialyzer_dataflow.erl275
-rw-r--r--lib/dialyzer/src/dialyzer_dep.erl2
-rw-r--r--lib/dialyzer/src/dialyzer_explanation.erl2
-rw-r--r--lib/dialyzer/src/dialyzer_gui_wx.erl2
-rw-r--r--lib/dialyzer/src/dialyzer_options.erl1
-rw-r--r--lib/dialyzer/src/dialyzer_plt.erl2
-rw-r--r--lib/dialyzer/src/dialyzer_timing.erl2
-rw-r--r--lib/dialyzer/src/dialyzer_typesig.erl589
-rw-r--r--lib/dialyzer/src/dialyzer_utils.erl89
-rw-r--r--lib/dialyzer/test/behaviour_SUITE_data/results/supervisor_incorrect_return2
-rw-r--r--lib/dialyzer/test/behaviour_SUITE_data/src/proper/compile_flags.hrl2
-rw-r--r--lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_common.hrl55
-rw-r--r--lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_gen.erl611
-rw-r--r--lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_internal.hrl98
-rw-r--r--lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_types.erl1353
-rw-r--r--lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_typeserver.erl2411
-rw-r--r--lib/dialyzer/test/dialyzer_SUITE.erl2
-rw-r--r--lib/dialyzer/test/map_SUITE_data/dialyzer_options1
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/bad_argument5
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/contract7
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/contract_violation3
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/exact3
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/guard_update5
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/initial_dataflow4
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/is_map_guard5
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/map_galore28
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/map_in_guard4
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/map_in_guard213
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/map_size13
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/maps_merge11
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/opaque_key15
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/order17
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/subtract_value_flip0
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/typeflow4
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/typeflow213
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/typesig5
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/bad_argument.erl19
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/bug.erl63
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/contract.erl14
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/contract_violation.erl29
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/exact.erl23
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/guard_update.erl18
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/initial_dataflow.erl11
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/is_map_guard.erl17
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/map_galore.erl2824
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/map_in_guard.erl35
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/map_in_guard2.erl27
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/map_size.erl36
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/maps_merge.erl29
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/opaque_key/opaque_key_adt.erl69
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/opaque_key/opaque_key_use.erl97
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/order.erl56
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/subtract_value_flip.erl9
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/typeflow.erl25
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/typeflow2.erl88
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/typesig.erl9
-rw-r--r--lib/dialyzer/test/opaque_SUITE_data/src/modules/opaque_digraph.erl2
-rw-r--r--lib/dialyzer/test/opaque_SUITE_data/src/modules/opaque_erl_scan.erl2
-rw-r--r--lib/dialyzer/test/small_SUITE_data/results/literals3
-rw-r--r--lib/dialyzer/test/small_SUITE_data/results/maps14
-rw-r--r--lib/dialyzer/test/small_SUITE_data/results/maps_difftype2
-rw-r--r--lib/dialyzer/test/small_SUITE_data/results/maps_sum2
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/literals.erl6
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/maps1.erl2
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/maps_redef.erl12
-rw-r--r--lib/dialyzer/vsn.mk2
-rw-r--r--lib/diameter/Makefile2
-rwxr-xr-xlib/diameter/bin/diameterc2
-rw-r--r--lib/diameter/doc/src/Makefile2
-rw-r--r--lib/diameter/doc/src/book.xml2
-rw-r--r--lib/diameter/doc/src/depend.sed2
-rw-r--r--lib/diameter/doc/src/diameter.xml2
-rw-r--r--lib/diameter/doc/src/diameter_app.xml2
-rw-r--r--lib/diameter/doc/src/diameter_codec.xml2
-rw-r--r--lib/diameter/doc/src/diameter_dict.xml2
-rw-r--r--lib/diameter/doc/src/diameter_examples.xml2
-rw-r--r--lib/diameter/doc/src/diameter_intro.xml2
-rw-r--r--lib/diameter/doc/src/diameter_make.xml2
-rw-r--r--lib/diameter/doc/src/diameter_sctp.xml2
-rw-r--r--lib/diameter/doc/src/diameter_soc.xml2
-rw-r--r--lib/diameter/doc/src/diameter_soc_rfc6733.xml2
-rw-r--r--lib/diameter/doc/src/diameter_tcp.xml2
-rw-r--r--lib/diameter/doc/src/diameter_transport.xml2
-rw-r--r--lib/diameter/doc/src/diameter_using.xml2
-rw-r--r--lib/diameter/doc/src/files.mk2
-rw-r--r--lib/diameter/doc/src/notes.xml2
-rw-r--r--lib/diameter/doc/src/ref_man.xml2
-rw-r--r--lib/diameter/doc/src/seehere.sed2
-rw-r--r--lib/diameter/doc/src/user_man.xml2
-rw-r--r--lib/diameter/examples/code/client_cb.erl2
-rw-r--r--lib/diameter/examples/code/redirect.erl2
-rw-r--r--lib/diameter/examples/code/redirect_cb.erl2
-rw-r--r--lib/diameter/examples/code/relay_cb.erl2
-rw-r--r--lib/diameter/examples/code/sctp.erl2
-rw-r--r--lib/diameter/examples/dict/GNUmakefile2
-rw-r--r--lib/diameter/examples/dict/depend.sed2
-rw-r--r--lib/diameter/examples/dict/rfc4004_mip.dia2
-rw-r--r--lib/diameter/examples/dict/rfc4005_nas.dia2
-rw-r--r--lib/diameter/examples/dict/rfc4006_cc.dia2
-rw-r--r--lib/diameter/examples/dict/rfc4072_eap.dia2
-rw-r--r--lib/diameter/examples/dict/rfc4590_digest.dia2
-rw-r--r--lib/diameter/examples/dict/rfc4740_sip.dia2
-rw-r--r--lib/diameter/include/diameter.hrl2
-rw-r--r--lib/diameter/src/Makefile2
-rw-r--r--lib/diameter/src/app.sed2
-rw-r--r--lib/diameter/src/base/diameter_app.erl2
-rw-r--r--lib/diameter/src/base/diameter_callback.erl2
-rw-r--r--lib/diameter/src/base/diameter_dict.erl2
-rw-r--r--lib/diameter/src/base/diameter_internal.hrl2
-rw-r--r--lib/diameter/src/base/diameter_misc_sup.erl2
-rw-r--r--lib/diameter/src/base/diameter_peer_fsm_sup.erl2
-rw-r--r--lib/diameter/src/base/diameter_session.erl2
-rw-r--r--lib/diameter/src/base/diameter_watchdog_sup.erl2
-rw-r--r--lib/diameter/src/compiler/diameter_dict_parser.yrl2
-rw-r--r--lib/diameter/src/compiler/diameter_dict_scanner.erl2
-rw-r--r--lib/diameter/src/compiler/diameter_dict_util.erl2
-rw-r--r--lib/diameter/src/compiler/diameter_exprecs.erl2
-rw-r--r--lib/diameter/src/compiler/diameter_make.erl2
-rw-r--r--lib/diameter/src/compiler/diameter_vsn.hrl2
-rw-r--r--lib/diameter/src/depend.sed2
-rw-r--r--lib/diameter/src/diameter.app.src2
-rw-r--r--lib/diameter/src/diameter.appup.src2
-rw-r--r--lib/diameter/src/dict/acct_rfc6733.dia2
-rw-r--r--lib/diameter/src/dict/base_accounting.dia2
-rw-r--r--lib/diameter/src/dict/base_rfc3588.dia2
-rw-r--r--lib/diameter/src/dict/base_rfc6733.dia2
-rw-r--r--lib/diameter/src/dict/capup_rfc6737.dia2
-rw-r--r--lib/diameter/src/dict/relay.dia2
-rw-r--r--lib/diameter/src/info/diameter_dbg.erl2
-rw-r--r--lib/diameter/src/transport/diameter_etcp.erl2
-rw-r--r--lib/diameter/src/transport/diameter_etcp_sup.erl2
-rw-r--r--lib/diameter/src/transport/diameter_sctp_sup.erl2
-rw-r--r--lib/diameter/src/transport/diameter_tcp_sup.erl2
-rw-r--r--lib/diameter/src/transport/diameter_transport.erl2
-rw-r--r--lib/diameter/subdirs.mk2
-rw-r--r--lib/diameter/test/Makefile2
-rw-r--r--lib/diameter/test/coverspec.sed2
-rw-r--r--lib/diameter/test/depend.sed2
-rw-r--r--lib/diameter/test/diameter_3xxx_SUITE.erl2
-rw-r--r--lib/diameter/test/diameter_codec_SUITE_data/avps.dia2
-rw-r--r--lib/diameter/test/diameter_codec_SUITE_data/diameter_test_unknown.erl2
-rw-r--r--lib/diameter/test/diameter_codec_SUITE_data/recv.dia2
-rw-r--r--lib/diameter/test/diameter_codec_SUITE_data/send.dia2
-rw-r--r--lib/diameter/test/diameter_compiler_SUITE.erl2
-rw-r--r--lib/diameter/test/diameter_ct.hrl2
-rw-r--r--lib/diameter/test/diameter_dict_SUITE.erl2
-rw-r--r--lib/diameter/test/diameter_distribution_SUITE.erl2
-rw-r--r--lib/diameter/test/diameter_enum.erl2
-rw-r--r--lib/diameter/test/diameter_event_SUITE.erl2
-rw-r--r--lib/diameter/test/diameter_failover_SUITE.erl2
-rw-r--r--lib/diameter/test/diameter_length_SUITE.erl2
-rw-r--r--lib/diameter/test/diameter_reg_SUITE.erl2
-rw-r--r--lib/diameter/test/diameter_sync_SUITE.erl2
-rw-r--r--lib/diameter/test/diameter_tls_SUITE.erl2
-rw-r--r--lib/diameter/test/diameter_tls_SUITE_data/Makefile.ca2
-rw-r--r--lib/diameter/test/diameter_traffic_SUITE.erl2
-rw-r--r--lib/diameter/test/release.sed2
-rw-r--r--lib/edoc/doc/src/book.xml2
-rw-r--r--lib/edoc/doc/src/notes.xml2
-rw-r--r--lib/edoc/doc/src/part.xml2
-rw-r--r--lib/edoc/doc/src/part_notes.xml2
-rw-r--r--lib/edoc/doc/src/ref_man.xml2
-rw-r--r--lib/edoc/src/edoc.appup.src2
-rw-r--r--lib/edoc/src/edoc.erl15
-rw-r--r--lib/edoc/src/edoc_extract.erl48
-rw-r--r--lib/edoc/src/edoc_specs.erl20
-rw-r--r--lib/eldap/Makefile2
-rw-r--r--lib/eldap/doc/src/book.xml2
-rw-r--r--lib/eldap/doc/src/notes.xml2
-rw-r--r--lib/eldap/doc/src/ref_man.xml2
-rw-r--r--lib/eldap/doc/src/release_notes.xml2
-rw-r--r--lib/eldap/doc/src/usersguide.xml2
-rw-r--r--lib/eldap/src/Makefile4
-rw-r--r--lib/eldap/src/eldap.appup.src2
-rw-r--r--lib/eldap/test/Makefile2
-rw-r--r--lib/eldap/test/eldap_basic_SUITE.erl2
-rw-r--r--lib/eldap/test/make_certs.erl2
-rw-r--r--lib/eldap/vsn.mk2
-rw-r--r--lib/erl_docgen/Makefile2
-rw-r--r--lib/erl_docgen/doc/src/Makefile2
-rw-r--r--lib/erl_docgen/doc/src/block_tags.xml2
-rw-r--r--lib/erl_docgen/doc/src/book.xml2
-rw-r--r--lib/erl_docgen/doc/src/character_entities.xml2
-rw-r--r--lib/erl_docgen/doc/src/doc-build.xml2
-rw-r--r--lib/erl_docgen/doc/src/docgen_xml_check.xml2
-rw-r--r--lib/erl_docgen/doc/src/erl_docgen_app.xml2
-rw-r--r--lib/erl_docgen/doc/src/fasc_dtds.xml2
-rw-r--r--lib/erl_docgen/doc/src/header_tags.xml2
-rw-r--r--lib/erl_docgen/doc/src/inline_tags.xml2
-rw-r--r--lib/erl_docgen/doc/src/notes.xml2
-rw-r--r--lib/erl_docgen/doc/src/overview.xml2
-rw-r--r--lib/erl_docgen/doc/src/part.xml2
-rw-r--r--lib/erl_docgen/doc/src/ref_man.xml2
-rw-r--r--lib/erl_docgen/doc/src/refman_dtds.xml2
-rw-r--r--lib/erl_docgen/doc/src/user_guide_dtds.xml2
-rw-r--r--lib/erl_docgen/priv/bin/Makefile2
-rwxr-xr-xlib/erl_docgen/priv/bin/codeline_preprocessing.escript2
-rw-r--r--lib/erl_docgen/priv/bin/specs_gen.escript2
-rwxr-xr-xlib/erl_docgen/priv/bin/xml_from_edoc.escript2
-rwxr-xr-xlib/erl_docgen/priv/bin/xref_mod_app.escript2
-rw-r--r--lib/erl_docgen/priv/css/Makefile2
-rw-r--r--lib/erl_docgen/priv/dtd/Makefile2
-rw-r--r--lib/erl_docgen/priv/dtd_html_entities/Makefile2
-rw-r--r--lib/erl_docgen/priv/dtd_man_entities/Makefile2
-rw-r--r--lib/erl_docgen/priv/fop.xconf2
-rw-r--r--lib/erl_docgen/priv/images/Makefile2
-rw-r--r--lib/erl_docgen/priv/js/flipmenu/Makefile2
-rw-r--r--lib/erl_docgen/priv/xsl/Makefile2
-rw-r--r--lib/erl_docgen/priv/xsl/db_eix.xsl2
-rw-r--r--lib/erl_docgen/priv/xsl/db_html.xsl2
-rw-r--r--lib/erl_docgen/priv/xsl/db_html_params.xsl2
-rw-r--r--lib/erl_docgen/priv/xsl/db_man.xsl2
-rw-r--r--lib/erl_docgen/priv/xsl/db_pdf.xsl2
-rw-r--r--lib/erl_docgen/priv/xsl/db_pdf_params.xsl2
-rw-r--r--lib/erl_docgen/src/Makefile2
-rw-r--r--lib/erl_docgen/src/docgen_xmerl_xml_cb.erl2
-rw-r--r--lib/erl_docgen/src/erl_docgen.appup.src2
-rw-r--r--lib/erl_interface/Makefile2
-rw-r--r--lib/erl_interface/configure.in2
-rw-r--r--lib/erl_interface/doc/src/Makefile2
-rw-r--r--lib/erl_interface/doc/src/book.xml2
-rw-r--r--lib/erl_interface/doc/src/ei.xml2
-rw-r--r--lib/erl_interface/doc/src/ei_connect.xml2
-rw-r--r--lib/erl_interface/doc/src/ei_users_guide.xml2
-rw-r--r--lib/erl_interface/doc/src/erl_call.xml2
-rw-r--r--lib/erl_interface/doc/src/erl_connect.xml2
-rw-r--r--lib/erl_interface/doc/src/erl_error.xml2
-rw-r--r--lib/erl_interface/doc/src/erl_eterm.xml2
-rw-r--r--lib/erl_interface/doc/src/erl_format.xml2
-rw-r--r--lib/erl_interface/doc/src/erl_global.xml2
-rw-r--r--lib/erl_interface/doc/src/erl_interface.xml2
-rw-r--r--lib/erl_interface/doc/src/erl_malloc.xml2
-rw-r--r--lib/erl_interface/doc/src/erl_marshal.xml2
-rw-r--r--lib/erl_interface/doc/src/notes.xml2
-rw-r--r--lib/erl_interface/doc/src/notes_history.xml2
-rw-r--r--lib/erl_interface/doc/src/part.xml2
-rw-r--r--lib/erl_interface/doc/src/part_erl_interface.xml2
-rw-r--r--lib/erl_interface/doc/src/part_notes.xml2
-rw-r--r--lib/erl_interface/doc/src/part_notes_history.xml2
-rw-r--r--lib/erl_interface/doc/src/ref_man.xml2
-rw-r--r--lib/erl_interface/doc/src/ref_man_ei.xml2
-rw-r--r--lib/erl_interface/doc/src/ref_man_erl_interface.xml2
-rw-r--r--lib/erl_interface/doc/src/registry.xml2
-rw-r--r--lib/erl_interface/include/ei.h5
-rw-r--r--lib/erl_interface/include/ei_connect.h2
-rw-r--r--lib/erl_interface/include/eicode.h2
-rw-r--r--lib/erl_interface/include/erl_interface.h8
-rw-r--r--lib/erl_interface/src/Makefile2
-rw-r--r--lib/erl_interface/src/Makefile.in2
-rw-r--r--lib/erl_interface/src/connect/ei_connect.c5
-rw-r--r--lib/erl_interface/src/connect/ei_connect_int.h3
-rw-r--r--lib/erl_interface/src/connect/ei_resolve.c2
-rw-r--r--lib/erl_interface/src/connect/ei_resolve.h2
-rw-r--r--lib/erl_interface/src/connect/eirecv.c2
-rw-r--r--lib/erl_interface/src/connect/eirecv.h2
-rw-r--r--lib/erl_interface/src/connect/eisend.h2
-rw-r--r--lib/erl_interface/src/connect/send.c2
-rw-r--r--lib/erl_interface/src/connect/send_exit.c2
-rw-r--r--lib/erl_interface/src/connect/send_reg.c2
-rw-r--r--lib/erl_interface/src/decode/decode_atom.c2
-rw-r--r--lib/erl_interface/src/decode/decode_big.c2
-rw-r--r--lib/erl_interface/src/decode/decode_bignum.c2
-rw-r--r--lib/erl_interface/src/decode/decode_binary.c2
-rw-r--r--lib/erl_interface/src/decode/decode_boolean.c2
-rw-r--r--lib/erl_interface/src/decode/decode_char.c2
-rw-r--r--lib/erl_interface/src/decode/decode_double.c2
-rw-r--r--lib/erl_interface/src/decode/decode_fun.c2
-rw-r--r--lib/erl_interface/src/decode/decode_intlist.c2
-rw-r--r--lib/erl_interface/src/decode/decode_list_header.c2
-rw-r--r--lib/erl_interface/src/decode/decode_long.c2
-rw-r--r--lib/erl_interface/src/decode/decode_longlong.c2
-rw-r--r--lib/erl_interface/src/decode/decode_pid.c12
-rw-r--r--lib/erl_interface/src/decode/decode_port.c12
-rw-r--r--lib/erl_interface/src/decode/decode_ref.c16
-rw-r--r--lib/erl_interface/src/decode/decode_skip.c5
-rw-r--r--lib/erl_interface/src/decode/decode_skip.h2
-rw-r--r--lib/erl_interface/src/decode/decode_string.c2
-rw-r--r--lib/erl_interface/src/decode/decode_trace.c2
-rw-r--r--lib/erl_interface/src/decode/decode_tuple_header.c2
-rw-r--r--lib/erl_interface/src/decode/decode_ulong.c2
-rw-r--r--lib/erl_interface/src/decode/decode_ulonglong.c2
-rw-r--r--lib/erl_interface/src/decode/decode_version.c2
-rw-r--r--lib/erl_interface/src/eidefs.mk.in2
-rw-r--r--lib/erl_interface/src/encode/eicode.h2
-rw-r--r--lib/erl_interface/src/encode/encode_atom.c2
-rw-r--r--lib/erl_interface/src/encode/encode_big.c2
-rw-r--r--lib/erl_interface/src/encode/encode_bignum.c2
-rw-r--r--lib/erl_interface/src/encode/encode_binary.c2
-rw-r--r--lib/erl_interface/src/encode/encode_boolean.c2
-rw-r--r--lib/erl_interface/src/encode/encode_char.c2
-rw-r--r--lib/erl_interface/src/encode/encode_double.c2
-rw-r--r--lib/erl_interface/src/encode/encode_fun.c2
-rw-r--r--lib/erl_interface/src/encode/encode_list_header.c2
-rw-r--r--lib/erl_interface/src/encode/encode_long.c2
-rw-r--r--lib/erl_interface/src/encode/encode_longlong.c2
-rw-r--r--lib/erl_interface/src/encode/encode_pid.c15
-rw-r--r--lib/erl_interface/src/encode/encode_port.c14
-rw-r--r--lib/erl_interface/src/encode/encode_ref.c12
-rw-r--r--lib/erl_interface/src/encode/encode_string.c2
-rw-r--r--lib/erl_interface/src/encode/encode_trace.c2
-rw-r--r--lib/erl_interface/src/encode/encode_tuple_header.c2
-rw-r--r--lib/erl_interface/src/encode/encode_ulong.c2
-rw-r--r--lib/erl_interface/src/encode/encode_ulonglong.c2
-rw-r--r--lib/erl_interface/src/encode/encode_version.c2
-rw-r--r--lib/erl_interface/src/epmd/ei_epmd.h2
-rw-r--r--lib/erl_interface/src/epmd/epmd_port.c2
-rw-r--r--lib/erl_interface/src/epmd/epmd_publish.c2
-rw-r--r--lib/erl_interface/src/epmd/epmd_unpublish.c2
-rw-r--r--lib/erl_interface/src/erl_interface.app.src2
-rw-r--r--lib/erl_interface/src/erl_interface.appup.src2
-rw-r--r--lib/erl_interface/src/legacy/decode_term.c2
-rw-r--r--lib/erl_interface/src/legacy/encode_term.c2
-rw-r--r--lib/erl_interface/src/legacy/erl_config.h2
-rw-r--r--lib/erl_interface/src/legacy/erl_connect.c2
-rw-r--r--lib/erl_interface/src/legacy/erl_connect.h2
-rw-r--r--lib/erl_interface/src/legacy/erl_error.c2
-rw-r--r--lib/erl_interface/src/legacy/erl_error.h2
-rw-r--r--lib/erl_interface/src/legacy/erl_eterm.c16
-rw-r--r--lib/erl_interface/src/legacy/erl_eterm.h8
-rw-r--r--lib/erl_interface/src/legacy/erl_fix_alloc.c2
-rw-r--r--lib/erl_interface/src/legacy/erl_fix_alloc.h2
-rw-r--r--lib/erl_interface/src/legacy/erl_format.c2
-rw-r--r--lib/erl_interface/src/legacy/erl_format.h2
-rw-r--r--lib/erl_interface/src/legacy/erl_global.h2
-rw-r--r--lib/erl_interface/src/legacy/erl_internal.h2
-rw-r--r--lib/erl_interface/src/legacy/erl_malloc.c2
-rw-r--r--lib/erl_interface/src/legacy/erl_malloc.h2
-rw-r--r--lib/erl_interface/src/legacy/erl_marshal.c201
-rw-r--r--lib/erl_interface/src/legacy/erl_marshal.h2
-rw-r--r--lib/erl_interface/src/legacy/erl_resolve.c2
-rw-r--r--lib/erl_interface/src/legacy/erl_timeout.c2
-rw-r--r--lib/erl_interface/src/legacy/erl_timeout.h2
-rw-r--r--lib/erl_interface/src/legacy/global_names.c2
-rw-r--r--lib/erl_interface/src/legacy/global_register.c2
-rw-r--r--lib/erl_interface/src/legacy/global_unregister.c2
-rw-r--r--lib/erl_interface/src/legacy/global_whereis.c2
-rw-r--r--lib/erl_interface/src/legacy/portability.h2
-rw-r--r--lib/erl_interface/src/misc/ei_compat.c2
-rw-r--r--lib/erl_interface/src/misc/ei_decode_term.c50
-rw-r--r--lib/erl_interface/src/misc/ei_decode_term.h2
-rw-r--r--lib/erl_interface/src/misc/ei_format.c2
-rw-r--r--lib/erl_interface/src/misc/ei_format.h2
-rw-r--r--lib/erl_interface/src/misc/ei_internal.h2
-rw-r--r--lib/erl_interface/src/misc/ei_locking.c2
-rw-r--r--lib/erl_interface/src/misc/ei_locking.h2
-rw-r--r--lib/erl_interface/src/misc/ei_malloc.c2
-rw-r--r--lib/erl_interface/src/misc/ei_malloc.h2
-rw-r--r--lib/erl_interface/src/misc/ei_portio.c2
-rw-r--r--lib/erl_interface/src/misc/ei_portio.h2
-rw-r--r--lib/erl_interface/src/misc/ei_printterm.c5
-rw-r--r--lib/erl_interface/src/misc/ei_printterm.h2
-rw-r--r--lib/erl_interface/src/misc/ei_pthreads.c2
-rw-r--r--lib/erl_interface/src/misc/ei_trace.c2
-rw-r--r--lib/erl_interface/src/misc/ei_trace.h2
-rw-r--r--lib/erl_interface/src/misc/ei_x_encode.c2
-rw-r--r--lib/erl_interface/src/misc/ei_x_encode.h2
-rw-r--r--lib/erl_interface/src/misc/eidef.h2
-rw-r--r--lib/erl_interface/src/misc/eiext.h2
-rw-r--r--lib/erl_interface/src/misc/get_type.c11
-rw-r--r--lib/erl_interface/src/misc/putget.h2
-rw-r--r--lib/erl_interface/src/misc/show_msg.c5
-rw-r--r--lib/erl_interface/src/misc/show_msg.h2
-rw-r--r--lib/erl_interface/src/not_used/ei_send.c2
-rw-r--r--lib/erl_interface/src/not_used/ei_send_reg.c2
-rw-r--r--lib/erl_interface/src/not_used/send_link.c2
-rw-r--r--lib/erl_interface/src/not_used/whereis.c2
-rw-r--r--lib/erl_interface/src/prog/ei_fake_prog.c2
-rw-r--r--lib/erl_interface/src/prog/erl_call.c2
-rw-r--r--lib/erl_interface/src/prog/erl_fake_prog.c2
-rw-r--r--lib/erl_interface/src/prog/erl_start.c2
-rw-r--r--lib/erl_interface/src/prog/erl_start.h2
-rw-r--r--lib/erl_interface/src/registry/hash.h2
-rw-r--r--lib/erl_interface/src/registry/hash_dohash.c2
-rw-r--r--lib/erl_interface/src/registry/hash_foreach.c2
-rw-r--r--lib/erl_interface/src/registry/hash_freetab.c2
-rw-r--r--lib/erl_interface/src/registry/hash_insert.c2
-rw-r--r--lib/erl_interface/src/registry/hash_isprime.c2
-rw-r--r--lib/erl_interface/src/registry/hash_lookup.c2
-rw-r--r--lib/erl_interface/src/registry/hash_newtab.c2
-rw-r--r--lib/erl_interface/src/registry/hash_remove.c2
-rw-r--r--lib/erl_interface/src/registry/hash_resize.c2
-rw-r--r--lib/erl_interface/src/registry/hash_rlookup.c2
-rw-r--r--lib/erl_interface/src/registry/reg.h2
-rw-r--r--lib/erl_interface/src/registry/reg_close.c2
-rw-r--r--lib/erl_interface/src/registry/reg_delete.c2
-rw-r--r--lib/erl_interface/src/registry/reg_dirty.c2
-rw-r--r--lib/erl_interface/src/registry/reg_dump.c2
-rw-r--r--lib/erl_interface/src/registry/reg_free.c2
-rw-r--r--lib/erl_interface/src/registry/reg_get.c2
-rw-r--r--lib/erl_interface/src/registry/reg_getf.c2
-rw-r--r--lib/erl_interface/src/registry/reg_geti.c2
-rw-r--r--lib/erl_interface/src/registry/reg_getp.c2
-rw-r--r--lib/erl_interface/src/registry/reg_gets.c2
-rw-r--r--lib/erl_interface/src/registry/reg_make.c2
-rw-r--r--lib/erl_interface/src/registry/reg_open.c2
-rw-r--r--lib/erl_interface/src/registry/reg_purge.c2
-rw-r--r--lib/erl_interface/src/registry/reg_resize.c2
-rw-r--r--lib/erl_interface/src/registry/reg_restore.c2
-rw-r--r--lib/erl_interface/src/registry/reg_set.c2
-rw-r--r--lib/erl_interface/src/registry/reg_setf.c2
-rw-r--r--lib/erl_interface/src/registry/reg_seti.c2
-rw-r--r--lib/erl_interface/src/registry/reg_setp.c2
-rw-r--r--lib/erl_interface/src/registry/reg_sets.c2
-rw-r--r--lib/erl_interface/src/registry/reg_stat.c2
-rw-r--r--lib/erl_interface/src/registry/reg_tabstat.c2
-rw-r--r--lib/erl_interface/test/Makefile2
-rw-r--r--lib/erl_interface/test/Makefile.src2
-rw-r--r--lib/erl_interface/test/all_SUITE_data/Makefile.first2
-rw-r--r--lib/erl_interface/test/all_SUITE_data/Makefile.src2
-rw-r--r--lib/erl_interface/test/all_SUITE_data/ei_runner.c21
-rw-r--r--lib/erl_interface/test/all_SUITE_data/ei_runner.h5
-rw-r--r--lib/erl_interface/test/all_SUITE_data/gccifier.c2
-rwxr-xr-xlib/erl_interface/test/all_SUITE_data/gccifier.sh2
-rw-r--r--lib/erl_interface/test/all_SUITE_data/init_tc.erl2
-rw-r--r--lib/erl_interface/test/all_SUITE_data/reclaim.h2
-rw-r--r--lib/erl_interface/test/all_SUITE_data/runner.c10
-rw-r--r--lib/erl_interface/test/all_SUITE_data/runner.h2
-rw-r--r--lib/erl_interface/test/ei_accept_SUITE.erl194
-rw-r--r--lib/erl_interface/test/ei_accept_SUITE_data/Makefile.first2
-rw-r--r--lib/erl_interface/test/ei_accept_SUITE_data/Makefile.src2
-rw-r--r--lib/erl_interface/test/ei_accept_SUITE_data/ei_accept_test.c2
-rw-r--r--lib/erl_interface/test/ei_accept_SUITE_data/eiaccnode.c2
-rw-r--r--lib/erl_interface/test/ei_connect_SUITE.erl232
-rw-r--r--lib/erl_interface/test/ei_connect_SUITE_data/Makefile.first2
-rw-r--r--lib/erl_interface/test/ei_connect_SUITE_data/Makefile.src2
-rw-r--r--lib/erl_interface/test/ei_connect_SUITE_data/ei_connect_test.c2
-rw-r--r--lib/erl_interface/test/ei_connect_SUITE_data/einode.c2
-rw-r--r--lib/erl_interface/test/ei_decode_SUITE.erl366
-rw-r--r--lib/erl_interface/test/ei_decode_SUITE_data/Makefile.first2
-rw-r--r--lib/erl_interface/test/ei_decode_SUITE_data/Makefile.src2
-rw-r--r--lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c2
-rw-r--r--lib/erl_interface/test/ei_decode_encode_SUITE.erl264
-rw-r--r--lib/erl_interface/test/ei_decode_encode_SUITE_data/Makefile.first2
-rw-r--r--lib/erl_interface/test/ei_decode_encode_SUITE_data/Makefile.src2
-rw-r--r--lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c15
-rw-r--r--lib/erl_interface/test/ei_encode_SUITE.erl390
-rw-r--r--lib/erl_interface/test/ei_encode_SUITE_data/Makefile.first2
-rw-r--r--lib/erl_interface/test/ei_encode_SUITE_data/Makefile.src2
-rw-r--r--lib/erl_interface/test/ei_encode_SUITE_data/ei_encode_test.c2
-rw-r--r--lib/erl_interface/test/ei_format_SUITE.erl192
-rw-r--r--lib/erl_interface/test/ei_format_SUITE_data/Makefile.first2
-rw-r--r--lib/erl_interface/test/ei_format_SUITE_data/Makefile.src2
-rw-r--r--lib/erl_interface/test/ei_format_SUITE_data/ei_format_test.c2
-rw-r--r--lib/erl_interface/test/ei_print_SUITE.erl186
-rw-r--r--lib/erl_interface/test/ei_print_SUITE_data/Makefile.first2
-rw-r--r--lib/erl_interface/test/ei_print_SUITE_data/Makefile.src2
-rw-r--r--lib/erl_interface/test/ei_print_SUITE_data/ei_print_test.c2
-rw-r--r--lib/erl_interface/test/ei_tmo_SUITE.erl793
-rw-r--r--lib/erl_interface/test/ei_tmo_SUITE_data/Makefile.first2
-rw-r--r--lib/erl_interface/test/ei_tmo_SUITE_data/Makefile.src2
-rw-r--r--lib/erl_interface/test/ei_tmo_SUITE_data/ei_tmo_test.c13
-rw-r--r--lib/erl_interface/test/erl_connect_SUITE.erl122
-rw-r--r--lib/erl_interface/test/erl_connect_SUITE_data/Makefile.first2
-rw-r--r--lib/erl_interface/test/erl_connect_SUITE_data/Makefile.src2
-rw-r--r--lib/erl_interface/test/erl_connect_SUITE_data/erl_connect_test.c2
-rw-r--r--lib/erl_interface/test/erl_eterm_SUITE.erl1141
-rw-r--r--lib/erl_interface/test/erl_eterm_SUITE_data/Makefile.first2
-rw-r--r--lib/erl_interface/test/erl_eterm_SUITE_data/Makefile.src2
-rw-r--r--lib/erl_interface/test/erl_eterm_SUITE_data/cnode.c2
-rw-r--r--lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c2
-rw-r--r--lib/erl_interface/test/erl_eterm_SUITE_data/print_term.c2
-rw-r--r--lib/erl_interface/test/erl_ext_SUITE.erl68
-rw-r--r--lib/erl_interface/test/erl_ext_SUITE_data/Makefile.first2
-rw-r--r--lib/erl_interface/test/erl_ext_SUITE_data/Makefile.src2
-rw-r--r--lib/erl_interface/test/erl_ext_SUITE_data/ext_test.c2
-rw-r--r--lib/erl_interface/test/erl_format_SUITE.erl174
-rw-r--r--lib/erl_interface/test/erl_format_SUITE_data/Makefile.first2
-rw-r--r--lib/erl_interface/test/erl_format_SUITE_data/Makefile.src2
-rw-r--r--lib/erl_interface/test/erl_format_SUITE_data/format_test.c2
-rw-r--r--lib/erl_interface/test/erl_global_SUITE.erl110
-rw-r--r--lib/erl_interface/test/erl_global_SUITE_data/Makefile.first2
-rw-r--r--lib/erl_interface/test/erl_global_SUITE_data/Makefile.src2
-rw-r--r--lib/erl_interface/test/erl_global_SUITE_data/erl_global_test.c2
-rw-r--r--lib/erl_interface/test/erl_match_SUITE.erl325
-rw-r--r--lib/erl_interface/test/erl_match_SUITE_data/Makefile.first2
-rw-r--r--lib/erl_interface/test/erl_match_SUITE_data/Makefile.src2
-rw-r--r--lib/erl_interface/test/erl_match_SUITE_data/match_test.c2
-rw-r--r--lib/erl_interface/test/port_call_SUITE.erl112
-rw-r--r--lib/erl_interface/test/port_call_SUITE_data/Makefile.src2
-rw-r--r--lib/erl_interface/test/port_call_SUITE_data/port_call_drv.c2
-rw-r--r--lib/erl_interface/test/runner.erl20
-rw-r--r--lib/et/Makefile2
-rw-r--r--lib/et/doc/src/Makefile2
-rw-r--r--lib/et/doc/src/book.xml2
-rw-r--r--lib/et/doc/src/et.xml2
-rw-r--r--lib/et/doc/src/et_collector.xml2
-rw-r--r--lib/et/doc/src/et_desc.xmlsrc2
-rw-r--r--lib/et/doc/src/et_examples.xmlsrc2
-rw-r--r--lib/et/doc/src/et_intro.xml2
-rw-r--r--lib/et/doc/src/et_selector.xml2
-rw-r--r--lib/et/doc/src/et_tutorial.xmlsrc2
-rw-r--r--lib/et/doc/src/et_viewer.xml2
-rw-r--r--lib/et/doc/src/files.mk2
-rw-r--r--lib/et/doc/src/notes.xml2
-rw-r--r--lib/et/doc/src/part.xml2
-rw-r--r--lib/et/doc/src/ref_man.xml2
-rw-r--r--lib/et/examples/Makefile2
-rw-r--r--lib/et/examples/et_demo.erl2
-rw-r--r--lib/et/include/et.hrl2
-rw-r--r--lib/et/src/Makefile2
-rw-r--r--lib/et/src/et.app.src6
-rw-r--r--lib/et/src/et.appup.src2
-rw-r--r--lib/et/src/et.erl2
-rw-r--r--lib/et/src/et_collector.erl2
-rw-r--r--lib/et/src/et_internal.hrl2
-rw-r--r--lib/et/src/et_selector.erl48
-rw-r--r--lib/et/src/et_viewer.erl2
-rw-r--r--lib/et/src/et_wx_contents_viewer.erl2
-rw-r--r--lib/et/src/et_wx_viewer.erl2
-rw-r--r--lib/et/src/modules.mk2
-rw-r--r--lib/et/subdirs.mk2
-rw-r--r--lib/et/test/Makefile2
-rw-r--r--lib/et/test/et_SUITE.erl24
-rw-r--r--lib/et/test/et_test_lib.erl2
-rw-r--r--lib/et/test/et_test_lib.hrl2
-rw-r--r--lib/et/test/et_wx_SUITE.erl25
-rwxr-xr-xlib/et/test/ett2
-rw-r--r--lib/et/test/ett.erl2
-rw-r--r--lib/eunit/doc/src/book.xml2
-rw-r--r--lib/eunit/doc/src/notes.xml2
-rw-r--r--lib/eunit/doc/src/part.xml2
-rw-r--r--lib/eunit/doc/src/part_notes.xml2
-rw-r--r--lib/eunit/doc/src/ref_man.xml2
-rw-r--r--lib/eunit/src/eunit.appup.src2
-rw-r--r--lib/eunit/src/eunit_lib.erl6
-rw-r--r--lib/eunit/test/Makefile2
-rw-r--r--lib/eunit/test/eunit_SUITE.erl2
-rw-r--r--lib/gs/Makefile2
-rw-r--r--lib/gs/doc/src/Makefile2
-rw-r--r--lib/gs/doc/src/book.xml2
-rw-r--r--lib/gs/doc/src/gs.xml2
-rw-r--r--lib/gs/doc/src/gs_chapter1.xml2
-rw-r--r--lib/gs/doc/src/gs_chapter2.xmlsrc2
-rw-r--r--lib/gs/doc/src/gs_chapter3.xml2
-rw-r--r--lib/gs/doc/src/gs_chapter4.xmlsrc2
-rw-r--r--lib/gs/doc/src/gs_chapter5.xmlsrc2
-rw-r--r--lib/gs/doc/src/gs_chapter6.xmlsrc2
-rw-r--r--lib/gs/doc/src/gs_chapter7.xmlsrc2
-rw-r--r--lib/gs/doc/src/gs_chapter8.xmlsrc2
-rw-r--r--lib/gs/doc/src/notes.xml2
-rw-r--r--lib/gs/doc/src/part.xml2
-rw-r--r--lib/gs/doc/src/part_notes.xml2
-rw-r--r--lib/gs/doc/src/ref_man.xml2
-rw-r--r--lib/gs/examples/Makefile2
-rw-r--r--lib/gs/examples/ball.erl2
-rw-r--r--lib/gs/examples/browser.erl2
-rw-r--r--lib/gs/examples/calc.erl2
-rw-r--r--lib/gs/examples/calc2.erl2
-rw-r--r--lib/gs/examples/color_demo.erl2
-rw-r--r--lib/gs/examples/color_demo2.erl2
-rw-r--r--lib/gs/examples/distrib_draw.erl2
-rw-r--r--lib/gs/examples/entry_demo.erl2
-rw-r--r--lib/gs/examples/event_test.erl2
-rw-r--r--lib/gs/examples/file_dialog.erl2
-rw-r--r--lib/gs/examples/focus_demo.erl2
-rw-r--r--lib/gs/examples/frac.erl2
-rw-r--r--lib/gs/examples/line_demo.erl2
-rw-r--r--lib/gs/examples/man.erl2
-rw-r--r--lib/gs/examples/menu_demo.erl2
-rw-r--r--lib/gs/examples/rubber.erl2
-rw-r--r--lib/gs/src/Makefile2
-rw-r--r--lib/gs/src/gs.appup.src2
-rw-r--r--lib/gs/src/gs.erl2
-rw-r--r--lib/gs/src/gs_frontend.erl2
-rw-r--r--lib/gs/src/gs_make.erl2
-rw-r--r--lib/gs/src/gs_packer.erl2
-rw-r--r--lib/gs/src/gs_widgets.erl2
-rw-r--r--lib/gs/src/gse.erl2
-rw-r--r--lib/gs/src/gstk.erl2
-rw-r--r--lib/gs/src/gstk.hrl2
-rw-r--r--lib/gs/src/gstk_arc.erl2
-rw-r--r--lib/gs/src/gstk_button.erl2
-rw-r--r--lib/gs/src/gstk_canvas.erl2
-rw-r--r--lib/gs/src/gstk_checkbutton.erl2
-rw-r--r--lib/gs/src/gstk_db.erl2
-rw-r--r--lib/gs/src/gstk_editor.erl2
-rw-r--r--lib/gs/src/gstk_entry.erl2
-rw-r--r--lib/gs/src/gstk_font.erl2
-rw-r--r--lib/gs/src/gstk_frame.erl2
-rw-r--r--lib/gs/src/gstk_generic.erl2
-rw-r--r--lib/gs/src/gstk_grid.erl2
-rw-r--r--lib/gs/src/gstk_gridline.erl2
-rw-r--r--lib/gs/src/gstk_gs.erl2
-rw-r--r--lib/gs/src/gstk_image.erl2
-rw-r--r--lib/gs/src/gstk_label.erl2
-rw-r--r--lib/gs/src/gstk_line.erl2
-rw-r--r--lib/gs/src/gstk_listbox.erl2
-rw-r--r--lib/gs/src/gstk_menu.erl2
-rw-r--r--lib/gs/src/gstk_menubar.erl2
-rw-r--r--lib/gs/src/gstk_menubutton.erl2
-rw-r--r--lib/gs/src/gstk_menuitem.erl2
-rw-r--r--lib/gs/src/gstk_oval.erl2
-rw-r--r--lib/gs/src/gstk_polygon.erl2
-rw-r--r--lib/gs/src/gstk_port_handler.erl2
-rw-r--r--lib/gs/src/gstk_radiobutton.erl2
-rw-r--r--lib/gs/src/gstk_rectangle.erl2
-rw-r--r--lib/gs/src/gstk_scale.erl2
-rw-r--r--lib/gs/src/gstk_text.erl2
-rw-r--r--lib/gs/src/gstk_widgets.erl2
-rw-r--r--lib/gs/src/gstk_window.erl2
-rw-r--r--lib/gs/src/tcl2erl.erl2
-rw-r--r--lib/gs/src/tool_file_dialog.erl2
-rw-r--r--lib/gs/src/tool_utils.erl2
-rw-r--r--lib/gs/tcl/Makefile2
-rw-r--r--lib/gs/tcl/Makefile.in2
-rw-r--r--lib/hipe/Makefile2
-rw-r--r--lib/hipe/amd64/Makefile2
-rw-r--r--lib/hipe/amd64/hipe_amd64_assemble.erl2
-rw-r--r--lib/hipe/amd64/hipe_amd64_defuse.erl2
-rw-r--r--lib/hipe/amd64/hipe_amd64_encode.erl2
-rw-r--r--lib/hipe/amd64/hipe_amd64_frame.erl2
-rw-r--r--lib/hipe/amd64/hipe_amd64_liveness.erl2
-rw-r--r--lib/hipe/amd64/hipe_amd64_main.erl2
-rw-r--r--lib/hipe/amd64/hipe_amd64_pp.erl2
-rw-r--r--lib/hipe/amd64/hipe_amd64_ra.erl2
-rw-r--r--lib/hipe/amd64/hipe_amd64_ra_finalise.erl2
-rw-r--r--lib/hipe/amd64/hipe_amd64_ra_ls.erl2
-rw-r--r--lib/hipe/amd64/hipe_amd64_ra_naive.erl2
-rw-r--r--lib/hipe/amd64/hipe_amd64_ra_postconditions.erl2
-rw-r--r--lib/hipe/amd64/hipe_amd64_ra_sse2_postconditions.erl2
-rw-r--r--lib/hipe/amd64/hipe_amd64_ra_x87_ls.erl2
-rw-r--r--lib/hipe/amd64/hipe_amd64_registers.erl2
-rw-r--r--lib/hipe/amd64/hipe_amd64_spill_restore.erl2
-rw-r--r--lib/hipe/amd64/hipe_amd64_x87.erl2
-rw-r--r--lib/hipe/amd64/hipe_rtl_to_amd64.erl2
-rw-r--r--lib/hipe/arm/Makefile2
-rw-r--r--lib/hipe/arm/hipe_arm.erl2
-rw-r--r--lib/hipe/arm/hipe_arm.hrl2
-rw-r--r--lib/hipe/arm/hipe_arm_assemble.erl2
-rw-r--r--lib/hipe/arm/hipe_arm_cfg.erl2
-rw-r--r--lib/hipe/arm/hipe_arm_defuse.erl2
-rw-r--r--lib/hipe/arm/hipe_arm_encode.erl2
-rw-r--r--lib/hipe/arm/hipe_arm_finalise.erl2
-rw-r--r--lib/hipe/arm/hipe_arm_frame.erl2
-rw-r--r--lib/hipe/arm/hipe_arm_liveness_gpr.erl2
-rw-r--r--lib/hipe/arm/hipe_arm_main.erl2
-rw-r--r--lib/hipe/arm/hipe_arm_pp.erl2
-rw-r--r--lib/hipe/arm/hipe_arm_ra.erl2
-rw-r--r--lib/hipe/arm/hipe_arm_ra_finalise.erl2
-rw-r--r--lib/hipe/arm/hipe_arm_ra_ls.erl2
-rw-r--r--lib/hipe/arm/hipe_arm_ra_naive.erl2
-rw-r--r--lib/hipe/arm/hipe_arm_ra_postconditions.erl2
-rw-r--r--lib/hipe/arm/hipe_arm_registers.erl2
-rw-r--r--lib/hipe/arm/hipe_rtl_to_arm.erl2
-rw-r--r--lib/hipe/cerl/Makefile2
-rw-r--r--lib/hipe/cerl/cerl_closurean.erl2
-rw-r--r--lib/hipe/cerl/cerl_hipe_primops.hrl2
-rw-r--r--lib/hipe/cerl/cerl_lib.erl2
-rw-r--r--lib/hipe/cerl/cerl_messagean.erl2
-rw-r--r--lib/hipe/cerl/cerl_pmatch.erl2
-rw-r--r--lib/hipe/cerl/cerl_prettypr.erl2
-rw-r--r--lib/hipe/cerl/cerl_typean.erl2
-rw-r--r--lib/hipe/cerl/erl_bif_types.erl113
-rw-r--r--lib/hipe/cerl/erl_types.erl849
-rw-r--r--lib/hipe/doc/Makefile2
-rw-r--r--lib/hipe/doc/src/Makefile2
-rw-r--r--lib/hipe/doc/src/book.xml2
-rw-r--r--lib/hipe/doc/src/hipe_app.xml2
-rw-r--r--lib/hipe/doc/src/notes.xml2
-rw-r--r--lib/hipe/doc/src/part_notes.xml2
-rw-r--r--lib/hipe/doc/src/ref_man.xml2
-rw-r--r--lib/hipe/flow/Makefile2
-rw-r--r--lib/hipe/flow/cfg.inc2
-rw-r--r--lib/hipe/flow/ebb.inc2
-rw-r--r--lib/hipe/flow/hipe_bb.erl2
-rw-r--r--lib/hipe/flow/hipe_bb.hrl2
-rw-r--r--lib/hipe/flow/hipe_dominators.erl2
-rw-r--r--lib/hipe/flow/hipe_gen_cfg.erl2
-rw-r--r--lib/hipe/flow/liveness.inc2
-rw-r--r--lib/hipe/icode/Makefile2
-rw-r--r--lib/hipe/icode/hipe_beam_to_icode.erl2
-rw-r--r--lib/hipe/icode/hipe_icode.hrl2
-rw-r--r--lib/hipe/icode/hipe_icode_bincomp.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_callgraph.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_cfg.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_coordinator.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_ebb.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_fp.erl402
-rw-r--r--lib/hipe/icode/hipe_icode_heap_test.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_inline_bifs.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_instruction_counter.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_liveness.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_mulret.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_pp.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_primops.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_primops.hrl2
-rw-r--r--lib/hipe/icode/hipe_icode_range.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_split_arith.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_ssa.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_ssa_const_prop.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_ssa_copy_prop.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_type.erl2
-rw-r--r--lib/hipe/icode/hipe_icode_type.hrl2
-rw-r--r--lib/hipe/llvm/Makefile2
-rw-r--r--lib/hipe/main/Makefile2
-rw-r--r--lib/hipe/main/hipe.appup.src2
-rw-r--r--lib/hipe/misc/Makefile2
-rw-r--r--lib/hipe/misc/hipe_consttab.erl2
-rw-r--r--lib/hipe/misc/hipe_consttab.hrl2
-rw-r--r--lib/hipe/misc/hipe_data_pp.erl2
-rw-r--r--lib/hipe/misc/hipe_gensym.erl2
-rw-r--r--lib/hipe/misc/hipe_pack_constants.erl2
-rw-r--r--lib/hipe/misc/hipe_sdi.erl2
-rw-r--r--lib/hipe/misc/hipe_sdi.hrl2
-rw-r--r--lib/hipe/opt/Makefile2
-rw-r--r--lib/hipe/opt/hipe_schedule.erl2
-rw-r--r--lib/hipe/opt/hipe_schedule_prio.erl2
-rw-r--r--lib/hipe/opt/hipe_spillmin.erl2
-rw-r--r--lib/hipe/opt/hipe_spillmin_color.erl2
-rw-r--r--lib/hipe/opt/hipe_spillmin_scan.erl2
-rw-r--r--lib/hipe/opt/hipe_target_machine.erl2
-rw-r--r--lib/hipe/opt/hipe_ultra_mod2.erl2
-rw-r--r--lib/hipe/opt/hipe_ultra_prio.erl2
-rw-r--r--lib/hipe/ppc/Makefile2
-rw-r--r--lib/hipe/ppc/hipe_ppc.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc.hrl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_assemble.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_cfg.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_defuse.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_encode.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_finalise.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_frame.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_liveness_all.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_liveness_fpr.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_liveness_gpr.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_main.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_pp.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_ra.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_ra_finalise.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_ra_ls.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_ra_naive.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_ra_postconditions.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_ra_postconditions_fp.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_registers.erl2
-rw-r--r--lib/hipe/ppc/hipe_rtl_to_ppc.erl2
-rw-r--r--lib/hipe/regalloc/Makefile2
-rw-r--r--lib/hipe/regalloc/hipe_adj_list.erl2
-rw-r--r--lib/hipe/regalloc/hipe_amd64_specific.erl2
-rw-r--r--lib/hipe/regalloc/hipe_amd64_specific_sse2.erl2
-rw-r--r--lib/hipe/regalloc/hipe_amd64_specific_x87.erl2
-rw-r--r--lib/hipe/regalloc/hipe_arm_specific.erl2
-rw-r--r--lib/hipe/regalloc/hipe_coalescing_regalloc.erl2
-rw-r--r--lib/hipe/regalloc/hipe_graph_coloring_regalloc.erl2
-rw-r--r--lib/hipe/regalloc/hipe_ig.erl2
-rw-r--r--lib/hipe/regalloc/hipe_ig_moves.erl2
-rw-r--r--lib/hipe/regalloc/hipe_ls_regalloc.erl2
-rw-r--r--lib/hipe/regalloc/hipe_moves.erl2
-rw-r--r--lib/hipe/regalloc/hipe_node_sets.erl2
-rw-r--r--lib/hipe/regalloc/hipe_optimistic_regalloc.erl2
-rw-r--r--lib/hipe/regalloc/hipe_ppc_specific.erl2
-rw-r--r--lib/hipe/regalloc/hipe_ppc_specific_fp.erl2
-rw-r--r--lib/hipe/regalloc/hipe_reg_worklists.erl2
-rw-r--r--lib/hipe/regalloc/hipe_regalloc_loop.erl2
-rw-r--r--lib/hipe/regalloc/hipe_sparc_specific.erl2
-rw-r--r--lib/hipe/regalloc/hipe_sparc_specific_fp.erl2
-rw-r--r--lib/hipe/regalloc/hipe_spillcost.erl2
-rw-r--r--lib/hipe/regalloc/hipe_spillcost.hrl2
-rw-r--r--lib/hipe/regalloc/hipe_temp_map.erl2
-rw-r--r--lib/hipe/regalloc/hipe_x86_specific.erl2
-rw-r--r--lib/hipe/regalloc/hipe_x86_specific_x87.erl2
-rw-r--r--lib/hipe/rtl/Makefile2
-rw-r--r--lib/hipe/rtl/hipe_icode2rtl.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl.hrl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_arch.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_arith.inc2
-rw-r--r--lib/hipe/rtl/hipe_rtl_arith_32.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_arith_64.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_binary.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_binary_match.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_cfg.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_cleanup_const.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_exceptions.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_lcm.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_liveness.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_mk_switch.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_primops.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_ssa.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_ssa_avail_expr.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_ssa_const_prop.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_ssapre.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_symbolic.erl2
-rw-r--r--lib/hipe/rtl/hipe_rtl_varmap.erl2
-rw-r--r--lib/hipe/sparc/Makefile2
-rw-r--r--lib/hipe/sparc/hipe_rtl_to_sparc.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc.hrl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_assemble.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_cfg.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_defuse.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_encode.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_finalise.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_frame.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_liveness_all.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_liveness_fpr.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_liveness_gpr.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_main.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_pp.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_ra.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_ra_finalise.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_ra_ls.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_ra_naive.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_ra_postconditions.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_ra_postconditions_fp.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_registers.erl2
-rw-r--r--lib/hipe/ssa/hipe_ssa.inc2
-rw-r--r--lib/hipe/ssa/hipe_ssa_const_prop.inc2
-rw-r--r--lib/hipe/ssa/hipe_ssa_copy_prop.inc2
-rw-r--r--lib/hipe/ssa/hipe_ssa_liveness.inc2
-rw-r--r--lib/hipe/test/basic_SUITE_data/basic_floats.erl70
-rw-r--r--lib/hipe/test/bs_SUITE_data/bs_match_compiler.erl1235
-rw-r--r--lib/hipe/test/hipe_SUITE.erl3
-rw-r--r--lib/hipe/test/hipe_testsuite_driver.erl2
-rw-r--r--lib/hipe/tools/Makefile2
-rw-r--r--lib/hipe/tools/hipe_jit.erl2
-rw-r--r--lib/hipe/tools/hipe_profile.erl2
-rw-r--r--lib/hipe/tools/hipe_timer.erl2
-rw-r--r--lib/hipe/util/Makefile2
-rw-r--r--lib/hipe/util/hipe_digraph.erl2
-rw-r--r--lib/hipe/util/hipe_dot.erl2
-rw-r--r--lib/hipe/util/hipe_timing.erl2
-rw-r--r--lib/hipe/util/hipe_vectors.erl2
-rw-r--r--lib/hipe/util/hipe_vectors.hrl2
-rw-r--r--lib/hipe/x86/Makefile2
-rw-r--r--lib/hipe/x86/hipe_rtl_to_x86.erl2
-rw-r--r--lib/hipe/x86/hipe_x86.erl2
-rw-r--r--lib/hipe/x86/hipe_x86.hrl2
-rw-r--r--lib/hipe/x86/hipe_x86_assemble.erl2
-rw-r--r--lib/hipe/x86/hipe_x86_cfg.erl2
-rw-r--r--lib/hipe/x86/hipe_x86_defuse.erl2
-rw-r--r--lib/hipe/x86/hipe_x86_encode.erl2
-rw-r--r--lib/hipe/x86/hipe_x86_frame.erl2
-rw-r--r--lib/hipe/x86/hipe_x86_liveness.erl2
-rw-r--r--lib/hipe/x86/hipe_x86_main.erl2
-rw-r--r--lib/hipe/x86/hipe_x86_postpass.erl2
-rw-r--r--lib/hipe/x86/hipe_x86_pp.erl2
-rw-r--r--lib/hipe/x86/hipe_x86_ra.erl2
-rw-r--r--lib/hipe/x86/hipe_x86_ra_finalise.erl2
-rw-r--r--lib/hipe/x86/hipe_x86_ra_ls.erl2
-rw-r--r--lib/hipe/x86/hipe_x86_ra_naive.erl2
-rw-r--r--lib/hipe/x86/hipe_x86_ra_postconditions.erl2
-rw-r--r--lib/hipe/x86/hipe_x86_ra_x87_ls.erl2
-rw-r--r--lib/hipe/x86/hipe_x86_registers.erl2
-rw-r--r--lib/hipe/x86/hipe_x86_spill_restore.erl2
-rw-r--r--lib/hipe/x86/hipe_x86_x87.erl2
-rw-r--r--lib/ic/Makefile2
-rw-r--r--lib/ic/c_src/Makefile2
-rw-r--r--lib/ic/c_src/Makefile.in2
-rw-r--r--lib/ic/c_src/Makefile.win322
-rw-r--r--lib/ic/c_src/ic.c2
-rw-r--r--lib/ic/c_src/ic_tmo.c2
-rw-r--r--lib/ic/c_src/oe_ei_code_erlang_binary.c2
-rw-r--r--lib/ic/c_src/oe_ei_decode_longlong.c2
-rw-r--r--lib/ic/c_src/oe_ei_decode_ulonglong.c2
-rw-r--r--lib/ic/c_src/oe_ei_decode_wchar.c2
-rw-r--r--lib/ic/c_src/oe_ei_decode_wstring.c2
-rw-r--r--lib/ic/c_src/oe_ei_encode_atom.c2
-rw-r--r--lib/ic/c_src/oe_ei_encode_char.c2
-rw-r--r--lib/ic/c_src/oe_ei_encode_double.c2
-rw-r--r--lib/ic/c_src/oe_ei_encode_list_header.c2
-rw-r--r--lib/ic/c_src/oe_ei_encode_long.c2
-rw-r--r--lib/ic/c_src/oe_ei_encode_longlong.c2
-rw-r--r--lib/ic/c_src/oe_ei_encode_pid.c2
-rw-r--r--lib/ic/c_src/oe_ei_encode_port.c2
-rw-r--r--lib/ic/c_src/oe_ei_encode_ref.c2
-rw-r--r--lib/ic/c_src/oe_ei_encode_string.c2
-rw-r--r--lib/ic/c_src/oe_ei_encode_term.c2
-rw-r--r--lib/ic/c_src/oe_ei_encode_tuple_header.c2
-rw-r--r--lib/ic/c_src/oe_ei_encode_ulong.c2
-rw-r--r--lib/ic/c_src/oe_ei_encode_ulonglong.c2
-rw-r--r--lib/ic/c_src/oe_ei_encode_version.c2
-rw-r--r--lib/ic/c_src/oe_ei_encode_wchar.c2
-rw-r--r--lib/ic/c_src/oe_ei_encode_wstring.c2
-rw-r--r--lib/ic/doc/src/CORBA_Environment_alloc.xml2
-rw-r--r--lib/ic/doc/src/Makefile2
-rw-r--r--lib/ic/doc/src/book.xml2
-rw-r--r--lib/ic/doc/src/c-part.xml2
-rw-r--r--lib/ic/doc/src/ch_basic_idl.xml2
-rw-r--r--lib/ic/doc/src/ch_c_client.xml2
-rw-r--r--lib/ic/doc/src/ch_c_corba_env.xml2
-rw-r--r--lib/ic/doc/src/ch_c_mapping.xml2
-rw-r--r--lib/ic/doc/src/ch_c_server.xml2
-rw-r--r--lib/ic/doc/src/ch_erl_genserv.xml2
-rw-r--r--lib/ic/doc/src/ch_erl_plain.xml2
-rw-r--r--lib/ic/doc/src/ch_ic_protocol.xml2
-rw-r--r--lib/ic/doc/src/ch_introduction.xml2
-rw-r--r--lib/ic/doc/src/ch_java.xml2
-rw-r--r--lib/ic/doc/src/erl-part.xml2
-rw-r--r--lib/ic/doc/src/ic.xml2
-rw-r--r--lib/ic/doc/src/ic_c_protocol.xml2
-rw-r--r--lib/ic/doc/src/ic_clib.xml2
-rw-r--r--lib/ic/doc/src/java-part.xml2
-rw-r--r--lib/ic/doc/src/notes.xml2
-rw-r--r--lib/ic/doc/src/part.xml2
-rw-r--r--lib/ic/doc/src/part_notes.xml2
-rw-r--r--lib/ic/doc/src/ref_man.xml2
-rw-r--r--lib/ic/examples/all-against-all/Makefile2
-rw-r--r--lib/ic/examples/all-against-all/Makefile.win322
-rw-r--r--lib/ic/examples/all-against-all/callbacks.c2
-rw-r--r--lib/ic/examples/all-against-all/client.c2
-rw-r--r--lib/ic/examples/all-against-all/client.erl2
-rw-r--r--lib/ic/examples/all-against-all/client.java2
-rw-r--r--lib/ic/examples/all-against-all/rmod_random_impl.erl2
-rw-r--r--lib/ic/examples/all-against-all/server.c2
-rw-r--r--lib/ic/examples/all-against-all/server.erl2
-rw-r--r--lib/ic/examples/all-against-all/server.java2
-rw-r--r--lib/ic/examples/all-against-all/serverImpl.java2
-rw-r--r--lib/ic/examples/c-client/Makefile2
-rw-r--r--lib/ic/examples/c-client/client.c2
-rw-r--r--lib/ic/examples/c-client/rmod_random_impl.erl2
-rw-r--r--lib/ic/examples/c-client/test.erl2
-rw-r--r--lib/ic/examples/c-server/Makefile2
-rw-r--r--lib/ic/examples/c-server/callbacks.c2
-rw-r--r--lib/ic/examples/c-server/client.c2
-rw-r--r--lib/ic/examples/c-server/client.erl2
-rw-r--r--lib/ic/examples/c-server/server.c2
-rw-r--r--lib/ic/examples/erl-genserv/rmod_random_impl.erl2
-rw-r--r--lib/ic/examples/erl-plain/rmod_random_impl.erl2
-rw-r--r--lib/ic/examples/java-client-server/client.java2
-rw-r--r--lib/ic/examples/java-client-server/server.java2
-rw-r--r--lib/ic/examples/java-client-server/serverImpl.java2
-rw-r--r--lib/ic/examples/pre_post_condition/Makefile2
-rw-r--r--lib/ic/examples/pre_post_condition/m_i_impl.erl2
-rw-r--r--lib/ic/examples/pre_post_condition/tracer.erl2
-rw-r--r--lib/ic/include/ic.h2
-rw-r--r--lib/ic/java_src/Makefile2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/Any.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/AnyHelper.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/AnyHolder.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/BooleanHolder.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/ByteHolder.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/CharHolder.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/DoubleHolder.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/Environment.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/FloatHolder.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/Holder.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/IntHolder.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/LongHolder.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/Makefile2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/Pid.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/PidHelper.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/PidHolder.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/Port.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/PortHelper.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/PortHolder.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/Ref.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/RefHelper.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/RefHolder.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/ShortHolder.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/StringHolder.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/TCKind.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/Term.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/TermHelper.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/TermHolder.java2
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/TypeCode.java2
-rw-r--r--lib/ic/src/Makefile2
-rw-r--r--lib/ic/src/ic.erl2
-rw-r--r--lib/ic/src/ic.hrl2
-rw-r--r--lib/ic/src/ic_array_java.erl2
-rw-r--r--lib/ic/src/ic_attribute_java.erl2
-rw-r--r--lib/ic/src/ic_cbe.erl2
-rw-r--r--lib/ic/src/ic_cclient.erl2
-rw-r--r--lib/ic/src/ic_code.erl2
-rw-r--r--lib/ic/src/ic_codegen.erl2
-rw-r--r--lib/ic/src/ic_constant_java.erl2
-rw-r--r--lib/ic/src/ic_cserver.erl2
-rw-r--r--lib/ic/src/ic_debug.hrl2
-rw-r--r--lib/ic/src/ic_enum_java.erl2
-rw-r--r--lib/ic/src/ic_erl_template.erl2
-rw-r--r--lib/ic/src/ic_erlbe.erl2
-rw-r--r--lib/ic/src/ic_error.erl2
-rw-r--r--lib/ic/src/ic_fetch.erl2
-rw-r--r--lib/ic/src/ic_file.erl2
-rw-r--r--lib/ic/src/ic_forms.erl2
-rw-r--r--lib/ic/src/ic_genobj.erl2
-rw-r--r--lib/ic/src/ic_java_type.erl2
-rw-r--r--lib/ic/src/ic_jbe.erl2
-rw-r--r--lib/ic/src/ic_noc.erl2
-rw-r--r--lib/ic/src/ic_options.erl2
-rw-r--r--lib/ic/src/ic_plainbe.erl2
-rw-r--r--lib/ic/src/ic_pp.erl2
-rw-r--r--lib/ic/src/ic_pragma.erl2
-rw-r--r--lib/ic/src/ic_sequence_java.erl2
-rw-r--r--lib/ic/src/ic_struct_java.erl2
-rw-r--r--lib/ic/src/ic_symtab.erl2
-rw-r--r--lib/ic/src/ic_union_java.erl2
-rw-r--r--lib/ic/src/ic_util.erl2
-rw-r--r--lib/ic/src/icenum.erl2
-rw-r--r--lib/ic/src/iceval.erl2
-rw-r--r--lib/ic/src/icforms.hrl2
-rw-r--r--lib/ic/src/icparse.yrl2
-rw-r--r--lib/ic/src/icpreproc.erl2
-rw-r--r--lib/ic/src/icscan.erl2
-rw-r--r--lib/ic/src/icstruct.erl2
-rw-r--r--lib/ic/src/ictk.erl2
-rw-r--r--lib/ic/src/ictype.erl2
-rw-r--r--lib/ic/src/icunion.erl2
-rw-r--r--lib/ic/src/icyeccpre.hrl2
-rw-r--r--lib/ic/test/Makefile2
-rw-r--r--lib/ic/test/c_client_erl_server_SUITE.erl2
-rw-r--r--lib/ic/test/c_client_erl_server_SUITE_data/Makefile.src2
-rw-r--r--lib/ic/test/c_client_erl_server_SUITE_data/c_client.c2
-rw-r--r--lib/ic/test/c_client_erl_server_SUITE_data/c_erl_test.idl2
-rw-r--r--lib/ic/test/c_client_erl_server_SUITE_data/erl_server.erl2
-rw-r--r--lib/ic/test/c_client_erl_server_SUITE_data/m_i_impl.erl2
-rw-r--r--lib/ic/test/c_client_erl_server_proto_SUITE.erl2
-rw-r--r--lib/ic/test/c_client_erl_server_proto_SUITE_data/Makefile.src2
-rw-r--r--lib/ic/test/c_client_erl_server_proto_SUITE_data/c_client.c2
-rw-r--r--lib/ic/test/c_client_erl_server_proto_SUITE_data/c_erl_test.idl2
-rw-r--r--lib/ic/test/c_client_erl_server_proto_SUITE_data/erl_server.erl2
-rw-r--r--lib/ic/test/c_client_erl_server_proto_SUITE_data/m_i_impl.erl2
-rw-r--r--lib/ic/test/c_client_erl_server_proto_SUITE_data/my.c2
-rw-r--r--lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl2
-rw-r--r--lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/Makefile.src2
-rw-r--r--lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/c_client.c2
-rw-r--r--lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/c_erl_test.idl2
-rw-r--r--lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/erl_server.erl2
-rw-r--r--lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/m_i_impl.erl2
-rw-r--r--lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/my.c2
-rw-r--r--lib/ic/test/erl_client_c_server_SUITE.erl2
-rw-r--r--lib/ic/test/erl_client_c_server_SUITE_data/Makefile.src2
-rw-r--r--lib/ic/test/erl_client_c_server_SUITE_data/c_server.c2
-rw-r--r--lib/ic/test/erl_client_c_server_SUITE_data/callbacks.c2
-rw-r--r--lib/ic/test/erl_client_c_server_SUITE_data/erl_c_test.idl2
-rw-r--r--lib/ic/test/erl_client_c_server_SUITE_data/erl_client.erl2
-rw-r--r--lib/ic/test/erl_client_c_server_proto_SUITE.erl2
-rw-r--r--lib/ic/test/erl_client_c_server_proto_SUITE_data/Makefile.src2
-rw-r--r--lib/ic/test/erl_client_c_server_proto_SUITE_data/c_server.c2
-rw-r--r--lib/ic/test/erl_client_c_server_proto_SUITE_data/callbacks.c2
-rw-r--r--lib/ic/test/erl_client_c_server_proto_SUITE_data/erl_c_test.idl2
-rw-r--r--lib/ic/test/erl_client_c_server_proto_SUITE_data/erl_client.erl2
-rw-r--r--lib/ic/test/erl_client_c_server_proto_SUITE_data/my.c2
-rw-r--r--lib/ic/test/ic_SUITE.erl2
-rw-r--r--lib/ic/test/ic_SUITE_data/attr.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/c_err1.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/c_err2.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/c_err3.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/c_norm.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/enum.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/forward.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/include.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/include2.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/include3.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/inherit.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/inherit_err.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/inherit_warn.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/mult_ids.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/nasty.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/one.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/one_followed.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/one_out.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/one_raises.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/one_void.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/raises_reg.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/struct.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/syntax1.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/syntax2.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/syntax3.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/syntax4.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/syntax5.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/syntax6.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/type.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/typeid.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/u_case_mult.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/u_default.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/u_mult.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/u_norm.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/u_type.idl2
-rw-r--r--lib/ic/test/ic_SUITE_data/undef_id.idl2
-rw-r--r--lib/ic/test/ic_be_SUITE.erl2
-rw-r--r--lib/ic/test/ic_be_SUITE_data/plain.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE.erl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/arg.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/cascade.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/comment.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/concat.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/define.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/if.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/if_zero.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/improp_nest_constr.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/inc.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/included1.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/included2.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/includer.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/line.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/misc.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/nopara.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/predef.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/predef_time.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/self_ref.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/separate.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/swallow_sc.idl2
-rw-r--r--lib/ic/test/ic_pp_SUITE_data/unintended_grp.idl2
-rw-r--r--lib/ic/test/ic_pragma_SUITE.erl2
-rw-r--r--lib/ic/test/ic_pragma_SUITE_data/reg_m0.idl2
-rw-r--r--lib/ic/test/ic_pragma_SUITE_data/reg_m1.idl2
-rw-r--r--lib/ic/test/ic_pragma_SUITE_data/reg_m2.idl2
-rw-r--r--lib/ic/test/ic_pragma_SUITE_data/reg_m3.idl2
-rw-r--r--lib/ic/test/ic_pragma_SUITE_data/reg_m4.idl2
-rw-r--r--lib/ic/test/ic_pragma_SUITE_data/reg_m5.idl2
-rw-r--r--lib/ic/test/ic_pragma_SUITE_data/reg_m6.idl2
-rw-r--r--lib/ic/test/ic_pragma_SUITE_data/reg_m7.idl2
-rw-r--r--lib/ic/test/ic_pragma_SUITE_data/uggly.idl2
-rw-r--r--lib/ic/test/ic_register_SUITE.erl2
-rw-r--r--lib/ic/test/ic_register_SUITE_data/reg_m10.idl2
-rw-r--r--lib/ic/test/ic_register_SUITE_data/reg_m11.idl2
-rw-r--r--lib/ic/test/ic_register_SUITE_data/reg_m12.idl2
-rw-r--r--lib/ic/test/ic_register_SUITE_data/reg_m8.idl2
-rw-r--r--lib/ic/test/ic_register_SUITE_data/reg_m9.idl2
-rw-r--r--lib/ic/test/java_client_erl_server_SUITE.erl2
-rw-r--r--lib/ic/test/java_client_erl_server_SUITE_data/JavaClient.java2
-rw-r--r--lib/ic/test/java_client_erl_server_SUITE_data/Makefile.src2
-rw-r--r--lib/ic/test/java_client_erl_server_SUITE_data/java_erl_test.idl2
-rw-r--r--lib/ic/test/java_client_erl_server_SUITE_data/m_i_impl.erl2
-rw-r--r--lib/inets/Makefile2
-rw-r--r--lib/inets/doc/src/book.xml2
-rw-r--r--lib/inets/doc/src/ftp.xml2
-rw-r--r--lib/inets/doc/src/ftp_client.xml2
-rw-r--r--lib/inets/doc/src/http_client.xml2
-rw-r--r--lib/inets/doc/src/httpd_socket.xml2
-rw-r--r--lib/inets/doc/src/httpd_util.xml2
-rw-r--r--lib/inets/doc/src/inets.xml2
-rw-r--r--lib/inets/doc/src/inets_services.xml2
-rw-r--r--lib/inets/doc/src/introduction.xml2
-rw-r--r--lib/inets/doc/src/mod_alias.xml2
-rw-r--r--lib/inets/doc/src/mod_auth.xml2
-rw-r--r--lib/inets/doc/src/mod_esi.xml68
-rw-r--r--lib/inets/doc/src/mod_security.xml2
-rw-r--r--lib/inets/doc/src/notes.xml52
-rw-r--r--lib/inets/doc/src/notes_history.xml2
-rw-r--r--lib/inets/doc/src/part.xml2
-rw-r--r--lib/inets/doc/src/part_notes.xml2
-rw-r--r--lib/inets/doc/src/part_notes_history.xml2
-rw-r--r--lib/inets/examples/Makefile2
-rw-r--r--lib/inets/examples/httpd_load_test/Makefile2
-rw-r--r--lib/inets/examples/httpd_load_test/hdlt.erl2
-rw-r--r--lib/inets/examples/httpd_load_test/hdlt.sh.skel2
-rw-r--r--lib/inets/examples/httpd_load_test/hdlt_client.erl2
-rw-r--r--lib/inets/examples/httpd_load_test/hdlt_ctrl.erl2
-rw-r--r--lib/inets/examples/httpd_load_test/hdlt_logger.erl2
-rw-r--r--lib/inets/examples/httpd_load_test/hdlt_logger.hrl2
-rw-r--r--lib/inets/examples/httpd_load_test/hdlt_server.erl2
-rw-r--r--lib/inets/examples/httpd_load_test/hdlt_slave.erl2
-rw-r--r--lib/inets/examples/httpd_load_test/modules.mk2
-rw-r--r--lib/inets/examples/server_root/Makefile2
-rw-r--r--lib/inets/examples/server_root/conf/8080.conf2
-rw-r--r--lib/inets/examples/server_root/conf/8888.conf2
-rw-r--r--lib/inets/examples/server_root/conf/httpd.conf4
-rw-r--r--lib/inets/examples/server_root/conf/ssl.conf2
-rw-r--r--lib/inets/include/httpd.hrl2
-rw-r--r--lib/inets/include/mod_auth.hrl2
-rw-r--r--lib/inets/priv/Makefile2
-rw-r--r--lib/inets/src/Makefile2
-rw-r--r--lib/inets/src/ftp/Makefile2
-rw-r--r--lib/inets/src/ftp/ftp_internal.hrl2
-rw-r--r--lib/inets/src/ftp/ftp_progress.erl2
-rw-r--r--lib/inets/src/ftp/ftp_response.erl2
-rw-r--r--lib/inets/src/ftp/ftp_sup.erl2
-rw-r--r--lib/inets/src/http_client/Makefile2
-rw-r--r--lib/inets/src/http_client/httpc.erl8
-rw-r--r--lib/inets/src/http_client/httpc_cookie.erl2
-rw-r--r--lib/inets/src/http_client/httpc_handler_sup.erl2
-rw-r--r--lib/inets/src/http_client/httpc_internal.hrl2
-rw-r--r--lib/inets/src/http_client/httpc_manager.erl2
-rw-r--r--lib/inets/src/http_client/httpc_profile_sup.erl2
-rw-r--r--lib/inets/src/http_client/httpc_request.erl25
-rw-r--r--lib/inets/src/http_client/httpc_response.erl2
-rw-r--r--lib/inets/src/http_client/httpc_sup.erl2
-rw-r--r--lib/inets/src/http_lib/Makefile2
-rw-r--r--lib/inets/src/http_lib/http_chunk.erl2
-rw-r--r--lib/inets/src/http_lib/http_response.erl2
-rw-r--r--lib/inets/src/http_lib/http_transport.erl2
-rw-r--r--lib/inets/src/http_lib/http_uri.erl2
-rw-r--r--lib/inets/src/http_lib/http_util.erl2
-rw-r--r--lib/inets/src/http_server/httpd.erl2
-rw-r--r--lib/inets/src/http_server/httpd.hrl2
-rw-r--r--lib/inets/src/http_server/httpd_acceptor.erl2
-rw-r--r--lib/inets/src/http_server/httpd_acceptor_sup.erl2
-rw-r--r--lib/inets/src/http_server/httpd_cgi.erl2
-rw-r--r--lib/inets/src/http_server/httpd_conf.erl2
-rw-r--r--lib/inets/src/http_server/httpd_connection_sup.erl2
-rw-r--r--lib/inets/src/http_server/httpd_esi.erl2
-rw-r--r--lib/inets/src/http_server/httpd_example.erl20
-rw-r--r--lib/inets/src/http_server/httpd_file.erl2
-rw-r--r--lib/inets/src/http_server/httpd_instance_sup.erl2
-rw-r--r--lib/inets/src/http_server/httpd_internal.hrl2
-rw-r--r--lib/inets/src/http_server/httpd_log.erl2
-rw-r--r--lib/inets/src/http_server/httpd_manager.erl2
-rw-r--r--lib/inets/src/http_server/httpd_misc_sup.erl2
-rw-r--r--lib/inets/src/http_server/httpd_request_handler.erl2
-rw-r--r--lib/inets/src/http_server/httpd_script_env.erl16
-rw-r--r--lib/inets/src/http_server/httpd_socket.erl2
-rw-r--r--lib/inets/src/http_server/httpd_sup.erl2
-rw-r--r--lib/inets/src/http_server/httpd_util.erl2
-rw-r--r--lib/inets/src/http_server/mod_actions.erl2
-rw-r--r--lib/inets/src/http_server/mod_alias.erl2
-rw-r--r--lib/inets/src/http_server/mod_auth.erl2
-rw-r--r--lib/inets/src/http_server/mod_auth.hrl2
-rw-r--r--lib/inets/src/http_server/mod_auth_dets.erl2
-rw-r--r--lib/inets/src/http_server/mod_auth_mnesia.erl2
-rw-r--r--lib/inets/src/http_server/mod_auth_plain.erl2
-rw-r--r--lib/inets/src/http_server/mod_auth_server.erl2
-rw-r--r--lib/inets/src/http_server/mod_browser.erl2
-rw-r--r--lib/inets/src/http_server/mod_cgi.erl2
-rw-r--r--lib/inets/src/http_server/mod_dir.erl2
-rw-r--r--lib/inets/src/http_server/mod_disk_log.erl2
-rw-r--r--lib/inets/src/http_server/mod_esi.erl2
-rw-r--r--lib/inets/src/http_server/mod_get.erl2
-rw-r--r--lib/inets/src/http_server/mod_head.erl2
-rw-r--r--lib/inets/src/http_server/mod_htaccess.erl2
-rw-r--r--lib/inets/src/http_server/mod_log.erl2
-rw-r--r--lib/inets/src/http_server/mod_range.erl2
-rw-r--r--lib/inets/src/http_server/mod_responsecontrol.erl2
-rw-r--r--lib/inets/src/http_server/mod_security.erl2
-rw-r--r--lib/inets/src/http_server/mod_security_server.erl2
-rw-r--r--lib/inets/src/http_server/mod_trace.erl2
-rw-r--r--lib/inets/src/inets_app/Makefile5
-rw-r--r--lib/inets/src/inets_app/inets.app.src3
-rw-r--r--lib/inets/src/inets_app/inets.appup.src2
-rw-r--r--lib/inets/src/inets_app/inets.erl2
-rw-r--r--lib/inets/src/inets_app/inets.mk2
-rw-r--r--lib/inets/src/inets_app/inets_app.erl2
-rw-r--r--lib/inets/src/inets_app/inets_internal.hrl2
-rw-r--r--lib/inets/src/inets_app/inets_regexp.erl414
-rw-r--r--lib/inets/src/inets_app/inets_service.erl2
-rw-r--r--lib/inets/src/inets_app/inets_sup.erl2
-rw-r--r--lib/inets/src/tftp/Makefile2
-rw-r--r--lib/inets/src/tftp/tftp.erl2
-rw-r--r--lib/inets/src/tftp/tftp.hrl2
-rw-r--r--lib/inets/src/tftp/tftp_binary.erl2
-rw-r--r--lib/inets/src/tftp/tftp_engine.erl2
-rw-r--r--lib/inets/src/tftp/tftp_file.erl2
-rw-r--r--lib/inets/src/tftp/tftp_lib.erl2
-rw-r--r--lib/inets/test/Makefile2
-rw-r--r--lib/inets/test/erl_make_certs.erl2
-rw-r--r--lib/inets/test/ftp_SUITE.erl2
-rw-r--r--lib/inets/test/ftp_format_SUITE.erl2
-rw-r--r--lib/inets/test/ftp_property_test_SUITE.erl2
-rw-r--r--lib/inets/test/ftp_suite_lib.erl2
-rw-r--r--lib/inets/test/httpc_SUITE.erl24
-rw-r--r--lib/inets/test/httpc_cookie_SUITE.erl2
-rw-r--r--lib/inets/test/httpc_proxy_SUITE.erl2
-rw-r--r--lib/inets/test/httpc_proxy_SUITE_data/apache2/apache2.conf2
-rwxr-xr-xlib/inets/test/httpc_proxy_SUITE_data/server_proxy.sh2
-rw-r--r--lib/inets/test/httpd_1_0.erl2
-rw-r--r--lib/inets/test/httpd_1_1.erl10
-rw-r--r--lib/inets/test/httpd_SUITE.erl14
-rw-r--r--lib/inets/test/httpd_basic_SUITE.erl2
-rw-r--r--lib/inets/test/httpd_block.erl2
-rw-r--r--lib/inets/test/httpd_load.erl2
-rw-r--r--lib/inets/test/httpd_mod.erl2
-rw-r--r--lib/inets/test/httpd_mod_SUITE.erl2
-rw-r--r--lib/inets/test/httpd_poll.erl2
-rw-r--r--lib/inets/test/httpd_test_data/server_root/Makefile2
-rw-r--r--lib/inets/test/httpd_test_data/server_root/conf/8080.conf2
-rw-r--r--lib/inets/test/httpd_test_data/server_root/conf/8888.conf2
-rw-r--r--lib/inets/test/httpd_test_data/server_root/conf/httpd.conf4
-rw-r--r--lib/inets/test/httpd_test_data/server_root/conf/ssl.conf2
-rw-r--r--lib/inets/test/httpd_test_lib.erl2
-rw-r--r--lib/inets/test/httpd_time_test.erl2
-rw-r--r--lib/inets/test/inets_appup_test.erl2
-rw-r--r--lib/inets/test/inets_socketwrap_SUITE_data/setuid_socket_wrap.c2
-rw-r--r--lib/inets/test/inets_sup_SUITE.erl2
-rw-r--r--lib/inets/test/inets_test_lib.hrl2
-rw-r--r--lib/inets/test/old_httpd_SUITE.erl2
-rw-r--r--lib/inets/test/old_httpd_SUITE_data/server_root/Makefile2
-rw-r--r--lib/inets/test/old_httpd_SUITE_data/server_root/conf/8080.conf2
-rw-r--r--lib/inets/test/old_httpd_SUITE_data/server_root/conf/8888.conf2
-rw-r--r--lib/inets/test/old_httpd_SUITE_data/server_root/conf/httpd.conf4
-rw-r--r--lib/inets/test/old_httpd_SUITE_data/server_root/conf/ssl.conf2
-rw-r--r--lib/inets/test/property_test/ftp_simple_client_server.erl2
-rw-r--r--lib/inets/test/tftp_SUITE.erl2
-rw-r--r--lib/inets/test/tftp_test_lib.erl2
-rw-r--r--lib/inets/test/tftp_test_lib.hrl2
-rw-r--r--lib/inets/test/uri_SUITE.erl2
-rw-r--r--lib/inets/vsn.mk5
-rw-r--r--lib/jinterface/Makefile2
-rw-r--r--lib/jinterface/doc/src/Makefile2
-rw-r--r--lib/jinterface/doc/src/book.xml2
-rw-r--r--lib/jinterface/doc/src/index.html.src2
-rw-r--r--lib/jinterface/doc/src/jinterface.xml2
-rw-r--r--lib/jinterface/doc/src/jinterface_users_guide.xml2
-rw-r--r--lib/jinterface/doc/src/notes.xml2
-rw-r--r--lib/jinterface/doc/src/notes_history.xml2
-rw-r--r--lib/jinterface/doc/src/part.xml2
-rw-r--r--lib/jinterface/doc/src/part_notes.xml2
-rw-r--r--lib/jinterface/doc/src/part_notes_history.xml2
-rw-r--r--lib/jinterface/doc/src/ref_man.xml2
-rw-r--r--lib/jinterface/java_src/Makefile2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractNode.java6
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/GenericQueue.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/Link.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/Links.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/Makefile2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpAuthException.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpConnection.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpCookedConnection.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpEpmd.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangAtom.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangBinary.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangBitstr.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangBoolean.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangByte.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangChar.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangDecodeException.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangDouble.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangException.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangExit.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangExternalFun.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangFloat.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangFun.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangInt.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangLong.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangMap.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangObject.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangPid.java56
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangPort.java49
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangRangeException.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangRef.java52
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangShort.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangString.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangTuple.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangUInt.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangUShort.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpException.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpExternal.java5
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java48
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpLocalNode.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMD5.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMbox.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMsg.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpNode.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpNodeStatus.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java155
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpPeer.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpSelf.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpServer.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpSystem.java2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/java_files2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/jinterface.app.src2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/jinterface.appup.src2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/package.html2
-rw-r--r--lib/jinterface/java_src/pom.xml.src42
-rw-r--r--lib/jinterface/test/Makefile2
-rw-r--r--lib/jinterface/test/jinterface.spec2
-rw-r--r--lib/jinterface/test/jinterface_SUITE.erl2
-rw-r--r--lib/jinterface/test/jinterface_SUITE_data/BooleanAtom.java2
-rw-r--r--lib/jinterface/test/jinterface_SUITE_data/FunEquals.java2
-rw-r--r--lib/jinterface/test/jinterface_SUITE_data/GetNames.java2
-rw-r--r--lib/jinterface/test/jinterface_SUITE_data/Makefile.src2
-rw-r--r--lib/jinterface/test/jinterface_SUITE_data/Maps.java2
-rw-r--r--lib/jinterface/test/jinterface_SUITE_data/MboxLinkUnlink.java2
-rw-r--r--lib/jinterface/test/jinterface_SUITE_data/MboxPing.java2
-rw-r--r--lib/jinterface/test/jinterface_SUITE_data/MboxSendReceive.java2
-rw-r--r--lib/jinterface/test/jinterface_SUITE_data/NodePing.java2
-rw-r--r--lib/jinterface/test/jinterface_SUITE_data/NodeStatusHandler.java2
-rw-r--r--lib/jinterface/test/jinterface_SUITE_data/Nodename.java2
-rw-r--r--lib/jinterface/test/jinterface_SUITE_data/RegisterAndWhereis.java2
-rw-r--r--lib/jinterface/test/jitu.erl2
-rw-r--r--lib/jinterface/test/nc_SUITE.erl60
-rw-r--r--lib/jinterface/test/nc_SUITE_data/Makefile.src2
-rw-r--r--lib/jinterface/test/nc_SUITE_data/connection_server.java2
-rw-r--r--lib/jinterface/test/nc_SUITE_data/echo_server.java2
-rw-r--r--lib/kernel/Makefile2
-rw-r--r--lib/kernel/doc/src/Makefile2
-rw-r--r--lib/kernel/doc/src/app.xml170
-rw-r--r--lib/kernel/doc/src/application.xml459
-rw-r--r--lib/kernel/doc/src/auth.xml58
-rw-r--r--lib/kernel/doc/src/book.xml2
-rw-r--r--lib/kernel/doc/src/code.xml573
-rw-r--r--lib/kernel/doc/src/config.xml91
-rw-r--r--lib/kernel/doc/src/disk_log.xml989
-rw-r--r--lib/kernel/doc/src/erl_boot_server.xml69
-rw-r--r--lib/kernel/doc/src/erl_ddll.xml1344
-rw-r--r--lib/kernel/doc/src/erl_prim_loader_stub.xml4
-rw-r--r--lib/kernel/doc/src/erlang_stub.xml4
-rw-r--r--lib/kernel/doc/src/error_handler.xml80
-rw-r--r--lib/kernel/doc/src/error_logger.xml383
-rw-r--r--lib/kernel/doc/src/file.xml1495
-rw-r--r--lib/kernel/doc/src/gen_sctp.xml1470
-rw-r--r--lib/kernel/doc/src/gen_tcp.xml489
-rw-r--r--lib/kernel/doc/src/gen_udp.xml225
-rw-r--r--lib/kernel/doc/src/global.xml296
-rw-r--r--lib/kernel/doc/src/global_group.xml175
-rw-r--r--lib/kernel/doc/src/heart.xml168
-rw-r--r--lib/kernel/doc/src/inet.xml1659
-rw-r--r--lib/kernel/doc/src/inet_res.xml300
-rw-r--r--lib/kernel/doc/src/init_stub.xml16
-rw-r--r--lib/kernel/doc/src/kernel_app.xml342
-rw-r--r--lib/kernel/doc/src/net_adm.xml87
-rw-r--r--lib/kernel/doc/src/net_kernel.xml279
-rw-r--r--lib/kernel/doc/src/notes.xml2
-rw-r--r--lib/kernel/doc/src/notes_history.xml2
-rw-r--r--lib/kernel/doc/src/os.xml236
-rw-r--r--lib/kernel/doc/src/part_notes.xml2
-rw-r--r--lib/kernel/doc/src/part_notes_history.xml2
-rw-r--r--lib/kernel/doc/src/pg2.xml123
-rw-r--r--lib/kernel/doc/src/ref_man.xml8
-rw-r--r--lib/kernel/doc/src/rpc.xml434
-rw-r--r--lib/kernel/doc/src/seq_trace.xml230
-rw-r--r--lib/kernel/doc/src/user.xml8
-rw-r--r--lib/kernel/doc/src/wrap_log_reader.xml154
-rw-r--r--lib/kernel/doc/src/zlib_stub.xml16
-rw-r--r--lib/kernel/include/dist.hrl3
-rw-r--r--lib/kernel/include/dist_util.hrl2
-rw-r--r--lib/kernel/include/inet.hrl2
-rw-r--r--lib/kernel/include/inet_sctp.hrl2
-rw-r--r--lib/kernel/include/net_address.hrl2
-rw-r--r--lib/kernel/src/Makefile2
-rw-r--r--lib/kernel/src/application.erl2
-rw-r--r--lib/kernel/src/application_controller.erl2
-rw-r--r--lib/kernel/src/application_master.erl2
-rw-r--r--lib/kernel/src/application_master.hrl2
-rw-r--r--lib/kernel/src/application_starter.erl2
-rw-r--r--lib/kernel/src/auth.erl2
-rw-r--r--lib/kernel/src/code.erl4
-rw-r--r--lib/kernel/src/code_server.erl467
-rw-r--r--lib/kernel/src/disk_log_server.erl2
-rw-r--r--lib/kernel/src/disk_log_sup.erl2
-rw-r--r--lib/kernel/src/dist_ac.erl2
-rw-r--r--lib/kernel/src/dist_util.erl39
-rw-r--r--lib/kernel/src/erl_boot_server.erl2
-rw-r--r--lib/kernel/src/erl_ddll.erl2
-rw-r--r--lib/kernel/src/erl_distribution.erl2
-rw-r--r--lib/kernel/src/erl_epmd.erl2
-rw-r--r--lib/kernel/src/erl_epmd.hrl2
-rw-r--r--lib/kernel/src/erl_reply.erl2
-rw-r--r--lib/kernel/src/error_handler.erl2
-rw-r--r--lib/kernel/src/error_logger.erl2
-rw-r--r--lib/kernel/src/erts_debug.erl2
-rw-r--r--lib/kernel/src/file.erl5
-rw-r--r--lib/kernel/src/file_server.erl2
-rw-r--r--lib/kernel/src/gen_sctp.erl2
-rw-r--r--lib/kernel/src/gen_tcp.erl2
-rw-r--r--lib/kernel/src/gen_udp.erl2
-rw-r--r--lib/kernel/src/global_group.erl6
-rw-r--r--lib/kernel/src/global_search.erl2
-rw-r--r--lib/kernel/src/group.erl2
-rw-r--r--lib/kernel/src/inet6_sctp.erl2
-rw-r--r--lib/kernel/src/inet6_tcp.erl2
-rw-r--r--lib/kernel/src/inet6_tcp_dist.erl2
-rw-r--r--lib/kernel/src/inet6_udp.erl2
-rw-r--r--lib/kernel/src/inet_boot.hrl2
-rw-r--r--lib/kernel/src/inet_config.erl2
-rw-r--r--lib/kernel/src/inet_config.hrl2
-rw-r--r--lib/kernel/src/inet_db.erl5
-rw-r--r--lib/kernel/src/inet_dns.erl2
-rw-r--r--lib/kernel/src/inet_dns.hrl2
-rw-r--r--lib/kernel/src/inet_dns_record_adts.pl2
-rw-r--r--lib/kernel/src/inet_gethost_native.erl2
-rw-r--r--lib/kernel/src/inet_hosts.erl2
-rw-r--r--lib/kernel/src/inet_int.hrl2
-rw-r--r--lib/kernel/src/inet_parse.erl2
-rw-r--r--lib/kernel/src/inet_res.erl2
-rw-r--r--lib/kernel/src/inet_res.hrl2
-rw-r--r--lib/kernel/src/inet_sctp.erl2
-rw-r--r--lib/kernel/src/inet_tcp.erl2
-rw-r--r--lib/kernel/src/inet_udp.erl2
-rw-r--r--lib/kernel/src/kernel.app.src2
-rw-r--r--lib/kernel/src/kernel.appup.src2
-rw-r--r--lib/kernel/src/kernel.erl2
-rw-r--r--lib/kernel/src/kernel_config.erl2
-rw-r--r--lib/kernel/src/net.erl2
-rw-r--r--lib/kernel/src/net_adm.erl2
-rw-r--r--lib/kernel/src/net_kernel.erl2
-rw-r--r--lib/kernel/src/os.erl2
-rw-r--r--lib/kernel/src/pg2.erl2
-rw-r--r--lib/kernel/src/ram_file.erl2
-rw-r--r--lib/kernel/src/rpc.erl71
-rw-r--r--lib/kernel/src/seq_trace.erl18
-rw-r--r--lib/kernel/src/standard_error.erl2
-rw-r--r--lib/kernel/src/user.erl2
-rw-r--r--lib/kernel/src/user_sup.erl2
-rw-r--r--lib/kernel/src/wrap_log_reader.erl2
-rw-r--r--lib/kernel/test/Makefile2
-rw-r--r--lib/kernel/test/appinc1.erl2
-rw-r--r--lib/kernel/test/appinc1x.erl2
-rw-r--r--lib/kernel/test/appinc2.erl2
-rw-r--r--lib/kernel/test/appinc2A.erl2
-rw-r--r--lib/kernel/test/appinc2B.erl2
-rw-r--r--lib/kernel/test/appinc2top.erl2
-rw-r--r--lib/kernel/test/application_SUITE.erl2
-rw-r--r--lib/kernel/test/application_SUITE_data/app_start_error.erl2
-rw-r--r--lib/kernel/test/application_SUITE_data/group_leader.erl2
-rw-r--r--lib/kernel/test/application_SUITE_data/group_leader_sup.erl2
-rw-r--r--lib/kernel/test/application_SUITE_data/trans_abnormal_sup.erl2
-rw-r--r--lib/kernel/test/application_SUITE_data/trans_normal_sup.erl2
-rw-r--r--lib/kernel/test/application_SUITE_data/transient.erl2
-rw-r--r--lib/kernel/test/bif_SUITE.erl2
-rw-r--r--lib/kernel/test/ch.erl2
-rw-r--r--lib/kernel/test/ch_sup.erl2
-rw-r--r--lib/kernel/test/cleanup.erl2
-rw-r--r--lib/kernel/test/code_SUITE.erl221
-rw-r--r--lib/kernel/test/code_SUITE_data/code_archive_dict-1.0/src/code_archive_dict.erl2
-rw-r--r--lib/kernel/test/code_SUITE_data/code_archive_dict-1.0/src/code_archive_dict_app.erl2
-rw-r--r--lib/kernel/test/code_SUITE_data/code_archive_dict-1.0/src/code_archive_dict_sup.erl2
-rw-r--r--lib/kernel/test/code_SUITE_data/mult_lib_roots/first_root/my_dummy_app-b/ebin/lists.erl2
-rw-r--r--lib/kernel/test/code_SUITE_data/mult_lib_roots/first_root/my_dummy_app-c/ebin/code_SUITE_mult_root_module.erl2
-rw-r--r--lib/kernel/test/code_a_test.erl2
-rw-r--r--lib/kernel/test/code_b_test.erl2
-rw-r--r--lib/kernel/test/disk_log_SUITE.erl2
-rw-r--r--lib/kernel/test/disk_log_SUITE_data/wrap_log_test.erl2
-rw-r--r--lib/kernel/test/erl_boot_server_SUITE.erl2
-rw-r--r--lib/kernel/test/erl_distribution_SUITE.erl15
-rw-r--r--lib/kernel/test/erl_distribution_wb_SUITE.erl2
-rw-r--r--lib/kernel/test/erl_prim_loader_SUITE.erl2
-rw-r--r--lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dict-1.0/src/primary_archive_dict.erl2
-rw-r--r--lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dict-1.0/src/primary_archive_dict_app.erl2
-rw-r--r--lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dict-1.0/src/primary_archive_dict_sup.erl2
-rw-r--r--lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dummy/src/primary_archive_dummy.erl2
-rw-r--r--lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dummy/src/primary_archive_dummy_app.erl2
-rw-r--r--lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dummy/src/primary_archive_dummy_sup.erl2
-rw-r--r--lib/kernel/test/error_handler_SUITE.erl2
-rw-r--r--lib/kernel/test/error_logger_SUITE.erl2
-rw-r--r--lib/kernel/test/error_logger_warn_SUITE.erl10
-rw-r--r--lib/kernel/test/file_SUITE.erl7
-rw-r--r--lib/kernel/test/file_name_SUITE.erl327
-rw-r--r--lib/kernel/test/gen_sctp_SUITE.erl41
-rw-r--r--lib/kernel/test/gen_tcp_api_SUITE.erl2
-rw-r--r--lib/kernel/test/gen_tcp_api_SUITE_data/gen_tcp_api_SUITE.c2
-rw-r--r--lib/kernel/test/gen_tcp_echo_SUITE.erl2
-rw-r--r--lib/kernel/test/gen_tcp_misc_SUITE.erl252
-rw-r--r--lib/kernel/test/gen_udp_SUITE.erl2
-rw-r--r--lib/kernel/test/global_SUITE.erl2
-rw-r--r--lib/kernel/test/global_SUITE_data/global_trace.erl2
-rw-r--r--lib/kernel/test/global_group_SUITE.erl12
-rw-r--r--lib/kernel/test/heart_SUITE.erl33
-rw-r--r--lib/kernel/test/ignore_cores.erl2
-rw-r--r--lib/kernel/test/inet_SUITE.erl26
-rw-r--r--lib/kernel/test/inet_res_SUITE.erl2
-rwxr-xr-xlib/kernel/test/inet_res_SUITE_data/run-named2
-rw-r--r--lib/kernel/test/inet_sockopt_SUITE.erl2
-rw-r--r--lib/kernel/test/init_SUITE.erl5
-rw-r--r--lib/kernel/test/interactive_shell_SUITE.erl2
-rw-r--r--lib/kernel/test/kernel_SUITE.erl2
-rw-r--r--lib/kernel/test/kernel_config_SUITE.erl2
-rw-r--r--lib/kernel/test/loose_node.erl2
-rw-r--r--lib/kernel/test/multi_load_SUITE.erl2
-rw-r--r--lib/kernel/test/myApp.erl2
-rw-r--r--lib/kernel/test/os_SUITE.erl2
-rw-r--r--lib/kernel/test/pdict_SUITE.erl2
-rw-r--r--lib/kernel/test/pg2_SUITE.erl2
-rw-r--r--lib/kernel/test/prim_file_SUITE.erl21
-rw-r--r--lib/kernel/test/ram_file_SUITE.erl2
-rw-r--r--lib/kernel/test/rpc_SUITE.erl2
-rw-r--r--lib/kernel/test/sendfile_SUITE.erl2
-rw-r--r--lib/kernel/test/seq_trace_SUITE.erl21
-rw-r--r--lib/kernel/test/standard_error_SUITE.erl2
-rw-r--r--lib/kernel/test/topApp.erl2
-rw-r--r--lib/kernel/test/topApp2.erl2
-rw-r--r--lib/kernel/test/topApp3.erl2
-rw-r--r--lib/kernel/test/wrap_log_reader_SUITE.erl2
-rw-r--r--lib/kernel/test/wrap_log_reader_SUITE_data/wrap_log_test.erl2
-rw-r--r--lib/kernel/test/zlib_SUITE.erl2
-rw-r--r--lib/kernel/vsn.mk2
-rw-r--r--lib/megaco/Makefile2
-rw-r--r--lib/megaco/configure.in2
-rw-r--r--lib/megaco/doc/src/Makefile2
-rw-r--r--lib/megaco/doc/src/book.xml2
-rw-r--r--lib/megaco/doc/src/files.mk2
-rw-r--r--lib/megaco/doc/src/megaco.xml2
-rw-r--r--lib/megaco/doc/src/megaco_architecture.xml2
-rw-r--r--lib/megaco/doc/src/megaco_codec_meas.xml2
-rw-r--r--lib/megaco/doc/src/megaco_codec_mstone1.xml2
-rw-r--r--lib/megaco/doc/src/megaco_codec_mstone2.xml2
-rw-r--r--lib/megaco/doc/src/megaco_codec_transform.xml2
-rw-r--r--lib/megaco/doc/src/megaco_debug.xml2
-rw-r--r--lib/megaco/doc/src/megaco_edist_compress.xml2
-rw-r--r--lib/megaco/doc/src/megaco_encode.xml2
-rw-r--r--lib/megaco/doc/src/megaco_encoder.xml2
-rw-r--r--lib/megaco/doc/src/megaco_examples.xml2
-rw-r--r--lib/megaco/doc/src/megaco_flex_scanner.xml2
-rw-r--r--lib/megaco/doc/src/megaco_intro.xml2
-rw-r--r--lib/megaco/doc/src/megaco_mib.xml2
-rw-r--r--lib/megaco/doc/src/megaco_performance.xml2
-rw-r--r--lib/megaco/doc/src/megaco_run.xml2
-rw-r--r--lib/megaco/doc/src/megaco_tcp.xml2
-rw-r--r--lib/megaco/doc/src/megaco_transport.xml2
-rw-r--r--lib/megaco/doc/src/megaco_transport_mechanisms.xml2
-rw-r--r--lib/megaco/doc/src/megaco_udp.xml2
-rw-r--r--lib/megaco/doc/src/megaco_user.xml2
-rw-r--r--lib/megaco/doc/src/notes.xml2
-rw-r--r--lib/megaco/doc/src/notes_history.xml2
-rw-r--r--lib/megaco/doc/src/part.xml2
-rw-r--r--lib/megaco/doc/src/part_notes.xml2
-rw-r--r--lib/megaco/doc/src/part_notes_history.xml2
-rw-r--r--lib/megaco/doc/src/ref_man.xml2
-rw-r--r--lib/megaco/examples/meas/Makefile.in2
-rw-r--r--lib/megaco/examples/meas/meas.sh.skel.src2
-rw-r--r--lib/megaco/examples/meas/megaco_codec_meas.erl2
-rw-r--r--lib/megaco/examples/meas/megaco_codec_mstone1.erl2
-rw-r--r--lib/megaco/examples/meas/megaco_codec_mstone2.erl2
-rw-r--r--lib/megaco/examples/meas/megaco_codec_mstone_lib.erl2
-rw-r--r--lib/megaco/examples/meas/megaco_codec_transform.erl2
-rw-r--r--lib/megaco/examples/meas/modules.mk2
-rw-r--r--lib/megaco/examples/meas/mstone1.sh.skel.src2
-rw-r--r--lib/megaco/examples/simple/Makefile2
-rw-r--r--lib/megaco/examples/simple/megaco_simple_mg.erl2
-rw-r--r--lib/megaco/examples/simple/megaco_simple_mgc.erl2
-rw-r--r--lib/megaco/examples/simple/modules.mk2
-rw-r--r--lib/megaco/include/megaco.hrl2
-rw-r--r--lib/megaco/src/Makefile2
-rw-r--r--lib/megaco/src/app/Makefile2
-rw-r--r--lib/megaco/src/app/depend.mk2
-rw-r--r--lib/megaco/src/app/megaco.erl2
-rw-r--r--lib/megaco/src/app/megaco.mk2
-rw-r--r--lib/megaco/src/app/megaco_internal.hrl2
-rw-r--r--lib/megaco/src/app/modules.mk2
-rw-r--r--lib/megaco/src/binary/Makefile2
-rw-r--r--lib/megaco/src/binary/depend.mk2
-rw-r--r--lib/megaco/src/binary/megaco_ber_encoder.erl2
-rw-r--r--lib/megaco/src/binary/megaco_binary_encoder.erl2
-rw-r--r--lib/megaco/src/binary/megaco_binary_encoder_lib.erl2
-rw-r--r--lib/megaco/src/binary/megaco_binary_name_resolver_prev3a.erl2
-rw-r--r--lib/megaco/src/binary/megaco_binary_name_resolver_prev3b.erl2
-rw-r--r--lib/megaco/src/binary/megaco_binary_name_resolver_prev3c.erl2
-rw-r--r--lib/megaco/src/binary/megaco_binary_name_resolver_v1.erl2
-rw-r--r--lib/megaco/src/binary/megaco_binary_name_resolver_v2.erl2
-rw-r--r--lib/megaco/src/binary/megaco_binary_name_resolver_v3.erl2
-rw-r--r--lib/megaco/src/binary/megaco_binary_term_id.erl2
-rw-r--r--lib/megaco/src/binary/megaco_binary_term_id_gen.erl2
-rw-r--r--lib/megaco/src/binary/megaco_binary_transformer_prev3a.erl2
-rw-r--r--lib/megaco/src/binary/megaco_binary_transformer_prev3b.erl2
-rw-r--r--lib/megaco/src/binary/megaco_binary_transformer_prev3c.erl2
-rw-r--r--lib/megaco/src/binary/megaco_binary_transformer_v1.erl2
-rw-r--r--lib/megaco/src/binary/megaco_binary_transformer_v2.erl2
-rw-r--r--lib/megaco/src/binary/megaco_binary_transformer_v3.erl2
-rw-r--r--lib/megaco/src/binary/megaco_per_encoder.erl2
-rw-r--r--lib/megaco/src/binary/modules.mk2
-rw-r--r--lib/megaco/src/binary/old/megaco_ber_bin_drv_encoder.erl2
-rw-r--r--lib/megaco/src/binary/old/megaco_per_bin_drv_encoder.erl2
-rw-r--r--lib/megaco/src/engine/Makefile2
-rw-r--r--lib/megaco/src/engine/depend.mk2
-rw-r--r--lib/megaco/src/engine/megaco_config.erl2
-rw-r--r--lib/megaco/src/engine/megaco_config_misc.erl2
-rw-r--r--lib/megaco/src/engine/megaco_digit_map.erl2
-rw-r--r--lib/megaco/src/engine/megaco_edist_compress.erl2
-rw-r--r--lib/megaco/src/engine/megaco_encoder.erl2
-rw-r--r--lib/megaco/src/engine/megaco_erl_dist_encoder.erl2
-rw-r--r--lib/megaco/src/engine/megaco_erl_dist_encoder_mc.erl2
-rw-r--r--lib/megaco/src/engine/megaco_filter.erl2
-rw-r--r--lib/megaco/src/engine/megaco_message_internal.hrl2
-rw-r--r--lib/megaco/src/engine/megaco_messenger.erl2
-rw-r--r--lib/megaco/src/engine/megaco_messenger_misc.erl2
-rw-r--r--lib/megaco/src/engine/megaco_misc_sup.erl2
-rw-r--r--lib/megaco/src/engine/megaco_monitor.erl2
-rw-r--r--lib/megaco/src/engine/megaco_sdp.erl2
-rw-r--r--lib/megaco/src/engine/megaco_stats.erl2
-rw-r--r--lib/megaco/src/engine/megaco_sup.erl2
-rw-r--r--lib/megaco/src/engine/megaco_timer.erl2
-rw-r--r--lib/megaco/src/engine/megaco_trans_sender.erl2
-rw-r--r--lib/megaco/src/engine/megaco_trans_sup.erl2
-rw-r--r--lib/megaco/src/engine/megaco_transport.erl2
-rw-r--r--lib/megaco/src/engine/megaco_user_default.erl2
-rw-r--r--lib/megaco/src/engine/modules.mk2
-rw-r--r--lib/megaco/src/flex/Makefile2
-rw-r--r--lib/megaco/src/flex/Makefile.in2
-rw-r--r--lib/megaco/src/flex/megaco_flex_scanner.erl2
-rw-r--r--lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src2
-rw-r--r--lib/megaco/src/flex/megaco_flex_scanner_handler.erl2
-rw-r--r--lib/megaco/src/flex/modules.mk2
-rw-r--r--lib/megaco/src/rules.mk2
-rw-r--r--lib/megaco/src/subdirs.mk2
-rw-r--r--lib/megaco/src/tcp/Makefile2
-rw-r--r--lib/megaco/src/tcp/depend.mk2
-rw-r--r--lib/megaco/src/tcp/megaco_tcp.erl2
-rw-r--r--lib/megaco/src/tcp/megaco_tcp.hrl2
-rw-r--r--lib/megaco/src/tcp/megaco_tcp_accept.erl2
-rw-r--r--lib/megaco/src/tcp/megaco_tcp_accept_sup.erl2
-rw-r--r--lib/megaco/src/tcp/megaco_tcp_connection.erl2
-rw-r--r--lib/megaco/src/tcp/megaco_tcp_connection_sup.erl2
-rw-r--r--lib/megaco/src/tcp/megaco_tcp_sup.erl2
-rw-r--r--lib/megaco/src/tcp/modules.mk2
-rw-r--r--lib/megaco/src/text/Makefile2
-rw-r--r--lib/megaco/src/text/depend.mk2
-rw-r--r--lib/megaco/src/text/megaco_compact_text_encoder.erl2
-rw-r--r--lib/megaco/src/text/megaco_compact_text_encoder_prev3a.erl2
-rw-r--r--lib/megaco/src/text/megaco_compact_text_encoder_prev3b.erl2
-rw-r--r--lib/megaco/src/text/megaco_compact_text_encoder_prev3c.erl2
-rw-r--r--lib/megaco/src/text/megaco_compact_text_encoder_v1.erl2
-rw-r--r--lib/megaco/src/text/megaco_compact_text_encoder_v2.erl2
-rw-r--r--lib/megaco/src/text/megaco_compact_text_encoder_v3.erl2
-rw-r--r--lib/megaco/src/text/megaco_pretty_text_encoder.erl2
-rw-r--r--lib/megaco/src/text/megaco_pretty_text_encoder_prev3a.erl2
-rw-r--r--lib/megaco/src/text/megaco_pretty_text_encoder_prev3b.erl2
-rw-r--r--lib/megaco/src/text/megaco_pretty_text_encoder_prev3c.erl2
-rw-r--r--lib/megaco/src/text/megaco_pretty_text_encoder_v1.erl2
-rw-r--r--lib/megaco/src/text/megaco_pretty_text_encoder_v2.erl2
-rw-r--r--lib/megaco/src/text/megaco_pretty_text_encoder_v3.erl2
-rw-r--r--lib/megaco/src/text/megaco_text_gen_prev3a.hrl2
-rw-r--r--lib/megaco/src/text/megaco_text_gen_prev3b.hrl2
-rw-r--r--lib/megaco/src/text/megaco_text_gen_prev3c.hrl2
-rw-r--r--lib/megaco/src/text/megaco_text_gen_v1.hrl2
-rw-r--r--lib/megaco/src/text/megaco_text_gen_v2.hrl2
-rw-r--r--lib/megaco/src/text/megaco_text_gen_v3.hrl2
-rw-r--r--lib/megaco/src/text/megaco_text_mini_decoder.erl2
-rw-r--r--lib/megaco/src/text/megaco_text_mini_parser.hrl2
-rw-r--r--lib/megaco/src/text/megaco_text_mini_parser.yrl2
-rw-r--r--lib/megaco/src/text/megaco_text_parser_prev3a.hrl2
-rw-r--r--lib/megaco/src/text/megaco_text_parser_prev3a.yrl2
-rw-r--r--lib/megaco/src/text/megaco_text_parser_prev3b.hrl2
-rw-r--r--lib/megaco/src/text/megaco_text_parser_prev3b.yrl2
-rw-r--r--lib/megaco/src/text/megaco_text_parser_prev3c.hrl2
-rw-r--r--lib/megaco/src/text/megaco_text_parser_prev3c.yrl2
-rw-r--r--lib/megaco/src/text/megaco_text_parser_v1.hrl2
-rw-r--r--lib/megaco/src/text/megaco_text_parser_v1.yrl2
-rw-r--r--lib/megaco/src/text/megaco_text_parser_v2.hrl2
-rw-r--r--lib/megaco/src/text/megaco_text_parser_v2.yrl2
-rw-r--r--lib/megaco/src/text/megaco_text_parser_v3.hrl2
-rw-r--r--lib/megaco/src/text/megaco_text_parser_v3.yrl2
-rw-r--r--lib/megaco/src/text/megaco_text_scanner.erl2
-rw-r--r--lib/megaco/src/text/megaco_text_tokens.hrl2
-rw-r--r--lib/megaco/src/text/modules.mk2
-rw-r--r--lib/megaco/src/udp/Makefile2
-rw-r--r--lib/megaco/src/udp/megaco_udp.erl2
-rw-r--r--lib/megaco/src/udp/megaco_udp.hrl2
-rw-r--r--lib/megaco/src/udp/megaco_udp_server.erl2
-rw-r--r--lib/megaco/src/udp/megaco_udp_sup.erl2
-rw-r--r--lib/megaco/src/udp/modules.mk2
-rw-r--r--lib/megaco/subdirs.mk2
-rw-r--r--lib/megaco/test/Makefile2
-rw-r--r--lib/megaco/test/megaco_SUITE.erl2
-rw-r--r--lib/megaco/test/megaco_actions_test.erl2
-rw-r--r--lib/megaco/test/megaco_app_test.erl2
-rw-r--r--lib/megaco/test/megaco_appup_mg.erl2
-rw-r--r--lib/megaco/test/megaco_appup_mgc.erl2
-rw-r--r--lib/megaco/test/megaco_appup_test.erl2
-rw-r--r--lib/megaco/test/megaco_binary_term_id_test.erl2
-rw-r--r--lib/megaco/test/megaco_call_flow_test.erl2
-rw-r--r--lib/megaco/test/megaco_codec_flex_lib.erl2
-rw-r--r--lib/megaco/test/megaco_codec_mini_test.erl2
-rw-r--r--lib/megaco/test/megaco_codec_prev3a_test.erl2
-rw-r--r--lib/megaco/test/megaco_codec_prev3b_test.erl2
-rw-r--r--lib/megaco/test/megaco_codec_prev3c_test.erl2
-rw-r--r--lib/megaco/test/megaco_codec_test.erl2
-rw-r--r--lib/megaco/test/megaco_codec_test_lib.erl2
-rw-r--r--lib/megaco/test/megaco_codec_v1_test.erl2
-rw-r--r--lib/megaco/test/megaco_codec_v2_test.erl2
-rw-r--r--lib/megaco/test/megaco_codec_v3_test.erl2
-rw-r--r--lib/megaco/test/megaco_config_test.erl2
-rw-r--r--lib/megaco/test/megaco_digit_map_test.erl2
-rw-r--r--lib/megaco/test/megaco_examples_test.erl2
-rw-r--r--lib/megaco/test/megaco_flex_test.erl2
-rw-r--r--lib/megaco/test/megaco_load_test.erl2
-rw-r--r--lib/megaco/test/megaco_mess_otp8212_test.erl2
-rw-r--r--lib/megaco/test/megaco_mess_test.erl2
-rw-r--r--lib/megaco/test/megaco_mess_user_test.erl2
-rw-r--r--lib/megaco/test/megaco_mib_test.erl2
-rw-r--r--lib/megaco/test/megaco_mreq_test.erl2
-rw-r--r--lib/megaco/test/megaco_pending_limit_test.erl2
-rw-r--r--lib/megaco/test/megaco_profile.erl2
-rw-r--r--lib/megaco/test/megaco_sdp_test.erl2
-rw-r--r--lib/megaco/test/megaco_segment_test.erl2
-rw-r--r--lib/megaco/test/megaco_tc_controller.erl2
-rw-r--r--lib/megaco/test/megaco_tcp_test.erl2
-rw-r--r--lib/megaco/test/megaco_test_deliver.erl2
-rw-r--r--lib/megaco/test/megaco_test_generator.erl2
-rw-r--r--lib/megaco/test/megaco_test_generator_lib.erl2
-rw-r--r--lib/megaco/test/megaco_test_generic_transport.erl2
-rw-r--r--lib/megaco/test/megaco_test_lib.erl2
-rw-r--r--lib/megaco/test/megaco_test_lib.hrl2
-rw-r--r--lib/megaco/test/megaco_test_megaco_generator.erl2
-rw-r--r--lib/megaco/test/megaco_test_mg.erl2
-rw-r--r--lib/megaco/test/megaco_test_mgc.erl2
-rw-r--r--lib/megaco/test/megaco_test_msg_prev3a_lib.erl2
-rw-r--r--lib/megaco/test/megaco_test_msg_prev3b_lib.erl2
-rw-r--r--lib/megaco/test/megaco_test_msg_prev3c_lib.erl2
-rw-r--r--lib/megaco/test/megaco_test_msg_v1_lib.erl2
-rw-r--r--lib/megaco/test/megaco_test_msg_v2_lib.erl2
-rw-r--r--lib/megaco/test/megaco_test_msg_v3_lib.erl2
-rw-r--r--lib/megaco/test/megaco_test_tcp_generator.erl2
-rw-r--r--lib/megaco/test/megaco_timer_test.erl2
-rw-r--r--lib/megaco/test/megaco_trans_test.erl2
-rw-r--r--lib/megaco/test/megaco_udp_test.erl2
-rw-r--r--lib/megaco/test/modules.mk2
-rw-r--r--lib/mnesia/Makefile2
-rw-r--r--lib/mnesia/doc/misc/Makefile2
-rw-r--r--lib/mnesia/doc/src/Makefile2
-rw-r--r--lib/mnesia/doc/src/Mnesia_App_A.xmlsrc2
-rw-r--r--lib/mnesia/doc/src/Mnesia_App_B.xmlsrc2
-rw-r--r--lib/mnesia/doc/src/Mnesia_App_C.xmlsrc2
-rw-r--r--lib/mnesia/doc/src/Mnesia_chap1.xml2
-rw-r--r--lib/mnesia/doc/src/Mnesia_chap2.xmlsrc2
-rw-r--r--lib/mnesia/doc/src/Mnesia_chap3.xmlsrc2
-rw-r--r--lib/mnesia/doc/src/Mnesia_chap4.xmlsrc2
-rw-r--r--lib/mnesia/doc/src/Mnesia_chap5.xmlsrc2
-rw-r--r--lib/mnesia/doc/src/Mnesia_chap7.xmlsrc2
-rw-r--r--lib/mnesia/doc/src/Mnesia_chap8.xml2
-rw-r--r--lib/mnesia/doc/src/Mnesia_overview.xml2
-rw-r--r--lib/mnesia/doc/src/book.xml2
-rw-r--r--lib/mnesia/doc/src/company.erl2
-rw-r--r--lib/mnesia/doc/src/company_o.erl2
-rw-r--r--lib/mnesia/doc/src/mnesia.xml2
-rw-r--r--lib/mnesia/doc/src/mnesia_frag_hash.xml2
-rw-r--r--lib/mnesia/doc/src/mnesia_registry.xml2
-rw-r--r--lib/mnesia/doc/src/notes.xml20
-rw-r--r--lib/mnesia/doc/src/notes_history.xml2
-rw-r--r--lib/mnesia/doc/src/part.xml2
-rw-r--r--lib/mnesia/doc/src/part_notes.xml2
-rw-r--r--lib/mnesia/doc/src/part_notes_history.xml2
-rw-r--r--lib/mnesia/doc/src/ref_man.xml2
-rw-r--r--lib/mnesia/examples/Makefile2
-rw-r--r--lib/mnesia/examples/bench/bench.erl2
-rw-r--r--lib/mnesia/examples/bench/bench.hrl2
-rw-r--r--lib/mnesia/examples/bench/bench_generate.erl2
-rw-r--r--lib/mnesia/examples/bench/bench_populate.erl2
-rw-r--r--lib/mnesia/examples/bench/bench_trans.erl2
-rw-r--r--lib/mnesia/examples/mnesia_meter.erl2
-rw-r--r--lib/mnesia/examples/mnesia_tpcb.erl2
-rw-r--r--lib/mnesia/include/Makefile2
-rw-r--r--lib/mnesia/src/Makefile2
-rw-r--r--lib/mnesia/src/mnesia.erl2
-rw-r--r--lib/mnesia/src/mnesia.hrl2
-rw-r--r--lib/mnesia/src/mnesia_backup.erl2
-rw-r--r--lib/mnesia/src/mnesia_checkpoint.erl2
-rw-r--r--lib/mnesia/src/mnesia_checkpoint_sup.erl2
-rw-r--r--lib/mnesia/src/mnesia_controller.erl2
-rw-r--r--lib/mnesia/src/mnesia_dumper.erl2
-rw-r--r--lib/mnesia/src/mnesia_event.erl2
-rw-r--r--lib/mnesia/src/mnesia_frag.erl2
-rw-r--r--lib/mnesia/src/mnesia_frag_hash.erl2
-rw-r--r--lib/mnesia/src/mnesia_frag_old_hash.erl2
-rw-r--r--lib/mnesia/src/mnesia_index.erl2
-rw-r--r--lib/mnesia/src/mnesia_kernel_sup.erl2
-rw-r--r--lib/mnesia/src/mnesia_late_loader.erl2
-rw-r--r--lib/mnesia/src/mnesia_loader.erl2
-rw-r--r--lib/mnesia/src/mnesia_locker.erl2
-rw-r--r--lib/mnesia/src/mnesia_monitor.erl2
-rw-r--r--lib/mnesia/src/mnesia_recover.erl2
-rw-r--r--lib/mnesia/src/mnesia_registry.erl2
-rw-r--r--lib/mnesia/src/mnesia_snmp_hook.erl2
-rw-r--r--lib/mnesia/src/mnesia_snmp_sup.erl2
-rw-r--r--lib/mnesia/src/mnesia_sp.erl2
-rw-r--r--lib/mnesia/src/mnesia_subscr.erl2
-rw-r--r--lib/mnesia/src/mnesia_sup.erl2
-rw-r--r--lib/mnesia/src/mnesia_text.erl2
-rw-r--r--lib/mnesia/src/mnesia_tm.erl13
-rw-r--r--lib/mnesia/test/Makefile2
-rw-r--r--lib/mnesia/test/mnesia_SUITE.erl2
-rw-r--r--lib/mnesia/test/mnesia_atomicity_test.erl2
-rw-r--r--lib/mnesia/test/mnesia_bench_SUITE.erl2
-rw-r--r--lib/mnesia/test/mnesia_config_backup.erl2
-rw-r--r--lib/mnesia/test/mnesia_config_event.erl2
-rw-r--r--lib/mnesia/test/mnesia_config_test.erl10
-rw-r--r--lib/mnesia/test/mnesia_consistency_test.erl8
-rw-r--r--lib/mnesia/test/mnesia_cost.erl2
-rw-r--r--lib/mnesia/test/mnesia_dbn_meters.erl2
-rw-r--r--lib/mnesia/test/mnesia_dirty_access_test.erl2
-rw-r--r--lib/mnesia/test/mnesia_durability_test.erl2
-rw-r--r--lib/mnesia/test/mnesia_evil_backup.erl2
-rw-r--r--lib/mnesia/test/mnesia_evil_coverage_test.erl2
-rw-r--r--lib/mnesia/test/mnesia_examples_test.erl2
-rw-r--r--lib/mnesia/test/mnesia_frag_test.erl2
-rw-r--r--lib/mnesia/test/mnesia_inconsistent_database_test.erl2
-rw-r--r--lib/mnesia/test/mnesia_install_test.erl2
-rw-r--r--lib/mnesia/test/mnesia_isolation_test.erl2
-rw-r--r--lib/mnesia/test/mnesia_majority_test.erl2
-rw-r--r--lib/mnesia/test/mnesia_measure_test.erl2
-rw-r--r--lib/mnesia/test/mnesia_meter.erl2
-rw-r--r--lib/mnesia/test/mnesia_nice_coverage_test.erl2
-rw-r--r--lib/mnesia/test/mnesia_qlc_test.erl2
-rw-r--r--lib/mnesia/test/mnesia_recovery_test.erl2
-rw-r--r--lib/mnesia/test/mnesia_registry_test.erl2
-rw-r--r--lib/mnesia/test/mnesia_schema_recovery_test.erl2
-rw-r--r--lib/mnesia/test/mnesia_test_lib.erl2
-rw-r--r--lib/mnesia/test/mnesia_test_lib.hrl2
-rw-r--r--lib/mnesia/test/mnesia_tpcb.erl2
-rw-r--r--lib/mnesia/test/mnesia_trans_access_test.erl2
-rw-r--r--lib/mnesia/test/mt.erl2
-rw-r--r--lib/mnesia/vsn.mk2
-rw-r--r--lib/observer/Makefile2
-rw-r--r--lib/observer/doc/src/book.xml2
-rw-r--r--lib/observer/doc/src/crashdump.xml2
-rw-r--r--lib/observer/doc/src/etop.xml2
-rw-r--r--lib/observer/doc/src/notes.xml2
-rw-r--r--lib/observer/doc/src/notes_history.xml2
-rw-r--r--lib/observer/doc/src/part.xml2
-rw-r--r--lib/observer/doc/src/part_notes.xml2
-rw-r--r--lib/observer/doc/src/part_notes_history.xml2
-rw-r--r--lib/observer/doc/src/ref_man.xml2
-rw-r--r--lib/observer/include/etop.hrl2
-rw-r--r--lib/observer/src/Makefile2
-rw-r--r--lib/observer/src/cdv_atom_cb.erl2
-rw-r--r--lib/observer/src/cdv_bin_cb.erl2
-rw-r--r--lib/observer/src/cdv_detail_wx.erl2
-rw-r--r--lib/observer/src/cdv_dist_cb.erl2
-rw-r--r--lib/observer/src/cdv_ets_cb.erl2
-rw-r--r--lib/observer/src/cdv_fun_cb.erl2
-rw-r--r--lib/observer/src/cdv_gen_cb.erl2
-rw-r--r--lib/observer/src/cdv_html_wx.erl2
-rw-r--r--lib/observer/src/cdv_info_wx.erl2
-rw-r--r--lib/observer/src/cdv_int_tab_cb.erl2
-rw-r--r--lib/observer/src/cdv_mem_cb.erl2
-rw-r--r--lib/observer/src/cdv_mod_cb.erl2
-rw-r--r--lib/observer/src/cdv_multi_wx.erl2
-rw-r--r--lib/observer/src/cdv_port_cb.erl2
-rw-r--r--lib/observer/src/cdv_proc_cb.erl2
-rw-r--r--lib/observer/src/cdv_sched_cb.erl2
-rw-r--r--lib/observer/src/cdv_table_wx.erl2
-rw-r--r--lib/observer/src/cdv_term_cb.erl2
-rw-r--r--lib/observer/src/cdv_timer_cb.erl2
-rw-r--r--lib/observer/src/cdv_virtual_list_wx.erl2
-rw-r--r--lib/observer/src/cdv_wx.erl2
-rw-r--r--lib/observer/src/crashdump_viewer.erl2
-rw-r--r--lib/observer/src/crashdump_viewer.hrl2
-rw-r--r--lib/observer/src/etop.erl2
-rw-r--r--lib/observer/src/etop_defs.hrl2
-rw-r--r--lib/observer/src/etop_tr.erl2
-rw-r--r--lib/observer/src/etop_txt.erl2
-rw-r--r--lib/observer/src/multitrace.erl2
-rw-r--r--lib/observer/src/observer.app.src2
-rw-r--r--lib/observer/src/observer.appup.src2
-rw-r--r--lib/observer/src/observer.erl2
-rw-r--r--lib/observer/src/observer_alloc_wx.erl57
-rw-r--r--lib/observer/src/observer_app_wx.erl6
-rw-r--r--lib/observer/src/observer_defs.hrl2
-rw-r--r--lib/observer/src/observer_html_lib.erl2
-rw-r--r--lib/observer/src/observer_lib.erl105
-rw-r--r--lib/observer/src/observer_perf_wx.erl11
-rw-r--r--lib/observer/src/observer_pro_wx.erl2
-rw-r--r--lib/observer/src/observer_procinfo.erl6
-rw-r--r--lib/observer/src/observer_sys_wx.erl2
-rw-r--r--lib/observer/src/observer_trace_wx.erl2
-rw-r--r--lib/observer/src/observer_tv.hrl2
-rw-r--r--lib/observer/src/observer_tv_wx.erl2
-rw-r--r--lib/observer/src/observer_wx.erl2
-rw-r--r--lib/observer/src/ttb.erl6
-rw-r--r--lib/observer/src/ttb_et.erl2
-rw-r--r--lib/observer/test/crashdump_helper.erl2
-rw-r--r--lib/observer/test/crashdump_viewer_SUITE.erl12
-rw-r--r--lib/observer/test/etop_SUITE.erl2
-rw-r--r--lib/observer/test/observer_SUITE.erl2
-rw-r--r--lib/observer/test/ttb_SUITE.erl59
-rw-r--r--lib/odbc/Makefile2
-rw-r--r--lib/odbc/c_src/Makefile2
-rw-r--r--lib/odbc/c_src/Makefile.in2
-rw-r--r--lib/odbc/c_src/odbcserver.c2
-rw-r--r--lib/odbc/c_src/odbcserver.h2
-rw-r--r--lib/odbc/configure.in2
-rw-r--r--lib/odbc/doc/src/Makefile2
-rw-r--r--lib/odbc/doc/src/book.xml2
-rw-r--r--lib/odbc/doc/src/databases.xml2
-rw-r--r--lib/odbc/doc/src/error_handling.xml2
-rw-r--r--lib/odbc/doc/src/getting_started.xml2
-rw-r--r--lib/odbc/doc/src/introduction.xml2
-rw-r--r--lib/odbc/doc/src/notes.xml2
-rw-r--r--lib/odbc/doc/src/notes_history.xml2
-rw-r--r--lib/odbc/doc/src/odbc.xml2
-rw-r--r--lib/odbc/doc/src/part.xml2
-rw-r--r--lib/odbc/doc/src/part_notes.xml2
-rw-r--r--lib/odbc/doc/src/part_notes_history.xml2
-rw-r--r--lib/odbc/doc/src/ref_man.xml2
-rw-r--r--lib/odbc/src/Makefile2
-rw-r--r--lib/odbc/src/odbc.appup.src2
-rw-r--r--lib/odbc/src/odbc.erl2
-rw-r--r--lib/odbc/src/odbc_app.erl2
-rw-r--r--lib/odbc/src/odbc_internal.hrl2
-rw-r--r--lib/odbc/src/odbc_sup.erl2
-rw-r--r--lib/odbc/test/Makefile2
-rw-r--r--lib/odbc/test/README2
-rw-r--r--lib/odbc/test/mysql.erl2
-rw-r--r--lib/odbc/test/odbc_connect_SUITE.erl2
-rw-r--r--lib/odbc/test/odbc_data_type_SUITE.erl2
-rw-r--r--lib/odbc/test/odbc_query_SUITE.erl2
-rw-r--r--lib/odbc/test/odbc_start_SUITE.erl2
-rw-r--r--lib/odbc/test/odbc_test.hrl2
-rw-r--r--lib/odbc/test/odbc_test_lib.erl2
-rw-r--r--lib/odbc/test/oracle.erl2
-rw-r--r--lib/odbc/test/postgres.erl2
-rw-r--r--lib/odbc/test/sqlserver.erl2
-rw-r--r--lib/orber/COSS/CosNaming/CosNaming_BindingIterator_impl.erl2
-rw-r--r--lib/orber/COSS/CosNaming/Makefile2
-rw-r--r--lib/orber/COSS/CosNaming/lname.erl2
-rw-r--r--lib/orber/COSS/CosNaming/lname.hrl2
-rw-r--r--lib/orber/COSS/CosNaming/lname_component.erl2
-rw-r--r--lib/orber/COSS/CosNaming/orber_cosnaming.hrl2
-rw-r--r--lib/orber/COSS/CosNaming/orber_cosnaming_utils.erl2
-rw-r--r--lib/orber/Makefile2
-rw-r--r--lib/orber/c_src/Makefile2
-rw-r--r--lib/orber/c_src/Makefile.in2
-rw-r--r--lib/orber/doc/src/CosNaming.xml2
-rw-r--r--lib/orber/doc/src/CosNaming_BindingIterator.xml2
-rw-r--r--lib/orber/doc/src/CosNaming_NamingContext.xml2
-rw-r--r--lib/orber/doc/src/CosNaming_NamingContextExt.xml2
-rw-r--r--lib/orber/doc/src/Makefile2
-rw-r--r--lib/orber/doc/src/Module_Interface.xml2
-rw-r--r--lib/orber/doc/src/Orber/InitialReference.java2
-rw-r--r--lib/orber/doc/src/Orber/Makefile2
-rw-r--r--lib/orber/doc/src/any.xml2
-rw-r--r--lib/orber/doc/src/book.xml2
-rw-r--r--lib/orber/doc/src/ch_contents.xml2
-rw-r--r--lib/orber/doc/src/ch_debugging.xml2
-rw-r--r--lib/orber/doc/src/ch_exceptions.xml2
-rw-r--r--lib/orber/doc/src/ch_idl_to_erlang_mapping.xml2
-rw-r--r--lib/orber/doc/src/ch_ifr.xml2
-rw-r--r--lib/orber/doc/src/ch_install.xml2
-rw-r--r--lib/orber/doc/src/ch_interceptors.xml2
-rw-r--r--lib/orber/doc/src/ch_introduction.xml2
-rw-r--r--lib/orber/doc/src/ch_naming_service.xml2
-rw-r--r--lib/orber/doc/src/ch_orber_kernel.xml2
-rw-r--r--lib/orber/doc/src/ch_orberweb.xml2
-rw-r--r--lib/orber/doc/src/ch_security.xml2
-rw-r--r--lib/orber/doc/src/ch_stubs.xml2
-rw-r--r--lib/orber/doc/src/corba.xml2
-rw-r--r--lib/orber/doc/src/corba_object.xml2
-rw-r--r--lib/orber/doc/src/example_part.xml2
-rw-r--r--lib/orber/doc/src/fixed.xml2
-rw-r--r--lib/orber/doc/src/interceptors.xml2
-rw-r--r--lib/orber/doc/src/intro_part.xml2
-rw-r--r--lib/orber/doc/src/lname.xml2
-rw-r--r--lib/orber/doc/src/lname_component.xml2
-rw-r--r--lib/orber/doc/src/notes.xml2
-rw-r--r--lib/orber/doc/src/orber.xml2
-rw-r--r--lib/orber/doc/src/orber_acl.xml2
-rw-r--r--lib/orber/doc/src/orber_diagnostics.xml2
-rw-r--r--lib/orber/doc/src/orber_ifr.xml2
-rw-r--r--lib/orber/doc/src/orber_tc.xml2
-rw-r--r--lib/orber/doc/src/part.xml2
-rw-r--r--lib/orber/doc/src/part_notes.xml2
-rw-r--r--lib/orber/doc/src/ref_man.xml2
-rw-r--r--lib/orber/doc/src/tools_debugging_part.xml2
-rw-r--r--lib/orber/examples/Makefile2
-rw-r--r--lib/orber/examples/Stack/Makefile2
-rw-r--r--lib/orber/examples/Stack/StackClient.java2
-rw-r--r--lib/orber/examples/Stack/StackModule_StackFactory_impl.erl2
-rw-r--r--lib/orber/examples/Stack/StackModule_Stack_impl.erl2
-rw-r--r--lib/orber/examples/Stack/stack_client.erl2
-rw-r--r--lib/orber/examples/Stack/stack_factory.erl2
-rw-r--r--lib/orber/include/corba.hrl2
-rw-r--r--lib/orber/include/ifr_types.hrl2
-rw-r--r--lib/orber/include/orber_pi.hrl2
-rw-r--r--lib/orber/java_src/Makefile2
-rw-r--r--lib/orber/java_src/Orber/InitialReference.java2
-rw-r--r--lib/orber/java_src/Orber/Makefile2
-rw-r--r--lib/orber/priv/Makefile2
-rw-r--r--lib/orber/src/Makefile2
-rw-r--r--lib/orber/src/OrberApp_IFR_impl.erl2
-rw-r--r--lib/orber/src/any.erl2
-rw-r--r--lib/orber/src/cdr_encode.erl2
-rw-r--r--lib/orber/src/cdrlib.erl2
-rw-r--r--lib/orber/src/corba_boa.erl2
-rw-r--r--lib/orber/src/corba_nvlist.erl2
-rw-r--r--lib/orber/src/corba_object.erl2
-rw-r--r--lib/orber/src/fixed.erl2
-rw-r--r--lib/orber/src/ifr_objects.hrl2
-rw-r--r--lib/orber/src/iop_ior.erl2
-rw-r--r--lib/orber/src/orber.erl2
-rw-r--r--lib/orber/src/orber_acl.erl2
-rw-r--r--lib/orber/src/orber_diagnostics.erl2
-rw-r--r--lib/orber/src/orber_env.erl2
-rw-r--r--lib/orber/src/orber_exceptions.erl2
-rw-r--r--lib/orber/src/orber_ifr.hrl2
-rw-r--r--lib/orber/src/orber_ifr_aliasdef.erl2
-rw-r--r--lib/orber/src/orber_ifr_arraydef.erl2
-rw-r--r--lib/orber/src/orber_ifr_attributedef.erl2
-rw-r--r--lib/orber/src/orber_ifr_constantdef.erl2
-rw-r--r--lib/orber/src/orber_ifr_contained.erl2
-rw-r--r--lib/orber/src/orber_ifr_container.erl2
-rw-r--r--lib/orber/src/orber_ifr_enumdef.erl2
-rw-r--r--lib/orber/src/orber_ifr_exceptiondef.erl2
-rw-r--r--lib/orber/src/orber_ifr_fixeddef.erl2
-rw-r--r--lib/orber/src/orber_ifr_idltype.erl2
-rw-r--r--lib/orber/src/orber_ifr_interfacedef.erl2
-rw-r--r--lib/orber/src/orber_ifr_irobject.erl2
-rw-r--r--lib/orber/src/orber_ifr_moduledef.erl2
-rw-r--r--lib/orber/src/orber_ifr_operationdef.erl2
-rw-r--r--lib/orber/src/orber_ifr_primitivedef.erl2
-rw-r--r--lib/orber/src/orber_ifr_sequencedef.erl2
-rw-r--r--lib/orber/src/orber_ifr_stringdef.erl2
-rw-r--r--lib/orber/src/orber_ifr_structdef.erl2
-rw-r--r--lib/orber/src/orber_ifr_typecode.erl2
-rw-r--r--lib/orber/src/orber_ifr_typedef.erl2
-rw-r--r--lib/orber/src/orber_ifr_uniondef.erl2
-rw-r--r--lib/orber/src/orber_ifr_wstringdef.erl2
-rw-r--r--lib/orber/src/orber_iiop.hrl2
-rw-r--r--lib/orber/src/orber_iiop_inproxy.erl2
-rw-r--r--lib/orber/src/orber_iiop_insup.erl2
-rw-r--r--lib/orber/src/orber_iiop_net.erl2
-rw-r--r--lib/orber/src/orber_iiop_net_accept.erl2
-rw-r--r--lib/orber/src/orber_iiop_outproxy.erl2
-rw-r--r--lib/orber/src/orber_iiop_outsup.erl2
-rw-r--r--lib/orber/src/orber_iiop_pm.erl2
-rw-r--r--lib/orber/src/orber_iiop_socketsup.erl2
-rw-r--r--lib/orber/src/orber_iiop_tracer.erl2
-rw-r--r--lib/orber/src/orber_iiop_tracer_silent.erl2
-rw-r--r--lib/orber/src/orber_iiop_tracer_stealth.erl2
-rw-r--r--lib/orber/src/orber_initial_references.erl2
-rw-r--r--lib/orber/src/orber_interceptors.erl2
-rw-r--r--lib/orber/src/orber_request_number.erl2
-rw-r--r--lib/orber/src/orber_tb.erl2
-rw-r--r--lib/orber/src/orber_tc.erl2
-rw-r--r--lib/orber/src/orber_typedefs.erl2
-rw-r--r--lib/orber/src/orber_web.erl2
-rw-r--r--lib/orber/test/Makefile2
-rw-r--r--lib/orber/test/cdrcoding_10_SUITE.erl2
-rw-r--r--lib/orber/test/cdrcoding_11_SUITE.erl2
-rw-r--r--lib/orber/test/cdrcoding_12_SUITE.erl2
-rw-r--r--lib/orber/test/cdrlib_SUITE.erl2
-rw-r--r--lib/orber/test/corba_SUITE.erl2
-rw-r--r--lib/orber/test/csiv2_SUITE.erl2
-rw-r--r--lib/orber/test/data_types_SUITE.erl2
-rw-r--r--lib/orber/test/generated_SUITE.erl2
-rw-r--r--lib/orber/test/iiop_module_do_test_impl.erl2
-rw-r--r--lib/orber/test/iiop_module_test_impl.erl2
-rw-r--r--lib/orber/test/iiop_test.idl2
-rw-r--r--lib/orber/test/iiop_test_impl.erl2
-rw-r--r--lib/orber/test/interceptors_SUITE.erl2
-rw-r--r--lib/orber/test/iop_ior_10_SUITE.erl2
-rw-r--r--lib/orber/test/iop_ior_11_SUITE.erl2
-rw-r--r--lib/orber/test/iop_ior_12_SUITE.erl2
-rw-r--r--lib/orber/test/ip_v4v6_interop_SUITE.erl2
-rw-r--r--lib/orber/test/lname_SUITE.erl2
-rw-r--r--lib/orber/test/multi_ORB_SUITE.erl2
-rw-r--r--lib/orber/test/naming_context_SUITE.erl2
-rw-r--r--lib/orber/test/orber_SUITE.erl2
-rw-r--r--lib/orber/test/orber_acl_SUITE.erl2
-rw-r--r--lib/orber/test/orber_firewall_ipv4_in_SUITE.erl2
-rw-r--r--lib/orber/test/orber_firewall_ipv4_out_SUITE.erl2
-rw-r--r--lib/orber/test/orber_firewall_ipv6_in_SUITE.erl2
-rw-r--r--lib/orber/test/orber_firewall_ipv6_out_SUITE.erl2
-rw-r--r--lib/orber/test/orber_nat_SUITE.erl2
-rw-r--r--lib/orber/test/orber_test.idl2
-rw-r--r--lib/orber/test/orber_test_lib.erl2
-rw-r--r--lib/orber/test/orber_test_server.cfg2
-rw-r--r--lib/orber/test/orber_test_server.idl2
-rw-r--r--lib/orber/test/orber_test_server_impl.erl2
-rw-r--r--lib/orber/test/orber_test_timeout_server_impl.erl2
-rw-r--r--lib/orber/test/orber_web_SUITE.erl2
-rw-r--r--lib/orber/test/tc_SUITE.erl2
-rw-r--r--lib/os_mon/Makefile2
-rw-r--r--lib/os_mon/c_src/Makefile.in2
-rw-r--r--lib/os_mon/c_src/cpu_sup.c2
-rw-r--r--lib/os_mon/c_src/ferrule.c3
-rw-r--r--lib/os_mon/c_src/memsup.c2
-rw-r--r--lib/os_mon/c_src/memsup.h2
-rw-r--r--lib/os_mon/c_src/mod_syslog.c3
-rw-r--r--lib/os_mon/c_src/nteventlog/elog_format.c2
-rw-r--r--lib/os_mon/c_src/nteventlog/elog_format.h2
-rw-r--r--lib/os_mon/c_src/nteventlog/elog_global.h2
-rw-r--r--lib/os_mon/c_src/nteventlog/elog_main.c2
-rw-r--r--lib/os_mon/c_src/nteventlog/elog_pipe_stdin.c2
-rw-r--r--lib/os_mon/c_src/nteventlog/elog_pipe_stdin.h2
-rw-r--r--lib/os_mon/c_src/nteventlog/elog_registry.c2
-rw-r--r--lib/os_mon/c_src/nteventlog/elog_registry.h2
-rw-r--r--lib/os_mon/c_src/nteventlog/elog_util.c2
-rw-r--r--lib/os_mon/c_src/nteventlog/elog_util.h2
-rw-r--r--lib/os_mon/c_src/win32sysinfo.c2
-rw-r--r--lib/os_mon/doc/src/Makefile2
-rw-r--r--lib/os_mon/doc/src/book.xml2
-rw-r--r--lib/os_mon/doc/src/cpu_sup.xml2
-rw-r--r--lib/os_mon/doc/src/disksup.xml2
-rw-r--r--lib/os_mon/doc/src/memsup.xml2
-rw-r--r--lib/os_mon/doc/src/notes.xml2
-rw-r--r--lib/os_mon/doc/src/nteventlog.xml2
-rw-r--r--lib/os_mon/doc/src/os_mon_app.xml2
-rw-r--r--lib/os_mon/doc/src/os_mon_mib.xml2
-rw-r--r--lib/os_mon/doc/src/os_sup.xml2
-rw-r--r--lib/os_mon/doc/src/part_notes.xml2
-rw-r--r--lib/os_mon/doc/src/ref_man.xml2
-rw-r--r--lib/os_mon/include/memsup.hrl2
-rw-r--r--lib/os_mon/mibs/Makefile2
-rw-r--r--lib/os_mon/mibs/OTP-OS-MON-MIB.mib2
-rw-r--r--lib/os_mon/src/Makefile2
-rw-r--r--lib/os_mon/src/cpu_sup.erl4
-rw-r--r--lib/os_mon/src/disksup.erl2
-rw-r--r--lib/os_mon/src/memsup.erl2
-rw-r--r--lib/os_mon/src/nteventlog.erl2
-rw-r--r--lib/os_mon/src/os_mon.app.src2
-rw-r--r--lib/os_mon/src/os_mon.appup.src2
-rw-r--r--lib/os_mon/src/os_mon.erl2
-rw-r--r--lib/os_mon/src/os_mon_mib.erl2
-rw-r--r--lib/os_mon/src/os_mon_sysinfo.erl2
-rw-r--r--lib/os_mon/src/os_sup.erl2
-rw-r--r--lib/os_mon/test/Makefile2
-rw-r--r--lib/os_mon/test/cpu_sup_SUITE.erl305
-rw-r--r--lib/os_mon/test/disksup_SUITE.erl88
-rw-r--r--lib/os_mon/test/memsup_SUITE.erl916
-rw-r--r--lib/os_mon/test/os_mon_SUITE.erl102
-rw-r--r--lib/os_mon/test/os_mon_conf.erl2
-rw-r--r--lib/os_mon/test/os_mon_mib_SUITE.erl666
-rw-r--r--lib/os_mon/test/os_sup_SUITE.erl197
-rw-r--r--lib/otp_mibs/Makefile2
-rw-r--r--lib/otp_mibs/doc/src/Makefile2
-rw-r--r--lib/otp_mibs/doc/src/book.xml2
-rw-r--r--lib/otp_mibs/doc/src/introduction.xml2
-rw-r--r--lib/otp_mibs/doc/src/mibs.xml2
-rw-r--r--lib/otp_mibs/doc/src/notes.xml2
-rw-r--r--lib/otp_mibs/doc/src/otp_mib.xml2
-rw-r--r--lib/otp_mibs/doc/src/part.xml2
-rw-r--r--lib/otp_mibs/doc/src/part_notes.xml2
-rw-r--r--lib/otp_mibs/doc/src/ref_man.xml2
-rw-r--r--lib/otp_mibs/mibs/Makefile2
-rw-r--r--lib/otp_mibs/mibs/OTP-EVA-MIB.mib2
-rw-r--r--lib/otp_mibs/mibs/OTP-MIB.mib2
-rw-r--r--lib/otp_mibs/mibs/OTP-REG.mib2
-rw-r--r--lib/otp_mibs/mibs/OTP-TC.mib2
-rw-r--r--lib/otp_mibs/src/Makefile2
-rw-r--r--lib/otp_mibs/src/otp_mib.erl2
-rw-r--r--lib/otp_mibs/src/otp_mibs.app.src2
-rw-r--r--lib/otp_mibs/src/otp_mibs.appup.src2
-rw-r--r--lib/otp_mibs/test/Makefile2
-rw-r--r--lib/otp_mibs/test/otp_mibs_SUITE.erl2
-rw-r--r--lib/parsetools/Makefile2
-rw-r--r--lib/parsetools/doc/src/Makefile2
-rw-r--r--lib/parsetools/doc/src/book.xml2
-rw-r--r--lib/parsetools/doc/src/leex.xml2
-rw-r--r--lib/parsetools/doc/src/notes.xml2
-rw-r--r--lib/parsetools/doc/src/notes_history.xml2
-rw-r--r--lib/parsetools/doc/src/part_notes.xml2
-rw-r--r--lib/parsetools/doc/src/ref_man.xml2
-rw-r--r--lib/parsetools/doc/src/yecc.xml2
-rw-r--r--lib/parsetools/src/Makefile2
-rw-r--r--lib/parsetools/src/parsetools.appup.src2
-rw-r--r--lib/parsetools/src/yecc.erl2
-rw-r--r--lib/parsetools/src/yeccscan.erl2
-rw-r--r--lib/parsetools/test/Makefile2
-rw-r--r--lib/parsetools/test/leex_SUITE.erl2
-rw-r--r--lib/parsetools/test/yecc_SUITE.erl2
-rw-r--r--lib/percept/Makefile2
-rw-r--r--lib/percept/doc/src/Makefile2
-rw-r--r--lib/percept/doc/src/book.xml2
-rw-r--r--lib/percept/doc/src/egd_ug.xmlsrc2
-rw-r--r--lib/percept/doc/src/notes.xml2
-rw-r--r--lib/percept/doc/src/part.xml2
-rw-r--r--lib/percept/doc/src/part_notes.xml2
-rw-r--r--lib/percept/doc/src/percept_ug.xmlsrc2
-rw-r--r--lib/percept/doc/src/ref_man.xml2
-rw-r--r--lib/percept/doc/stylesheet.css2
-rw-r--r--lib/percept/priv/Makefile2
-rw-r--r--lib/percept/priv/server_root/css/percept.css2
-rw-r--r--lib/percept/priv/server_root/htdocs/index.html2
-rw-r--r--lib/percept/priv/server_root/scripts/percept_area_select.js2
-rw-r--r--lib/percept/priv/server_root/scripts/percept_error_handler.js2
-rw-r--r--lib/percept/priv/server_root/scripts/percept_select_all.js2
-rw-r--r--lib/percept/src/Makefile2
-rw-r--r--lib/percept/src/egd.erl2
-rw-r--r--lib/percept/src/egd.hrl2
-rw-r--r--lib/percept/src/egd_font.erl2
-rw-r--r--lib/percept/src/egd_png.erl2
-rw-r--r--lib/percept/src/egd_primitives.erl2
-rw-r--r--lib/percept/src/egd_render.erl2
-rw-r--r--lib/percept/src/percept.app.src2
-rw-r--r--lib/percept/src/percept.appup.src2
-rw-r--r--lib/percept/src/percept.erl2
-rw-r--r--lib/percept/src/percept.hrl2
-rw-r--r--lib/percept/src/percept_analyzer.erl2
-rw-r--r--lib/percept/src/percept_db.erl2
-rw-r--r--lib/percept/src/percept_graph.erl2
-rw-r--r--lib/percept/src/percept_html.erl2
-rw-r--r--lib/percept/src/percept_image.erl2
-rw-r--r--lib/percept/test/Makefile2
-rw-r--r--lib/percept/test/egd_SUITE.erl2
-rw-r--r--lib/percept/test/percept_SUITE.erl2
-rw-r--r--lib/percept/test/percept_db_SUITE.erl2
-rw-r--r--lib/public_key/Makefile2
-rw-r--r--lib/public_key/asn1/Makefile2
-rw-r--r--lib/public_key/doc/src/Makefile2
-rw-r--r--lib/public_key/doc/src/book.xml2
-rw-r--r--lib/public_key/doc/src/notes.xml2
-rw-r--r--lib/public_key/doc/src/part.xml2
-rw-r--r--lib/public_key/doc/src/part_notes.xml2
-rw-r--r--lib/public_key/doc/src/public_key.xml2
-rw-r--r--lib/public_key/doc/src/ref_man.xml2
-rw-r--r--lib/public_key/doc/src/using_public_key.xml4
-rw-r--r--lib/public_key/include/public_key.hrl2
-rw-r--r--lib/public_key/src/Makefile2
-rw-r--r--lib/public_key/src/pubkey_cert.erl2
-rw-r--r--lib/public_key/src/pubkey_cert_records.erl2
-rw-r--r--lib/public_key/src/pubkey_crl.erl2
-rw-r--r--lib/public_key/src/pubkey_pbe.erl2
-rw-r--r--lib/public_key/src/pubkey_pem.erl2
-rw-r--r--lib/public_key/src/pubkey_ssh.erl2
-rw-r--r--lib/public_key/src/public_key.appup.src2
-rw-r--r--lib/public_key/test/Makefile2
-rw-r--r--lib/public_key/test/erl_make_certs.erl2
-rw-r--r--lib/public_key/test/pbe_SUITE.erl2
-rw-r--r--lib/public_key/test/pkits_SUITE.erl2
-rw-r--r--lib/public_key/test/public_key_SUITE.erl6
-rw-r--r--lib/reltool/Makefile2
-rwxr-xr-xlib/reltool/bin/reltool.escript2
-rw-r--r--lib/reltool/doc/src/Makefile2
-rw-r--r--lib/reltool/doc/src/book.xml2
-rw-r--r--lib/reltool/doc/src/files.mk2
-rw-r--r--lib/reltool/doc/src/notes.xml2
-rw-r--r--lib/reltool/doc/src/part.xml2
-rw-r--r--lib/reltool/doc/src/ref_man.xml2
-rw-r--r--lib/reltool/doc/src/reltool.xml2
-rw-r--r--lib/reltool/doc/src/reltool_examples.xml2
-rw-r--r--lib/reltool/doc/src/reltool_intro.xml2
-rw-r--r--lib/reltool/doc/src/reltool_usage.xml2
-rw-r--r--lib/reltool/examples/Makefile2
-rw-r--r--lib/reltool/src/Makefile2
-rw-r--r--lib/reltool/src/files.mk2
-rw-r--r--lib/reltool/src/reltool.app.src2
-rw-r--r--lib/reltool/src/reltool.appup.src2
-rw-r--r--lib/reltool/src/reltool.erl2
-rw-r--r--lib/reltool/src/reltool_app_win.erl2
-rw-r--r--lib/reltool/src/reltool_fgraph.erl2
-rw-r--r--lib/reltool/src/reltool_fgraph.hrl2
-rw-r--r--lib/reltool/src/reltool_fgraph_win.erl2
-rw-r--r--lib/reltool/src/reltool_mod_win.erl2
-rw-r--r--lib/reltool/src/reltool_server.erl2
-rw-r--r--lib/reltool/src/reltool_sys_win.erl2
-rw-r--r--lib/reltool/src/reltool_target.erl2
-rw-r--r--lib/reltool/src/reltool_utils.erl2
-rw-r--r--lib/reltool/test/Makefile2
-rw-r--r--lib/reltool/test/reltool_app_SUITE.erl2
-rw-r--r--lib/reltool/test/reltool_manual_gui_SUITE.erl2
-rw-r--r--lib/reltool/test/reltool_server_SUITE.erl49
-rw-r--r--lib/reltool/test/reltool_test_lib.erl2
-rw-r--r--lib/reltool/test/reltool_test_lib.hrl2
-rw-r--r--lib/reltool/test/reltool_wx_SUITE.erl2
-rwxr-xr-xlib/reltool/test/rtt2
-rw-r--r--lib/reltool/test/rtt.erl2
-rw-r--r--lib/runtime_tools/Makefile2
-rw-r--r--lib/runtime_tools/c_src/Makefile.in71
-rw-r--r--lib/runtime_tools/c_src/dtrace_user.d2
-rw-r--r--lib/runtime_tools/c_src/dyntrace.c606
-rw-r--r--lib/runtime_tools/c_src/dyntrace_lttng.h367
-rw-r--r--lib/runtime_tools/c_src/trace_file_drv.c15
-rw-r--r--lib/runtime_tools/c_src/trace_ip_drv.c2
-rw-r--r--lib/runtime_tools/doc/src/LTTng.xml461
-rw-r--r--lib/runtime_tools/doc/src/Makefile4
-rw-r--r--lib/runtime_tools/doc/src/book.xml2
-rw-r--r--lib/runtime_tools/doc/src/dbg.xml294
-rw-r--r--lib/runtime_tools/doc/src/dyntrace.xml2
-rw-r--r--lib/runtime_tools/doc/src/erts_alloc_config.xml2
-rw-r--r--lib/runtime_tools/doc/src/notes.xml2
-rw-r--r--lib/runtime_tools/doc/src/notes_history.xml2
-rw-r--r--lib/runtime_tools/doc/src/part.xml3
-rw-r--r--lib/runtime_tools/doc/src/part_notes.xml2
-rw-r--r--lib/runtime_tools/doc/src/part_notes_history.xml2
-rw-r--r--lib/runtime_tools/doc/src/ref_man.xml2
-rw-r--r--lib/runtime_tools/doc/src/runtime_tools_app.xml2
-rw-r--r--lib/runtime_tools/doc/src/system_information.xml2
-rw-r--r--lib/runtime_tools/examples/dist.d2
-rw-r--r--lib/runtime_tools/examples/dist.systemtap2
-rw-r--r--lib/runtime_tools/examples/driver1.d2
-rw-r--r--lib/runtime_tools/examples/driver1.systemtap2
-rw-r--r--lib/runtime_tools/examples/efile_drv.d2
-rw-r--r--lib/runtime_tools/examples/efile_drv.systemtap2
-rw-r--r--lib/runtime_tools/examples/function-calls.d2
-rw-r--r--lib/runtime_tools/examples/function-calls.systemtap2
-rw-r--r--lib/runtime_tools/examples/garbage-collection.d2
-rw-r--r--lib/runtime_tools/examples/garbage-collection.systemtap2
-rw-r--r--lib/runtime_tools/examples/memory1.d2
-rw-r--r--lib/runtime_tools/examples/memory1.systemtap2
-rw-r--r--lib/runtime_tools/examples/messages.d2
-rw-r--r--lib/runtime_tools/examples/messages.systemtap2
-rw-r--r--lib/runtime_tools/examples/port1.d2
-rw-r--r--lib/runtime_tools/examples/port1.systemtap2
-rw-r--r--lib/runtime_tools/examples/process-scheduling.d2
-rw-r--r--lib/runtime_tools/examples/process-scheduling.systemtap2
-rw-r--r--lib/runtime_tools/examples/spawn-exit.d2
-rw-r--r--lib/runtime_tools/examples/spawn-exit.systemtap2
-rw-r--r--lib/runtime_tools/examples/user-probe-n.d2
-rw-r--r--lib/runtime_tools/examples/user-probe-n.systemtap2
-rw-r--r--lib/runtime_tools/examples/user-probe.d2
-rw-r--r--lib/runtime_tools/examples/user-probe.systemtap2
-rw-r--r--lib/runtime_tools/include/observer_backend.hrl2
-rw-r--r--lib/runtime_tools/src/Makefile2
-rw-r--r--lib/runtime_tools/src/appmon_info.erl2
-rw-r--r--lib/runtime_tools/src/dbg.erl93
-rw-r--r--lib/runtime_tools/src/dyntrace.erl79
-rw-r--r--lib/runtime_tools/src/erts_alloc_config.erl2
-rw-r--r--lib/runtime_tools/src/msacc.erl18
-rw-r--r--lib/runtime_tools/src/observer_backend.erl2
-rw-r--r--lib/runtime_tools/src/percept_profile.erl2
-rw-r--r--lib/runtime_tools/src/runtime_tools.app.src6
-rw-r--r--lib/runtime_tools/src/runtime_tools.appup.src2
-rw-r--r--lib/runtime_tools/src/runtime_tools.erl2
-rw-r--r--lib/runtime_tools/src/runtime_tools_sup.erl2
-rw-r--r--lib/runtime_tools/src/system_information.erl52
-rw-r--r--lib/runtime_tools/test/Makefile1
-rw-r--r--lib/runtime_tools/test/dbg_SUITE.erl1249
-rw-r--r--lib/runtime_tools/test/dbg_SUITE_data/Makefile.src8
-rw-r--r--lib/runtime_tools/test/dbg_SUITE_data/dbg_SUITE.c113
-rw-r--r--lib/runtime_tools/test/dbg_SUITE_data/dbg_test.erl2
-rw-r--r--lib/runtime_tools/test/dbg_SUITE_data/exref_td.erl2
-rw-r--r--lib/runtime_tools/test/dyntrace_SUITE.erl37
-rw-r--r--lib/runtime_tools/test/dyntrace_lttng_SUITE.erl377
-rw-r--r--lib/runtime_tools/test/erts_alloc_config_SUITE.erl164
-rw-r--r--lib/runtime_tools/test/runtime_tools_SUITE.erl41
-rw-r--r--lib/runtime_tools/test/system_information_SUITE.erl10
-rw-r--r--lib/sasl/Makefile2
-rw-r--r--lib/sasl/doc/src/alarm_handler.xml2
-rw-r--r--lib/sasl/doc/src/appup.xml5
-rw-r--r--lib/sasl/doc/src/book.xml2
-rw-r--r--lib/sasl/doc/src/error_logging.xml7
-rw-r--r--lib/sasl/doc/src/notes.xml2
-rw-r--r--lib/sasl/doc/src/notes_history.xml2
-rw-r--r--lib/sasl/doc/src/part.xml2
-rw-r--r--lib/sasl/doc/src/part_notes.xml2
-rw-r--r--lib/sasl/doc/src/part_notes_history.xml2
-rw-r--r--lib/sasl/doc/src/rb.xml2
-rw-r--r--lib/sasl/doc/src/ref_man.xml2
-rw-r--r--lib/sasl/doc/src/rel.xml2
-rw-r--r--lib/sasl/doc/src/release_handler.xml2
-rw-r--r--lib/sasl/doc/src/relup.xml2
-rw-r--r--lib/sasl/doc/src/sasl_app.xml2
-rw-r--r--lib/sasl/doc/src/sasl_intro.xml2
-rw-r--r--lib/sasl/doc/src/script.xml2
-rw-r--r--lib/sasl/doc/src/systools.xml2
-rw-r--r--lib/sasl/examples/src/Makefile2
-rw-r--r--lib/sasl/examples/src/target_system.erl2
-rw-r--r--lib/sasl/src/Makefile2
-rw-r--r--lib/sasl/src/alarm_handler.erl2
-rw-r--r--lib/sasl/src/erlsrv.erl2
-rw-r--r--lib/sasl/src/format_lib_supp.erl2
-rw-r--r--lib/sasl/src/misc_supp.erl2
-rw-r--r--lib/sasl/src/rb.erl2
-rw-r--r--lib/sasl/src/rb_format_supp.erl2
-rw-r--r--lib/sasl/src/release_handler.erl2
-rw-r--r--lib/sasl/src/release_handler_1.erl2
-rw-r--r--lib/sasl/src/sasl.app.src2
-rw-r--r--lib/sasl/src/sasl.appup.src2
-rw-r--r--lib/sasl/src/sasl.erl2
-rw-r--r--lib/sasl/src/sasl_report.erl2
-rw-r--r--lib/sasl/src/sasl_report_file_h.erl2
-rw-r--r--lib/sasl/src/sasl_report_tty_h.erl2
-rw-r--r--lib/sasl/src/si.erl2
-rw-r--r--lib/sasl/src/si_sasl_supp.erl2
-rw-r--r--lib/sasl/src/systools.erl2
-rw-r--r--lib/sasl/src/systools.hrl2
-rw-r--r--lib/sasl/src/systools_lib.erl2
-rw-r--r--lib/sasl/src/systools_make.erl43
-rw-r--r--lib/sasl/src/systools_rc.erl2
-rw-r--r--lib/sasl/src/systools_relup.erl2
-rw-r--r--lib/sasl/test/Makefile2
-rw-r--r--lib/sasl/test/alarm_handler_SUITE.erl2
-rw-r--r--lib/sasl/test/installer.erl2
-rw-r--r--lib/sasl/test/rb_SUITE.erl2
-rw-r--r--lib/sasl/test/release_handler_SUITE.erl17
-rw-r--r--lib/sasl/test/sasl_SUITE.erl2
-rw-r--r--lib/sasl/test/sasl_report_SUITE.erl2
-rw-r--r--lib/sasl/test/systools_SUITE.erl2
-rw-r--r--lib/sasl/test/systools_rc_SUITE.erl2
-rw-r--r--lib/sasl/test/test_lib.hrl4
-rw-r--r--lib/sasl/vsn.mk2
-rw-r--r--lib/snmp/Makefile2
-rw-r--r--lib/snmp/doc/src/Makefile2
-rw-r--r--lib/snmp/doc/src/book.xml2
-rw-r--r--lib/snmp/doc/src/files.mk2
-rw-r--r--lib/snmp/doc/src/notes.xml2
-rw-r--r--lib/snmp/doc/src/notes_history.xml2
-rw-r--r--lib/snmp/doc/src/part.xml2
-rw-r--r--lib/snmp/doc/src/part_notes.xml2
-rw-r--r--lib/snmp/doc/src/part_notes_history.xml2
-rw-r--r--lib/snmp/doc/src/ref_man.xml2
-rw-r--r--lib/snmp/doc/src/snmp.xml2
-rw-r--r--lib/snmp/doc/src/snmp_agent_config_files.xml2
-rw-r--r--lib/snmp/doc/src/snmp_agent_funct_descr.xml2
-rw-r--r--lib/snmp/doc/src/snmp_agent_netif.xml2
-rw-r--r--lib/snmp/doc/src/snmp_app.xml2
-rw-r--r--lib/snmp/doc/src/snmp_app_a.xml2
-rw-r--r--lib/snmp/doc/src/snmp_app_b.xml2
-rw-r--r--lib/snmp/doc/src/snmp_audit_trail_log.xml2
-rw-r--r--lib/snmp/doc/src/snmp_community_mib.xml2
-rw-r--r--lib/snmp/doc/src/snmp_config.xml2
-rw-r--r--lib/snmp/doc/src/snmp_def_instr_functions.xml2
-rw-r--r--lib/snmp/doc/src/snmp_framework_mib.xml2
-rw-r--r--lib/snmp/doc/src/snmp_generic.xml2
-rw-r--r--lib/snmp/doc/src/snmp_impl_example_agent.xml2
-rw-r--r--lib/snmp/doc/src/snmp_impl_example_manager.xml2
-rw-r--r--lib/snmp/doc/src/snmp_index.xml2
-rw-r--r--lib/snmp/doc/src/snmp_instr_functions.xml2
-rw-r--r--lib/snmp/doc/src/snmp_intro.xml2
-rw-r--r--lib/snmp/doc/src/snmp_manager_config_files.xml2
-rw-r--r--lib/snmp/doc/src/snmp_manager_funct_descr.xml2
-rw-r--r--lib/snmp/doc/src/snmp_manager_netif.xml2
-rw-r--r--lib/snmp/doc/src/snmp_mib_compiler.xml2
-rw-r--r--lib/snmp/doc/src/snmp_notification_mib.xml2
-rw-r--r--lib/snmp/doc/src/snmp_pdus.xml2
-rw-r--r--lib/snmp/doc/src/snmp_standard_mib.xml2
-rw-r--r--lib/snmp/doc/src/snmp_target_mib.xml2
-rw-r--r--lib/snmp/doc/src/snmp_user_based_sm_mib.xml2
-rw-r--r--lib/snmp/doc/src/snmp_view_based_acm_mib.xml2
-rw-r--r--lib/snmp/doc/src/snmpa.xml2
-rw-r--r--lib/snmp/doc/src/snmpa_conf.xml2
-rw-r--r--lib/snmp/doc/src/snmpa_discovery_handler.xml2
-rw-r--r--lib/snmp/doc/src/snmpa_error.xml2
-rw-r--r--lib/snmp/doc/src/snmpa_error_io.xml2
-rw-r--r--lib/snmp/doc/src/snmpa_error_logger.xml2
-rw-r--r--lib/snmp/doc/src/snmpa_error_report.xml2
-rw-r--r--lib/snmp/doc/src/snmpa_local_db.xml2
-rw-r--r--lib/snmp/doc/src/snmpa_mib_data.xml2
-rw-r--r--lib/snmp/doc/src/snmpa_mib_storage.xml2
-rw-r--r--lib/snmp/doc/src/snmpa_mpd.xml2
-rw-r--r--lib/snmp/doc/src/snmpa_network_interface.xml2
-rw-r--r--lib/snmp/doc/src/snmpa_network_interface_filter.xml2
-rw-r--r--lib/snmp/doc/src/snmpa_notification_delivery_info_receiver.xml2
-rw-r--r--lib/snmp/doc/src/snmpa_notification_filter.xml2
-rw-r--r--lib/snmp/doc/src/snmpa_supervisor.xml2
-rw-r--r--lib/snmp/doc/src/snmpc.xml2
-rw-r--r--lib/snmp/doc/src/snmpc_cmd.xml2
-rw-r--r--lib/snmp/doc/src/snmpm.xml2
-rw-r--r--lib/snmp/doc/src/snmpm_conf.xml2
-rw-r--r--lib/snmp/doc/src/snmpm_mpd.xml2
-rw-r--r--lib/snmp/doc/src/snmpm_network_interface.xml2
-rw-r--r--lib/snmp/doc/src/snmpm_network_interface_filter.xml2
-rw-r--r--lib/snmp/doc/src/snmpm_user.xml2
-rw-r--r--lib/snmp/examples/Makefile2
-rw-r--r--lib/snmp/examples/ex1/Makefile2
-rw-r--r--lib/snmp/examples/ex2/Makefile2
-rw-r--r--lib/snmp/examples/ex2/snmp_ex2_manager.erl2
-rw-r--r--lib/snmp/examples/ex2/snmp_ex2_simple_standard_test.erl2
-rw-r--r--lib/snmp/examples/subdirs.mk2
-rw-r--r--lib/snmp/include/SNMPv2-TC.hrl2
-rw-r--r--lib/snmp/include/snmp_tables.hrl2
-rw-r--r--lib/snmp/include/snmp_types.hrl2
-rw-r--r--lib/snmp/mibs/Makefile.in2
-rw-r--r--lib/snmp/priv/conf/Makefile2
-rw-r--r--lib/snmp/priv/conf/agent/Makefile2
-rw-r--r--lib/snmp/priv/conf/agent/files.mk2
-rw-r--r--lib/snmp/priv/conf/manager/Makefile2
-rw-r--r--lib/snmp/priv/conf/manager/files.mk2
-rw-r--r--lib/snmp/priv/conf/subdirs.mk2
-rw-r--r--lib/snmp/src/Makefile2
-rw-r--r--lib/snmp/src/agent/Makefile2
-rw-r--r--lib/snmp/src/agent/depend.mk2
-rw-r--r--lib/snmp/src/agent/modules.mk2
-rw-r--r--lib/snmp/src/agent/snmp_community_mib.erl2
-rw-r--r--lib/snmp/src/agent/snmp_framework_mib.erl2
-rw-r--r--lib/snmp/src/agent/snmp_generic.erl2
-rw-r--r--lib/snmp/src/agent/snmp_generic_mnesia.erl2
-rw-r--r--lib/snmp/src/agent/snmp_index.erl2
-rw-r--r--lib/snmp/src/agent/snmp_notification_mib.erl2
-rw-r--r--lib/snmp/src/agent/snmp_view_based_acm_mib.erl2
-rw-r--r--lib/snmp/src/agent/snmpa.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_acm.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_agent.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_agent_sup.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_app.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_atl.hrl2
-rw-r--r--lib/snmp/src/agent/snmpa_authentication_service.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_conf.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_discovery_handler.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_discovery_handler_default.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_error.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_error_io.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_error_logger.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_error_report.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_general_db.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_internal.hrl2
-rw-r--r--lib/snmp/src/agent/snmpa_local_db.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_mib.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_mib_data.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_mib_data_ttln.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_mib_data_tttn.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_mib_lib.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_mib_storage.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_mib_storage_dets.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_mib_storage_ets.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_misc_sup.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_net_if_filter.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_network_interface.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_network_interface_filter.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_notification_delivery_info_receiver.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_notification_filter.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_set.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_set_lib.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_set_mechanism.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_supervisor.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_svbl.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_symbolic_store.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_target_cache.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_trap.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_vacm.hrl2
-rw-r--r--lib/snmp/src/app/Makefile2
-rw-r--r--lib/snmp/src/app/depend.mk2
-rw-r--r--lib/snmp/src/app/modules.mk2
-rw-r--r--lib/snmp/src/app/snmp.erl2
-rw-r--r--lib/snmp/src/app/snmp_app.erl2
-rw-r--r--lib/snmp/src/app/snmp_app_sup.erl2
-rw-r--r--lib/snmp/src/app/snmp_internal.hrl2
-rw-r--r--lib/snmp/src/compile/Makefile2
-rw-r--r--lib/snmp/src/compile/depend.mk2
-rw-r--r--lib/snmp/src/compile/modules.mk2
-rw-r--r--lib/snmp/src/compile/snmpc.hrl2
-rw-r--r--lib/snmp/src/compile/snmpc.src2
-rw-r--r--lib/snmp/src/compile/snmpc_lib.erl2
-rw-r--r--lib/snmp/src/compile/snmpc_lib.hrl2
-rw-r--r--lib/snmp/src/compile/snmpc_mib_gram.yrl2
-rw-r--r--lib/snmp/src/compile/snmpc_mib_to_hrl.erl2
-rw-r--r--lib/snmp/src/compile/snmpc_misc.erl2
-rw-r--r--lib/snmp/src/compile/snmpc_misc.hrl2
-rw-r--r--lib/snmp/src/compile/snmpc_tok.erl2
-rw-r--r--lib/snmp/src/manager/Makefile2
-rw-r--r--lib/snmp/src/manager/depend.mk2
-rw-r--r--lib/snmp/src/manager/modules.mk2
-rw-r--r--lib/snmp/src/manager/snmpm.erl2
-rw-r--r--lib/snmp/src/manager/snmpm_atl.hrl2
-rw-r--r--lib/snmp/src/manager/snmpm_conf.erl2
-rw-r--r--lib/snmp/src/manager/snmpm_config.erl2
-rw-r--r--lib/snmp/src/manager/snmpm_internal.hrl2
-rw-r--r--lib/snmp/src/manager/snmpm_misc_sup.erl2
-rw-r--r--lib/snmp/src/manager/snmpm_net_if_filter.erl2
-rw-r--r--lib/snmp/src/manager/snmpm_net_if_mt.erl2
-rw-r--r--lib/snmp/src/manager/snmpm_network_interface.erl2
-rw-r--r--lib/snmp/src/manager/snmpm_network_interface_filter.erl2
-rw-r--r--lib/snmp/src/manager/snmpm_server_sup.erl2
-rw-r--r--lib/snmp/src/manager/snmpm_supervisor.erl2
-rw-r--r--lib/snmp/src/manager/snmpm_user.erl2
-rw-r--r--lib/snmp/src/manager/snmpm_user_default.erl2
-rw-r--r--lib/snmp/src/manager/snmpm_user_old.erl2
-rw-r--r--lib/snmp/src/manager/snmpm_usm.erl2
-rw-r--r--lib/snmp/src/manager/snmpm_usm.hrl2
-rw-r--r--lib/snmp/src/misc/Makefile2
-rw-r--r--lib/snmp/src/misc/depend.mk2
-rw-r--r--lib/snmp/src/misc/modules.mk2
-rw-r--r--lib/snmp/src/misc/snmp_conf.erl2
-rw-r--r--lib/snmp/src/misc/snmp_config.erl2
-rw-r--r--lib/snmp/src/misc/snmp_debug.hrl2
-rw-r--r--lib/snmp/src/misc/snmp_log.erl2
-rw-r--r--lib/snmp/src/misc/snmp_mini_mib.erl2
-rw-r--r--lib/snmp/src/misc/snmp_note_store.erl2
-rw-r--r--lib/snmp/src/misc/snmp_pdus.erl2
-rw-r--r--lib/snmp/src/misc/snmp_usm.erl2
-rw-r--r--lib/snmp/src/misc/snmp_verbosity.hrl2
-rw-r--r--lib/snmp/src/subdirs.mk2
-rw-r--r--lib/snmp/subdirs.mk2
-rw-r--r--lib/snmp/test/Makefile2
-rw-r--r--lib/snmp/test/exp/snmp_agent_bl_test.erl2
-rw-r--r--lib/snmp/test/exp/snmp_agent_ms_test.erl2
-rw-r--r--lib/snmp/test/exp/snmp_agent_mt_test.erl2
-rw-r--r--lib/snmp/test/exp/snmp_agent_v1_test.erl2
-rw-r--r--lib/snmp/test/exp/snmp_agent_v2_test.erl2
-rw-r--r--lib/snmp/test/exp/snmp_agent_v3_test.erl2
-rw-r--r--lib/snmp/test/klas3.erl2
-rw-r--r--lib/snmp/test/modules.mk2
-rw-r--r--lib/snmp/test/sa.erl2
-rw-r--r--lib/snmp/test/snmp_SUITE.erl2
-rw-r--r--lib/snmp/test/snmp_agent_mibs_test.erl2
-rw-r--r--lib/snmp/test/snmp_agent_nfilter_test.erl2
-rw-r--r--lib/snmp/test/snmp_agent_test.erl2
-rw-r--r--lib/snmp/test/snmp_agent_test_lib.erl2
-rw-r--r--lib/snmp/test/snmp_app_test.erl2
-rw-r--r--lib/snmp/test/snmp_appup_test.erl2
-rw-r--r--lib/snmp/test/snmp_compiler_test.erl2
-rw-r--r--lib/snmp/test/snmp_conf_test.erl2
-rw-r--r--lib/snmp/test/snmp_log_test.erl2
-rw-r--r--lib/snmp/test/snmp_manager_config_test.erl2
-rw-r--r--lib/snmp/test/snmp_manager_test.erl2
-rw-r--r--lib/snmp/test/snmp_manager_user.erl2
-rw-r--r--lib/snmp/test/snmp_manager_user_old.erl2
-rw-r--r--lib/snmp/test/snmp_manager_user_test.erl2
-rw-r--r--lib/snmp/test/snmp_manager_user_test_lib.erl2
-rw-r--r--lib/snmp/test/snmp_note_store_test.erl2
-rw-r--r--lib/snmp/test/snmp_pdus_test.erl2
-rw-r--r--lib/snmp/test/snmp_test_manager.erl2
-rw-r--r--lib/snmp/test/snmp_test_mgr_counter_server.erl2
-rw-r--r--lib/snmp/test/snmp_test_mgr_misc.erl2
-rw-r--r--lib/snmp/test/snmp_test_server.erl2
-rw-r--r--lib/snmp/test/snmp_test_suite.erl2
-rw-r--r--lib/snmp/test/snmp_to_snmpnet_SUITE.erl2
-rwxr-xr-xlib/snmp/test/snmp_to_snmpnet_SUITE_data/start_stop_wrapper2
-rw-r--r--lib/snmp/test/test1.erl2
-rw-r--r--lib/snmp/test/test2.erl2
-rw-r--r--lib/snmp/test/test_config/Makefile2
-rw-r--r--lib/snmp/test/test_config/modules.mk2
-rw-r--r--lib/snmp/test/test_config/snmp_test_config.erl2
-rw-r--r--lib/snmp/vsn.mk2
-rw-r--r--lib/ssh/Makefile2
-rw-r--r--lib/ssh/doc/src/Makefile2
-rw-r--r--lib/ssh/doc/src/book.xml2
-rw-r--r--lib/ssh/doc/src/introduction.xml2
-rw-r--r--lib/ssh/doc/src/notes.xml2
-rw-r--r--lib/ssh/doc/src/part_notes.xml2
-rw-r--r--lib/ssh/doc/src/ref_man.xml2
-rw-r--r--lib/ssh/doc/src/ssh.xml17
-rw-r--r--lib/ssh/doc/src/ssh_channel.xml2
-rw-r--r--lib/ssh/doc/src/ssh_client_key_api.xml2
-rw-r--r--lib/ssh/doc/src/ssh_sftp.xml218
-rw-r--r--lib/ssh/doc/src/ssh_sftpd.xml2
-rw-r--r--lib/ssh/doc/src/usersguide.xml2
-rw-r--r--lib/ssh/doc/src/using_ssh.xml2
-rw-r--r--lib/ssh/examples/ssh_sample_cli.erl2
-rw-r--r--lib/ssh/src/Makefile3
-rw-r--r--lib/ssh/src/ssh.app.src10
-rw-r--r--lib/ssh/src/ssh.erl101
-rw-r--r--lib/ssh/src/ssh.hrl6
-rw-r--r--lib/ssh/src/ssh_acceptor.erl45
-rw-r--r--lib/ssh/src/ssh_acceptor_sup.erl7
-rw-r--r--lib/ssh/src/ssh_app.erl2
-rw-r--r--lib/ssh/src/ssh_auth.erl24
-rw-r--r--lib/ssh/src/ssh_auth.hrl2
-rw-r--r--lib/ssh/src/ssh_bits.erl2
-rw-r--r--lib/ssh/src/ssh_channel.erl7
-rw-r--r--lib/ssh/src/ssh_channel_sup.erl2
-rw-r--r--lib/ssh/src/ssh_cli.erl2
-rw-r--r--lib/ssh/src/ssh_client_key.erl2
-rw-r--r--lib/ssh/src/ssh_client_key_api.erl2
-rw-r--r--lib/ssh/src/ssh_connect.hrl10
-rw-r--r--lib/ssh/src/ssh_connection.erl152
-rw-r--r--lib/ssh/src/ssh_connection_handler.erl2903
-rw-r--r--lib/ssh/src/ssh_connection_sup.erl2
-rw-r--r--lib/ssh/src/ssh_daemon_channel.erl2
-rw-r--r--lib/ssh/src/ssh_dbg.erl140
-rw-r--r--lib/ssh/src/ssh_file.erl2
-rw-r--r--lib/ssh/src/ssh_info.erl341
-rw-r--r--lib/ssh/src/ssh_io.erl2
-rw-r--r--lib/ssh/src/ssh_message.erl48
-rw-r--r--lib/ssh/src/ssh_no_io.erl46
-rw-r--r--lib/ssh/src/ssh_server_key.erl2
-rw-r--r--lib/ssh/src/ssh_server_key_api.erl2
-rw-r--r--lib/ssh/src/ssh_sftp.erl2
-rw-r--r--lib/ssh/src/ssh_sftpd_file.erl2
-rw-r--r--lib/ssh/src/ssh_sftpd_file_api.erl2
-rw-r--r--lib/ssh/src/ssh_shell.erl2
-rw-r--r--lib/ssh/src/ssh_subsystem_sup.erl2
-rw-r--r--lib/ssh/src/ssh_sup.erl2
-rw-r--r--lib/ssh/src/ssh_system_sup.erl11
-rw-r--r--lib/ssh/src/ssh_transport.erl197
-rw-r--r--lib/ssh/src/ssh_transport.hrl2
-rw-r--r--lib/ssh/src/ssh_userauth.hrl2
-rw-r--r--lib/ssh/src/ssh_xfer.erl2
-rw-r--r--lib/ssh/src/ssh_xfer.hrl2
-rw-r--r--lib/ssh/src/sshc_sup.erl6
-rw-r--r--lib/ssh/src/sshd_sup.erl2
-rw-r--r--lib/ssh/test/Makefile3
-rw-r--r--lib/ssh/test/property_test/ssh_eqc_client_server.erl2
-rw-r--r--lib/ssh/test/property_test/ssh_eqc_encode_decode.erl2
-rw-r--r--lib/ssh/test/property_test/ssh_eqc_subsys.erl2
-rw-r--r--lib/ssh/test/ssh_algorithms_SUITE.erl32
-rw-r--r--lib/ssh/test/ssh_basic_SUITE.erl4
-rw-r--r--lib/ssh/test/ssh_benchmark_SUITE.erl48
-rw-r--r--lib/ssh/test/ssh_connection_SUITE.erl46
-rw-r--r--lib/ssh/test/ssh_echo_server.erl3
-rw-r--r--lib/ssh/test/ssh_options_SUITE.erl59
-rw-r--r--lib/ssh/test/ssh_peername_sockname_server.erl2
-rw-r--r--lib/ssh/test/ssh_property_test_SUITE.erl2
-rw-r--r--lib/ssh/test/ssh_protocol_SUITE.erl4
-rw-r--r--lib/ssh/test/ssh_renegotiate_SUITE.erl12
-rw-r--r--lib/ssh/test/ssh_sftp_SUITE.erl31
-rw-r--r--lib/ssh/test/ssh_sftpd_SUITE.erl11
-rw-r--r--lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl5
-rw-r--r--lib/ssh/test/ssh_sftpd_erlclient_SUITE_data/ssh_sftpd_file_alt.erl2
-rw-r--r--lib/ssh/test/ssh_sup_SUITE.erl93
-rw-r--r--lib/ssh/test/ssh_test_cli.erl9
-rw-r--r--lib/ssh/test/ssh_test_lib.erl80
-rw-r--r--lib/ssh/test/ssh_test_lib.hrl27
-rw-r--r--lib/ssh/test/ssh_to_openssh_SUITE.erl44
-rw-r--r--lib/ssh/test/ssh_to_openssh_SUITE_data/ssh_host_rsa_key16
-rw-r--r--lib/ssh/test/ssh_to_openssh_SUITE_data/ssh_host_rsa_key.pub5
-rw-r--r--lib/ssh/test/ssh_trpt_test_lib.erl9
-rw-r--r--lib/ssh/test/ssh_upgrade_SUITE.erl7
-rw-r--r--lib/ssh/vsn.mk2
-rw-r--r--lib/ssl/Makefile2
-rw-r--r--lib/ssl/doc/src/book.xml2
-rw-r--r--lib/ssl/doc/src/notes.xml49
-rw-r--r--lib/ssl/doc/src/pkix_certs.xml2
-rw-r--r--lib/ssl/doc/src/release_notes.xml2
-rw-r--r--lib/ssl/doc/src/ssl.xml71
-rw-r--r--lib/ssl/doc/src/ssl_app.xml2
-rw-r--r--lib/ssl/doc/src/ssl_distribution.xml2
-rw-r--r--lib/ssl/doc/src/usersguide.xml2
-rw-r--r--lib/ssl/doc/src/using_ssl.xml2
-rw-r--r--lib/ssl/examples/certs/Makefile2
-rw-r--r--lib/ssl/examples/src/Makefile2
-rw-r--r--lib/ssl/examples/src/client_server.erl2
-rw-r--r--lib/ssl/src/dtls.erl2
-rw-r--r--lib/ssl/src/dtls_connection.erl359
-rw-r--r--lib/ssl/src/dtls_connection.hrl2
-rw-r--r--lib/ssl/src/dtls_connection_sup.erl2
-rw-r--r--lib/ssl/src/dtls_handshake.erl7
-rw-r--r--lib/ssl/src/dtls_handshake.hrl2
-rw-r--r--lib/ssl/src/dtls_record.erl25
-rw-r--r--lib/ssl/src/dtls_record.hrl2
-rw-r--r--lib/ssl/src/dtls_v1.erl2
-rw-r--r--lib/ssl/src/inet_tls_dist.erl2
-rw-r--r--lib/ssl/src/ssl.appup.src6
-rw-r--r--lib/ssl/src/ssl.erl59
-rw-r--r--lib/ssl/src/ssl_api.hrl2
-rw-r--r--lib/ssl/src/ssl_app.erl2
-rw-r--r--lib/ssl/src/ssl_certificate.erl2
-rw-r--r--lib/ssl/src/ssl_cipher.erl101
-rw-r--r--lib/ssl/src/ssl_connection.erl1000
-rw-r--r--lib/ssl/src/ssl_connection.hrl5
-rw-r--r--lib/ssl/src/ssl_dist_sup.erl2
-rw-r--r--lib/ssl/src/ssl_handshake.erl214
-rw-r--r--lib/ssl/src/ssl_handshake.hrl4
-rw-r--r--lib/ssl/src/ssl_internal.hrl5
-rw-r--r--lib/ssl/src/ssl_listen_tracker_sup.erl2
-rw-r--r--lib/ssl/src/ssl_manager.erl8
-rw-r--r--lib/ssl/src/ssl_record.erl4
-rw-r--r--lib/ssl/src/ssl_record.hrl2
-rw-r--r--lib/ssl/src/ssl_session.erl2
-rw-r--r--lib/ssl/src/ssl_session_cache.erl2
-rw-r--r--lib/ssl/src/ssl_session_cache_api.erl2
-rw-r--r--lib/ssl/src/ssl_socket.erl2
-rw-r--r--lib/ssl/src/ssl_srp.hrl2
-rw-r--r--lib/ssl/src/ssl_sup.erl2
-rw-r--r--lib/ssl/src/ssl_tls_dist_proxy.erl7
-rw-r--r--lib/ssl/src/ssl_v2.erl2
-rw-r--r--lib/ssl/src/ssl_v3.erl2
-rw-r--r--lib/ssl/src/tls.erl2
-rw-r--r--lib/ssl/src/tls_connection.erl625
-rw-r--r--lib/ssl/src/tls_connection.hrl2
-rw-r--r--lib/ssl/src/tls_connection_sup.erl2
-rw-r--r--lib/ssl/src/tls_handshake.erl49
-rw-r--r--lib/ssl/src/tls_handshake.hrl2
-rw-r--r--lib/ssl/src/tls_record.hrl2
-rw-r--r--lib/ssl/src/tls_v1.erl62
-rw-r--r--lib/ssl/test/Makefile2
-rw-r--r--lib/ssl/test/erl_make_certs.erl2
-rw-r--r--lib/ssl/test/ssl_ECC_SUITE.erl2
-rw-r--r--lib/ssl/test/ssl_basic_SUITE.erl274
-rw-r--r--lib/ssl/test/ssl_bench_SUITE.erl2
-rw-r--r--lib/ssl/test/ssl_certificate_verify_SUITE.erl135
-rw-r--r--lib/ssl/test/ssl_crl_SUITE.erl2
-rw-r--r--lib/ssl/test/ssl_dist_SUITE.erl4
-rw-r--r--lib/ssl/test/ssl_handshake_SUITE.erl6
-rw-r--r--lib/ssl/test/ssl_npn_handshake_SUITE.erl2
-rw-r--r--lib/ssl/test/ssl_npn_hello_SUITE.erl2
-rw-r--r--lib/ssl/test/ssl_packet_SUITE.erl2
-rw-r--r--lib/ssl/test/ssl_payload_SUITE.erl2
-rw-r--r--lib/ssl/test/ssl_sni_SUITE.erl2
-rw-r--r--lib/ssl/test/ssl_test_lib.erl29
-rw-r--r--lib/ssl/test/ssl_to_openssl_SUITE.erl2
-rw-r--r--lib/ssl/vsn.mk2
-rw-r--r--lib/stdlib/Makefile2
-rw-r--r--lib/stdlib/doc/src/Makefile3
-rw-r--r--lib/stdlib/doc/src/array.xml2
-rw-r--r--lib/stdlib/doc/src/base64.xml2
-rw-r--r--lib/stdlib/doc/src/binary.xml4
-rw-r--r--lib/stdlib/doc/src/book.xml2
-rw-r--r--lib/stdlib/doc/src/c.xml2
-rw-r--r--lib/stdlib/doc/src/calendar.xml2
-rw-r--r--lib/stdlib/doc/src/dets.xml2
-rw-r--r--lib/stdlib/doc/src/dict.xml2
-rw-r--r--lib/stdlib/doc/src/digraph.xml2
-rw-r--r--lib/stdlib/doc/src/digraph_utils.xml2
-rw-r--r--lib/stdlib/doc/src/epp.xml2
-rw-r--r--lib/stdlib/doc/src/erl_eval.xml2
-rw-r--r--lib/stdlib/doc/src/erl_expand_records.xml2
-rw-r--r--lib/stdlib/doc/src/erl_id_trans.xml2
-rw-r--r--lib/stdlib/doc/src/erl_internal.xml2
-rw-r--r--lib/stdlib/doc/src/erl_lint.xml2
-rw-r--r--lib/stdlib/doc/src/erl_pp.xml2
-rw-r--r--lib/stdlib/doc/src/erl_tar.xml2
-rw-r--r--lib/stdlib/doc/src/ets.xml4
-rw-r--r--lib/stdlib/doc/src/file_sorter.xml2
-rw-r--r--lib/stdlib/doc/src/filelib.xml2
-rw-r--r--lib/stdlib/doc/src/filename.xml2
-rw-r--r--lib/stdlib/doc/src/gen_event.xml2
-rw-r--r--lib/stdlib/doc/src/gen_fsm.xml16
-rw-r--r--lib/stdlib/doc/src/gen_server.xml3
-rw-r--r--lib/stdlib/doc/src/gen_statem.xml1671
-rw-r--r--lib/stdlib/doc/src/io.xml2
-rw-r--r--lib/stdlib/doc/src/io_lib.xml2
-rw-r--r--lib/stdlib/doc/src/io_protocol.xml2
-rw-r--r--lib/stdlib/doc/src/lib.xml2
-rw-r--r--lib/stdlib/doc/src/lists.xml17
-rw-r--r--lib/stdlib/doc/src/log_mf_h.xml2
-rw-r--r--lib/stdlib/doc/src/maps.xml62
-rw-r--r--lib/stdlib/doc/src/math.xml2
-rw-r--r--lib/stdlib/doc/src/ms_transform.xml2
-rw-r--r--lib/stdlib/doc/src/notes.xml2
-rw-r--r--lib/stdlib/doc/src/notes_history.xml2
-rw-r--r--lib/stdlib/doc/src/ordsets.xml2
-rw-r--r--lib/stdlib/doc/src/part.xml2
-rw-r--r--lib/stdlib/doc/src/part_notes.xml2
-rw-r--r--lib/stdlib/doc/src/part_notes_history.xml2
-rw-r--r--lib/stdlib/doc/src/pool.xml2
-rw-r--r--lib/stdlib/doc/src/proc_lib.xml8
-rw-r--r--lib/stdlib/doc/src/proplists.xml2
-rw-r--r--lib/stdlib/doc/src/qlc.xml2
-rw-r--r--lib/stdlib/doc/src/queue.xml2
-rw-r--r--lib/stdlib/doc/src/random.xml2
-rw-r--r--lib/stdlib/doc/src/re.xml2
-rw-r--r--lib/stdlib/doc/src/ref_man.xml3
-rw-r--r--lib/stdlib/doc/src/shell.xml2
-rw-r--r--lib/stdlib/doc/src/shell_default.xml2
-rw-r--r--lib/stdlib/doc/src/slave.xml2
-rw-r--r--lib/stdlib/doc/src/sofs.xml2
-rw-r--r--lib/stdlib/doc/src/specs.xml1
-rw-r--r--lib/stdlib/doc/src/stdlib_app.xml2
-rw-r--r--lib/stdlib/doc/src/string.xml2
-rw-r--r--lib/stdlib/doc/src/supervisor.xml10
-rw-r--r--lib/stdlib/doc/src/supervisor_bridge.xml2
-rw-r--r--lib/stdlib/doc/src/sys.xml31
-rw-r--r--lib/stdlib/doc/src/timer.xml2
-rw-r--r--lib/stdlib/doc/src/unicode.xml2
-rw-r--r--lib/stdlib/doc/src/unicode_usage.xml2
-rw-r--r--lib/stdlib/doc/src/win32reg.xml2
-rw-r--r--lib/stdlib/doc/src/zip.xml2
-rw-r--r--lib/stdlib/examples/erl_id_trans.erl4
-rw-r--r--lib/stdlib/include/assert.hrl31
-rw-r--r--lib/stdlib/include/erl_compile.hrl2
-rw-r--r--lib/stdlib/include/ms_transform.hrl2
-rw-r--r--lib/stdlib/include/qlc.hrl2
-rw-r--r--lib/stdlib/include/zip.hrl2
-rw-r--r--lib/stdlib/src/Makefile3
-rw-r--r--lib/stdlib/src/array.erl2
-rw-r--r--lib/stdlib/src/base64.erl2
-rw-r--r--lib/stdlib/src/binary.erl2
-rw-r--r--lib/stdlib/src/c.erl2
-rw-r--r--lib/stdlib/src/calendar.erl2
-rw-r--r--lib/stdlib/src/dets.hrl2
-rw-r--r--lib/stdlib/src/dets_server.erl2
-rw-r--r--lib/stdlib/src/dets_sup.erl2
-rw-r--r--lib/stdlib/src/digraph_utils.erl2
-rw-r--r--lib/stdlib/src/edlin.erl2
-rw-r--r--lib/stdlib/src/edlin_expand.erl2
-rw-r--r--lib/stdlib/src/epp.erl72
-rw-r--r--lib/stdlib/src/erl_bits.erl2
-rw-r--r--lib/stdlib/src/erl_compile.erl2
-rw-r--r--lib/stdlib/src/erl_internal.erl2
-rw-r--r--lib/stdlib/src/erl_lint.erl108
-rw-r--r--lib/stdlib/src/erl_parse.yrl12
-rw-r--r--lib/stdlib/src/erl_posix_msg.erl2
-rw-r--r--lib/stdlib/src/erl_pp.erl26
-rw-r--r--lib/stdlib/src/erl_tar.erl2
-rw-r--r--lib/stdlib/src/error_logger_file_h.erl2
-rw-r--r--lib/stdlib/src/error_logger_tty_h.erl2
-rw-r--r--lib/stdlib/src/ets.erl2
-rw-r--r--lib/stdlib/src/eval_bits.erl2
-rw-r--r--lib/stdlib/src/filelib.erl2
-rw-r--r--lib/stdlib/src/filename.erl41
-rw-r--r--lib/stdlib/src/gen.erl121
-rw-r--r--lib/stdlib/src/gen_event.erl11
-rw-r--r--lib/stdlib/src/gen_fsm.erl85
-rw-r--r--lib/stdlib/src/gen_server.erl112
-rw-r--r--lib/stdlib/src/gen_statem.erl1308
-rw-r--r--lib/stdlib/src/io_lib.erl18
-rw-r--r--lib/stdlib/src/io_lib_format.erl2
-rw-r--r--lib/stdlib/src/io_lib_fread.erl2
-rw-r--r--lib/stdlib/src/io_lib_pretty.erl2
-rw-r--r--lib/stdlib/src/lib.erl2
-rw-r--r--lib/stdlib/src/lists.erl15
-rw-r--r--lib/stdlib/src/log_mf_h.erl2
-rw-r--r--lib/stdlib/src/maps.erl61
-rw-r--r--lib/stdlib/src/math.erl2
-rw-r--r--lib/stdlib/src/ordsets.erl2
-rw-r--r--lib/stdlib/src/otp_internal.erl119
-rw-r--r--lib/stdlib/src/pool.erl2
-rw-r--r--lib/stdlib/src/proc_lib.erl20
-rw-r--r--lib/stdlib/src/proplists.erl2
-rw-r--r--lib/stdlib/src/queue.erl2
-rw-r--r--lib/stdlib/src/rand.erl10
-rw-r--r--lib/stdlib/src/random.erl2
-rw-r--r--lib/stdlib/src/re.erl2
-rw-r--r--lib/stdlib/src/sets.erl2
-rw-r--r--lib/stdlib/src/shell_default.erl2
-rw-r--r--lib/stdlib/src/slave.erl2
-rw-r--r--lib/stdlib/src/sofs.erl2
-rw-r--r--lib/stdlib/src/stdlib.app.src3
-rw-r--r--lib/stdlib/src/stdlib.appup.src2
-rw-r--r--lib/stdlib/src/string.erl2
-rw-r--r--lib/stdlib/src/supervisor.erl6
-rw-r--r--lib/stdlib/src/supervisor_bridge.erl2
-rw-r--r--lib/stdlib/src/sys.erl2
-rw-r--r--lib/stdlib/src/timer.erl2
-rw-r--r--lib/stdlib/src/win32reg.erl2
-rw-r--r--lib/stdlib/test/ExpandTestCaps.erl2
-rw-r--r--lib/stdlib/test/ExpandTestCaps1.erl2
-rw-r--r--lib/stdlib/test/Makefile1
-rw-r--r--lib/stdlib/test/array_SUITE.erl2
-rw-r--r--lib/stdlib/test/base64_SUITE.erl2
-rw-r--r--lib/stdlib/test/beam_lib_SUITE.erl2
-rw-r--r--lib/stdlib/test/binary_module_SUITE.erl2
-rw-r--r--lib/stdlib/test/c_SUITE.erl2
-rw-r--r--lib/stdlib/test/c_SUITE_data/m.erl2
-rw-r--r--lib/stdlib/test/calendar_SUITE.erl2
-rw-r--r--lib/stdlib/test/dict_SUITE.erl2
-rw-r--r--lib/stdlib/test/digraph_SUITE.erl2
-rw-r--r--lib/stdlib/test/digraph_utils_SUITE.erl2
-rw-r--r--lib/stdlib/test/dummy1_h.erl2
-rw-r--r--lib/stdlib/test/dummy_h.erl2
-rw-r--r--lib/stdlib/test/edlin_expand_SUITE.erl2
-rw-r--r--lib/stdlib/test/epp_SUITE.erl65
-rw-r--r--lib/stdlib/test/epp_SUITE_data/mac.erl2
-rw-r--r--lib/stdlib/test/epp_SUITE_data/mac2.erl2
-rw-r--r--lib/stdlib/test/epp_SUITE_data/mac3.erl2
-rw-r--r--lib/stdlib/test/epp_SUITE_data/pmod.erl2
-rw-r--r--lib/stdlib/test/epp_SUITE_data/variable_1.erl2
-rw-r--r--lib/stdlib/test/epp_SUITE_data/variable_1_include.hrl2
-rw-r--r--lib/stdlib/test/epp_SUITE_data/variable_1_include_dir.hrl2
-rw-r--r--lib/stdlib/test/erl_anno_SUITE.erl2
-rw-r--r--lib/stdlib/test/erl_expand_records_SUITE.erl2
-rw-r--r--lib/stdlib/test/erl_internal_SUITE.erl2
-rw-r--r--lib/stdlib/test/erl_lint_SUITE.erl163
-rw-r--r--lib/stdlib/test/erl_lint_SUITE_data/format.erl2
-rw-r--r--lib/stdlib/test/erl_pp_SUITE.erl25
-rw-r--r--lib/stdlib/test/erl_scan_SUITE.erl2
-rw-r--r--lib/stdlib/test/error_logger_forwarder.erl8
-rw-r--r--lib/stdlib/test/error_logger_h_SUITE.erl21
-rw-r--r--lib/stdlib/test/escript_SUITE.erl2
-rw-r--r--lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dict/src/archive_script_dict.erl2
-rw-r--r--lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dict/src/archive_script_dict_app.erl2
-rw-r--r--lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dict/src/archive_script_dict_sup.erl2
-rw-r--r--lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dummy/src/archive_script_dummy.erl2
-rw-r--r--lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dummy/src/archive_script_dummy_app.erl2
-rw-r--r--lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dummy/src/archive_script_dummy_sup.erl2
-rw-r--r--lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_main.erl2
-rw-r--r--lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_main2.erl2
-rw-r--r--lib/stdlib/test/escript_SUITE_data/archive_script_file_access/archive_script_file_access.erl2
-rw-r--r--lib/stdlib/test/ets_SUITE.erl15
-rw-r--r--lib/stdlib/test/ets_tough_SUITE.erl2
-rw-r--r--lib/stdlib/test/expand_test.erl2
-rw-r--r--lib/stdlib/test/expand_test1.erl2
-rw-r--r--lib/stdlib/test/file_sorter_SUITE.erl2
-rw-r--r--lib/stdlib/test/filelib_SUITE.erl2
-rw-r--r--lib/stdlib/test/filename_SUITE.erl2
-rw-r--r--lib/stdlib/test/fixtable_SUITE.erl2
-rw-r--r--lib/stdlib/test/format_SUITE.erl2
-rw-r--r--lib/stdlib/test/gen_event_SUITE.erl2
-rw-r--r--lib/stdlib/test/gen_fsm_SUITE.erl12
-rw-r--r--lib/stdlib/test/gen_server_SUITE.erl2
-rw-r--r--lib/stdlib/test/gen_statem_SUITE.erl1584
-rw-r--r--lib/stdlib/test/id_transform_SUITE.erl2
-rw-r--r--lib/stdlib/test/id_transform_SUITE_data/External.hrl2
-rw-r--r--lib/stdlib/test/id_transform_SUITE_data/m.hrl2
-rw-r--r--lib/stdlib/test/id_transform_SUITE_data/m_i.hrl2
-rw-r--r--lib/stdlib/test/id_transform_SUITE_data/oe_ex.hrl2
-rw-r--r--lib/stdlib/test/io_SUITE.erl2
-rw-r--r--lib/stdlib/test/io_proto_SUITE.erl2
-rw-r--r--lib/stdlib/test/lists_SUITE.erl18
-rw-r--r--lib/stdlib/test/log_mf_h_SUITE.erl2
-rw-r--r--lib/stdlib/test/maps_SUITE.erl56
-rw-r--r--lib/stdlib/test/ms_transform_SUITE.erl2
-rw-r--r--lib/stdlib/test/naughty_child.erl2
-rw-r--r--lib/stdlib/test/proc_lib_SUITE.erl2
-rw-r--r--lib/stdlib/test/qlc_SUITE.erl2
-rw-r--r--lib/stdlib/test/qlc_SUITE_data/join_info_compat.erl2
-rw-r--r--lib/stdlib/test/queue_SUITE.erl2
-rw-r--r--lib/stdlib/test/rand_SUITE.erl4
-rw-r--r--lib/stdlib/test/random_SUITE.erl2
-rw-r--r--lib/stdlib/test/random_iolist.erl2
-rw-r--r--lib/stdlib/test/random_unicode_list.erl2
-rw-r--r--lib/stdlib/test/re_SUITE.erl2
-rw-r--r--lib/stdlib/test/re_testoutput1_replacement_test.erl2
-rw-r--r--lib/stdlib/test/re_testoutput1_split_test.erl2
-rw-r--r--lib/stdlib/test/run_pcre_tests.erl2
-rw-r--r--lib/stdlib/test/select_SUITE.erl2
-rw-r--r--lib/stdlib/test/sets_SUITE.erl2
-rw-r--r--lib/stdlib/test/shell_SUITE.erl2
-rw-r--r--lib/stdlib/test/slave_SUITE.erl2
-rw-r--r--lib/stdlib/test/sofs_SUITE.erl2
-rw-r--r--lib/stdlib/test/stdlib_SUITE.erl2
-rw-r--r--lib/stdlib/test/string_SUITE.erl2
-rw-r--r--lib/stdlib/test/supervisor_1.erl2
-rw-r--r--lib/stdlib/test/supervisor_2.erl2
-rw-r--r--lib/stdlib/test/supervisor_3.erl2
-rw-r--r--lib/stdlib/test/supervisor_SUITE.erl2
-rw-r--r--lib/stdlib/test/supervisor_bridge_SUITE.erl2
-rw-r--r--lib/stdlib/test/sys_SUITE.erl2
-rw-r--r--lib/stdlib/test/sys_sp1.erl2
-rw-r--r--lib/stdlib/test/sys_sp2.erl2
-rw-r--r--lib/stdlib/test/tar_SUITE.erl2
-rw-r--r--lib/stdlib/test/timer_SUITE.erl2
-rw-r--r--lib/stdlib/test/timer_simple_SUITE.erl2
-rw-r--r--lib/stdlib/test/unicode_SUITE.erl2
-rw-r--r--lib/stdlib/test/win32reg_SUITE.erl2
-rw-r--r--lib/stdlib/test/y2k_SUITE.erl2
-rw-r--r--lib/stdlib/test/zip_SUITE.erl2
-rw-r--r--lib/stdlib/vsn.mk2
-rw-r--r--lib/syntax_tools/doc/src/Makefile2
-rw-r--r--lib/syntax_tools/doc/src/book.xml2
-rw-r--r--lib/syntax_tools/doc/src/notes.xml2
-rw-r--r--lib/syntax_tools/doc/src/part.xml2
-rw-r--r--lib/syntax_tools/doc/src/part_notes.xml2
-rw-r--r--lib/syntax_tools/doc/src/ref_man.xml2
-rw-r--r--lib/syntax_tools/src/erl_prettypr.erl374
-rw-r--r--lib/syntax_tools/src/erl_syntax.erl1410
-rw-r--r--lib/syntax_tools/src/erl_syntax_lib.erl181
-rw-r--r--lib/syntax_tools/src/igor.erl13
-rw-r--r--lib/syntax_tools/src/syntax_tools.app.src2
-rw-r--r--lib/syntax_tools/src/syntax_tools.appup.src2
-rw-r--r--lib/syntax_tools/test/syntax_tools_SUITE.erl25
-rw-r--r--lib/syntax_tools/test/syntax_tools_SUITE_data/empty.erl1
-rw-r--r--lib/syntax_tools/test/syntax_tools_SUITE_data/igor_type_specs.erl80
-rw-r--r--lib/syntax_tools/test/syntax_tools_SUITE_data/type_specs.erl84
-rw-r--r--lib/tools/Makefile2
-rw-r--r--lib/tools/c_src/Makefile.in2
-rw-r--r--lib/tools/c_src/erl_memory.c2
-rw-r--r--lib/tools/doc/src/Makefile2
-rw-r--r--lib/tools/doc/src/book.xml2
-rw-r--r--lib/tools/doc/src/cover_chapter.xml2
-rw-r--r--lib/tools/doc/src/cprof.xml2
-rw-r--r--lib/tools/doc/src/cprof_chapter.xml2
-rw-r--r--lib/tools/doc/src/eprof.xml2
-rw-r--r--lib/tools/doc/src/erlang_mode.xml3
-rw-r--r--lib/tools/doc/src/erlang_mode_chapter.xml2
-rw-r--r--lib/tools/doc/src/fprof.xml2
-rw-r--r--lib/tools/doc/src/fprof_chapter.xml2
-rw-r--r--lib/tools/doc/src/instrument.xml2
-rw-r--r--lib/tools/doc/src/lcnt.xml2
-rw-r--r--lib/tools/doc/src/lcnt_chapter.xml2
-rw-r--r--lib/tools/doc/src/make.xml2
-rw-r--r--lib/tools/doc/src/notes.xml2
-rw-r--r--lib/tools/doc/src/notes_history.xml2
-rw-r--r--lib/tools/doc/src/part.xml2
-rw-r--r--lib/tools/doc/src/part_notes.xml2
-rw-r--r--lib/tools/doc/src/part_notes_history.xml2
-rw-r--r--lib/tools/doc/src/ref_man.xml2
-rw-r--r--lib/tools/doc/src/tags.xml2
-rw-r--r--lib/tools/doc/src/xref.xml2
-rw-r--r--lib/tools/doc/src/xref_chapter.xml2
-rw-r--r--lib/tools/emacs/erlang-eunit.el2
-rw-r--r--lib/tools/emacs/erlang-skels-old.el2
-rw-r--r--lib/tools/emacs/erlang-skels.el120
-rw-r--r--lib/tools/emacs/erlang.el17
-rw-r--r--lib/tools/emacs/test.erl.indented2
-rw-r--r--lib/tools/emacs/test.erl.orig2
-rw-r--r--lib/tools/src/Makefile2
-rw-r--r--lib/tools/src/cover.erl2
-rw-r--r--lib/tools/src/eprof.erl2
-rw-r--r--lib/tools/src/fprof.erl32
-rw-r--r--lib/tools/src/instrument.erl2
-rw-r--r--lib/tools/src/lcnt.erl2
-rw-r--r--lib/tools/src/tools.appup.src2
-rw-r--r--lib/tools/src/xref.erl2
-rw-r--r--lib/tools/src/xref_base.erl2
-rw-r--r--lib/tools/src/xref_parser.yrl2
-rw-r--r--lib/tools/test/Makefile2
-rw-r--r--lib/tools/test/cover_SUITE.erl1648
-rw-r--r--lib/tools/test/cprof_SUITE.erl313
-rw-r--r--lib/tools/test/emacs_SUITE.erl2
-rw-r--r--lib/tools/test/emem_SUITE.erl842
-rw-r--r--lib/tools/test/eprof_SUITE.erl53
-rw-r--r--lib/tools/test/fprof_SUITE.erl1491
-rw-r--r--lib/tools/test/ignore_cores.erl14
-rw-r--r--lib/tools/test/instrument_SUITE.erl192
-rw-r--r--lib/tools/test/lcnt_SUITE.erl74
-rw-r--r--lib/tools/test/make_SUITE.erl218
-rw-r--r--lib/tools/test/tools_SUITE.erl45
-rw-r--r--lib/tools/test/xref_SUITE.erl2988
-rw-r--r--lib/typer/Makefile2
-rw-r--r--lib/typer/doc/Makefile2
-rw-r--r--lib/typer/doc/src/Makefile2
-rw-r--r--lib/typer/doc/src/book.xml2
-rw-r--r--lib/typer/doc/src/notes.xml2
-rw-r--r--lib/typer/doc/src/part_notes.xml2
-rw-r--r--lib/typer/doc/src/ref_man.xml2
-rw-r--r--lib/typer/doc/src/typer_app.xml2
-rw-r--r--lib/typer/src/Makefile2
-rw-r--r--lib/typer/src/typer.appup.src2
-rw-r--r--lib/wx/Makefile2
-rw-r--r--lib/wx/api_gen/Makefile2
-rw-r--r--lib/wx/api_gen/gen_util.erl2
-rw-r--r--lib/wx/api_gen/gl_gen.erl2
-rw-r--r--lib/wx/api_gen/gl_gen_c.erl2
-rw-r--r--lib/wx/api_gen/gl_gen_erl.erl2
-rw-r--r--lib/wx/api_gen/gl_scan_doc.erl2
-rw-r--r--lib/wx/api_gen/wx_extra/wxEvtHandler.c_src2
-rw-r--r--lib/wx/api_gen/wx_extra/wxListCtrl.c_src2
-rw-r--r--lib/wx/api_gen/wx_extra/wxListCtrl.erl2
-rw-r--r--lib/wx/api_gen/wx_extra/wxPrintout.erl2
-rw-r--r--lib/wx/api_gen/wx_extra/wxTreeCtrl.c_src2
-rw-r--r--lib/wx/api_gen/wx_extra/wxXmlResource.erl2
-rw-r--r--lib/wx/api_gen/wx_gen.erl2
-rw-r--r--lib/wx/api_gen/wx_gen.hrl2
-rw-r--r--lib/wx/api_gen/wx_gen_cpp.erl14
-rw-r--r--lib/wx/api_gen/wx_gen_erl.erl4
-rw-r--r--lib/wx/api_gen/wxapi.conf10
-rw-r--r--lib/wx/c_src/Makefile.in2
-rw-r--r--lib/wx/c_src/egl_impl.cpp2
-rw-r--r--lib/wx/c_src/egl_impl.h2
-rw-r--r--lib/wx/c_src/gen/gl_fdefs.h2
-rw-r--r--lib/wx/c_src/gen/gl_finit.h2
-rw-r--r--lib/wx/c_src/gen/gl_funcs.cpp2
-rw-r--r--lib/wx/c_src/gen/glu_finit.h2
-rw-r--r--lib/wx/c_src/gen/wxe_funcs.cpp50
-rw-r--r--lib/wx/c_src/gen/wxe_macros.h3834
-rw-r--r--lib/wx/c_src/wxe_callback_impl.cpp2
-rw-r--r--lib/wx/c_src/wxe_callback_impl.h2
-rw-r--r--lib/wx/c_src/wxe_driver.c2
-rw-r--r--lib/wx/c_src/wxe_driver.h2
-rw-r--r--lib/wx/c_src/wxe_events.h2
-rw-r--r--lib/wx/c_src/wxe_gl.cpp2
-rw-r--r--lib/wx/c_src/wxe_gl.h2
-rw-r--r--lib/wx/c_src/wxe_helpers.cpp6
-rw-r--r--lib/wx/c_src/wxe_helpers.h4
-rw-r--r--lib/wx/c_src/wxe_impl.cpp7
-rw-r--r--lib/wx/c_src/wxe_impl.h2
-rw-r--r--lib/wx/c_src/wxe_main.cpp6
-rw-r--r--lib/wx/c_src/wxe_memory.h2
-rw-r--r--lib/wx/c_src/wxe_ps_init.c2
-rw-r--r--lib/wx/c_src/wxe_return.cpp2
-rw-r--r--lib/wx/c_src/wxe_return.h2
-rw-r--r--lib/wx/config.mk.in2
-rw-r--r--lib/wx/configure.in2
-rw-r--r--lib/wx/doc/src/Makefile2
-rw-r--r--lib/wx/doc/src/book.xml2
-rw-r--r--lib/wx/doc/src/notes.xml2
-rw-r--r--lib/wx/doc/src/part.xml2
-rw-r--r--lib/wx/doc/src/part_notes.xml2
-rw-r--r--lib/wx/doc/src/ref_man.xml.src2
-rw-r--r--lib/wx/examples/Makefile2
-rw-r--r--lib/wx/examples/demo/Makefile2
-rw-r--r--lib/wx/examples/demo/demo.erl2
-rw-r--r--lib/wx/examples/demo/ex_aui.erl2
-rw-r--r--lib/wx/examples/demo/ex_button.erl2
-rw-r--r--lib/wx/examples/demo/ex_canvas.erl15
-rw-r--r--lib/wx/examples/demo/ex_canvas_paint.erl18
-rw-r--r--lib/wx/examples/demo/ex_choices.erl2
-rw-r--r--lib/wx/examples/demo/ex_cursor.erl2
-rw-r--r--lib/wx/examples/demo/ex_dialogs.erl2
-rw-r--r--lib/wx/examples/demo/ex_frame_utils.erl2
-rw-r--r--lib/wx/examples/demo/ex_gauge.erl2
-rw-r--r--lib/wx/examples/demo/ex_gl.erl2
-rw-r--r--lib/wx/examples/demo/ex_graphicsContext.erl2
-rw-r--r--lib/wx/examples/demo/ex_grid.erl2
-rw-r--r--lib/wx/examples/demo/ex_htmlWindow.erl2
-rw-r--r--lib/wx/examples/demo/ex_listCtrl.erl2
-rw-r--r--lib/wx/examples/demo/ex_notebook.erl2
-rw-r--r--lib/wx/examples/demo/ex_pickers.erl2
-rw-r--r--lib/wx/examples/demo/ex_popupMenu.erl2
-rw-r--r--lib/wx/examples/demo/ex_radioBox.erl2
-rw-r--r--lib/wx/examples/demo/ex_sashWindow.erl2
-rw-r--r--lib/wx/examples/demo/ex_sizers.erl2
-rw-r--r--lib/wx/examples/demo/ex_slider.erl2
-rw-r--r--lib/wx/examples/demo/ex_splitterWindow.erl2
-rw-r--r--lib/wx/examples/demo/ex_static.erl2
-rw-r--r--lib/wx/examples/demo/ex_textCtrl.erl2
-rw-r--r--lib/wx/examples/demo/ex_treeCtrl.erl2
-rw-r--r--lib/wx/examples/simple/Makefile2
-rw-r--r--lib/wx/examples/simple/hello.erl2
-rw-r--r--lib/wx/examples/simple/hello2.erl2
-rw-r--r--lib/wx/examples/simple/menu.erl2
-rw-r--r--lib/wx/examples/simple/minimal.erl2
-rw-r--r--lib/wx/examples/sudoku/Makefile2
-rw-r--r--lib/wx/examples/sudoku/sudoku.erl2
-rw-r--r--lib/wx/examples/sudoku/sudoku.hrl2
-rw-r--r--lib/wx/examples/sudoku/sudoku_board.erl2
-rw-r--r--lib/wx/examples/sudoku/sudoku_game.erl2
-rw-r--r--lib/wx/examples/sudoku/sudoku_gui.erl2
-rw-r--r--lib/wx/examples/xrc/Makefile2
-rw-r--r--lib/wx/examples/xrc/xrc.erl2
-rw-r--r--lib/wx/include/gl.hrl2
-rw-r--r--lib/wx/include/glu.hrl2
-rw-r--r--lib/wx/include/wx.hrl2
-rw-r--r--lib/wx/src/Makefile2
-rw-r--r--lib/wx/src/gen/wxAcceleratorEntry.erl2
-rw-r--r--lib/wx/src/gen/wxAcceleratorTable.erl2
-rw-r--r--lib/wx/src/gen/wxActivateEvent.erl2
-rw-r--r--lib/wx/src/gen/wxArtProvider.erl2
-rw-r--r--lib/wx/src/gen/wxAuiNotebookEvent.erl2
-rw-r--r--lib/wx/src/gen/wxBitmap.erl2
-rw-r--r--lib/wx/src/gen/wxBitmapDataObject.erl2
-rw-r--r--lib/wx/src/gen/wxBoxSizer.erl2
-rw-r--r--lib/wx/src/gen/wxBrush.erl2
-rw-r--r--lib/wx/src/gen/wxBufferedDC.erl2
-rw-r--r--lib/wx/src/gen/wxBufferedPaintDC.erl2
-rw-r--r--lib/wx/src/gen/wxCalendarDateAttr.erl2
-rw-r--r--lib/wx/src/gen/wxCalendarEvent.erl2
-rw-r--r--lib/wx/src/gen/wxCaret.erl2
-rw-r--r--lib/wx/src/gen/wxChildFocusEvent.erl2
-rw-r--r--lib/wx/src/gen/wxClientDC.erl2
-rw-r--r--lib/wx/src/gen/wxClipboard.erl2
-rw-r--r--lib/wx/src/gen/wxClipboardTextEvent.erl2
-rw-r--r--lib/wx/src/gen/wxCloseEvent.erl2
-rw-r--r--lib/wx/src/gen/wxColourData.erl2
-rw-r--r--lib/wx/src/gen/wxColourPickerEvent.erl2
-rw-r--r--lib/wx/src/gen/wxCommandEvent.erl2
-rw-r--r--lib/wx/src/gen/wxContextMenuEvent.erl2
-rw-r--r--lib/wx/src/gen/wxCursor.erl2
-rw-r--r--lib/wx/src/gen/wxDC.erl2
-rw-r--r--lib/wx/src/gen/wxDataObject.erl2
-rw-r--r--lib/wx/src/gen/wxDateEvent.erl2
-rw-r--r--lib/wx/src/gen/wxDisplayChangedEvent.erl2
-rw-r--r--lib/wx/src/gen/wxEraseEvent.erl2
-rw-r--r--lib/wx/src/gen/wxEvent.erl2
-rw-r--r--lib/wx/src/gen/wxEvtHandler.erl2
-rw-r--r--lib/wx/src/gen/wxFileDataObject.erl2
-rw-r--r--lib/wx/src/gen/wxFileDirPickerEvent.erl2
-rw-r--r--lib/wx/src/gen/wxFindReplaceData.erl2
-rw-r--r--lib/wx/src/gen/wxFlexGridSizer.erl2
-rw-r--r--lib/wx/src/gen/wxFocusEvent.erl2
-rw-r--r--lib/wx/src/gen/wxFont.erl2
-rw-r--r--lib/wx/src/gen/wxFontData.erl2
-rw-r--r--lib/wx/src/gen/wxFontPickerEvent.erl2
-rw-r--r--lib/wx/src/gen/wxGBSizerItem.erl2
-rw-r--r--lib/wx/src/gen/wxGauge.erl39
-rw-r--r--lib/wx/src/gen/wxGraphicsBrush.erl2
-rw-r--r--lib/wx/src/gen/wxGraphicsContext.erl2
-rw-r--r--lib/wx/src/gen/wxGraphicsFont.erl2
-rw-r--r--lib/wx/src/gen/wxGraphicsMatrix.erl2
-rw-r--r--lib/wx/src/gen/wxGraphicsObject.erl2
-rw-r--r--lib/wx/src/gen/wxGraphicsPath.erl2
-rw-r--r--lib/wx/src/gen/wxGraphicsPen.erl2
-rw-r--r--lib/wx/src/gen/wxGraphicsRenderer.erl2
-rw-r--r--lib/wx/src/gen/wxGridBagSizer.erl2
-rw-r--r--lib/wx/src/gen/wxGridCellAttr.erl2
-rw-r--r--lib/wx/src/gen/wxGridCellBoolEditor.erl2
-rw-r--r--lib/wx/src/gen/wxGridCellBoolRenderer.erl2
-rw-r--r--lib/wx/src/gen/wxGridCellChoiceEditor.erl2
-rw-r--r--lib/wx/src/gen/wxGridCellEditor.erl2
-rw-r--r--lib/wx/src/gen/wxGridCellFloatEditor.erl2
-rw-r--r--lib/wx/src/gen/wxGridCellFloatRenderer.erl2
-rw-r--r--lib/wx/src/gen/wxGridCellNumberEditor.erl2
-rw-r--r--lib/wx/src/gen/wxGridCellNumberRenderer.erl2
-rw-r--r--lib/wx/src/gen/wxGridCellRenderer.erl2
-rw-r--r--lib/wx/src/gen/wxGridCellStringRenderer.erl2
-rw-r--r--lib/wx/src/gen/wxGridCellTextEditor.erl2
-rw-r--r--lib/wx/src/gen/wxGridEvent.erl2
-rw-r--r--lib/wx/src/gen/wxGridSizer.erl2
-rw-r--r--lib/wx/src/gen/wxHelpEvent.erl2
-rw-r--r--lib/wx/src/gen/wxHtmlEasyPrinting.erl2
-rw-r--r--lib/wx/src/gen/wxHtmlLinkEvent.erl2
-rw-r--r--lib/wx/src/gen/wxIcon.erl2
-rw-r--r--lib/wx/src/gen/wxIconBundle.erl2
-rw-r--r--lib/wx/src/gen/wxIconizeEvent.erl2
-rw-r--r--lib/wx/src/gen/wxIdleEvent.erl2
-rw-r--r--lib/wx/src/gen/wxImage.erl2
-rw-r--r--lib/wx/src/gen/wxImageList.erl2
-rw-r--r--lib/wx/src/gen/wxInitDialogEvent.erl2
-rw-r--r--lib/wx/src/gen/wxJoystickEvent.erl2
-rw-r--r--lib/wx/src/gen/wxKeyEvent.erl2
-rw-r--r--lib/wx/src/gen/wxLayoutAlgorithm.erl2
-rw-r--r--lib/wx/src/gen/wxListCtrl.erl13
-rw-r--r--lib/wx/src/gen/wxListEvent.erl2
-rw-r--r--lib/wx/src/gen/wxListItem.erl2
-rw-r--r--lib/wx/src/gen/wxListItemAttr.erl2
-rw-r--r--lib/wx/src/gen/wxLocale.erl2
-rw-r--r--lib/wx/src/gen/wxLogNull.erl2
-rw-r--r--lib/wx/src/gen/wxMask.erl2
-rw-r--r--lib/wx/src/gen/wxMaximizeEvent.erl2
-rw-r--r--lib/wx/src/gen/wxMemoryDC.erl2
-rw-r--r--lib/wx/src/gen/wxMenu.erl2
-rw-r--r--lib/wx/src/gen/wxMenuEvent.erl2
-rw-r--r--lib/wx/src/gen/wxMenuItem.erl2
-rw-r--r--lib/wx/src/gen/wxMirrorDC.erl2
-rw-r--r--lib/wx/src/gen/wxMouseCaptureChangedEvent.erl2
-rw-r--r--lib/wx/src/gen/wxMouseEvent.erl2
-rw-r--r--lib/wx/src/gen/wxMoveEvent.erl2
-rw-r--r--lib/wx/src/gen/wxNavigationKeyEvent.erl2
-rw-r--r--lib/wx/src/gen/wxNotebookEvent.erl2
-rw-r--r--lib/wx/src/gen/wxNotifyEvent.erl2
-rw-r--r--lib/wx/src/gen/wxPageSetupDialog.erl2
-rw-r--r--lib/wx/src/gen/wxPageSetupDialogData.erl2
-rw-r--r--lib/wx/src/gen/wxPaintDC.erl2
-rw-r--r--lib/wx/src/gen/wxPaintEvent.erl2
-rw-r--r--lib/wx/src/gen/wxPalette.erl2
-rw-r--r--lib/wx/src/gen/wxPaletteChangedEvent.erl2
-rw-r--r--lib/wx/src/gen/wxPen.erl2
-rw-r--r--lib/wx/src/gen/wxPostScriptDC.erl2
-rw-r--r--lib/wx/src/gen/wxPrintData.erl2
-rw-r--r--lib/wx/src/gen/wxPrintDialogData.erl2
-rw-r--r--lib/wx/src/gen/wxPrintPreview.erl2
-rw-r--r--lib/wx/src/gen/wxPrinter.erl2
-rw-r--r--lib/wx/src/gen/wxPrintout.erl2
-rw-r--r--lib/wx/src/gen/wxQueryNewPaletteEvent.erl2
-rw-r--r--lib/wx/src/gen/wxRegion.erl2
-rw-r--r--lib/wx/src/gen/wxSashEvent.erl2
-rw-r--r--lib/wx/src/gen/wxScreenDC.erl2
-rw-r--r--lib/wx/src/gen/wxScrollEvent.erl2
-rw-r--r--lib/wx/src/gen/wxScrollWinEvent.erl2
-rw-r--r--lib/wx/src/gen/wxSetCursorEvent.erl2
-rw-r--r--lib/wx/src/gen/wxShowEvent.erl2
-rw-r--r--lib/wx/src/gen/wxSizeEvent.erl2
-rw-r--r--lib/wx/src/gen/wxSizer.erl2
-rw-r--r--lib/wx/src/gen/wxSizerFlags.erl2
-rw-r--r--lib/wx/src/gen/wxSizerItem.erl2
-rw-r--r--lib/wx/src/gen/wxSpinEvent.erl2
-rw-r--r--lib/wx/src/gen/wxSplitterEvent.erl2
-rw-r--r--lib/wx/src/gen/wxStaticBoxSizer.erl2
-rw-r--r--lib/wx/src/gen/wxStdDialogButtonSizer.erl2
-rw-r--r--lib/wx/src/gen/wxStyledTextEvent.erl2
-rw-r--r--lib/wx/src/gen/wxSysColourChangedEvent.erl2
-rw-r--r--lib/wx/src/gen/wxSystemOptions.erl2
-rw-r--r--lib/wx/src/gen/wxSystemSettings.erl2
-rw-r--r--lib/wx/src/gen/wxTaskBarIcon.erl2
-rw-r--r--lib/wx/src/gen/wxTaskBarIconEvent.erl2
-rw-r--r--lib/wx/src/gen/wxTextAttr.erl2
-rw-r--r--lib/wx/src/gen/wxTextDataObject.erl2
-rw-r--r--lib/wx/src/gen/wxToolTip.erl2
-rw-r--r--lib/wx/src/gen/wxTreeEvent.erl2
-rw-r--r--lib/wx/src/gen/wxUpdateUIEvent.erl2
-rw-r--r--lib/wx/src/gen/wxWindowCreateEvent.erl2
-rw-r--r--lib/wx/src/gen/wxWindowDC.erl2
-rw-r--r--lib/wx/src/gen/wxWindowDestroyEvent.erl2
-rw-r--r--lib/wx/src/gen/wxXmlResource.erl2
-rw-r--r--lib/wx/src/gen/wx_misc.erl2
-rw-r--r--lib/wx/src/gen/wxe_debug.hrl3834
-rw-r--r--lib/wx/src/gen/wxe_funcs.hrl3834
-rw-r--r--lib/wx/src/wx.app.src2
-rw-r--r--lib/wx/src/wx.appup.src2
-rw-r--r--lib/wx/src/wx.erl8
-rw-r--r--lib/wx/src/wx_object.erl10
-rw-r--r--lib/wx/src/wxe.hrl2
-rw-r--r--lib/wx/src/wxe_master.erl2
-rw-r--r--lib/wx/src/wxe_server.erl2
-rw-r--r--lib/wx/src/wxe_util.erl2
-rw-r--r--lib/wx/test/Makefile2
-rw-r--r--lib/wx/test/wx_app_SUITE.erl12
-rw-r--r--lib/wx/test/wx_basic_SUITE.erl19
-rw-r--r--lib/wx/test/wx_class_SUITE.erl73
-rw-r--r--lib/wx/test/wx_event_SUITE.erl4
-rw-r--r--lib/wx/test/wx_obj_test.erl13
-rw-r--r--lib/wx/test/wx_opengl_SUITE.erl4
-rw-r--r--lib/wx/test/wx_test_lib.erl2
-rw-r--r--lib/wx/test/wx_test_lib.hrl2
-rw-r--r--lib/wx/test/wx_xtra_SUITE.erl4
-rwxr-xr-xlib/wx/test/wxt2
-rw-r--r--lib/wx/test/wxt.erl14
-rw-r--r--lib/xmerl/doc/src/Makefile2
-rw-r--r--lib/xmerl/doc/src/book.xml2
-rw-r--r--lib/xmerl/doc/src/notes.xml2
-rw-r--r--lib/xmerl/doc/src/notes_history.xml2
-rw-r--r--lib/xmerl/doc/src/part.xml2
-rw-r--r--lib/xmerl/doc/src/part_notes.xml2
-rw-r--r--lib/xmerl/doc/src/ref_man.xml2
-rw-r--r--lib/xmerl/doc/src/xmerl_sax_parser.xml2
-rw-r--r--lib/xmerl/doc/src/xmerl_ug.xmlsrc2
-rw-r--r--lib/xmerl/include/xmerl.hrl2
-rw-r--r--lib/xmerl/src/Makefile2
-rw-r--r--lib/xmerl/src/xmerl.appup.src2
-rw-r--r--lib/xmerl/src/xmerl.erl2
-rw-r--r--lib/xmerl/src/xmerl_b64Bin.yrl2
-rw-r--r--lib/xmerl/src/xmerl_b64Bin_scan.erl2
-rw-r--r--lib/xmerl/src/xmerl_eventp.erl2
-rw-r--r--lib/xmerl/src/xmerl_html.erl2
-rw-r--r--lib/xmerl/src/xmerl_internal.hrl2
-rw-r--r--lib/xmerl/src/xmerl_lib.erl2
-rw-r--r--lib/xmerl/src/xmerl_otpsgml.erl2
-rw-r--r--lib/xmerl/src/xmerl_regexp.erl2
-rw-r--r--lib/xmerl/src/xmerl_sax_old_dom.erl2
-rw-r--r--lib/xmerl/src/xmerl_sax_old_dom.hrl2
-rw-r--r--lib/xmerl/src/xmerl_sax_parser.erl2
-rw-r--r--lib/xmerl/src/xmerl_sax_parser.hrl2
-rw-r--r--lib/xmerl/src/xmerl_sax_parser_base.erlsrc2
-rw-r--r--lib/xmerl/src/xmerl_sax_parser_latin1.erlsrc2
-rw-r--r--lib/xmerl/src/xmerl_sax_parser_list.erlsrc2
-rw-r--r--lib/xmerl/src/xmerl_sax_parser_utf16be.erlsrc2
-rw-r--r--lib/xmerl/src/xmerl_sax_parser_utf16le.erlsrc2
-rw-r--r--lib/xmerl/src/xmerl_sax_parser_utf8.erlsrc2
-rw-r--r--lib/xmerl/src/xmerl_sax_simple_dom.erl2
-rw-r--r--lib/xmerl/src/xmerl_scan.erl2
-rw-r--r--lib/xmerl/src/xmerl_sgml.erl2
-rw-r--r--lib/xmerl/src/xmerl_simple.erl2
-rw-r--r--lib/xmerl/src/xmerl_text.erl2
-rw-r--r--lib/xmerl/src/xmerl_ucs.erl2
-rw-r--r--lib/xmerl/src/xmerl_uri.erl2
-rw-r--r--lib/xmerl/src/xmerl_validate.erl2
-rw-r--r--lib/xmerl/src/xmerl_xlate.erl2
-rw-r--r--lib/xmerl/src/xmerl_xml.erl2
-rw-r--r--lib/xmerl/src/xmerl_xpath.erl2
-rw-r--r--lib/xmerl/src/xmerl_xpath_lib.erl2
-rw-r--r--lib/xmerl/src/xmerl_xpath_parse.yrl2
-rw-r--r--lib/xmerl/src/xmerl_xpath_pred.erl2
-rw-r--r--lib/xmerl/src/xmerl_xpath_scan.erl2
-rw-r--r--lib/xmerl/src/xmerl_xs.erl2
-rw-r--r--lib/xmerl/src/xmerl_xsd.erl2
-rw-r--r--lib/xmerl/src/xmerl_xsd_type.erl2
-rw-r--r--lib/xmerl/test/Makefile2
-rw-r--r--lib/xmerl/test/xmerl_SUITE.erl2
-rw-r--r--lib/xmerl/test/xmerl_app_test.erl2
-rw-r--r--lib/xmerl/test/xmerl_appup_test.erl2
-rw-r--r--lib/xmerl/test/xmerl_sax_SUITE.erl2
-rw-r--r--lib/xmerl/test/xmerl_sax_std_SUITE.erl2
-rw-r--r--lib/xmerl/test/xmerl_std_SUITE.erl2
-rw-r--r--lib/xmerl/test/xmerl_test_lib.erl2
-rw-r--r--lib/xmerl/test/xmerl_xsd_MS2002-01-16_SUITE.erl2
-rw-r--r--lib/xmerl/test/xmerl_xsd_NIST2002-01-16_SUITE.erl2
-rw-r--r--lib/xmerl/test/xmerl_xsd_SUITE.erl2
-rw-r--r--lib/xmerl/test/xmerl_xsd_Sun2002-01-16_SUITE.erl2
-rw-r--r--lib/xmerl/test/xmerl_xsd_lib.erl2
-rw-r--r--otp_versions.table4
-rw-r--r--system/COPYRIGHT2
-rw-r--r--system/doc/definitions/term.defs1
-rw-r--r--system/doc/design_principles/Makefile17
-rw-r--r--system/doc/design_principles/applications.xml2
-rw-r--r--system/doc/design_principles/appup_cookbook.xml5
-rw-r--r--system/doc/design_principles/book.xml2
-rw-r--r--system/doc/design_principles/code_lock.diabin0 -> 2932 bytes
-rw-r--r--system/doc/design_principles/code_lock.pngbin0 -> 59160 bytes
-rw-r--r--system/doc/design_principles/code_lock_2.diabin0 -> 2621 bytes
-rw-r--r--system/doc/design_principles/code_lock_2.pngbin0 -> 48927 bytes
-rw-r--r--system/doc/design_principles/des_princ.xml6
-rw-r--r--system/doc/design_principles/distributed_applications.xml2
-rw-r--r--system/doc/design_principles/events.xml2
-rw-r--r--system/doc/design_principles/fsm.xml12
-rw-r--r--system/doc/design_principles/gen_server_concepts.xml2
-rw-r--r--system/doc/design_principles/included_applications.xml2
-rw-r--r--system/doc/design_principles/part.xml3
-rw-r--r--system/doc/design_principles/release_handling.xml4
-rw-r--r--system/doc/design_principles/release_structure.xml2
-rw-r--r--system/doc/design_principles/spec_proc.xml33
-rw-r--r--system/doc/design_principles/statem.xml1454
-rw-r--r--system/doc/design_principles/sup_princ.xml10
-rw-r--r--system/doc/design_principles/xmlfiles.mk3
-rw-r--r--system/doc/efficiency_guide/Makefile2
-rw-r--r--system/doc/efficiency_guide/advanced.xml2
-rw-r--r--system/doc/efficiency_guide/appendix.xml2
-rw-r--r--system/doc/efficiency_guide/binaryhandling.xml2
-rw-r--r--system/doc/efficiency_guide/book.xml2
-rw-r--r--system/doc/efficiency_guide/commoncaveats.xml2
-rw-r--r--system/doc/efficiency_guide/drivers.xml2
-rw-r--r--system/doc/efficiency_guide/functions.xml2
-rw-r--r--system/doc/efficiency_guide/introduction.xml2
-rw-r--r--system/doc/efficiency_guide/listhandling.xml2
-rw-r--r--system/doc/efficiency_guide/myths.xml2
-rw-r--r--system/doc/efficiency_guide/part.xml2
-rw-r--r--system/doc/efficiency_guide/processes.xml2
-rw-r--r--system/doc/efficiency_guide/profiling.xml2
-rw-r--r--system/doc/efficiency_guide/tablesDatabases.xml2
-rw-r--r--system/doc/efficiency_guide/xmlfiles.mk2
-rw-r--r--system/doc/embedded/Makefile2
-rw-r--r--system/doc/embedded/book.xml2
-rw-r--r--system/doc/embedded/embedded_nt.xml2
-rw-r--r--system/doc/embedded/embedded_solaris.xml2
-rw-r--r--system/doc/embedded/intro.xml2
-rw-r--r--system/doc/embedded/part.xml2
-rw-r--r--system/doc/embedded/starting.xml2
-rw-r--r--system/doc/embedded/target.xml2
-rw-r--r--system/doc/embedded/vme_problems.xml2
-rw-r--r--system/doc/embedded/xmlfiles.mk2
-rw-r--r--system/doc/embedded/xntp.xml2
-rw-r--r--system/doc/getting_started/Makefile2
-rw-r--r--system/doc/getting_started/book.xml2
-rw-r--r--system/doc/getting_started/conc_prog.xml2
-rw-r--r--system/doc/getting_started/intro.xml2
-rw-r--r--system/doc/getting_started/part.xml2
-rw-r--r--system/doc/getting_started/records_macros.xml2
-rw-r--r--system/doc/getting_started/robustness.xml2
-rw-r--r--system/doc/getting_started/seq_prog.xml2
-rw-r--r--system/doc/getting_started/xmlfiles.mk2
-rw-r--r--system/doc/installation_guide/Makefile2
-rw-r--r--system/doc/installation_guide/book.xml2
-rw-r--r--system/doc/installation_guide/install-binary.xml2
-rw-r--r--system/doc/installation_guide/part.xml2
-rw-r--r--system/doc/installation_guide/xmlfiles.mk2
-rw-r--r--system/doc/oam/Makefile2
-rw-r--r--system/doc/oam/book.xml2
-rw-r--r--system/doc/oam/oam_intro.xml2
-rw-r--r--system/doc/oam/part.xml2
-rw-r--r--system/doc/oam/xmlfiles.mk2
-rw-r--r--system/doc/programming_examples/Makefile2
-rw-r--r--system/doc/programming_examples/book.xml2
-rw-r--r--system/doc/programming_examples/funs.xmlsrc4
-rw-r--r--system/doc/programming_examples/list_comprehensions.xml2
-rw-r--r--system/doc/programming_examples/part.xml2
-rw-r--r--system/doc/programming_examples/records.xml2
-rw-r--r--system/doc/programming_examples/xmlfiles.mk2
-rw-r--r--system/doc/reference_manual/Makefile2
-rw-r--r--system/doc/reference_manual/book.xml2
-rw-r--r--system/doc/reference_manual/code_loading.xml55
-rw-r--r--system/doc/reference_manual/expressions.xml2
-rw-r--r--system/doc/reference_manual/macros.xml48
-rw-r--r--system/doc/reference_manual/modules.xml3
-rw-r--r--system/doc/reference_manual/part.xml2
-rw-r--r--system/doc/reference_manual/patterns.xml2
-rw-r--r--system/doc/reference_manual/typespec.xml32
-rw-r--r--system/doc/reference_manual/xmlfiles.mk2
-rw-r--r--system/doc/system_architecture_intro/Makefile2
-rw-r--r--system/doc/system_architecture_intro/book.xml2
-rw-r--r--system/doc/system_architecture_intro/part.xml2
-rw-r--r--system/doc/system_architecture_intro/sys_arch_intro.xml2
-rw-r--r--system/doc/system_architecture_intro/xmlfiles.mk2
-rw-r--r--system/doc/system_principles/Makefile2
-rw-r--r--system/doc/system_principles/book.xml2
-rw-r--r--system/doc/system_principles/create_target.xmlsrc2
-rw-r--r--system/doc/system_principles/error_logging.xml2
-rw-r--r--system/doc/system_principles/part.xml2
-rw-r--r--system/doc/system_principles/upgrade.xml2
-rw-r--r--system/doc/system_principles/versions.xml2
-rw-r--r--system/doc/system_principles/xmlfiles.mk2
-rw-r--r--system/doc/top/Makefile2
-rw-r--r--system/doc/top/book.xml2
-rw-r--r--system/doc/top/src/erl_html_tools.erl2
-rw-r--r--system/doc/top/src/erlresolvelinks.erl2
-rw-r--r--system/doc/top/src/otp_man_index.erl2
-rw-r--r--system/doc/top/templates/applications.html.src2
-rw-r--r--system/doc/top/templates/index.html.src10
-rw-r--r--system/doc/tutorial/Makefile2
-rw-r--r--system/doc/tutorial/appendix.xmlsrc2
-rw-r--r--system/doc/tutorial/book.xml2
-rw-r--r--system/doc/tutorial/distribution.xml2
-rw-r--r--system/doc/tutorial/part.xml2
-rw-r--r--system/doc/tutorial/xmlfiles.mk2
5431 files changed, 72777 insertions, 44617 deletions
diff --git a/HOWTO/INSTALL.md b/HOWTO/INSTALL.md
index 43bcdb3a9e..2ae1ed3c8d 100644
--- a/HOWTO/INSTALL.md
+++ b/HOWTO/INSTALL.md
@@ -68,7 +68,7 @@ also find the utilities needed for building the documentation.
Required for building the application `crypto`.
Further, `ssl` and `ssh` require a working crypto application and
will also be skipped if OpenSSL is missing. The `public_key`
- application will available without `crypto`, but the functionality
+ application is available without `crypto`, but the functionality
will be very limited.
The development package of OpenSSL including the header files are needed as well
@@ -356,8 +356,6 @@ Some of the available `configure` options are:
depending on operating system and hardware platform. Note that by
enabling this you might get a seemingly working system that sometimes
fail on floating point operations.
-* `--enable-darwin-universal` - Build universal binaries on darwin i386.
-* `--enable-darwin-64bit` - Build 64-bit binaries on darwin
* `--enable-m64-build` - Build 64-bit binaries using the `-m64` flag to
`(g)cc`
* `--enable-m32-build` - Build 32-bit binaries using the `-m32` flag to
diff --git a/OTP_VERSION b/OTP_VERSION
index cc12e7c6aa..0b602e3cc8 100644
--- a/OTP_VERSION
+++ b/OTP_VERSION
@@ -1,2 +1 @@
19.0-rc0
-
diff --git a/README.md b/README.md
index ed3bf26d6e..9986d6bc18 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,8 @@ Here are the [instructions for submitting patches] [2].
In short:
+* Go to the JIRA issue tracker at [bugs.erlang.org] [7] to see reported issues which you can contribute to. Search for issues with the status *Contribution Needed*.
+
* We prefer to receive proposed updates via email on the
[`erlang-patches`] [3] mailing list or through a pull request.
@@ -58,8 +60,6 @@ In short:
may suggest improvements that are needed before the change can be accepted
and merged.
-* Once or twice a week, a status email called ["What's cooking in Erlang/OTP"] [4]
- will be sent to the [`erlang-patches`] [3] mailing list.
Bug Reports
--------------------------
@@ -91,8 +91,9 @@ Copyright and License
[1]: http://www.erlang.org
- [2]: http://wiki.github.com/erlang/otp/submitting-patches
+ [2]: http://wiki.github.com/erlang/otp/contribution-guidelines
[3]: http://www.erlang.org/static/doc/mailinglist.html
[4]: http://erlang.github.com/otp/
[5]: HOWTO/INSTALL.md
[6]: https://github.com/erlang/otp/wiki/Bug-reports
+ [7]: http://bugs.erlang.org
diff --git a/bootstrap/bin/start.boot b/bootstrap/bin/start.boot
index 73381d4d8b..cc0edd5427 100644
--- a/bootstrap/bin/start.boot
+++ b/bootstrap/bin/start.boot
Binary files differ
diff --git a/bootstrap/bin/start_clean.boot b/bootstrap/bin/start_clean.boot
index 73381d4d8b..cc0edd5427 100644
--- a/bootstrap/bin/start_clean.boot
+++ b/bootstrap/bin/start_clean.boot
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/beam_asm.beam b/bootstrap/lib/compiler/ebin/beam_asm.beam
index ae57c8dd6b..c8bc82022c 100644
--- a/bootstrap/lib/compiler/ebin/beam_asm.beam
+++ b/bootstrap/lib/compiler/ebin/beam_asm.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/beam_block.beam b/bootstrap/lib/compiler/ebin/beam_block.beam
index 7a96ad3196..cccf21d9ab 100644
--- a/bootstrap/lib/compiler/ebin/beam_block.beam
+++ b/bootstrap/lib/compiler/ebin/beam_block.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/beam_bool.beam b/bootstrap/lib/compiler/ebin/beam_bool.beam
index e677c125a3..a793db8bed 100644
--- a/bootstrap/lib/compiler/ebin/beam_bool.beam
+++ b/bootstrap/lib/compiler/ebin/beam_bool.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/beam_bs.beam b/bootstrap/lib/compiler/ebin/beam_bs.beam
index 18b9f8bc1b..6105ef85ca 100644
--- a/bootstrap/lib/compiler/ebin/beam_bs.beam
+++ b/bootstrap/lib/compiler/ebin/beam_bs.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/beam_bsm.beam b/bootstrap/lib/compiler/ebin/beam_bsm.beam
index b65f915978..51abd68b00 100644
--- a/bootstrap/lib/compiler/ebin/beam_bsm.beam
+++ b/bootstrap/lib/compiler/ebin/beam_bsm.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/beam_dead.beam b/bootstrap/lib/compiler/ebin/beam_dead.beam
index 10926614e6..4fda5157fa 100644
--- a/bootstrap/lib/compiler/ebin/beam_dead.beam
+++ b/bootstrap/lib/compiler/ebin/beam_dead.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/beam_disasm.beam b/bootstrap/lib/compiler/ebin/beam_disasm.beam
index b2fd7faa0c..477ab0a957 100644
--- a/bootstrap/lib/compiler/ebin/beam_disasm.beam
+++ b/bootstrap/lib/compiler/ebin/beam_disasm.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/beam_peep.beam b/bootstrap/lib/compiler/ebin/beam_peep.beam
index 334047bbf6..2a2b8d38f5 100644
--- a/bootstrap/lib/compiler/ebin/beam_peep.beam
+++ b/bootstrap/lib/compiler/ebin/beam_peep.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/beam_receive.beam b/bootstrap/lib/compiler/ebin/beam_receive.beam
index 0aa196f3de..fef3fcc816 100644
--- a/bootstrap/lib/compiler/ebin/beam_receive.beam
+++ b/bootstrap/lib/compiler/ebin/beam_receive.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/beam_split.beam b/bootstrap/lib/compiler/ebin/beam_split.beam
index a4e2b78938..3a02e2b17c 100644
--- a/bootstrap/lib/compiler/ebin/beam_split.beam
+++ b/bootstrap/lib/compiler/ebin/beam_split.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/beam_trim.beam b/bootstrap/lib/compiler/ebin/beam_trim.beam
index 194882f68a..67d290e733 100644
--- a/bootstrap/lib/compiler/ebin/beam_trim.beam
+++ b/bootstrap/lib/compiler/ebin/beam_trim.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/beam_type.beam b/bootstrap/lib/compiler/ebin/beam_type.beam
index 35bc046ef8..8f89c771b7 100644
--- a/bootstrap/lib/compiler/ebin/beam_type.beam
+++ b/bootstrap/lib/compiler/ebin/beam_type.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/beam_utils.beam b/bootstrap/lib/compiler/ebin/beam_utils.beam
index a97fc853a7..661cd1c60d 100644
--- a/bootstrap/lib/compiler/ebin/beam_utils.beam
+++ b/bootstrap/lib/compiler/ebin/beam_utils.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/beam_validator.beam b/bootstrap/lib/compiler/ebin/beam_validator.beam
index 73fa117755..187968450f 100644
--- a/bootstrap/lib/compiler/ebin/beam_validator.beam
+++ b/bootstrap/lib/compiler/ebin/beam_validator.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/beam_z.beam b/bootstrap/lib/compiler/ebin/beam_z.beam
index 7bf77d7d33..11ddf0e062 100644
--- a/bootstrap/lib/compiler/ebin/beam_z.beam
+++ b/bootstrap/lib/compiler/ebin/beam_z.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/cerl.beam b/bootstrap/lib/compiler/ebin/cerl.beam
index 88857b8905..82bd89c17a 100644
--- a/bootstrap/lib/compiler/ebin/cerl.beam
+++ b/bootstrap/lib/compiler/ebin/cerl.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/cerl_inline.beam b/bootstrap/lib/compiler/ebin/cerl_inline.beam
index cc90a53ef9..ce1f13db6a 100644
--- a/bootstrap/lib/compiler/ebin/cerl_inline.beam
+++ b/bootstrap/lib/compiler/ebin/cerl_inline.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/cerl_trees.beam b/bootstrap/lib/compiler/ebin/cerl_trees.beam
index 37120929ba..a2c27861c4 100644
--- a/bootstrap/lib/compiler/ebin/cerl_trees.beam
+++ b/bootstrap/lib/compiler/ebin/cerl_trees.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/compile.beam b/bootstrap/lib/compiler/ebin/compile.beam
index 5234f98a75..b309544c39 100644
--- a/bootstrap/lib/compiler/ebin/compile.beam
+++ b/bootstrap/lib/compiler/ebin/compile.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/compiler.app b/bootstrap/lib/compiler/ebin/compiler.app
index 37a6ce4acb..53891c7260 100644
--- a/bootstrap/lib/compiler/ebin/compiler.app
+++ b/bootstrap/lib/compiler/ebin/compiler.app
@@ -1,7 +1,7 @@
% This is an -*- erlang -*- file.
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
{application, compiler,
[{description, "ERTS CXC 138 10"},
- {vsn, "6.0.2"},
+ {vsn, "6.0.3"},
{modules, [
beam_a,
beam_asm,
diff --git a/bootstrap/lib/compiler/ebin/compiler.appup b/bootstrap/lib/compiler/ebin/compiler.appup
index ceb96264d5..367a845adf 100644
--- a/bootstrap/lib/compiler/ebin/compiler.appup
+++ b/bootstrap/lib/compiler/ebin/compiler.appup
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
%% limitations under the License.
%%
%% %CopyrightEnd%
-{"6.0.2",
+{"6.0.3",
[{<<".*">>,[{restart_application, compiler}]}],
[{<<".*">>,[{restart_application, compiler}]}]
}.
diff --git a/bootstrap/lib/compiler/ebin/core_lint.beam b/bootstrap/lib/compiler/ebin/core_lint.beam
index 69143cdd23..0e47e00b15 100644
--- a/bootstrap/lib/compiler/ebin/core_lint.beam
+++ b/bootstrap/lib/compiler/ebin/core_lint.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/core_parse.beam b/bootstrap/lib/compiler/ebin/core_parse.beam
index 3ef8588f65..baf2c9d70f 100644
--- a/bootstrap/lib/compiler/ebin/core_parse.beam
+++ b/bootstrap/lib/compiler/ebin/core_parse.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/core_pp.beam b/bootstrap/lib/compiler/ebin/core_pp.beam
index f320fd6908..6047596cb6 100644
--- a/bootstrap/lib/compiler/ebin/core_pp.beam
+++ b/bootstrap/lib/compiler/ebin/core_pp.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/sys_core_dsetel.beam b/bootstrap/lib/compiler/ebin/sys_core_dsetel.beam
index 0c2d05286a..81da8b62c5 100644
--- a/bootstrap/lib/compiler/ebin/sys_core_dsetel.beam
+++ b/bootstrap/lib/compiler/ebin/sys_core_dsetel.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/sys_core_fold.beam b/bootstrap/lib/compiler/ebin/sys_core_fold.beam
index 52c0d62f5f..088d69fa2a 100644
--- a/bootstrap/lib/compiler/ebin/sys_core_fold.beam
+++ b/bootstrap/lib/compiler/ebin/sys_core_fold.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/sys_pre_expand.beam b/bootstrap/lib/compiler/ebin/sys_pre_expand.beam
index 71d381b5b3..0914282354 100644
--- a/bootstrap/lib/compiler/ebin/sys_pre_expand.beam
+++ b/bootstrap/lib/compiler/ebin/sys_pre_expand.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/v3_codegen.beam b/bootstrap/lib/compiler/ebin/v3_codegen.beam
index 322469639f..0d76bb21e2 100644
--- a/bootstrap/lib/compiler/ebin/v3_codegen.beam
+++ b/bootstrap/lib/compiler/ebin/v3_codegen.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/v3_core.beam b/bootstrap/lib/compiler/ebin/v3_core.beam
index 223eb2acef..3b3b8f4208 100644
--- a/bootstrap/lib/compiler/ebin/v3_core.beam
+++ b/bootstrap/lib/compiler/ebin/v3_core.beam
Binary files differ
diff --git a/bootstrap/lib/compiler/ebin/v3_kernel.beam b/bootstrap/lib/compiler/ebin/v3_kernel.beam
index 6555a39c86..5e3ae80d14 100644
--- a/bootstrap/lib/compiler/ebin/v3_kernel.beam
+++ b/bootstrap/lib/compiler/ebin/v3_kernel.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/code.beam b/bootstrap/lib/kernel/ebin/code.beam
index 28d8a5b579..784d8c2e71 100644
--- a/bootstrap/lib/kernel/ebin/code.beam
+++ b/bootstrap/lib/kernel/ebin/code.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/code_server.beam b/bootstrap/lib/kernel/ebin/code_server.beam
index 135fd066d9..6f99487ca7 100644
--- a/bootstrap/lib/kernel/ebin/code_server.beam
+++ b/bootstrap/lib/kernel/ebin/code_server.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/disk_log.beam b/bootstrap/lib/kernel/ebin/disk_log.beam
index 3384baedc0..998d4bca2f 100644
--- a/bootstrap/lib/kernel/ebin/disk_log.beam
+++ b/bootstrap/lib/kernel/ebin/disk_log.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/dist_util.beam b/bootstrap/lib/kernel/ebin/dist_util.beam
index 521bdb5d91..eb09a06785 100644
--- a/bootstrap/lib/kernel/ebin/dist_util.beam
+++ b/bootstrap/lib/kernel/ebin/dist_util.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/erl_distribution.beam b/bootstrap/lib/kernel/ebin/erl_distribution.beam
index eacacf799c..198f23e14b 100644
--- a/bootstrap/lib/kernel/ebin/erl_distribution.beam
+++ b/bootstrap/lib/kernel/ebin/erl_distribution.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/error_handler.beam b/bootstrap/lib/kernel/ebin/error_handler.beam
index 64f44baeb7..a898c909ac 100644
--- a/bootstrap/lib/kernel/ebin/error_handler.beam
+++ b/bootstrap/lib/kernel/ebin/error_handler.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/erts_debug.beam b/bootstrap/lib/kernel/ebin/erts_debug.beam
index 908c63cb9a..ab883f3a50 100644
--- a/bootstrap/lib/kernel/ebin/erts_debug.beam
+++ b/bootstrap/lib/kernel/ebin/erts_debug.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/file.beam b/bootstrap/lib/kernel/ebin/file.beam
index a66a2621b9..c82dada559 100644
--- a/bootstrap/lib/kernel/ebin/file.beam
+++ b/bootstrap/lib/kernel/ebin/file.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/file_io_server.beam b/bootstrap/lib/kernel/ebin/file_io_server.beam
index dabb6b194e..c22b7e4dec 100644
--- a/bootstrap/lib/kernel/ebin/file_io_server.beam
+++ b/bootstrap/lib/kernel/ebin/file_io_server.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/gen_sctp.beam b/bootstrap/lib/kernel/ebin/gen_sctp.beam
index 91aaa41063..fe2ff17ff1 100644
--- a/bootstrap/lib/kernel/ebin/gen_sctp.beam
+++ b/bootstrap/lib/kernel/ebin/gen_sctp.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/global.beam b/bootstrap/lib/kernel/ebin/global.beam
index 419102e285..b461d30baa 100644
--- a/bootstrap/lib/kernel/ebin/global.beam
+++ b/bootstrap/lib/kernel/ebin/global.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/global_group.beam b/bootstrap/lib/kernel/ebin/global_group.beam
index 1269f7e321..03202f68eb 100644
--- a/bootstrap/lib/kernel/ebin/global_group.beam
+++ b/bootstrap/lib/kernel/ebin/global_group.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/group.beam b/bootstrap/lib/kernel/ebin/group.beam
index 3df8f6030c..0511d1fa09 100644
--- a/bootstrap/lib/kernel/ebin/group.beam
+++ b/bootstrap/lib/kernel/ebin/group.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/hipe_unified_loader.beam b/bootstrap/lib/kernel/ebin/hipe_unified_loader.beam
index a90757bd32..5a2f294951 100644
--- a/bootstrap/lib/kernel/ebin/hipe_unified_loader.beam
+++ b/bootstrap/lib/kernel/ebin/hipe_unified_loader.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/inet.beam b/bootstrap/lib/kernel/ebin/inet.beam
index 55598b0067..60469432b9 100644
--- a/bootstrap/lib/kernel/ebin/inet.beam
+++ b/bootstrap/lib/kernel/ebin/inet.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/inet_db.beam b/bootstrap/lib/kernel/ebin/inet_db.beam
index 1b7450f0d3..557852c917 100644
--- a/bootstrap/lib/kernel/ebin/inet_db.beam
+++ b/bootstrap/lib/kernel/ebin/inet_db.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/inet_dns.beam b/bootstrap/lib/kernel/ebin/inet_dns.beam
index 88ecaaf10b..f4be62bae6 100644
--- a/bootstrap/lib/kernel/ebin/inet_dns.beam
+++ b/bootstrap/lib/kernel/ebin/inet_dns.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/inet_gethost_native.beam b/bootstrap/lib/kernel/ebin/inet_gethost_native.beam
index 93f60428a1..f090de9fba 100644
--- a/bootstrap/lib/kernel/ebin/inet_gethost_native.beam
+++ b/bootstrap/lib/kernel/ebin/inet_gethost_native.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/inet_parse.beam b/bootstrap/lib/kernel/ebin/inet_parse.beam
index 4323d12bf1..30f05d5c09 100644
--- a/bootstrap/lib/kernel/ebin/inet_parse.beam
+++ b/bootstrap/lib/kernel/ebin/inet_parse.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/inet_res.beam b/bootstrap/lib/kernel/ebin/inet_res.beam
index ada7300673..2713c7fef6 100644
--- a/bootstrap/lib/kernel/ebin/inet_res.beam
+++ b/bootstrap/lib/kernel/ebin/inet_res.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/kernel.app b/bootstrap/lib/kernel/ebin/kernel.app
index 14f526c30c..8e00bc4a45 100644
--- a/bootstrap/lib/kernel/ebin/kernel.app
+++ b/bootstrap/lib/kernel/ebin/kernel.app
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
{application, kernel,
[
{description, "ERTS CXC 138 10"},
- {vsn, "4.1.1"},
+ {vsn, "5.0"},
{modules, [application,
application_controller,
application_master,
@@ -116,6 +116,6 @@
{applications, []},
{env, [{error_logger, tty}]},
{mod, {kernel, []}},
- {runtime_dependencies, ["erts-7.3", "stdlib-2.6", "sasl-2.6"]}
+ {runtime_dependencies, ["erts-8.0", "stdlib-2.6", "sasl-2.6"]}
]
}.
diff --git a/bootstrap/lib/kernel/ebin/kernel.appup b/bootstrap/lib/kernel/ebin/kernel.appup
index 5cd6724383..1ed9771492 100644
--- a/bootstrap/lib/kernel/ebin/kernel.appup
+++ b/bootstrap/lib/kernel/ebin/kernel.appup
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -16,11 +16,11 @@
%% limitations under the License.
%%
%% %CopyrightEnd%
-{"4.1.1",
+{"5.0",
%% Up from - max one major revision back
- [{<<"4\\.[0-1](\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-18.*
- {<<"3\\.[0-2](\\.[0-9]+)*">>,[restart_new_emulator]}], % OTP-17
+ [{<<"5\\.0(\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-19.*
+ {<<"4\\.[0-2](\\.[0-9]+)*">>,[restart_new_emulator]}], % OTP-18.*
%% Down to - max one major revision back
- [{<<"4\\.[0-1](\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-18.*
- {<<"3\\.[0-2](\\.[0-9]+)*">>,[restart_new_emulator]}] % OTP-17
+ [{<<"5\\.0(\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-19.*
+ {<<"4\\.[0-2](\\.[0-9]+)*">>,[restart_new_emulator]}] % OTP-18.*
}.
diff --git a/bootstrap/lib/kernel/ebin/net_kernel.beam b/bootstrap/lib/kernel/ebin/net_kernel.beam
index bd15759017..8afe1c0388 100644
--- a/bootstrap/lib/kernel/ebin/net_kernel.beam
+++ b/bootstrap/lib/kernel/ebin/net_kernel.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/ram_file.beam b/bootstrap/lib/kernel/ebin/ram_file.beam
index b119b3656c..2b14a4d28b 100644
--- a/bootstrap/lib/kernel/ebin/ram_file.beam
+++ b/bootstrap/lib/kernel/ebin/ram_file.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/rpc.beam b/bootstrap/lib/kernel/ebin/rpc.beam
index 4d1cbdb625..684d95afa0 100644
--- a/bootstrap/lib/kernel/ebin/rpc.beam
+++ b/bootstrap/lib/kernel/ebin/rpc.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/seq_trace.beam b/bootstrap/lib/kernel/ebin/seq_trace.beam
index 68d1b50f84..0155810ca7 100644
--- a/bootstrap/lib/kernel/ebin/seq_trace.beam
+++ b/bootstrap/lib/kernel/ebin/seq_trace.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/user_drv.beam b/bootstrap/lib/kernel/ebin/user_drv.beam
index e306b172bf..1d72927105 100644
--- a/bootstrap/lib/kernel/ebin/user_drv.beam
+++ b/bootstrap/lib/kernel/ebin/user_drv.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/include/dist.hrl b/bootstrap/lib/kernel/include/dist.hrl
index 47d9459a19..d6bccdf474 100644
--- a/bootstrap/lib/kernel/include/dist.hrl
+++ b/bootstrap/lib/kernel/include/dist.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -39,3 +39,4 @@
-define(DFLAG_SMALL_ATOM_TAGS, 16#4000).
-define(DFLAG_UTF8_ATOMS, 16#10000).
-define(DFLAG_MAP_TAG, 16#20000).
+-define(DFLAG_BIG_CREATION, 16#40000).
diff --git a/bootstrap/lib/kernel/include/dist_util.hrl b/bootstrap/lib/kernel/include/dist_util.hrl
index d5df2be4ec..43e50d4325 100644
--- a/bootstrap/lib/kernel/include/dist_util.hrl
+++ b/bootstrap/lib/kernel/include/dist_util.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/bootstrap/lib/kernel/include/inet.hrl b/bootstrap/lib/kernel/include/inet.hrl
index d983fa9e72..b39df8c3f2 100644
--- a/bootstrap/lib/kernel/include/inet.hrl
+++ b/bootstrap/lib/kernel/include/inet.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/bootstrap/lib/kernel/include/inet_sctp.hrl b/bootstrap/lib/kernel/include/inet_sctp.hrl
index d6376e452e..ddb3cdc26c 100644
--- a/bootstrap/lib/kernel/include/inet_sctp.hrl
+++ b/bootstrap/lib/kernel/include/inet_sctp.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/bootstrap/lib/kernel/include/net_address.hrl b/bootstrap/lib/kernel/include/net_address.hrl
index 9dd4b78cd4..4988175593 100644
--- a/bootstrap/lib/kernel/include/net_address.hrl
+++ b/bootstrap/lib/kernel/include/net_address.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/bootstrap/lib/stdlib/ebin/array.beam b/bootstrap/lib/stdlib/ebin/array.beam
index 4ad8942b06..b7b808035a 100644
--- a/bootstrap/lib/stdlib/ebin/array.beam
+++ b/bootstrap/lib/stdlib/ebin/array.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/beam_lib.beam b/bootstrap/lib/stdlib/ebin/beam_lib.beam
index 8b987fd7f7..bdea71378f 100644
--- a/bootstrap/lib/stdlib/ebin/beam_lib.beam
+++ b/bootstrap/lib/stdlib/ebin/beam_lib.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/c.beam b/bootstrap/lib/stdlib/ebin/c.beam
index 133035102e..e1d964115d 100644
--- a/bootstrap/lib/stdlib/ebin/c.beam
+++ b/bootstrap/lib/stdlib/ebin/c.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/dets.beam b/bootstrap/lib/stdlib/ebin/dets.beam
index b255a4e10f..754663b531 100644
--- a/bootstrap/lib/stdlib/ebin/dets.beam
+++ b/bootstrap/lib/stdlib/ebin/dets.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/dets_server.beam b/bootstrap/lib/stdlib/ebin/dets_server.beam
index da999f3025..502eb98318 100644
--- a/bootstrap/lib/stdlib/ebin/dets_server.beam
+++ b/bootstrap/lib/stdlib/ebin/dets_server.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/dets_utils.beam b/bootstrap/lib/stdlib/ebin/dets_utils.beam
index ab627d50df..37247c7176 100644
--- a/bootstrap/lib/stdlib/ebin/dets_utils.beam
+++ b/bootstrap/lib/stdlib/ebin/dets_utils.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/dets_v9.beam b/bootstrap/lib/stdlib/ebin/dets_v9.beam
index 0b966769ba..3e02f4b0be 100644
--- a/bootstrap/lib/stdlib/ebin/dets_v9.beam
+++ b/bootstrap/lib/stdlib/ebin/dets_v9.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/dict.beam b/bootstrap/lib/stdlib/ebin/dict.beam
index 3b2b5a4c04..c91e90a0a9 100644
--- a/bootstrap/lib/stdlib/ebin/dict.beam
+++ b/bootstrap/lib/stdlib/ebin/dict.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/digraph_utils.beam b/bootstrap/lib/stdlib/ebin/digraph_utils.beam
index 9065fda936..66777eeb8f 100644
--- a/bootstrap/lib/stdlib/ebin/digraph_utils.beam
+++ b/bootstrap/lib/stdlib/ebin/digraph_utils.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/epp.beam b/bootstrap/lib/stdlib/ebin/epp.beam
index e2a528f9fc..54909eeaa3 100644
--- a/bootstrap/lib/stdlib/ebin/epp.beam
+++ b/bootstrap/lib/stdlib/ebin/epp.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/erl_bits.beam b/bootstrap/lib/stdlib/ebin/erl_bits.beam
index af8619bac0..a5aec9de8b 100644
--- a/bootstrap/lib/stdlib/ebin/erl_bits.beam
+++ b/bootstrap/lib/stdlib/ebin/erl_bits.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/erl_compile.beam b/bootstrap/lib/stdlib/ebin/erl_compile.beam
index 82949da20a..2c02065f58 100644
--- a/bootstrap/lib/stdlib/ebin/erl_compile.beam
+++ b/bootstrap/lib/stdlib/ebin/erl_compile.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/erl_eval.beam b/bootstrap/lib/stdlib/ebin/erl_eval.beam
index b58781d3f8..8793d70a39 100644
--- a/bootstrap/lib/stdlib/ebin/erl_eval.beam
+++ b/bootstrap/lib/stdlib/ebin/erl_eval.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/erl_expand_records.beam b/bootstrap/lib/stdlib/ebin/erl_expand_records.beam
index 617913c674..f6c0d0a732 100644
--- a/bootstrap/lib/stdlib/ebin/erl_expand_records.beam
+++ b/bootstrap/lib/stdlib/ebin/erl_expand_records.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/erl_lint.beam b/bootstrap/lib/stdlib/ebin/erl_lint.beam
index 3a0681d1bf..aeea1e2fcd 100644
--- a/bootstrap/lib/stdlib/ebin/erl_lint.beam
+++ b/bootstrap/lib/stdlib/ebin/erl_lint.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/erl_parse.beam b/bootstrap/lib/stdlib/ebin/erl_parse.beam
index 79e96cabec..9b04739d58 100644
--- a/bootstrap/lib/stdlib/ebin/erl_parse.beam
+++ b/bootstrap/lib/stdlib/ebin/erl_parse.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/erl_pp.beam b/bootstrap/lib/stdlib/ebin/erl_pp.beam
index 4cc4884c92..9841362f9d 100644
--- a/bootstrap/lib/stdlib/ebin/erl_pp.beam
+++ b/bootstrap/lib/stdlib/ebin/erl_pp.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/erl_scan.beam b/bootstrap/lib/stdlib/ebin/erl_scan.beam
index 6c35d20c46..f33c5bd6f9 100644
--- a/bootstrap/lib/stdlib/ebin/erl_scan.beam
+++ b/bootstrap/lib/stdlib/ebin/erl_scan.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/erl_tar.beam b/bootstrap/lib/stdlib/ebin/erl_tar.beam
index 9bcbabc27c..d29dbf18fd 100644
--- a/bootstrap/lib/stdlib/ebin/erl_tar.beam
+++ b/bootstrap/lib/stdlib/ebin/erl_tar.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/escript.beam b/bootstrap/lib/stdlib/ebin/escript.beam
index c006d9a1ad..70ac06c476 100644
--- a/bootstrap/lib/stdlib/ebin/escript.beam
+++ b/bootstrap/lib/stdlib/ebin/escript.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/ets.beam b/bootstrap/lib/stdlib/ebin/ets.beam
index a15534b365..130d9df1b5 100644
--- a/bootstrap/lib/stdlib/ebin/ets.beam
+++ b/bootstrap/lib/stdlib/ebin/ets.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/eval_bits.beam b/bootstrap/lib/stdlib/ebin/eval_bits.beam
index be20e8c720..0529da7250 100644
--- a/bootstrap/lib/stdlib/ebin/eval_bits.beam
+++ b/bootstrap/lib/stdlib/ebin/eval_bits.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/file_sorter.beam b/bootstrap/lib/stdlib/ebin/file_sorter.beam
index 9286aea119..ac4f1a36f1 100644
--- a/bootstrap/lib/stdlib/ebin/file_sorter.beam
+++ b/bootstrap/lib/stdlib/ebin/file_sorter.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/filelib.beam b/bootstrap/lib/stdlib/ebin/filelib.beam
index 5ea27fdca6..a9783ed990 100644
--- a/bootstrap/lib/stdlib/ebin/filelib.beam
+++ b/bootstrap/lib/stdlib/ebin/filelib.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/filename.beam b/bootstrap/lib/stdlib/ebin/filename.beam
index 7f6818db30..b6248fe460 100644
--- a/bootstrap/lib/stdlib/ebin/filename.beam
+++ b/bootstrap/lib/stdlib/ebin/filename.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/gen.beam b/bootstrap/lib/stdlib/ebin/gen.beam
index 586973a973..08735311fb 100644
--- a/bootstrap/lib/stdlib/ebin/gen.beam
+++ b/bootstrap/lib/stdlib/ebin/gen.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/gen_event.beam b/bootstrap/lib/stdlib/ebin/gen_event.beam
index 4788735049..2486647f46 100644
--- a/bootstrap/lib/stdlib/ebin/gen_event.beam
+++ b/bootstrap/lib/stdlib/ebin/gen_event.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/gen_fsm.beam b/bootstrap/lib/stdlib/ebin/gen_fsm.beam
index f78a7368d5..dbf38090af 100644
--- a/bootstrap/lib/stdlib/ebin/gen_fsm.beam
+++ b/bootstrap/lib/stdlib/ebin/gen_fsm.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/gen_server.beam b/bootstrap/lib/stdlib/ebin/gen_server.beam
index 8ebe9d7a3a..e7026a2a9a 100644
--- a/bootstrap/lib/stdlib/ebin/gen_server.beam
+++ b/bootstrap/lib/stdlib/ebin/gen_server.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/gen_statem.beam b/bootstrap/lib/stdlib/ebin/gen_statem.beam
new file mode 100644
index 0000000000..5a3fd2a1a5
--- /dev/null
+++ b/bootstrap/lib/stdlib/ebin/gen_statem.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/io_lib_pretty.beam b/bootstrap/lib/stdlib/ebin/io_lib_pretty.beam
index 9d37b74ad3..8488125227 100644
--- a/bootstrap/lib/stdlib/ebin/io_lib_pretty.beam
+++ b/bootstrap/lib/stdlib/ebin/io_lib_pretty.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/lib.beam b/bootstrap/lib/stdlib/ebin/lib.beam
index 8e594d97ad..541ea59421 100644
--- a/bootstrap/lib/stdlib/ebin/lib.beam
+++ b/bootstrap/lib/stdlib/ebin/lib.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/lists.beam b/bootstrap/lib/stdlib/ebin/lists.beam
index 91297311b2..422a9bd214 100644
--- a/bootstrap/lib/stdlib/ebin/lists.beam
+++ b/bootstrap/lib/stdlib/ebin/lists.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/maps.beam b/bootstrap/lib/stdlib/ebin/maps.beam
index 7533b56554..5f041ab10f 100644
--- a/bootstrap/lib/stdlib/ebin/maps.beam
+++ b/bootstrap/lib/stdlib/ebin/maps.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/otp_internal.beam b/bootstrap/lib/stdlib/ebin/otp_internal.beam
index e834be6dca..e1ebd34afd 100644
--- a/bootstrap/lib/stdlib/ebin/otp_internal.beam
+++ b/bootstrap/lib/stdlib/ebin/otp_internal.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/proc_lib.beam b/bootstrap/lib/stdlib/ebin/proc_lib.beam
index 568015b3e4..d3249b120e 100644
--- a/bootstrap/lib/stdlib/ebin/proc_lib.beam
+++ b/bootstrap/lib/stdlib/ebin/proc_lib.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/qlc.beam b/bootstrap/lib/stdlib/ebin/qlc.beam
index 436b62e50e..f0ed1e961b 100644
--- a/bootstrap/lib/stdlib/ebin/qlc.beam
+++ b/bootstrap/lib/stdlib/ebin/qlc.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/qlc_pt.beam b/bootstrap/lib/stdlib/ebin/qlc_pt.beam
index 4032af0dd7..17c698de60 100644
--- a/bootstrap/lib/stdlib/ebin/qlc_pt.beam
+++ b/bootstrap/lib/stdlib/ebin/qlc_pt.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/re.beam b/bootstrap/lib/stdlib/ebin/re.beam
index 7b2e736a21..c68d7cc82a 100644
--- a/bootstrap/lib/stdlib/ebin/re.beam
+++ b/bootstrap/lib/stdlib/ebin/re.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/shell.beam b/bootstrap/lib/stdlib/ebin/shell.beam
index 8e64036c90..9fa5727aa5 100644
--- a/bootstrap/lib/stdlib/ebin/shell.beam
+++ b/bootstrap/lib/stdlib/ebin/shell.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/sofs.beam b/bootstrap/lib/stdlib/ebin/sofs.beam
index 5514b0d4f9..01f7810764 100644
--- a/bootstrap/lib/stdlib/ebin/sofs.beam
+++ b/bootstrap/lib/stdlib/ebin/sofs.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/stdlib.app b/bootstrap/lib/stdlib/ebin/stdlib.app
index 7287cbd451..4c8f196620 100644
--- a/bootstrap/lib/stdlib/ebin/stdlib.app
+++ b/bootstrap/lib/stdlib/ebin/stdlib.app
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
%%
{application, stdlib,
[{description, "ERTS CXC 138 10"},
- {vsn, "2.7"},
+ {vsn, "3.0"},
{modules, [array,
base64,
beam_lib,
@@ -65,6 +65,7 @@
gen_event,
gen_fsm,
gen_server,
+ gen_statem,
io,
io_lib,
io_lib_format,
diff --git a/bootstrap/lib/stdlib/ebin/stdlib.appup b/bootstrap/lib/stdlib/ebin/stdlib.appup
index 8b0206f6be..737486d3c5 100644
--- a/bootstrap/lib/stdlib/ebin/stdlib.appup
+++ b/bootstrap/lib/stdlib/ebin/stdlib.appup
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -16,11 +16,11 @@
%% limitations under the License.
%%
%% %CopyrightEnd%
-{"2.7",
+{"3.0",
%% Up from - max one major revision back
- [{<<"2\\.[5-7](\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-18.*
- {<<"2\\.[0-4](\\.[0-9]+)*">>,[restart_new_emulator]}], % 17.0-17.5
+ [{<<"3\\.0(\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-19.*
+ {<<"2\\.[5-8](\\.[0-9]+)*">>,[restart_new_emulator]}], % OTP-18.*
%% Down to - max one major revision back
- [{<<"2\\.[5-7](\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-18.*
- {<<"2\\.[0-4](\\.[0-9]+)*">>,[restart_new_emulator]}] % 17.0-17.5
+ [{<<"3\\.0(\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-19.*
+ {<<"2\\.[5-8](\\.[0-9]+)*">>,[restart_new_emulator]}] % OTP-18.*
}.
diff --git a/bootstrap/lib/stdlib/ebin/supervisor.beam b/bootstrap/lib/stdlib/ebin/supervisor.beam
index e03a3264a6..d30b4a037b 100644
--- a/bootstrap/lib/stdlib/ebin/supervisor.beam
+++ b/bootstrap/lib/stdlib/ebin/supervisor.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/unicode.beam b/bootstrap/lib/stdlib/ebin/unicode.beam
index 17a318c4d4..1f5c92e369 100644
--- a/bootstrap/lib/stdlib/ebin/unicode.beam
+++ b/bootstrap/lib/stdlib/ebin/unicode.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/include/assert.hrl b/bootstrap/lib/stdlib/include/assert.hrl
index f913760102..9e5d4eb598 100644
--- a/bootstrap/lib/stdlib/include/assert.hrl
+++ b/bootstrap/lib/stdlib/include/assert.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright (C) 2004-2014 Richard Carlsson, Mickaël Rémond
+%% Copyright (C) 2004-2016 Richard Carlsson, Mickaël Rémond
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -59,19 +59,22 @@
-define(assert(BoolExpr),ok).
-else.
%% The assert macro is written the way it is so as not to cause warnings
-%% for clauses that cannot match, even if the expression is a constant.
+%% for clauses that cannot match, even if the expression is a constant or
+%% is known to be boolean-only.
-define(assert(BoolExpr),
begin
((fun () ->
+ __T = is_process_alive(self()), % cheap source of truth
case (BoolExpr) of
- true -> ok;
+ __T -> ok;
__V -> erlang:error({assert,
[{module, ?MODULE},
{line, ?LINE},
{expression, (??BoolExpr)},
{expected, true},
- case __V of false -> {value, __V};
- _ -> {not_boolean,__V}
+ case not __T of
+ __V -> {value, false};
+ _ -> {not_boolean, __V}
end]})
end
end)())
@@ -85,15 +88,17 @@
-define(assertNot(BoolExpr),
begin
((fun () ->
+ __F = not is_process_alive(self()),
case (BoolExpr) of
- false -> ok;
+ __F -> ok;
__V -> erlang:error({assert,
[{module, ?MODULE},
{line, ?LINE},
{expression, (??BoolExpr)},
{expected, false},
- case __V of true -> {value, __V};
- _ -> {not_boolean,__V}
+ case not __F of
+ __V -> {value, true};
+ _ -> {not_boolean, __V}
end]})
end
end)())
@@ -149,7 +154,8 @@
-else.
-define(assertEqual(Expect, Expr),
begin
- ((fun (__X) ->
+ ((fun () ->
+ __X = (Expect),
case (Expr) of
__X -> ok;
__V -> erlang:error({assertEqual,
@@ -159,7 +165,7 @@
{expected, __X},
{value, __V}]})
end
- end)(Expect))
+ end)())
end).
-endif.
@@ -169,7 +175,8 @@
-else.
-define(assertNotEqual(Unexpected, Expr),
begin
- ((fun (__X) ->
+ ((fun () ->
+ __X = (Unexpected),
case (Expr) of
__X -> erlang:error({assertNotEqual,
[{module, ?MODULE},
@@ -178,7 +185,7 @@
{value, __X}]});
_ -> ok
end
- end)(Unexpected))
+ end)())
end).
-endif.
diff --git a/bootstrap/lib/stdlib/include/erl_compile.hrl b/bootstrap/lib/stdlib/include/erl_compile.hrl
index c5fb491308..1c45613716 100644
--- a/bootstrap/lib/stdlib/include/erl_compile.hrl
+++ b/bootstrap/lib/stdlib/include/erl_compile.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/bootstrap/lib/stdlib/include/ms_transform.hrl b/bootstrap/lib/stdlib/include/ms_transform.hrl
index f8a2d35394..0d2c19fd4e 100644
--- a/bootstrap/lib/stdlib/include/ms_transform.hrl
+++ b/bootstrap/lib/stdlib/include/ms_transform.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/bootstrap/lib/stdlib/include/qlc.hrl b/bootstrap/lib/stdlib/include/qlc.hrl
index e3513314a0..60cd92aab0 100644
--- a/bootstrap/lib/stdlib/include/qlc.hrl
+++ b/bootstrap/lib/stdlib/include/qlc.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/bootstrap/lib/stdlib/include/zip.hrl b/bootstrap/lib/stdlib/include/zip.hrl
index 5f5abf9df3..2d0ee56f87 100644
--- a/bootstrap/lib/stdlib/include/zip.hrl
+++ b/bootstrap/lib/stdlib/include/zip.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/configure.in b/configure.in
index 89486590b8..8a7f372a50 100644
--- a/configure.in
+++ b/configure.in
@@ -234,8 +234,8 @@ AS_HELP_STRING([--enable-native-libs],
[compile Erlang libraries to native code]))
AC_ARG_WITH(dynamic-trace,
-AS_HELP_STRING([--with-dynamic-trace={dtrace|systemtap}],
- [specify use of dynamic trace framework, dtrace or systemtap])
+AS_HELP_STRING([--with-dynamic-trace={dtrace|lttng|systemtap}],
+ [specify use of dynamic trace framework, dtrace, lttng or systemtap])
AS_HELP_STRING([--without-dynamic-trace],
[don't enable any dynamic tracing (default)]))
AC_ARG_ENABLE(vm-probes,
@@ -297,24 +297,6 @@ dnl *) erl_mandir='$(erlang_libdir)/man' ;;
dnl esac ], erl_mandir='$(erlang_libdir)/man')
dnl AC_SUBST(erl_mandir)
-AC_ARG_ENABLE(darwin-universal,
-AS_HELP_STRING([--enable-darwin-universal],
- [build universal binaries on darwin i386]),
-[ case "$enableval" in
- no) enable_darwin_universal=no ;;
- *) enable_darwin_univeral=yes ;;
- esac
-],enable_darwin_universal=no)
-
-
-AC_ARG_ENABLE(darwin-64bit,
-AS_HELP_STRING([--enable-darwin-64bit], [build 64bit binaries on darwin]),
-[ case "$enableval" in
- no) enable_darwin_64bit=no ;;
- *) enable_darwin_64bit=yes ;;
- esac
-],enable_darwin_64bit=no)
-
AC_ARG_ENABLE(m64-build,
AS_HELP_STRING([--enable-m64-build],
[build 64bit binaries using the -m64 flag to (g)cc]),
@@ -329,12 +311,7 @@ AS_HELP_STRING([--enable-m32-build],
[build 32bit binaries using the -m32 flag to (g)cc]),
[ case "$enableval" in
no) enable_m32_build=no ;;
- *)
- if test X${enable_darwin_64bit} = Xyes -o X${enable_m64_build} = Xyes;
- then
- AC_MSG_ERROR([(--enable-darwin-64bit or --enable-m64-build) and --enable-m32-build are mutually exclusive]) ;
- fi ;
- enable_m32_build=yes ;;
+ *) enable_m32_build=yes ;;
esac
],enable_m32_build=no)
@@ -342,42 +319,6 @@ AC_ARG_WITH(libatomic_ops,
AS_HELP_STRING([--with-libatomic_ops=PATH],
[specify and prefer usage of libatomic_ops in the ethread library]))
-dnl OK, we might have darwin switches off different kinds, lets
-dnl check it all before continuing.
-TMPSYS=`uname -s`-`uname -m`
-if test X${enable_darwin_universal} = Xyes; then
- if test X${enable_darwin_64bit} = Xyes; then
- AC_MSG_ERROR([--enable-darwin-universal and --enable-darwin-64bit mutually exclusive])
- fi
- enable_hipe=no
- CFLAGS="-arch i386 -arch ppc $CFLAGS"
- export CFLAGS
- LDFLAGS="-arch i386 -arch ppc $LDFLAGS"
- export LDFLAGS
-fi
-if test X${enable_darwin_64bit} = Xyes; then
- case "$TMPSYS" in
- Darwin-i386|Darwin-x86_64)
- ;;
- Darwin*)
- AC_MSG_ERROR([--enable-darwin-64bit only supported on x86 hosts])
- ;;
- *)
- AC_MSG_ERROR([--enable-darwin-64bit only supported on Darwin])
- ;;
- esac
- enable_hipe=no
- CFLAGS="-m64 $CFLAGS"
- export CFLAGS
- LDFLAGS="-m64 $LDFLAGS"
- export LDFLAGS
-elif test X"$TMPSYS" '=' X"Darwin-i386"; then
- CFLAGS="-m32 $CFLAGS"
- export CFLAGS
- LDFLAGS="-m32 $LDFLAGS"
- export LDFLAGS
-fi
-
m4_define(DEFAULT_SANITIZERS, [address,undefined])
AC_ARG_ENABLE(sanitizers,
AS_HELP_STRING(
diff --git a/erts/AUTHORS b/erts/AUTHORS
index d8746f65b2..5555502099 100644
--- a/erts/AUTHORS
+++ b/erts/AUTHORS
@@ -1,7 +1,7 @@
%CopyrightBegin%
- Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ Copyright Ericsson AB 1999-2016. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/erts/Makefile.in b/erts/Makefile.in
index feed00dad5..3052dc3065 100644
--- a/erts/Makefile.in
+++ b/erts/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2013. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/aclocal.m4 b/erts/aclocal.m4
index 017fdbd589..86799186fd 100644
--- a/erts/aclocal.m4
+++ b/erts/aclocal.m4
@@ -1,7 +1,7 @@
dnl
dnl %CopyrightBegin%
dnl
-dnl Copyright Ericsson AB 1998-2015. All Rights Reserved.
+dnl Copyright Ericsson AB 1998-2016. All Rights Reserved.
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
diff --git a/erts/autoconf/configure.vxworks b/erts/autoconf/configure.vxworks
index 96dd1f8401..a13e0a6c56 100755
--- a/erts/autoconf/configure.vxworks
+++ b/erts/autoconf/configure.vxworks
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/autoconf/vxworks/sed.general b/erts/autoconf/vxworks/sed.general
index 5adee4db45..96a70e4148 100644
--- a/erts/autoconf/vxworks/sed.general
+++ b/erts/autoconf/vxworks/sed.general
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2013. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/autoconf/vxworks/sed.vxworks_cpu32 b/erts/autoconf/vxworks/sed.vxworks_cpu32
index e3d54246ab..71663676e7 100644
--- a/erts/autoconf/vxworks/sed.vxworks_cpu32
+++ b/erts/autoconf/vxworks/sed.vxworks_cpu32
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2010. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/autoconf/vxworks/sed.vxworks_ppc32 b/erts/autoconf/vxworks/sed.vxworks_ppc32
index 012760e127..2146e862fd 100644
--- a/erts/autoconf/vxworks/sed.vxworks_ppc32
+++ b/erts/autoconf/vxworks/sed.vxworks_ppc32
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2013. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/autoconf/vxworks/sed.vxworks_ppc603 b/erts/autoconf/vxworks/sed.vxworks_ppc603
index 55af52571b..fca1ba76d9 100644
--- a/erts/autoconf/vxworks/sed.vxworks_ppc603
+++ b/erts/autoconf/vxworks/sed.vxworks_ppc603
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2010. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/autoconf/vxworks/sed.vxworks_ppc603_nolongcall b/erts/autoconf/vxworks/sed.vxworks_ppc603_nolongcall
index e0c0891aeb..51c589d79a 100644
--- a/erts/autoconf/vxworks/sed.vxworks_ppc603_nolongcall
+++ b/erts/autoconf/vxworks/sed.vxworks_ppc603_nolongcall
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2010. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/autoconf/vxworks/sed.vxworks_ppc860 b/erts/autoconf/vxworks/sed.vxworks_ppc860
index 8828339e34..485504e706 100644
--- a/erts/autoconf/vxworks/sed.vxworks_ppc860
+++ b/erts/autoconf/vxworks/sed.vxworks_ppc860
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2010. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/autoconf/vxworks/sed.vxworks_simlinux b/erts/autoconf/vxworks/sed.vxworks_simlinux
index 950fb79ec5..10cd7bbb82 100644
--- a/erts/autoconf/vxworks/sed.vxworks_simlinux
+++ b/erts/autoconf/vxworks/sed.vxworks_simlinux
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2013. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/autoconf/vxworks/sed.vxworks_simso b/erts/autoconf/vxworks/sed.vxworks_simso
index 6f2796f04e..cd30f8c2b2 100644
--- a/erts/autoconf/vxworks/sed.vxworks_simso
+++ b/erts/autoconf/vxworks/sed.vxworks_simso
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2013. All Rights Reserved.
+# Copyright Ericsson AB 2005-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/autoconf/vxworks/sed.vxworks_sparc b/erts/autoconf/vxworks/sed.vxworks_sparc
index e67c34af26..a3758423e8 100644
--- a/erts/autoconf/vxworks/sed.vxworks_sparc
+++ b/erts/autoconf/vxworks/sed.vxworks_sparc
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/configure.in b/erts/configure.in
index cae3843465..11c428ced7 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. -*-m4-*-
dnl %CopyrightBegin%
dnl
-dnl Copyright Ericsson AB 1997-2015. All Rights Reserved.
+dnl Copyright Ericsson AB 1997-2016. All Rights Reserved.
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
@@ -215,24 +215,6 @@ AS_HELP_STRING([--enable-fp-exceptions],
esac
],enable_fp_exceptions=auto)
-AC_ARG_ENABLE(darwin-universal,
-AS_HELP_STRING([--enable-darwin-universal],
- [build universal binaries on darwin i386]),
-[ case "$enableval" in
- no) enable_darwin_universal=no ;;
- *) enable_darwin_univeral=yes ;;
- esac
-],enable_darwin_universal=no)
-
-
-AC_ARG_ENABLE(darwin-64bit,
-AS_HELP_STRING([--enable-darwin-64bit], [build 64bit binaries on darwin]),
-[ case "$enableval" in
- no) enable_darwin_64bit=no ;;
- *) enable_darwin_64bit=yes ;;
- esac
-],enable_darwin_64bit=no)
-
AC_ARG_ENABLE(m64-build,
AS_HELP_STRING([--enable-m64-build],
[build 64bit binaries using the -m64 flag to (g)cc]),
@@ -247,18 +229,13 @@ AS_HELP_STRING([--enable-m32-build],
[build 32bit binaries using the -m32 flag to (g)cc]),
[ case "$enableval" in
no) enable_m32_build=no ;;
- *)
- if test X${enable_darwin_64bit} = Xyes -o X${enable_m64_build} = Xyes;
- then
- AC_MSG_ERROR([(--enable-darwin-64bit or --enable-m64-build) and --enable-m32-build are mutually exclusive]) ;
- fi ;
- enable_m32_build=yes ;;
+ *) enable_m32_build=yes ;;
esac
],enable_m32_build=no)
AC_ARG_WITH(dynamic-trace,
-AS_HELP_STRING([--with-dynamic-trace={dtrace|systemtap}],
- [specify use of dynamic trace framework, dtrace or systemtap])
+AS_HELP_STRING([--with-dynamic-trace={dtrace|lttng|systemtap}],
+ [specify use of dynamic trace framework, dtrace, lttng or systemtap])
AS_HELP_STRING([--without-dynamic-trace],
[don't enable any dynamic tracing (default)]))
@@ -268,6 +245,10 @@ fi
case "$with_dynamic_trace" in
no) DYNAMIC_TRACE_FRAMEWORK=;;
+ lttng)
+ AC_DEFINE(USE_LTTNG,[1],
+ [Define if you want to use lttng for dynamic tracing])
+ DYNAMIC_TRACE_FRAMEWORK=lttng;;
dtrace)
AC_DEFINE(USE_DTRACE,[1],
[Define if you want to use dtrace for dynamic tracing])
@@ -303,10 +284,12 @@ AS_HELP_STRING([--enable-vm-probes],
fi)
AC_SUBST(USE_VM_PROBES)
-if test X"$use_vm_probes" = X"yes"; then
- USE_VM_PROBES=yes
- AC_DEFINE(USE_VM_PROBES,[1],
- [Define to enable VM dynamic trace probes])
+if test X"$DYNAMIC_TRACE_FRAMEWORK" != X"lttng"; then
+ if test X"$use_vm_probes" = X"yes"; then
+ USE_VM_PROBES=yes
+ AC_DEFINE(USE_VM_PROBES,[1],
+ [Define to enable VM dynamic trace probes])
+ fi
fi
AC_ARG_WITH(assumed-cache-line-size,
@@ -377,42 +360,7 @@ AC_MSG_CHECKING([OTP version])
AC_MSG_RESULT([$OTP_VERSION])
AC_SUBST(OTP_VERSION)
-dnl OK, we might have darwin switches off different kinds, lets
-dnl check it all before continuing.
-TMPSYS=`uname -s`-`uname -m`
-if test X${enable_darwin_universal} = Xyes; then
- if test X${enable_darwin_64bit} = Xyes; then
- AC_MSG_ERROR([--enable-darwin-universal and --enable-darwin-64bit mutually exclusive])
- fi
- enable_hipe=no
- case $CFLAGS in
- *-arch\ ppc*)
- ;;
- *)
- CFLAGS="-arch ppc $CFLAGS"
- ;;
- esac
- case $CFLAGS in
- *-arch\ i386*)
- ;;
- *)
- CFLAGS="-arch i386 $CFLAGS"
- ;;
- esac
-fi
-if test X${enable_darwin_64bit} = Xyes; then
- case "$TMPSYS" in
- Darwin-i386|Darwin-x86_64)
- ;;
- Darwin*)
- AC_MSG_ERROR([--enable-darwin-64bit only supported on x86 hosts])
- ;;
- *)
- AC_MSG_ERROR([--enable-darwin-64bit only supported on Darwin])
- ;;
- esac
-fi
-if test X${enable_darwin_64bit} = Xyes -o X${enable_m64_build} = Xyes; then
+if test X${enable_m64_build} = Xyes; then
case $CFLAGS in
*-m64*)
;;
@@ -735,32 +683,13 @@ case $ARCH-$OPSYS in
esac
;;
*-darwin*)
- if test X${enable_darwin_universal} = Xyes; then
- AC_MSG_NOTICE([Adjusting LDFLAGS for universal binaries])
-
- case $LDFLAGS in
- *-arch\ ppc*)
- ;;
- *)
- LDFLAGS="-arch ppc $LDFLAGS"
- ;;
- esac
- case $LDFLAGS in
- *-arch\ i386*)
- ;;
- *)
- LDFLAGS="-arch i386 $LDFLAGS"
- ;;
- esac
- else
- case $LDFLAGS in
- *-m32*)
- ;;
- *)
- LDFLAGS="-m32 $LDFLAGS"
- ;;
- esac
- fi
+ case $LDFLAGS in
+ *-m32*)
+ ;;
+ *)
+ LDFLAGS="-m32 $LDFLAGS"
+ ;;
+ esac
;;
*)
if test X${enable_m64_build} = Xyes; then
@@ -1623,7 +1552,7 @@ AC_CHECK_HEADERS(fcntl.h limits.h unistd.h syslog.h dlfcn.h ieeefp.h \
sys/ioctl.h sys/time.h sys/uio.h \
sys/socket.h sys/sockio.h sys/socketio.h \
net/errno.h malloc.h arpa/nameser.h libdlpi.h \
- pty.h util.h utmp.h langinfo.h poll.h sdkddkver.h)
+ pty.h util.h libutil.h utmp.h langinfo.h poll.h sdkddkver.h)
AC_CHECK_MEMBERS([struct ifreq.ifr_hwaddr], [], [],
[#ifdef __WIN32__
@@ -3422,6 +3351,13 @@ if test X${enable_hipe} = Xyes; then
AC_DEFINE(HIPE,[1],[Define to enable HiPE])
HIPE_HELPERS="xmerl syntax_tools edoc"
ENABLE_ALLOC_TYPE_VARS="$ENABLE_ALLOC_TYPE_VARS hipe"
+ case "$ARCH" in
+ amd64)
+ # For now exec_alloc is only used for hipe on amd64
+ AC_MSG_NOTICE([Enable exec_alloc for hipe code allocation])
+ ENABLE_ALLOC_TYPE_VARS="$ENABLE_ALLOC_TYPE_VARS exec_alloc"
+ ;;
+ esac
fi
fi
AC_SUBST(HIPE_HELPERS)
@@ -3747,14 +3683,8 @@ case $host_os in
DED_LDFLAGS="-m64 $DED_LDFLAGS"
;;
*)
- if test X${enable_darwin_universal} != Xyes; then
- DED_LDFLAGS="-m32 $DED_LDFLAGS"
- fi
;;
esac
- if test X${enable_darwin_universal} = Xyes; then
- DED_LDFLAGS="-arch ppc -arch i386 $DED_LDFLAGS"
- fi
DED_LD="$CC"
DED_LD_FLAG_RUNTIME_LIBRARY_PATH="$CFLAG_RUNTIME_LIBRARY_PATH"
;;
@@ -3839,14 +3769,20 @@ dnl
LM_FIND_EMU_CC
dnl
-dnl DTrace
+dnl DTrace & LTTNG
dnl
case $DYNAMIC_TRACE_FRAMEWORK in
dtrace|systemtap)
AC_CHECK_TOOL(DTRACE, dtrace, none)
test "$DTRACE" = "none" && AC_MSG_ERROR([No dtrace utility found.]);
+ enable_lttng_test=no
enable_dtrace_test=yes;;
- *) enable_dtrace_test=no;;
+ lttng)
+ enable_lttng_test=yes
+ enable_dtrace_test=no;;
+ *)
+ enable_lttng_test=no
+ enable_dtrace_test=no;;
esac
AC_SUBST(DTRACE)
@@ -3913,6 +3849,37 @@ if test "$enable_dtrace_test" = "yes" ; then
fi
fi
+if test "$enable_lttng_test" = "yes" ; then
+ AC_CHECK_HEADERS(lttng/tracepoint.h)
+ AC_CHECK_HEADERS(lttng/tracepoint-event.h)
+ dnl The macro tracepoint_enabled is not present in older lttng versions
+ dnl checking for tracepoint_enabled
+ AC_MSG_CHECKING([for tracepoint_enabled in lttng/tracepoint.h])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [#include <lttng/tracepoint.h>
+ #define TRACEPOINT_PROVIDER com_ericsson_otp
+ TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ dummy,
+ TP_ARGS(int, my_int),
+ TP_FIELDS(ctf_integer(int, my_int, my_int)))
+ #define TRACEPOINT_CREATE_PROBES
+ #define TRACEPOINT_DEFINE],
+ [if(tracepoint_enabled(com_ericsson_otp,dummy)) do {} while(0)])],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_ERROR([no (must be present)])])
+ if test "x$ac_cv_header_lttng_tracepoint_h" = "xyes" \
+ -a "x$ac_cv_header_lttng_tracepoint_event_h" = "xyes"; then
+ # No straight forward way to test for liblttng-ust when no public symbol exists,
+ # just add the lib.
+ LIBS="$LIBS -llttng-ust -ldl"
+ else
+ AC_MSG_ERROR([No LTTng support found.])
+ fi
+fi
+
+
dnl
dnl SSL, SSH and CRYPTO need the OpenSSL libraries
dnl
diff --git a/erts/doc/Makefile b/erts/doc/Makefile
index d415e544f3..f26a43592e 100644
--- a/erts/doc/Makefile
+++ b/erts/doc/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/doc/src/Makefile b/erts/doc/src/Makefile
index 83f4c58560..b96cbbce40 100644
--- a/erts/doc/src/Makefile
+++ b/erts/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -50,12 +50,14 @@ XML_REF1_FILES = epmd.xml \
XML_REF3_EFILES = \
erl_prim_loader.xml \
erlang.xml \
+ erl_tracer.xml \
init.xml \
zlib.xml
XML_REF3_FILES = \
driver_entry.xml \
erl_nif.xml \
+ erl_tracer.xml \
erl_driver.xml \
erl_prim_loader.xml \
erlang.xml \
@@ -154,18 +156,9 @@ clean:
rm -f $(SPECDIR)/*
rm -f errs core *~
-$(SPECDIR)/specs_driver_entry.xml:
+$(SPECDIR)/specs_%.xml:
escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \
- -o$(dir $@) -module driver_entry
-$(SPECDIR)/specs_erl_nif.xml:
- escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \
- -o$(dir $@) -module erl_nif
-$(SPECDIR)/specs_erl_driver.xml:
- escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \
- -o$(dir $@) -module erl_driver
-$(SPECDIR)/specs_erts_alloc.xml:
- escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \
- -o$(dir $@) -module erts_alloc
+ -o$(dir $@) -module $(patsubst $(SPECDIR)/specs_%.xml,%,$@)
# ----------------------------------------------------
# Release Target
diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml
index 13756ddfdc..bfabb7f042 100644
--- a/erts/doc/src/absform.xml
+++ b/erts/doc/src/absform.xml
@@ -68,22 +68,12 @@
<item>If D is a module declaration consisting of the forms
<c>F_1</c>, ..., <c>F_k</c>, then
Rep(D) = <c>[Rep(F_1), ..., Rep(F_k)]</c>.</item>
- <item>If F is an attribute <c>-behavior(Behavior)</c>, then
- Rep(F) = <c>{attribute,LINE,behavior,Behavior}</c>.</item>
- <item>If F is an attribute <c>-behaviour(Behaviour)</c>, then
- Rep(F) = <c>{attribute,LINE,behaviour,Behaviour}</c>.</item>
- <item>If F is an attribute <c>-compile(Options)</c>, then
- Rep(F) = <c>{attribute,LINE,compile,Options}</c>.</item>
<item>If F is an attribute <c>-export([Fun_1/A_1, ..., Fun_k/A_k])</c>, then
Rep(F) = <c>{attribute,LINE,export,[{Fun_1,A_1}, ..., {Fun_k,A_k}]}</c>.</item>
- <item>If F is an attribute <c>-export_type([Type_1/A_1, ..., Type_k/A_k])</c>, then
- Rep(F) = <c>{attribute,LINE,export_type,[{Type_1,A_1}, ..., {Type_k,A_k}]}</c>.</item>
<item>If F is an attribute <c>-import(Mod,[Fun_1/A_1, ..., Fun_k/A_k])</c>, then
Rep(F) = <c>{attribute,LINE,import,{Mod,[{Fun_1,A_1}, ..., {Fun_k,A_k}]}}</c>.</item>
<item>If F is an attribute <c>-module(Mod)</c>, then
Rep(F) = <c>{attribute,LINE,module,Mod}</c>.</item>
- <item>If F is an attribute <c>-optional_callbacks([Fun_1/A_1, ..., Fun_k/A_k])</c>, then
- Rep(F) = <c>{attribute,LINE,optional_callbacks,[{Fun_1,A_1}, ..., {Fun_k,A_k}]}</c>.</item>
<item>If F is an attribute <c>-file(File,Line)</c>, then
Rep(F) = <c>{attribute,LINE,file,{File,Line}}</c>.</item>
<item>If F is a function declaration
@@ -636,6 +626,9 @@
<item>If A is an association type <c>K => V</c>, where
<c>K</c> and <c>V</c> are types, then Rep(A) =
<c>{type,LINE,map_field_assoc,[Rep(K),Rep(V)]}</c>.</item>
+ <item>If A is an association type <c>K := V</c>, where
+ <c>K</c> and <c>V</c> are types, then Rep(A) =
+ <c>{type,LINE,map_field_exact,[Rep(K),Rep(V)]}</c>.</item>
</list>
</section>
diff --git a/erts/doc/src/alt_dist.xml b/erts/doc/src/alt_dist.xml
index 2263302707..e283acc1b4 100644
--- a/erts/doc/src/alt_dist.xml
+++ b/erts/doc/src/alt_dist.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/book.xml b/erts/doc/src/book.xml
index 12eda03ee5..a0780c91d9 100644
--- a/erts/doc/src/book.xml
+++ b/erts/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/communication.xml b/erts/doc/src/communication.xml
index 3deea3e4af..1eb05310e9 100644
--- a/erts/doc/src/communication.xml
+++ b/erts/doc/src/communication.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2012</year><year>2013</year>
+ <year>2012</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/crash_dump.xml b/erts/doc/src/crash_dump.xml
index 61c9159823..0b827ae583 100644
--- a/erts/doc/src/crash_dump.xml
+++ b/erts/doc/src/crash_dump.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/driver.xml b/erts/doc/src/driver.xml
index a68e87d3b3..4bef5e1388 100644
--- a/erts/doc/src/driver.xml
+++ b/erts/doc/src/driver.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/epmd.xml b/erts/doc/src/epmd.xml
index 7f61804bea..d9f580d081 100644
--- a/erts/doc/src/epmd.xml
+++ b/erts/doc/src/epmd.xml
@@ -4,7 +4,7 @@
<comref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml
index 096af096dc..c499fc8081 100644
--- a/erts/doc/src/erl.xml
+++ b/erts/doc/src/erl.xml
@@ -4,7 +4,7 @@
<comref>
<header>
<copyright>
- <year>1996</year><year>2015</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -632,6 +632,15 @@
<p>Sets the initial process dictionary size of processes to the size
<c><![CDATA[Size]]></c>.</p>
</item>
+ <tag><marker id="+hmqd"><c>+hmqd off_heap|on_heap|mixed</c></marker></tag>
+ <item><p>
+ Sets the default value for the process flag
+ <c>message_queue_data</c>. If <c>+hmqd</c> is not
+ passed, <c>mixed</c> will be the default. For more information,
+ see the documentation of
+ <seealso marker="erlang#process_flag_message_queue_data"><c>process_flag(message_queue_data,
+ MQD)</c></seealso>.
+ </p></item>
<tag><c><![CDATA[+K true | false]]></c></tag>
<item>
<p>Enables or disables the kernel poll functionality if
@@ -1361,21 +1370,6 @@
<seealso marker="kernel:error_logger#warning_map/0">error_logger(3)</seealso>
for further information.</p>
</item>
- <tag><c><![CDATA[+xFlag Value]]></c></tag>
- <item>
- <p>Default process flag settings.</p>
- <taglist>
- <tag><marker id="+xmqd"><c>+xmqd off_heap|on_heap|mixed</c></marker></tag>
- <item><p>
- Sets the default value for the process flag
- <c>message_queue_data</c>. If <c>+xmqd</c> is not
- passed, <c>mixed</c> will be the default. For more information,
- see the documentation of
- <seealso marker="erlang#process_flag_message_queue_data"><c>process_flag(message_queue_data,
- MQD)</c></seealso>.
- </p></item>
- </taglist>
- </item>
<tag><c><![CDATA[+zFlag Value]]></c></tag>
<item>
<p>Miscellaneous flags.</p>
diff --git a/erts/doc/src/erl_dist_protocol.xml b/erts/doc/src/erl_dist_protocol.xml
index b435d5c9b4..f9fa981d9a 100644
--- a/erts/doc/src/erl_dist_protocol.xml
+++ b/erts/doc/src/erl_dist_protocol.xml
@@ -364,14 +364,14 @@ If Result > 0, the packet only consists of [119, Result].
NodeInfo is, as expressed in Erlang:
</p>
<code>
- io:format("active name ~ts at port ~p, fd = ~p ~n",
+ io:format("active name ~ts at port ~p, fd = ~p~n",
[NodeName, Port, Fd]).
</code>
<p>
or
</p>
<code>
- io:format("old/unused name ~ts at port ~p, fd = ~p~n",
+ io:format("old/unused name ~ts at port ~p, fd = ~p ~n",
[NodeName, Port, Fd]).
</code>
diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml
index 241d4131d5..175b7f6bfb 100644
--- a/erts/doc/src/erl_driver.xml
+++ b/erts/doc/src/erl_driver.xml
@@ -4,7 +4,7 @@
<cref>
<header>
<copyright>
- <year>2001</year><year>2015</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml
index be0e406b9c..7546f7ef81 100644
--- a/erts/doc/src/erl_nif.xml
+++ b/erts/doc/src/erl_nif.xml
@@ -4,7 +4,7 @@
<cref>
<header>
<copyright>
- <year>2001</year><year>2015</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -524,6 +524,18 @@ typedef struct {
<p>Note that <c>ErlNifBinary</c> is a semi-opaque type and you are
only allowed to read fields <c>size</c> and <c>data</c>.</p>
</item>
+
+ <tag><marker id="ErlNifBinaryToTerm"/>ErlNifBinaryToTerm</tag>
+ <item>
+ <p>An enumeration of the options that can be given to
+ <seealso marker="#enif_binary_to_term">enif_binary_to_term</seealso>.
+ For default behavior, use the value <c>0</c>.</p>
+ <taglist>
+ <tag><c>ERL_NIF_BIN2TERM_SAFE</c></tag>
+ <item><p>Use this option when receiving data from untrusted sources.</p></item>
+ </taglist>
+ </item>
+
<tag><marker id="ErlNifPid"/>ErlNifPid</tag>
<item>
<p><c>ErlNifPid</c> is a process identifier (pid). In contrast to
@@ -532,6 +544,14 @@ typedef struct {
<seealso marker="#ErlNifEnv">environment</seealso>. <c>ErlNifPid</c>
is an opaque type.</p>
</item>
+ <tag><marker id="ErlNifPort"/>ErlNifPort</tag>
+ <item>
+ <p><c>ErlNifPort</c> is a port identifier. In contrast to
+ port id terms (instances of <c>ERL_NIF_TERM</c>), <c>ErlNifPort</c>'s are self
+ contained and not bound to any
+ <seealso marker="#ErlNifEnv">environment</seealso>. <c>ErlNifPort</c>
+ is an opaque type.</p>
+ </item>
<tag><marker id="ErlNifResourceType"/>ErlNifResourceType</tag>
<item>
@@ -546,8 +566,7 @@ typedef struct {
<code type="none">
typedef void ErlNifResourceDtor(ErlNifEnv* env, void* obj);
</code>
- <p>The function prototype of a resource destructor function.
- A destructor function is not allowed to call any term-making functions.</p>
+ <p>The function prototype of a resource destructor function.</p>
</item>
<tag><marker id="ErlNifCharEncoding"/>ErlNifCharEncoding</tag>
<item>
@@ -591,6 +610,21 @@ typedef enum {
</taglist>
</item>
+ <tag><marker id="ErlNifUniqueInteger"/>ErlNifUniqueInteger</tag>
+ <item>
+ <p>An enumeration of the properties that can be requested from
+ <seealso marker="#enif_make_unique_integer">enif_unique_integer</seealso>.
+ For default properties, use the value <c>0</c>.</p>
+ <taglist>
+ <tag><c>ERL_NIF_UNIQUE_POSITIVE</c></tag>
+ <item><p>Return only positive integers</p></item>
+ <tag><c>ERL_NIF_UNIQUE_MONOTONIC</c></tag>
+ <item><p>Return only
+ <seealso marker="time_correction#Strictly_Monotonically_Increasing">strictly
+ monotonically increasing</seealso> integer corresponding to creation time</p></item>
+ </taglist>
+ </item>
+
</taglist>
</section>
@@ -632,6 +666,25 @@ typedef enum {
have been allocated with <seealso marker="#enif_alloc_env">enif_alloc_env</seealso>.
</p></desc>
</func>
+ <func><name><ret>size_t</ret><nametext>enif_binary_to_term(ErlNifEnv *env, const unsigned char* data, size_t size, ERL_NIF_TERM *term, ErlNifBinaryToTerm opts)</nametext></name>
+ <fsummary>Create a term from the external format</fsummary>
+ <desc>
+ <p>Create a term that is the result of decoding the binary data
+ at <c>data</c>, which must be encoded according to the Erlang external term format.
+ No more than <c>size</c> bytes are read from <c>data</c>. Argument <c>opts</c>
+ correspond to the second argument to <seealso marker="erlang#binary_to_term-2">
+ <c>erlang:binary_to_term/2</c></seealso>, and must be either <c>0</c> or
+ <c>ERL_NIF_BIN2TERM_SAFE</c>.</p>
+ <p>On success, store the resulting term at <c>*term</c> and return
+ the actual number of bytes read. Return zero if decoding fails or if <c>opts</c>
+ is invalid.</p>
+ <p>See also:
+ <seealso marker="#ErlNifBinaryToTerm"><c>ErlNifBinaryToTerm</c></seealso>,
+ <seealso marker="erlang#binary_to_term-2"><c>erlang:binary_to_term/2</c></seealso> and
+ <seealso marker="#enif_term_to_binary"><c>enif_term_to_binary</c></seealso>.
+ </p>
+ </desc>
+ </func>
<func><name><ret>int</ret><nametext>enif_compare(ERL_NIF_TERM lhs, ERL_NIF_TERM rhs)</nametext></name>
<fsummary>Compare two terms</fsummary>
<desc><p>Return an integer less than, equal to, or greater than
@@ -689,7 +742,48 @@ typedef enum {
a number of repeated NIF-calls without the need to create threads.
See also the <seealso marker="#WARNING">warning</seealso> text at the beginning of this document.</p>
</desc>
+
</func>
+
+ <func>
+ <name><ret>ErlNifTime</ret><nametext>enif_convert_time_unit(ErlNifTime val, ErlNifTimeUnit from, ErlNifTimeUnit to)</nametext></name>
+ <fsummary>Convert time unit of a time value</fsummary>
+ <desc>
+ <marker id="enif_convert_time_unit"></marker>
+ <p>Arguments:</p>
+ <taglist>
+ <tag><c>val</c></tag>
+ <item>Value to convert time unit for.</item>
+ <tag><c>from</c></tag>
+ <item>Time unit of <c>val</c>.</item>
+ <tag><c>to</c></tag>
+ <item>Time unit of returned value.</item>
+ </taglist>
+ <p>Converts the <c>val</c> value of time unit <c>from</c> to
+ the corresponding value of time unit <c>to</c>. The result is
+ rounded using the floor function.</p>
+ <p>Returns <c>ERL_NIF_TIME_ERROR</c> if called with an invalid
+ time unit argument.</p>
+ <p>See also:
+ <seealso marker="#ErlNifTime"><c>ErlNifTime</c></seealso> and
+ <seealso marker="#ErlNifTimeUnit"><c>ErlNifTimeUnit</c></seealso>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name><ret>ERL_NIF_TERM</ret><nametext>enif_cpu_time(ErlNifEnv *)</nametext></name>
+ <fsummary></fsummary>
+ <desc>
+ <p>Returns the CPU time in the same format as <seealso marker="erlang#timestamp-0">erlang:timestamp()</seealso>.
+ The CPU time is the time the current logical cpu has spent executing since
+ some arbitrary point in the past.
+ If the OS does not support fetching of this value <c>enif_cpu_time</c>
+ invokes <seealso marker="#enif_make_badarg">enif_make_badarg</seealso>.
+ </p>
+ </desc>
+ </func>
+
<func><name><ret>int</ret><nametext>enif_equal_tids(ErlNifTid tid1, ErlNifTid tid2)</nametext></name>
<fsummary></fsummary>
<desc><p>Same as <seealso marker="erl_driver#erl_drv_equal_tids">erl_drv_equal_tids</seealso>.
@@ -744,6 +838,12 @@ typedef enum {
pid variable <c>*pid</c> from it and return true. Otherwise return false.
No check if the process is alive is done.</p></desc>
</func>
+ <func><name><ret>int</ret><nametext>enif_get_local_port(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifPort* port_id)</nametext></name>
+ <fsummary>Read an local port term</fsummary>
+ <desc><p>If <c>term</c> identifies a node local port, initialize the
+ port variable <c>*port_id</c> from it and return true. Otherwise return false.
+ No check if the port is alive is done.</p></desc>
+ </func>
<func><name><ret>int</ret><nametext>enif_get_list_cell(ErlNifEnv* env, ERL_NIF_TERM list, ERL_NIF_TERM* head, ERL_NIF_TERM* tail)</nametext></name>
<fsummary>Get head and tail from a list</fsummary>
<desc><p>Set <c>*head</c> and <c>*tail</c> from
@@ -912,6 +1012,17 @@ typedef enum {
<fsummary>Determine if a term is a port</fsummary>
<desc><p>Return true if <c>term</c> is a port.</p></desc>
</func>
+ <func><name><ret>int</ret><nametext>enif_is_port_alive(ErlNifEnv* env, ErlNifPort *port_id)</nametext></name>
+ <fsummary>Determine if a local port is alive or not.</fsummary>
+ <desc><p>Return true if <c>port_id</c> is currently alive.</p>
+ <p>This function can only be used in a from a NIF-calling thread.</p></desc>
+ </func>
+ <func><name><ret>int</ret><nametext>enif_is_process_alive(ErlNifEnv* env, ErlNifPid *pid)</nametext></name>
+ <fsummary>Determine if a local process is alive or not.</fsummary>
+ <desc><p>Return true if <c>pid</c> is currently alive.</p>
+ <p>This function is only thread-safe when the emulator with SMP support is used.
+ It can only be used in a non-SMP emulator from a NIF-calling thread.</p></desc>
+ </func>
<func><name><ret>int</ret><nametext>enif_is_ref(ErlNifEnv* env, ERL_NIF_TERM term)</nametext></name>
<fsummary>Determine if a term is a reference</fsummary>
<desc><p>Return true if <c>term</c> is a reference.</p></desc>
@@ -961,7 +1072,7 @@ typedef enum {
<seealso marker="#enif_is_exception">enif_is_exception</seealso>, but
not to any other NIF API function.</p>
<p>See also: <seealso marker="#enif_has_pending_exception">enif_has_pending_exception</seealso>
- and <seealso marker="#enif_raise_exception">enif_raise_exception</seealso>
+ and <seealso marker="#enif_raise_exception">enif_raise_exception</seealso>.
</p>
<note><p>In earlier versions (older than erts-7.0, OTP 18) the return value
from <c>enif_make_badarg</c> had to be returned from the NIF. This
@@ -1195,6 +1306,23 @@ typedef enum {
<fsummary>Create an unsigned integer term</fsummary>
<desc><p>Create an integer term from an unsigned 64-bit integer.</p></desc>
</func>
+ <func>
+ <name><ret>ERL_NIF_TERM</ret><nametext>enif_make_unique_integer(ErlNifEnv *env, ErlNifUniqueInteger properties)</nametext></name>
+ <fsummary></fsummary>
+ <desc>
+ <p>Returns a unique integer with the same properties as given by <seealso marker="erlang#unique_integer-1">erlang:unique_integer/1</seealso>.</p>
+ <p><c>env</c> is the environment to create the integer in.</p>
+ <p>
+ <c>ERL_NIF_UNIQUE_POSITIVE</c> and <c>ERL_NIF_UNIQUE_MONOTONIC</c> can
+ be passed as the second argument to change the properties of the
+ integer returned. It is possible to combine them by or:ing the
+ two values together.
+ </p>
+ <p>See also:
+ <seealso marker="#ErlNifUniqueInteger"><c>ErlNifUniqueInteger</c></seealso>.
+ </p>
+ </desc>
+ </func>
<func><name><ret>ERL_NIF_TERM</ret><nametext>enif_make_ulong(ErlNifEnv* env, unsigned long i)</nametext></name>
<fsummary>Create an integer term from an unsigned long int</fsummary>
<desc><p>Create an integer term from an <c>unsigned long int</c>.</p></desc>
@@ -1265,6 +1393,33 @@ enif_map_iterator_destroy(env, &amp;iter);
or false if the iterator is positioned at the head (before the first
entry).</p></desc>
</func>
+
+ <func>
+ <name><ret>ErlNifTime</ret><nametext>enif_monotonic_time(ErlNifTimeUnit time_unit)</nametext></name>
+ <fsummary>Get Erlang Monotonic Time</fsummary>
+ <desc>
+ <marker id="enif_monotonic_time"></marker>
+ <p>Arguments:</p>
+ <taglist>
+ <tag><c>time_unit</c></tag>
+ <item>Time unit of returned value.</item>
+ </taglist>
+ <p>
+ Returns the current
+ <seealso marker="time_correction#Erlang_Monotonic_Time">Erlang
+ monotonic time</seealso>. Note that it is not uncommon with
+ negative values.
+ </p>
+ <p>Returns <c>ERL_NIF_TIME_ERROR</c> if called with an invalid
+ time unit argument, or if called from a thread that is not a
+ scheduler thread.</p>
+ <p>See also:
+ <seealso marker="#ErlNifTime"><c>ErlNifTime</c></seealso> and
+ <seealso marker="#ErlNifTimeUnit"><c>ErlNifTimeUnit</c></seealso>.
+ </p>
+ </desc>
+ </func>
+
<func><name><ret>ErlNifMutex *</ret><nametext>enif_mutex_create(char *name)</nametext></name>
<fsummary></fsummary>
<desc><p>Same as <seealso marker="erl_driver#erl_drv_mutex_create">erl_drv_mutex_create</seealso>.
@@ -1290,6 +1445,11 @@ enif_map_iterator_destroy(env, &amp;iter);
<desc><p>Same as <seealso marker="erl_driver#erl_drv_mutex_unlock">erl_drv_mutex_unlock</seealso>.
</p></desc>
</func>
+ <func><name><ret>ERL_NIF_TERM</ret><nametext>enif_now_time(ErlNifEnv *env)</nametext></name>
+ <fsummary></fsummary>
+ <desc><p>Retuns an <seealso marker="erlang#now-0">erlang:now()</seealso> timestamp.
+ The enif_now_time function is <em>deprecated</em>.</p></desc>
+ </func>
<func><name><ret>ErlNifResourceType *</ret><nametext>enif_open_resource_type(ErlNifEnv* env,
const char* module_str, const char* name,
ErlNifResourceDtor* dtor, ErlNifResourceFlags flags, ErlNifResourceFlags* tried)</nametext></name>
@@ -1319,6 +1479,35 @@ enif_map_iterator_destroy(env, &amp;iter);
and <seealso marker="#upgrade">upgrade</seealso>.</p>
</desc>
</func>
+ <func><name><ret>int</ret><nametext>enif_port_command(ErlNifEnv* env, const ErlNifPort* to_port, ErlNifEnv *msg_env, ERL_NIF_TERM msg)</nametext></name>
+ <fsummary>Send a port_command to to_port</fsummary>
+ <desc>
+ <p>This function works the same as <seealso marker="erlang#port_command-2">erlang:port_command/2</seealso>
+ except that it is always completely asynchronous. This call may return false
+ if it detects that the port is already dead, otherwise it will return true.
+ </p>
+ <taglist>
+ <tag><c>env</c></tag>
+ <item>The environment of the calling process. May not be NULL.</item>
+ <tag><c>*to_port</c></tag>
+ <item>The port id of the receiving port. The port id should refer to a
+ port on the local node.</item>
+ <tag><c>msg_env</c></tag>
+ <item>The environment of the message term. Can be a process
+ independent environment allocated with
+ <seealso marker="#enif_alloc_env">enif_alloc_env</seealso> or NULL.</item>
+ <tag><c>msg</c></tag>
+ <item>The message term to send. The same limitations apply as on the
+ payload to <seealso marker="erlang#port_command-2">erlang:port_command/2</seealso>.</item>
+ </taglist>
+ <p>Using a <c>msg_env</c> of NULL is an optimization which groups together
+ calls to <c>enif_alloc_env</c>, <c>enif_make_copy</c>, <c>enif_port_command</c>
+ and <c>enif_free_env</c> into one call. This optimization is only usefull
+ when a majority of the terms are to be copied from <c>env</c> to the <c>msg_env</c>.</p>
+ <p>The call may return false if it detects that the command failed for some reason. Otherwise true is returned.</p>
+ <p>See also: <seealso marker="#enif_get_local_port"><c>enif_get_local_port</c></seealso>.</p>
+ </desc>
+ </func>
<func><name><ret>void *</ret><nametext>enif_priv_data(ErlNifEnv* env)</nametext></name>
<fsummary>Get the private data of a NIF library</fsummary>
<desc><p>Return the pointer to the private data that was set by <c>load</c>,
@@ -1442,7 +1631,7 @@ enif_map_iterator_destroy(env, &amp;iter);
<tag><c>msg_env</c></tag>
<item>The environment of the message term. Must be a process
independent environment allocated with
- <seealso marker="#enif_alloc_env">enif_alloc_env</seealso>.</item>
+ <seealso marker="#enif_alloc_env">enif_alloc_env</seealso> or NULL.</item>
<tag><c>msg</c></tag>
<item>The message term to send.</item>
</taglist>
@@ -1451,8 +1640,12 @@ enif_map_iterator_destroy(env, &amp;iter);
<c>msg</c>) will be invalidated by a successful call to <c>enif_send</c>. The environment
should either be freed with <seealso marker="#enif_free_env">enif_free_env</seealso>
of cleared for reuse with <seealso marker="#enif_clear_env">enif_clear_env</seealso>.</p>
+ <p>If <c>msg_env</c> is set to NULL the <c>msg</c> term is copied and
+ the original term and its environemt is still valid after the call.</p>
<p>This function is only thread-safe when the emulator with SMP support is used.
It can only be used in a non-SMP emulator from a NIF-calling thread.</p>
+ <note><p>Passing <c>msg_env</c> as <c>NULL</c> is only supported since
+ erts-8.0 (OTP 19).</p></note>
</desc>
</func>
<func><name><ret>unsigned</ret><nametext>enif_sizeof_resource(void* obj)</nametext></name>
@@ -1466,6 +1659,18 @@ enif_map_iterator_destroy(env, &amp;iter);
<desc><p>Same as <seealso marker="erl_driver#driver_system_info">driver_system_info</seealso>.
</p></desc>
</func>
+ <func><name><ret>int</ret><nametext>enif_term_to_binary(ErlNifEnv *env, ERL_NIF_TERM term, ErlNifBinary *bin)</nametext></name>
+ <fsummary>Convert a term to the external format</fsummary>
+ <desc>
+ <p>Allocates a new binary with <seealso marker="#enif_alloc_binary">enif_alloc_binary</seealso>
+ and stores the result of encoding <c>term</c> according to the Erlang external term format.</p>
+ <p>Returns true on success or false if allocation failed.</p>
+ <p>See also:
+ <seealso marker="erlang#term_to_binary-1"><c>erlang:term_to_binary/1</c></seealso> and
+ <seealso marker="#enif_binary_to_term"><c>enif_binary_to_term</c></seealso>.
+ </p>
+ </desc>
+ </func>
<func><name><ret>int</ret><nametext>enif_thread_create(char *name,ErlNifTid *tid,void * (*func)(void *),void *args,ErlNifThreadOpts *opts)</nametext></name>
<fsummary></fsummary>
<desc><p>Same as <seealso marker="erl_driver#erl_drv_thread_create">erl_drv_thread_create</seealso>.
@@ -1496,54 +1701,6 @@ enif_map_iterator_destroy(env, &amp;iter);
<desc><p>Same as <seealso marker="erl_driver#erl_drv_thread_self">erl_drv_thread_self</seealso>.
</p></desc>
</func>
- <func><name><ret>int</ret><nametext>enif_tsd_key_create(char *name, ErlNifTSDKey *key)</nametext></name>
- <fsummary></fsummary>
- <desc><p>Same as <seealso marker="erl_driver#erl_drv_tsd_key_create">erl_drv_tsd_key_create</seealso>.
- </p></desc>
- </func>
- <func><name><ret>void</ret><nametext>enif_tsd_key_destroy(ErlNifTSDKey key)</nametext></name>
- <fsummary></fsummary>
- <desc><p>Same as <seealso marker="erl_driver#erl_drv_tsd_key_destroy">erl_drv_tsd_key_destroy</seealso>.
- </p></desc>
- </func>
- <func><name><ret>void *</ret><nametext>enif_tsd_get(ErlNifTSDKey key)</nametext></name>
- <fsummary></fsummary>
- <desc><p>Same as <seealso marker="erl_driver#erl_drv_tsd_get">erl_drv_tsd_get</seealso>.
- </p></desc>
- </func>
- <func><name><ret>void</ret><nametext>enif_tsd_set(ErlNifTSDKey key, void *data)</nametext></name>
- <fsummary></fsummary>
- <desc><p>Same as <seealso marker="erl_driver#erl_drv_tsd_set">erl_drv_tsd_set</seealso>.
- </p></desc>
- </func>
-
-
- <func>
- <name><ret>ErlNifTime</ret><nametext>enif_monotonic_time(ErlNifTimeUnit time_unit)</nametext></name>
- <fsummary>Get Erlang Monotonic Time</fsummary>
- <desc>
- <marker id="enif_monotonic_time"></marker>
- <p>Arguments:</p>
- <taglist>
- <tag><c>time_unit</c></tag>
- <item>Time unit of returned value.</item>
- </taglist>
- <p>
- Returns
- <seealso marker="time_correction#Erlang_Monotonic_Time">Erlang
- monotonic time</seealso>. Note that it is not uncommon with
- negative values.
- </p>
- <p>Returns <c>ERL_NIF_TIME_ERROR</c> if called with an invalid
- time unit argument, or if called from a thread that is not a
- scheduler thread.</p>
- <p>See also:</p>
- <list>
- <item><seealso marker="#ErlNifTime"><c>ErlNifTime</c></seealso></item>
- <item><seealso marker="#ErlNifTimeUnit"><c>ErlNifTimeUnit</c></seealso></item>
- </list>
- </desc>
- </func>
<func>
<name><ret>ErlNifTime</ret><nametext>enif_time_offset(ErlNifTimeUnit time_unit)</nametext></name>
@@ -1563,41 +1720,33 @@ enif_map_iterator_destroy(env, &amp;iter);
<p>Returns <c>ERL_NIF_TIME_ERROR</c> if called with an invalid
time unit argument, or if called from a thread that is not a
scheduler thread.</p>
- <p>See also:</p>
- <list>
- <item><seealso marker="#ErlNifTime"><c>ErlNifTime</c></seealso></item>
- <item><seealso marker="#ErlNifTimeUnit"><c>ErlNifTimeUnit</c></seealso></item>
- </list>
+ <p>See also:
+ <seealso marker="#ErlNifTime"><c>ErlNifTime</c></seealso> and
+ <seealso marker="#ErlNifTimeUnit"><c>ErlNifTimeUnit</c></seealso>.
+ </p>
</desc>
</func>
- <func>
- <name><ret>ErlNifTime</ret><nametext>enif_convert_time_unit(ErlNifTime val, ErlNifTimeUnit from, ErlNifTimeUnit to)</nametext></name>
- <fsummary>Convert time unit of a time value</fsummary>
- <desc>
- <marker id="enif_convert_time_unit"></marker>
- <p>Arguments:</p>
- <taglist>
- <tag><c>val</c></tag>
- <item>Value to convert time unit for.</item>
- <tag><c>from</c></tag>
- <item>Time unit of <c>val</c>.</item>
- <tag><c>to</c></tag>
- <item>Time unit of returned value.</item>
- </taglist>
- <p>Converts the <c>val</c> value of time unit <c>from</c> to
- the corresponding value of time unit <c>to</c>. The result is
- rounded using the floor function.</p>
- <p>Returns <c>ERL_NIF_TIME_ERROR</c> if called with an invalid
- time unit argument.</p>
- <p>See also:</p>
- <list>
- <item><seealso marker="#ErlNifTime"><c>ErlNifTime</c></seealso></item>
- <item><seealso marker="#ErlNifTimeUnit"><c>ErlNifTimeUnit</c></seealso></item>
- </list>
- </desc>
+ <func><name><ret>int</ret><nametext>enif_tsd_key_create(char *name, ErlNifTSDKey *key)</nametext></name>
+ <fsummary></fsummary>
+ <desc><p>Same as <seealso marker="erl_driver#erl_drv_tsd_key_create">erl_drv_tsd_key_create</seealso>.
+ </p></desc>
+ </func>
+ <func><name><ret>void</ret><nametext>enif_tsd_key_destroy(ErlNifTSDKey key)</nametext></name>
+ <fsummary></fsummary>
+ <desc><p>Same as <seealso marker="erl_driver#erl_drv_tsd_key_destroy">erl_drv_tsd_key_destroy</seealso>.
+ </p></desc>
+ </func>
+ <func><name><ret>void *</ret><nametext>enif_tsd_get(ErlNifTSDKey key)</nametext></name>
+ <fsummary></fsummary>
+ <desc><p>Same as <seealso marker="erl_driver#erl_drv_tsd_get">erl_drv_tsd_get</seealso>.
+ </p></desc>
+ </func>
+ <func><name><ret>void</ret><nametext>enif_tsd_set(ErlNifTSDKey key, void *data)</nametext></name>
+ <fsummary></fsummary>
+ <desc><p>Same as <seealso marker="erl_driver#erl_drv_tsd_set">erl_drv_tsd_set</seealso>.
+ </p></desc>
</func>
-
</funcs>
<section>
<title>SEE ALSO</title>
diff --git a/erts/doc/src/erl_prim_loader.xml b/erts/doc/src/erl_prim_loader.xml
index 8f66e07ae1..d3ece37cc5 100644
--- a/erts/doc/src/erl_prim_loader.xml
+++ b/erts/doc/src/erl_prim_loader.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/erl_tracer.xml b/erts/doc/src/erl_tracer.xml
new file mode 100644
index 0000000000..2075b962d8
--- /dev/null
+++ b/erts/doc/src/erl_tracer.xml
@@ -0,0 +1,668 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2016</year><year>2016</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>erl_tracer</title>
+ <prepared></prepared>
+ <docno></docno>
+ <date></date>
+ <rev></rev>
+ </header>
+ <module>erl_tracer</module>
+ <modulesummary>Erlang Tracer Behaviour</modulesummary>
+ <description>
+ <p>A behaviour module for implementing the back end of the erlang
+ tracing system. The functions in this module will be called whenever
+ a trace probe is triggered. Both the <c>enabled</c> and <c>trace</c>
+ functions are called in the context of the entity that triggered the
+ trace probe.
+ This means that the overhead by having the tracing enabled will be
+ greatly effected by how much time is spent in these functions. So do as
+ little work as possible in these functions.</p>
+ <note>
+ <p>All functions in this behaviour have to be implemented as NIF's.
+ This is a limitation that may the lifted in the future.
+ There is an <seealso marker="#example">example tracer module nif</seealso>
+ implementation at the end of this page.</p>
+ </note>
+ <warning>
+ <p>Do not send messages or issue port commands to the <c>Tracee</c>
+ in any of the callbacks. Doing so is not allowed and can cause all
+ sorts of strange behaviour, including but not limited to infinite
+ recursions.</p>
+ </warning>
+ </description>
+
+ <datatypes>
+ <datatype> <name name="trace_tag_send" /> </datatype>
+ <datatype> <name name="trace_tag_receive" /> </datatype>
+ <datatype> <name name="trace_tag_call" /> </datatype>
+ <datatype> <name name="trace_tag_procs" /> </datatype>
+ <datatype> <name name="trace_tag_ports" /> </datatype>
+ <datatype> <name name="trace_tag_running_procs" /> </datatype>
+ <datatype> <name name="trace_tag_running_ports" /> </datatype>
+ <datatype> <name name="trace_tag_gc" /> </datatype>
+ <datatype>
+ <name name="trace_tag" />
+ <desc>
+ <p>The different trace tags that the tracer will be called with.
+ Each trace tag is described in greater detail in
+ <seealso marker="#trace">Module:trace/6</seealso>
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="tracee" />
+ <desc>
+ <p>The process or port that the trace belongs to.
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="trace_opts" />
+ <desc>
+ <p>The options for the tracee.
+ <taglist>
+ <tag><c>timestamp</c></tag>
+ <item>If not set to <c>undefined</c>, the tracer has been requested to
+ include a timestamp.</item>
+ <tag><c>match_spec_result</c></tag>
+ <item>If not set to <c>true</c>, the tracer has been requested to
+ include the output of a match specification that was run.</item>
+ <tag><c>scheduler_id</c></tag>
+ <item>Set to a number of the scheduler id is to be included by the tracer.
+ Otherwise it is set to <c>undefined</c>.</item>
+ </taglist>
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="tracer_state" />
+ <desc>
+ <p>
+ The state which is given when calling
+ <seealso marker="erlang#trace-3"><c>erlang:trace(PidPortSpec,true,[{tracer,Module,TracerState}])</c></seealso>.
+ The tracer state is an immutable value that is passed to erl_tracer callbacks and should
+ contain all the data that is needed to generate the trace event.
+ </p>
+ </desc>
+ </datatype>
+ </datatypes>
+
+ <section>
+ <title>CALLBACK FUNCTIONS</title>
+ <p>The following functions
+ should be exported from a <c>erl_tracer</c> callback module.</p>
+ <taglist>
+ <tag><seealso marker="#enabled"><c>Module:enabled/3</c></seealso></tag>
+ <item>Mandatory</item>
+ <tag><seealso marker="#trace"><c>Module:trace/6</c></seealso></tag>
+ <item>Mandatory</item>
+ <tag><seealso marker="#enabled_procs"><c>Module:enabled_procs/3</c></seealso></tag>
+ <item>Optional</item>
+ <tag><seealso marker="#trace_procs"><c>Module:trace_procs/6</c></seealso></tag>
+ <item>Optional</item>
+ <tag><seealso marker="#enabled_ports"><c>Module:enabled_ports/3</c></seealso></tag>
+ <item>Optional</item>
+ <tag><seealso marker="#trace_ports"><c>Module:trace_ports/6</c></seealso></tag>
+ <item>Optional</item>
+ <tag><seealso marker="#enabled_running_ports"><c>Module:enabled_running_ports/3</c></seealso></tag>
+ <item>Optional</item>
+ <tag><seealso marker="#trace_running_ports"><c>Module:trace_running_ports/6</c></seealso></tag>
+ <item>Optional</item>
+ <tag><seealso marker="#enabled_running_procs"><c>Module:enabled_running_procs/3</c></seealso></tag>
+ <item>Optional</item>
+ <tag><seealso marker="#trace_running_procs"><c>Module:trace_running_procs/6</c></seealso></tag>
+ <item>Optional</item>
+ </taglist>
+
+ </section>
+ <marker id="enabled"></marker>
+ <funcs>
+ <func>
+ <name>Module:enabled(TraceTag, TracerState, Tracee) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag">trace_tag()</seealso> | trace_status</v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>Result = trace | discard | remove</v>
+ </type>
+ <desc>
+ <p>This callback will be called whenever a tracepoint is triggered. It
+ allows the tracer to decide whether a trace should be generated or not.
+ This check is made as early as possible in order to limit the amount of
+ overhead associated with tracing. If <c>trace</c> is returned the
+ necessary trace data will be created and the trace call-back of the tracer
+ will be called. If <c>discard</c> is returned, this trace call
+ will be discarded and no call to trace will be done. If
+ <c>remove</c> is returned, the VM will attempt to remove this tracer
+ from the tracee, together with any trace flags set on the tracee.
+ </p>
+ <p><c>trace_status</c> is a special type of <c>TraceTag</c> which is used
+ to check if the tracer should still be active. It is called in multiple
+ scenarios, but most significantly it is used when tracing is started
+ using this tracer.</p>
+ <p>This function may be called multiple times per tracepoint, so it
+ is important that it is both fast and side effect free.</p>
+ </desc>
+ </func>
+ <marker id="trace"></marker>
+ <func>
+ <name>Module:trace(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag">trace_tag()</seealso></v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>FirstTraceTerm = term()</v>
+ <v>SecondTraceTerm = term() | undefined</v>
+ <v>Opts = <seealso marker="#type-trace_opts">trace_opts()</seealso></v>
+ <v>Result = ok</v>
+ </type>
+ <desc>
+ <p>This callback will be called when a tracepoint is triggered and
+ the <seealso marker="#enabled">Module:enabled/3</seealso>
+ callback returned <c>trace</c>. In it any side effects needed by
+ the tracer should be done. The tracepoint payload is located in
+ the <c>FirstTraceTerm</c> and <c>SecondTraceTerm</c>. The content
+ of the TraceTerms depends on which <c>TraceTag</c> has been triggered.
+ The <c>FirstTraceTerm</c> and <c>SecondTraceTerm</c> correspond to the
+ fourth and fifth slot in the trace tuples described in
+ <seealso marker="erlang#trace_3_trace_messages">erlang:trace/3</seealso>.
+ If the tuple only has four elements, <c>SecondTraceTerm</c> will be
+ <c>undefined</c>.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="trace">Module:trace(seq_trace, TracerState, Label, SeqTraceInfo, undefined, Opts) -> Result</name>
+ <fsummary>Check if a sequence trace event should be generated.</fsummary>
+ <type>
+ <v>TracerState = term()</v>
+ <v>Label = term()</v>
+ <v>SeqTraceInfo = term()</v>
+ <v>Opts = <seealso marker="#type-trace_opts">trace_opts()</seealso></v>
+ <v>Result = ok</v>
+ </type>
+ <desc>
+ <p>The <c>TraceTag</c> <c>seq_trace</c> is handled a little bit
+ differently. There is not <c>Tracee</c> for seq_trace, instead the
+ <c>Label</c> associated with the seq_trace event is given.
+ For more info on what <c>Label</c> and <c>SeqTraceInfo</c> can be
+ see the <seealso marker="kernel:seq_trace">seq_trace</seealso> manual.</p>
+ </desc>
+ </func>
+
+ <marker id="enabled_procs"></marker>
+ <func>
+ <name>Module:enabled_procs(TraceTag, TracerState, Tracee) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag_procs">trace_tag_procs()</seealso></v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>Result = trace | discard | remove</v>
+ </type>
+ <desc>
+ <p>This callback will be called whenever a tracepoint with trace flag
+ <seealso marker="erlang#trace-3"><c>procs</c></seealso>
+ is triggered.</p>
+ <p>If <c>enabled_procs/3</c> is not defined <c>enabled/3</c> will be called instead.</p>
+ </desc>
+ </func>
+
+ <marker id="trace_procs"></marker>
+ <func>
+ <name>Module:trace_procs(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag_procs">trace_tag()</seealso></v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>FirstTraceTerm = term()</v>
+ <v>SecondTraceTerm = term() | undefined</v>
+ <v>Opts = <seealso marker="#type-trace_opts">trace_opts()</seealso></v>
+ <v>Result = ok</v>
+ </type>
+ <desc>
+ <p>This callback will be called when a tracepoint is triggered and
+ the <seealso marker="#enabled_procs">Module:enabled_procs/3</seealso>
+ callback returned <c>trace</c>.</p>
+ <p>If <c>trace_procs/6</c> is not defined <c>trace/6</c> will be called instead.</p>
+ </desc>
+ </func>
+
+ <marker id="enabled_ports"></marker>
+ <func>
+ <name>Module:enabled_ports(TraceTag, TracerState, Tracee) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag_ports">trace_tag_ports()</seealso></v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>Result = trace | discard | remove</v>
+ </type>
+ <desc>
+ <p>This callback will be called whenever a tracepoint with trace flag
+ <seealso marker="erlang#trace-3"><c>ports</c></seealso>
+ is triggered.</p>
+ <p>If <c>enabled_ports/3</c> is not defined <c>enabled/3</c> will be called instead.</p>
+ </desc>
+ </func>
+
+ <marker id="trace_ports"></marker>
+ <func>
+ <name>Module:trace_ports(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag_ports">trace_tag()</seealso></v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>FirstTraceTerm = term()</v>
+ <v>SecondTraceTerm = term() | undefined</v>
+ <v>Opts = <seealso marker="#type-trace_opts">trace_opts()</seealso></v>
+ <v>Result = ok</v>
+ </type>
+ <desc>
+ <p>This callback will be called when a tracepoint is triggered and
+ the <seealso marker="#enabled_ports">Module:enabled_ports/3</seealso>
+ callback returned <c>trace</c>.</p>
+ <p>If <c>trace_ports/6</c> is not defined <c>trace/6</c> will be called instead.</p>
+ </desc>
+ </func>
+
+ <marker id="enabled_running_procs"></marker>
+ <func>
+ <name>Module:enabled_running_procs(TraceTag, TracerState, Tracee) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag_running_procs">trace_tag_running_procs()</seealso></v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>Result = trace | discard | remove</v>
+ </type>
+ <desc>
+ <p>This callback will be called whenever a tracepoint with trace flag
+ <seealso marker="erlang#trace-3"><c>running_procs | running</c></seealso>
+ is triggered.</p>
+ <p>If <c>enabled_running_procs/3</c> is not defined <c>enabled/3</c> will be called instead.</p>
+ </desc>
+ </func>
+
+ <marker id="trace_running_procs"></marker>
+ <func>
+ <name>Module:trace_running_procs(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag_running_procs">trace_tag_running_procs()</seealso></v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>FirstTraceTerm = term()</v>
+ <v>SecondTraceTerm = term() | undefined</v>
+ <v>Opts = <seealso marker="#type-trace_opts">trace_opts()</seealso></v>
+ <v>Result = ok</v>
+ </type>
+ <desc>
+ <p>This callback will be called when a tracepoint is triggered and
+ the <seealso marker="#enabled_running_procs">Module:enabled_running_procs/3</seealso>
+ callback returned <c>trace</c>.</p>
+ <p>If <c>trace_running_procs/6</c> is not defined <c>trace/6</c> will be called instead.</p>
+ </desc>
+ </func>
+
+ <marker id="enabled_running_ports"></marker>
+ <func>
+ <name>Module:enabled_running_ports(TraceTag, TracerState, Tracee) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag_running_ports">trace_tag_running_ports()</seealso></v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>Result = trace | discard | remove</v>
+ </type>
+ <desc>
+ <p>This callback will be called whenever a tracepoint with trace flag
+ <seealso marker="erlang#trace-3"><c>running_ports</c></seealso>
+ is triggered.</p>
+ <p>If <c>enabled_running_ports/3</c> is not defined <c>enabled/3</c> will be called instead.</p>
+ </desc>
+ </func>
+
+ <marker id="trace_running_ports"></marker>
+ <func>
+ <name>Module:trace_running_ports(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag_running_ports">trace_tag_running_ports()</seealso></v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>FirstTraceTerm = term()</v>
+ <v>SecondTraceTerm = term() | undefined</v>
+ <v>Opts = <seealso marker="#type-trace_opts">trace_opts()</seealso></v>
+ <v>Result = ok</v>
+ </type>
+ <desc>
+ <p>This callback will be called when a tracepoint is triggered and
+ the <seealso marker="#enabled_running_ports">Module:enabled_running_ports/3</seealso>
+ callback returned <c>trace</c>.</p>
+ <p>If <c>trace_running_ports/6</c> is not defined <c>trace/6</c> will be called instead.</p>
+ </desc>
+ </func>
+
+ <marker id="enabled_call"></marker>
+ <func>
+ <name>Module:enabled_call(TraceTag, TracerState, Tracee) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag_call">trace_tag_call()</seealso></v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>Result = trace | discard | remove</v>
+ </type>
+ <desc>
+ <p>This callback will be called whenever a tracepoint with trace flag
+ <seealso marker="erlang#trace-3"><c>call | return_to</c></seealso>
+ is triggered.</p>
+ <p>If <c>enabled_call/3</c> is not defined <c>enabled/3</c> will be called instead.</p>
+ </desc>
+ </func>
+
+ <marker id="trace_call"></marker>
+ <func>
+ <name>Module:trace_call(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag_call">trace_tag_call()</seealso></v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>FirstTraceTerm = term()</v>
+ <v>SecondTraceTerm = term() | undefined</v>
+ <v>Opts = <seealso marker="#type-trace_opts">trace_opts()</seealso></v>
+ <v>Result = ok</v>
+ </type>
+ <desc>
+ <p>This callback will be called when a tracepoint is triggered and
+ the <seealso marker="#enabled_call">Module:enabled_call/3</seealso>
+ callback returned <c>trace</c>.</p>
+ <p>If <c>trace_call/6</c> is not defined <c>trace/6</c> will be called instead.</p>
+ </desc>
+ </func>
+
+ <marker id="enabled_send"></marker>
+ <func>
+ <name>Module:enabled_send(TraceTag, TracerState, Tracee) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag_send">trace_tag_send()</seealso></v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>Result = trace | discard | remove</v>
+ </type>
+ <desc>
+ <p>This callback will be called whenever a tracepoint with trace flag
+ <seealso marker="erlang#trace-3"><c>send</c></seealso>
+ is triggered.</p>
+ <p>If <c>enabled_send/3</c> is not defined <c>enabled/3</c> will be called instead.</p>
+ </desc>
+ </func>
+
+ <marker id="trace_send"></marker>
+ <func>
+ <name>Module:trace_send(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag_send">trace_tag_send()</seealso></v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>FirstTraceTerm = term()</v>
+ <v>SecondTraceTerm = term() | undefined</v>
+ <v>Opts = <seealso marker="#type-trace_opts">trace_opts()</seealso></v>
+ <v>Result = ok</v>
+ </type>
+ <desc>
+ <p>This callback will be called when a tracepoint is triggered and
+ the <seealso marker="#enabled_send">Module:enabled_send/3</seealso>
+ callback returned <c>trace</c>.</p>
+ <p>If <c>trace_send/6</c> is not defined <c>trace/6</c> will be called instead.</p>
+ </desc>
+ </func>
+
+ <marker id="enabled_receive"></marker>
+ <func>
+ <name>Module:enabled_receive(TraceTag, TracerState, Tracee) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag_receive">trace_tag_receive()</seealso></v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>Result = trace | discard | remove</v>
+ </type>
+ <desc>
+ <p>This callback will be called whenever a tracepoint with trace flag
+ <seealso marker="erlang#trace-3"><c>'receive'</c></seealso>
+ is triggered.</p>
+ <p>If <c>enabled_receive/3</c> is not defined <c>enabled/3</c> will be called instead.</p>
+ </desc>
+ </func>
+
+ <marker id="trace_receive"></marker>
+ <func>
+ <name>Module:trace_receive(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag_receive">trace_tag_receive()</seealso></v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>FirstTraceTerm = term()</v>
+ <v>SecondTraceTerm = term() | undefined</v>
+ <v>Opts = <seealso marker="#type-trace_opts">trace_opts()</seealso></v>
+ <v>Result = ok</v>
+ </type>
+ <desc>
+ <p>This callback will be called when a tracepoint is triggered and
+ the <seealso marker="#enabled_receive">Module:enabled_receive/3</seealso>
+ callback returned <c>trace</c>.</p>
+ <p>If <c>trace_receive/6</c> is not defined <c>trace/6</c> will be called instead.</p>
+ </desc>
+ </func>
+
+ <marker id="enabled_garbage_collection"></marker>
+ <func>
+ <name>Module:enabled_garbage_collection(TraceTag, TracerState, Tracee) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag_gc">trace_tag_gc()</seealso></v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>Result = trace | discard | remove</v>
+ </type>
+ <desc>
+ <p>This callback will be called whenever a tracepoint with trace flag
+ <seealso marker="erlang#trace-3"><c>garbage_collection</c></seealso>
+ is triggered.</p>
+ <p>If <c>enabled_garbage_collection/3</c> is not defined <c>enabled/3</c> will be called instead.</p>
+ </desc>
+ </func>
+
+ <marker id="trace_garbage_collection"></marker>
+ <func>
+ <name>Module:trace_garbage_collection(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result</name>
+ <fsummary>Check if a trace event should be generated.</fsummary>
+ <type>
+ <v>TraceTag = <seealso marker="#type-trace_tag_gc">trace_tag_gc()</seealso></v>
+ <v>TracerState = term()</v>
+ <v>Tracee = <seealso marker="#type-tracee">tracee()</seealso></v>
+ <v>FirstTraceTerm = term()</v>
+ <v>SecondTraceTerm = term() | undefined</v>
+ <v>Opts = <seealso marker="#type-trace_opts">trace_opts()</seealso></v>
+ <v>Result = ok</v>
+ </type>
+ <desc>
+ <p>This callback will be called when a tracepoint is triggered and
+ the <seealso marker="#enabled_garbage_collection">Module:enabled_garbage_collection/3</seealso>
+ callback returned <c>trace</c>.</p>
+ <p>If <c>trace_garbage_collection/6</c> is not defined <c>trace/6</c> will be called instead.</p>
+ </desc>
+ </func>
+
+ </funcs>
+ <section>
+ <marker id="example"></marker>
+ <title>Erl Tracer Module example</title>
+ <p>In the example below a tracer module with a nif backend sends a message
+ for each <c>send</c> trace tag containing only the sender and receiver.
+ Using this tracer module, a much more lightweight message tracer is
+ used that only records who sent messages to who.</p>
+ <p>Here is an example session using it on Linux.</p>
+ <pre>
+$ gcc -I erts-8.0/include/ -fPIC -shared -o erl_msg_tracer.so erl_msg_tracer.c
+$ erl
+Erlang/OTP 19 [DEVELOPMENT] [erts-8.0] [source-ed2b56b] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
+
+Eshell V8.0 (abort with ^G)
+1&gt; c(erl_msg_tracer), erl_msg_tracer:load().
+ok
+2&gt; Tracer = spawn(fun F() -&gt; receive M -&gt; io:format("~p~n",[M]), F() end end).
+&lt;0.37.0&gt;
+3&gt; erlang:trace(new, true, [send,{tracer, erl_msg_tracer, Tracer}]).
+0
+{&lt;0.39.0&gt;,&lt;0.27.0&gt;}
+4&gt; {ok, D} = file:open("/tmp/tmp.data",[write]).
+{trace,#Port&lt;0.486&gt;,&lt;0.40.0&gt;}
+{trace,&lt;0.40.0&gt;,&lt;0.21.0&gt;}
+{trace,#Port&lt;0.487&gt;,&lt;0.4.0&gt;}
+{trace,#Port&lt;0.488&gt;,&lt;0.4.0&gt;}
+{trace,#Port&lt;0.489&gt;,&lt;0.4.0&gt;}
+{trace,#Port&lt;0.490&gt;,&lt;0.4.0&gt;}
+{ok,&lt;0.40.0&gt;}
+{trace,&lt;0.41.0&gt;,&lt;0.27.0&gt;}
+5&gt;
+ </pre>
+ <p>erl_msg_tracer.erl</p>
+ <pre>
+-module(erl_msg_tracer).
+
+-export([enabled/3, trace/6, load/0]).
+
+load() ->
+ erlang:load_nif("erl_msg_tracer", []).
+
+enabled(_, _, _) ->
+ error.
+
+trace(_, _, _,_, _, _) ->
+ error.
+ </pre>
+ <p>erl_msg_tracer.c</p>
+ <pre>
+#include "erl_nif.h"
+
+/* NIF interface declarations */
+static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info);
+static int upgrade(ErlNifEnv* env, void** priv_data, void** old_priv_data, ERL_NIF_TERM load_info);
+static void unload(ErlNifEnv* env, void* priv_data);
+
+/* The NIFs: */
+static ERL_NIF_TERM enabled(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM trace(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+
+static ErlNifFunc nif_funcs[] = {
+ {"enabled", 3, enabled},
+ {"trace", 6, trace}
+};
+
+ERL_NIF_INIT(erl_msg_tracer, nif_funcs, load, NULL, upgrade, unload)
+
+static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info)
+{
+ *priv_data = NULL;
+ return 0;
+}
+
+static void unload(ErlNifEnv* env, void* priv_data)
+{
+
+}
+
+static int upgrade(ErlNifEnv* env, void** priv_data, void** old_priv_data,
+ ERL_NIF_TERM load_info)
+{
+ if (*old_priv_data != NULL || *priv_data != NULL) {
+ return -1; /* Don't know how to do that */
+ }
+ if (load(env, priv_data, load_info)) {
+ return -1;
+ }
+ return 0;
+}
+
+/*
+ * argv[0]: Trace Tag
+ * argv[1]: TracerState
+ * argv[2]: Tracee
+ */
+static ERL_NIF_TERM enabled(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ ErlNifPid to_pid;
+ if (enif_get_local_pid(env, argv[1], &amp;to_pid))
+ if (!enif_is_process_alive(env, &amp;to_pid))
+ /* tracer is dead so we should remove this tracepoint */
+ return enif_make_atom(env, "remove");
+
+ /* Only generate trace for when tracer != tracee */
+ if (enif_is_identical(argv[1], argv[2]))
+ return enif_make_atom(env, "discard");
+
+ /* Only trigger trace messages on 'send' */
+ if (enif_is_identical(enif_make_atom(env, "send"), argv[0]))
+ return enif_make_atom(env, "trace");
+
+ /* Have to answer trace_status */
+ if (enif_is_identical(enif_make_atom(env, "trace_status"), argv[0]))
+ return enif_make_atom(env, "trace");
+
+ return enif_make_atom(env, "discard");
+}
+
+/*
+ * argv[0]: Trace Tag, should only be 'send'
+ * argv[1]: TracerState, process to send {argv[2], argv[4]} to
+ * argv[2]: Tracee
+ * argv[3]: Message, ignored
+ * argv[4]: Recipient
+ * argv[5]: Options, ignored
+ */
+static ERL_NIF_TERM trace(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ ErlNifPid to_pid;
+
+ if (enif_get_local_pid(env, argv[1], &amp;to_pid)) {
+ ERL_NIF_TERM msg = enif_make_tuple3(env, enif_make_atom(env, "trace"), argv[2], argv[4]);
+ enif_send(env, &amp;to_pid, NULL, msg);
+ }
+
+ return enif_make_atom(env, "ok");
+}
+ </pre>
+ </section>
+</erlref>
diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml
index 350a8506f5..3276bc34b0 100644
--- a/erts/doc/src/erlang.xml
+++ b/erts/doc/src/erlang.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2015</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -2613,6 +2613,48 @@ os_prompt% </pre>
</func>
<func>
+ <name name="match_spec_test" arity="3"/>
+ <fsummary>Test that a match specification works</fsummary>
+ <desc>
+ <p>
+ This function is a utility to test a match_spec used in calls to
+ <seealso marker="stdlib:ets#select/2">ets:select/2</seealso> and
+ <seealso marker="#trace_pattern/3">erlang:trace_pattern/3</seealso>.
+ The function both tests MatchSpec for "syntactic" correctness and
+ runs the match_spec against the object. If the match_spec contains
+ errors, the tuple {error, Errors} is returned where Errors is a list
+ of natural language descriptions of what was wrong with the match_spec.
+ </p>
+ <p>
+ If the <c><anno>Type</anno></c> is <c>table</c> the object to match
+ against should be a tuple. The function then returns
+ {ok,Result,[],Warnings} where Result is what would have been the
+ result in a real ets:select/2 call or false if the match_spec does
+ not match the object tuple.
+ </p>
+
+ <p>
+ If <c><anno>Type</anno></c> is <c>trace</c> the object to match
+ against should be a list. The function returns
+ {ok, Result, Flags, Warnings} where Result is <c>true</c> if a trace
+ message should be emitted, <c>false</c> if a trace message should not
+ be emitted or the message term to be appended to the trace message.
+ Flags is a list containing all the trace flags that will be enabled,
+ at the moment this is only <c>return_trace</c>.
+ </p>
+
+ <p>
+ This is a useful debugging and test tool, especially when writing complicated
+ match specifications.
+ </p>
+ <p>
+ See also
+ <seealso marker="stdlib:ets#test_ms/2">ets:test_ms/2</seealso>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
<name name="max" arity="2"/>
<fsummary>Returns the largest of two terms.</fsummary>
<desc>
@@ -4329,7 +4371,7 @@ os_prompt% </pre>
</taglist>
<p>
The default <c>message_queue_data</c> process flag is determined
- by the <seealso marker="erl#+xmqd"><c>+xmqd</c></seealso>
+ by the <seealso marker="erl#+hmqd"><c>+hmqd</c></seealso>
<c>erl</c> command line argument.
</p>
<p>
@@ -4660,7 +4702,7 @@ os_prompt% </pre>
detailed information about garbage collection for this process.
The content of <c><anno>GCInfo</anno></c> can be changed without
prior notice.
- See <seealso marker="#gc_start">gc_start</seealso> in
+ See <seealso marker="#gc_minor_start">gc_minor_start</seealso> in
<seealso marker="#trace/3">erlang:trace/3</seealso> for details about
what each item means.
</p>
@@ -4836,7 +4878,9 @@ os_prompt% </pre>
<tag><c>{total_heap_size, <anno>Size</anno>}</c></tag>
<item>
<p><c><anno>Size</anno></c> is the total size, in words, of all heap
- fragments of the process. This includes the process stack.</p>
+ fragments of the process. This includes the process stack and
+ any unreceived messages that are considered to be part of the
+ heap. </p>
</item>
<tag><c>{trace, <anno>InternalTraceFlags</anno>}</c></tag>
<item>
@@ -5667,7 +5711,7 @@ true</pre>
flag. <c><anno>MQD</anno></c> should be either <c>off_heap</c>,
<c>on_heap</c>, or <c>mixed</c>. The default
<c>message_queue_data</c> process flag is determined by the
- <seealso marker="erl#+xmqd"><c>+xmqd</c></seealso> <c>erl</c>
+ <seealso marker="erl#+hmqd"><c>+hmqd</c></seealso> <c>erl</c>
command line argument. For more information, see the
documentation of
<seealso marker="#process_flag_message_queue_data"><c>process_flag(message_queue_data,
@@ -7346,7 +7390,7 @@ ok
<p>Returns the default value of the <c>message_queue_data</c>
process flag which is either <c>off_heap</c>, <c>on_heap</c>, or <c>mixed</c>.
This default is set by the <c>erl</c> command line argument
- <seealso marker="erl#+xmqd"><c>+xmqd</c></seealso>. For more information on the
+ <seealso marker="erl#+hmqd"><c>+hmqd</c></seealso>. For more information on the
<c>message_queue_data</c> process flag, see documentation of
<seealso marker="#process_flag_message_queue_data"><c>process_flag(message_queue_data,
MQD)</c></seealso>.</p>
@@ -7924,7 +7968,7 @@ ok
<c>stack_size</c>, <c>mbuf_size</c>, <c>old_heap_size</c>,
and <c>old_heap_block_size</c>. These tuples are
explained in the description of trace message
- <seealso marker="#gc_start">gc_start</seealso> (see
+ <seealso marker="#gc_minor_start">gc_minor_start</seealso> (see
<seealso marker="#trace/3">erlang:trace/3</seealso>).
New tuples can be added, and the order of the tuples in
the <c>Info</c> list can be changed at any time without
@@ -8347,22 +8391,47 @@ timestamp() ->
<c><anno>How</anno> == false</c>) the trace flags in
<c><anno>FlagList</anno></c> for
the process or processes represented by
- <c><anno>PidSpec</anno></c>.</p>
- <p><c><anno>PidSpec</anno></c> is either a process identifier
- (pid) for a local process, or one of the following atoms:</p>
+ <c><anno>PidPortSpec</anno></c>.</p>
+ <p><c><anno>PidPortSpec</anno></c> is either a process identifier
+ (pid) for a local process, a port identifier,
+ or one of the following atoms:</p>
<taglist>
+ <tag><c>all</c></tag>
+ <item>
+ <p>All currently existing processes and ports and all that
+ will be created in the future.</p>
+ </item>
+ <tag><c>processes</c></tag>
+ <item>
+ <p>All currently existing processes and all that will be created in the future.</p>
+ </item>
+ <tag><c>ports</c></tag>
+ <item>
+ <p>All currently existing ports and all that will be created in the future.</p>
+ </item>
<tag><c>existing</c></tag>
<item>
+ <p>All currently existing processes and ports.</p>
+ </item>
+ <tag><c>existing_processes</c></tag>
+ <item>
<p>All currently existing processes.</p>
</item>
+ <tag><c>existing_ports</c></tag>
+ <item>
+ <p>All currently existing ports.</p>
+ </item>
<tag><c>new</c></tag>
<item>
- <p>All processes that are created in the future.</p>
+ <p>All processes and ports that will be created in the future.</p>
</item>
- <tag><c>all</c></tag>
+ <tag><c>new_processes</c></tag>
<item>
- <p>All currently existing processes and all processes that
- are created in the future.</p>
+ <p>All processes that will be created in the future.</p>
+ </item>
+ <tag><c>new_ports</c></tag>
+ <item>
+ <p>All ports that will be created in the future.</p>
</item>
</taglist>
<p><c><anno>FlagList</anno></c> can contain any number of the
@@ -8371,35 +8440,28 @@ timestamp() ->
<taglist>
<tag><c>all</c></tag>
<item>
- <p>Sets all trace flags except <c>{tracer, Tracer}</c> and
+ <p>Sets all trace flags except <c>tracer</c> and
<c>cpu_timestamp</c>, which are in their nature different
than the others.</p>
</item>
<tag><c>send</c></tag>
<item>
<p>Traces sending of messages.</p>
- <p>Message tags: <c>send</c> and
- <c>send_to_non_existing_process</c>.</p>
+ <p>Message tags: <c><seealso marker="#trace_3_trace_messages_send">send</seealso></c> and
+ <c><seealso marker="#trace_3_trace_messages_send_to_non_existing_process">send_to_non_existing_process</seealso></c>.</p>
</item>
<tag><c>'receive'</c></tag>
<item>
<p>Traces receiving of messages.</p>
- <p>Message tags: <c>'receive'</c>.</p>
+ <p>Message tags: <c><seealso marker="#trace_3_trace_messages_receive">'receive'</seealso></c>.</p>
</item>
- <tag><c>procs</c></tag>
- <item>
- <p>Traces process-related events.</p>
- <p>Message tags: <c>spawn</c>, <c>exit</c>,
- <c>register</c>, <c>unregister</c>, <c>link</c>,
- <c>unlink</c>, <c>getting_linked</c>, and
- <c>getting_unlinked</c>.</p>
- </item>
- <tag><c>call</c></tag>
+<tag><c>call</c></tag>
<item>
<p>Traces certain function calls. Specify which function
calls to trace by calling
<seealso marker="#trace_pattern/3">erlang:trace_pattern/3</seealso>.</p>
- <p>Message tags: <c>call</c> and <c>return_from</c>.</p>
+ <p>Message tags: <c><seealso marker="#trace_3_trace_messages_call">call</seealso></c> and
+ <c><seealso marker="#trace_3_trace_messages_return_from">return_from</seealso></c>.</p>
</item>
<tag><c>silent</c></tag>
<item>
@@ -8417,8 +8479,9 @@ timestamp() ->
specification function <c>{silent,Bool}</c>, giving
a high degree of control of which functions with which
arguments that trigger the trace.</p>
- <p>Message tags: <c>call</c>, <c>return_from</c>, and
- <c>return_to</c>. Or rather, the absence of.</p>
+ <p>Message tags: <c><seealso marker="#trace_3_trace_messages_call">call</seealso></c>,
+ <c><seealso marker="#trace_3_trace_messages_return_from">return_from</seealso></c>, and
+ <c><seealso marker="#trace_3_trace_messages_return_to">return_to</seealso></c>. Or rather, the absence of.</p>
</item>
<tag><c>return_to</c></tag>
<item>
@@ -8439,23 +8502,63 @@ timestamp() ->
<p>To get trace messages containing return values from
functions, use the <c>{return_trace}</c> match
specification action instead.</p>
- <p>Message tags: <c>return_to</c>.</p>
+ <p>Message tags: <c><seealso marker="#trace_3_trace_messages_return_to">return_to</seealso></c>.</p>
+ </item>
+ <tag><c>procs</c></tag>
+ <item>
+ <p>Traces process-related events.</p>
+ <p>Message tags: <c><seealso marker="#trace_3_trace_messages_spawn">spawn</seealso></c>,
+ <c><seealso marker="#trace_3_trace_messages_spawned">spawned</seealso></c>,
+ <c><seealso marker="#trace_3_trace_messages_exit">exit</seealso></c>,
+ <c><seealso marker="#trace_3_trace_messages_register">register</seealso></c>,
+ <c><seealso marker="#trace_3_trace_messages_unregister">unregister</seealso></c>,
+ <c><seealso marker="#trace_3_trace_messages_link">link</seealso></c>,
+ <c><seealso marker="#trace_3_trace_messages_unlink">unlink</seealso></c>,
+ <c><seealso marker="#trace_3_trace_messages_getting_linked">getting_linked</seealso></c>, and
+ <c><seealso marker="#trace_3_trace_messages_getting_unlinked">getting_unlinked</seealso></c>.</p>
+ </item>
+ <tag><c>ports</c></tag>
+ <item>
+ <p>Traces port-related events.</p>
+ <p>Message tags: <c><seealso marker="#trace_3_trace_messages_open">open</seealso></c>,
+ <c><seealso marker="#trace_3_trace_messages_closed">closed</seealso></c>,
+ <c><seealso marker="#trace_3_trace_messages_register">register</seealso></c>,
+ <c><seealso marker="#trace_3_trace_messages_unregister">unregister</seealso></c>,
+ <c><seealso marker="#trace_3_trace_messages_getting_linked">getting_linked</seealso></c>, and
+ <c><seealso marker="#trace_3_trace_messages_getting_unlinked">getting_unlinked</seealso></c>.</p>
</item>
<tag><c>running</c></tag>
<item>
<p>Traces scheduling of processes.</p>
- <p>Message tags: <c>in</c> and <c>out</c>.</p>
+ <p>Message tags: <c><seealso marker="#trace_3_trace_messages_in_proc">in</seealso></c> and
+ <c><seealso marker="#trace_3_trace_messages_out_proc">out</seealso></c>.</p>
</item>
<tag><c>exiting</c></tag>
<item>
<p>Traces scheduling of exiting processes.</p>
- <p>Message tags: <c>in_exiting</c>, <c>out_exiting</c>, and
- <c>out_exited</c>.</p>
+ <p>Message tags: <c><seealso marker="#trace_3_trace_messages_in_exiting_proc">in_exiting</seealso></c>,
+ <c><seealso marker="#trace_3_trace_messages_out_exiting_proc">out_exiting</seealso></c>, and
+ <c><seealso marker="#trace_3_trace_messages_out_exited_proc">out_exited</seealso></c>.</p>
+ </item>
+ <tag><c>running_procs</c></tag>
+ <item>
+ <p>Traces scheduling of processes just like <c>running</c>.
+ However this option also includes schedule events when the
+ process executes within the context of a port without
+ being scheduled out itself.</p>
+ <p>Message tags: <c><seealso marker="#trace_3_trace_messages_in_proc">in</seealso></c> and
+ <c><seealso marker="#trace_3_trace_messages_out_proc">out</seealso></c>.</p>
+ </item>
+ <tag><c>running_ports</c></tag>
+ <item>
+ <p>Traces scheduling of ports.</p>
+ <p>Message tags: <c><seealso marker="#trace_3_trace_messages_in_port">in</seealso></c> and
+ <c><seealso marker="#trace_3_trace_messages_out_port">out</seealso></c>.</p>
</item>
<tag><c>garbage_collection</c></tag>
<item>
<p>Traces garbage collections of processes.</p>
- <p>Message tags: <c>gc_start</c> and <c>gc_end</c>.</p>
+ <p>Message tags: <c><seealso marker="#trace_3_trace_messages_gc_minor_start">gc_minor_start</seealso></c> and <c><seealso marker="#trace_3_trace_messages_gc_minor_end">gc_minor_end</seealso></c>.</p>
</item>
<tag><c>timestamp</c></tag>
<item>
@@ -8470,8 +8573,8 @@ timestamp() ->
in CPU time, not wall clock time. That is, <c>cpu_timestamp</c>
will not be used if <c>monotonic_timestamp</c>, or
<c>strict_monotonic_timestamp</c> is enabled.
- Only allowed with <c>PidSpec==all</c>. If the host
- machine OS does not support high-resolution
+ Only allowed with <c><anno>PidPortSpec</anno>==all</c>. If the
+ host machine OS does not support high-resolution
CPU time measurements, <c>trace/3</c> exits with
<c>badarg</c>. Notice that most OS do
not synchronize this value across cores, so be prepared
@@ -8483,8 +8586,8 @@ timestamp() ->
<seealso marker="time_correction#Erlang_Monotonic_Time">Erlang
monotonic time</seealso> time-stamp in all trace messages. The
time-stamp (Ts) has the same format and value as produced by
- <c>erlang:monotonic_time(nano_seconds)</c>. This flag overrides
- the <c>cpu_timestamp</c> flag.</p>
+ <c><seealso marker="#monotonic_time-1">erlang:monotonic_time(nano_seconds)</seealso></c>.
+ This flag overrides the <c>cpu_timestamp</c> flag.</p>
</item>
<tag><c>strict_monotonic_timestamp</c></tag>
<item>
@@ -8493,9 +8596,9 @@ timestamp() ->
monotonic time</seealso> and a monotonically increasing
integer in all trace messages. The time-stamp (Ts) has the
same format and value as produced by
- <c>{erlang:monotonic_time(nano_seconds),
- erlang:unique_integer([monotonic])}</c>. This flag overrides
- the <c>cpu_timestamp</c> flag.</p>
+ <c>{<seealso marker="#monotonic_time-1">erlang:monotonic_time(nano_seconds)</seealso>,
+ <seealso marker="#unique_integer-1">erlang:unique_integer([monotonic])</seealso>}</c>.
+ This flag overrides the <c>cpu_timestamp</c> flag.</p>
</item>
<tag><c>arity</c></tag>
<item>
@@ -8529,12 +8632,20 @@ timestamp() ->
<item>
<p>Specifies where to send the trace messages. <c>Tracer</c>
must be the process identifier of a local process
- or the port identifier
- of a local port. If this flag is not given, trace
- messages are sent to the process that called
- <c>erlang:trace/3</c>.</p>
+ or the port identifier of a local port.</p>
+ </item>
+ <tag><c>{tracer, TracerModule, TracerState}</c></tag>
+ <item>
+ <p>Specifies that a tracer module should be called
+ instead of sending a trace message. The tracer module
+ can then ignore or change the trace message. For more details
+ on how to write a tracer module see
+ <seealso marker="erts:erl_tracer"><c>erl_tracer</c></seealso>
+ </p>
</item>
</taglist>
+ <p>If no <c>tracer</c> is given, the calling process
+ will be receiving all of the trace messages</p>
<p>The effect of combining <c>set_on_first_link</c> with
<c>set_on_link</c> is the same as having
<c>set_on_first_link</c> alone. Likewise for
@@ -8555,21 +8666,36 @@ timestamp() ->
the other one will become active.</p>
<marker id="trace_3_trace_messages"></marker>
<taglist>
- <tag><c>{trace, Pid, 'receive', Msg}</c></tag>
- <item>
- <p>When <c>Pid</c> receives message <c>Msg</c>.</p>
- </item>
- <tag><c>{trace, Pid, send, Msg, To}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_send"></marker>
+ <c>{trace, PidPort, send, Msg, To}</c>
+ </tag>
<item>
- <p>When <c>Pid</c> sends message <c>Msg</c> to
+ <p>When <c>PidPort</c> sends message <c>Msg</c> to
process <c>To</c>.</p>
</item>
- <tag><c>{trace, Pid, send_to_non_existing_process, Msg, To}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_send_to_non_existing_process"></marker>
+ <c>{trace, PidPort, send_to_non_existing_process, Msg, To}</c>
+ </tag>
<item>
- <p>When <c>Pid</c> sends message <c>Msg</c> to
+ <p>When <c>PidPort</c> sends message <c>Msg</c> to
the non-existing process <c>To</c>.</p>
</item>
- <tag><c>{trace, Pid, call, {M, F, Args}}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_receive"></marker>
+ <c>{trace, PidPort, 'receive', Msg}</c>
+ </tag>
+ <item>
+ <p>When <c>PidPort</c> receives message <c>Msg</c>.
+ If <c>Msg</c> is set to timeout, then a receive
+ statement may have timedout, or the process received
+ a message with the payload <c>timeout</c>.</p>
+ </item>
+ <tag>
+ <marker id="trace_3_trace_messages_call"></marker>
+ <c>{trace, Pid, call, {M, F, Args}}</c>
+ </tag>
<item>
<p>When <c>Pid</c> calls a traced function. The return
values of calls are never supplied, only the call and its
@@ -8578,7 +8704,10 @@ timestamp() ->
change the contents of this message, so that <c>Arity</c>
is specified instead of <c>Args</c>.</p>
</item>
- <tag><c>{trace, Pid, return_to, {M, F, Arity}}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_return_to"></marker>
+ <c>{trace, Pid, return_to, {M, F, Arity}}</c>
+ </tag>
<item>
<p>When <c>Pid</c> returns <em>to</em> the specified
function. This trace message is sent if both
@@ -8590,76 +8719,175 @@ timestamp() ->
(that is, the functions match specification matched, and
<c>{message, false}</c> was not an action).</p>
</item>
- <tag><c>{trace, Pid, return_from, {M, F, Arity}, ReturnValue}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_return_from"></marker>
+ <c>{trace, Pid, return_from, {M, F, Arity}, ReturnValue}</c>
+ </tag>
<item>
<p>When <c>Pid</c> returns <em>from</em> the specified
function. This trace message is sent if flag <c>call</c>
is set, and the function has a match specification
with a <c>return_trace</c> or <c>exception_trace</c> action.</p>
</item>
- <tag><c>{trace, Pid, exception_from, {M, F, Arity}, {Class, Value}}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_exception_from"></marker>
+ <c>{trace, Pid, exception_from, {M, F, Arity}, {Class, Value}}</c>
+ </tag>
<item>
<p>When <c>Pid</c> exits <em>from</em> the specified
function because of an exception. This trace message is
sent if flag <c>call</c> is set, and the function has
a match specification with an <c>exception_trace</c> action.</p>
</item>
- <tag><c>{trace, Pid, spawn, Pid2, {M, F, Args}}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_spawn"></marker>
+ <c>{trace, Pid, spawn, Pid2, {M, F, Args}}</c>
+ </tag>
<item>
<p>When <c>Pid</c> spawns a new process <c>Pid2</c> with
the specified function call as entry point.</p>
<p><c>Args</c> is supposed to be the argument list,
but can be any term if the spawn is erroneous.</p>
</item>
- <tag><c>{trace, Pid, exit, Reason}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_spawned"></marker>
+ <c>{trace, Pid, spawned, Pid2, {M, F, Args}}</c>
+ </tag>
+ <item>
+ <p>When <c>Pid</c> is spawned by process <c>Pid2</c> with
+ the specified function call as entry point.</p>
+ <p><c>Args</c> is supposed to be the argument list,
+ but can be any term if the spawn is erroneous.</p>
+ </item>
+ <tag>
+ <marker id="trace_3_trace_messages_exit"></marker>
+ <c>{trace, Pid, exit, Reason}</c>
+ </tag>
<item>
<p>When <c>Pid</c> exits with reason <c>Reason</c>.</p>
</item>
- <tag><c>{trace, Pid, link, Pid2}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_register"></marker>
+ <c>{trace, PidPort, register, RegName}</c>
+ </tag>
+ <item>
+ <p>When <c>PidPort</c> gets the name <c>RegName</c> registered.</p>
+ </item>
+ <tag>
+ <marker id="trace_3_trace_messages_unregister"></marker>
+ <c>{trace, PidPort, unregister, RegName}</c>
+ </tag>
+ <item>
+ <p>When <c>PidPort</c> gets the name <c>RegName</c> unregistered.
+ This is done automatically when a registered
+ process or port exits.</p>
+ </item>
+ <tag>
+ <marker id="trace_3_trace_messages_link"></marker>
+ <c>{trace, Pid, link, Pid2}</c>
+ </tag>
<item>
<p>When <c>Pid</c> links to a process <c>Pid2</c>.</p>
</item>
- <tag><c>{trace, Pid, unlink, Pid2}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_unlink"></marker>
+ <c>{trace, Pid, unlink, Pid2}</c>
+ </tag>
<item>
<p>When <c>Pid</c> removes the link from a process
<c>Pid2</c>.</p>
</item>
- <tag><c>{trace, Pid, getting_linked, Pid2}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_getting_linked"></marker>
+ <c>{trace, PidPort, getting_linked, Pid2}</c>
+ </tag>
<item>
- <p>When <c>Pid</c> gets linked to a process <c>Pid2</c>.</p>
+ <p>When <c>PidPort</c> gets linked to a process <c>Pid2</c>.</p>
</item>
- <tag><c>{trace, Pid, getting_unlinked, Pid2}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_getting_unlinked"></marker>
+ <c>{trace, PidPort, getting_unlinked, Pid2}</c>
+ </tag>
<item>
- <p>When <c>Pid</c> gets unlinked from a process <c>Pid2</c>.</p>
+ <p>When <c>PidPort</c> gets unlinked from a process <c>Pid2</c>.</p>
</item>
- <tag><c>{trace, Pid, register, RegName}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_exit"></marker>
+ <c>{trace, Pid, exit, Reason}</c>
+ </tag>
<item>
- <p>When <c>Pid</c> gets the name <c>RegName</c> registered.</p>
+ <p>When <c>Pid</c> exits with reason <c>Reason</c>.</p>
</item>
- <tag><c>{trace, Pid, unregister, RegName}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_open"></marker>
+ <c>{trace, Port, open, Pid, Driver}</c>
+ </tag>
<item>
- <p>When <c>Pid</c> gets the name <c>RegName</c> unregistered.
- This is done automatically when a registered
- process exits.</p>
+ <p>When <c>Pid</c> opens a new port <c>Port</c> with
+ the running the <c>Driver</c>.</p>
+ <p><c>Driver</c> is the name of the driver as an atom.</p>
+ </item>
+ <tag>
+ <marker id="trace_3_trace_messages_closed"></marker>
+ <c>{trace, Port, closed, Reason}</c>
+ </tag>
+ <item>
+ <p>When <c>Port</c> closed with <c>Reason</c>.</p>
</item>
- <tag><c>{trace, Pid, in, {M, F, Arity} | 0}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_in_proc"></marker>
+ <marker id="trace_3_trace_messages_in_exiting_proc"></marker>
+ <c>{trace, Pid, in | in_exiting, {M, F, Arity} | 0}</c>
+ </tag>
<item>
<p>When <c>Pid</c> is scheduled to run. The process
runs in function <c>{M, F, Arity}</c>. On some rare
occasions, the current function cannot be determined,
then the last element is <c>0</c>.</p>
</item>
- <tag><c>{trace, Pid, out, {M, F, Arity} | 0}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_out_proc"></marker>
+ <marker id="trace_3_trace_messages_out_exiting_proc"></marker>
+ <marker id="trace_3_trace_messages_out_exited_proc"></marker>
+ <c>{trace, Pid, out | out_exiting | out_exited, {M, F, Arity} | 0}</c>
+ </tag>
<item>
<p>When <c>Pid</c> is scheduled out. The process was
running in function {M, F, Arity}. On some rare occasions,
the current function cannot be determined, then the last
element is <c>0</c>.</p>
</item>
- <tag><c>{trace, Pid, gc_start, Info}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_in_port"></marker>
+ <c>{trace, Port, in, Command | 0}</c>
+ </tag>
+ <item>
+ <p>When <c>Port</c> is scheduled to run. <c>Command</c> is the
+ first thing the port will execute, it may however run several
+ commands before being scheduled out. On some rare
+ occasions, the current function cannot be determined,
+ then the last element is <c>0</c>.</p>
+ <p>The possible commands are: <c>call | close | command | connect | control | flush | info | link | open | unlink</c></p>
+ </item>
+ <tag>
+ <marker id="trace_3_trace_messages_out_port"></marker>
+ <c>{trace, Port, out, Command | 0}</c>
+ </tag>
+ <item>
+ <p>When <c>Port</c> is scheduled out. The last command run
+ was <c>Command</c>. On some rare occasions,
+ the current function cannot be determined, then the last
+ element is <c>0</c>. <c>Command</c> can contain the same
+ commands as <c>in</c>
+ </p>
+ </item>
+ <tag>
+ <marker id="trace_3_trace_messages_gc_minor_start"></marker>
+ <c>{trace, Pid, gc_minor_start, Info}</c>
+ </tag>
<item>
- <marker id="gc_start"></marker>
- <p>Sent when garbage collection is about to be started.
+ <marker id="gc_minor_start"></marker>
+ <p>Sent when a young garbage collection is about to be started.
<c>Info</c> is a list of two-element tuples, where
the first element is a key, and the second is the value.
Do not depend on any order of the tuples.
@@ -8698,26 +8926,46 @@ timestamp() ->
</taglist>
<p>All sizes are in words.</p>
</item>
- <tag><c>{trace, Pid, gc_end, Info}</c></tag>
+ <tag>
+ <marker id="trace_3_trace_messages_gc_minor_end"></marker>
+ <c>{trace, Pid, gc_minor_end, Info}</c>
+ </tag>
<item>
- <p>Sent when garbage collection is finished. <c>Info</c>
- contains the same kind of list as in message <c>gc_start</c>,
+ <p>Sent when young garbage collection is finished. <c>Info</c>
+ contains the same kind of list as in message <c>gc_minor_start</c>,
but the sizes reflect the new sizes after
garbage collection.</p>
</item>
+ <tag>
+ <marker id="trace_3_trace_messages_gc_major_start"></marker>
+ <c>{trace, Pid, gc_major_start, Info}</c>
+ </tag>
+ <item>
+ <p>Sent when fullsweep garbage collection is about to be started. <c>Info</c>
+ contains the same kind of list as in message <c>gc_minor_start</c>.</p>
+ </item>
+ <tag>
+ <marker id="trace_3_trace_messages_gc_major_end"></marker>
+ <c>{trace, Pid, gc_major_end, Info}</c>
+ </tag>
+ <item>
+ <p>Sent when fullsweep garbage collection is finished. <c>Info</c>
+ contains the same kind of list as in message <c>gc_minor_start</c>
+ but the sizes reflect the new sizes after a fullsweep garbage collection.</p>
+ </item>
</taglist>
- <p>If the tracing process dies, the flags are silently
- removed.</p>
- <p>Only one process can trace a particular process. Therefore,
+ <p>If the tracing process/port dies or the tracer module returns
+ <c>remove</c>, the flags are silently removed.</p>
+ <p>Each process can only be traced by one tracer. Therefore,
attempts to trace an already traced process fail.</p>
<p>Returns: A number indicating the number of processes that
- matched <c><anno>PidSpec</anno></c>.
- If <c><anno>PidSpec</anno></c> is a process
+ matched <c><anno>PidPortSpec</anno></c>.
+ If <c><anno>PidPortSpec</anno></c> is a process
identifier, the return value is <c>1</c>.
- If <c><anno>PidSpec</anno></c>
+ If <c><anno>PidPortSpec</anno></c>
is <c>all</c> or <c>existing</c>, the return value is
- the number of processes running, excluding tracer processes.
- If <c><anno>PidSpec</anno></c> is <c>new</c>, the return value is
+ the number of processes running.
+ If <c><anno>PidPortSpec</anno></c> is <c>new</c>, the return value is
<c>0</c>.</p>
<p>Failure: <c>badarg</c> if the specified arguments are
not supported. For example, <c>cpu_timestamp</c> is not
@@ -8729,7 +8977,11 @@ timestamp() ->
<name name="trace_delivered" arity="1"/>
<fsummary>Notification when trace has been delivered.</fsummary>
<desc>
- <p>The delivery of trace messages is dislocated on the time-line
+ <p>The delivery of trace messages (generated by
+ <seealso marker="#trace/3"><c>erlang:trace/3</c></seealso>,
+ <seealso marker="kernel:seq_trace"><c>seq_trace</c></seealso> or
+ <seealso marker="#system_profile/2"><c>erlang:system_profile/2</c></seealso>)
+ is dislocated on the time-line
compared to other events in the system. If you know that
<c><anno>Tracee</anno></c> has passed some specific point
in its execution,
@@ -8750,13 +9002,16 @@ timestamp() ->
has not been traced by someone, but if this is the case,
<em>no</em> trace messages have been delivered when the
<c>trace_delivered</c> message arrives.</p>
- <p>Notice that that <c><anno>Tracee</anno></c> must refer
+ <p>Notice that <c><anno>Tracee</anno></c> must refer
to a process currently,
or previously existing on the same node as the caller of
<c>erlang:trace_delivered(<anno>Tracee</anno>)</c> resides on.
The special <c><anno>Tracee</anno></c> atom <c>all</c>
- denotes all processes
- that currently are traced in the node.</p>
+ denotes all processes that currently are traced in the node.</p>
+ <p>When used together with an <seealso marker="erts:erl_tracer">
+ Tracer Module</seealso> any message sent in the trace callback
+ is guaranteed to have reached it's recipient before the
+ <c>trace_delivered</c> message is sent.</p>
<p>Example: Process <c>A</c> is <c><anno>Tracee</anno></c>,
port <c>B</c> is tracer, and process <c>C</c> is the port
owner of <c>B</c>. <c>C</c> wants to close <c>B</c> when
@@ -8779,12 +9034,15 @@ timestamp() ->
<type name="trace_info_flag"/>
<type name="trace_match_spec"/>
<desc>
- <p>Returns trace information about a process or function.</p>
- <p>To get information about a process,
- <c><anno>PidOrFunc</anno></c> is to
- be a process identifier (pid) or the atom <c>new</c>.
- The atom <c>new</c> means that the default trace state for
- processes to be created is returned.</p>
+ <p>Returns trace information about a port, process or function.</p>
+ <p>To get information about a port or process,
+ <c><anno>PidPortOrFunc</anno></c> is to
+ be a process identifier (pid), port identifier or one of
+ the atoms <c>new</c>, <c>new_processes</c>, <c>new_ports</c>.
+ The atom <c>new</c> or <c>new_processes</c> means that the default trace
+ state for processes to be created is returned. The atom <c>new_ports</c>
+ means that the default trace state for ports to be created is returned.
+ </p>
<p>The following <c>Item</c>s are valid:</p>
<taglist>
<tag><c>flags</c></tag>
@@ -8794,19 +9052,22 @@ timestamp() ->
traces are enabled, and one or more of the followings
atoms if traces are enabled: <c>send</c>,
<c>'receive'</c>, <c>set_on_spawn</c>, <c>call</c>,
- <c>return_to</c>, <c>procs</c>, <c>set_on_first_spawn</c>,
- <c>set_on_link</c>, <c>running</c>,
+ <c>return_to</c>, <c>procs</c>, <c>ports</c>, <c>set_on_first_spawn</c>,
+ <c>set_on_link</c>, <c>running</c>, <c>running_procs</c>,
+ <c>running_ports</c>, <c>silent</c>, <c>exiting</c>
+ <c>monotonic_timestamp</c>, <c>strict_monotonic_timestamp</c>,
<c>garbage_collection</c>, <c>timestamp</c>, and
<c>arity</c>. The order is arbitrary.</p>
</item>
<tag><c>tracer</c></tag>
<item>
- <p>Returns the identifier for process or port tracing this
+ <p>Returns the identifier for process, port or a tuple containing
+ the tracer module and tracer state tracing this
process. If this process is not being traced, the return
value is <c>[]</c>.</p>
</item>
</taglist>
- <p>To get information about a function, <c>PidOrFunc</c> is to
+ <p>To get information about a function, <c><anno>PidPortOrFunc</anno></c> is to
be the three-element tuple <c>{Module, Function, Arity}</c> or
the atom <c>on_load</c>. No wild cards are allowed. Returns
<c>undefined</c> if the function does not exist, or
@@ -8830,8 +9091,8 @@ timestamp() ->
</item>
<tag><c>meta</c></tag>
<item>
- <p>Returns the meta-trace tracer process or port for this
- function, if it has one. If the function is not
+ <p>Returns the meta-trace tracer process, port or trace module
+ for this function, if it has one. If the function is not
meta-traced, the returned value is <c>false</c>. If
the function is meta-traced but has once detected that
the tracer process is invalid, the returned value is [].</p>
@@ -8874,7 +9135,7 @@ timestamp() ->
<c>Value</c> is the requested information as described earlier.
If a pid for a dead process was given, or the name of a
non-existing function, <c>Value</c> is <c>undefined</c>.</p>
- <p>If <c><anno>PidOrFunc</anno></c> is <c>on_load</c>, the information
+ <p>If <c><anno>PidPortOrFunc</anno></c> is <c>on_load</c>, the information
returned refers to the default value for code that will be
loaded.</p>
</desc>
@@ -8999,13 +9260,12 @@ timestamp() ->
the process, a <c>return_to</c> message is also sent
when this function returns to its caller.</p>
</item>
- <tag><c>meta | {meta, <anno>Pid</anno>}</c></tag>
+ <tag><c>meta | {meta, <anno>Pid</anno>} | {meta, <anno>TracerModule</anno>, <anno>TracerState</anno>}</c>
+ </tag>
<item>
<p>Turns on or off meta-tracing for all types of function
- calls. Trace messages are sent to the tracer process
- or port <c><anno>Pid</anno></c> whenever any of the specified
- functions are called, regardless of how they are called.
- If no <c><anno>Pid</anno></c> is specified,
+ calls. Trace messages are sent to the tracer whenever any of
+ the specified functions are called. If no tracer is specified,
<c>self()</c> is used as a default tracer process.</p>
<p>Meta-tracing traces all processes and does not care
about the process trace flags set by <c>trace/3</c>,
@@ -9013,7 +9273,7 @@ timestamp() ->
<c>[call, timestamp]</c>.</p>
<p>The match specification function <c>{return_trace}</c>
works with meta-trace and sends its trace message to the
- same tracer process.</p>
+ same tracer.</p>
</item>
<tag><c>call_count</c></tag>
<item>
diff --git a/erts/doc/src/erlc.xml b/erts/doc/src/erlc.xml
index 9fc5864413..a64927fec2 100644
--- a/erts/doc/src/erlc.xml
+++ b/erts/doc/src/erlc.xml
@@ -4,7 +4,7 @@
<comref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/erlsrv.xml b/erts/doc/src/erlsrv.xml
index ccb8b2dd76..fb00444aa4 100644
--- a/erts/doc/src/erlsrv.xml
+++ b/erts/doc/src/erlsrv.xml
@@ -4,7 +4,7 @@
<comref>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml
index 0965f9b49c..70775b9f0f 100644
--- a/erts/doc/src/erts_alloc.xml
+++ b/erts/doc/src/erts_alloc.xml
@@ -4,7 +4,7 @@
<cref>
<header>
<copyright>
- <year>2002</year><year>2015</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -63,6 +63,9 @@
<tag><c>fix_alloc</c></tag>
<item>A fast allocator used for some frequently used
fixed size data types.</item>
+ <tag><c>exec_alloc</c></tag>
+ <item>Allocator used by hipe for native executable code
+ on specific architectures (x86_64).</item>
<tag><c>std_alloc</c></tag>
<item>Allocator used for most memory blocks not allocated via any of
the other allocators described above.</item>
@@ -80,7 +83,8 @@
the number of system calls made.</item>
</taglist>
<p><c>sys_alloc</c> and <c>literal_alloc</c> are always enabled and
- cannot be disabled. <c>mseg_alloc</c> is always enabled if it is
+ cannot be disabled. <c>exec_alloc</c> is only available if it is needed
+ and cannot be disabled. <c>mseg_alloc</c> is always enabled if it is
available and an allocator that uses it is enabled. All other
allocators can be <seealso marker="#M_e">enabled or disabled</seealso>.
By default all allocators are enabled.
@@ -248,16 +252,17 @@
the currently present allocators:</p>
<list type="bulleted">
<item><c>B: binary_alloc</c></item>
- <item><c>I: literal_alloc</c></item>
<item><c>D: std_alloc</c></item>
<item><c>E: ets_alloc</c></item>
<item><c>F: fix_alloc</c></item>
<item><c>H: eheap_alloc</c></item>
+ <item><c>I: literal_alloc</c></item>
<item><c>L: ll_alloc</c></item>
<item><c>M: mseg_alloc</c></item>
<item><c>R: driver_alloc</c></item>
<item><c>S: sl_alloc</c></item>
<item><c>T: temp_alloc</c></item>
+ <item><c>X: exec_alloc</c></item>
<item><c>Y: sys_alloc</c></item>
</list>
<p>The following flags are available for configuration of
@@ -576,6 +581,15 @@
and is usually sufficient. The flag is ignored on 32-bit
architectures.</item>
</taglist>
+ <p>The following flag is special for <c>exec_alloc</c>:</p>
+ <taglist>
+ <tag><marker id="MIscs"/><c><![CDATA[+MXscs <size in MB>]]></c></tag>
+ <item>
+ <c>exec_alloc</c> super carrier size (in MB). The amount of
+ <em>virtual</em> address space reserved for native executable code
+ used by hipe on specific architectures (x86_64). The default is 512 MB.
+ </item>
+ </taglist>
<p>Instrumentation flags:</p>
<taglist>
<tag><marker id="Mim"/><c>+Mim true|false</c></tag>
diff --git a/erts/doc/src/inet_cfg.xml b/erts/doc/src/inet_cfg.xml
index 5caf232a62..027fe600d7 100644
--- a/erts/doc/src/inet_cfg.xml
+++ b/erts/doc/src/inet_cfg.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/init.xml b/erts/doc/src/init.xml
index 2a33096d04..84a5aea335 100644
--- a/erts/doc/src/init.xml
+++ b/erts/doc/src/init.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/match_spec.xml b/erts/doc/src/match_spec.xml
index 08dad8cc10..3944f24f84 100644
--- a/erts/doc/src/match_spec.xml
+++ b/erts/doc/src/match_spec.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -287,7 +287,7 @@
can <em>not</em> be one of the atoms <c><![CDATA[all]]></c>, <c><![CDATA[new]]></c> or
<c><![CDATA[existing]]></c> (unless, of course, they are registered names).
<c><![CDATA[P2]]></c> can <em>not</em> be <c><![CDATA[cpu_timestamp]]></c> nor
- <c><![CDATA[{tracer,_}]]></c>.
+ <c><![CDATA[tracer]]></c>.
Returns <c><![CDATA[true]]></c> and may only be used in
the <c><![CDATA[MatchBody]]></c> part when tracing.
</p>
@@ -298,7 +298,7 @@
be either a process identifier or a registered name and is given
as the first argument to the match_spec function.
<c><![CDATA[P2]]></c> can <em>not</em> be <c><![CDATA[cpu_timestamp]]></c> nor
- <c><![CDATA[{tracer,_}]]></c>. Returns
+ <c><![CDATA[tracer]]></c>. Returns
<c><![CDATA[true]]></c> and may only be used in the <c><![CDATA[MatchBody]]></c> part
when tracing.
</p>
@@ -308,11 +308,14 @@
disable list is applied first, but effectively all changes
are applied atomically. The trace flags
are the same as for <c><![CDATA[erlang:trace/3]]></c> not including
- <c><![CDATA[cpu_timestamp]]></c> but including <c><![CDATA[{tracer,_}]]></c>. If a
+ <c><![CDATA[cpu_timestamp]]></c> but including <c><![CDATA[tracer]]></c>. If a
tracer is specified in both lists, the tracer in the
enable list takes precedence. If no tracer is specified the
same tracer as the process executing the match spec is
- used. With three parameters to this function the first is
+ used. When using a <seealso marker="erl_tracer">tracer module</seealso>
+ the module has to be loaded before the match specification is executed.
+ If it is not loaded the match will fail.
+ With three parameters to this function the first is
either a process identifier or the registered name of a
process to set trace flags on, the second is the disable
list, and the third is the enable list. Returns
@@ -525,7 +528,7 @@
</section>
<section>
- <title>Examples</title>
+ <title>ETS Examples</title>
<p>Match an argument list of three where the first and third arguments
are equal:</p>
<code type="none"><![CDATA[
@@ -616,5 +619,44 @@
<p>The function <c><![CDATA[ets:test_ms/2]]></c> can be useful for testing
complicated ets matches.</p>
</section>
+ <section>
+ <title>Tracing Examples</title>
+ <p>Only generate trace message if trace control word is set to 1:</p>
+ <code type="none"><![CDATA[
+[{'_',
+ [{'==',{get_tcw},{const, 1}}],
+ []}]
+ ]]></code>
+ <p>Only generate trace message if there is a seq trace token:</p>
+ <code type="none"><![CDATA[
+[{'_',
+ [{'==',{is_seq_trace},{const, 1}}],
+ []}]
+ ]]></code>
+ <p>Remove 'silent' trace flag when first argument is 'verbose'
+ and add it when it is 'silent':</p>
+ <code type="none"><![CDATA[
+[{'$1',
+ [{'==',{hd, '$1'},verbose}],
+ [{trace, [silent],[]}]},
+ {'$1',
+ [{'==',{hd, '$1'},silent}],
+ [{trace, [],[silent]}]}]
+ ]]></code>
+ <p>Add return_trace message if function is of arity 3:</p>
+ <code type="none"><![CDATA[
+[{'$1',
+ [{'==',{length, '$1'},3}],
+ [{return_trace}]},
+ {'_',[],[]}]
+ ]]></code>
+ <p>Only generate trace message if function is of arity 3 and first argument is 'trace':</p>
+ <code type="none"><![CDATA[
+[{['trace','$2','$3'],
+ [],
+ []},
+ {'_',[],[]}]
+ ]]></code>
+ </section>
</chapter>
diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml
index acd816a81c..7501ccd9ce 100644
--- a/erts/doc/src/notes.xml
+++ b/erts/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2015</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -32,6 +32,71 @@
<p>This document describes the changes made to the ERTS application.</p>
+<section><title>Erts 7.3.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ <c>process_info(Pid, last_calls)</c> did not work for
+ <c>Pid /= self()</c>.</p>
+ <p>
+ Own Id: OTP-13418</p>
+ </item>
+ <item>
+ <p>
+ Make sure to create a crash dump when running out of
+ memory. This was accidentally removed in the erts-7.3
+ release.</p>
+ <p>
+ Own Id: OTP-13419</p>
+ </item>
+ <item>
+ <p>
+ Schedulers could be woken by a premature timeout on
+ Linux. This premature wakeup was however harmless.</p>
+ <p>
+ Own Id: OTP-13420</p>
+ </item>
+ <item>
+ <p>
+ A process communicating with a port via one of the
+ <c>erlang:port_*</c> BIFs could potentially end up in an
+ inconsistent state if the port terminated during the
+ communication. When this occurred the process could later
+ block in a <c>receive</c> even though it had messages
+ matching in its message queue.</p>
+ <p>
+ This bug was introduced in erts version 5.10 (OTP R16A).</p>
+ <p>
+ Own Id: OTP-13424 Aux Id: OTP-10336 </p>
+ </item>
+ <item>
+ <p>
+ The reference count of a process structure could under
+ rare circumstances be erroneously managed. When this
+ happened invalid memory accesses occurred.</p>
+ <p>
+ Own Id: OTP-13446</p>
+ </item>
+ <item>
+ <p>
+ Fix race between <c>process_flag(trap_exit,true)</c> and
+ a received exit signal.</p>
+ <p>
+ A process could terminate due to exit signal even though
+ <c>process_flag(trap_exit,true)</c> had returned. A very
+ specific timing between call to <c>process_flag/2</c> and
+ exit signal from another scheduler was required for this
+ to happen.</p>
+ <p>
+ Own Id: OTP-13452</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Erts 7.3</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/erts/doc/src/notes_history.xml b/erts/doc/src/notes_history.xml
index 0886ae4039..0bc2ab1383 100644
--- a/erts/doc/src/notes_history.xml
+++ b/erts/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/part.xml b/erts/doc/src/part.xml
index 2f5eca93db..b2abfc62ca 100644
--- a/erts/doc/src/part.xml
+++ b/erts/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/part_notes.xml b/erts/doc/src/part_notes.xml
index 83bb479715..e579b7635d 100644
--- a/erts/doc/src/part_notes.xml
+++ b/erts/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/part_notes_history.xml b/erts/doc/src/part_notes_history.xml
index 055d1681d5..277683a2b5 100644
--- a/erts/doc/src/part_notes_history.xml
+++ b/erts/doc/src/part_notes_history.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/ref_man.xml b/erts/doc/src/ref_man.xml
index ac589f8cb5..e45402a397 100644
--- a/erts/doc/src/ref_man.xml
+++ b/erts/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -56,5 +56,6 @@
<xi:include href="driver_entry.xml"/>
<xi:include href="erts_alloc.xml"/>
<xi:include href="erl_nif.xml"/>
+ <xi:include href="erl_tracer.xml"/>
</application>
diff --git a/erts/doc/src/run_erl.xml b/erts/doc/src/run_erl.xml
index faec3c68c1..6b0fef7c0a 100644
--- a/erts/doc/src/run_erl.xml
+++ b/erts/doc/src/run_erl.xml
@@ -4,7 +4,7 @@
<comref>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/specs.xml b/erts/doc/src/specs.xml
index 41a3984659..ed6be650e5 100644
--- a/erts/doc/src/specs.xml
+++ b/erts/doc/src/specs.xml
@@ -2,6 +2,7 @@
<specs xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../specs/specs_erl_prim_loader.xml"/>
<xi:include href="../specs/specs_erlang.xml"/>
+ <xi:include href="../specs/specs_erl_tracer.xml"/>
<xi:include href="../specs/specs_init.xml"/>
<xi:include href="../specs/specs_zlib.xml"/>
</specs>
diff --git a/erts/doc/src/start.xml b/erts/doc/src/start.xml
index 386fbe6e88..adacf5b98d 100644
--- a/erts/doc/src/start.xml
+++ b/erts/doc/src/start.xml
@@ -4,7 +4,7 @@
<comref>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/start_erl.xml b/erts/doc/src/start_erl.xml
index 62610b43b0..243aeaa717 100644
--- a/erts/doc/src/start_erl.xml
+++ b/erts/doc/src/start_erl.xml
@@ -4,7 +4,7 @@
<comref>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/tty.xml b/erts/doc/src/tty.xml
index cd46d1203c..b2866c82cf 100644
--- a/erts/doc/src/tty.xml
+++ b/erts/doc/src/tty.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/werl.xml b/erts/doc/src/werl.xml
index 9e7ad584eb..1a3cb6f502 100644
--- a/erts/doc/src/werl.xml
+++ b/erts/doc/src/werl.xml
@@ -4,7 +4,7 @@
<comref>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/doc/src/zlib.xml b/erts/doc/src/zlib.xml
index 0a641346d9..861661043f 100644
--- a/erts/doc/src/zlib.xml
+++ b/erts/doc/src/zlib.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2005</year><year>2013</year>
+ <year>2005</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/erts/emulator/Makefile b/erts/emulator/Makefile
index 550e6e6f5b..65fdbdb747 100644
--- a/erts/emulator/Makefile
+++ b/erts/emulator/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/Makefile.in b/erts/emulator/Makefile.in
index 12148ad9c7..fb486c917f 100644
--- a/erts/emulator/Makefile.in
+++ b/erts/emulator/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2013. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -577,7 +577,7 @@ GENERATE += $(TARGET)/erl_version.h
# driver table
$(TTF_DIR)/driver_tab.c: Makefile.in utils/make_driver_tab
- $(gen_verbose)LANG=C $(PERL) utils/make_driver_tab -o $@ -nifs $(STATIC_NIF_LIBS) -drivers $(DRV_OBJS) $(STATIC_DRIVER_LIBS)
+ $(gen_verbose)LANG=C $(PERL) utils/make_driver_tab -o $@ -nifs $(NIF_OBJS) $(STATIC_NIF_LIBS) -drivers $(DRV_OBJS) $(STATIC_DRIVER_LIBS)
GENERATE += $(TTF_DIR)/driver_tab.c
@@ -600,8 +600,8 @@ $(PRELOAD_SRC): $(ERL_TOP)/erts/preloaded/ebin/otp_ring0.beam \
$(ERL_TOP)/erts/preloaded/ebin/prim_zip.beam \
$(ERL_TOP)/erts/preloaded/ebin/erl_prim_loader.beam \
$(ERL_TOP)/erts/preloaded/ebin/erlang.beam \
- $(ERL_TOP)/erts/preloaded/ebin/erts_internal.beam
-
+ $(ERL_TOP)/erts/preloaded/ebin/erts_internal.beam \
+ $(ERL_TOP)/erts/preloaded/ebin/erl_tracer.beam
$(gen_verbose)LANG=C $(PERL) utils/make_preload $(MAKE_PRELOAD_EXTRA) -rc $^ > $@
else
PRELOAD_OBJ = $(OBJDIR)/preload.o
@@ -616,7 +616,8 @@ $(PRELOAD_SRC): $(ERL_TOP)/erts/preloaded/ebin/otp_ring0.beam \
$(ERL_TOP)/erts/preloaded/ebin/prim_zip.beam \
$(ERL_TOP)/erts/preloaded/ebin/erl_prim_loader.beam \
$(ERL_TOP)/erts/preloaded/ebin/erlang.beam \
- $(ERL_TOP)/erts/preloaded/ebin/erts_internal.beam
+ $(ERL_TOP)/erts/preloaded/ebin/erts_internal.beam \
+ $(ERL_TOP)/erts/preloaded/ebin/erl_tracer.beam
$(gen_verbose)LANG=C $(PERL) utils/make_preload -old $^ > $@
endif
@@ -690,6 +691,9 @@ $(OBJDIR)/%.o: drivers/common/%.c
$(OBJDIR)/%.o: drivers/$(ERLANG_OSTYPE)/%.c
$(V_CC) $(CFLAGS) $(INCLUDES) -Idrivers/common -Idrivers/$(ERLANG_OSTYPE) -I../etc/$(ERLANG_OSTYPE) -c $< -o $@
+$(OBJDIR)/%.o: nifs/common/%.c
+ $(V_CC) $(CFLAGS) -DLIBSCTP=$(LIBSCTP) $(INCLUDES) -Inifs/common -Inifs/$(ERLANG_OSTYPE) -c $< -o $@
+
# ----------------------------------------------------------------------
# Specials
#
@@ -779,6 +783,9 @@ RUN_OBJS = \
$(OBJDIR)/erl_ptab.o $(OBJDIR)/erl_map.o \
$(OBJDIR)/erl_msacc.o
+LTTNG_OBJS = $(OBJDIR)/erlang_lttng.o
+NIF_OBJS = $(OBJDIR)/erl_tracer_nif.o
+
ifeq ($(TARGET),win32)
DRV_OBJS = \
$(OBJDIR)/registry_drv.o \
@@ -885,9 +892,9 @@ ifdef HIPE_ENABLED
EXTRA_BASE_OBJS += $(HIPE_OBJS)
endif
-BASE_OBJS = $(EMU_OBJS) $(RUN_OBJS) $(OS_OBJS) $(EXTRA_BASE_OBJS)
+BASE_OBJS = $(EMU_OBJS) $(RUN_OBJS) $(OS_OBJS) $(EXTRA_BASE_OBJS) $(LTTNG_OBJS)
-before_DTrace_OBJS = $(BASE_OBJS) $(DRV_OBJS)
+before_DTrace_OBJS = $(BASE_OBJS) $(DRV_OBJS) $(NIF_OBJS)
DTRACE_OBJS =
ifdef DTRACE_ENABLED_2STEP
@@ -1040,6 +1047,7 @@ endif
BEAM_SRC=$(wildcard beam/*.c)
DRV_COMMON_SRC=$(wildcard drivers/common/*.c)
DRV_OSTYPE_SRC=$(wildcard drivers/$(ERLANG_OSTYPE)/*.c)
+NIF_COMMON_SRC=$(wildcard nifs/common/*.c)
ALL_SYS_SRC=$(wildcard sys/$(ERLANG_OSTYPE)/*.c) $(wildcard sys/common/*.c)
# We use $(shell ls) here instead of wildcard as $(wildcard ) resolved at
# loadtime of the makefile and at that time these files are not generated yet.
@@ -1072,7 +1080,7 @@ MG_FLAG=-MG
endif
DEP_CC=$(CC)
-DEP_FLAGS=-MM $(MG_FLAG) $(CFLAGS) $(INCLUDES) -Idrivers/common -Idrivers/$(ERLANG_OSTYPE)
+DEP_FLAGS=-MM $(MG_FLAG) $(CFLAGS) $(INCLUDES) -Inifs/common -Idrivers/common -Idrivers/$(ERLANG_OSTYPE)
SYS_SRC=$(ALL_SYS_SRC)
endif
@@ -1097,6 +1105,8 @@ $(TTF_DIR)/depend.mk: $(TTF_DIR)/GENERATED $(PRELOAD_SRC)
| $(SED_DEPEND) >> $(TTF_DIR)/depend.mk
$(V_at)$(DEP_CC) $(DEP_FLAGS) -I../etc/$(ERLANG_OSTYPE) $(DRV_OSTYPE_SRC) \
| $(SED_DEPEND) >> $(TTF_DIR)/depend.mk
+ $(V_at)$(DEP_CC) $(DEP_FLAGS) $(NIF_COMMON_SRC) \
+ | $(SED_DEPEND) >> $(TTF_DIR)/depend.mk
$(V_at)$(DEP_CC) $(DEP_FLAGS) $(SYS_SRC) \
| $(SED_DEPEND) >> $(TTF_DIR)/depend.mk
$(V_at)$(DEP_CC) $(DEP_FLAGS) $(TARGET_SRC) \
diff --git a/erts/emulator/beam/atom.c b/erts/emulator/beam/atom.c
index 099c00bcf6..a5e778e4aa 100644
--- a/erts/emulator/beam/atom.c
+++ b/erts/emulator/beam/atom.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/atom.h b/erts/emulator/beam/atom.h
index 2c002ca92f..fbd0528009 100644
--- a/erts/emulator/beam/atom.h
+++ b/erts/emulator/beam/atom.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/atom.names b/erts/emulator/beam/atom.names
index 169b071cd7..3022c0a99a 100644
--- a/erts/emulator/beam/atom.names
+++ b/erts/emulator/beam/atom.names
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2013. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ atom false true
atom Underscore='_'
atom Noname='nonode@nohost'
atom EOT='$end_of_table'
-atom Cookie=''
+atom Empty=''
#
# Used in the Beam emulator loop. (Smaller literals usually means tighter code.)
@@ -161,6 +161,7 @@ atom close
atom closed
atom code
atom command
+atom commandv
atom compact
atom compat_rel
atom compile
@@ -197,6 +198,7 @@ atom dirty_cpu_schedulers_online
atom dirty_io
atom disable_trace
atom disabled
+atom discard
atom display_items
atom dist
atom dist_cmd
@@ -231,6 +233,7 @@ atom exception_trace
atom extended
atom Eq='=:='
atom Eqeq='=='
+atom erl_tracer
atom erlang
atom ERROR='ERROR'
atom error_handler
@@ -243,6 +246,9 @@ atom exact_reductions
atom exclusive
atom exit_status
atom existing
+atom existing_processes
+atom existing_ports
+atom existing
atom exiting
atom exports
atom external
@@ -267,6 +273,10 @@ atom garbage_collecting
atom garbage_collection
atom garbage_collection_info
atom gc_end
+atom gc_major_end
+atom gc_major_start
+atom gc_minor_end
+atom gc_minor_start
atom gc_start
atom Ge='>='
atom generational
@@ -353,6 +363,7 @@ atom match
atom match_limit
atom match_limit_recursion
atom match_spec
+atom match_spec_result
atom max
atom maximum
atom max_tables max_processes
@@ -401,6 +412,8 @@ atom net_kernel_terminated
atom never_utf
atom new
atom new_index
+atom new_processes
+atom new_ports
atom new_uniq
atom newline
atom next
@@ -540,6 +553,7 @@ atom scheme
atom scientific
atom scope
atom seconds
+atom send_to_non_existing_process
atom sensitive
atom sequential_tracer
atom sequential_trace_token
@@ -561,6 +575,7 @@ atom size
atom sl_alloc
atom spawn_executable
atom spawn_driver
+atom spawned
atom ssl_tls
atom stack_size
atom start
@@ -569,6 +584,7 @@ atom static
atom stderr_to_stdout
atom stop
atom stream
+atom strict_monotonic
atom strict_monotonic_timestamp
atom sunrm
atom suspend
@@ -596,8 +612,9 @@ atom total_active_tasks
atom total_heap_size
atom total_run_queue_lengths
atom tpkt
-atom trace trace_ts traced
+atom trace trace_ts traced
atom trace_control_word
+atom trace_status
atom tracer
atom trap_exit
atom trim
diff --git a/erts/emulator/beam/beam_bif_load.c b/erts/emulator/beam/beam_bif_load.c
index 0b47fc3586..40d44dda4c 100644
--- a/erts/emulator/beam/beam_bif_load.c
+++ b/erts/emulator/beam/beam_bif_load.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@
#include "erl_thr_progress.h"
static void set_default_trace_pattern(Eterm module);
-static Eterm check_process_code(Process* rp, Module* modp, Uint flags, int *redsp);
+static Eterm check_process_code(Process* rp, Module* modp, Uint flags, int *redsp, int fcalls);
static void delete_code(Module* modp);
static void decrement_refc(BeamCodeHeader*);
static int any_heap_ref_ptrs(Eterm* start, Eterm* end, char* mod_start, Uint mod_size);
@@ -467,7 +467,7 @@ check_old_code_1(BIF_ALIST_1)
}
Eterm
-erts_check_process_code(Process *c_p, Eterm module, Uint flags, int *redsp)
+erts_check_process_code(Process *c_p, Eterm module, Uint flags, int *redsp, int fcalls)
{
Module* modp;
Eterm res;
@@ -483,7 +483,7 @@ erts_check_process_code(Process *c_p, Eterm module, Uint flags, int *redsp)
return am_false;
erts_rlock_old_code(code_ix);
res = (!modp->old.code_hdr ? am_false :
- check_process_code(c_p, modp, flags, redsp));
+ check_process_code(c_p, modp, flags, redsp, fcalls));
erts_runlock_old_code(code_ix);
return res;
@@ -506,7 +506,7 @@ BIF_RETTYPE erts_internal_check_process_code_2(BIF_ALIST_2)
goto badarg;
}
- res = erts_check_process_code(BIF_P, BIF_ARG_1, flags, &reds);
+ res = erts_check_process_code(BIF_P, BIF_ARG_1, flags, &reds, BIF_P->fcalls);
ASSERT(is_value(res));
@@ -625,8 +625,8 @@ BIF_RETTYPE call_on_load_function_1(BIF_ALIST_1)
{
Module* modp = erts_get_module(BIF_ARG_1, erts_active_code_ix());
- if (modp && modp->curr.code_hdr) {
- BIF_TRAP_CODE_PTR_0(BIF_P, modp->curr.code_hdr->on_load_function_ptr);
+ if (modp && modp->old.code_hdr) {
+ BIF_TRAP_CODE_PTR_0(BIF_P, modp->old.code_hdr->on_load_function_ptr);
}
else {
BIF_ERROR(BIF_P, BADARG);
@@ -651,14 +651,14 @@ BIF_RETTYPE finish_after_on_load_2(BIF_ALIST_2)
code_ix = erts_active_code_ix();
modp = erts_get_module(BIF_ARG_1, code_ix);
- if (!modp || !modp->curr.code_hdr) {
+ if (!modp || !modp->old.code_hdr) {
error:
erts_smp_thr_progress_unblock();
erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
erts_release_code_write_permission();
BIF_ERROR(BIF_P, BADARG);
}
- if (modp->curr.code_hdr->on_load_function_ptr == NULL) {
+ if (modp->old.code_hdr->on_load_function_ptr == NULL) {
goto error;
}
if (BIF_ARG_2 != am_false && BIF_ARG_2 != am_true) {
@@ -667,44 +667,55 @@ BIF_RETTYPE finish_after_on_load_2(BIF_ALIST_2)
if (BIF_ARG_2 == am_true) {
int i;
+ struct erl_module_instance t;
+
+ /*
+ * Swap old and new code.
+ */
+ t = modp->curr;
+ modp->curr = modp->old;
+ modp->old = t;
/*
* The on_load function succeded. Fix up export entries.
*/
for (i = 0; i < export_list_size(code_ix); i++) {
Export *ep = export_list(i,code_ix);
- if (ep != NULL &&
- ep->code[0] == BIF_ARG_1 &&
- ep->code[4] != 0) {
+ if (ep == NULL || ep->code[0] != BIF_ARG_1) {
+ continue;
+ }
+ if (ep->code[4] != 0) {
ep->addressv[code_ix] = (void *) ep->code[4];
ep->code[4] = 0;
+ } else {
+ if (ep->addressv[code_ix] == ep->code+3 &&
+ ep->code[3] == (BeamInstr) em_apply_bif) {
+ continue;
+ }
+ ep->addressv[code_ix] = ep->code+3;
+ ep->code[3] = (BeamInstr) em_call_error_handler;
}
}
modp->curr.code_hdr->on_load_function_ptr = NULL;
set_default_trace_pattern(BIF_ARG_1);
} else if (BIF_ARG_2 == am_false) {
- BeamInstr* code;
- BeamInstr* end;
+ int i;
/*
- * The on_load function failed. Remove the loaded code.
- * This is an combination of delete and purge. We purge
- * the current code; the old code is not touched.
+ * The on_load function failed. Remove references to the
+ * code that is about to be purged from the export entries.
*/
- erts_total_code_size -= modp->curr.code_length;
- code = (BeamInstr*) modp->curr.code_hdr;
- end = (BeamInstr *) ((char *)code + modp->curr.code_length);
- erts_cleanup_funs_on_purge(code, end);
- beam_catches_delmod(modp->curr.catches, code, modp->curr.code_length,
- erts_active_code_ix());
- if (modp->curr.code_hdr->literals_start) {
- erts_free(ERTS_ALC_T_LITERAL, modp->curr.code_hdr->literals_start);
- }
- erts_free(ERTS_ALC_T_CODE, modp->curr.code_hdr);
- modp->curr.code_hdr = NULL;
- modp->curr.code_length = 0;
- modp->curr.catches = BEAM_CATCHES_NIL;
- erts_remove_from_ranges(code);
+
+ for (i = 0; i < export_list_size(code_ix); i++) {
+ Export *ep = export_list(i,code_ix);
+ if (ep == NULL || ep->code[0] != BIF_ARG_1) {
+ continue;
+ }
+ if (ep->code[3] == (BeamInstr) em_apply_bif) {
+ continue;
+ }
+ ep->code[4] = 0;
+ }
}
erts_smp_thr_progress_unblock();
erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
@@ -719,13 +730,13 @@ set_default_trace_pattern(Eterm module)
Binary *match_spec;
Binary *meta_match_spec;
struct trace_pattern_flags trace_pattern_flags;
- Eterm meta_tracer_pid;
+ ErtsTracer meta_tracer;
erts_get_default_trace_pattern(&trace_pattern_is_on,
&match_spec,
&meta_match_spec,
&trace_pattern_flags,
- &meta_tracer_pid);
+ &meta_tracer);
if (trace_pattern_is_on) {
Eterm mfa[1];
mfa[0] = module;
@@ -733,7 +744,7 @@ set_default_trace_pattern(Eterm module)
match_spec,
meta_match_spec,
1, trace_pattern_flags,
- meta_tracer_pid, 1);
+ meta_tracer, 1);
}
}
@@ -753,7 +764,7 @@ check_mod_funs(Process *p, ErlOffHeap *off_heap, char *area, size_t area_size)
static Eterm
-check_process_code(Process* rp, Module* modp, Uint flags, int *redsp)
+check_process_code(Process* rp, Module* modp, Uint flags, int *redsp, int fcalls)
{
BeamInstr* start;
char* literals;
@@ -832,7 +843,7 @@ check_process_code(Process* rp, Module* modp, Uint flags, int *redsp)
/*
* Message queue can contains funs, but (at least currently) no
- * constants. If we got references to this module from the message
+ * literals. If we got references to this module from the message
* queue, a GC cannot remove these...
*/
@@ -853,7 +864,7 @@ check_process_code(Process* rp, Module* modp, Uint flags, int *redsp)
for (; hfrag; hfrag = hfrag->next) {
if (check_mod_funs(rp, &hfrag->off_heap, mod_start, mod_size))
return am_true;
- /* Should not contain any constants... */
+ /* Should not contain any literals... */
ASSERT(!any_heap_refs(&hfrag->mem[0],
&hfrag->mem[hfrag->used_size],
literals,
@@ -908,7 +919,7 @@ check_process_code(Process* rp, Module* modp, Uint flags, int *redsp)
#ifdef DEBUG
/*
* Message buffer fragments should not have any references
- * to constants, and off heap lists should already have
+ * to literals, and off heap lists should already have
* been moved into process off heap structure.
*/
for (msgp = rp->msg_frag; msgp; msgp = msgp->next) {
@@ -945,7 +956,7 @@ check_process_code(Process* rp, Module* modp, Uint flags, int *redsp)
need_gc &= ~done_gc;
/*
- * Try to get rid of constants by by garbage collecting.
+ * Try to get rid of literals by by garbage collecting.
* Clear both fvalue and ftrace.
*/
@@ -955,7 +966,7 @@ check_process_code(Process* rp, Module* modp, Uint flags, int *redsp)
if (need_gc & ERTS_ORDINARY_GC__) {
FLAGS(rp) |= F_NEED_FULLSWEEP;
- *redsp += erts_garbage_collect_nobump(rp, 0, rp->arg_reg, rp->arity);
+ *redsp += erts_garbage_collect_nobump(rp, 0, rp->arg_reg, rp->arity, fcalls);
done_gc |= ERTS_ORDINARY_GC__;
}
if (need_gc & ERTS_LITERAL_GC__) {
@@ -1264,6 +1275,7 @@ delete_code(Module* modp)
modp->curr.code_length = 0;
modp->curr.catches = BEAM_CATCHES_NIL;
modp->curr.nif = NULL;
+
}
diff --git a/erts/emulator/beam/beam_bp.c b/erts/emulator/beam/beam_bp.c
index 5d471d168b..2ee98ed7b5 100644
--- a/erts/emulator/beam/beam_bp.c
+++ b/erts/emulator/beam/beam_bp.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -92,15 +92,15 @@ get_mtime(Process *c_p)
/*
** Helpers
*/
-static Eterm do_call_trace(Process* c_p, BeamInstr* I, Eterm* reg,
- int local, Binary* ms, Eterm tracer_pid);
+static ErtsTracer do_call_trace(Process* c_p, BeamInstr* I, Eterm* reg,
+ int local, Binary* ms, ErtsTracer tracer);
static void set_break(BpFunctions* f, Binary *match_spec, Uint break_flags,
- enum erts_break_op count_op, Eterm tracer_pid);
+ enum erts_break_op count_op, ErtsTracer tracer);
static void set_function_break(BeamInstr *pc,
Binary *match_spec,
Uint break_flags,
enum erts_break_op count_op,
- Eterm tracer_pid);
+ ErtsTracer tracer);
static void clear_break(BpFunctions* f, Uint break_flags);
static int clear_function_break(BeamInstr *pc, Uint break_flags);
@@ -108,7 +108,7 @@ static int clear_function_break(BeamInstr *pc, Uint break_flags);
static BpDataTime* get_time_break(BeamInstr *pc);
static GenericBpData* check_break(BeamInstr *pc, Uint break_flags);
-static void bp_meta_unref(BpMetaPid* bmp);
+static void bp_meta_unref(BpMetaTracer* bmt);
static void bp_count_unref(BpCount* bcp);
static void bp_time_unref(BpDataTime* bdt);
static void consolidate_bp_data(Module* modp, BeamInstr* pc, int local);
@@ -302,7 +302,7 @@ consolidate_bp_data(Module* modp, BeamInstr* pc, int local)
MatchSetUnref(dst->local_ms);
}
if (flags & ERTS_BPF_META_TRACE) {
- bp_meta_unref(dst->meta_pid);
+ bp_meta_unref(dst->meta_tracer);
MatchSetUnref(dst->meta_ms);
}
if (flags & ERTS_BPF_COUNT) {
@@ -343,8 +343,8 @@ consolidate_bp_data(Module* modp, BeamInstr* pc, int local)
MatchSetRef(dst->local_ms);
}
if (flags & ERTS_BPF_META_TRACE) {
- dst->meta_pid = src->meta_pid;
- erts_refc_inc(&dst->meta_pid->refc, 1);
+ dst->meta_tracer = src->meta_tracer;
+ erts_refc_inc(&dst->meta_tracer->refc, 1);
dst->meta_ms = src->meta_ms;
MatchSetRef(dst->meta_ms);
}
@@ -436,13 +436,13 @@ uninstall_breakpoint(BeamInstr* pc)
void
erts_set_trace_break(BpFunctions* f, Binary *match_spec)
{
- set_break(f, match_spec, ERTS_BPF_LOCAL_TRACE, 0, am_true);
+ set_break(f, match_spec, ERTS_BPF_LOCAL_TRACE, 0, erts_tracer_true);
}
void
-erts_set_mtrace_break(BpFunctions* f, Binary *match_spec, Eterm tracer_pid)
+erts_set_mtrace_break(BpFunctions* f, Binary *match_spec, ErtsTracer tracer)
{
- set_break(f, match_spec, ERTS_BPF_META_TRACE, 0, tracer_pid);
+ set_break(f, match_spec, ERTS_BPF_META_TRACE, 0, tracer);
}
void
@@ -450,13 +450,13 @@ erts_set_call_trace_bif(BeamInstr *pc, Binary *match_spec, int local)
{
Uint flags = local ? ERTS_BPF_LOCAL_TRACE : ERTS_BPF_GLOBAL_TRACE;
- set_function_break(pc, match_spec, flags, 0, NIL);
+ set_function_break(pc, match_spec, flags, 0, erts_tracer_nil);
}
void
-erts_set_mtrace_bif(BeamInstr *pc, Binary *match_spec, Eterm tracer_pid)
+erts_set_mtrace_bif(BeamInstr *pc, Binary *match_spec, ErtsTracer tracer)
{
- set_function_break(pc, match_spec, ERTS_BPF_META_TRACE, 0, tracer_pid);
+ set_function_break(pc, match_spec, ERTS_BPF_META_TRACE, 0, tracer);
}
void
@@ -464,7 +464,7 @@ erts_set_time_trace_bif(BeamInstr *pc, enum erts_break_op count_op)
{
set_function_break(pc, NULL,
ERTS_BPF_TIME_TRACE|ERTS_BPF_TIME_TRACE_ACTIVE,
- count_op, NIL);
+ count_op, erts_tracer_nil);
}
void
@@ -474,21 +474,21 @@ erts_clear_time_trace_bif(BeamInstr *pc) {
void
erts_set_debug_break(BpFunctions* f) {
- set_break(f, NULL, ERTS_BPF_DEBUG, 0, NIL);
+ set_break(f, NULL, ERTS_BPF_DEBUG, 0, erts_tracer_nil);
}
void
erts_set_count_break(BpFunctions* f, enum erts_break_op count_op)
{
set_break(f, 0, ERTS_BPF_COUNT|ERTS_BPF_COUNT_ACTIVE,
- count_op, NIL);
+ count_op, erts_tracer_nil);
}
void
erts_set_time_break(BpFunctions* f, enum erts_break_op count_op)
{
set_break(f, 0, ERTS_BPF_TIME_TRACE|ERTS_BPF_TIME_TRACE_ACTIVE,
- count_op, NIL);
+ count_op, erts_tracer_nil);
}
void
@@ -625,19 +625,26 @@ erts_generic_breakpoint(Process* c_p, BeamInstr* I, Eterm* reg)
if (bp_flags & ERTS_BPF_LOCAL_TRACE) {
ASSERT((bp_flags & ERTS_BPF_GLOBAL_TRACE) == 0);
- (void) do_call_trace(c_p, I, reg, 1, bp->local_ms, am_true);
+ (void) do_call_trace(c_p, I, reg, 1, bp->local_ms, erts_tracer_true);
} else if (bp_flags & ERTS_BPF_GLOBAL_TRACE) {
- (void) do_call_trace(c_p, I, reg, 0, bp->local_ms, am_true);
+ (void) do_call_trace(c_p, I, reg, 0, bp->local_ms, erts_tracer_true);
}
if (bp_flags & ERTS_BPF_META_TRACE) {
- Eterm old_pid;
- Eterm new_pid;
-
- old_pid = (Eterm) erts_smp_atomic_read_nob(&bp->meta_pid->pid);
- new_pid = do_call_trace(c_p, I, reg, 1, bp->meta_ms, old_pid);
- if (new_pid != old_pid) {
- erts_smp_atomic_set_nob(&bp->meta_pid->pid, new_pid);
+ ErtsTracer old_tracer, new_tracer;
+
+ old_tracer = erts_smp_atomic_read_nob(&bp->meta_tracer->tracer);
+
+ new_tracer = do_call_trace(c_p, I, reg, 1, bp->meta_ms, old_tracer);
+ if (!ERTS_TRACER_COMPARE(new_tracer, old_tracer)) {
+ if (old_tracer == erts_smp_atomic_cmpxchg_acqb(
+ &bp->meta_tracer->tracer,
+ (erts_aint_t)new_tracer,
+ (erts_aint_t)old_tracer)) {
+ ERTS_TRACER_CLEAR(&old_tracer);
+ } else {
+ ERTS_TRACER_CLEAR(&new_tracer);
+ }
}
}
@@ -645,7 +652,8 @@ erts_generic_breakpoint(Process* c_p, BeamInstr* I, Eterm* reg)
erts_smp_atomic_inc_nob(&bp->count->acount);
}
- if (bp_flags & ERTS_BPF_TIME_TRACE_ACTIVE && erts_is_tracer_proc_valid(c_p)) {
+ if (bp_flags & ERTS_BPF_TIME_TRACE_ACTIVE
+ && ERTS_TRACER_PROC_IS_ENABLED(c_p)) {
Eterm w;
erts_trace_time_call(c_p, I, bp->time);
w = (BeamInstr) *c_p->cp;
@@ -690,7 +698,7 @@ erts_bif_trace(int bif_index, Process* p, Eterm* args, BeamInstr* I)
Eterm (*func)(Process*, Eterm*, BeamInstr*);
Export* ep = bif_export[bif_index];
Uint32 flags = 0, flags_meta = 0;
- Eterm meta_tracer_pid = NIL;
+ ErtsTracer meta_tracer = erts_tracer_nil;
int applying = (I == &(ep->code[3])); /* Yup, the apply code for a bif
* is actually in the
* export entry */
@@ -718,23 +726,32 @@ erts_bif_trace(int bif_index, Process* p, Eterm* args, BeamInstr* I)
IS_TRACED_FL(p, F_TRACE_CALLS)) {
int local = !!(bp_flags & ERTS_BPF_LOCAL_TRACE);
flags = erts_call_trace(p, ep->code, bp->local_ms, args,
- local, &ERTS_TRACER_PROC(p));
+ local, &ERTS_TRACER(p));
}
if (bp_flags & ERTS_BPF_META_TRACE) {
- Eterm tpid1, tpid2;
+ ErtsTracer old_tracer;
- tpid1 = tpid2 =
- (Eterm) erts_smp_atomic_read_nob(&bp->meta_pid->pid);
+ meta_tracer = erts_smp_atomic_read_nob(&bp->meta_tracer->tracer);
+ old_tracer = meta_tracer;
flags_meta = erts_call_trace(p, ep->code, bp->meta_ms, args,
- 0, &tpid2);
- meta_tracer_pid = tpid2;
- if (tpid1 != tpid2) {
- erts_smp_atomic_set_nob(&bp->meta_pid->pid, tpid2);
+ 0, &meta_tracer);
+
+ if (!ERTS_TRACER_COMPARE(old_tracer, meta_tracer)) {
+ ErtsTracer new_tracer = erts_tracer_nil;
+ erts_tracer_update(&new_tracer, meta_tracer);
+ if (old_tracer == erts_smp_atomic_cmpxchg_acqb(
+ &bp->meta_tracer->tracer,
+ (erts_aint_t)new_tracer,
+ (erts_aint_t)old_tracer)) {
+ ERTS_TRACER_CLEAR(&old_tracer);
+ } else {
+ ERTS_TRACER_CLEAR(&new_tracer);
+ }
}
}
if (bp_flags & ERTS_BPF_TIME_TRACE_ACTIVE &&
IS_TRACED_FL(p, F_TRACE_CALLS) &&
- erts_is_tracer_proc_valid(p)) {
+ ERTS_TRACER_PROC_IS_ENABLED(p)) {
BeamInstr *pc = (BeamInstr *)ep->code+3;
erts_trace_time_call(p, pc, bp->time);
}
@@ -778,8 +795,6 @@ erts_bif_trace(int bif_index, Process* p, Eterm* args, BeamInstr* I)
if (reason != TRAP) {
Eterm class;
Eterm value = p->fvalue;
- DeclareTmpHeapNoproc(nocatch,3);
- UseTmpHeapNoproc(3);
/* Expand error value like in handle_error() */
if (reason & EXF_ARGLIST) {
Eterm *tp;
@@ -788,7 +803,8 @@ erts_bif_trace(int bif_index, Process* p, Eterm* args, BeamInstr* I)
value = tp[1];
}
if ((reason & EXF_THROWN) && (p->catches <= 0)) {
- value = TUPLE2(nocatch, am_nocatch, value);
+ Eterm *hp = HAlloc(p, 3);
+ value = TUPLE2(hp, am_nocatch, value);
reason = EXC_ERROR;
}
/* Note: expand_error_value() could theoretically
@@ -801,11 +817,11 @@ erts_bif_trace(int bif_index, Process* p, Eterm* args, BeamInstr* I)
if (flags_meta & MATCH_SET_EXCEPTION_TRACE) {
erts_trace_exception(p, ep->code, class, value,
- &meta_tracer_pid);
+ &meta_tracer);
}
if (flags & MATCH_SET_EXCEPTION_TRACE) {
erts_trace_exception(p, ep->code, class, value,
- &ERTS_TRACER_PROC(p));
+ &ERTS_TRACER(p));
}
if ((flags & MATCH_SET_RETURN_TO_TRACE) && p->catches > 0) {
/* can only happen if(local)*/
@@ -827,7 +843,6 @@ erts_bif_trace(int bif_index, Process* p, Eterm* args, BeamInstr* I)
}
}
}
- UnUseTmpHeapNoproc(3);
if ((flags_meta|flags) & MATCH_SET_EXCEPTION_TRACE) {
erts_smp_proc_lock(p, ERTS_PROC_LOCKS_ALL_MINOR);
ERTS_TRACE_FLAGS(p) |= F_EXCEPTION_TRACE;
@@ -836,11 +851,11 @@ erts_bif_trace(int bif_index, Process* p, Eterm* args, BeamInstr* I)
}
} else {
if (flags_meta & MATCH_SET_RX_TRACE) {
- erts_trace_return(p, ep->code, result, &meta_tracer_pid);
+ erts_trace_return(p, ep->code, result, &meta_tracer);
}
/* MATCH_SET_RETURN_TO_TRACE cannot occur if(meta) */
if (flags & MATCH_SET_RX_TRACE) {
- erts_trace_return(p, ep->code, result, &ERTS_TRACER_PROC(p));
+ erts_trace_return(p, ep->code, result, &ERTS_TRACER(p));
}
if (flags & MATCH_SET_RETURN_TO_TRACE) {
/* can only happen if(local)*/
@@ -857,9 +872,9 @@ erts_bif_trace(int bif_index, Process* p, Eterm* args, BeamInstr* I)
return result;
}
-static Eterm
+static ErtsTracer
do_call_trace(Process* c_p, BeamInstr* I, Eterm* reg,
- int local, Binary* ms, Eterm tracer_pid)
+ int local, Binary* ms, ErtsTracer tracer)
{
Eterm* cpp;
int return_to_trace = 0;
@@ -899,7 +914,7 @@ do_call_trace(Process* c_p, BeamInstr* I, Eterm* reg,
ASSERT(is_CP(*cpp));
}
ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p);
- flags = erts_call_trace(c_p, I-3, ms, reg, local, &tracer_pid);
+ flags = erts_call_trace(c_p, I-3, ms, reg, local, &tracer);
ERTS_SMP_REQ_PROC_MAIN_LOCK(c_p);
if (cpp) {
c_p->cp = cp_save;
@@ -910,7 +925,7 @@ do_call_trace(Process* c_p, BeamInstr* I, Eterm* reg,
need += 1;
}
if (flags & MATCH_SET_RX_TRACE) {
- need += 3;
+ need += 3 + size_object(tracer);
}
if (need) {
ASSERT(c_p->htop <= E && E <= c_p->hend);
@@ -926,14 +941,15 @@ do_call_trace(Process* c_p, BeamInstr* I, Eterm* reg,
E[0] = make_cp(c_p->cp);
c_p->cp = beam_return_to_trace;
}
- if (flags & MATCH_SET_RX_TRACE) {
+ if (flags & MATCH_SET_RX_TRACE)
+ {
E -= 3;
+ c_p->stop = E;
ASSERT(c_p->htop <= E && E <= c_p->hend);
ASSERT(is_CP((Eterm) (UWord) (I - 3)));
- ASSERT(am_true == tracer_pid ||
- is_internal_pid(tracer_pid) || is_internal_port(tracer_pid));
+ ASSERT(IS_TRACER_VALID(tracer));
E[2] = make_cp(c_p->cp);
- E[1] = tracer_pid;
+ E[1] = copy_object(tracer, c_p);
E[0] = make_cp(I - 3); /* We ARE at the beginning of an
instruction,
the funcinfo is above i. */
@@ -942,9 +958,9 @@ do_call_trace(Process* c_p, BeamInstr* I, Eterm* reg,
erts_smp_proc_lock(c_p, ERTS_PROC_LOCKS_ALL_MINOR);
ERTS_TRACE_FLAGS(c_p) |= F_EXCEPTION_TRACE;
erts_smp_proc_unlock(c_p, ERTS_PROC_LOCKS_ALL_MINOR);
- }
- c_p->stop = E;
- return tracer_pid;
+ } else
+ c_p->stop = E;
+ return tracer;
}
void
@@ -974,7 +990,7 @@ erts_trace_time_call(Process* c_p, BeamInstr* I, BpDataTime* bdt)
if (pbt == 0) {
/* First call of process to instrumented function */
pbt = Alloc(sizeof(process_breakpoint_time_t));
- (void) ERTS_PROC_SET_CALL_TIME(c_p, ERTS_PROC_LOCK_MAIN, pbt);
+ (void) ERTS_PROC_SET_CALL_TIME(c_p, pbt);
} else {
ASSERT(pbt->pc);
/* add time to previous code */
@@ -1098,9 +1114,9 @@ erts_is_trace_break(BeamInstr *pc, Binary **match_spec_ret, int local)
return 0;
}
-int
+int
erts_is_mtrace_break(BeamInstr *pc, Binary **match_spec_ret,
- Eterm *tracer_pid_ret)
+ ErtsTracer *tracer_ret)
{
GenericBpData* bp = check_break(pc, ERTS_BPF_META_TRACE);
@@ -1108,9 +1124,8 @@ erts_is_mtrace_break(BeamInstr *pc, Binary **match_spec_ret,
if (match_spec_ret) {
*match_spec_ret = bp->meta_ms;
}
- if (tracer_pid_ret) {
- *tracer_pid_ret =
- (Eterm) erts_smp_atomic_read_nob(&bp->meta_pid->pid);
+ if (tracer_ret) {
+ *tracer_ret = erts_smp_atomic_read_nob(&bp->meta_tracer->tracer);
}
return 1;
}
@@ -1391,7 +1406,7 @@ void erts_schedule_time_break(Process *p, Uint schedule) {
static void
set_break(BpFunctions* f, Binary *match_spec, Uint break_flags,
- enum erts_break_op count_op, Eterm tracer_pid)
+ enum erts_break_op count_op, ErtsTracer tracer)
{
Uint i;
Uint n;
@@ -1400,13 +1415,13 @@ set_break(BpFunctions* f, Binary *match_spec, Uint break_flags,
for (i = 0; i < n; i++) {
BeamInstr* pc = f->matching[i].pc;
set_function_break(pc, match_spec, break_flags,
- count_op, tracer_pid);
+ count_op, tracer);
}
}
static void
set_function_break(BeamInstr *pc, Binary *match_spec, Uint break_flags,
- enum erts_break_op count_op, Eterm tracer_pid)
+ enum erts_break_op count_op, ErtsTracer tracer)
{
GenericBp* g;
GenericBpData* bp;
@@ -1439,7 +1454,7 @@ set_function_break(BeamInstr *pc, Binary *match_spec, Uint break_flags,
MatchSetUnref(bp->local_ms);
} else if (common & ERTS_BPF_META_TRACE) {
MatchSetUnref(bp->meta_ms);
- bp_meta_unref(bp->meta_pid);
+ bp_meta_unref(bp->meta_tracer);
} else if (common & ERTS_BPF_COUNT) {
if (count_op == erts_break_stop) {
bp->flags &= ~ERTS_BPF_COUNT_ACTIVE;
@@ -1474,13 +1489,15 @@ set_function_break(BeamInstr *pc, Binary *match_spec, Uint break_flags,
MatchSetRef(match_spec);
bp->local_ms = match_spec;
} else if (break_flags & ERTS_BPF_META_TRACE) {
- BpMetaPid* bmp;
+ BpMetaTracer* bmt;
+ ErtsTracer meta_tracer = erts_tracer_nil;
MatchSetRef(match_spec);
bp->meta_ms = match_spec;
- bmp = Alloc(sizeof(BpMetaPid));
- erts_refc_init(&bmp->refc, 1);
- erts_smp_atomic_init_nob(&bmp->pid, tracer_pid);
- bp->meta_pid = bmp;
+ bmt = Alloc(sizeof(BpMetaTracer));
+ erts_refc_init(&bmt->refc, 1);
+ erts_tracer_update(&meta_tracer, tracer); /* copy tracer */
+ erts_smp_atomic_init_nob(&bmt->tracer, (erts_aint_t)meta_tracer);
+ bp->meta_tracer = bmt;
} else if (break_flags & ERTS_BPF_COUNT) {
BpCount* bcp;
@@ -1544,7 +1561,7 @@ clear_function_break(BeamInstr *pc, Uint break_flags)
}
if (common & ERTS_BPF_META_TRACE) {
MatchSetUnref(bp->meta_ms);
- bp_meta_unref(bp->meta_pid);
+ bp_meta_unref(bp->meta_tracer);
}
if (common & ERTS_BPF_COUNT) {
ASSERT((bp->flags & ERTS_BPF_COUNT_ACTIVE) == 0);
@@ -1560,10 +1577,12 @@ clear_function_break(BeamInstr *pc, Uint break_flags)
}
static void
-bp_meta_unref(BpMetaPid* bmp)
+bp_meta_unref(BpMetaTracer* bmt)
{
- if (erts_refc_dectest(&bmp->refc, 0) <= 0) {
- Free(bmp);
+ if (erts_refc_dectest(&bmt->refc, 0) <= 0) {
+ ErtsTracer trc = erts_smp_atomic_read_nob(&bmt->tracer);
+ ERTS_TRACER_CLEAR(&trc);
+ Free(bmt);
}
}
@@ -1598,9 +1617,7 @@ bp_time_unref(BpDataTime* bdt)
h_p = erts_pid2proc(NULL, 0, item->pid,
ERTS_PROC_LOCK_MAIN);
if (h_p) {
- pbt = ERTS_PROC_SET_CALL_TIME(h_p,
- ERTS_PROC_LOCK_MAIN,
- NULL);
+ pbt = ERTS_PROC_SET_CALL_TIME(h_p, NULL);
if (pbt) {
Free(pbt);
}
diff --git a/erts/emulator/beam/beam_bp.h b/erts/emulator/beam/beam_bp.h
index 2b89d6fc71..08641b86d6 100644
--- a/erts/emulator/beam/beam_bp.h
+++ b/erts/emulator/beam/beam_bp.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -55,15 +55,15 @@ typedef struct {
} BpCount;
typedef struct {
- erts_smp_atomic_t pid;
+ erts_smp_atomic_t tracer;
erts_refc_t refc;
-} BpMetaPid;
+} BpMetaTracer;
typedef struct generic_bp_data {
Uint flags;
Binary* local_ms; /* Match spec for local call trace */
Binary* meta_ms; /* Match spec for meta trace */
- BpMetaPid* meta_pid; /* Meta trace pid */
+ BpMetaTracer* meta_tracer; /* Meta tracer */
BpCount* count; /* For call count */
BpDataTime* time; /* For time trace */
} GenericBpData;
@@ -132,10 +132,10 @@ void erts_set_call_trace_bif(BeamInstr *pc, Binary *match_spec, int local);
void erts_clear_call_trace_bif(BeamInstr *pc, int local);
void erts_set_mtrace_break(BpFunctions *f, Binary *match_spec,
- Eterm tracer_pid);
+ ErtsTracer tracer);
void erts_clear_mtrace_break(BpFunctions *f);
void erts_set_mtrace_bif(BeamInstr *pc, Binary *match_spec,
- Eterm tracer_pid);
+ ErtsTracer tracer);
void erts_clear_mtrace_bif(BeamInstr *pc);
void erts_set_debug_break(BpFunctions *f);
@@ -150,13 +150,13 @@ void erts_clear_export_break(Module *modp, BeamInstr* pc);
BeamInstr erts_generic_breakpoint(Process* c_p, BeamInstr* I, Eterm* reg);
BeamInstr erts_trace_break(Process *p, BeamInstr *pc, Eterm *args,
- Uint32 *ret_flags, Eterm *tracer_pid);
+ Uint32 *ret_flags, ErtsTracer *tracer);
int erts_is_trace_break(BeamInstr *pc, Binary **match_spec_ret, int local);
int erts_is_mtrace_break(BeamInstr *pc, Binary **match_spec_ret,
- Eterm *tracer_pid_rte);
+ ErtsTracer *tracer_ret);
int erts_is_mtrace_bif(BeamInstr *pc, Binary **match_spec_ret,
- Eterm *tracer_pid_ret);
+ ErtsTracer *tracer_ret);
int erts_is_native_break(BeamInstr *pc);
int erts_is_count_break(BeamInstr *pc, Uint *count_ret);
int erts_is_time_break(Process *p, BeamInstr *pc, Eterm *call_time);
@@ -173,19 +173,7 @@ void erts_clear_time_trace_bif(BeamInstr *pc);
BeamInstr *erts_find_local_func(Eterm mfa[3]);
-ERTS_GLB_INLINE Uint erts_bp_sched2ix(void);
-
#if ERTS_GLB_INLINE_INCL_FUNC_DEF
-ERTS_GLB_INLINE Uint erts_bp_sched2ix(void)
-{
-#ifdef ERTS_SMP
- ErtsSchedulerData *esdp;
- esdp = erts_get_scheduler_data();
- return esdp->no - 1;
-#else
- return 0;
-#endif
-}
extern erts_smp_atomic32_t erts_active_bp_index;
extern erts_smp_atomic32_t erts_staging_bp_index;
diff --git a/erts/emulator/beam/beam_catches.c b/erts/emulator/beam/beam_catches.c
index 7a1f4901aa..cd592c7e5e 100644
--- a/erts/emulator/beam/beam_catches.c
+++ b/erts/emulator/beam/beam_catches.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/beam_catches.h b/erts/emulator/beam/beam_catches.h
index 59ee64d033..8eb2165ac9 100644
--- a/erts/emulator/beam/beam_catches.h
+++ b/erts/emulator/beam/beam_catches.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c
index e37bd4d78c..a4ad3e7886 100644
--- a/erts/emulator/beam/beam_debug.c
+++ b/erts/emulator/beam/beam_debug.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -431,7 +431,7 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr)
packed >>= 10;
break;
case '0': /* Tight shift */
- *ap++ = packed & (BEAM_TIGHT_MASK / sizeof(Eterm));
+ *ap++ = packed & BEAM_TIGHT_MASK;
packed >>= BEAM_TIGHT_SHIFT;
break;
case '6': /* Shift 16 steps */
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
index a390422040..59112e1e43 100644
--- a/erts/emulator/beam/beam_emu.c
+++ b/erts/emulator/beam/beam_emu.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -308,7 +308,8 @@ void** beam_ops;
if (E - HTOP < (needed + (HeapNeed))) { \
SWAPOUT; \
PROCESS_MAIN_CHK_LOCKS(c_p); \
- FCALLS -= erts_garbage_collect_nobump(c_p, needed + (HeapNeed), reg, (M)); \
+ FCALLS -= erts_garbage_collect_nobump(c_p, needed + (HeapNeed), \
+ reg, (M), FCALLS); \
ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); \
PROCESS_MAIN_CHK_LOCKS(c_p); \
SWAPIN; \
@@ -360,7 +361,7 @@ void** beam_ops;
if ((E - HTOP < need) || (MSO(c_p).overhead + (VNh) >= BIN_VHEAP_SZ(c_p))) {\
SWAPOUT; \
PROCESS_MAIN_CHK_LOCKS(c_p); \
- FCALLS -= erts_garbage_collect_nobump(c_p, need, reg, (Live)); \
+ FCALLS -= erts_garbage_collect_nobump(c_p, need, reg, (Live), FCALLS); \
ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); \
PROCESS_MAIN_CHK_LOCKS(c_p); \
SWAPIN; \
@@ -381,7 +382,7 @@ void** beam_ops;
if (E - HTOP < need) { \
SWAPOUT; \
PROCESS_MAIN_CHK_LOCKS(c_p); \
- FCALLS -= erts_garbage_collect_nobump(c_p, need, reg, (Live));\
+ FCALLS -= erts_garbage_collect_nobump(c_p, need, reg, (Live), FCALLS); \
ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); \
PROCESS_MAIN_CHK_LOCKS(c_p); \
SWAPIN; \
@@ -402,7 +403,7 @@ void** beam_ops;
SWAPOUT; \
reg[Live] = Extra; \
PROCESS_MAIN_CHK_LOCKS(c_p); \
- FCALLS -= erts_garbage_collect_nobump(c_p, need, reg, (Live)+1); \
+ FCALLS -= erts_garbage_collect_nobump(c_p, need, reg, (Live)+1, FCALLS); \
ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); \
PROCESS_MAIN_CHK_LOCKS(c_p); \
Extra = reg[Live]; \
@@ -702,6 +703,17 @@ void** beam_ops;
dst[1] = E2; \
} while (0)
+#define GetTupleElement2Y(Src, Element, D1, D2) \
+ do { \
+ Eterm* src; \
+ Eterm E1, E2; \
+ src = ADD_BYTE_OFFSET(tuple_val(Src), (Element)); \
+ E1 = src[0]; \
+ E2 = src[1]; \
+ D1 = E1; \
+ D2 = E2; \
+ } while (0)
+
#define GetTupleElement3(Src, Element, Dest) \
do { \
Eterm* src; \
@@ -1185,6 +1197,25 @@ init_emulator(void)
#define DTRACE_NIF_RETURN(p, m, f, a) do {} while (0)
#endif /* USE_VM_PROBES */
+#ifdef DEBUG
+#define ERTS_DBG_CHK_REDS(P, FC) \
+ do { \
+ if (ERTS_PROC_GET_SAVED_CALLS_BUF((P))) { \
+ ASSERT(FC <= 0); \
+ ASSERT(ERTS_PROC_GET_SCHDATA(c_p)->virtual_reds \
+ <= 0 - (FC)); \
+ } \
+ else { \
+ ASSERT(FC <= CONTEXT_REDS); \
+ ASSERT(ERTS_PROC_GET_SCHDATA(c_p)->virtual_reds \
+ <= CONTEXT_REDS - (FC)); \
+ } \
+} while (0)
+#else
+#define ERTS_DBG_CHK_REDS(P, FC)
+#endif
+
+
/*
* process_main() is called twice:
* The first call performs some initialisation, including exporting
@@ -1279,7 +1310,12 @@ void process_main(void)
goto do_schedule1;
do_schedule:
- reds_used = REDS_IN(c_p) - FCALLS;
+ ASSERT(c_p->debug_reds_in == REDS_IN(c_p));
+ if (!ERTS_PROC_GET_SAVED_CALLS_BUF(c_p))
+ reds_used = REDS_IN(c_p) - FCALLS;
+ else
+ reds_used = REDS_IN(c_p) - (CONTEXT_REDS + FCALLS);
+ ASSERT(reds_used >= 0);
do_schedule1:
if (start_time != 0) {
@@ -1299,6 +1335,7 @@ void process_main(void)
ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p);
ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p);
c_p = schedule(c_p, reds_used);
+ ASSERT(!(c_p->flags & F_HIPE_MODE));
ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p);
start_time = 0;
#ifdef DEBUG
@@ -1337,16 +1374,21 @@ void process_main(void)
SET_I(c_p->i);
- reds = c_p->fcalls;
- if (ERTS_PROC_GET_SAVED_CALLS_BUF(c_p)
- && (ERTS_TRACE_FLAGS(c_p) & F_SENSITIVE) == 0) {
- neg_o_reds = -reds;
- FCALLS = REDS_IN(c_p) = 0;
+ REDS_IN(c_p) = reds = c_p->fcalls;
+#ifdef DEBUG
+ c_p->debug_reds_in = reds;
+#endif
+
+ if (ERTS_PROC_GET_SAVED_CALLS_BUF(c_p)) {
+ neg_o_reds = -CONTEXT_REDS;
+ FCALLS = neg_o_reds + reds;
} else {
neg_o_reds = 0;
- FCALLS = REDS_IN(c_p) = reds;
+ FCALLS = reds;
}
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
+
next = (BeamInstr *) *I;
SWAPIN;
ASSERT(VALID_INSTR(next));
@@ -1759,7 +1801,7 @@ void process_main(void)
if (E - HTOP < 3) {
SWAPOUT;
PROCESS_MAIN_CHK_LOCKS(c_p);
- FCALLS -= erts_garbage_collect_nobump(c_p, 3, reg+2, 1);
+ FCALLS -= erts_garbage_collect_nobump(c_p, 3, reg+2, 1, FCALLS);
ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p);
PROCESS_MAIN_CHK_LOCKS(c_p);
SWAPIN;
@@ -1854,6 +1896,7 @@ void process_main(void)
c_p->flags |= F_DELAY_GC;
loop_rec__:
+
PROCESS_MAIN_CHK_LOCKS(c_p);
msgp = PEEK_MESSAGE(c_p);
@@ -1996,6 +2039,8 @@ void process_main(void)
ERTS_VBUMP_LEAVE_REDS_INTERNAL(c_p, 5, FCALLS);
}
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
+
ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p);
PROCESS_MAIN_CHK_LOCKS(c_p);
NextPF(0, next);
@@ -2524,6 +2569,7 @@ do { \
GetArg1(2, tmp_reg[0]);
bf = (BifFunction) Arg(1);
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
c_p->fcalls = FCALLS;
PROCESS_MAIN_CHK_LOCKS(c_p);
ASSERT(!ERTS_PROC_IS_EXITING(c_p));
@@ -2533,6 +2579,7 @@ do { \
PROCESS_MAIN_CHK_LOCKS(c_p);
ERTS_HOLE_CHECK(c_p);
FCALLS = c_p->fcalls;
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
if (is_value(result)) {
StoreBifResult(3, result);
}
@@ -2553,6 +2600,7 @@ do { \
GetArg1(1, tmp_reg[0]);
bf = (BifFunction) Arg(0);
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
c_p->fcalls = FCALLS;
PROCESS_MAIN_CHK_LOCKS(c_p);
ASSERT(!ERTS_PROC_IS_EXITING(c_p));
@@ -2562,6 +2610,7 @@ do { \
PROCESS_MAIN_CHK_LOCKS(c_p);
ERTS_HOLE_CHECK(c_p);
FCALLS = c_p->fcalls;
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
if (is_value(result)) {
StoreBifResult(2, result);
}
@@ -2580,6 +2629,7 @@ do { \
GetArg1(2, x(live));
bf = (GcBifFunction) Arg(1);
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
c_p->fcalls = FCALLS;
SWAPOUT;
PROCESS_MAIN_CHK_LOCKS(c_p);
@@ -2591,6 +2641,7 @@ do { \
SWAPIN;
ERTS_HOLE_CHECK(c_p);
FCALLS = c_p->fcalls;
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
if (is_value(result)) {
StoreBifResult(4, result);
}
@@ -2619,6 +2670,7 @@ do { \
*/
live++;
bf = (GcBifFunction) Arg(1);
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
c_p->fcalls = FCALLS;
SWAPOUT;
PROCESS_MAIN_CHK_LOCKS(c_p);
@@ -2630,6 +2682,7 @@ do { \
SWAPIN;
ERTS_HOLE_CHECK(c_p);
FCALLS = c_p->fcalls;
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
if (is_value(result)) {
StoreBifResult(5, result);
}
@@ -2660,6 +2713,7 @@ do { \
*/
live += 2;
bf = (GcBifFunction) Arg(1);
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
c_p->fcalls = FCALLS;
SWAPOUT;
PROCESS_MAIN_CHK_LOCKS(c_p);
@@ -2671,6 +2725,7 @@ do { \
SWAPIN;
ERTS_HOLE_CHECK(c_p);
FCALLS = c_p->fcalls;
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
if (is_value(result)) {
StoreBifResult(5, result);
}
@@ -2697,6 +2752,7 @@ do { \
GetArg2(2, tmp_reg[0], tmp_reg[1]);
bf = (BifFunction) Arg(1);
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
c_p->fcalls = FCALLS;
PROCESS_MAIN_CHK_LOCKS(c_p);
ASSERT(!ERTS_PROC_IS_EXITING(c_p));
@@ -2706,6 +2762,7 @@ do { \
PROCESS_MAIN_CHK_LOCKS(c_p);
ERTS_HOLE_CHECK(c_p);
FCALLS = c_p->fcalls;
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
if (is_value(result)) {
StoreBifResult(4, result);
}
@@ -2764,6 +2821,7 @@ do { \
bf = GET_BIF_ADDRESS(Arg(0));
PRE_BIF_SWAPOUT(c_p);
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
c_p->fcalls = FCALLS - 1;
if (FCALLS <= 0) {
save_calls(c_p, (Export *) Arg(0));
@@ -2785,6 +2843,7 @@ do { \
PROCESS_MAIN_CHK_LOCKS(c_p);
HTOP = HEAP_TOP(c_p);
FCALLS = c_p->fcalls;
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
/* We have to update the cache if we are enabled in order
to make sure no book keeping is done after we disabled
msacc. We don't always do this as it is quite expensive. */
@@ -3313,8 +3372,13 @@ do { \
* (beacuse the code for the Dispatch() macro becomes shorter that way).
*/
- reds_used = REDS_IN(c_p) - FCALLS + 1;
-
+ ASSERT(c_p->debug_reds_in == REDS_IN(c_p));
+ if (!ERTS_PROC_GET_SAVED_CALLS_BUF(c_p))
+ reds_used = REDS_IN(c_p) - FCALLS;
+ else
+ reds_used = REDS_IN(c_p) - (CONTEXT_REDS + FCALLS);
+ ASSERT(reds_used >= 0);
+
/*
* Save the argument registers and everything else.
*/
@@ -3346,7 +3410,7 @@ do { \
OpCase(normal_exit): {
SWAPOUT;
c_p->freason = EXC_NORMAL;
- c_p->arity = 0; /* In case this process will ever be garbed again. */
+ c_p->arity = 0; /* In case this process will never be garbed again. */
ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p);
erts_do_exit_process(c_p, am_normal);
ERTS_SMP_REQ_PROC_MAIN_LOCK(c_p);
@@ -3360,48 +3424,18 @@ do { \
goto do_schedule;
}
- OpCase(raise_ss): {
- /* This was not done very well in R10-0; then, we passed the tag in
- the first argument and hoped that the existing c_p->ftrace was
- still correct. But the ftrace-object already includes the tag
- (or rather, the freason). Now, we pass the original ftrace in
- the first argument. We also handle atom tags in the first
- argument for backwards compatibility.
- */
- Eterm raise_val1;
- Eterm raise_val2;
- GetArg2(0, raise_val1, raise_val2);
- c_p->fvalue = raise_val2;
- if (c_p->freason == EXC_NULL) {
- /* a safety check for the R10-0 case; should not happen */
- c_p->ftrace = NIL;
- c_p->freason = EXC_ERROR;
- }
- /* for R10-0 code, keep existing c_p->ftrace and hope it's correct */
- switch (raise_val1) {
- case am_throw:
- c_p->freason = EXC_THROWN & ~EXF_SAVETRACE;
- break;
- case am_error:
- c_p->freason = EXC_ERROR & ~EXF_SAVETRACE;
- break;
- case am_exit:
- c_p->freason = EXC_EXIT & ~EXF_SAVETRACE;
- break;
- default:
- {/* R10-1 and later
- XXX note: should do sanity check on given trace if it can be
- passed from a user! Currently only expecting generated calls.
- */
- struct StackTrace *s;
- c_p->ftrace = raise_val1;
- s = get_trace_from_exc(raise_val1);
- if (s == NULL) {
- c_p->freason = EXC_ERROR;
- } else {
- c_p->freason = PRIMARY_EXCEPTION(s->freason);
- }
- }
+ OpCase(i_raise): {
+ Eterm raise_trace = x(2);
+ Eterm raise_value = x(1);
+ struct StackTrace *s;
+
+ c_p->fvalue = raise_value;
+ c_p->ftrace = raise_trace;
+ s = get_trace_from_exc(raise_trace);
+ if (s == NULL) {
+ c_p->freason = EXC_ERROR;
+ } else {
+ c_p->freason = PRIMARY_EXCEPTION(s->freason);
}
goto find_func_info;
}
@@ -3490,7 +3524,7 @@ do { \
typedef Eterm NifF(struct enif_environment_t*, int argc, Eterm argv[]);
NifF* fp = vbf = (NifF*) I[1];
struct enif_environment_t env;
- erts_pre_nif(&env, c_p, (struct erl_module_nif*)I[2]);
+ erts_pre_nif(&env, c_p, (struct erl_module_nif*)I[2], NULL);
live_hf_end = c_p->mbuf;
nif_bif_result = (*fp)(&env, bif_nif_arity, reg);
if (env.exception_thrown)
@@ -3533,6 +3567,7 @@ do { \
DTRACE_BIF_ENTRY(c_p, (Eterm)I[-3], (Eterm)I[-2], (Uint)I[-1]);
SWAPOUT;
+ ERTS_DBG_CHK_REDS(c_p, FCALLS - 1);
c_p->fcalls = FCALLS - 1;
vbf = (BifFunction) Arg(0);
PROCESS_MAIN_CHK_LOCKS(c_p);
@@ -3568,6 +3603,7 @@ do { \
}
SWAPIN; /* There might have been a garbage collection. */
FCALLS = c_p->fcalls;
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
if (is_value(nif_bif_result)) {
r(0) = nif_bif_result;
CHECK_TERM(r(0));
@@ -4102,7 +4138,7 @@ do { \
StoreBifResult(1, result);
}
- OpCase(i_bs_put_utf16_jIs): {
+ OpCase(bs_put_utf16_jIs): {
Eterm arg;
GetArg1(2, arg);
@@ -4618,7 +4654,7 @@ do { \
SWAPOUT; /* Needed for shared heap */
ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p);
- erts_trace_return(c_p, code, r(0), E+1/*Process tracer*/);
+ erts_trace_return(c_p, code, r(0), ERTS_TRACER_FROM_ETERM(E+1)/* tracer */);
ERTS_SMP_REQ_PROC_MAIN_LOCK(c_p);
SWAPIN;
c_p->cp = NULL;
@@ -4630,9 +4666,9 @@ do { \
OpCase(i_generic_breakpoint): {
BeamInstr real_I;
ASSERT(I[-5] == (BeamInstr) BeamOp(op_i_func_info_IaaI));
- SWAPOUT;
+ HEAVY_SWAPOUT;
real_I = erts_generic_breakpoint(c_p, I, reg);
- SWAPIN;
+ HEAVY_SWAPIN;
ASSERT(VALID_INSTR(real_I));
Goto(real_I);
}
@@ -4809,6 +4845,7 @@ do { \
{
#define HIPE_MODE_SWITCH(Cmd) \
SWAPOUT; \
+ ERTS_DBG_CHK_REDS(c_p, FCALLS); \
c_p->fcalls = FCALLS; \
c_p->def_arg_reg[4] = -neg_o_reds; \
c_p = hipe_mode_switch(c_p, Cmd, reg); \
@@ -4847,6 +4884,9 @@ do { \
#undef HIPE_MODE_SWITCH
L_post_hipe_mode_switch:
+#ifdef DEBUG
+ pid = c_p->common.id; /* may have switched process... */
+#endif
reg = ERTS_PROC_GET_SCHDATA(c_p)->x_reg_array;
freg = ERTS_PROC_GET_SCHDATA(c_p)->f_reg_array;
ERL_BITS_RELOAD_STATEP(c_p);
@@ -4854,6 +4894,7 @@ do { \
neg_o_reds = -c_p->def_arg_reg[4];
FCALLS = c_p->fcalls;
SWAPIN;
+ ERTS_DBG_CHK_REDS(c_p, FCALLS);
switch( c_p->def_arg_reg[3] ) {
case HIPE_MODE_SWITCH_RES_RETURN:
ASSERT(is_value(reg[0]));
@@ -5258,7 +5299,8 @@ next_catch(Process* c_p, Eterm *reg) {
BeamInstr *cpp = c_p->cp;
if (cpp == beam_exception_trace) {
erts_trace_exception(c_p, cp_val(ptr[0]),
- reg[1], reg[2], ptr+1);
+ reg[1], reg[2],
+ ERTS_TRACER_FROM_ETERM(ptr+1));
/* Skip return_trace parameters */
ptr += 2;
} else if (cpp == beam_return_trace) {
@@ -5285,7 +5327,8 @@ next_catch(Process* c_p, Eterm *reg) {
}
if (cp_val(*prev) == beam_exception_trace) {
erts_trace_exception(c_p, cp_val(ptr[0]),
- reg[1], reg[2], ptr+1);
+ reg[1], reg[2],
+ ERTS_TRACER_FROM_ETERM(ptr+1));
}
/* Skip return_trace parameters */
ptr += 2;
@@ -6079,7 +6122,7 @@ erts_hibernate(Process* c_p, Eterm module, Eterm function, Eterm args, Eterm* re
return -1;
}
#else /* ERTS_SMP */
- ERTS_SMP_MSGQ_MV_INQ2PRIVQ(c_p);
+ ERTS_SMP_MSGQ_MV_INQ2PRIVQ(c_p);
if (!c_p->msg.len)
#endif
erts_smp_atomic32_read_band_relb(&c_p->state, ~ERTS_PSFLG_ACTIVE);
@@ -6856,7 +6899,7 @@ erts_current_reductions(Process *current, Process *p)
if (current != p) {
return 0;
} else if (current->fcalls < 0 && ERTS_PROC_GET_SAVED_CALLS_BUF(current)) {
- return -current->fcalls;
+ return current->fcalls + CONTEXT_REDS;
} else {
return REDS_IN(current) - current->fcalls;
}
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index f115df935f..95489d9a63 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,7 @@
#include "bif.h"
#include "external.h"
#include "beam_load.h"
+#include "beam_bp.h"
#include "big.h"
#include "erl_bits.h"
#include "beam_catches.h"
@@ -479,9 +480,9 @@ static void free_loader_state(Binary* magic);
static ErlHeapFragment* new_literal_fragment(Uint size);
static void free_literal_fragment(ErlHeapFragment*);
static void loader_state_dtor(Binary* magic);
-static Eterm insert_new_code(Process *c_p, ErtsProcLocks c_p_locks,
- Eterm group_leader, Eterm module,
- BeamCodeHeader* code, Uint size);
+static Eterm stub_insert_new_code(Process *c_p, ErtsProcLocks c_p_locks,
+ Eterm group_leader, Eterm module,
+ BeamCodeHeader* code, Uint size);
static int init_iff_file(LoaderState* stp, byte* code, Uint size);
static int scan_iff_file(LoaderState* stp, Uint* chunk_types,
Uint num_types, Uint num_mandatory);
@@ -513,7 +514,7 @@ static GenOp* gen_get_map_element(LoaderState* stp, GenOpArg Fail, GenOpArg Src,
static int freeze_code(LoaderState* stp);
-static void final_touch(LoaderState* stp);
+static void final_touch(LoaderState* stp, struct erl_module_instance* inst_p);
static void short_file(int line, LoaderState* stp, unsigned needed);
static void load_printf(int line, LoaderState* context, char *fmt, ...);
static int transform_engine(LoaderState* st);
@@ -766,8 +767,11 @@ Eterm
erts_finish_loading(Binary* magic, Process* c_p,
ErtsProcLocks c_p_locks, Eterm* modp)
{
- Eterm retval;
+ Eterm retval = NIL;
LoaderState* stp = ERTS_MAGIC_BIN_DATA(magic);
+ Module* mod_tab_p;
+ struct erl_module_instance* inst_p;
+ Uint size;
/*
* No other process may run since we will update the export
@@ -776,27 +780,80 @@ erts_finish_loading(Binary* magic, Process* c_p,
ERTS_SMP_LC_ASSERT(erts_initialized == 0 || erts_has_code_write_permission() ||
erts_smp_thr_progress_is_blocking());
-
/*
* Make current code for the module old and insert the new code
* as current. This will fail if there already exists old code
* for the module.
*/
+ mod_tab_p = erts_put_module(stp->module);
CHKBLK(ERTS_ALC_T_CODE,stp->code);
- retval = insert_new_code(c_p, c_p_locks, stp->group_leader, stp->module,
- stp->hdr, stp->loaded_size);
- if (retval != NIL) {
- goto load_error;
+ if (!stp->on_load) {
+ /*
+ * Normal case -- no -on_load() function.
+ */
+ retval = beam_make_current_old(c_p, c_p_locks, stp->module);
+ ASSERT(retval == NIL);
+ } else {
+ ErtsCodeIndex code_ix = erts_staging_code_ix();
+ Eterm module = stp->module;
+ int i;
+
+ /*
+ * There is an -on_load() function. We will keep the current
+ * code, but we must turn off any tracing.
+ */
+
+ for (i = 0; i < export_list_size(code_ix); i++) {
+ Export *ep = export_list(i, code_ix);
+ if (ep == NULL || ep->code[0] != module) {
+ continue;
+ }
+ if (ep->addressv[code_ix] == ep->code+3) {
+ if (ep->code[3] == (BeamInstr) em_apply_bif) {
+ continue;
+ } else if (ep->code[3] ==
+ (BeamInstr) BeamOp(op_i_generic_breakpoint)) {
+ ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking());
+ ASSERT(mod_tab_p->curr.num_traced_exports > 0);
+ erts_clear_export_break(mod_tab_p, ep->code+3);
+ ep->addressv[code_ix] = (BeamInstr *) ep->code[4];
+ ep->code[4] = 0;
+ }
+ ASSERT(ep->code[4] == 0);
+ }
+ }
+ ASSERT(mod_tab_p->curr.num_breakpoints == 0);
+ ASSERT(mod_tab_p->curr.num_traced_exports == 0);
}
/*
+ * Update module table.
+ */
+
+ size = stp->loaded_size;
+ erts_total_code_size += size;
+ if (stp->on_load) {
+ inst_p = &mod_tab_p->old;
+ } else {
+ inst_p = &mod_tab_p->curr;
+ }
+ inst_p->code_hdr = stp->hdr;
+ inst_p->code_length = size;
+
+ /*
+ * Update ranges (used for finding a function from a PC value).
+ */
+
+ erts_update_ranges((BeamInstr*)inst_p->code_hdr, size);
+
+ /*
* Ready for the final touch: fixing the export table entries for
* exported and imported functions. This can't fail.
*/
CHKBLK(ERTS_ALC_T_CODE,stp->code);
- final_touch(stp);
+ final_touch(stp, inst_p);
/*
* Loading succeded.
@@ -820,7 +877,6 @@ erts_finish_loading(Binary* magic, Process* c_p,
retval = am_on_load;
}
- load_error:
free_loader_state(magic);
return retval;
}
@@ -1026,9 +1082,9 @@ loader_state_dtor(Binary* magic)
}
static Eterm
-insert_new_code(Process *c_p, ErtsProcLocks c_p_locks,
- Eterm group_leader, Eterm module, BeamCodeHeader* code_hdr,
- Uint size)
+stub_insert_new_code(Process *c_p, ErtsProcLocks c_p_locks,
+ Eterm group_leader, Eterm module,
+ BeamCodeHeader* code_hdr, Uint size)
{
Module* modp;
Eterm retval;
@@ -1548,7 +1604,7 @@ read_literal_table(LoaderState* stp)
erts_factory_heap_frag_init(&factory,
new_literal_fragment(heap_size));
factory.alloc_type = ERTS_ALC_T_PREPARED_CODE;
- val = erts_decode_ext(&factory, &p);
+ val = erts_decode_ext(&factory, &p, 0);
if (is_non_value(val)) {
LoadError1(stp, "literal %d: bad external format", i);
@@ -1559,7 +1615,7 @@ read_literal_table(LoaderState* stp)
}
else {
erts_factory_dummy_init(&factory);
- val = erts_decode_ext(&factory, &p);
+ val = erts_decode_ext(&factory, &p, 0);
if (is_non_value(val)) {
LoadError1(stp, "literal %d: bad external format", i);
}
@@ -2028,42 +2084,47 @@ load_code(LoaderState* stp)
ASSERT(arity == last_op->arity);
do_transform:
- if (stp->genop == NULL) {
- last_op_next = NULL;
- goto get_next_instr;
- }
-
+ ASSERT(stp->genop != NULL);
if (gen_opc[stp->genop->op].transform != -1) {
- int need;
- tmp_op = stp->genop;
-
- for (need = gen_opc[stp->genop->op].min_window-1; need > 0; need--) {
- if (tmp_op == NULL) {
- goto get_next_instr;
- }
- tmp_op = tmp_op->next;
+ if (stp->genop->next == NULL) {
+ /*
+ * Simple heuristic: Most transformations requires
+ * at least two instructions, so make sure that
+ * there are. That will reduce the number of
+ * TE_SHORT_WINDOWs.
+ */
+ goto get_next_instr;
}
switch (transform_engine(stp)) {
case TE_FAIL:
- last_op_next = NULL;
- last_op = NULL;
+ /*
+ * No transformation found. stp->genop != NULL and
+ * last_op_next is still valid. Go ahead and load
+ * the instruction.
+ */
break;
case TE_OK:
+ /*
+ * Some transformation was applied. last_op_next is
+ * no longer valid and stp->genop may be NULL.
+ * Try to transform again.
+ */
+ if (stp->genop == NULL) {
+ last_op_next = &stp->genop;
+ goto get_next_instr;
+ }
last_op_next = NULL;
- last_op = NULL;
goto do_transform;
case TE_SHORT_WINDOW:
- last_op_next = NULL;
- last_op = NULL;
+ /*
+ * No transformation applied. stp->genop != NULL and
+ * last_op_next is still valid. Fetch a new instruction
+ * before trying the transformation again.
+ */
goto get_next_instr;
}
}
- if (stp->genop == NULL) {
- last_op_next = NULL;
- goto get_next_instr;
- }
-
/*
* From the collected generic instruction, find the specific
* instruction.
@@ -2584,7 +2645,10 @@ load_code(LoaderState* stp)
{
GenOp* next = stp->genop->next;
FREE_GENOP(stp, stp->genop);
- stp->genop = next;
+ if ((stp->genop = next) == NULL) {
+ last_op_next = &stp->genop;
+ goto get_next_instr;
+ }
goto do_transform;
}
}
@@ -2728,10 +2792,10 @@ mixed_types(LoaderState* stp, GenOpArg Size, GenOpArg* Rest)
}
static int
-same_label(LoaderState* stp, GenOpArg Target, GenOpArg Label)
+is_killed_apply(LoaderState* stp, GenOpArg Reg, GenOpArg Live)
{
- return Target.type = TAG_f && Label.type == TAG_u &&
- Target.val == Label.val;
+ return Reg.type == TAG_x && Live.type == TAG_u &&
+ Live.val+2 <= Reg.val;
}
static int
@@ -4692,14 +4756,13 @@ freeze_code(LoaderState* stp)
}
static void
-final_touch(LoaderState* stp)
+final_touch(LoaderState* stp, struct erl_module_instance* inst_p)
{
int i;
int on_load = stp->on_load;
unsigned catches;
Uint index;
BeamInstr* codev = stp->codev;
- Module* modp;
/*
* Allocate catch indices and fix up all catch_yf instructions.
@@ -4714,8 +4777,7 @@ final_touch(LoaderState* stp)
codev[index+2] = make_catch(catches);
index = next;
}
- modp = erts_put_module(stp->module);
- modp->curr.catches = catches;
+ inst_p->catches = catches;
/*
* Export functions.
@@ -4735,10 +4797,10 @@ final_touch(LoaderState* stp)
ep->addressv[erts_staging_code_ix()] = address;
} else {
/*
- * Don't make any of the exported functions
- * callable yet.
+ * on_load: Don't make any of the exported functions
+ * callable yet. Keep any function in the current
+ * code callable.
*/
- ep->addressv[erts_staging_code_ix()] = ep->code+3;
ep->code[4] = (BeamInstr) address;
}
}
@@ -4798,31 +4860,25 @@ transform_engine(LoaderState* st)
Uint op;
int ap; /* Current argument. */
Uint* restart; /* Where to restart if current match fails. */
- GenOpArg def_vars[TE_MAX_VARS]; /* Default buffer for variables. */
- GenOpArg* var = def_vars;
- int num_vars = 0;
+ GenOpArg var[TE_MAX_VARS]; /* Buffer for variables. */
+ GenOpArg* rest_args = NULL;
+ int num_rest_args = 0;
int i; /* General index. */
Uint mask;
GenOp* instr;
+ GenOp* first = st->genop;
+ GenOp* keep = NULL;
Uint* pc;
- int rval;
static Uint restart_fail[1] = {TOP_fail};
- ASSERT(gen_opc[st->genop->op].transform != -1);
- pc = op_transform + gen_opc[st->genop->op].transform;
- restart = pc;
+ ASSERT(gen_opc[first->op].transform != -1);
+ restart = op_transform + gen_opc[first->op].transform;
restart:
- if (var != def_vars) {
- erts_free(ERTS_ALC_T_LOADER_TMP, (void *) var);
- var = def_vars;
- }
ASSERT(restart != NULL);
pc = restart;
ASSERT(*pc < NUM_TOPS); /* Valid instruction? */
- instr = st->genop;
-
-#define RETURN(r) rval = (r); goto do_return;
+ instr = first;
#ifdef DEBUG
restart = NULL;
@@ -4840,7 +4896,7 @@ transform_engine(LoaderState* st)
* We'll need at least one more instruction to decide whether
* this combination matches or not.
*/
- RETURN(TE_SHORT_WINDOW);
+ return TE_SHORT_WINDOW;
}
if (*pc++ != instr->op)
goto restart;
@@ -5002,19 +5058,9 @@ transform_engine(LoaderState* st)
#if defined(TOP_rest_args)
case TOP_rest_args:
{
- int n = *pc++;
int formal_arity = gen_opc[instr->op].arity;
- int j = formal_arity;
-
- num_vars = n + (instr->arity - formal_arity);
- var = erts_alloc(ERTS_ALC_T_LOADER_TMP,
- num_vars * sizeof(GenOpArg));
- for (i = 0; i < n; i++) {
- var[i] = def_vars[i];
- }
- while (i < num_vars) {
- var[i++] = instr->a[j++];
- }
+ num_rest_args = instr->arity - formal_arity;
+ rest_args = instr->a + formal_arity;
}
break;
#endif
@@ -5023,21 +5069,22 @@ transform_engine(LoaderState* st)
break;
case TOP_commit:
instr = instr->next; /* The next_instr was optimized away. */
-
- /*
- * The left-hand side of this transformation matched.
- * Delete all matched instructions.
- */
- while (st->genop != instr) {
- GenOp* next = st->genop->next;
- FREE_GENOP(st, st->genop);
- st->genop = next;
- }
+ keep = instr;
+ st->genop = instr;
#ifdef DEBUG
instr = 0;
#endif
break;
-
+#if defined(TOP_keep)
+ case TOP_keep:
+ /* Keep the current instruction unchanged. */
+ keep = instr;
+ st->genop = instr;
+#ifdef DEBUG
+ instr = 0;
+#endif
+ break;
+#endif
#if defined(TOP_call_end)
case TOP_call_end:
{
@@ -5062,22 +5109,19 @@ transform_engine(LoaderState* st)
lastp = &((*lastp)->next);
}
- instr = instr->next; /* The next_instr was optimized away. */
-
- /*
- * The left-hand side of this transformation matched.
- * Delete all matched instructions.
- */
- while (st->genop != instr) {
- GenOp* next = st->genop->next;
- FREE_GENOP(st, st->genop);
- st->genop = next;
- }
- *lastp = st->genop;
+ keep = instr->next; /* The next_instr was optimized away. */
+ *lastp = keep;
st->genop = new_instr;
}
- RETURN(TE_OK);
+ /* FALLTHROUGH */
#endif
+ case TOP_end:
+ while (first != keep) {
+ GenOp* next = first->next;
+ FREE_GENOP(st, first);
+ first = next;
+ }
+ return TE_OK;
case TOP_new_instr:
/*
* Note that the instructions are generated in reverse order.
@@ -5089,6 +5133,12 @@ transform_engine(LoaderState* st)
instr->arity = gen_opc[op].arity;
ap = 0;
break;
+#ifdef TOP_rename
+ case TOP_rename:
+ instr->op = op = *pc++;
+ instr->arity = gen_opc[op].arity;
+ return TE_OK;
+#endif
case TOP_store_type:
i = *pc++;
instr->a[ap].type = i;
@@ -5108,14 +5158,10 @@ transform_engine(LoaderState* st)
#if defined(TOP_store_rest_args)
case TOP_store_rest_args:
{
- int n = *pc++;
- int num_extra = num_vars - n;
-
- ASSERT(n <= num_vars);
- GENOP_ARITY(instr, instr->arity+num_extra);
+ GENOP_ARITY(instr, instr->arity+num_rest_args);
memcpy(instr->a, instr->def_args, ap*sizeof(GenOpArg));
- memcpy(instr->a+ap, var+n, num_extra*sizeof(GenOpArg));
- ap += num_extra;
+ memcpy(instr->a+ap, rest_args, num_rest_args*sizeof(GenOpArg));
+ ap += num_rest_args;
}
break;
#endif
@@ -5127,21 +5173,12 @@ transform_engine(LoaderState* st)
case TOP_try_me_else_fail:
restart = restart_fail;
break;
- case TOP_end:
- RETURN(TE_OK);
case TOP_fail:
- RETURN(TE_FAIL);
+ return TE_FAIL;
default:
ASSERT(0);
}
}
-#undef RETURN
-
- do_return:
- if (var != def_vars) {
- erts_free(ERTS_ALC_T_LOADER_TMP, (void *) var);
- }
- return rval;
}
static void
@@ -5719,7 +5756,7 @@ attributes_for_module(Process* p, /* Process whose heap to use. */
if (ext != NULL) {
ErtsHeapFactory factory;
erts_factory_proc_prealloc_init(&factory, p, code_hdr->attr_size_on_heap);
- result = erts_decode_ext(&factory, &ext);
+ result = erts_decode_ext(&factory, &ext, 0);
if (is_value(result)) {
erts_factory_close(&factory);
}
@@ -5742,7 +5779,7 @@ compilation_info_for_module(Process* p, /* Process whose heap to use. */
if (ext != NULL) {
ErtsHeapFactory factory;
erts_factory_proc_prealloc_init(&factory, p, code_hdr->compile_size_on_heap);
- result = erts_decode_ext(&factory, &ext);
+ result = erts_decode_ext(&factory, &ext, 0);
if (is_value(result)) {
erts_factory_close(&factory);
}
@@ -6438,7 +6475,8 @@ erts_make_stub_module(Process* p, Eterm Mod, Eterm Beam, Eterm Info)
* Insert the module in the module table.
*/
- rval = insert_new_code(p, 0, p->group_leader, Mod, code_hdr, code_size);
+ rval = stub_insert_new_code(p, 0, p->group_leader, Mod,
+ code_hdr, code_size);
if (rval != NIL) {
goto error;
}
diff --git a/erts/emulator/beam/beam_load.h b/erts/emulator/beam/beam_load.h
index 22ab71c868..fd2dd97fee 100644
--- a/erts/emulator/beam/beam_load.h
+++ b/erts/emulator/beam/beam_load.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,7 +33,6 @@ typedef struct gen_op_entry {
int specific;
int num_specific;
int transform;
- int min_window;
} GenOpEntry;
extern GenOpEntry gen_opc[];
diff --git a/erts/emulator/beam/beam_ranges.c b/erts/emulator/beam/beam_ranges.c
index 54c337ee72..55342a38c6 100644
--- a/erts/emulator/beam/beam_ranges.c
+++ b/erts/emulator/beam/beam_ranges.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2012. All Rights Reserved.
+ * Copyright Ericsson AB 2012-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/benchmark.c b/erts/emulator/beam/benchmark.c
index 44f5c760c2..c8409784ef 100644
--- a/erts/emulator/beam/benchmark.c
+++ b/erts/emulator/beam/benchmark.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/benchmark.h b/erts/emulator/beam/benchmark.h
index 0fb0b93f12..0272896f4f 100644
--- a/erts/emulator/beam/benchmark.h
+++ b/erts/emulator/beam/benchmark.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c
index 37bb28c6f8..9d6dfefa3c 100644
--- a/erts/emulator/beam/bif.c
+++ b/erts/emulator/beam/bif.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -123,15 +123,12 @@ static int insert_internal_link(Process* p, Eterm rpid)
erts_add_link(&ERTS_P_LINKS(p), LINK_PID, rp->common.id);
erts_add_link(&ERTS_P_LINKS(rp), LINK_PID, p->common.id);
- ASSERT(is_nil(ERTS_TRACER_PROC(p))
- || is_internal_pid(ERTS_TRACER_PROC(p))
- || is_internal_port(ERTS_TRACER_PROC(p)));
+ ASSERT(IS_TRACER_VALID(ERTS_TRACER(p)));
if (IS_TRACED(p)) {
if (ERTS_TRACE_FLAGS(p) & (F_TRACE_SOL|F_TRACE_SOL1)) {
ERTS_TRACE_FLAGS(rp) |= (ERTS_TRACE_FLAGS(p) & TRACEE_FLAGS);
- ERTS_TRACER_PROC(rp) = ERTS_TRACER_PROC(p); /* maybe steal */
-
+ erts_tracer_replace(&rp->common, ERTS_TRACER(p));
if (ERTS_TRACE_FLAGS(p) & F_TRACE_SOL1) { /* maybe override */
ERTS_TRACE_FLAGS(rp) &= ~(F_TRACE_SOL1 | F_TRACE_SOL);
ERTS_TRACE_FLAGS(p) &= ~(F_TRACE_SOL1 | F_TRACE_SOL);
@@ -140,7 +137,8 @@ static int insert_internal_link(Process* p, Eterm rpid)
}
}
if (IS_TRACED_FL(rp, F_TRACE_PROCS))
- trace_proc(p, rp, am_getting_linked, p->common.id);
+ trace_proc(p, p == rp ? rp_locks : ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_LINK,
+ rp, am_getting_linked, p->common.id);
if (p == rp)
erts_smp_proc_unlock(p, rp_locks & ~ERTS_PROC_LOCK_MAIN);
@@ -159,7 +157,7 @@ BIF_RETTYPE link_1(BIF_ALIST_1)
DistEntry *dep;
if (IS_TRACED_FL(BIF_P, F_TRACE_PROCS)) {
- trace_proc(BIF_P, BIF_P, am_link, BIF_ARG_1);
+ trace_proc(BIF_P, ERTS_PROC_LOCK_MAIN, BIF_P, am_link, BIF_ARG_1);
}
/* check that the pid or port which is our argument is OK */
@@ -613,7 +611,7 @@ erts_queue_monitor_message(Process *p,
ref_copy = copy_struct(ref, ref_size, &hp, ohp);
tup = TUPLE5(hp, am_DOWN, ref_copy, type, item_copy, reason_copy);
- erts_queue_message(p, p_locksp, msgp, tup, NIL);
+ erts_queue_message(p, p_locksp, msgp, tup);
}
static BIF_RETTYPE
@@ -1001,6 +999,7 @@ BIF_RETTYPE unlink_1(BIF_ALIST_1)
Process *rp;
DistEntry *dep;
ErtsLink *l = NULL, *rl = NULL;
+ ErtsProcLocks cp_locks = ERTS_PROC_LOCK_MAIN;
/*
* SMP specific note concerning incoming exit signals:
@@ -1015,7 +1014,7 @@ BIF_RETTYPE unlink_1(BIF_ALIST_1)
*/
if (IS_TRACED_FL(BIF_P, F_TRACE_PROCS)) {
- trace_proc(BIF_P, BIF_P, am_unlink, BIF_ARG_1);
+ trace_proc(BIF_P, cp_locks, BIF_P, am_unlink, BIF_ARG_1);
}
if (is_internal_port(BIF_ARG_1)) {
@@ -1120,10 +1119,10 @@ BIF_RETTYPE unlink_1(BIF_ALIST_1)
erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_LINK|ERTS_PROC_LOCK_STATUS);
+ cp_locks |= ERTS_PROC_LOCK_LINK|ERTS_PROC_LOCK_STATUS;
+
/* get process struct */
- rp = erts_pid2proc_opt(BIF_P, (ERTS_PROC_LOCK_MAIN
- | ERTS_PROC_LOCK_LINK
- | ERTS_PROC_LOCK_STATUS),
+ rp = erts_pid2proc_opt(BIF_P, cp_locks,
BIF_ARG_1, ERTS_PROC_LOCK_LINK,
ERTS_P2P_FLG_ALLOW_OTHER_X);
@@ -1149,14 +1148,17 @@ BIF_RETTYPE unlink_1(BIF_ALIST_1)
erts_destroy_link(rl);
if (IS_TRACED_FL(rp, F_TRACE_PROCS) && rl != NULL) {
- trace_proc(BIF_P, rp, am_getting_unlinked, BIF_P->common.id);
+ erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_STATUS);
+ cp_locks &= ~ERTS_PROC_LOCK_STATUS;
+ trace_proc(BIF_P, (ERTS_PROC_LOCK_MAIN | ERTS_PROC_LOCK_LINK),
+ rp, am_getting_unlinked, BIF_P->common.id);
}
if (rp != BIF_P)
erts_smp_proc_unlock(rp, ERTS_PROC_LOCK_LINK);
}
- erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_LINK|ERTS_PROC_LOCK_STATUS);
+ erts_smp_proc_unlock(BIF_P, cp_locks & ~ERTS_PROC_LOCK_MAIN);
BIF_RET(am_true);
@@ -1567,7 +1569,32 @@ static BIF_RETTYPE process_flag_aux(Process *BIF_P,
scb->n = 0;
}
- scb = ERTS_PROC_SET_SAVED_CALLS_BUF(rp, ERTS_PROC_LOCK_MAIN, scb);
+#ifdef HIPE
+ if (rp->flags & F_HIPE_MODE) {
+ ASSERT(!ERTS_PROC_GET_SAVED_CALLS_BUF(rp));
+ scb = ERTS_PROC_SET_SUSPENDED_SAVED_CALLS_BUF(rp, scb);
+ }
+ else
+#endif
+ {
+#ifdef HIPE
+ ASSERT(!ERTS_PROC_GET_SUSPENDED_SAVED_CALLS_BUF(rp));
+#endif
+ scb = ERTS_PROC_SET_SAVED_CALLS_BUF(rp, scb);
+ if (rp == BIF_P && ((scb && i == 0) || (!scb && i != 0))) {
+ /* Adjust fcalls to match save calls setting... */
+ if (i == 0)
+ BIF_P->fcalls += CONTEXT_REDS; /* disabled it */
+ else
+ BIF_P->fcalls -= CONTEXT_REDS; /* enabled it */
+
+ /*
+ * Make sure we reschedule immediately so the
+ * change take effect at once.
+ */
+ ERTS_VBUMP_ALL_REDS(BIF_P);
+ }
+ }
if (!scb)
old_value = make_small(0);
@@ -1576,12 +1603,7 @@ static BIF_RETTYPE process_flag_aux(Process *BIF_P,
erts_free(ERTS_ALC_T_CALLS_BUF, (void *) scb);
}
- /* Make sure the process in question is rescheduled
- immediately, if it's us, so the call saving takes effect. */
- if (rp == BIF_P)
- BIF_RET2(old_value, CONTEXT_REDS);
- else
- BIF_RET(old_value);
+ BIF_RET(old_value);
}
error:
@@ -1595,9 +1617,7 @@ BIF_RETTYPE process_flag_2(BIF_ALIST_2)
if (is_not_atom(BIF_ARG_2)) {
goto error;
}
- old_value = erts_proc_set_error_handler(BIF_P,
- ERTS_PROC_LOCK_MAIN,
- BIF_ARG_2);
+ old_value = erts_proc_set_error_handler(BIF_P, BIF_ARG_2);
BIF_RET(old_value);
}
else if (BIF_ARG_1 == am_priority) {
@@ -1622,14 +1642,17 @@ BIF_RETTYPE process_flag_2(BIF_ALIST_2)
* true. For more info, see implementation of
* erts_send_exit_signal().
*/
+ erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCKS_XSIG_SEND);
if (trap_exit)
state = erts_smp_atomic32_read_bor_mb(&BIF_P->state,
ERTS_PSFLG_TRAP_EXIT);
else
state = erts_smp_atomic32_read_band_mb(&BIF_P->state,
~ERTS_PSFLG_TRAP_EXIT);
+ erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCKS_XSIG_SEND);
+
#ifdef ERTS_SMP
- if (ERTS_PROC_PENDING_EXIT(BIF_P)) {
+ if (state & ERTS_PSFLG_PENDING_EXIT) {
erts_handle_pending_exit(BIF_P, ERTS_PROC_LOCK_MAIN);
ERTS_BIF_EXITED(BIF_P);
}
@@ -1733,7 +1756,9 @@ BIF_RETTYPE process_flag_2(BIF_ALIST_2)
ERTS_TRACE_FLAGS(BIF_P) &= ~F_SENSITIVE;
}
erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCKS_ALL_MINOR);
- BIF_RET(old_value);
+ /* make sure to bump all reds so that we get
+ rescheduled immediately so setting takes effect */
+ BIF_RET2(old_value, CONTEXT_REDS);
}
else if (BIF_ARG_1 == am_monitor_nodes) {
/*
@@ -1772,10 +1797,18 @@ BIF_RETTYPE process_flag_3(BIF_ALIST_3)
Process *rp;
Eterm res;
- if ((rp = erts_pid2proc(BIF_P, ERTS_PROC_LOCK_MAIN,
- BIF_ARG_1, ERTS_PROC_LOCK_MAIN)) == NULL) {
+#ifdef ERTS_SMP
+ rp = erts_pid2proc_not_running(BIF_P, ERTS_PROC_LOCK_MAIN,
+ BIF_ARG_1, ERTS_PROC_LOCK_MAIN);
+ if (rp == ERTS_PROC_LOCK_BUSY)
+ ERTS_BIF_YIELD3(bif_export[BIF_process_flag_3], BIF_P,
+ BIF_ARG_1, BIF_ARG_2, BIF_ARG_3);
+#else
+ rp = erts_proc_lookup(BIF_ARG_1);
+#endif
+
+ if (!rp)
BIF_ERROR(BIF_P, BADARG);
- }
res = process_flag_aux(BIF_P, rp, BIF_ARG_2, BIF_ARG_3);
@@ -1908,7 +1941,7 @@ static Sint remote_send(Process *p, DistEntry *dep,
}
if (res >= 0) {
- if (IS_TRACED(p))
+ if (IS_TRACED_FL(p, F_TRACE_SEND))
trace_send(p, full_to, msg);
if (ERTS_PROC_GET_SAVED_CALLS_BUF(p))
save_calls(p, &exp_send);
@@ -1927,7 +1960,7 @@ do_send(Process *p, Eterm to, Eterm msg, Eterm *refp, ErtsSendContext* ctx)
Eterm* tp;
if (is_internal_pid(to)) {
- if (IS_TRACED(p))
+ if (IS_TRACED_FL(p, F_TRACE_SEND))
trace_send(p, to, msg);
if (ERTS_PROC_GET_SAVED_CALLS_BUF(p))
save_calls(p, &exp_send);
@@ -1956,7 +1989,7 @@ do_send(Process *p, Eterm to, Eterm msg, Eterm *refp, ErtsSendContext* ctx)
rp = erts_proc_lookup_raw(id);
if (rp) {
- if (IS_TRACED(p))
+ if (IS_TRACED_FL(p, F_TRACE_SEND))
trace_send(p, to, msg);
if (ERTS_PROC_GET_SAVED_CALLS_BUF(p))
save_calls(p, &exp_send);
@@ -1972,7 +2005,7 @@ do_send(Process *p, Eterm to, Eterm msg, Eterm *refp, ErtsSendContext* ctx)
goto port_common;
}
- if (IS_TRACED(p))
+ if (IS_TRACED_FL(p, F_TRACE_SEND))
trace_send(p, to, msg);
if (ERTS_PROC_GET_SAVED_CALLS_BUF(p))
save_calls(p, &exp_send);
@@ -2003,11 +2036,20 @@ do_send(Process *p, Eterm to, Eterm msg, Eterm *refp, ErtsSendContext* ctx)
port_common:
ret_val = 0;
-
+
if (pt) {
int ps_flags = ctx->suspend ? 0 : ERTS_PORT_SIG_FLG_NOSUSPEND;
*refp = NIL;
+ if (IS_TRACED_FL(p, F_TRACE_SEND)) /* trace once only !! */
+ trace_send(p, portid, msg);
+
+ if (have_seqtrace(SEQ_TRACE_TOKEN(p))) {
+ seq_trace_update_send(p);
+ seq_trace_output(SEQ_TRACE_TOKEN(p), msg,
+ SEQ_TRACE_SEND, portid, p);
+ }
+
switch (erts_port_command(p, ps_flags, pt, msg, refp)) {
case ERTS_PORT_OP_CALLER_EXIT:
/* We are exiting... */
@@ -2040,18 +2082,10 @@ do_send(Process *p, Eterm to, Eterm msg, Eterm *refp, ErtsSendContext* ctx)
break;
}
}
-
- if (IS_TRACED(p)) /* trace once only !! */
- trace_send(p, portid, msg);
+
if (ERTS_PROC_GET_SAVED_CALLS_BUF(p))
save_calls(p, &exp_send);
-
- if (have_seqtrace(SEQ_TRACE_TOKEN(p))) {
- seq_trace_update_send(p);
- seq_trace_output(SEQ_TRACE_TOKEN(p), msg,
- SEQ_TRACE_SEND, portid, p);
- }
-
+
if (ERTS_PROC_IS_EXITING(p)) {
KILL_CATCHES(p); /* Must exit */
return SEND_USER_ERROR;
@@ -2074,7 +2108,7 @@ do_send(Process *p, Eterm to, Eterm msg, Eterm *refp, ErtsSendContext* ctx)
if (dep == erts_this_dist_entry) {
Eterm id;
erts_deref_dist_entry(dep);
- if (IS_TRACED(p))
+ if (IS_TRACED_FL(p, F_TRACE_SEND))
trace_send(p, to, msg);
if (ERTS_PROC_GET_SAVED_CALLS_BUF(p))
save_calls(p, &exp_send);
@@ -2105,7 +2139,7 @@ do_send(Process *p, Eterm to, Eterm msg, Eterm *refp, ErtsSendContext* ctx)
}
return ret;
} else {
- if (IS_TRACED(p)) /* XXX Is this really neccessary ??? */
+ if (IS_TRACED_FL(p, F_TRACE_SEND))
trace_send(p, to, msg);
if (ERTS_PROC_GET_SAVED_CALLS_BUF(p))
save_calls(p, &exp_send);
@@ -4336,12 +4370,34 @@ BIF_RETTYPE system_flag_2(BIF_ALIST_2)
} else if (BIF_ARG_1 == am_trace_control_word) {
BIF_RET(db_set_trace_control_word(BIF_P, BIF_ARG_2));
} else if (BIF_ARG_1 == am_sequential_tracer) {
- Eterm old_value = erts_set_system_seq_tracer(BIF_P,
- ERTS_PROC_LOCK_MAIN,
- BIF_ARG_2);
- if (old_value != THE_NON_VALUE) {
- BIF_RET(old_value);
- }
+ ErtsTracer new_seq_tracer, old_seq_tracer;
+ Eterm ret;
+
+ if (BIF_ARG_2 == am_false)
+ new_seq_tracer = erts_tracer_nil;
+ else
+ new_seq_tracer = erts_term_to_tracer(THE_NON_VALUE, BIF_ARG_2);
+
+ if (new_seq_tracer == THE_NON_VALUE)
+ goto error;
+
+ old_seq_tracer = erts_set_system_seq_tracer(BIF_P,
+ ERTS_PROC_LOCK_MAIN,
+ new_seq_tracer);
+
+ ERTS_TRACER_CLEAR(&new_seq_tracer);
+
+ if (old_seq_tracer == THE_NON_VALUE)
+ goto error;
+
+ if (ERTS_TRACER_IS_NIL(old_seq_tracer))
+ BIF_RET(am_false);
+
+ ret = erts_tracer_to_term(BIF_P, old_seq_tracer);
+
+ ERTS_TRACER_CLEAR(&old_seq_tracer);
+
+ BIF_RET(ret);
} else if (BIF_ARG_1 == make_small(1)) {
int i, max;
ErtsMessage* mp;
@@ -4678,7 +4734,7 @@ skip_current_msgq(Process *c_p)
res = 0;
}
else {
- ERTS_SMP_MSGQ_MV_INQ2PRIVQ(c_p);
+ ERTS_SMP_MSGQ_MV_INQ2PRIVQ(c_p);
c_p->msg.save = c_p->msg.last;
res = 1;
}
diff --git a/erts/emulator/beam/bif.h b/erts/emulator/beam/bif.h
index 46af552b39..5d751dd67d 100644
--- a/erts/emulator/beam/bif.h
+++ b/erts/emulator/beam/bif.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,6 +52,7 @@ extern Export *erts_convert_time_unit_trap;
(p)->fcalls = 0; \
else \
(p)->fcalls = -CONTEXT_REDS; \
+ ASSERT(ERTS_BIF_REDS_LEFT((p)) == 0); \
} while(0)
#define ERTS_VBUMP_ALL_REDS_INTERNAL(p, fcalls) \
diff --git a/erts/emulator/beam/bif.tab b/erts/emulator/beam/bif.tab
index a6670c10e8..872f0f9b2a 100644
--- a/erts/emulator/beam/bif.tab
+++ b/erts/emulator/beam/bif.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2013. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -181,9 +181,8 @@ bif erlang:port_set_data/2
bif erlang:port_get_data/1
# Tracing & debugging.
-bif erlang:trace_pattern/2
-bif erlang:trace_pattern/3
-bif erlang:trace/3
+bif erts_internal:trace_pattern/3
+bif erts_internal:trace/3
bif erlang:trace_info/2
bif erlang:trace_delivered/1
bif erlang:seq_trace/2
@@ -653,6 +652,8 @@ bif erts_debug:size_shared/1
bif erts_debug:copy_shared/1
bif erlang:has_prepared_code_on_load/1
+bif maps:take/2
+
#
# Obsolete
#
diff --git a/erts/emulator/beam/big.c b/erts/emulator/beam/big.c
index c738a9ecf5..4baee7900b 100644
--- a/erts/emulator/beam/big.c
+++ b/erts/emulator/beam/big.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/big.h b/erts/emulator/beam/big.h
index ee51e5d313..464acd67f6 100644
--- a/erts/emulator/beam/big.h
+++ b/erts/emulator/beam/big.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/binary.c b/erts/emulator/beam/binary.c
index 3fd284b589..cfd8fbe2f5 100644
--- a/erts/emulator/beam/binary.c
+++ b/erts/emulator/beam/binary.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/break.c b/erts/emulator/beam/break.c
index 8c039ef132..d02c6828f9 100644
--- a/erts/emulator/beam/break.c
+++ b/erts/emulator/beam/break.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -347,8 +347,11 @@ print_process_info(int to, void *to_arg, Process *p)
static void
print_garb_info(int to, void *to_arg, Process* p)
{
+#ifdef ERTS_SMP
/* ERTS_SMP: A scheduler is probably concurrently doing gc... */
-#ifndef ERTS_SMP
+ if (!ERTS_IS_CRASH_DUMPING)
+ return;
+#endif
erts_print(to, to_arg, "New heap start: %bpX\n", p->heap);
erts_print(to, to_arg, "New heap top: %bpX\n", p->htop);
erts_print(to, to_arg, "Stack top: %bpX\n", p->stop);
@@ -356,7 +359,6 @@ print_garb_info(int to, void *to_arg, Process* p)
erts_print(to, to_arg, "Old heap start: %bpX\n", OLD_HEAP(p));
erts_print(to, to_arg, "Old heap top: %bpX\n", OLD_HTOP(p));
erts_print(to, to_arg, "Old heap end: %bpX\n", OLD_HEND(p));
-#endif
}
void
@@ -684,7 +686,7 @@ erl_crash_dump_v(char *file, int line, char* fmt, va_list args)
crash dump. */
erts_thr_progress_fatal_error_block(&tpd_buf);
-#ifdef ERTS_THR_HAVE_SIG_FUNCS
+#ifdef ERTS_SYS_SUSPEND_SIGNAL
/*
* We suspend all scheduler threads so that we can dump some
* data about the currently running processes and scheduler data.
@@ -818,7 +820,7 @@ erl_crash_dump_v(char *file, int line, char* fmt, va_list args)
#ifdef ERTS_SMP
-#if defined(ERTS_THR_HAVE_SIG_FUNCS)
+#ifdef ERTS_SYS_SUSPEND_SIGNAL
/* We resume all schedulers so that we are in a known safe state
when we write the rest of the crash dump */
diff --git a/erts/emulator/beam/code_ix.c b/erts/emulator/beam/code_ix.c
index 1b0968c55c..ec6267711b 100644
--- a/erts/emulator/beam/code_ix.c
+++ b/erts/emulator/beam/code_ix.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2012. All Rights Reserved.
+ * Copyright Ericsson AB 2012-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -94,6 +94,7 @@ void erts_commit_staging_code_ix(void)
ix = (ix + 1) % ERTS_NUM_CODE_IX;
erts_smp_atomic32_set_nob(&the_staging_code_index, ix);
export_staging_unlock();
+ erts_tracer_nif_clear();
CIX_TRACE("activate");
}
diff --git a/erts/emulator/beam/code_ix.h b/erts/emulator/beam/code_ix.h
index 7a66211a5b..584a605771 100644
--- a/erts/emulator/beam/code_ix.h
+++ b/erts/emulator/beam/code_ix.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2012-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2012-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/copy.c b/erts/emulator/beam/copy.c
index b38ebe066b..ccc4cbad43 100644
--- a/erts/emulator/beam/copy.c
+++ b/erts/emulator/beam/copy.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2012. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/dist.c b/erts/emulator/beam/dist.c
index fa385f105d..277e0668a2 100644
--- a/erts/emulator/beam/dist.c
+++ b/erts/emulator/beam/dist.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -337,7 +337,7 @@ static void doit_link_net_exits_sub(ErtsLink *sublnk, void *vlnecp)
erts_destroy_link(rlnk);
if (xres >= 0 && IS_TRACED_FL(rp, F_TRACE_PROCS)) {
/* We didn't exit the process and it is traced */
- trace_proc(NULL, rp, am_getting_unlinked, sublnk->pid);
+ trace_proc(NULL, 0, rp, am_getting_unlinked, sublnk->pid);
}
}
erts_smp_proc_unlock(rp, rp_locks);
@@ -397,7 +397,7 @@ static void doit_node_link_net_exits(ErtsLink *lnk, void *vnecp)
msgp = erts_alloc_message_heap(rp, &rp_locks,
3, &hp, &ohp);
tup = TUPLE2(hp, am_nodedown, name);
- erts_queue_message(rp, &rp_locks, msgp, tup, NIL);
+ erts_queue_message(rp, &rp_locks, msgp, tup);
}
erts_smp_proc_unlock(rp, rp_locks);
}
@@ -906,9 +906,9 @@ erts_dsig_send_msg(Eterm remote, Eterm message, ErtsSendContext* ctx)
if (token != NIL)
ctl = TUPLE4(&ctx->ctl_heap[0],
- make_small(DOP_SEND_TT), am_Cookie, remote, token);
+ make_small(DOP_SEND_TT), am_Empty, remote, token);
else
- ctl = TUPLE3(&ctx->ctl_heap[0], make_small(DOP_SEND), am_Cookie, remote);
+ ctl = TUPLE3(&ctx->ctl_heap[0], make_small(DOP_SEND), am_Empty, remote);
DTRACE6(message_send, sender_name, receiver_name,
msize, tok_label, tok_lastcnt, tok_serial);
DTRACE7(message_send_remote, sender_name, node_name, receiver_name,
@@ -963,10 +963,10 @@ erts_dsig_send_reg_msg(Eterm remote_name, Eterm message,
if (token != NIL)
ctl = TUPLE5(&ctx->ctl_heap[0], make_small(DOP_REG_SEND_TT),
- sender->common.id, am_Cookie, remote_name, token);
+ sender->common.id, am_Empty, remote_name, token);
else
ctl = TUPLE4(&ctx->ctl_heap[0], make_small(DOP_REG_SEND),
- sender->common.id, am_Cookie, remote_name);
+ sender->common.id, am_Empty, remote_name);
DTRACE6(message_send, sender_name, receiver_name,
msize, tok_label, tok_lastcnt, tok_serial);
DTRACE7(message_send_remote, sender_name, node_name, receiver_name,
@@ -1275,7 +1275,7 @@ int erts_net_message(Port *prt,
erts_smp_de_links_unlock(dep);
if (IS_TRACED_FL(rp, F_TRACE_PROCS))
- trace_proc(NULL, rp, am_getting_linked, from);
+ trace_proc(NULL, 0, rp, am_getting_linked, from);
erts_smp_proc_unlock(rp, ERTS_PROC_LOCK_LINK);
break;
@@ -1300,7 +1300,7 @@ int erts_net_message(Port *prt,
lnk = erts_remove_link(&ERTS_P_LINKS(rp), from);
if (IS_TRACED_FL(rp, F_TRACE_PROCS) && lnk != NULL) {
- trace_proc(NULL, rp, am_getting_unlinked, from);
+ trace_proc(NULL, 0, rp, am_getting_unlinked, from);
}
erts_smp_proc_unlock(rp, ERTS_PROC_LOCK_LINK);
@@ -1628,7 +1628,11 @@ int erts_net_message(Port *prt,
ERTS_XSIG_FLG_IGN_KILL);
if (xres >= 0 && IS_TRACED_FL(rp, F_TRACE_PROCS)) {
/* We didn't exit the process and it is traced */
- trace_proc(NULL, rp, am_getting_unlinked, from);
+ if (rp_locks & ERTS_PROC_LOCKS_XSIG_SEND) {
+ erts_smp_proc_unlock(rp, ERTS_PROC_LOCKS_XSIG_SEND);
+ rp_locks &= ~ERTS_PROC_LOCKS_XSIG_SEND;
+ }
+ trace_proc(NULL, 0, rp, am_getting_unlinked, from);
}
}
erts_smp_proc_unlock(rp, rp_locks);
@@ -1719,7 +1723,7 @@ decode_error:
}
data_error:
UnUseTmpHeapNoproc(DIST_CTL_DEFAULT_SIZE);
- erts_deliver_port_exit(prt, dep->cid, am_killed, 0);
+ erts_deliver_port_exit(prt, dep->cid, am_killed, 0, 1);
ERTS_SMP_CHK_NO_PROC_LOCKS;
return -1;
}
@@ -1963,7 +1967,7 @@ dist_port_command(Port *prt, ErtsDistOutputBuf *obuf)
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(prt));
if (size > (Uint) INT_MAX)
- erts_exit(ERTS_ABORT_EXIT,
+ erts_exit(ERTS_DUMP_EXIT,
"Absurdly large distribution output data buffer "
"(%beu bytes) passed.\n",
size);
@@ -2003,7 +2007,7 @@ dist_port_commandv(Port *prt, ErtsDistOutputBuf *obuf)
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(prt));
if (size > (Uint) INT_MAX)
- erts_exit(ERTS_ABORT_EXIT,
+ erts_exit(ERTS_DUMP_EXIT,
"Absurdly large distribution output data buffer "
"(%beu bytes) passed.\n",
size);
@@ -2089,7 +2093,7 @@ erts_dist_command(Port *prt, int reds_limit)
erts_smp_de_runlock(dep);
if (status & ERTS_DE_SFLG_EXITING) {
- erts_deliver_port_exit(prt, prt->common.id, am_killed, 0);
+ erts_deliver_port_exit(prt, prt->common.id, am_killed, 0, 1);
erts_deref_dist_entry(dep);
return reds + ERTS_PORT_REDS_DIST_CMD_EXIT;
}
@@ -3313,7 +3317,7 @@ send_nodes_mon_msg(Process *rp,
}
ASSERT(hend == hp);
- erts_queue_message(rp, rp_locksp, mp, msg, NIL);
+ erts_queue_message(rp, rp_locksp, mp, msg);
}
static void
diff --git a/erts/emulator/beam/dist.h b/erts/emulator/beam/dist.h
index fb777d9ac1..e82b416286 100644
--- a/erts/emulator/beam/dist.h
+++ b/erts/emulator/beam/dist.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,6 +43,7 @@
#define DFLAG_INTERNAL_TAGS 0x8000
#define DFLAG_UTF8_ATOMS 0x10000
#define DFLAG_MAP_TAG 0x20000
+#define DFLAG_BIG_CREATION 0x40000
/* All flags that should be enabled when term_to_binary/1 is used. */
#define TERM_TO_BINARY_DFLAGS (DFLAG_EXTENDED_REFERENCES \
@@ -51,7 +52,8 @@
| DFLAG_EXTENDED_PIDS_PORTS \
| DFLAG_EXPORT_PTR_TAG \
| DFLAG_BIT_BINARIES \
- | DFLAG_MAP_TAG)
+ | DFLAG_MAP_TAG \
+ | DFLAG_BIG_CREATION)
/* opcodes used in distribution messages */
#define DOP_LINK 1
diff --git a/erts/emulator/beam/dtrace-wrapper.h b/erts/emulator/beam/dtrace-wrapper.h
index d343dc5ab0..6f70d5961e 100644
--- a/erts/emulator/beam/dtrace-wrapper.h
+++ b/erts/emulator/beam/dtrace-wrapper.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Dustin Sallings, Michal Ptaszek, Scott Lystig Fritchie 2011-2012.
+ * Copyright Dustin Sallings, Michal Ptaszek, Scott Lystig Fritchie 2011-2016.
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/erts/emulator/beam/elib_memmove.c b/erts/emulator/beam/elib_memmove.c
index d4ca30158e..2f45f69026 100644
--- a/erts/emulator/beam/elib_memmove.c
+++ b/erts/emulator/beam/elib_memmove.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_afit_alloc.c b/erts/emulator/beam/erl_afit_alloc.c
index 4b0541c10e..eda3ad870a 100644
--- a/erts/emulator/beam/erl_afit_alloc.c
+++ b/erts/emulator/beam/erl_afit_alloc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_afit_alloc.h b/erts/emulator/beam/erl_afit_alloc.h
index ef050ff50e..74258e284a 100644
--- a/erts/emulator/beam/erl_afit_alloc.h
+++ b/erts/emulator/beam/erl_afit_alloc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_alloc.c b/erts/emulator/beam/erl_alloc.c
index 490e0c0915..d04977b9ae 100644
--- a/erts/emulator/beam/erl_alloc.c
+++ b/erts/emulator/beam/erl_alloc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@
#endif
#define ERTS_ALLOC_C__
#define ERTS_ALC_INTERNAL__
+#define ERTS_WANT_MEM_MAPPERS
#include "sys.h"
#define ERL_THREADS_EMU_INTERNAL__
#include "erl_threads.h"
@@ -131,6 +132,9 @@ static ErtsAllocatorState_t ets_alloc_state;
static ErtsAllocatorState_t driver_alloc_state;
static ErtsAllocatorState_t fix_alloc_state;
static ErtsAllocatorState_t literal_alloc_state;
+#ifdef ERTS_ALC_A_EXEC
+static ErtsAllocatorState_t exec_alloc_state;
+#endif
static ErtsAllocatorState_t test_alloc_state;
typedef struct {
@@ -216,6 +220,7 @@ typedef struct {
struct au_init driver_alloc;
struct au_init fix_alloc;
struct au_init literal_alloc;
+ struct au_init exec_alloc;
struct au_init test_alloc;
} erts_alc_hndl_args_init_t;
@@ -307,9 +312,9 @@ set_default_literal_alloc_opts(struct au_init *ip)
ip->init.util.name_prefix = "literal_";
ip->init.util.alloc_no = ERTS_ALC_A_LITERAL;
#ifndef SMALL_MEMORY
- ip->init.util.mmbcs = 2*1024*1024; /* Main carrier size */
+ ip->init.util.mmbcs = 1024*1024; /* Main carrier size */
#else
- ip->init.util.mmbcs = 1*1024*1024; /* Main carrier size */
+ ip->init.util.mmbcs = 256*1024; /* Main carrier size */
#endif
ip->init.util.ts = ERTS_ALC_MTA_LITERAL;
ip->init.util.asbcst = 0;
@@ -329,15 +334,48 @@ set_default_literal_alloc_opts(struct au_init *ip)
ip->init.util.sys_dealloc = &erts_alcu_literal_32_sys_dealloc;
#elif defined(ARCH_64)
# ifdef ERTS_HAVE_OS_PHYSICAL_MEMORY_RESERVATION
- ip->init.util.mseg_alloc = &erts_alcu_literal_64_mseg_alloc;
- ip->init.util.mseg_realloc = &erts_alcu_literal_64_mseg_realloc;
- ip->init.util.mseg_dealloc = &erts_alcu_literal_64_mseg_dealloc;
+ ip->init.util.mseg_alloc = &erts_alcu_mmapper_mseg_alloc;
+ ip->init.util.mseg_realloc = &erts_alcu_mmapper_mseg_realloc;
+ ip->init.util.mseg_dealloc = &erts_alcu_mmapper_mseg_dealloc;
+ ip->init.util.mseg_mmapper = &erts_literal_mmapper;
# endif
#else
# error Unknown architecture
#endif
}
+#ifdef ERTS_ALC_A_EXEC
+static void
+set_default_exec_alloc_opts(struct au_init *ip)
+{
+ SET_DEFAULT_ALLOC_OPTS(ip);
+ ip->enable = 1;
+ ip->thr_spec = 0;
+ ip->disable_allowed = 0;
+ ip->thr_spec_allowed = 0;
+ ip->carrier_migration_allowed = 0;
+ ip->atype = BESTFIT;
+ ip->init.bf.ao = 1;
+ ip->init.util.ramv = 0;
+ ip->init.util.mmsbc = 0;
+ ip->init.util.sbct = ~((UWord) 0);
+ ip->init.util.name_prefix = "exec_";
+ ip->init.util.alloc_no = ERTS_ALC_A_EXEC;
+ ip->init.util.mmbcs = 0; /* No main carrier */
+ ip->init.util.ts = ERTS_ALC_MTA_EXEC;
+ ip->init.util.asbcst = 0;
+ ip->init.util.rsbcst = 0;
+ ip->init.util.rsbcmt = 0;
+ ip->init.util.rmbcmt = 0;
+ ip->init.util.acul = 0;
+
+ ip->init.util.mseg_alloc = &erts_alcu_mmapper_mseg_alloc;
+ ip->init.util.mseg_realloc = &erts_alcu_mmapper_mseg_realloc;
+ ip->init.util.mseg_dealloc = &erts_alcu_mmapper_mseg_dealloc;
+ ip->init.util.mseg_mmapper = &erts_exec_mmapper;
+}
+#endif /* ERTS_ALC_A_EXEC */
+
static void
set_default_temp_alloc_opts(struct au_init *ip)
{
@@ -659,6 +697,9 @@ erts_alloc_init(int *argc, char **argv, ErtsAllocInitOpts *eaiop)
set_default_fix_alloc_opts(&init.fix_alloc,
fix_type_sizes);
set_default_literal_alloc_opts(&init.literal_alloc);
+#ifdef ERTS_ALC_A_EXEC
+ set_default_exec_alloc_opts(&init.exec_alloc);
+#endif
set_default_test_alloc_opts(&init.test_alloc);
if (argc && argv)
@@ -688,6 +729,9 @@ erts_alloc_init(int *argc, char **argv, ErtsAllocInitOpts *eaiop)
init.driver_alloc.thr_spec = 0;
init.fix_alloc.thr_spec = 0;
init.literal_alloc.thr_spec = 0;
+#ifdef ERTS_ALC_A_EXEC
+ init.exec_alloc.thr_spec = 0;
+#endif
#endif
/* Make adjustments for carrier migration support */
@@ -701,6 +745,9 @@ erts_alloc_init(int *argc, char **argv, ErtsAllocInitOpts *eaiop)
adjust_carrier_migration_support(&init.driver_alloc);
adjust_carrier_migration_support(&init.fix_alloc);
adjust_carrier_migration_support(&init.literal_alloc);
+#ifdef ERTS_ALC_A_EXEC
+ adjust_carrier_migration_support(&init.exec_alloc);
+#endif
if (init.erts_alloc_config) {
/* Adjust flags that erts_alloc_config won't like */
@@ -716,6 +763,9 @@ erts_alloc_init(int *argc, char **argv, ErtsAllocInitOpts *eaiop)
init.driver_alloc.thr_spec = 0;
init.fix_alloc.thr_spec = 0;
init.literal_alloc.thr_spec = 0;
+#ifdef ERTS_ALC_A_EXEC
+ init.exec_alloc.thr_spec = 0;
+#endif
/* No carrier migration */
init.temp_alloc.init.util.acul = 0;
@@ -728,6 +778,9 @@ erts_alloc_init(int *argc, char **argv, ErtsAllocInitOpts *eaiop)
init.driver_alloc.init.util.acul = 0;
init.fix_alloc.init.util.acul = 0;
init.literal_alloc.init.util.acul = 0;
+#ifdef ERTS_ALC_A_EXEC
+ init.exec_alloc.init.util.acul = 0;
+#endif
}
#ifdef ERTS_SMP
@@ -745,6 +798,9 @@ erts_alloc_init(int *argc, char **argv, ErtsAllocInitOpts *eaiop)
adjust_tpref(&init.driver_alloc, erts_no_schedulers);
adjust_tpref(&init.fix_alloc, erts_no_schedulers);
adjust_tpref(&init.literal_alloc, erts_no_schedulers);
+#ifdef ERTS_ALC_A_EXEC
+ adjust_tpref(&init.exec_alloc, erts_no_schedulers);
+#endif
#else
/* No thread specific if not smp */
@@ -764,6 +820,9 @@ erts_alloc_init(int *argc, char **argv, ErtsAllocInitOpts *eaiop)
refuse_af_strategy(&init.driver_alloc);
refuse_af_strategy(&init.fix_alloc);
refuse_af_strategy(&init.literal_alloc);
+#ifdef ERTS_ALC_A_EXEC
+ refuse_af_strategy(&init.exec_alloc);
+#endif
#ifdef ERTS_SMP
if (!init.temp_alloc.thr_spec)
@@ -808,6 +867,9 @@ erts_alloc_init(int *argc, char **argv, ErtsAllocInitOpts *eaiop)
set_au_allocator(ERTS_ALC_A_DRIVER, &init.driver_alloc, ncpu);
set_au_allocator(ERTS_ALC_A_FIXED_SIZE, &init.fix_alloc, ncpu);
set_au_allocator(ERTS_ALC_A_LITERAL, &init.literal_alloc, ncpu);
+#ifdef ERTS_ALC_A_EXEC
+ set_au_allocator(ERTS_ALC_A_EXEC, &init.exec_alloc, ncpu);
+#endif
set_au_allocator(ERTS_ALC_A_TEST, &init.test_alloc, ncpu);
for (i = ERTS_ALC_A_MIN; i <= ERTS_ALC_A_MAX; i++) {
@@ -864,7 +926,11 @@ erts_alloc_init(int *argc, char **argv, ErtsAllocInitOpts *eaiop)
start_au_allocator(ERTS_ALC_A_LITERAL,
&init.literal_alloc,
&literal_alloc_state);
-
+#ifdef ERTS_ALC_A_EXEC
+ start_au_allocator(ERTS_ALC_A_EXEC,
+ &init.exec_alloc,
+ &exec_alloc_state);
+#endif
start_au_allocator(ERTS_ALC_A_TEST,
&init.test_alloc,
&test_alloc_state);
@@ -1499,6 +1565,16 @@ handle_args(int *argc, char **argv, erts_alc_hndl_args_init_t *init)
else
handle_au_arg(&init->literal_alloc, &argv[i][3], argv, &i, 0);
break;
+ case 'X':
+ if (has_prefix("scs", argv[i]+3)) {
+#ifdef ERTS_ALC_A_EXEC
+ init->mseg.exec_mmap.scs =
+#endif
+ get_mb_value(argv[i]+6, argv, &i);
+ }
+ else
+ handle_au_arg(&init->exec_alloc, &argv[i][3], argv, &i, 0);
+ break;
case 'D':
handle_au_arg(&init->std_alloc, &argv[i][3], argv, &i, 0);
break;
@@ -1949,7 +2025,7 @@ erts_alc_fatal_error(int error, int func, ErtsAlcType_t n, ...)
va_start(argp, n);
size = va_arg(argp, Uint);
va_end(argp);
- erts_exit(1,
+ erts_exit(ERTS_DUMP_EXIT,
"%s: Cannot %s %lu bytes of memory (of type \"%s\").\n",
allctr_str, op, size, t_str);
break;
@@ -3210,7 +3286,7 @@ reply_alloc_info(void *vair)
if (hp != hp_end)
erts_shrink_message_heap(&mp, rp, hp_start, hp, hp_end, &msg, 1);
- erts_queue_message(rp, &rp_locks, mp, msg, NIL);
+ erts_queue_message(rp, &rp_locks, mp, msg);
if (air->req_sched == sched_id)
rp_locks &= ~ERTS_PROC_LOCK_MAIN;
diff --git a/erts/emulator/beam/erl_alloc.h b/erts/emulator/beam/erl_alloc.h
index 71e4713624..925a081a02 100644
--- a/erts/emulator/beam/erl_alloc.h
+++ b/erts/emulator/beam/erl_alloc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -235,9 +235,9 @@ void *erts_alloc(ErtsAlcType_t type, Uint size)
void *res;
ERTS_MSACC_PUSH_AND_SET_STATE_X(ERTS_MSACC_STATE_ALLOC);
res = (*erts_allctrs[ERTS_ALC_T2A(type)].alloc)(
- ERTS_ALC_T2N(type),
- erts_allctrs[ERTS_ALC_T2A(type)].extra,
- size);
+ ERTS_ALC_T2N(type),
+ erts_allctrs[ERTS_ALC_T2A(type)].extra,
+ size);
if (!res)
erts_alloc_n_enomem(ERTS_ALC_T2N(type), size);
ERTS_MSACC_POP_STATE_X();
@@ -564,5 +564,3 @@ NAME##_free(TYPE *p) \
#undef ERTS_ALC_ATTRIBUTES
#endif /* #ifndef ERL_ALLOC_H__ */
-
-
diff --git a/erts/emulator/beam/erl_alloc.types b/erts/emulator/beam/erl_alloc.types
index 2932adca84..ba216c7eb4 100644
--- a/erts/emulator/beam/erl_alloc.types
+++ b/erts/emulator/beam/erl_alloc.types
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2014. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -87,6 +87,9 @@ allocator EHEAP true eheap_alloc
allocator ETS true ets_alloc
allocator FIXED_SIZE true fix_alloc
allocator LITERAL true literal_alloc
++if exec_alloc
+allocator EXEC true exec_alloc
++endif
+else # Non smp build
@@ -98,6 +101,9 @@ allocator EHEAP false eheap_alloc
allocator ETS false ets_alloc
allocator FIXED_SIZE false fix_alloc
allocator LITERAL false literal_alloc
++if exec_alloc
+allocator EXEC false exec_alloc
++endif
+endif
@@ -258,7 +264,6 @@ type PRTSD STANDARD SYSTEM port_specific_data
type CPUDATA LONG_LIVED SYSTEM cpu_data
type TMP_CPU_IDS SHORT_LIVED SYSTEM tmp_cpu_ids
type EXT_TERM_DATA SHORT_LIVED PROCESSES external_term_data
-type ZLIB STANDARD SYSTEM zlib
type CPU_GRPS_MAP LONG_LIVED SYSTEM cpu_groups_map
type AUX_WORK_TMO LONG_LIVED SYSTEM aux_work_timeouts
type MISC_AUX_WORK_Q LONG_LIVED SYSTEM misc_aux_work_q
@@ -270,6 +275,9 @@ type PROC_SYS_TSK SHORT_LIVED PROCESSES proc_sys_task
type PROC_SYS_TSK_QS SHORT_LIVED PROCESSES proc_sys_task_queues
type NEW_TIME_OFFSET SHORT_LIVED SYSTEM new_time_offset
type IOB_REQ SHORT_LIVED SYSTEM io_bytes_request
+type TRACER_NIF LONG_LIVED SYSTEM tracer_nif
+type TRACE_MSG_QUEUE SHORT_LIVED SYSTEM trace_message_queue
+type SCHED_ASYNC_JOB SHORT_LIVED SYSTEM async_calls
+if threads_no_smp
# Need thread safe allocs, but std_alloc and fix_alloc are not;
@@ -288,8 +296,10 @@ type THR_Q_LL LONG_LIVED SYSTEM long_lived_thr_queue
+if smp
type ASYNC SHORT_LIVED SYSTEM async
+type ZLIB STANDARD SYSTEM zlib
+else
-# sl_alloc is not thread safe in non smp build; therefore, we use driver_alloc
+# sl/std_alloc is not thread safe in non smp build; therefore, we use driver_alloc
+type ZLIB DRIVER SYSTEM zlib
type ASYNC DRIVER SYSTEM async
+endif
@@ -335,14 +345,22 @@ type SL_MPATHS SHORT_LIVED SYSTEM sl_migration_paths
# Currently most hipe code use this type.
type HIPE SYSTEM SYSTEM hipe_data
++if exec_alloc
+type HIPE_EXEC EXEC CODE hipe_code
+endif
++endif
+
+
+
+if heap_frag_elim_test
type SSB SHORT_LIVED PROCESSES ssb
+endif
+type DEBUG SHORT_LIVED SYSTEM debugging
+
type DDLL_PROCESS STANDARD SYSTEM ddll_processes
type MONITOR_LH STANDARD PROCESSES monitor_lh
type NLINK_LH STANDARD PROCESSES nlink_lh
diff --git a/erts/emulator/beam/erl_alloc_util.c b/erts/emulator/beam/erl_alloc_util.c
index 5e7dd7cce8..2995f2f822 100644
--- a/erts/emulator/beam/erl_alloc_util.c
+++ b/erts/emulator/beam/erl_alloc_util.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,6 +52,7 @@
#ifdef ERTS_ENABLE_LOCK_COUNT
#include "erl_lock_count.h"
#endif
+#include "lttng-wrapper.h"
#if defined(ERTS_ALLOC_UTIL_HARD_DEBUG) && defined(__GNUC__)
#warning "* * * * * * * * * *"
@@ -858,28 +859,36 @@ void*
erts_alcu_literal_32_mseg_alloc(Allctr_t *allctr, Uint *size_p, Uint flags)
{
void* res;
- ERTS_LC_ASSERT(allctr->alloc_no == ERTS_ALC_A_LITERAL
- && !allctr->t && allctr->thread_safe);
+ Uint sz = ERTS_SUPERALIGNED_CEILING(*size_p);
+ ERTS_LC_ASSERT(allctr->alloc_no == ERTS_ALC_A_LITERAL &&
+ allctr->t == 0);
+ ERTS_SMP_LC_ASSERT(allctr->thread_safe);
- res = erts_alcu_mseg_alloc(allctr, size_p, flags);
- if (res)
- set_literal_range(res, *size_p);
+ res = erts_alcu_mseg_alloc(allctr, &sz, flags);
+ if (res) {
+ set_literal_range(res, sz);
+ *size_p = sz;
+ }
return res;
}
void*
erts_alcu_literal_32_mseg_realloc(Allctr_t *allctr, void *seg,
- Uint old_size, Uint *new_size_p)
+ Uint old_size, Uint *new_size_p)
{
void* res;
- ERTS_LC_ASSERT(allctr->alloc_no == ERTS_ALC_A_LITERAL
- && !allctr->t && allctr->thread_safe);
+ Uint new_sz = ERTS_SUPERALIGNED_CEILING(*new_size_p);
+ ERTS_LC_ASSERT(allctr->alloc_no == ERTS_ALC_A_LITERAL &&
+ allctr->t == 0);
+ ERTS_SMP_LC_ASSERT(allctr->thread_safe);
if (seg && old_size)
clear_literal_range(seg, old_size);
- res = erts_alcu_mseg_realloc(allctr, seg, old_size, new_size_p);
- if (res)
- set_literal_range(res, *new_size_p);
+ res = erts_alcu_mseg_realloc(allctr, seg, old_size, &new_sz);
+ if (res) {
+ set_literal_range(res, new_sz);
+ *new_size_p = new_sz;
+ }
return res;
}
@@ -887,8 +896,9 @@ void
erts_alcu_literal_32_mseg_dealloc(Allctr_t *allctr, void *seg, Uint size,
Uint flags)
{
- ERTS_LC_ASSERT(allctr->alloc_no == ERTS_ALC_A_LITERAL
- && !allctr->t && allctr->thread_safe);
+ ERTS_LC_ASSERT(allctr->alloc_no == ERTS_ALC_A_LITERAL &&
+ allctr->t == 0);
+ ERTS_SMP_LC_ASSERT(allctr->thread_safe);
erts_alcu_mseg_dealloc(allctr, seg, size, flags);
@@ -897,8 +907,9 @@ erts_alcu_literal_32_mseg_dealloc(Allctr_t *allctr, void *seg, Uint size,
#elif defined(ARCH_64) && defined(ERTS_HAVE_OS_PHYSICAL_MEMORY_RESERVATION)
+/* Used by literal allocator that has its own mmapper (super carrier) */
void*
-erts_alcu_literal_64_mseg_alloc(Allctr_t *allctr, Uint *size_p, Uint flags)
+erts_alcu_mmapper_mseg_alloc(Allctr_t *allctr, Uint *size_p, Uint flags)
{
void* res;
UWord size = (UWord) *size_p;
@@ -906,33 +917,33 @@ erts_alcu_literal_64_mseg_alloc(Allctr_t *allctr, Uint *size_p, Uint flags)
if (flags & ERTS_MSEG_FLG_2POW)
mmap_flags |= ERTS_MMAPFLG_SUPERALIGNED;
- res = erts_mmap(&erts_literal_mmapper, mmap_flags, &size);
+ res = erts_mmap(allctr->mseg_mmapper, mmap_flags, &size);
*size_p = (Uint)size;
INC_CC(allctr->calls.mseg_alloc);
return res;
}
void*
-erts_alcu_literal_64_mseg_realloc(Allctr_t *allctr, void *seg,
+erts_alcu_mmapper_mseg_realloc(Allctr_t *allctr, void *seg,
Uint old_size, Uint *new_size_p)
{
void *res;
UWord new_size = (UWord) *new_size_p;
- res = erts_mremap(&erts_literal_mmapper, ERTS_MSEG_FLG_NONE, seg, old_size, &new_size);
+ res = erts_mremap(allctr->mseg_mmapper, ERTS_MSEG_FLG_NONE, seg, old_size, &new_size);
*new_size_p = (Uint) new_size;
INC_CC(allctr->calls.mseg_realloc);
return res;
}
void
-erts_alcu_literal_64_mseg_dealloc(Allctr_t *allctr, void *seg, Uint size,
+erts_alcu_mmapper_mseg_dealloc(Allctr_t *allctr, void *seg, Uint size,
Uint flags)
{
Uint32 mmap_flags = ERTS_MMAPFLG_SUPERCARRIER_ONLY;
if (flags & ERTS_MSEG_FLG_2POW)
mmap_flags |= ERTS_MMAPFLG_SUPERALIGNED;
- erts_munmap(&erts_literal_mmapper, mmap_flags, seg, (UWord)size);
+ erts_munmap(allctr->mseg_mmapper, mmap_flags, seg, (UWord)size);
INC_CC(allctr->calls.mseg_dealloc);
}
#endif /* ARCH_64 && ERTS_HAVE_OS_PHYSICAL_MEMORY_RESERVATION */
@@ -940,9 +951,10 @@ erts_alcu_literal_64_mseg_dealloc(Allctr_t *allctr, void *seg, Uint size,
#endif /* HAVE_ERTS_MSEG */
void*
-erts_alcu_sys_alloc(Allctr_t *allctr, Uint size, int superalign)
+erts_alcu_sys_alloc(Allctr_t *allctr, Uint* size_p, int superalign)
{
void *res;
+ const Uint size = *size_p;
#if ERTS_SA_MB_CARRIERS && ERTS_HAVE_ERTS_SYS_ALIGNED_ALLOC
if (superalign)
res = erts_sys_aligned_alloc(ERTS_SACRR_UNIT_SZ, size);
@@ -956,9 +968,10 @@ erts_alcu_sys_alloc(Allctr_t *allctr, Uint size, int superalign)
}
void*
-erts_alcu_sys_realloc(Allctr_t *allctr, void *ptr, Uint size, Uint old_size, int superalign)
+erts_alcu_sys_realloc(Allctr_t *allctr, void *ptr, Uint *size_p, Uint old_size, int superalign)
{
void *res;
+ const Uint size = *size_p;
#if ERTS_SA_MB_CARRIERS && ERTS_HAVE_ERTS_SYS_ALIGNED_ALLOC
if (superalign)
@@ -993,38 +1006,48 @@ erts_alcu_sys_dealloc(Allctr_t *allctr, void *ptr, Uint size, int superalign)
#ifdef ARCH_32
void*
-erts_alcu_literal_32_sys_alloc(Allctr_t *allctr, Uint size, int superalign)
+erts_alcu_literal_32_sys_alloc(Allctr_t *allctr, Uint* size_p, int superalign)
{
void* res;
- ERTS_LC_ASSERT(allctr->alloc_no == ERTS_ALC_A_LITERAL
- && !allctr->t && allctr->thread_safe);
+ Uint size = ERTS_SUPERALIGNED_CEILING(*size_p);
+ ERTS_LC_ASSERT(allctr->alloc_no == ERTS_ALC_A_LITERAL &&
+ allctr->t == 0);
+ ERTS_SMP_LC_ASSERT(allctr->thread_safe);
- res = erts_alcu_sys_alloc(allctr, size, 1);
- if (res)
+ res = erts_alcu_sys_alloc(allctr, &size, 1);
+ if (res) {
set_literal_range(res, size);
+ *size_p = size;
+ }
return res;
}
void*
-erts_alcu_literal_32_sys_realloc(Allctr_t *allctr, void *ptr, Uint size, Uint old_size, int superalign)
+erts_alcu_literal_32_sys_realloc(Allctr_t *allctr, void *ptr, Uint* size_p, Uint old_size, int superalign)
{
void* res;
- ERTS_LC_ASSERT(allctr->alloc_no == ERTS_ALC_A_LITERAL
- && !allctr->t && allctr->thread_safe);
+ Uint size = ERTS_SUPERALIGNED_CEILING(*size_p);
+
+ ERTS_LC_ASSERT(allctr->alloc_no == ERTS_ALC_A_LITERAL &&
+ allctr->t == 0);
+ ERTS_SMP_LC_ASSERT(allctr->thread_safe);
if (ptr && old_size)
clear_literal_range(ptr, old_size);
- res = erts_alcu_sys_realloc(allctr, ptr, size, old_size, 1);
- if (res)
+ res = erts_alcu_sys_realloc(allctr, ptr, &size, old_size, 1);
+ if (res) {
set_literal_range(res, size);
+ *size_p = size;
+ }
return res;
}
void
erts_alcu_literal_32_sys_dealloc(Allctr_t *allctr, void *ptr, Uint size, int superalign)
{
- ERTS_LC_ASSERT(allctr->alloc_no == ERTS_ALC_A_LITERAL
- && !allctr->t && allctr->thread_safe);
+ ERTS_LC_ASSERT(allctr->alloc_no == ERTS_ALC_A_LITERAL &&
+ allctr->t == 0);
+ ERTS_SMP_LC_ASSERT(allctr->thread_safe);
erts_alcu_sys_dealloc(allctr, ptr, size, 1);
@@ -3125,6 +3148,7 @@ cpool_insert(Allctr_t *allctr, Carrier_t *crr)
erts_smp_atomic_set_wb(&crr->allctr,
((erts_aint_t) allctr)|ERTS_CRR_ALCTR_FLG_IN_POOL);
+ LTTNG3(carrier_pool_put, ERTS_ALC_A2AD(allctr->alloc_no), allctr->ix, CARRIER_SZ(crr));
}
static void
@@ -3240,6 +3264,7 @@ cpool_fetch(Allctr_t *allctr, UWord size)
first_old_traitor = allctr->cpool.traitor_list.next;
cpool_entrance = NULL;
+ LTTNG3(carrier_pool_get, ERTS_ALC_A2AD(allctr->alloc_no), allctr->ix, (unsigned long)size);
/*
* Search my own pooled_list,
* i.e my abandoned carriers that were in the pool last time I checked.
@@ -3861,12 +3886,12 @@ create_carrier(Allctr_t *allctr, Uint umem_sz, UWord flags)
? UNIT_CEILING(bcrr_sz)
: SYS_ALLOC_CARRIER_CEILING(bcrr_sz));
- crr = (Carrier_t *) allctr->sys_alloc(allctr, crr_sz, flags & CFLG_MBC);
+ crr = (Carrier_t *) allctr->sys_alloc(allctr, &crr_sz, flags & CFLG_MBC);
if (!crr) {
if (crr_sz > UNIT_CEILING(bcrr_sz)) {
crr_sz = UNIT_CEILING(bcrr_sz);
- crr = (Carrier_t *) allctr->sys_alloc(allctr, crr_sz, flags & CFLG_MBC);
+ crr = (Carrier_t *) allctr->sys_alloc(allctr, &crr_sz, flags & CFLG_MBC);
}
if (!crr) {
#if HAVE_ERTS_MSEG
@@ -3925,6 +3950,21 @@ create_carrier(Allctr_t *allctr, Uint umem_sz, UWord flags)
}
+#ifdef USE_LTTNG_VM_TRACEPOINTS
+ if (LTTNG_ENABLED(carrier_create)) {
+ lttng_decl_carrier_stats(mbc_stats);
+ lttng_decl_carrier_stats(sbc_stats);
+ LTTNG_CARRIER_STATS_TO_LTTNG_STATS(&(allctr->mbcs), mbc_stats);
+ LTTNG_CARRIER_STATS_TO_LTTNG_STATS(&(allctr->sbcs), sbc_stats);
+ LTTNG5(carrier_create,
+ ERTS_ALC_A2AD(allctr->alloc_no),
+ allctr->ix,
+ crr_sz,
+ mbc_stats,
+ sbc_stats);
+ }
+#endif
+
DEBUG_SAVE_ALIGNMENT(crr);
return blk;
}
@@ -4009,7 +4049,7 @@ resize_carrier(Allctr_t *allctr, Block_t *old_blk, Uint umem_sz, UWord flags)
new_crr = (Carrier_t *) allctr->sys_realloc(allctr,
(void *) old_crr,
- new_crr_sz,
+ &new_crr_sz,
old_crr_sz,
0);
if (new_crr) {
@@ -4030,7 +4070,7 @@ resize_carrier(Allctr_t *allctr, Block_t *old_blk, Uint umem_sz, UWord flags)
new_crr_sz = UNIT_CEILING(new_crr_sz);
new_crr = (Carrier_t *) allctr->sys_realloc(allctr,
(void *) old_crr,
- new_crr_sz,
+ &new_crr_sz,
old_crr_sz,
0);
if (new_crr)
@@ -4148,6 +4188,21 @@ destroy_carrier(Allctr_t *allctr, Block_t *blk, Carrier_t **busy_pcrr_pp)
allctr->remove_mbc(allctr, crr);
}
+#ifdef USE_LTTNG_VM_TRACEPOINTS
+ if (LTTNG_ENABLED(carrier_destroy)) {
+ lttng_decl_carrier_stats(mbc_stats);
+ lttng_decl_carrier_stats(sbc_stats);
+ LTTNG_CARRIER_STATS_TO_LTTNG_STATS(&(allctr->mbcs), mbc_stats);
+ LTTNG_CARRIER_STATS_TO_LTTNG_STATS(&(allctr->sbcs), sbc_stats);
+ LTTNG5(carrier_destroy,
+ ERTS_ALC_A2AD(allctr->alloc_no),
+ allctr->ix,
+ crr_sz,
+ mbc_stats,
+ sbc_stats);
+ }
+#endif
+
#ifdef ERTS_SMP
schedule_dealloc_carrier(allctr, crr);
#else
@@ -6094,6 +6149,7 @@ erts_alcu_start(Allctr_t *allctr, AllctrInit_t *init)
allctr->mseg_alloc = init->mseg_alloc;
allctr->mseg_realloc = init->mseg_realloc;
allctr->mseg_dealloc = init->mseg_dealloc;
+ allctr->mseg_mmapper = init->mseg_mmapper;
}
else {
ASSERT(!init->mseg_realloc && !init->mseg_dealloc);
diff --git a/erts/emulator/beam/erl_alloc_util.h b/erts/emulator/beam/erl_alloc_util.h
index b7d717ed23..f50f09907a 100644
--- a/erts/emulator/beam/erl_alloc_util.h
+++ b/erts/emulator/beam/erl_alloc_util.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@
#endif
#include "erl_mseg.h"
+#include "lttng-wrapper.h"
#define ERTS_AU_PREF_ALLOC_BITS 11
#define ERTS_AU_MAX_PREF_ALLOC_INSTANCES (1 << ERTS_AU_PREF_ALLOC_BITS)
@@ -71,9 +72,10 @@ typedef struct {
void* (*mseg_alloc)(Allctr_t*, Uint *size_p, Uint flags);
void* (*mseg_realloc)(Allctr_t*, void *seg, Uint old_size, Uint *new_size_p);
void (*mseg_dealloc)(Allctr_t*, void *seg, Uint size, Uint flags);
+ ErtsMemMapper *mseg_mmapper;
#endif
- void* (*sys_alloc)(Allctr_t *allctr, Uint size, int superalign);
- void* (*sys_realloc)(Allctr_t *allctr, void *ptr, Uint size, Uint old_size, int superalign);
+ void* (*sys_alloc)(Allctr_t *allctr, Uint *size_p, int superalign);
+ void* (*sys_realloc)(Allctr_t *allctr, void *ptr, Uint *size_p, Uint old_size, int superalign);
void (*sys_dealloc)(Allctr_t *allctr, void *ptr, Uint size, int superalign);
} AllctrInit_t;
@@ -204,18 +206,18 @@ void* erts_alcu_literal_32_mseg_realloc(Allctr_t*, void *seg, Uint old_size, Uin
void erts_alcu_literal_32_mseg_dealloc(Allctr_t*, void *seg, Uint size, Uint flags);
# elif defined(ARCH_64) && defined(ERTS_HAVE_OS_PHYSICAL_MEMORY_RESERVATION)
-void* erts_alcu_literal_64_mseg_alloc(Allctr_t*, Uint *size_p, Uint flags);
-void* erts_alcu_literal_64_mseg_realloc(Allctr_t*, void *seg, Uint old_size, Uint *new_size_p);
-void erts_alcu_literal_64_mseg_dealloc(Allctr_t*, void *seg, Uint size, Uint flags);
+void* erts_alcu_mmapper_mseg_alloc(Allctr_t*, Uint *size_p, Uint flags);
+void* erts_alcu_mmapper_mseg_realloc(Allctr_t*, void *seg, Uint old_size, Uint *new_size_p);
+void erts_alcu_mmapper_mseg_dealloc(Allctr_t*, void *seg, Uint size, Uint flags);
# endif
#endif /* HAVE_ERTS_MSEG */
-void* erts_alcu_sys_alloc(Allctr_t*, Uint size, int superalign);
-void* erts_alcu_sys_realloc(Allctr_t*, void *ptr, Uint size, Uint old_size, int superalign);
+void* erts_alcu_sys_alloc(Allctr_t*, Uint *size_p, int superalign);
+void* erts_alcu_sys_realloc(Allctr_t*, void *ptr, Uint *size_p, Uint old_size, int superalign);
void erts_alcu_sys_dealloc(Allctr_t*, void *ptr, Uint size, int superalign);
#ifdef ARCH_32
-void* erts_alcu_literal_32_sys_alloc(Allctr_t*, Uint size, int superalign);
-void* erts_alcu_literal_32_sys_realloc(Allctr_t*, void *ptr, Uint size, Uint old_size, int superalign);
+void* erts_alcu_literal_32_sys_alloc(Allctr_t*, Uint *size_p, int superalign);
+void* erts_alcu_literal_32_sys_realloc(Allctr_t*, void *ptr, Uint *size_p, Uint old_size, int superalign);
void erts_alcu_literal_32_sys_dealloc(Allctr_t*, void *ptr, Uint size, int superalign);
#endif
@@ -417,6 +419,18 @@ typedef struct {
} blocks;
} CarriersStats_t;
+#ifdef USE_LTTNG_VM_TRACEPOINTS
+#define LTTNG_CARRIER_STATS_TO_LTTNG_STATS(CSP, LSP) \
+ do { \
+ (LSP)->carriers.size = (CSP)->curr.norm.mseg.size \
+ + (CSP)->curr.norm.sys_alloc.size; \
+ (LSP)->carriers.no = (CSP)->curr.norm.mseg.no \
+ + (CSP)->curr.norm.sys_alloc.no; \
+ (LSP)->blocks.size = (CSP)->blocks.curr.size; \
+ (LSP)->blocks.no = (CSP)->blocks.curr.no; \
+ } while (0)
+#endif
+
#ifdef ERTS_SMP
typedef union ErtsAllctrDDBlock_t_ ErtsAllctrDDBlock_t;
@@ -588,9 +602,10 @@ struct Allctr_t_ {
void* (*mseg_alloc)(Allctr_t*, Uint *size_p, Uint flags);
void* (*mseg_realloc)(Allctr_t*, void *seg, Uint old_size, Uint *new_size_p);
void (*mseg_dealloc)(Allctr_t*, void *seg, Uint size, Uint flags);
+ ErtsMemMapper *mseg_mmapper;
#endif
- void* (*sys_alloc)(Allctr_t *allctr, Uint size, int superalign);
- void* (*sys_realloc)(Allctr_t *allctr, void *ptr, Uint size, Uint old_size, int superalign);
+ void* (*sys_alloc)(Allctr_t *allctr, Uint *size_p, int superalign);
+ void* (*sys_realloc)(Allctr_t *allctr, void *ptr, Uint *size_p, Uint old_size, int superalign);
void (*sys_dealloc)(Allctr_t *allctr, void *ptr, Uint size, int superalign);
void (*init_atoms) (void);
diff --git a/erts/emulator/beam/erl_ao_firstfit_alloc.c b/erts/emulator/beam/erl_ao_firstfit_alloc.c
index 5cd067ff54..fbe4724047 100644
--- a/erts/emulator/beam/erl_ao_firstfit_alloc.c
+++ b/erts/emulator/beam/erl_ao_firstfit_alloc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_ao_firstfit_alloc.h b/erts/emulator/beam/erl_ao_firstfit_alloc.h
index 4200f20622..7349c6ab19 100644
--- a/erts/emulator/beam/erl_ao_firstfit_alloc.h
+++ b/erts/emulator/beam/erl_ao_firstfit_alloc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_arith.c b/erts/emulator/beam/erl_arith.c
index 3671025d22..861532f241 100644
--- a/erts/emulator/beam/erl_arith.c
+++ b/erts/emulator/beam/erl_arith.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2010. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_async.c b/erts/emulator/beam/erl_async.c
index cdeeb5281b..84254af0c2 100644
--- a/erts/emulator/beam/erl_async.c
+++ b/erts/emulator/beam/erl_async.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@
#include "erl_thr_queue.h"
#include "erl_async.h"
#include "dtrace-wrapper.h"
+#include "lttng-wrapper.h"
#define ERTS_MAX_ASYNC_READY_CALLS_IN_SEQ 20
@@ -281,6 +282,13 @@ static ERTS_INLINE void async_add(ErtsAsync *a, ErtsAsyncQ* q)
#endif
erts_thr_q_enqueue(&q->thr_q, a);
+#ifdef USE_LTTNG_VM_TRACEPOINTS
+ if (LTTNG_ENABLED(aio_pool_put)) {
+ lttng_decl_portbuf(port_str);
+ lttng_portid_to_str(a->port, port_str);
+ LTTNG2(aio_pool_put, port_str, -1);
+ }
+#endif
#ifdef USE_VM_PROBES
if (DTRACE_ENABLED(aio_pool_add)) {
DTRACE_CHARBUF(port_str, 16);
@@ -317,6 +325,14 @@ static ERTS_INLINE ErtsAsync *async_get(ErtsThrQ_t *q,
if (saved_fin_deq)
erts_thr_q_append_finalize_dequeue_data(&a->q.fin_deq, &fin_deq);
#endif
+#ifdef USE_LTTNG_VM_TRACEPOINTS
+ if (LTTNG_ENABLED(aio_pool_get)) {
+ lttng_decl_portbuf(port_str);
+ int length = erts_thr_q_length_dirty(q);
+ lttng_portid_to_str(a->port, port_str);
+ LTTNG2(aio_pool_get, port_str, length);
+ }
+#endif
#ifdef USE_VM_PROBES
if (DTRACE_ENABLED(aio_pool_get)) {
DTRACE_CHARBUF(port_str, 16);
diff --git a/erts/emulator/beam/erl_async.h b/erts/emulator/beam/erl_async.h
index 65538bcef0..473c7686e5 100644
--- a/erts/emulator/beam/erl_async.h
+++ b/erts/emulator/beam/erl_async.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_bestfit_alloc.c b/erts/emulator/beam/erl_bestfit_alloc.c
index f39a18ac88..379cee39a1 100644
--- a/erts/emulator/beam/erl_bestfit_alloc.c
+++ b/erts/emulator/beam/erl_bestfit_alloc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_bestfit_alloc.h b/erts/emulator/beam/erl_bestfit_alloc.h
index b315518b88..3a5f51f5dc 100644
--- a/erts/emulator/beam/erl_bestfit_alloc.h
+++ b/erts/emulator/beam/erl_bestfit_alloc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_bif_binary.c b/erts/emulator/beam/erl_bif_binary.c
index aec72bd61a..6e10980b6b 100644
--- a/erts/emulator/beam/erl_bif_binary.c
+++ b/erts/emulator/beam/erl_bif_binary.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_bif_chksum.c b/erts/emulator/beam/erl_bif_chksum.c
index e3074d6309..9417803e14 100644
--- a/erts/emulator/beam/erl_bif_chksum.c
+++ b/erts/emulator/beam/erl_bif_chksum.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_bif_ddll.c b/erts/emulator/beam/erl_bif_ddll.c
index f006856b6a..1e2db38442 100644
--- a/erts/emulator/beam/erl_bif_ddll.c
+++ b/erts/emulator/beam/erl_bif_ddll.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,6 +48,7 @@
#include "erl_version.h"
#include "erl_bif_unique.h"
#include "dtrace-wrapper.h"
+#include "lttng-wrapper.h"
#ifdef ERTS_SMP
#define DDLL_SMP 1
@@ -1619,6 +1620,7 @@ static int do_unload_driver_entry(DE_Handle *dh, Eterm *save_name)
if (q->finish) {
int fpe_was_unmasked = erts_block_fpe();
DTRACE1(driver_finish, q->name);
+ LTTNG1(driver_finish, q->name);
(*(q->finish))();
erts_unblock_fpe(fpe_was_unmasked);
}
@@ -1735,7 +1737,7 @@ static void notify_proc(Process *proc, Eterm ref, Eterm driver_name, Eterm type,
hp += REF_THING_SIZE;
mess = TUPLE5(hp,type,r,am_driver,driver_name,tag);
}
- erts_queue_message(proc, &rp_locks, mp, mess, am_undefined);
+ erts_queue_message(proc, &rp_locks, mp, mess);
erts_smp_proc_unlock(proc, rp_locks);
ERTS_SMP_CHK_NO_PROC_LOCKS;
}
diff --git a/erts/emulator/beam/erl_bif_guard.c b/erts/emulator/beam/erl_bif_guard.c
index 4a9a6a5fcd..b42d2dc28b 100644
--- a/erts/emulator/beam/erl_bif_guard.c
+++ b/erts/emulator/beam/erl_bif_guard.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index 8c748c9bf7..99fe847ba2 100644
--- a/erts/emulator/beam/erl_bif_info.c
+++ b/erts/emulator/beam/erl_bif_info.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@
# include "config.h"
#endif
+#define ERTS_WANT_MEM_MAPPERS
#include "sys.h"
#include "erl_vm.h"
#include "global.h"
@@ -126,6 +127,9 @@ static char erts_system_version[] = ("Erlang/OTP " ERLANG_OTP_RELEASE
#ifdef ERTS_FRMPTR
" [frame-pointer]"
#endif
+#ifdef USE_LTTNG
+ " [lttng]"
+#endif
#ifdef USE_DTRACE
" [dtrace]"
#endif
@@ -843,6 +847,7 @@ process_info_list(Process *c_p, Eterm pid, Eterm list, int always_wrap,
if (unlock_locks)
erts_smp_proc_unlock(rp, unlock_locks);
+
}
/*
@@ -1354,9 +1359,10 @@ process_info_aux(Process *BIF_P,
total_heap_size += rp->mbuf_sz;
- for (mp = rp->msg.first; mp; mp = mp->next)
- if (mp->data.attached)
- total_heap_size += erts_msg_attached_data_size(mp);
+ if (rp->flags & F_ON_HEAP_MSGQ)
+ for (mp = rp->msg.first; mp; mp = mp->next)
+ if (mp->data.attached)
+ total_heap_size += erts_msg_attached_data_size(mp);
(void) erts_bld_uint(NULL, &hsz, total_heap_size);
hp = HAlloc(BIF_P, hsz);
@@ -1480,7 +1486,7 @@ process_info_aux(Process *BIF_P,
}
case am_last_calls: {
- struct saved_calls *scb = ERTS_PROC_GET_SAVED_CALLS_BUF(BIF_P);
+ struct saved_calls *scb = ERTS_PROC_GET_SAVED_CALLS_BUF(rp);
if (!scb) {
hp = HAlloc(BIF_P, 3);
res = am_false;
@@ -2159,8 +2165,8 @@ BIF_RETTYPE system_info_1(BIF_ALIST_1)
res = build_snifs_term(&hp, NULL, NIL);
BIF_RET(res);
} else if (BIF_ARG_1 == am_sequential_tracer) {
- val = erts_get_system_seq_tracer();
- ASSERT(is_internal_pid(val) || is_internal_port(val) || val==am_false);
+ ErtsTracer seq_tracer = erts_get_system_seq_tracer();
+ val = erts_tracer_to_term(BIF_P, seq_tracer);
hp = HAlloc(BIF_P, 3);
res = TUPLE2(hp, am_sequential_tracer, val);
BIF_RET(res);
@@ -2748,6 +2754,9 @@ BIF_RETTYPE system_info_1(BIF_ALIST_1)
#elif defined(USE_SYSTEMTAP)
DECL_AM(systemtap);
BIF_RET(AM_systemtap);
+#elif defined(USE_LTTNG)
+ DECL_AM(lttng);
+ BIF_RET(AM_lttng);
#else
BIF_RET(am_none);
#endif
diff --git a/erts/emulator/beam/erl_bif_lists.c b/erts/emulator/beam/erl_bif_lists.c
index fe64e76575..73d327da3e 100644
--- a/erts/emulator/beam/erl_bif_lists.c
+++ b/erts/emulator/beam/erl_bif_lists.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,32 +40,93 @@ static BIF_RETTYPE append(Process* p, Eterm A, Eterm B)
Eterm list;
Eterm copy;
Eterm last;
- size_t need;
- Eterm* hp;
+ Eterm* hp = NULL;
Sint i;
- if ((i = erts_list_length(A)) < 0) {
- BIF_ERROR(p, BADARG);
+ list = A;
+
+ if (is_nil(list)) {
+ BIF_RET(B);
}
- if (i == 0) {
- BIF_RET(B);
- } else if (is_nil(B)) {
- BIF_RET(A);
+
+ if (is_not_list(list)) {
+ BIF_ERROR(p, BADARG);
}
- need = 2*i;
- hp = HAlloc(p, need);
- list = A;
+ /* optimistic append on heap first */
+
+ if ((i = HeapWordsLeft(p) / 2) < 4) {
+ goto list_tail;
+ }
+
+ hp = HEAP_TOP(p);
copy = last = CONS(hp, CAR(list_val(list)), make_list(hp+2));
list = CDR(list_val(list));
- hp += 2;
+ hp += 2;
+ i -= 2; /* don't use the last 2 words (extra i--;) */
+
+ while(i-- && is_list(list)) {
+ Eterm* listp = list_val(list);
+ last = CONS(hp, CAR(listp), make_list(hp+2));
+ list = CDR(listp);
+ hp += 2;
+ }
+
+ /* A is proper and B is NIL return A as-is, don't update HTOP */
+
+ if (is_nil(list) && is_nil(B)) {
+ BIF_RET(A);
+ }
+
+ if (is_nil(list)) {
+ HEAP_TOP(p) = hp;
+ CDR(list_val(last)) = B;
+ BIF_RET(copy);
+ }
+
+list_tail:
+
+ if ((i = erts_list_length(list)) < 0) {
+ BIF_ERROR(p, BADARG);
+ }
+
+ /* remaining list was proper and B is NIL */
+ if (is_nil(B)) {
+ BIF_RET(A);
+ }
+
+ if (hp) {
+ /* Note: fall through case, already written
+ * on the heap.
+ * The last 2 words of the heap is not written yet
+ */
+ Eterm *hp_save = hp;
+ ASSERT(i != 0);
+ HEAP_TOP(p) = hp + 2;
+ if (i == 1) {
+ hp[0] = CAR(list_val(list));
+ hp[1] = B;
+ BIF_RET(copy);
+ }
+ hp = HAlloc(p, 2*(i - 1));
+ last = CONS(hp_save, CAR(list_val(list)), make_list(hp));
+ } else {
+ hp = HAlloc(p, 2*i);
+ copy = last = CONS(hp, CAR(list_val(list)), make_list(hp+2));
+ hp += 2;
+ }
+
+ list = CDR(list_val(list));
i--;
+
+ ASSERT(i > -1);
while(i--) {
- Eterm* listp = list_val(list);
- last = CONS(hp, CAR(listp), make_list(hp+2));
- list = CDR(listp);
- hp += 2;
+ Eterm* listp = list_val(list);
+ last = CONS(hp, CAR(listp), make_list(hp+2));
+ list = CDR(listp);
+ hp += 2;
}
+
CDR(list_val(last)) = B;
BIF_RET(copy);
}
diff --git a/erts/emulator/beam/erl_bif_op.c b/erts/emulator/beam/erl_bif_op.c
index 0f20ded1d6..aecb8bf0c1 100644
--- a/erts/emulator/beam/erl_bif_op.c
+++ b/erts/emulator/beam/erl_bif_op.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_bif_os.c b/erts/emulator/beam/erl_bif_os.c
index 2333ca0851..46777d3aa5 100644
--- a/erts/emulator/beam/erl_bif_os.c
+++ b/erts/emulator/beam/erl_bif_os.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2012. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_bif_port.c b/erts/emulator/beam/erl_bif_port.c
index 86bcf43678..37f4e1de49 100644
--- a/erts/emulator/beam/erl_bif_port.c
+++ b/erts/emulator/beam/erl_bif_port.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -79,6 +79,7 @@ BIF_RETTYPE erts_internal_open_port_2(BIF_ALIST_2)
}
if (port->drv_ptr->flags & ERL_DRV_FLAG_USE_INIT_ACK) {
+
/* Copied from erl_port_task.c */
port->async_open_port = erts_alloc(ERTS_ALC_T_PRTSD,
sizeof(*port->async_open_port));
@@ -109,6 +110,10 @@ BIF_RETTYPE erts_internal_open_port_2(BIF_ALIST_2)
erts_add_link(&ERTS_P_LINKS(port), LINK_PID, BIF_P->common.id);
erts_add_link(&ERTS_P_LINKS(BIF_P), LINK_PID, port->common.id);
+ if (IS_TRACED_FL(BIF_P, F_TRACE_PROCS))
+ trace_proc(BIF_P, ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_LINK, BIF_P,
+ am_link, port->common.id);
+
erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_LINK);
erts_port_release(port);
@@ -339,8 +344,7 @@ BIF_RETTYPE erts_internal_port_close_1(BIF_ALIST_1)
if (!prt)
BIF_RET(am_badarg);
-
- switch (erts_port_exit(BIF_P, 0, prt, prt->common.id, am_normal, &ref)) {
+ switch (erts_port_exit(BIF_P, 0, prt, BIF_P->common.id, am_normal, &ref)) {
case ERTS_PORT_OP_CALLER_EXIT:
case ERTS_PORT_OP_BADARG:
case ERTS_PORT_OP_DROPPED:
@@ -373,7 +377,7 @@ BIF_RETTYPE erts_internal_port_connect_2(BIF_ALIST_2)
ref = NIL;
#endif
- switch (erts_port_connect(BIF_P, 0, prt, prt->common.id, BIF_ARG_2, &ref)) {
+ switch (erts_port_connect(BIF_P, 0, prt, BIF_P->common.id, BIF_ARG_2, &ref)) {
case ERTS_PORT_OP_CALLER_EXIT:
case ERTS_PORT_OP_BADARG:
case ERTS_PORT_OP_DROPPED:
@@ -911,7 +915,7 @@ open_port(Process* p, Eterm name, Eterm settings, int *err_typep, int *err_nump)
}
if (IS_TRACED_FL(p, F_TRACE_SCHED_PROCS)) {
- trace_virtual_sched(p, am_out);
+ trace_sched(p, ERTS_PROC_LOCK_MAIN, am_out);
}
@@ -928,21 +932,22 @@ open_port(Process* p, Eterm name, Eterm settings, int *err_typep, int *err_nump)
DTRACE3(port_open, process_str, name_buf, port_str);
}
#endif
+
+ if (port && IS_TRACED_FL(port, F_TRACE_PORTS))
+ trace_port(port, am_getting_linked, p->common.id);
+
erts_smp_proc_lock(p, ERTS_PROC_LOCK_MAIN);
+ if (IS_TRACED_FL(p, F_TRACE_SCHED_PROCS)) {
+ trace_sched(p, ERTS_PROC_LOCK_MAIN, am_in);
+ }
+
if (!port) {
DEBUGF(("open_driver returned (%d:%d)\n",
err_typep ? *err_typep : 4711,
err_nump ? *err_nump : 4711));
- if (IS_TRACED_FL(p, F_TRACE_SCHED_PROCS)) {
- trace_virtual_sched(p, am_in);
- }
goto do_return;
}
-
- if (IS_TRACED_FL(p, F_TRACE_SCHED_PROCS)) {
- trace_virtual_sched(p, am_in);
- }
if (linebuf && port->linebuf == NULL){
port->linebuf = allocate_linebuf(linebuf);
@@ -985,6 +990,8 @@ static char **convert_args(Eterm l)
}
n = erts_list_length(l);
+ if (n < 0)
+ return NULL;
/* We require at least one element in argv[0] + NULL at end */
pp = erts_alloc(ERTS_ALC_T_TMP, (n + 2) * sizeof(char **));
pp[i++] = erts_default_arg0;
diff --git a/erts/emulator/beam/erl_bif_re.c b/erts/emulator/beam/erl_bif_re.c
index 7f7cd376ac..f4daecd2a4 100644
--- a/erts/emulator/beam/erl_bif_re.c
+++ b/erts/emulator/beam/erl_bif_re.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_bif_trace.c b/erts/emulator/beam/erl_bif_trace.c
index 71a7079b09..ff2018aa27 100644
--- a/erts/emulator/beam/erl_bif_trace.c
+++ b/erts/emulator/beam/erl_bif_trace.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@ static int erts_default_trace_pattern_is_on;
static Binary *erts_default_match_spec;
static Binary *erts_default_meta_match_spec;
static struct trace_pattern_flags erts_default_trace_pattern_flags;
-static Eterm erts_default_meta_tracer_pid;
+static ErtsTracer erts_default_meta_tracer;
static struct { /* Protected by code write permission */
int current;
@@ -75,8 +75,6 @@ static BIF_RETTYPE
system_monitor(Process *p, Eterm monitor_pid, Eterm list);
static void new_seq_trace_token(Process* p); /* help func for seq_trace_2*/
-static int already_traced(Process *p, Process *tracee_p, Eterm tracer);
-static int port_already_traced(Process *p, Port *tracee_port, Eterm tracer);
static Eterm trace_info_pid(Process* p, Eterm pid_spec, Eterm key);
static Eterm trace_info_func(Process* p, Eterm pid_spec, Eterm key);
static Eterm trace_info_on_load(Process* p, Eterm key);
@@ -94,21 +92,15 @@ erts_bif_trace_init(void)
erts_default_match_spec = NULL;
erts_default_meta_match_spec = NULL;
erts_default_trace_pattern_flags = erts_trace_pattern_flags_off;
- erts_default_meta_tracer_pid = NIL;
+ erts_default_meta_tracer = erts_tracer_nil;
}
/*
* Turn on/off call tracing for the given function(s).
*/
-
-Eterm
-trace_pattern_2(BIF_ALIST_2)
-{
- return trace_pattern(BIF_P, BIF_ARG_1, BIF_ARG_2, NIL);
-}
Eterm
-trace_pattern_3(BIF_ALIST_3)
+erts_internal_trace_pattern_3(BIF_ALIST_3)
{
return trace_pattern(BIF_P, BIF_ARG_1, BIF_ARG_2, BIF_ARG_3);
}
@@ -125,11 +117,10 @@ trace_pattern(Process* p, Eterm MFA, Eterm Pattern, Eterm flaglist)
Eterm l;
struct trace_pattern_flags flags = erts_trace_pattern_flags_off;
int is_global;
- Process *meta_tracer_proc = p;
- Eterm meta_tracer_pid = p->common.id;
+ ErtsTracer meta_tracer = erts_tracer_nil;
if (!erts_try_seize_code_write_permission(p)) {
- ERTS_BIF_YIELD3(bif_export[BIF_trace_pattern_3], p, MFA, Pattern, flaglist);
+ ERTS_BIF_YIELD3(bif_export[BIF_erts_internal_trace_pattern_3], p, MFA, Pattern, flaglist);
}
finish_bp.current = -1;
@@ -160,31 +151,11 @@ trace_pattern(Process* p, Eterm MFA, Eterm Pattern, Eterm flaglist)
is_global = 0;
for(l = flaglist; is_list(l); l = CDR(list_val(l))) {
if (is_tuple(CAR(list_val(l)))) {
- Eterm *tp = tuple_val(CAR(list_val(l)));
-
- if (arityval(tp[0]) != 2 || tp[1] != am_meta) {
- goto error;
- }
- meta_tracer_pid = tp[2];
- if (is_internal_pid(meta_tracer_pid)) {
- meta_tracer_proc = erts_pid2proc(NULL, 0, meta_tracer_pid, 0);
- if (!meta_tracer_proc) {
- goto error;
- }
- } else if (is_internal_port(meta_tracer_pid)) {
- Port *meta_tracer_port;
- meta_tracer_proc = NULL;
- meta_tracer_port = (erts_port_lookup(
- meta_tracer_pid,
- ERTS_PORT_SFLGS_INVALID_TRACER_LOOKUP));
- if (!meta_tracer_port)
- goto error;
- } else {
- goto error;
- }
- if (is_global) {
- goto error;
- }
+ meta_tracer = erts_term_to_tracer(am_meta, CAR(list_val(l)));
+ if (meta_tracer == THE_NON_VALUE) {
+ meta_tracer = erts_tracer_nil;
+ goto error;
+ }
flags.breakpoint = 1;
flags.meta = 1;
} else {
@@ -202,6 +173,8 @@ trace_pattern(Process* p, Eterm MFA, Eterm Pattern, Eterm flaglist)
}
flags.breakpoint = 1;
flags.meta = 1;
+ if (ERTS_TRACER_IS_NIL(meta_tracer))
+ meta_tracer = erts_term_to_tracer(THE_NON_VALUE, p->common.id);
break;
case am_global:
if (flags.breakpoint) {
@@ -252,14 +225,11 @@ trace_pattern(Process* p, Eterm MFA, Eterm Pattern, Eterm flaglist)
MatchSetUnref(erts_default_meta_match_spec);
erts_default_meta_match_spec = match_prog_set;
MatchSetRef(erts_default_meta_match_spec);
- erts_default_meta_tracer_pid = meta_tracer_pid;
- if (meta_tracer_proc) {
- ERTS_TRACE_FLAGS(meta_tracer_proc) |= F_TRACER;
- }
+ erts_tracer_update(&erts_default_meta_tracer, meta_tracer);
} else if (! flags.breakpoint) {
MatchSetUnref(erts_default_meta_match_spec);
erts_default_meta_match_spec = NULL;
- erts_default_meta_tracer_pid = NIL;
+ ERTS_TRACER_CLEAR(&erts_default_meta_tracer);
}
if (erts_default_trace_pattern_flags.breakpoint &&
flags.breakpoint) {
@@ -340,20 +310,18 @@ trace_pattern(Process* p, Eterm MFA, Eterm Pattern, Eterm flaglist)
if (is_small(mfa[2])) {
mfa[2] = signed_val(mfa[2]);
}
-
- if (meta_tracer_proc) {
- ERTS_TRACE_FLAGS(meta_tracer_proc) |= F_TRACER;
- }
matches = erts_set_trace_pattern(p, mfa, specified,
match_prog_set, match_prog_set,
- on, flags, meta_tracer_pid, 0);
+ on, flags, meta_tracer, 0);
}
error:
MatchSetUnref(match_prog_set);
UnUseTmpHeap(3,p);
+ ERTS_TRACER_CLEAR(&meta_tracer);
+
#ifdef ERTS_SMP
if (finish_bp.current >= 0) {
ASSERT(matches >= 0);
@@ -404,7 +372,7 @@ erts_get_default_trace_pattern(int *trace_pattern_is_on,
Binary **match_spec,
Binary **meta_match_spec,
struct trace_pattern_flags *trace_pattern_flags,
- Eterm *meta_tracer_pid)
+ ErtsTracer *meta_tracer)
{
ERTS_SMP_LC_ASSERT(erts_has_code_write_permission() ||
erts_smp_thr_progress_is_blocking());
@@ -416,8 +384,8 @@ erts_get_default_trace_pattern(int *trace_pattern_is_on,
*meta_match_spec = erts_default_meta_match_spec;
if (trace_pattern_flags)
*trace_pattern_flags = erts_default_trace_pattern_flags;
- if (meta_tracer_pid)
- *meta_tracer_pid = erts_default_meta_tracer_pid;
+ if (meta_tracer)
+ *meta_tracer = erts_default_meta_tracer;
}
int erts_is_default_trace_enabled(void)
@@ -465,12 +433,12 @@ erts_trace_flag2bit(Eterm flag)
** occurred in the argument list.
*/
int
-erts_trace_flags(Eterm List,
- Uint *pMask, Eterm *pTracer, int *pCpuTimestamp)
+erts_trace_flags(Eterm List,
+ Uint *pMask, ErtsTracer *pTracer, int *pCpuTimestamp)
{
Eterm list = List;
Uint mask = 0;
- Eterm tracer = NIL;
+ ErtsTracer tracer = erts_tracer_nil;
int cpu_timestamp = 0;
while (is_list(list)) {
@@ -483,33 +451,73 @@ erts_trace_flags(Eterm List,
cpu_timestamp = !0;
#endif
} else if (is_tuple(item)) {
- Eterm* tp = tuple_val(item);
-
- if (arityval(tp[0]) != 2 || tp[1] != am_tracer) goto error;
- if (is_internal_pid(tp[2]) || is_internal_port(tp[2])) {
- tracer = tp[2];
- } else goto error;
+ tracer = erts_term_to_tracer(am_tracer, item);
+ if (tracer == THE_NON_VALUE)
+ goto error;
} else goto error;
list = CDR(list_val(list));
}
if (is_not_nil(list)) goto error;
- if (pMask && mask) *pMask = mask;
- if (pTracer && tracer != NIL) *pTracer = tracer;
- if (pCpuTimestamp && cpu_timestamp) *pCpuTimestamp = cpu_timestamp;
+ if (pMask && mask) *pMask = mask;
+ if (pTracer && !ERTS_TRACER_IS_NIL(tracer)) *pTracer = tracer;
+ if (pCpuTimestamp && cpu_timestamp) *pCpuTimestamp = cpu_timestamp;
return !0;
error:
return 0;
}
-Eterm trace_3(BIF_ALIST_3)
+static ERTS_INLINE int
+start_trace(Process *c_p, ErtsTracer tracer,
+ ErtsPTabElementCommon *common,
+ int on, int mask)
+{
+ /* We can use the common part of both port+proc without checking what it is
+ In the code below port is used for both proc and port */
+ Port *port = (Port*)common;
+
+ /*
+ * SMP build assumes that either system is blocked or:
+ * * main lock is held on c_p
+ * * all locks are held on port common
+ */
+
+ if (!ERTS_TRACER_IS_NIL(tracer)) {
+ if ((ERTS_TRACE_FLAGS(port) & TRACEE_FLAGS)
+ && !ERTS_TRACER_COMPARE(ERTS_TRACER(port), tracer)) {
+ /* This tracee is already being traced, and not by the
+ * tracer to be */
+ if (erts_is_tracer_proc_enabled(c_p, ERTS_PROC_LOCKS_ALL,
+ common, am_trace_status)) {
+ /* The tracer is still in use */
+ return 1;
+ }
+ /* Current tracer now invalid */
+ }
+ }
+
+ if (on)
+ ERTS_TRACE_FLAGS(port) |= mask;
+ else
+ ERTS_TRACE_FLAGS(port) &= ~mask;
+
+ if ((ERTS_TRACE_FLAGS(port) & TRACEE_FLAGS) == 0) {
+ tracer = erts_tracer_nil;
+ erts_tracer_replace(common, erts_tracer_nil);
+ } else if (!ERTS_TRACER_IS_NIL(tracer))
+ erts_tracer_replace(common, tracer);
+
+ return 0;
+}
+
+Eterm erts_internal_trace_3(BIF_ALIST_3)
{
Process* p = BIF_P;
Eterm pid_spec = BIF_ARG_1;
Eterm how = BIF_ARG_2;
Eterm list = BIF_ARG_3;
int on;
- Eterm tracer = NIL;
+ ErtsTracer tracer = erts_tracer_nil;
int matches = 0;
Uint mask = 0;
int cpu_ts = 0;
@@ -522,41 +530,24 @@ Eterm trace_3(BIF_ALIST_3)
}
if (!erts_try_seize_code_write_permission(BIF_P)) {
- ERTS_BIF_YIELD3(bif_export[BIF_trace_3], BIF_P, BIF_ARG_1, BIF_ARG_2, BIF_ARG_3);
+ ERTS_BIF_YIELD3(bif_export[BIF_erts_internal_trace_3],
+ BIF_P, BIF_ARG_1, BIF_ARG_2, BIF_ARG_3);
}
- if (is_nil(tracer) || is_internal_pid(tracer)) {
- Process *tracer_proc = erts_pid2proc(p,
- ERTS_PROC_LOCK_MAIN,
- is_nil(tracer) ? p->common.id : tracer,
- ERTS_PROC_LOCKS_ALL);
- if (!tracer_proc)
- goto error;
- ERTS_TRACE_FLAGS(tracer_proc) |= F_TRACER;
- erts_smp_proc_unlock(tracer_proc,
- (tracer_proc == p
- ? ERTS_PROC_LOCKS_ALL_MINOR
- : ERTS_PROC_LOCKS_ALL));
- } else if (is_internal_port(tracer)) {
- Port *tracer_port = erts_id2port_sflgs(tracer,
- p,
- ERTS_PROC_LOCK_MAIN,
- ERTS_PORT_SFLGS_INVALID_TRACER_LOOKUP);
- if (!tracer_port)
- goto error;
- ERTS_TRACE_FLAGS(tracer_port) |= F_TRACER;
- erts_port_release(tracer_port);
- } else
- goto error;
-
switch (how) {
case am_false:
on = 0;
break;
case am_true:
on = 1;
- if (is_nil(tracer))
- tracer = p->common.id;
+ if (ERTS_TRACER_IS_NIL(tracer))
+ tracer = erts_term_to_tracer(am_tracer, p->common.id);
+
+ if (tracer == THE_NON_VALUE) {
+ tracer = erts_tracer_nil;
+ goto error;
+ }
+
break;
default:
goto error;
@@ -575,34 +566,20 @@ Eterm trace_3(BIF_ALIST_3)
}
#endif
- if (pid_spec == tracer)
- goto error;
-
tracee_port = erts_id2port_sflgs(pid_spec,
p,
ERTS_PROC_LOCK_MAIN,
ERTS_PORT_SFLGS_INVALID_LOOKUP);
+
if (!tracee_port)
goto error;
-
- if (tracer != NIL && port_already_traced(p, tracee_port, tracer)) {
+
+ if (start_trace(p, tracer, &tracee_port->common, on, mask)) {
erts_port_release(tracee_port);
goto already_traced;
- }
-
- if (on)
- ERTS_TRACE_FLAGS(tracee_port) |= mask;
- else
- ERTS_TRACE_FLAGS(tracee_port) &= ~mask;
-
- if (!ERTS_TRACE_FLAGS(tracee_port))
- ERTS_TRACER_PROC(tracee_port) = NIL;
- else if (tracer != NIL)
- ERTS_TRACER_PROC(tracee_port) = tracer;
-
- erts_port_release(tracee_port);
-
- matches = 1;
+ }
+ erts_port_release(tracee_port);
+ matches = 1;
} else if (is_pid(pid_spec)) {
Process *tracee_p;
@@ -615,33 +592,19 @@ Eterm trace_3(BIF_ALIST_3)
* and not about to be tracing.
*/
- if (pid_spec == tracer)
- goto error;
-
tracee_p = erts_pid2proc(p, ERTS_PROC_LOCK_MAIN,
pid_spec, ERTS_PROC_LOCKS_ALL);
if (!tracee_p)
goto error;
- if (tracer != NIL && already_traced(p, tracee_p, tracer)) {
+ if (start_trace(tracee_p, tracer, &tracee_p->common, on, mask)) {
erts_smp_proc_unlock(tracee_p,
(tracee_p == p
? ERTS_PROC_LOCKS_ALL_MINOR
: ERTS_PROC_LOCKS_ALL));
goto already_traced;
- }
-
- if (on)
- ERTS_TRACE_FLAGS(tracee_p) |= mask;
- else
- ERTS_TRACE_FLAGS(tracee_p) &= ~mask;
-
- if ((ERTS_TRACE_FLAGS(tracee_p) & TRACEE_FLAGS) == 0)
- ERTS_TRACER_PROC(tracee_p) = NIL;
- else if (tracer != NIL)
- ERTS_TRACER_PROC(tracee_p) = tracer;
-
- erts_smp_proc_unlock(tracee_p,
+ }
+ erts_smp_proc_unlock(tracee_p,
(tracee_p == p
? ERTS_PROC_LOCKS_ALL_MINOR
: ERTS_PROC_LOCKS_ALL));
@@ -692,18 +655,27 @@ Eterm trace_3(BIF_ALIST_3)
}
#endif
- if (pid_spec == am_all || pid_spec == am_existing) {
+ if (pid_spec == am_all || pid_spec == am_existing ||
+ pid_spec == am_ports || pid_spec == am_processes ||
+ pid_spec == am_existing_ports || pid_spec == am_existing_processes
+ ) {
int i;
int procs = 0;
int ports = 0;
int mods = 0;
if (mask & (ERTS_PROC_TRACEE_FLAGS & ~ERTS_TRACEE_MODIFIER_FLAGS))
- procs = 1;
+ procs = pid_spec != am_ports && pid_spec != am_existing_ports;
if (mask & (ERTS_PORT_TRACEE_FLAGS & ~ERTS_TRACEE_MODIFIER_FLAGS))
- ports = 1;
- if (mask & ERTS_TRACEE_MODIFIER_FLAGS)
- mods = 1;
+ ports = pid_spec != am_processes && pid_spec != am_existing_processes;
+ if (mask & ERTS_TRACEE_MODIFIER_FLAGS) {
+ if (pid_spec == am_ports || pid_spec == am_existing_ports)
+ ports = 1;
+ else if (pid_spec == am_processes || pid_spec == am_existing_processes)
+ procs = 1;
+ else
+ mods = 1;
+ }
#ifdef ERTS_SMP
erts_smp_proc_unlock(p, ERTS_PROC_LOCK_MAIN);
@@ -719,22 +691,7 @@ Eterm trace_3(BIF_ALIST_3)
Process* tracee_p = erts_pix2proc(i);
if (! tracee_p)
continue;
- if (tracer != NIL) {
- if (tracee_p->common.id == tracer)
- continue;
- if (already_traced(NULL, tracee_p, tracer))
- continue;
- }
- if (on) {
- ERTS_TRACE_FLAGS(tracee_p) |= mask;
- } else {
- ERTS_TRACE_FLAGS(tracee_p) &= ~mask;
- }
- if(!(ERTS_TRACE_FLAGS(tracee_p) & TRACEE_FLAGS)) {
- ERTS_TRACER_PROC(tracee_p) = NIL;
- } else if (tracer != NIL) {
- ERTS_TRACER_PROC(tracee_p) = tracer;
- }
+ start_trace(p, tracer, &tracee_p->common, on, mask);
matches++;
}
}
@@ -749,33 +706,26 @@ Eterm trace_3(BIF_ALIST_3)
state = erts_atomic32_read_nob(&tracee_port->state);
if (state & ERTS_PORT_SFLGS_DEAD)
continue;
- if (tracer != NIL) {
- if (tracee_port->common.id == tracer)
- continue;
- if (port_already_traced(NULL, tracee_port, tracer))
- continue;
- }
-
- if (on) ERTS_TRACE_FLAGS(tracee_port) |= mask;
- else ERTS_TRACE_FLAGS(tracee_port) &= ~mask;
-
- if (!(ERTS_TRACE_FLAGS(tracee_port) & TRACEE_FLAGS)) {
- ERTS_TRACER_PROC(tracee_port) = NIL;
- } else if (tracer != NIL) {
- ERTS_TRACER_PROC(tracee_port) = tracer;
- }
- /* matches are not counted for ports since it would violate compatibility */
- /* This could be a reason to modify this function or make a new one. */
+ start_trace(p, tracer, &tracee_port->common, on, mask);
+ matches++;
}
}
}
- if (pid_spec == am_all || pid_spec == am_new) {
- Uint def_flags = mask;
- Eterm def_tracer = tracer;
+ if (pid_spec == am_all || pid_spec == am_new
+ || pid_spec == am_ports || pid_spec == am_processes
+ || pid_spec == am_new_ports || pid_spec == am_new_processes
+ ) {
ok = 1;
- erts_change_default_tracing(on, &def_flags, &def_tracer);
+ if (mask & ERTS_PROC_TRACEE_FLAGS &&
+ pid_spec != am_ports && pid_spec != am_new_ports)
+ erts_change_default_proc_tracing(
+ on, mask & ERTS_PROC_TRACEE_FLAGS, tracer);
+ if (mask & ERTS_PORT_TRACEE_FLAGS &&
+ pid_spec != am_processes && pid_spec != am_new_processes)
+ erts_change_default_port_tracing(
+ on, mask & ERTS_PORT_TRACEE_FLAGS, tracer);
#ifdef HAVE_ERTS_NOW_CPU
if (cpu_ts && !on) {
@@ -801,6 +751,7 @@ Eterm trace_3(BIF_ALIST_3)
}
#endif
erts_release_code_write_permission();
+ ERTS_TRACER_CLEAR(&tracer);
BIF_RET(make_small(matches));
@@ -810,6 +761,8 @@ Eterm trace_3(BIF_ALIST_3)
error:
+ ERTS_TRACER_CLEAR(&tracer);
+
#ifdef ERTS_SMP
if (system_blocked) {
erts_smp_thr_progress_unblock();
@@ -821,88 +774,6 @@ Eterm trace_3(BIF_ALIST_3)
BIF_ERROR(p, BADARG);
}
-/* Check that the process to be traced is not already traced
- * by a valid other tracer than the tracer to be.
- */
-static int port_already_traced(Process *c_p, Port *tracee_port, Eterm tracer)
-{
- /*
- * SMP build assumes that either system is blocked or:
- * * main lock is held on c_p
- * * all locks are held on port tracee_p
- */
- if ((ERTS_TRACE_FLAGS(tracee_port) & TRACEE_FLAGS)
- && ERTS_TRACER_PROC(tracee_port) != tracer) {
- /* This tracee is already being traced, and not by the
- * tracer to be */
- if (is_internal_port(ERTS_TRACER_PROC(tracee_port))) {
- if (!erts_is_valid_tracer_port(ERTS_TRACER_PROC(tracee_port))) {
- /* Current trace port now invalid
- * - discard it and approve the new. */
- goto remove_tracer;
- } else
- return 1;
- }
- else if(is_internal_pid(ERTS_TRACER_PROC(tracee_port))) {
- Process *tracer_p = erts_proc_lookup(ERTS_TRACER_PROC(tracee_port));
- if (!tracer_p) {
- /* Current trace process now invalid
- * - discard it and approve the new. */
- goto remove_tracer;
- } else
- return 1;
- }
- else {
- remove_tracer:
- ERTS_TRACE_FLAGS(tracee_port) &= ~TRACEE_FLAGS;
- ERTS_TRACER_PROC(tracee_port) = NIL;
- }
- }
- return 0;
-}
-
-/* Check that the process to be traced is not already traced
- * by a valid other tracer than the tracer to be.
- */
-static int already_traced(Process *c_p, Process *tracee_p, Eterm tracer)
-{
- /*
- * SMP build assumes that either system is blocked or:
- * * main lock is held on c_p
- * * all locks multiple are held on tracee_p
- */
- if ((ERTS_TRACE_FLAGS(tracee_p) & TRACEE_FLAGS)
- && ERTS_TRACER_PROC(tracee_p) != tracer) {
- /* This tracee is already being traced, and not by the
- * tracer to be */
- if (is_internal_port(ERTS_TRACER_PROC(tracee_p))) {
- if (!erts_is_valid_tracer_port(ERTS_TRACER_PROC(tracee_p))) {
- /* Current trace port now invalid
- * - discard it and approve the new. */
- goto remove_tracer;
- } else
- return 1;
- }
- else if(is_internal_pid(ERTS_TRACER_PROC(tracee_p))) {
- Process *tracer_p;
-
- tracer_p = erts_proc_lookup(ERTS_TRACER_PROC(tracee_p));
- if (!tracer_p) {
- /* Current trace process now invalid
- * - discard it and approve the new. */
- goto remove_tracer;
- } else
- return 1;
- }
- else {
- remove_tracer:
- ERTS_TRACE_FLAGS(tracee_p) &= ~TRACEE_FLAGS;
- ERTS_TRACER_PROC(tracee_p) = NIL;
- }
- }
- return 0;
-}
-
/*
* Return information about a process or an external function being traced.
*/
@@ -920,7 +791,7 @@ Eterm trace_info_2(BIF_ALIST_2)
if (What == am_on_load) {
res = trace_info_on_load(p, Key);
- } else if (is_atom(What) || is_pid(What)) {
+ } else if (is_atom(What) || is_pid(What) || is_port(What)) {
res = trace_info_pid(p, What, Key);
} else if (is_tuple(What)) {
res = trace_info_func(p, What, Key);
@@ -936,41 +807,52 @@ static Eterm
trace_info_pid(Process* p, Eterm pid_spec, Eterm key)
{
Eterm tracer;
- Uint trace_flags;
+ Uint trace_flags = am_false;
Eterm* hp;
- if (pid_spec == am_new) {
- erts_get_default_tracing(&trace_flags, &tracer);
+ if (pid_spec == am_new || pid_spec == am_new_processes) {
+ ErtsTracer def_tracer;
+ erts_get_default_proc_tracing(&trace_flags, &def_tracer);
+ tracer = erts_tracer_to_term(p, def_tracer);
+ ERTS_TRACER_CLEAR(&def_tracer);
+ } else if (pid_spec == am_new_ports) {
+ ErtsTracer def_tracer;
+ erts_get_default_port_tracing(&trace_flags, &def_tracer);
+ tracer = erts_tracer_to_term(p, def_tracer);
+ ERTS_TRACER_CLEAR(&def_tracer);
+ } else if (is_internal_port(pid_spec)) {
+ Port *tracee;
+ tracee = erts_id2port_sflgs(pid_spec, p, ERTS_PROC_LOCK_MAIN,
+ ERTS_PORT_SFLGS_INVALID_LOOKUP);
+
+ if (!tracee)
+ return am_undefined;
+
+ if (!ERTS_TRACER_IS_NIL(ERTS_TRACER(tracee)))
+ erts_is_tracer_proc_enabled(NULL, 0, &tracee->common, am_trace_status);
+
+ tracer = erts_tracer_to_term(p, ERTS_TRACER(tracee));
+ trace_flags = ERTS_TRACE_FLAGS(tracee);
+
+ erts_port_release(tracee);
+
} else if (is_internal_pid(pid_spec)) {
Process *tracee;
tracee = erts_pid2proc(p, ERTS_PROC_LOCK_MAIN,
- pid_spec, ERTS_PROC_LOCKS_ALL);
+ pid_spec, ERTS_PROC_LOCK_MAIN);
- if (!tracee) {
+ if (!tracee)
return am_undefined;
- } else {
- tracer = ERTS_TRACER_PROC(tracee);
- trace_flags = ERTS_TRACE_FLAGS(tracee);
- }
- if (is_internal_pid(tracer)) {
- if (!erts_proc_lookup(tracer)) {
- reset_tracer:
- ERTS_TRACE_FLAGS(tracee) &= ~TRACEE_FLAGS;
- trace_flags = ERTS_TRACE_FLAGS(tracee);
- tracer = ERTS_TRACER_PROC(tracee) = NIL;
- }
- }
- else if (is_internal_port(tracer)) {
- if (!erts_is_valid_tracer_port(tracer))
- goto reset_tracer;
- }
-#ifdef ERTS_SMP
- erts_smp_proc_unlock(tracee,
- (tracee == p
- ? ERTS_PROC_LOCKS_ALL_MINOR
- : ERTS_PROC_LOCKS_ALL));
-#endif
+ if (!ERTS_TRACER_IS_NIL(ERTS_TRACER(tracee)))
+ erts_is_tracer_proc_enabled(tracee, ERTS_PROC_LOCK_MAIN,
+ &tracee->common, am_trace_status);
+
+ tracer = erts_tracer_to_term(p, ERTS_TRACER(tracee));
+ trace_flags = ERTS_TRACE_FLAGS(tracee);
+
+ if (tracee != p)
+ erts_smp_proc_unlock(tracee, ERTS_PROC_LOCK_MAIN);
} else if (is_external_pid(pid_spec)
&& external_pid_dist_entry(pid_spec) == erts_this_dist_entry) {
return am_undefined;
@@ -1024,8 +906,10 @@ trace_info_pid(Process* p, Eterm pid_spec, Eterm key)
HRelease(p,limit,hp+3);
return TUPLE2(hp, key, flag_list);
} else if (key == am_tracer) {
- hp = HAlloc(p, 3);
- return TUPLE2(hp, key, tracer); /* Local pid or port */
+ if (tracer == am_false)
+ tracer = NIL;
+ hp = HAlloc(p, 3);
+ return TUPLE2(hp, key, tracer);
} else {
goto error;
}
@@ -1054,11 +938,11 @@ trace_info_pid(Process* p, Eterm pid_spec, Eterm key)
*/
static int function_is_traced(Process *p,
Eterm mfa[3],
- Binary **ms, /* out */
- Binary **ms_meta, /* out */
- Eterm *tracer_pid_meta, /* out */
- Uint *count, /* out */
- Eterm *call_time) /* out */
+ Binary **ms, /* out */
+ Binary **ms_meta, /* out */
+ ErtsTracer *tracer_pid_meta, /* out */
+ Uint *count, /* out */
+ Eterm *call_time) /* out */
{
Export e;
Export* ep;
@@ -1123,7 +1007,7 @@ trace_info_func(Process* p, Eterm func_spec, Eterm key)
Eterm traced = am_false;
Eterm match_spec = am_false;
Eterm retval = am_false;
- Eterm meta = am_false;
+ ErtsTracer meta = erts_tracer_nil;
Eterm call_time = NIL;
int r;
@@ -1193,7 +1077,10 @@ trace_info_func(Process* p, Eterm func_spec, Eterm key)
retval = match_spec;
break;
case am_meta:
- retval = meta;
+ retval = erts_tracer_to_term(p, meta);
+ if (retval == am_false)
+ /* backwards compatibility */
+ retval = NIL;
break;
case am_meta_match_spec:
if (r & FUNC_TRACE_META_TRACE) {
@@ -1216,7 +1103,8 @@ trace_info_func(Process* p, Eterm func_spec, Eterm key)
}
break;
case am_all: {
- Eterm match_spec_meta = am_false, c = am_false, t, ct = am_false;
+ Eterm match_spec_meta = am_false, c = am_false, t, ct = am_false,
+ m = am_false;
if (ms) {
match_spec = MatchSetGetSource(ms);
@@ -1235,6 +1123,9 @@ trace_info_func(Process* p, Eterm func_spec, Eterm key)
if (r & FUNC_TRACE_TIME_TRACE) {
ct = call_time;
}
+
+ m = erts_tracer_to_term(p, meta);
+
hp = HAlloc(p, (3+2)*6);
retval = NIL;
t = TUPLE2(hp, am_call_count, c); hp += 3;
@@ -1243,7 +1134,7 @@ trace_info_func(Process* p, Eterm func_spec, Eterm key)
retval = CONS(hp, t, retval); hp += 2;
t = TUPLE2(hp, am_meta_match_spec, match_spec_meta); hp += 3;
retval = CONS(hp, t, retval); hp += 2;
- t = TUPLE2(hp, am_meta, meta); hp += 3;
+ t = TUPLE2(hp, am_meta, m); hp += 3;
retval = CONS(hp, t, retval); hp += 2;
t = TUPLE2(hp, am_match_spec, match_spec); hp += 3;
retval = CONS(hp, t, retval); hp += 2;
@@ -1306,7 +1197,8 @@ trace_info_on_load(Process* p, Eterm key)
case am_meta:
hp = HAlloc(p, 3);
if (erts_default_trace_pattern_flags.meta) {
- return TUPLE2(hp, key, erts_default_meta_tracer_pid);
+ ASSERT(!ERTS_TRACER_IS_NIL(erts_default_meta_tracer));
+ return TUPLE2(hp, key, erts_tracer_to_term(p, erts_default_meta_tracer));
} else {
return TUPLE2(hp, key, am_false);
}
@@ -1345,7 +1237,7 @@ trace_info_on_load(Process* p, Eterm key)
}
case am_all:
{
- Eterm match_spec = am_false, meta_match_spec = am_false, r = NIL, t;
+ Eterm match_spec = am_false, meta_match_spec = am_false, r = NIL, t, m;
if (erts_default_trace_pattern_flags.local ||
(! erts_default_trace_pattern_flags.breakpoint)) {
@@ -1363,6 +1255,8 @@ trace_info_on_load(Process* p, Eterm key)
MatchSetGetSource(erts_default_meta_match_spec);
meta_match_spec = copy_object(meta_match_spec, p);
}
+ m = (erts_default_trace_pattern_flags.meta
+ ? erts_tracer_to_term(p, erts_default_meta_tracer) : am_false);
hp = HAlloc(p, (3+2)*5 + 3);
t = TUPLE2(hp, am_call_count,
(erts_default_trace_pattern_flags.call_count
@@ -1370,9 +1264,7 @@ trace_info_on_load(Process* p, Eterm key)
r = CONS(hp, t, r); hp += 2;
t = TUPLE2(hp, am_meta_match_spec, meta_match_spec); hp += 3;
r = CONS(hp, t, r); hp += 2;
- t = TUPLE2(hp, am_meta,
- (erts_default_trace_pattern_flags.meta
- ? erts_default_meta_tracer_pid : am_false)); hp += 3;
+ t = TUPLE2(hp, am_meta, m); hp += 3;
r = CONS(hp, t, r); hp += 2;
t = TUPLE2(hp, am_match_spec, match_spec); hp += 3;
r = CONS(hp, t, r); hp += 2;
@@ -1397,7 +1289,7 @@ int
erts_set_trace_pattern(Process*p, Eterm* mfa, int specified,
Binary* match_prog_set, Binary *meta_match_prog_set,
int on, struct trace_pattern_flags flags,
- Eterm meta_tracer_pid, int is_blocking)
+ ErtsTracer meta_tracer, int is_blocking)
{
const ErtsCodeIndex code_ix = erts_active_code_ix();
int matches = 0;
@@ -1487,7 +1379,7 @@ erts_set_trace_pattern(Process*p, Eterm* mfa, int specified,
}
if (flags.meta) {
erts_set_mtrace_bif(pc, meta_match_prog_set,
- meta_tracer_pid);
+ meta_tracer);
m = 1;
}
if (flags.call_time) {
@@ -1527,7 +1419,7 @@ erts_set_trace_pattern(Process*p, Eterm* mfa, int specified,
}
if (flags.meta) {
erts_set_mtrace_break(&finish_bp.f, meta_match_prog_set,
- meta_tracer_pid);
+ meta_tracer);
}
if (flags.call_count) {
erts_set_count_break(&finish_bp.f, on);
@@ -2336,50 +2228,86 @@ BIF_RETTYPE system_profile_2(BIF_ALIST_2)
}
/* End: Trace for System Profiling */
-BIF_RETTYPE
-trace_delivered_1(BIF_ALIST_1)
+/* Trace delivered send an aux work message to all schedulers
+ and when all schedulers have acknowledged that they have seen
+ the message the message is sent to the requesting process.
+
+ IMPORTANT: We have to make sure that the all messages sent
+ using enif_send have been delivered before we send the message
+ to the caller.
+
+ There used to be a separate implementation for when only a pid
+ is passed in, but since this is not performance critical code
+ we now use the same approach for both.
+*/
+
+typedef struct {
+ Process *proc;
+ Eterm ref;
+ Eterm ref_heap[REF_THING_SIZE];
+ Eterm target;
+ erts_smp_atomic32_t refc;
+} ErtsTraceDeliveredAll;
+
+static void
+reply_trace_delivered_all(void *vtdarp)
{
- DECL_AM(trace_delivered);
-#ifdef ERTS_SMP
- ErlHeapFragment *bp;
-#else
- ErtsProcLocks locks = 0;
-#endif
- Eterm *hp;
- Eterm msg, ref, msg_ref;
- Process *p;
- if (BIF_ARG_1 == am_all) {
- p = NULL;
- } else if (! (p = erts_pid2proc(BIF_P, ERTS_PROC_LOCK_MAIN,
- BIF_ARG_1, ERTS_PROC_LOCKS_ALL))) {
- if (is_not_internal_pid(BIF_ARG_1)) {
- BIF_ERROR(BIF_P, BADARG);
- }
- }
-
- ref = erts_make_ref(BIF_P);
+ ErtsTraceDeliveredAll *tdarp = (ErtsTraceDeliveredAll *) vtdarp;
+ if (erts_smp_atomic32_dec_read_nob(&tdarp->refc) == 0) {
+ Eterm ref_copy, msg;
+ Process *rp = tdarp->proc;
+ Eterm *hp = NULL;
+ ErlOffHeap *ohp;
#ifdef ERTS_SMP
- bp = new_message_buffer(REF_THING_SIZE + 4);
- hp = &bp->mem[0];
- msg_ref = STORE_NC(&hp, &bp->off_heap, ref);
+ ErlHeapFragment *bp;
+ bp = new_message_buffer(4 + NC_HEAP_SIZE(tdarp->ref));
+ hp = &bp->mem[0];
+ ohp = &bp->off_heap;
#else
- hp = HAlloc(BIF_P, 4);
- msg_ref = ref;
+ ErtsProcLocks rp_locks = 0;
+ ErtsMessage *mp;
+ mp = erts_alloc_message_heap(
+ rp, &rp_locks, 4 + NC_HEAP_SIZE(tdarp->ref), &hp, &ohp);
#endif
- msg = TUPLE3(hp, AM_trace_delivered, BIF_ARG_1, msg_ref);
+ ref_copy = STORE_NC(&hp, ohp, tdarp->ref);
+ msg = TUPLE3(hp, am_trace_delivered, tdarp->target, ref_copy);
#ifdef ERTS_SMP
- erts_send_sys_msg_proc(BIF_P->common.id, BIF_P->common.id, msg, bp);
- if (p)
- erts_smp_proc_unlock(p,
- (BIF_P == p
- ? ERTS_PROC_LOCKS_ALL_MINOR
- : ERTS_PROC_LOCKS_ALL));
+ erts_send_sys_msg_proc(rp->common.id, rp->common.id, msg, bp);
#else
- erts_send_message(BIF_P, BIF_P, &locks, msg, ERTS_SND_FLG_NO_SEQ_TRACE);
+ erts_queue_message(rp, &rp_locks, mp, msg);
#endif
- BIF_RET(ref);
+ erts_free(ERTS_ALC_T_MISC_AUX_WORK, vtdarp);
+ erts_proc_dec_refc(rp);
+ }
+}
+
+BIF_RETTYPE
+trace_delivered_1(BIF_ALIST_1)
+{
+
+ if (BIF_ARG_1 == am_all || is_internal_pid(BIF_ARG_1)) {
+ Eterm *hp, ref;
+ ErtsTraceDeliveredAll *tdarp =
+ erts_alloc(ERTS_ALC_T_MISC_AUX_WORK, sizeof(ErtsTraceDeliveredAll));
+
+ tdarp->proc = BIF_P;
+ ref = erts_make_ref(BIF_P);
+ hp = &tdarp->ref_heap[0];
+ tdarp->ref = STORE_NC(&hp, NULL, ref);
+ tdarp->target = BIF_ARG_1;
+ erts_smp_atomic32_init_nob(&tdarp->refc,
+ (erts_aint32_t) erts_no_schedulers);
+ erts_proc_add_refc(BIF_P, 1);
+ erts_schedule_multi_misc_aux_work(0,
+ erts_no_schedulers,
+ reply_trace_delivered_all,
+ (void *) tdarp);
+ BIF_RET(ref);
+ } else {
+ BIF_ERROR(BIF_P, BADARG);
+ }
}
diff --git a/erts/emulator/beam/erl_bif_unique.c b/erts/emulator/beam/erl_bif_unique.c
index c4a39b8897..1e57e9fa53 100644
--- a/erts/emulator/beam/erl_bif_unique.c
+++ b/erts/emulator/beam/erl_bif_unique.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2014. All Rights Reserved.
+ * Copyright Ericsson AB 2014-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -266,17 +266,19 @@ static ERTS_INLINE Eterm unique_integer_bif(Process *c_p, int positive)
}
Uint
-erts_raw_unique_integer_heap_size(Uint64 val[ERTS_UNIQUE_INT_RAW_VALUES])
+erts_raw_unique_integer_heap_size(Uint64 val[ERTS_UNIQUE_INT_RAW_VALUES],
+ int positive)
{
Uint sz;
- bld_unique_integer_term(NULL, &sz, val[0], val[1], 0);
+ bld_unique_integer_term(NULL, &sz, val[0], val[1], positive);
return sz;
}
Eterm
-erts_raw_make_unique_integer(Eterm **hpp, Uint64 val[ERTS_UNIQUE_INT_RAW_VALUES])
+erts_raw_make_unique_integer(Eterm **hpp, Uint64 val[ERTS_UNIQUE_INT_RAW_VALUES],
+ int positive)
{
- return bld_unique_integer_term(hpp, NULL, val[0], val[1], 0);
+ return bld_unique_integer_term(hpp, NULL, val[0], val[1], positive);
}
void
@@ -426,16 +428,16 @@ erts_raw_get_unique_monotonic_integer(void)
}
Uint
-erts_raw_unique_monotonic_integer_heap_size(Sint64 raw)
+erts_raw_unique_monotonic_integer_heap_size(Sint64 raw, int positive)
{
- return get_unique_monotonic_integer_heap_size(raw, 0);
+ return get_unique_monotonic_integer_heap_size(raw, positive);
}
Eterm
-erts_raw_make_unique_monotonic_integer_value(Eterm **hpp, Sint64 raw)
+erts_raw_make_unique_monotonic_integer_value(Eterm **hpp, Sint64 raw, int positive)
{
- Uint hsz = get_unique_monotonic_integer_heap_size(raw, 0);
- Eterm res = make_unique_monotonic_integer_value(*hpp, hsz, raw, 0);
+ Uint hsz = get_unique_monotonic_integer_heap_size(raw, positive);
+ Eterm res = make_unique_monotonic_integer_value(*hpp, hsz, raw, positive);
*hpp += hsz;
return res;
}
diff --git a/erts/emulator/beam/erl_bif_unique.h b/erts/emulator/beam/erl_bif_unique.h
index 37d5d91c39..c6481864d0 100644
--- a/erts/emulator/beam/erl_bif_unique.h
+++ b/erts/emulator/beam/erl_bif_unique.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2014. All Rights Reserved.
+ * Copyright Ericsson AB 2014-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,8 +41,9 @@ void erts_make_ref_in_array(Uint32 ref[ERTS_MAX_REF_NUMBERS]);
* not necessarily correspond to the end result.
*/
Sint64 erts_raw_get_unique_monotonic_integer(void);
-Uint erts_raw_unique_monotonic_integer_heap_size(Sint64 raw);
-Eterm erts_raw_make_unique_monotonic_integer_value(Eterm **hpp, Sint64 raw);
+Uint erts_raw_unique_monotonic_integer_heap_size(Sint64 raw, int positive);
+Eterm erts_raw_make_unique_monotonic_integer_value(Eterm **hpp, Sint64 raw,
+ int positive);
Sint64 erts_get_min_unique_monotonic_integer(void);
@@ -53,8 +54,11 @@ Eterm erts_debug_get_unique_monotonic_integer_state(Process *c_p);
#define ERTS_UNIQUE_INT_RAW_VALUES 2
#define ERTS_MAX_UNIQUE_INT_HEAP_SIZE ERTS_UINT64_ARRAY_TO_BIG_MAX_HEAP_SZ(2)
-Uint erts_raw_unique_integer_heap_size(Uint64 val[ERTS_UNIQUE_INT_RAW_VALUES]);
-Eterm erts_raw_make_unique_integer(Eterm **hpp, Uint64 val[ERTS_UNIQUE_INT_RAW_VALUES]);
+Uint erts_raw_unique_integer_heap_size(Uint64 val[ERTS_UNIQUE_INT_RAW_VALUES],
+ int positive);
+Eterm erts_raw_make_unique_integer(Eterm **hpp,
+ Uint64 val[ERTS_UNIQUE_INT_RAW_VALUES],
+ int postive);
void erts_raw_get_unique_integer(Uint64 val[ERTS_UNIQUE_INT_RAW_VALUES]);
Sint64 erts_get_min_unique_integer(void);
diff --git a/erts/emulator/beam/erl_binary.h b/erts/emulator/beam/erl_binary.h
index e181b5555d..fdc5efea98 100644
--- a/erts/emulator/beam/erl_binary.h
+++ b/erts/emulator/beam/erl_binary.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_bits.c b/erts/emulator/beam/erl_bits.c
index 11d83686a3..6bf52fb303 100644
--- a/erts/emulator/beam/erl_bits.c
+++ b/erts/emulator/beam/erl_bits.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_bits.h b/erts/emulator/beam/erl_bits.h
index 8b7807fbd9..1c2a090f07 100644
--- a/erts/emulator/beam/erl_bits.h
+++ b/erts/emulator/beam/erl_bits.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_cpu_topology.c b/erts/emulator/beam/erl_cpu_topology.c
index c263eebfcc..28aaeeb479 100644
--- a/erts/emulator/beam/erl_cpu_topology.c
+++ b/erts/emulator/beam/erl_cpu_topology.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_cpu_topology.h b/erts/emulator/beam/erl_cpu_topology.h
index f3fbfc6da0..45324ac4a0 100644
--- a/erts/emulator/beam/erl_cpu_topology.h
+++ b/erts/emulator/beam/erl_cpu_topology.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_db.c b/erts/emulator/beam/erl_db.c
index 441dbdde4f..615d23402b 100644
--- a/erts/emulator/beam/erl_db.c
+++ b/erts/emulator/beam/erl_db.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_db.h b/erts/emulator/beam/erl_db.h
index a589af784c..1d26c49652 100644
--- a/erts/emulator/beam/erl_db.h
+++ b/erts/emulator/beam/erl_db.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_db_hash.c b/erts/emulator/beam/erl_db_hash.c
index 240b79fc60..74979f984a 100644
--- a/erts/emulator/beam/erl_db_hash.c
+++ b/erts/emulator/beam/erl_db_hash.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2012. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_db_hash.h b/erts/emulator/beam/erl_db_hash.h
index 66d8ec71d9..e654363cd5 100644
--- a/erts/emulator/beam/erl_db_hash.h
+++ b/erts/emulator/beam/erl_db_hash.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_db_tree.c b/erts/emulator/beam/erl_db_tree.c
index 0f642f0867..02d211a4bb 100644
--- a/erts/emulator/beam/erl_db_tree.c
+++ b/erts/emulator/beam/erl_db_tree.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_db_tree.h b/erts/emulator/beam/erl_db_tree.h
index 6098387f5d..72749ead1e 100644
--- a/erts/emulator/beam/erl_db_tree.h
+++ b/erts/emulator/beam/erl_db_tree.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c
index 973be58420..76b96637ae 100644
--- a/erts/emulator/beam/erl_db_util.c
+++ b/erts/emulator/beam/erl_db_util.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -135,21 +135,22 @@ get_proc(Process *cp, Uint32 cp_locks, Eterm id, Uint32 id_locks)
static Eterm
-set_tracee_flags(Process *tracee_p, Eterm tracer, Uint d_flags, Uint e_flags) {
+set_tracee_flags(Process *tracee_p, ErtsTracer tracer,
+ Uint d_flags, Uint e_flags) {
Eterm ret;
Uint flags;
- if (tracer == NIL) {
+ if (ERTS_TRACER_IS_NIL(tracer)) {
flags = ERTS_TRACE_FLAGS(tracee_p) & ~TRACEE_FLAGS;
} else {
flags = ((ERTS_TRACE_FLAGS(tracee_p) & ~d_flags) | e_flags);
- if (! flags) tracer = NIL;
+ if (! flags) tracer = erts_tracer_nil;
}
- ret = ((ERTS_TRACER_PROC(tracee_p) != tracer
+ ret = ((!ERTS_TRACER_COMPARE(ERTS_TRACER(tracee_p),tracer)
|| ERTS_TRACE_FLAGS(tracee_p) != flags)
? am_true
: am_false);
- ERTS_TRACER_PROC(tracee_p) = tracer;
+ erts_tracer_replace(&tracee_p->common, tracer);
ERTS_TRACE_FLAGS(tracee_p) = flags;
return ret;
}
@@ -163,40 +164,16 @@ set_tracee_flags(Process *tracee_p, Eterm tracer, Uint d_flags, Uint e_flags) {
** returns fail_term on failure. Fails if tracer pid or port is invalid.
*/
static Eterm
-set_match_trace(Process *tracee_p, Eterm fail_term, Eterm tracer,
+set_match_trace(Process *tracee_p, Eterm fail_term, ErtsTracer tracer,
Uint d_flags, Uint e_flags) {
- Eterm ret = fail_term;
- Process *tracer_p;
-
- ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCKS_ALL ==
- erts_proc_lc_my_proc_locks(tracee_p));
-
- if (is_internal_pid(tracer)
- && (tracer_p =
- erts_pid2proc(tracee_p, ERTS_PROC_LOCKS_ALL,
- tracer, ERTS_PROC_LOCKS_ALL))) {
- if (tracee_p != tracer_p) {
- ret = set_tracee_flags(tracee_p, tracer, d_flags, e_flags);
- ERTS_TRACE_FLAGS(tracer_p) |= (ERTS_TRACE_FLAGS(tracee_p)
- ? F_TRACER
- : 0);
- erts_smp_proc_unlock(tracer_p, ERTS_PROC_LOCKS_ALL);
- }
- } else if (is_internal_port(tracer)) {
- Port *tracer_port =
- erts_id2port_sflgs(tracer,
- tracee_p,
- ERTS_PROC_LOCKS_ALL,
- ERTS_PORT_SFLGS_INVALID_TRACER_LOOKUP);
- if (tracer_port) {
- ret = set_tracee_flags(tracee_p, tracer, d_flags, e_flags);
- erts_port_release(tracer_port);
- }
- } else {
- ASSERT(is_nil(tracer));
- ret = set_tracee_flags(tracee_p, tracer, d_flags, e_flags);
- }
- return ret;
+
+ ERTS_SMP_LC_ASSERT(
+ ERTS_PROC_LOCKS_ALL == erts_proc_lc_my_proc_locks(tracee_p)
+ || erts_thr_progress_is_blocking());
+
+ if (ERTS_TRACER_IS_NIL(tracer) || erts_is_tracer_enabled(tracee_p, tracer))
+ return set_tracee_flags(tracee_p, tracer, d_flags, e_flags);
+ return fail_term;
}
/*
@@ -2358,7 +2335,7 @@ restart:
case matchEnableTrace:
if ( (n = erts_trace_flag2bit(esp[-1]))) {
BEGIN_ATOMIC_TRACE(c_p);
- set_tracee_flags(c_p, ERTS_TRACER_PROC(c_p), 0, n);
+ set_tracee_flags(c_p, ERTS_TRACER(c_p), 0, n);
esp[-1] = am_true;
} else {
esp[-1] = FAIL_TERM;
@@ -2371,7 +2348,7 @@ restart:
BEGIN_ATOMIC_TRACE(c_p);
if ( (tmpp = get_proc(c_p, 0, esp[0], 0))) {
/* Always take over the tracer of the current process */
- set_tracee_flags(tmpp, ERTS_TRACER_PROC(c_p), 0, n);
+ set_tracee_flags(tmpp, ERTS_TRACER(c_p), 0, n);
esp[-1] = am_true;
}
}
@@ -2379,7 +2356,7 @@ restart:
case matchDisableTrace:
if ( (n = erts_trace_flag2bit(esp[-1]))) {
BEGIN_ATOMIC_TRACE(c_p);
- set_tracee_flags(c_p, ERTS_TRACER_PROC(c_p), n, 0);
+ set_tracee_flags(c_p, ERTS_TRACER(c_p), n, 0);
esp[-1] = am_true;
} else {
esp[-1] = FAIL_TERM;
@@ -2392,7 +2369,7 @@ restart:
BEGIN_ATOMIC_TRACE(c_p);
if ( (tmpp = get_proc(c_p, 0, esp[0], 0))) {
/* Always take over the tracer of the current process */
- set_tracee_flags(tmpp, ERTS_TRACER_PROC(c_p), n, 0);
+ set_tracee_flags(tmpp, ERTS_TRACER(c_p), n, 0);
esp[-1] = am_true;
}
}
@@ -2428,7 +2405,7 @@ restart:
{
/* disable enable */
Uint d_flags = 0, e_flags = 0; /* process trace flags */
- Eterm tracer = ERTS_TRACER_PROC(c_p);
+ ErtsTracer tracer = erts_tracer_nil;
/* XXX Atomicity note: Not fully atomic. Default tracer
* is sampled from current process but applied to
* tracee and tracer later after releasing main
@@ -2440,29 +2417,34 @@ restart:
* {trace,[],[{{tracer,Tracer}}]} is much, much older.
*/
int cputs = 0;
+ erts_tracer_update(&tracer, ERTS_TRACER(c_p));
if (! erts_trace_flags(esp[-1], &d_flags, &tracer, &cputs) ||
! erts_trace_flags(esp[-2], &e_flags, &tracer, &cputs) ||
cputs ) {
(--esp)[-1] = FAIL_TERM;
+ ERTS_TRACER_CLEAR(&tracer);
break;
}
erts_smp_proc_lock(c_p, ERTS_PROC_LOCKS_ALL_MINOR);
(--esp)[-1] = set_match_trace(c_p, FAIL_TERM, tracer,
d_flags, e_flags);
erts_smp_proc_unlock(c_p, ERTS_PROC_LOCKS_ALL_MINOR);
+ ERTS_TRACER_CLEAR(&tracer);
}
break;
case matchTrace3:
{
/* disable enable */
Uint d_flags = 0, e_flags = 0; /* process trace flags */
- Eterm tracer = ERTS_TRACER_PROC(c_p);
+ ErtsTracer tracer = erts_tracer_nil;
/* XXX Atomicity note. Not fully atomic. See above.
* Above it could possibly be solved, but not here.
*/
int cputs = 0;
Eterm tracee = (--esp)[0];
+
+ erts_tracer_update(&tracer, ERTS_TRACER(c_p));
if (! erts_trace_flags(esp[-1], &d_flags, &tracer, &cputs) ||
! erts_trace_flags(esp[-2], &e_flags, &tracer, &cputs) ||
@@ -2470,6 +2452,7 @@ restart:
! (tmpp = get_proc(c_p, ERTS_PROC_LOCK_MAIN,
tracee, ERTS_PROC_LOCKS_ALL))) {
(--esp)[-1] = FAIL_TERM;
+ ERTS_TRACER_CLEAR(&tracer);
break;
}
if (tmpp == c_p) {
@@ -2483,6 +2466,7 @@ restart:
erts_smp_proc_unlock(tmpp, ERTS_PROC_LOCKS_ALL);
erts_smp_proc_lock(c_p, ERTS_PROC_LOCK_MAIN);
}
+ ERTS_TRACER_CLEAR(&tracer);
}
break;
case matchCatch: /* Match success, now build result */
@@ -5084,7 +5068,7 @@ static Eterm match_spec_test(Process *p, Eterm against, Eterm spec, int trace)
lint_res = db_match_set_lint(p, spec, DCOMP_TABLE | DCOMP_FAKE_DESTRUCTIVE);
mps = db_match_set_compile(p, spec, DCOMP_TABLE | DCOMP_FAKE_DESTRUCTIVE);
}
-
+
if (mps == NULL) {
hp = HAlloc(p,3);
ret = TUPLE2(hp, am_error, lint_res);
diff --git a/erts/emulator/beam/erl_db_util.h b/erts/emulator/beam/erl_db_util.h
index 911ed37aef..5d7946a525 100644
--- a/erts/emulator/beam/erl_db_util.h
+++ b/erts/emulator/beam/erl_db_util.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_debug.c b/erts/emulator/beam/erl_debug.c
index 2902c98864..3e3bfa03a2 100644
--- a/erts/emulator/beam/erl_debug.c
+++ b/erts/emulator/beam/erl_debug.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_driver.h b/erts/emulator/beam/erl_driver.h
index 0234b9b0e4..97a69140c3 100644
--- a/erts/emulator/beam/erl_driver.h
+++ b/erts/emulator/beam/erl_driver.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_drv_nif.h b/erts/emulator/beam/erl_drv_nif.h
index f6b946ae82..2700b62854 100644
--- a/erts/emulator/beam/erl_drv_nif.h
+++ b/erts/emulator/beam/erl_drv_nif.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_drv_thread.c b/erts/emulator/beam/erl_drv_thread.c
index 184f8e8931..92edce5176 100644
--- a/erts/emulator/beam/erl_drv_thread.c
+++ b/erts/emulator/beam/erl_drv_thread.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2007-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_fun.c b/erts/emulator/beam/erl_fun.c
index ed555aa92f..6ce1376c81 100644
--- a/erts/emulator/beam/erl_fun.c
+++ b/erts/emulator/beam/erl_fun.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_fun.h b/erts/emulator/beam/erl_fun.h
index 0024b1ff71..8c4deea7a0 100644
--- a/erts/emulator/beam/erl_fun.h
+++ b/erts/emulator/beam/erl_fun.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c
index 0d125c5598..e21fba6bf1 100644
--- a/erts/emulator/beam/erl_gc.c
+++ b/erts/emulator/beam/erl_gc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -116,7 +116,7 @@ static Eterm *full_sweep_heaps(Process *p,
char *oh, Uint oh_size,
Eterm *objv, int nobj);
static int garbage_collect(Process* p, ErlHeapFragment *live_hf_end,
- int need, Eterm* objv, int nobj);
+ int need, Eterm* objv, int nobj, int fcalls);
static int major_collection(Process* p, ErlHeapFragment *live_hf_end,
int need, Eterm* objv, int nobj, Uint *recl);
static int minor_collection(Process* p, ErlHeapFragment *live_hf_end,
@@ -392,15 +392,15 @@ erts_gc_after_bif_call_lhf(Process* p, ErlHeapFragment *live_hf_end,
regs = ERTS_PROC_GET_SCHDATA(p)->x_reg_array;
}
#endif
- cost = garbage_collect(p, live_hf_end, 0, regs, p->arity);
+ cost = garbage_collect(p, live_hf_end, 0, regs, p->arity, p->fcalls);
} else {
- cost = garbage_collect(p, live_hf_end, 0, regs, arity);
+ cost = garbage_collect(p, live_hf_end, 0, regs, arity, p->fcalls);
}
} else {
Eterm val[1];
val[0] = result;
- cost = garbage_collect(p, live_hf_end, 0, val, 1);
+ cost = garbage_collect(p, live_hf_end, 0, val, 1, p->fcalls);
result = val[0];
}
BUMP_REDS(p, cost);
@@ -431,7 +431,7 @@ static ERTS_INLINE void reset_active_writer(Process *p)
#define ERTS_ABANDON_HEAP_COST 10
static int
-delay_garbage_collection(Process *p, ErlHeapFragment *live_hf_end, int need)
+delay_garbage_collection(Process *p, ErlHeapFragment *live_hf_end, int need, int fcalls)
{
ErlHeapFragment *hfrag;
Eterm *orig_heap, *orig_hend, *orig_htop, *orig_stop;
@@ -506,12 +506,16 @@ delay_garbage_collection(Process *p, ErlHeapFragment *live_hf_end, int need)
/* Make sure that we do a proper GC as soon as possible... */
p->flags |= F_FORCE_GC;
- reds_left = ERTS_BIF_REDS_LEFT(p);
+ reds_left = ERTS_REDS_LEFT(p, fcalls);
+ ASSERT(CONTEXT_REDS - reds_left >= ERTS_PROC_GET_SCHDATA(p)->virtual_reds);
+
if (reds_left > ERTS_ABANDON_HEAP_COST) {
int vreds = reds_left - ERTS_ABANDON_HEAP_COST;
- ERTS_VBUMP_REDS(p, vreds);
+ ERTS_PROC_GET_SCHDATA((p))->virtual_reds += vreds;
}
- return ERTS_ABANDON_HEAP_COST;
+
+ ASSERT(CONTEXT_REDS >= ERTS_PROC_GET_SCHDATA(p)->virtual_reds);
+ return reds_left;
}
static ERTS_FORCE_INLINE Uint
@@ -570,7 +574,7 @@ young_gen_usage(Process *p)
*/
static int
garbage_collect(Process* p, ErlHeapFragment *live_hf_end,
- int need, Eterm* objv, int nobj)
+ int need, Eterm* objv, int nobj, int fcalls)
{
Uint reclaimed_now = 0;
int reds;
@@ -581,8 +585,11 @@ garbage_collect(Process* p, ErlHeapFragment *live_hf_end,
DTRACE_CHARBUF(pidbuf, DTRACE_TERM_BUF_SIZE);
#endif
+ ASSERT(CONTEXT_REDS - ERTS_REDS_LEFT(p, fcalls)
+ >= ERTS_PROC_GET_SCHDATA(p)->virtual_reds);
+
if (p->flags & (F_DISABLE_GC|F_DELAY_GC))
- return delay_garbage_collection(p, live_hf_end, need);
+ return delay_garbage_collection(p, live_hf_end, need, fcalls);
if (p->abandoned_heap)
live_hf_end = ERTS_INVALID_HFRAG_PTR;
@@ -593,10 +600,6 @@ garbage_collect(Process* p, ErlHeapFragment *live_hf_end,
esdp = erts_get_scheduler_data();
- if (IS_TRACED_FL(p, F_TRACE_GC)) {
- trace_gc(p, am_gc_start);
- }
-
erts_smp_atomic32_read_bor_nob(&p->state, ERTS_PSFLG_GC);
if (erts_system_monitor_long_gc != 0)
start_time = erts_get_monotonic_time(esdp);
@@ -619,18 +622,29 @@ garbage_collect(Process* p, ErlHeapFragment *live_hf_end,
*/
if (GEN_GCS(p) < MAX_GEN_GCS(p) && !(FLAGS(p) & F_NEED_FULLSWEEP)) {
- DTRACE2(gc_minor_start, pidbuf, need);
- reds = minor_collection(p, live_hf_end, need, objv, nobj, &reclaimed_now);
- DTRACE2(gc_minor_end, pidbuf, reclaimed_now);
- if (reds < 0)
- goto do_major_collection;
- }
- else {
- do_major_collection:
+ if (IS_TRACED_FL(p, F_TRACE_GC)) {
+ trace_gc(p, am_gc_minor_start, need);
+ }
+ DTRACE2(gc_minor_start, pidbuf, need);
+ reds = minor_collection(p, live_hf_end, need, objv, nobj, &reclaimed_now);
+ DTRACE2(gc_minor_end, pidbuf, reclaimed_now);
+ if (IS_TRACED_FL(p, F_TRACE_GC)) {
+ trace_gc(p, am_gc_minor_end, reclaimed_now);
+ }
+ if (reds < 0)
+ goto do_major_collection;
+ } else {
+do_major_collection:
ERTS_MSACC_SET_STATE_CACHED_M_X(ERTS_MSACC_STATE_GC_FULL);
- DTRACE2(gc_major_start, pidbuf, need);
- reds = major_collection(p, live_hf_end, need, objv, nobj, &reclaimed_now);
- DTRACE2(gc_major_end, pidbuf, reclaimed_now);
+ if (IS_TRACED_FL(p, F_TRACE_GC)) {
+ trace_gc(p, am_gc_major_start, need);
+ }
+ DTRACE2(gc_major_start, pidbuf, need);
+ reds = major_collection(p, live_hf_end, need, objv, nobj, &reclaimed_now);
+ DTRACE2(gc_major_end, pidbuf, reclaimed_now);
+ if (IS_TRACED_FL(p, F_TRACE_GC)) {
+ trace_gc(p, am_gc_major_end, reclaimed_now);
+ }
ERTS_MSACC_SET_STATE_CACHED_M_X(ERTS_MSACC_STATE_GC);
}
@@ -646,10 +660,6 @@ garbage_collect(Process* p, ErlHeapFragment *live_hf_end,
erts_smp_atomic32_read_band_nob(&p->state, ~ERTS_PSFLG_GC);
- if (IS_TRACED_FL(p, F_TRACE_GC)) {
- trace_gc(p, am_gc_end);
- }
-
if (erts_system_monitor_long_gc != 0) {
ErtsMonotonicTime end_time;
Uint gc_time;
@@ -700,16 +710,23 @@ garbage_collect(Process* p, ErlHeapFragment *live_hf_end,
}
int
-erts_garbage_collect_nobump(Process* p, int need, Eterm* objv, int nobj)
+erts_garbage_collect_nobump(Process* p, int need, Eterm* objv, int nobj, int fcalls)
{
- return garbage_collect(p, ERTS_INVALID_HFRAG_PTR, need, objv, nobj);
+ int reds = garbage_collect(p, ERTS_INVALID_HFRAG_PTR, need, objv, nobj, fcalls);
+ int reds_left = ERTS_REDS_LEFT(p, fcalls);
+ if (reds > reds_left)
+ reds = reds_left;
+ ASSERT(CONTEXT_REDS - (reds_left - reds) >= ERTS_PROC_GET_SCHDATA(p)->virtual_reds);
+ return reds;
}
void
erts_garbage_collect(Process* p, int need, Eterm* objv, int nobj)
{
- int reds = garbage_collect(p, ERTS_INVALID_HFRAG_PTR, need, objv, nobj);
+ int reds = garbage_collect(p, ERTS_INVALID_HFRAG_PTR, need, objv, nobj, p->fcalls);
BUMP_REDS(p, reds);
+ ASSERT(CONTEXT_REDS - ERTS_BIF_REDS_LEFT(p)
+ >= ERTS_PROC_GET_SCHDATA(p)->virtual_reds);
}
/*
@@ -2053,8 +2070,26 @@ copy_one_frag(Eterm** hpp, ErlOffHeap* off_heap,
*hp++ = val;
break;
case TAG_PRIMARY_LIST:
+#ifdef SHCOPY_SEND
+ if (erts_is_literal(val,list_val(val))) {
+ *hp++ = val;
+ } else {
+ *hp++ = offset_ptr(val, offs);
+ }
+#else
+ *hp++ = offset_ptr(val, offs);
+#endif
+ break;
case TAG_PRIMARY_BOXED:
- *hp++ = offset_ptr(val, offs);
+#ifdef SHCOPY_SEND
+ if (erts_is_literal(val,boxed_val(val))) {
+ *hp++ = val;
+ } else {
+ *hp++ = offset_ptr(val, offs);
+ }
+#else
+ *hp++ = offset_ptr(val, offs);
+#endif
break;
case TAG_PRIMARY_HEADER:
*hp++ = val;
@@ -2233,9 +2268,7 @@ setup_rootset(Process *p, Eterm *objv, int nobj, Rootset *rootset)
n++;
}
#endif
- ASSERT(is_nil(ERTS_TRACER_PROC(p)) ||
- is_internal_pid(ERTS_TRACER_PROC(p)) ||
- is_internal_port(ERTS_TRACER_PROC(p)));
+ ASSERT(IS_TRACER_VALID(ERTS_TRACER(p)));
ASSERT(is_pid(follow_moved(p->group_leader, (Eterm) 0)));
if (is_not_immed(p->group_leader)) {
@@ -2905,7 +2938,7 @@ reply_gc_info(void *vgcirp)
hpp = &hp;
}
- erts_queue_message(rp, &rp_locks, mp, msg, NIL);
+ erts_queue_message(rp, &rp_locks, mp, msg);
if (gcirp->req_sched == esdp->no)
rp_locks &= ~ERTS_PROC_LOCK_MAIN;
@@ -2990,10 +3023,30 @@ erts_process_gc_info(Process *p, Uint *sizep, Eterm **hpp)
};
Eterm res = THE_NON_VALUE;
+ ErtsMessage *mp;
ERTS_CT_ASSERT(sizeof(values)/sizeof(*values) == sizeof(tags)/sizeof(*tags));
ERTS_CT_ASSERT(sizeof(values)/sizeof(*values) == ERTS_PROCESS_GC_INFO_MAX_TERMS);
+ if (p->abandoned_heap) {
+ Eterm *htop, *heap;
+ ERTS_GET_ORIG_HEAP(p, heap, htop);
+ values[3] = HIGH_WATER(p) - heap;
+ values[6] = htop - heap;
+ }
+
+ if (p->flags & F_ON_HEAP_MSGQ) {
+ /* If on heap messages in the internal queue are counted
+ as being part of the heap, so we have to add them to the
+ am_mbuf_size value. process_info(total_heap_size) should
+ be the same as adding old_heap_block_size + heap_block_size
+ + mbuf_size.
+ */
+ for (mp = p->msg.first; mp; mp = mp->next)
+ if (mp->data.attached)
+ values[2] += erts_msg_attached_data_size(mp);
+ }
+
res = erts_bld_atom_uword_2tup_list(hpp,
sizep,
sizeof(values)/sizeof(*values),
diff --git a/erts/emulator/beam/erl_gc.h b/erts/emulator/beam/erl_gc.h
index 2cedd9361f..8a6ff99990 100644
--- a/erts/emulator/beam/erl_gc.h
+++ b/erts/emulator/beam/erl_gc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2007-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -139,7 +139,7 @@ Eterm erts_process_gc_info(struct process*, Uint *, Eterm **);
void erts_gc_info(ErtsGCInfo *gcip);
void erts_init_gc(void);
-int erts_garbage_collect_nobump(struct process*, int, Eterm*, int);
+int erts_garbage_collect_nobump(struct process*, int, Eterm*, int, int);
void erts_garbage_collect(struct process*, int, Eterm*, int);
void erts_garbage_collect_hibernate(struct process* p);
Eterm erts_gc_after_bif_call_lhf(struct process* p, ErlHeapFragment *live_hf_end,
diff --git a/erts/emulator/beam/erl_goodfit_alloc.c b/erts/emulator/beam/erl_goodfit_alloc.c
index 9b4aad9d91..223ba193da 100644
--- a/erts/emulator/beam/erl_goodfit_alloc.c
+++ b/erts/emulator/beam/erl_goodfit_alloc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_goodfit_alloc.h b/erts/emulator/beam/erl_goodfit_alloc.h
index ababdbd0a1..76dd558234 100644
--- a/erts/emulator/beam/erl_goodfit_alloc.h
+++ b/erts/emulator/beam/erl_goodfit_alloc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_hl_timer.c b/erts/emulator/beam/erl_hl_timer.c
index 491d2f8c84..8e201d5711 100644
--- a/erts/emulator/beam/erl_hl_timer.c
+++ b/erts/emulator/beam/erl_hl_timer.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2015. All Rights Reserved.
+ * Copyright Ericsson AB 2015-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1248,7 +1248,7 @@ hlt_bif_timer_timeout(ErtsHLTimer *tmr, Uint32 roflgs)
ErtsMessage *mp = erts_alloc_message(0, NULL);
mp->data.heap_frag = tmr->btm.bp;
erts_queue_message(proc, &proc_locks, mp,
- tmr->btm.message, NIL);
+ tmr->btm.message);
erts_smp_proc_unlock(proc, ERTS_PROC_LOCKS_MSG_SEND);
queued_message = 1;
proc_locks &= ~ERTS_PROC_LOCKS_MSG_SEND;
@@ -1980,7 +1980,7 @@ access_sched_local_btm(Process *c_p, Eterm pid,
ERTS_HLT_ASSERT(hp + (async ? 4 : 3) == hp_end);
- erts_queue_message(proc, &proc_locks, mp, msg, NIL);
+ erts_queue_message(proc, &proc_locks, mp, msg);
if (c_p)
proc_locks &= ~ERTS_PROC_LOCK_MAIN;
@@ -2111,7 +2111,7 @@ try_access_sched_remote_btm(ErtsSchedulerData *esdp,
msg = TUPLE3(hp, tag, tref, res);
- erts_queue_message(c_p, &proc_locks, mp, msg, NIL);
+ erts_queue_message(c_p, &proc_locks, mp, msg);
proc_locks &= ~ERTS_PROC_LOCK_MAIN;
if (proc_locks)
diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c
index 86c4eeb484..fcd2739ac3 100644
--- a/erts/emulator/beam/erl_init.c
+++ b/erts/emulator/beam/erl_init.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -206,15 +206,15 @@ int erts_no_line_info = 0; /* -L: Don't load line information */
ErtsModifiedTimings erts_modified_timings[] = {
/* 0 */ {make_small(0), CONTEXT_REDS, INPUT_REDUCTIONS},
- /* 1 */ {make_small(0), 2*CONTEXT_REDS, 2*INPUT_REDUCTIONS},
+ /* 1 */ {make_small(0), (3*CONTEXT_REDS)/4, 2*INPUT_REDUCTIONS},
/* 2 */ {make_small(0), CONTEXT_REDS/2, INPUT_REDUCTIONS/2},
- /* 3 */ {make_small(0), 3*CONTEXT_REDS, 3*INPUT_REDUCTIONS},
+ /* 3 */ {make_small(0), (7*CONTEXT_REDS)/8, 3*INPUT_REDUCTIONS},
/* 4 */ {make_small(0), CONTEXT_REDS/3, 3*INPUT_REDUCTIONS},
- /* 5 */ {make_small(0), 4*CONTEXT_REDS, INPUT_REDUCTIONS/2},
+ /* 5 */ {make_small(0), (10*CONTEXT_REDS)/11, INPUT_REDUCTIONS/2},
/* 6 */ {make_small(1), CONTEXT_REDS/4, 2*INPUT_REDUCTIONS},
- /* 7 */ {make_small(1), 5*CONTEXT_REDS, INPUT_REDUCTIONS/3},
+ /* 7 */ {make_small(1), (5*CONTEXT_REDS)/7, INPUT_REDUCTIONS/3},
/* 8 */ {make_small(10), CONTEXT_REDS/5, 3*INPUT_REDUCTIONS},
- /* 9 */ {make_small(10), 6*CONTEXT_REDS, INPUT_REDUCTIONS/4}
+ /* 9 */ {make_small(10), (6*CONTEXT_REDS)/7, INPUT_REDUCTIONS/4}
};
#define ERTS_MODIFIED_TIMING_LEVELS \
@@ -578,6 +578,8 @@ void erts_usage(void)
VH_DEFAULT_SIZE);
erts_fprintf(stderr, "-hpds size initial process dictionary size (default %d)\n",
erts_pd_initial_size);
+ erts_fprintf(stderr, "-hmqd val set default message queue data flag for processes,\n");
+ erts_fprintf(stderr, " valid values are: off_heap | on_heap | mixed\n");
/* erts_fprintf(stderr, "-i module set the boot module (default init)\n"); */
@@ -655,8 +657,6 @@ void erts_usage(void)
erts_fprintf(stderr, "-W<i|w|e> set error logger warnings mapping,\n");
erts_fprintf(stderr, " see error_logger documentation for details\n");
- erts_fprintf(stderr, "-xmqd val set default message queue data flag for processes,\n");
- erts_fprintf(stderr, " valid values are: off_heap | on_heap | mixed\n");
erts_fprintf(stderr, "-zdbbl size set the distribution buffer busy limit in kilobytes\n");
erts_fprintf(stderr, " valid range is [1-%d]\n", INT_MAX/1024);
erts_fprintf(stderr, "-zdntgc time set delayed node table gc in seconds\n");
@@ -1487,6 +1487,7 @@ erl_start(int argc, char **argv)
* h|ms - min_heap_size
* h|mbs - min_bin_vheap_size
* h|pds - erts_pd_initial_size
+ * h|mqd - message_queue_data
*
*/
if (has_prefix("mbs", sub_param)) {
@@ -1512,6 +1513,23 @@ erl_start(int argc, char **argv)
}
VERBOSE(DEBUG_SYSTEM, ("using initial process dictionary size %d\n",
erts_pd_initial_size));
+ } else if (has_prefix("mqd", sub_param)) {
+ arg = get_arg(sub_param+3, argv[i+1], &i);
+ if (sys_strcmp(arg, "mixed") == 0)
+ erts_default_spo_flags &= ~(SPO_ON_HEAP_MSGQ|SPO_OFF_HEAP_MSGQ);
+ else if (sys_strcmp(arg, "on_heap") == 0) {
+ erts_default_spo_flags &= ~SPO_OFF_HEAP_MSGQ;
+ erts_default_spo_flags |= SPO_ON_HEAP_MSGQ;
+ }
+ else if (sys_strcmp(arg, "off_heap") == 0) {
+ erts_default_spo_flags &= ~SPO_ON_HEAP_MSGQ;
+ erts_default_spo_flags |= SPO_OFF_HEAP_MSGQ;
+ }
+ else {
+ erts_fprintf(stderr,
+ "Invalid message_queue_data flag: %s\n", arg);
+ erts_usage();
+ }
} else {
/* backward compatibility */
arg = get_arg(argv[i]+2, argv[i+1], &i);
@@ -2047,32 +2065,6 @@ erl_start(int argc, char **argv)
}
break;
- case 'x': {
- char *sub_param = argv[i]+2;
- if (has_prefix("mqd", sub_param)) {
- arg = get_arg(sub_param+3, argv[i+1], &i);
- if (sys_strcmp(arg, "mixed") == 0)
- erts_default_spo_flags &= ~(SPO_ON_HEAP_MSGQ|SPO_OFF_HEAP_MSGQ);
- else if (sys_strcmp(arg, "on_heap") == 0) {
- erts_default_spo_flags &= ~SPO_OFF_HEAP_MSGQ;
- erts_default_spo_flags |= SPO_ON_HEAP_MSGQ;
- }
- else if (sys_strcmp(arg, "off_heap") == 0) {
- erts_default_spo_flags &= ~SPO_ON_HEAP_MSGQ;
- erts_default_spo_flags |= SPO_OFF_HEAP_MSGQ;
- }
- else {
- erts_fprintf(stderr,
- "Invalid message_queue_data flag: %s\n", arg);
- erts_usage();
- }
- } else {
- erts_fprintf(stderr, "bad -x option %s\n", argv[i]);
- erts_usage();
- }
- break;
- }
-
case 'z': {
char *sub_param = argv[i]+2;
@@ -2188,6 +2180,7 @@ erl_start(int argc, char **argv)
init_break_handler();
if (replace_intr)
erts_replace_intr();
+ sys_init_suspend_handler();
#endif
boot_argc = argc - i; /* Number of arguments to init */
diff --git a/erts/emulator/beam/erl_instrument.c b/erts/emulator/beam/erl_instrument.c
index 12a72ad839..f84c63e7a4 100644
--- a/erts/emulator/beam/erl_instrument.c
+++ b/erts/emulator/beam/erl_instrument.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_instrument.h b/erts/emulator/beam/erl_instrument.h
index cb3b1920d3..1f04c91d5e 100644
--- a/erts/emulator/beam/erl_instrument.h
+++ b/erts/emulator/beam/erl_instrument.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_lock_check.c b/erts/emulator/beam/erl_lock_check.c
index 598bf84c0b..39c0617143 100644
--- a/erts/emulator/beam/erl_lock_check.c
+++ b/erts/emulator/beam/erl_lock_check.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -97,6 +97,7 @@ static erts_lc_lock_order_t erts_lock_order[] = {
{ "dist_entry_links", "address" },
{ "code_write_permission", NULL },
{ "proc_status", "pid" },
+ { "proc_trace", "pid" },
{ "ports_snapshot", NULL },
{ "meta_name_tab", "address" },
{ "meta_main_tab_slot", "address" },
@@ -148,6 +149,7 @@ static erts_lc_lock_order_t erts_lock_order[] = {
{ "dist_entry_out_queue", "address" },
{ "port_sched_lock", "port_id" },
{ "sys_msg_q", NULL },
+ { "tracer_mtx", NULL },
{ "port_table", NULL },
#endif
{ "mtrace_op", NULL },
@@ -160,9 +162,6 @@ static erts_lc_lock_order_t erts_lock_order[] = {
{ "proclist_pre_alloc_lock", "address" },
{ "xports_list_pre_alloc_lock", "address" },
{ "inet_buffer_stack_lock", NULL },
- { "gc_info", NULL },
- { "io_wake", NULL },
- { "timer_wheel", NULL },
{ "system_block", NULL },
{ "timeofday", NULL },
{ "get_time", NULL },
diff --git a/erts/emulator/beam/erl_lock_check.h b/erts/emulator/beam/erl_lock_check.h
index 66251ef4e8..18296d1fec 100644
--- a/erts/emulator/beam/erl_lock_check.h
+++ b/erts/emulator/beam/erl_lock_check.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_lock_count.c b/erts/emulator/beam/erl_lock_count.c
index bd00480ba2..a00e0f0fff 100644
--- a/erts/emulator/beam/erl_lock_count.c
+++ b/erts/emulator/beam/erl_lock_count.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_lock_count.h b/erts/emulator/beam/erl_lock_count.h
index 4cc6a5c695..3e8dcefe69 100644
--- a/erts/emulator/beam/erl_lock_count.h
+++ b/erts/emulator/beam/erl_lock_count.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_map.c b/erts/emulator/beam/erl_map.c
index 4b6931f848..8efc983f04 100644
--- a/erts/emulator/beam/erl_map.c
+++ b/erts/emulator/beam/erl_map.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2014. All Rights Reserved.
+ * Copyright Ericsson AB 2014-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -54,6 +54,7 @@
* - maps:new/0
* - maps:put/3
* - maps:remove/2
+ * - maps:take/2
* - maps:to_list/1
* - maps:update/3
* - maps:values/1
@@ -93,7 +94,7 @@ static Uint hashmap_subtree_size(Eterm node);
static Eterm hashmap_to_list(Process *p, Eterm map);
static Eterm hashmap_keys(Process *p, Eterm map);
static Eterm hashmap_values(Process *p, Eterm map);
-static Eterm hashmap_delete(Process *p, Uint32 hx, Eterm key, Eterm node);
+static Eterm hashmap_delete(Process *p, Uint32 hx, Eterm key, Eterm node, Eterm *value);
static Eterm flatmap_from_validated_list(Process *p, Eterm list, Uint size);
static Eterm hashmap_from_validated_list(Process *p, Eterm list, Uint size);
static Eterm hashmap_from_unsorted_array(ErtsHeapFactory*, hxnode_t *hxns, Uint n, int reject_dupkeys);
@@ -196,13 +197,13 @@ erts_maps_get(Eterm key, Eterm map)
return &vs[i];
}
}
- }
-
- for (i = 0; i < n; i++) {
- if (EQ(ks[i], key)) {
- return &vs[i];
- }
- }
+ } else {
+ for (i = 0; i < n; i++) {
+ if (EQ(ks[i], key)) {
+ return &vs[i];
+ }
+ }
+ }
return NULL;
}
ASSERT(is_hashmap(map));
@@ -1521,10 +1522,45 @@ BIF_RETTYPE maps_put_3(BIF_ALIST_3) {
BIF_ERROR(BIF_P, BADMAP);
}
-/* maps:remove/3 */
+/* maps:take/2 */
-int erts_maps_remove(Process *p, Eterm key, Eterm map, Eterm *res) {
+BIF_RETTYPE maps_take_2(BIF_ALIST_2) {
+ if (is_map(BIF_ARG_2)) {
+ Eterm res, map, val;
+ if (erts_maps_take(BIF_P, BIF_ARG_1, BIF_ARG_2, &map, &val)) {
+ Eterm *hp = HAlloc(BIF_P, 3);
+ res = make_tuple(hp);
+ *hp++ = make_arityval(2);
+ *hp++ = val;
+ *hp++ = map;
+ BIF_RET(res);
+ }
+ BIF_RET(am_error);
+ }
+ BIF_P->fvalue = BIF_ARG_2;
+ BIF_ERROR(BIF_P, BADMAP);
+}
+
+/* maps:remove/2 */
+
+BIF_RETTYPE maps_remove_2(BIF_ALIST_2) {
+ if (is_map(BIF_ARG_2)) {
+ Eterm res;
+ (void) erts_maps_take(BIF_P, BIF_ARG_1, BIF_ARG_2, &res, NULL);
+ BIF_RET(res);
+ }
+ BIF_P->fvalue = BIF_ARG_2;
+ BIF_ERROR(BIF_P, BADMAP);
+}
+
+/* erts_maps_take
+ * return 1 if key is found, otherwise 0
+ * If the key is not found res (output map) will be map (input map)
+ */
+int erts_maps_take(Process *p, Eterm key, Eterm map,
+ Eterm *res, Eterm *value) {
Uint32 hx;
+ Eterm ret;
if (is_flatmap(map)) {
Sint n;
Uint need;
@@ -1537,7 +1573,7 @@ int erts_maps_remove(Process *p, Eterm key, Eterm map, Eterm *res) {
if (n == 0) {
*res = map;
- return 1;
+ return 0;
}
ks = flatmap_get_keys(mp);
@@ -1564,6 +1600,7 @@ int erts_maps_remove(Process *p, Eterm key, Eterm map, Eterm *res) {
if (is_immed(key)) {
while (1) {
if (*ks == key) {
+ if (value) *value = *vs;
goto found_key;
} else if (--n) {
*mhp++ = *vs++;
@@ -1574,6 +1611,7 @@ int erts_maps_remove(Process *p, Eterm key, Eterm map, Eterm *res) {
} else {
while(1) {
if (EQ(*ks, key)) {
+ if (value) *value = *vs;
goto found_key;
} else if (--n) {
*mhp++ = *vs++;
@@ -1589,7 +1627,7 @@ int erts_maps_remove(Process *p, Eterm key, Eterm map, Eterm *res) {
HRelease(p, hp_start + need, hp_start);
*res = map;
- return 1;
+ return 0;
found_key:
/* Copy rest of keys and values */
@@ -1601,19 +1639,13 @@ found_key:
}
ASSERT(is_hashmap(map));
hx = hashmap_make_hash(key);
- *res = hashmap_delete(p, hx, key, map);
- return 1;
-}
-
-BIF_RETTYPE maps_remove_2(BIF_ALIST_2) {
- if (is_map(BIF_ARG_2)) {
- Eterm res;
- if (erts_maps_remove(BIF_P, BIF_ARG_1, BIF_ARG_2, &res)) {
- BIF_RET(res);
- }
+ ret = hashmap_delete(p, hx, key, map, value);
+ if (is_value(ret)) {
+ *res = ret;
+ return 1;
}
- BIF_P->fvalue = BIF_ARG_2;
- BIF_ERROR(BIF_P, BADMAP);
+ *res = map;
+ return 0;
}
int erts_maps_update(Process *p, Eterm key, Eterm value, Eterm map, Eterm *res) {
@@ -2322,7 +2354,8 @@ static Eterm hashmap_values(Process* p, Eterm node) {
return res;
}
-static Eterm hashmap_delete(Process *p, Uint32 hx, Eterm key, Eterm map) {
+static Eterm hashmap_delete(Process *p, Uint32 hx, Eterm key,
+ Eterm map, Eterm *value) {
Eterm *hp = NULL, *nhp = NULL, *hp_end = NULL;
Eterm *ptr;
Eterm hdr, res = map, node = map;
@@ -2337,8 +2370,12 @@ static Eterm hashmap_delete(Process *p, Uint32 hx, Eterm key, Eterm map) {
switch(primary_tag(node)) {
case TAG_PRIMARY_LIST:
if (EQ(CAR(list_val(node)), key)) {
+ if (value) {
+ *value = CDR(list_val(node));
+ }
goto unroll;
}
+ res = THE_NON_VALUE;
goto not_found;
case TAG_PRIMARY_BOXED:
ptr = boxed_val(node);
@@ -2365,6 +2402,7 @@ static Eterm hashmap_delete(Process *p, Uint32 hx, Eterm key, Eterm map) {
n = hashmap_bitcount(hval);
} else {
/* not occupied */
+ res = THE_NON_VALUE;
goto not_found;
}
@@ -2394,6 +2432,7 @@ static Eterm hashmap_delete(Process *p, Uint32 hx, Eterm key, Eterm map) {
break;
}
/* not occupied */
+ res = THE_NON_VALUE;
goto not_found;
default:
erts_exit(ERTS_ERROR_EXIT, "bad header tag %ld\r\n", hdr & _HEADER_MAP_SUBTAG_MASK);
diff --git a/erts/emulator/beam/erl_map.h b/erts/emulator/beam/erl_map.h
index 052fa99f03..8b5c9582ba 100644
--- a/erts/emulator/beam/erl_map.h
+++ b/erts/emulator/beam/erl_map.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2014. All Rights Reserved.
+ * Copyright Ericsson AB 2014-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -66,7 +66,7 @@ typedef struct flatmap_s {
/* erl_term.h stuff */
-#define flatmap_get_values(x) (((Eterm *)(x)) + 3)
+#define flatmap_get_values(x) (((Eterm *)(x)) + sizeof(flatmap_t)/sizeof(Eterm))
#define flatmap_get_keys(x) (((Eterm *)tuple_val(((flatmap_t *)(x))->keys)) + 1)
#define flatmap_get_size(x) (((flatmap_t*)(x))->size)
@@ -82,6 +82,7 @@ struct ErtsEStack_;
Eterm erts_maps_put(Process *p, Eterm key, Eterm value, Eterm map);
int erts_maps_update(Process *p, Eterm key, Eterm value, Eterm map, Eterm *res);
int erts_maps_remove(Process *p, Eterm key, Eterm map, Eterm *res);
+int erts_maps_take(Process *p, Eterm key, Eterm map, Eterm *res, Eterm *value);
Eterm erts_hashmap_insert(Process *p, Uint32 hx, Eterm key, Eterm value,
Eterm node, int is_update);
diff --git a/erts/emulator/beam/erl_math.c b/erts/emulator/beam/erl_math.c
index b46cc37495..fc0aaed18a 100644
--- a/erts/emulator/beam/erl_math.c
+++ b/erts/emulator/beam/erl_math.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_message.c b/erts/emulator/beam/erl_message.c
index 88efb2c59f..9beff52835 100644
--- a/erts/emulator/beam/erl_message.c
+++ b/erts/emulator/beam/erl_message.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2012. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -324,7 +324,7 @@ erts_queue_dist_message(Process *rcvr,
tok_label, tok_lastcnt, tok_serial);
}
#endif
- erts_queue_message(rcvr, rcvr_locks, mp, msg, token);
+ erts_queue_message(rcvr, rcvr_locks, mp, msg);
}
}
else {
@@ -349,7 +349,7 @@ erts_queue_dist_message(Process *rcvr,
}
#endif
- LINK_MESSAGE(rcvr, mp);
+ LINK_MESSAGE(rcvr, mp, &mp->next, 1);
if (!(*rcvr_locks & ERTS_PROC_LOCK_MSGQ))
erts_smp_proc_unlock(rcvr, ERTS_PROC_LOCK_MSGQ);
@@ -364,31 +364,34 @@ erts_queue_dist_message(Process *rcvr,
}
}
-/* Add a message last in message queue */
+/* Add messages last in message queue */
static Sint
-queue_message(Process *c_p,
- Process* receiver,
- erts_aint32_t *receiver_state,
- ErtsProcLocks *receiver_locks,
- ErtsMessage* mp,
- Eterm message,
- Eterm seq_trace_token
-#ifdef USE_VM_PROBES
- , Eterm dt_utag
-#endif
- )
+queue_messages(Process *c_p,
+ Process* receiver,
+ erts_aint32_t *receiver_state,
+ ErtsProcLocks *receiver_locks,
+ ErtsMessage* first,
+ ErtsMessage** last,
+ Uint len)
{
Sint res;
int locked_msgq = 0;
erts_aint32_t state;
- ERTS_SMP_LC_ASSERT(*receiver_locks == erts_proc_lc_my_proc_locks(receiver));
+ ASSERT(is_value(ERL_MESSAGE_TERM(first)));
+ ASSERT(ERL_MESSAGE_TOKEN(first) == am_undefined ||
+ ERL_MESSAGE_TOKEN(first) == NIL ||
+ is_tuple(ERL_MESSAGE_TOKEN(first)));
#ifdef ERTS_SMP
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ ERTS_SMP_LC_ASSERT(erts_proc_lc_my_proc_locks(receiver) < ERTS_PROC_LOCK_MSGQ ||
+ *receiver_locks == erts_proc_lc_my_proc_locks(receiver));
+#endif
if (!(*receiver_locks & ERTS_PROC_LOCK_MSGQ)) {
if (erts_smp_proc_trylock(receiver, ERTS_PROC_LOCK_MSGQ) == EBUSY) {
- ErtsProcLocks need_locks = ERTS_PROC_LOCK_MSGQ;
+ ErtsProcLocks need_locks = ERTS_PROC_LOCK_MSGQ;
if (receiver_state)
state = *receiver_state;
@@ -417,16 +420,10 @@ queue_message(Process *c_p,
/* Drop message if receiver is exiting or has a pending exit... */
if (locked_msgq)
erts_smp_proc_unlock(receiver, ERTS_PROC_LOCK_MSGQ);
- erts_cleanup_messages(mp);
+ erts_cleanup_messages(first);
return 0;
}
- ERL_MESSAGE_TERM(mp) = message;
- ERL_MESSAGE_TOKEN(mp) = seq_trace_token;
-#ifdef USE_VM_PROBES
- ERL_MESSAGE_DT_UTAG(mp) = dt_utag;
-#endif
-
res = receiver->msg.len;
#ifdef ERTS_SMP
if (*receiver_locks & ERTS_PROC_LOCK_MAIN) {
@@ -440,75 +437,83 @@ queue_message(Process *c_p,
*/
res += receiver->msg_inq.len;
ERTS_SMP_MSGQ_MV_INQ2PRIVQ(receiver);
- LINK_MESSAGE_PRIVQ(receiver, mp);
+ LINK_MESSAGE_PRIVQ(receiver, first, last, len);
}
else
#endif
{
- LINK_MESSAGE(receiver, mp);
+ LINK_MESSAGE(receiver, first, last, len);
}
+ if (IS_TRACED_FL(receiver, F_TRACE_RECEIVE)) {
+ ErtsMessage *msg = first;
+
#ifdef USE_VM_PROBES
- if (DTRACE_ENABLED(message_queued)) {
- DTRACE_CHARBUF(receiver_name, DTRACE_TERM_BUF_SIZE);
- Sint tok_label = 0;
- Sint tok_lastcnt = 0;
- Sint tok_serial = 0;
-
- dtrace_proc_str(receiver, receiver_name);
- if (seq_trace_token != NIL && is_tuple(seq_trace_token)) {
- tok_label = signed_val(SEQ_TRACE_T_LABEL(seq_trace_token));
- tok_lastcnt = signed_val(SEQ_TRACE_T_LASTCNT(seq_trace_token));
- tok_serial = signed_val(SEQ_TRACE_T_SERIAL(seq_trace_token));
+ if (DTRACE_ENABLED(message_queued)) {
+ DTRACE_CHARBUF(receiver_name, DTRACE_TERM_BUF_SIZE);
+ Sint tok_label = 0;
+ Sint tok_lastcnt = 0;
+ Sint tok_serial = 0;
+ Eterm seq_trace_token = ERL_MESSAGE_TOKEN(msg);
+
+ dtrace_proc_str(receiver, receiver_name);
+ if (seq_trace_token != NIL && is_tuple(seq_trace_token)) {
+ tok_label = signed_val(SEQ_TRACE_T_LABEL(seq_trace_token));
+ tok_lastcnt = signed_val(SEQ_TRACE_T_LASTCNT(seq_trace_token));
+ tok_serial = signed_val(SEQ_TRACE_T_SERIAL(seq_trace_token));
+ }
+ DTRACE6(message_queued,
+ receiver_name, size_object(ERL_MESSAGE_TERM(msg)),
+ receiver->msg.len,
+ tok_label, tok_lastcnt, tok_serial);
}
- DTRACE6(message_queued,
- receiver_name, size_object(message), receiver->msg.len,
- tok_label, tok_lastcnt, tok_serial);
- }
#endif
- if (IS_TRACED_FL(receiver, F_TRACE_RECEIVE))
- trace_receive(receiver, message);
+ while (msg) {
+ trace_receive(receiver, ERL_MESSAGE_TERM(msg));
+ msg = msg->next;
+ }
+
+ }
if (locked_msgq)
erts_smp_proc_unlock(receiver, ERTS_PROC_LOCK_MSGQ);
- erts_proc_notify_new_message(receiver,
#ifdef ERTS_SMP
- *receiver_locks
+ erts_proc_notify_new_message(receiver, *receiver_locks);
#else
- 0
-#endif
- );
-
-#ifndef ERTS_SMP
+ erts_proc_notify_new_message(receiver, 0);
ERTS_HOLE_CHECK(receiver);
#endif
return res;
}
-void
-#ifdef USE_VM_PROBES
-erts_queue_message_probe(Process* receiver, ErtsProcLocks *receiver_locks,
- ErtsMessage* mp,
- Eterm message, Eterm seq_trace_token, Eterm dt_utag)
-#else
+static Sint
+queue_message(Process *c_p,
+ Process* receiver,
+ erts_aint32_t *receiver_state,
+ ErtsProcLocks *receiver_locks,
+ ErtsMessage* mp, Eterm msg)
+{
+ ERL_MESSAGE_TERM(mp) = msg;
+ return queue_messages(c_p, receiver, receiver_state, receiver_locks,
+ mp, &mp->next, 1 );
+}
+
+Sint
erts_queue_message(Process* receiver, ErtsProcLocks *receiver_locks,
- ErtsMessage* mp,
- Eterm message, Eterm seq_trace_token)
-#endif
+ ErtsMessage* mp, Eterm msg)
{
- queue_message(NULL,
- receiver,
- NULL,
- receiver_locks,
- mp,
- message,
- seq_trace_token
-#ifdef USE_VM_PROBES
- , dt_utag
-#endif
- );
+ return queue_message(NULL, receiver, NULL, receiver_locks, mp, msg);
+}
+
+
+Sint
+erts_queue_messages(Process* receiver, ErtsProcLocks *receiver_locks,
+ ErtsMessage* first, ErtsMessage** last, Uint len)
+{
+ return queue_messages(NULL, receiver, NULL, receiver_locks,
+ first, last, len);
}
void
@@ -591,7 +596,7 @@ erts_try_alloc_message_on_heap(Process *pp,
#if defined(ERTS_SMP)
*plp & ERTS_PROC_LOCK_MAIN
#else
- 1
+ pp
#endif
) {
#ifdef ERTS_SMP
@@ -621,7 +626,7 @@ erts_try_alloc_message_on_heap(Process *pp,
*on_heap_p = !0;
}
#ifdef ERTS_SMP
- else if (erts_smp_proc_trylock(pp, ERTS_PROC_LOCK_MAIN) == 0) {
+ else if (pp && erts_smp_proc_trylock(pp, ERTS_PROC_LOCK_MAIN) == 0) {
locked_main = 1;
*psp = erts_smp_atomic32_read_nob(&pp->state);
*plp |= ERTS_PROC_LOCK_MAIN;
@@ -766,17 +771,7 @@ erts_send_message(Process* sender,
utag = DT_UTAG(sender);
else
utag = copy_struct(DT_UTAG(sender), dt_utag_size, &hp, ohp);
-#ifdef DTRACE_TAG_HARDDEBUG
- erts_fprintf(stderr,
- "Dtrace -> (%T) Spreading tag (%T) with "
- "message %T!\r\n",sender->common.id, utag, message);
-#endif
}
-#endif
- BM_MESSAGE_COPIED(msize);
- BM_SWAP_TIMER(copy,send);
-
-#ifdef USE_VM_PROBES
if (DTRACE_ENABLED(message_send)) {
if (have_seqtrace(stoken)) {
tok_label = signed_val(SEQ_TRACE_T_LABEL(stoken));
@@ -787,6 +782,9 @@ erts_send_message(Process* sender,
msize, tok_label, tok_lastcnt, tok_serial);
}
#endif
+ BM_MESSAGE_COPIED(msize);
+ BM_SWAP_TIMER(copy,send);
+
} else {
Eterm *hp;
@@ -822,21 +820,21 @@ erts_send_message(Process* sender,
BM_MESSAGE_COPIED(msz);
BM_SWAP_TIMER(copy,send);
}
+#ifdef USE_VM_PROBES
DTRACE6(message_send, sender_name, receiver_name,
msize, tok_label, tok_lastcnt, tok_serial);
+#endif
}
+ ERL_MESSAGE_TOKEN(mp) = token;
+#ifdef USE_VM_PROBES
+ ERL_MESSAGE_DT_UTAG(mp) = utag;
+#endif
res = queue_message(sender,
receiver,
&receiver_state,
receiver_locks,
- mp,
- message,
- token
-#ifdef USE_VM_PROBES
- , utag
-#endif
- );
+ mp, message);
BM_SWAP_TIMER(send,system);
@@ -892,7 +890,8 @@ erts_deliver_exit_message(Eterm from, Process *to, ErtsProcLocks *to_locksp,
/* the trace token must in this case be updated by the caller */
seq_trace_output(token, save, SEQ_TRACE_SEND, to->common.id, NULL);
temptoken = copy_struct(token, sz_token, &hp, ohp);
- erts_queue_message(to, to_locksp, mp, save, temptoken);
+ ERL_MESSAGE_TOKEN(mp) = temptoken;
+ erts_queue_message(to, to_locksp, mp, save);
} else {
sz_from = IS_CONST(from) ? 0 : size_object(from);
#ifdef SHCOPY_SEND
@@ -914,7 +913,7 @@ erts_deliver_exit_message(Eterm from, Process *to, ErtsProcLocks *to_locksp,
? from
: copy_struct(from, sz_from, &hp, ohp));
save = TUPLE3(hp, am_EXIT, from_copy, mess);
- erts_queue_message(to, to_locksp, mp, save, NIL);
+ erts_queue_message(to, to_locksp, mp, save);
}
}
@@ -1489,7 +1488,7 @@ erts_factory_message_create(ErtsHeapFactory* factory,
int on_heap;
erts_aint32_t state;
- state = erts_smp_atomic32_read_nob(&proc->state);
+ state = proc ? erts_smp_atomic32_read_nob(&proc->state) : 0;
if (state & ERTS_PSFLG_OFF_HEAP_MSGQ) {
msgp = erts_alloc_message(sz, &hp);
diff --git a/erts/emulator/beam/erl_message.h b/erts/emulator/beam/erl_message.h
index 60035d15ae..608cf552a2 100644
--- a/erts/emulator/beam/erl_message.h
+++ b/erts/emulator/beam/erl_message.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2012. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -182,48 +182,64 @@ typedef struct {
Sint len; /* queue length */
} ErlMessageInQueue;
+typedef struct erl_trace_message_queue__ {
+ struct erl_trace_message_queue__ *next; /* point to the next receiver */
+ Eterm receiver;
+ ErtsMessage* first;
+ ErtsMessage** last; /* point to the last next pointer */
+ Sint len; /* queue length */
+} ErlTraceMessageQueue;
+
#endif
/* Get "current" message */
#define PEEK_MESSAGE(p) (*(p)->msg.save)
+#ifdef USE_VM_PROBES
+#define LINK_MESSAGE_DTAG(mp, dt) ERL_MESSAGE_DT_UTAG(mp) = dt
+#else
+#define LINK_MESSAGE_DTAG(mp, dt)
+#endif
-/* Add message last in private message queue */
-#define LINK_MESSAGE_PRIVQ(p, mp) do { \
- *(p)->msg.last = (mp); \
- (p)->msg.last = &(mp)->next; \
- (p)->msg.len++; \
-} while (0)
-
+#define LINK_MESSAGE_IMPL(p, first_msg, last_msg, num_msgs, where) do { \
+ *(p)->where.last = (first_msg); \
+ (p)->where.last = (last_msg); \
+ (p)->where.len += (num_msgs); \
+ } while(0)
#ifdef ERTS_SMP
-/* Move in message queue to end of private message queue */
-#define ERTS_SMP_MSGQ_MV_INQ2PRIVQ(P) \
-do { \
- if ((P)->msg_inq.first) { \
- *(P)->msg.last = (P)->msg_inq.first; \
- (P)->msg.last = (P)->msg_inq.last; \
- (P)->msg.len += (P)->msg_inq.len; \
- (P)->msg_inq.first = NULL; \
- (P)->msg_inq.last = &(P)->msg_inq.first; \
- (P)->msg_inq.len = 0; \
- } \
-} while (0)
-
-/* Add message last in message queue */
-#define LINK_MESSAGE(p, mp) do { \
- *(p)->msg_inq.last = (mp); \
- (p)->msg_inq.last = &(mp)->next; \
- (p)->msg_inq.len++; \
-} while(0)
+/* Add message last in private message queue */
+#define LINK_MESSAGE_PRIVQ(p, first_msg, last_msg, len) \
+ do { \
+ LINK_MESSAGE_IMPL(p, first_msg, last_msg, len, msg); \
+ } while (0)
+
+/* Add message last_msg in message queue */
+#define LINK_MESSAGE(p, first_msg, last_msg, len) \
+ LINK_MESSAGE_IMPL(p, first_msg, last_msg, len, msg_inq)
+
+#define ERTS_SMP_MSGQ_MV_INQ2PRIVQ(p) \
+ do { \
+ if (p->msg_inq.first) { \
+ *p->msg.last = p->msg_inq.first; \
+ p->msg.last = p->msg_inq.last; \
+ p->msg.len += p->msg_inq.len; \
+ p->msg_inq.first = NULL; \
+ p->msg_inq.last = &p->msg_inq.first; \
+ p->msg_inq.len = 0; \
+ } \
+ } while (0)
#else
-#define ERTS_SMP_MSGQ_MV_INQ2PRIVQ(P)
+#define ERTS_SMP_MSGQ_MV_INQ2PRIVQ(p)
-/* Add message last in message queue */
-#define LINK_MESSAGE(p, mp) LINK_MESSAGE_PRIVQ((p), (mp))
+/* Add message last_msg in message queue */
+#define LINK_MESSAGE(p, first_msg, last_msg, len) \
+ do { \
+ LINK_MESSAGE_IMPL(p, first_msg, last_msg, len, msg); \
+ } while(0)
#endif
@@ -259,23 +275,30 @@ do { \
(HEAP_FRAG_P)->off_heap.overhead = 0; \
} while (0)
+#ifdef USE_VM_PROBES
+#define ERL_MESSAGE_DT_UTAG_INIT(MP) ERL_MESSAGE_DT_UTAG(MP) = NIL
+#else
+#define ERL_MESSAGE_DT_UTAG_INIT(MP) do{ } while (0)
+#endif
+
+#define ERTS_INIT_MESSAGE(MP) \
+ do { \
+ (MP)->next = NULL; \
+ ERL_MESSAGE_TERM(MP) = THE_NON_VALUE; \
+ ERL_MESSAGE_TOKEN(MP) = NIL; \
+ ERL_MESSAGE_DT_UTAG_INIT(MP); \
+ MP->data.attached = NULL; \
+ } while (0)
+
void init_message(void);
ErlHeapFragment* new_message_buffer(Uint);
ErlHeapFragment* erts_resize_message_buffer(ErlHeapFragment *, Uint,
Eterm *, Uint);
void free_message_buffer(ErlHeapFragment *);
void erts_queue_dist_message(Process*, ErtsProcLocks*, ErtsDistExternal *, Eterm);
-#ifdef USE_VM_PROBES
-void erts_queue_message_probe(Process*, ErtsProcLocks*, ErtsMessage*,
- Eterm message, Eterm seq_trace_token, Eterm dt_utag);
-#define erts_queue_message(RP,RL,BP,Msg,SEQ) \
- erts_queue_message_probe((RP),(RL),(BP),(Msg),(SEQ),NIL)
-#else
-void erts_queue_message(Process*, ErtsProcLocks*, ErtsMessage*,
- Eterm message, Eterm seq_trace_token);
-#define erts_queue_message_probe(RP,RL,BP,Msg,SEQ,TAG) \
- erts_queue_message((RP),(RL),(BP),(Msg),(SEQ))
-#endif
+Sint erts_queue_message(Process*, ErtsProcLocks*,ErtsMessage*, Eterm);
+Sint erts_queue_messages(Process*, ErtsProcLocks*,
+ ErtsMessage*, ErtsMessage**, Uint);
void erts_deliver_exit_message(Eterm, Process*, ErtsProcLocks *, Eterm, Eterm);
Sint erts_send_message(Process*, Process*, ErtsProcLocks*, Eterm, unsigned);
void erts_link_mbuf_to_proc(Process *proc, ErlHeapFragment *bp);
@@ -354,9 +377,7 @@ ERTS_GLB_FORCE_INLINE ErtsMessage *erts_alloc_message(Uint sz, Eterm **hpp)
if (sz == 0) {
mp = erts_alloc_message_ref();
- mp->next = NULL;
- ERL_MESSAGE_TERM(mp) = NIL;
- mp->data.attached = NULL;
+ ERTS_INIT_MESSAGE(mp);
if (hpp)
*hpp = NULL;
return mp;
@@ -365,8 +386,7 @@ ERTS_GLB_FORCE_INLINE ErtsMessage *erts_alloc_message(Uint sz, Eterm **hpp)
mp = erts_alloc(ERTS_ALC_T_MSG,
sizeof(ErtsMessage) + (sz - 1)*sizeof(Eterm));
- mp->next = NULL;
- ERL_MESSAGE_TERM(mp) = NIL;
+ ERTS_INIT_MESSAGE(mp);
mp->data.attached = ERTS_MSG_COMBINED_HFRAG;
ERTS_INIT_HEAP_FRAG(&mp->hfrag, sz, sz);
diff --git a/erts/emulator/beam/erl_monitors.c b/erts/emulator/beam/erl_monitors.c
index bd899fa2f9..910598690d 100644
--- a/erts/emulator/beam/erl_monitors.c
+++ b/erts/emulator/beam/erl_monitors.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_monitors.h b/erts/emulator/beam/erl_monitors.h
index 901ed8940b..9e2beedea3 100644
--- a/erts/emulator/beam/erl_monitors.h
+++ b/erts/emulator/beam/erl_monitors.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_msacc.c b/erts/emulator/beam/erl_msacc.c
index 71e3fd8b6e..d0f305900a 100644
--- a/erts/emulator/beam/erl_msacc.c
+++ b/erts/emulator/beam/erl_msacc.c
@@ -257,7 +257,7 @@ static void send_reply(ErtsMsAcc *msacc, ErtsMSAccReq *msaccrp) {
if (msacc->unmanaged) erts_mtx_unlock(&msacc->mtx);
- erts_queue_message(rp, &rp_locks, msgp, msg, NIL);
+ erts_queue_message(rp, &rp_locks, msgp, msg);
if (esdp && msaccrp->req_sched == esdp->no)
rp_locks &= ~ERTS_PROC_LOCK_MAIN;
diff --git a/erts/emulator/beam/erl_mtrace.c b/erts/emulator/beam/erl_mtrace.c
index fdaf02f37a..e275867928 100644
--- a/erts/emulator/beam/erl_mtrace.c
+++ b/erts/emulator/beam/erl_mtrace.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_mtrace.h b/erts/emulator/beam/erl_mtrace.h
index b34eab3c4a..776c70a819 100644
--- a/erts/emulator/beam/erl_mtrace.h
+++ b/erts/emulator/beam/erl_mtrace.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index 8580bc2689..dc83a780a2 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -92,11 +92,12 @@ static ERTS_INLINE Eterm* alloc_heap(ErlNifEnv* env, unsigned need)
}
static Eterm* alloc_heap_heavy(ErlNifEnv* env, unsigned need, Eterm* hp)
-{
+{
env->hp = hp;
- if (env->heap_frag == NULL) {
+ if (env->heap_frag == NULL) {
ASSERT(HEAP_LIMIT(env->proc) == env->hp_end);
- HEAP_TOP(env->proc) = env->hp;
+ ASSERT(env->hp + need > env->hp_end);
+ HEAP_TOP(env->proc) = env->hp;
}
else {
env->heap_frag->used_size = hp - env->heap_frag->mem;
@@ -120,7 +121,8 @@ static ERTS_INLINE void ensure_heap(ErlNifEnv* env, unsigned may_need)
}
#endif
-void erts_pre_nif(ErlNifEnv* env, Process* p, struct erl_module_nif* mod_nif)
+void erts_pre_nif(ErlNifEnv* env, Process* p, struct erl_module_nif* mod_nif,
+ Process* tracee)
{
env->mod_nif = mod_nif;
env->proc = p;
@@ -130,17 +132,7 @@ void erts_pre_nif(ErlNifEnv* env, Process* p, struct erl_module_nif* mod_nif)
env->fpe_was_unmasked = erts_block_fpe();
env->tmp_obj_list = NULL;
env->exception_thrown = 0;
-}
-
-static void pre_nif_noproc(ErlNifEnv* env, struct erl_module_nif* mod_nif)
-{
- env->mod_nif = mod_nif;
- env->proc = NULL;
- env->hp = NULL;
- env->hp_end = NULL;
- env->heap_frag = NULL;
- env->fpe_was_unmasked = erts_block_fpe();
- env->tmp_obj_list = NULL;
+ env->tracee = tracee;
}
/* Temporary object header, auto-deallocated when NIF returns
@@ -180,13 +172,6 @@ void erts_post_nif(ErlNifEnv* env)
free_tmp_objs(env);
}
-static void post_nif_noproc(ErlNifEnv* env)
-{
- erts_unblock_fpe(env->fpe_was_unmasked);
- free_tmp_objs(env);
-}
-
-
/* Flush out our cached heap pointers to allow an ordinary HAlloc
*/
static void flush_env(ErlNifEnv* env)
@@ -209,6 +194,7 @@ static void flush_env(ErlNifEnv* env)
*/
static void cache_env(ErlNifEnv* env)
{
+ env->heap_frag = MBUF(env->proc);
if (env->heap_frag == NULL) {
ASSERT(env->hp_end == HEAP_LIMIT(env->proc));
ASSERT(env->hp <= HEAP_TOP(env->proc));
@@ -216,10 +202,6 @@ static void cache_env(ErlNifEnv* env)
env->hp = HEAP_TOP(env->proc);
}
else {
- ASSERT(env->hp_end != HEAP_LIMIT(env->proc));
- ASSERT(env->hp_end - env->hp <= env->heap_frag->alloc_size);
- env->heap_frag = MBUF(env->proc);
- ASSERT(env->heap_frag != NULL);
env->hp = env->heap_frag->mem + env->heap_frag->used_size;
env->hp_end = env->heap_frag->mem + env->heap_frag->alloc_size;
}
@@ -250,18 +232,20 @@ struct enif_msg_environment_t
Process phony_proc;
};
-ErlNifEnv* enif_alloc_env(void)
+static ERTS_INLINE void
+setup_nif_env(struct enif_msg_environment_t* msg_env,
+ struct erl_module_nif* mod,
+ Process* tracee)
{
- struct enif_msg_environment_t* msg_env =
- erts_alloc_fnf(ERTS_ALC_T_NIF, sizeof(struct enif_msg_environment_t));
Eterm* phony_heap = (Eterm*) msg_env; /* dummy non-NULL ptr */
-
- msg_env->env.hp = phony_heap;
+
+ msg_env->env.hp = phony_heap;
msg_env->env.hp_end = phony_heap;
msg_env->env.heap_frag = NULL;
- msg_env->env.mod_nif = NULL;
+ msg_env->env.mod_nif = mod;
msg_env->env.tmp_obj_list = NULL;
msg_env->env.proc = &msg_env->phony_proc;
+ msg_env->env.exception_thrown = 0;
memset(&msg_env->phony_proc, 0, sizeof(Process));
HEAP_START(&msg_env->phony_proc) = phony_heap;
HEAP_TOP(&msg_env->phony_proc) = phony_heap;
@@ -273,6 +257,14 @@ ErlNifEnv* enif_alloc_env(void)
msg_env->phony_proc.space_verified = 0;
msg_env->phony_proc.space_verified_from = NULL;
#endif
+ msg_env->env.tracee = tracee;
+}
+
+ErlNifEnv* enif_alloc_env(void)
+{
+ struct enif_msg_environment_t* msg_env =
+ erts_alloc_fnf(ERTS_ALC_T_NIF, sizeof(struct enif_msg_environment_t));
+ setup_nif_env(msg_env, NULL, NULL);
return &msg_env->env;
}
void enif_free_env(ErlNifEnv* env)
@@ -281,6 +273,20 @@ void enif_free_env(ErlNifEnv* env)
erts_free(ERTS_ALC_T_NIF, env);
}
+static ERTS_INLINE void pre_nif_noproc(struct enif_msg_environment_t* msg_env,
+ struct erl_module_nif* mod,
+ Process* tracee)
+{
+ setup_nif_env(msg_env, mod, tracee);
+ msg_env->env.fpe_was_unmasked = erts_block_fpe();
+}
+
+static ERTS_INLINE void post_nif_noproc(struct enif_msg_environment_t* msg_env)
+{
+ erts_unblock_fpe(msg_env->env.fpe_was_unmasked);
+ enif_clear_env(&msg_env->env);
+}
+
static ERTS_INLINE void clear_offheap(ErlOffHeap* oh)
{
oh->first = NULL;
@@ -307,23 +313,111 @@ void enif_clear_env(ErlNifEnv* env)
ASSERT(!is_offheap(&MSO(p)));
free_tmp_objs(env);
}
-int enif_send(ErlNifEnv* env, const ErlNifPid* to_pid,
- ErlNifEnv* msg_env, ERL_NIF_TERM msg)
+
+#ifdef ERTS_SMP
+#ifdef DEBUG
+static int enif_send_delay = 0;
+#define ERTS_FORCE_ENIF_SEND_DELAY() (enif_send_delay++ % 2 == 0)
+#else
+#ifdef ERTS_PROC_LOCK_OWN_IMPL
+#define ERTS_FORCE_ENIF_SEND_DELAY() 0
+#else
+/*
+ * We always schedule messages if we do not use our own
+ * process lock implementation, as if we try to do a trylock on
+ * a lock that might already be locked by the same thread.
+ * And what happens then with different mutex implementations
+ * is not always guaranteed.
+ */
+#define ERTS_FORCE_ENIF_SEND_DELAY() 1
+#endif
+#endif
+
+int erts_flush_trace_messages(Process *c_p, ErtsProcLocks c_p_locks)
+{
+ ErlTraceMessageQueue *msgq, **last_msgq;
+ int reds = 0;
+
+ erts_smp_proc_lock(c_p, ERTS_PROC_LOCK_TRACE);
+
+ msgq = c_p->trace_msg_q;
+
+ if (!msgq)
+ goto error;
+
+ do {
+ Process* rp;
+ ErtsProcLocks rp_locks;
+ ErtsMessage *first, **last;
+ Uint len;
+
+ first = msgq->first;
+ last = msgq->last;
+ len = msgq->len;
+ msgq->first = NULL;
+ msgq->last = &msgq->first;
+ msgq->len = 0;
+ erts_smp_proc_unlock(c_p, ERTS_PROC_LOCK_TRACE);
+
+ ASSERT(len != 0);
+
+ rp = erts_proc_lookup(msgq->receiver);
+ if (rp) {
+ rp_locks = 0;
+ if (rp->common.id == c_p->common.id)
+ rp_locks = c_p_locks;
+ erts_queue_messages(rp, &rp_locks, first, last, len);
+ if (rp->common.id == c_p->common.id)
+ rp_locks &= ~c_p_locks;
+ if (rp_locks)
+ erts_smp_proc_unlock(rp, rp_locks);
+ reds += len;
+ } else {
+ erts_cleanup_messages(first);
+ }
+ reds += 1;
+ erts_smp_proc_lock(c_p, ERTS_PROC_LOCK_TRACE);
+ msgq = msgq->next;
+ } while (msgq);
+
+ last_msgq = &c_p->trace_msg_q;
+
+ while (*last_msgq) {
+ msgq = *last_msgq;
+ if (msgq->len == 0) {
+ *last_msgq = msgq->next;
+ erts_free(ERTS_ALC_T_TRACE_MSG_QUEUE, msgq);
+ } else {
+ last_msgq = &msgq->next;
+ }
+ }
+
+error:
+ erts_smp_proc_unlock(c_p, ERTS_PROC_LOCK_TRACE);
+
+ return reds;
+}
+
+#endif
+
+int
+enif_send(ErlNifEnv* env, const ErlNifPid* to_pid,
+ ErlNifEnv* msg_env, ERL_NIF_TERM msg)
{
struct enif_msg_environment_t* menv = (struct enif_msg_environment_t*)msg_env;
- ErtsProcLocks rp_locks = 0;
+ ErtsProcLocks rp_locks = 0, lc_locks = 0, c_p_locks = ERTS_PROC_LOCK_MAIN;
Process* rp;
Process* c_p;
ErtsMessage *mp;
- ErlHeapFragment* frags;
Eterm receiver = to_pid->pid;
int flush_me = 0;
- int scheduler = erts_get_scheduler_id() != 0;
+ ErtsSchedulerData *esdp = erts_get_scheduler_data();
+ int scheduler = esdp ? esdp->no : 0;
if (env != NULL) {
c_p = env->proc;
if (receiver == c_p->common.id) {
- rp_locks = ERTS_PROC_LOCK_MAIN;
+ rp_locks = c_p_locks;
flush_me = 1;
}
}
@@ -333,40 +427,124 @@ int enif_send(ErlNifEnv* env, const ErlNifPid* to_pid,
#else
erts_exit(ERTS_ABORT_EXIT,"enif_send: env==NULL on non-SMP VM");
#endif
- }
+ }
rp = (scheduler
? erts_proc_lookup(receiver)
: erts_pid2proc_opt(c_p, ERTS_PROC_LOCK_MAIN,
receiver, rp_locks, ERTS_P2P_FLG_INC_REFC));
+
if (rp == NULL) {
ASSERT(env == NULL || receiver != c_p->common.id);
return 0;
}
- flush_env(msg_env);
- frags = menv->env.heap_frag;
- ASSERT(frags == MBUF(&menv->phony_proc));
- if (frags != NULL) {
- /* Move all offheap's from phony proc to the first fragment.
- Quick and dirty... */
- ASSERT(!is_offheap(&frags->off_heap));
- frags->off_heap = MSO(&menv->phony_proc);
- clear_offheap(&MSO(&menv->phony_proc));
- menv->env.heap_frag = NULL;
- MBUF(&menv->phony_proc) = NULL;
- }
- ASSERT(!is_offheap(&MSO(&menv->phony_proc)));
-
- if (flush_me) {
- flush_env(env); /* Needed for ERTS_HOLE_CHECK */
- }
- mp = erts_alloc_message(0, NULL);
- mp->data.heap_frag = frags;
- erts_queue_message(rp, &rp_locks, mp, msg, am_undefined);
+ if (menv) {
+ flush_env(msg_env);
+ mp = erts_alloc_message(0, NULL);
+ mp->data.heap_frag = menv->env.heap_frag;
+ ASSERT(mp->data.heap_frag == MBUF(&menv->phony_proc));
+ if (mp->data.heap_frag != NULL) {
+ /* Move all offheap's from phony proc to the first fragment.
+ Quick and dirty... */
+ ASSERT(!is_offheap(&mp->data.heap_frag->off_heap));
+ mp->data.heap_frag->off_heap = MSO(&menv->phony_proc);
+ clear_offheap(&MSO(&menv->phony_proc));
+ menv->env.heap_frag = NULL;
+ MBUF(&menv->phony_proc) = NULL;
+ }
+ } else {
+ Uint sz = size_object(msg);
+ Eterm *hp;
+ mp = erts_alloc_message(sz, &hp);
+ msg = copy_struct(msg, sz, &hp, &mp->hfrag.off_heap);
+ ASSERT(hp == mp->hfrag.mem+mp->hfrag.used_size);
+ }
+
+ ERL_MESSAGE_TERM(mp) = msg;
+
+ if (flush_me) {
+ flush_env(env); /* Needed for ERTS_HOLE_CHECK */
+ }
+
+ if (!env || !env->tracee) {
+
+ if (c_p && IS_TRACED_FL(c_p, F_TRACE_SEND))
+ trace_send(c_p, receiver, msg);
+
+#ifndef ERTS_SMP
+ }
+#endif
+
+ erts_queue_message(rp, &rp_locks, mp, msg);
+#ifdef ERTS_SMP
+ }
+ else {
+ /* This clause is taken when the nif is called in the context
+ of a traced process. We do not know which locks we have
+ so we have to do a try lock and if that fails we enqueue
+ the message in a special trace message output queue of the
+ tracee */
+ ErlTraceMessageQueue *msgq;
+ Process *t_p = env->tracee;
+
+
+ erts_smp_proc_lock(t_p, ERTS_PROC_LOCK_TRACE);
+
+ msgq = t_p->trace_msg_q;
+
+ while (msgq != NULL) {
+ if (msgq->receiver == receiver) {
+ break;
+ }
+ msgq = msgq->next;
+ }
+
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ lc_locks = erts_proc_lc_my_proc_locks(rp);
+ rp_locks |= lc_locks;
+ if (receiver == c_p->common.id)
+ c_p_locks |= lc_locks;
+#endif
+ if (ERTS_FORCE_ENIF_SEND_DELAY() || msgq ||
+ rp_locks & ERTS_PROC_LOCK_MSGQ ||
+ erts_smp_proc_trylock(rp, ERTS_PROC_LOCK_MSGQ) == EBUSY) {
+
+ if (!msgq) {
+
+ msgq = erts_alloc(ERTS_ALC_T_TRACE_MSG_QUEUE,
+ sizeof(ErlTraceMessageQueue));
+ msgq->receiver = receiver;
+ msgq->first = mp;
+ msgq->last = &mp->next;
+ msgq->len = 1;
+
+ /* Insert in linked list */
+ msgq->next = t_p->trace_msg_q;
+ t_p->trace_msg_q = msgq;
+
+ erts_smp_proc_unlock(t_p, ERTS_PROC_LOCK_TRACE);
+
+ erts_schedule_flush_trace_messages(t_p->common.id);
+
+ } else {
+ msgq->len++;
+ *msgq->last = mp;
+ msgq->last = &mp->next;
+ erts_smp_proc_unlock(t_p, ERTS_PROC_LOCK_TRACE);
+ }
+ } else {
+ erts_smp_proc_unlock(t_p, ERTS_PROC_LOCK_TRACE);
+ rp_locks &= ~ERTS_PROC_LOCK_TRACE;
+ rp_locks |= ERTS_PROC_LOCK_MSGQ;
+ erts_queue_message(rp, &rp_locks, mp, msg);
+ }
+ }
+#endif
+
if (c_p == rp)
rp_locks &= ~ERTS_PROC_LOCK_MAIN;
- if (rp_locks)
- erts_smp_proc_unlock(rp, rp_locks);
+ if (rp_locks & ~lc_locks)
+ erts_smp_proc_unlock(rp, rp_locks & ~lc_locks);
if (!scheduler)
erts_proc_dec_refc(rp);
if (flush_me) {
@@ -375,6 +553,32 @@ int enif_send(ErlNifEnv* env, const ErlNifPid* to_pid,
return 1;
}
+int
+enif_port_command(ErlNifEnv *env, const ErlNifPort* to_port,
+ ErlNifEnv *msg_env, ERL_NIF_TERM msg)
+{
+
+ ErtsSchedulerData *esdp = erts_get_scheduler_data();
+ int scheduler = esdp ? esdp->no : 0;
+ Port *prt;
+
+ if (scheduler == 0 || !env)
+ return 0;
+
+ prt = erts_port_lookup(to_port->port_id,
+ (erts_port_synchronous_ops
+ ? ERTS_PORT_SFLGS_INVALID_DRIVER_LOOKUP
+ : ERTS_PORT_SFLGS_INVALID_LOOKUP));
+
+ if (!prt)
+ return 0;
+
+ if (IS_TRACED_FL(prt, F_TRACE_RECEIVE))
+ trace_port_receive(prt, env->proc->common.id, am_command, msg);
+
+ return erts_port_output_async(prt, env->proc->common.id, msg);
+}
+
ERL_NIF_TERM enif_make_copy(ErlNifEnv* dst_env, ERL_NIF_TERM src_term)
{
Uint sz;
@@ -404,12 +608,28 @@ static int is_offheap(const ErlOffHeap* oh)
ErlNifPid* enif_self(ErlNifEnv* caller_env, ErlNifPid* pid)
{
+ if (caller_env->proc->common.id == ERTS_INVALID_PID)
+ return NULL;
pid->pid = caller_env->proc->common.id;
return pid;
}
+
int enif_get_local_pid(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifPid* pid)
{
- return is_internal_pid(term) ? (pid->pid=term, 1) : 0;
+ if (is_internal_pid(term)) {
+ pid->pid=term;
+ return 1;
+ }
+ return 0;
+}
+
+int enif_get_local_port(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifPort* port)
+{
+ if (is_internal_port(term)) {
+ port->port_id=term;
+ return 1;
+ }
+ return 0;
}
int enif_is_atom(ErlNifEnv* env, ERL_NIF_TERM term)
@@ -622,6 +842,68 @@ unsigned char* enif_make_new_binary(ErlNifEnv* env, size_t size,
return binary_bytes(*termp);
}
+int enif_term_to_binary(ErlNifEnv *dst_env, ERL_NIF_TERM term,
+ ErlNifBinary *bin)
+{
+ Sint size;
+ byte *bp;
+ Binary* refbin;
+
+ size = erts_encode_ext_size(term);
+ if (!enif_alloc_binary(size, bin))
+ return 0;
+
+ refbin = bin->ref_bin;
+
+ bp = bin->data;
+
+ erts_encode_ext(term, &bp);
+
+ bin->size = bp - bin->data;
+ refbin->orig_size = bin->size;
+
+ ASSERT(bin->data + bin->size == bp);
+
+ return 1;
+}
+
+size_t enif_binary_to_term(ErlNifEnv *dst_env,
+ const unsigned char* data,
+ size_t data_sz,
+ ERL_NIF_TERM *term,
+ ErlNifBinaryToTerm opts)
+{
+ Sint size;
+ ErtsHeapFactory factory;
+ byte *bp = (byte*) data;
+
+ ERTS_CT_ASSERT(ERL_NIF_BIN2TERM_SAFE == ERTS_DIST_EXT_BTT_SAFE);
+
+ if (opts & ~ERL_NIF_BIN2TERM_SAFE) {
+ return 0;
+ }
+ if ((size = erts_decode_ext_size(bp, data_sz)) < 0)
+ return 0;
+
+ if (size > 0) {
+ flush_env(dst_env);
+ erts_factory_proc_prealloc_init(&factory, dst_env->proc, size);
+ } else {
+ erts_factory_dummy_init(&factory);
+ }
+
+ *term = erts_decode_ext(&factory, &bp, (Uint32)opts);
+
+ if (is_non_value(*term)) {
+ return 0;
+ }
+ erts_factory_close(&factory);
+ cache_env(dst_env);
+
+ ASSERT(bp > data);
+ return bp - data;
+}
+
int enif_is_identical(Eterm lhs, Eterm rhs)
{
return EQ(lhs,rhs);
@@ -1158,6 +1440,103 @@ int enif_make_reverse_list(ErlNifEnv* env, ERL_NIF_TERM term, ERL_NIF_TERM *list
return 1;
}
+int enif_is_process_alive(ErlNifEnv* env, ErlNifPid *proc)
+{
+ ErtsProcLocks rp_locks = 0; /* We don't need any locks,
+ just to check if it is alive */
+ Eterm target = proc->pid;
+ Process* rp;
+ Process* c_p;
+ int scheduler = erts_get_scheduler_id() != 0;
+
+ if (env != NULL) {
+ c_p = env->proc;
+ if (target == c_p->common.id) {
+ /* We are alive! */
+ return 1;
+ }
+ }
+ else {
+#ifdef ERTS_SMP
+ c_p = NULL;
+#else
+ erts_exit(ERTS_ABORT_EXIT,"enif_is_process_alive: "
+ "env==NULL on non-SMP VM");
+#endif
+ }
+
+ rp = (scheduler
+ ? erts_proc_lookup(target)
+ : erts_pid2proc_opt(c_p, ERTS_PROC_LOCK_MAIN,
+ target, rp_locks, ERTS_P2P_FLG_INC_REFC));
+ if (rp == NULL) {
+ ASSERT(env == NULL || target != c_p->common.id);
+ return 0;
+ } else {
+ if (!scheduler)
+ erts_proc_dec_refc(rp);
+ return 1;
+ }
+}
+
+int enif_is_port_alive(ErlNifEnv *env, ErlNifPort *port)
+{
+ /* only allowed if called from scheduler */
+ if (erts_get_scheduler_id() == 0)
+ erts_exit(ERTS_ABORT_EXIT,"enif_is_port_alive: called from non-scheduler");
+
+ return erts_port_lookup(
+ port->port_id,
+ (erts_port_synchronous_ops
+ ? ERTS_PORT_SFLGS_INVALID_DRIVER_LOOKUP
+ : ERTS_PORT_SFLGS_INVALID_LOOKUP)) != NULL;
+}
+
+ERL_NIF_TERM
+enif_now_time(ErlNifEnv *env)
+{
+ Uint mega, sec, micro;
+ Eterm *hp;
+ get_now(&mega, &sec, &micro);
+ hp = alloc_heap(env, 4);
+ return TUPLE3(hp, make_small(mega), make_small(sec), make_small(micro));
+}
+
+ERL_NIF_TERM
+enif_cpu_time(ErlNifEnv *env)
+{
+#ifdef HAVE_ERTS_NOW_CPU
+ Uint mega, sec, micro;
+ Eterm *hp;
+ erts_get_now_cpu(&mega, &sec, &micro);
+ hp = alloc_heap(env, 4);
+ return TUPLE3(hp, make_small(mega), make_small(sec), make_small(micro));
+#else
+ return enif_make_badarg(env);
+#endif
+}
+
+ERL_NIF_TERM
+enif_make_unique_integer(ErlNifEnv *env, ErlNifUniqueInteger properties)
+{
+ int monotonic = properties & ERL_NIF_UNIQUE_MONOTONIC;
+ int positive = properties & ERL_NIF_UNIQUE_POSITIVE;
+ Eterm *hp;
+ Uint hsz;
+
+ if (monotonic) {
+ Sint64 raw_unique = erts_raw_get_unique_monotonic_integer();
+ hsz = erts_raw_unique_monotonic_integer_heap_size(raw_unique, positive);
+ hp = alloc_heap(env, hsz);
+ return erts_raw_make_unique_monotonic_integer_value(&hp, raw_unique, positive);
+ } else {
+ Uint64 raw_unique[ERTS_UNIQUE_INT_RAW_VALUES];
+ erts_raw_get_unique_integer(raw_unique);
+ hsz = erts_raw_unique_integer_heap_size(raw_unique, positive);
+ hp = alloc_heap(env, hsz);
+ return erts_raw_make_unique_integer(&hp, raw_unique, positive);
+ }
+}
ErlNifMutex* enif_mutex_create(char *name) { return erl_drv_mutex_create(name); }
void enif_mutex_destroy(ErlNifMutex *mtx) { erl_drv_mutex_destroy(mtx); }
@@ -1284,10 +1663,10 @@ static void close_lib(struct erl_module_nif* lib)
ASSERT(erts_refc_read(&lib->rt_dtor_cnt,0) == 0);
if (lib->entry != NULL && lib->entry->unload != NULL) {
- ErlNifEnv env;
- pre_nif_noproc(&env, lib);
- lib->entry->unload(&env, lib->priv_data);
- post_nif_noproc(&env);
+ struct enif_msg_environment_t msg_env;
+ pre_nif_noproc(&msg_env, lib, NULL);
+ lib->entry->unload(&msg_env.env, lib->priv_data);
+ post_nif_noproc(&msg_env);
}
if (!erts_is_static_nif(lib->handle))
erts_sys_ddll_close(lib->handle);
@@ -1433,10 +1812,10 @@ static void nif_resource_dtor(Binary* bin)
ASSERT(ERTS_MAGIC_BIN_DESTRUCTOR(bin) == &nif_resource_dtor);
if (type->dtor != NULL) {
- ErlNifEnv env;
- pre_nif_noproc(&env, type->owner);
- type->dtor(&env,resource->data);
- post_nif_noproc(&env);
+ struct enif_msg_environment_t msg_env;
+ pre_nif_noproc(&msg_env, type->owner, NULL);
+ type->dtor(&msg_env.env, resource->data);
+ post_nif_noproc(&msg_env);
}
if (erts_refc_dectest(&type->refc, 0) == 0) {
ASSERT(type->next == NULL);
@@ -1653,7 +2032,7 @@ allocate_nif_sched_data(Process* proc, int argc)
ep->exp.addressv[i] = &ep->exp.code[3];
}
ep->exp.code[3] = (BeamInstr) em_call_nif;
- (void) ERTS_PROC_SET_NIF_TRAP_EXPORT(proc, ERTS_PROC_LOCK_MAIN, ep);
+ (void) ERTS_PROC_SET_NIF_TRAP_EXPORT(proc, ep);
return ep;
}
@@ -2064,14 +2443,13 @@ int enif_make_map_remove(ErlNifEnv* env,
Eterm key,
Eterm *map_out)
{
- int res;
if (!is_map(map_in)) {
return 0;
}
flush_env(env);
- res = erts_maps_remove(env->proc, key, map_in, map_out);
+ (void) erts_maps_take(env->proc, key, map_in, map_out, NULL);
cache_env(env);
- return res;
+ return 1;
}
int enif_map_iterator_create(ErlNifEnv *env,
@@ -2402,7 +2780,7 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
ErlNifEntry* entry = NULL;
ErlNifEnv env;
int i, err, encoding;
- Module* mod;
+ Module* module_p;
Eterm mod_atom;
const Atom* mod_atomp;
Eterm f_atom;
@@ -2412,6 +2790,8 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
int veto;
struct erl_module_nif* lib = NULL;
int reload_warning = 0;
+ struct erl_module_instance* this_mi;
+ struct erl_module_instance* prev_mi;
encoding = erts_get_native_filename_encoding();
if (encoding == ERL_FILENAME_WIN_WCHAR) {
@@ -2445,21 +2825,29 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
ASSERT(caller != NULL);
mod_atom = caller[0];
ASSERT(is_atom(mod_atom));
- mod=erts_get_module(mod_atom, erts_active_code_ix());
- ASSERT(mod != NULL);
+ module_p = erts_get_module(mod_atom, erts_active_code_ix());
+ ASSERT(module_p != NULL);
mod_atomp = atom_tab(atom_val(mod_atom));
init_func = erts_static_nif_get_nif_init((char*)mod_atomp->name, mod_atomp->len);
if (init_func != NULL)
handle = init_func;
- if (!in_area(caller, mod->curr.code_hdr, mod->curr.code_length)) {
- ASSERT(in_area(caller, mod->old.code_hdr, mod->old.code_length));
+ if (in_area(caller, module_p->old.code_hdr, module_p->old.code_length)) {
+ if (module_p->old.code_hdr->on_load_function_ptr) {
+ this_mi = &module_p->old;
+ prev_mi = &module_p->curr;
+ } else {
+ ret = load_nif_error(BIF_P, "old_code", "Calling load_nif from old "
+ "module '%T' not allowed", mod_atom);
+ goto error;
+ }
+ } else {
+ this_mi = &module_p->curr;
+ prev_mi = &module_p->old;
+ }
- ret = load_nif_error(BIF_P, "old_code", "Calling load_nif from old "
- "module '%T' not allowed", mod_atom);
- }
- else if (init_func == NULL &&
+ if (init_func == NULL &&
(err=erts_sys_ddll_open(lib_name, &handle, &errdesc)) != ERL_DE_NO_ERROR) {
const char slogan[] = "Failed to load NIF library";
if (strstr(errdesc.str, lib_name) != NULL) {
@@ -2508,7 +2896,7 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
for (i=0; i < entry->num_of_funcs && ret==am_ok; i++) {
BeamInstr** code_pp;
if (!erts_atom_get(f->name, sys_strlen(f->name), &f_atom, ERTS_ATOM_ENC_LATIN1)
- || (code_pp = get_func_pp(mod->curr.code_hdr, f_atom, f->arity))==NULL) {
+ || (code_pp = get_func_pp(this_mi->code_hdr, f_atom, f->arity))==NULL) {
ret = load_nif_error(BIF_P,bad_lib,"Function not found %T:%s/%u",
mod_atom, f->name, f->arity);
}
@@ -2559,9 +2947,9 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
erts_refc_init(&lib->rt_cnt, 0);
erts_refc_init(&lib->rt_dtor_cnt, 0);
ASSERT(opened_rt_list == NULL);
- lib->mod = mod;
+ lib->mod = module_p;
env.mod_nif = lib;
- if (mod->curr.nif != NULL) { /*************** Reload ******************/
+ if (this_mi->nif != NULL) { /*************** Reload ******************/
/*
* Repeated load_nif calls from same Erlang module instance ("reload")
* is deprecated and was only ment as a development feature not to
@@ -2569,16 +2957,16 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
*/
int k, old_incr = 0;
ErlNifFunc* old_func;
- lib->priv_data = mod->curr.nif->priv_data;
+ lib->priv_data = this_mi->nif->priv_data;
- ASSERT(mod->curr.nif->entry != NULL);
+ ASSERT(this_mi->nif->entry != NULL);
if (entry->reload == NULL) {
ret = load_nif_error(BIF_P,reload,"Reload not supported by this NIF library.");
goto error;
}
/* Check that no NIF is removed */
- old_func = mod->curr.nif->entry->funcs;
- for (k=0; k < mod->curr.nif->entry->num_of_funcs; k++) {
+ old_func = this_mi->nif->entry->funcs;
+ for (k=0; k < this_mi->nif->entry->num_of_funcs; k++) {
int incr = 0;
ErlNifFunc* f = entry->funcs;
for (i=0; i < entry->num_of_funcs; i++) {
@@ -2594,9 +2982,9 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
old_func->name, old_func->arity);
goto error;
}
- old_func = next_func(mod->curr.nif->entry, &old_incr, old_func);
+ old_func = next_func(this_mi->nif->entry, &old_incr, old_func);
}
- erts_pre_nif(&env, BIF_P, lib);
+ erts_pre_nif(&env, BIF_P, lib, NULL);
veto = entry->reload(&env, &lib->priv_data, BIF_ARG_2);
erts_post_nif(&env);
if (veto) {
@@ -2604,31 +2992,31 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
}
else {
commit_opened_resource_types(lib);
- mod->curr.nif->entry = NULL; /* to prevent 'unload' callback */
- erts_unload_nif(mod->curr.nif);
+ this_mi->nif->entry = NULL; /* to prevent 'unload' callback */
+ erts_unload_nif(this_mi->nif);
reload_warning = 1;
}
}
else {
lib->priv_data = NULL;
- if (mod->old.nif != NULL) { /**************** Upgrade ***************/
- void* prev_old_data = mod->old.nif->priv_data;
+ if (prev_mi->nif != NULL) { /**************** Upgrade ***************/
+ void* prev_old_data = prev_mi->nif->priv_data;
if (entry->upgrade == NULL) {
ret = load_nif_error(BIF_P, upgrade, "Upgrade not supported by this NIF library.");
goto error;
}
- erts_pre_nif(&env, BIF_P, lib);
- veto = entry->upgrade(&env, &lib->priv_data, &mod->old.nif->priv_data, BIF_ARG_2);
+ erts_pre_nif(&env, BIF_P, lib, NULL);
+ veto = entry->upgrade(&env, &lib->priv_data, &prev_mi->nif->priv_data, BIF_ARG_2);
erts_post_nif(&env);
if (veto) {
- mod->old.nif->priv_data = prev_old_data;
+ prev_mi->nif->priv_data = prev_old_data;
ret = load_nif_error(BIF_P, upgrade, "Library upgrade-call unsuccessful.");
}
else
commit_opened_resource_types(lib);
}
else if (entry->load != NULL) { /********* Initial load ***********/
- erts_pre_nif(&env, BIF_P, lib);
+ erts_pre_nif(&env, BIF_P, lib, NULL);
veto = entry->load(&env, &lib->priv_data, BIF_ARG_2);
erts_post_nif(&env);
if (veto) {
@@ -2646,12 +3034,12 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
int incr = 0;
ErlNifFunc* f = entry->funcs;
- mod->curr.nif = lib;
+ this_mi->nif = lib;
for (i=0; i < entry->num_of_funcs; i++)
{
BeamInstr* code_ptr;
erts_atom_get(f->name, sys_strlen(f->name), &f_atom, ERTS_ATOM_ENC_LATIN1);
- code_ptr = *get_func_pp(mod->curr.code_hdr, f_atom, f->arity);
+ code_ptr = *get_func_pp(this_mi->code_hdr, f_atom, f->arity);
if (code_ptr[1] == 0) {
code_ptr[5+0] = (BeamInstr) BeamOp(op_call_nif);
@@ -2715,6 +3103,9 @@ erts_unload_nif(struct erl_module_nif* lib)
ASSERT(erts_smp_thr_progress_is_blocking());
ASSERT(lib != NULL);
ASSERT(lib->mod != NULL);
+
+ erts_tracer_nif_clear();
+
for (rt = resource_type_list.next;
rt != &resource_type_list;
rt = next) {
@@ -2757,6 +3148,76 @@ void erl_nif_init()
resource_type_list.owner = NULL;
resource_type_list.module = THE_NON_VALUE;
resource_type_list.name = THE_NON_VALUE;
+
+}
+
+int erts_nif_get_funcs(struct erl_module_nif* mod,
+ ErlNifFunc **funcs)
+{
+ *funcs = mod->entry->funcs;
+ return mod->entry->num_of_funcs;
+}
+
+Eterm erts_nif_call_function(Process *p, Process *tracee,
+ struct erl_module_nif* mod,
+ ErlNifFunc *fun, int argc, Eterm *argv)
+{
+ Eterm nif_result;
+#ifdef DEBUG
+ /* Verify that function is part of this module */
+ int i;
+ for (i = 0; i < mod->entry->num_of_funcs; i++)
+ if (fun == &(mod->entry->funcs[i]))
+ break;
+ ASSERT(i < mod->entry->num_of_funcs);
+ if (p)
+ ERTS_SMP_LC_ASSERT(erts_proc_lc_my_proc_locks(p) & ERTS_PROC_LOCK_MAIN
+ || erts_smp_thr_progress_is_blocking());
+#endif
+ if (p) {
+ /* This is almost a normal nif call like in beam_emu,
+ except that any heap fragment created in the nif will be
+ discarded without checking if anything in it is live.
+ This is because we cannot do a GC here as we don't know
+ the number of live registers that have to be preserved.
+ This means that any heap part of the returned term may
+ not be used outside this function. */
+ struct enif_environment_t env;
+ ErlHeapFragment *orig_hf = MBUF(p);
+ ErlOffHeap orig_oh = MSO(p);
+ ASSERT(is_internal_pid(p->common.id));
+ MBUF(p) = NULL;
+ clear_offheap(&MSO(p));
+
+ erts_pre_nif(&env, p, mod, tracee);
+ nif_result = (*fun->fptr)(&env, argc, argv);
+ if (env.exception_thrown)
+ nif_result = THE_NON_VALUE;
+ erts_post_nif(&env);
+
+ /* Free any offheap and heap fragments created in nif */
+ if (MSO(p).first) {
+ erts_cleanup_offheap(&MSO(p));
+ clear_offheap(&MSO(p));
+ }
+ if (MBUF(p))
+ free_message_buffer(MBUF(p));
+
+ /* restore original heap fragment list */
+ MBUF(p) = orig_hf;
+ MSO(p) = orig_oh;
+ } else {
+ /* Nif call was done without a process context,
+ so we create a phony one. */
+ struct enif_msg_environment_t msg_env;
+ pre_nif_noproc(&msg_env, mod, tracee);
+ nif_result = (*fun->fptr)(&msg_env.env, argc, argv);
+ if (msg_env.env.exception_thrown)
+ nif_result = THE_NON_VALUE;
+ post_nif_noproc(&msg_env);
+ }
+
+ return nif_result;
}
#ifdef USE_VM_PROBES
diff --git a/erts/emulator/beam/erl_nif.h b/erts/emulator/beam/erl_nif.h
index c9c8b1d0af..3964f7f679 100644
--- a/erts/emulator/beam/erl_nif.h
+++ b/erts/emulator/beam/erl_nif.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -87,16 +87,16 @@ typedef ErlNifSInt64 ErlNifTime;
#define ERL_NIF_TIME_ERROR ((ErlNifSInt64) ERTS_NAPI_TIME_ERROR__)
typedef enum {
- ERL_NIF_SEC = ERTS_NAPI_SEC__,
- ERL_NIF_MSEC = ERTS_NAPI_MSEC__,
- ERL_NIF_USEC = ERTS_NAPI_USEC__,
- ERL_NIF_NSEC = ERTS_NAPI_NSEC__
+ ERL_NIF_SEC = ERTS_NAPI_SEC__,
+ ERL_NIF_MSEC = ERTS_NAPI_MSEC__,
+ ERL_NIF_USEC = ERTS_NAPI_USEC__,
+ ERL_NIF_NSEC = ERTS_NAPI_NSEC__
} ErlNifTimeUnit;
struct enif_environment_t;
typedef struct enif_environment_t ErlNifEnv;
-typedef struct
+typedef struct enif_func_t
{
const char* name;
unsigned arity;
@@ -150,7 +150,12 @@ typedef enum
typedef struct
{
ERL_NIF_TERM pid; /* internal, may change */
-}ErlNifPid;
+} ErlNifPid;
+
+typedef struct
+{
+ ERL_NIF_TERM port_id; /* internal, may change */
+}ErlNifPort;
typedef ErlDrvSysInfo ErlNifSysInfo;
@@ -197,6 +202,15 @@ typedef enum {
ERL_NIF_MAP_ITERATOR_TAIL = ERL_NIF_MAP_ITERATOR_LAST
} ErlNifMapIteratorEntry;
+typedef enum {
+ ERL_NIF_UNIQUE_POSITIVE = (1 << 0),
+ ERL_NIF_UNIQUE_MONOTONIC = (1 << 1)
+} ErlNifUniqueInteger;
+
+typedef enum {
+ ERL_NIF_BIN2TERM_SAFE = 0x20000000
+} ErlNifBinaryToTerm;
+
#if (defined(__WIN32__) || defined(_WIN32) || defined(_WIN32_))
# define ERL_NIF_API_FUNC_DECL(RET_TYPE, NAME, ARGS) RET_TYPE (*NAME) ARGS
typedef struct {
diff --git a/erts/emulator/beam/erl_nif_api_funcs.h b/erts/emulator/beam/erl_nif_api_funcs.h
index 1448a508a2..a5acd86551 100644
--- a/erts/emulator/beam/erl_nif_api_funcs.h
+++ b/erts/emulator/beam/erl_nif_api_funcs.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -163,6 +163,15 @@ ERL_NIF_API_FUNC_DECL(int,enif_getenv,(const char* key, char* value, size_t* val
ERL_NIF_API_FUNC_DECL(ErlNifTime, enif_monotonic_time, (ErlNifTimeUnit));
ERL_NIF_API_FUNC_DECL(ErlNifTime, enif_time_offset, (ErlNifTimeUnit));
ERL_NIF_API_FUNC_DECL(ErlNifTime, enif_convert_time_unit, (ErlNifTime, ErlNifTimeUnit, ErlNifTimeUnit));
+ERL_NIF_API_FUNC_DECL(ERL_NIF_TERM, enif_now_time, (ErlNifEnv *env));
+ERL_NIF_API_FUNC_DECL(ERL_NIF_TERM, enif_cpu_time, (ErlNifEnv *env));
+ERL_NIF_API_FUNC_DECL(ERL_NIF_TERM, enif_make_unique_integer, (ErlNifEnv *env, ErlNifUniqueInteger properties));
+ERL_NIF_API_FUNC_DECL(int, enif_is_process_alive, (ErlNifEnv *env, ErlNifPid *pid));
+ERL_NIF_API_FUNC_DECL(int, enif_is_port_alive, (ErlNifEnv *env, ErlNifPort *port_id));
+ERL_NIF_API_FUNC_DECL(int, enif_get_local_port, (ErlNifEnv* env, ERL_NIF_TERM, ErlNifPort* port_id));
+ERL_NIF_API_FUNC_DECL(int, enif_term_to_binary, (ErlNifEnv *env, ERL_NIF_TERM term, ErlNifBinary *bin));
+ERL_NIF_API_FUNC_DECL(size_t, enif_binary_to_term, (ErlNifEnv *env, const unsigned char* data, size_t sz, ERL_NIF_TERM *term, unsigned int opts));
+ERL_NIF_API_FUNC_DECL(int, enif_port_command, (ErlNifEnv *env, const ErlNifPort* to_port, ErlNifEnv *msg_env, ERL_NIF_TERM msg));
/*
** ADD NEW ENTRIES HERE (before this comment) !!!
@@ -318,6 +327,15 @@ ERL_NIF_API_FUNC_DECL(int,enif_is_on_dirty_scheduler,(ErlNifEnv*));
# define enif_monotonic_time ERL_NIF_API_FUNC_MACRO(enif_monotonic_time)
# define enif_time_offset ERL_NIF_API_FUNC_MACRO(enif_time_offset)
# define enif_convert_time_unit ERL_NIF_API_FUNC_MACRO(enif_convert_time_unit)
+# define enif_now_time ERL_NIF_API_FUNC_MACRO(enif_now_time)
+# define enif_cpu_time ERL_NIF_API_FUNC_MACRO(enif_cpu_time)
+# define enif_make_unique_integer ERL_NIF_API_FUNC_MACRO(enif_make_unique_integer)
+# define enif_is_process_alive ERL_NIF_API_FUNC_MACRO(enif_is_process_alive)
+# define enif_is_port_alive ERL_NIF_API_FUNC_MACRO(enif_is_port_alive)
+# define enif_get_local_port ERL_NIF_API_FUNC_MACRO(enif_get_local_port)
+# define enif_term_to_binary ERL_NIF_API_FUNC_MACRO(enif_term_to_binary)
+# define enif_binary_to_term ERL_NIF_API_FUNC_MACRO(enif_binary_to_term)
+# define enif_port_command ERL_NIF_API_FUNC_MACRO(enif_port_command)
/*
** ADD NEW ENTRIES HERE (before this comment)
diff --git a/erts/emulator/beam/erl_node_container_utils.h b/erts/emulator/beam/erl_node_container_utils.h
index b6a3531e28..0c76c6fe7d 100644
--- a/erts/emulator/beam/erl_node_container_utils.h
+++ b/erts/emulator/beam/erl_node_container_utils.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_node_tables.c b/erts/emulator/beam/erl_node_tables.c
index 8617f42d7b..646f786651 100644
--- a/erts/emulator/beam/erl_node_tables.c
+++ b/erts/emulator/beam/erl_node_tables.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -497,31 +497,7 @@ node_table_hash(void *venp)
Uint32 cre = ((ErlNode *) venp)->creation;
HashValue h = atom_tab(atom_val(((ErlNode *) venp)->sysname))->slot.bucket.hvalue;
- h *= PRIME0;
- h += cre & 0xff;
-
-#if MAX_CREATION >= (1 << 8)
- h *= PRIME1;
- h += (cre >> 8) & 0xff;
-#endif
-
-#if MAX_CREATION >= (1 << 16)
- h *= PRIME2;
- h += (cre >> 16) & 0xff;
-#endif
-
-#if MAX_CREATION >= (1 << 24)
- h *= PRIME3;
- h += (cre >> 24) & 0xff;
-#endif
-
-#if 0
-/* XXX Problems in older versions of GCC */
- #if MAX_CREATION >= (1UL << 32)
- #error "MAX_CREATION larger than size of expected creation storage (Uint32)"
- #endif
-#endif
- return h;
+ return (h + cre) * PRIME0;
}
static int
@@ -599,7 +575,7 @@ erts_node_table_info(int to, void *to_arg)
}
-ErlNode *erts_find_or_insert_node(Eterm sysname, Uint creation)
+ErlNode *erts_find_or_insert_node(Eterm sysname, Uint32 creation)
{
ErlNode *res;
ErlNode ne;
diff --git a/erts/emulator/beam/erl_node_tables.h b/erts/emulator/beam/erl_node_tables.h
index fb2f2a5407..7a4434acbf 100644
--- a/erts/emulator/beam/erl_node_tables.h
+++ b/erts/emulator/beam/erl_node_tables.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -182,7 +182,7 @@ Uint erts_dist_table_size(void);
void erts_dist_table_info(int, void *);
void erts_set_dist_entry_not_connected(DistEntry *);
void erts_set_dist_entry_connected(DistEntry *, Eterm, Uint);
-ErlNode *erts_find_or_insert_node(Eterm, Uint);
+ErlNode *erts_find_or_insert_node(Eterm, Uint32);
void erts_schedule_delete_node(ErlNode *);
void erts_set_this_node(Eterm, Uint);
Uint erts_node_table_size(void);
diff --git a/erts/emulator/beam/erl_port.h b/erts/emulator/beam/erl_port.h
index fa97707a87..c2588e718d 100644
--- a/erts/emulator/beam/erl_port.h
+++ b/erts/emulator/beam/erl_port.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2012-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2012-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -185,7 +185,7 @@ struct _erl_drv_port {
int control_flags; /* Flags for port_control() */
ErlDrvPDL port_data_lock;
- ErtsPrtSD *psd; /* Port specific data */
+ erts_smp_atomic_t psd; /* Port specific data */
int reds; /* Only used while executing driver callbacks */
struct {
@@ -252,22 +252,51 @@ ERTS_GLB_INLINE void *erts_prtsd_set(Port *p, int ix, void *new);
ERTS_GLB_INLINE void *
erts_prtsd_get(Port *prt, int ix)
{
- return prt->psd ? prt->psd->data[ix] : NULL;
+ ErtsPrtSD *psd = (ErtsPrtSD *) erts_smp_atomic_read_nob(&prt->psd);
+ if (!psd)
+ return NULL;
+ ERTS_SMP_DATA_DEPENDENCY_READ_MEMORY_BARRIER;
+ return psd->data[ix];
}
ERTS_GLB_INLINE void *
erts_prtsd_set(Port *prt, int ix, void *data)
{
- if (prt->psd) {
- void *old = prt->psd->data[ix];
- prt->psd->data[ix] = data;
+ ErtsPrtSD *psd, *new_psd;
+ void *old;
+ int i;
+
+ psd = (ErtsPrtSD *) erts_smp_atomic_read_nob(&prt->psd);
+
+ if (psd) {
+#ifdef ERTS_SMP
+#ifdef ETHR_ORDERED_READ_DEPEND
+ ETHR_MEMBAR(ETHR_LoadStore|ETHR_StoreStore);
+#else
+ ETHR_MEMBAR(ETHR_LoadLoad|ETHR_LoadStore|ETHR_StoreStore);
+#endif
+#endif
+ old = psd->data[ix];
+ psd->data[ix] = data;
return old;
}
- else {
- prt->psd = erts_alloc(ERTS_ALC_T_PRTSD, sizeof(ErtsPrtSD));
- prt->psd->data[ix] = data;
+
+ if (!data)
return NULL;
- }
+
+ new_psd = erts_alloc(ERTS_ALC_T_PRTSD, sizeof(ErtsPrtSD));
+ for (i = 0; i < ERTS_PRTSD_SIZE; i++)
+ new_psd->data[i] = NULL;
+ psd = (ErtsPrtSD *) erts_smp_atomic_cmpxchg_mb(&prt->psd,
+ (erts_aint_t) new_psd,
+ (erts_aint_t) NULL);
+ if (psd)
+ erts_free(ERTS_ALC_T_PRTSD, new_psd);
+ else
+ psd = new_psd;
+ old = psd->data[ix];
+ psd->data[ix] = data;
+ return old;
}
#endif
@@ -915,7 +944,7 @@ erts_schedule_proc2port_signal(Process *,
ErtsPortTaskHandle *,
ErtsProc2PortSigCallback);
-int erts_deliver_port_exit(Port *, Eterm, Eterm, int);
+int erts_deliver_port_exit(Port *, Eterm, Eterm, int, int);
/*
* Port signal flags
@@ -949,6 +978,8 @@ ErtsPortOpResult erts_port_control(Process *, Port *, unsigned int, Eterm, Eterm
ErtsPortOpResult erts_port_call(Process *, Port *, unsigned int, Eterm, Eterm *);
ErtsPortOpResult erts_port_info(Process *, Port *, Eterm, Eterm *);
+int erts_port_output_async(Port *, Eterm, Eterm);
+
/*
* Signals from ports to ports. Used by sys drivers.
*/
diff --git a/erts/emulator/beam/erl_port_task.c b/erts/emulator/beam/erl_port_task.c
index e85395e062..3102e44c11 100644
--- a/erts/emulator/beam/erl_port_task.c
+++ b/erts/emulator/beam/erl_port_task.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,6 +35,7 @@
#include "dist.h"
#include "erl_check_io.h"
#include "dtrace-wrapper.h"
+#include "lttng-wrapper.h"
#include <stdarg.h>
/*
@@ -69,6 +70,18 @@ static void chk_task_queues(Port *pp, ErtsPortTask *execq, int processing_busy_q
#else
#define DTRACE_DRIVER(PROBE_NAME, PP) do {} while(0)
#endif
+#ifdef USE_LTTNG_VM_TRACEPOINTS
+#define LTTNG_DRIVER(TRACEPOINT, PP) \
+ if (LTTNG_ENABLED(TRACEPOINT)) { \
+ lttng_decl_portbuf(port_str); \
+ lttng_decl_procbuf(proc_str); \
+ lttng_pid_to_str(ERTS_PORT_GET_CONNECTED(PP), proc_str); \
+ lttng_port_to_str((PP), port_str); \
+ LTTNG3(TRACEPOINT, proc_str, port_str, (PP)->name); \
+ }
+#else
+#define LTTNG_DRIVER(TRACEPOINT, PP) do {} while(0)
+#endif
#define ERTS_SMP_LC_VERIFY_RQ(RQ, PP) \
do { \
@@ -180,10 +193,9 @@ p2p_sig_data_to_task(ErtsProc2PortSigData *sigdp)
return ptp;
}
-ErtsProc2PortSigData *
-erts_port_task_alloc_p2p_sig_data(void)
+static ERTS_INLINE ErtsProc2PortSigData *
+p2p_sig_data_init(ErtsPortTask *ptp)
{
- ErtsPortTask *ptp = port_task_alloc();
ptp->type = ERTS_PORT_TASK_PROC_SIG;
ptp->u.alive.flags = ERTS_PT_FLG_SIG_DEP;
@@ -194,6 +206,31 @@ erts_port_task_alloc_p2p_sig_data(void)
return &ptp->u.alive.td.psig.data;
}
+ErtsProc2PortSigData *
+erts_port_task_alloc_p2p_sig_data(void)
+{
+ ErtsPortTask *ptp = port_task_alloc();
+
+ return p2p_sig_data_init(ptp);
+}
+
+ErtsProc2PortSigData *
+erts_port_task_alloc_p2p_sig_data_extra(size_t extra, void **extra_ptr)
+{
+ ErtsPortTask *ptp = erts_alloc(ERTS_ALC_T_PORT_TASK,
+ sizeof(ErtsPortTask) + extra);
+
+ *extra_ptr = ptp+1;
+
+ return p2p_sig_data_init(ptp);
+}
+
+void
+erts_port_task_free_p2p_sig_data(ErtsProc2PortSigData *sigdp)
+{
+ schedule_port_task_free(p2p_sig_data_to_task(sigdp));
+}
+
static ERTS_INLINE Eterm
task_caller(ErtsPortTask *ptp)
{
@@ -1728,6 +1765,9 @@ erts_port_task_execute(ErtsRunQueue *runq, Port **curr_port_pp)
reds = ERTS_PORT_REDS_TIMEOUT;
if (!(state & ERTS_PORT_SFLGS_DEAD)) {
DTRACE_DRIVER(driver_timeout, pp);
+ LTTNG_DRIVER(driver_timeout, pp);
+ if (IS_TRACED_FL(pp, F_TRACE_RECEIVE))
+ trace_port(pp, am_receive, am_timeout);
(*pp->drv_ptr->timeout)((ErlDrvData) pp->drv_data);
}
}
@@ -1736,6 +1776,7 @@ erts_port_task_execute(ErtsRunQueue *runq, Port **curr_port_pp)
reds = ERTS_PORT_REDS_INPUT;
ASSERT((state & ERTS_PORT_SFLGS_DEAD) == 0);
DTRACE_DRIVER(driver_ready_input, pp);
+ LTTNG_DRIVER(driver_ready_input, pp);
/* NOTE some windows drivers use ->ready_input
for input and output */
(*pp->drv_ptr->ready_input)((ErlDrvData) pp->drv_data,
@@ -1747,6 +1788,7 @@ erts_port_task_execute(ErtsRunQueue *runq, Port **curr_port_pp)
reds = ERTS_PORT_REDS_OUTPUT;
ASSERT((state & ERTS_PORT_SFLGS_DEAD) == 0);
DTRACE_DRIVER(driver_ready_output, pp);
+ LTTNG_DRIVER(driver_ready_output, pp);
(*pp->drv_ptr->ready_output)((ErlDrvData) pp->drv_data,
ptp->u.alive.td.io.event);
reset_executed_io_task_handle(ptp);
@@ -1756,6 +1798,7 @@ erts_port_task_execute(ErtsRunQueue *runq, Port **curr_port_pp)
reds = ERTS_PORT_REDS_EVENT;
ASSERT((state & ERTS_PORT_SFLGS_DEAD) == 0);
DTRACE_DRIVER(driver_event, pp);
+ LTTNG_DRIVER(driver_event, pp);
(*pp->drv_ptr->event)((ErlDrvData) pp->drv_data,
ptp->u.alive.td.io.event,
ptp->u.alive.td.io.event_data);
diff --git a/erts/emulator/beam/erl_port_task.h b/erts/emulator/beam/erl_port_task.h
index 335f7a77d5..2a6bd165a3 100644
--- a/erts/emulator/beam/erl_port_task.h
+++ b/erts/emulator/beam/erl_port_task.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -269,6 +269,8 @@ int erts_port_task_schedule(Eterm,
void erts_port_task_free_port(Port *);
int erts_port_is_scheduled(Port *);
ErtsProc2PortSigData *erts_port_task_alloc_p2p_sig_data(void);
+ErtsProc2PortSigData *erts_port_task_alloc_p2p_sig_data_extra(size_t extra, void **extra_ptr);
+void erts_port_task_free_p2p_sig_data(ErtsProc2PortSigData *sigdp);
#ifdef ERTS_SMP
void erts_enqueue_port(ErtsRunQueue *rq, Port *pp);
diff --git a/erts/emulator/beam/erl_printf_term.c b/erts/emulator/beam/erl_printf_term.c
index 45ba4371dc..1a579704a8 100644
--- a/erts/emulator/beam/erl_printf_term.c
+++ b/erts/emulator/beam/erl_printf_term.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_printf_term.h b/erts/emulator/beam/erl_printf_term.h
index 4618457f27..8a30286fd8 100644
--- a/erts/emulator/beam/erl_printf_term.h
+++ b/erts/emulator/beam/erl_printf_term.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index a706ebf595..bc32f3f167 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,6 +43,7 @@
#include "erl_thr_queue.h"
#include "erl_async.h"
#include "dtrace-wrapper.h"
+#include "lttng-wrapper.h"
#include "erl_ptab.h"
#include "erl_bif_unique.h"
#define ERTS_WANT_TIMER_WHEEL_API
@@ -443,7 +444,8 @@ int erts_system_profile_ts_type = ERTS_TRACE_FLG_NOW_TIMESTAMP;
typedef enum {
ERTS_PSTT_GC, /* Garbage Collect */
ERTS_PSTT_CPC, /* Check Process Code */
- ERTS_PSTT_COHMQ /* Change off heap message queue */
+ ERTS_PSTT_COHMQ, /* Change off heap message queue */
+ ERTS_PSTT_FTMQ /* Flush trace msg queue */
} ErtsProcSysTaskType;
#define ERTS_MAX_PROC_SYS_TASK_ARGS 2
@@ -687,45 +689,36 @@ erts_pre_init_process(void)
= "DEBUG_WAIT_COMPLETED";
#ifdef ERTS_ENABLE_LOCK_CHECK
- {
- int ix;
- erts_psd_required_locks[ERTS_PSD_ERROR_HANDLER].get_locks
- = ERTS_PSD_ERROR_HANDLER_BUF_GET_LOCKS;
- erts_psd_required_locks[ERTS_PSD_ERROR_HANDLER].set_locks
- = ERTS_PSD_ERROR_HANDLER_BUF_SET_LOCKS;
+ erts_psd_required_locks[ERTS_PSD_ERROR_HANDLER].get_locks
+ = ERTS_PSD_ERROR_HANDLER_BUF_GET_LOCKS;
+ erts_psd_required_locks[ERTS_PSD_ERROR_HANDLER].set_locks
+ = ERTS_PSD_ERROR_HANDLER_BUF_SET_LOCKS;
- erts_psd_required_locks[ERTS_PSD_SAVED_CALLS_BUF].get_locks
- = ERTS_PSD_SAVED_CALLS_BUF_GET_LOCKS;
- erts_psd_required_locks[ERTS_PSD_SAVED_CALLS_BUF].set_locks
- = ERTS_PSD_SAVED_CALLS_BUF_SET_LOCKS;
+ erts_psd_required_locks[ERTS_PSD_SAVED_CALLS_BUF].get_locks
+ = ERTS_PSD_SAVED_CALLS_BUF_GET_LOCKS;
+ erts_psd_required_locks[ERTS_PSD_SAVED_CALLS_BUF].set_locks
+ = ERTS_PSD_SAVED_CALLS_BUF_SET_LOCKS;
- erts_psd_required_locks[ERTS_PSD_SCHED_ID].get_locks
- = ERTS_PSD_SCHED_ID_GET_LOCKS;
- erts_psd_required_locks[ERTS_PSD_SCHED_ID].set_locks
- = ERTS_PSD_SCHED_ID_SET_LOCKS;
+ erts_psd_required_locks[ERTS_PSD_SCHED_ID].get_locks
+ = ERTS_PSD_SCHED_ID_GET_LOCKS;
+ erts_psd_required_locks[ERTS_PSD_SCHED_ID].set_locks
+ = ERTS_PSD_SCHED_ID_SET_LOCKS;
- erts_psd_required_locks[ERTS_PSD_CALL_TIME_BP].get_locks
- = ERTS_PSD_CALL_TIME_BP_GET_LOCKS;
- erts_psd_required_locks[ERTS_PSD_CALL_TIME_BP].set_locks
- = ERTS_PSD_CALL_TIME_BP_SET_LOCKS;
+ erts_psd_required_locks[ERTS_PSD_CALL_TIME_BP].get_locks
+ = ERTS_PSD_CALL_TIME_BP_GET_LOCKS;
+ erts_psd_required_locks[ERTS_PSD_CALL_TIME_BP].set_locks
+ = ERTS_PSD_CALL_TIME_BP_SET_LOCKS;
- erts_psd_required_locks[ERTS_PSD_DELAYED_GC_TASK_QS].get_locks
- = ERTS_PSD_DELAYED_GC_TASK_QS_GET_LOCKS;
- erts_psd_required_locks[ERTS_PSD_DELAYED_GC_TASK_QS].set_locks
- = ERTS_PSD_DELAYED_GC_TASK_QS_SET_LOCKS;
+ erts_psd_required_locks[ERTS_PSD_DELAYED_GC_TASK_QS].get_locks
+ = ERTS_PSD_DELAYED_GC_TASK_QS_GET_LOCKS;
+ erts_psd_required_locks[ERTS_PSD_DELAYED_GC_TASK_QS].set_locks
+ = ERTS_PSD_DELAYED_GC_TASK_QS_SET_LOCKS;
- erts_psd_required_locks[ERTS_PSD_NIF_TRAP_EXPORT].get_locks
- = ERTS_PSD_NIF_TRAP_EXPORT_GET_LOCKS;
- erts_psd_required_locks[ERTS_PSD_NIF_TRAP_EXPORT].set_locks
- = ERTS_PSD_NIF_TRAP_EXPORT_SET_LOCKS;
-
- /* Check that we have locks for all entries */
- for (ix = 0; ix < ERTS_PSD_SIZE; ix++) {
- ERTS_SMP_LC_ASSERT(erts_psd_required_locks[ix].get_locks);
- ERTS_SMP_LC_ASSERT(erts_psd_required_locks[ix].set_locks);
- }
- }
+ erts_psd_required_locks[ERTS_PSD_NIF_TRAP_EXPORT].get_locks
+ = ERTS_PSD_NIF_TRAP_EXPORT_GET_LOCKS;
+ erts_psd_required_locks[ERTS_PSD_NIF_TRAP_EXPORT].set_locks
+ = ERTS_PSD_NIF_TRAP_EXPORT_SET_LOCKS;
#endif
}
@@ -1146,7 +1139,7 @@ reply_sched_wall_time(void *vswtrp)
hpp = &hp;
}
- erts_queue_message(rp, &rp_locks, mp, msg, NIL);
+ erts_queue_message(rp, &rp_locks, mp, msg);
if (swtrp->req_sched == esdp->no)
rp_locks &= ~ERTS_PROC_LOCK_MAIN;
@@ -1225,7 +1218,7 @@ reply_system_check(void *vscrp)
hpp = &hp;
msg = STORE_NC(hpp, ohp, scrp->ref);
- erts_queue_message(rp, &rp_locks, mp, msg, NIL);
+ erts_queue_message(rp, &rp_locks, mp, msg);
if (scrp->req_sched == esdp->no)
rp_locks &= ~ERTS_PROC_LOCK_MAIN;
@@ -1314,46 +1307,25 @@ erts_proclist_destroy(ErtsProcList *plp)
}
void *
-erts_psd_set_init(Process *p, ErtsProcLocks plocks, int ix, void *data)
+erts_psd_set_init(Process *p, int ix, void *data)
{
void *old;
- ErtsProcLocks xplocks;
- int refc = 0;
- ErtsPSD *psd = erts_alloc(ERTS_ALC_T_PSD, sizeof(ErtsPSD));
+ ErtsPSD *psd, *new_psd;
int i;
- for (i = 0; i < ERTS_PSD_SIZE; i++)
- psd->data[i] = NULL;
- ERTS_SMP_LC_ASSERT(plocks);
- ERTS_SMP_LC_ASSERT(plocks == erts_proc_lc_my_proc_locks(p));
+ new_psd = erts_alloc(ERTS_ALC_T_PSD, sizeof(ErtsPSD));
+ for (i = 0; i < ERTS_PSD_SIZE; i++)
+ new_psd->data[i] = NULL;
- xplocks = ERTS_PROC_LOCKS_ALL;
- xplocks &= ~plocks;
- if (xplocks && erts_smp_proc_trylock(p, xplocks) == EBUSY) {
- if (xplocks & ERTS_PROC_LOCK_MAIN) {
- erts_proc_inc_refc(p);
- erts_smp_proc_unlock(p, plocks);
- erts_smp_proc_lock(p, ERTS_PROC_LOCKS_ALL);
- refc = 1;
- }
- else {
- if (plocks & ERTS_PROC_LOCKS_ALL_MINOR)
- erts_smp_proc_unlock(p, plocks & ERTS_PROC_LOCKS_ALL_MINOR);
- erts_smp_proc_lock(p, ERTS_PROC_LOCKS_ALL_MINOR);
- }
- }
- if (!p->psd)
- p->psd = psd;
- if (xplocks)
- erts_smp_proc_unlock(p, xplocks);
- if (refc)
- erts_proc_dec_refc(p);
- ASSERT(p->psd);
- if (p->psd != psd)
- erts_free(ERTS_ALC_T_PSD, psd);
- old = p->psd->data[ix];
- p->psd->data[ix] = data;
- ERTS_SMP_LC_ASSERT(plocks == erts_proc_lc_my_proc_locks(p));
+ psd = (ErtsPSD *) erts_smp_atomic_cmpxchg_mb(&p->psd,
+ (erts_aint_t) new_psd,
+ (erts_aint_t) NULL);
+ if (psd)
+ erts_free(ERTS_ALC_T_PSD, new_psd);
+ else
+ psd = new_psd;
+ old = psd->data[ix];
+ psd->data[ix] = data;
return old;
}
@@ -2211,8 +2183,7 @@ setup_thr_debug_wait_completed(void *vproc)
if (debug_wait_completed_flags & ERTS_DEBUG_WAIT_COMPLETED_DEALLOCATIONS) {
erts_alloc_fix_alloc_shrink(awdp->sched_id, 0);
wait_flags |= (ERTS_SSI_AUX_WORK_DD
- | ERTS_SSI_AUX_WORK_DD_THR_PRGR
- | ERTS_SSI_AUX_WORK_THR_PRGR_LATER_OP);
+ | ERTS_SSI_AUX_WORK_DD_THR_PRGR);
#ifdef ERTS_SMP
aux_work_flags |= ERTS_SSI_AUX_WORK_DD;
#endif
@@ -2220,8 +2191,7 @@ setup_thr_debug_wait_completed(void *vproc)
if (debug_wait_completed_flags & ERTS_DEBUG_WAIT_COMPLETED_TIMER_CANCELLATIONS) {
wait_flags |= (ERTS_SSI_AUX_WORK_CNCLD_TMRS
- | ERTS_SSI_AUX_WORK_CNCLD_TMRS_THR_PRGR
- | ERTS_SSI_AUX_WORK_THR_PRGR_LATER_OP);
+ | ERTS_SSI_AUX_WORK_CNCLD_TMRS_THR_PRGR);
#ifdef ERTS_SMP
if (awdp->esdp && !ERTS_SCHEDULER_IS_DIRTY(awdp->esdp))
aux_work_flags |= ERTS_SSI_AUX_WORK_CNCLD_TMRS;
@@ -2235,26 +2205,42 @@ setup_thr_debug_wait_completed(void *vproc)
awdp->debug.wait_completed.arg = vproc;
}
-static void
-prep_setup_thr_debug_wait_completed(void *vproc)
+struct debug_lop {
+ ErtsThrPrgrLaterOp lop;
+ Process *proc;
+};
+
+static void later_thr_debug_wait_completed(void *vlop)
{
+ struct debug_lop *lop = vlop;
erts_aint32_t count = (erts_aint32_t) erts_no_schedulers;
#ifdef ERTS_SMP
count += 1; /* aux thread */
#endif
if (erts_atomic32_dec_read_mb(&debug_wait_completed_count) == count) {
- /* scheduler threads */
- erts_schedule_multi_misc_aux_work(0,
- erts_no_schedulers,
- setup_thr_debug_wait_completed,
- vproc);
+ /* scheduler threads */
+ erts_schedule_multi_misc_aux_work(0,
+ erts_no_schedulers,
+ setup_thr_debug_wait_completed,
+ lop->proc);
#ifdef ERTS_SMP
- /* aux_thread */
- erts_schedule_misc_aux_work(0,
- setup_thr_debug_wait_completed,
- vproc);
+ /* aux_thread */
+ erts_schedule_misc_aux_work(0,
+ setup_thr_debug_wait_completed,
+ lop->proc);
#endif
}
+ erts_free(ERTS_ALC_T_DEBUG, lop);
+}
+
+
+static void
+init_thr_debug_wait_completed(void *vproc)
+{
+ struct debug_lop* lop = erts_alloc(ERTS_ALC_T_DEBUG,
+ sizeof(struct debug_lop));
+ lop->proc = vproc;
+ erts_schedule_thr_prgr_later_op(later_thr_debug_wait_completed, lop, &lop->lop);
}
@@ -2264,7 +2250,7 @@ erts_debug_wait_completed(Process *c_p, int flags)
/* Only one process at a time can do this */
erts_aint32_t count = (erts_aint32_t) (2*erts_no_schedulers);
#ifdef ERTS_SMP
- count += 2; /* aux thread */
+ count += 1; /* aux thread */
#endif
if (0 == erts_atomic32_cmpxchg_mb(&debug_wait_completed_count,
count,
@@ -2272,17 +2258,12 @@ erts_debug_wait_completed(Process *c_p, int flags)
debug_wait_completed_flags = flags;
erts_suspend(c_p, ERTS_PROC_LOCK_MAIN, NULL);
erts_proc_inc_refc(c_p);
- /* scheduler threads */
+
+ /* First flush later-ops on all scheduler threads */
erts_schedule_multi_misc_aux_work(0,
erts_no_schedulers,
- prep_setup_thr_debug_wait_completed,
+ init_thr_debug_wait_completed,
(void *) c_p);
-#ifdef ERTS_SMP
- /* aux_thread */
- erts_schedule_misc_aux_work(0,
- prep_setup_thr_debug_wait_completed,
- (void *) c_p);
-#endif
return 1;
}
return 0;
@@ -2331,7 +2312,7 @@ handle_reap_ports(ErtsAuxWorkData *awdp, erts_aint32_t aux_work, int waiting)
ERTS_PORT_SFLG_HALT);
erts_smp_atomic32_inc_nob(&erts_halt_progress);
if (!(state & (ERTS_PORT_SFLG_EXITING|ERTS_PORT_SFLG_CLOSING)))
- erts_deliver_port_exit(prt, prt->common.id, am_killed, 0);
+ erts_deliver_port_exit(prt, prt->common.id, am_killed, 0, 1);
}
erts_port_release(prt);
@@ -3238,6 +3219,7 @@ scheduler_wait(int *fcalls, ErtsSchedulerData *esdp, ErtsRunQueue *rq)
ERTS_MSACC_SET_STATE_CACHED_M(ERTS_MSACC_STATE_CHECK_IO);
ASSERT(!erts_port_task_have_outstanding_io_tasks());
+ LTTNG2(scheduler_poll, esdp->no, 1);
erl_sys_schedule(1); /* Might give us something to do */
ERTS_MSACC_POP_STATE_M();
@@ -3361,6 +3343,7 @@ scheduler_wait(int *fcalls, ErtsSchedulerData *esdp, ErtsRunQueue *rq)
ASSERT(!erts_port_task_have_outstanding_io_tasks());
ERTS_MSACC_SET_STATE_CACHED_M(ERTS_MSACC_STATE_CHECK_IO);
+ LTTNG2(scheduler_poll, esdp->no, 0);
erl_sys_schedule(0);
@@ -6705,10 +6688,8 @@ schedule_process_sys_task(Process *p, erts_aint32_t prio, ErtsProcSysTask *st)
erts_aint32_t e;
n = e = a;
- if (a & ERTS_PSFLG_FREE) {
- res = 0;
+ if (a & ERTS_PSFLG_FREE)
goto cleanup; /* We don't want to schedule free processes... */
- }
enqueue = ERTS_ENQUEUE_NOT;
n |= ERTS_PSFLG_ACTIVE_SYS;
@@ -9257,6 +9238,21 @@ erts_set_process_priority(Process *p, Eterm value)
}
}
+static int
+scheduler_gc_proc(Process *c_p, int reds_left)
+{
+ int fcalls, reds;
+ if (!ERTS_PROC_GET_SAVED_CALLS_BUF(c_p))
+ fcalls = reds_left;
+ else
+ fcalls = reds_left - CONTEXT_REDS;
+ reds = erts_garbage_collect_nobump(c_p, 0, c_p->arg_reg, c_p->arity, fcalls);
+ ASSERT(reds_left >= reds);
+ return reds;
+}
+
+
+
/*
* schedule() is called from BEAM (process_main()) or HiPE
* (hipe_mode_switch()) when the current process is to be
@@ -9324,8 +9320,6 @@ Process *schedule(Process *p, int calls)
} else {
sched_out_proc:
- ASSERT(!(p->flags & F_DELAY_GC));
-
#ifdef ERTS_SMP
ERTS_SMP_CHK_HAVE_ONLY_MAIN_PROC_LOCK(p);
esdp = p->scheduler_data;
@@ -9335,7 +9329,9 @@ Process *schedule(Process *p, int calls)
esdp = erts_scheduler_data;
ASSERT(esdp->current_process == p);
#endif
+
reds = actual_reds = calls - esdp->virtual_reds;
+ ASSERT(actual_reds >= 0);
if (reds < ERTS_PROC_MIN_CONTEXT_SWITCH_REDS_COST)
reds = ERTS_PROC_MIN_CONTEXT_SWITCH_REDS_COST;
esdp->virtual_reds = 0;
@@ -9347,27 +9343,39 @@ Process *schedule(Process *p, int calls)
p->reds += actual_reds;
- erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS);
+#ifdef ERTS_SMP
+ erts_smp_proc_lock(p, ERTS_PROC_LOCK_TRACE);
+ if (p->trace_msg_q) {
+ erts_smp_proc_unlock(p, ERTS_PROC_LOCK_TRACE);
+ erts_schedule_flush_trace_messages(p->common.id);
+ } else
+ erts_smp_proc_unlock(p, ERTS_PROC_LOCK_TRACE);
+#endif
- state = erts_smp_atomic32_read_acqb(&p->state);
+ state = erts_smp_atomic32_read_nob(&p->state);
if (IS_TRACED(p)) {
if (IS_TRACED_FL(p, F_TRACE_CALLS) && !(state & ERTS_PSFLG_FREE))
erts_schedule_time_break(p, ERTS_BP_CALL_TIME_SCHEDULE_OUT);
- if (state & (ERTS_PSFLG_FREE|ERTS_PSFLG_EXITING)) {
+ if ((state & (ERTS_PSFLG_FREE|ERTS_PSFLG_EXITING)) == ERTS_PSFLG_EXITING) {
if (ARE_TRACE_FLAGS_ON(p, F_TRACE_SCHED_EXIT))
- trace_sched(p, ((state & ERTS_PSFLG_FREE)
- ? am_out_exited
- : am_out_exiting));
+ trace_sched(p, ERTS_PROC_LOCK_MAIN,
+ ((state & ERTS_PSFLG_FREE)
+ ? am_out_exited
+ : am_out_exiting));
}
else {
- if (ARE_TRACE_FLAGS_ON(p, F_TRACE_SCHED))
- trace_sched(p, am_out);
- else if (ARE_TRACE_FLAGS_ON(p, F_TRACE_SCHED_PROCS))
- trace_virtual_sched(p, am_out);
+ if (ARE_TRACE_FLAGS_ON(p, F_TRACE_SCHED) ||
+ ARE_TRACE_FLAGS_ON(p, F_TRACE_SCHED_PROCS))
+ trace_sched(p, ERTS_PROC_LOCK_MAIN, am_out);
}
}
+ erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS);
+
+ /* have to re-read state after taking lock */
+ state = erts_smp_atomic32_read_nob(&p->state);
+
#ifdef ERTS_SMP
if (state & ERTS_PSFLG_PENDING_EXIT)
erts_handle_pending_exit(p, (ERTS_PROC_LOCK_MAIN
@@ -9581,7 +9589,10 @@ Process *schedule(Process *p, int calls)
erts_sys_schedule_interrupt(0);
#endif
erts_smp_runq_unlock(rq);
- ERTS_MSACC_SET_STATE_CACHED_M(ERTS_MSACC_STATE_CHECK_IO);
+
+ ERTS_MSACC_SET_STATE_CACHED_M(ERTS_MSACC_STATE_CHECK_IO);
+ LTTNG2(scheduler_poll, esdp->no, 1);
+
erl_sys_schedule(1);
ERTS_MSACC_POP_STATE_M();
@@ -9724,12 +9735,14 @@ Process *schedule(Process *p, int calls)
| ERTS_PSFLG_ACTIVE_SYS
| ERTS_PSFLG_DIRTY_ACTIVE_SYS))
== ERTS_PSFLG_SUSPENDED)) {
- if (state & ERTS_PSFLG_FREE)
- erts_proc_dec_refc(p);
if (proxy_p) {
free_proxy_proc(proxy_p);
proxy_p = NULL;
}
+ else if (state & ERTS_PSFLG_FREE) {
+ /* free and not queued by proxy */
+ erts_proc_dec_refc(p);
+ }
goto pick_next_process;
}
state = new;
@@ -9741,7 +9754,7 @@ Process *schedule(Process *p, int calls)
esdp->current_process = p;
-
+ calls = 0;
reds = context_reds;
#ifdef ERTS_SMP
@@ -9789,10 +9802,7 @@ Process *schedule(Process *p, int calls)
if (erts_sched_stat.enabled) {
int prio;
- UWord old = ERTS_PROC_SCHED_ID(p,
- (ERTS_PROC_LOCK_MAIN
- | ERTS_PROC_LOCK_STATUS),
- (UWord) esdp->no);
+ UWord old = ERTS_PROC_SCHED_ID(p, (UWord) esdp->no);
int migrated = old && old != esdp->no;
#ifdef ERTS_DIRTY_SCHEDULERS
@@ -9823,9 +9833,7 @@ Process *schedule(Process *p, int calls)
/* Migrate to dirty scheduler... */
sunlock_sched_out_proc:
erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
- p->fcalls = reds;
goto sched_out_proc;
-
}
}
else {
@@ -9860,41 +9868,49 @@ Process *schedule(Process *p, int calls)
#endif /* ERTS_SMP */
- p->fcalls = reds;
+ erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
if (IS_TRACED(p)) {
if (state & ERTS_PSFLG_EXITING) {
if (ARE_TRACE_FLAGS_ON(p, F_TRACE_SCHED_EXIT))
- trace_sched(p, am_in_exiting);
+ trace_sched(p, ERTS_PROC_LOCK_MAIN, am_in_exiting);
}
else {
- if (ARE_TRACE_FLAGS_ON(p, F_TRACE_SCHED))
- trace_sched(p, am_in);
- else if (ARE_TRACE_FLAGS_ON(p, F_TRACE_SCHED_PROCS))
- trace_virtual_sched(p, am_in);
+ if (ARE_TRACE_FLAGS_ON(p, F_TRACE_SCHED) ||
+ ARE_TRACE_FLAGS_ON(p, F_TRACE_SCHED_PROCS))
+ trace_sched(p, ERTS_PROC_LOCK_MAIN, am_in);
}
if (IS_TRACED_FL(p, F_TRACE_CALLS)) {
erts_schedule_time_break(p, ERTS_BP_CALL_TIME_SCHEDULE_IN);
}
}
- erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
#ifdef ERTS_SMP
- if (is_not_nil(ERTS_TRACER_PROC(p)))
- erts_check_my_tracer_proc(p);
+ /* Clears tracer if it has been removed */
+ (void)ERTS_TRACER_PROC_IS_ENABLED(p);
#endif
if (state & ERTS_PSFLG_RUNNING_SYS) {
- reds -= execute_sys_tasks(p, &state, reds);
- if (reds <= 0
+ /*
+ * GC is normally never delayed when a process
+ * is scheduled out, but might be when executing
+ * hand written beam assembly in
+ * prim_eval:'receive'. If GC is delayed we are
+ * not allowed to execute system tasks.
+ */
+ if (!(p->flags & F_DELAY_GC)) {
+ int cost = execute_sys_tasks(p, &state, reds);
+ calls += cost;
+ reds -= cost;
+ if (reds <= 0
#ifdef ERTS_DIRTY_SCHEDULERS
- || ERTS_SCHEDULER_IS_DIRTY(esdp)
- || (state & ERTS_PSFLGS_DIRTY_WORK)
+ || ERTS_SCHEDULER_IS_DIRTY(esdp)
+ || (state & ERTS_PSFLGS_DIRTY_WORK)
#endif
- ) {
- p->fcalls = reds;
- goto sched_out_proc;
+ ) {
+ goto sched_out_proc;
+ }
}
ASSERT(state & ERTS_PSFLG_RUNNING_SYS);
@@ -9905,8 +9921,9 @@ Process *schedule(Process *p, int calls)
if (((state & (ERTS_PSFLG_SUSPENDED
| ERTS_PSFLG_ACTIVE)) != ERTS_PSFLG_ACTIVE)
- && !(state & ERTS_PSFLG_EXITING))
+ && !(state & ERTS_PSFLG_EXITING)) {
goto sched_out_proc;
+ }
n = e = state;
n &= ~ERTS_PSFLG_RUNNING_SYS;
@@ -9924,12 +9941,12 @@ Process *schedule(Process *p, int calls)
}
if (ERTS_IS_GC_DESIRED(p)) {
- if (!(state & ERTS_PSFLG_EXITING) && !(p->flags & F_DISABLE_GC)) {
- reds -= erts_garbage_collect_nobump(p, 0, p->arg_reg, p->arity);
- if (reds <= 0) {
- p->fcalls = reds;
+ if (!(state & ERTS_PSFLG_EXITING) && !(p->flags & (F_DELAY_GC|F_DISABLE_GC))) {
+ int cost = scheduler_gc_proc(p, reds);
+ calls += cost;
+ reds -= cost;
+ if (reds <= 0)
goto sched_out_proc;
- }
}
}
@@ -9937,6 +9954,8 @@ Process *schedule(Process *p, int calls)
free_proxy_proc(proxy_p);
proxy_p = NULL;
}
+
+ p->fcalls = reds;
ERTS_SMP_CHK_HAVE_ONLY_MAIN_PROC_LOCK(p);
@@ -10005,7 +10024,7 @@ notify_sys_task_executed(Process *c_p, ErtsProcSysTask *st, Eterm st_result)
ASSERT(hp_start + hsz == hp);
#endif
- erts_queue_message(rp, &rp_locks, mp, msg, NIL);
+ erts_queue_message(rp, &rp_locks, mp, msg);
if (c_p == rp)
rp_locks &= ~ERTS_PROC_LOCK_MAIN;
@@ -10173,8 +10192,7 @@ execute_sys_tasks(Process *c_p, erts_aint32_t *statep, int in_reds)
{
int garbage_collected = 0;
erts_aint32_t state = *statep;
- int max_reds = in_reds;
- int reds = 0;
+ int reds = in_reds;
int qmask = 0;
ERTS_SMP_LC_ASSERT(erts_proc_lc_my_proc_locks(c_p) == ERTS_PROC_LOCK_MAIN);
@@ -10202,35 +10220,47 @@ execute_sys_tasks(Process *c_p, erts_aint32_t *statep, int in_reds)
if (c_p->flags & F_DISABLE_GC) {
save_gc_task(c_p, st, st_prio);
st = NULL;
- reds++;
+ reds--;
}
else {
if (!garbage_collected) {
FLAGS(c_p) |= F_NEED_FULLSWEEP;
- reds += erts_garbage_collect_nobump(c_p,
- 0,
- c_p->arg_reg,
- c_p->arity);
+ reds -= scheduler_gc_proc(c_p, reds);
garbage_collected = 1;
}
st_res = am_true;
}
break;
- case ERTS_PSTT_CPC:
+ case ERTS_PSTT_CPC: {
+ int fcalls;
+ int cpc_reds = 0;
+ if (!ERTS_PROC_GET_SAVED_CALLS_BUF(c_p))
+ fcalls = reds;
+ else
+ fcalls = reds - CONTEXT_REDS;
st_res = erts_check_process_code(c_p,
st->arg[0],
unsigned_val(st->arg[1]),
- &reds);
+ &cpc_reds,
+ fcalls);
+ reds -= cpc_reds;
if (is_non_value(st_res)) {
/* Needed gc, but gc was disabled */
save_gc_task(c_p, st, st_prio);
st = NULL;
}
break;
+ }
case ERTS_PSTT_COHMQ:
- reds += erts_complete_off_heap_message_queue_change(c_p);
+ reds -= erts_complete_off_heap_message_queue_change(c_p);
st_res = am_true;
break;
+#ifdef ERTS_SMP
+ case ERTS_PSTT_FTMQ:
+ reds -= erts_flush_trace_messages(c_p, ERTS_PROC_LOCK_MAIN);
+ st_res = am_true;
+ break;
+#endif
default:
ERTS_INTERNAL_ERROR("Invalid process sys task type");
st_res = am_false;
@@ -10240,11 +10270,14 @@ execute_sys_tasks(Process *c_p, erts_aint32_t *statep, int in_reds)
reds += notify_sys_task_executed(c_p, st, st_res);
state = erts_smp_atomic32_read_acqb(&c_p->state);
- } while (qmask && reds < max_reds);
+ } while (qmask && reds > 0);
*statep = state;
- return reds;
+ if (in_reds < reds)
+ return in_reds;
+
+ return in_reds - reds;
}
static int
@@ -10276,6 +10309,12 @@ cleanup_sys_tasks(Process *c_p, erts_aint32_t in_state, int in_reds)
case ERTS_PSTT_COHMQ:
st_res = am_false;
break;
+#ifdef ERTS_SMP
+ case ERTS_PSTT_FTMQ:
+ reds -= erts_flush_trace_messages(c_p, ERTS_PROC_LOCK_MAIN);
+ st_res = am_true;
+ break;
+#endif
default:
ERTS_INTERNAL_ERROR("Invalid process sys task type");
st_res = am_false;
@@ -10411,8 +10450,8 @@ badarg:
BIF_ERROR(BIF_P, BADARG);
}
-void
-erts_schedule_complete_off_heap_message_queue_change(Eterm pid)
+static void
+erts_schedule_generic_sys_task(Eterm pid, ErtsProcSysTaskType type)
{
Process *rp = erts_proc_lookup(pid);
if (rp) {
@@ -10422,7 +10461,7 @@ erts_schedule_complete_off_heap_message_queue_change(Eterm pid)
st = erts_alloc(ERTS_ALC_T_PROC_SYS_TSK,
ERTS_PROC_SYS_TASK_SIZE(0));
- st->type = ERTS_PSTT_COHMQ;
+ st->type = type;
st->requester = NIL;
st->reply_tag = NIL;
st->req_id = NIL;
@@ -10437,6 +10476,18 @@ erts_schedule_complete_off_heap_message_queue_change(Eterm pid)
}
}
+void
+erts_schedule_complete_off_heap_message_queue_change(Eterm pid)
+{
+ erts_schedule_generic_sys_task(pid, ERTS_PSTT_COHMQ);
+}
+
+void
+erts_schedule_flush_trace_messages(Eterm pid)
+{
+ erts_schedule_generic_sys_task(pid, ERTS_PSTT_FTMQ);
+}
+
static void
save_gc_task(Process *c_p, ErtsProcSysTask *st, int prio)
{
@@ -10456,7 +10507,7 @@ save_gc_task(Process *c_p, ErtsProcSysTask *st, int prio)
qs->q[PRIORITY_NORMAL] = NULL;
qs->q[PRIORITY_LOW] = NULL;
qs->q[prio] = st;
- (void) ERTS_PROC_SET_DELAYED_GC_TASK_QS(c_p, ERTS_PROC_LOCK_MAIN, qs);
+ (void) ERTS_PROC_SET_DELAYED_GC_TASK_QS(c_p, qs);
}
else {
if (!qs->q[prio]) {
@@ -10603,7 +10654,7 @@ erts_set_gc_state(Process *c_p, int enable)
erts_smp_proc_unlock(c_p, ERTS_PROC_LOCK_STATUS);
- (void) ERTS_PROC_SET_DELAYED_GC_TASK_QS(c_p, ERTS_PROC_LOCK_MAIN, NULL);
+ (void) ERTS_PROC_SET_DELAYED_GC_TASK_QS(c_p, NULL);
if (dgc_tsk_qs)
proc_sys_task_queues_free(dgc_tsk_qs);
@@ -10895,14 +10946,13 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
Eterm res = THE_NON_VALUE;
erts_aint32_t state = 0;
erts_aint32_t prio = (erts_aint32_t) PRIORITY_NORMAL;
+ ErtsProcLocks locks = ERTS_PROC_LOCKS_ALL;
#ifdef SHCOPY_SPAWN
erts_shcopy_t info;
INITIALIZE_SHCOPY(info);
#endif
-#ifdef ERTS_SMP
erts_smp_proc_lock(parent, ERTS_PROC_LOCKS_ALL_MINOR);
-#endif
/*
* Check for errors.
@@ -11071,7 +11121,7 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
: STORE_NC(&p->htop, &p->off_heap, parent->group_leader);
}
- erts_get_default_tracing(&ERTS_TRACE_FLAGS(p), &ERTS_TRACER_PROC(p));
+ erts_get_default_proc_tracing(&ERTS_TRACE_FLAGS(p), &ERTS_TRACER(p));
p->msg.first = NULL;
p->msg.last = &p->msg.first;
@@ -11089,7 +11139,7 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
p->mbuf = NULL;
p->msg_frag = NULL;
p->mbuf_sz = 0;
- p->psd = NULL;
+ erts_smp_atomic_init_nob(&p->psd, (erts_aint_t) NULL);
p->dictionary = NULL;
p->seq_trace_lastcnt = 0;
p->seq_trace_clock = 0;
@@ -11107,21 +11157,60 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
p->last_old_htop = NULL;
#endif
+#ifdef ERTS_SMP
+ p->trace_msg_q = NULL;
+ p->scheduler_data = NULL;
+ p->suspendee = NIL;
+ p->pending_suspenders = NULL;
+ p->pending_exit.reason = THE_NON_VALUE;
+ p->pending_exit.bp = NULL;
+#endif
+
+#if !defined(NO_FPE_SIGNALS) || defined(HIPE)
+ p->fp_exception = 0;
+#endif
+
if (IS_TRACED(parent)) {
if (ERTS_TRACE_FLAGS(parent) & F_TRACE_SOS) {
ERTS_TRACE_FLAGS(p) |= (ERTS_TRACE_FLAGS(parent) & TRACEE_FLAGS);
- ERTS_TRACER_PROC(p) = ERTS_TRACER_PROC(parent);
- }
- if (ARE_TRACE_FLAGS_ON(parent, F_TRACE_PROCS)) {
- trace_proc_spawn(parent, p->common.id, mod, func, args);
+ erts_tracer_replace(&p->common, ERTS_TRACER(parent));
}
- if (ERTS_TRACE_FLAGS(parent) & F_TRACE_SOS1) {
+ if (ERTS_TRACE_FLAGS(parent) & F_TRACE_SOS1) {
/* Overrides TRACE_CHILDREN */
ERTS_TRACE_FLAGS(p) |= (ERTS_TRACE_FLAGS(parent) & TRACEE_FLAGS);
- ERTS_TRACER_PROC(p) = ERTS_TRACER_PROC(parent);
+ erts_tracer_replace(&p->common, ERTS_TRACER(parent));
ERTS_TRACE_FLAGS(p) &= ~(F_TRACE_SOS1 | F_TRACE_SOS);
ERTS_TRACE_FLAGS(parent) &= ~(F_TRACE_SOS1 | F_TRACE_SOS);
}
+ if (so->flags & SPO_LINK && ERTS_TRACE_FLAGS(parent) & (F_TRACE_SOL|F_TRACE_SOL1)) {
+ ERTS_TRACE_FLAGS(p) |= (ERTS_TRACE_FLAGS(parent)&TRACEE_FLAGS);
+ erts_tracer_replace(&p->common, ERTS_TRACER(parent));
+ if (ERTS_TRACE_FLAGS(parent) & F_TRACE_SOL1) {/*maybe override*/
+ ERTS_TRACE_FLAGS(p) &= ~(F_TRACE_SOL1 | F_TRACE_SOL);
+ ERTS_TRACE_FLAGS(parent) &= ~(F_TRACE_SOL1 | F_TRACE_SOL);
+ }
+ }
+ if (ARE_TRACE_FLAGS_ON(parent, F_TRACE_PROCS)) {
+ locks &= ~(ERTS_PROC_LOCK_STATUS|ERTS_PROC_LOCK_TRACE);
+ erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS|ERTS_PROC_LOCK_TRACE);
+ erts_smp_proc_unlock(parent, ERTS_PROC_LOCK_STATUS|ERTS_PROC_LOCK_TRACE);
+ trace_proc_spawn(parent, am_spawn, p->common.id, mod, func, args);
+ if (so->flags & SPO_LINK)
+ trace_proc(parent, locks, parent, am_link, p->common.id);
+ }
+ }
+
+ if (IS_TRACED_FL(p, F_TRACE_PROCS)) {
+ if ((locks & (ERTS_PROC_LOCK_STATUS|ERTS_PROC_LOCK_TRACE))
+ == (ERTS_PROC_LOCK_STATUS|ERTS_PROC_LOCK_TRACE)) {
+ /* This happens when parent was not traced, but child is */
+ locks &= ~(ERTS_PROC_LOCK_STATUS|ERTS_PROC_LOCK_TRACE);
+ erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS|ERTS_PROC_LOCK_TRACE);
+ erts_smp_proc_unlock(parent, ERTS_PROC_LOCK_STATUS|ERTS_PROC_LOCK_TRACE);
+ }
+ trace_proc_spawn(p, am_spawned, parent->common.id, mod, func, args);
+ if (so->flags & SPO_LINK)
+ trace_proc(p, locks, p, am_getting_linked, parent->common.id);
}
/*
@@ -11132,10 +11221,6 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
#ifdef DEBUG
int ret;
#endif
- if (IS_TRACED_FL(parent, F_TRACE_PROCS)) {
- trace_proc(parent, parent, am_link, p->common.id);
- }
-
#ifdef DEBUG
ret = erts_add_link(&ERTS_P_LINKS(parent), LINK_PID, p->common.id);
ASSERT(ret == 0);
@@ -11146,17 +11231,6 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
erts_add_link(&ERTS_P_LINKS(p), LINK_PID, parent->common.id);
#endif
- if (IS_TRACED(parent)) {
- if (ERTS_TRACE_FLAGS(parent) & (F_TRACE_SOL|F_TRACE_SOL1)) {
- ERTS_TRACE_FLAGS(p) |= (ERTS_TRACE_FLAGS(parent)&TRACEE_FLAGS);
- ERTS_TRACER_PROC(p) = ERTS_TRACER_PROC(parent); /*maybe steal*/
-
- if (ERTS_TRACE_FLAGS(parent) & F_TRACE_SOL1) {/*maybe override*/
- ERTS_TRACE_FLAGS(p) &= ~(F_TRACE_SOL1 | F_TRACE_SOL);
- ERTS_TRACE_FLAGS(parent) &= ~(F_TRACE_SOL1 | F_TRACE_SOL);
- }
- }
- }
}
/*
@@ -11171,19 +11245,7 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
so->mref = mref;
}
-#ifdef ERTS_SMP
- p->scheduler_data = NULL;
- p->suspendee = NIL;
- p->pending_suspenders = NULL;
- p->pending_exit.reason = THE_NON_VALUE;
- p->pending_exit.bp = NULL;
-#endif
-
-#if !defined(NO_FPE_SIGNALS) || defined(HIPE)
- p->fp_exception = 0;
-#endif
-
- erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL);
+ erts_smp_proc_unlock(p, locks);
res = p->common.id;
@@ -11191,6 +11253,8 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
* Schedule process for execution.
*/
+ erts_smp_proc_unlock(parent, locks & ERTS_PROC_LOCKS_ALL_MINOR);
+
schedule_process(p, state, 0);
VERBOSE(DEBUG_PROCESSES, ("Created a new process: %T\n",p->common.id));
@@ -11204,10 +11268,11 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
DTRACE2(process_spawn, process_name, mfa);
}
#endif
+ return res;
error:
- erts_smp_proc_unlock(parent, ERTS_PROC_LOCKS_ALL_MINOR);
+ erts_smp_proc_unlock(parent, locks & ERTS_PROC_LOCKS_ALL_MINOR);
return res;
}
@@ -11232,7 +11297,7 @@ void erts_init_empty_process(Process *p)
p->rcount = 0;
p->common.id = ERTS_INVALID_PID;
p->reds = 0;
- ERTS_TRACER_PROC(p) = NIL;
+ ERTS_TRACER(p) = erts_tracer_nil;
ERTS_TRACE_FLAGS(p) = F_INITIAL_TRACE_FLAGS;
p->group_leader = ERTS_INVALID_PID;
p->flags = 0;
@@ -11258,7 +11323,7 @@ void erts_init_empty_process(Process *p)
p->mbuf = NULL;
p->msg_frag = NULL;
p->mbuf_sz = 0;
- p->psd = NULL;
+ erts_smp_atomic_init_nob(&p->psd, (erts_aint_t) NULL);
ERTS_P_MONITORS(p) = NULL;
ERTS_P_LINKS(p) = NULL; /* List of links */
p->nodes_monitors = NULL;
@@ -11352,7 +11417,7 @@ erts_debug_verify_clean_empty_process(Process* p)
ASSERT(p->live_hf_end == ERTS_INVALID_HFRAG_PTR);
ASSERT(p->heap == NULL);
ASSERT(p->common.id == ERTS_INVALID_PID);
- ASSERT(ERTS_TRACER_PROC(p) == NIL);
+ ASSERT(ERTS_TRACER_IS_NIL(ERTS_TRACER(p)));
ASSERT(ERTS_TRACE_FLAGS(p) == F_INITIAL_TRACE_FLAGS);
ASSERT(p->group_leader == ERTS_INVALID_PID);
ASSERT(p->next == NULL);
@@ -11428,14 +11493,19 @@ static void
delete_process(Process* p)
{
Eterm *heap;
+ ErtsPSD *psd;
VERBOSE(DEBUG_PROCESSES, ("Removing process: %T\n",p->common.id));
VERBOSE(DEBUG_SHCOPY, ("[pid=%T] delete process: %p %p %p %p\n", p->common.id,
HEAP_START(p), HEAP_END(p), OLD_HEAP(p), OLD_HEND(p)));
/* Cleanup psd */
- if (p->psd)
- erts_free(ERTS_ALC_T_PSD, p->psd);
+ psd = (ErtsPSD *) erts_smp_atomic_read_nob(&p->psd);
+
+ if (psd) {
+ erts_smp_atomic_set_nob(&p->psd, (erts_aint_t) NULL); /* Reduction counting depends on this... */
+ erts_free(ERTS_ALC_T_PSD, psd);
+ }
/* Clean binaries and funs */
erts_cleanup_offheap(&p->off_heap);
@@ -11696,7 +11766,7 @@ send_exit_message(Process *to, ErtsProcLocks *to_locksp,
mp = erts_alloc_message_heap(to, to_locksp, term_size, &hp, &ohp);
mess = copy_struct(exit_term, term_size, &hp, ohp);
#endif
- erts_queue_message(to, to_locksp, mp, mess, NIL);
+ erts_queue_message(to, to_locksp, mp, mess);
} else {
Eterm temp_token;
Uint sz_token;
@@ -11714,9 +11784,10 @@ send_exit_message(Process *to, ErtsProcLocks *to_locksp,
mess = copy_struct(exit_term, term_size, &hp, ohp);
#endif
/* the trace token must in this case be updated by the caller */
- seq_trace_output(token, mess, SEQ_TRACE_SEND, to->common.id, NULL);
+ seq_trace_output(token, mess, SEQ_TRACE_SEND, to->common.id, to);
temp_token = copy_struct(token, sz_token, &hp, ohp);
- erts_queue_message(to, to_locksp, mp, mess, temp_token);
+ ERL_MESSAGE_TOKEN(mp) = temp_token;
+ erts_queue_message(to, to_locksp, mp, mess);
}
}
@@ -11825,6 +11896,9 @@ send_exit_signal(Process *c_p, /* current process if and only
if ((state & ERTS_PSFLG_TRAP_EXIT)
&& (reason != am_kill || (flags & ERTS_XSIG_FLG_IGN_KILL))) {
+ /* have to release the status lock in order to send the exit message */
+ erts_smp_proc_unlock(rp, *rp_locks & ERTS_PROC_LOCKS_XSIG_SEND);
+ *rp_locks &= ~ERTS_PROC_LOCKS_XSIG_SEND;
if (have_seqtrace(token) && token_update)
seq_trace_update_send(token_update);
if (is_value(exit_tuple))
@@ -12122,6 +12196,7 @@ static void doit_exit_link(ErtsLink *lnk, void *vpcontext)
DistEntry *dep;
Process *rp;
+
switch(lnk->type) {
case LINK_PID:
if(is_internal_port(item)) {
@@ -12169,7 +12244,11 @@ static void doit_exit_link(ErtsLink *lnk, void *vpcontext)
if (xres >= 0 && IS_TRACED_FL(rp, F_TRACE_PROCS)) {
/* We didn't exit the process and it is traced */
if (IS_TRACED_FL(rp, F_TRACE_PROCS)) {
- trace_proc(p, rp, am_getting_unlinked, p->common.id);
+ if (rp_locks & ERTS_PROC_LOCKS_XSIG_SEND) {
+ erts_smp_proc_unlock(rp, ERTS_PROC_LOCKS_XSIG_SEND);
+ rp_locks &= ~ERTS_PROC_LOCKS_XSIG_SEND;
+ }
+ trace_proc(NULL, 0, rp, am_getting_unlinked, p->common.id);
}
}
}
@@ -12286,8 +12365,6 @@ erts_do_exit_process(Process* p, Eterm reason)
if (IS_TRACED_FL(p, F_TRACE_CALLS))
erts_schedule_time_break(p, ERTS_BP_CALL_TIME_SCHEDULE_EXITING);
- if (IS_TRACED_FL(p,F_TRACE_PROCS))
- trace_proc(p, p, am_exit, reason);
}
erts_trace_check_exiting(p->common.id);
@@ -12303,6 +12380,10 @@ erts_do_exit_process(Process* p, Eterm reason)
erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL_MINOR);
+ if (IS_TRACED_FL(p,F_TRACE_PROCS))
+ trace_proc(p, ERTS_PROC_LOCK_MAIN, p, am_exit, reason);
+
+
/*
* p->u.initial of this process can *not* be used anymore;
* will be overwritten by misc termination data.
@@ -12442,6 +12523,9 @@ erts_continue_exit_process(Process *p)
ASSERT(!p->common.u.alive.reg);
}
+ if (IS_TRACED_FL(p, F_TRACE_SCHED_EXIT))
+ trace_sched(p, curr_locks, am_out_exited);
+
erts_smp_proc_lock(p, ERTS_PROC_LOCKS_ALL_MINOR);
curr_locks = ERTS_PROC_LOCKS_ALL;
@@ -12514,9 +12598,11 @@ erts_continue_exit_process(Process *p)
}
dep = (p->flags & F_DISTRIBUTION) ? erts_this_dist_entry : NULL;
- scb = ERTS_PROC_SET_SAVED_CALLS_BUF(p, ERTS_PROC_LOCKS_ALL, NULL);
- pbt = ERTS_PROC_SET_CALL_TIME(p, ERTS_PROC_LOCKS_ALL, NULL);
- nif_export = ERTS_PROC_SET_NIF_TRAP_EXPORT(p, ERTS_PROC_LOCKS_ALL, NULL);
+ scb = ERTS_PROC_SET_SAVED_CALLS_BUF(p, NULL);
+ if (scb)
+ p->fcalls += CONTEXT_REDS; /* Reduction counting depends on this... */
+ pbt = ERTS_PROC_SET_CALL_TIME(p, NULL);
+ nif_export = ERTS_PROC_SET_NIF_TRAP_EXPORT(p, NULL);
erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL);
#ifdef BM_COUNTERS
@@ -12565,6 +12651,12 @@ erts_continue_exit_process(Process *p)
if (nif_export)
erts_destroy_nif_export(nif_export);
+#ifdef ERTS_SMP
+ erts_flush_trace_messages(p, 0);
+#endif
+
+ ERTS_TRACER_CLEAR(&ERTS_TRACER(p));
+
delete_process(p);
#ifdef ERTS_SMP
diff --git a/erts/emulator/beam/erl_process.h b/erts/emulator/beam/erl_process.h
index c88bd7056c..59da9c1779 100644
--- a/erts/emulator/beam/erl_process.h
+++ b/erts/emulator/beam/erl_process.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -805,8 +805,15 @@ erts_smp_reset_max_len(ErtsRunQueue *rq, ErtsRunQueueInfo *rqi)
#define ERTS_PSD_CALL_TIME_BP 3
#define ERTS_PSD_DELAYED_GC_TASK_QS 4
#define ERTS_PSD_NIF_TRAP_EXPORT 5
+#ifdef HIPE
+#define ERTS_PSD_SUSPENDED_SAVED_CALLS_BUF 6
+#endif
+#ifdef HIPE
+#define ERTS_PSD_SIZE 7
+#else
#define ERTS_PSD_SIZE 6
+#endif
typedef struct {
void *data[ERTS_PSD_SIZE];
@@ -818,8 +825,8 @@ typedef struct {
#define ERTS_PSD_ERROR_HANDLER_BUF_GET_LOCKS ERTS_PROC_LOCK_MAIN
#define ERTS_PSD_ERROR_HANDLER_BUF_SET_LOCKS ERTS_PROC_LOCK_MAIN
-#define ERTS_PSD_SAVED_CALLS_BUF_GET_LOCKS ERTS_PROC_LOCK_MAIN
-#define ERTS_PSD_SAVED_CALLS_BUF_SET_LOCKS ERTS_PROC_LOCK_MAIN
+#define ERTS_PSD_SAVED_CALLS_BUF_GET_LOCKS ((ErtsProcLocks) 0)
+#define ERTS_PSD_SAVED_CALLS_BUF_SET_LOCKS ((ErtsProcLocks) 0)
#define ERTS_PSD_SCHED_ID_GET_LOCKS ERTS_PROC_LOCK_STATUS
#define ERTS_PSD_SCHED_ID_SET_LOCKS ERTS_PROC_LOCK_STATUS
@@ -830,8 +837,8 @@ typedef struct {
#define ERTS_PSD_DELAYED_GC_TASK_QS_GET_LOCKS ERTS_PROC_LOCK_MAIN
#define ERTS_PSD_DELAYED_GC_TASK_QS_SET_LOCKS ERTS_PROC_LOCK_MAIN
-#define ERTS_PSD_NIF_TRAP_EXPORT_GET_LOCKS ERTS_PROC_LOCK_MAIN
-#define ERTS_PSD_NIF_TRAP_EXPORT_SET_LOCKS ERTS_PROC_LOCK_MAIN
+#define ERTS_PSD_NIF_TRAP_EXPORT_GET_LOCKS ((ErtsProcLocks) 0)
+#define ERTS_PSD_NIF_TRAP_EXPORT_SET_LOCKS ((ErtsProcLocks) 0)
typedef struct {
ErtsProcLocks get_locks;
@@ -925,7 +932,6 @@ struct process {
Eterm* stop; /* Stack top */
Eterm* heap; /* Heap start */
Eterm* hend; /* Heap end */
- Eterm* abandoned_heap;
Uint heap_sz; /* Size of heap in words */
Uint min_heap_size; /* Minimum size of heap (in words). */
Uint min_vheap_size; /* Minimum size of virtual heap (in words). */
@@ -941,6 +947,16 @@ struct process {
#endif
/*
+ * Moved to after "struct hipe_process_state hipe", as a temporary fix for
+ * LLVM hard-coding offsetof(struct process, hipe.nstack) (sic!)
+ * (see void X86FrameLowering::adjustForHiPEPrologue(...) in
+ * lib/Target/X86/X86FrameLowering.cpp).
+ *
+ * Used to be below "Eterm* hend".
+ */
+ Eterm* abandoned_heap;
+
+ /*
* Saved x registers.
*/
Uint arity; /* Number of live argument registers (only valid
@@ -1026,7 +1042,7 @@ struct process {
ErlHeapFragment* live_hf_end;
ErtsMessage *msg_frag; /* Pointer to message fragment list */
Uint mbuf_sz; /* Total size of heap fragments and message fragments */
- ErtsPSD *psd; /* Rarely used process specific data */
+ erts_smp_atomic_t psd; /* Rarely used process specific data */
Uint64 bin_vheap_sz; /* Virtual heap block size for binaries */
Uint64 bin_old_vheap_sz; /* Virtual old heap block size for binaries */
@@ -1041,6 +1057,7 @@ struct process {
#ifdef ERTS_SMP
ErlMessageInQueue msg_inq;
+ ErlTraceMessageQueue *trace_msg_q;
ErtsPendExit pending_exit;
erts_proc_lock_t lock;
ErtsSchedulerData *scheduler_data;
@@ -1070,6 +1087,10 @@ struct process {
Uint space_verified; /* Avoid HAlloc forcing heap fragments when */
Eterm* space_verified_from; /* we rely on available heap space (TestHeap) */
#endif
+
+#ifdef DEBUG
+ Uint debug_reds_in;
+#endif
};
extern const Process erts_invalid_process;
@@ -1341,6 +1362,7 @@ extern int erts_system_profile_ts_type;
#define F_DELAY_GC (1 << 16) /* Similar to disable GC (see below) */
#define F_SCHDLR_ONLN_WAITQ (1 << 17) /* Process enqueued waiting to change schedulers online */
#define F_HAVE_BLCKD_NMSCHED (1 << 18) /* Process has blocked normal multi-scheduling */
+#define F_HIPE_MODE (1 << 19)
/*
* F_DISABLE_GC and F_DELAY_GC are similar. Both will prevent
@@ -1358,7 +1380,6 @@ extern int erts_system_profile_ts_type;
#define F_TRACE_FLAG(N) (1 << (ERTS_TRACE_TS_TYPE_BITS + (N)))
/* process trace_flags */
-
#define F_NOW_TS (ERTS_TRACE_FLG_NOW_TIMESTAMP \
<< ERTS_TRACE_FLAGS_TS_TYPE_SHIFT)
#define F_STRICT_MON_TS (ERTS_TRACE_FLG_STRICT_MONOTONIC_TIMESTAMP \
@@ -1380,8 +1401,7 @@ extern int erts_system_profile_ts_type;
#define F_TRACE_ARITY_ONLY F_TRACE_FLAG(12)
#define F_TRACE_RETURN_TO F_TRACE_FLAG(13) /* Return_to trace when breakpoint tracing */
#define F_TRACE_SILENT F_TRACE_FLAG(14) /* No call trace msg suppress */
-#define F_TRACER F_TRACE_FLAG(15) /* May be (has been) tracer */
-#define F_EXCEPTION_TRACE F_TRACE_FLAG(16) /* May have exception trace on stack */
+#define F_EXCEPTION_TRACE F_TRACE_FLAG(15) /* May have exception trace on stack */
/* port trace flags, currently the same as process trace flags */
#define F_TRACE_SCHED_PORTS F_TRACE_FLAG(17) /* Trace of port scheduling */
@@ -1410,12 +1430,14 @@ extern int erts_system_profile_ts_type;
| F_TRACE_SCHED_PORTS | F_TRACE_SCHED_NO \
| F_TRACE_SCHED_EXIT)
+
#define ERTS_TRACEE_MODIFIER_FLAGS \
- (F_TRACE_SILENT | F_TIMESTAMP_MASK | F_TRACE_SCHED_NO)
-#define ERTS_PORT_TRACEE_FLAGS \
- (ERTS_TRACEE_MODIFIER_FLAGS | F_TRACE_PORTS | F_TRACE_SCHED_PORTS)
+ (F_TRACE_SILENT | F_TIMESTAMP_MASK | F_TRACE_SCHED_NO \
+ | F_TRACE_RECEIVE | F_TRACE_SEND)
+#define ERTS_PORT_TRACEE_FLAGS \
+ (ERTS_TRACEE_MODIFIER_FLAGS | F_TRACE_PORTS | F_TRACE_SCHED_PORTS)
#define ERTS_PROC_TRACEE_FLAGS \
- ((TRACEE_FLAGS & ~ERTS_PORT_TRACEE_FLAGS) | ERTS_TRACEE_MODIFIER_FLAGS)
+ ((TRACEE_FLAGS & ~ERTS_PORT_TRACEE_FLAGS) | ERTS_TRACEE_MODIFIER_FLAGS)
#define SEQ_TRACE_FLAG(N) (1 << (ERTS_TRACE_TS_TYPE_BITS + (N)))
@@ -1717,6 +1739,8 @@ void erts_schedule_thr_prgr_later_cleanup_op(void (*)(void *),
ErtsThrPrgrLaterOp *,
UWord);
void erts_schedule_complete_off_heap_message_queue_change(Eterm pid);
+void erts_schedule_flush_trace_messages(Eterm pid);
+int erts_flush_trace_messages(Process *c_p, ErtsProcLocks locks);
#if defined(ERTS_SMP) && defined(ERTS_ENABLE_LOCK_CHECK)
int erts_dbg_check_halloc_lock(Process *p);
@@ -1903,18 +1927,19 @@ do { \
#define ERTS_SMP_LC_CHK_RUNQ_LOCK(RQ, L)
#endif
-void *erts_psd_set_init(Process *p, ErtsProcLocks plocks, int ix, void *data);
+void *erts_psd_set_init(Process *p, int ix, void *data);
ERTS_GLB_INLINE void *
erts_psd_get(Process *p, int ix);
ERTS_GLB_INLINE void *
-erts_psd_set(Process *p, ErtsProcLocks plocks, int ix, void *new);
+erts_psd_set(Process *p, int ix, void *new);
#if ERTS_GLB_INLINE_INCL_FUNC_DEF
ERTS_GLB_INLINE void *
erts_psd_get(Process *p, int ix)
{
+ ErtsPSD *psd;
#if defined(ERTS_SMP) && defined(ERTS_ENABLE_LOCK_CHECK)
ErtsProcLocks locks = erts_proc_lc_my_proc_locks(p);
if (ERTS_LC_PSD_ANY_LOCK == erts_psd_required_locks[ix].get_locks)
@@ -1925,17 +1950,19 @@ erts_psd_get(Process *p, int ix)
|| erts_thr_progress_is_blocking());
}
#endif
+
+ psd = (ErtsPSD *) erts_smp_atomic_read_nob(&p->psd);
ASSERT(0 <= ix && ix < ERTS_PSD_SIZE);
- return p->psd ? p->psd->data[ix] : NULL;
+ if (!psd)
+ return NULL;
+ ERTS_SMP_DATA_DEPENDENCY_READ_MEMORY_BARRIER;
+ return psd->data[ix];
}
-
-/*
- * NOTE: erts_psd_set() might release and reacquire locks on 'p'.
- */
ERTS_GLB_INLINE void *
-erts_psd_set(Process *p, ErtsProcLocks plocks, int ix, void *data)
+erts_psd_set(Process *p, int ix, void *data)
{
+ ErtsPSD *psd;
#if defined(ERTS_SMP) && defined(ERTS_ENABLE_LOCK_CHECK)
ErtsProcLocks locks = erts_proc_lc_my_proc_locks(p);
if (ERTS_LC_PSD_ANY_LOCK == erts_psd_required_locks[ix].set_locks)
@@ -1946,50 +1973,62 @@ erts_psd_set(Process *p, ErtsProcLocks plocks, int ix, void *data)
|| erts_thr_progress_is_blocking());
}
#endif
+ psd = (ErtsPSD *) erts_smp_atomic_read_nob(&p->psd);
ASSERT(0 <= ix && ix < ERTS_PSD_SIZE);
- if (p->psd) {
- void *old = p->psd->data[ix];
- p->psd->data[ix] = data;
+ if (psd) {
+ void *old;
+#ifdef ERTS_SMP
+#ifdef ETHR_ORDERED_READ_DEPEND
+ ETHR_MEMBAR(ETHR_LoadStore|ETHR_StoreStore);
+#else
+ ETHR_MEMBAR(ETHR_LoadLoad|ETHR_LoadStore|ETHR_StoreStore);
+#endif
+#endif
+ old = psd->data[ix];
+ psd->data[ix] = data;
return old;
}
- else {
- if (!data)
- return NULL;
- else
- return erts_psd_set_init(p, plocks, ix, data);
- }
+
+ if (!data)
+ return NULL;
+
+ return erts_psd_set_init(p, ix, data);
}
#endif
-#define ERTS_PROC_SCHED_ID(P, L, ID) \
- ((UWord) erts_psd_set((P), (L), ERTS_PSD_SCHED_ID, (void *) (ID)))
+#define ERTS_PROC_SCHED_ID(P, ID) \
+ ((UWord) erts_psd_set((P), ERTS_PSD_SCHED_ID, (void *) (ID)))
#define ERTS_PROC_GET_SAVED_CALLS_BUF(P) \
((struct saved_calls *) erts_psd_get((P), ERTS_PSD_SAVED_CALLS_BUF))
-#define ERTS_PROC_SET_SAVED_CALLS_BUF(P, L, SCB) \
- ((struct saved_calls *) erts_psd_set((P), (L), ERTS_PSD_SAVED_CALLS_BUF, (void *) (SCB)))
+#define ERTS_PROC_SET_SAVED_CALLS_BUF(P, SCB) \
+ ((struct saved_calls *) erts_psd_set((P), ERTS_PSD_SAVED_CALLS_BUF, (void *) (SCB)))
#define ERTS_PROC_GET_CALL_TIME(P) \
((process_breakpoint_time_t *) erts_psd_get((P), ERTS_PSD_CALL_TIME_BP))
-#define ERTS_PROC_SET_CALL_TIME(P, L, PBT) \
- ((process_breakpoint_time_t *) erts_psd_set((P), (L), ERTS_PSD_CALL_TIME_BP, (void *) (PBT)))
+#define ERTS_PROC_SET_CALL_TIME(P, PBT) \
+ ((process_breakpoint_time_t *) erts_psd_set((P), ERTS_PSD_CALL_TIME_BP, (void *) (PBT)))
#define ERTS_PROC_GET_DELAYED_GC_TASK_QS(P) \
((ErtsProcSysTaskQs *) erts_psd_get((P), ERTS_PSD_DELAYED_GC_TASK_QS))
-#define ERTS_PROC_SET_DELAYED_GC_TASK_QS(P, L, PBT) \
- ((ErtsProcSysTaskQs *) erts_psd_set((P), (L), ERTS_PSD_DELAYED_GC_TASK_QS, (void *) (PBT)))
+#define ERTS_PROC_SET_DELAYED_GC_TASK_QS(P, PBT) \
+ ((ErtsProcSysTaskQs *) erts_psd_set((P), ERTS_PSD_DELAYED_GC_TASK_QS, (void *) (PBT)))
#define ERTS_PROC_GET_NIF_TRAP_EXPORT(P) \
erts_psd_get((P), ERTS_PSD_NIF_TRAP_EXPORT)
-#define ERTS_PROC_SET_NIF_TRAP_EXPORT(P, L, NTE) \
- erts_psd_set((P), (L), ERTS_PSD_NIF_TRAP_EXPORT, (void *) (NTE))
+#define ERTS_PROC_SET_NIF_TRAP_EXPORT(P, NTE) \
+ erts_psd_set((P), ERTS_PSD_NIF_TRAP_EXPORT, (void *) (NTE))
+#ifdef HIPE
+#define ERTS_PROC_GET_SUSPENDED_SAVED_CALLS_BUF(P) \
+ ((struct saved_calls *) erts_psd_get((P), ERTS_PSD_SUSPENDED_SAVED_CALLS_BUF))
+#define ERTS_PROC_SET_SUSPENDED_SAVED_CALLS_BUF(P, SCB) \
+ ((struct saved_calls *) erts_psd_set((P), ERTS_PSD_SUSPENDED_SAVED_CALLS_BUF, (void *) (SCB)))
+#endif
ERTS_GLB_INLINE Eterm erts_proc_get_error_handler(Process *p);
-ERTS_GLB_INLINE Eterm erts_proc_set_error_handler(Process *p,
- ErtsProcLocks plocks,
- Eterm handler);
+ERTS_GLB_INLINE Eterm erts_proc_set_error_handler(Process *p, Eterm handler);
#if ERTS_GLB_INLINE_INCL_FUNC_DEF
ERTS_GLB_INLINE Eterm
@@ -2005,13 +2044,13 @@ erts_proc_get_error_handler(Process *p)
}
ERTS_GLB_INLINE Eterm
-erts_proc_set_error_handler(Process *p, ErtsProcLocks plocks, Eterm handler)
+erts_proc_set_error_handler(Process *p, Eterm handler)
{
void *old_val;
void *new_val;
ASSERT(is_atom(handler));
new_val = (handler == am_error_handler) ? NULL : (void *) (UWord) handler;
- old_val = erts_psd_set(p, plocks, ERTS_PSD_ERROR_HANDLER, new_val);
+ old_val = erts_psd_set(p, ERTS_PSD_ERROR_HANDLER, new_val);
if (!old_val)
return am_error_handler;
else {
@@ -2317,14 +2356,17 @@ erts_alloc_message_heap_state(Process *pp,
ErlOffHeap **ohpp)
{
int on_heap;
+ ErtsMessage *mp;
if ((*psp) & ERTS_PSFLG_OFF_HEAP_MSGQ) {
- ErtsMessage *mp = erts_alloc_message(sz, hpp);
+ mp = erts_alloc_message(sz, hpp);
*ohpp = sz == 0 ? NULL : &mp->hfrag.off_heap;
return mp;
}
- return erts_try_alloc_message_on_heap(pp, psp, plp, sz, hpp, ohpp, &on_heap);
+ mp = erts_try_alloc_message_on_heap(pp, psp, plp, sz, hpp, ohpp, &on_heap);
+ ASSERT(pp || !on_heap);
+ return mp;
}
ERTS_GLB_INLINE ErtsMessage *
@@ -2334,7 +2376,7 @@ erts_alloc_message_heap(Process *pp,
Eterm **hpp,
ErlOffHeap **ohpp)
{
- erts_aint32_t state = erts_smp_atomic32_read_nob(&pp->state);
+ erts_aint32_t state = pp ? erts_smp_atomic32_read_nob(&pp->state) : 0;
return erts_alloc_message_heap_state(pp, &state, plp, sz, hpp, ohpp);
}
diff --git a/erts/emulator/beam/erl_process_dict.c b/erts/emulator/beam/erl_process_dict.c
index 487b944fc0..d8c2eaba94 100644
--- a/erts/emulator/beam/erl_process_dict.c
+++ b/erts/emulator/beam/erl_process_dict.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_process_dict.h b/erts/emulator/beam/erl_process_dict.h
index dac214c8a1..387562058c 100644
--- a/erts/emulator/beam/erl_process_dict.h
+++ b/erts/emulator/beam/erl_process_dict.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_process_dump.c b/erts/emulator/beam/erl_process_dump.c
index 39c36ee7a9..fa76773cac 100644
--- a/erts/emulator/beam/erl_process_dump.c
+++ b/erts/emulator/beam/erl_process_dump.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -103,7 +103,7 @@ Uint erts_process_memory(Process *p, int incl_msg_inq) {
size += p->arity * sizeof(p->arg_reg[0]);
}
- if (p->psd)
+ if (erts_smp_atomic_read_nob(&p->psd) != (erts_aint_t) NULL)
size += sizeof(ErtsPSD);
scb = ERTS_PROC_GET_SAVED_CALLS_BUF(p);
diff --git a/erts/emulator/beam/erl_process_lock.c b/erts/emulator/beam/erl_process_lock.c
index 0bee2c848c..a69185bc5c 100644
--- a/erts/emulator/beam/erl_process_lock.c
+++ b/erts/emulator/beam/erl_process_lock.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2007-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -106,6 +106,7 @@ static struct {
Sint16 proc_lock_msgq;
Sint16 proc_lock_btm;
Sint16 proc_lock_status;
+ Sint16 proc_lock_trace;
} lc_id;
#endif
@@ -152,6 +153,7 @@ erts_init_proc_lock(int cpus)
lc_id.proc_lock_msgq = erts_lc_get_lock_order_id("proc_msgq");
lc_id.proc_lock_btm = erts_lc_get_lock_order_id("proc_btm");
lc_id.proc_lock_status = erts_lc_get_lock_order_id("proc_status");
+ lc_id.proc_lock_trace = erts_lc_get_lock_order_id("proc_trace");
#endif
}
@@ -1057,6 +1059,11 @@ erts_proc_lock_init(Process *p)
#ifdef ERTS_ENABLE_LOCK_CHECK
erts_lc_trylock(1, &p->lock.status.lc);
#endif
+ erts_mtx_init_x(&p->lock.trace, "proc_trace", p->common.id, do_lock_count);
+ ethr_mutex_lock(&p->lock.trace.mtx);
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ erts_lc_trylock(1, &p->lock.trace.lc);
+#endif
#endif
#ifdef ERTS_PROC_LOCK_DEBUG
for (i = 0; i <= ERTS_PROC_LOCK_MAX_BIT; i++)
@@ -1078,6 +1085,7 @@ erts_proc_lock_fin(Process *p)
erts_mtx_destroy(&p->lock.msgq);
erts_mtx_destroy(&p->lock.btm);
erts_mtx_destroy(&p->lock.status);
+ erts_mtx_destroy(&p->lock.trace);
#endif
#if defined(ERTS_ENABLE_LOCK_COUNT) && defined(ERTS_SMP)
erts_lcnt_proc_lock_destroy(p);
@@ -1100,26 +1108,29 @@ void erts_lcnt_enable_proc_lock_count(int enable) {
void erts_lcnt_proc_lock_init(Process *p) {
if (!(erts_lcnt_rt_options & ERTS_LCNT_OPT_PROCLOCK)) {
erts_lcnt_init_lock_empty(&(p->lock.lcnt_main));
+ erts_lcnt_init_lock_empty(&(p->lock.lcnt_link));
erts_lcnt_init_lock_empty(&(p->lock.lcnt_msgq));
erts_lcnt_init_lock_empty(&(p->lock.lcnt_btm));
- erts_lcnt_init_lock_empty(&(p->lock.lcnt_link));
erts_lcnt_init_lock_empty(&(p->lock.lcnt_status));
+ erts_lcnt_init_lock_empty(&(p->lock.lcnt_trace));
} else { /* now the common case */
Eterm pid = (p->common.id != ERTS_INVALID_PID) ? p->common.id : NIL;
erts_lcnt_init_lock_x(&(p->lock.lcnt_main), "proc_main", ERTS_LCNT_LT_PROCLOCK, pid);
+ erts_lcnt_init_lock_x(&(p->lock.lcnt_link), "proc_link", ERTS_LCNT_LT_PROCLOCK, pid);
erts_lcnt_init_lock_x(&(p->lock.lcnt_msgq), "proc_msgq", ERTS_LCNT_LT_PROCLOCK, pid);
erts_lcnt_init_lock_x(&(p->lock.lcnt_btm), "proc_btm", ERTS_LCNT_LT_PROCLOCK, pid);
- erts_lcnt_init_lock_x(&(p->lock.lcnt_link), "proc_link", ERTS_LCNT_LT_PROCLOCK, pid);
erts_lcnt_init_lock_x(&(p->lock.lcnt_status),"proc_status",ERTS_LCNT_LT_PROCLOCK, pid);
+ erts_lcnt_init_lock_x(&(p->lock.lcnt_trace), "proc_trace", ERTS_LCNT_LT_PROCLOCK, pid);
} /* the lock names should really be aligned to four characters */
} /* logic reversed */
void erts_lcnt_proc_lock_destroy(Process *p) {
erts_lcnt_destroy_lock(&(p->lock.lcnt_main));
+ erts_lcnt_destroy_lock(&(p->lock.lcnt_link));
erts_lcnt_destroy_lock(&(p->lock.lcnt_msgq));
erts_lcnt_destroy_lock(&(p->lock.lcnt_btm));
- erts_lcnt_destroy_lock(&(p->lock.lcnt_link));
erts_lcnt_destroy_lock(&(p->lock.lcnt_status));
+ erts_lcnt_destroy_lock(&(p->lock.lcnt_trace));
}
static void lcnt_enable_proc_lock_count(Process *proc, int enable) {
@@ -1138,10 +1149,11 @@ static void lcnt_enable_proc_lock_count(Process *proc, int enable) {
void erts_lcnt_proc_lock(erts_proc_lock_t *lock, ErtsProcLocks locks) {
if (!(erts_lcnt_rt_options & ERTS_LCNT_OPT_PROCLOCK)) return;
if (locks & ERTS_PROC_LOCK_MAIN) { erts_lcnt_lock(&(lock->lcnt_main)); }
+ if (locks & ERTS_PROC_LOCK_LINK) { erts_lcnt_lock(&(lock->lcnt_link)); }
if (locks & ERTS_PROC_LOCK_MSGQ) { erts_lcnt_lock(&(lock->lcnt_msgq)); }
if (locks & ERTS_PROC_LOCK_BTM) { erts_lcnt_lock(&(lock->lcnt_btm)); }
- if (locks & ERTS_PROC_LOCK_LINK) { erts_lcnt_lock(&(lock->lcnt_link)); }
if (locks & ERTS_PROC_LOCK_STATUS) { erts_lcnt_lock(&(lock->lcnt_status)); }
+ if (locks & ERTS_PROC_LOCK_TRACE) { erts_lcnt_lock(&(lock->lcnt_trace)); }
}
void erts_lcnt_proc_lock_post_x(erts_proc_lock_t *lock, ErtsProcLocks locks,
@@ -1150,44 +1162,50 @@ void erts_lcnt_proc_lock_post_x(erts_proc_lock_t *lock, ErtsProcLocks locks,
if (locks & ERTS_PROC_LOCK_MAIN) {
erts_lcnt_lock_post_x(&(lock->lcnt_main), file, line);
}
+ if (locks & ERTS_PROC_LOCK_LINK) {
+ erts_lcnt_lock_post_x(&(lock->lcnt_link), file, line);
+ }
if (locks & ERTS_PROC_LOCK_MSGQ) {
erts_lcnt_lock_post_x(&(lock->lcnt_msgq), file, line);
}
if (locks & ERTS_PROC_LOCK_BTM) {
erts_lcnt_lock_post_x(&(lock->lcnt_btm), file, line);
}
- if (locks & ERTS_PROC_LOCK_LINK) {
- erts_lcnt_lock_post_x(&(lock->lcnt_link), file, line);
- }
if (locks & ERTS_PROC_LOCK_STATUS) {
erts_lcnt_lock_post_x(&(lock->lcnt_status), file, line);
}
+ if (locks & ERTS_PROC_LOCK_TRACE) {
+ erts_lcnt_lock_post_x(&(lock->lcnt_trace), file, line);
+ }
}
void erts_lcnt_proc_lock_unaquire(erts_proc_lock_t *lock, ErtsProcLocks locks) {
if (!(erts_lcnt_rt_options & ERTS_LCNT_OPT_PROCLOCK)) return;
if (locks & ERTS_PROC_LOCK_MAIN) { erts_lcnt_lock_unaquire(&(lock->lcnt_main)); }
+ if (locks & ERTS_PROC_LOCK_LINK) { erts_lcnt_lock_unaquire(&(lock->lcnt_link)); }
if (locks & ERTS_PROC_LOCK_MSGQ) { erts_lcnt_lock_unaquire(&(lock->lcnt_msgq)); }
if (locks & ERTS_PROC_LOCK_BTM) { erts_lcnt_lock_unaquire(&(lock->lcnt_btm)); }
- if (locks & ERTS_PROC_LOCK_LINK) { erts_lcnt_lock_unaquire(&(lock->lcnt_link)); }
if (locks & ERTS_PROC_LOCK_STATUS) { erts_lcnt_lock_unaquire(&(lock->lcnt_status)); }
+ if (locks & ERTS_PROC_LOCK_TRACE) { erts_lcnt_lock_unaquire(&(lock->lcnt_trace)); }
}
void erts_lcnt_proc_unlock(erts_proc_lock_t *lock, ErtsProcLocks locks) {
if (!(erts_lcnt_rt_options & ERTS_LCNT_OPT_PROCLOCK)) return;
if (locks & ERTS_PROC_LOCK_MAIN) { erts_lcnt_unlock(&(lock->lcnt_main)); }
+ if (locks & ERTS_PROC_LOCK_LINK) { erts_lcnt_unlock(&(lock->lcnt_link)); }
if (locks & ERTS_PROC_LOCK_MSGQ) { erts_lcnt_unlock(&(lock->lcnt_msgq)); }
if (locks & ERTS_PROC_LOCK_BTM) { erts_lcnt_unlock(&(lock->lcnt_btm)); }
- if (locks & ERTS_PROC_LOCK_LINK) { erts_lcnt_unlock(&(lock->lcnt_link)); }
if (locks & ERTS_PROC_LOCK_STATUS) { erts_lcnt_unlock(&(lock->lcnt_status)); }
+ if (locks & ERTS_PROC_LOCK_TRACE) { erts_lcnt_unlock(&(lock->lcnt_trace)); }
}
void erts_lcnt_proc_trylock(erts_proc_lock_t *lock, ErtsProcLocks locks, int res) {
if (!(erts_lcnt_rt_options & ERTS_LCNT_OPT_PROCLOCK)) return;
if (locks & ERTS_PROC_LOCK_MAIN) { erts_lcnt_trylock(&(lock->lcnt_main), res); }
+ if (locks & ERTS_PROC_LOCK_LINK) { erts_lcnt_trylock(&(lock->lcnt_link), res); }
if (locks & ERTS_PROC_LOCK_MSGQ) { erts_lcnt_trylock(&(lock->lcnt_msgq), res); }
if (locks & ERTS_PROC_LOCK_BTM) { erts_lcnt_trylock(&(lock->lcnt_btm), res); }
- if (locks & ERTS_PROC_LOCK_LINK) { erts_lcnt_trylock(&(lock->lcnt_link), res); }
if (locks & ERTS_PROC_LOCK_STATUS) { erts_lcnt_trylock(&(lock->lcnt_status), res); }
+ if (locks & ERTS_PROC_LOCK_TRACE) { erts_lcnt_trylock(&(lock->lcnt_trace), res); }
} /* reversed logic */
#endif /* ERTS_ENABLE_LOCK_COUNT */
@@ -1224,6 +1242,10 @@ erts_proc_lc_lock(Process *p, ErtsProcLocks locks, char *file, unsigned int line
lck.id = lc_id.proc_lock_status;
erts_lc_lock_x(&lck,file,line);
}
+ if (locks & ERTS_PROC_LOCK_TRACE) {
+ lck.id = lc_id.proc_lock_trace;
+ erts_lc_lock_x(&lck,file,line);
+ }
}
void
@@ -1253,6 +1275,10 @@ erts_proc_lc_trylock(Process *p, ErtsProcLocks locks, int locked,
lck.id = lc_id.proc_lock_status;
erts_lc_trylock_x(locked, &lck, file, line);
}
+ if (locks & ERTS_PROC_LOCK_TRACE) {
+ lck.id = lc_id.proc_lock_trace;
+ erts_lc_trylock_x(locked, &lck, file, line);
+ }
}
void
@@ -1261,6 +1287,10 @@ erts_proc_lc_unlock(Process *p, ErtsProcLocks locks)
erts_lc_lock_t lck = ERTS_LC_LOCK_INIT(-1,
p->common.id,
ERTS_LC_FLG_LT_PROCLOCK);
+ if (locks & ERTS_PROC_LOCK_TRACE) {
+ lck.id = lc_id.proc_lock_trace;
+ erts_lc_unlock(&lck);
+ }
if (locks & ERTS_PROC_LOCK_STATUS) {
lck.id = lc_id.proc_lock_status;
erts_lc_unlock(&lck);
@@ -1292,6 +1322,10 @@ erts_proc_lc_might_unlock(Process *p, ErtsProcLocks locks)
erts_lc_lock_t lck = ERTS_LC_LOCK_INIT(-1,
p->common.id,
ERTS_LC_FLG_LT_PROCLOCK);
+ if (locks & ERTS_PROC_LOCK_TRACE) {
+ lck.id = lc_id.proc_lock_trace;
+ erts_lc_might_unlock(&lck);
+ }
if (locks & ERTS_PROC_LOCK_STATUS) {
lck.id = lc_id.proc_lock_status;
erts_lc_might_unlock(&lck);
@@ -1323,6 +1357,8 @@ erts_proc_lc_might_unlock(Process *p, ErtsProcLocks locks)
erts_lc_might_unlock(&p->lock.btm.lc);
if (locks & ERTS_PROC_LOCK_STATUS)
erts_lc_might_unlock(&p->lock.status.lc);
+ if (locks & ERTS_PROC_LOCK_TRACE)
+ erts_lc_might_unlock(&p->lock.trace.lc);
#endif
}
@@ -1354,6 +1390,10 @@ erts_proc_lc_require_lock(Process *p, ErtsProcLocks locks, char *file,
lck.id = lc_id.proc_lock_status;
erts_lc_require_lock(&lck, file, line);
}
+ if (locks & ERTS_PROC_LOCK_TRACE) {
+ lck.id = lc_id.proc_lock_trace;
+ erts_lc_require_lock(&lck, file, line);
+ }
#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
if (locks & ERTS_PROC_LOCK_MAIN)
erts_lc_require_lock(&p->lock.main.lc, file, line);
@@ -1365,6 +1405,8 @@ erts_proc_lc_require_lock(Process *p, ErtsProcLocks locks, char *file,
erts_lc_require_lock(&p->lock.btm.lc, file, line);
if (locks & ERTS_PROC_LOCK_STATUS)
erts_lc_require_lock(&p->lock.status.lc, file, line);
+ if (locks & ERTS_PROC_LOCK_TRACE)
+ erts_lc_require_lock(&p->lock.trace.lc, file, line);
#endif
}
@@ -1375,6 +1417,10 @@ erts_proc_lc_unrequire_lock(Process *p, ErtsProcLocks locks)
erts_lc_lock_t lck = ERTS_LC_LOCK_INIT(-1,
p->common.id,
ERTS_LC_FLG_LT_PROCLOCK);
+ if (locks & ERTS_PROC_LOCK_TRACE) {
+ lck.id = lc_id.proc_lock_trace;
+ erts_lc_unrequire_lock(&lck);
+ }
if (locks & ERTS_PROC_LOCK_STATUS) {
lck.id = lc_id.proc_lock_status;
erts_lc_unrequire_lock(&lck);
@@ -1406,6 +1452,8 @@ erts_proc_lc_unrequire_lock(Process *p, ErtsProcLocks locks)
erts_lc_unrequire_lock(&p->lock.btm.lc);
if (locks & ERTS_PROC_LOCK_STATUS)
erts_lc_unrequire_lock(&p->lock.status.lc);
+ if (locks & ERTS_PROC_LOCK_TRACE)
+ erts_lc_unrequire_lock(&p->lock.trace.lc);
#endif
}
@@ -1429,6 +1477,8 @@ erts_proc_lc_trylock_force_busy(Process *p, ErtsProcLocks locks)
lck.id = lc_id.proc_lock_btm;
else if (locks & ERTS_PROC_LOCK_STATUS)
lck.id = lc_id.proc_lock_status;
+ else if (locks & ERTS_PROC_LOCK_TRACE)
+ lck.id = lc_id.proc_lock_trace;
else
erts_lc_fail("Unknown proc lock found");
@@ -1441,14 +1491,7 @@ erts_proc_lc_trylock_force_busy(Process *p, ErtsProcLocks locks)
void erts_proc_lc_chk_only_proc_main(Process *p)
{
-#if ERTS_PROC_LOCK_OWN_IMPL
- erts_lc_lock_t proc_main = ERTS_LC_LOCK_INIT(lc_id.proc_lock_main,
- p->common.id,
- ERTS_LC_FLG_LT_PROCLOCK);
- erts_lc_check_exact(&proc_main, 1);
-#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
- erts_lc_check_exact(&p->lock.main.lc, 1);
-#endif
+ erts_proc_lc_chk_only_proc(p, ERTS_PROC_LOCK_MAIN);
}
#if ERTS_PROC_LOCK_OWN_IMPL
@@ -1456,14 +1499,67 @@ void erts_proc_lc_chk_only_proc_main(Process *p)
ERTS_LC_LOCK_INIT(-1, THE_NON_VALUE, ERTS_LC_FLG_LT_PROCLOCK)
#endif /* ERTS_PROC_LOCK_OWN_IMPL */
+void erts_proc_lc_chk_only_proc(Process *p, ErtsProcLocks locks)
+{
+ int have_locks_len = 0;
+#if ERTS_PROC_LOCK_OWN_IMPL
+ erts_lc_lock_t have_locks[6] = {ERTS_PROC_LC_EMPTY_LOCK_INIT,
+ ERTS_PROC_LC_EMPTY_LOCK_INIT,
+ ERTS_PROC_LC_EMPTY_LOCK_INIT,
+ ERTS_PROC_LC_EMPTY_LOCK_INIT,
+ ERTS_PROC_LC_EMPTY_LOCK_INIT,
+ ERTS_PROC_LC_EMPTY_LOCK_INIT};
+ if (locks & ERTS_PROC_LOCK_MAIN) {
+ have_locks[have_locks_len].id = lc_id.proc_lock_main;
+ have_locks[have_locks_len++].extra = p->common.id;
+ }
+ if (locks & ERTS_PROC_LOCK_LINK) {
+ have_locks[have_locks_len].id = lc_id.proc_lock_link;
+ have_locks[have_locks_len++].extra = p->common.id;
+ }
+ if (locks & ERTS_PROC_LOCK_MSGQ) {
+ have_locks[have_locks_len].id = lc_id.proc_lock_msgq;
+ have_locks[have_locks_len++].extra = p->common.id;
+ }
+ if (locks & ERTS_PROC_LOCK_BTM) {
+ have_locks[have_locks_len].id = lc_id.proc_lock_btm;
+ have_locks[have_locks_len++].extra = p->common.id;
+ }
+ if (locks & ERTS_PROC_LOCK_STATUS) {
+ have_locks[have_locks_len].id = lc_id.proc_lock_status;
+ have_locks[have_locks_len++].extra = p->common.id;
+ }
+ if (locks & ERTS_PROC_LOCK_TRACE) {
+ have_locks[have_locks_len].id = lc_id.proc_lock_trace;
+ have_locks[have_locks_len++].extra = p->common.id;
+ }
+#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
+ erts_lc_lock_t have_locks[6];
+ if (locks & ERTS_PROC_LOCK_MAIN)
+ have_locks[have_locks_len++] = p->lock.main.lc;
+ if (locks & ERTS_PROC_LOCK_LINK)
+ have_locks[have_locks_len++] = p->lock.link.lc;
+ if (locks & ERTS_PROC_LOCK_MSGQ)
+ have_locks[have_locks_len++] = p->lock.msgq.lc;
+ if (locks & ERTS_PROC_LOCK_BTM)
+ have_locks[have_locks_len++] = p->lock.btm.lc;
+ if (locks & ERTS_PROC_LOCK_STATUS)
+ have_locks[have_locks_len++] = p->lock.status.lc;
+ if (locks & ERTS_PROC_LOCK_TRACE)
+ have_locks[have_locks_len++] = p->lock.trace.lc;
+#endif
+ erts_lc_check_exact(have_locks, have_locks_len);
+}
+
void
erts_proc_lc_chk_have_proc_locks(Process *p, ErtsProcLocks locks)
{
int have_locks_len = 0;
#if ERTS_PROC_LOCK_OWN_IMPL
- erts_lc_lock_t have_locks[5] = {ERTS_PROC_LC_EMPTY_LOCK_INIT,
+ erts_lc_lock_t have_locks[6] = {ERTS_PROC_LC_EMPTY_LOCK_INIT,
ERTS_PROC_LC_EMPTY_LOCK_INIT,
ERTS_PROC_LC_EMPTY_LOCK_INIT,
+ ERTS_PROC_LC_EMPTY_LOCK_INIT,
ERTS_PROC_LC_EMPTY_LOCK_INIT,
ERTS_PROC_LC_EMPTY_LOCK_INIT};
if (locks & ERTS_PROC_LOCK_MAIN) {
@@ -1486,8 +1582,12 @@ erts_proc_lc_chk_have_proc_locks(Process *p, ErtsProcLocks locks)
have_locks[have_locks_len].id = lc_id.proc_lock_status;
have_locks[have_locks_len++].extra = p->common.id;
}
+ if (locks & ERTS_PROC_LOCK_TRACE) {
+ have_locks[have_locks_len].id = lc_id.proc_lock_trace;
+ have_locks[have_locks_len++].extra = p->common.id;
+ }
#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
- erts_lc_lock_t have_locks[5];
+ erts_lc_lock_t have_locks[6];
if (locks & ERTS_PROC_LOCK_MAIN)
have_locks[have_locks_len++] = p->lock.main.lc;
if (locks & ERTS_PROC_LOCK_LINK)
@@ -1498,6 +1598,8 @@ erts_proc_lc_chk_have_proc_locks(Process *p, ErtsProcLocks locks)
have_locks[have_locks_len++] = p->lock.btm.lc;
if (locks & ERTS_PROC_LOCK_STATUS)
have_locks[have_locks_len++] = p->lock.status.lc;
+ if (locks & ERTS_PROC_LOCK_TRACE)
+ have_locks[have_locks_len++] = p->lock.trace.lc;
#endif
erts_lc_check(have_locks, have_locks_len, NULL, 0);
}
@@ -1508,12 +1610,14 @@ erts_proc_lc_chk_proc_locks(Process *p, ErtsProcLocks locks)
int have_locks_len = 0;
int have_not_locks_len = 0;
#if ERTS_PROC_LOCK_OWN_IMPL
- erts_lc_lock_t have_locks[5] = {ERTS_PROC_LC_EMPTY_LOCK_INIT,
+ erts_lc_lock_t have_locks[6] = {ERTS_PROC_LC_EMPTY_LOCK_INIT,
ERTS_PROC_LC_EMPTY_LOCK_INIT,
+ ERTS_PROC_LC_EMPTY_LOCK_INIT,
ERTS_PROC_LC_EMPTY_LOCK_INIT,
ERTS_PROC_LC_EMPTY_LOCK_INIT};
- erts_lc_lock_t have_not_locks[5] = {ERTS_PROC_LC_EMPTY_LOCK_INIT,
+ erts_lc_lock_t have_not_locks[6] = {ERTS_PROC_LC_EMPTY_LOCK_INIT,
ERTS_PROC_LC_EMPTY_LOCK_INIT,
+ ERTS_PROC_LC_EMPTY_LOCK_INIT,
ERTS_PROC_LC_EMPTY_LOCK_INIT,
ERTS_PROC_LC_EMPTY_LOCK_INIT};
@@ -1557,9 +1661,17 @@ erts_proc_lc_chk_proc_locks(Process *p, ErtsProcLocks locks)
have_not_locks[have_not_locks_len].id = lc_id.proc_lock_status;
have_not_locks[have_not_locks_len++].extra = p->common.id;
}
+ if (locks & ERTS_PROC_LOCK_TRACE) {
+ have_locks[have_locks_len].id = lc_id.proc_lock_trace;
+ have_locks[have_locks_len++].extra = p->common.id;
+ }
+ else {
+ have_not_locks[have_not_locks_len].id = lc_id.proc_lock_trace;
+ have_not_locks[have_not_locks_len++].extra = p->common.id;
+ }
#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
- erts_lc_lock_t have_locks[5];
- erts_lc_lock_t have_not_locks[5];
+ erts_lc_lock_t have_locks[6];
+ erts_lc_lock_t have_not_locks[6];
if (locks & ERTS_PROC_LOCK_MAIN)
have_locks[have_locks_len++] = p->lock.main.lc;
@@ -1581,6 +1693,10 @@ erts_proc_lc_chk_proc_locks(Process *p, ErtsProcLocks locks)
have_locks[have_locks_len++] = p->lock.status.lc;
else
have_not_locks[have_not_locks_len++] = p->lock.status.lc;
+ if (locks & ERTS_PROC_LOCK_TRACE)
+ have_locks[have_locks_len++] = p->lock.trace.lc;
+ else
+ have_not_locks[have_not_locks_len++] = p->lock.trace.lc;
#endif
erts_lc_check(have_locks, have_locks_len,
@@ -1590,10 +1706,10 @@ erts_proc_lc_chk_proc_locks(Process *p, ErtsProcLocks locks)
ErtsProcLocks
erts_proc_lc_my_proc_locks(Process *p)
{
- int resv[5];
+ int resv[6];
ErtsProcLocks res = 0;
#if ERTS_PROC_LOCK_OWN_IMPL
- erts_lc_lock_t locks[5] = {ERTS_LC_LOCK_INIT(lc_id.proc_lock_main,
+ erts_lc_lock_t locks[6] = {ERTS_LC_LOCK_INIT(lc_id.proc_lock_main,
p->common.id,
ERTS_LC_FLG_LT_PROCLOCK),
ERTS_LC_LOCK_INIT(lc_id.proc_lock_link,
@@ -1607,16 +1723,20 @@ erts_proc_lc_my_proc_locks(Process *p)
ERTS_LC_FLG_LT_PROCLOCK),
ERTS_LC_LOCK_INIT(lc_id.proc_lock_status,
p->common.id,
+ ERTS_LC_FLG_LT_PROCLOCK),
+ ERTS_LC_LOCK_INIT(lc_id.proc_lock_trace,
+ p->common.id,
ERTS_LC_FLG_LT_PROCLOCK)};
#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
- erts_lc_lock_t locks[5] = {p->lock.main.lc,
+ erts_lc_lock_t locks[6] = {p->lock.main.lc,
p->lock.link.lc,
p->lock.msgq.lc,
p->lock.btm.lc,
- p->lock.status.lc};
+ p->lock.status.lc,
+ p->lock.trace.lc};
#endif
- erts_lc_have_locks(resv, locks, 5);
+ erts_lc_have_locks(resv, locks, 6);
if (resv[0])
res |= ERTS_PROC_LOCK_MAIN;
if (resv[1])
@@ -1627,6 +1747,8 @@ erts_proc_lc_my_proc_locks(Process *p)
res |= ERTS_PROC_LOCK_BTM;
if (resv[4])
res |= ERTS_PROC_LOCK_STATUS;
+ if (resv[5])
+ res |= ERTS_PROC_LOCK_TRACE;
return res;
}
@@ -1634,14 +1756,15 @@ erts_proc_lc_my_proc_locks(Process *p)
void
erts_proc_lc_chk_no_proc_locks(char *file, int line)
{
- int resv[5];
- int ids[5] = {lc_id.proc_lock_main,
+ int resv[6];
+ int ids[6] = {lc_id.proc_lock_main,
lc_id.proc_lock_link,
lc_id.proc_lock_msgq,
lc_id.proc_lock_btm,
- lc_id.proc_lock_status};
- erts_lc_have_lock_ids(resv, ids, 5);
- if (!ERTS_IS_CRASH_DUMPING && (resv[0] || resv[1] || resv[2] || resv[3] || resv[4])) {
+ lc_id.proc_lock_status,
+ lc_id.proc_lock_trace};
+ erts_lc_have_lock_ids(resv, ids, 6);
+ if (!ERTS_IS_CRASH_DUMPING && (resv[0] || resv[1] || resv[2] || resv[3] || resv[4] || resv[5])) {
erts_lc_fail("%s:%d: Thread has process locks locked when expected "
"not to have any process locks locked",
file, line);
diff --git a/erts/emulator/beam/erl_process_lock.h b/erts/emulator/beam/erl_process_lock.h
index 9c59301086..2cccf0697a 100644
--- a/erts/emulator/beam/erl_process_lock.h
+++ b/erts/emulator/beam/erl_process_lock.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2007-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -66,7 +66,7 @@
#endif
-#define ERTS_PROC_LOCK_MAX_BIT 4
+#define ERTS_PROC_LOCK_MAX_BIT 5
typedef erts_aint32_t ErtsProcLocks;
@@ -84,6 +84,7 @@ typedef struct erts_proc_lock_t_ {
erts_lcnt_lock_t lcnt_msgq;
erts_lcnt_lock_t lcnt_btm;
erts_lcnt_lock_t lcnt_status;
+ erts_lcnt_lock_t lcnt_trace;
#endif
#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
erts_mtx_t main;
@@ -91,6 +92,7 @@ typedef struct erts_proc_lock_t_ {
erts_mtx_t msgq;
erts_mtx_t btm;
erts_mtx_t status;
+ erts_mtx_t trace;
#else
# error "no implementation"
#endif
@@ -137,9 +139,18 @@ typedef struct erts_proc_lock_t_ {
* Protects the following fields in the process structure:
* * pending_suspenders
* * suspendee
+ * * sys_tasks
* * ...
*/
-#define ERTS_PROC_LOCK_STATUS (((ErtsProcLocks) 1) << ERTS_PROC_LOCK_MAX_BIT)
+#define ERTS_PROC_LOCK_STATUS (((ErtsProcLocks) 1) << 4)
+
+/*
+ * Trace message lock:
+ * Protects the order in which messages are sent
+ * from trace nifs. This lock is taken inside enif_send.
+ *
+ */
+#define ERTS_PROC_LOCK_TRACE (((ErtsProcLocks) 1) << ERTS_PROC_LOCK_MAX_BIT)
/*
* Special fields:
@@ -154,8 +165,8 @@ typedef struct erts_proc_lock_t_ {
* all process locks are held, and are allowed to be read if
* at least one process lock (whichever one doesn't matter)
* is held:
- * * tracer_proc
- * * tracer_flags
+ * * common.tracer
+ * * common.trace_flags
*
* The following fields are only allowed to be accessed if
* both the schedule queue lock and at least one process lock
@@ -198,17 +209,15 @@ typedef struct erts_proc_lock_t_ {
/* ERTS_PROC_LOCKS_* are combinations of process locks */
-#define ERTS_PROC_LOCKS_MSG_RECEIVE (ERTS_PROC_LOCK_MSGQ \
- | ERTS_PROC_LOCK_STATUS)
-#define ERTS_PROC_LOCKS_MSG_SEND (ERTS_PROC_LOCK_MSGQ \
- | ERTS_PROC_LOCK_STATUS)
+#define ERTS_PROC_LOCKS_MSG_RECEIVE ERTS_PROC_LOCK_MSGQ
+#define ERTS_PROC_LOCKS_MSG_SEND ERTS_PROC_LOCK_MSGQ
#define ERTS_PROC_LOCKS_XSIG_SEND ERTS_PROC_LOCK_STATUS
#define ERTS_PROC_LOCKS_ALL \
((((ErtsProcLocks) 1) << (ERTS_PROC_LOCK_MAX_BIT + 1)) - 1)
#define ERTS_PROC_LOCKS_ALL_MINOR (ERTS_PROC_LOCKS_ALL \
- & ~ERTS_PROC_LOCK_MAIN)
+ & ~ERTS_PROC_LOCK_MAIN)
#define ERTS_PIX_LOCKS_BITS 10
@@ -260,6 +269,7 @@ void erts_proc_lc_might_unlock(Process *p, ErtsProcLocks locks);
void erts_proc_lc_chk_have_proc_locks(Process *p, ErtsProcLocks locks);
void erts_proc_lc_chk_proc_locks(Process *p, ErtsProcLocks locks);
void erts_proc_lc_chk_only_proc_main(Process *p);
+void erts_proc_lc_chk_only_proc(Process *p, ErtsProcLocks locks);
void erts_proc_lc_chk_no_proc_locks(char *file, int line);
ErtsProcLocks erts_proc_lc_my_proc_locks(Process *p);
int erts_proc_lc_trylock_force_busy(Process *p, ErtsProcLocks locks);
@@ -477,9 +487,15 @@ erts_smp_proc_raw_trylock__(Process *p, ErtsProcLocks locks)
if (locks & ERTS_PROC_LOCK_STATUS)
if (erts_mtx_trylock(&p->lock.status) == EBUSY)
goto busy_status;
+ if (locks & ERTS_PROC_LOCK_TRACE)
+ if (erts_mtx_trylock(&p->lock.trace) == EBUSY)
+ goto busy_trace;
return 0;
+busy_trace:
+ if (locks & ERTS_PROC_LOCK_TRACE)
+ erts_mtx_unlock(&p->lock.trace);
busy_status:
if (locks & ERTS_PROC_LOCK_BTM)
erts_mtx_unlock(&p->lock.btm);
@@ -568,6 +584,8 @@ erts_smp_proc_lock__(Process *p,
erts_mtx_lock(&p->lock.btm);
if (locks & ERTS_PROC_LOCK_STATUS)
erts_mtx_lock(&p->lock.status);
+ if (locks & ERTS_PROC_LOCK_TRACE)
+ erts_mtx_lock(&p->lock.trace);
#ifdef ERTS_PROC_LOCK_DEBUG
erts_proc_lock_op_debug(p, locks, 1);
@@ -653,6 +671,8 @@ erts_smp_proc_unlock__(Process *p,
erts_proc_lock_op_debug(p, locks, 0);
#endif
+ if (locks & ERTS_PROC_LOCK_TRACE)
+ erts_mtx_unlock(&p->lock.trace);
if (locks & ERTS_PROC_LOCK_STATUS)
erts_mtx_unlock(&p->lock.status);
if (locks & ERTS_PROC_LOCK_BTM)
diff --git a/erts/emulator/beam/erl_ptab.c b/erts/emulator/beam/erl_ptab.c
index 9ed175fe01..22830a19c4 100644
--- a/erts/emulator/beam/erl_ptab.c
+++ b/erts/emulator/beam/erl_ptab.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2012-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2012-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_ptab.h b/erts/emulator/beam/erl_ptab.h
index 8fd961e3ce..a5931ffc25 100644
--- a/erts/emulator/beam/erl_ptab.h
+++ b/erts/emulator/beam/erl_ptab.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2012-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2012-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,14 +37,16 @@
#include "erl_alloc.h"
#include "erl_monitors.h"
-#define ERTS_TRACER_PROC(P) ((P)->common.tracer_proc)
+#define ERTS_TRACER(P) ((P)->common.tracer)
+#define ERTS_TRACER_MODULE(T) (CAR(list_val(T)))
+#define ERTS_TRACER_STATE(T) (CDR(list_val(T)))
#define ERTS_TRACE_FLAGS(P) ((P)->common.trace_flags)
#define ERTS_P_LINKS(P) ((P)->common.u.alive.links)
#define ERTS_P_MONITORS(P) ((P)->common.u.alive.monitors)
#define IS_TRACED(p) \
- (ERTS_TRACER_PROC((p)) != NIL)
+ (ERTS_TRACER(p) != NIL)
#define ARE_TRACE_FLAGS_ON(p,tf) \
((ERTS_TRACE_FLAGS((p)) & (tf|F_SENSITIVE)) == (tf))
#define IS_TRACED_FL(p,tf) \
@@ -56,7 +58,7 @@ typedef struct {
erts_atomic_t atmc;
Sint sint;
} refc;
- Eterm tracer_proc;
+ ErtsTracer tracer;
Uint trace_flags;
erts_smp_atomic_t timer;
union {
diff --git a/erts/emulator/beam/erl_sched_spec_pre_alloc.c b/erts/emulator/beam/erl_sched_spec_pre_alloc.c
index caec24bc03..cab4bd73db 100644
--- a/erts/emulator/beam/erl_sched_spec_pre_alloc.c
+++ b/erts/emulator/beam/erl_sched_spec_pre_alloc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_sched_spec_pre_alloc.h b/erts/emulator/beam/erl_sched_spec_pre_alloc.h
index 4d07b0f674..7808d7d438 100644
--- a/erts/emulator/beam/erl_sched_spec_pre_alloc.h
+++ b/erts/emulator/beam/erl_sched_spec_pre_alloc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_smp.h b/erts/emulator/beam/erl_smp.h
index 5fc5e989a6..713ed50b86 100644
--- a/erts/emulator/beam/erl_smp.h
+++ b/erts/emulator/beam/erl_smp.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_sock.h b/erts/emulator/beam/erl_sock.h
index 7be6062115..3429a52d7e 100644
--- a/erts/emulator/beam/erl_sock.h
+++ b/erts/emulator/beam/erl_sock.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_sys_driver.h b/erts/emulator/beam/erl_sys_driver.h
index 4031eef0aa..d46e88cb05 100644
--- a/erts/emulator/beam/erl_sys_driver.h
+++ b/erts/emulator/beam/erl_sys_driver.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_term.c b/erts/emulator/beam/erl_term.c
index d2343912b4..7d857ad326 100644
--- a/erts/emulator/beam/erl_term.c
+++ b/erts/emulator/beam/erl_term.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -59,96 +59,6 @@ erts_set_literal_tag(Eterm *term, Eterm *hp_start, Eterm hsz)
#endif
}
-__decl_noreturn static void __noreturn
-et_abort(const char *expr, const char *file, unsigned line)
-{
-#ifdef EXIT_ON_ET_ABORT
- static int have_been_called = 0;
-
- if (have_been_called) {
- abort();
- } else {
- /*
- * Prevent infinite loop.
- */
- have_been_called = 1;
- erts_exit(ERTS_ERROR_EXIT, "TYPE ASSERTION FAILED, file %s, line %u: %s\n", file, line, expr);
- }
-#else
- erts_fprintf(stderr, "TYPE ASSERTION FAILED, file %s, line %u: %s\n", file, line, expr);
- abort();
-#endif
-}
-
-#if ET_DEBUG
-#define ET_ASSERT(expr,file,line) \
-do { \
- if (!(expr)) \
- et_abort(#expr, file, line); \
-} while(0)
-#else
-#define ET_ASSERT(expr,file,line) do { } while(0)
-#endif
-
-#if ET_DEBUG
-unsigned tag_val_def_debug(Wterm x, const char *file, unsigned line)
-#else
-unsigned tag_val_def(Wterm x)
-#define file __FILE__
-#define line __LINE__
-#endif
-{
- static char msg[32];
-
- switch (x & _TAG_PRIMARY_MASK) {
- case TAG_PRIMARY_LIST:
- ET_ASSERT(_list_precond(x),file,line);
- return LIST_DEF;
- case TAG_PRIMARY_BOXED: {
- Eterm hdr = *boxed_val(x);
- ET_ASSERT(is_header(hdr),file,line);
- switch ((hdr & _TAG_HEADER_MASK) >> _TAG_PRIMARY_SIZE) {
- case (_TAG_HEADER_ARITYVAL >> _TAG_PRIMARY_SIZE): return TUPLE_DEF;
- case (_TAG_HEADER_POS_BIG >> _TAG_PRIMARY_SIZE): return BIG_DEF;
- case (_TAG_HEADER_NEG_BIG >> _TAG_PRIMARY_SIZE): return BIG_DEF;
- case (_TAG_HEADER_REF >> _TAG_PRIMARY_SIZE): return REF_DEF;
- case (_TAG_HEADER_FLOAT >> _TAG_PRIMARY_SIZE): return FLOAT_DEF;
- case (_TAG_HEADER_EXPORT >> _TAG_PRIMARY_SIZE): return EXPORT_DEF;
- case (_TAG_HEADER_FUN >> _TAG_PRIMARY_SIZE): return FUN_DEF;
- case (_TAG_HEADER_EXTERNAL_PID >> _TAG_PRIMARY_SIZE): return EXTERNAL_PID_DEF;
- case (_TAG_HEADER_EXTERNAL_PORT >> _TAG_PRIMARY_SIZE): return EXTERNAL_PORT_DEF;
- case (_TAG_HEADER_EXTERNAL_REF >> _TAG_PRIMARY_SIZE): return EXTERNAL_REF_DEF;
- case (_TAG_HEADER_MAP >> _TAG_PRIMARY_SIZE): return MAP_DEF;
- case (_TAG_HEADER_REFC_BIN >> _TAG_PRIMARY_SIZE): return BINARY_DEF;
- case (_TAG_HEADER_HEAP_BIN >> _TAG_PRIMARY_SIZE): return BINARY_DEF;
- case (_TAG_HEADER_SUB_BIN >> _TAG_PRIMARY_SIZE): return BINARY_DEF;
- case (_TAG_HEADER_BIN_MATCHSTATE >> _TAG_PRIMARY_SIZE): return MATCHSTATE_DEF;
- }
-
- break;
- }
- case TAG_PRIMARY_IMMED1: {
- switch ((x & _TAG_IMMED1_MASK) >> _TAG_PRIMARY_SIZE) {
- case (_TAG_IMMED1_PID >> _TAG_PRIMARY_SIZE): return PID_DEF;
- case (_TAG_IMMED1_PORT >> _TAG_PRIMARY_SIZE): return PORT_DEF;
- case (_TAG_IMMED1_IMMED2 >> _TAG_PRIMARY_SIZE): {
- switch ((x & _TAG_IMMED2_MASK) >> _TAG_IMMED1_SIZE) {
- case (_TAG_IMMED2_ATOM >> _TAG_IMMED1_SIZE): return ATOM_DEF;
- case (_TAG_IMMED2_NIL >> _TAG_IMMED1_SIZE): return NIL_DEF;
- }
- break;
- }
- case (_TAG_IMMED1_SMALL >> _TAG_PRIMARY_SIZE): return SMALL_DEF;
- }
- break;
- }
- }
- erts_snprintf(msg, sizeof(msg), "tag_val_def: %#lx", (unsigned long) x);
- et_abort(msg, file, line);
-#undef file
-#undef line
-}
-
/*
* XXX: define NUMBER_CODE() here when new representation is used
*/
diff --git a/erts/emulator/beam/erl_term.h b/erts/emulator/beam/erl_term.h
index 2b28762db5..c3234ee349 100644
--- a/erts/emulator/beam/erl_term.h
+++ b/erts/emulator/beam/erl_term.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -558,14 +558,6 @@ _ET_DECLARE_CHECKED(Eterm*,tuple_val,Wterm)
#define _GETBITS(X,Pos,Size) (((X) >> (Pos)) & ~(~((Uint) 0) << (Size)))
-/*
- * Creation in node specific data (pids, ports, refs)
- */
-
-#define _CRE_SIZE 2
-
-/* MAX value for the creation field in pid, port and reference */
-#define MAX_CREATION (1 << _CRE_SIZE)
/*
* PID layout (internal pids):
@@ -579,7 +571,7 @@ _ET_DECLARE_CHECKED(Eterm*,tuple_val,Wterm)
*
* n : number
*
- * Old pid layout:
+ * Very old pid layout:
*
* |3 3 2 2 2 2 2 2|2 2 2 2 1 1 1 1|1 1 1 1 1 1 | |
* |1 0 9 8 7 6 5 4|3 2 1 0 9 8 7 6|5 4 3 2 1 0 9 8|7 6 5 4 3 2 1 0|
@@ -1129,11 +1121,11 @@ _ET_DECLARE_CHECKED(Uint,loader_y_reg_index,Uint)
#define FIRST_VACANT_TAG_DEF 0x12
#if ET_DEBUG
-extern unsigned tag_val_def_debug(Wterm, const char*, unsigned);
-#define tag_val_def(x) tag_val_def_debug((x),__FILE__,__LINE__)
+ERTS_GLB_INLINE unsigned tag_val_def(Wterm, const char*, unsigned);
#else
-extern unsigned tag_val_def(Wterm);
+ERTS_GLB_INLINE unsigned tag_val_def(Wterm);
#endif
+
#define not_eq_tags(X,Y) (tag_val_def((X)) ^ tag_val_def((Y)))
#define NUMBER_CODE(x,y) ((tag_val_def(x) << 5) | tag_val_def(y))
@@ -1152,5 +1144,80 @@ extern unsigned tag_val_def(Wterm);
void erts_set_literal_tag(Eterm *term, Eterm *hp_start, Eterm hsz);
+#if ET_DEBUG
+#define ET_ASSERT(expr,file,line) \
+do { \
+ if (!(expr)) \
+ erl_assert_error("TYPE ASSERTION: " #expr, __FUNCTION__, file, line); \
+} while(0)
+#else
+#define ET_ASSERT(expr,file,line) do { } while(0)
+#endif
+
+#if ERTS_GLB_INLINE_INCL_FUNC_DEF
+
+#if ET_DEBUG
+ERTS_GLB_INLINE unsigned tag_val_def(Wterm x, const char *file, unsigned line)
+#else
+ERTS_GLB_INLINE unsigned tag_val_def(Wterm x)
+#define file __FILE__
+#define line __LINE__
+#endif
+{
+ static char *msg = "tag_val_def error";
+
+ switch (x & _TAG_PRIMARY_MASK) {
+ case TAG_PRIMARY_LIST:
+ ET_ASSERT(_list_precond(x),file,line);
+ return LIST_DEF;
+ case TAG_PRIMARY_BOXED: {
+ Eterm hdr = *boxed_val(x);
+ ET_ASSERT(is_header(hdr),file,line);
+ switch ((hdr & _TAG_HEADER_MASK) >> _TAG_PRIMARY_SIZE) {
+ case (_TAG_HEADER_ARITYVAL >> _TAG_PRIMARY_SIZE): return TUPLE_DEF;
+ case (_TAG_HEADER_POS_BIG >> _TAG_PRIMARY_SIZE): return BIG_DEF;
+ case (_TAG_HEADER_NEG_BIG >> _TAG_PRIMARY_SIZE): return BIG_DEF;
+ case (_TAG_HEADER_REF >> _TAG_PRIMARY_SIZE): return REF_DEF;
+ case (_TAG_HEADER_FLOAT >> _TAG_PRIMARY_SIZE): return FLOAT_DEF;
+ case (_TAG_HEADER_EXPORT >> _TAG_PRIMARY_SIZE): return EXPORT_DEF;
+ case (_TAG_HEADER_FUN >> _TAG_PRIMARY_SIZE): return FUN_DEF;
+ case (_TAG_HEADER_EXTERNAL_PID >> _TAG_PRIMARY_SIZE): return EXTERNAL_PID_DEF;
+ case (_TAG_HEADER_EXTERNAL_PORT >> _TAG_PRIMARY_SIZE): return EXTERNAL_PORT_DEF;
+ case (_TAG_HEADER_EXTERNAL_REF >> _TAG_PRIMARY_SIZE): return EXTERNAL_REF_DEF;
+ case (_TAG_HEADER_MAP >> _TAG_PRIMARY_SIZE): return MAP_DEF;
+ case (_TAG_HEADER_REFC_BIN >> _TAG_PRIMARY_SIZE): return BINARY_DEF;
+ case (_TAG_HEADER_HEAP_BIN >> _TAG_PRIMARY_SIZE): return BINARY_DEF;
+ case (_TAG_HEADER_SUB_BIN >> _TAG_PRIMARY_SIZE): return BINARY_DEF;
+ case (_TAG_HEADER_BIN_MATCHSTATE >> _TAG_PRIMARY_SIZE): return MATCHSTATE_DEF;
+ }
+
+ break;
+ }
+ case TAG_PRIMARY_IMMED1: {
+ switch ((x & _TAG_IMMED1_MASK) >> _TAG_PRIMARY_SIZE) {
+ case (_TAG_IMMED1_PID >> _TAG_PRIMARY_SIZE): return PID_DEF;
+ case (_TAG_IMMED1_PORT >> _TAG_PRIMARY_SIZE): return PORT_DEF;
+ case (_TAG_IMMED1_IMMED2 >> _TAG_PRIMARY_SIZE): {
+ switch ((x & _TAG_IMMED2_MASK) >> _TAG_IMMED1_SIZE) {
+ case (_TAG_IMMED2_ATOM >> _TAG_IMMED1_SIZE): return ATOM_DEF;
+ case (_TAG_IMMED2_NIL >> _TAG_IMMED1_SIZE): return NIL_DEF;
+ }
+ break;
+ }
+ case (_TAG_IMMED1_SMALL >> _TAG_PRIMARY_SIZE): return SMALL_DEF;
+ }
+ break;
+ }
+ }
+ erl_assert_error(msg, __FUNCTION__, file, line);
+#undef file
+#undef line
+}
+#endif
+
+#if ET_DEBUG
+#define tag_val_def(X) tag_val_def(X, __FILE__, __LINE__)
+#endif
+
#endif /* __ERL_TERM_H */
diff --git a/erts/emulator/beam/erl_thr_progress.c b/erts/emulator/beam/erl_thr_progress.c
index 7b06fd840f..542541165b 100644
--- a/erts/emulator/beam/erl_thr_progress.c
+++ b/erts/emulator/beam/erl_thr_progress.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_thr_progress.h b/erts/emulator/beam/erl_thr_progress.h
index b89cc4c267..b2894ba1fe 100644
--- a/erts/emulator/beam/erl_thr_progress.h
+++ b/erts/emulator/beam/erl_thr_progress.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_thr_queue.c b/erts/emulator/beam/erl_thr_queue.c
index 7ff456b915..f56d0828dd 100644
--- a/erts/emulator/beam/erl_thr_queue.c
+++ b/erts/emulator/beam/erl_thr_queue.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -780,3 +780,35 @@ erts_thr_q_dequeue(ErtsThrQ_t *q)
return res;
#endif
}
+
+#ifdef USE_LTTNG_VM_TRACEPOINTS
+int
+erts_thr_q_length_dirty(ErtsThrQ_t *q)
+{
+ int n = 0;
+#ifndef USE_THREADS
+ void *res;
+ ErtsThrQElement_t *tmp;
+
+ for (tmp = q->first; tmp != NULL; tmp = tmp->next) {
+ n++;
+ }
+#else
+ ErtsThrQElement_t *e;
+ erts_aint_t inext;
+
+ e = ErtsThrQDirtyReadEl(&q->head.head);
+ inext = erts_atomic_read_acqb(&e->next);
+
+ while (inext != ERTS_AINT_NULL) {
+ e = (ErtsThrQElement_t *) inext;
+ if (e != &q->tail.data.marker) {
+ /* don't count marker */
+ n++;
+ }
+ inext = erts_atomic_read_acqb(&e->next);
+ }
+#endif
+ return n;
+}
+#endif
diff --git a/erts/emulator/beam/erl_thr_queue.h b/erts/emulator/beam/erl_thr_queue.h
index 27a6d03224..705a67af4c 100644
--- a/erts/emulator/beam/erl_thr_queue.h
+++ b/erts/emulator/beam/erl_thr_queue.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -190,6 +190,10 @@ void erts_thr_q_append_finalize_dequeue_data(ErtsThrQFinDeQ_t *,
int erts_thr_q_finalize_dequeue(ErtsThrQFinDeQ_t *);
void erts_thr_q_finalize_dequeue_state_init(ErtsThrQFinDeQ_t *);
+#ifdef USE_LTTNG_VM_TRACEPOINTS
+int erts_thr_q_length_dirty(ErtsThrQ_t *);
+#endif
+
#ifdef ERTS_SMP
ERTS_GLB_INLINE ErtsThrPrgrVal erts_thr_q_need_thr_progress(ErtsThrQ_t *q);
#endif
diff --git a/erts/emulator/beam/erl_threads.h b/erts/emulator/beam/erl_threads.h
index e689547d1d..eccd49f2a9 100644
--- a/erts/emulator/beam/erl_threads.h
+++ b/erts/emulator/beam/erl_threads.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_time.h b/erts/emulator/beam/erl_time.h
index 5242063550..a1c4220633 100644
--- a/erts/emulator/beam/erl_time.h
+++ b/erts/emulator/beam/erl_time.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_time_sup.c b/erts/emulator/beam/erl_time_sup.c
index f3f528eaf6..346404fe2a 100644
--- a/erts/emulator/beam/erl_time_sup.c
+++ b/erts/emulator/beam/erl_time_sup.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2015. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1966,7 +1966,7 @@ send_time_offset_changed_notifications(void *new_offsetp)
*patch_refp = ref;
ASSERT(hsz == size_object(message_template));
message = copy_struct(message_template, hsz, &hp, ohp);
- erts_queue_message(rp, &rp_locks, mp, message, NIL);
+ erts_queue_message(rp, &rp_locks, mp, message);
}
erts_smp_proc_unlock(rp, rp_locks);
}
diff --git a/erts/emulator/beam/erl_trace.c b/erts/emulator/beam/erl_trace.c
index 41876b8c62..436b4aca21 100644
--- a/erts/emulator/beam/erl_trace.c
+++ b/erts/emulator/beam/erl_trace.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,19 @@
/*
* Support functions for tracing.
+ *
+ * Ideas for future speed improvements in tracing framework:
+ * * Move ErtsTracerNif into ErtsTracer
+ * + Removes need for locking
+ * + Removes hash lookup overhead
+ * + Use a refc on the ErtsTracerNif to know when it can
+ * be freed. We don't want to allocate a separate
+ * ErtsTracerNif for each module used.
+ * * Optimize GenericBp for cache locality by reusing equivalent
+ * GenericBp and GenericBpData in multiple tracer points.
+ * + Possibly we want to use specialized instructions for different
+ * types of trace so that the knowledge of which struct is used
+ * can be in the instruction.
*/
#ifdef HAVE_CONFIG_H
@@ -39,6 +52,7 @@
#include "erl_bits.h"
#include "erl_thr_progress.h"
#include "erl_bif_unique.h"
+#include "erl_map.h"
#if 0
#define DEBUG_PRINTOUTS
@@ -46,17 +60,15 @@
#undef DEBUG_PRINTOUTS
#endif
-extern BeamInstr beam_return_to_trace[1]; /* OpCode(i_return_to_trace) */
-extern BeamInstr beam_return_trace[1]; /* OpCode(i_return_trace) */
-extern BeamInstr beam_return_time_trace[1]; /* OpCode(i_return_time_trace) */
-
/* Pseudo export entries. Never filled in with data, only used to
yield unique pointers of the correct type. */
Export exp_send, exp_receive, exp_timeout;
-static Eterm system_seq_tracer;
-static Uint default_trace_flags;
-static Eterm default_tracer;
+static ErtsTracer system_seq_tracer;
+static Uint default_proc_trace_flags;
+static ErtsTracer default_proc_tracer;
+static Uint default_port_trace_flags;
+static ErtsTracer default_port_tracer;
static Eterm system_monitor;
static Eterm system_profile;
@@ -70,8 +82,6 @@ static erts_smp_rwmtx_t sys_trace_rwmtx;
enum ErtsSysMsgType {
SYS_MSG_TYPE_UNDEFINED,
- SYS_MSG_TYPE_TRACE,
- SYS_MSG_TYPE_SEQTRACE,
SYS_MSG_TYPE_SYSMON,
SYS_MSG_TYPE_ERRLGR,
SYS_MSG_TYPE_PROC_MSG,
@@ -176,7 +186,7 @@ take_timestamp(ErtsTraceTimeStamp *tsp, int ts_type)
hsz += 3; /* 2-tuple */
raw_unique = erts_raw_get_unique_monotonic_integer();
tsp->u.monotonic.raw_unique = raw_unique;
- hsz += erts_raw_unique_monotonic_integer_heap_size(raw_unique);
+ hsz += erts_raw_unique_monotonic_integer_heap_size(raw_unique, 0);
}
return hsz;
}
@@ -216,8 +226,7 @@ write_timestamp(ErtsTraceTimeStamp *tsp, Eterm **hpp)
return emtime;
raw = tsp->u.monotonic.raw_unique;
- unique = erts_raw_make_unique_monotonic_integer_value(hpp,
- raw);
+ unique = erts_raw_make_unique_monotonic_integer_value(hpp, raw, 0);
res = TUPLE2(*hpp, emtime, unique);
*hpp += 3;
return res;
@@ -228,6 +237,7 @@ write_timestamp(ErtsTraceTimeStamp *tsp, Eterm **hpp)
}
}
+#ifdef ERTS_SMP
#define PATCH_TS_SIZE(p) patch_ts_size(TFLGS_TS_TYPE(p))
static ERTS_INLINE Uint
@@ -248,6 +258,7 @@ patch_ts_size(int ts_type)
return 0;
}
}
+#endif
/*
* Write a timestamp. The timestamp MUST be the last
@@ -299,43 +310,6 @@ write_ts(int ts_type, Eterm *hp, ErlHeapFragment *bp, Process *tracer)
return res;
}
-/*
- * Patch a timestamp into a tuple. The tuple MUST be the last thing
- * built on the heap before the call, and the timestamp MUST be
- * the last thing after the call. This since patch_ts() might adjust
- * the size of the used area.
- */
-
-#define PATCH_TS__(Type, Tuple, Hp, Bp, Tracer) \
- do { \
- int ts_type__ = (Type); \
- if (ts_type__) \
- patch_ts(ts_type__, (Tuple), (Hp), (Bp), (Tracer)); \
- } while (0)
-
-#ifdef ERTS_SMP
-#define PATCH_TS(Type, Tuple, Hp, Bp, Tracer) \
- PATCH_TS__((Type), (Tuple), (Hp), (Bp), NULL)
-#else
-#define PATCH_TS(Type, Tuple, Hp, Bp, Tracer) \
- PATCH_TS__((Type), (Tuple), (Hp), (Bp), (Tracer))
-#endif
-
-static ERTS_INLINE void
-patch_ts(int ts_type, Eterm tuple, Eterm* hp, ErlHeapFragment *bp, Process *tracer)
-{
- Eterm *tptr = tuple_val(tuple);
- int arity = arityval(*tptr);
-
- ASSERT(ts_type);
- ASSERT((tptr+arity+1) == hp);
-
- tptr[0] = make_arityval(arity+1);
- tptr[1] = am_trace_ts;
-
- *hp = write_ts(ts_type, hp+1, bp, tracer);
-}
-
#ifdef ERTS_SMP
static void enqueue_sys_msg_unlocked(enum ErtsSysMsgType type,
Eterm from,
@@ -350,6 +324,14 @@ static void enqueue_sys_msg(enum ErtsSysMsgType type,
static void init_sys_msg_dispatcher(void);
#endif
+static void init_tracer_nif(void);
+static int tracer_cmp_fun(void*, void*);
+static HashValue tracer_hash_fun(void*);
+static void *tracer_alloc_fun(void*);
+static void tracer_free_fun(void*);
+
+typedef struct ErtsTracerNif_ ErtsTracerNif;
+
void erts_init_trace(void) {
erts_smp_rwmtx_opt_t rwmtx_opts = ERTS_SMP_RWMTX_OPT_DEFAULT_INITER;
rwmtx_opts.type = ERTS_SMP_RWMTX_TYPE_EXTREMELY_FREQUENT_READ;
@@ -363,80 +345,66 @@ void erts_init_trace(void) {
erts_bif_trace_init();
erts_system_monitor_clear(NULL);
erts_system_profile_clear(NULL);
- default_trace_flags = F_INITIAL_TRACE_FLAGS;
- default_tracer = NIL;
- system_seq_tracer = am_false;
+ default_proc_trace_flags = F_INITIAL_TRACE_FLAGS;
+ default_proc_tracer = erts_tracer_nil;
+ default_port_trace_flags = F_INITIAL_TRACE_FLAGS;
+ default_port_tracer = erts_tracer_nil;
+ system_seq_tracer = erts_tracer_nil;
#ifdef ERTS_SMP
init_sys_msg_dispatcher();
#endif
+ init_tracer_nif();
}
-static Eterm system_seq_tracer;
-
#define ERTS_ALLOC_SYSMSG_HEAP(SZ, BPP, OHPP, UNUSED) \
(*(BPP) = new_message_buffer((SZ)), \
*(OHPP) = &(*(BPP))->off_heap, \
(*(BPP))->mem)
-#ifdef ERTS_SMP
-#define ERTS_ENQ_TRACE_MSG(FPID, TPID, MSG, BP) \
-do { \
- ERTS_LC_ASSERT(erts_smp_lc_mtx_is_locked(&smq_mtx)); \
- enqueue_sys_msg_unlocked(SYS_MSG_TYPE_TRACE, (FPID), (TPID), (MSG), (BP)); \
-} while(0)
-#else
-#define ERTS_ENQ_TRACE_MSG(FPID, TPROC, MSG, BP) \
- do { \
- ErtsMessage *mp__ = erts_alloc_message(0, NULL); \
- mp__->data.heap_frag = (BP); \
- erts_queue_message((TPROC), NULL, mp__, (MSG), NIL); \
- } while (0)
-#endif
+enum ErtsTracerOpt {
+ TRACE_FUN_DEFAULT = 0,
+ TRACE_FUN_ENABLED = 1,
+ TRACE_FUN_T_SEND = 2,
+ TRACE_FUN_T_RECEIVE = 3,
+ TRACE_FUN_T_CALL = 4,
+ TRACE_FUN_T_SCHED_PROC = 5,
+ TRACE_FUN_T_SCHED_PORT = 6,
+ TRACE_FUN_T_GC = 7,
+ TRACE_FUN_T_PROCS = 8,
+ TRACE_FUN_T_PORTS = 9,
+ TRACE_FUN_E_SEND = 10,
+ TRACE_FUN_E_RECEIVE = 11,
+ TRACE_FUN_E_CALL = 12,
+ TRACE_FUN_E_SCHED_PROC = 13,
+ TRACE_FUN_E_SCHED_PORT = 14,
+ TRACE_FUN_E_GC = 15,
+ TRACE_FUN_E_PROCS = 16,
+ TRACE_FUN_E_PORTS = 17
+};
-/*
- * NOTE that the ERTS_GET_TRACER_REF() returns from the function (!!!)
- * using it, and resets the parameters used if the tracer is invalid, i.e.,
- * use it with extreme care!
- */
-#ifdef ERTS_SMP
-#define ERTS_NULL_TRACER_REF NIL
-#define ERTS_TRACER_REF_TYPE Eterm
- /* In the smp case, we never find the tracer invalid here (the sys
- message dispatcher thread takes care of that). */
-#define ERTS_GET_TRACER_REF(RES, TPID, TRACEE_FLGS) \
-do { (RES) = (TPID); } while(0)
-int
-erts_is_tracer_proc_valid(Process* p)
-{
- return 1;
-}
-#else
-#define ERTS_NULL_TRACER_REF NULL
-#define ERTS_TRACER_REF_TYPE Process *
-#define ERTS_GET_TRACER_REF(RES, TPID, TRACEE_FLGS) \
-do { \
- (RES) = erts_proc_lookup((TPID)); \
- if (!(RES) || !(ERTS_TRACE_FLAGS((RES)) & F_TRACER)) { \
- (TPID) = NIL; \
- (TRACEE_FLGS) &= ~TRACEE_FLAGS; \
- return; \
- } \
-} while (0)
-int
-erts_is_tracer_proc_valid(Process* p)
-{
- Process* tracer;
+#define NIF_TRACER_TYPES (18)
- tracer = erts_proc_lookup(ERTS_TRACER_PROC(p));
- if (tracer && ERTS_TRACE_FLAGS(tracer) & F_TRACER) {
- return 1;
- } else {
- ERTS_TRACER_PROC(p) = NIL;
- ERTS_TRACE_FLAGS(p) = ~TRACEE_FLAGS;
- return 0;
- }
-}
-#endif
+
+static ERTS_INLINE int
+send_to_tracer_nif_raw(Process *c_p, Process *tracee, const ErtsTracer tracer,
+ Uint trace_flags, Eterm t_p_id, ErtsTracerNif *tnif,
+ enum ErtsTracerOpt topt,
+ Eterm tag, Eterm msg, Eterm extra, Eterm pam_result);
+static ERTS_INLINE int
+send_to_tracer_nif(Process *c_p, ErtsPTabElementCommon *t_p,
+ Eterm t_p_id, ErtsTracerNif *tnif,
+ enum ErtsTracerOpt topt,
+ Eterm tag, Eterm msg, Eterm extra);
+static ERTS_INLINE Eterm
+call_enabled_tracer(Process *c_p, const ErtsTracer tracer,
+ ErtsTracerNif **tnif_ref,
+ enum ErtsTracerOpt topt,
+ Eterm tag, Eterm t_p_id);
+static int
+is_tracer_enabled(Process* c_p, ErtsProcLocks c_p_locks,
+ ErtsPTabElementCommon *t_p,
+ ErtsTracerNif **tnif_ret,
+ enum ErtsTracerOpt topt, Eterm tag);
static Uint active_sched;
@@ -451,19 +419,6 @@ static void
exiting_reset(Eterm exiting)
{
erts_smp_rwmtx_rwlock(&sys_trace_rwmtx);
- if (exiting == default_tracer) {
- default_tracer = NIL;
- default_trace_flags &= TRACEE_FLAGS;
-#ifdef DEBUG
- default_trace_flags |= F_INITIAL_TRACE_FLAGS;
-#endif
- }
- if (exiting == system_seq_tracer) {
-#ifdef DEBUG_PRINTOUTS
- erts_fprintf(stderr, "seq tracer %T exited\n", exiting);
-#endif
- system_seq_tracer = am_false;
- }
if (exiting == system_monitor) {
#ifdef ERTS_SMP
system_monitor = NIL;
@@ -488,11 +443,7 @@ erts_trace_check_exiting(Eterm exiting)
{
int reset = 0;
erts_smp_rwmtx_rlock(&sys_trace_rwmtx);
- if (exiting == default_tracer)
- reset = 1;
- else if (exiting == system_seq_tracer)
- reset = 1;
- else if (exiting == system_monitor)
+ if (exiting == system_monitor)
reset = 1;
else if (exiting == system_profile)
reset = 1;
@@ -501,23 +452,26 @@ erts_trace_check_exiting(Eterm exiting)
exiting_reset(exiting);
}
-static ERTS_INLINE int
-is_valid_tracer(Eterm tracer)
-{
- return erts_proc_lookup(tracer) || erts_is_valid_tracer_port(tracer);
-}
-
-Eterm
-erts_set_system_seq_tracer(Process *c_p, ErtsProcLocks c_p_locks, Eterm new)
+ErtsTracer
+erts_set_system_seq_tracer(Process *c_p, ErtsProcLocks c_p_locks, ErtsTracer new)
{
- Eterm old;
+ ErtsTracer old;
- if (new != am_false && !is_valid_tracer(new))
- return THE_NON_VALUE;
+ if (!ERTS_TRACER_IS_NIL(new)) {
+ Eterm nif_result = call_enabled_tracer(
+ NULL, new, NULL,
+ TRACE_FUN_ENABLED, am_trace_status, am_undefined);
+ switch (nif_result) {
+ case am_trace: break;
+ default:
+ return THE_NON_VALUE;
+ }
+ }
erts_smp_rwmtx_rwlock(&sys_trace_rwmtx);
old = system_seq_tracer;
- system_seq_tracer = new;
+ system_seq_tracer = erts_tracer_nil;
+ erts_tracer_update(&system_seq_tracer, new);
#ifdef DEBUG_PRINTOUTS
erts_fprintf(stderr, "set seq tracer new=%T old=%T\n", new, old);
@@ -526,66 +480,134 @@ erts_set_system_seq_tracer(Process *c_p, ErtsProcLocks c_p_locks, Eterm new)
return old;
}
-Eterm
+ErtsTracer
erts_get_system_seq_tracer(void)
{
- Eterm st;
+ ErtsTracer st;
erts_smp_rwmtx_rlock(&sys_trace_rwmtx);
st = system_seq_tracer;
#ifdef DEBUG_PRINTOUTS
erts_fprintf(stderr, "get seq tracer %T\n", st);
#endif
erts_smp_rwmtx_runlock(&sys_trace_rwmtx);
+
+ if (st != erts_tracer_nil &&
+ call_enabled_tracer(NULL, st, NULL, TRACE_FUN_ENABLED,
+ am_trace_status, am_undefined) == am_remove) {
+ erts_set_system_seq_tracer(NULL, 0, erts_tracer_nil);
+ st = erts_tracer_nil;
+ }
+
return st;
}
static ERTS_INLINE void
-get_default_tracing(Uint *flagsp, Eterm *tracerp)
-{
- if (!(default_trace_flags & TRACEE_FLAGS))
- default_tracer = NIL;
-
- if (is_nil(default_tracer)) {
- default_trace_flags &= ~TRACEE_FLAGS;
- } else if (is_internal_pid(default_tracer)) {
- if (!erts_proc_lookup(default_tracer)) {
- reset_tracer:
- default_trace_flags &= ~TRACEE_FLAGS;
- default_tracer = NIL;
- }
+get_default_tracing(Uint *flagsp, ErtsTracer *tracerp,
+ Uint *default_trace_flags,
+ ErtsTracer *default_tracer)
+{
+ if (!(*default_trace_flags & TRACEE_FLAGS))
+ ERTS_TRACER_CLEAR(default_tracer);
+
+ if (ERTS_TRACER_IS_NIL(*default_tracer)) {
+ *default_trace_flags &= ~TRACEE_FLAGS;
} else {
- ASSERT(is_internal_port(default_tracer));
- if (!erts_is_valid_tracer_port(default_tracer))
- goto reset_tracer;
+ Eterm nif_res;
+ nif_res = call_enabled_tracer(NULL, *default_tracer,
+ NULL, TRACE_FUN_ENABLED,
+ am_trace_status, am_undefined);
+ switch (nif_res) {
+ case am_trace: break;
+ default: {
+ ErtsTracer curr_default_tracer = *default_tracer;
+ if (tracerp) {
+ /* we only have a rlock, so we have to unlock and then rwlock */
+ erts_smp_rwmtx_runlock(&sys_trace_rwmtx);
+ erts_smp_rwmtx_rwlock(&sys_trace_rwmtx);
+ }
+ /* check if someone else changed default tracer
+ while we got the write lock, if so we don't do
+ anything. */
+ if (curr_default_tracer == *default_tracer) {
+ *default_trace_flags &= ~TRACEE_FLAGS;
+ ERTS_TRACER_CLEAR(default_tracer);
+ }
+ if (tracerp) {
+ erts_smp_rwmtx_rwunlock(&sys_trace_rwmtx);
+ erts_smp_rwmtx_rlock(&sys_trace_rwmtx);
+ }
+ }
+ }
}
if (flagsp)
- *flagsp = default_trace_flags;
- if (tracerp)
- *tracerp = default_tracer;
+ *flagsp = *default_trace_flags;
+ if (tracerp) {
+ erts_tracer_update(tracerp,*default_tracer);
+ }
+}
+
+static ERTS_INLINE void
+erts_change_default_tracing(int setflags, Uint flags,
+ const ErtsTracer tracer,
+ Uint *default_trace_flags,
+ ErtsTracer *default_tracer)
+{
+ if (setflags)
+ *default_trace_flags |= flags;
+ else
+ *default_trace_flags &= ~flags;
+
+ erts_tracer_update(default_tracer, tracer);
+
+ get_default_tracing(NULL, NULL, default_trace_flags, default_tracer);
}
void
-erts_change_default_tracing(int setflags, Uint *flagsp, Eterm *tracerp)
+erts_change_default_proc_tracing(int setflags, Uint flagsp,
+ const ErtsTracer tracer)
{
erts_smp_rwmtx_rwlock(&sys_trace_rwmtx);
- if (flagsp) {
- if (setflags)
- default_trace_flags |= *flagsp;
- else
- default_trace_flags &= ~(*flagsp);
- }
- if (tracerp)
- default_tracer = *tracerp;
- get_default_tracing(flagsp, tracerp);
+ erts_change_default_tracing(
+ setflags, flagsp, tracer,
+ &default_proc_trace_flags,
+ &default_proc_tracer);
+ erts_smp_rwmtx_rwunlock(&sys_trace_rwmtx);
+}
+
+void
+erts_change_default_port_tracing(int setflags, Uint flagsp,
+ const ErtsTracer tracer)
+{
+ erts_smp_rwmtx_rwlock(&sys_trace_rwmtx);
+ erts_change_default_tracing(
+ setflags, flagsp, tracer,
+ &default_port_trace_flags,
+ &default_port_tracer);
erts_smp_rwmtx_rwunlock(&sys_trace_rwmtx);
}
void
-erts_get_default_tracing(Uint *flagsp, Eterm *tracerp)
+erts_get_default_proc_tracing(Uint *flagsp, ErtsTracer *tracerp)
+{
+ erts_smp_rwmtx_rlock(&sys_trace_rwmtx);
+ *tracerp = erts_tracer_nil; /* initialize */
+ get_default_tracing(
+ flagsp, tracerp,
+ &default_proc_trace_flags,
+ &default_proc_tracer);
+ erts_smp_rwmtx_runlock(&sys_trace_rwmtx);
+}
+
+void
+erts_get_default_port_tracing(Uint *flagsp, ErtsTracer *tracerp)
{
erts_smp_rwmtx_rlock(&sys_trace_rwmtx);
- get_default_tracing(flagsp, tracerp);
+ *tracerp = erts_tracer_nil; /* initialize */
+ get_default_tracing(
+ flagsp, tracerp,
+ &default_port_trace_flags,
+ &default_port_tracer);
erts_smp_rwmtx_runlock(&sys_trace_rwmtx);
}
@@ -623,29 +645,22 @@ erts_get_system_profile(void) {
return profile;
}
-#ifdef ERTS_SMP
-static void
-do_send_to_port(Eterm to,
- Port* unused_port,
- Eterm from,
- enum ErtsSysMsgType type,
- Eterm message)
-{
- Uint sz = size_object(message);
- ErlHeapFragment *bp = new_message_buffer(sz);
- Uint *hp = bp->mem;
- Eterm msg = copy_struct(message, sz, &hp, &bp->off_heap);
- enqueue_sys_msg_unlocked(type, from, to, msg, bp);
-}
-
-#define WRITE_SYS_MSG_TO_PORT write_sys_msg_to_port
+#ifdef HAVE_ERTS_NOW_CPU
+# define GET_NOW(m, s, u) \
+do { \
+ if (erts_cpu_timestamp) \
+ erts_get_now_cpu(m, s, u); \
+ else \
+ get_now(m, s, u); \
+} while (0)
#else
-#define WRITE_SYS_MSG_TO_PORT do_send_to_port
+# define GET_NOW(m, s, u) do {get_now(m, s, u);} while (0)
#endif
+
static void
-WRITE_SYS_MSG_TO_PORT(Eterm unused_to,
+write_sys_msg_to_port(Eterm unused_to,
Port* trace_port,
Eterm unused_from,
enum ErtsSysMsgType unused_type,
@@ -672,150 +687,6 @@ WRITE_SYS_MSG_TO_PORT(Eterm unused_to,
erts_free(ERTS_ALC_T_TMP, (void *) buffer);
}
-
-#ifndef ERTS_SMP
-/* Send {trace_ts, Pid, out, 0, Timestamp}
- * followed by {trace_ts, Pid, in, 0, NewTimestamp}
- *
- * 'NewTimestamp' through patch_ts().
- */
-static void
-do_send_schedfix_to_port(Port *trace_port, Eterm pid, Eterm timestamp, int ts_type) {
-#define LOCAL_HEAP_SIZE (5+5+ERTS_TRACE_PATCH_TS_MAX_SIZE)
- DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
- Eterm message;
- Eterm *hp;
- Eterm mfarity;
-
- UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
- ASSERT(is_pid(pid));
- ASSERT(is_tuple(timestamp));
- ASSERT(*tuple_val(timestamp) == make_arityval(3));
-
- hp = local_heap;
- mfarity = make_small(0);
- message = TUPLE5(hp, am_trace_ts, pid, am_out, mfarity, timestamp);
- /* Note, hp is deliberately NOT incremented since it will be reused */
-
- do_send_to_port(trace_port->common.id,
- trace_port,
- pid,
- SYS_MSG_TYPE_UNDEFINED,
- message);
-
-
- message = TUPLE5(hp, am_trace_ts, pid, am_in, mfarity,
- NIL /* Will be overwritten by timestamp */);
- hp += 6;
- hp[-1] = write_ts(ts_type, hp, NULL, NULL);
-
- do_send_to_port(trace_port->common.id,
- trace_port,
- pid,
- SYS_MSG_TYPE_UNDEFINED,
- message);
- UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-#undef LOCAL_HEAP_SIZE
-}
-#endif
-
-/* If (c_p != NULL), a fake schedule out/in message pair will be sent,
- * if the driver so requests.
- * It is assumed that 'message' is not an 'out' message.
- *
- * 'c_p' is the currently executing process, "tracee" is the traced process
- * which 'message' concerns => if (*tracee_flags & F_TIMESTAMP_MASK),
- * 'message' must contain a timestamp.
- */
-static void
-send_to_port(Process *c_p, Eterm message,
- Eterm *tracer_pid, Uint *tracee_flags) {
- Port* trace_port;
-#ifndef ERTS_SMP
- int ts_type;
-#define LOCAL_HEAP_SIZE ERTS_TRACE_PATCH_TS_MAX_SIZE
- Eterm ts;
- DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
-#endif
-
- ASSERT(is_internal_port(*tracer_pid));
-#ifdef ERTS_SMP
- if (is_not_internal_port(*tracer_pid))
- return;
-
- trace_port = NULL;
-#else
-
- trace_port = erts_id2port_sflgs(*tracer_pid,
- NULL,
- 0,
- ERTS_PORT_SFLGS_INVALID_TRACER_LOOKUP);
-
- if (!trace_port) {
- *tracee_flags &= ~TRACEE_FLAGS;
- *tracer_pid = NIL;
- return;
- }
-
- /*
- * Make a fake schedule only if the current process is traced
- * with 'running' and 'timestamp'.
- */
-
- if ( c_p == NULL ||
- (! IS_TRACED_FL(c_p, F_TRACE_SCHED | F_TIMESTAMP_MASK))) {
-#endif
- do_send_to_port(*tracer_pid,
- trace_port,
- c_p ? c_p->common.id : NIL,
- SYS_MSG_TYPE_TRACE,
- message);
-#ifndef ERTS_SMP
- erts_port_release(trace_port);
- return;
- }
-
- /*
- * Note that the process being traced for some type of trace messages
- * (e.g. getting_linked) need not be the current process. That other
- * process might not have timestamps enabled.
- */
- UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-
- /* A fake schedule might be needed.
- * Create a dummy trace message with timestamp to be
- * passed to do_send_schedfix_to_port().
- */
- ts_type = TFLGS_TS_TYPE(c_p);
- ts = write_ts(ts_type, local_heap, NULL, NULL);
-
- trace_port->control_flags &= ~PORT_CONTROL_FLAG_HEAVY;
- do_send_to_port(*tracer_pid,
- trace_port,
- c_p ? c_p->common.id : NIL,
- SYS_MSG_TYPE_TRACE,
- message);
-
- if (trace_port->control_flags & PORT_CONTROL_FLAG_HEAVY) {
- /* The driver has just informed us that the last write took a
- * non-neglectible amount of time.
- *
- * We need to fake some trace messages to compensate for the time the
- * current process had to sacrifice for the writing of the previous
- * trace message. We pretend that the process got scheduled out
- * just after writning the real trace message, and now gets scheduled
- * in again.
- */
- do_send_schedfix_to_port(trace_port, c_p->common.id, ts, ts_type);
- }
-
- erts_port_release(trace_port);
-
- UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-#undef LOCAL_HEAP_SIZE
-#endif
-}
-
#ifndef ERTS_SMP
/* Profile send
* Checks if profiler is port or process
@@ -844,11 +715,11 @@ profile_send(Eterm from, Eterm message) {
0,
ERTS_PORT_SFLGS_INVALID_TRACER_LOOKUP);
if (profiler_port) {
- do_send_to_port(profiler,
- profiler_port,
- NIL, /* or current process->common.id */
- SYS_MSG_TYPE_SYSPROF,
- message);
+ write_sys_msg_to_port(profiler,
+ profiler_port,
+ NIL, /* or current process->common.id */
+ SYS_MSG_TYPE_SYSPROF,
+ message);
erts_port_release(profiler_port);
}
@@ -868,154 +739,26 @@ profile_send(Eterm from, Eterm message) {
else
msg = copy_struct(message, sz, &hp, &mp->hfrag.off_heap);
- erts_queue_message(profile_p, NULL, mp, msg, NIL);
+ erts_queue_message(profile_p, NULL, mp, msg);
}
}
#endif
-
-/* A fake schedule out/in message pair will be sent,
- * if the driver so requests.
- *
- * 'c_p' is the currently executing process, may be NULL.
- */
-static void
-seq_trace_send_to_port(Process *c_p,
- Eterm seq_tracer,
- Eterm message)
-{
- Port* trace_port;
-#ifndef ERTS_SMP
- int ts_type;
- Eterm ts;
-#define LOCAL_HEAP_SIZE ERTS_TRACE_PATCH_TS_MAX_SIZE
- DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
- UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-#endif
-
- ASSERT(is_internal_port(seq_tracer));
-#ifdef ERTS_SMP
- if (is_not_internal_port(seq_tracer))
- return;
-
- trace_port = NULL;
-#else
- trace_port = erts_id2port_sflgs(seq_tracer,
- NULL,
- 0,
- ERTS_PORT_SFLGS_INVALID_TRACER_LOOKUP);
- if (!trace_port) {
- system_seq_tracer = am_false;
-#ifndef ERTS_SMP
- UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-#endif
- return;
- }
-
- if (c_p == NULL
- || (! IS_TRACED_FL(c_p, F_TRACE_SCHED | F_TIMESTAMP_MASK))) {
-#endif
- do_send_to_port(seq_tracer,
- trace_port,
- c_p ? c_p->common.id : NIL,
- SYS_MSG_TYPE_SEQTRACE,
- message);
-
-#ifndef ERTS_SMP
- erts_port_release(trace_port);
- UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
- return;
- }
- /* Make a fake schedule only if the current process is traced
- * with 'running' and 'timestamp'.
- */
-
- /* A fake schedule might be needed.
- * Create a dummy trace message with timestamp to be
- * passed to do_send_schedfix_to_port().
- */
- ts_type = TFLGS_TS_TYPE(c_p);
- ts = write_ts(ts_type, local_heap, NULL, NULL);
-
- trace_port->control_flags &= ~PORT_CONTROL_FLAG_HEAVY;
- do_send_to_port(seq_tracer,
- trace_port,
- c_p ? c_p->common.id : NIL,
- SYS_MSG_TYPE_SEQTRACE,
- message);
-
- if (trace_port->control_flags & PORT_CONTROL_FLAG_HEAVY) {
- /* The driver has just informed us that the last write took a
- * non-neglectible amount of time.
- *
- * We need to fake some trace messages to compensate for the time the
- * current process had to sacrifice for the writing of the previous
- * trace message. We pretend that the process got scheduled out
- * just after writing the real trace message, and now gets scheduled
- * in again.
- */
- do_send_schedfix_to_port(trace_port, c_p->common.id, ts, ts_type);
- }
-
- erts_port_release(trace_port);
-
- UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-#undef LOCAL_HEAP_SIZE
-#endif
-}
-
-static ERTS_INLINE void
-send_to_tracer(Process *tracee,
- ERTS_TRACER_REF_TYPE tracer_ref,
- Eterm msg,
- Eterm **hpp,
- ErlHeapFragment *bp,
- int no_fake_sched)
-{
- ERTS_SMP_LC_ASSERT(erts_proc_lc_my_proc_locks(tracee));
-
- erts_smp_mtx_lock(&smq_mtx);
-
- if (is_internal_pid(ERTS_TRACER_PROC(tracee))) {
- PATCH_TS(TFLGS_TS_TYPE(tracee), msg, *hpp, bp, tracer_ref);
- ERTS_ENQ_TRACE_MSG(tracee->common.id, tracer_ref, msg, bp);
- }
- else {
- ASSERT(is_internal_port(ERTS_TRACER_PROC(tracee)));
- PATCH_TS(TFLGS_TS_TYPE(tracee), msg, *hpp, NULL, NULL);
- send_to_port(no_fake_sched ? NULL : tracee,
- msg,
- &ERTS_TRACER_PROC(tracee),
- &ERTS_TRACE_FLAGS(tracee));
- }
-
- erts_smp_mtx_unlock(&smq_mtx);
-
-}
-
static void
-trace_sched_aux(Process *p, Eterm what, int never_fake_sched)
+trace_sched_aux(Process *p, ErtsProcLocks locks, Eterm what)
{
-#define LOCAL_HEAP_SIZE (5+4+1+ERTS_TRACE_PATCH_TS_MAX_SIZE)
- DeclareTmpHeap(local_heap,LOCAL_HEAP_SIZE,p);
- Eterm tmp, mess, *hp;
- ErlHeapFragment *bp = NULL;
- ErlOffHeap *off_heap;
- ERTS_TRACER_REF_TYPE tracer_ref = ERTS_NULL_TRACER_REF;
- int sched_no, curr_func, to_port, no_fake_sched;
+ Eterm tmp, *hp;
+ int curr_func;
+ ErtsTracerNif *tnif = NULL;
- if (is_nil(ERTS_TRACER_PROC(p)))
+ if (ERTS_TRACER_IS_NIL(ERTS_TRACER(p)))
return;
- no_fake_sched = never_fake_sched;
-
switch (what) {
case am_out:
case am_out_exiting:
case am_out_exited:
- no_fake_sched = 1;
- break;
case am_in:
case am_in_exiting:
break;
@@ -1024,16 +767,8 @@ trace_sched_aux(Process *p, Eterm what, int never_fake_sched)
break;
}
- sched_no = IS_TRACED_FL(p, F_TRACE_SCHED_NO);
- to_port = is_internal_port(ERTS_TRACER_PROC(p));
-
- if (!to_port) {
- ASSERT(is_internal_pid(ERTS_TRACER_PROC(p)));
-
- ERTS_GET_TRACER_REF(tracer_ref,
- ERTS_TRACER_PROC(p),
- ERTS_TRACE_FLAGS(p));
- }
+ if (!is_tracer_enabled(p, locks, &p->common, &tnif, TRACE_FUN_E_SCHED_PROC, what))
+ return;
if (ERTS_PROC_IS_EXITING(p))
curr_func = 0;
@@ -1043,44 +778,16 @@ trace_sched_aux(Process *p, Eterm what, int never_fake_sched)
curr_func = p->current != NULL;
}
- UseTmpHeap(LOCAL_HEAP_SIZE,p);
-
- if (to_port)
- hp = local_heap;
- else {
- Uint size = 5;
- if (curr_func)
- size += 4;
- if (sched_no)
- size += 1;
- size += PATCH_TS_SIZE(p);
- hp = ERTS_ALLOC_SYSMSG_HEAP(size, &bp, &off_heap, tracer_ref);
- }
-
if (!curr_func) {
tmp = make_small(0);
} else {
+ hp = HAlloc(p, 4);
tmp = TUPLE3(hp,p->current[0],p->current[1],make_small(p->current[2]));
hp += 4;
}
- if (!sched_no) {
- mess = TUPLE4(hp, am_trace, p->common.id, what, tmp);
- hp += 5;
- }
- else {
-#ifdef ERTS_SMP
- Eterm sched_id = make_small(p->scheduler_data->no);
-#else
- Eterm sched_id = make_small(1);
-#endif
- mess = TUPLE5(hp, am_trace, p->common.id, what, sched_id, tmp);
- hp += 6;
- }
-
- send_to_tracer(p, tracer_ref, mess, &hp, bp, no_fake_sched);
- UnUseTmpHeap(LOCAL_HEAP_SIZE,p);
-#undef LOCAL_HEAP_SIZE
+ send_to_tracer_nif(p, &p->common, p->common.id, tnif, TRACE_FUN_T_SCHED_PROC,
+ what, tmp, THE_NON_VALUE);
}
/* Send {trace_ts, Pid, What, {Mod, Func, Arity}, Timestamp}
@@ -1090,9 +797,9 @@ trace_sched_aux(Process *p, Eterm what, int never_fake_sched)
* 'out_exiting', or 'out_exited'.
*/
void
-trace_sched(Process *p, Eterm what)
+trace_sched(Process *p, ErtsProcLocks locks, Eterm what)
{
- trace_sched_aux(p, what, 0);
+ trace_sched_aux(p, locks, what);
}
/* Send {trace_ts, Pid, Send, Msg, DestPid, Timestamp}
@@ -1103,140 +810,55 @@ trace_sched(Process *p, Eterm what)
void
trace_send(Process *p, Eterm to, Eterm msg)
{
- Eterm operation;
- unsigned sz_msg;
- unsigned sz_to;
- Eterm* hp;
- Eterm mess;
-
- if (!ARE_TRACE_FLAGS_ON(p, F_TRACE_SEND)) {
- return;
- }
+ Eterm operation = am_send;
+ ErtsTracerNif *tnif = NULL;
+
+ ASSERT(ARE_TRACE_FLAGS_ON(p, F_TRACE_SEND));
- operation = am_send;
if (is_internal_pid(to)) {
if (!erts_proc_lookup(to))
goto send_to_non_existing_process;
}
else if(is_external_pid(to)
&& external_pid_dist_entry(to) == erts_this_dist_entry) {
- char *s;
send_to_non_existing_process:
- s = "send_to_non_existing_process";
- operation = am_atom_put(s, sys_strlen(s));
+ operation = am_send_to_non_existing_process;
}
- if (is_internal_port(ERTS_TRACER_PROC(p))) {
-#define LOCAL_HEAP_SIZE (6 + ERTS_TRACE_PATCH_TS_MAX_SIZE)
- DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
- UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-
- hp = local_heap;
- mess = TUPLE5(hp, am_trace, p->common.id, operation, msg, to);
- hp += 6;
- erts_smp_mtx_lock(&smq_mtx);
- PATCH_TS(TFLGS_TS_TYPE(p), mess, hp, NULL, NULL);
- send_to_port(p, mess, &ERTS_TRACER_PROC(p), &ERTS_TRACE_FLAGS(p));
- UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-#undef LOCAL_HEAP_SIZE
- erts_smp_mtx_unlock(&smq_mtx);
- } else {
- Uint need;
- ErlHeapFragment *bp;
- ErlOffHeap *off_heap;
- ERTS_TRACER_REF_TYPE tracer_ref;
-
- ASSERT(is_internal_pid(ERTS_TRACER_PROC(p)));
-
- ERTS_GET_TRACER_REF(tracer_ref,
- ERTS_TRACER_PROC(p),
- ERTS_TRACE_FLAGS(p));
-
- sz_msg = size_object(msg);
- sz_to = size_object(to);
- need = sz_msg + sz_to + 6 + PATCH_TS_SIZE(p);
-
- hp = ERTS_ALLOC_SYSMSG_HEAP(need, &bp, &off_heap, tracer_ref);
-
- to = copy_struct(to,
- sz_to,
- &hp,
- off_heap);
- msg = copy_struct(msg,
- sz_msg,
- &hp,
- off_heap);
- mess = TUPLE5(hp, am_trace, p->common.id, operation, msg, to);
- hp += 6;
-
- erts_smp_mtx_lock(&smq_mtx);
-
- PATCH_TS(TFLGS_TS_TYPE(p), mess, hp, bp, tracer_ref);
- ERTS_ENQ_TRACE_MSG(p->common.id, tracer_ref, mess, bp);
- erts_smp_mtx_unlock(&smq_mtx);
- }
+ if (is_tracer_enabled(p, ERTS_PROC_LOCK_MAIN, &p->common, &tnif,
+ TRACE_FUN_E_SEND, operation))
+ send_to_tracer_nif(p, &p->common, p->common.id, tnif, TRACE_FUN_T_SEND,
+ operation, msg, to);
}
/* Send {trace_ts, Pid, receive, Msg, Timestamp}
* or {trace, Pid, receive, Msg}
*/
void
-trace_receive(Process *rp, Eterm msg)
+trace_receive(Process *c_p, Eterm msg)
{
- Eterm mess;
- size_t sz_msg;
- Eterm* hp;
-
- if (is_internal_port(ERTS_TRACER_PROC(rp))) {
-#define LOCAL_HEAP_SIZE (5+ERTS_TRACE_PATCH_TS_MAX_SIZE)
- DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
- UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-
- hp = local_heap;
- mess = TUPLE4(hp, am_trace, rp->common.id, am_receive, msg);
- hp += 5;
- erts_smp_mtx_lock(&smq_mtx);
- PATCH_TS(TFLGS_TS_TYPE(rp), mess, hp, NULL, NULL);
- send_to_port(rp, mess, &ERTS_TRACER_PROC(rp), &ERTS_TRACE_FLAGS(rp));
- UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-#undef LOCAL_HEAP_SIZE
- erts_smp_mtx_unlock(&smq_mtx);
- } else {
- Uint hsz;
- ErlHeapFragment *bp;
- ErlOffHeap *off_heap;
- ERTS_TRACER_REF_TYPE tracer_ref;
-
- ASSERT(is_internal_pid(ERTS_TRACER_PROC(rp)));
-
- ERTS_GET_TRACER_REF(tracer_ref,
- ERTS_TRACER_PROC(rp),
- ERTS_TRACE_FLAGS(rp));
-
- sz_msg = size_object(msg);
-
- hsz = sz_msg + 5 + PATCH_TS_SIZE(rp);
-
- hp = ERTS_ALLOC_SYSMSG_HEAP(hsz, &bp, &off_heap, tracer_ref);
-
- msg = copy_struct(msg, sz_msg, &hp, off_heap);
- mess = TUPLE4(hp, am_trace, rp->common.id, am_receive, msg);
- hp += 5;
-
- erts_smp_mtx_lock(&smq_mtx);
-
- PATCH_TS(TFLGS_TS_TYPE(rp), mess, hp, bp, tracer_ref);
- ERTS_ENQ_TRACE_MSG(rp->common.id, tracer_ref, mess, bp);
- erts_smp_mtx_unlock(&smq_mtx);
- }
+ ErtsTracerNif *tnif = NULL;
+ if (is_tracer_enabled(NULL, 0, &c_p->common, &tnif,
+ TRACE_FUN_E_RECEIVE, am_receive))
+ send_to_tracer_nif(NULL, &c_p->common, c_p->common.id,
+ tnif, TRACE_FUN_T_RECEIVE,
+ am_receive, msg, THE_NON_VALUE);
}
int
seq_trace_update_send(Process *p)
{
- Eterm seq_tracer = erts_get_system_seq_tracer();
+ ErtsTracer seq_tracer = erts_get_system_seq_tracer();
ASSERT((is_tuple(SEQ_TRACE_TOKEN(p)) || is_nil(SEQ_TRACE_TOKEN(p))));
- if ((p->common.id == seq_tracer) || have_no_seqtrace(SEQ_TRACE_TOKEN(p))) {
+ if (have_no_seqtrace(SEQ_TRACE_TOKEN(p)) ||
+ (seq_tracer != NIL &&
+ call_enabled_tracer(NULL, seq_tracer, NULL,
+ TRACE_FUN_ENABLED, am_trace_status,
+ p ? p->common.id : am_undefined) != am_trace)
+#ifdef USE_VM_PROBES
+ || (SEQ_TRACE_TOKEN(p) == am_have_dt_utag)
+#endif
+ ) {
return 0;
}
SEQ_TRACE_TOKEN_SENDER(p) = p->common.id;
@@ -1264,20 +886,29 @@ seq_trace_output_generic(Eterm token, Eterm msg, Uint type,
Eterm receiver, Process *process, Eterm exitfrom)
{
Eterm mess;
- ErlHeapFragment* bp;
Eterm* hp;
Eterm label;
Eterm lastcnt_serial;
Eterm type_atom;
- int sz_exit;
- Eterm seq_tracer;
- int ts_type;
+ ErtsTracer seq_tracer;
+ int seq_tracer_flags = 0;
+#define LOCAL_HEAP_SIZE (64)
+ DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
seq_tracer = erts_get_system_seq_tracer();
ASSERT(is_tuple(token) || is_nil(token));
- if (SEQ_TRACE_T_SENDER(token) == seq_tracer || token == NIL ||
- (process && ERTS_TRACE_FLAGS(process) & F_SENSITIVE)) {
+ if (token == NIL || (process && ERTS_TRACE_FLAGS(process) & F_SENSITIVE) ||
+ ERTS_TRACER_IS_NIL(seq_tracer) ||
+ call_enabled_tracer(NULL, seq_tracer,
+ NULL, TRACE_FUN_ENABLED,
+ am_trace_status,
+ process ? process->common.id : am_undefined) != am_trace) {
+ return;
+ }
+
+ if ((unsigned_val(SEQ_TRACE_T_FLAGS(token)) & type) == 0) {
+ /* No flags set, nothing to do */
return;
}
@@ -1290,151 +921,28 @@ seq_trace_output_generic(Eterm token, Eterm msg, Uint type,
return; /* To avoid warning */
}
- if ((unsigned_val(SEQ_TRACE_T_FLAGS(token)) & type) == 0) {
- /* No flags set, nothing to do */
- return;
- }
+ UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
- if (seq_tracer == am_false) {
- return; /* no need to send anything */
+ hp = local_heap;
+ label = SEQ_TRACE_T_LABEL(token);
+ lastcnt_serial = TUPLE2(hp, SEQ_TRACE_T_LASTCNT(token),
+ SEQ_TRACE_T_SERIAL(token));
+ hp += 3;
+ if (exitfrom != NIL) {
+ msg = TUPLE3(hp, am_EXIT, exitfrom, msg);
+ hp += 4;
}
+ mess = TUPLE5(hp, type_atom, lastcnt_serial, SEQ_TRACE_T_SENDER(token), receiver, msg);
+ hp += 6;
- ts_type = ERTS_SEQTFLGS2TSTYPE(unsigned_val(SEQ_TRACE_T_FLAGS(token)));
-
- if (is_internal_port(seq_tracer)) {
-#define LOCAL_HEAP_SIZE (60 + ERTS_TRACE_PATCH_TS_MAX_SIZE)
- DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
- UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
+ seq_tracer_flags |= ERTS_SEQTFLGS2TFLGS(unsigned_val(SEQ_TRACE_T_FLAGS(token)));
- hp = local_heap;
- label = SEQ_TRACE_T_LABEL(token);
- lastcnt_serial = TUPLE2(hp, SEQ_TRACE_T_LASTCNT(token),
- SEQ_TRACE_T_SERIAL(token));
- hp += 3;
- if (exitfrom != NIL) {
- msg = TUPLE3(hp, am_EXIT, exitfrom, msg);
- hp += 4;
- }
- mess = TUPLE5(hp, type_atom, lastcnt_serial, SEQ_TRACE_T_SENDER(token),
- receiver, msg);
- hp += 6;
+ send_to_tracer_nif_raw(NULL, process, seq_tracer, seq_tracer_flags,
+ label, NULL, TRACE_FUN_DEFAULT, am_seq_trace, mess,
+ THE_NON_VALUE, am_true);
- erts_smp_mtx_lock(&smq_mtx);
- if (!ts_type) {
- mess = TUPLE3(hp, am_seq_trace, label, mess);
- seq_trace_send_to_port(NULL, seq_tracer, mess);
- } else {
- mess = TUPLE4(hp, am_seq_trace, label, mess,
- NIL /* Will be overwritten by timestamp */);
- hp += 5;
- hp[-1] = write_ts(ts_type, hp, NULL, NULL);
- seq_trace_send_to_port(process, seq_tracer, mess);
- }
- UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
+ UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
#undef LOCAL_HEAP_SIZE
- erts_smp_mtx_unlock(&smq_mtx);
- } else {
-#ifndef ERTS_SMP
- Process* tracer;
-#endif
- Eterm sender_copy;
- Eterm receiver_copy;
- Eterm m2;
- Uint sz_label, sz_lastcnt_serial, sz_msg, sz_ts, sz_sender,
- sz_exitfrom, sz_receiver;
-
- ASSERT(is_internal_pid(seq_tracer));
-
-#ifndef ERTS_SMP
-
- tracer = erts_proc_lookup(seq_tracer);
- if (!tracer) {
- system_seq_tracer = am_false;
- return; /* no need to send anything */
- }
-#endif
- if (receiver == seq_tracer) {
- return; /* no need to send anything */
- }
-
- sz_label = size_object(SEQ_TRACE_T_LABEL(token));
- sz_sender = size_object(SEQ_TRACE_T_SENDER(token));
- sz_receiver = size_object(receiver);
- sz_lastcnt_serial = 3; /* TUPLE2 */
- sz_msg = size_object(msg);
-
- sz_ts = patch_ts_size(ts_type);
- if (exitfrom != NIL) {
- sz_exit = 4; /* create {'EXIT',exitfrom,msg} */
- sz_exitfrom = size_object(exitfrom);
- }
- else {
- sz_exit = 0;
- sz_exitfrom = 0;
- }
- bp = new_message_buffer(4 /* TUPLE3 */ + sz_ts + 6 /* TUPLE5 */
- + sz_lastcnt_serial + sz_label + sz_msg
- + sz_exit + sz_exitfrom
- + sz_sender + sz_receiver);
- hp = bp->mem;
- label = copy_struct(SEQ_TRACE_T_LABEL(token), sz_label, &hp, &bp->off_heap);
- lastcnt_serial = TUPLE2(hp,SEQ_TRACE_T_LASTCNT(token),SEQ_TRACE_T_SERIAL(token));
- hp += 3;
- m2 = copy_struct(msg, sz_msg, &hp, &bp->off_heap);
- if (sz_exit) {
- Eterm exitfrom_copy = copy_struct(exitfrom,
- sz_exitfrom,
- &hp,
- &bp->off_heap);
- m2 = TUPLE3(hp, am_EXIT, exitfrom_copy, m2);
- hp += 4;
- }
- sender_copy = copy_struct(SEQ_TRACE_T_SENDER(token),
- sz_sender,
- &hp,
- &bp->off_heap);
- receiver_copy = copy_struct(receiver,
- sz_receiver,
- &hp,
- &bp->off_heap);
- mess = TUPLE5(hp,
- type_atom,
- lastcnt_serial,
- sender_copy,
- receiver_copy,
- m2);
- hp += 6;
-
- erts_smp_mtx_lock(&smq_mtx);
-
- if (!ts_type)
- mess = TUPLE3(hp, am_seq_trace, label, mess);
- else {
- mess = TUPLE4(hp, am_seq_trace, label, mess,
- NIL /* Will be overwritten by timestamp */);
- hp += 5;
- /* Write timestamp in element 6 of the 'msg' tuple */
- hp[-1] = write_ts(ts_type, hp, bp,
-#ifndef ERTS_SMP
- tracer
-#else
- NULL
-#endif
- );
- }
-
-#ifdef ERTS_SMP
- enqueue_sys_msg_unlocked(SYS_MSG_TYPE_SEQTRACE, NIL, NIL, mess, bp);
- erts_smp_mtx_unlock(&smq_mtx);
-#else
- /* trace_token must be NIL here */
- {
- ErtsMessage *mp = erts_alloc_message(0, NULL);
- mp->data.heap_frag = bp;
- erts_queue_message(tracer, NULL, mp, mess, NIL);
- }
-#endif
- }
}
/* Send {trace_ts, Pid, return_to, {Mod, Func, Arity}, Timestamp}
@@ -1443,63 +951,20 @@ seq_trace_output_generic(Eterm token, Eterm msg, Uint type,
void
erts_trace_return_to(Process *p, BeamInstr *pc)
{
-#define LOCAL_HEAP_SIZE (4+5+ERTS_TRACE_PATCH_TS_MAX_SIZE)
- Eterm* hp;
Eterm mfa;
- Eterm mess;
- DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
BeamInstr *code_ptr = find_function_from_pc(pc);
- UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-
- hp = local_heap;
-
if (!code_ptr) {
mfa = am_undefined;
} else {
+ Eterm *hp = HAlloc(p, 4);
mfa = TUPLE3(hp, code_ptr[0], code_ptr[1], make_small(code_ptr[2]));
- hp += 4;
}
-
- mess = TUPLE4(hp, am_trace, p->common.id, am_return_to, mfa);
- hp += 5;
-
- erts_smp_mtx_lock(&smq_mtx);
-
- PATCH_TS(TFLGS_TS_TYPE(p), mess, hp, NULL, NULL);
-
- if (is_internal_port(ERTS_TRACER_PROC(p))) {
- send_to_port(p, mess, &ERTS_TRACER_PROC(p), &ERTS_TRACE_FLAGS(p));
- } else {
- ErlHeapFragment *bp;
- ErlOffHeap *off_heap;
- ERTS_TRACER_REF_TYPE tracer_ref;
- unsigned size;
- /*
- * Find the tracer.
- */
- ASSERT(is_internal_pid(ERTS_TRACER_PROC(p)));
-
- ERTS_GET_TRACER_REF(tracer_ref,
- ERTS_TRACER_PROC(p),
- ERTS_TRACE_FLAGS(p));
-
- size = size_object(mess);
-
- hp = ERTS_ALLOC_SYSMSG_HEAP(size, &bp, &off_heap, tracer_ref);
-
- /*
- * Copy the trace message into the buffer and enqueue it.
- */
- mess = copy_struct(mess, size, &hp, off_heap);
- ERTS_ENQ_TRACE_MSG(p->common.id, tracer_ref, mess, bp);
- }
- UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-#undef LOCAL_HEAP_SIZE
- erts_smp_mtx_unlock(&smq_mtx);
+ send_to_tracer_nif(p, &p->common, p->common.id, NULL, TRACE_FUN_T_CALL,
+ am_return_to, mfa, THE_NON_VALUE);
}
@@ -1507,114 +972,53 @@ erts_trace_return_to(Process *p, BeamInstr *pc)
* or {trace, Pid, return_from, {Mod, Name, Arity}, Retval}
*/
void
-erts_trace_return(Process* p, BeamInstr* fi, Eterm retval, Eterm *tracer_pid)
+erts_trace_return(Process* p, BeamInstr* fi, Eterm retval, ErtsTracer *tracer)
{
Eterm* hp;
- Eterm mfa;
- Eterm mess;
- Eterm mod, name;
+ Eterm mfa, mod, name;
int arity;
Uint meta_flags, *tracee_flags;
- int ts_type;
-#ifdef ERTS_SMP
- Eterm tracee;
-#endif
-
- ASSERT(tracer_pid);
- if (*tracer_pid == am_true) {
+
+ ASSERT(tracer);
+ if (ERTS_TRACER_COMPARE(*tracer, erts_tracer_true)) {
/* Breakpoint trace enabled without specifying tracer =>
* use process tracer and flags
*/
- tracer_pid = &ERTS_TRACER_PROC(p);
+ tracer = &ERTS_TRACER(p);
}
- if (is_nil(*tracer_pid)) {
+ if (ERTS_TRACER_IS_NIL(*tracer)) {
/* Trace disabled */
return;
}
- ASSERT(is_internal_pid(*tracer_pid) || is_internal_port(*tracer_pid));
- if (*tracer_pid == p->common.id) {
- /* Do not generate trace messages to oneself */
- return;
- }
- if (tracer_pid == &ERTS_TRACER_PROC(p)) {
+ ASSERT(IS_TRACER_VALID(*tracer));
+ if (tracer == &ERTS_TRACER(p)) {
/* Tracer specified in process structure =>
* non-breakpoint trace =>
* use process flags
*/
tracee_flags = &ERTS_TRACE_FLAGS(p);
-#ifdef ERTS_SMP
- tracee = p->common.id;
-#endif
+ if (! (*tracee_flags & F_TRACE_CALLS)) {
+ return;
+ }
} else {
/* Tracer not specified in process structure =>
* tracer specified in breakpoint =>
* meta trace =>
* use fixed flag set instead of process flags
- */
+ */
meta_flags = F_TRACE_CALLS | F_NOW_TS;
tracee_flags = &meta_flags;
-#ifdef ERTS_SMP
- tracee = NIL;
-#endif
}
- if (! (*tracee_flags & F_TRACE_CALLS)) {
- return;
- }
-
+
mod = fi[0];
name = fi[1];
arity = fi[2];
-
- ts_type = ERTS_TFLGS2TSTYPE(*tracee_flags);
-
- if (is_internal_port(*tracer_pid)) {
-#define LOCAL_HEAP_SIZE (4+6+ERTS_TRACE_PATCH_TS_MAX_SIZE)
- DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
- UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
- hp = local_heap;
- mfa = TUPLE3(hp, mod, name, make_small(arity));
- hp += 4;
- mess = TUPLE5(hp, am_trace, p->common.id, am_return_from, mfa, retval);
- hp += 6;
- erts_smp_mtx_lock(&smq_mtx);
- PATCH_TS(ts_type, mess, hp, NULL, NULL);
- send_to_port(p, mess, tracer_pid, tracee_flags);
- UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-#undef LOCAL_HEAP_SIZE
- erts_smp_mtx_unlock(&smq_mtx);
- } else {
- ErlHeapFragment *bp;
- ErlOffHeap *off_heap;
- ERTS_TRACER_REF_TYPE tracer_ref;
- unsigned size;
- unsigned retval_size;
-
- ASSERT(is_internal_pid(*tracer_pid));
- ERTS_GET_TRACER_REF(tracer_ref, *tracer_pid, *tracee_flags);
-
- retval_size = size_object(retval);
- size = 6 + 4 + retval_size + patch_ts_size(ts_type);
-
- hp = ERTS_ALLOC_SYSMSG_HEAP(size, &bp, &off_heap, tracer_ref);
-
- /*
- * Build the trace tuple and put it into receive queue of the tracer process.
- */
-
- mfa = TUPLE3(hp, mod, name, make_small(arity));
- hp += 4;
- retval = copy_struct(retval, retval_size, &hp, off_heap);
- mess = TUPLE5(hp, am_trace, p->common.id, am_return_from, mfa, retval);
- hp += 6;
-
- erts_smp_mtx_lock(&smq_mtx);
-
- PATCH_TS(ts_type, mess, hp, bp, tracer_ref);
-
- ERTS_ENQ_TRACE_MSG(tracee, tracer_ref, mess, bp);
- erts_smp_mtx_unlock(&smq_mtx);
- }
+ hp = HAlloc(p, 4);
+ mfa = TUPLE3(hp, mod, name, make_small(arity));
+ hp += 4;
+ send_to_tracer_nif_raw(p, NULL, *tracer, *tracee_flags, p->common.id,
+ NULL, TRACE_FUN_T_CALL, am_return_from, mfa, retval, am_true);
}
/* Send {trace_ts, Pid, exception_from, {Mod, Name, Arity}, {Class,Value},
@@ -1626,116 +1030,50 @@ erts_trace_return(Process* p, BeamInstr* fi, Eterm retval, Eterm *tracer_pid)
*/
void
erts_trace_exception(Process* p, BeamInstr mfa[3], Eterm class, Eterm value,
- Eterm *tracer_pid)
+ ErtsTracer *tracer)
{
Eterm* hp;
- Eterm mfa_tuple;
- Eterm cv;
- Eterm mess;
+ Eterm mfa_tuple, cv;
Uint meta_flags, *tracee_flags;
- int ts_type;
-#ifdef ERTS_SMP
- Eterm tracee;
-#endif
-
- ASSERT(tracer_pid);
- if (*tracer_pid == am_true) {
+
+ ASSERT(tracer);
+ if (ERTS_TRACER_COMPARE(*tracer, erts_tracer_true)) {
/* Breakpoint trace enabled without specifying tracer =>
* use process tracer and flags
*/
- tracer_pid = &ERTS_TRACER_PROC(p);
+ tracer = &ERTS_TRACER(p);
}
- if (is_nil(*tracer_pid)) {
+ if (ERTS_TRACER_IS_NIL(*tracer)) {
/* Trace disabled */
return;
}
- ASSERT(is_internal_pid(*tracer_pid) || is_internal_port(*tracer_pid));
- if (*tracer_pid == p->common.id) {
- /* Do not generate trace messages to oneself */
- return;
- }
- if (tracer_pid == &ERTS_TRACER_PROC(p)) {
+ ASSERT(IS_TRACER_VALID(*tracer));
+ if (tracer == &ERTS_TRACER(p)) {
/* Tracer specified in process structure =>
* non-breakpoint trace =>
* use process flags
*/
tracee_flags = &ERTS_TRACE_FLAGS(p);
-#ifdef ERTS_SMP
- tracee = p->common.id;
-#endif
- if (! (*tracee_flags & F_TRACE_CALLS)) {
- return;
- }
+ if (! (*tracee_flags & F_TRACE_CALLS)) {
+ return;
+ }
} else {
/* Tracer not specified in process structure =>
* tracer specified in breakpoint =>
* meta trace =>
* use fixed flag set instead of process flags
- */
+ */
meta_flags = F_TRACE_CALLS | F_NOW_TS;
tracee_flags = &meta_flags;
-#ifdef ERTS_SMP
- tracee = NIL;
-#endif
}
-
- ts_type = ERTS_TFLGS2TSTYPE(*tracee_flags);
-
- if (is_internal_port(*tracer_pid)) {
-#define LOCAL_HEAP_SIZE (4+3+6+ERTS_TRACE_PATCH_TS_MAX_SIZE)
- DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
- UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-
- hp = local_heap;
- mfa_tuple = TUPLE3(hp, (Eterm) mfa[0], (Eterm) mfa[1], make_small((Eterm)mfa[2]));
- hp += 4;
- cv = TUPLE2(hp, class, value);
- hp += 3;
- mess = TUPLE5(hp, am_trace, p->common.id, am_exception_from, mfa_tuple, cv);
- hp += 6;
- ASSERT((hp - local_heap) <= LOCAL_HEAP_SIZE);
- erts_smp_mtx_lock(&smq_mtx);
- PATCH_TS(ts_type, mess, hp, NULL, NULL);
- send_to_port(p, mess, tracer_pid, tracee_flags);
- UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-#undef LOCAL_HEAP_SIZE
- erts_smp_mtx_unlock(&smq_mtx);
- } else {
- ErlHeapFragment *bp;
- ErlOffHeap *off_heap;
- ERTS_TRACER_REF_TYPE tracer_ref;
- unsigned size;
- unsigned value_size;
-
- ASSERT(is_internal_pid(*tracer_pid));
-
- ERTS_GET_TRACER_REF(tracer_ref, *tracer_pid, *tracee_flags);
-
- value_size = size_object(value);
- size = 6 + 4 + 3 + value_size + patch_ts_size(ts_type);
-
- hp = ERTS_ALLOC_SYSMSG_HEAP(size, &bp, &off_heap, tracer_ref);
-
- /*
- * Build the trace tuple and put it into receive queue of the tracer process.
- */
-
- mfa_tuple = TUPLE3(hp, (Eterm) mfa[0], (Eterm) mfa[1], make_small((Eterm) mfa[2]));
- hp += 4;
- value = copy_struct(value, value_size, &hp, off_heap);
- cv = TUPLE2(hp, class, value);
- hp += 3;
- mess = TUPLE5(hp, am_trace, p->common.id,
- am_exception_from, mfa_tuple, cv);
- hp += 6;
- erts_smp_mtx_lock(&smq_mtx);
-
- PATCH_TS(ts_type, mess, hp, bp, tracer_ref);
-
- ERTS_ENQ_TRACE_MSG(tracee, tracer_ref, mess, bp);
- erts_smp_mtx_unlock(&smq_mtx);
- }
+ hp = HAlloc(p, 7);;
+ mfa_tuple = TUPLE3(hp, (Eterm) mfa[0], (Eterm) mfa[1], make_small((Eterm)mfa[2]));
+ hp += 4;
+ cv = TUPLE2(hp, class, value);
+ hp += 3;
+ send_to_tracer_nif_raw(p, NULL, *tracer, *tracee_flags, p->common.id,
+ NULL, TRACE_FUN_T_CALL, am_exception_from, mfa_tuple, cv, am_true);
}
/*
@@ -1754,7 +1092,7 @@ erts_trace_exception(Process* p, BeamInstr mfa[3], Eterm class, Eterm value,
*/
Uint32
erts_call_trace(Process* p, BeamInstr mfa[3], Binary *match_spec,
- Eterm* args, int local, Eterm *tracer_pid)
+ Eterm* args, int local, ErtsTracer *tracer)
{
Eterm* hp;
Eterm mfa_tuple;
@@ -1762,55 +1100,53 @@ erts_call_trace(Process* p, BeamInstr mfa[3], Binary *match_spec,
int i;
Uint32 return_flags;
Eterm pam_result = am_true;
- Eterm mess;
Uint meta_flags, *tracee_flags;
- int ts_type;
-#ifdef ERTS_SMP
- Eterm tracee;
-#endif
+ ErtsTracerNif *tnif = NULL;
Eterm transformed_args[MAX_ARG];
- DeclareTypedTmpHeap(ErlSubBin,sub_bin_heap,p);
+ ErtsTracer pre_ms_tracer = erts_tracer_nil;
- ASSERT(tracer_pid);
- if (*tracer_pid == am_true) {
- /* Breakpoint trace enabled without specifying tracer =>
+ ASSERT(tracer);
+ if (ERTS_TRACER_COMPARE(*tracer, erts_tracer_true)) {
+ /* Breakpoint trace enabled without specifying tracer =>
* use process tracer and flags
*/
- tracer_pid = &ERTS_TRACER_PROC(p);
- }
- if (is_nil(*tracer_pid)) {
- /* Trace disabled */
- return 0;
+ tracer = &ERTS_TRACER(p);
}
- ASSERT(is_internal_pid(*tracer_pid) || is_internal_port(*tracer_pid));
- if (*tracer_pid == p->common.id) {
- /* Do not generate trace messages to oneself */
+ if (ERTS_TRACER_IS_NIL(*tracer)) {
+ /* Trace disabled */
return 0;
}
- if (tracer_pid == &ERTS_TRACER_PROC(p)) {
+ ASSERT(IS_TRACER_VALID(*tracer));
+ if (tracer == &ERTS_TRACER(p)) {
/* Tracer specified in process structure =>
* non-breakpoint trace =>
* use process flags
*/
tracee_flags = &ERTS_TRACE_FLAGS(p);
-#ifdef ERTS_SMP
- tracee = p->common.id;
-#endif
+ if (!is_tracer_enabled(p, ERTS_PROC_LOCK_MAIN, &p->common, &tnif,
+ TRACE_FUN_E_CALL, am_call)) {
+ return 0;
+ }
} else {
/* Tracer not specified in process structure =>
* tracer specified in breakpoint =>
* meta trace =>
* use fixed flag set instead of process flags
- */
- if (ERTS_TRACE_FLAGS(p) & F_SENSITIVE) {
- /* No trace messages for sensitive processes. */
- return 0;
- }
+ */
+ if (ERTS_TRACE_FLAGS(p) & F_SENSITIVE) {
+ /* No trace messages for sensitive processes. */
+ return 0;
+ }
meta_flags = F_TRACE_CALLS | F_NOW_TS;
tracee_flags = &meta_flags;
-#ifdef ERTS_SMP
- tracee = NIL;
-#endif
+ switch (call_enabled_tracer(p, *tracer,
+ &tnif, TRACE_FUN_T_CALL,
+ am_call, p->common.id)) {
+ default:
+ case am_remove: *tracer = erts_tracer_nil;
+ case am_discard: return 0;
+ case am_trace: break;
+ }
}
/*
@@ -1821,18 +1157,13 @@ erts_call_trace(Process* p, BeamInstr mfa[3], Binary *match_spec,
* temporarily convert any match contexts to sub binaries.
*/
arity = (Eterm) mfa[2];
- UseTmpHeap(ERL_SUB_BIN_SIZE,p);
-#ifdef DEBUG
- sub_bin_heap->thing_word = 0;
-#endif
for (i = 0; i < arity; i++) {
Eterm arg = args[i];
if (is_boxed(arg) && header_is_bin_matchstate(*boxed_val(arg))) {
ErlBinMatchState* ms = (ErlBinMatchState *) boxed_val(arg);
ErlBinMatchBuffer* mb = &ms->mb;
Uint bit_size;
-
- ASSERT(sub_bin_heap->thing_word == 0); /* At most one of match context */
+ ErlSubBin *sub_bin_heap = (ErlSubBin *)HAlloc(p, ERL_SUB_BIN_SIZE);
bit_size = mb->size - mb->offset;
sub_bin_heap->thing_word = HEADER_SUB_BIN;
@@ -1849,275 +1180,98 @@ erts_call_trace(Process* p, BeamInstr mfa[3], Binary *match_spec,
}
args = transformed_args;
- ts_type = ERTS_TFLGS2TSTYPE(*tracee_flags);
-
- if (is_internal_port(*tracer_pid)) {
- Eterm local_heap[64+ERTS_TRACE_PATCH_TS_MAX_SIZE+MAX_ARG];
- hp = local_heap;
-
- if (!erts_is_valid_tracer_port(*tracer_pid)) {
-#ifdef ERTS_SMP
- ASSERT(is_nil(tracee) || tracer_pid == &ERTS_TRACER_PROC(p));
- if (is_not_nil(tracee))
- erts_smp_proc_lock(p, ERTS_PROC_LOCKS_ALL_MINOR);
-#endif
- *tracee_flags &= ~TRACEE_FLAGS;
- *tracer_pid = NIL;
-#ifdef ERTS_SMP
- if (is_not_nil(tracee))
- erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL_MINOR);
-#endif
- UnUseTmpHeap(ERL_SUB_BIN_SIZE,p);
- return 0;
- }
-
- /*
- * If there is a PAM program, run it. Return if it fails.
- *
- * Some precedence rules:
- *
- * - No proc flags, e.g 'silent' or 'return_to'
- * has any effect on meta trace.
- * - The 'silent' process trace flag silences all call
- * related messages, e.g 'call', 'return_to' and 'return_from'.
- * - The {message,_} PAM function does not affect {return_trace}.
- * - The {message,false} PAM function shall give the same
- * 'call' trace message as no PAM match.
- * - The {message,true} PAM function shall give the same
- * 'call' trace message as a nonexistent PAM program.
- */
-
- /* BEGIN this code should be the same for port and pid trace */
- return_flags = 0;
- if (match_spec) {
- pam_result = erts_match_set_run(p, match_spec, args, arity,
- ERTS_PAM_TMP_RESULT, &return_flags);
- if (is_non_value(pam_result)) {
- erts_match_set_release_result(p);
- UnUseTmpHeap(ERL_SUB_BIN_SIZE,p);
- return 0;
- }
- }
- if (tracee_flags == &meta_flags) {
- /* Meta trace */
- if (pam_result == am_false) {
- erts_match_set_release_result(p);
- UnUseTmpHeap(ERL_SUB_BIN_SIZE,p);
- return return_flags;
- }
- } else {
- /* Non-meta trace */
- if (*tracee_flags & F_TRACE_SILENT) {
- erts_match_set_release_result(p);
- UnUseTmpHeap(ERL_SUB_BIN_SIZE,p);
- return 0;
- }
- if (pam_result == am_false) {
- erts_match_set_release_result(p);
- UnUseTmpHeap(ERL_SUB_BIN_SIZE,p);
- return return_flags;
- }
- if (local && (*tracee_flags & F_TRACE_RETURN_TO)) {
- return_flags |= MATCH_SET_RETURN_TO_TRACE;
- }
- }
- /* END this code should be the same for port and pid trace */
-
- /*
- * Build the the {M,F,A} tuple in the local heap.
- * (A is arguments or arity.)
- */
-
- if (*tracee_flags & F_TRACE_ARITY_ONLY) {
- mfa_tuple = make_small(arity);
- } else {
- mfa_tuple = NIL;
- for (i = arity-1; i >= 0; i--) {
- mfa_tuple = CONS(hp, args[i], mfa_tuple);
- hp += 2;
- }
- }
- mfa_tuple = TUPLE3(hp, (Eterm) mfa[0], (Eterm) mfa[1], mfa_tuple);
- hp += 4;
-
- /*
- * Build the trace tuple and send it to the port.
- */
-
- mess = TUPLE4(hp, am_trace, p->common.id, am_call, mfa_tuple);
- hp += 5;
- if (pam_result != am_true) {
- hp[-5] = make_arityval(5);
- *hp++ = pam_result;
- }
- erts_smp_mtx_lock(&smq_mtx);
- PATCH_TS(ts_type, mess, hp, NULL, NULL);
- send_to_port(p, mess, tracer_pid, tracee_flags);
- erts_smp_mtx_unlock(&smq_mtx);
- erts_match_set_release_result(p);
- UnUseTmpHeap(ERL_SUB_BIN_SIZE,p);
- return *tracer_pid == NIL ? 0 : return_flags;
+ /*
+ * If there is a PAM program, run it. Return if it fails.
+ *
+ * Some precedence rules:
+ *
+ * - No proc flags, e.g 'silent' or 'return_to'
+ * has any effect on meta trace.
+ * - The 'silent' process trace flag silences all call
+ * related messages, e.g 'call', 'return_to' and 'return_from'.
+ * - The {message,_} PAM function does not affect {return_trace}.
+ * - The {message,false} PAM function shall give the same
+ * 'call' trace message as no PAM match.
+ * - The {message,true} PAM function shall give the same
+ * 'call' trace message as a nonexistent PAM program.
+ */
+ return_flags = 0;
+ if (match_spec) {
+ /* we have to make a copy of the tracer here as the match spec
+ may remove it, and we still want to generate a trace message */
+ erts_tracer_update(&pre_ms_tracer, *tracer);
+ tracer = &pre_ms_tracer;
+ pam_result = erts_match_set_run(p, match_spec, args, arity,
+ ERTS_PAM_TMP_RESULT, &return_flags);
+ if (is_non_value(pam_result)) {
+ erts_match_set_release_result(p);
+ UnUseTmpHeap(ERL_SUB_BIN_SIZE,p);
+ ERTS_TRACER_CLEAR(&pre_ms_tracer);
+ return 0;
+ }
+ }
+
+ if (tracee_flags == &meta_flags) {
+ /* Meta trace */
+ if (pam_result == am_false) {
+ erts_match_set_release_result(p);
+ UnUseTmpHeap(ERL_SUB_BIN_SIZE,p);
+ ERTS_TRACER_CLEAR(&pre_ms_tracer);
+ return return_flags;
+ }
} else {
- ErlHeapFragment *bp;
- ErlOffHeap *off_heap;
- Process *tracer;
- ERTS_TRACER_REF_TYPE tracer_ref;
-#ifdef ERTS_SMP
- Eterm tpid;
-#endif
- unsigned size;
- unsigned sizes[MAX_ARG];
- unsigned pam_result_size = 0;
- int invalid_tracer;
-
- ASSERT(is_internal_pid(*tracer_pid));
-
- tracer = erts_pid2proc(p, ERTS_PROC_LOCK_MAIN,
- *tracer_pid, ERTS_PROC_LOCK_STATUS);
- if (!tracer)
- invalid_tracer = 1;
- else {
- invalid_tracer = !(ERTS_TRACE_FLAGS(tracer) & F_TRACER);
- erts_smp_proc_unlock(tracer, ERTS_PROC_LOCK_STATUS);
- }
+ /* Non-meta trace */
+ if (*tracee_flags & F_TRACE_SILENT) {
+ erts_match_set_release_result(p);
+ UnUseTmpHeap(ERL_SUB_BIN_SIZE,p);
+ ERTS_TRACER_CLEAR(&pre_ms_tracer);
+ return 0;
+ }
+ if (pam_result == am_false) {
+ erts_match_set_release_result(p);
+ UnUseTmpHeap(ERL_SUB_BIN_SIZE,p);
+ ERTS_TRACER_CLEAR(&pre_ms_tracer);
+ return return_flags;
+ }
+ if (local && (*tracee_flags & F_TRACE_RETURN_TO)) {
+ return_flags |= MATCH_SET_RETURN_TO_TRACE;
+ }
+ }
+
+ ASSERT(!ERTS_TRACER_IS_NIL(*tracer));
- if (invalid_tracer) {
-#ifdef ERTS_SMP
- ASSERT(is_nil(tracee)
- || tracer_pid == &ERTS_TRACER_PROC(p));
- if (is_not_nil(tracee))
- erts_smp_proc_lock(p, ERTS_PROC_LOCKS_ALL_MINOR);
-#endif
- *tracee_flags &= ~TRACEE_FLAGS;
- *tracer_pid = NIL;
-#ifdef ERTS_SMP
- if (is_not_nil(tracee))
- erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL_MINOR);
-#endif
- UnUseTmpHeap(ERL_SUB_BIN_SIZE,p);
- return 0;
- }
-
-#ifdef ERTS_SMP
- tpid = *tracer_pid; /* Need to save tracer pid,
- since *tracer_pid might
- be reset by erts_match_set_run() */
- tracer_ref = tpid;
-#else
- tracer_ref = tracer;
-#endif
-
- /*
- * If there is a PAM program, run it. Return if it fails.
- *
- * See the rules above in the port trace code.
- */
-
- /* BEGIN this code should be the same for port and pid trace */
- return_flags = 0;
- if (match_spec) {
- pam_result = erts_match_set_run(p, match_spec, args, arity,
- ERTS_PAM_TMP_RESULT, &return_flags);
- if (is_non_value(pam_result)) {
- erts_match_set_release_result(p);
- UnUseTmpHeap(ERL_SUB_BIN_SIZE,p);
- return 0;
- }
- }
- if (tracee_flags == &meta_flags) {
- /* Meta trace */
- if (pam_result == am_false) {
- erts_match_set_release_result(p);
- UnUseTmpHeap(ERL_SUB_BIN_SIZE,p);
- return return_flags;
- }
- } else {
- /* Non-meta trace */
- if (*tracee_flags & F_TRACE_SILENT) {
- erts_match_set_release_result(p);
- UnUseTmpHeap(ERL_SUB_BIN_SIZE,p);
- return 0;
- }
- if (pam_result == am_false) {
- erts_match_set_release_result(p);
- UnUseTmpHeap(ERL_SUB_BIN_SIZE,p);
- return return_flags;
- }
- if (local && (*tracee_flags & F_TRACE_RETURN_TO)) {
- return_flags |= MATCH_SET_RETURN_TO_TRACE;
- }
- }
- /* END this code should be the same for port and pid trace */
-
- /*
- * Calculate number of words needed on heap.
- */
-
- size = 4 + 5; /* Trace tuple + MFA tuple. */
- if (! (*tracee_flags & F_TRACE_ARITY_ONLY)) {
- size += 2*arity;
- for (i = arity-1; i >= 0; i--) {
- sizes[i] = size_object(args[i]);
- size += sizes[i];
- }
- }
- size += patch_ts_size(ts_type);
- if (pam_result != am_true) {
- pam_result_size = size_object(pam_result);
- size += 1 + pam_result_size;
- /* One element in trace tuple + term size. */
- }
-
- hp = ERTS_ALLOC_SYSMSG_HEAP(size, &bp, &off_heap, tracer_ref);
+ /*
+ * Build the the {M,F,A} tuple in the local heap.
+ * (A is arguments or arity.)
+ */
- /*
- * Build the the {M,F,A} tuple in the message buffer.
- * (A is arguments or arity.)
- */
-
- if (*tracee_flags & F_TRACE_ARITY_ONLY) {
- mfa_tuple = make_small(arity);
- } else {
- mfa_tuple = NIL;
- for (i = arity-1; i >= 0; i--) {
- Eterm term = copy_struct(args[i], sizes[i], &hp, off_heap);
- mfa_tuple = CONS(hp, term, mfa_tuple);
- hp += 2;
- }
- }
- mfa_tuple = TUPLE3(hp, (Eterm) mfa[0], (Eterm) mfa[1], mfa_tuple);
- hp += 4;
-
- /*
- * Copy the PAM result (if any) onto the heap.
- */
-
- if (pam_result != am_true) {
- pam_result = copy_struct(pam_result, pam_result_size, &hp, off_heap);
- }
- erts_match_set_release_result(p);
+ if (*tracee_flags & F_TRACE_ARITY_ONLY) {
+ hp = HAlloc(p, 4);
+ mfa_tuple = make_small(arity);
+ } else {
+ hp = HAlloc(p, 4 + arity * 2);
+ mfa_tuple = NIL;
+ for (i = arity-1; i >= 0; i--) {
+ mfa_tuple = CONS(hp, args[i], mfa_tuple);
+ hp += 2;
+ }
+ }
+ mfa_tuple = TUPLE3(hp, (Eterm) mfa[0], (Eterm) mfa[1], mfa_tuple);
+ hp += 4;
- /*
- * Build the trace tuple and enqueue it.
- */
-
- mess = TUPLE4(hp, am_trace, p->common.id, am_call, mfa_tuple);
- hp += 5;
- if (pam_result != am_true) {
- hp[-5] = make_arityval(5);
- *hp++ = pam_result;
- }
+ /*
+ * Build the trace tuple and send it to the port.
+ */
+ send_to_tracer_nif_raw(p, NULL, *tracer, *tracee_flags, p->common.id,
+ tnif, TRACE_FUN_T_CALL, am_call, mfa_tuple, THE_NON_VALUE, pam_result);
+ erts_match_set_release_result(p);
- erts_smp_mtx_lock(&smq_mtx);
+ if (match_spec && tracer == &pre_ms_tracer)
+ ERTS_TRACER_CLEAR(&pre_ms_tracer);
- PATCH_TS(ts_type, mess, hp, bp, tracer_ref);
- ERTS_ENQ_TRACE_MSG(tracee, tracer_ref, mess, bp);
- erts_smp_mtx_unlock(&smq_mtx);
- UnUseTmpHeap(ERL_SUB_BIN_SIZE,p);
- return return_flags;
- }
+ return return_flags;
}
/* Sends trace message:
@@ -2129,69 +1283,14 @@ erts_call_trace(Process* p, BeamInstr mfa[3], Binary *match_spec,
* 't_p' is the traced process.
*/
void
-trace_proc(Process *c_p, Process *t_p, Eterm what, Eterm data)
+trace_proc(Process *c_p, ErtsProcLocks c_p_locks,
+ Process *t_p, Eterm what, Eterm data)
{
- Eterm mess;
- Eterm* hp;
- int need;
-
- ERTS_SMP_LC_ASSERT((erts_proc_lc_my_proc_locks(t_p) != 0)
- || erts_thr_progress_is_blocking());
- if (is_internal_port(ERTS_TRACER_PROC(t_p))) {
-#define LOCAL_HEAP_SIZE (5+5)
- DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
- UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-
-
- hp = local_heap;
- mess = TUPLE4(hp, am_trace, t_p->common.id, what, data);
- hp += 5;
- erts_smp_mtx_lock(&smq_mtx);
- PATCH_TS(TFLGS_TS_TYPE(t_p), mess, hp, NULL, NULL);
- send_to_port(
-#ifndef ERTS_SMP
- /* No fake schedule out and in again after an exit */
- what == am_exit ? NULL : c_p,
-#else
- /* Fake schedule out and in are never sent when smp enabled */
- c_p,
-#endif
- mess,
- &ERTS_TRACER_PROC(t_p),
- &ERTS_TRACE_FLAGS(t_p));
- UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-#undef LOCAL_HEAP_SIZE
- erts_smp_mtx_unlock(&smq_mtx);
- } else {
- Eterm tmp;
- ErlHeapFragment *bp;
- ErlOffHeap *off_heap;
- ERTS_TRACER_REF_TYPE tracer_ref;
- size_t sz_data;
-
- ASSERT(is_internal_pid(ERTS_TRACER_PROC(t_p)));
-
- ERTS_GET_TRACER_REF(tracer_ref,
- ERTS_TRACER_PROC(t_p),
- ERTS_TRACE_FLAGS(t_p));
-
- sz_data = size_object(data);
-
- need = sz_data + 5 + PATCH_TS_SIZE(t_p);
-
- hp = ERTS_ALLOC_SYSMSG_HEAP(need, &bp, &off_heap, tracer_ref);
-
- tmp = copy_struct(data, sz_data, &hp, off_heap);
- mess = TUPLE4(hp, am_trace, t_p->common.id, what, tmp);
- hp += 5;
-
- erts_smp_mtx_lock(&smq_mtx);
-
- PATCH_TS(TFLGS_TS_TYPE(t_p), mess, hp, bp, tracer_ref);
-
- ERTS_ENQ_TRACE_MSG(t_p->common.id, tracer_ref, mess, bp);
- erts_smp_mtx_unlock(&smq_mtx);
- }
+ ErtsTracerNif *tnif = NULL;
+ if (is_tracer_enabled(c_p, c_p_locks, &t_p->common, &tnif,
+ TRACE_FUN_E_PROCS, what))
+ send_to_tracer_nif(c_p, &t_p->common, t_p->common.id, tnif, TRACE_FUN_T_PROCS,
+ what, data, THE_NON_VALUE);
}
@@ -2203,77 +1302,38 @@ trace_proc(Process *c_p, Process *t_p, Eterm what, Eterm data)
* and 'args' may be a deep term.
*/
void
-trace_proc_spawn(Process *p, Eterm pid,
+trace_proc_spawn(Process *p, Eterm what, Eterm pid,
Eterm mod, Eterm func, Eterm args)
{
- Eterm mfa;
- Eterm mess;
- Eterm* hp;
-
- if (is_internal_port(ERTS_TRACER_PROC(p))) {
-#define LOCAL_HEAP_SIZE (4+6+5)
- DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
- UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-
- hp = local_heap;
- mfa = TUPLE3(hp, mod, func, args);
- hp += 4;
- mess = TUPLE5(hp, am_trace, p->common.id, am_spawn, pid, mfa);
- hp += 6;
- erts_smp_mtx_lock(&smq_mtx);
- PATCH_TS(TFLGS_TS_TYPE(p), mess, hp, NULL, NULL);
- send_to_port(p, mess, &ERTS_TRACER_PROC(p), &ERTS_TRACE_FLAGS(p));
- UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-#undef LOCAL_HEAP_SIZE
- erts_smp_mtx_unlock(&smq_mtx);
- } else {
- Eterm tmp;
- ErlHeapFragment *bp;
- ErlOffHeap *off_heap;
- ERTS_TRACER_REF_TYPE tracer_ref;
- size_t sz_args, sz_pid;
- Uint need;
-
- ASSERT(is_internal_pid(ERTS_TRACER_PROC(p)));
-
- ERTS_GET_TRACER_REF(tracer_ref,
- ERTS_TRACER_PROC(p),
- ERTS_TRACE_FLAGS(p));
-
- sz_args = size_object(args);
- sz_pid = size_object(pid);
- need = sz_args + 4 + 6 + PATCH_TS_SIZE(p);
-
- hp = ERTS_ALLOC_SYSMSG_HEAP(need, &bp, &off_heap, tracer_ref);
-
- tmp = copy_struct(args, sz_args, &hp, off_heap);
- mfa = TUPLE3(hp, mod, func, tmp);
- hp += 4;
- tmp = copy_struct(pid, sz_pid, &hp, off_heap);
- mess = TUPLE5(hp, am_trace, p->common.id, am_spawn, tmp, mfa);
- hp += 6;
+ ErtsTracerNif *tnif = NULL;
+ if (is_tracer_enabled(p, ERTS_PROC_LOCKS_ALL &
+ ~(ERTS_PROC_LOCK_STATUS|ERTS_PROC_LOCK_TRACE),
+ &p->common, &tnif, TRACE_FUN_E_PROCS, what)) {
+ Eterm mfa;
+ Eterm* hp;
- erts_smp_mtx_lock(&smq_mtx);
-
- PATCH_TS(TFLGS_TS_TYPE(p), mess, hp, bp, tracer_ref);
-
- ERTS_ENQ_TRACE_MSG(p->common.id, tracer_ref, mess, bp);
- erts_smp_mtx_unlock(&smq_mtx);
+ hp = HAlloc(p, 4);
+ mfa = TUPLE3(hp, mod, func, args);
+ hp += 4;
+ send_to_tracer_nif(p, &p->common, p->common.id, tnif, TRACE_FUN_T_PROCS,
+ what, pid, mfa);
}
}
void save_calls(Process *p, Export *e)
{
- struct saved_calls *scb = ERTS_PROC_GET_SAVED_CALLS_BUF(p);
- if (scb) {
- Export **ct = &scb->ct[0];
- int len = scb->len;
-
- ct[scb->cur] = e;
- if (++scb->cur >= len)
- scb->cur = 0;
- if (scb->n < len)
- scb->n++;
+ if ((ERTS_TRACE_FLAGS(p) & F_SENSITIVE) == 0) {
+ struct saved_calls *scb = ERTS_PROC_GET_SAVED_CALLS_BUF(p);
+ if (scb) {
+ Export **ct = &scb->ct[0];
+ int len = scb->len;
+
+ ct[scb->cur] = e;
+ if (++scb->cur >= len)
+ scb->cur = 0;
+ if (scb->n < len)
+ scb->n++;
+ }
}
}
@@ -2290,68 +1350,26 @@ void save_calls(Process *p, Export *e)
* are all small (atomic) integers.
*/
void
-trace_gc(Process *p, Eterm what)
+trace_gc(Process *p, Eterm what, Uint size)
{
- ErlHeapFragment *bp = NULL;
- ErlOffHeap *off_heap;
- ERTS_TRACER_REF_TYPE tracer_ref = ERTS_NULL_TRACER_REF; /* Initialized
- to eliminate
- compiler
- warning */
+ ErtsTracerNif *tnif = NULL;
Eterm* hp;
Eterm msg = NIL;
- Uint size;
-
-#define LOCAL_HEAP_SIZE \
- (ERTS_PROCESS_GC_INFO_MAX_SIZE) + \
- 5/*4-tuple */ + ERTS_TRACE_PATCH_TS_MAX_SIZE
- DeclareTmpHeap(local_heap,LOCAL_HEAP_SIZE,p);
-
- UseTmpHeap(LOCAL_HEAP_SIZE,p);
-
- if (is_internal_port(ERTS_TRACER_PROC(p))) {
- hp = local_heap;
-#ifdef DEBUG
- size = 0;
- (void) erts_process_gc_info(p, &size, NULL);
-
- size += 5/*4-tuple*/ + PATCH_TS_SIZE(p);
-#endif
- } else {
- ASSERT(is_internal_pid(ERTS_TRACER_PROC(p)));
-
- ERTS_GET_TRACER_REF(tracer_ref,
- ERTS_TRACER_PROC(p),
- ERTS_TRACE_FLAGS(p));
-
- size = 0;
- (void) erts_process_gc_info(p, &size, NULL);
-
- size += 5/*4-tuple*/ + PATCH_TS_SIZE(p);
-
- hp = ERTS_ALLOC_SYSMSG_HEAP(size, &bp, &off_heap, tracer_ref);
- }
-
- ASSERT(size <= LOCAL_HEAP_SIZE);
+ Uint sz = 0;
+ Eterm tup;
- msg = erts_process_gc_info(p, NULL, &hp);
+ if (is_tracer_enabled(p, ERTS_PROC_LOCK_MAIN, &p->common, &tnif, TRACE_FUN_E_GC, what)) {
- msg = TUPLE4(hp, am_trace, p->common.id, what, msg);
- hp += 5;
+ (void) erts_process_gc_info(p, &sz, NULL);
+ hp = HAlloc(p, sz + 3 + 2);
- erts_smp_mtx_lock(&smq_mtx);
+ msg = erts_process_gc_info(p, NULL, &hp);
+ tup = TUPLE2(hp, am_wordsize, make_small(size)); hp += 3;
+ msg = CONS(hp, tup, msg); hp += 2;
- if (is_internal_port(ERTS_TRACER_PROC(p))) {
- PATCH_TS(TFLGS_TS_TYPE(p), msg, hp, NULL, NULL);
- send_to_port(p, msg, &ERTS_TRACER_PROC(p), &ERTS_TRACE_FLAGS(p));
+ send_to_tracer_nif(p, &p->common, p->common.id, tnif, TRACE_FUN_T_GC,
+ what, msg, am_undefined);
}
- else {
- PATCH_TS(TFLGS_TS_TYPE(p), msg, hp, bp, tracer_ref);
- ERTS_ENQ_TRACE_MSG(p->common.id, tracer_ref, msg, bp);
- }
- erts_smp_mtx_unlock(&smq_mtx);
- UnUseTmpHeap(LOCAL_HEAP_SIZE,p);
-#undef LOCAL_HEAP_SIZE
}
void
@@ -2413,7 +1431,7 @@ monitor_long_schedule_proc(Process *p, BeamInstr *in_fp, BeamInstr *out_fp, Uint
{
ErtsMessage *mp = erts_alloc_message(0, NULL);
mp->data.heap_frag = bp;
- erts_queue_message(monitor_p, NULL, mp, msg, NIL);
+ erts_queue_message(monitor_p, NULL, mp, msg);
}
#endif
}
@@ -2478,7 +1496,7 @@ monitor_long_schedule_port(Port *pp, ErtsPortTaskType type, Uint time)
{
ErtsMessage *mp = erts_alloc_message(0, NULL);
mp->data.heap_frag = bp;
- erts_queue_message(monitor_p, NULL, mp, msg, NIL);
+ erts_queue_message(monitor_p, NULL, mp, msg);
}
#endif
}
@@ -2553,7 +1571,7 @@ monitor_long_gc(Process *p, Uint time) {
{
ErtsMessage *mp = erts_alloc_message(0, NULL);
mp->data.heap_frag = bp;
- erts_queue_message(monitor_p, NULL, mp, msg, NIL);
+ erts_queue_message(monitor_p, NULL, mp, msg);
}
#endif
}
@@ -2628,7 +1646,7 @@ monitor_large_heap(Process *p) {
{
ErtsMessage *mp = erts_alloc_message(0, NULL);
mp->data.heap_frag = bp;
- erts_queue_message(monitor_p, NULL, mp, msg, NIL);
+ erts_queue_message(monitor_p, NULL, mp, msg);
}
#endif
}
@@ -2660,7 +1678,7 @@ monitor_generic(Process *p, Eterm type, Eterm spec) {
{
ErtsMessage *mp = erts_alloc_message(0, NULL);
mp->data.heap_frag = bp;
- erts_queue_message(monitor_p, NULL, mp, msg, NIL);
+ erts_queue_message(monitor_p, NULL, mp, msg);
}
#endif
@@ -2722,106 +1740,15 @@ profile_scheduler(Eterm scheduler_id, Eterm state) {
}
-void
-profile_scheduler_q(Eterm scheduler_id, Eterm state, Eterm no_schedulers, Uint Ms, Uint s, Uint us) {
- Eterm *hp, msg, timestamp;
-
-#ifndef ERTS_SMP
-#define LOCAL_HEAP_SIZE (4 + 7)
- DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
- UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-
- hp = local_heap;
-#else
- ErlHeapFragment *bp;
- Uint hsz;
-
- hsz = 4 + 7;
-
- bp = new_message_buffer(hsz);
- hp = bp->mem;
-#endif
-
- erts_smp_mtx_lock(&smq_mtx);
-
- timestamp = TUPLE3(hp, make_small(Ms), make_small(s), make_small(us)); hp += 4;
- msg = TUPLE6(hp, am_profile, am_scheduler, scheduler_id, state, no_schedulers, timestamp); hp += 7;
-#ifndef ERTS_SMP
- profile_send(NIL, msg);
- UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-#undef LOCAL_HEAP_SIZE
-#else
- enqueue_sys_msg_unlocked(SYS_MSG_TYPE_SYSPROF, NIL, NIL, msg, bp);
-#endif
- erts_smp_mtx_unlock(&smq_mtx);
-
-}
-
-
-/* Send {trace_ts, Pid, What, {Mod, Func, Arity}, Timestamp}
- * or {trace, Pid, What, {Mod, Func, Arity}}
- *
- * where 'What' is supposed to be 'in' or 'out'.
- *
- * Virtual scheduling do not fake scheduling for ports.
- */
-
-
-void trace_virtual_sched(Process *p, Eterm what)
-{
- trace_sched_aux(p, what, 1);
-}
-
/* Port profiling */
void
trace_port_open(Port *p, Eterm calling_pid, Eterm drv_name) {
- Eterm mess;
- Eterm* hp;
-
- if (is_internal_port(ERTS_TRACER_PROC(p))) {
-#define LOCAL_HEAP_SIZE (6+ERTS_TRACE_PATCH_TS_MAX_SIZE)
- DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
- UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-
- hp = local_heap;
-
- mess = TUPLE5(hp, am_trace, calling_pid, am_open, p->common.id, drv_name);
- hp += 6;
- erts_smp_mtx_lock(&smq_mtx);
- PATCH_TS(TFLGS_TS_TYPE(p), mess, hp, NULL, NULL);
- /* No fake schedule */
- send_to_port(NULL, mess, &ERTS_TRACER_PROC(p), &ERTS_TRACE_FLAGS(p));
- UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-#undef LOCAL_HEAP_SIZE
- erts_smp_mtx_unlock(&smq_mtx);
- } else {
- ErlHeapFragment *bp;
- ErlOffHeap *off_heap;
- size_t sz_data;
- ERTS_TRACER_REF_TYPE tracer_ref;
-
- ASSERT(is_internal_pid(ERTS_TRACER_PROC(p)));
-
- sz_data = 6 + PATCH_TS_SIZE(p);
-
- ERTS_GET_TRACER_REF(tracer_ref,
- ERTS_TRACER_PROC(p),
- ERTS_TRACE_FLAGS(p));
-
- hp = ERTS_ALLOC_SYSMSG_HEAP(sz_data, &bp, &off_heap, tracer_ref);
-
- mess = TUPLE5(hp, am_trace, calling_pid, am_open, p->common.id, drv_name);
- hp += 6;
-
- erts_smp_mtx_lock(&smq_mtx);
-
- PATCH_TS(TFLGS_TS_TYPE(p), mess, hp, bp, tracer_ref);
-
- ERTS_ENQ_TRACE_MSG(p->common.id, tracer_ref, mess, bp);
- erts_smp_mtx_unlock(&smq_mtx);
- }
-
+ ErtsTracerNif *tnif = NULL;
+ ERTS_SMP_CHK_NO_PROC_LOCKS;
+ if (is_tracer_enabled(NULL, 0, &p->common, &tnif, TRACE_FUN_E_PORTS, am_open))
+ send_to_tracer_nif(NULL, &p->common, p->common.id, tnif, TRACE_FUN_T_PORTS,
+ am_open, calling_pid, drv_name);
}
/* Sends trace message:
@@ -2833,52 +1760,211 @@ trace_port_open(Port *p, Eterm calling_pid, Eterm drv_name) {
*/
void
trace_port(Port *t_p, Eterm what, Eterm data) {
- Eterm mess;
- Eterm* hp;
+ ErtsTracerNif *tnif = NULL;
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(t_p)
|| erts_thr_progress_is_blocking());
+ ERTS_SMP_CHK_NO_PROC_LOCKS;
+ if (is_tracer_enabled(NULL, 0, &t_p->common, &tnif, TRACE_FUN_E_PORTS, what))
+ send_to_tracer_nif(NULL, &t_p->common, t_p->common.id, tnif, TRACE_FUN_T_PORTS,
+ what, data, THE_NON_VALUE);
+}
- if (is_internal_port(ERTS_TRACER_PROC(t_p))) {
-#define LOCAL_HEAP_SIZE (5+ERTS_TRACE_PATCH_TS_MAX_SIZE)
- DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
- UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
- hp = local_heap;
- mess = TUPLE4(hp, am_trace, t_p->common.id, what, data);
- hp += 5;
- erts_smp_mtx_lock(&smq_mtx);
- PATCH_TS(TFLGS_TS_TYPE(t_p), mess, hp, NULL, NULL);
- /* No fake schedule */
- send_to_port(NULL,mess,&ERTS_TRACER_PROC(t_p),&ERTS_TRACE_FLAGS(t_p));
- UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-#undef LOCAL_HEAP_SIZE
- erts_smp_mtx_unlock(&smq_mtx);
+static Eterm
+trace_port_tmp_binary(char *bin, Sint sz, Binary **bptrp, Eterm **hp)
+{
+ if (sz <= ERL_ONHEAP_BIN_LIMIT) {
+ ErlHeapBin *hb = (ErlHeapBin *)*hp;
+ hb->thing_word = header_heap_bin(sz);
+ hb->size = sz;
+ sys_memcpy(hb->data, bin, sz);
+ *hp += heap_bin_size(sz);
+ return make_binary(hb);
} else {
- ErlHeapFragment *bp;
- ErlOffHeap *off_heap;
- size_t sz_data;
- ERTS_TRACER_REF_TYPE tracer_ref;
+ ProcBin* pb = (ProcBin *)*hp;
+ Binary *bptr = erts_bin_nrml_alloc(sz);
+ erts_refc_init(&bptr->refc, 1);
+ sys_memcpy(bptr->orig_bytes, bin, sz);
+ pb->thing_word = HEADER_PROC_BIN;
+ pb->size = sz;
+ pb->next = NULL;
+ pb->val = bptr;
+ pb->bytes = (byte*) bptr->orig_bytes;
+ pb->flags = 0;
+ *bptrp = bptr;
+ *hp += PROC_BIN_SIZE;
+ return make_binary(pb);
+ }
+}
+
+/* Sends trace message:
+ * {trace, PortPid, 'receive', {pid(), {command, iolist()}}}
+ * {trace, PortPid, 'receive', {pid(), {control, pid()}}}
+ * {trace, PortPid, 'receive', {pid(), exit}}
+ *
+ */
+void
+trace_port_receive(Port *t_p, Eterm caller, Eterm what, ...)
+{
+ ErtsTracerNif *tnif = NULL;
+ ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(t_p)
+ || erts_thr_progress_is_blocking());
+ ERTS_SMP_CHK_NO_PROC_LOCKS;
+ if (is_tracer_enabled(NULL, 0, &t_p->common, &tnif, TRACE_FUN_E_RECEIVE, am_receive)) {
+ /* We can use a stack heap here, as the nif is called in the
+ context of a port */
+#define LOCAL_HEAP_SIZE (3 + 3 + heap_bin_size(ERL_ONHEAP_BIN_LIMIT) + 3)
+ DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
+
+ Eterm *hp, data, *orig_hp = NULL;
+ Binary *bptr = NULL;
+ va_list args;
+ UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
+ hp = local_heap;
+
+ if (what == am_close) {
+ data = what;
+ } else {
+ Eterm arg;
+ va_start(args, what);
+ if (what == am_command) {
+ char *bin = va_arg(args, char *);
+ Sint sz = va_arg(args, Sint);
+ va_end(args);
+ arg = trace_port_tmp_binary(bin, sz, &bptr, &hp);
+ } else if (what == am_call || what == am_control) {
+ unsigned int command = va_arg(args, unsigned int);
+ char *bin = va_arg(args, char *);
+ Sint sz = va_arg(args, Sint);
+ Eterm cmd;
+ va_end(args);
+ arg = trace_port_tmp_binary(bin, sz, &bptr, &hp);
+#if defined(ARCH_32)
+ if (!IS_USMALL(0, command)) {
+ *hp = make_pos_bignum_header(1);
+ BIG_DIGIT(hp, 0) = (Uint)command;
+ cmd = make_big(hp);
+ hp += 2;
+ } else
+#endif
+ {
+ cmd = make_small((Sint)command);
+ }
+ arg = TUPLE2(hp, cmd, arg);
+ hp += 3;
+ } else if (what == am_commandv) {
+ ErlIOVec *evp = va_arg(args, ErlIOVec*);
+ int i;
+ va_end(args);
+ if ((6 + evp->vsize * (2+PROC_BIN_SIZE+ERL_SUB_BIN_SIZE)) > LOCAL_HEAP_SIZE) {
+ hp = erts_alloc(ERTS_ALC_T_TMP,
+ (6 + evp->vsize * (2+PROC_BIN_SIZE+ERL_SUB_BIN_SIZE)) * sizeof(Eterm));
+ orig_hp = hp;
+ }
+ arg = NIL;
+ /* Convert each element in the ErlIOVec to a sub bin that points
+ to a procbin. We don't have to increment the proc bin refc as
+ the port task keeps the reference alive. */
+ for (i = evp->vsize-1; i >= 0; i--) {
+ if (evp->iov[i].iov_len) {
+ ProcBin* pb = (ProcBin*)hp;
+ ErlSubBin *sb;
+ ASSERT(evp->binv[i]);
+ pb->thing_word = HEADER_PROC_BIN;
+ pb->val = ErlDrvBinary2Binary(evp->binv[i]);
+ pb->size = pb->val->orig_size;
+ pb->next = NULL;
+ pb->bytes = (byte*) pb->val->orig_bytes;
+ pb->flags = 0;
+ hp += PROC_BIN_SIZE;
+
+ sb = (ErlSubBin*) hp;
+ sb->thing_word = HEADER_SUB_BIN;
+ sb->size = evp->iov[i].iov_len;
+ sb->offs = (byte*)(evp->iov[i].iov_base) - pb->bytes;
+ sb->orig = make_binary(pb);
+ sb->bitoffs = 0;
+ sb->bitsize = 0;
+ sb->is_writable = 0;
+ hp += ERL_SUB_BIN_SIZE;
+
+ arg = CONS(hp, make_binary(sb), arg);
+ hp += 2;
+ }
+ }
+ what = am_command;
+ } else {
+ arg = va_arg(args, Eterm);
+ va_end(args);
+ }
+ data = TUPLE2(hp, what, arg);
+ hp += 3;
+ }
+
+ data = TUPLE2(hp, caller, data);
+ hp += 3;
+ ASSERT(hp <= (local_heap + LOCAL_HEAP_SIZE) || orig_hp);
+ send_to_tracer_nif(NULL, &t_p->common, t_p->common.id, tnif,
+ TRACE_FUN_T_RECEIVE,
+ am_receive, data, THE_NON_VALUE);
+
+ if (bptr && erts_refc_dectest(&bptr->refc, 1) == 0)
+ erts_bin_free(bptr);
+
+ if (orig_hp)
+ erts_free(ERTS_ALC_T_TMP, orig_hp);
+
+ UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
+ }
+#undef LOCAL_HEAP_SIZE
+}
- ASSERT(is_internal_pid(ERTS_TRACER_PROC(t_p)));
+void
+trace_port_send(Port *t_p, Eterm receiver, Eterm msg, int exists)
+{
+ ErtsTracerNif *tnif = NULL;
+ Eterm op = exists ? am_send : am_send_to_non_existing_process;
+ ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(t_p)
+ || erts_thr_progress_is_blocking());
+ ERTS_SMP_CHK_NO_PROC_LOCKS;
+ if (is_tracer_enabled(NULL, 0, &t_p->common, &tnif, TRACE_FUN_E_SEND, op))
+ send_to_tracer_nif(NULL, &t_p->common, t_p->common.id, tnif, TRACE_FUN_T_SEND,
+ op, msg, receiver);
+}
- sz_data = 5 + PATCH_TS_SIZE(t_p);
+void trace_port_send_binary(Port *t_p, Eterm to, Eterm what, char *bin, Sint sz)
+{
+ ErtsTracerNif *tnif = NULL;
+ ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(t_p)
+ || erts_thr_progress_is_blocking());
+ ERTS_SMP_CHK_NO_PROC_LOCKS;
+ if (is_tracer_enabled(NULL, 0, &t_p->common, &tnif, TRACE_FUN_E_SEND, am_send)) {
+ Eterm msg;
+ Binary* bptr = NULL;
+#define LOCAL_HEAP_SIZE (3 + 3 + heap_bin_size(ERL_ONHEAP_BIN_LIMIT))
+ DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
- ERTS_GET_TRACER_REF(tracer_ref,
- ERTS_TRACER_PROC(t_p),
- ERTS_TRACE_FLAGS(t_p));
+ Eterm *hp;
- hp = ERTS_ALLOC_SYSMSG_HEAP(sz_data, &bp, &off_heap, tracer_ref);
+ ERTS_CT_ASSERT(heap_bin_size(ERL_ONHEAP_BIN_LIMIT) >= PROC_BIN_SIZE);
+ UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
+ hp = local_heap;
- mess = TUPLE4(hp, am_trace, t_p->common.id, what, data);
- hp += 5;
+ msg = trace_port_tmp_binary(bin, sz, &bptr, &hp);
- erts_smp_mtx_lock(&smq_mtx);
+ msg = TUPLE2(hp, what, msg);
+ hp += 3;
+ msg = TUPLE2(hp, t_p->common.id, msg);
+ hp += 3;
- PATCH_TS(TFLGS_TS_TYPE(t_p), mess, hp, bp, tracer_ref);
+ send_to_tracer_nif(NULL, &t_p->common, t_p->common.id, tnif, TRACE_FUN_T_SEND,
+ am_send, msg, to);
+ if (bptr && erts_refc_dectest(&bptr->refc, 1) == 0)
+ erts_bin_free(bptr);
- ERTS_ENQ_TRACE_MSG(t_p->common.id, tracer_ref, mess, bp);
- erts_smp_mtx_unlock(&smq_mtx);
+ UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
+#undef LOCAL_HEAP_SIZE
}
}
@@ -2892,83 +1978,19 @@ trace_port(Port *t_p, Eterm what, Eterm data) {
void
trace_sched_ports(Port *p, Eterm what) {
- trace_sched_ports_where(p,what, make_small(0));
+ trace_sched_ports_where(p, what, make_small(0));
}
-void
-trace_sched_ports_where(Port *p, Eterm what, Eterm where) {
- Eterm mess;
- Eterm* hp;
- int ws = 5;
- Eterm sched_id = am_undefined;
-
- if (is_internal_port(ERTS_TRACER_PROC(p))) {
-#define LOCAL_HEAP_SIZE (6+ERTS_TRACE_PATCH_TS_MAX_SIZE)
- DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
- UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-
- hp = local_heap;
-
- if (IS_TRACED_FL(p, F_TRACE_SCHED_NO)) {
-#ifdef ERTS_SMP
- ErtsSchedulerData *esd = erts_get_scheduler_data();
- if (esd) sched_id = make_small(esd->no);
- else sched_id = am_undefined;
-#else
- sched_id = make_small(1);
-#endif
- mess = TUPLE5(hp, am_trace, p->common.id, what, sched_id, where);
- ws = 6;
- } else {
- mess = TUPLE4(hp, am_trace, p->common.id, what, where);
- ws = 5;
- }
- hp += ws;
-
- erts_smp_mtx_lock(&smq_mtx);
-
- PATCH_TS(TFLGS_TS_TYPE(p), mess, hp, NULL, NULL);
-
- /* No fake scheduling */
- send_to_port(NULL, mess, &ERTS_TRACER_PROC(p), &ERTS_TRACE_FLAGS(p));
- UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
-#undef LOCAL_HEAP_SIZE
- erts_smp_mtx_unlock(&smq_mtx);
- } else {
- ErlHeapFragment *bp;
- ErlOffHeap *off_heap;
- ERTS_TRACER_REF_TYPE tracer_ref;
-
- ASSERT(is_internal_pid(ERTS_TRACER_PROC(p)));
-
- if (IS_TRACED_FL(p, F_TRACE_SCHED_NO)) ws = 6; /* Make place for scheduler id */
-
- ERTS_GET_TRACER_REF(tracer_ref,
- ERTS_TRACER_PROC(p),
- ERTS_TRACE_FLAGS(p));
-
- hp = ERTS_ALLOC_SYSMSG_HEAP(ws+PATCH_TS_SIZE(p), &bp, &off_heap, tracer_ref);
-
- if (IS_TRACED_FL(p, F_TRACE_SCHED_NO)) {
-#ifdef ERTS_SMP
- ErtsSchedulerData *esd = erts_get_scheduler_data();
- if (esd) sched_id = make_small(esd->no);
- else sched_id = am_undefined;
-#else
- sched_id = make_small(1);
-#endif
- mess = TUPLE5(hp, am_trace, p->common.id, what, sched_id, where);
- } else {
- mess = TUPLE4(hp, am_trace, p->common.id, what, where);
- }
- hp += ws;
-
- erts_smp_mtx_lock(&smq_mtx);
-
- PATCH_TS(TFLGS_TS_TYPE(p), mess, hp, bp, tracer_ref);
- ERTS_ENQ_TRACE_MSG(p->common.id, tracer_ref, mess, bp);
- erts_smp_mtx_unlock(&smq_mtx);
- }
+void
+trace_sched_ports_where(Port *t_p, Eterm what, Eterm where) {
+ ErtsTracerNif *tnif = NULL;
+ ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(t_p)
+ || erts_thr_progress_is_blocking());
+ ERTS_SMP_CHK_NO_PROC_LOCKS;
+ if (is_tracer_enabled(NULL, 0, &t_p->common, &tnif, TRACE_FUN_E_SCHED_PORT, what))
+ send_to_tracer_nif(NULL, &t_p->common, t_p->common.id,
+ tnif, TRACE_FUN_T_SCHED_PORT,
+ what, where, THE_NON_VALUE);
}
/* Port profiling */
@@ -3021,6 +2043,7 @@ profile_runnable_proc(Process *p, Eterm status){
Eterm *hp, msg;
Eterm where = am_undefined;
ErlHeapFragment *bp = NULL;
+ int use_current = 1;
#ifndef ERTS_SMP
#define LOCAL_HEAP_SIZE (4 + 6 + ERTS_TRACE_PATCH_TS_MAX_SIZE)
@@ -3033,12 +2056,19 @@ profile_runnable_proc(Process *p, Eterm status){
Uint hsz = 4 + 6 + patch_ts_size(erts_system_profile_ts_type)-1;
#endif
- if (!p->current) {
- p->current = find_function_from_pc(p->i);
+ if (ERTS_PROC_IS_EXITING(p)) {
+ use_current = 0;
+ /* could probably set 'where' to 'exiting' here,
+ * though it's not documented as such */
+ } else {
+ if (!p->current) {
+ p->current = find_function_from_pc(p->i);
+ }
+ use_current = p->current != NULL;
}
#ifdef ERTS_SMP
- if (!p->current) {
+ if (!use_current) {
hsz -= 4;
}
@@ -3046,7 +2076,7 @@ profile_runnable_proc(Process *p, Eterm status){
hp = bp->mem;
#endif
- if (p->current) {
+ if (use_current) {
where = TUPLE3(hp, p->current[0], p->current[1], make_small(p->current[2])); hp += 4;
} else {
where = make_small(0);
@@ -3076,28 +2106,6 @@ profile_runnable_proc(Process *p, Eterm status){
#ifdef ERTS_SMP
-void
-erts_check_my_tracer_proc(Process *p)
-{
- if (is_internal_pid(ERTS_TRACER_PROC(p))) {
- Process *tracer = erts_pid2proc(p,
- ERTS_PROC_LOCK_MAIN,
- ERTS_TRACER_PROC(p),
- ERTS_PROC_LOCK_STATUS);
- int invalid_tracer = (!tracer
- || !(ERTS_TRACE_FLAGS(tracer) & F_TRACER));
- if (tracer)
- erts_smp_proc_unlock(tracer, ERTS_PROC_LOCK_STATUS);
- if (invalid_tracer) {
- erts_smp_proc_lock(p, ERTS_PROC_LOCKS_ALL_MINOR);
- ERTS_TRACE_FLAGS(p) &= ~TRACEE_FLAGS;
- ERTS_TRACER_PROC(p) = NIL;
- erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL_MINOR);
- }
- }
-}
-
-
typedef struct ErtsSysMsgQ_ ErtsSysMsgQ;
struct ErtsSysMsgQ_ {
ErtsSysMsgQ *next;
@@ -3175,12 +2183,6 @@ static void
print_msg_type(ErtsSysMsgQ *smqp)
{
switch (smqp->type) {
- case SYS_MSG_TYPE_TRACE:
- erts_fprintf(stderr, "TRACE ");
- break;
- case SYS_MSG_TYPE_SEQTRACE:
- erts_fprintf(stderr, "SEQTRACE ");
- break;
case SYS_MSG_TYPE_SYSMON:
erts_fprintf(stderr, "SYSMON ");
break;
@@ -3191,8 +2193,8 @@ print_msg_type(ErtsSysMsgQ *smqp)
erts_fprintf(stderr, "ERRLGR ");
break;
case SYS_MSG_TYPE_PROC_MSG:
- erts_fprintf(stderr, "PROC_MSG ");
- break;
+ erts_fprintf(stderr, "PROC_MSG ");
+ break;
default:
erts_fprintf(stderr, "??? ");
break;
@@ -3204,17 +2206,6 @@ static void
sys_msg_disp_failure(ErtsSysMsgQ *smqp, Eterm receiver)
{
switch (smqp->type) {
- case SYS_MSG_TYPE_TRACE:
- /* Invalid tracer_proc's are removed when processes
- are scheduled in. */
- break;
- case SYS_MSG_TYPE_SEQTRACE:
- /* Reset seq_tracer if it hasn't changed */
- erts_smp_rwmtx_rwlock(&sys_trace_rwmtx);
- if (system_seq_tracer == receiver)
- system_seq_tracer = am_false;
- erts_smp_rwmtx_rwunlock(&sys_trace_rwmtx);
- break;
case SYS_MSG_TYPE_SYSMON:
if (receiver == NIL
&& !erts_system_monitor_long_gc
@@ -3275,7 +2266,7 @@ sys_msg_disp_failure(ErtsSysMsgQ *smqp, Eterm receiver)
break;
}
case SYS_MSG_TYPE_PROC_MSG:
- break;
+ break;
default:
ASSERT(0);
}
@@ -3393,13 +2384,9 @@ sys_msg_dispatcher_func(void *unused)
print_msg_type(smqp);
#endif
switch (smqp->type) {
- case SYS_MSG_TYPE_TRACE:
- case SYS_MSG_TYPE_PROC_MSG:
- receiver = smqp->to;
- break;
- case SYS_MSG_TYPE_SEQTRACE:
- receiver = erts_get_system_seq_tracer();
- break;
+ case SYS_MSG_TYPE_PROC_MSG:
+ receiver = smqp->to;
+ break;
case SYS_MSG_TYPE_SYSMON:
receiver = erts_get_system_monitor();
if (smqp->from == receiver) {
@@ -3434,16 +2421,8 @@ sys_msg_dispatcher_func(void *unused)
if (is_internal_pid(receiver)) {
proc = erts_pid2proc(NULL, 0, receiver, proc_locks);
- if (!proc
- || (smqp->type == SYS_MSG_TYPE_TRACE
- && !(ERTS_TRACE_FLAGS(proc) & F_TRACER))) {
+ if (!proc) {
/* Bad tracer */
-#ifdef DEBUG_PRINTOUTS
- if (smqp->type == SYS_MSG_TYPE_TRACE && proc)
- erts_fprintf(stderr,
- "<tracer alive but missing "
- "F_TRACER flag> ");
-#endif
goto failure;
}
else {
@@ -3451,7 +2430,7 @@ sys_msg_dispatcher_func(void *unused)
queue_proc_msg:
mp = erts_alloc_message(0, NULL);
mp->data.heap_frag = smqp->bp;
- erts_queue_message(proc,&proc_locks,mp,smqp->msg,NIL);
+ erts_queue_message(proc,&proc_locks,mp,smqp->msg);
#ifdef DEBUG_PRINTOUTS
erts_fprintf(stderr, "delivered\n");
#endif
@@ -3517,12 +2496,6 @@ erts_foreach_sys_msg_in_q(void (*func)(Eterm,
for (sm = sys_message_queue; sm; sm = sm->next) {
Eterm to;
switch (sm->type) {
- case SYS_MSG_TYPE_TRACE:
- to = sm->to;
- break;
- case SYS_MSG_TYPE_SEQTRACE:
- to = erts_get_system_seq_tracer();
- break;
case SYS_MSG_TYPE_SYSMON:
to = erts_get_system_monitor();
break;
@@ -3560,3 +2533,589 @@ init_sys_msg_dispatcher(void)
}
#endif
+
+#include "erl_nif.h"
+
+typedef struct {
+ char *name;
+ Uint arity;
+ ErlNifFunc *cb;
+} ErtsTracerType;
+
+struct ErtsTracerNif_ {
+ HashBucket hb;
+ Eterm module;
+ struct erl_module_nif* nif_mod;
+ ErtsTracerType tracers[NIF_TRACER_TYPES];
+};
+
+static void init_tracer_template(ErtsTracerNif *tnif) {
+
+ /* default tracer functions */
+ tnif->tracers[TRACE_FUN_DEFAULT].name = "trace";
+ tnif->tracers[TRACE_FUN_DEFAULT].arity = 6;
+ tnif->tracers[TRACE_FUN_DEFAULT].cb = NULL;
+
+ tnif->tracers[TRACE_FUN_ENABLED].name = "enabled";
+ tnif->tracers[TRACE_FUN_ENABLED].arity = 3;
+ tnif->tracers[TRACE_FUN_ENABLED].cb = NULL;
+
+ /* specific tracer functions */
+ tnif->tracers[TRACE_FUN_T_SEND].name = "trace_send";
+ tnif->tracers[TRACE_FUN_T_SEND].arity = 6;
+ tnif->tracers[TRACE_FUN_T_SEND].cb = NULL;
+
+ tnif->tracers[TRACE_FUN_T_RECEIVE].name = "trace_receive";
+ tnif->tracers[TRACE_FUN_T_RECEIVE].arity = 6;
+ tnif->tracers[TRACE_FUN_T_RECEIVE].cb = NULL;
+
+ tnif->tracers[TRACE_FUN_T_CALL].name = "trace_call";
+ tnif->tracers[TRACE_FUN_T_CALL].arity = 6;
+ tnif->tracers[TRACE_FUN_T_CALL].cb = NULL;
+
+ tnif->tracers[TRACE_FUN_T_SCHED_PROC].name = "trace_running_procs";
+ tnif->tracers[TRACE_FUN_T_SCHED_PROC].arity = 6;
+ tnif->tracers[TRACE_FUN_T_SCHED_PROC].cb = NULL;
+
+ tnif->tracers[TRACE_FUN_T_SCHED_PORT].name = "trace_running_ports";
+ tnif->tracers[TRACE_FUN_T_SCHED_PORT].arity = 6;
+ tnif->tracers[TRACE_FUN_T_SCHED_PORT].cb = NULL;
+
+ tnif->tracers[TRACE_FUN_T_GC].name = "trace_garbage_collection";
+ tnif->tracers[TRACE_FUN_T_GC].arity = 6;
+ tnif->tracers[TRACE_FUN_T_GC].cb = NULL;
+
+ tnif->tracers[TRACE_FUN_T_PROCS].name = "trace_procs";
+ tnif->tracers[TRACE_FUN_T_PROCS].arity = 6;
+ tnif->tracers[TRACE_FUN_T_PROCS].cb = NULL;
+
+ tnif->tracers[TRACE_FUN_T_PORTS].name = "trace_ports";
+ tnif->tracers[TRACE_FUN_T_PORTS].arity = 6;
+ tnif->tracers[TRACE_FUN_T_PORTS].cb = NULL;
+
+ /* specific enabled functions */
+ tnif->tracers[TRACE_FUN_E_SEND].name = "enabled_send";
+ tnif->tracers[TRACE_FUN_E_SEND].arity = 3;
+ tnif->tracers[TRACE_FUN_E_SEND].cb = NULL;
+
+ tnif->tracers[TRACE_FUN_E_RECEIVE].name = "enabled_receive";
+ tnif->tracers[TRACE_FUN_E_RECEIVE].arity = 3;
+ tnif->tracers[TRACE_FUN_E_RECEIVE].cb = NULL;
+
+ tnif->tracers[TRACE_FUN_E_CALL].name = "enabled_call";
+ tnif->tracers[TRACE_FUN_E_CALL].arity = 3;
+ tnif->tracers[TRACE_FUN_E_CALL].cb = NULL;
+
+ tnif->tracers[TRACE_FUN_E_SCHED_PROC].name = "enabled_running_procs";
+ tnif->tracers[TRACE_FUN_E_SCHED_PROC].arity = 3;
+ tnif->tracers[TRACE_FUN_E_SCHED_PROC].cb = NULL;
+
+ tnif->tracers[TRACE_FUN_E_SCHED_PORT].name = "enabled_running_ports";
+ tnif->tracers[TRACE_FUN_E_SCHED_PORT].arity = 3;
+ tnif->tracers[TRACE_FUN_E_SCHED_PORT].cb = NULL;
+
+ tnif->tracers[TRACE_FUN_E_GC].name = "enabled_garbage_collection";
+ tnif->tracers[TRACE_FUN_E_GC].arity = 3;
+ tnif->tracers[TRACE_FUN_E_GC].cb = NULL;
+
+ tnif->tracers[TRACE_FUN_E_PROCS].name = "enabled_procs";
+ tnif->tracers[TRACE_FUN_E_PROCS].arity = 3;
+ tnif->tracers[TRACE_FUN_E_PROCS].cb = NULL;
+
+ tnif->tracers[TRACE_FUN_E_PORTS].name = "enabled_ports";
+ tnif->tracers[TRACE_FUN_E_PORTS].arity = 3;
+ tnif->tracers[TRACE_FUN_E_PORTS].cb = NULL;
+}
+
+static Hash *tracer_hash = NULL;
+static erts_smp_rwmtx_t tracer_mtx;
+
+static ErtsTracerNif *
+load_tracer_nif(const ErtsTracer tracer)
+{
+ Module* mod = erts_get_module(ERTS_TRACER_MODULE(tracer),
+ erts_active_code_ix());
+ struct erl_module_instance *instance;
+ ErlNifFunc *funcs;
+ int num_of_funcs;
+ ErtsTracerNif tnif_tmpl, *tnif;
+ ErtsTracerType *tracers;
+ int i,j;
+
+ if (!mod || !mod->curr.nif) {
+ return NULL;
+ }
+
+ instance = &mod->curr;
+
+ init_tracer_template(&tnif_tmpl);
+ tnif_tmpl.nif_mod = instance->nif;
+ tnif_tmpl.module = ERTS_TRACER_MODULE(tracer);
+ tracers = tnif_tmpl.tracers;
+
+ num_of_funcs = erts_nif_get_funcs(instance->nif, &funcs);
+
+ for(i = 0; i < num_of_funcs; i++) {
+ for (j = 0; j < NIF_TRACER_TYPES; j++) {
+ if (strcmp(tracers[j].name, funcs[i].name) == 0 && tracers[j].arity == funcs[i].arity) {
+ tracers[j].cb = &(funcs[i]);
+ break;
+ }
+ }
+ }
+
+ if (tracers[TRACE_FUN_DEFAULT].cb == NULL || tracers[TRACE_FUN_ENABLED].cb == NULL ) {
+ return NULL;
+ }
+
+ erts_smp_rwmtx_rwlock(&tracer_mtx);
+ tnif = hash_put(tracer_hash, &tnif_tmpl);
+ erts_smp_rwmtx_rwunlock(&tracer_mtx);
+
+ return tnif;
+}
+
+static ERTS_INLINE ErtsTracerNif *
+lookup_tracer_nif(const ErtsTracer tracer)
+{
+ ErtsTracerNif tnif_tmpl;
+ ErtsTracerNif *tnif;
+ tnif_tmpl.module = ERTS_TRACER_MODULE(tracer);
+ erts_smp_rwmtx_rlock(&tracer_mtx);
+ if ((tnif = hash_get(tracer_hash, &tnif_tmpl)) == NULL) {
+ erts_smp_rwmtx_runlock(&tracer_mtx);
+ tnif = load_tracer_nif(tracer);
+ ASSERT(!tnif || tnif->nif_mod);
+ return tnif;
+ }
+ erts_smp_rwmtx_runlock(&tracer_mtx);
+ ASSERT(tnif->nif_mod);
+ return tnif;
+}
+
+/* This function converts an Erlang tracer term to ErtsTracer.
+ It returns THE_NON_VALUE if an invalid tracer term was given.
+ Accepted input is:
+ pid() || port() || {prefix, pid()} || {prefix, port()} ||
+ {prefix, atom(), term()} || {atom(), term()}
+ */
+ErtsTracer
+erts_term_to_tracer(Eterm prefix, Eterm t)
+{
+ ErtsTracer tracer = erts_tracer_nil;
+ ASSERT(is_atom(prefix) || prefix == THE_NON_VALUE);
+ if (!is_nil(t)) {
+ Eterm module = am_erl_tracer, state = THE_NON_VALUE;
+ Eterm hp[2];
+ if (is_tuple(t)) {
+ Eterm *tp = tuple_val(t);
+ if (prefix != THE_NON_VALUE) {
+ if (arityval(tp[0]) == 2 && tp[1] == prefix)
+ t = tp[2];
+ else if (arityval(tp[0]) == 3 && tp[1] == prefix && is_atom(tp[2])) {
+ module = tp[2];
+ state = tp[3];
+ }
+ } else {
+ if (arityval(tp[0]) == 2 && is_atom(tp[2])) {
+ module = tp[1];
+ state = tp[2];
+ }
+ }
+ }
+ if (state == THE_NON_VALUE && (is_internal_pid(t) || is_internal_port(t)))
+ state = t;
+ if (state == THE_NON_VALUE)
+ return THE_NON_VALUE;
+ erts_tracer_update(&tracer, CONS(hp, module, state));
+ }
+ if (!lookup_tracer_nif(tracer)) {
+ ASSERT(ERTS_TRACER_MODULE(tracer) != am_erl_tracer);
+ ERTS_TRACER_CLEAR(&tracer);
+ return THE_NON_VALUE;
+ }
+ return tracer;
+}
+
+Eterm
+erts_tracer_to_term(Process *p, ErtsTracer tracer)
+{
+ if (ERTS_TRACER_IS_NIL(tracer))
+ return am_false;
+ if (ERTS_TRACER_MODULE(tracer) == am_erl_tracer)
+ /* Have to manage these specifically in order to be
+ backwards compatible */
+ return ERTS_TRACER_STATE(tracer);
+ else {
+ Eterm *hp = HAlloc(p, 3);
+ return TUPLE2(hp, ERTS_TRACER_MODULE(tracer),
+ copy_object(ERTS_TRACER_STATE(tracer), p));
+ }
+}
+
+
+static ERTS_INLINE int
+send_to_tracer_nif_raw(Process *c_p, Process *tracee,
+ const ErtsTracer tracer, Uint tracee_flags,
+ Eterm t_p_id, ErtsTracerNif *tnif,
+ enum ErtsTracerOpt topt,
+ Eterm tag, Eterm msg, Eterm extra, Eterm pam_result)
+{
+ if (tnif || (tnif = lookup_tracer_nif(tracer)) != NULL) {
+#define MAP_SIZE 3
+ Eterm argv[6], local_heap[3+MAP_SIZE /* values */ + (MAP_SIZE+1 /* keys */)];
+ flatmap_t *map = (flatmap_t*)(local_heap+(MAP_SIZE+1));
+ Eterm *map_values = flatmap_get_values(map);
+
+ topt = (tnif->tracers[topt].cb) ? topt : TRACE_FUN_DEFAULT;
+ ASSERT(topt < NIF_TRACER_TYPES);
+
+ argv[0] = tag;
+ argv[1] = ERTS_TRACER_STATE(tracer);
+ argv[2] = t_p_id;
+ argv[3] = msg;
+ argv[4] = extra == THE_NON_VALUE ? am_undefined : extra;
+ argv[5] = make_flatmap(map);
+
+ map->thing_word = MAP_HEADER_FLATMAP;
+ map->size = MAP_SIZE;
+ map->keys = TUPLE3(local_heap, am_match_spec_result, am_scheduler_id, am_timestamp);
+
+ *map_values++ = pam_result;
+ if (tracee_flags & F_TRACE_SCHED_NO)
+ *map_values++ = make_small(erts_get_scheduler_id());
+ else
+ *map_values++ = am_undefined;
+ if (tracee_flags & F_NOW_TS)
+#ifdef HAVE_ERTS_NOW_CPU
+ if (erts_cpu_timestamp)
+ *map_values++ = am_cpu_timestamp;
+ else
+#endif
+ *map_values++ = am_timestamp;
+ else if (tracee_flags & F_STRICT_MON_TS)
+ *map_values++ = am_strict_monotonic;
+ else if (tracee_flags & F_MON_TS)
+ *map_values++ = am_monotonic;
+ else
+ *map_values++ = am_undefined;
+
+#undef MAP_SIZE
+ erts_nif_call_function(c_p, tracee ? tracee : c_p,
+ tnif->nif_mod,
+ tnif->tracers[topt].cb,
+ tnif->tracers[topt].arity,
+ argv);
+ }
+ return 1;
+}
+
+static ERTS_INLINE int
+send_to_tracer_nif(Process *c_p, ErtsPTabElementCommon *t_p,
+ Eterm t_p_id, ErtsTracerNif *tnif, enum ErtsTracerOpt topt,
+ Eterm tag, Eterm msg, Eterm extra)
+{
+#if defined(ERTS_SMP) && defined(ERTS_ENABLE_LOCK_CHECK)
+ if (c_p) {
+ /* We have to hold the main lock of the currently executing process */
+ erts_proc_lc_chk_have_proc_locks(c_p, ERTS_PROC_LOCK_MAIN);
+ }
+ if (is_internal_pid(t_p->id)) {
+ /* We have to have at least one lock */
+ ERTS_SMP_LC_ASSERT(erts_proc_lc_my_proc_locks((Process*)t_p) & ERTS_PROC_LOCKS_ALL);
+ } else {
+ ASSERT(is_internal_port(t_p->id));
+ ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked((Port*)t_p));
+ }
+#endif
+
+ return send_to_tracer_nif_raw(c_p,
+ is_internal_pid(t_p->id) ? (Process*)t_p : NULL,
+ t_p->tracer, t_p->trace_flags,
+ t_p_id, tnif, topt, tag, msg, extra,
+ am_true);
+}
+
+static ERTS_INLINE Eterm
+call_enabled_tracer(Process *c_p, const ErtsTracer tracer,
+ ErtsTracerNif **tnif_ret,
+ enum ErtsTracerOpt topt,
+ Eterm tag, Eterm t_p_id) {
+ ErtsTracerNif *tnif = lookup_tracer_nif(tracer);
+ if (tnif) {
+ Eterm argv[] = {tag, ERTS_TRACER_STATE(tracer), t_p_id};
+ topt = (tnif->tracers[topt].cb) ? topt : TRACE_FUN_ENABLED;
+ ASSERT(topt < NIF_TRACER_TYPES);
+ ASSERT(tnif->tracers[topt].cb != NULL);
+ if (tnif_ret) *tnif_ret = tnif;
+ return erts_nif_call_function(c_p, NULL, tnif->nif_mod,
+ tnif->tracers[topt].cb,
+ tnif->tracers[topt].arity,
+ argv);
+ }
+ return am_remove;
+}
+
+static int
+is_tracer_enabled(Process* c_p, ErtsProcLocks c_p_locks,
+ ErtsPTabElementCommon *t_p,
+ ErtsTracerNif **tnif_ret,
+ enum ErtsTracerOpt topt, Eterm tag) {
+ Eterm nif_result;
+
+#if defined(ERTS_SMP) && defined(ERTS_ENABLE_LOCK_CHECK)
+ if (c_p)
+ ERTS_SMP_LC_ASSERT(erts_proc_lc_my_proc_locks(c_p) == c_p_locks
+ || erts_thr_progress_is_blocking());
+ if (is_internal_pid(t_p->id)) {
+ /* We have to have at least one lock */
+ ERTS_SMP_LC_ASSERT(erts_proc_lc_my_proc_locks((Process*)t_p) & ERTS_PROC_LOCKS_ALL
+ || erts_thr_progress_is_blocking());
+ } else {
+ ASSERT(is_internal_port(t_p->id));
+ ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked((Port*)t_p)
+ || erts_thr_progress_is_blocking());
+ }
+#endif
+
+ nif_result = call_enabled_tracer(c_p, t_p->tracer, tnif_ret, topt, tag, t_p->id);
+ switch (nif_result) {
+ case am_discard: return 0;
+ case am_trace: return 1;
+ case THE_NON_VALUE:
+ case am_remove: break;
+ default:
+ /* only am_remove should be returned, but if
+ something else is returned we fall-through
+ and remove the tracer. */
+ ASSERT(0);
+ }
+
+ /* Only remove tracer on self() and ports */
+ if (is_internal_port(t_p->id) || (c_p && c_p->common.id == t_p->id)) {
+ ErtsProcLocks c_p_xlocks = 0;
+ if (is_internal_pid(t_p->id)) {
+ ERTS_SMP_LC_ASSERT(erts_proc_lc_my_proc_locks(c_p) & ERTS_PROC_LOCK_MAIN);
+ if (c_p_locks != ERTS_PROC_LOCKS_ALL) {
+ c_p_xlocks = ~c_p_locks & ERTS_PROC_LOCKS_ALL;
+ if (erts_smp_proc_trylock(c_p, c_p_xlocks) == EBUSY) {
+ erts_smp_proc_unlock(c_p, c_p_locks & ~ERTS_PROC_LOCK_MAIN);
+ erts_smp_proc_lock(c_p, ERTS_PROC_LOCKS_ALL_MINOR);
+ }
+ }
+ }
+ erts_tracer_replace(t_p, erts_tracer_nil);
+ t_p->trace_flags &= ~TRACEE_FLAGS;
+
+ if (c_p_xlocks)
+ erts_smp_proc_unlock(c_p, c_p_xlocks);
+ }
+
+ return 0;
+}
+
+int erts_is_tracer_proc_enabled(Process* c_p, ErtsProcLocks c_p_locks,
+ ErtsPTabElementCommon *t_p, Eterm type)
+{
+ return is_tracer_enabled(c_p, c_p_locks, t_p, NULL, TRACE_FUN_ENABLED, am_trace_status);
+}
+
+int erts_is_tracer_enabled(Process *c_p, const ErtsTracer tracer)
+{
+ ErtsTracerNif *tnif = lookup_tracer_nif(tracer);
+ if (tnif) {
+ Eterm nif_result = call_enabled_tracer(c_p, tracer, &tnif,
+ TRACE_FUN_ENABLED, am_trace_status,
+ c_p->common.id);
+ switch (nif_result) {
+ case am_discard:
+ case am_trace: return 1;
+ default:
+ break;
+ }
+ }
+ return 0;
+}
+
+void erts_tracer_replace(ErtsPTabElementCommon *t_p, const ErtsTracer tracer)
+{
+#if defined(ERTS_SMP) && defined(ERTS_ENABLE_LOCK_CHECK)
+ if (is_internal_pid(t_p->id) && !erts_thr_progress_is_blocking()) {
+ erts_proc_lc_chk_have_proc_locks((Process*)t_p, ERTS_PROC_LOCKS_ALL);
+ } else if (is_internal_port(t_p->id)) {
+ ERTS_LC_ASSERT(erts_lc_is_port_locked((Port*)t_p)
+ || erts_thr_progress_is_blocking());
+ }
+#endif
+ if (ERTS_TRACER_COMPARE(t_p->tracer, tracer))
+ return;
+
+ erts_tracer_update(&t_p->tracer, tracer);
+}
+
+static void free_tracer(void *p)
+{
+ ErtsTracer tracer = (ErtsTracer)p;
+
+ if (is_immed(ERTS_TRACER_STATE(tracer))) {
+ erts_free(ERTS_ALC_T_HEAP_FRAG, ptr_val(tracer));
+ } else {
+ ErlHeapFragment *hf = (void*)((char*)(ptr_val(tracer)) - offsetof(ErlHeapFragment, mem));
+ free_message_buffer(hf);
+ }
+}
+
+/* un-define erts_tracer_update before implementation */
+#ifdef erts_tracer_update
+#undef erts_tracer_update
+#endif
+
+/*
+ * ErtsTracer is either NIL, 'true' or [Mod | State]
+ *
+ * - If State is immediate then the memory for
+ * the cons cell is just two words + sizeof(ErtsThrPrgrLaterOp) large.
+ * - If State is a complex term then the cons cell
+ * is allocated in an ErlHeapFragment where the cons
+ * ptr points to the mem field. So in order to get the
+ * ptr to the fragment you do this:
+ * (char*)(ptr_val(tracer)) - offsetof(ErlHeapFragment, mem)
+ * Normally you shouldn't have to care about this though
+ * as erts_tracer_update takes care of it for you.
+ *
+ * When ErtsTracer is stored in the stack as part of a
+ * return trace, the cons cell is stored on the heap of
+ * the process.
+ *
+ * The cons cell is not always stored on the heap as:
+ * 1) for port/meta tracing there is no heap
+ * 2) we would need the main lock in order to
+ * read the tracer which is undesirable.
+ *
+ * One way to optimize this (memory wise) is to keep an refc and only bump
+ * the refc when *tracer is NIL.
+ */
+void
+erts_tracer_update(ErtsTracer *tracer, const ErtsTracer new_tracer)
+{
+ ErlHeapFragment *hf;
+
+ if (is_not_nil(*tracer)) {
+ Uint offs = 2;
+ UWord size = 2 * sizeof(Eterm) + sizeof(ErtsThrPrgrLaterOp);
+ ASSERT(is_list(*tracer));
+ if (is_not_immed(ERTS_TRACER_STATE(*tracer))) {
+ hf = (void*)(((char*)(ptr_val(*tracer)) - offsetof(ErlHeapFragment, mem)));
+ offs = hf->used_size;
+ size = hf->alloc_size * sizeof(Eterm) + sizeof(ErlHeapFragment);
+ ASSERT(offs == size_object(*tracer));
+ }
+ /* We schedule the free:ing of the tracer until after a thread progress
+ has been made so that we know that no schedulers have any references
+ to it. Because we do this, it is possible to release all locks of a
+ process/port and still use the ErtsTracer of that port/process
+ without having to worry if it is free'd.
+ */
+ erts_schedule_thr_prgr_later_cleanup_op(
+ free_tracer, (void*)(*tracer),
+ (ErtsThrPrgrLaterOp*)(ptr_val(*tracer) + offs),
+ size);
+ }
+
+ if (is_nil(new_tracer)) {
+ *tracer = new_tracer;
+ } else if (is_immed(ERTS_TRACER_STATE(new_tracer))) {
+ /* If tracer state is an immediate we only allocate a 2 Eterm heap.
+ Not sure if it is worth it, we save 4 words (sizeof(ErlHeapFragment))
+ per tracer. */
+ Eterm *hp = erts_alloc(ERTS_ALC_T_HEAP_FRAG,
+ 2*sizeof(Eterm) + sizeof(ErtsThrPrgrLaterOp));
+ *tracer = CONS(hp, ERTS_TRACER_MODULE(new_tracer),
+ ERTS_TRACER_STATE(new_tracer));
+ } else {
+ Eterm *hp, tracer_state = ERTS_TRACER_STATE(new_tracer),
+ tracer_module = ERTS_TRACER_MODULE(new_tracer);
+ Uint sz = size_object(tracer_state);
+ hf = new_message_buffer(sz + 2 /* cons cell */ + (sizeof(ErtsThrPrgrLaterOp)+sizeof(Eterm)-1)/sizeof(Eterm));
+ hp = hf->mem + 2;
+ hf->used_size -= (sizeof(ErtsThrPrgrLaterOp)+sizeof(Eterm)-1)/sizeof(Eterm);
+ *tracer = copy_struct(tracer_state, sz, &hp, &hf->off_heap);
+ *tracer = CONS(hf->mem, tracer_module, *tracer);
+ ASSERT((void*)(((char*)(ptr_val(*tracer)) - offsetof(ErlHeapFragment, mem))) == hf);
+ }
+}
+
+static void init_tracer_nif()
+{
+ erts_smp_rwmtx_opt_t rwmtx_opt = ERTS_SMP_RWMTX_OPT_DEFAULT_INITER;
+ rwmtx_opt.type = ERTS_SMP_RWMTX_TYPE_EXTREMELY_FREQUENT_READ;
+ rwmtx_opt.lived = ERTS_SMP_RWMTX_LONG_LIVED;
+ erts_smp_rwmtx_init_opt(&tracer_mtx, &rwmtx_opt, "tracer_mtx");
+
+ erts_tracer_nif_clear();
+
+}
+
+int erts_tracer_nif_clear()
+{
+
+ erts_smp_rwmtx_rlock(&tracer_mtx);
+ if (!tracer_hash || tracer_hash->nobjs) {
+
+ HashFunctions hf;
+ hf.hash = tracer_hash_fun;
+ hf.cmp = tracer_cmp_fun;
+ hf.alloc = tracer_alloc_fun;
+ hf.free = tracer_free_fun;
+ hf.meta_alloc = (HMALLOC_FUN) erts_alloc;
+ hf.meta_free = (HMFREE_FUN) erts_free;
+ hf.meta_print = (HMPRINT_FUN) erts_print;
+
+ erts_smp_rwmtx_runlock(&tracer_mtx);
+ erts_smp_rwmtx_rwlock(&tracer_mtx);
+
+ if (tracer_hash)
+ hash_delete(tracer_hash);
+
+ tracer_hash = hash_new(ERTS_ALC_T_TRACER_NIF, "tracer_hash", 10, hf);
+
+ erts_smp_rwmtx_rwunlock(&tracer_mtx);
+ return 1;
+ }
+
+ erts_smp_rwmtx_runlock(&tracer_mtx);
+ return 0;
+}
+
+static int tracer_cmp_fun(void* a, void* b)
+{
+ return ((ErtsTracerNif*)a)->module != ((ErtsTracerNif*)b)->module;
+}
+
+static HashValue tracer_hash_fun(void* obj)
+{
+ return make_internal_hash(((ErtsTracerNif*)obj)->module);
+}
+
+static void *tracer_alloc_fun(void* tmpl)
+{
+ ErtsTracerNif *obj = erts_alloc(ERTS_ALC_T_TRACER_NIF,
+ sizeof(ErtsTracerNif) +
+ sizeof(ErtsThrPrgrLaterOp));
+ memcpy(obj, tmpl, sizeof(*obj));
+ return obj;
+}
+
+static void tracer_free_fun_cb(void* obj)
+{
+ erts_free(ERTS_ALC_T_TRACER_NIF, obj);
+}
+
+static void tracer_free_fun(void* obj)
+{
+ ErtsTracerNif *tnif = obj;
+ erts_schedule_thr_prgr_later_op(
+ tracer_free_fun_cb, obj,
+ (ErtsThrPrgrLaterOp*)(tnif + 1));
+
+}
diff --git a/erts/emulator/beam/erl_trace.h b/erts/emulator/beam/erl_trace.h
index a0058264d7..9a007e62ec 100644
--- a/erts/emulator/beam/erl_trace.h
+++ b/erts/emulator/beam/erl_trace.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2012-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2012-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -46,6 +46,8 @@
#define ERTS_SEQTFLGS2TSTYPE(SEQTFLGS) \
((int) (((SEQTFLGS) >> ERTS_SEQ_TRACE_FLAGS_TS_TYPE_SHIFT) \
& ERTS_TRACE_TS_TYPE_MASK))
+#define ERTS_SEQTFLGS2TFLGS(SEQTFLGS) \
+ (ERTS_SEQTFLGS2TSTYPE(SEQTFLGS) << ERTS_TRACE_FLAGS_TS_TYPE_SHIFT)
#endif /* ERL_TRACE_H__FLAGS__ */
@@ -62,15 +64,19 @@ void erts_system_profile_clear(Process *c_p);
/* erl_trace.c */
void erts_init_trace(void);
void erts_trace_check_exiting(Eterm exiting);
-Eterm erts_set_system_seq_tracer(Process *c_p,
- ErtsProcLocks c_p_locks,
- Eterm new);
-Eterm erts_get_system_seq_tracer(void);
-void erts_change_default_tracing(int setflags, Uint *flagsp, Eterm *tracerp);
-void erts_get_default_tracing(Uint *flagsp, Eterm *tracerp);
+ErtsTracer erts_set_system_seq_tracer(Process *c_p,
+ ErtsProcLocks c_p_locks,
+ ErtsTracer new);
+ErtsTracer erts_get_system_seq_tracer(void);
+void erts_change_default_proc_tracing(int setflags, Uint flagsp,
+ const ErtsTracer tracerp);
+void erts_get_default_proc_tracing(Uint *flagsp, ErtsTracer *tracerp);
+void erts_change_default_port_tracing(int setflags, Uint flagsp,
+ const ErtsTracer tracerp);
+void erts_get_default_port_tracing(Uint *flagsp, ErtsTracer *tracerp);
void erts_set_system_monitor(Eterm monitor);
Eterm erts_get_system_monitor(void);
-int erts_is_tracer_proc_valid(Process* p);
+int erts_is_tracer_valid(Process* p);
#ifdef ERTS_SMP
void erts_check_my_tracer_proc(Process *);
@@ -81,28 +87,32 @@ void erts_foreach_sys_msg_in_q(void (*func)(Eterm,
Eterm,
ErlHeapFragment *));
void erts_queue_error_logger_message(Eterm, Eterm, ErlHeapFragment *);
+void erts_send_sys_msg_proc(Eterm, Eterm, Eterm, ErlHeapFragment *);
#endif
-void erts_send_sys_msg_proc(Eterm, Eterm, Eterm, ErlHeapFragment *);
void trace_send(Process*, Eterm, Eterm);
-void trace_receive(Process*, Eterm);
-Uint32 erts_call_trace(Process *p, BeamInstr mfa[], struct binary *match_spec, Eterm* args,
- int local, Eterm *tracer_pid);
-void erts_trace_return(Process* p, BeamInstr* fi, Eterm retval, Eterm *tracer_pid);
+void trace_receive(Process *, Eterm);
+Uint32 erts_call_trace(Process *p, BeamInstr mfa[], struct binary *match_spec,
+ Eterm* args, int local, ErtsTracer *tracer);
+void erts_trace_return(Process* p, BeamInstr* fi, Eterm retval,
+ ErtsTracer *tracer);
void erts_trace_exception(Process* p, BeamInstr mfa[], Eterm class, Eterm value,
- Eterm *tracer);
+ ErtsTracer *tracer);
void erts_trace_return_to(Process *p, BeamInstr *pc);
-void trace_sched(Process*, Eterm);
-void trace_proc(Process*, Process*, Eterm, Eterm);
-void trace_proc_spawn(Process*, Eterm pid, Eterm mod, Eterm func, Eterm args);
+void trace_sched(Process*, ErtsProcLocks, Eterm);
+void trace_proc(Process*, ErtsProcLocks, Process*, Eterm, Eterm);
+void trace_proc_spawn(Process*, Eterm what, Eterm pid, Eterm mod, Eterm func, Eterm args);
void save_calls(Process *p, Export *);
-void trace_gc(Process *p, Eterm what);
+void trace_gc(Process *p, Eterm what, Uint size);
/* port tracing */
-void trace_virtual_sched(Process*, Eterm);
+void trace_virtual_sched(Process*, ErtsProcLocks, Eterm);
void trace_sched_ports(Port *pp, Eterm);
void trace_sched_ports_where(Port *pp, Eterm, Eterm);
void trace_port(Port *, Eterm what, Eterm data);
void trace_port_open(Port *, Eterm calling_pid, Eterm drv_name);
+void trace_port_receive(Port *, Eterm calling_pid, Eterm tag, ...);
+void trace_port_send(Port *, Eterm to, Eterm msg, int exists);
+void trace_port_send_binary(Port *, Eterm to, Eterm what, char *bin, Sint sz);
/* system_profile */
void erts_set_system_profile(Eterm profile);
@@ -121,7 +131,7 @@ void monitor_large_heap(Process *p);
void monitor_generic(Process *p, Eterm type, Eterm spec);
Uint erts_trace_flag2bit(Eterm flag);
int erts_trace_flags(Eterm List,
- Uint *pMask, Eterm *pTracer, int *pCpuTimestamp);
+ Uint *pMask, ErtsTracer *pTracer, int *pCpuTimestamp);
Eterm erts_bif_trace(int bif_index, Process* p, Eterm* args, BeamInstr *I);
#ifdef ERTS_SMP
@@ -161,15 +171,53 @@ int erts_set_trace_pattern(Process*p, Eterm* mfa, int specified,
struct binary* match_prog_set,
struct binary *meta_match_prog_set,
int on, struct trace_pattern_flags,
- Eterm meta_tracer_pid, int is_blocking);
+ ErtsTracer meta_tracer, int is_blocking);
void
erts_get_default_trace_pattern(int *trace_pattern_is_on,
struct binary **match_spec,
struct binary **meta_match_spec,
struct trace_pattern_flags *trace_pattern_flags,
- Eterm *meta_tracer_pid);
+ ErtsTracer *meta_tracer);
int erts_is_default_trace_enabled(void);
void erts_bif_trace_init(void);
int erts_finish_breakpointing(void);
+/* Nif tracer functions */
+int erts_is_tracer_proc_enabled(Process *c_p, ErtsProcLocks c_p_locks,
+ ErtsPTabElementCommon *t_p, Eterm type);
+int erts_is_tracer_enabled(Process *c_p, const ErtsTracer tracer);
+Eterm erts_tracer_to_term(Process *p, ErtsTracer tracer);
+ErtsTracer erts_term_to_tracer(Eterm prefix, Eterm term);
+void erts_tracer_replace(ErtsPTabElementCommon *t_p,
+ const ErtsTracer new_tracer);
+void erts_tracer_update(ErtsTracer *tracer, const ErtsTracer new_tracer);
+int erts_tracer_nif_clear(void);
+
+#define erts_tracer_update(t,n) do { if (*(t) != (n)) erts_tracer_update(t,n); } while(0)
+#define ERTS_TRACER_CLEAR(t) erts_tracer_update(t, erts_tracer_nil)
+
+static const ErtsTracer
+ERTS_DECLARE_DUMMY(erts_tracer_true) = am_true;
+
+static const ErtsTracer
+ERTS_DECLARE_DUMMY(erts_tracer_nil) = NIL;
+
+#define ERTS_TRACER_COMPARE(t1, t2) \
+ (EQ((t1), (t2)))
+
+#define ERTS_TRACER_IS_NIL(t1) ERTS_TRACER_COMPARE(t1, erts_tracer_nil)
+
+#define IS_TRACER_VALID(tracer) \
+ (ERTS_TRACER_COMPARE(tracer,erts_tracer_true) \
+ || ERTS_TRACER_IS_NIL(tracer) \
+ || (is_list(tracer) && is_atom(CAR(list_val(tracer)))))
+
+#define ERTS_TRACER_FROM_ETERM(termp) \
+ ((ErtsTracer*)(termp))
+
+#define ERTS_TRACER_PROC_IS_ENABLED(PROC) \
+ (!ERTS_TRACER_IS_NIL(ERTS_TRACER(PROC)) \
+ && erts_is_tracer_proc_enabled(PROC, ERTS_PROC_LOCK_MAIN, \
+ &(PROC)->common, am_trace_status))
+
#endif /* ERL_TRACE_H__ */
diff --git a/erts/emulator/beam/erl_unicode.c b/erts/emulator/beam/erl_unicode.c
index 36d85b0a22..3c3536c021 100644
--- a/erts/emulator/beam/erl_unicode.c
+++ b/erts/emulator/beam/erl_unicode.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_unicode.h b/erts/emulator/beam/erl_unicode.h
index 4c25d89b7c..e01eaa787e 100644
--- a/erts/emulator/beam/erl_unicode.h
+++ b/erts/emulator/beam/erl_unicode.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_unicode_normalize.h b/erts/emulator/beam/erl_unicode_normalize.h
index 16c62db50e..21e2a52544 100644
--- a/erts/emulator/beam/erl_unicode_normalize.h
+++ b/erts/emulator/beam/erl_unicode_normalize.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2010. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_utils.h b/erts/emulator/beam/erl_utils.h
index 640969daf0..81800752f0 100644
--- a/erts/emulator/beam/erl_utils.h
+++ b/erts/emulator/beam/erl_utils.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2012-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2012-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_vm.h b/erts/emulator/beam/erl_vm.h
index 98f27a1725..f3c54de214 100644
--- a/erts/emulator/beam/erl_vm.h
+++ b/erts/emulator/beam/erl_vm.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -165,7 +165,6 @@ extern int erts_atom_table_size;/* Atom table size */
extern int erts_pd_initial_size;/* Initial Process dictionary table size */
#define ORIG_CREATION 0
-#define INTERNAL_CREATION 255
/* macros for extracting bytes from uint16's */
diff --git a/erts/emulator/beam/erl_zlib.c b/erts/emulator/beam/erl_zlib.c
index e44e86c39c..944ff2e35f 100644
--- a/erts/emulator/beam/erl_zlib.c
+++ b/erts/emulator/beam/erl_zlib.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erl_zlib.h b/erts/emulator/beam/erl_zlib.h
index 2ca1e3735e..c83c6f291f 100644
--- a/erts/emulator/beam/erl_zlib.h
+++ b/erts/emulator/beam/erl_zlib.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/erlang_dtrace.d b/erts/emulator/beam/erlang_dtrace.d
index c682f76e3a..237889e0f5 100644
--- a/erts/emulator/beam/erlang_dtrace.d
+++ b/erts/emulator/beam/erlang_dtrace.d
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Dustin Sallings, Michal Ptaszek, Scott Lystig Fritchie 2011-2012.
+ * Copyright Dustin Sallings, Michal Ptaszek, Scott Lystig Fritchie 2011-2016.
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -700,6 +700,35 @@ provider erlang {
*/
probe efile_drv__return(int, int, char *, int, int, int);
+
+/*
+ * The set of probes called by the erlang tracer nif backend. In order
+ * to receive events on these you both have to enable tracing in erlang
+ * using the trace bifs and also from dtrace/systemtap.
+ */
+
+
+ /**
+ * A trace message of type `event` was triggered by process `p`.
+ *
+ *
+ * @param p the PID (string form) of the process
+ * @param event the event that was triggered (i.e. call or spawn)
+ * @param state the state of the tracer nif as a string
+ * @param arg1 first argument to the trace event
+ * @param arg2 second argument to the trace event
+ */
+ probe trace(char *p, char *event, char *state, char *arg1, char *arg2);
+
+ /**
+ * A sequence trace message of type `label` was triggered.
+ *
+ * @param state the state of the tracer nif as a string
+ * @param label the seq trace label
+ * @param seq_info the seq trace info tuple as a string
+ */
+ probe trace_seq(char *state, char *label, char *seq_info);
+
/*
* NOTE:
* For formatting int64_t arguments within a D script, see:
diff --git a/erts/emulator/beam/erlang_lttng.c b/erts/emulator/beam/erlang_lttng.c
new file mode 100644
index 0000000000..fce40eedc1
--- /dev/null
+++ b/erts/emulator/beam/erlang_lttng.c
@@ -0,0 +1,32 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifdef USE_LTTNG
+#define TRACEPOINT_CREATE_PROBES
+/*
+ * The header containing our TRACEPOINT_EVENTs.
+ */
+#define TRACEPOINT_DEFINE
+#include "erlang_lttng.h"
+#endif /* USE_LTTNG */
diff --git a/erts/emulator/beam/erlang_lttng.h b/erts/emulator/beam/erlang_lttng.h
new file mode 100644
index 0000000000..12f68e477b
--- /dev/null
+++ b/erts/emulator/beam/erlang_lttng.h
@@ -0,0 +1,424 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+#ifdef USE_LTTNG
+#undef TRACEPOINT_PROVIDER
+#define TRACEPOINT_PROVIDER com_ericsson_otp
+
+#undef TRACEPOINT_INCLUDE
+#define TRACEPOINT_INCLUDE "erlang_lttng.h"
+
+#if !defined(__ERLANG_LTTNG_H__) || defined(TRACEPOINT_HEADER_MULTI_READ)
+#define __ERLANG_LTTNG_H__
+
+#include <lttng/tracepoint.h>
+
+/* Schedulers */
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ scheduler_poll,
+ TP_ARGS(
+ int, id,
+ int, runnable
+ ),
+ TP_FIELDS(
+ ctf_integer(int, scheduler, id)
+ ctf_integer(int, runnable, runnable)
+ )
+)
+
+#ifndef LTTNG_CARRIER_STATS
+#define LTTNG_CARRIER_STATS
+typedef struct {
+ unsigned long no;
+ unsigned long size;
+} lttng_stat_values_t;
+
+typedef struct {
+ lttng_stat_values_t carriers;
+ lttng_stat_values_t blocks;
+} lttng_carrier_stats_t;
+#endif
+
+
+/* Port and Driver Scheduling */
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ driver_start,
+ TP_ARGS(
+ char*, pid,
+ char*, driver,
+ char*, port
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(driver, driver)
+ ctf_string(port, port)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ driver_init,
+ TP_ARGS(
+ char*, driver,
+ int, major,
+ int, minor,
+ int, flags
+ ),
+ TP_FIELDS(
+ ctf_string(driver, driver)
+ ctf_integer(int, major, major)
+ ctf_integer(int, minor, minor)
+ ctf_integer(int, flags, flags)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ driver_outputv,
+ TP_ARGS(
+ char*, pid,
+ char*, port,
+ char*, driver,
+ size_t, bytes
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(port, port)
+ ctf_string(driver, driver)
+ ctf_integer(size_t, bytes, bytes)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ driver_output,
+ TP_ARGS(
+ char*, pid,
+ char*, port,
+ char*, driver,
+ size_t, bytes
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(port, port)
+ ctf_string(driver, driver)
+ ctf_integer(size_t, bytes, bytes)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ driver_ready_input,
+ TP_ARGS(
+ char*, pid,
+ char*, port,
+ char*, driver
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(port, port)
+ ctf_string(driver, driver)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ driver_ready_output,
+ TP_ARGS(
+ char*, pid,
+ char*, port,
+ char*, driver
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(port, port)
+ ctf_string(driver, driver)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ driver_event,
+ TP_ARGS(
+ char*, pid,
+ char*, port,
+ char*, driver
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(port, port)
+ ctf_string(driver, driver)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ driver_timeout,
+ TP_ARGS(
+ char*, pid,
+ char*, port,
+ char*, driver
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(port, port)
+ ctf_string(driver, driver)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ driver_stop_select,
+ TP_ARGS(
+ char*, driver
+ ),
+ TP_FIELDS(
+ ctf_string(driver, driver)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ driver_flush,
+ TP_ARGS(
+ char*, pid,
+ char*, port,
+ char*, driver
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(port, port)
+ ctf_string(driver, driver)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ driver_stop,
+ TP_ARGS(
+ char*, pid,
+ char*, port,
+ char*, driver
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(port, port)
+ ctf_string(driver, driver)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ driver_process_exit,
+ TP_ARGS(
+ char*, pid,
+ char*, port,
+ char*, driver
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(port, port)
+ ctf_string(driver, driver)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ driver_ready_async,
+ TP_ARGS(
+ char*, pid,
+ char*, port,
+ char*, driver
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(port, port)
+ ctf_string(driver, driver)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ driver_finish,
+ TP_ARGS(
+ char*, driver
+ ),
+ TP_FIELDS(
+ ctf_string(driver, driver)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ driver_call,
+ TP_ARGS(
+ char*, pid,
+ char*, port,
+ char*, driver,
+ unsigned int, command,
+ size_t, bytes
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(port, port)
+ ctf_string(driver, driver)
+ ctf_integer(unsigned int, command, command)
+ ctf_integer(size_t, bytes, bytes)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ driver_control,
+ TP_ARGS(
+ char*, pid,
+ char*, port,
+ char*, driver,
+ unsigned int, command,
+ size_t, bytes
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(port, port)
+ ctf_string(driver, driver)
+ ctf_integer(unsigned int, command, command)
+ ctf_integer(size_t, bytes, bytes)
+ )
+)
+
+/* Async pool */
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ aio_pool_get,
+ TP_ARGS(
+ char*, port,
+ int, length
+ ),
+ TP_FIELDS(
+ ctf_string(port, port)
+ ctf_integer(int, length, length)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ aio_pool_put,
+ TP_ARGS(
+ char*, port,
+ int, length
+ ),
+ TP_FIELDS(
+ ctf_string(port, port)
+ ctf_integer(int, length, length)
+ )
+)
+
+
+/* Memory Allocator */
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ carrier_create,
+ TP_ARGS(
+ const char*, type,
+ int, instance,
+ unsigned long, size,
+ lttng_carrier_stats_t *, mbcs,
+ lttng_carrier_stats_t *, sbcs
+ ),
+ TP_FIELDS(
+ ctf_string(type, type)
+ ctf_integer(int, instance, instance)
+ ctf_integer(unsigned long, size, size)
+ ctf_integer(unsigned long, mbc_carriers, mbcs->carriers.no)
+ ctf_integer(unsigned long, mbc_carriers_size, mbcs->carriers.size)
+ ctf_integer(unsigned long, mbc_blocks, mbcs->blocks.no)
+ ctf_integer(unsigned long, mbc_blocks_size, mbcs->blocks.size)
+ ctf_integer(unsigned long, sbc_carriers, sbcs->carriers.no)
+ ctf_integer(unsigned long, sbc_carriers_size, sbcs->carriers.size)
+ ctf_integer(unsigned long, sbc_blocks, sbcs->blocks.no)
+ ctf_integer(unsigned long, sbc_blocks_size, sbcs->blocks.size)
+ )
+)
+
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ carrier_destroy,
+ TP_ARGS(
+ const char*, type,
+ int, instance,
+ unsigned long, size,
+ lttng_carrier_stats_t *, mbcs,
+ lttng_carrier_stats_t *, sbcs
+ ),
+ TP_FIELDS(
+ ctf_string(type, type)
+ ctf_integer(int, instance, instance)
+ ctf_integer(unsigned long, size, size)
+ ctf_integer(unsigned long, mbc_carriers, mbcs->carriers.no)
+ ctf_integer(unsigned long, mbc_carriers_size, mbcs->carriers.size)
+ ctf_integer(unsigned long, mbc_blocks, mbcs->blocks.no)
+ ctf_integer(unsigned long, mbc_blocks_size, mbcs->blocks.size)
+ ctf_integer(unsigned long, sbc_carriers, sbcs->carriers.no)
+ ctf_integer(unsigned long, sbc_carriers_size, sbcs->carriers.size)
+ ctf_integer(unsigned long, sbc_blocks, sbcs->blocks.no)
+ ctf_integer(unsigned long, sbc_blocks_size, sbcs->blocks.size)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ carrier_pool_put,
+ TP_ARGS(
+ const char*, name,
+ int, instance,
+ unsigned long, size
+ ),
+ TP_FIELDS(
+ ctf_string(type, name)
+ ctf_integer(int, instance, instance)
+ ctf_integer(unsigned long, size, size)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_otp,
+ carrier_pool_get,
+ TP_ARGS(
+ const char*, name,
+ int, instance,
+ unsigned long, size
+ ),
+ TP_FIELDS(
+ ctf_string(type, name)
+ ctf_integer(int, instance, instance)
+ ctf_integer(unsigned long, size, size)
+ )
+)
+
+#endif /* __ERLANG_LTTNG_H__ */
+#include <lttng/tracepoint-event.h>
+#endif /* USE_LTTNG */
diff --git a/erts/emulator/beam/error.h b/erts/emulator/beam/error.h
index cba8672c68..6c33b12dd0 100644
--- a/erts/emulator/beam/error.h
+++ b/erts/emulator/beam/error.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2010. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/export.c b/erts/emulator/beam/export.c
index 581efe6eec..02c24557c1 100644
--- a/erts/emulator/beam/export.c
+++ b/erts/emulator/beam/export.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/export.h b/erts/emulator/beam/export.h
index a8bc9d2f66..8c81cbd410 100644
--- a/erts/emulator/beam/export.h
+++ b/erts/emulator/beam/export.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/external.c b/erts/emulator/beam/external.c
index aac1490f0c..3c002d43a7 100644
--- a/erts/emulator/beam/external.c
+++ b/erts/emulator/beam/external.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,7 +51,18 @@
#define MAX_STRING_LEN 0xffff
-#define is_valid_creation(Cre) ((unsigned)(Cre) < MAX_CREATION || (Cre) == INTERNAL_CREATION)
+/* MAX value for the creation field in pid, port and reference
+ for the local node and for the current external format.
+
+ Larger creation values than this are allowed in external pid, port and refs
+ encoded with NEW_PID_EXT, NEW_PORT_EXT and NEWER_REFERENCE_EXT.
+ The point here is to prepare for future upgrade to 32-bit creation.
+ OTP-19 (erts-8.0) can handle big creation values from other (newer) nodes,
+ but do not use big creation values for the local node yet,
+ as we still may have to communicate with older nodes.
+*/
+#define ERTS_MAX_LOCAL_CREATION (3)
+#define is_valid_creation(Cre) ((unsigned)(Cre) <= ERTS_MAX_LOCAL_CREATION)
#undef ERTS_DEBUG_USE_DIST_SEP
#ifdef DEBUG
@@ -97,7 +108,7 @@ static byte* enc_pid(ErtsAtomCacheMap *, Eterm, byte*, Uint32);
struct B2TContext_t;
static byte* dec_term(ErtsDistExternal*, ErtsHeapFactory*, byte*, Eterm*, struct B2TContext_t*);
static byte* dec_atom(ErtsDistExternal *, byte*, Eterm*);
-static byte* dec_pid(ErtsDistExternal *, ErtsHeapFactory*, byte*, Eterm*);
+static byte* dec_pid(ErtsDistExternal *, ErtsHeapFactory*, byte*, Eterm*, byte tag);
static Sint decoded_size(byte *ep, byte* endp, int internal_tags, struct B2TContext_t*);
static BIF_RETTYPE term_to_binary_trap_1(BIF_ALIST_1);
@@ -967,19 +978,24 @@ erts_decode_dist_ext(ErtsHeapFactory* factory,
return THE_NON_VALUE;
}
-Eterm erts_decode_ext(ErtsHeapFactory* factory, byte **ext)
+Eterm erts_decode_ext(ErtsHeapFactory* factory, byte **ext, Uint32 flags)
{
+ ErtsDistExternal ede, *edep;
Eterm obj;
byte *ep = *ext;
if (*ep++ != VERSION_MAGIC) {
erts_factory_undo(factory);
return THE_NON_VALUE;
}
- ep = dec_term(NULL, factory, ep, &obj, NULL);
+ if (flags) {
+ ASSERT(flags == ERTS_DIST_EXT_BTT_SAFE);
+ ede.flags = flags; /* a dummy struct just for the flags */
+ edep = &ede;
+ } else {
+ edep = NULL;
+ }
+ ep = dec_term(edep, factory, ep, &obj, NULL);
if (!ep) {
-#ifdef DEBUG
- bin_write(ERTS_PRINT_STDERR,NULL,*ext,500);
-#endif
return THE_NON_VALUE;
}
*ext = ep;
@@ -2147,12 +2163,13 @@ static byte*
enc_pid(ErtsAtomCacheMap *acmp, Eterm pid, byte* ep, Uint32 dflags)
{
Uint on, os;
+ Eterm sysname = ((is_internal_pid(pid) && (dflags & DFLAG_INTERNAL_TAGS))
+ ? am_Empty : pid_node_name(pid));
+ Uint32 creation = pid_creation(pid);
+ byte* tagp = ep++;
- *ep++ = PID_EXT;
/* insert atom here containing host and sysname */
- ep = enc_atom(acmp, pid_node_name(pid), ep, dflags);
-
- /* two bytes for each number and serial */
+ ep = enc_atom(acmp, sysname, ep, dflags);
on = pid_number(pid);
os = pid_serial(pid);
@@ -2161,8 +2178,15 @@ enc_pid(ErtsAtomCacheMap *acmp, Eterm pid, byte* ep, Uint32 dflags)
ep += 4;
put_int32(os, ep);
ep += 4;
- *ep++ = (is_internal_pid(pid) && (dflags & DFLAG_INTERNAL_TAGS)) ?
- INTERNAL_CREATION : pid_creation(pid);
+ if (creation <= ERTS_MAX_LOCAL_CREATION) {
+ *tagp = PID_EXT;
+ *ep++ = creation;
+ } else {
+ ASSERT(is_external_pid(pid));
+ *tagp = NEW_PID_EXT;
+ put_int32(creation, ep);
+ ep += 4;
+ }
return ep;
}
@@ -2242,27 +2266,27 @@ dec_atom(ErtsDistExternal *edep, byte* ep, Eterm* objp)
return ep;
}
-static ERTS_INLINE ErlNode* dec_get_node(Eterm sysname, Uint creation)
+static ERTS_INLINE ErlNode* dec_get_node(Eterm sysname, Uint32 creation)
{
- switch (creation) {
- case INTERNAL_CREATION:
+ if (sysname == am_Empty) /* && DFLAG_INTERNAL_TAGS */
return erts_this_node;
- case ORIG_CREATION:
- if (sysname == erts_this_node->sysname) {
- creation = erts_this_node->creation;
- }
- }
+
+ if (sysname == erts_this_node->sysname
+ && (creation == erts_this_node->creation || creation == ORIG_CREATION))
+ return erts_this_node;
+
return erts_find_or_insert_node(sysname,creation);
}
static byte*
-dec_pid(ErtsDistExternal *edep, ErtsHeapFactory* factory, byte* ep, Eterm* objp)
+dec_pid(ErtsDistExternal *edep, ErtsHeapFactory* factory, byte* ep,
+ Eterm* objp, byte tag)
{
Eterm sysname;
Uint data;
Uint num;
Uint ser;
- Uint cre;
+ Uint32 cre;
ErlNode *node;
*objp = NIL; /* In case we fail, don't leave a hole in the heap */
@@ -2278,12 +2302,19 @@ dec_pid(ErtsDistExternal *edep, ErtsHeapFactory* factory, byte* ep, Eterm* objp)
ep += 4;
if (ser > ERTS_MAX_PID_SERIAL)
return NULL;
- cre = get_int8(ep);
- ep += 1;
- if (!is_valid_creation(cre)) {
- return NULL;
+ if (tag == PID_EXT) {
+ cre = get_int8(ep);
+ ep += 1;
+ if (!is_valid_creation(cre)) {
+ return NULL;
+ }
+ } else {
+ ASSERT(tag == NEW_PID_EXT);
+ cre = get_int32(ep);
+ ep += 4;
}
+
data = make_pid_data(ser, num);
/*
@@ -2523,16 +2554,26 @@ enc_term_int(TTBEncodeContext* ctx, ErtsAtomCacheMap *acmp, Eterm obj, byte* ep,
case REF_DEF:
case EXTERNAL_REF_DEF: {
Uint32 *ref_num;
+ Eterm sysname = (((dflags & DFLAG_INTERNAL_TAGS) && is_internal_ref(obj))
+ ? am_Empty : ref_node_name(obj));
+ Uint32 creation = ref_creation(obj);
+ byte* tagp = ep++;
ASSERT(dflags & DFLAG_EXTENDED_REFERENCES);
- *ep++ = NEW_REFERENCE_EXT;
i = ref_no_of_numbers(obj);
put_int16(i, ep);
ep += 2;
- ep = enc_atom(acmp,ref_node_name(obj),ep,dflags);
- *ep++ = ((dflags & DFLAG_INTERNAL_TAGS) && is_internal_ref(obj)) ?
- INTERNAL_CREATION : ref_creation(obj);
+ ep = enc_atom(acmp, sysname, ep, dflags);
+ if (creation <= ERTS_MAX_LOCAL_CREATION) {
+ *tagp = NEW_REFERENCE_EXT;
+ *ep++ = creation;
+ } else {
+ ASSERT(is_external_ref(obj));
+ *tagp = NEWER_REFERENCE_EXT;
+ put_int32(creation, ep);
+ ep += 4;
+ }
ref_num = ref_numbers(obj);
for (j = 0; j < i; j++) {
put_int32(ref_num[j], ep);
@@ -2541,17 +2582,27 @@ enc_term_int(TTBEncodeContext* ctx, ErtsAtomCacheMap *acmp, Eterm obj, byte* ep,
break;
}
case PORT_DEF:
- case EXTERNAL_PORT_DEF:
+ case EXTERNAL_PORT_DEF: {
+ Eterm sysname = (((dflags & DFLAG_INTERNAL_TAGS) && is_internal_port(obj))
+ ? am_Empty : port_node_name(obj));
+ Uint32 creation = port_creation(obj);
+ byte* tagp = ep++;
- *ep++ = PORT_EXT;
- ep = enc_atom(acmp,port_node_name(obj),ep,dflags);
+ ep = enc_atom(acmp, sysname, ep, dflags);
j = port_number(obj);
put_int32(j, ep);
ep += 4;
- *ep++ = ((dflags & DFLAG_INTERNAL_TAGS) && is_internal_port(obj)) ?
- INTERNAL_CREATION : port_creation(obj);
+ if (creation <= ERTS_MAX_LOCAL_CREATION) {
+ *tagp = PORT_EXT;
+ *ep++ = creation;
+ } else {
+ ASSERT(is_external_port(obj));
+ *tagp = NEW_PORT_EXT;
+ put_int32(creation, ep);
+ ep += 4;
+ }
break;
-
+ }
case LIST_DEF:
{
int is_str;
@@ -3255,20 +3306,23 @@ dec_term_atom_common:
hp += FLOAT_SIZE_OBJECT;
break;
}
- case PID_EXT:
+ case PID_EXT:
+ case NEW_PID_EXT:
factory->hp = hp;
- ep = dec_pid(edep, factory, ep, objp);
+ ep = dec_pid(edep, factory, ep, objp, ep[-1]);
hp = factory->hp;
if (ep == NULL) {
goto error;
}
break;
- case PORT_EXT:
+ case PORT_EXT:
+ case NEW_PORT_EXT:
{
Eterm sysname;
ErlNode *node;
Uint num;
- Uint cre;
+ Uint32 cre;
+ byte tag = ep[-1];
if ((ep = dec_atom(edep, ep, &sysname)) == NULL) {
goto error;
@@ -3277,12 +3331,17 @@ dec_term_atom_common:
goto error;
}
ep += 4;
- cre = get_int8(ep);
- ep++;
- if (!is_valid_creation(cre)) {
- goto error;
- }
-
+ if (tag == PORT_EXT) {
+ cre = get_int8(ep);
+ ep++;
+ if (!is_valid_creation(cre)) {
+ goto error;
+ }
+ }
+ else {
+ cre = get_int32(ep);
+ ep += 4;
+ }
node = dec_get_node(sysname, cre);
if(node == erts_this_node) {
*objp = make_internal_port(num);
@@ -3307,7 +3366,7 @@ dec_term_atom_common:
Eterm sysname;
ErlNode *node;
int i;
- Uint cre;
+ Uint32 cre;
Uint32 *ref_num;
Uint32 r0;
Uint ref_words;
@@ -3331,9 +3390,6 @@ dec_term_atom_common:
ref_words = get_int16(ep);
ep += 2;
- if (ref_words > ERTS_MAX_REF_NUMBERS)
- goto error;
-
if ((ep = dec_atom(edep, ep, &sysname)) == NULL)
goto error;
@@ -3346,8 +3402,23 @@ dec_term_atom_common:
ep += 4;
if (r0 >= MAX_REFERENCE)
goto error;
+ goto ref_ext_common;
+
+ case NEWER_REFERENCE_EXT:
+ ref_words = get_int16(ep);
+ ep += 2;
+
+ if ((ep = dec_atom(edep, ep, &sysname)) == NULL)
+ goto error;
+
+ cre = get_int32(ep);
+ ep += 4;
+ r0 = get_int32(ep); /* allow full word */
+ ep += 4;
ref_ext_common:
+ if (ref_words > ERTS_MAX_REF_NUMBERS)
+ goto error;
node = dec_get_node(sysname, cre);
if(node == erts_this_node) {
@@ -3701,9 +3772,9 @@ dec_term_atom_common:
*objp = make_fun(funp);
/* Creator pid */
- if (*ep != PID_EXT
- || (ep = dec_pid(edep, factory, ++ep,
- &funp->creator))==NULL) {
+ if ((*ep != PID_EXT && *ep != NEW_PID_EXT)
+ || (ep = dec_pid(edep, factory, ep+1,
+ &funp->creator, *ep))==NULL) {
goto error;
}
@@ -3887,9 +3958,13 @@ error:
* Must unlink all off-heap objects that may have been
* linked into the process.
*/
- if (factory->hp < hp) { /* Sometimes we used hp and sometimes factory->hp */
- factory->hp = hp; /* the largest must be the freshest */
+ if (factory->mode != FACTORY_CLOSED) {
+ if (factory->hp < hp) { /* Sometimes we used hp and sometimes factory->hp */
+ factory->hp = hp; /* the largest must be the freshest */
+ }
}
+ else ASSERT(factory->hp == hp);
+
error_hamt:
erts_factory_undo(factory);
PSTACK_DESTROY(hamt_array);
@@ -4005,20 +4080,29 @@ encode_size_struct_int(TTBSizeContext* ctx, ErtsAtomCacheMap *acmp, Eterm obj,
else
result += 1 + 4 + 1 + i; /* tag,size,sign,digits */
break;
+ case EXTERNAL_PID_DEF:
+ if (external_pid_creation(obj) > ERTS_MAX_LOCAL_CREATION)
+ result += 3;
+ /*fall through*/
case PID_DEF:
- case EXTERNAL_PID_DEF:
result += (1 + encode_size_struct2(acmp, pid_node_name(obj), dflags) +
4 + 4 + 1);
break;
+ case EXTERNAL_REF_DEF:
+ if (external_ref_creation(obj) > ERTS_MAX_LOCAL_CREATION)
+ result += 3;
+ /*fall through*/
case REF_DEF:
- case EXTERNAL_REF_DEF:
ASSERT(dflags & DFLAG_EXTENDED_REFERENCES);
i = ref_no_of_numbers(obj);
result += (1 + 2 + encode_size_struct2(acmp, ref_node_name(obj), dflags) +
1 + 4*i);
break;
- case PORT_DEF:
- case EXTERNAL_PORT_DEF:
+ case EXTERNAL_PORT_DEF:
+ if (external_port_creation(obj) > ERTS_MAX_LOCAL_CREATION)
+ result += 3;
+ /*fall through*/
+ case PORT_DEF:
result += (1 + encode_size_struct2(acmp, port_node_name(obj), dflags) +
4 + 1);
break;
@@ -4345,19 +4429,32 @@ init_done:
SKIP(1+atom_extra_skip);
atom_extra_skip = 0;
break;
- case PID_EXT:
+ case NEW_PID_EXT:
+ atom_extra_skip = 12;
+ goto case_PID;
+ case PID_EXT:
atom_extra_skip = 9;
+ case_PID:
/* In case it is an external pid */
heap_size += EXTERNAL_THING_HEAD_SIZE + 1;
terms++;
break;
- case PORT_EXT:
+ case NEW_PORT_EXT:
+ atom_extra_skip = 8;
+ goto case_PORT;
+ case PORT_EXT:
atom_extra_skip = 5;
+ case_PORT:
/* In case it is an external port */
heap_size += EXTERNAL_THING_HEAD_SIZE + 1;
terms++;
break;
- case NEW_REFERENCE_EXT:
+ case NEWER_REFERENCE_EXT:
+ atom_extra_skip = 4;
+ goto case_NEW_REFERENCE;
+ case NEW_REFERENCE_EXT:
+ atom_extra_skip = 1;
+ case_NEW_REFERENCE:
{
int id_words;
@@ -4368,7 +4465,7 @@ init_done:
goto error;
ep += 2;
- atom_extra_skip = 1 + 4*id_words;
+ atom_extra_skip += 4*id_words;
/* In case it is an external ref */
#if defined(ARCH_64)
heap_size += EXTERNAL_THING_HEAD_SIZE + id_words/2 + 1;
diff --git a/erts/emulator/beam/external.h b/erts/emulator/beam/external.h
index d12051c6b4..f00426cc16 100644
--- a/erts/emulator/beam/external.h
+++ b/erts/emulator/beam/external.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,8 +18,6 @@
* %CopyrightEnd%
*/
-/* Same order as the ordering of terms in erlang */
-
/* Since there are 255 different External tag values to choose from
There is no reason to not be extravagant.
Hence, the different tags for large/small tuple e.t.c
@@ -37,9 +35,12 @@
#define SMALL_ATOM_EXT 's'
#define REFERENCE_EXT 'e'
#define NEW_REFERENCE_EXT 'r'
+#define NEWER_REFERENCE_EXT 'Z'
#define PORT_EXT 'f'
+#define NEW_PORT_EXT 'Y'
#define NEW_FLOAT_EXT 'F'
#define PID_EXT 'g'
+#define NEW_PID_EXT 'X'
#define SMALL_TUPLE_EXT 'h'
#define LARGE_TUPLE_EXT 'i'
#define NIL_EXT 'j'
@@ -191,7 +192,7 @@ Eterm erts_decode_dist_ext(ErtsHeapFactory* factory, ErtsDistExternal *);
Sint erts_decode_ext_size(byte*, Uint);
Sint erts_decode_ext_size_ets(byte*, Uint);
-Eterm erts_decode_ext(ErtsHeapFactory*, byte**);
+Eterm erts_decode_ext(ErtsHeapFactory*, byte**, Uint32 flags);
Eterm erts_decode_ext_ets(ErtsHeapFactory*, byte*);
Eterm erts_term_to_binary(Process* p, Eterm Term, int level, Uint flags);
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h
index d7edf451be..49eec44053 100644
--- a/erts/emulator/beam/global.h
+++ b/erts/emulator/beam/global.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,6 +44,8 @@
#include "erl_port.h"
#include "erl_gc.h"
+struct enif_func_t;
+
struct enif_environment_t /* ErlNifEnv */
{
struct erl_module_nif* mod_nif;
@@ -54,14 +56,21 @@ struct enif_environment_t /* ErlNifEnv */
int fpe_was_unmasked;
struct enif_tmp_obj_t* tmp_obj_list;
int exception_thrown; /* boolean */
+ Process *tracee;
};
extern void erts_pre_nif(struct enif_environment_t*, Process*,
- struct erl_module_nif*);
+ struct erl_module_nif*, Process* tracee);
extern void erts_post_nif(struct enif_environment_t* env);
extern Eterm erts_nif_taints(Process* p);
extern void erts_print_nif_taints(int to, void* to_arg);
void erts_unload_nif(struct erl_module_nif* nif);
extern void erl_nif_init(void);
+extern int erts_nif_get_funcs(struct erl_module_nif*,
+ struct enif_func_t **funcs);
+extern Eterm erts_nif_call_function(Process *p, Process *tracee,
+ struct erl_module_nif*,
+ struct enif_func_t *,
+ int argc, Eterm *argv);
/* Driver handle (wrapper for old plain handle) */
#define ERL_DE_OK 0
@@ -988,7 +997,7 @@ Eterm erl_is_function(Process* p, Eterm arg1, Eterm arg2);
#define ERTS_CPC_ALLOW_GC (1 << 0)
#define ERTS_CPC_COPY_LITERALS (1 << 1)
#define ERTS_CPC_ALL (ERTS_CPC_ALLOW_GC | ERTS_CPC_COPY_LITERALS)
-Eterm erts_check_process_code(Process *c_p, Eterm module, Uint flags, int *redsp);
+Eterm erts_check_process_code(Process *c_p, Eterm module, Uint flags, int *redsp, int fcalls);
typedef struct {
Eterm *ptr;
@@ -1532,10 +1541,15 @@ ERTS_GLB_INLINE void dtrace_fun_decode(Process *process,
ERTS_GLB_INLINE void
dtrace_pid_str(Eterm pid, char *process_buf)
{
- erts_snprintf(process_buf, DTRACE_TERM_BUF_SIZE, "<%lu.%lu.%lu>",
- pid_channel_no(pid),
- pid_number(pid),
- pid_serial(pid));
+ if (is_pid(pid))
+ erts_snprintf(process_buf, DTRACE_TERM_BUF_SIZE, "<%lu.%lu.%lu>",
+ pid_channel_no(pid),
+ pid_number(pid),
+ pid_serial(pid));
+ else if (is_port(pid))
+ erts_snprintf(process_buf, DTRACE_TERM_BUF_SIZE, "#Port<%lu.%lu>",
+ port_channel_no(pid),
+ port_number(pid));
}
ERTS_GLB_INLINE void
@@ -1547,9 +1561,7 @@ dtrace_proc_str(Process *process, char *process_buf)
ERTS_GLB_INLINE void
dtrace_port_str(Port *port, char *port_buf)
{
- erts_snprintf(port_buf, DTRACE_TERM_BUF_SIZE, "#Port<%lu.%lu>",
- port_channel_no(port->common.id),
- port_number(port->common.id));
+ dtrace_pid_str(port->common.id, port_buf);
}
ERTS_GLB_INLINE void
diff --git a/erts/emulator/beam/hash.c b/erts/emulator/beam/hash.c
index 5a0b93f693..e255b961f1 100644
--- a/erts/emulator/beam/hash.c
+++ b/erts/emulator/beam/hash.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/hash.h b/erts/emulator/beam/hash.h
index e94aaa0a84..9f773d8faa 100644
--- a/erts/emulator/beam/hash.h
+++ b/erts/emulator/beam/hash.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/index.c b/erts/emulator/beam/index.c
index 5f6ea14732..26d6c04ea0 100644
--- a/erts/emulator/beam/index.c
+++ b/erts/emulator/beam/index.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2012. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/index.h b/erts/emulator/beam/index.h
index 99b2bdfab0..218779c33b 100644
--- a/erts/emulator/beam/index.h
+++ b/erts/emulator/beam/index.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c
index 797e4cdadc..5c2595c69d 100644
--- a/erts/emulator/beam/io.c
+++ b/erts/emulator/beam/io.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,6 +47,7 @@
#define ERTS_WANT_EXTERNAL_TAGS
#include "external.h"
#include "dtrace-wrapper.h"
+#include "lttng-wrapper.h"
#include "erl_map.h"
#include "erl_bif_unique.h"
#include "erl_hl_timer.h"
@@ -87,7 +88,7 @@ int erts_port_parallelism = 0;
static erts_atomic64_t bytes_in;
static erts_atomic64_t bytes_out;
-static void deliver_result(Eterm sender, Eterm pid, Eterm res);
+static void deliver_result(Port *p, Eterm sender, Eterm pid, Eterm res);
static int init_driver(erts_driver_t *, ErlDrvEntry *, DE_Handle *);
static void terminate_port(Port *p);
static void pdl_init(void);
@@ -211,6 +212,7 @@ static ERTS_INLINE void
kill_port(Port *pp)
{
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(pp));
+ ERTS_TRACER_CLEAR(&ERTS_TRACER(pp));
erts_ptab_delete_element(&erts_port, &pp->common); /* Time of death */
erts_port_task_free_port(pp);
/* In non-smp case the port structure may have been deallocated now */
@@ -397,13 +399,13 @@ static Port *create_port(char *name,
prt->common.u.alive.reg = NULL;
ERTS_PTMR_INIT(prt);
erts_port_task_handle_init(&prt->timeout_task);
- prt->psd = NULL;
+ erts_smp_atomic_init_nob(&prt->psd, (erts_aint_t) NULL);
prt->async_open_port = NULL;
prt->drv_data = (SWord) 0;
prt->os_pid = -1;
/* Set default tracing */
- erts_get_default_tracing(&ERTS_TRACE_FLAGS(prt), &ERTS_TRACER_PROC(prt));
+ erts_get_default_port_tracing(&ERTS_TRACE_FLAGS(prt), &ERTS_TRACER(prt));
ERTS_CT_ASSERT(offsetof(Port,common) == 0);
@@ -708,7 +710,7 @@ erts_open_driver(erts_driver_t* driver, /* Pointer to driver. */
if (driver->start) {
ERTS_MSACC_PUSH_STATE_M();
if (IS_TRACED_FL(port, F_TRACE_SCHED_PORTS)) {
- trace_sched_ports_where(port, am_in, am_start);
+ trace_sched_ports_where(port, am_in, am_open);
}
port->caller = pid;
#ifdef USE_VM_PROBES
@@ -717,7 +719,19 @@ erts_open_driver(erts_driver_t* driver, /* Pointer to driver. */
DTRACE3(driver_start, process_str, driver->name, port_str);
}
#endif
+
ERTS_MSACC_SET_STATE_CACHED_M(ERTS_MSACC_STATE_PORT);
+
+#ifdef USE_LTTNG_VM_TRACEPOINTS
+ if (LTTNG_ENABLED(driver_start)) {
+ lttng_decl_portbuf(port_str);
+ lttng_decl_procbuf(proc_str);
+ lttng_pid_to_str(pid, proc_str);
+ lttng_port_to_str(port, port_str);
+ LTTNG3(driver_start, proc_str, driver->name, port_str);
+ }
+#endif
+
fpe_was_unmasked = erts_block_fpe();
drv_data = (*driver->start)(ERTS_Port2ErlDrvPort(port), name, opts);
if (((SWord) drv_data) == -1)
@@ -740,7 +754,7 @@ erts_open_driver(erts_driver_t* driver, /* Pointer to driver. */
ERTS_MSACC_POP_STATE_M();
port->caller = NIL;
if (IS_TRACED_FL(port, F_TRACE_SCHED_PORTS)) {
- trace_sched_ports_where(port, am_out, am_start);
+ trace_sched_ports_where(port, am_out, am_open);
}
#ifdef ERTS_SMP
if (port->xports)
@@ -1287,7 +1301,7 @@ try_imm_drv_call(ErtsTryImmDrvCallState *sp)
reds_left_in = CONTEXT_REDS/10;
else {
if (IS_TRACED_FL(c_p, F_TRACE_SCHED_PROCS))
- trace_virtual_sched(c_p, am_out);
+ trace_sched(c_p, ERTS_PROC_LOCK_MAIN, am_out);
/*
* No status lock held while sending runnable
* proc trace messages. It is however not needed
@@ -1371,7 +1385,7 @@ finalize_imm_drv_call(ErtsTryImmDrvCallState *sp)
}
if (IS_TRACED_FL(c_p, F_TRACE_SCHED_PROCS))
- trace_virtual_sched(c_p, am_in);
+ trace_sched(c_p, ERTS_PROC_LOCK_MAIN, am_in);
/*
* No status lock held while sending runnable
* proc trace messages. It is however not needed
@@ -1434,7 +1448,7 @@ queue_port_sched_op_reply(Process *rp,
erts_factory_trim_and_close(factory, &msg, 1);
- erts_queue_message(rp, rp_locksp, factory->message, msg, NIL);
+ erts_queue_message(rp, rp_locksp, factory->message, msg);
}
static void
@@ -1522,9 +1536,8 @@ erts_schedule_proc2port_signal(Process *c_p,
ERTS_SMP_MSGQ_MV_INQ2PRIVQ(c_p);
c_p->msg.save = c_p->msg.last;
- erts_smp_proc_unlock(c_p,
- (ERTS_PROC_LOCK_MAIN
- | ERTS_PROC_LOCKS_MSG_RECEIVE));
+ erts_smp_proc_unlock(c_p, (ERTS_PROC_LOCKS_MSG_RECEIVE
+ | ERTS_PROC_LOCK_MAIN));
}
@@ -1542,8 +1555,19 @@ erts_schedule_proc2port_signal(Process *c_p,
erts_smp_proc_lock(c_p, ERTS_PROC_LOCK_MAIN);
if (sched_res != 0) {
- if (refp)
+ if (refp) {
+ /*
+ * We need to restore the message queue save
+ * pointer to the beginning of the message queue
+ * since the caller now wont wait for a message
+ * containing the reference created above...
+ */
+ ASSERT(c_p);
+ erts_smp_proc_lock(c_p, ERTS_PROC_LOCKS_MSG_RECEIVE);
+ JOIN_MESSAGE(c_p);
+ erts_smp_proc_unlock(c_p, ERTS_PROC_LOCKS_MSG_RECEIVE);
*refp = NIL;
+ }
return ERTS_PORT_OP_DROPPED;
}
return ERTS_PORT_OP_SCHEDULED;
@@ -1718,12 +1742,25 @@ call_driver_outputv(int bang_op,
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(prt)
|| ERTS_IS_CRASH_DUMPING);
+
+ if (IS_TRACED_FL(prt, F_TRACE_RECEIVE))
+ trace_port_receive(prt, caller, am_commandv, evp);
+
#ifdef USE_VM_PROBES
if (DTRACE_ENABLED(driver_outputv)) {
DTRACE_FORMAT_COMMON_PID_AND_PORT(caller, prt);
DTRACE4(driver_outputv, process_str, port_str, prt->name, size);
}
#endif
+#ifdef USE_LTTNG_VM_TRACEPOINTS
+ if (LTTNG_ENABLED(driver_outputv)) {
+ lttng_decl_portbuf(port_str);
+ lttng_decl_procbuf(proc_str);
+ lttng_pid_to_str(caller, proc_str);
+ lttng_port_to_str(prt, port_str);
+ LTTNG4(driver_outputv, proc_str, port_str, prt->name, size);
+ }
+#endif
prt->caller = caller;
(*drv->outputv)((ErlDrvData) prt->drv_data, evp);
@@ -1749,7 +1786,6 @@ cleanup_scheduled_outputv(ErlIOVec *ev, ErlDrvBinary *cbinp)
driver_free_binary(ev->binv[i]);
if (cbinp)
driver_free_binary(cbinp);
- erts_free(ERTS_ALC_T_DRV_CMD_DATA, ev);
}
static int
@@ -1826,6 +1862,18 @@ call_driver_output(int bang_op,
DTRACE4(driver_output, process_str, port_str, prt->name, size);
}
#endif
+#ifdef USE_LTTNG_VM_TRACEPOINTS
+ if (LTTNG_ENABLED(driver_output)) {
+ lttng_decl_portbuf(port_str);
+ lttng_decl_procbuf(proc_str);
+ lttng_pid_to_str(caller, proc_str);
+ lttng_port_to_str(prt, port_str);
+ LTTNG4(driver_output, proc_str, port_str, prt->name, size);
+ }
+#endif
+
+ if (IS_TRACED_FL(prt, F_TRACE_RECEIVE))
+ trace_port_receive(prt, caller, am_command, bufp, size);
prt->caller = caller;
(*drv->output)((ErlDrvData) prt->drv_data, bufp, size);
@@ -1887,6 +1935,188 @@ port_sig_output(Port *prt, erts_aint32_t state, int op, ErtsProc2PortSigData *si
return ERTS_PORT_REDS_CMD_OUTPUT;
}
+
+/*
+ * This erts_port_output will always create a port task.
+ * The call is treated as a port_command call, i.e. no
+ * badsig i generated if the input in invalid. However
+ * an error_logger message is generated.
+ */
+int
+erts_port_output_async(Port *prt, Eterm from, Eterm list)
+{
+
+ ErtsPortOpResult res;
+ ErtsProc2PortSigData *sigdp;
+ erts_driver_t *drv = prt->drv_ptr;
+ size_t size;
+ int task_flags;
+ ErtsProc2PortSigCallback port_sig_callback;
+ ErlDrvBinary *cbin = NULL;
+ ErlIOVec *evp = NULL;
+ char *buf = NULL;
+ ErtsPortTaskHandle *ns_pthp;
+
+ if (drv->outputv) {
+ ErlIOVec ev;
+ SysIOVec* ivp;
+ ErlDrvBinary** bvp;
+ int vsize;
+ Uint csize;
+ Uint pvsize;
+ Uint pcsize;
+ size_t iov_offset, binv_offset, alloc_size;
+ Uint blimit = 0;
+ char *ptr;
+ int i;
+
+ Eterm* bptr = NULL;
+ Uint offset;
+
+ if (is_binary(list)) {
+ /* We optimize for when we get a procbin without offset */
+ Eterm real_bin;
+ int bitoffs;
+ int bitsize;
+ ERTS_GET_REAL_BIN(list, real_bin, offset, bitoffs, bitsize);
+ bptr = binary_val(real_bin);
+ if (*bptr == HEADER_PROC_BIN && bitoffs == 0) {
+ size = binary_size(list);
+ vsize = 1;
+ } else
+ bptr = NULL;
+ }
+
+ if (!bptr) {
+ if (io_list_vec_len(list, &vsize, &csize, &pvsize, &pcsize, &size))
+ goto bad_value;
+
+ /* To pack or not to pack (small binaries) ...? */
+ if (vsize >= SMALL_WRITE_VEC) {
+ /* Do pack */
+ vsize = pvsize + 1;
+ csize = pcsize;
+ blimit = ERL_SMALL_IO_BIN_LIMIT;
+ }
+ cbin = driver_alloc_binary(csize);
+ if (!cbin)
+ erts_alloc_enomem(ERTS_ALC_T_DRV_BINARY, ERTS_SIZEOF_Binary(csize));
+ }
+
+
+ iov_offset = ERTS_ALC_DATA_ALIGN_SIZE(sizeof(ErlIOVec));
+ binv_offset = iov_offset;
+ binv_offset += ERTS_ALC_DATA_ALIGN_SIZE((vsize+1)*sizeof(SysIOVec));
+ alloc_size = binv_offset;
+ alloc_size += (vsize+1)*sizeof(ErlDrvBinary *);
+
+ sigdp = erts_port_task_alloc_p2p_sig_data_extra(alloc_size, (void**)&ptr);
+
+ evp = (ErlIOVec *) ptr;
+ ivp = evp->iov = (SysIOVec *) (ptr + iov_offset);
+ bvp = evp->binv = (ErlDrvBinary **) (ptr + binv_offset);
+
+ ivp[0].iov_base = NULL;
+ ivp[0].iov_len = 0;
+ bvp[0] = NULL;
+
+ if (bptr) {
+ ProcBin* pb = (ProcBin *) bptr;
+
+ ivp[1].iov_base = pb->bytes+offset;
+ ivp[1].iov_len = size;
+ bvp[1] = Binary2ErlDrvBinary(pb->val);
+
+ evp->vsize = 1;
+ } else {
+
+ evp->vsize = io_list_to_vec(list, ivp+1, bvp+1, cbin, blimit);
+ if (evp->vsize < 0) {
+ if (evp != &ev)
+ erts_free(ERTS_ALC_T_DRV_CMD_DATA, evp);
+ driver_free_binary(cbin);
+ goto bad_value;
+ }
+ }
+#if 0
+ /* This assertion may say something useful, but it can
+ be falsified during the emulator test suites. */
+ ASSERT(evp->vsize == vsize);
+#endif
+ evp->vsize++;
+ evp->size = size; /* total size */
+
+ /* Need to increase refc on all binaries */
+ for (i = 1; i < evp->vsize; i++)
+ if (bvp[i])
+ driver_binary_inc_refc(bvp[i]);
+
+ sigdp->flags = ERTS_P2P_SIG_TYPE_OUTPUTV;
+ sigdp->u.outputv.from = from;
+ sigdp->u.outputv.evp = evp;
+ sigdp->u.outputv.cbinp = cbin;
+ port_sig_callback = port_sig_outputv;
+ } else {
+ ErlDrvSizeT ERTS_DECLARE_DUMMY(r);
+
+ /*
+ * Apperently there exist code that write 1 byte to
+ * much in buffer. Where it resides I don't know, but
+ * we can live with one byte extra allocated...
+ */
+
+ if (erts_iolist_size(list, &size))
+ goto bad_value;
+
+ buf = erts_alloc(ERTS_ALC_T_DRV_CMD_DATA, size + 1);
+
+ r = erts_iolist_to_buf(list, buf, size);
+ ASSERT(ERTS_IOLIST_TO_BUF_SUCCEEDED(r));
+
+ sigdp = erts_port_task_alloc_p2p_sig_data();
+ sigdp->flags = ERTS_P2P_SIG_TYPE_OUTPUT;
+ sigdp->u.output.from = from;
+ sigdp->u.output.bufp = buf;
+ sigdp->u.output.size = size;
+ port_sig_callback = port_sig_output;
+ }
+ sigdp->flags = 0;
+ ns_pthp = NULL;
+ task_flags = 0;
+
+ res = erts_schedule_proc2port_signal(NULL,
+ prt,
+ ERTS_INVALID_PID,
+ NULL,
+ sigdp,
+ task_flags,
+ ns_pthp,
+ port_sig_callback);
+
+ if (res != ERTS_PORT_OP_SCHEDULED) {
+ if (drv->outputv)
+ cleanup_scheduled_outputv(evp, cbin);
+ else
+ cleanup_scheduled_output(buf);
+ return 1;
+ }
+ return 1;
+
+bad_value:
+
+ /*
+ * We call badsig directly here as this function is called with
+ * the main lock of the calling process still held.
+ * At the moment this operation is always not a bang_op, so
+ * only an error_logger message should be generated, no badsig.
+ */
+
+ badsig_received(0, prt, erts_atomic32_read_nob(&prt->state), 1);
+
+ return 0;
+
+}
+
ErtsPortOpResult
erts_port_output(Process *c_p,
int flags,
@@ -1896,7 +2126,7 @@ erts_port_output(Process *c_p,
Eterm *refp)
{
ErtsPortOpResult res;
- ErtsProc2PortSigData *sigdp;
+ ErtsProc2PortSigData *sigdp = NULL;
erts_driver_t *drv = prt->drv_ptr;
size_t size;
int try_call;
@@ -1949,7 +2179,6 @@ erts_port_output(Process *c_p,
DTRACE4(port_command, process_str, port_str, prt->name, "command");
}
#endif
-
if (drv->outputv) {
ErlIOVec ev;
SysIOVec iv[SMALL_WRITE_VEC];
@@ -1978,10 +2207,13 @@ erts_port_output(Process *c_p,
evp = &ev;
}
else {
- char *ptr = erts_alloc((try_call
- ? ERTS_ALC_T_TMP
- : ERTS_ALC_T_DRV_CMD_DATA), alloc_size);
-
+ char *ptr;
+ if (try_call) {
+ ptr = erts_alloc(ERTS_ALC_T_TMP, alloc_size);
+ } else {
+ sigdp = erts_port_task_alloc_p2p_sig_data_extra(
+ alloc_size, (void**)&ptr);
+ }
evp = (ErlIOVec *) ptr;
ivp = evp->iov = (SysIOVec *) (ptr + iov_offset);
bvp = evp->binv = (ErlDrvBinary **) (ptr + binv_offset);
@@ -2010,9 +2242,12 @@ erts_port_output(Process *c_p,
bvp[0] = NULL;
evp->vsize = io_list_to_vec(list, ivp+1, bvp+1, cbin, blimit);
if (evp->vsize < 0) {
- if (evp != &ev)
- erts_free(try_call ? ERTS_ALC_T_TMP : ERTS_ALC_T_DRV_CMD_DATA,
- evp);
+ if (evp != &ev) {
+ if (try_call)
+ erts_free(ERTS_ALC_T_TMP, evp);
+ else
+ erts_port_task_free_p2p_sig_data(sigdp);
+ }
driver_free_binary(cbin);
goto bad_value;
}
@@ -2064,8 +2299,10 @@ erts_port_output(Process *c_p,
/* Fall through... */
case ERTS_TRY_IMM_DRV_CALL_INVALID_PORT:
driver_free_binary(cbin);
- if (evp != &ev)
+ if (evp != &ev) {
+ ASSERT(!sigdp);
erts_free(ERTS_ALC_T_TMP, evp);
+ }
if (try_call_res != ERTS_TRY_IMM_DRV_CALL_OK)
return ERTS_PORT_OP_DROPPED;
if (c_p)
@@ -2076,8 +2313,10 @@ erts_port_output(Process *c_p,
if (async_nosuspend
&& (sched_flags & (busy_flgs|ERTS_PTS_FLG_EXIT))) {
driver_free_binary(cbin);
- if (evp != &ev)
+ if (evp != &ev) {
+ ASSERT(!sigdp);
erts_free(ERTS_ALC_T_TMP, evp);
+ }
return ((sched_flags & ERTS_PTS_FLG_EXIT)
? ERTS_PORT_OP_DROPPED
: ERTS_PORT_OP_BUSY);
@@ -2092,9 +2331,16 @@ erts_port_output(Process *c_p,
if (bvp[i])
driver_binary_inc_refc(bvp[i]);
- new_evp = erts_alloc(ERTS_ALC_T_DRV_CMD_DATA, alloc_size);
+ /* The port task and iovec is allocated in the
+ same structure as an optimization. This
+ is especially important in erts_port_output_async
+ of when !try_call */
+ ASSERT(sigdp == NULL);
+ sigdp = erts_port_task_alloc_p2p_sig_data_extra(
+ alloc_size, (void**)&new_evp);
if (evp != &ev) {
+ /* Copy from TMP alloc to port task */
sys_memcpy((void *) new_evp, (void *) evp, alloc_size);
new_evp->iov = (SysIOVec *) (((char *) new_evp)
+ iov_offset);
@@ -2142,7 +2388,6 @@ erts_port_output(Process *c_p,
evp = new_evp;
}
- sigdp = erts_port_task_alloc_p2p_sig_data();
sigdp->flags = ERTS_P2P_SIG_TYPE_OUTPUTV;
sigdp->u.outputv.from = from;
sigdp->u.outputv.evp = evp;
@@ -2351,7 +2596,10 @@ call_deliver_port_exit(int bang_op,
return ERTS_PORT_OP_DROPPED;
}
- if (!erts_deliver_port_exit(prt, from, reason, bang_op))
+ if (IS_TRACED_FL(prt, F_TRACE_RECEIVE))
+ trace_port_receive(prt, from, am_close);
+
+ if (!erts_deliver_port_exit(prt, from, reason, bang_op, broken_link))
return ERTS_PORT_OP_DROPPED;
#ifdef USE_VM_PROBES
@@ -2422,13 +2670,13 @@ erts_port_exit(Process *c_p,
ERTS_PORT_SFLGS_INVALID_LOOKUP,
0,
!refp,
- am_exit);
+ am_close);
switch (try_imm_drv_call(&try_call_state)) {
case ERTS_TRY_IMM_DRV_CALL_OK: {
res = call_deliver_port_exit(flags & ERTS_PORT_SIG_FLG_BANG_OP,
- from,
+ c_p ? c_p->common.id : from,
prt,
try_call_state.state,
reason,
@@ -2507,8 +2755,11 @@ set_port_connected(int bang_op,
return ERTS_PORT_OP_DROPPED;
}
+ if (IS_TRACED_FL(prt, F_TRACE_RECEIVE))
+ trace_port_receive(prt, from, am_connect, connect);
+
ERTS_PORT_SET_CONNECTED(prt, connect);
- deliver_result(prt->common.id, from, am_connected);
+ deliver_result(prt, prt->common.id, from, am_connected);
#ifdef USE_VM_PROBES
if(DTRACE_ENABLED(port_command)) {
@@ -2530,10 +2781,22 @@ set_port_connected(int bang_op,
erts_add_link(&ERTS_P_LINKS(rp), LINK_PID, prt->common.id);
erts_add_link(&ERTS_P_LINKS(prt), LINK_PID, connect);
+ if (IS_TRACED_FL(rp, F_TRACE_PROCS))
+ trace_proc(NULL, 0, rp, am_getting_linked, prt->common.id);
+
ERTS_PORT_SET_CONNECTED(prt, connect);
erts_smp_proc_unlock(rp, ERTS_PROC_LOCK_LINK);
+ if (IS_TRACED_FL(prt, F_TRACE_PORTS))
+ trace_port(prt, am_getting_linked, connect);
+ if (IS_TRACED_FL(prt, F_TRACE_RECEIVE))
+ trace_port_receive(prt, from, am_connect, connect);
+ if (IS_TRACED_FL(prt, F_TRACE_SEND)) {
+ Eterm hp[3];
+ trace_port_send(prt, from, TUPLE2(hp, prt->common.id, am_connected), 1);
+ }
+
#ifdef USE_VM_PROBES
if (DTRACE_ENABLED(port_connect)) {
DTRACE_CHARBUF(process_str, DTRACE_TERM_BUF_SIZE);
@@ -2636,8 +2899,11 @@ static void
port_unlink(Port *prt, Eterm from)
{
ErtsLink *lnk = erts_remove_link(&ERTS_P_LINKS(prt), from);
- if (lnk)
+ if (lnk) {
+ if (IS_TRACED_FL(prt, F_TRACE_PORTS))
+ trace_port(prt, am_getting_unlinked, from);
erts_destroy_link(lnk);
+ }
}
static int
@@ -2707,10 +2973,10 @@ port_link_failure(Eterm port_id, Eterm linker)
NIL,
NULL,
0);
- if (xres >= 0 && IS_TRACED_FL(rp, F_TRACE_PROCS)) {
+ if (xres >= 0) {
/* We didn't exit the process and it is traced */
if (IS_TRACED_FL(rp, F_TRACE_PROCS))
- trace_proc(NULL, rp, am_getting_unlinked, port_id);
+ trace_proc(NULL, 0, rp, am_getting_unlinked, port_id);
}
if (rp_locks)
erts_smp_proc_unlock(rp, rp_locks);
@@ -2721,10 +2987,15 @@ port_link_failure(Eterm port_id, Eterm linker)
static void
port_link(Port *prt, erts_aint32_t state, Eterm to)
{
- if (!(state & ERTS_PORT_SFLGS_INVALID_LOOKUP))
+ if (IS_TRACED_FL(prt, F_TRACE_PORTS))
+ trace_port(prt, am_getting_linked, to);
+ if (!(state & ERTS_PORT_SFLGS_INVALID_LOOKUP)) {
erts_add_link(&ERTS_P_LINKS(prt), LINK_PID, to);
- else
+ } else {
port_link_failure(prt->common.id, to);
+ if (IS_TRACED_FL(prt, F_TRACE_PORTS))
+ trace_port(prt, am_unlink, to);
+ }
}
static int
@@ -2732,8 +3003,9 @@ port_sig_link(Port *prt, erts_aint32_t state, int op, ErtsProc2PortSigData *sigd
{
if (op == ERTS_PROC2PORT_SIG_EXEC)
port_link(prt, state, sigdp->u.link.to);
- else
+ else {
port_link_failure(sigdp->u.link.port, sigdp->u.link.to);
+ }
if (sigdp->flags & ERTS_P2P_SIG_DATA_FLG_REPLY)
port_sched_op_reply(sigdp->caller, sigdp->ref, am_true);
return ERTS_PORT_REDS_LINK;
@@ -3153,7 +3425,7 @@ static int read_linebuf(LineBufContext *bp)
}
static void
-deliver_result(Eterm sender, Eterm pid, Eterm res)
+deliver_result(Port *prt, Eterm sender, Eterm pid, Eterm res)
{
Process *rp;
ErtsProcLocks rp_locks = 0;
@@ -3161,12 +3433,22 @@ deliver_result(Eterm sender, Eterm pid, Eterm res)
ERTS_SMP_CHK_NO_PROC_LOCKS;
+ ASSERT(!prt || prt->common.id == sender);
+#ifdef ERTS_SMP
+ ASSERT(!prt || erts_lc_is_port_locked(prt));
+#endif
+
ASSERT(is_internal_port(sender) && is_internal_pid(pid));
rp = (scheduler
? erts_proc_lookup(pid)
: erts_pid2proc_opt(NULL, 0, pid, 0, ERTS_P2P_FLG_INC_REFC));
+ if (prt && IS_TRACED_FL(prt, F_TRACE_SEND)) {
+ Eterm hp[3];
+ trace_port_send(prt, pid, TUPLE2(hp, sender, res), !!rp);
+ }
+
if (rp) {
Eterm tuple;
ErtsMessage *mp;
@@ -3179,7 +3461,7 @@ deliver_result(Eterm sender, Eterm pid, Eterm res)
sz_res + 3, &hp, &ohp);
res = copy_struct(res, sz_res, &hp, ohp);
tuple = TUPLE2(hp, sender, res);
- erts_queue_message(rp, &rp_locks, mp, tuple, NIL);
+ erts_queue_message(rp, &rp_locks, mp, tuple);
if (rp_locks)
erts_smp_proc_unlock(rp, rp_locks);
@@ -3211,6 +3493,7 @@ static void deliver_read_message(Port* prt, erts_aint32_t state, Eterm to,
ErlOffHeap *ohp;
ErtsProcLocks rp_locks = 0;
int scheduler = erts_get_scheduler_id() != 0;
+ int trace_send = IS_TRACED_FL(prt, F_TRACE_SEND);
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(prt));
ERTS_SMP_CHK_NO_PROC_LOCKS;
@@ -3233,7 +3516,7 @@ static void deliver_read_message(Port* prt, erts_aint32_t state, Eterm to,
if (!rp)
return;
- mp = erts_alloc_message_heap(rp, &rp_locks, need, &hp, &ohp);
+ mp = erts_alloc_message_heap(trace_send ? NULL : rp, &rp_locks, need, &hp, &ohp);
listp = NIL;
if ((state & ERTS_PORT_SFLG_BINARY_IO) == 0) {
@@ -3275,7 +3558,11 @@ static void deliver_read_message(Port* prt, erts_aint32_t state, Eterm to,
tuple = TUPLE2(hp, prt->common.id, tuple);
hp += 3;
- erts_queue_message(rp, &rp_locks, mp, tuple, am_undefined);
+ if (trace_send)
+ trace_port_send(prt, to, tuple, 1);
+
+ ERL_MESSAGE_TOKEN(mp) = am_undefined;
+ erts_queue_message(rp, &rp_locks, mp, tuple);
if (rp_locks)
erts_smp_proc_unlock(rp, rp_locks);
if (!scheduler)
@@ -3354,6 +3641,7 @@ deliver_vec_message(Port* prt, /* Port */
ErtsProcLocks rp_locks = 0;
int scheduler = erts_get_scheduler_id() != 0;
erts_aint32_t state;
+ int trace_send = IS_TRACED_FL(prt, F_TRACE_SEND);
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(prt));
ERTS_SMP_CHK_NO_PROC_LOCKS;
@@ -3381,7 +3669,7 @@ deliver_vec_message(Port* prt, /* Port */
need += (hlen+csize)*2;
}
- mp = erts_alloc_message_heap(rp, &rp_locks, need, &hp, &ohp);
+ mp = erts_alloc_message_heap(trace_send ? NULL : rp, &rp_locks, need, &hp, &ohp);
listp = NIL;
iov += vsize;
@@ -3442,7 +3730,11 @@ deliver_vec_message(Port* prt, /* Port */
tuple = TUPLE2(hp, prt->common.id, tuple);
hp += 3;
- erts_queue_message(rp, &rp_locks, mp, tuple, am_undefined);
+ if (IS_TRACED_FL(prt, F_TRACE_SEND))
+ trace_port_send(prt, to, tuple, 1);
+
+ ERL_MESSAGE_TOKEN(mp) = am_undefined;
+ erts_queue_message(rp, &rp_locks, mp, tuple);
erts_smp_proc_unlock(rp, rp_locks);
if (!scheduler)
erts_proc_dec_refc(rp);
@@ -3489,6 +3781,17 @@ static void flush_port(Port *p)
DTRACE3(driver_flush, process_str, port_str, p->name);
}
#endif
+#ifdef USE_LTTNG_VM_TRACEPOINTS
+ if (LTTNG_ENABLED(driver_flush)) {
+ lttng_decl_portbuf(port_str);
+ lttng_decl_procbuf(proc_str);
+ lttng_pid_to_str(ERTS_PORT_GET_CONNECTED(p), proc_str);
+ lttng_port_to_str(p, port_str);
+ LTTNG3(driver_flush, proc_str, port_str, p->name);
+ }
+#endif
+
+
if (IS_TRACED_FL(p, F_TRACE_SCHED_PORTS)) {
trace_sched_ports_where(p, am_in, am_flush);
}
@@ -3520,6 +3823,7 @@ terminate_port(Port *prt)
Eterm connected_id = NIL /* Initialize to silence compiler */;
erts_driver_t *drv;
erts_aint32_t state;
+ ErtsPrtSD *psd;
ERTS_SMP_CHK_NO_PROC_LOCKS;
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(prt));
@@ -3551,6 +3855,16 @@ terminate_port(Port *prt)
DTRACE3(driver_stop, process_str, drv->name, port_str);
}
#endif
+#ifdef USE_LTTNG_VM_TRACEPOINTS
+ if (LTTNG_ENABLED(driver_stop)) {
+ lttng_decl_portbuf(port_str);
+ lttng_decl_procbuf(proc_str);
+ lttng_pid_to_str(connected_id, proc_str);
+ lttng_port_to_str(prt, port_str);
+ LTTNG3(driver_stop, proc_str, port_str, drv->name);
+ }
+#endif
+
(*drv->stop)((ErlDrvData)prt->drv_data);
erts_unblock_fpe(fpe_was_unmasked);
ERTS_MSACC_POP_STATE_M();
@@ -3560,6 +3874,11 @@ terminate_port(Port *prt)
ASSERT(!prt->xports);
#endif
}
+
+ if (is_internal_port(send_closed_port_id)
+ && IS_TRACED_FL(prt, F_TRACE_SEND))
+ trace_port_send(prt, connected_id, am_closed, 1);
+
if(drv->handle != NULL) {
erts_smp_rwmtx_rlock(&erts_driver_list_lock);
erts_ddll_decrement_port_count(drv->handle);
@@ -3573,8 +3892,9 @@ terminate_port(Port *prt)
erts_cleanup_port_data(prt);
- if (prt->psd)
- erts_free(ERTS_ALC_T_PRTSD, prt->psd);
+ psd = (ErtsPrtSD *) erts_smp_atomic_read_nob(&prt->psd);
+ if (psd)
+ erts_free(ERTS_ALC_T_PRTSD, psd);
ASSERT(prt->dist_entry == NULL);
@@ -3590,7 +3910,7 @@ terminate_port(Port *prt)
erts_flush_async_exit(erts_halt_code, "");
}
if (is_internal_port(send_closed_port_id))
- deliver_result(send_closed_port_id, connected_id, am_closed);
+ deliver_result(NULL, send_closed_port_id, connected_id, am_closed);
}
void
@@ -3623,7 +3943,7 @@ static void sweep_one_monitor(ErtsMonitor *mon, void *vpsc)
typedef struct {
- Eterm port;
+ Port *port;
Eterm reason;
} SweepContext;
@@ -3632,10 +3952,13 @@ static void sweep_one_link(ErtsLink *lnk, void *vpsc)
SweepContext *psc = vpsc;
DistEntry *dep;
Process *rp;
-
+ Eterm port_id = psc->port->common.id;
ASSERT(lnk->type == LINK_PID);
-
+
+ if (IS_TRACED_FL(psc->port, F_TRACE_PORTS))
+ trace_port(psc->port, am_unlink, lnk->pid);
+
if (is_external_pid(lnk->pid)) {
dep = external_pid_dist_entry(lnk->pid);
if(dep != erts_this_dist_entry) {
@@ -3648,9 +3971,9 @@ static void sweep_one_link(ErtsLink *lnk, void *vpsc)
case ERTS_DSIG_PREP_NOT_CONNECTED:
break;
case ERTS_DSIG_PREP_CONNECTED:
- erts_remove_dist_link(&dld, psc->port, lnk->pid, dep);
+ erts_remove_dist_link(&dld, port_id, lnk->pid, dep);
erts_destroy_dist_link(&dld);
- code = erts_dsig_send_exit(&dsd, psc->port, lnk->pid,
+ code = erts_dsig_send_exit(&dsd, port_id, lnk->pid,
psc->reason);
ASSERT(code == ERTS_DSIG_SEND_OK);
break;
@@ -3664,23 +3987,25 @@ static void sweep_one_link(ErtsLink *lnk, void *vpsc)
ASSERT(is_internal_pid(lnk->pid));
rp = erts_pid2proc(NULL, 0, lnk->pid, rp_locks);
if (rp) {
- ErtsLink *rlnk = erts_remove_link(&ERTS_P_LINKS(rp), psc->port);
+ ErtsLink *rlnk = erts_remove_link(&ERTS_P_LINKS(rp), port_id);
if (rlnk) {
int xres = erts_send_exit_signal(NULL,
- psc->port,
+ port_id,
rp,
&rp_locks,
psc->reason,
NIL,
NULL,
0);
- if (xres >= 0 && IS_TRACED_FL(rp, F_TRACE_PROCS)) {
+ if (xres >= 0) {
+ if (rp_locks & ERTS_PROC_LOCKS_XSIG_SEND) {
+ erts_smp_proc_unlock(rp, ERTS_PROC_LOCKS_XSIG_SEND);
+ rp_locks &= ~ERTS_PROC_LOCKS_XSIG_SEND;
+ }
/* We didn't exit the process and it is traced */
- if (IS_TRACED_FL(rp, F_TRACE_PROCS)) {
- trace_proc(NULL, rp, am_getting_unlinked,
- psc->port);
- }
+ if (IS_TRACED_FL(rp, F_TRACE_PROCS))
+ trace_proc(NULL, 0, rp, am_getting_unlinked, port_id);
}
erts_destroy_link(rlnk);
}
@@ -3702,7 +4027,8 @@ static void sweep_one_link(ErtsLink *lnk, void *vpsc)
*/
int
-erts_deliver_port_exit(Port *p, Eterm from, Eterm reason, int send_closed)
+erts_deliver_port_exit(Port *p, Eterm from, Eterm reason, int send_closed,
+ int drop_normal)
{
ErtsLink *lnk;
Eterm rreason;
@@ -3732,8 +4058,10 @@ erts_deliver_port_exit(Port *p, Eterm from, Eterm reason, int send_closed)
| ERTS_PORT_SFLG_CLOSING))
return 0;
- if (reason == am_normal && from != ERTS_PORT_GET_CONNECTED(p) && from != p->common.id)
+ if (reason == am_normal && from != ERTS_PORT_GET_CONNECTED(p)
+ && from != p->common.id && drop_normal) {
return 0;
+ }
set_state_flags = ERTS_PORT_SFLG_EXITING;
if (send_closed)
@@ -3744,9 +4072,8 @@ erts_deliver_port_exit(Port *p, Eterm from, Eterm reason, int send_closed)
state = erts_atomic32_read_bor_mb(&p->state, set_state_flags);
state |= set_state_flags;
- if (IS_TRACED_FL(p, F_TRACE_PORTS)) {
+ if (IS_TRACED_FL(p, F_TRACE_PORTS))
trace_port(p, am_closed, reason);
- }
erts_trace_check_exiting(p->common.id);
@@ -3756,7 +4083,7 @@ erts_deliver_port_exit(Port *p, Eterm from, Eterm reason, int send_closed)
(void) erts_unregister_name(NULL, 0, p, p->common.u.alive.reg->name);
{
- SweepContext sc = {p->common.id, rreason};
+ SweepContext sc = {p, rreason};
lnk = ERTS_P_LINKS(p);
ERTS_P_LINKS(p) = NULL;
erts_sweep_links(lnk, &sweep_one_link, &sc);
@@ -3878,9 +4205,22 @@ call_driver_control(Eterm caller,
command, size);
}
#endif
-
+
+ if (IS_TRACED_FL(prt, F_TRACE_RECEIVE))
+ trace_port_receive(prt, caller, am_control, command, bufp, size);
+
ERTS_MSACC_SET_STATE_CACHED_M(ERTS_MSACC_STATE_PORT);
+#ifdef USE_LTTNG_VM_TRACEPOINTS
+ if (LTTNG_ENABLED(driver_control)) {
+ lttng_decl_procbuf(proc_str);
+ lttng_decl_portbuf(port_str);
+ lttng_pid_to_str(caller, proc_str);
+ lttng_port_to_str(prt, port_str);
+ LTTNG5(driver_control, proc_str, port_str, prt->name, command, size);
+ }
+#endif
+
prt->caller = caller;
cres = prt->drv_ptr->control((ErlDrvData) prt->drv_data,
command,
@@ -3895,6 +4235,9 @@ call_driver_control(Eterm caller,
if (cres < 0)
return ERTS_PORT_OP_BADARG;
+ if (IS_TRACED_FL(prt, F_TRACE_SEND))
+ trace_port_send_binary(prt, caller, am_control, *resp_bufp, cres);
+
*from_size = (ErlDrvSizeT) cres;
return ERTS_PORT_OP_DONE;
@@ -4294,6 +4637,18 @@ call_driver_call(Eterm caller,
DTRACE5(driver_call, process_str, port_str, prt->name, command, size);
}
#endif
+#ifdef USE_LTTNG_VM_TRACEPOINTS
+ if (LTTNG_ENABLED(driver_call)) {
+ lttng_decl_procbuf(proc_str);
+ lttng_decl_portbuf(port_str);
+ lttng_pid_to_str(caller,proc_str);
+ lttng_port_to_str(prt, port_str);
+ LTTNG5(driver_call, proc_str, port_str, prt->name, command, size);
+ }
+#endif
+
+ if (IS_TRACED_FL(prt, F_TRACE_RECEIVE))
+ trace_port_receive(prt, caller, am_call, command, bufp, size);
ERTS_MSACC_SET_STATE_CACHED_M(ERTS_MSACC_STATE_PORT);
@@ -4313,6 +4668,9 @@ call_driver_call(Eterm caller,
|| ((byte) (*resp_bufp)[0]) != VERSION_MAGIC)
return ERTS_PORT_OP_BADARG;
+ if (IS_TRACED_FL(prt, F_TRACE_SEND))
+ trace_port_send_binary(prt, caller, am_call, *resp_bufp, cres);
+
*from_size = (ErlDrvSizeT) cres;
return ERTS_PORT_OP_DONE;
@@ -4373,7 +4731,7 @@ port_sig_call(Port *prt,
(void) erts_factory_message_create(&factory, rp, &rp_locks, hsz);
endp = (byte *) resp_bufp;
- msg = erts_decode_ext(&factory, &endp);
+ msg = erts_decode_ext(&factory, &endp, 0);
if (is_value(msg)) {
hp = erts_produce_heap(&factory,
3,
@@ -4492,7 +4850,7 @@ erts_port_call(Process* c_p,
hsz += 3;
erts_factory_proc_prealloc_init(&factory, c_p, hsz);
endp = (byte *) resp_bufp;
- term = erts_decode_ext(&factory, &endp);
+ term = erts_decode_ext(&factory, &endp, 0);
if (term == THE_NON_VALUE)
return ERTS_PORT_OP_BADARG;
hp = erts_produce_heap(&factory,3,0);
@@ -4756,7 +5114,8 @@ reply_io_bytes(void *vreq)
eout = erts_bld_uint64(&hp, NULL, out);
msg = TUPLE4(hp, ref, make_small(sched_id), ein, eout);
- erts_queue_message(rp, &rp_locks, mp, msg, NIL);
+
+ erts_queue_message(rp, &rp_locks, mp, msg);
if (req->sched_id == sched_id)
rp_locks &= ~ERTS_PROC_LOCK_MAIN;
@@ -5056,6 +5415,15 @@ int async_ready(Port *p, void* data)
DTRACE3(driver_ready_async, process_str, port_str, p->name);
}
#endif
+#ifdef USE_LTTNG_VM_TRACEPOINTS
+ if (LTTNG_ENABLED(driver_ready_async)) {
+ lttng_decl_portbuf(port_str);
+ lttng_decl_procbuf(proc_str);
+ lttng_pid_to_str(ERTS_PORT_GET_CONNECTED(p), proc_str);
+ lttng_port_to_str(p, port_str);
+ LTTNG3(driver_ready_async, proc_str, port_str, p->name);
+ }
+#endif
(*p->drv_ptr->ready_async)((ErlDrvData)p->drv_data, data);
need_free = 0;
ERTS_MSACC_POP_STATE_M();
@@ -5218,6 +5586,7 @@ void driver_report_exit(ErlDrvPort ix, int status)
ErtsProcLocks rp_locks = 0;
int scheduler = erts_get_scheduler_id() != 0;
Port* prt = erts_drvport2port(ix);
+ int trace_send = IS_TRACED_FL(prt, F_TRACE_SEND);
if (prt == ERTS_INVALID_ERL_DRV_PORT)
return;
@@ -5234,13 +5603,17 @@ void driver_report_exit(ErlDrvPort ix, int status)
if (!rp)
return;
- mp = erts_alloc_message_heap(rp, &rp_locks, 3+3, &hp, &ohp);
+ mp = erts_alloc_message_heap(trace_send ? NULL : rp, &rp_locks, 3+3, &hp, &ohp);
tuple = TUPLE2(hp, am_exit_status, make_small(status));
hp += 3;
tuple = TUPLE2(hp, prt->common.id, tuple);
- erts_queue_message(rp, &rp_locks, mp, tuple, am_undefined);
+ if (IS_TRACED_FL(prt, F_TRACE_SEND))
+ trace_port_send(prt, pid, tuple, 1);
+
+ ERL_MESSAGE_TOKEN(mp) = am_undefined;
+ erts_queue_message(rp, &rp_locks, mp, tuple);
erts_smp_proc_unlock(rp, rp_locks);
if (!scheduler)
@@ -5334,13 +5707,13 @@ cleanup_b2t_states(struct b2t_states__ *b2tsp)
*/
static int
-driver_deliver_term(Eterm to, ErlDrvTermData* data, int len)
+driver_deliver_term(Port *prt, Eterm to, ErlDrvTermData* data, int len)
{
#define HEAP_EXTRA 200
#define ERTS_DDT_FAIL do { res = -1; goto done; } while (0)
Uint need = 0;
int depth = 0;
- int res;
+ int res = 0;
ErlDrvTermData* ptr;
ErlDrvTermData* ptr_end;
DECLARE_ESTACK(stack);
@@ -5559,11 +5932,26 @@ driver_deliver_term(Eterm to, ErlDrvTermData* data, int len)
? erts_proc_lookup(to)
: erts_pid2proc_opt(NULL, 0, to, 0, ERTS_P2P_FLG_INC_REFC));
if (!rp) {
- res = 0;
- goto done;
- }
+ if (!prt || !IS_TRACED_FL(prt, F_TRACE_SEND))
+ goto done;
+ if (!erts_is_tracer_proc_enabled(NULL, 0, &prt->common, am_send))
+ goto done;
- (void) erts_factory_message_create(&factory, rp, &rp_locks, need);
+ res = -2;
+
+ /* We allocate a temporary heap to be used to create
+ the message that may be sent using tracing */
+ erts_factory_tmp_init(&factory, erts_alloc(ERTS_ALC_T_DRIVER, need*sizeof(Eterm)),
+ need, ERTS_ALC_T_DRIVER);
+
+ } else {
+ /* We force the creation of a heap fragment (rp == NULL) when send
+ tracing so that we don't have the main lock of the process while
+ tracing */
+ Process *trace_rp = prt && IS_TRACED_FL(prt, F_TRACE_SEND) ? NULL : rp;
+ (void) erts_factory_message_create(&factory, trace_rp, &rp_locks, need);
+ res = 1;
+ }
/*
* Interpret the instructions and build the term.
@@ -5826,22 +6214,40 @@ driver_deliver_term(Eterm to, ErlDrvTermData* data, int len)
ESTACK_PUSH(stack, mess);
}
- res = 1;
-
done:
if (res > 0) {
mess = ESTACK_POP(stack); /* get resulting value */
erts_factory_trim_and_close(&factory, &mess, 1);
+
+ if (prt && IS_TRACED_FL(prt, F_TRACE_SEND))
+ trace_port_send(prt, to, mess, 1);
+
/* send message */
- erts_queue_message(rp, &rp_locks, factory.message, mess, am_undefined);
+ ERL_MESSAGE_TOKEN(factory.message) = am_undefined;
+ erts_queue_message(rp, &rp_locks, factory.message, mess);
+ }
+ else if (res == -2) {
+ /* this clause only happens when we were requested to
+ generate a send trace, but the process to send to
+ did not exist any more */
+ mess = ESTACK_POP(stack); /* get resulting value */
+
+ trace_port_send(prt, to, mess, 0);
+
+ erts_factory_trim_and_close(&factory, &mess, 1);
+ erts_free(ERTS_ALC_T_DRIVER, factory.hp_start);
+ res = 0;
}
else {
if (b2t.ix > b2t.used)
b2t.used = b2t.ix;
for (b2t.ix = 0; b2t.ix < b2t.used; b2t.ix++)
erts_binary2term_abort(&b2t.state[b2t.ix]);
- erts_factory_undo(&factory);
+ if (factory.mode != FACTORY_CLOSED) {
+ ERL_MESSAGE_TERM(factory.message) = am_undefined;
+ erts_factory_undo(&factory);
+ }
}
if (rp) {
if (rp_locks)
@@ -5857,7 +6263,8 @@ driver_deliver_term(Eterm to, ErlDrvTermData* data, int len)
}
static ERTS_INLINE int
-deliver_term_check_port(ErlDrvTermData port_id, Eterm *connected_p)
+deliver_term_check_port(ErlDrvTermData port_id, Eterm *connected_p,
+ Port **trace_prt)
{
#ifdef ERTS_SMP
ErtsThrPrgrDelayHandle dhndl = erts_thr_progress_unmanaged_delay();
@@ -5885,8 +6292,11 @@ deliver_term_check_port(ErlDrvTermData port_id, Eterm *connected_p)
if (dhndl != ERTS_THR_PRGR_DHANDLE_MANAGED) {
erts_thr_progress_unmanaged_continue(dhndl);
ETHR_MEMBAR(ETHR_LoadLoad|ETHR_LoadStore);
- }
+ } else
#endif
+ {
+ *trace_prt = prt;
+ }
ERTS_SMP_LC_ASSERT(dhndl == ERTS_THR_PRGR_DHANDLE_MANAGED
? erts_lc_is_port_locked(prt)
: !erts_lc_is_port_locked(prt));
@@ -5897,10 +6307,11 @@ int erl_drv_output_term(ErlDrvTermData port_id, ErlDrvTermData* data, int len)
{
/* May be called from arbitrary thread */
Eterm connected;
- int res = deliver_term_check_port(port_id, &connected);
+ Port *prt = NULL;
+ int res = deliver_term_check_port(port_id, &connected, &prt);
if (res <= 0)
return res;
- return driver_deliver_term(connected, data, len);
+ return driver_deliver_term(prt, connected, data, len);
}
/*
@@ -5924,7 +6335,7 @@ driver_output_term(ErlDrvPort drvport, ErlDrvTermData* data, int len)
if (state & ERTS_PORT_SFLG_CLOSING)
return 0;
- return driver_deliver_term(ERTS_PORT_GET_CONNECTED(prt), data, len);
+ return driver_deliver_term(prt, ERTS_PORT_GET_CONNECTED(prt), data, len);
}
int erl_drv_send_term(ErlDrvTermData port_id,
@@ -5933,10 +6344,11 @@ int erl_drv_send_term(ErlDrvTermData port_id,
int len)
{
/* May be called from arbitrary thread */
- int res = deliver_term_check_port(port_id, NULL);
+ Port *prt = NULL;
+ int res = deliver_term_check_port(port_id, NULL, &prt);
if (res <= 0)
return res;
- return driver_deliver_term(to, data, len);
+ return driver_deliver_term(prt, to, data, len);
}
/*
@@ -5955,20 +6367,21 @@ driver_send_term(ErlDrvPort drvport,
* to make this access safe without using a less efficient
* internal data representation for ErlDrvPort.
*/
+ Port* prt = NULL;
ERTS_SMP_CHK_NO_PROC_LOCKS;
#ifdef ERTS_SMP
if (erts_thr_progress_is_managed_thread())
#endif
{
erts_aint32_t state;
- Port* prt = erts_drvport2port_state(drvport, &state);
+ prt = erts_drvport2port_state(drvport, &state);
if (prt == ERTS_INVALID_ERL_DRV_PORT)
return -1; /* invalid (dead) */
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(prt));
if (state & ERTS_PORT_SFLG_CLOSING)
return 0;
}
- return driver_deliver_term(to, data, len);
+ return driver_deliver_term(prt, to, data, len);
}
@@ -7102,6 +7515,15 @@ void erts_fire_port_monitor(Port *prt, Eterm ref)
DTRACE3(driver_process_exit, process_str, port_str, prt->name);
}
#endif
+#ifdef USE_LTTNG_VM_TRACEPOINTS
+ if (LTTNG_ENABLED(driver_process_exit)) {
+ lttng_decl_portbuf(port_str);
+ lttng_decl_procbuf(proc_str);
+ lttng_pid_to_str(ERTS_PORT_GET_CONNECTED(prt), proc_str);
+ lttng_port_to_str(prt, port_str);
+ LTTNG3(driver_process_exit, proc_str, port_str, prt->name);
+ }
+#endif
fpe_was_unmasked = erts_block_fpe();
(*callback)((ErlDrvData) (prt->drv_data), &drv_monitor);
erts_unblock_fpe(fpe_was_unmasked);
@@ -7135,7 +7557,7 @@ driver_failure_term(ErlDrvPort ix, Eterm term, int eof)
if (state & ERTS_PORT_SFLG_CLOSING) {
terminate_port(prt);
} else if (eof && (state & ERTS_PORT_SFLG_SOFT_EOF)) {
- deliver_result(prt->common.id, ERTS_PORT_GET_CONNECTED(prt), am_eof);
+ deliver_result(prt, prt->common.id, ERTS_PORT_GET_CONNECTED(prt), am_eof);
} else {
/* XXX UGLY WORK AROUND, Let erts_deliver_port_exit() terminate the port */
if (prt->port_data_lock)
@@ -7143,7 +7565,7 @@ driver_failure_term(ErlDrvPort ix, Eterm term, int eof)
prt->ioq.size = 0;
if (prt->port_data_lock)
driver_pdl_unlock(prt->port_data_lock);
- erts_deliver_port_exit(prt, prt->common.id, eof ? am_normal : term, 0);
+ erts_deliver_port_exit(prt, prt->common.id, eof ? am_normal : term, 0, 0);
}
return 0;
}
@@ -7579,6 +8001,8 @@ init_driver(erts_driver_t *drv, ErlDrvEntry *de, DE_Handle *handle)
int fpe_was_unmasked = erts_block_fpe();
DTRACE4(driver_init, drv->name, drv->version.major, drv->version.minor,
drv->flags);
+ LTTNG4(driver_init, drv->name, drv->version.major, drv->version.minor,
+ drv->flags);
res = (*de->init)();
erts_unblock_fpe(fpe_was_unmasked);
return res;
diff --git a/erts/emulator/beam/lttng-wrapper.h b/erts/emulator/beam/lttng-wrapper.h
new file mode 100644
index 0000000000..294872c365
--- /dev/null
+++ b/erts/emulator/beam/lttng-wrapper.h
@@ -0,0 +1,107 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+#ifndef __LTTNG_WRAPPER_H__
+#define __LTTNG_WRAPPER_H__
+
+#ifdef USE_LTTNG
+
+#include "erlang_lttng.h"
+#define USE_LTTNG_VM_TRACEPOINTS
+
+#define LTTNG_BUFFER_SZ (256)
+#define LTTNG_PROC_BUFFER_SZ (16)
+#define LTTNG_PORT_BUFFER_SZ (20)
+#define LTTNG_MFA_BUFFER_SZ (256)
+
+#define lttng_decl_procbuf(Name) \
+ char Name[LTTNG_PROC_BUFFER_SZ]
+
+#define lttng_decl_portbuf(Name) \
+ char Name[LTTNG_PORT_BUFFER_SZ]
+
+#define lttng_decl_mfabuf(Name) \
+ char Name[LTTNG_MFA_BUFFER_SZ]
+
+#define lttng_decl_carrier_stats(Name) \
+ lttng_carrier_stats_t Name##_STATSTRUCT, *Name = &Name##_STATSTRUCT
+
+#define lttng_pid_to_str(pid, name) \
+ erts_snprintf(name, LTTNG_PROC_BUFFER_SZ, "%T", (pid))
+
+#define lttng_portid_to_str(pid, name) \
+ erts_snprintf(name, LTTNG_PORT_BUFFER_SZ, "%T", (pid))
+
+#define lttng_proc_to_str(p, name) \
+ lttng_pid_to_str(((p) ? (p)->common.id : ERTS_INVALID_PID), name)
+
+#define lttng_port_to_str(p, name) \
+ lttng_portid_to_str(((p) ? (p)->common.id : ERTS_INVALID_PORT), name)
+
+#define lttng_mfa_to_str(m,f,a, Name) \
+ erts_snprintf(Name, LTTNG_MFA_BUFFER_SZ, "%T:%T/%lu", (Eterm)(m), (Eterm)(f), (Uint)(a))
+
+#define lttng_proc_to_mfa_str(p, Name) \
+ do { \
+ if (ERTS_PROC_IS_EXITING((p))) { \
+ strcpy(Name, "<exiting>"); \
+ } else { \
+ BeamInstr *_fptr = find_function_from_pc((p)->i); \
+ if (_fptr) { \
+ lttng_mfa_to_str(_fptr[0],_fptr[1],_fptr[2], Name); \
+ } else { \
+ strcpy(Name, "<unknown>"); \
+ } \
+ } \
+ } while(0)
+
+/* ErtsRunQueue->ErtsSchedulerData->Uint */
+#define lttng_rq_to_id(RQ) \
+ (RQ)->scheduler->no
+
+#define LTTNG_ENABLED(Name) \
+ tracepoint_enabled(com_ericsson_otp, Name)
+
+/* include a special LTTNG_DO for do_tracepoint ? */
+#define LTTNG1(Name, Arg1) \
+ tracepoint(com_ericsson_otp, Name, (Arg1))
+
+#define LTTNG2(Name, Arg1, Arg2) \
+ tracepoint(com_ericsson_otp, Name, (Arg1), (Arg2))
+
+#define LTTNG3(Name, Arg1, Arg2, Arg3) \
+ tracepoint(com_ericsson_otp, Name, (Arg1), (Arg2), (Arg3))
+
+#define LTTNG4(Name, Arg1, Arg2, Arg3, Arg4) \
+ tracepoint(com_ericsson_otp, Name, (Arg1), (Arg2), (Arg3), (Arg4))
+
+#define LTTNG5(Name, Arg1, Arg2, Arg3, Arg4, Arg5) \
+ tracepoint(com_ericsson_otp, Name, (Arg1), (Arg2), (Arg3), (Arg4), (Arg5))
+
+#else /* USE_LTTNG */
+
+#define LTTNG1(Name, Arg1) do {} while(0)
+#define LTTNG2(Name, Arg1, Arg2) do {} while(0)
+#define LTTNG3(Name, Arg1, Arg2, Arg3) do {} while(0)
+#define LTTNG4(Name, Arg1, Arg2, Arg3, Arg4) do {} while(0)
+#define LTTNG5(Name, Arg1, Arg2, Arg3, Arg4, Arg5) do {} while(0)
+
+#endif /* USE_LTTNG */
+#endif /* __LTTNG_WRAPPER_H__ */
diff --git a/erts/emulator/beam/module.c b/erts/emulator/beam/module.c
index f5c7b177d3..3eb11f1693 100644
--- a/erts/emulator/beam/module.c
+++ b/erts/emulator/beam/module.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/module.h b/erts/emulator/beam/module.h
index b7468b0926..4e12731d85 100644
--- a/erts/emulator/beam/module.h
+++ b/erts/emulator/beam/module.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab
index 9e53b4bfcc..879daaca0a 100644
--- a/erts/emulator/beam/ops.tab
+++ b/erts/emulator/beam/ops.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2013. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -181,11 +181,6 @@ i_jump_on_val_zero y f I
i_jump_on_val x f I I
i_jump_on_val y f I I
-jump Target | label Lbl | same_label(Target, Lbl) => label Lbl
-
-is_ne_exact L1 S1 S2 | jump Fail | label L2 | same_label(L1, L2) => \
- is_eq_exact Fail S1 S2 | label L2
-
%macro: get_list GetList -pack
get_list x x x
get_list x x y
@@ -234,6 +229,9 @@ i_get_tuple_element y P y
%macro: i_get_tuple_element2 GetTupleElement2 -pack
i_get_tuple_element2 x P x
+%macro: i_get_tuple_element2y GetTupleElement2Y -pack
+i_get_tuple_element2y x P y y
+
%macro: i_get_tuple_element3 GetTupleElement3 -pack
i_get_tuple_element3 x P x
@@ -256,7 +254,14 @@ case_end x
badmatch x
if_end
-raise s s
+
+# Operands for raise/2 are almost always in x(2) and x(1).
+# Optimize for that case.
+raise x==2 x==1 => i_raise
+raise Trace=y Value=y => move Trace x=2 | move Value x=1 | i_raise
+raise Trace Value => move Trace x=3 | move Value x=1 | move x=3 x=2 | i_raise
+
+i_raise
# Internal now, but could be useful to make known to the compiler.
badarg j
@@ -303,7 +308,7 @@ move_window5 x x x x x y
# Swap registers.
move R1=x Tmp=x | move R2=xy R1 | move Tmp R2 => swap_temp R1 R2 Tmp
-swap_temp R1 R2 Tmp | line Loc | apply Live | is_killed(Tmp, Live) => \
+swap_temp R1 R2 Tmp | line Loc | apply Live | is_killed_apply(Tmp, Live) => \
swap R1 R2 | line Loc | apply Live
swap_temp R1 R2 Tmp | line Loc | call Live Addr | is_killed(Tmp, Live) => \
@@ -527,9 +532,9 @@ i_put_tuple x I
i_put_tuple y I
#
-# The instruction "put_list Const [] Dst" will not be generated by
-# the current BEAM compiler. But until R15A, play it safe by handling
-# that instruction with the following transformation.
+# The instruction "put_list Const [] Dst" were generated in rare
+# circumstances up to and including OTP 18. Starting with OTP 19,
+# AFAIK, it should never be generated.
#
put_list Const=c n Dst => move Const x | put_list x n Dst
@@ -647,6 +652,9 @@ get_tuple_element Reg=x P1 D1=x | get_tuple_element Reg=x P2 D2=x | \
get_tuple_element Reg=x P1 D1=x | get_tuple_element Reg=x P2 D2=x | \
succ(P1, P2) | succ(D1, D2) => i_get_tuple_element2 Reg P1 D1
+get_tuple_element Reg=x P1 D1=y | get_tuple_element Reg=x P2 D2=y | \
+ succ(P1, P2) => i_get_tuple_element2y Reg P1 D1 D2
+
get_tuple_element Reg P Dst => i_get_tuple_element Reg P Dst
is_integer Fail=f i =>
@@ -1355,9 +1363,7 @@ bs_put_utf8 Fail u Src=s => i_bs_put_utf8 Fail Src
i_bs_put_utf8 j s
-bs_put_utf16 Fail Flags=u Src=s => i_bs_put_utf16 Fail Flags Src
-
-i_bs_put_utf16 j I s
+bs_put_utf16 j I s
bs_put_utf32 Fail=j Flags=u Src=s => \
i_bs_validate_unicode Fail Src | bs_put_integer Fail i=32 u=1 Flags Src
@@ -1539,7 +1545,6 @@ gen_minus p Live Reg=d Int=i Dst | negation_is_small(Int) => \
# GCing arithmetic instructions.
#
-gen_plus Fail Live Y=y X=x Dst => i_plus Fail Live X Y Dst
gen_plus Fail Live S1 S2 Dst => i_plus Fail Live S1 S2 Dst
gen_minus Fail Live S1 S2 Dst => i_minus Fail Live S1 S2 Dst
diff --git a/erts/emulator/beam/packet_parser.c b/erts/emulator/beam/packet_parser.c
index a737a86f14..f14910bc72 100644
--- a/erts/emulator/beam/packet_parser.c
+++ b/erts/emulator/beam/packet_parser.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/packet_parser.h b/erts/emulator/beam/packet_parser.h
index 717d905fad..358d650804 100644
--- a/erts/emulator/beam/packet_parser.h
+++ b/erts/emulator/beam/packet_parser.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/register.c b/erts/emulator/beam/register.c
index ebc35b0c4d..77f79fcea4 100644
--- a/erts/emulator/beam/register.c
+++ b/erts/emulator/beam/register.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -226,7 +226,8 @@ int erts_register_name(Process *c_p, Eterm name, Eterm id)
rp = (RegProc*) hash_put(&process_reg, (void*) &r);
if (proc && rp->p == proc) {
if (IS_TRACED_FL(proc, F_TRACE_PROCS)) {
- trace_proc(c_p, proc, am_register, name);
+ trace_proc(proc, ERTS_PROC_LOCK_MAIN,
+ proc, am_register, name);
}
proc->common.u.alive.reg = rp;
}
@@ -470,8 +471,8 @@ int erts_unregister_name(Process *c_p,
int res = 0;
RegProc r, *rp;
Port *port = c_prt;
+ ErtsProcLocks current_c_p_locks = 0;
#ifdef ERTS_SMP
- ErtsProcLocks current_c_p_locks;
/*
* SMP note: If 'c_prt != NULL' and 'c_prt->reg->name == name',
@@ -537,8 +538,12 @@ int erts_unregister_name(Process *c_p,
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(port));
rp->pt->common.u.alive.reg = NULL;
-
+
if (IS_TRACED_FL(port, F_TRACE_PORTS)) {
+ if (current_c_p_locks) {
+ erts_smp_proc_unlock(c_p, current_c_p_locks);
+ current_c_p_locks = 0;
+ }
trace_port(port, am_unregister, r.name);
}
@@ -555,7 +560,8 @@ int erts_unregister_name(Process *c_p,
#endif
rp->p->common.u.alive.reg = NULL;
if (IS_TRACED_FL(rp->p, F_TRACE_PROCS)) {
- trace_proc(c_p, rp->p, am_unregister, r.name);
+ trace_proc(rp->p, (c_p == rp->p) ? c_p_locks : ERTS_PROC_LOCK_MAIN,
+ rp->p, am_unregister, r.name);
}
#ifdef ERTS_SMP
if (rp->p != c_p) {
diff --git a/erts/emulator/beam/register.h b/erts/emulator/beam/register.h
index 144536f34b..88ab7b7bf1 100644
--- a/erts/emulator/beam/register.h
+++ b/erts/emulator/beam/register.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2012. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/safe_hash.c b/erts/emulator/beam/safe_hash.c
index 3f039c8dfd..30b26a7296 100644
--- a/erts/emulator/beam/safe_hash.c
+++ b/erts/emulator/beam/safe_hash.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/safe_hash.h b/erts/emulator/beam/safe_hash.h
index a11370813c..6910b33004 100644
--- a/erts/emulator/beam/safe_hash.h
+++ b/erts/emulator/beam/safe_hash.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h
index 03b9088adc..748fba15c7 100644
--- a/erts/emulator/beam/sys.h
+++ b/erts/emulator/beam/sys.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -138,10 +138,10 @@ typedef ERTS_SYS_FD_TYPE ErtsSysFdType;
#endif
#if ERTS_AT_LEAST_GCC_VSN__(2, 96, 0)
-#ifndef __llvm__
-# define ERTS_WRITE_UNLIKELY(X) X __attribute__ ((section ("ERTS_LOW_WRITE") ))
-#else
+#if (defined(__APPLE__) && defined(__MACH__)) || defined(__DARWIN__)
# define ERTS_WRITE_UNLIKELY(X) X __attribute__ ((section ("__DATA,ERTS_LOW_WRITE") ))
+#else
+# define ERTS_WRITE_UNLIKELY(X) X __attribute__ ((section ("ERTS_LOW_WRITE") ))
#endif
#else
# define ERTS_WRITE_UNLIKELY(X) X
@@ -644,6 +644,15 @@ typedef struct preload {
unsigned char* code; /* Code pointer */
} Preload;
+/*
+ * ErtsTracer is either NIL, 'true' or [Mod | State]
+ *
+ * If set to NIL, it means no tracer.
+ * If set to 'true' it means the current process' tracer.
+ * If set to [Mod | State], there is a tracer.
+ * See erts_tracer_update for more details
+ */
+typedef Eterm ErtsTracer;
/*
* This structure contains options to all built in drivers.
diff --git a/erts/emulator/beam/time.c b/erts/emulator/beam/time.c
index 0ce4f443f3..6f15082130 100644
--- a/erts/emulator/beam/time.c
+++ b/erts/emulator/beam/time.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c
index 66fcfcf6ce..68006e7ef3 100644
--- a/erts/emulator/beam/utils.c
+++ b/erts/emulator/beam/utils.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -71,41 +71,6 @@
#define HAVE_MALLOPT 0
#endif
-/* profile_scheduler mini message queue */
-
-typedef struct {
- Uint scheduler_id;
- Uint no_schedulers;
- Uint Ms;
- Uint s;
- Uint us;
- Eterm state;
-} profile_sched_msg;
-
-typedef struct {
- profile_sched_msg msg[2];
- Uint n;
-} profile_sched_msg_q;
-
-#ifdef ERTS_SMP
-
-#if 0 /* Unused */
-static void
-dispatch_profile_msg_q(profile_sched_msg_q *psmq)
-{
- int i = 0;
- profile_sched_msg *msg = NULL;
- ASSERT(psmq != NULL);
- for (i = 0; i < psmq->n; i++) {
- msg = &(psmq->msg[i]);
- profile_scheduler_q(make_small(msg->scheduler_id), msg->state, am_undefined, msg->Ms, msg->s, msg->us);
- }
-}
-#endif
-
-#endif
-
-
Eterm*
erts_heap_alloc(Process* p, Uint need, Uint xtra)
{
@@ -2298,7 +2263,7 @@ static void do_send_logger_message(Eterm *hp, ErlOffHeap *ohp, ErlHeapFragment *
{
ErtsMessage *mp = erts_alloc_message(0, NULL);
mp->data.heap_frag = bp;
- erts_queue_message(p, NULL /* only used for smp build */, mp, message, NIL);
+ erts_queue_message(p, NULL /* only used for smp build */, mp, message);
}
#endif
}
diff --git a/erts/emulator/beam/version.h b/erts/emulator/beam/version.h
index 004725eaf5..0fa775fe8c 100644
--- a/erts/emulator/beam/version.h
+++ b/erts/emulator/beam/version.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/drivers/common/efile_drv.c b/erts/emulator/drivers/common/efile_drv.c
index 3088dfd572..3adb8db661 100644
--- a/erts/emulator/drivers/common/efile_drv.c
+++ b/erts/emulator/drivers/common/efile_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -2900,12 +2900,12 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
d = EF_SAFE_ALLOC(sizeof(struct t_data) - 1
+ FILENAME_BYTELEN(buf + 9*4) + FILENAME_CHARSIZE);
- d->info.mode = get_int32(buf + 0 * 4);
- d->info.uid = get_int32(buf + 1 * 4);
- d->info.gid = get_int32(buf + 2 * 4);
- d->info.accessTime = (time_t)((Sint64)get_int64(buf + 3 * 4));
- d->info.modifyTime = (time_t)((Sint64)get_int64(buf + 5 * 4));
- d->info.cTime = (time_t)((Sint64)get_int64(buf + 7 * 4));
+ d->info.mode = get_int32(buf + 0 * 4);
+ d->info.uid = get_int32(buf + 1 * 4);
+ d->info.gid = get_int32(buf + 2 * 4);
+ d->info.accessTime = get_int64(buf + 3 * 4);
+ d->info.modifyTime = get_int64(buf + 5 * 4);
+ d->info.cTime = get_int64(buf + 7 * 4);
FILENAME_COPY(d->b, buf + 9*4);
#ifdef USE_VM_PROBES
diff --git a/erts/emulator/drivers/common/erl_efile.h b/erts/emulator/drivers/common/erl_efile.h
index be5a891486..b7f063b4f2 100644
--- a/erts/emulator/drivers/common/erl_efile.h
+++ b/erts/emulator/drivers/common/erl_efile.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -105,9 +105,9 @@ typedef struct _Efile_info {
Uint32 inode; /* Inode number. */
Uint32 uid; /* User id of owner. */
Uint32 gid; /* Group id of owner. */
- time_t accessTime; /* Last time the file was accessed. */
- time_t modifyTime; /* Last time the file was modified. */
- time_t cTime; /* Creation time (Windows) or last
+ Sint64 accessTime; /* Last time the file was accessed. */
+ Sint64 modifyTime; /* Last time the file was modified. */
+ Sint64 cTime; /* Creation time (Windows) or last
* inode change (Unix).
*/
} Efile_info;
diff --git a/erts/emulator/drivers/common/gzio.h b/erts/emulator/drivers/common/gzio.h
index a6fe2fb6f5..ee0ebe7bd8 100644
--- a/erts/emulator/drivers/common/gzio.h
+++ b/erts/emulator/drivers/common/gzio.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/drivers/common/gzio_zutil.h b/erts/emulator/drivers/common/gzio_zutil.h
index 9eefb86637..b229ae4efd 100644
--- a/erts/emulator/drivers/common/gzio_zutil.h
+++ b/erts/emulator/drivers/common/gzio_zutil.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c
index b219669ce5..e87d141ddb 100644
--- a/erts/emulator/drivers/common/inet_drv.c
+++ b/erts/emulator/drivers/common/inet_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2015. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/drivers/common/ram_file_drv.c b/erts/emulator/drivers/common/ram_file_drv.c
index 9cb44d0b7e..bcdfe6a186 100644
--- a/erts/emulator/drivers/common/ram_file_drv.c
+++ b/erts/emulator/drivers/common/ram_file_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/drivers/common/zlib_drv.c b/erts/emulator/drivers/common/zlib_drv.c
index 364048174c..440ba956d8 100644
--- a/erts/emulator/drivers/common/zlib_drv.c
+++ b/erts/emulator/drivers/common/zlib_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/drivers/unix/bin_drv.c b/erts/emulator/drivers/unix/bin_drv.c
index 21fb398907..4b633bb0cf 100644
--- a/erts/emulator/drivers/unix/bin_drv.c
+++ b/erts/emulator/drivers/unix/bin_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/drivers/unix/multi_drv.c b/erts/emulator/drivers/unix/multi_drv.c
index 7f8c2d9a0d..eddc57d4d4 100644
--- a/erts/emulator/drivers/unix/multi_drv.c
+++ b/erts/emulator/drivers/unix/multi_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/drivers/unix/sig_drv.c b/erts/emulator/drivers/unix/sig_drv.c
index e6f2ecc494..68ad6b9156 100644
--- a/erts/emulator/drivers/unix/sig_drv.c
+++ b/erts/emulator/drivers/unix/sig_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/drivers/unix/ttsl_drv.c b/erts/emulator/drivers/unix/ttsl_drv.c
index abfc52d3bc..e425b99f16 100644
--- a/erts/emulator/drivers/unix/ttsl_drv.c
+++ b/erts/emulator/drivers/unix/ttsl_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -264,14 +264,12 @@ static int ttysl_init(void)
DEBUGLOG(("ttysl_init: Debuglog = %s(0x%ld)\n",dl,(long) debuglog));
}
#endif
- DEBUGLOG(("ttysl_init: ttysl_port = %d\n", ttysl_port));
return 0;
}
static ErlDrvData ttysl_start(ErlDrvPort port, char* buf)
{
#ifndef HAVE_TERMCAP
- DEBUGLOG(("ttysl_start: failure - no TERMCAP configured!\n"));
return ERL_DRV_ERROR_GENERAL;
#else
char *s, *t, *l;
@@ -825,12 +823,13 @@ static void ttysl_to_tty(ErlDrvData ttysl_data, ErlDrvEvent fd) {
if (sz == 0) {
driver_select(ttysl_port,(ErlDrvEvent)(long)ttysl_fd,
ERL_DRV_WRITE,0);
- if (ttysl_terminate)
+ if (ttysl_terminate) {
/* flush has been called, which means we should terminate
when queue is empty. This will not send any exit
message */
DEBUGLOG(("ttysl_to_tty: ttysl_terminate normal\n"));
driver_failure_atom(ttysl_port, "normal");
+ }
break;
}
}
diff --git a/erts/emulator/drivers/unix/unix_efile.c b/erts/emulator/drivers/unix/unix_efile.c
index ac9b681d03..bfe0807df8 100644
--- a/erts/emulator/drivers/unix/unix_efile.c
+++ b/erts/emulator/drivers/unix/unix_efile.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -537,9 +537,9 @@ efile_fileinfo(Efile_error* errInfo, Efile_info* pInfo,
else
pInfo->type = FT_OTHER;
- pInfo->accessTime = statbuf.st_atime;
- pInfo->modifyTime = statbuf.st_mtime;
- pInfo->cTime = statbuf.st_ctime;
+ pInfo->accessTime = (Sint64)statbuf.st_atime;
+ pInfo->modifyTime = (Sint64)statbuf.st_mtime;
+ pInfo->cTime = (Sint64)statbuf.st_ctime;
pInfo->mode = statbuf.st_mode;
pInfo->links = statbuf.st_nlink;
@@ -578,8 +578,8 @@ efile_write_info(Efile_error *errInfo, Efile_info *pInfo, char *name)
}
}
- tval.actime = pInfo->accessTime;
- tval.modtime = pInfo->modifyTime;
+ tval.actime = (time_t)pInfo->accessTime;
+ tval.modtime = (time_t)pInfo->modifyTime;
return check_error(utime(name, &tval), errInfo);
}
@@ -638,12 +638,21 @@ efile_writev(Efile_error* errInfo, /* Where to return error codes */
do {
w = writev(fd, &iov[cnt], b);
} while (w < 0 && errno == EINTR);
+ if (w < 0 && errno == EINVAL) {
+ goto single_write;
+ }
} else
+ single_write:
/* Degenerated io vector - use regular write */
#endif
{
do {
- w = write(fd, iov[cnt].iov_base, iov[cnt].iov_len);
+ size_t iov_len = iov[cnt].iov_len;
+ size_t limit = 1024*1024*1024; /* 1GB */
+ if (iov_len > limit) {
+ iov_len = limit;
+ }
+ w = write(fd, iov[cnt].iov_base, iov_len);
} while (w < 0 && errno == EINTR);
ASSERT(w <= iov[cnt].iov_len ||
(w == -1 && errno != EINTR));
diff --git a/erts/emulator/drivers/vxworks/vxworks_resolv.c b/erts/emulator/drivers/vxworks/vxworks_resolv.c
index a7de53c692..c2cdf4a90b 100644
--- a/erts/emulator/drivers/vxworks/vxworks_resolv.c
+++ b/erts/emulator/drivers/vxworks/vxworks_resolv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/drivers/win32/registry_drv.c b/erts/emulator/drivers/win32/registry_drv.c
index 4e396aa8d9..a03a030df8 100644
--- a/erts/emulator/drivers/win32/registry_drv.c
+++ b/erts/emulator/drivers/win32/registry_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/drivers/win32/ttsl_drv.c b/erts/emulator/drivers/win32/ttsl_drv.c
index 4bd766a8a8..99e7fb25a4 100644
--- a/erts/emulator/drivers/win32/ttsl_drv.c
+++ b/erts/emulator/drivers/win32/ttsl_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/drivers/win32/win_con.c b/erts/emulator/drivers/win32/win_con.c
index 7fe708dc7b..0bcccfe405 100644
--- a/erts/emulator/drivers/win32/win_con.c
+++ b/erts/emulator/drivers/win32/win_con.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2012. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/drivers/win32/win_con.h b/erts/emulator/drivers/win32/win_con.h
index 3f4e89a195..7a642cd7ed 100644
--- a/erts/emulator/drivers/win32/win_con.h
+++ b/erts/emulator/drivers/win32/win_con.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2007-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/drivers/win32/win_efile.c b/erts/emulator/drivers/win32/win_efile.c
index d95f29f49d..2d366b5833 100644
--- a/erts/emulator/drivers/win32/win_efile.c
+++ b/erts/emulator/drivers/win32/win_efile.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/TODO b/erts/emulator/hipe/TODO
index dd9760ea1c..0c28616a30 100644
--- a/erts/emulator/hipe/TODO
+++ b/erts/emulator/hipe/TODO
@@ -1,7 +1,7 @@
%CopyrightBegin%
- Copyright Ericsson AB 2004-2009. All Rights Reserved.
+ Copyright Ericsson AB 2004-2016. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/elf64ppc.x b/erts/emulator/hipe/elf64ppc.x
index 3cd4010cb3..46d2632970 100644
--- a/erts/emulator/hipe/elf64ppc.x
+++ b/erts/emulator/hipe/elf64ppc.x
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_amd64.c b/erts/emulator/hipe/hipe_amd64.c
index 1bb336637d..62739d2a78 100644
--- a/erts/emulator/hipe/hipe_amd64.c
+++ b/erts/emulator/hipe/hipe_amd64.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -83,21 +83,6 @@ int hipe_patch_call(void *callAddress, void *destAddress, void *trampoline)
return 0;
}
-/*
- * Memory allocator for executable code.
- *
- * This is required on AMD64 because some Linux kernels
- * (including 2.6.10-rc1 and newer www.kernel.org ones)
- * default to non-executable memory mappings, causing
- * ordinary malloc() memory to be non-executable.
- *
- * Implementing this properly also allows us to ensure that
- * executable code ends up in the low 2GB of the address space,
- * as required by HiPE/AMD64's small code model.
- */
-static unsigned int code_bytes;
-static char *code_next;
-
#if 0 /* change to non-zero to get allocation statistics at exit() */
static unsigned int total_mapped, nr_joins, nr_splits, total_alloc, nr_allocs, nr_large, total_lost;
static unsigned int atexit_done;
@@ -121,101 +106,20 @@ static void atexit_alloc_code_stats(void)
#define ALLOC_CODE_STATS(X) do{}while(0)
#endif
-/* FreeBSD 6.1 breakage */
-#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
-#define MAP_ANONYMOUS MAP_ANON
-#endif
-
-static int morecore(unsigned int alloc_bytes)
-{
- unsigned int map_bytes;
- char *map_hint, *map_start;
-
- /* Page-align the amount to allocate. */
- map_bytes = (alloc_bytes + 4095) & ~4095;
-
- /* Round up small allocations. */
- if (map_bytes < 1024*1024)
- map_bytes = 1024*1024;
- else
- ALLOC_CODE_STATS(++nr_large);
-
- /* Create a new memory mapping, ensuring it is executable
- and in the low 2GB of the address space. Also attempt
- to make it adjacent to the previous mapping. */
- map_hint = code_next + code_bytes;
-#if !defined(MAP_32BIT)
- /* FreeBSD doesn't have MAP_32BIT, and it doesn't respect
- a plain map_hint (returns high mappings even though the
- hint refers to a free area), so we have to use both map_hint
- and MAP_FIXED to get addresses below the 2GB boundary.
- This is even worse than the Linux/ppc64 case.
- Similarly, Solaris 10 doesn't have MAP_32BIT,
- and it doesn't respect a plain map_hint. */
- if (!map_hint) /* first call */
- map_hint = (char*)(512*1024*1024); /* 0.5GB */
-#endif
- if ((unsigned long)map_hint & 4095)
- abort();
- map_start = mmap(map_hint, map_bytes,
- PROT_EXEC|PROT_READ|PROT_WRITE,
- MAP_PRIVATE|MAP_ANONYMOUS
-#if defined(MAP_32BIT)
- |MAP_32BIT
-#elif defined(__FreeBSD__) || defined(__sun__)
- |MAP_FIXED
-#endif
- ,
- -1, 0);
- ALLOC_CODE_STATS(fprintf(stderr, "%s: mmap(%p,%u,...) == %p\r\n", __FUNCTION__, map_hint, map_bytes, map_start));
-#if !defined(MAP_32BIT)
- if (map_start != MAP_FAILED &&
- (((unsigned long)map_start + (map_bytes-1)) & ~0x7FFFFFFFUL)) {
- fprintf(stderr, "mmap with hint %p returned code memory %p\r\n", map_hint, map_start);
- abort();
- }
-#endif
- if (map_start == MAP_FAILED)
- return -1;
-
- ALLOC_CODE_STATS(total_mapped += map_bytes);
-
- /* Merge adjacent mappings, so the trailing portion of the previous
- mapping isn't lost. In practice this is quite successful. */
- if (map_start == map_hint) {
- ALLOC_CODE_STATS(++nr_joins);
- code_bytes += map_bytes;
-#if !defined(MAP_32BIT)
- if (!code_next) /* first call */
- code_next = map_start;
-#endif
- } else {
- ALLOC_CODE_STATS(++nr_splits);
- ALLOC_CODE_STATS(total_lost += code_bytes);
- code_next = map_start;
- code_bytes = map_bytes;
- }
-
- ALLOC_CODE_STATS(atexit_alloc_code_stats());
-
- return 0;
-}
-
+/*
+ * Memory allocator for executable code.
+ *
+ * We use a dedicated allocator for executable code (from OTP 19.0)
+ * to make sure the memory we get is executable (PROT_EXEC)
+ * and to ensure that executable code ends up in the low 2GB
+ * of the address space, as required by HiPE/AMD64's small code model.
+ */
static void *alloc_code(unsigned int alloc_bytes)
{
- void *res;
-
- /* Align function entries. */
- alloc_bytes = (alloc_bytes + 3) & ~3;
-
- if (code_bytes < alloc_bytes && morecore(alloc_bytes) != 0)
- return NULL;
ALLOC_CODE_STATS(++nr_allocs);
ALLOC_CODE_STATS(total_alloc += alloc_bytes);
- res = code_next;
- code_next += alloc_bytes;
- code_bytes -= alloc_bytes;
- return res;
+
+ return erts_alloc(ERTS_ALC_T_HIPE_EXEC, alloc_bytes);
}
void *hipe_alloc_code(Uint nrbytes, Eterm callees, Eterm *trampolines, Process *p)
diff --git a/erts/emulator/hipe/hipe_amd64.h b/erts/emulator/hipe/hipe_amd64.h
index 09b55a1243..750a26fcb9 100644
--- a/erts/emulator/hipe/hipe_amd64.h
+++ b/erts/emulator/hipe/hipe_amd64.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_amd64.tab b/erts/emulator/hipe/hipe_amd64.tab
index 70287034a0..e5ff31b985 100644
--- a/erts/emulator/hipe/hipe_amd64.tab
+++ b/erts/emulator/hipe/hipe_amd64.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2011. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_amd64_asm.m4 b/erts/emulator/hipe/hipe_amd64_asm.m4
index ecb25ec5c8..2c0fbbee2d 100644
--- a/erts/emulator/hipe/hipe_amd64_asm.m4
+++ b/erts/emulator/hipe/hipe_amd64_asm.m4
@@ -2,7 +2,7 @@ changecom(`/*', `*/')dnl
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_amd64_bifs.m4 b/erts/emulator/hipe/hipe_amd64_bifs.m4
index 602e71c195..9cf3bf74fd 100644
--- a/erts/emulator/hipe/hipe_amd64_bifs.m4
+++ b/erts/emulator/hipe/hipe_amd64_bifs.m4
@@ -2,7 +2,7 @@ changecom(`/*', `*/')dnl
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_amd64_gc.h b/erts/emulator/hipe/hipe_amd64_gc.h
index e7a156c910..6b95d54904 100644
--- a/erts/emulator/hipe/hipe_amd64_gc.h
+++ b/erts/emulator/hipe/hipe_amd64_gc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_amd64_glue.S b/erts/emulator/hipe/hipe_amd64_glue.S
index 6fb93bce53..b37ed3c68a 100644
--- a/erts/emulator/hipe/hipe_amd64_glue.S
+++ b/erts/emulator/hipe/hipe_amd64_glue.S
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_amd64_glue.h b/erts/emulator/hipe/hipe_amd64_glue.h
index e54b8b3a3f..089658f4b5 100644
--- a/erts/emulator/hipe/hipe_amd64_glue.h
+++ b/erts/emulator/hipe/hipe_amd64_glue.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_amd64_primops.h b/erts/emulator/hipe/hipe_amd64_primops.h
index 23d8202e46..94c39a9433 100644
--- a/erts/emulator/hipe/hipe_amd64_primops.h
+++ b/erts/emulator/hipe/hipe_amd64_primops.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_arch.h b/erts/emulator/hipe/hipe_arch.h
index 21dabc7cb6..6f959815bb 100644
--- a/erts/emulator/hipe/hipe_arch.h
+++ b/erts/emulator/hipe/hipe_arch.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_arm.c b/erts/emulator/hipe/hipe_arm.c
index 01512e9aa1..f8ef468341 100644
--- a/erts/emulator/hipe/hipe_arm.c
+++ b/erts/emulator/hipe/hipe_arm.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_arm.h b/erts/emulator/hipe/hipe_arm.h
index a0e07cd6ce..b5fe6317c9 100644
--- a/erts/emulator/hipe/hipe_arm.h
+++ b/erts/emulator/hipe/hipe_arm.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_arm.tab b/erts/emulator/hipe/hipe_arm.tab
index bcac2cd79d..152319edbd 100644
--- a/erts/emulator/hipe/hipe_arm.tab
+++ b/erts/emulator/hipe/hipe_arm.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2011. All Rights Reserved.
+# Copyright Ericsson AB 2005-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_arm_asm.m4 b/erts/emulator/hipe/hipe_arm_asm.m4
index 8ce8600f97..ae9ec752bb 100644
--- a/erts/emulator/hipe/hipe_arm_asm.m4
+++ b/erts/emulator/hipe/hipe_arm_asm.m4
@@ -2,7 +2,7 @@ changecom(`/*', `*/')dnl
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_arm_bifs.m4 b/erts/emulator/hipe/hipe_arm_bifs.m4
index 3efe961964..d9c9952dbf 100644
--- a/erts/emulator/hipe/hipe_arm_bifs.m4
+++ b/erts/emulator/hipe/hipe_arm_bifs.m4
@@ -2,7 +2,7 @@ changecom(`/*', `*/')dnl
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_arm_gc.h b/erts/emulator/hipe/hipe_arm_gc.h
index dfffd6c630..e8eb900978 100644
--- a/erts/emulator/hipe/hipe_arm_gc.h
+++ b/erts/emulator/hipe/hipe_arm_gc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_arm_glue.S b/erts/emulator/hipe/hipe_arm_glue.S
index e4ce9b75ef..49ffa8b1d8 100644
--- a/erts/emulator/hipe/hipe_arm_glue.S
+++ b/erts/emulator/hipe/hipe_arm_glue.S
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_arm_glue.h b/erts/emulator/hipe/hipe_arm_glue.h
index 39bc27ec5f..dffc5aef03 100644
--- a/erts/emulator/hipe/hipe_arm_glue.h
+++ b/erts/emulator/hipe/hipe_arm_glue.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_arm_primops.h b/erts/emulator/hipe/hipe_arm_primops.h
index 0e8f84dfb9..c080b67699 100644
--- a/erts/emulator/hipe/hipe_arm_primops.h
+++ b/erts/emulator/hipe/hipe_arm_primops.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_bif0.c b/erts/emulator/hipe/hipe_bif0.c
index 70354aa9af..48cfafb8c5 100644
--- a/erts/emulator/hipe/hipe_bif0.c
+++ b/erts/emulator/hipe/hipe_bif0.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_bif0.h b/erts/emulator/hipe/hipe_bif0.h
index 5527c6c3ed..c9a8216368 100644
--- a/erts/emulator/hipe/hipe_bif0.h
+++ b/erts/emulator/hipe/hipe_bif0.h
@@ -2,7 +2,7 @@
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_bif0.tab b/erts/emulator/hipe/hipe_bif0.tab
index 5ce254314a..99237aae05 100644
--- a/erts/emulator/hipe/hipe_bif0.tab
+++ b/erts/emulator/hipe/hipe_bif0.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2011. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_bif1.c b/erts/emulator/hipe/hipe_bif1.c
index a2682992a4..08adbd474e 100644
--- a/erts/emulator/hipe/hipe_bif1.c
+++ b/erts/emulator/hipe/hipe_bif1.c
@@ -2,7 +2,7 @@
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_bif1.h b/erts/emulator/hipe/hipe_bif1.h
index 80cdeb4a82..e12bb1a1f3 100644
--- a/erts/emulator/hipe/hipe_bif1.h
+++ b/erts/emulator/hipe/hipe_bif1.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_bif1.tab b/erts/emulator/hipe/hipe_bif1.tab
index 6c4e05afdb..c5b452f199 100644
--- a/erts/emulator/hipe/hipe_bif1.tab
+++ b/erts/emulator/hipe/hipe_bif1.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_bif2.c b/erts/emulator/hipe/hipe_bif2.c
index 2328e69886..dfd34e31d4 100644
--- a/erts/emulator/hipe/hipe_bif2.c
+++ b/erts/emulator/hipe/hipe_bif2.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_bif2.tab b/erts/emulator/hipe/hipe_bif2.tab
index a29e1fbdbb..bbcb577be0 100644
--- a/erts/emulator/hipe/hipe_bif2.tab
+++ b/erts/emulator/hipe/hipe_bif2.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_bif64.c b/erts/emulator/hipe/hipe_bif64.c
index b97cf2b7ee..a1a3c81bfe 100644
--- a/erts/emulator/hipe/hipe_bif64.c
+++ b/erts/emulator/hipe/hipe_bif64.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_bif64.h b/erts/emulator/hipe/hipe_bif64.h
index 856b4003dc..a97ce311d3 100644
--- a/erts/emulator/hipe/hipe_bif64.h
+++ b/erts/emulator/hipe/hipe_bif64.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_bif64.tab b/erts/emulator/hipe/hipe_bif64.tab
index 3062ab5848..eefca379a0 100644
--- a/erts/emulator/hipe/hipe_bif64.tab
+++ b/erts/emulator/hipe/hipe_bif64.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2011. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_bif_list.m4 b/erts/emulator/hipe/hipe_bif_list.m4
index 7240280345..29095a5389 100644
--- a/erts/emulator/hipe/hipe_bif_list.m4
+++ b/erts/emulator/hipe/hipe_bif_list.m4
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_debug.c b/erts/emulator/hipe/hipe_debug.c
index a48578c468..ace489452f 100644
--- a/erts/emulator/hipe/hipe_debug.c
+++ b/erts/emulator/hipe/hipe_debug.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -195,7 +195,7 @@ void hipe_print_pcb(Process *p)
U("rcount ", rcount);
U("id ", common.id);
U("reds ", reds);
- U("tracer_pr..", common.tracer_proc);
+ U("tracer ", common.tracer);
U("trace_fla..", common.trace_flags);
U("group_lea..", group_leader);
U("flags ", flags);
diff --git a/erts/emulator/hipe/hipe_debug.h b/erts/emulator/hipe/hipe_debug.h
index bf10d5a2a8..c510eac949 100644
--- a/erts/emulator/hipe/hipe_debug.h
+++ b/erts/emulator/hipe/hipe_debug.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_gbif_list.h b/erts/emulator/hipe/hipe_gbif_list.h
index dc93741a1d..424b001298 100644
--- a/erts/emulator/hipe/hipe_gbif_list.h
+++ b/erts/emulator/hipe/hipe_gbif_list.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_gc.c b/erts/emulator/hipe/hipe_gc.c
index 2e19bf88bf..d0619a0609 100644
--- a/erts/emulator/hipe/hipe_gc.c
+++ b/erts/emulator/hipe/hipe_gc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_gc.h b/erts/emulator/hipe/hipe_gc.h
index e373324cdd..5b5eb29175 100644
--- a/erts/emulator/hipe/hipe_gc.h
+++ b/erts/emulator/hipe/hipe_gc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_mkliterals.c b/erts/emulator/hipe/hipe_mkliterals.c
index dfa5313739..0d3493ec6c 100644
--- a/erts/emulator/hipe/hipe_mkliterals.c
+++ b/erts/emulator/hipe/hipe_mkliterals.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_mode_switch.c b/erts/emulator/hipe/hipe_mode_switch.c
index 804c458b6c..9ad44b25ac 100644
--- a/erts/emulator/hipe/hipe_mode_switch.c
+++ b/erts/emulator/hipe/hipe_mode_switch.c
@@ -2,7 +2,7 @@
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -218,15 +218,37 @@ static __inline__ void hipe_pop_beam_trap_frame(Process *p)
Process *hipe_mode_switch(Process *p, unsigned cmd, Eterm reg[])
{
unsigned result;
-#if NR_ARG_REGS > 5
- /* When NR_ARG_REGS > 5, we need to protect the process' input
- reduction count (which BEAM stores in def_arg_reg[5]) from
- being clobbered by the arch glue code. */
Eterm reds_in = p->def_arg_reg[5];
-#endif
-#if NR_ARG_REGS > 4
- Eterm o_reds = p->def_arg_reg[4];
-#endif
+ /*
+ * Process is in the normal case scheduled out when reduction
+ * count reach zero. When "save calls" is enabled reduction
+ * count is subtracted with CONTEXT_REDS, i.e. initial reduction
+ * count will be zero or less and process is scheduled out
+ * when -CONTEXT_REDS is reached.
+ *
+ * HiPE does not support the "save calls" feature, so we switch
+ * to using a positive reduction counter when executing in
+ * hipe mode, but need to restore the "save calls" when
+ * returning to beam. We also need to hide the save calls buffer
+ * from BIFs. We do that by moving the saved calls buf to
+ * suspended saved calls buf.
+ *
+ * Beam has initial reduction count in stored in p->def_arg_reg[5].
+ *
+ * Beam expects -neg_o_reds to be found in p->def_arg_reg[4]
+ * on return to beam.
+ */
+
+ {
+ struct saved_calls *scb = ERTS_PROC_SET_SAVED_CALLS_BUF(p, NULL);
+ if (scb) {
+ reds_in += CONTEXT_REDS;
+ p->fcalls += CONTEXT_REDS;
+ ERTS_PROC_SET_SUSPENDED_SAVED_CALLS_BUF(p, scb);
+ }
+ }
+
+ p->flags |= F_HIPE_MODE; /* inform bifs where we are comming from... */
p->i = NULL;
/* Set current_function to undefined. stdlib hibernate tests rely on it. */
@@ -481,12 +503,21 @@ Process *hipe_mode_switch(Process *p, unsigned cmd, Eterm reg[])
erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_MSG_RECEIVE);
do_schedule:
{
-#if !(NR_ARG_REGS > 5)
- int reds_in = p->def_arg_reg[5];
+ struct saved_calls *scb;
+
+ scb = ERTS_PROC_SET_SUSPENDED_SAVED_CALLS_BUF(p, NULL);
+ if (scb)
+ ERTS_PROC_SET_SAVED_CALLS_BUF(p, scb);
+
+#ifdef DEBUG
+ ASSERT(p->debug_reds_in == reds_in);
#endif
+ p->flags &= ~F_HIPE_MODE;
+
ERTS_SMP_UNREQ_PROC_MAIN_LOCK(p);
p = schedule(p, reds_in - p->fcalls);
ERTS_SMP_REQ_PROC_MAIN_LOCK(p);
+ ASSERT(!(p->flags & F_HIPE_MODE));
#ifdef ERTS_SMP
p->hipe_smp.have_receive_locks = 0;
reg = p->scheduler_data->x_reg_array;
@@ -501,28 +532,32 @@ Process *hipe_mode_switch(Process *p, unsigned cmd, Eterm reg[])
reg[i] = argp[i];
}
{
-#if !(NR_ARG_REGS > 5)
- Eterm reds_in;
-#endif
-#if !(NR_ARG_REGS > 4)
- Eterm o_reds;
-#endif
+ struct saved_calls *scb;
reds_in = p->fcalls;
- o_reds = 0;
- if (ERTS_PROC_GET_SAVED_CALLS_BUF(p)) {
- o_reds = reds_in;
- reds_in = 0;
- p->fcalls = 0;
- }
- p->def_arg_reg[4] = o_reds;
p->def_arg_reg[5] = reds_in;
+#ifdef DEBUG
+ p->debug_reds_in = reds_in;
+#endif
if (p->i == hipe_beam_pc_resume) {
+ p->flags |= F_HIPE_MODE; /* inform bifs where we are comming from... */
+ scb = ERTS_PROC_SET_SAVED_CALLS_BUF(p, NULL);
+ if (scb)
+ ERTS_PROC_SET_SUSPENDED_SAVED_CALLS_BUF(p, scb);
p->i = NULL;
p->arity = 0;
goto do_resume;
}
+
+ scb = ERTS_PROC_GET_SAVED_CALLS_BUF(p);
+ if (!scb)
+ p->def_arg_reg[4] = 0;
+ else {
+ p->def_arg_reg[4] = CONTEXT_REDS;
+ p->fcalls = -CONTEXT_REDS + reds_in;
+ }
}
+
HIPE_CHECK_PCB(p);
result = HIPE_MODE_SWITCH_RES_CALL_BEAM;
p->def_arg_reg[3] = result;
@@ -562,14 +597,29 @@ Process *hipe_mode_switch(Process *p, unsigned cmd, Eterm reg[])
default:
erts_exit(ERTS_ERROR_EXIT, "hipe_mode_switch: result %#x\r\n", result);
}
+
+ {
+ struct saved_calls *scb = ERTS_PROC_SET_SUSPENDED_SAVED_CALLS_BUF(p, NULL);
+ if (!scb)
+ p->def_arg_reg[4] = 0;
+ else {
+ p->def_arg_reg[4] = CONTEXT_REDS;
+ p->fcalls -= CONTEXT_REDS;
+ ERTS_PROC_SET_SAVED_CALLS_BUF(p, scb);
+ }
+ }
+
HIPE_CHECK_PCB(p);
p->def_arg_reg[3] = result;
-#if NR_ARG_REGS > 4
- p->def_arg_reg[4] = o_reds;
-#endif
#if NR_ARG_REGS > 5
+ /*
+ * When NR_ARG_REGS > 5, we need to protect the process' input
+ * reduction count (which BEAM stores in def_arg_reg[5]) from
+ * being clobbered by the arch glue code.
+ */
p->def_arg_reg[5] = reds_in;
#endif
+ p->flags &= ~F_HIPE_MODE;
return p;
}
diff --git a/erts/emulator/hipe/hipe_mode_switch.h b/erts/emulator/hipe/hipe_mode_switch.h
index 620cc6356b..c40077d558 100644
--- a/erts/emulator/hipe/hipe_mode_switch.h
+++ b/erts/emulator/hipe/hipe_mode_switch.h
@@ -2,7 +2,7 @@
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_native_bif.c b/erts/emulator/hipe/hipe_native_bif.c
index 0ec417999b..00b572029a 100644
--- a/erts/emulator/hipe/hipe_native_bif.c
+++ b/erts/emulator/hipe/hipe_native_bif.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_native_bif.h b/erts/emulator/hipe/hipe_native_bif.h
index 55a0d3bb1b..a02d26087b 100644
--- a/erts/emulator/hipe/hipe_native_bif.h
+++ b/erts/emulator/hipe/hipe_native_bif.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_ops.tab b/erts/emulator/hipe/hipe_ops.tab
index d021c72ac9..96e4c0da91 100644
--- a/erts/emulator/hipe/hipe_ops.tab
+++ b/erts/emulator/hipe/hipe_ops.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2011. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_ppc.c b/erts/emulator/hipe/hipe_ppc.c
index 3f86de626d..9b2048c457 100644
--- a/erts/emulator/hipe/hipe_ppc.c
+++ b/erts/emulator/hipe/hipe_ppc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_ppc.h b/erts/emulator/hipe/hipe_ppc.h
index 777c9384d5..e86c122fb1 100644
--- a/erts/emulator/hipe/hipe_ppc.h
+++ b/erts/emulator/hipe/hipe_ppc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_ppc.tab b/erts/emulator/hipe/hipe_ppc.tab
index 5bf2320cbe..274612d9ce 100644
--- a/erts/emulator/hipe/hipe_ppc.tab
+++ b/erts/emulator/hipe/hipe_ppc.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2011. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_ppc64.tab b/erts/emulator/hipe/hipe_ppc64.tab
index 301a9752f7..a291185b57 100644
--- a/erts/emulator/hipe/hipe_ppc64.tab
+++ b/erts/emulator/hipe/hipe_ppc64.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2011. All Rights Reserved.
+# Copyright Ericsson AB 2005-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_ppc_asm.m4 b/erts/emulator/hipe/hipe_ppc_asm.m4
index ea74923d1f..be25d65725 100644
--- a/erts/emulator/hipe/hipe_ppc_asm.m4
+++ b/erts/emulator/hipe/hipe_ppc_asm.m4
@@ -2,7 +2,7 @@ changecom(`/*', `*/')dnl
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_ppc_bifs.m4 b/erts/emulator/hipe/hipe_ppc_bifs.m4
index 28518827ec..57b4208bee 100644
--- a/erts/emulator/hipe/hipe_ppc_bifs.m4
+++ b/erts/emulator/hipe/hipe_ppc_bifs.m4
@@ -2,7 +2,7 @@ changecom(`/*', `*/')dnl
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_ppc_gc.h b/erts/emulator/hipe/hipe_ppc_gc.h
index 0854d9e950..a6ec1338ff 100644
--- a/erts/emulator/hipe/hipe_ppc_gc.h
+++ b/erts/emulator/hipe/hipe_ppc_gc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_ppc_glue.S b/erts/emulator/hipe/hipe_ppc_glue.S
index 6e2022603c..44351dc06c 100644
--- a/erts/emulator/hipe/hipe_ppc_glue.S
+++ b/erts/emulator/hipe/hipe_ppc_glue.S
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_ppc_glue.h b/erts/emulator/hipe/hipe_ppc_glue.h
index 93ca39fcb3..2bfa10298c 100644
--- a/erts/emulator/hipe/hipe_ppc_glue.h
+++ b/erts/emulator/hipe/hipe_ppc_glue.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_ppc_primops.h b/erts/emulator/hipe/hipe_ppc_primops.h
index ce3dda9eb3..540605de9f 100644
--- a/erts/emulator/hipe/hipe_ppc_primops.h
+++ b/erts/emulator/hipe/hipe_ppc_primops.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_primops.h b/erts/emulator/hipe/hipe_primops.h
index 0bec677574..4fcbc9df38 100644
--- a/erts/emulator/hipe/hipe_primops.h
+++ b/erts/emulator/hipe/hipe_primops.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_process.h b/erts/emulator/hipe/hipe_process.h
index 60d09ea1c9..21c4239753 100644
--- a/erts/emulator/hipe/hipe_process.h
+++ b/erts/emulator/hipe/hipe_process.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_risc_gc.h b/erts/emulator/hipe/hipe_risc_gc.h
index 770ec93459..315f8e7f9f 100644
--- a/erts/emulator/hipe/hipe_risc_gc.h
+++ b/erts/emulator/hipe/hipe_risc_gc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_risc_glue.h b/erts/emulator/hipe/hipe_risc_glue.h
index 51db7eac01..0284265307 100644
--- a/erts/emulator/hipe/hipe_risc_glue.h
+++ b/erts/emulator/hipe/hipe_risc_glue.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_risc_stack.c b/erts/emulator/hipe/hipe_risc_stack.c
index fd04421381..dc98c96b8f 100644
--- a/erts/emulator/hipe/hipe_risc_stack.c
+++ b/erts/emulator/hipe/hipe_risc_stack.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_signal.h b/erts/emulator/hipe/hipe_signal.h
index b2f461797d..5d8621135b 100644
--- a/erts/emulator/hipe/hipe_signal.h
+++ b/erts/emulator/hipe/hipe_signal.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_sparc.c b/erts/emulator/hipe/hipe_sparc.c
index bd95bc5d98..23020f34ee 100644
--- a/erts/emulator/hipe/hipe_sparc.c
+++ b/erts/emulator/hipe/hipe_sparc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_sparc.h b/erts/emulator/hipe/hipe_sparc.h
index 0b74b2db26..25d513e988 100644
--- a/erts/emulator/hipe/hipe_sparc.h
+++ b/erts/emulator/hipe/hipe_sparc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_sparc.tab b/erts/emulator/hipe/hipe_sparc.tab
index 2f528c0607..bc90d38168 100644
--- a/erts/emulator/hipe/hipe_sparc.tab
+++ b/erts/emulator/hipe/hipe_sparc.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2011. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_sparc_asm.m4 b/erts/emulator/hipe/hipe_sparc_asm.m4
index 227a1658b4..8a9a516eab 100644
--- a/erts/emulator/hipe/hipe_sparc_asm.m4
+++ b/erts/emulator/hipe/hipe_sparc_asm.m4
@@ -2,7 +2,7 @@ changecom(`/*', `*/')dnl
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2007-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_sparc_bifs.m4 b/erts/emulator/hipe/hipe_sparc_bifs.m4
index a7bbe5b2cc..2e886ec1d1 100644
--- a/erts/emulator/hipe/hipe_sparc_bifs.m4
+++ b/erts/emulator/hipe/hipe_sparc_bifs.m4
@@ -2,7 +2,7 @@ changecom(`/*', `*/')dnl
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_sparc_gc.h b/erts/emulator/hipe/hipe_sparc_gc.h
index 99e55df1ce..eea0268ed5 100644
--- a/erts/emulator/hipe/hipe_sparc_gc.h
+++ b/erts/emulator/hipe/hipe_sparc_gc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_sparc_glue.S b/erts/emulator/hipe/hipe_sparc_glue.S
index 7e47ffb52f..077db9b8ad 100644
--- a/erts/emulator/hipe/hipe_sparc_glue.S
+++ b/erts/emulator/hipe/hipe_sparc_glue.S
@@ -2,7 +2,7 @@
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_sparc_glue.h b/erts/emulator/hipe/hipe_sparc_glue.h
index 95ce1e5b4a..3a1795f408 100644
--- a/erts/emulator/hipe/hipe_sparc_glue.h
+++ b/erts/emulator/hipe/hipe_sparc_glue.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_sparc_primops.h b/erts/emulator/hipe/hipe_sparc_primops.h
index e42bcbad62..2ecfa1293e 100644
--- a/erts/emulator/hipe/hipe_sparc_primops.h
+++ b/erts/emulator/hipe/hipe_sparc_primops.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_stack.c b/erts/emulator/hipe/hipe_stack.c
index e088b45c57..e2e6eb74b1 100644
--- a/erts/emulator/hipe/hipe_stack.c
+++ b/erts/emulator/hipe/hipe_stack.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_stack.h b/erts/emulator/hipe/hipe_stack.h
index f575b97ce3..4ea7d5c031 100644
--- a/erts/emulator/hipe/hipe_stack.h
+++ b/erts/emulator/hipe/hipe_stack.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_x86.c b/erts/emulator/hipe/hipe_x86.c
index 19b70afced..3d25646231 100644
--- a/erts/emulator/hipe/hipe_x86.c
+++ b/erts/emulator/hipe/hipe_x86.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_x86.h b/erts/emulator/hipe/hipe_x86.h
index 30dc5666ae..8967793171 100644
--- a/erts/emulator/hipe/hipe_x86.h
+++ b/erts/emulator/hipe/hipe_x86.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_x86.tab b/erts/emulator/hipe/hipe_x86.tab
index 55fb03cde8..b922f05165 100644
--- a/erts/emulator/hipe/hipe_x86.tab
+++ b/erts/emulator/hipe/hipe_x86.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2011. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_x86_abi.txt b/erts/emulator/hipe/hipe_x86_abi.txt
index b74fcef127..31a4a0e121 100644
--- a/erts/emulator/hipe/hipe_x86_abi.txt
+++ b/erts/emulator/hipe/hipe_x86_abi.txt
@@ -1,7 +1,7 @@
%CopyrightBegin%
- Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ Copyright Ericsson AB 2001-2016. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_x86_asm.m4 b/erts/emulator/hipe/hipe_x86_asm.m4
index 3457574622..91c60382eb 100644
--- a/erts/emulator/hipe/hipe_x86_asm.m4
+++ b/erts/emulator/hipe/hipe_x86_asm.m4
@@ -2,7 +2,7 @@ changecom(`/*', `*/')dnl
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_x86_bifs.m4 b/erts/emulator/hipe/hipe_x86_bifs.m4
index 0c0a8da6eb..b8ac5046d5 100644
--- a/erts/emulator/hipe/hipe_x86_bifs.m4
+++ b/erts/emulator/hipe/hipe_x86_bifs.m4
@@ -2,7 +2,7 @@ changecom(`/*', `*/')dnl
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_x86_gc.h b/erts/emulator/hipe/hipe_x86_gc.h
index a8770ef4f9..c22b28c2d5 100644
--- a/erts/emulator/hipe/hipe_x86_gc.h
+++ b/erts/emulator/hipe/hipe_x86_gc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_x86_glue.S b/erts/emulator/hipe/hipe_x86_glue.S
index cf382c480d..8d6e377730 100644
--- a/erts/emulator/hipe/hipe_x86_glue.S
+++ b/erts/emulator/hipe/hipe_x86_glue.S
@@ -2,7 +2,7 @@
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_x86_glue.h b/erts/emulator/hipe/hipe_x86_glue.h
index 6c123e8938..818d7444e2 100644
--- a/erts/emulator/hipe/hipe_x86_glue.h
+++ b/erts/emulator/hipe/hipe_x86_glue.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_x86_primops.h b/erts/emulator/hipe/hipe_x86_primops.h
index 3e057059bc..68a284203e 100644
--- a/erts/emulator/hipe/hipe_x86_primops.h
+++ b/erts/emulator/hipe/hipe_x86_primops.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_x86_signal.c b/erts/emulator/hipe/hipe_x86_signal.c
index 0ecd13c4bc..50d08b96d3 100644
--- a/erts/emulator/hipe/hipe_x86_signal.c
+++ b/erts/emulator/hipe/hipe_x86_signal.c
@@ -2,7 +2,7 @@
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/hipe/hipe_x86_stack.c b/erts/emulator/hipe/hipe_x86_stack.c
index 6629713a05..f1559b1451 100644
--- a/erts/emulator/hipe/hipe_x86_stack.c
+++ b/erts/emulator/hipe/hipe_x86_stack.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/internal_doc/dec.erl b/erts/emulator/internal_doc/dec.erl
index e64e37a7d9..8ce83fa402 100644
--- a/erts/emulator/internal_doc/dec.erl
+++ b/erts/emulator/internal_doc/dec.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/internal_doc/erl_ext_dist.txt b/erts/emulator/internal_doc/erl_ext_dist.txt
index 23b7d0d8e5..0b9a783069 100644
--- a/erts/emulator/internal_doc/erl_ext_dist.txt
+++ b/erts/emulator/internal_doc/erl_ext_dist.txt
@@ -1,7 +1,7 @@
%CopyrightBegin%
- Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ Copyright Ericsson AB 1997-2016. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/erts/emulator/nifs/common/erl_tracer_nif.c b/erts/emulator/nifs/common/erl_tracer_nif.c
new file mode 100644
index 0000000000..8a9a1bf16c
--- /dev/null
+++ b/erts/emulator/nifs/common/erl_tracer_nif.c
@@ -0,0 +1,257 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Ericsson 2015. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+/*
+ * Purpose: NIF library for process/port tracer
+ *
+ */
+
+
+#define STATIC_ERLANG_NIF 1
+
+#include "erl_nif.h"
+#include "config.h"
+#include "sys.h"
+
+#ifdef VALGRIND
+# include <valgrind/memcheck.h>
+#endif
+
+/* NIF interface declarations */
+static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info);
+static int upgrade(ErlNifEnv* env, void** priv_data, void** old_priv_data, ERL_NIF_TERM load_info);
+static void unload(ErlNifEnv* env, void* priv_data);
+
+/* The NIFs: */
+static ERL_NIF_TERM enabled(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM trace(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+
+static ErlNifFunc nif_funcs[] = {
+ {"enabled", 3, enabled},
+ {"trace", 6, trace}
+};
+
+
+ERL_NIF_INIT(erl_tracer, nif_funcs, load, NULL, upgrade, unload)
+
+#define ATOMS \
+ ATOM_DECL(call); \
+ ATOM_DECL(command); \
+ ATOM_DECL(cpu_timestamp); \
+ ATOM_DECL(discard); \
+ ATOM_DECL(exception_from); \
+ ATOM_DECL(match_spec_result); \
+ ATOM_DECL(monotonic); \
+ ATOM_DECL(ok); \
+ ATOM_DECL(remove); \
+ ATOM_DECL(return_from); \
+ ATOM_DECL(scheduler_id); \
+ ATOM_DECL(send); \
+ ATOM_DECL(send_to_non_existing_process); \
+ ATOM_DECL(seq_trace); \
+ ATOM_DECL(spawn); \
+ ATOM_DECL(strict_monotonic); \
+ ATOM_DECL(timestamp); \
+ ATOM_DECL(trace); \
+ ATOM_DECL(trace_ts); \
+ ATOM_DECL(true); \
+ ATOM_DECL(gc_minor_start); \
+ ATOM_DECL(gc_minor_end); \
+ ATOM_DECL(gc_major_start); \
+ ATOM_DECL(gc_major_end); \
+ ATOM_DECL(undefined);
+
+#define ATOM_DECL(A) static ERL_NIF_TERM atom_##A
+ATOMS
+#undef ATOM_DECL
+
+static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info)
+{
+
+#define ATOM_DECL(A) atom_##A = enif_make_atom(env, #A)
+ATOMS
+#undef ATOM_DECL
+
+ *priv_data = NULL;
+
+ return 0;
+}
+
+static void unload(ErlNifEnv* env, void* priv_data)
+{
+
+}
+
+static int upgrade(ErlNifEnv* env, void** priv_data, void** old_priv_data,
+ ERL_NIF_TERM load_info)
+{
+ if (*old_priv_data != NULL) {
+ return -1; /* Don't know how to do that */
+ }
+ if (*priv_data != NULL) {
+ return -1; /* Don't know how to do that */
+ }
+ if (load(env, priv_data, load_info)) {
+ return -1;
+ }
+ return 0;
+}
+
+static ERL_NIF_TERM enabled(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ ErlNifPid to_pid;
+ ErlNifPort to_port;
+ ASSERT(argc == 3);
+
+ if (enif_get_local_pid(env, argv[1], &to_pid)) {
+ if (!enif_is_process_alive(env, &to_pid))
+ /* tracer is dead so we should remove this trace point */
+ return atom_remove;
+ } else if (enif_get_local_port(env, argv[1], &to_port)) {
+ if (!enif_is_port_alive(env, &to_port))
+ /* tracer is dead so we should remove this trace point */
+ return atom_remove;
+ } else {
+ /* The state was not a pid or a port */
+ return atom_remove;
+ }
+
+ /* Only generate trace for when tracer != tracee */
+ if (enif_is_identical(argv[1], argv[2])) {
+ return atom_discard;
+ }
+
+ return atom_trace;
+}
+
+/*
+ -spec trace(seq_trace, TracerState :: pid() | port(),
+ Label :: non_neg_integer(),
+ Msg :: term(),
+ Opts :: map()) -> ignored();
+ trace(Tag :: atom(), TracerState :: pid() | port(),
+ Tracee :: pid() || port() || undefined,
+ Msg :: term(),
+ Opts :: map()) -> ignored().
+ -spec trace(Tag :: atom(), TracerState :: pid() | port(),
+ Tracee :: pid() || port() || undefined,
+ Msg :: term(),
+ Extra :: term(),
+ Opts :: map()) -> ignored().
+*/
+static ERL_NIF_TERM trace(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ ERL_NIF_TERM value, msg, tt[8], opts;
+ ErlNifPid to_pid;
+ ErlNifPort to_port;
+ size_t tt_sz = 0;
+ int is_port = 0;
+ ASSERT(argc == 6);
+
+ if (!enif_get_local_pid(env, argv[1], &to_pid)) {
+ if (!enif_get_local_port(env, argv[1], &to_port)) {
+ /* This only fails if argv[1] is a not a local port/pid
+ which should not happen as it is checked in enabled */
+ ASSERT(0);
+ return atom_ok;
+ }
+ is_port = 1;
+ }
+
+ if (!enif_is_identical(argv[4], atom_undefined)) {
+ tt[tt_sz++] = atom_trace;
+ tt[tt_sz++] = argv[2];
+ tt[tt_sz++] = argv[0];
+ tt[tt_sz++] = argv[3];
+ tt[tt_sz++] = argv[4];
+ } else {
+ if (enif_is_identical(argv[0], atom_seq_trace)) {
+ tt[tt_sz++] = atom_seq_trace;
+ tt[tt_sz++] = argv[2];
+ tt[tt_sz++] = argv[3];
+ } else {
+ tt[tt_sz++] = atom_trace;
+ tt[tt_sz++] = argv[2];
+ tt[tt_sz++] = argv[0];
+ tt[tt_sz++] = argv[3];
+ }
+ }
+
+ opts = argv[5];
+
+ if (enif_get_map_value(env, opts, atom_match_spec_result,
+ &value)
+ && !enif_is_identical(value, atom_true)) {
+ tt[tt_sz++] = value;
+ }
+
+ if (enif_get_map_value(env, opts, atom_scheduler_id, &value)
+ && !enif_is_identical(value, atom_undefined)) {
+ tt[tt_sz++] = value;
+ }
+
+ if (enif_get_map_value(env, opts, atom_timestamp, &value)
+ && !enif_is_identical(value, atom_undefined)) {
+ ERL_NIF_TERM ts;
+ if (enif_is_identical(value, atom_monotonic)) {
+ ErlNifTime mon = enif_monotonic_time(ERL_NIF_NSEC);
+ ts = enif_make_int64(env, mon);
+ } else if (enif_is_identical(value, atom_strict_monotonic)) {
+ ErlNifTime mon = enif_monotonic_time(ERL_NIF_NSEC);
+ ERL_NIF_TERM unique = enif_make_unique_integer(
+ env, ERL_NIF_UNIQUE_MONOTONIC);
+ ts = enif_make_tuple2(env, enif_make_int64(env, mon), unique);
+ } else if (enif_is_identical(value, atom_timestamp)) {
+ ts = enif_now_time(env);
+ } else if (enif_is_identical(value, atom_cpu_timestamp)) {
+ ts = enif_cpu_time(env);
+ } else {
+ ASSERT(0);
+ goto error;
+ }
+ tt[tt_sz++] = ts;
+ if (tt[0] == atom_trace)
+ tt[0] = atom_trace_ts;
+ }
+
+ msg = enif_make_tuple_from_array(env, tt, tt_sz);
+
+ if (is_port) {
+ ErlNifBinary bin;
+
+ if (!enif_term_to_binary(env, msg, &bin))
+ goto error;
+
+ msg = enif_make_binary(env, &bin);
+
+ if (!enif_port_command(env, &to_port, NULL, msg))
+ /* port has probably died, enabled will clean up */;
+
+ enif_release_binary(&bin);
+ } else {
+
+ if (!enif_send(env, &to_pid, NULL, msg))
+ /* process has probably died, enabled will clean up */;
+ }
+
+error:
+
+ return atom_ok;
+}
diff --git a/erts/emulator/pcre/pcre.mk b/erts/emulator/pcre/pcre.mk
index b844b77214..38b91237a2 100644
--- a/erts/emulator/pcre/pcre.mk
+++ b/erts/emulator/pcre/pcre.mk
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2012. All Rights Reserved.
+# Copyright Ericsson AB 2012-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/common/erl_check_io.c b/erts/emulator/sys/common/erl_check_io.c
index f87196d724..44a77f3ea5 100644
--- a/erts/emulator/sys/common/erl_check_io.c
+++ b/erts/emulator/sys/common/erl_check_io.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,6 +39,7 @@
#include "erl_check_io.h"
#include "erl_thr_progress.h"
#include "dtrace-wrapper.h"
+#include "lttng-wrapper.h"
#define ERTS_WANT_TIMER_WHEEL_API
#include "erl_time.h"
@@ -395,6 +396,7 @@ forget_removed(struct pollset_info* psi)
if (drv_ptr) {
int was_unmasked = erts_block_fpe();
DTRACE1(driver_stop_select, drv_ptr->name);
+ LTTNG1(driver_stop_select, drv_ptr->name);
(*drv_ptr->stop_select) ((ErlDrvEvent) fd, NULL);
erts_unblock_fpe(was_unmasked);
if (drv_ptr->handle) {
@@ -1055,6 +1057,7 @@ done_unknown:
if (stop_select_fn) {
int was_unmasked = erts_block_fpe();
DTRACE1(driver_stop_select, name);
+ LTTNG1(driver_stop_select, "unknown");
(*stop_select_fn)(e, NULL);
erts_unblock_fpe(was_unmasked);
}
diff --git a/erts/emulator/sys/common/erl_check_io.h b/erts/emulator/sys/common/erl_check_io.h
index c8675a7d9d..14f1ea3f43 100644
--- a/erts/emulator/sys/common/erl_check_io.h
+++ b/erts/emulator/sys/common/erl_check_io.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/common/erl_mmap.c b/erts/emulator/sys/common/erl_mmap.c
index 889d6f3868..a7e710070b 100644
--- a/erts/emulator/sys/common/erl_mmap.c
+++ b/erts/emulator/sys/common/erl_mmap.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -294,12 +294,13 @@ typedef struct {
}ErtsFreeSegMap;
struct ErtsMemMapper_ {
- int (*reserve_physical)(char *, UWord);
+ int (*reserve_physical)(char *, UWord, int exec);
void (*unreserve_physical)(char *, UWord);
int supercarrier;
int no_os_mmap;
+ int executable; /* is client a native code allocator? */
/*
- * Super unaligend area is located above super aligned
+ * Super unaligned area is located above super aligned
* area. That is, `sa.bot` is beginning of the super
* carrier, `sua.top` is the end of the super carrier,
* and sa.top and sua.bot moves towards eachother.
@@ -355,6 +356,12 @@ char* erts_literals_start;
UWord erts_literals_size;
#endif
+#ifdef ERTS_ALC_A_EXEC
+ErtsMemMapper erts_exec_mmapper;
+#endif
+
+
+
#define ERTS_MMAP_SIZE_SC_SA_INC(SZ) \
do { \
mm->size.supercarrier.used.total += (SZ); \
@@ -1232,6 +1239,7 @@ Eterm build_free_seg_list(Process* p, ErtsFreeSegMap* map)
#if HAVE_MMAP
# define ERTS_MMAP_PROT (PROT_READ|PROT_WRITE)
+# define ERTS_MMAP_PROT_EXEC (PROT_READ|PROT_WRITE|PROT_EXEC)
# if defined(MAP_ANONYMOUS)
# define ERTS_MMAP_FLAGS (MAP_ANON|MAP_PRIVATE)
# define ERTS_MMAP_FD (-1)
@@ -1245,24 +1253,26 @@ Eterm build_free_seg_list(Process* p, ErtsFreeSegMap* map)
#endif
static ERTS_INLINE void *
-os_mmap(void *hint_ptr, UWord size, int try_superalign)
+os_mmap(void *hint_ptr, UWord size, int try_superalign, int executable)
{
#if HAVE_MMAP
+ const int prot = executable ? ERTS_MMAP_PROT_EXEC : ERTS_MMAP_PROT;
void *res;
#ifdef MAP_ALIGN
if (try_superalign)
- res = mmap((void *) ERTS_SUPERALIGNED_SIZE, size, ERTS_MMAP_PROT,
+ res = mmap((void *) ERTS_SUPERALIGNED_SIZE, size, prot,
ERTS_MMAP_FLAGS|MAP_ALIGN, ERTS_MMAP_FD, 0);
else
#endif
- res = mmap((void *) hint_ptr, size, ERTS_MMAP_PROT,
+ res = mmap((void *) hint_ptr, size, prot,
ERTS_MMAP_FLAGS, ERTS_MMAP_FD, 0);
if (res == MAP_FAILED)
return NULL;
return res;
#elif HAVE_VIRTUALALLOC
+ const DWORD prot = executable ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE;
return (void *) VirtualAlloc(NULL, (SIZE_T) size,
- MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE);
+ MEM_COMMIT|MEM_RESERVE, prot);
#else
# error "missing mmap() or similar"
#endif
@@ -1319,6 +1329,7 @@ os_mremap(void *ptr, UWord old_size, UWord new_size, int try_superalign)
#if HAVE_MMAP
#define ERTS_MMAP_RESERVE_PROT (ERTS_MMAP_PROT)
+#define ERTS_MMAP_RESERVE_PROT_EXEC (ERTS_MMAP_PROT_EXEC)
#define ERTS_MMAP_RESERVE_FLAGS (ERTS_MMAP_FLAGS|MAP_FIXED)
#define ERTS_MMAP_UNRESERVE_PROT (PROT_NONE)
#define ERTS_MMAP_UNRESERVE_FLAGS (ERTS_MMAP_FLAGS|MAP_NORESERVE|MAP_FIXED)
@@ -1326,9 +1337,10 @@ os_mremap(void *ptr, UWord old_size, UWord new_size, int try_superalign)
#define ERTS_MMAP_VIRTUAL_FLAGS (ERTS_MMAP_FLAGS|MAP_NORESERVE)
static int
-os_reserve_physical(char *ptr, UWord size)
+os_reserve_physical(char *ptr, UWord size, int exec)
{
- void *res = mmap((void *) ptr, (size_t) size, ERTS_MMAP_RESERVE_PROT,
+ const int prot = exec ? ERTS_MMAP_RESERVE_PROT_EXEC : ERTS_MMAP_RESERVE_PROT;
+ void *res = mmap((void *) ptr, (size_t) size, prot,
ERTS_MMAP_RESERVE_FLAGS, ERTS_MMAP_FD, 0);
if (res == (void *) MAP_FAILED)
return 0;
@@ -1345,10 +1357,39 @@ os_unreserve_physical(char *ptr, UWord size)
}
static void *
-os_mmap_virtual(char *ptr, UWord size)
+os_mmap_virtual(char *ptr, UWord size, int exec)
{
- void *res = mmap((void *) ptr, (size_t) size, ERTS_MMAP_VIRTUAL_PROT,
- ERTS_MMAP_VIRTUAL_FLAGS, ERTS_MMAP_FD, 0);
+ int flags = ERTS_MMAP_VIRTUAL_FLAGS;
+ void* res;
+
+#ifdef ERTS_ALC_A_EXEC
+ if (exec) {
+ ASSERT(!ptr);
+ /* OTP-19.0: Nice hack below cut-and-pasted from hipe_amd64.c */
+
+# ifdef MAP_32BIT
+ /* If we got MAP_32BIT (Linux), then use that to ask for low memory */
+ flags |= MAP_32BIT;
+# else
+ /* FreeBSD doesn't have MAP_32BIT, and it doesn't respect
+ a plain map_hint (returns high mappings even though the
+ hint refers to a free area), so we have to use both map_hint
+ and MAP_FIXED to get addresses below the 2GB boundary.
+ This is even worse than the Linux/ppc64 case.
+ Similarly, Solaris 10 doesn't have MAP_32BIT,
+ and it doesn't respect a plain map_hint. */
+ ptr = (char*)(512*1024*1024); /* 0.5GB */
+
+# if defined(__FreeBSD__) || defined(__sun__)
+ flags |= MAP_FIXED;
+# endif
+# endif /* !MAP_32BIT */
+ }
+#else /* !ERTS_ALC_A_EXEC */
+ ASSERT(!exec);
+#endif
+ res = mmap((void *) ptr, (size_t) size, ERTS_MMAP_VIRTUAL_PROT,
+ flags, ERTS_MMAP_FD, 0);
if (res == (void *) MAP_FAILED)
return NULL;
return res;
@@ -1361,7 +1402,7 @@ os_mmap_virtual(char *ptr, UWord size)
#endif /* ERTS_HAVE_OS_MMAP */
-static int reserve_noop(char *ptr, UWord size)
+static int reserve_noop(char *ptr, UWord size, int exec)
{
#ifdef ERTS_MMAP_DEBUG_FILL_AREAS
Uint32 *uip, *end = (Uint32 *) (ptr + size);
@@ -1404,7 +1445,7 @@ alloc_desc_insert_free_seg(ErtsMemMapper* mm,
#if ERTS_HAVE_OS_MMAP
if (!mm->no_os_mmap) {
- ptr = os_mmap(mm->desc.new_area_hint, ERTS_PAGEALIGNED_SIZE, 0);
+ ptr = os_mmap(mm->desc.new_area_hint, ERTS_PAGEALIGNED_SIZE, 0, 0);
if (ptr) {
mm->desc.new_area_hint = ptr+ERTS_PAGEALIGNED_SIZE;
ERTS_MMAP_SIZE_OS_INC(ERTS_PAGEALIGNED_SIZE);
@@ -1423,7 +1464,7 @@ alloc_desc_insert_free_seg(ErtsMemMapper* mm,
da_map = &mm->sua.map;
desc = lookup_free_seg(da_map, ERTS_PAGEALIGNED_SIZE);
if (desc) {
- if (mm->reserve_physical(desc->start, ERTS_PAGEALIGNED_SIZE))
+ if (mm->reserve_physical(desc->start, ERTS_PAGEALIGNED_SIZE, 0))
ERTS_MMAP_SIZE_SC_SUA_INC(ERTS_PAGEALIGNED_SIZE);
else
desc = NULL;
@@ -1433,7 +1474,7 @@ alloc_desc_insert_free_seg(ErtsMemMapper* mm,
da_map = &mm->sa.map;
desc = lookup_free_seg(da_map, ERTS_PAGEALIGNED_SIZE);
if (desc) {
- if (mm->reserve_physical(desc->start, ERTS_PAGEALIGNED_SIZE))
+ if (mm->reserve_physical(desc->start, ERTS_PAGEALIGNED_SIZE, 0))
ERTS_MMAP_SIZE_SC_SA_INC(ERTS_PAGEALIGNED_SIZE);
else
desc = NULL;
@@ -1494,7 +1535,7 @@ erts_mmap(ErtsMemMapper* mm, Uint32 flags, UWord *sizep)
if (desc) {
seg = desc->start;
end = seg+asize;
- if (!mm->reserve_physical(seg, asize))
+ if (!mm->reserve_physical(seg, asize, mm->executable))
goto supercarrier_reserve_failure;
if (desc->end == end) {
delete_free_seg(&mm->sua.map, desc);
@@ -1509,8 +1550,8 @@ erts_mmap(ErtsMemMapper* mm, Uint32 flags, UWord *sizep)
}
if (asize <= mm->sua.bot - mm->sa.top) {
- if (!mm->reserve_physical(mm->sua.bot - asize,
- asize))
+ if (!mm->reserve_physical(mm->sua.bot - asize, asize,
+ mm->executable))
goto supercarrier_reserve_failure;
mm->sua.bot -= asize;
seg = mm->sua.bot;
@@ -1526,7 +1567,8 @@ erts_mmap(ErtsMemMapper* mm, Uint32 flags, UWord *sizep)
char *start = seg = desc->start;
seg = (char *) ERTS_SUPERALIGNED_CEILING(seg);
end = seg+asize;
- if (!mm->reserve_physical(start, (UWord) (end - start)))
+ if (!mm->reserve_physical(start, (UWord) (end - start),
+ mm->executable))
goto supercarrier_reserve_failure;
ERTS_MMAP_SIZE_SC_SA_INC(asize);
if (desc->end == end) {
@@ -1558,7 +1600,8 @@ erts_mmap(ErtsMemMapper* mm, Uint32 flags, UWord *sizep)
if (asize + (seg - start) <= mm->sua.bot - start) {
end = seg + asize;
- if (!mm->reserve_physical(start, (UWord) (end - start)))
+ if (!mm->reserve_physical(start, (UWord) (end - start),
+ mm->executable))
goto supercarrier_reserve_failure;
mm->sa.top = end;
ERTS_MMAP_SIZE_SC_SA_INC(asize);
@@ -1580,7 +1623,8 @@ erts_mmap(ErtsMemMapper* mm, Uint32 flags, UWord *sizep)
seg = (char *) ERTS_SUPERALIGNED_CEILING(org_start);
end = seg + asize;
- if (!mm->reserve_physical(seg, (UWord) (org_end - seg)))
+ if (!mm->reserve_physical(seg, (UWord) (org_end - seg),
+ mm->executable))
goto supercarrier_reserve_failure;
ERTS_MMAP_SIZE_SC_SUA_INC(asize);
if (org_start != seg) {
@@ -1613,13 +1657,13 @@ erts_mmap(ErtsMemMapper* mm, Uint32 flags, UWord *sizep)
/* Map using OS primitives */
if (!(ERTS_MMAPFLG_SUPERCARRIER_ONLY & flags) && !mm->no_os_mmap) {
if (!(ERTS_MMAPFLG_SUPERALIGNED & flags)) {
- seg = os_mmap(NULL, asize, 0);
+ seg = os_mmap(NULL, asize, 0, mm->executable);
if (!seg)
goto failure;
}
else {
asize = ERTS_SUPERALIGNED_CEILING(*sizep);
- seg = os_mmap(NULL, asize, 1);
+ seg = os_mmap(NULL, asize, 1, mm->executable);
if (!seg)
goto failure;
@@ -1629,7 +1673,8 @@ erts_mmap(ErtsMemMapper* mm, Uint32 flags, UWord *sizep)
os_munmap(seg, asize);
- ptr = os_mmap(NULL, asize + ERTS_SUPERALIGNED_SIZE, 1);
+ ptr = os_mmap(NULL, asize + ERTS_SUPERALIGNED_SIZE, 1,
+ mm->executable);
if (!ptr)
goto failure;
@@ -1964,7 +2009,8 @@ erts_mremap(ErtsMemMapper* mm,
if (next && new_end <= next->end) {
if (!mm->reserve_physical(((char *) ptr) + old_size,
- asize - old_size))
+ asize - old_size,
+ mm->executable))
goto supercarrier_reserve_failure;
if (new_end < next->end)
resize_free_seg(&mm->sua.map, next, new_end, next->end);
@@ -1982,7 +2028,8 @@ erts_mremap(ErtsMemMapper* mm,
if (end == mm->sa.top) {
if (new_end <= mm->sua.bot) {
if (!mm->reserve_physical(((char *) ptr) + old_size,
- asize - old_size))
+ asize - old_size,
+ mm->executable))
goto supercarrier_reserve_failure;
mm->sa.top = new_end;
new_ptr = ptr;
@@ -1994,7 +2041,8 @@ erts_mremap(ErtsMemMapper* mm,
adjacent_free_seg(&mm->sa.map, start, end, &prev, &next);
if (next && new_end <= next->end) {
if (!mm->reserve_physical(((char *) ptr) + old_size,
- asize - old_size))
+ asize - old_size,
+ mm->executable))
goto supercarrier_reserve_failure;
if (new_end < next->end)
resize_free_seg(&mm->sa.map, next, new_end, next->end);
@@ -2112,7 +2160,7 @@ static void hard_dbg_mseg_init(void);
#endif
void
-erts_mmap_init(ErtsMemMapper* mm, ErtsMMapInit *init)
+erts_mmap_init(ErtsMemMapper* mm, ErtsMMapInit *init, int executable)
{
static int is_first_call = 1;
int virtual_map = 0;
@@ -2144,6 +2192,7 @@ erts_mmap_init(ErtsMemMapper* mm, ErtsMMapInit *init)
mm->supercarrier = 0;
mm->reserve_physical = reserve_noop;
mm->unreserve_physical = unreserve_noop;
+ mm->executable = executable;
#if HAVE_MMAP && !defined(MAP_ANON)
mm->mmap_fd = open("/dev/zero", O_RDWR);
@@ -2163,7 +2212,7 @@ erts_mmap_init(ErtsMemMapper* mm, ErtsMMapInit *init)
ptr = (char *) ERTS_PAGEALIGNED_CEILING(init->virtual_range.start);
end = (char *) ERTS_PAGEALIGNED_FLOOR(init->virtual_range.end);
sz = end - ptr;
- start = os_mmap_virtual(ptr, sz);
+ start = os_mmap_virtual(ptr, sz, executable);
if (!start || start > ptr || start >= end)
erts_exit(1,
"erts_mmap: Failed to create virtual range for super carrier\n");
@@ -2188,7 +2237,7 @@ erts_mmap_init(ErtsMemMapper* mm, ErtsMMapInit *init)
sz = ERTS_PAGEALIGNED_CEILING(init->scs);
#ifdef ERTS_HAVE_OS_PHYSICAL_MEMORY_RESERVATION
if (!init->scrpm) {
- start = os_mmap_virtual(NULL, sz);
+ start = os_mmap_virtual(NULL, sz, executable);
mm->reserve_physical = os_reserve_physical;
mm->unreserve_physical = os_unreserve_physical;
virtual_map = 1;
@@ -2200,7 +2249,7 @@ erts_mmap_init(ErtsMemMapper* mm, ErtsMMapInit *init)
* The whole supercarrier will by physically
* reserved all the time.
*/
- start = os_mmap(NULL, sz, 1);
+ start = os_mmap(NULL, sz, 1, executable);
}
if (!start)
erts_exit(1,
@@ -2274,7 +2323,7 @@ erts_mmap_init(ErtsMemMapper* mm, ErtsMMapInit *init)
mm->sua.top -= ERTS_PAGEALIGNED_SIZE;
mm->size.supercarrier.used.total += ERTS_PAGEALIGNED_SIZE;
#ifdef ERTS_HAVE_OS_PHYSICAL_MEMORY_RESERVATION
- if (!virtual_map || os_reserve_physical(mm->sua.top, ERTS_PAGEALIGNED_SIZE))
+ if (!virtual_map || os_reserve_physical(mm->sua.top, ERTS_PAGEALIGNED_SIZE, 0))
#endif
add_free_desc_area(mm, mm->sua.top, end);
mm->desc.reserved += (end - mm->sua.top) / sizeof(ErtsFreeSegDesc);
@@ -2287,7 +2336,7 @@ erts_mmap_init(ErtsMemMapper* mm, ErtsMMapInit *init)
* will be used for free segment descritors.
*/
#ifdef ERTS_HAVE_OS_PHYSICAL_MEMORY_RESERVATION
- if (virtual_map && !os_reserve_physical(start, mm->sa.bot - start))
+ if (virtual_map && !os_reserve_physical(start, mm->sa.bot - start, 0))
erts_exit(1, "erts_mmap: Failed to reserve physical memory for descriptors\n");
#endif
mm->desc.unused_start = start;
diff --git a/erts/emulator/sys/common/erl_mmap.h b/erts/emulator/sys/common/erl_mmap.h
index 67e131b53e..b3c45ba116 100644
--- a/erts/emulator/sys/common/erl_mmap.h
+++ b/erts/emulator/sys/common/erl_mmap.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2013. All Rights Reserved.
+ * Copyright Ericsson AB 2013-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -53,7 +53,12 @@ typedef struct {
#define ERTS_LITERAL_VIRTUAL_AREA_SIZE (UWORD_CONSTANT(1)*1024*1024*1024)
#define ERTS_MMAP_INIT_LITERAL_INITER \
- {{NULL, NULL}, {NULL, NULL}, ERTS_LITERAL_VIRTUAL_AREA_SIZE, 1, (1 << 16), 0}
+ {{NULL, NULL}, {NULL, NULL}, ERTS_LITERAL_VIRTUAL_AREA_SIZE, 1, (1 << 10), 0}
+
+#define ERTS_HIPE_EXEC_VIRTUAL_AREA_SIZE (UWORD_CONSTANT(512)*1024*1024)
+
+#define ERTS_MMAP_INIT_HIPE_EXEC_INITER \
+ {{NULL, NULL}, {NULL, NULL}, ERTS_HIPE_EXEC_VIRTUAL_AREA_SIZE, 1, (1 << 10), 0}
typedef struct ErtsMemMapper_ ErtsMemMapper;
@@ -61,7 +66,7 @@ void *erts_mmap(ErtsMemMapper*, Uint32 flags, UWord *sizep);
void erts_munmap(ErtsMemMapper*, Uint32 flags, void *ptr, UWord size);
void *erts_mremap(ErtsMemMapper*, Uint32 flags, void *ptr, UWord old_size, UWord *sizep);
int erts_mmap_in_supercarrier(ErtsMemMapper*, void *ptr);
-void erts_mmap_init(ErtsMemMapper*, ErtsMMapInit*);
+void erts_mmap_init(ErtsMemMapper*, ErtsMMapInit*, int executable);
struct erts_mmap_info_struct
{
UWord sizes[6];
@@ -126,10 +131,17 @@ Eterm erts_mmap_debug_info(ErtsMemMapper*, struct process*);
# define ERTS_HAVE_OS_MMAP 1
#endif
+#ifdef ERTS_WANT_MEM_MAPPERS
+# include "erl_alloc_types.h"
+
extern ErtsMemMapper erts_dflt_mmapper;
-#if defined(ARCH_64) && defined(ERTS_HAVE_OS_PHYSICAL_MEMORY_RESERVATION)
+# if defined(ARCH_64) && defined(ERTS_HAVE_OS_PHYSICAL_MEMORY_RESERVATION)
extern ErtsMemMapper erts_literal_mmapper;
-#endif
+# endif
+# ifdef ERTS_ALC_A_EXEC
+extern ErtsMemMapper erts_exec_mmapper;
+# endif
+#endif /* ERTS_WANT_MEM_MAPPERS */
/*#define HARD_DEBUG_MSEG*/
#ifdef HARD_DEBUG_MSEG
diff --git a/erts/emulator/sys/common/erl_mseg.c b/erts/emulator/sys/common/erl_mseg.c
index 286130bece..43e75e2573 100644
--- a/erts/emulator/sys/common/erl_mseg.c
+++ b/erts/emulator/sys/common/erl_mseg.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,6 +31,7 @@
# include "config.h"
#endif
+#define ERTS_WANT_MEM_MAPPERS
#include "sys.h"
#include "erl_mseg.h"
#include "global.h"
@@ -1402,9 +1403,15 @@ erts_mseg_init(ErtsMsegInit_t *init)
erts_mtx_init(&init_atoms_mutex, "mseg_init_atoms");
- erts_mmap_init(&erts_dflt_mmapper, &init->dflt_mmap);
+#ifdef ERTS_ALC_A_EXEC
+ /* Initialize erts_exec_mapper *FIRST*, to increase probability
+ * of getting low memory for HiPE AMD64's small code model.
+ */
+ erts_mmap_init(&erts_exec_mmapper, &init->exec_mmap, 1);
+#endif
+ erts_mmap_init(&erts_dflt_mmapper, &init->dflt_mmap, 0);
#if defined(ARCH_64) && defined(ERTS_HAVE_OS_PHYSICAL_MEMORY_RESERVATION)
- erts_mmap_init(&erts_literal_mmapper, &init->literal_mmap);
+ erts_mmap_init(&erts_literal_mmapper, &init->literal_mmap, 0);
#endif
if (!IS_2POW(GET_PAGE_SIZE))
diff --git a/erts/emulator/sys/common/erl_mseg.h b/erts/emulator/sys/common/erl_mseg.h
index 2acd8f8505..192e5767e4 100644
--- a/erts/emulator/sys/common/erl_mseg.h
+++ b/erts/emulator/sys/common/erl_mseg.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -61,6 +61,7 @@ typedef struct {
Uint nos;
ErtsMMapInit dflt_mmap;
ErtsMMapInit literal_mmap;
+ ErtsMMapInit exec_mmap;
} ErtsMsegInit_t;
#define ERTS_MSEG_INIT_DEFAULT_INITIALIZER \
@@ -70,7 +71,8 @@ typedef struct {
10, /* mcs: Max cache size */ \
1000, /* cci: Cache check interval */ \
ERTS_MMAP_INIT_DEFAULT_INITER, \
- ERTS_MMAP_INIT_LITERAL_INITER \
+ ERTS_MMAP_INIT_LITERAL_INITER, \
+ ERTS_MMAP_INIT_HIPE_EXEC_INITER \
}
typedef struct {
diff --git a/erts/emulator/sys/common/erl_mtrace_sys_wrap.c b/erts/emulator/sys/common/erl_mtrace_sys_wrap.c
index a8c575835a..fc871f94f1 100644
--- a/erts/emulator/sys/common/erl_mtrace_sys_wrap.c
+++ b/erts/emulator/sys/common/erl_mtrace_sys_wrap.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/common/erl_os_monotonic_time_extender.c b/erts/emulator/sys/common/erl_os_monotonic_time_extender.c
index 367b22d989..d53190fdd5 100644
--- a/erts/emulator/sys/common/erl_os_monotonic_time_extender.c
+++ b/erts/emulator/sys/common/erl_os_monotonic_time_extender.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2015. All Rights Reserved.
+ * Copyright Ericsson AB 2015-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/common/erl_poll.c b/erts/emulator/sys/common/erl_poll.c
index 36ee94111c..e394d84f73 100644
--- a/erts/emulator/sys/common/erl_poll.c
+++ b/erts/emulator/sys/common/erl_poll.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/common/erl_poll.h b/erts/emulator/sys/common/erl_poll.h
index bc2c681876..c16122610d 100644
--- a/erts/emulator/sys/common/erl_poll.h
+++ b/erts/emulator/sys/common/erl_poll.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/common/erl_sys_common_misc.c b/erts/emulator/sys/common/erl_sys_common_misc.c
index e292741bfa..79f87eb3a9 100644
--- a/erts/emulator/sys/common/erl_sys_common_misc.c
+++ b/erts/emulator/sys/common/erl_sys_common_misc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/common/erl_util_queue.h b/erts/emulator/sys/common/erl_util_queue.h
index b50e062dd5..73293e0225 100644
--- a/erts/emulator/sys/common/erl_util_queue.h
+++ b/erts/emulator/sys/common/erl_util_queue.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2013. All Rights Reserved.
+ * Copyright Ericsson AB 2013-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/unix/driver_int.h b/erts/emulator/sys/unix/driver_int.h
index a6b9085245..840b832878 100644
--- a/erts/emulator/sys/unix/driver_int.h
+++ b/erts/emulator/sys/unix/driver_int.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/unix/erl_child_setup.c b/erts/emulator/sys/unix/erl_child_setup.c
index 8dd14bbac6..6beb316350 100644
--- a/erts/emulator/sys/unix/erl_child_setup.c
+++ b/erts/emulator/sys/unix/erl_child_setup.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2015. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/unix/erl_main.c b/erts/emulator/sys/unix/erl_main.c
index c417bea622..972b93a505 100644
--- a/erts/emulator/sys/unix/erl_main.c
+++ b/erts/emulator/sys/unix/erl_main.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/unix/erl_unix_sys.h b/erts/emulator/sys/unix/erl_unix_sys.h
index 8b1822ca9f..241540b894 100644
--- a/erts/emulator/sys/unix/erl_unix_sys.h
+++ b/erts/emulator/sys/unix/erl_unix_sys.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -321,6 +321,7 @@ typedef void (*SIGFUNC)(int);
extern SIGFUNC sys_signal(int, SIGFUNC);
extern void sys_sigrelease(int);
extern void sys_sigblock(int);
+extern void sys_init_suspend_handler(void);
/*
* Handling of floating point exceptions.
diff --git a/erts/emulator/sys/unix/erl_unix_sys_ddll.c b/erts/emulator/sys/unix/erl_unix_sys_ddll.c
index daed5af1b6..8f1ceac883 100644
--- a/erts/emulator/sys/unix/erl_unix_sys_ddll.c
+++ b/erts/emulator/sys/unix/erl_unix_sys_ddll.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c
index 0a18e54389..6fb86f6dda 100644
--- a/erts/emulator/sys/unix/sys.c
+++ b/erts/emulator/sys/unix/sys.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -121,8 +121,10 @@ erts_smp_atomic_t sys_misc_mem_sz;
static void smp_sig_notify(char c);
static int sig_notify_fds[2] = {-1, -1};
+#if !defined(ETHR_UNUSABLE_SIGUSRX) && defined(ERTS_THR_HAVE_SIG_FUNCS)
static int sig_suspend_fds[2] = {-1, -1};
#define ERTS_SYS_SUSPEND_SIGNAL SIGUSR2
+#endif
#endif
@@ -678,7 +680,7 @@ sigusr1_exit(void)
#else
-#ifdef ERTS_SMP
+#ifdef ERTS_SYS_SUSPEND_SIGNAL
void
sys_thr_suspend(erts_tid_t tid) {
erts_thr_kill(tid, ERTS_SYS_SUSPEND_SIGNAL);
@@ -706,7 +708,7 @@ static RETSIGTYPE user_signal1(int signum)
#endif
}
-#ifdef ERTS_SMP
+#ifdef ERTS_SYS_SUSPEND_SIGNAL
#if (defined(SIG_SIGSET) || defined(SIG_SIGNAL))
static RETSIGTYPE suspend_signal(void)
#else
@@ -719,7 +721,7 @@ static RETSIGTYPE suspend_signal(int signum)
res = read(sig_suspend_fds[0], buf, sizeof(int));
} while (res < 0 && errno == EINTR);
}
-#endif /* #ifdef ERTS_SMP */
+#endif /* #ifdef ERTS_SYS_SUSPEND_SIGNAL */
#endif /* #ifndef ETHR_UNUSABLE_SIGUSRX */
@@ -772,13 +774,17 @@ void init_break_handler(void)
sys_signal(SIGINT, request_break);
#ifndef ETHR_UNUSABLE_SIGUSRX
sys_signal(SIGUSR1, user_signal1);
-#ifdef ERTS_SMP
- sys_signal(ERTS_SYS_SUSPEND_SIGNAL, suspend_signal);
-#endif /* #ifdef ERTS_SMP */
#endif /* #ifndef ETHR_UNUSABLE_SIGUSRX */
sys_signal(SIGQUIT, do_quit);
}
+void sys_init_suspend_handler(void)
+{
+#ifdef ERTS_SYS_SUSPEND_SIGNAL
+ sys_signal(ERTS_SYS_SUSPEND_SIGNAL, suspend_signal);
+#endif
+}
+
int sys_max_files(void)
{
return(max_files);
@@ -1323,12 +1329,14 @@ init_smp_sig_notify(void)
static void
init_smp_sig_suspend(void) {
+#ifdef ERTS_SYS_SUSPEND_SIGNAL
if (pipe(sig_suspend_fds) < 0) {
erts_exit(ERTS_ABORT_EXIT,
"Failed to create sig_suspend pipe: %s (%d)\n",
erl_errno_id(errno),
errno);
}
+#endif
}
#ifdef __DARWIN__
diff --git a/erts/emulator/sys/unix/sys_drivers.c b/erts/emulator/sys/unix/sys_drivers.c
index 82fea1b330..ac39b8a389 100644
--- a/erts/emulator/sys/unix/sys_drivers.c
+++ b/erts/emulator/sys/unix/sys_drivers.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/unix/sys_float.c b/erts/emulator/sys/unix/sys_float.c
index 89e2484b17..6435da086f 100644
--- a/erts/emulator/sys/unix/sys_float.c
+++ b/erts/emulator/sys/unix/sys_float.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ static void erts_init_fp_exception(void)
void erts_thread_init_fp_exception(void)
{
unsigned long *fpe = erts_alloc(ERTS_ALC_T_FP_EXCEPTION, sizeof(*fpe));
- *fpe = 0L;
+ *fpe = 0;
erts_tsd_set(fpe_key, fpe);
}
@@ -102,6 +102,17 @@ void erts_fp_check_init_error(volatile unsigned long *fpexnp)
#define __DARWIN__ 1
#endif
+/*
+ * Define two processor and possibly OS-specific primitives:
+ *
+ * static void unmask_fpe(void);
+ * -- unmask invalid, overflow, and divide-by-zero exceptions
+ *
+ * static int mask_fpe(void);
+ * -- mask invalid, overflow, and divide-by-zero exceptions
+ * -- return non-zero if the previous state was unmasked
+ */
+
#if (defined(__i386__) || defined(__x86_64__)) && defined(__GNUC__)
static void unmask_x87(void)
@@ -113,7 +124,6 @@ static void unmask_x87(void)
__asm__ __volatile__("fldcw %0" : : "m"(cw));
}
-/* mask x87 FPE, return true if the previous state was unmasked */
static int mask_x87(void)
{
unsigned short cw;
@@ -136,7 +146,6 @@ static void unmask_sse2(void)
__asm__ __volatile__("ldmxcsr %0" : : "m"(mxcsr));
}
-/* mask SSE2 FPE, return true if the previous state was unmasked */
static int mask_sse2(void)
{
unsigned int mxcsr;
@@ -257,21 +266,19 @@ static int cpu_has_sse2(void)
}
#endif /* !__x86_64__ */
-static void unmask_fpe(void)
+static void unmask_fpe_internal(void)
{
- __asm__ __volatile__("fnclex");
unmask_x87();
if (cpu_has_sse2())
unmask_sse2();
}
-static void unmask_fpe_conditional(int unmasked)
+static void unmask_fpe(void)
{
- if (unmasked)
- unmask_fpe();
+ __asm__ __volatile__("fnclex");
+ unmask_fpe_internal();
}
-/* mask x86 FPE, return true if the previous state was unmasked */
static int mask_fpe(void)
{
int unmasked;
@@ -285,9 +292,7 @@ static int mask_fpe(void)
void erts_restore_fpu(void)
{
__asm__ __volatile__("fninit");
- unmask_x87();
- if (cpu_has_sse2())
- unmask_sse2();
+ unmask_fpe_internal();
}
#elif defined(__sparc__) && defined(__linux__)
@@ -310,13 +315,6 @@ static void unmask_fpe(void)
__asm__ __volatile__(LDX " %0, %%fsr" : : "m"(fsr));
}
-static void unmask_fpe_conditional(int unmasked)
-{
- if (unmasked)
- unmask_fpe();
-}
-
-/* mask SPARC FPE, return true if the previous state was unmasked */
static int mask_fpe(void)
{
unsigned long fsr;
@@ -431,13 +429,6 @@ static void unmask_fpe(void)
set_fpscr(0x80|0x40|0x10); /* VE, OE, ZE; not UE or XE */
}
-static void unmask_fpe_conditional(int unmasked)
-{
- if (unmasked)
- unmask_fpe();
-}
-
-/* mask PowerPC FPE, return true if the previous state was unmasked */
static int mask_fpe(void)
{
int unmasked;
@@ -447,20 +438,13 @@ static int mask_fpe(void)
return unmasked;
}
-#else
+#else /* !(x86 || (sparc && linux) || (powerpc && (linux || darwin))) */
static void unmask_fpe(void)
{
fpsetmask(FP_X_INV | FP_X_OFL | FP_X_DZ);
}
-static void unmask_fpe_conditional(int unmasked)
-{
- if (unmasked)
- unmask_fpe();
-}
-
-/* mask IEEE FPE, return true if previous state was unmasked */
static int mask_fpe(void)
{
const fp_except unmasked_mask = FP_X_INV | FP_X_OFL | FP_X_DZ;
@@ -472,6 +456,16 @@ static int mask_fpe(void)
#endif
+/*
+ * Define a processor and OS-specific SIGFPE handler.
+ *
+ * The effect of receiving a SIGFPE should be:
+ * 1. Update the processor context:
+ * a) on x86: mask FP exceptions, do not skip faulting instruction
+ * b) on SPARC and PowerPC: unmask FP exceptions, skip faulting instruction
+ * 2. call set_current_fp_exception with the PC of the faulting instruction
+ */
+
#if (defined(__linux__) && (defined(__i386__) || defined(__x86_64__) || defined(__sparc__) || defined(__powerpc__))) || (defined(__DARWIN__) && (defined(__i386__) || defined(__x86_64__) || defined(__ppc__))) || (defined(__FreeBSD__) && (defined(__x86_64__) || defined(__i386__))) || ((defined(__NetBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)) || (defined(__sun__) && defined(__x86_64__))
#if defined(__linux__) && defined(__i386__)
@@ -520,8 +514,7 @@ static void fpe_sig_action(int sig, siginfo_t *si, void *puc)
ucontext_t *uc = puc;
unsigned long pc;
-#if defined(__linux__)
-#if defined(__x86_64__)
+#if defined(__linux__) && defined(__x86_64__)
mcontext_t *mc = &uc->uc_mcontext;
fpregset_t fpstate = mc->fpregs;
pc = mc_pc(mc);
@@ -533,26 +526,26 @@ static void fpe_sig_action(int sig, siginfo_t *si, void *puc)
set encoding makes that a poor solution here. */
fpstate->mxcsr = 0x1F80;
fpstate->swd &= ~0xFF;
-#elif defined(__i386__)
+#elif defined(__linux__) && defined(__i386__)
mcontext_t *mc = &uc->uc_mcontext;
fpregset_t fpstate = mc->fpregs;
pc = mc_pc(mc);
if ((fpstate->status >> 16) == X86_FXSR_MAGIC)
((struct _fpstate*)fpstate)->mxcsr = 0x1F80;
fpstate->sw &= ~0xFF;
-#elif defined(__sparc__) && defined(__arch64__)
+#elif defined(__linux__) && defined(__sparc__) && defined(__arch64__)
/* on SPARC the 3rd parameter points to a sigcontext not a ucontext */
struct sigcontext *sc = (struct sigcontext*)puc;
pc = sc->sigc_regs.tpc;
sc->sigc_regs.tpc = sc->sigc_regs.tnpc;
sc->sigc_regs.tnpc += 4;
-#elif defined(__sparc__)
+#elif defined(__linux__) && defined(__sparc__)
/* on SPARC the 3rd parameter points to a sigcontext not a ucontext */
struct sigcontext *sc = (struct sigcontext*)puc;
pc = sc->si_regs.pc;
sc->si_regs.pc = sc->si_regs.npc;
sc->si_regs.npc = (unsigned long)sc->si_regs.npc + 4;
-#elif defined(__powerpc__)
+#elif defined(__linux__) && defined(__powerpc__)
#if defined(__powerpc64__)
mcontext_t *mc = &uc->uc_mcontext;
unsigned long *regs = &mc->gp_regs[0];
@@ -563,7 +556,6 @@ static void fpe_sig_action(int sig, siginfo_t *si, void *puc)
pc = regs[PT_NIP];
regs[PT_NIP] += 4;
regs[PT_FPSCR] = 0x80|0x40|0x10; /* VE, OE, ZE; not UE or XE */
-#endif
#elif defined(__DARWIN__) && (defined(__i386__) || defined(__x86_64__))
# error "Floating-point exceptions not supported on MacOS X"
#elif defined(__DARWIN__) && defined(__ppc__)
@@ -621,7 +613,7 @@ static void fpe_sig_action(int sig, siginfo_t *si, void *puc)
#endif
#if 0
{
- char buf[64];
+ char buf[128];
snprintf(buf, sizeof buf, "%s: FPE at %p\r\n", __FUNCTION__, (void*)pc);
write(2, buf, strlen(buf));
}
@@ -706,7 +698,8 @@ int erts_sys_block_fpe(void)
void erts_sys_unblock_fpe(int unmasked)
{
- unmask_fpe_conditional(unmasked);
+ if (unmasked)
+ unmask_fpe();
}
#endif
@@ -818,11 +811,6 @@ sys_chars_to_double(char* buf, double* fp)
int
matherr(struct exception *exc)
{
-#if !defined(NO_FPE_SIGNALS)
- volatile unsigned long *fpexnp = erts_get_current_fp_exception();
- if (fpexnp != NULL)
- *fpexnp = (unsigned long)__builtin_return_address(0);
-#endif
return 1;
}
diff --git a/erts/emulator/sys/unix/sys_time.c b/erts/emulator/sys/unix/sys_time.c
index 8ce02506ab..60f8decd96 100644
--- a/erts/emulator/sys/unix/sys_time.c
+++ b/erts/emulator/sys/unix/sys_time.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/unix/sys_uds.c b/erts/emulator/sys/unix/sys_uds.c
index 015d0346a1..dd0a3b03ff 100644
--- a/erts/emulator/sys/unix/sys_uds.c
+++ b/erts/emulator/sys/unix/sys_uds.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/unix/sys_uds.h b/erts/emulator/sys/unix/sys_uds.h
index 844a2804d8..a598102d5c 100644
--- a/erts/emulator/sys/unix/sys_uds.h
+++ b/erts/emulator/sys/unix/sys_uds.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/win32/dosmap.c b/erts/emulator/sys/win32/dosmap.c
index a98065c666..95fbba384b 100644
--- a/erts/emulator/sys/win32/dosmap.c
+++ b/erts/emulator/sys/win32/dosmap.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/win32/driver_int.h b/erts/emulator/sys/win32/driver_int.h
index b931da52f5..50097d3fd2 100644
--- a/erts/emulator/sys/win32/driver_int.h
+++ b/erts/emulator/sys/win32/driver_int.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/win32/erl_main.c b/erts/emulator/sys/win32/erl_main.c
index 21d9a58da6..9eee300f48 100644
--- a/erts/emulator/sys/win32/erl_main.c
+++ b/erts/emulator/sys/win32/erl_main.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/win32/erl_poll.c b/erts/emulator/sys/win32/erl_poll.c
index 9c1bef5f4f..94f3840b5f 100644
--- a/erts/emulator/sys/win32/erl_poll.c
+++ b/erts/emulator/sys/win32/erl_poll.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2007-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/win32/erl_win32_sys_ddll.c b/erts/emulator/sys/win32/erl_win32_sys_ddll.c
index 7c24a77e31..274133a346 100644
--- a/erts/emulator/sys/win32/erl_win32_sys_ddll.c
+++ b/erts/emulator/sys/win32/erl_win32_sys_ddll.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/win32/erl_win_dyn_driver.h b/erts/emulator/sys/win32/erl_win_dyn_driver.h
index 9c699fdba0..6f28d513c2 100644
--- a/erts/emulator/sys/win32/erl_win_dyn_driver.h
+++ b/erts/emulator/sys/win32/erl_win_dyn_driver.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/win32/erl_win_sys.h b/erts/emulator/sys/win32/erl_win_sys.h
index 99c1066ab3..7bdfac168b 100644
--- a/erts/emulator/sys/win32/erl_win_sys.h
+++ b/erts/emulator/sys/win32/erl_win_sys.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/win32/sys.c b/erts/emulator/sys/win32/sys.c
index ea7523ddc2..cf821b05cb 100644
--- a/erts/emulator/sys/win32/sys.c
+++ b/erts/emulator/sys/win32/sys.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -3079,6 +3079,8 @@ erl_bin_write(buf, sz, max)
}
}
+#endif /* DEBUG */
+
void
erl_assert_error(const char* expr, const char* func, const char* file, int line)
{
@@ -3094,7 +3096,6 @@ erl_assert_error(const char* expr, const char* func, const char* file, int line)
DebugBreak();
}
-#endif /* DEBUG */
static void
check_supported_os_version(void)
diff --git a/erts/emulator/sys/win32/sys_env.c b/erts/emulator/sys/win32/sys_env.c
index 67b6e55377..21ef71ad9a 100644
--- a/erts/emulator/sys/win32/sys_env.c
+++ b/erts/emulator/sys/win32/sys_env.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/win32/sys_float.c b/erts/emulator/sys/win32/sys_float.c
index 86e822da5b..2b2d6ab7d3 100644
--- a/erts/emulator/sys/win32/sys_float.c
+++ b/erts/emulator/sys/win32/sys_float.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -139,8 +139,7 @@ sys_double_to_chars_ext(double fp, char *buffer, size_t buffer_size, size_t deci
int
matherr(struct _exception *exc)
{
- erl_fp_exception = 1;
- DEBUGF(("FP exception (matherr) (0x%x) (%d)\n", exc->type, erl_fp_exception));
+ DEBUGF(("FP exception (matherr) (0x%x)\n", exc->type));
return 1;
}
diff --git a/erts/emulator/sys/win32/sys_interrupt.c b/erts/emulator/sys/win32/sys_interrupt.c
index a89211fa8e..df838960eb 100644
--- a/erts/emulator/sys/win32/sys_interrupt.c
+++ b/erts/emulator/sys/win32/sys_interrupt.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2012. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/sys/win32/sys_time.c b/erts/emulator/sys/win32/sys_time.c
index 9a9d90610d..e8c67b3928 100644
--- a/erts/emulator/sys/win32/sys_time.c
+++ b/erts/emulator/sys/win32/sys_time.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/Makefile b/erts/emulator/test/Makefile
index 318db4b45e..de395dfb97 100644
--- a/erts/emulator/test/Makefile
+++ b/erts/emulator/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -70,6 +70,7 @@ MODULES= \
hash_SUITE \
hibernate_SUITE \
list_bif_SUITE \
+ lttng_SUITE \
map_SUITE \
match_spec_SUITE \
module_info_SUITE \
@@ -109,8 +110,11 @@ MODULES= \
trace_meta_SUITE \
trace_call_count_SUITE \
trace_call_time_SUITE \
+ tracer_SUITE \
+ tracer_test \
scheduler_SUITE \
old_scheduler_SUITE \
+ port_trace_SUITE \
unique_SUITE \
z_SUITE \
old_mod \
diff --git a/erts/emulator/test/a_SUITE.erl b/erts/emulator/test/a_SUITE.erl
index 5b3a213154..880c5a5821 100644
--- a/erts/emulator/test/a_SUITE.erl
+++ b/erts/emulator/test/a_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/after_SUITE.erl b/erts/emulator/test/after_SUITE.erl
index a72cd8deea..4f20ad3656 100644
--- a/erts/emulator/test/after_SUITE.erl
+++ b/erts/emulator/test/after_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/alloc_SUITE.erl b/erts/emulator/test/alloc_SUITE.erl
index 1f690c5015..5fb560d1ec 100644
--- a/erts/emulator/test/alloc_SUITE.erl
+++ b/erts/emulator/test/alloc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -55,21 +55,13 @@ end_per_testcase(_Case, Config) when is_list(Config) ->
%% %%
basic(Cfg) -> drv_case(Cfg).
-
coalesce(Cfg) -> drv_case(Cfg).
-
threads(Cfg) -> drv_case(Cfg).
-
realloc_copy(Cfg) -> drv_case(Cfg).
-
bucket_index(Cfg) -> drv_case(Cfg).
-
bucket_mask(Cfg) -> drv_case(Cfg).
-
rbtree(Cfg) -> drv_case(Cfg).
-
mseg_clear_cache(Cfg) -> drv_case(Cfg).
-
cpool(Cfg) -> drv_case(Cfg).
migration(Cfg) ->
@@ -81,7 +73,7 @@ migration(Cfg) ->
end.
erts_mmap(Config) when is_list(Config) ->
- case test_server:os_type() of
+ case os:type() of
{unix, _} ->
[erts_mmap_do(Config, SCO, SCRPM, SCRFSD)
|| SCO <-[true,false], SCRFSD <-[1234,0], SCRPM <- [true,false]];
@@ -109,25 +101,26 @@ erts_mmap_do(Config, SCO, SCRPM, SCRFSD) ->
{ok, Node} = start_node(Config, Opts),
Self = self(),
Ref = make_ref(),
- F = fun () ->
- SI = erlang:system_info({allocator,mseg_alloc}),
- {erts_mmap,EM} = lists:keyfind(erts_mmap, 1, SI),
- {supercarrier,SC} = lists:keyfind(supercarrier, 1, EM),
- {sizes,Sizes} = lists:keyfind(sizes, 1, SC),
- {free_segs,Segs} = lists:keyfind(free_segs,1,SC),
- {total,Total} = lists:keyfind(total,1,Sizes),
- Total = SCS*1024*1024,
-
- {reserved,Reserved} = lists:keyfind(reserved,1,Segs),
- true = (Reserved >= SCRFSD),
-
- case {SCO,lists:keyfind(os,1,EM)} of
- {true, false} -> ok;
- {false, {os,_}} -> ok
- end,
-
- Self ! {Ref, ok}
- end,
+ F = fun() ->
+ SI = erlang:system_info({allocator,mseg_alloc}),
+ {erts_mmap,EM} = lists:keyfind(erts_mmap, 1, SI),
+ {supercarrier,SC} = lists:keyfind(supercarrier, 1, EM),
+ {sizes,Sizes} = lists:keyfind(sizes, 1, SC),
+ {free_segs,Segs} = lists:keyfind(free_segs,1,SC),
+ {total,Total} = lists:keyfind(total,1,Sizes),
+ io:format("Expecting total ~w, got ~w~n", [SCS*1024*1024,Total]),
+ Total = SCS*1024*1024,
+
+ {reserved,Reserved} = lists:keyfind(reserved,1,Segs),
+ true = (Reserved >= SCRFSD),
+
+ case {SCO,lists:keyfind(os,1,EM)} of
+ {true, false} -> ok;
+ {false, {os,_}} -> ok
+ end,
+
+ Self ! {Ref, ok}
+ end,
spawn_link(Node, F),
Result = receive {Ref, Rslt} -> Rslt end,
@@ -144,7 +137,7 @@ drv_case(Config) ->
drv_case(Config, one_shot, "").
drv_case(Config, Mode, NodeOpts) when is_list(Config) ->
- case test_server:os_type() of
+ case os:type() of
{Family, _} when Family == unix; Family == win32 ->
{ok, Node} = start_node(Config, NodeOpts),
Self = self(),
diff --git a/erts/emulator/test/alloc_SUITE_data/cpool.c b/erts/emulator/test/alloc_SUITE_data/cpool.c
index 73026cc758..0c41f4d747 100644
--- a/erts/emulator/test/alloc_SUITE_data/cpool.c
+++ b/erts/emulator/test/alloc_SUITE_data/cpool.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2013. All Rights Reserved.
+ * Copyright Ericsson AB 2013-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/alloc_SUITE_data/migration.c b/erts/emulator/test/alloc_SUITE_data/migration.c
index b006360043..b9a4de03b3 100644
--- a/erts/emulator/test/alloc_SUITE_data/migration.c
+++ b/erts/emulator/test/alloc_SUITE_data/migration.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2014. All Rights Reserved.
+ * Copyright Ericsson AB 2014-2016. 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
diff --git a/erts/emulator/test/beam_SUITE.erl b/erts/emulator/test/beam_SUITE.erl
index 07dfeb6633..6a54fa87e0 100644
--- a/erts/emulator/test/beam_SUITE.erl
+++ b/erts/emulator/test/beam_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,17 +24,19 @@
init_per_group/2,end_per_group/2,
packed_registers/1, apply_last/1, apply_last_bif/1,
buildo_mucho/1, heap_sizes/1, big_lists/1, fconv/1,
- select_val/1]).
+ select_val/1, swap_temp_apply/1]).
--export([applied/2]).
+-export([applied/2,swap_temp_applied/1]).
-include_lib("common_test/include/ct.hrl").
+-include_lib("syntax_tools/include/merl.hrl").
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
[packed_registers, apply_last, apply_last_bif,
- buildo_mucho, heap_sizes, big_lists, select_val].
+ buildo_mucho, heap_sizes, big_lists, select_val,
+ swap_temp_apply].
groups() ->
[].
@@ -92,48 +94,46 @@ applied(Starter, N) ->
apply_last_bif(Config) when is_list(Config) ->
apply(erlang, abs, [1]).
-%% Test three high register numbers in a put_list instruction
-%% (to test whether packing works properly).
+%% Test whether packing works properly.
packed_registers(Config) when is_list(Config) ->
- PrivDir = proplists:get_value(priv_dir, Config),
- Mod = packed_regs,
- Name = filename:join(PrivDir, atom_to_list(Mod) ++ ".erl"),
-
- %% Generate a module which generates a list of tuples.
- %% put_list(A) -> [{A, 600}, {A, 999}, ... {A, 0}].
- Code = gen_packed_regs(600, ["-module("++atom_to_list(Mod)++").\n",
- "-export([put_list/1]).\n",
- "put_list(A) ->\n["]),
- ok = file:write_file(Name, Code),
-
- %% Compile the module.
- io:format("Compiling: ~s\n", [Name]),
- CompRc = compile:file(Name, [{outdir, PrivDir}, report]),
- io:format("Result: ~p\n",[CompRc]),
- {ok, Mod} = CompRc,
-
- %% Load it.
- io:format("Loading...\n",[]),
- LoadRc = code:load_abs(filename:join(PrivDir, atom_to_list(Mod))),
- {module,_Module} = LoadRc,
-
- %% Call it and verify result.
- Term = {a, b},
- L = Mod:put_list(Term),
- verify_packed_regs(L, Term, 600),
+ Mod = ?FUNCTION_NAME,
+
+ %% Generate scrambled sequence.
+ Seq0 = [{erlang:phash2(I),I} || I <- lists:seq(0, 260)],
+ Seq = [I || {_,I} <- lists:sort(Seq0)],
+
+ %% Generate a test modules that uses get_list/3 instructions
+ %% with high register numbers.
+ S0 = [begin
+ VarName = list_to_atom("V"++integer_to_list(V)),
+ {merl:var(VarName),V}
+ end || V <- Seq],
+ Vars = [V || {V,_} <- S0],
+ NewVars = [begin
+ VarName = list_to_atom("M"++integer_to_list(V)),
+ merl:var(VarName)
+ end || V <- Seq],
+ S = [?Q("_@Var = id(_@Value@)") || {Var,Value} <- S0],
+ Code = ?Q(["-module('@Mod@').\n"
+ "-export([f/0]).\n"
+ "f() ->\n"
+ "_@S,\n"
+ "_ = id(0),\n"
+ "L = [_@Vars],\n"
+ "_ = id(1),\n"
+ "[_@NewVars] = L,\n" %Test get_list/3.
+ "_ = id(2),\n"
+ "id([_@Vars,_@NewVars]).\n"
+ "id(I) -> I.\n"]),
+ merl:compile_and_load(Code),
+ CombinedSeq = Seq ++ Seq,
+ CombinedSeq = Mod:f(),
+
+ %% Clean up.
+ true = code:delete(Mod),
+ false = code:purge(Mod),
ok.
-gen_packed_regs(0, Acc) ->
- [Acc|"{A,0}].\n"];
-gen_packed_regs(N, Acc) ->
- gen_packed_regs(N-1, [Acc,"{A,",integer_to_list(N)|"},\n"]).
-
-verify_packed_regs([], _, -1) -> ok;
-verify_packed_regs([{Term, N}| T], Term, N) ->
- verify_packed_regs(T, Term, N-1);
-verify_packed_regs(L, Term, N) ->
- ct:fail("Expected [{~p, ~p}|T]; got\n~p\n", [Term, N, L]).
-
buildo_mucho(Config) when is_list(Config) ->
buildo_mucho_1(),
ok.
@@ -346,3 +346,41 @@ do_select_val(X) ->
Int when is_integer(Int) ->
integer
end.
+
+swap_temp_apply(_Config) ->
+ {swap_temp_applied,42} = do_swap_temp_apply(41),
+ not_an_integer = do_swap_temp_apply(not_an_integer),
+ ok.
+
+do_swap_temp_apply(Msg) ->
+ case swap_temp_apply_function(Msg) of
+ undefined -> Msg;
+ Type ->
+ %% The following sequence:
+ %% move {x,0} {x,2}
+ %% move {y,0} {x,0}
+ %% move {x,2} {y,0}
+ %% apply 1
+ %%
+ %% Would be incorrectly transformed to:
+ %% swap {x,0} {y,0}
+ %% apply 1
+ %%
+ %% ({x,1} is the module, {x,2} the function to be applied).
+ %%
+ %% If the instructions are to be transformed, the correct
+ %% transformation is:
+ %%
+ %% swap_temp {x,0} {y,0} {x,2}
+ %% apply 1
+ Fields = ?MODULE:Type(Msg),
+ {Type,Fields}
+ end.
+
+swap_temp_apply_function(Int) when is_integer(Int) ->
+ swap_temp_applied;
+swap_temp_apply_function(_) ->
+ undefined.
+
+swap_temp_applied(Int) ->
+ Int+1.
diff --git a/erts/emulator/test/beam_literals_SUITE.erl b/erts/emulator/test/beam_literals_SUITE.erl
index b013ff5fbb..09761263e2 100644
--- a/erts/emulator/test/beam_literals_SUITE.erl
+++ b/erts/emulator/test/beam_literals_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/bif_SUITE.erl b/erts/emulator/test/bif_SUITE.erl
index 43d00e699a..26bb416bf0 100644
--- a/erts/emulator/test/bif_SUITE.erl
+++ b/erts/emulator/test/bif_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/big_SUITE.erl b/erts/emulator/test/big_SUITE.erl
index d331083661..402751393a 100644
--- a/erts/emulator/test/big_SUITE.erl
+++ b/erts/emulator/test/big_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/big_SUITE_data/literal_test.erl b/erts/emulator/test/big_SUITE_data/literal_test.erl
index 1620693bfa..17c4db467a 100644
--- a/erts/emulator/test/big_SUITE_data/literal_test.erl
+++ b/erts/emulator/test/big_SUITE_data/literal_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/binary_SUITE.erl b/erts/emulator/test/binary_SUITE.erl
index fcd49e43d3..1c7d278bb0 100644
--- a/erts/emulator/test/binary_SUITE.erl
+++ b/erts/emulator/test/binary_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/bs_bincomp_SUITE.erl b/erts/emulator/test/bs_bincomp_SUITE.erl
index 8836fe40ae..c481e93e41 100644
--- a/erts/emulator/test/bs_bincomp_SUITE.erl
+++ b/erts/emulator/test/bs_bincomp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/bs_bit_binaries_SUITE.erl b/erts/emulator/test/bs_bit_binaries_SUITE.erl
index dd056d10af..d393bc5b91 100644
--- a/erts/emulator/test/bs_bit_binaries_SUITE.erl
+++ b/erts/emulator/test/bs_bit_binaries_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/bs_construct_SUITE.erl b/erts/emulator/test/bs_construct_SUITE.erl
index 8deb0c7422..941cb435f7 100644
--- a/erts/emulator/test/bs_construct_SUITE.erl
+++ b/erts/emulator/test/bs_construct_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/bs_match_bin_SUITE.erl b/erts/emulator/test/bs_match_bin_SUITE.erl
index 6f7abf8c4e..f5c996ae9e 100644
--- a/erts/emulator/test/bs_match_bin_SUITE.erl
+++ b/erts/emulator/test/bs_match_bin_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/bs_match_int_SUITE.erl b/erts/emulator/test/bs_match_int_SUITE.erl
index 42d692c1ba..a7bd4b8ac3 100644
--- a/erts/emulator/test/bs_match_int_SUITE.erl
+++ b/erts/emulator/test/bs_match_int_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/bs_match_misc_SUITE.erl b/erts/emulator/test/bs_match_misc_SUITE.erl
index 114d7ecb36..17759d78f3 100644
--- a/erts/emulator/test/bs_match_misc_SUITE.erl
+++ b/erts/emulator/test/bs_match_misc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/bs_match_tail_SUITE.erl b/erts/emulator/test/bs_match_tail_SUITE.erl
index 8392a0df47..cbebc554c7 100644
--- a/erts/emulator/test/bs_match_tail_SUITE.erl
+++ b/erts/emulator/test/bs_match_tail_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/bs_utf_SUITE.erl b/erts/emulator/test/bs_utf_SUITE.erl
index f1c09bfbb0..a344f5c456 100644
--- a/erts/emulator/test/bs_utf_SUITE.erl
+++ b/erts/emulator/test/bs_utf_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/busy_port_SUITE.erl b/erts/emulator/test/busy_port_SUITE.erl
index c582f8d77b..bb0632ae08 100644
--- a/erts/emulator/test/busy_port_SUITE.erl
+++ b/erts/emulator/test/busy_port_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/busy_port_SUITE_data/Makefile.src b/erts/emulator/test/busy_port_SUITE_data/Makefile.src
index 0f2842e515..ae6378a6ff 100644
--- a/erts/emulator/test/busy_port_SUITE_data/Makefile.src
+++ b/erts/emulator/test/busy_port_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2013. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/busy_port_SUITE_data/hard_busy_drv.c b/erts/emulator/test/busy_port_SUITE_data/hard_busy_drv.c
index f83fa1eeaa..c4e0f13f06 100644
--- a/erts/emulator/test/busy_port_SUITE_data/hard_busy_drv.c
+++ b/erts/emulator/test/busy_port_SUITE_data/hard_busy_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/busy_port_SUITE_data/hs_busy_drv.c b/erts/emulator/test/busy_port_SUITE_data/hs_busy_drv.c
index be913cf56e..ffaca18e90 100644
--- a/erts/emulator/test/busy_port_SUITE_data/hs_busy_drv.c
+++ b/erts/emulator/test/busy_port_SUITE_data/hs_busy_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/busy_port_SUITE_data/scheduling_drv.c b/erts/emulator/test/busy_port_SUITE_data/scheduling_drv.c
index 40e42b6ac2..296b3f21de 100644
--- a/erts/emulator/test/busy_port_SUITE_data/scheduling_drv.c
+++ b/erts/emulator/test/busy_port_SUITE_data/scheduling_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/busy_port_SUITE_data/soft_busy_drv.c b/erts/emulator/test/busy_port_SUITE_data/soft_busy_drv.c
index 3c5bafb451..8a98f050f1 100644
--- a/erts/emulator/test/busy_port_SUITE_data/soft_busy_drv.c
+++ b/erts/emulator/test/busy_port_SUITE_data/soft_busy_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/call_trace_SUITE.erl b/erts/emulator/test/call_trace_SUITE.erl
index 4ec18aa49e..6ba6301c7c 100644
--- a/erts/emulator/test/call_trace_SUITE.erl
+++ b/erts/emulator/test/call_trace_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -84,32 +84,46 @@ process_specs(Config) when is_list(Config) ->
{tracer,Tracer} = trace_info(self(), tracer),
trace_func({?MODULE,worker_foo,1}, []),
- %% Test the 'new' flag.
-
- {Work1A,Work1B} = start_and_trace(new, [1,2,3], A1B={3,2,1}),
- {flags,[]} = trace_info(Work1A, flags),
- {tracer,[]} = trace_info(Work1A, tracer),
- {tracer,Tracer} = trace_info(Work1B, tracer),
- {flags,[call]} = trace_info(Work1B, flags),
- expect({trace,Work1B,call,{?MODULE,worker_foo,[A1B]}}),
- unlink(Work1B),
- Mref = erlang:monitor(process, Work1B),
- exit(Work1B, kill),
- receive
- {'DOWN',Mref,_,_,_} -> ok
- end,
- undefined = trace_info(Work1B, flags),
- {flags,[]} = trace_info(new, flags),
- {tracer,[]} = trace_info(new, tracer),
-
- %% Test the 'existing' flag.
- {Work2A,_Work2B} = start_and_trace(existing, A2A=[5,6,7], [7,6,5]),
- expect({trace,Work2A,call,{?MODULE,worker_foo,[A2A]}}),
-
- %% Test the 'all' flag.
- {Work3A,Work3B} = start_and_trace(all, A3A=[12,13], A3B=[13,12]),
- expect({trace,Work3A,call,{?MODULE,worker_foo,[A3A]}}),
- expect({trace,Work3B,call,{?MODULE,worker_foo,[A3B]}}),
+ %% Test the 'new' and 'new_processes' flags.
+
+ New = fun(Flag) ->
+ {Work1A,Work1B} = start_and_trace(Flag, [1,2,3], A1B={3,2,1}),
+ {flags,[]} = trace_info(Work1A, flags),
+ {tracer,[]} = trace_info(Work1A, tracer),
+ {tracer,Tracer} = trace_info(Work1B, tracer),
+ {flags,[call]} = trace_info(Work1B, flags),
+ expect({trace,Work1B,call,{?MODULE,worker_foo,[A1B]}}),
+ unlink(Work1B),
+ Mref = erlang:monitor(process, Work1B),
+ exit(Work1B, kill),
+ receive
+ {'DOWN',Mref,_,_,_} -> ok
+ end,
+ undefined = trace_info(Work1B, flags),
+ {flags,[]} = trace_info(Flag, flags),
+ {tracer,[]} = trace_info(Flag, tracer)
+ end,
+ New(new),
+ New(new_processes),
+
+ %% Test the 'existing' and 'existing_processes' flags.
+ Existing =
+ fun(Flag) ->
+ {Work2A,_Work2B} = start_and_trace(Flag, A2A=[5,6,7], [7,6,5]),
+ expect({trace,Work2A,call,{?MODULE,worker_foo,[A2A]}})
+ end,
+ Existing(existing),
+ Existing(existing_processes),
+
+ %% Test the 'all' and 'processes' flags.
+ All =
+ fun(Flag) ->
+ {Work3A,Work3B} = start_and_trace(Flag, A3A=[12,13], A3B=[13,12]),
+ expect({trace,Work3A,call,{?MODULE,worker_foo,[A3A]}}),
+ expect({trace,Work3B,call,{?MODULE,worker_foo,[A3B]}})
+ end,
+ All(all),
+ All(processes),
ok.
diff --git a/erts/emulator/test/code_SUITE.erl b/erts/emulator/test/code_SUITE.erl
index db285a3977..29b95ef674 100644
--- a/erts/emulator/test/code_SUITE.erl
+++ b/erts/emulator/test/code_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/code_SUITE_data/another_code_test.erl b/erts/emulator/test/code_SUITE_data/another_code_test.erl
index f6f9e32996..5708ec682c 100644
--- a/erts/emulator/test/code_SUITE_data/another_code_test.erl
+++ b/erts/emulator/test/code_SUITE_data/another_code_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/code_SUITE_data/cpbugx.erl b/erts/emulator/test/code_SUITE_data/cpbugx.erl
index ea01ce411b..ae2075c867 100644
--- a/erts/emulator/test/code_SUITE_data/cpbugx.erl
+++ b/erts/emulator/test/code_SUITE_data/cpbugx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/code_SUITE_data/fun_confusion.erl b/erts/emulator/test/code_SUITE_data/fun_confusion.erl
index 8d42937d3c..35279f241d 100644
--- a/erts/emulator/test/code_SUITE_data/fun_confusion.erl
+++ b/erts/emulator/test/code_SUITE_data/fun_confusion.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/code_SUITE_data/literals.erl b/erts/emulator/test/code_SUITE_data/literals.erl
index a36bfe09dd..7c3b0ebe73 100644
--- a/erts/emulator/test/code_SUITE_data/literals.erl
+++ b/erts/emulator/test/code_SUITE_data/literals.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/code_SUITE_data/many_funs.erl b/erts/emulator/test/code_SUITE_data/many_funs.erl
index e832f271d0..ada570feee 100644
--- a/erts/emulator/test/code_SUITE_data/many_funs.erl
+++ b/erts/emulator/test/code_SUITE_data/many_funs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/code_SUITE_data/my_code_test.erl b/erts/emulator/test/code_SUITE_data/my_code_test.erl
index 57d867a5ac..d2386157d6 100644
--- a/erts/emulator/test/code_SUITE_data/my_code_test.erl
+++ b/erts/emulator/test/code_SUITE_data/my_code_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/code_SUITE_data/versions.erl b/erts/emulator/test/code_SUITE_data/versions.erl
index 0e2d92c8f1..56407e877a 100644
--- a/erts/emulator/test/code_SUITE_data/versions.erl
+++ b/erts/emulator/test/code_SUITE_data/versions.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/code_parallel_load_SUITE.erl b/erts/emulator/test/code_parallel_load_SUITE.erl
index e9e7000434..827add71e5 100644
--- a/erts/emulator/test/code_parallel_load_SUITE.erl
+++ b/erts/emulator/test/code_parallel_load_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/crypto_SUITE.erl b/erts/emulator/test/crypto_SUITE.erl
index 6212997272..afb1be7332 100644
--- a/erts/emulator/test/crypto_SUITE.erl
+++ b/erts/emulator/test/crypto_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/crypto_reference.erl b/erts/emulator/test/crypto_reference.erl
index 7797eacd75..950b0c1560 100644
--- a/erts/emulator/test/crypto_reference.erl
+++ b/erts/emulator/test/crypto_reference.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/ddll_SUITE.erl b/erts/emulator/test/ddll_SUITE.erl
index 6982178827..93b6f2d956 100644
--- a/erts/emulator/test/ddll_SUITE.erl
+++ b/erts/emulator/test/ddll_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/decode_packet_SUITE.erl b/erts/emulator/test/decode_packet_SUITE.erl
index ad592f7147..54ee4d5567 100644
--- a/erts/emulator/test/decode_packet_SUITE.erl
+++ b/erts/emulator/test/decode_packet_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/dgawd_handler.erl b/erts/emulator/test/dgawd_handler.erl
index bba69ef87e..52cdd26427 100644
--- a/erts/emulator/test/dgawd_handler.erl
+++ b/erts/emulator/test/dgawd_handler.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl
index f116ec979b..d0096fb1bc 100644
--- a/erts/emulator/test/distribution_SUITE.erl
+++ b/erts/emulator/test/distribution_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1034,6 +1034,7 @@ atom_roundtrip(Config) when is_list(Config) ->
atom_roundtrip_r15b(Config) when is_list(Config) ->
case test_server:is_release_available("r15b") of
true ->
+ ct:timetrap({minutes, 6}),
AtomData = atom_data(),
verify_atom_data(AtomData),
{ok, Node} = start_node(Config, [], "r15b"),
diff --git a/erts/emulator/test/distribution_SUITE_data/run.erl b/erts/emulator/test/distribution_SUITE_data/run.erl
index d5ed139369..f574b2c02c 100644
--- a/erts/emulator/test/distribution_SUITE_data/run.erl
+++ b/erts/emulator/test/distribution_SUITE_data/run.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/driver_SUITE.erl b/erts/emulator/test/driver_SUITE.erl
index c589470f5b..f134a197aa 100644
--- a/erts/emulator/test/driver_SUITE.erl
+++ b/erts/emulator/test/driver_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/driver_SUITE_data/async_blast_drv.c b/erts/emulator/test/driver_SUITE_data/async_blast_drv.c
index a1008afcae..1432bc42c1 100644
--- a/erts/emulator/test/driver_SUITE_data/async_blast_drv.c
+++ b/erts/emulator/test/driver_SUITE_data/async_blast_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/driver_SUITE_data/consume_timeslice_drv.c b/erts/emulator/test/driver_SUITE_data/consume_timeslice_drv.c
index 192ac02d3e..142ae46247 100644
--- a/erts/emulator/test/driver_SUITE_data/consume_timeslice_drv.c
+++ b/erts/emulator/test/driver_SUITE_data/consume_timeslice_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2012-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2012-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/driver_SUITE_data/ioq_exit_drv.c b/erts/emulator/test/driver_SUITE_data/ioq_exit_drv.c
index e2221b9e17..d87c2bec93 100644
--- a/erts/emulator/test/driver_SUITE_data/ioq_exit_drv.c
+++ b/erts/emulator/test/driver_SUITE_data/ioq_exit_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2007-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/driver_SUITE_data/otp_9302_drv.c b/erts/emulator/test/driver_SUITE_data/otp_9302_drv.c
index fdf8e4c0ad..37cb93fb3a 100644
--- a/erts/emulator/test/driver_SUITE_data/otp_9302_drv.c
+++ b/erts/emulator/test/driver_SUITE_data/otp_9302_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/driver_SUITE_data/thr_free_drv.c b/erts/emulator/test/driver_SUITE_data/thr_free_drv.c
index 54205f190e..48fe5fa435 100644
--- a/erts/emulator/test/driver_SUITE_data/thr_free_drv.c
+++ b/erts/emulator/test/driver_SUITE_data/thr_free_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/driver_SUITE_data/thr_msg_blast_drv.c b/erts/emulator/test/driver_SUITE_data/thr_msg_blast_drv.c
index f7a7cc2b8e..56183c9484 100644
--- a/erts/emulator/test/driver_SUITE_data/thr_msg_blast_drv.c
+++ b/erts/emulator/test/driver_SUITE_data/thr_msg_blast_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2012. All Rights Reserved.
+ * Copyright Ericsson AB 2012-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/efile_SUITE.erl b/erts/emulator/test/efile_SUITE.erl
index cefa35a3ee..6bb8487c4e 100644
--- a/erts/emulator/test/efile_SUITE.erl
+++ b/erts/emulator/test/efile_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/erl_drv_thread_SUITE.erl b/erts/emulator/test/erl_drv_thread_SUITE.erl
index 41a761229c..f99c151936 100644
--- a/erts/emulator/test/erl_drv_thread_SUITE.erl
+++ b/erts/emulator/test/erl_drv_thread_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -65,7 +65,7 @@ drv_case(Config, CaseName, Command, TimeTrap) when is_list(Config),
is_atom(CaseName),
is_list(Command),
is_integer(TimeTrap) ->
- case test_server:os_type() of
+ case os:type() of
{Family, _} when Family == unix; Family == win32 ->
run_drv_case(Config, CaseName, Command, TimeTrap);
SkipOs ->
diff --git a/erts/emulator/test/erl_link_SUITE.erl b/erts/emulator/test/erl_link_SUITE.erl
index 56fdfc35c0..93d2065ba3 100644
--- a/erts/emulator/test/erl_link_SUITE.erl
+++ b/erts/emulator/test/erl_link_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/erts_debug_SUITE.erl b/erts/emulator/test/erts_debug_SUITE.erl
index e757ebdb3d..23871585f7 100644
--- a/erts/emulator/test/erts_debug_SUITE.erl
+++ b/erts/emulator/test/erts_debug_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/estone_SUITE.erl b/erts/emulator/test/estone_SUITE.erl
index 93728b299b..1180a45585 100644
--- a/erts/emulator/test/estone_SUITE.erl
+++ b/erts/emulator/test/estone_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/evil_SUITE.erl b/erts/emulator/test/evil_SUITE.erl
index 5f5a0ef305..9416ac7a02 100644
--- a/erts/emulator/test/evil_SUITE.erl
+++ b/erts/emulator/test/evil_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/exception_SUITE.erl b/erts/emulator/test/exception_SUITE.erl
index 1cad7e7920..76e3556bc4 100644
--- a/erts/emulator/test/exception_SUITE.erl
+++ b/erts/emulator/test/exception_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/float_SUITE.erl b/erts/emulator/test/float_SUITE.erl
index 78dec8c725..e85addae3a 100644
--- a/erts/emulator/test/float_SUITE.erl
+++ b/erts/emulator/test/float_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/float_SUITE_data/has_fpe_bug.erl b/erts/emulator/test/float_SUITE_data/has_fpe_bug.erl
index 79ab74dfff..26837de274 100644
--- a/erts/emulator/test/float_SUITE_data/has_fpe_bug.erl
+++ b/erts/emulator/test/float_SUITE_data/has_fpe_bug.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/fun_SUITE.erl b/erts/emulator/test/fun_SUITE.erl
index 044c6aabca..26fa955e3c 100644
--- a/erts/emulator/test/fun_SUITE.erl
+++ b/erts/emulator/test/fun_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/fun_r13_SUITE.erl b/erts/emulator/test/fun_r13_SUITE.erl
index d66026705b..a45ed08b9d 100644
--- a/erts/emulator/test/fun_r13_SUITE.erl
+++ b/erts/emulator/test/fun_r13_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/gc_SUITE.erl b/erts/emulator/test/gc_SUITE.erl
index 8e5f0b05a1..79c229a34d 100644
--- a/erts/emulator/test/gc_SUITE.erl
+++ b/erts/emulator/test/gc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/guard_SUITE.erl b/erts/emulator/test/guard_SUITE.erl
index 6ad4456e6b..e155e5f49f 100644
--- a/erts/emulator/test/guard_SUITE.erl
+++ b/erts/emulator/test/guard_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/hash_SUITE.erl b/erts/emulator/test/hash_SUITE.erl
index be254f5543..a39d101b0d 100644
--- a/erts/emulator/test/hash_SUITE.erl
+++ b/erts/emulator/test/hash_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/hibernate_SUITE.erl b/erts/emulator/test/hibernate_SUITE.erl
index 45f0bdc4da..6f8ce02266 100644
--- a/erts/emulator/test/hibernate_SUITE.erl
+++ b/erts/emulator/test/hibernate_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/ignore_cores.erl b/erts/emulator/test/ignore_cores.erl
index 7373303a39..25dce346b9 100644
--- a/erts/emulator/test/ignore_cores.erl
+++ b/erts/emulator/test/ignore_cores.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -94,7 +94,7 @@ setup(Suite, Testcase, Config, SetCwd) when is_atom(Suite),
end,
ok = file:write_file(filename:join([IgnDir, "ignore_core_files"]), <<>>),
%% cores are dumped in /cores on MacOS X
- CoresDir = case {test_server:os_type(), filelib:is_dir("/cores")} of
+ CoresDir = case {os:type(), filelib:is_dir("/cores")} of
{{unix,darwin}, true} ->
filelib:fold_files("/cores",
"^core.*$",
diff --git a/erts/emulator/test/list_bif_SUITE.erl b/erts/emulator/test/list_bif_SUITE.erl
index 1f64a6a8e5..514dd2f412 100644
--- a/erts/emulator/test/list_bif_SUITE.erl
+++ b/erts/emulator/test/list_bif_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/long_timers_test.erl b/erts/emulator/test/long_timers_test.erl
index 9415e1cced..7c055a31f9 100644
--- a/erts/emulator/test/long_timers_test.erl
+++ b/erts/emulator/test/long_timers_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/lttng_SUITE.erl b/erts/emulator/test/lttng_SUITE.erl
new file mode 100644
index 0000000000..efc79f42ed
--- /dev/null
+++ b/erts/emulator/test/lttng_SUITE.erl
@@ -0,0 +1,499 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(lttng_SUITE).
+
+-export([all/0, suite/0]).
+-export([init_per_suite/1, end_per_suite/1]).
+-export([init_per_testcase/2, end_per_testcase/2]).
+
+-export([t_lttng_list/1,
+ t_carrier_pool/1,
+ t_memory_carrier/1,
+ t_async_io_pool/1,
+ t_driver_control_ready_async/1,
+ t_driver_start_stop/1,
+ t_driver_ready_input_output/1,
+ t_driver_timeout/1,
+ t_driver_caller/1,
+ t_driver_flush/1,
+ t_scheduler_poll/1]).
+
+-include_lib("common_test/include/ct.hrl").
+
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {seconds, 10}}].
+
+all() ->
+ [t_lttng_list,
+ t_carrier_pool,
+ t_async_io_pool,
+ t_driver_start_stop,
+ t_driver_ready_input_output,
+ t_driver_control_ready_async,
+ t_driver_timeout,
+ t_driver_caller,
+ t_driver_flush,
+ t_scheduler_poll,
+ t_memory_carrier].
+
+
+init_per_suite(Config) ->
+ case erlang:system_info(dynamic_trace) of
+ lttng ->
+ ensure_lttng_stopped("--all"),
+ Config;
+ _ ->
+ {skip, "No LTTng configured on system."}
+ end.
+
+end_per_suite(_Config) ->
+ ensure_lttng_stopped("--all"),
+ ok.
+
+init_per_testcase(Case, Config) ->
+ Name = atom_to_list(Case),
+ ok = ensure_lttng_started(Name, Config),
+ [{session, Name}|Config].
+
+end_per_testcase(Case, _Config) ->
+ Name = atom_to_list(Case),
+ ok = ensure_lttng_stopped(Name),
+ ok.
+
+%% Not tested yet
+%% com_ericsson_otp:driver_process_exit
+%% com_ericsson_otp:driver_event
+
+%% tracepoints
+%%
+%% com_ericsson_otp:carrier_pool_get
+%% com_ericsson_otp:carrier_pool_put
+%% com_ericsson_otp:carrier_destroy
+%% com_ericsson_otp:carrier_create
+%% com_ericsson_otp:aio_pool_put
+%% com_ericsson_otp:aio_pool_get
+%% com_ericsson_otp:driver_control
+%% com_ericsson_otp:driver_call
+%% com_ericsson_otp:driver_finish
+%% com_ericsson_otp:driver_ready_async
+%% com_ericsson_otp:driver_process_exit
+%% com_ericsson_otp:driver_stop
+%% com_ericsson_otp:driver_flush
+%% com_ericsson_otp:driver_stop_select
+%% com_ericsson_otp:driver_timeout
+%% com_ericsson_otp:driver_event
+%% com_ericsson_otp:driver_ready_output
+%% com_ericsson_otp:driver_ready_input
+%% com_ericsson_otp:driver_output
+%% com_ericsson_otp:driver_outputv
+%% com_ericsson_otp:driver_init
+%% com_ericsson_otp:driver_start
+%% com_ericsson_otp:scheduler_poll
+
+%%
+%% Testcases
+%%
+
+t_lttng_list(_Config) ->
+ {ok, _} = cmd("lttng list -u"),
+ ok.
+
+%% com_ericsson_otp:carrier_pool_get
+%% com_ericsson_otp:carrier_pool_put
+t_carrier_pool(Config) ->
+ case have_carriers() of
+ false ->
+ {skip, "No Memory Carriers configured on system."};
+ true ->
+ ok = lttng_start_event("com_ericsson_otp:carrier_pool*", Config),
+
+ ok = ets_load(),
+
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_otp:carrier_pool_get", Res),
+ ok = check_tracepoint("com_ericsson_otp:carrier_pool_put", Res),
+ ok
+ end.
+
+%% com_ericsson_otp:carrier_destroy
+%% com_ericsson_otp:carrier_create
+t_memory_carrier(Config) ->
+ case have_carriers() of
+ false ->
+ {skip, "No Memory Carriers configured on system."};
+ true ->
+ ok = lttng_start_event("com_ericsson_otp:carrier_*", Config),
+
+ ok = ets_load(),
+
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_otp:carrier_destroy", Res),
+ ok = check_tracepoint("com_ericsson_otp:carrier_create", Res),
+ ok
+ end.
+
+%% com_ericsson_otp:aio_pool_put
+%% com_ericsson_otp:aio_pool_get
+t_async_io_pool(Config) ->
+ case have_async_threads() of
+ false ->
+ {skip, "No Async Threads configured on system."};
+ true ->
+ ok = lttng_start_event("com_ericsson_otp:aio_pool_*", Config),
+
+ Path1 = proplists:get_value(priv_dir, Config),
+ {ok, [[Path2]]} = init:get_argument(home),
+ {ok, _} = file:list_dir(Path1),
+ {ok, _} = file:list_dir(Path2),
+ {ok, _} = file:list_dir(Path1),
+ {ok, _} = file:list_dir(Path2),
+
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_otp:aio_pool_put", Res),
+ ok = check_tracepoint("com_ericsson_otp:aio_pool_get", Res),
+ ok
+ end.
+
+
+%% com_ericsson_otp:driver_start
+%% com_ericsson_otp:driver_stop
+t_driver_start_stop(Config) ->
+ ok = lttng_start_event("com_ericsson_otp:driver_*", Config),
+ Path = proplists:get_value(priv_dir, Config),
+ Name = filename:join(Path, "sometext.txt"),
+ Bin = txt(),
+ ok = file:write_file(Name, Bin),
+ {ok, Bin} = file:read_file(Name),
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_otp:driver_start", Res),
+ ok = check_tracepoint("com_ericsson_otp:driver_stop", Res),
+ ok = check_tracepoint("com_ericsson_otp:driver_control", Res),
+ ok = check_tracepoint("com_ericsson_otp:driver_outputv", Res),
+ ok = check_tracepoint("com_ericsson_otp:driver_ready_async", Res),
+ ok.
+
+%% com_ericsson_otp:driver_control
+%% com_ericsson_otp:driver_outputv
+%% com_ericsson_otp:driver_ready_async
+t_driver_control_ready_async(Config) ->
+ ok = lttng_start_event("com_ericsson_otp:driver_control", Config),
+ ok = lttng_start_event("com_ericsson_otp:driver_outputv", Config),
+ ok = lttng_start_event("com_ericsson_otp:driver_ready_async", Config),
+ Path = proplists:get_value(priv_dir, Config),
+ Name = filename:join(Path, "sometext.txt"),
+ Bin = txt(),
+ ok = file:write_file(Name, Bin),
+ {ok, Bin} = file:read_file(Name),
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_otp:driver_control", Res),
+ ok = check_tracepoint("com_ericsson_otp:driver_outputv", Res),
+ ok = check_tracepoint("com_ericsson_otp:driver_ready_async", Res),
+ ok.
+
+%% com_ericsson_otp:driver_ready_input
+%% com_ericsson_otp:driver_ready_output
+t_driver_ready_input_output(Config) ->
+ ok = lttng_start_event("com_ericsson_otp:driver_ready_*", Config),
+ Me = self(),
+ Pid = spawn_link(fun() -> tcp_server(Me, active) end),
+ receive {Pid, accept} -> ok end,
+ Bin = txt(),
+ Sz = byte_size(Bin),
+
+ {ok, Sock} = gen_tcp:connect("localhost", 5679, [binary, {packet, 2}]),
+ ok = gen_tcp:send(Sock, <<Sz:16, Bin/binary>>),
+ ok = gen_tcp:send(Sock, <<Sz:16, Bin/binary>>),
+ ok = gen_tcp:close(Sock),
+ receive {Pid, done} -> ok end,
+
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_otp:driver_ready_input", Res),
+ ok = check_tracepoint("com_ericsson_otp:driver_ready_output", Res),
+ ok.
+
+
+%% com_ericsson_otp:driver_stop_select
+%% com_ericsson_otp:driver_timeout
+t_driver_timeout(Config) ->
+ ok = lttng_start_event("com_ericsson_otp:driver_*", Config),
+ Me = self(),
+ Pid = spawn_link(fun() -> tcp_server(Me, timeout) end),
+ receive {Pid, accept} -> ok end,
+ {ok, Sock} = gen_tcp:connect("localhost", 5679, [binary]),
+ ok = gen_tcp:send(Sock, <<"hej">>),
+ receive {Pid, done} -> ok end,
+ ok = gen_tcp:close(Sock),
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_otp:driver_timeout", Res),
+ ok = check_tracepoint("com_ericsson_otp:driver_stop_select", Res),
+ ok.
+
+%% com_ericsson_otp:driver_call
+%% com_ericsson_otp:driver_output
+%% com_ericsson_otp:driver_init
+%% com_ericsson_otp:driver_finish
+t_driver_caller(Config) ->
+ ok = lttng_start_event("com_ericsson_otp:driver_*", Config),
+
+ Drv = 'caller_drv',
+ os:putenv("CALLER_DRV_USE_OUTPUTV", "false"),
+
+ ok = load_driver(proplists:get_value(data_dir, Config), Drv),
+ Port = open_port({spawn, Drv}, []),
+ true = is_port(Port),
+
+ chk_caller(Port, start, self()),
+ chk_caller(Port, output, spawn_link(fun() ->
+ port_command(Port, "")
+ end)),
+ Port ! {self(), {command, ""}},
+ chk_caller(Port, output, self()),
+ chk_caller(Port, control, spawn_link(fun () ->
+ port_control(Port, 0, "")
+ end)),
+ chk_caller(Port, call, spawn_link(fun() ->
+ erlang:port_call(Port, 0, "")
+ end)),
+
+ true = port_close(Port),
+ erl_ddll:unload_driver(Drv),
+
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_otp:driver_call", Res),
+ ok = check_tracepoint("com_ericsson_otp:driver_output", Res),
+ ok = check_tracepoint("com_ericsson_otp:driver_init", Res),
+ ok = check_tracepoint("com_ericsson_otp:driver_finish", Res),
+ ok.
+
+%% com_ericsson_otp:scheduler_poll
+t_scheduler_poll(Config) ->
+ ok = lttng_start_event("com_ericsson_otp:scheduler_poll", Config),
+
+ ok = memory_load(),
+
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_otp:scheduler_poll", Res),
+ ok.
+
+%% com_ericsson_otp:driver_flush
+t_driver_flush(Config) ->
+ ok = lttng_start_event("com_ericsson_otp:driver_flush", Config),
+
+ Me = self(),
+ Pid = spawn_link(fun() -> tcp_server(Me, passive_no_read) end),
+ receive {Pid, accept} -> ok end,
+ Bin = iolist_to_binary([txt() || _ <- lists:seq(1,100)]),
+ Sz = byte_size(Bin),
+
+ %% We want to create a scenario where sendings stalls and we
+ %% queue packets in the driver.
+ %% When we close the socket it has to flush the queue.
+ {ok, Sock} = gen_tcp:connect("localhost", 5679, [binary, {packet, 2},
+ {send_timeout, 10},
+ {sndbuf, 10000000}]),
+ Pids = [spawn_link(fun() ->
+ gen_tcp:send(Sock, <<Sz:16, Bin/binary>>),
+ Me ! {self(), ok}
+ end) || _ <- lists:seq(1,100)],
+ [receive {P, ok} -> ok end || P <- Pids],
+ ok = gen_tcp:close(Sock),
+ Pid ! die,
+ receive {Pid, done} -> ok end,
+
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_otp:driver_flush", Res),
+ ok.
+
+%%
+%% AUX
+%%
+
+chk_caller(Port, Callback, ExpectedCaller) ->
+ receive
+ {caller, Port, Callback, Caller} ->
+ ExpectedCaller = Caller
+ end.
+
+
+ets_load() ->
+ Tid = ets:new(ets_load, [public,set]),
+ N = erlang:system_info(schedulers_online),
+ Pids = [spawn_link(fun() -> ets_shuffle(Tid) end) || _ <- lists:seq(1,N)],
+ ok = ets_kill(Pids, 500),
+ ok.
+
+
+ets_kill([], _) -> ok;
+ets_kill([Pid|Pids], Time) ->
+ timer:sleep(Time),
+ Pid ! done,
+ ets_kill(Pids, Time).
+
+ets_shuffle(Tid) ->
+ Payload = lists:duplicate(100, $x),
+ ets_shuffle(Tid, 100, Payload).
+ets_shuffle(Tid, I, Data) ->
+ ets_shuffle(Tid, I, I, Data, Data).
+
+ets_shuffle(Tid, 0, N, _, Data) ->
+ ets_shuffle(Tid, N, N, Data, Data);
+ets_shuffle(Tid, I, N, Data, Data0) ->
+ receive
+ done -> ok
+ after 0 ->
+ Key = rand:uniform(1000),
+ Data1 = [I|Data],
+ ets:insert(Tid, {Key, Data1}),
+ ets_shuffle(Tid, I - 1, N, Data1, Data0)
+ end.
+
+
+
+
+memory_load() ->
+ Me = self(),
+ Pids0 = [spawn_link(fun() -> memory_loop(Me, 20, <<42>>) end) || _ <- lists:seq(1,30)],
+ timer:sleep(50),
+ Pids1 = [spawn_link(fun() -> memory_loop(Me, 20, <<42>>) end) || _ <- lists:seq(1,30)],
+ [receive {Pid, done} -> ok end || Pid <- Pids0 ++ Pids1],
+ timer:sleep(500),
+ ok.
+
+memory_loop(Parent, N, Bin) ->
+ memory_loop(Parent, N, Bin, []).
+
+memory_loop(Parent, 0, _Bin, _) ->
+ Parent ! {self(), done};
+memory_loop(Parent, N, Bin0, Ls) ->
+ Bin = binary:copy(<<Bin0/binary, Bin0/binary>>),
+ memory_loop(Parent, N - 1, Bin, [a,b,c|Ls]).
+
+tcp_server(Pid, Type) ->
+ {ok, LSock} = gen_tcp:listen(5679, [binary,
+ {reuseaddr, true},
+ {active, false}]),
+ Pid ! {self(), accept},
+ {ok, Sock} = gen_tcp:accept(LSock),
+ case Type of
+ passive_no_read ->
+ receive die -> ok end;
+ active ->
+ inet:setopts(Sock, [{active, once}, {packet,2}]),
+ receive Msg1 -> io:format("msg1: ~p~n", [Msg1]) end,
+ inet:setopts(Sock, [{active, once}, {packet,2}]),
+ receive Msg2 -> io:format("msg2: ~p~n", [Msg2]) end,
+ ok = gen_tcp:close(Sock);
+ timeout ->
+ Res = gen_tcp:recv(Sock, 2000, 1000),
+ io:format("res ~p~n", [Res])
+ end,
+ Pid ! {self(), done},
+ ok.
+
+txt() ->
+ <<"%% tracepoints\n"
+ "%%\n"
+ "%% com_ericsson_otp:carrier_pool_get\n"
+ "%% com_ericsson_otp:carrier_pool_put\n"
+ "%% com_ericsson_otp:carrier_destroy\n"
+ "%% com_ericsson_otp:carrier_create\n"
+ "%% com_ericsson_otp:aio_pool_put\n"
+ "%% com_ericsson_otp:aio_pool_get\n"
+ "%% com_ericsson_otp:driver_control\n"
+ "%% com_ericsson_otp:driver_call\n"
+ "%% com_ericsson_otp:driver_finish\n"
+ "%% com_ericsson_otp:driver_ready_async\n"
+ "%% com_ericsson_otp:driver_process_exit\n"
+ "%% com_ericsson_otp:driver_stop\n"
+ "%% com_ericsson_otp:driver_flush\n"
+ "%% com_ericsson_otp:driver_stop_select\n"
+ "%% com_ericsson_otp:driver_timeout\n"
+ "%% com_ericsson_otp:driver_event\n"
+ "%% com_ericsson_otp:driver_ready_output\n"
+ "%% com_ericsson_otp:driver_ready_input\n"
+ "%% com_ericsson_otp:driver_output\n"
+ "%% com_ericsson_otp:driver_outputv\n"
+ "%% com_ericsson_otp:driver_init\n"
+ "%% com_ericsson_otp:driver_start\n"
+ "%% com_ericsson_otp:scheduler_poll">>.
+
+load_driver(Dir, Driver) ->
+ case erl_ddll:load_driver(Dir, Driver) of
+ ok -> ok;
+ {error, Error} = Res ->
+ io:format("~s\n", [erl_ddll:format_error(Error)]),
+ Res
+ end.
+
+%% check
+
+have_carriers() ->
+ Cap = element(3,erlang:system_info(allocator)),
+ case Cap -- [sys_alloc,sys_aligned_alloc] of
+ [] -> false;
+ _ -> true
+ end.
+
+have_async_threads() ->
+ Tps = erlang:system_info(thread_pool_size),
+ if Tps =:= 0 -> false;
+ true -> true
+ end.
+
+%% lttng
+lttng_stop_and_view(Config) ->
+ Path = proplists:get_value(priv_dir, Config),
+ Name = proplists:get_value(session, Config),
+ {ok,_} = cmd("lttng stop " ++ Name),
+ {ok,Res} = cmd("lttng view " ++ Name ++ " --trace-path=" ++ Path),
+ Res.
+
+check_tracepoint(TP, Data) ->
+ case re:run(Data, TP, [global]) of
+ {match, _} -> ok;
+ _ -> notfound
+ end.
+
+lttng_start_event(Event, Config) ->
+ Name = proplists:get_value(session, Config),
+ {ok, _} = cmd("lttng enable-event -u " ++ Event ++ " --session=" ++ Name),
+ {ok, _} = cmd("lttng start " ++ Name),
+ ok.
+
+ensure_lttng_started(Name, Config) ->
+ Out = case proplists:get_value(priv_dir, Config) of
+ undefined -> [];
+ Path -> "--output="++Path++" "
+ end,
+ {ok,_} = cmd("lttng create " ++ Out ++ Name),
+ ok.
+
+ensure_lttng_stopped(Name) ->
+ {ok,_} = cmd("lttng stop"),
+ {ok,_} = cmd("lttng destroy " ++ Name),
+ ok.
+
+cmd(Cmd) ->
+ io:format("<< ~ts~n", [Cmd]),
+ Res = os:cmd(Cmd),
+ io:format(">> ~ts~n", [Res]),
+ {ok,Res}.
diff --git a/erts/emulator/test/lttng_SUITE_data/Makefile.src b/erts/emulator/test/lttng_SUITE_data/Makefile.src
new file mode 100644
index 0000000000..fe7a1b6ef3
--- /dev/null
+++ b/erts/emulator/test/lttng_SUITE_data/Makefile.src
@@ -0,0 +1,7 @@
+
+MISC_DRVS = caller_drv@dll@
+
+
+all: $(MISC_DRVS)
+
+@SHLIB_RULES@
diff --git a/erts/emulator/test/lttng_SUITE_data/caller_drv.c b/erts/emulator/test/lttng_SUITE_data/caller_drv.c
new file mode 100644
index 0000000000..86fd0a2995
--- /dev/null
+++ b/erts/emulator/test/lttng_SUITE_data/caller_drv.c
@@ -0,0 +1,159 @@
+/* ``Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions 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$
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "erl_driver.h"
+
+static int init();
+static void stop(ErlDrvData drv_data);
+static void finish();
+static void flush(ErlDrvData drv_data);
+static ErlDrvData start(ErlDrvPort port, char *command);
+static void output(ErlDrvData drv_data, char *buf, ErlDrvSizeT len);
+static void outputv(ErlDrvData drv_data, ErlIOVec *ev);
+static ErlDrvSSizeT control(ErlDrvData drv_data,
+ unsigned int command, char *buf,
+ ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen);
+static ErlDrvSSizeT call(ErlDrvData drv_data,
+ unsigned int command,
+ char *buf, ErlDrvSizeT len,
+ char **rbuf, ErlDrvSizeT rlen,
+ unsigned int *flags);
+
+static ErlDrvEntry caller_drv_entry = {
+ init,
+ start,
+ stop,
+ output,
+ NULL /* ready_input */,
+ NULL /* ready_output */,
+ "caller_drv",
+ finish,
+ NULL /* handle */,
+ control,
+ NULL /* timeout */,
+ outputv,
+ NULL /* ready_async */,
+ flush,
+ call,
+ NULL /* event */,
+ ERL_DRV_EXTENDED_MARKER,
+ ERL_DRV_EXTENDED_MAJOR_VERSION,
+ ERL_DRV_EXTENDED_MINOR_VERSION,
+ ERL_DRV_FLAG_USE_PORT_LOCKING,
+ NULL /* handle2 */,
+ NULL /* handle_monitor */
+};
+
+DRIVER_INIT(caller_drv)
+{
+ char buf[10];
+ size_t bufsz = sizeof(buf);
+ char *use_outputv;
+ use_outputv = (erl_drv_getenv("CALLER_DRV_USE_OUTPUTV", buf, &bufsz) == 0
+ ? buf
+ : "false");
+ if (strcmp(use_outputv, "true") != 0)
+ caller_drv_entry.outputv = NULL;
+ return &caller_drv_entry;
+}
+
+void
+send_caller(ErlDrvData drv_data, char *func)
+{
+ int res;
+ ErlDrvPort port = (ErlDrvPort) drv_data;
+ ErlDrvTermData msg[] = {
+ ERL_DRV_ATOM, driver_mk_atom("caller"),
+ ERL_DRV_PORT, driver_mk_port(port),
+ ERL_DRV_ATOM, driver_mk_atom(func),
+ ERL_DRV_PID, driver_caller(port),
+ ERL_DRV_TUPLE, (ErlDrvTermData) 4
+ };
+ res = erl_drv_output_term(driver_mk_port(port), msg, sizeof(msg)/sizeof(ErlDrvTermData));
+ if (res <= 0)
+ driver_failure_atom(port, "erl_drv_output_term failed");
+}
+
+static int
+init() {
+ return 0;
+}
+
+static void
+stop(ErlDrvData drv_data)
+{
+
+}
+
+static void
+flush(ErlDrvData drv_data)
+{
+
+}
+
+static void
+finish()
+{
+
+}
+
+static ErlDrvData
+start(ErlDrvPort port, char *command)
+{
+ send_caller((ErlDrvData) port, "start");
+ return (ErlDrvData) port;
+}
+
+static void
+output(ErlDrvData drv_data, char *buf, ErlDrvSizeT len)
+{
+ send_caller(drv_data, "output");
+}
+
+static void
+outputv(ErlDrvData drv_data, ErlIOVec *ev)
+{
+ send_caller(drv_data, "outputv");
+}
+
+static ErlDrvSSizeT
+control(ErlDrvData drv_data,
+ unsigned int command, char *buf,
+ ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen)
+{
+ send_caller(drv_data, "control");
+ return 0;
+}
+
+static ErlDrvSSizeT
+call(ErlDrvData drv_data,
+ unsigned int command,
+ char *buf, ErlDrvSizeT len,
+ char **rbuf, ErlDrvSizeT rlen,
+ unsigned int *flags)
+{
+ /* echo call */
+ if (len > rlen)
+ *rbuf = driver_alloc(len);
+ memcpy((void *) *rbuf, (void *) buf, len);
+ send_caller(drv_data, "call");
+ return len;
+}
diff --git a/erts/emulator/test/map_SUITE.erl b/erts/emulator/test/map_SUITE.erl
index 956b82335c..b3870f0313 100644
--- a/erts/emulator/test/map_SUITE.erl
+++ b/erts/emulator/test/map_SUITE.erl
@@ -48,6 +48,7 @@
t_bif_map_new/1,
t_bif_map_put/1,
t_bif_map_remove/1,
+ t_bif_map_take/1, t_bif_map_take_large/1,
t_bif_map_update/1,
t_bif_map_values/1,
t_bif_map_to_list/1,
@@ -112,7 +113,9 @@ all() -> [t_build_and_match_literals, t_build_and_match_literals_large,
t_bif_map_get,t_bif_map_find,t_bif_map_is_key,
t_bif_map_keys, t_bif_map_merge, t_bif_map_new,
t_bif_map_put,
- t_bif_map_remove, t_bif_map_update,
+ t_bif_map_remove,
+ t_bif_map_take, t_bif_map_take_large,
+ t_bif_map_update,
t_bif_map_values,
t_bif_map_to_list, t_bif_map_from_list,
@@ -1970,7 +1973,7 @@ t_bif_map_remove(Config) when is_list(Config) ->
0 = erlang:map_size(maps:remove(some_key, #{})),
M0 = #{ "hi" => "hello", int => 3, <<"key">> => <<"value">>,
- 4 => number, 18446744073709551629 => wat},
+ 4 => number, 18446744073709551629 => wat},
M1 = maps:remove("hi", M0),
true = is_members([4,18446744073709551629,int,<<"key">>],maps:keys(M1)),
@@ -1999,10 +2002,71 @@ t_bif_map_remove(Config) when is_list(Config) ->
%% error case
do_badmap(fun(T) ->
- {'EXIT',{{badmap,T},[{maps,remove,_,_}|_]}} =
- (catch maps:remove(a, T))
+ {'EXIT',{{badmap,T},[{maps,remove,_,_}|_]}} = (catch maps:remove(a, T))
end),
- ok.
+ ok.
+
+t_bif_map_take(Config) when is_list(Config) ->
+ error = maps:take(some_key, #{}),
+
+ M0 = #{ "hi" => "hello", int => 3, <<"key">> => <<"value">>,
+ 4 => number, 18446744073709551629 => wat},
+
+ 5 = maps:size(M0),
+ {"hello", M1} = maps:take("hi", M0),
+ true = is_members([4,18446744073709551629,int,<<"key">>],maps:keys(M1)),
+ true = is_members([number,wat,3,<<"value">>],maps:values(M1)),
+ error = maps:take("hi", M1),
+ 4 = maps:size(M1),
+
+ {3, M2} = maps:take(int, M1),
+ true = is_members([4,18446744073709551629,<<"key">>],maps:keys(M2)),
+ true = is_members([number,wat,<<"value">>],maps:values(M2)),
+ error = maps:take(int, M2),
+ 3 = maps:size(M2),
+
+ {<<"value">>,M3} = maps:take(<<"key">>, M2),
+ true = is_members([4,18446744073709551629],maps:keys(M3)),
+ true = is_members([number,wat],maps:values(M3)),
+ error = maps:take(<<"key">>, M3),
+ 2 = maps:size(M3),
+
+ {wat,M4} = maps:take(18446744073709551629, M3),
+ true = is_members([4],maps:keys(M4)),
+ true = is_members([number],maps:values(M4)),
+ error = maps:take(18446744073709551629, M4),
+ 1 = maps:size(M4),
+
+ {number,M5} = maps:take(4, M4),
+ [] = maps:keys(M5),
+ [] = maps:values(M5),
+ error = maps:take(4, M5),
+ 0 = maps:size(M5),
+
+ {wat,#{ "hi" := "hello", int := 3, 4 := number, <<"key">> := <<"value">>}} = maps:take(18446744073709551629,M0),
+
+ %% error case
+ do_badmap(fun(T) ->
+ {'EXIT',{{badmap,T},[{maps,take,_,_}|_]}} = (catch maps:take(a, T))
+ end),
+ ok.
+
+t_bif_map_take_large(Config) when is_list(Config) ->
+ KVs = [{{erlang:md5(<<I:64>>),I}, I}|| I <- lists:seq(1,500)],
+ M0 = maps:from_list(KVs),
+ ok = bif_map_take_all(KVs, M0),
+ ok.
+
+bif_map_take_all([], M0) ->
+ 0 = maps:size(M0),
+ ok;
+bif_map_take_all([{K,V}|KVs],M0) ->
+ {ok,V} = maps:find(K,M0),
+ {V,M1} = maps:take(K,M0),
+ error = maps:find(K,M1),
+ error = maps:take(K,M1),
+ bif_map_take_all(KVs,M1).
+
t_bif_map_update(Config) when is_list(Config) ->
M0 = #{ "hi" => "hello", int => 3, <<"key">> => <<"value">>,
diff --git a/erts/emulator/test/match_spec_SUITE.erl b/erts/emulator/test/match_spec_SUITE.erl
index baa6eb8fe0..6733237b20 100644
--- a/erts/emulator/test/match_spec_SUITE.erl
+++ b/erts/emulator/test/match_spec_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
-export([all/0, suite/0, not_run/1]).
-export([test_1/1, test_2/1, test_3/1, bad_match_spec_bin/1,
trace_control_word/1, silent/1, silent_no_ms/1, silent_test/1,
- ms_trace2/1, ms_trace3/1, boxed_and_small/1,
+ ms_trace2/1, ms_trace3/1, ms_trace_dead/1, boxed_and_small/1,
destructive_in_test_bif/1, guard_exceptions/1,
empty_list/1,
unary_plus/1, unary_minus/1, moving_labels/1]).
@@ -49,7 +49,7 @@ all() ->
false ->
[test_1, test_2, test_3, bad_match_spec_bin,
trace_control_word, silent, silent_no_ms, silent_test, ms_trace2,
- ms_trace3, boxed_and_small, destructive_in_test_bif,
+ ms_trace3, ms_trace_dead, boxed_and_small, destructive_in_test_bif,
guard_exceptions, unary_plus, unary_minus, fpe,
moving_labels,
faulty_seq_trace,
@@ -500,6 +500,8 @@ ms_trace2(Config) when is_list(Config) ->
[[call,return_to],[]]},
ms_trace2}]
end),
+ %% Silence valgrind
+ erlang:trace_pattern({?MODULE,fn,'_'},[],[]),
ok.
@@ -595,7 +597,32 @@ ms_trace3(Config) when is_list(Config) ->
end),
ok.
-
+%% Test that a dead tracer is removed using ms
+ms_trace_dead(_Config) ->
+ Self = self(),
+ TFun = fun F() -> receive M -> Self ! M, F() end end,
+ {Tracer, MRef} = spawn_monitor(TFun),
+ MetaTracer = spawn_link(TFun),
+ erlang:trace_pattern({?MODULE, f1, '_'},
+ [{'_',[],[{message, false},
+ {trace,[],
+ [call,{const,{tracer,Tracer}}]}]}],
+ [{meta, MetaTracer}]),
+ erlang:trace_pattern({?MODULE, f2, '_'}, []),
+ ?MODULE:f2(1,2),
+ ?MODULE:f1(1),
+ {tracer,Tracer} = erlang:trace_info(self(), tracer),
+ {flags,[call]} = erlang:trace_info(self(), flags),
+ ?MODULE:f2(2,3),
+ receive {trace, Self, call, {?MODULE, f2, _}} -> ok end,
+ exit(Tracer, stop),
+ receive {'DOWN',MRef,_,_,_} -> ok end,
+ ?MODULE:f1(2),
+ {tracer,[]} = erlang:trace_info(self(), tracer),
+ ?MODULE:f2(3,4),
+ TRef = erlang:trace_delivered(all),
+ receive {trace_delivered, _, TRef} -> ok end,
+ receive M -> ct:fail({unexpected, M}) after 10 -> ok end.
%% Test that destructive operations in test bif does not really happen
destructive_in_test_bif(Config) when is_list(Config) ->
@@ -905,34 +932,40 @@ collect([]) ->
collect([TM | TMs]) ->
io:format( "Expecting: ~p~n", [TM]),
receive
- M0 ->
- M = case element(1, M0) of
- trace_ts ->
- list_to_tuple(lists:reverse(
- tl(lists:reverse(tuple_to_list(M0)))));
- _ -> M0
- end,
- case is_function(TM,1) of
- true ->
- case (catch TM(M)) of
- true ->
- io:format("Got: ~p~n", [M]),
- collect(TMs);
- _ ->
- io:format("Got unexpected: ~p~n", [M]),
- flush({got_unexpected,M})
- end;
-
- false ->
- case M of
- TM ->
- io:format("Got: ~p~n", [M]),
- collect(TMs);
- _ ->
- io:format("Got unexpected: ~p~n", [M]),
- flush({got_unexpected,M})
- end
- end
+ %% We only look at trace messages with the same tracee
+ %% as the message we are looking for. This because
+ %% the order of trace messages is only guaranteed from
+ %% within a single process.
+ M0 when element(2, M0) =:= element(2, TM); is_function(TM, 1) ->
+ M = case element(1, M0) of
+ trace_ts ->
+ list_to_tuple(lists:reverse(
+ tl(lists:reverse(tuple_to_list(M0)))));
+ _ -> M0
+ end,
+ case is_function(TM,1) of
+ true ->
+ case (catch TM(M)) of
+ true ->
+ io:format("Got: ~p~n", [M]),
+ collect(TMs);
+ _ ->
+ io:format("Got unexpected: ~p~n", [M]),
+ flush({got_unexpected,M})
+ end;
+
+ false ->
+ case M of
+ TM ->
+ io:format("Got: ~p~n", [M]),
+ collect(TMs);
+ _ ->
+ io:format("Got unexpected: ~p~n", [M]),
+ flush({got_unexpected,M})
+ end
+ end
+ after 15000 ->
+ flush(timeout)
end.
flush(Reason) ->
diff --git a/erts/emulator/test/message_queue_data_SUITE.erl b/erts/emulator/test/message_queue_data_SUITE.erl
index 12c42d24aa..226462676c 100644
--- a/erts/emulator/test/message_queue_data_SUITE.erl
+++ b/erts/emulator/test/message_queue_data_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
-module(message_queue_data_SUITE).
-export([all/0, suite/0]).
--export([basic/1, process_info_messages/1]).
+-export([basic/1, process_info_messages/1, total_heap_size/1]).
-export([basic_test/1]).
@@ -32,7 +32,7 @@ suite() ->
{timetrap, {minutes, 2}}].
all() ->
- [basic, process_info_messages].
+ [basic, process_info_messages, total_heap_size].
%%
%%
@@ -44,15 +44,15 @@ basic(Config) when is_list(Config) ->
basic_test(erlang:system_info(message_queue_data)),
- {ok, Node1} = start_node(Config, "+xmqd off_heap"),
+ {ok, Node1} = start_node(Config, "+hmqd off_heap"),
ok = rpc:call(Node1, ?MODULE, basic_test, [off_heap]),
stop_node(Node1),
- {ok, Node2} = start_node(Config, "+xmqd on_heap"),
+ {ok, Node2} = start_node(Config, "+hmqd on_heap"),
ok = rpc:call(Node2, ?MODULE, basic_test, [on_heap]),
stop_node(Node2),
- {ok, Node3} = start_node(Config, "+xmqd mixed"),
+ {ok, Node3} = start_node(Config, "+hmqd mixed"),
ok = rpc:call(Node3, ?MODULE, basic_test, [mixed]),
stop_node(Node3),
@@ -190,6 +190,28 @@ process_info_messages(Config) when is_list(Config) ->
ok.
+total_heap_size(_Config) ->
+
+ Fun = fun F() -> receive Pid when is_pid(Pid) -> Pid ! ok,F() end end,
+
+ %% Test that on_heap messages grow the heap even if they are not received
+ OnPid = spawn_opt(Fun, [{message_queue_data, on_heap}]),
+ {total_heap_size, OnSize} = erlang:process_info(OnPid, total_heap_size),
+ [OnPid ! lists:duplicate(N,N) || N <- lists:seq(1,100)],
+ OnPid ! self(), receive ok -> ok end,
+ {total_heap_size, OnSizeAfter} = erlang:process_info(OnPid, total_heap_size),
+ ct:log("OnSize = ~p, OnSizeAfter = ~p",[OnSize, OnSizeAfter]),
+ true = OnSize < OnSizeAfter,
+
+ %% Test that off_heap messages do not grow the heap if they are not received
+ OffPid = spawn_opt(Fun, [{message_queue_data, off_heap}]),
+ {total_heap_size, OffSize} = erlang:process_info(OffPid, total_heap_size),
+ [OffPid ! lists:duplicate(N,N) || N <- lists:seq(1,100)],
+ OffPid ! self(), receive ok -> ok end,
+ {total_heap_size, OffSizeAfter} = erlang:process_info(OffPid, total_heap_size),
+ ct:log("OffSize = ~p, OffSizeAfter = ~p",[OffSize, OffSizeAfter]),
+ true = OffSize == OffSizeAfter.
+
%%
%%
%% helpers
diff --git a/erts/emulator/test/module_info_SUITE.erl b/erts/emulator/test/module_info_SUITE.erl
index f8208c5866..ba9b564fdc 100644
--- a/erts/emulator/test/module_info_SUITE.erl
+++ b/erts/emulator/test/module_info_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/monitor_SUITE.erl b/erts/emulator/test/monitor_SUITE.erl
index 82e3a36c1e..8955e62df5 100644
--- a/erts/emulator/test/monitor_SUITE.erl
+++ b/erts/emulator/test/monitor_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/mtx_SUITE.erl b/erts/emulator/test/mtx_SUITE.erl
index a17b11f3bf..1493e52655 100644
--- a/erts/emulator/test/mtx_SUITE.erl
+++ b/erts/emulator/test/mtx_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/mtx_SUITE_data/Makefile.src b/erts/emulator/test/mtx_SUITE_data/Makefile.src
index dc880118f1..1816dc6798 100644
--- a/erts/emulator/test/mtx_SUITE_data/Makefile.src
+++ b/erts/emulator/test/mtx_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2013. All Rights Reserved.
+# Copyright Ericsson AB 2010-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/mtx_SUITE_data/mtx_SUITE.c b/erts/emulator/test/mtx_SUITE_data/mtx_SUITE.c
index 1911291448..e011aadce9 100644
--- a/erts/emulator/test/mtx_SUITE_data/mtx_SUITE.c
+++ b/erts/emulator/test/mtx_SUITE_data/mtx_SUITE.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/multi_load_SUITE.erl b/erts/emulator/test/multi_load_SUITE.erl
index 784b239116..edf3205812 100644
--- a/erts/emulator/test/multi_load_SUITE.erl
+++ b/erts/emulator/test/multi_load_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -19,32 +19,16 @@
%%
-module(multi_load_SUITE).
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- many/1,on_load/1,errors/1]).
+-export([all/0, suite/0, many/1, on_load/1, errors/1]).
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]}].
all() ->
[many,on_load,errors].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
many(_Config) ->
Ms = make_modules(100, fun many_module/1),
@@ -57,7 +41,6 @@ many(_Config) ->
io:put_chars("Heavy load\n"
"=========="),
many_measure(Ms),
-
ok.
many_module(M) ->
@@ -81,9 +64,12 @@ many_measure(Ms) ->
"Sequential: ~9w µs\n"
"Parallel: ~9w µs\n"
"Ratio: ~9w\n",
- [length(Ms),Us1,Us2,round(Us1/Us2)]),
+ [length(Ms),Us1,Us2,divide(Us1,Us2)]),
ok.
+divide(A,B) when B > 0 -> A div B;
+divide(_,_) -> inf.
+
many_load_seq(Ms) ->
[erlang:finish_loading([M]) || M <- Ms],
ok.
@@ -135,7 +121,6 @@ on_load(_Config) ->
SingleOnPrep = tl(OnPrep),
{on_load,[OnLoadMod]} = erlang:finish_loading(SingleOnPrep),
ok = erlang:call_on_load_function(OnLoadMod),
-
ok.
on_load_module(M) ->
diff --git a/erts/emulator/test/nested_SUITE.erl b/erts/emulator/test/nested_SUITE.erl
index c13e19f857..7af2873ce2 100644
--- a/erts/emulator/test/nested_SUITE.erl
+++ b/erts/emulator/test/nested_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/nif_SUITE.erl b/erts/emulator/test/nif_SUITE.erl
index 84f5699890..a7767132ee 100644
--- a/erts/emulator/test/nif_SUITE.erl
+++ b/erts/emulator/test/nif_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -42,7 +42,12 @@
dirty_nif_exception/1, call_dirty_nif_exception/1, nif_schedule/1,
nif_exception/1, call_nif_exception/1,
nif_nan_and_inf/1, nif_atom_too_long/1,
- nif_monotonic_time/1, nif_time_offset/1, nif_convert_time_unit/1]).
+ nif_monotonic_time/1, nif_time_offset/1, nif_convert_time_unit/1,
+ nif_now_time/1, nif_cpu_time/1, nif_unique_integer/1,
+ nif_is_process_alive/1, nif_is_port_alive/1,
+ nif_term_to_binary/1, nif_binary_to_term/1,
+ nif_port_command/1
+ ]).
-export([many_args_100/100]).
@@ -72,7 +77,11 @@ all() ->
otp_9668, consume_timeslice,
nif_schedule, dirty_nif, dirty_nif_send, dirty_nif_exception,
nif_exception, nif_nan_and_inf, nif_atom_too_long,
- nif_monotonic_time, nif_time_offset, nif_convert_time_unit
+ nif_monotonic_time, nif_time_offset, nif_convert_time_unit,
+ nif_now_time, nif_cpu_time, nif_unique_integer,
+ nif_is_process_alive, nif_is_port_alive,
+ nif_term_to_binary, nif_binary_to_term,
+ nif_port_command
].
init_per_testcase(_Case, Config) ->
@@ -1273,9 +1282,10 @@ send3_make_blob() ->
repeat(N bsr 1,
fun(_) -> grow_blob(MsgEnv,other_term(),rand:uniform(1 bsl 20))
end, void),
- case (N band 1) of
+ case (N band 3) of
0 -> {term,copy_blob(MsgEnv)};
- 1 -> {msgenv,MsgEnv}
+ 1 -> {copy,copy_blob(MsgEnv)};
+ _ -> {msgenv,MsgEnv}
end
end.
@@ -1288,6 +1298,9 @@ send3_send(Pid, Msg) ->
send3_send_nif(Pid, {term,Blob}) ->
%%io:format("~p send term nif\n",[self()]),
send_term(Pid, {blob, Blob}) =:= 1;
+send3_send_nif(Pid, {copy,Blob}) ->
+ %%io:format("~p send term nif\n",[self()]),
+ send_copy_term(Pid, {blob, Blob}) =:= 1;
send3_send_nif(Pid, {msgenv,MsgEnv}) ->
%%io:format("~p send blob nif\n",[self()]),
send3_blob(MsgEnv, Pid, blob) =:= 1.
@@ -1296,6 +1309,10 @@ send3_send_bang(Pid, {term,Blob}) ->
%%io:format("~p send term bang\n",[self()]),
Pid ! {blob, Blob},
true;
+send3_send_bang(Pid, {copy,Blob}) ->
+ %%io:format("~p send term bang\n",[self()]),
+ Pid ! {blob, Blob},
+ true;
send3_send_bang(Pid, {msgenv,MsgEnv}) ->
%%io:format("~p send blob bang\n",[self()]),
Pid ! {blob, copy_blob(MsgEnv)},
@@ -1365,14 +1382,16 @@ get_length(Config) when is_list(Config) ->
ensure_lib_loaded(Config) ->
ensure_lib_loaded(Config, 1).
ensure_lib_loaded(Config, Ver) ->
+ Path = ?config(data_dir, Config),
case lib_version() of
- undefined ->
- Path = proplists:get_value(data_dir, Config),
- Lib = "nif_SUITE." ++ integer_to_list(Ver),
- ok = erlang:load_nif(filename:join(Path,Lib), []);
- Ver when is_integer(Ver) ->
- ok
- end.
+ undefined ->
+ Lib = "nif_SUITE." ++ integer_to_list(Ver),
+ ok = erlang:load_nif(filename:join(Path,Lib), []);
+ Ver when is_integer(Ver) ->
+ ok
+ end,
+ erl_ddll:try_load(Path, echo_drv, []),
+ ok.
make_atom(Config) when is_list(Config) ->
ensure_lib_loaded(Config, 1),
@@ -1885,6 +1904,129 @@ chk_ctu(Time, FromTU, [ToTU|ToTUs]) ->
chk_ctu(Time, FromTU, ToTUs)
end.
+nif_now_time(Config) ->
+ ensure_lib_loaded(Config),
+
+ N1 = now(),
+ NifN1 = now_time(),
+ NifN2 = now_time(),
+ N2 = now(),
+ true = N1 < NifN1,
+ true = NifN1 < NifN2,
+ true = NifN2 < N2.
+
+nif_cpu_time(Config) ->
+ ensure_lib_loaded(Config),
+
+ try cpu_time() of
+ {_, _, _} ->
+ ok
+ catch error:badarg ->
+ {comment, "cpu_time not supported"}
+ end.
+
+nif_unique_integer(Config) ->
+ ensure_lib_loaded(Config),
+
+ UM1 = erlang:unique_integer([monotonic]),
+ UM2 = unique_integer_nif([monotonic]),
+ UM3 = erlang:unique_integer([monotonic]),
+
+ true = UM1 < UM2,
+ true = UM2 < UM3,
+
+ UMP1 = erlang:unique_integer([monotonic, positive]),
+ UMP2 = unique_integer_nif([monotonic, positive]),
+ UMP3 = erlang:unique_integer([monotonic, positive]),
+
+ true = 0 =< UMP1,
+ true = UMP1 < UMP2,
+ true = UMP2 < UMP3,
+
+ UP1 = erlang:unique_integer([positive]),
+ UP2 = unique_integer_nif([positive]),
+ UP3 = erlang:unique_integer([positive]),
+
+ true = 0 =< UP1,
+ true = 0 =< UP2,
+ true = 0 =< UP3,
+
+ true = is_integer(unique_integer_nif([])),
+ true = is_integer(unique_integer_nif([])),
+ true = is_integer(unique_integer_nif([])).
+
+nif_is_process_alive(Config) ->
+ ensure_lib_loaded(Config),
+
+ {Pid,_} = spawn_monitor(fun() -> receive ok -> nok end end),
+ true = is_process_alive_nif(Pid),
+ exit(Pid, die),
+ receive _ -> ok end, %% Clear monitor
+ false = is_process_alive_nif(Pid).
+
+nif_is_port_alive(Config) ->
+ ensure_lib_loaded(Config),
+
+ Port = open_port({spawn,echo_drv},[eof]),
+ true = is_port_alive_nif(Port),
+ port_close(Port),
+ false = is_port_alive_nif(Port).
+
+nif_term_to_binary(Config) ->
+ ensure_lib_loaded(Config),
+ T = {#{ok => nok}, <<0:8096>>, lists:seq(1,100)},
+ Bin = term_to_binary(T),
+ ct:log("~p",[Bin]),
+ Bin = term_to_binary_nif(T, undefined),
+ true = term_to_binary_nif(T, self()),
+ receive Bin -> ok end.
+
+-define(ERL_NIF_BIN2TERM_SAFE, 16#20000000).
+
+nif_binary_to_term(Config) ->
+ ensure_lib_loaded(Config),
+ T = {#{ok => nok}, <<0:8096>>, lists:seq(1,100)},
+ Bin = term_to_binary(T),
+ Len = byte_size(Bin),
+ {Len,T} = binary_to_term_nif(Bin, undefined, 0),
+ Len = binary_to_term_nif(Bin, self(), 0),
+ T = receive M -> M after 1000 -> timeout end,
+
+ {Len, T} = binary_to_term_nif(Bin, undefined, ?ERL_NIF_BIN2TERM_SAFE),
+ false = binary_to_term_nif(<<131,100,0,14,"undefined_atom">>,
+ undefined, ?ERL_NIF_BIN2TERM_SAFE),
+ false = binary_to_term_nif(Bin, undefined, 1),
+ ok.
+
+nif_port_command(Config) ->
+ ensure_lib_loaded(Config),
+
+ Port = open_port({spawn,echo_drv},[eof]),
+ true = port_command_nif(Port, "hello\n"),
+ receive {Port,{data,"hello\n"}} -> ok
+ after 1000 -> ct:fail(timeout) end,
+
+ RefcBin = lists:flatten([lists:duplicate(100, "hello"),"\n"]),
+ true = port_command_nif(Port, iolist_to_binary(RefcBin)),
+ receive {Port,{data,RefcBin}} -> ok
+ after 1000 -> ct:fail(timeout) end,
+
+ %% Test that invalid arguments correctly returns
+ %% badarg and that the port survives.
+ {'EXIT', {badarg, _}} = (catch port_command_nif(Port, [ok])),
+
+ IoList = [lists:duplicate(100,<<"hello">>),"\n"],
+ true = port_command_nif(Port, [IoList]),
+ FlatIoList = binary_to_list(iolist_to_binary(IoList)),
+ receive {Port,{data,FlatIoList}} -> ok
+ after 1000 -> ct:fail(timeout) end,
+
+ port_close(Port),
+
+ {'EXIT', {badarg, _}} = (catch port_command_nif(Port, "hello\n")),
+
+ ok.
+
%% The NIFs:
lib_version() -> undefined.
call_history() -> ?nif_stub.
@@ -1928,6 +2070,7 @@ send_blob_thread(_,_,_) -> ?nif_stub.
join_send_thread(_) -> ?nif_stub.
copy_blob(_) -> ?nif_stub.
send_term(_,_) -> ?nif_stub.
+send_copy_term(_,_) -> ?nif_stub.
reverse_list(_) -> ?nif_stub.
echo_int(_) -> ?nif_stub.
type_sizes() -> ?nif_stub.
@@ -1942,6 +2085,12 @@ call_dirty_nif_zero_args() -> ?nif_stub.
call_nif_exception(_) -> ?nif_stub.
call_nif_nan_or_inf(_) -> ?nif_stub.
call_nif_atom_too_long(_) -> ?nif_stub.
+unique_integer_nif(_) -> ?nif_stub.
+is_process_alive_nif(_) -> ?nif_stub.
+is_port_alive_nif(_) -> ?nif_stub.
+term_to_binary_nif(_, _) -> ?nif_stub.
+binary_to_term_nif(_, _, _) -> ?nif_stub.
+port_command_nif(_, _) -> ?nif_stub.
%% maps
is_map_nif(_) -> ?nif_stub.
@@ -1958,7 +2107,8 @@ sorted_list_from_maps_nif(_) -> ?nif_stub.
monotonic_time(_) -> ?nif_stub.
time_offset(_) -> ?nif_stub.
convert_time_unit(_,_,_) -> ?nif_stub.
-
+now_time() -> ?nif_stub.
+cpu_time() -> ?nif_stub.
nif_stub_error(Line) ->
exit({nif_not_loaded,module,?MODULE,line,Line}).
diff --git a/erts/emulator/test/nif_SUITE_data/Makefile.src b/erts/emulator/test/nif_SUITE_data/Makefile.src
index ab4ff77add..fbb8978771 100644
--- a/erts/emulator/test/nif_SUITE_data/Makefile.src
+++ b/erts/emulator/test/nif_SUITE_data/Makefile.src
@@ -4,8 +4,7 @@ NIF_LIBS = nif_SUITE.1@dll@ \
nif_mod.2@dll@ \
nif_mod.3@dll@
-all: $(NIF_LIBS) basic@dll@ rwlock@dll@ tsd@dll@
-
+all: $(NIF_LIBS) basic@dll@ rwlock@dll@ tsd@dll@ echo_drv@dll@
@SHLIB_RULES@
diff --git a/erts/emulator/test/nif_SUITE_data/echo_drv.c b/erts/emulator/test/nif_SUITE_data/echo_drv.c
new file mode 100644
index 0000000000..2b3510c641
--- /dev/null
+++ b/erts/emulator/test/nif_SUITE_data/echo_drv.c
@@ -0,0 +1,62 @@
+#include <stdio.h>
+#include "erl_driver.h"
+
+static ErlDrvPort erlang_port;
+static ErlDrvData echo_start(ErlDrvPort, char *);
+static void from_erlang(ErlDrvData, char*, ErlDrvSizeT);
+static ErlDrvSSizeT echo_call(ErlDrvData drv_data, unsigned int command,
+ char *buf, ErlDrvSizeT len,
+ char **rbuf, ErlDrvSizeT rlen, unsigned *ret_flags);
+static ErlDrvEntry echo_driver_entry = {
+ NULL, /* Init */
+ echo_start,
+ NULL, /* Stop */
+ from_erlang,
+ NULL, /* Ready input */
+ NULL, /* Ready output */
+ "echo_drv",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ echo_call,
+ NULL,
+ ERL_DRV_EXTENDED_MARKER,
+ ERL_DRV_EXTENDED_MAJOR_VERSION,
+ ERL_DRV_EXTENDED_MINOR_VERSION,
+ 0,
+ NULL,
+ NULL,
+ NULL
+};
+
+DRIVER_INIT(echo_drv)
+{
+ return &echo_driver_entry;
+}
+
+static ErlDrvData
+echo_start(ErlDrvPort port, char *buf)
+{
+ return (ErlDrvData) port;
+}
+
+static void
+from_erlang(ErlDrvData data, char *buf, ErlDrvSizeT count)
+{
+ driver_output((ErlDrvPort) data, buf, count);
+}
+
+static ErlDrvSSizeT
+echo_call(ErlDrvData drv_data, unsigned int command,
+ char *buf, ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen,
+ unsigned *ret_flags)
+{
+ *rbuf = buf;
+ *ret_flags |= DRIVER_CALL_KEEP_BUFFER;
+ return len;
+}
+
diff --git a/erts/emulator/test/nif_SUITE_data/nif_SUITE.c b/erts/emulator/test/nif_SUITE_data/nif_SUITE.c
index 1acb270d1f..11e5dab58e 100644
--- a/erts/emulator/test/nif_SUITE_data/nif_SUITE.c
+++ b/erts/emulator/test/nif_SUITE_data/nif_SUITE.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@ static int static_cntA; /* zero by default */
static int static_cntB = NIF_SUITE_LIB_VER * 100;
static ERL_NIF_TERM atom_false;
+static ERL_NIF_TERM atom_true;
static ERL_NIF_TERM atom_self;
static ERL_NIF_TERM atom_ok;
static ERL_NIF_TERM atom_join;
@@ -138,6 +139,7 @@ static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info)
msgenv_dtor,
ERL_NIF_RT_CREATE, NULL);
atom_false = enif_make_atom(env,"false");
+ atom_true = enif_make_atom(env,"true");
atom_self = enif_make_atom(env,"self");
atom_ok = enif_make_atom(env,"ok");
atom_join = enif_make_atom(env,"join");
@@ -1464,6 +1466,18 @@ static ERL_NIF_TERM send_term(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[
return enif_make_int(env, ret);
}
+static ERL_NIF_TERM send_copy_term(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ ErlNifEnv* menv;
+ ErlNifPid pid;
+ int ret;
+ if (!enif_get_local_pid(env, argv[0], &pid)) {
+ return enif_make_badarg(env);
+ }
+ ret = enif_send(env, &pid, NULL, argv[1]);
+ return enif_make_int(env, ret);
+}
+
static ERL_NIF_TERM reverse_list(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) {
ERL_NIF_TERM rev_list;
@@ -1978,6 +1992,123 @@ static ERL_NIF_TERM convert_time_unit(ErlNifEnv* env, int argc, const ERL_NIF_TE
return enif_make_int64(env, enif_convert_time_unit(val, from, to));
}
+static ERL_NIF_TERM now_time(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ return enif_now_time(env);
+}
+
+static ERL_NIF_TERM cpu_time(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ return enif_cpu_time(env);
+}
+
+static ERL_NIF_TERM unique_integer(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ ERL_NIF_TERM atom_pos = enif_make_atom(env,"positive"),
+ atom_mon = enif_make_atom(env,"monotonic");
+ ERL_NIF_TERM opts = argv[0], opt;
+ ErlNifUniqueInteger properties = 0;
+
+ while (!enif_is_empty_list(env, opts)) {
+ if (!enif_get_list_cell(env, opts, &opt, &opts))
+ return enif_make_badarg(env);
+
+ if (enif_compare(opt, atom_pos) == 0)
+ properties |= ERL_NIF_UNIQUE_POSITIVE;
+ if (enif_compare(opt, atom_mon) == 0)
+ properties |= ERL_NIF_UNIQUE_MONOTONIC;
+ }
+
+ return enif_make_unique_integer(env, properties);
+}
+
+static ERL_NIF_TERM is_process_alive(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ ErlNifPid pid;
+ if (!enif_get_local_pid(env, argv[0], &pid))
+ return enif_make_badarg(env);
+ if (enif_is_process_alive(env, &pid))
+ return atom_true;
+ return atom_false;
+}
+
+static ERL_NIF_TERM is_port_alive(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ ErlNifPort port;
+ if (!enif_get_local_port(env, argv[0], &port))
+ return enif_make_badarg(env);
+ if (enif_is_port_alive(env, &port))
+ return atom_true;
+ return atom_false;
+}
+
+static ERL_NIF_TERM term_to_binary(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ ErlNifBinary bin;
+ ErlNifPid pid;
+ ErlNifEnv *msg_env = env;
+ ERL_NIF_TERM term;
+
+ if (enif_get_local_pid(env, argv[1], &pid))
+ msg_env = enif_alloc_env();
+
+ if (!enif_term_to_binary(msg_env, argv[0], &bin))
+ return enif_make_badarg(env);
+
+ term = enif_make_binary(msg_env, &bin);
+
+ if (msg_env != env) {
+ enif_send(env, &pid, msg_env, term);
+ enif_free_env(msg_env);
+ return atom_true;
+ } else {
+ return term;
+ }
+}
+
+static ERL_NIF_TERM binary_to_term(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ ErlNifBinary bin;
+ ERL_NIF_TERM term, ret_term;
+ ErlNifPid pid;
+ ErlNifEnv *msg_env = env;
+ unsigned int opts;
+ ErlNifUInt64 ret;
+
+ if (enif_get_local_pid(env, argv[1], &pid))
+ msg_env = enif_alloc_env();
+
+ if (!enif_inspect_binary(env, argv[0], &bin)
+ || !enif_get_uint(env, argv[2], &opts))
+ return enif_make_badarg(env);
+
+ ret = enif_binary_to_term(msg_env, bin.data, bin.size, &term,
+ (ErlNifBinaryToTerm)opts);
+ if (!ret)
+ return atom_false;
+
+ ret_term = enif_make_uint64(env, ret);
+ if (msg_env != env) {
+ enif_send(env, &pid, msg_env, term);
+ enif_free_env(msg_env);
+ return ret_term;
+ } else {
+ return enif_make_tuple2(env, ret_term, term);
+ }
+}
+
+static ERL_NIF_TERM port_command(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ ErlNifPort port;
+
+ if (!enif_get_local_port(env, argv[0], &port))
+ return enif_make_badarg(env);
+
+ if (!enif_port_command(env, &port, NULL, argv[1]))
+ return enif_make_badarg(env);
+ return atom_true;
+}
+
static ErlNifFunc nif_funcs[] =
{
{"lib_version", 0, lib_version},
@@ -2023,6 +2154,7 @@ static ErlNifFunc nif_funcs[] =
{"join_send_thread", 1, join_send_thread},
{"copy_blob", 1, copy_blob},
{"send_term", 2, send_term},
+ {"send_copy_term", 2, send_copy_term},
{"reverse_list",1, reverse_list},
{"echo_int", 1, echo_int},
{"type_sizes", 0, type_sizes},
@@ -2050,8 +2182,15 @@ static ErlNifFunc nif_funcs[] =
{"sorted_list_from_maps_nif", 1, sorted_list_from_maps_nif},
{"monotonic_time", 1, monotonic_time},
{"time_offset", 1, time_offset},
- {"convert_time_unit", 3, convert_time_unit}
+ {"convert_time_unit", 3, convert_time_unit},
+ {"now_time", 0, now_time},
+ {"cpu_time", 0, cpu_time},
+ {"unique_integer_nif", 1, unique_integer},
+ {"is_process_alive_nif", 1, is_process_alive},
+ {"is_port_alive_nif", 1, is_port_alive},
+ {"term_to_binary_nif", 2, term_to_binary},
+ {"binary_to_term_nif", 3, binary_to_term},
+ {"port_command_nif", 2, port_command}
};
ERL_NIF_INIT(nif_SUITE,nif_funcs,load,reload,upgrade,unload)
-
diff --git a/erts/emulator/test/nif_SUITE_data/nif_mod.c b/erts/emulator/test/nif_SUITE_data/nif_mod.c
index f7e729e2b6..fd8a0d0595 100644
--- a/erts/emulator/test/nif_SUITE_data/nif_mod.c
+++ b/erts/emulator/test/nif_SUITE_data/nif_mod.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/nif_SUITE_data/nif_mod.erl b/erts/emulator/test/nif_SUITE_data/nif_mod.erl
index b6de046388..eec1bb8858 100644
--- a/erts/emulator/test/nif_SUITE_data/nif_mod.erl
+++ b/erts/emulator/test/nif_SUITE_data/nif_mod.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/node_container_SUITE.erl b/erts/emulator/test/node_container_SUITE.erl
index 71400142af..536c91d4ae 100644
--- a/erts/emulator/test/node_container_SUITE.erl
+++ b/erts/emulator/test/node_container_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,8 +28,6 @@
-module(node_container_SUITE).
-author('[email protected]').
-%-define(line_trace, 1).
-
-include_lib("common_test/include/ct.hrl").
-export([all/0, suite/0, init_per_suite/1, end_per_suite/1,
@@ -56,7 +54,7 @@
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap, {minutes, 10}}].
+ {timetrap, {minutes, 12}}].
all() ->
@@ -126,7 +124,13 @@ term_to_binary_to_term_eq(Config) when is_list(Config) ->
LHLRef = binary_to_term(term_to_binary(LHLRef)),
LSRef = binary_to_term(term_to_binary(LSRef)),
% Get remote node containers
- RNode = {get_nodename(), 3},
+ ttbtteq_do_remote({get_nodename(), 3}),
+ ttbtteq_do_remote({get_nodename(), 4}),
+ ttbtteq_do_remote({get_nodename(), 16#adec0ded}),
+ nc_refc_check(node()),
+ ok.
+
+ttbtteq_do_remote(RNode) ->
RPid = mk_pid(RNode, 4711, 1),
RXPid = mk_pid(RNode, 32767, 8191),
RPort = mk_port(RNode, 4711),
@@ -142,7 +146,6 @@ term_to_binary_to_term_eq(Config) when is_list(Config) ->
RLRef = binary_to_term(term_to_binary(RLRef)),
RHLRef = binary_to_term(term_to_binary(RHLRef)),
RSRef = binary_to_term(term_to_binary(RSRef)),
- nc_refc_check(node()),
ok.
@@ -712,7 +715,7 @@ run_otp_4715(Config) when is_list(Config) ->
pid_wrap(Config) when is_list(Config) -> pp_wrap(pid).
port_wrap(Config) when is_list(Config) ->
- case test_server:os_type() of
+ case os:type() of
{unix, _} ->
pp_wrap(port);
_ ->
@@ -807,7 +810,7 @@ bad_nc(Config) when is_list(Config) ->
= (catch mk_ref(RemNode, [(1 bsl 18), 4711, 4711])),
{'EXIT', {badarg, mk_ref, _}}
= (catch mk_ref(RemNode, [4711, 4711, 4711, 4711, 4711, 4711, 4711])),
- BadNode = {x@y, 4},
+ BadNode = {x@y, bad_creation},
{'EXIT', {badarg, mk_pid, _}}
= (catch mk_pid(BadNode, 4711, 17)),
{'EXIT', {badarg, mk_port, _}}
@@ -842,11 +845,10 @@ iter_max_procs(Config) when is_list(Config) ->
Res = chk_max_proc_line(),
Res = chk_max_proc_line(),
done = chk_max_proc_line_until(NoMoreTests, Res),
- {comment,
- io_lib:format("max processes = ~p; "
- "process line length = ~p",
- [element(2, Res), element(1, Res)])}.
-
+ Cmt = io_lib:format("max processes = ~p; "
+ "process line length = ~p",
+ [element(2, Res), element(1, Res)]),
+ {comment, lists:flatten(Cmt)}.
max_proc_line(Root, Parent, N) ->
Me = self(),
@@ -1111,6 +1113,9 @@ get_nodename() ->
-define(PORT_EXT, 102).
-define(PID_EXT, 103).
-define(NEW_REFERENCE_EXT, 114).
+-define(NEW_PID_EXT, $X).
+-define(NEW_PORT_EXT, $Y).
+-define(NEWER_REFERENCE_EXT, $Z).
uint32_be(Uint) when is_integer(Uint), 0 =< Uint, Uint < 1 bsl 32 ->
[(Uint bsr 24) band 16#ff,
@@ -1133,51 +1138,65 @@ uint8(Uint) ->
exit({badarg, uint8, [Uint]}).
+pid_tag(bad_creation) -> ?PID_EXT;
+pid_tag(Creation) when Creation =< 3 -> ?PID_EXT;
+pid_tag(_Creation) -> ?NEW_PID_EXT.
+
+enc_creation(bad_creation) -> uint8(4);
+enc_creation(Creation) when Creation =< 3 -> uint8(Creation);
+enc_creation(Creation) -> uint32_be(Creation).
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})
+ pid_tag(Creation),
+ ?ATOM_EXT,
+ uint16_be(length(NodeName)),
+ NodeName,
+ uint32_be(Number),
+ uint32_be(Serial),
+ enc_creation(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.
+port_tag(bad_creation) -> ?PORT_EXT;
+port_tag(Creation) when Creation =< 3 -> ?PORT_EXT;
+port_tag(_Creation) -> ?NEW_PORT_EXT.
+
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})
+ port_tag(Creation),
+ ?ATOM_EXT,
+ uint16_be(length(NodeName)),
+ NodeName,
+ uint32_be(Number),
+ enc_creation(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.
+ref_tag(bad_creation) -> ?NEW_REFERENCE_EXT;
+ref_tag(Creation) when Creation =< 3 -> ?NEW_REFERENCE_EXT;
+ref_tag(_Creation) -> ?NEWER_REFERENCE_EXT.
+
mk_ref({NodeName, Creation}, Numbers) when is_atom(NodeName),
- is_integer(Creation),
- is_list(Numbers) ->
+ 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) ->
+ Creation =< 3,
+ is_integer(Number) ->
case catch binary_to_term(list_to_binary([?VERSION_MAGIC,
?REFERENCE_EXT,
?ATOM_EXT,
@@ -1193,25 +1212,24 @@ mk_ref({NodeName, Creation}, [Number]) when is_list(NodeName),
exit({unexpected_binary_to_term_result, Other})
end;
mk_ref({NodeName, Creation}, Numbers) when is_list(NodeName),
- is_integer(Creation),
- is_list(Numbers) ->
+ 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})
+ ref_tag(Creation),
+ uint16_be(length(Numbers)),
+ ?ATOM_EXT,
+ uint16_be(length(NodeName)),
+ NodeName,
+ enc_creation(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.
exec_loop() ->
diff --git a/erts/emulator/test/nofrag_SUITE.erl b/erts/emulator/test/nofrag_SUITE.erl
index 9cc851f9cf..8b1519ae36 100644
--- a/erts/emulator/test/nofrag_SUITE.erl
+++ b/erts/emulator/test/nofrag_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/num_bif_SUITE.erl b/erts/emulator/test/num_bif_SUITE.erl
index 04a6f9d18d..d1c9648017 100644
--- a/erts/emulator/test/num_bif_SUITE.erl
+++ b/erts/emulator/test/num_bif_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/old_mod.erl b/erts/emulator/test/old_mod.erl
index 0da40ec430..866aba79bb 100644
--- a/erts/emulator/test/old_mod.erl
+++ b/erts/emulator/test/old_mod.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/old_scheduler_SUITE.erl b/erts/emulator/test/old_scheduler_SUITE.erl
index 9d40417d0a..f91d84beea 100644
--- a/erts/emulator/test/old_scheduler_SUITE.erl
+++ b/erts/emulator/test/old_scheduler_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/op_SUITE.erl b/erts/emulator/test/op_SUITE.erl
index 562cf1c92d..08655d32a5 100644
--- a/erts/emulator/test/op_SUITE.erl
+++ b/erts/emulator/test/op_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap, {minutes, 3}}].
+ {timetrap, {minutes, 5}}].
all() ->
[bsl_bsr, logical, t_not, relop_simple, relop,
@@ -39,9 +39,16 @@ all() ->
%% Test the bsl and bsr operators.
bsl_bsr(Config) when is_list(Config) ->
Vs = [unvalue(V) || V <- [-16#8000009-2,-1,0,1,2,73,16#8000000,bad,[]]],
- Cases = [{Op,X,Y} || Op <- ['bsr','bsl'], X <- Vs, Y <- Vs],
- run_test_module(Cases, false),
- {comment,integer_to_list(length(Cases)) ++ " cases"}.
+ %% Try to use less memory by splitting the cases
+
+ Cases1 = [{Op,X,Y} || Op <- ['bsl'], X <- Vs, Y <- Vs],
+ N1 = length(Cases1),
+ run_test_module(Cases1, false),
+
+ Cases2 = [{Op,X,Y} || Op <- ['bsr'], X <- Vs, Y <- Vs],
+ N2 = length(Cases2),
+ run_test_module(Cases2, false),
+ {comment,integer_to_list(N1 + N2) ++ " cases"}.
%% Test the logical operators and internal BIFs.
logical(Config) when is_list(Config) ->
diff --git a/erts/emulator/test/port_SUITE.erl b/erts/emulator/test/port_SUITE.erl
index 328641f5b9..79abcbde5f 100644
--- a/erts/emulator/test/port_SUITE.erl
+++ b/erts/emulator/test/port_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -87,6 +87,7 @@
name1/1,
t_binary/1, parallell/1, t_exit/1,
env/1, huge_env/1, bad_env/1, cd/1, exit_status/1,
+ bad_args/1,
tps_16_bytes/1, tps_1K/1, line/1, stderr_to_stdout/1,
otp_3906/1, otp_4389/1, win_massive/1, win_massive_client/1,
mix_up_ports/1, otp_5112/1, otp_5119/1, otp_6224/1,
@@ -115,6 +116,7 @@ all() ->
{group, multiple_packets}, parallell, dying_port,
port_program_with_path, open_input_file_port,
open_output_file_port, name1, env, huge_env, bad_env, cd,
+ bad_args,
exit_status, iter_max_ports, count_fds, t_exit, {group, tps}, line,
stderr_to_stdout, otp_3906, otp_4389, win_massive,
mix_up_ports, otp_5112, otp_5119,
@@ -901,14 +903,15 @@ bad_env(Config) when is_list(Config) ->
ok.
try_bad_env(Env) ->
- try open_port({spawn,"ls"}, [{env,Env}])
- catch
- error:badarg -> ok
- end.
+ badarg = try open_port({spawn,"ls"}, [{env,Env}])
+ catch
+ error:badarg -> badarg
+ end.
+
%% Test that we can handle a very very large environment gracefully.
huge_env(Config) when is_list(Config) ->
- ct:timetrap({seconds, 30}),
+ ct:timetrap({minutes, 2}),
Vars = case os:type() of
{win32,_} -> 500;
_ ->
@@ -940,6 +943,24 @@ huge_env(Config) when is_list(Config) ->
end.
+%% Test bad 'args' options.
+bad_args(Config) when is_list(Config) ->
+ try_bad_args({args, [self()]}),
+ try_bad_args({args, ["head" | "tail"]}),
+ try_bad_args({args, ["head", "body" | "tail"]}),
+ try_bad_args({args, [<<"head">>, <<"body">> | <<"tail">>]}),
+ try_bad_args({args, not_a_list}),
+ try_bad_args({args, ["string",<<"binary">>, 1472, "string"]}),
+ try_bad_args({args, ["string",<<"binary">>], "element #3"}),
+ ok.
+
+try_bad_args(Args) ->
+ badarg = try open_port({spawn_executable,"ls"}, [Args])
+ catch
+ error:badarg -> badarg
+ end.
+
+
%% 'cd' option
%% (Can perhaps be made smaller by calling the other utility functions
@@ -1757,7 +1778,7 @@ otp_6224_loop() ->
exit_status_multi_scheduling_block(Config) when is_list(Config) ->
Repeat = 3,
- case test_server:os_type() of
+ case os:type() of
{unix, _} ->
ct:timetrap({minutes, 2*Repeat}),
SleepSecs = 6,
diff --git a/erts/emulator/test/port_SUITE_data/dead_port.c b/erts/emulator/test/port_SUITE_data/dead_port.c
index c859dbc402..26f09f33c7 100644
--- a/erts/emulator/test/port_SUITE_data/dead_port.c
+++ b/erts/emulator/test/port_SUITE_data/dead_port.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/port_SUITE_data/port_test.erl b/erts/emulator/test/port_SUITE_data/port_test.erl
index b07038e73d..406d376b26 100644
--- a/erts/emulator/test/port_SUITE_data/port_test.erl
+++ b/erts/emulator/test/port_SUITE_data/port_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/port_bif_SUITE.erl b/erts/emulator/test/port_bif_SUITE.erl
index 9b794be415..e1e1ec9fb9 100644
--- a/erts/emulator/test/port_bif_SUITE.erl
+++ b/erts/emulator/test/port_bif_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/port_trace_SUITE.erl b/erts/emulator/test/port_trace_SUITE.erl
new file mode 100644
index 0000000000..bfdea0761b
--- /dev/null
+++ b/erts/emulator/test/port_trace_SUITE.erl
@@ -0,0 +1,614 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(port_trace_SUITE).
+
+-export([all/0, suite/0,init_per_suite/1, end_per_suite/1,
+ init_per_group/2,end_per_group/2,
+ init_per_testcase/2,end_per_testcase/2]).
+-export([port_specs/1, ports/1, open_close/1,
+ command/1, control/1, connect/1, call/1,
+ output/1, output2/1, output_binary/1,
+ outputv/1, set_timer/1, failure_eof/1,
+ failure_atom/1, failure_posix/1,
+ failure/1, output_term/1,
+ driver_output_term/1,
+ send_term/1, driver_send_term/1]).
+
+-define(ECHO_DRV_NOOP, 0).
+-define(ECHO_DRV_OUTPUT, 1).
+-define(ECHO_DRV_OUTPUT2, 2).
+-define(ECHO_DRV_OUTPUT_BINARY, 3).
+-define(ECHO_DRV_OUTPUTV, 4).
+-define(ECHO_DRV_SET_TIMER, 5).
+-define(ECHO_DRV_FAILURE_EOF, 6).
+-define(ECHO_DRV_FAILURE_ATOM, 7).
+-define(ECHO_DRV_FAILURE_POSIX, 8).
+-define(ECHO_DRV_FAILURE, 9).
+-define(ECHO_DRV_OUTPUT_TERM, 10).
+-define(ECHO_DRV_DRIVER_OUTPUT_TERM, 11).
+-define(ECHO_DRV_SEND_TERM, 12).
+-define(ECHO_DRV_DRIVER_SEND_TERM, 13).
+-define(ECHO_DRV_SAVE_CALLER, 14).
+
+suite() -> [{ct_hooks,[ts_install_cth]},
+ {timetrap, {seconds, 30}}].
+
+all() ->
+ [port_specs, ports, open_close,
+ command, control, connect, call,
+ output, output2, output_binary,
+ outputv, set_timer, failure_eof,
+ failure_atom, failure_posix,
+ failure, output_term,
+ driver_output_term,
+ send_term, driver_send_term].
+
+init_per_suite(Config) ->
+ Config.
+
+end_per_suite(_Config) ->
+ ok.
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+
+init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
+ erlang:trace(all, false, [all]),
+ os:unsetenv("OUTPUTV"),
+ reload_drv(Config),
+ Config.
+
+end_per_testcase(_Func, _Config) ->
+ erlang:trace(all, false, [all]),
+ ok.
+
+%% Test the first argument of trace/3
+port_specs(_Config) ->
+
+ S = self(),
+
+ Tracer = fun F() ->
+ receive
+ stop ->
+ ok;
+ M ->
+ S ! M,
+ F()
+ end
+ end,
+
+ Test = fun(TraceSpec, Info1, Info2) ->
+ {TracerPid,Ref} = spawn_monitor(Tracer),
+ Prt1 = erlang:open_port({spawn, echo_drv}, [binary]),
+ erlang:trace(TraceSpec, true, ['receive', {tracer, TracerPid}]),
+ %% We disable trace messages from the testcase process
+ erlang:trace(self(), false, ['receive']),
+ Prt2 = erlang:open_port({spawn, echo_drv}, [binary]),
+
+ InfoCheck =
+ fun(Info, Prt) ->
+ if
+ Info ->
+ {tracer, TracerPid} = erlang:trace_info(Prt, tracer),
+ {flags,['receive']} = erlang:trace_info(Prt, flags);
+ not Info ->
+ {tracer,[]} = erlang:trace_info(Prt, tracer),
+ {flags,[]} = erlang:trace_info(Prt, flags)
+ end
+ end,
+ InfoCheck(Info1, Prt1),
+ InfoCheck(Info2, Prt2),
+
+ %% These may create trace messages
+ erlang:port_command(Prt1, <<?ECHO_DRV_NOOP>>),
+ erlang:port_command(Prt2, <<?ECHO_DRV_NOOP>>),
+
+ %% Test what happens when the tracer dies
+ trace_delivered(),
+ TracerPid ! stop,
+ receive {'DOWN', Ref, process, TracerPid, normal} -> ok end,
+
+ %% These should not generate any trace messages
+ erlang:port_command(Prt1, <<?ECHO_DRV_NOOP>>),
+ erlang:port_command(Prt2, <<?ECHO_DRV_NOOP>>),
+
+ InfoCheck(false, Prt1),
+ InfoCheck(false, Prt2),
+
+ erlang:port_close(Prt1),
+ erlang:port_close(Prt2),
+ erlang:trace(all, false, [all]),
+ {Prt1, Prt2}
+ end,
+
+ {_Prt11, Prt12} = Test(new, false, true),
+ [{trace, Prt12, 'receive', {S, {command,<<?ECHO_DRV_NOOP>>}}}]
+ = flush(Prt12),
+
+ {_Prt21, Prt22} = Test(new_ports, false, true),
+ [{trace, Prt22, 'receive', {S, {command,<<?ECHO_DRV_NOOP>>}}}]
+ = flush(Prt22),
+
+ {Prt31, _Prt32} = Test(existing, true, false),
+ [{trace, Prt31, 'receive', {S, {command,<<?ECHO_DRV_NOOP>>}}}]
+ = flush(Prt31),
+
+ {Prt41, _Prt42} = Test(existing_ports, true, false),
+ [{trace, Prt41, 'receive', {S, {command,<<?ECHO_DRV_NOOP>>}}}]
+ = flush(Prt41),
+
+ {Prt51, Prt52} = Test(all, true, true),
+ [{trace, Prt51, 'receive', {S, {command,<<?ECHO_DRV_NOOP>>}}}]
+ = flush(Prt51),
+ [{trace, Prt52, 'receive', {S, {command,<<?ECHO_DRV_NOOP>>}}}]
+ = flush(Prt52),
+
+ {Prt61, Prt62} = Test(ports, true, true),
+ [{trace, Prt61, 'receive', {S, {command,<<?ECHO_DRV_NOOP>>}}}]
+ = flush(Prt61),
+ [{trace, Prt62, 'receive', {S, {command,<<?ECHO_DRV_NOOP>>}}}]
+ = flush(Prt62),
+
+ ok.
+
+%% Test that the 'ports' trace flag works
+ports(_Config) ->
+
+ {Prt, S} = trace_and_open([ports],[binary]),
+
+ [{trace, Prt, open, S, echo_drv},
+ {trace, Prt, getting_linked, S}] = flush(),
+
+ register(?MODULE, Prt),
+ unregister(?MODULE),
+ register(?MODULE, Prt),
+
+ [{trace,Prt,register,port_trace_SUITE},
+ {trace,Prt,unregister,port_trace_SUITE},
+ {trace,Prt,register,port_trace_SUITE}] = flush(),
+
+ unlink(Prt),
+ link(Prt),
+
+ [{trace,Prt,getting_unlinked,S},
+ {trace,Prt,getting_linked,S}] = flush(),
+
+ erlang:port_close(Prt),
+
+ [{trace,Prt,closed,normal},
+ {trace,Prt,unregister,port_trace_SUITE},
+ {trace,Prt,unlink,S}] = flush(),
+
+ ok.
+
+%% Test that port_close and ! close generate correct trace messages
+open_close(_Config) ->
+
+ S = trace_ports([send,'receive']),
+
+ Prt = erlang:open_port({spawn, echo_drv}, [binary]),
+ erlang:port_close(Prt),
+ [{trace, Prt, 'receive', {S, close}}] = flush(),
+
+ Prt2 = erlang:open_port({spawn, echo_drv}, [binary]),
+ Prt2 ! {S, close},
+ recv({Prt2, closed}),
+ [{trace, Prt2, 'receive', {S, close}},
+ {trace, Prt2, send, closed, S}] = flush(),
+
+ catch erlang:port_close(Prt2),
+ [] = flush(),
+
+ ok.
+
+%% Test that port_command and ! command generate correct trace messages
+command(Config) ->
+
+ Flags = [send,'receive'],
+ S = trace_ports(Flags),
+ Prt = erlang:open_port({spawn, echo_drv}, [binary]),
+
+ erlang:port_command(Prt, <<?ECHO_DRV_NOOP:8>>),
+ [{trace, Prt, 'receive', {S, {command, <<?ECHO_DRV_NOOP:8>>}}}] = flush(),
+
+ erlang:port_command(Prt, [?ECHO_DRV_NOOP, <<0:8>>]),
+ [{trace, Prt, 'receive', {S, {command, <<?ECHO_DRV_NOOP:8,0:8>>}}}] = flush(),
+
+ Prt ! {S, {command, <<?ECHO_DRV_NOOP:8>>}},
+ [{trace, Prt, 'receive', {S, {command, <<?ECHO_DRV_NOOP:8>>}}}] = flush(),
+
+ OutputMsg = <<?ECHO_DRV_NOOP:8,0:(8*512)>>,
+ Prt ! {S, {command, OutputMsg}},
+ [{trace, Prt, 'receive', {S, {command, OutputMsg}}}] = flush(),
+
+ close(Prt, Flags),
+
+ os:putenv("OUTPUTV","true"),
+ reload_drv(Config),
+
+ Prt2 = erlang:open_port({spawn, echo_drv}, [binary]),
+ OutputvMsg = [<<0:8>>,<<0:(8*512)>>,<<0:(8*256)>>,<<0:8>>],
+
+ erlang:port_command(Prt2, OutputvMsg),
+ [{trace, Prt2, 'receive', {S, {command, OutputvMsg}}}] = flush(),
+
+ Prt2 ! {S, {command, OutputvMsg}},
+ [{trace, Prt2, 'receive', {S, {command, OutputvMsg}}}] = flush(),
+
+ close(Prt2, Flags),
+
+ os:unsetenv("OUTPUTV"),
+
+ ok.
+
+%% Test that port_control generate correct trace messages
+control(_Config) ->
+
+ Flags = [send,'receive'],
+ {Prt, S} = trace_and_open(Flags,[binary]),
+
+ [0] = erlang:port_control(Prt, 1, <<?ECHO_DRV_NOOP:8, 0:8>>),
+ [{trace, Prt, 'receive', {S, {control, {1, <<?ECHO_DRV_NOOP:8, 0:8>>}}}},
+ {trace, Prt, send, {Prt, {control, <<0:8>>}}, S}] = flush(),
+
+ [0] = erlang:port_control(Prt, (1 bsl 32) - 1, <<?ECHO_DRV_NOOP:8, 0:8>>),
+ [{trace, Prt, 'receive', {S, {control, {(1 bsl 32) - 1, <<?ECHO_DRV_NOOP:8, 0:8>>}}}},
+ {trace, Prt, send, {Prt, {control, <<0:8>>}}, S}] = flush(),
+
+ Msg = <<?ECHO_DRV_NOOP:8, 0:(8*512)>>,
+ Pat = lists:duplicate(512, 0),
+ Pat = erlang:port_control(Prt, 1, Msg),
+ [{trace, Prt, 'receive', {S, {control, {1, Msg}}}},
+ {trace, Prt, send, {Prt, {control, <<0:(8*512)>>}}, S}] = flush(),
+
+ close(Prt, Flags),
+
+ ok.
+
+%% Test that port_connect and ! connect generate correct trace messages
+%% This includes that the proper getting_linked messages are sent
+connect(_Config) ->
+
+
+ {Prt, S} = trace_and_open([send, 'receive', ports],[binary]),
+
+ flush(),
+
+ {Pid,Ref} = spawn_monitor(
+ fun() ->
+ receive
+ go ->
+ Prt ! {self(), {connect, S}},
+ receive {Prt, connected} -> unlink(Prt) end
+ end
+ end),
+ erlang:trace(Pid, true, [send, 'receive', procs]),
+
+ erlang:port_connect(Prt, Pid),
+ unlink(Prt),
+
+ [{trace,Prt,getting_linked,Pid},
+ {trace,Prt,'receive',{S,{connect,Pid}}},
+ {trace,Prt,send,{Prt,connected},S},
+ {trace,Prt,getting_unlinked, S}] = flush(Prt),
+
+ [{trace,Pid,getting_linked,Prt}] = flush(),
+
+ Pid ! go,
+ recv({'DOWN',Ref,process,Pid,normal}),
+
+ [{trace,Prt,'receive',{Pid,{connect,S}}},
+ {trace,Prt,send,{Prt,connected},Pid},
+ {trace,Prt,getting_unlinked,Pid}] = flush(Prt),
+
+ [{trace,Pid,'receive',go},
+ {trace,Pid,send,{Pid,{connect,S}}, Prt},
+ {trace,Pid,'receive',{Prt,connected}},
+ {trace,Pid,unlink,Prt},
+ {trace,Pid,exit,normal}] = flush(),
+
+ erlang:port_close(Prt),
+ [{trace, Prt, 'receive', {S, close}},
+ {trace, Prt, closed, normal}] = flush(),
+ ok.
+
+%% Test that port_call generate correct trace messages
+call(_Config) ->
+
+ Flags = [send,'receive'],
+ {Prt, S} = trace_and_open(Flags,[binary]),
+
+ Test = fun(Msg) ->
+ BinMsg = term_to_binary(Msg),
+
+ Msg = erlang:port_call(Prt, 0, Msg),
+ [{trace, Prt, 'receive', {S, {call, {0, BinMsg}}}},
+ {trace, Prt, send, {Prt, {call, BinMsg}}, S}] = flush()
+ end,
+
+ Test({hello, world, make_ref()}),
+ Test({hello, world, lists:seq(1,1000)}),
+
+ close(Prt, Flags),
+
+ ok.
+
+%% Test that driver_output generate correct trace messages
+output(_Config) ->
+
+ Flags = [send],
+ {Prt, S} = trace_and_open(Flags,[binary]),
+
+ erlang:port_command(Prt, <<?ECHO_DRV_OUTPUT, 123456:32>>),
+ recv({Prt,{data,<<123456:32>>}}),
+
+ [{trace, Prt, send, {Prt, {data, <<123456:32>>}}, S}] = flush(),
+
+ close(Prt, Flags),
+
+ ok.
+
+%% Test that driver_output2 generate correct trace messages
+output2(_Config) ->
+
+ Flags = [send],
+ {Prt, S} = trace_and_open(Flags,[binary]),
+
+ erlang:port_command(Prt, <<?ECHO_DRV_OUTPUT2, 123456:32>>),
+ recv({Prt,{data,[$a|<<123456:32>>]}}),
+ [{trace, Prt, send, {Prt, {data, [$a|<<123456:32>>]}}, S}] = flush(),
+
+ close(Prt, Flags),
+
+ ok.
+
+%% Test that driver_output_binary generate correct trace messages
+output_binary(_Config) ->
+
+ Flags = [send],
+ {Prt, S} = trace_and_open(Flags,[binary]),
+
+ erlang:port_command(Prt, <<?ECHO_DRV_OUTPUT_BINARY, 0, 123456:32>>),
+ recv({Prt,{data,[$a|<<123456:32>>]}}),
+ [{trace, Prt, send, {Prt, {data, [$a|<<123456:32>>]}}, S}] = flush(),
+
+ close(Prt, Flags),
+
+ ok.
+
+%% Test that driver_outputv generate correct trace messages
+outputv(_Config) ->
+
+ Flags = [send],
+ {Prt, S} = trace_and_open(Flags,[binary]),
+
+ erlang:port_command(Prt, <<?ECHO_DRV_OUTPUTV, 123456:32>>),
+ recv({Prt,{data,[$a|<<123456:32>>]}}),
+
+ [{trace, Prt, send, {Prt, {data, [$a|<<123456:32>>]}}, S}] = flush(),
+
+ erlang:port_close(Prt),
+ [] = flush(),
+
+ ok.
+
+%% Test that driver_set_timer generate correct trace messages
+set_timer(_Config) ->
+
+ Flags = [send,'receive'],
+ {Prt, S} = trace_and_open(Flags,[binary]),
+
+ erlang:port_command(Prt, <<?ECHO_DRV_SET_TIMER>>),
+ timer:sleep(100),
+ [{trace, Prt, 'receive', {S, {command, <<?ECHO_DRV_SET_TIMER>>}}},
+ {trace, Prt, 'receive', timeout}] = flush(),
+
+ close(Prt, Flags),
+
+ ok.
+
+%% Test that driver_failure* generate correct trace messages
+failure_eof(_Config) ->
+
+ Flags = [send,'receive', ports],
+ S = trace_ports(Flags),
+
+ Prt = erlang:open_port({spawn, echo_drv}, [eof, binary]),
+ [{trace, Prt, open, S, echo_drv},
+ {trace, Prt, getting_linked, S}] = flush(),
+
+ erlang:port_command(Prt, <<?ECHO_DRV_FAILURE_EOF>>),
+ recv({Prt,eof}),
+ [{trace, Prt, 'receive', {S, {command, <<?ECHO_DRV_FAILURE_EOF>>}}},
+ {trace, Prt, send, {Prt, eof}, S}] = flush(),
+
+ close(Prt, Flags),
+
+ %% Run same test without eof option
+ failure_test(<<?ECHO_DRV_FAILURE_EOF>>, normal).
+
+failure_atom(_Config) ->
+ failure_test(<<?ECHO_DRV_FAILURE_ATOM, "failure\0">>, failure).
+failure_posix(_Config) ->
+ failure_test(<<?ECHO_DRV_FAILURE_POSIX>>, eagain).
+failure(_Config) ->
+ failure_test(<<?ECHO_DRV_FAILURE, 1>>, 1).
+
+failure_test(Failure, Reason) ->
+
+ {Prt, S} = trace_and_open([send, 'receive', ports],[binary]),
+
+ [{trace, Prt, open, S, echo_drv},
+ {trace, Prt, getting_linked, S}] = flush(),
+
+ process_flag(trap_exit, true),
+ erlang:port_command(Prt, Failure),
+ try
+ recv({'EXIT',Prt,Reason})
+ after
+ process_flag(trap_exit, false)
+ end,
+ [{trace, Prt, 'receive', {S, {command, Failure}}},
+ {trace, Prt, closed, Reason},
+ {trace, Prt, unlink, S}] = flush(),
+
+ ok.
+
+%% Test that erl_drv_output_term generate correct trace messages
+output_term(_Config) ->
+
+ Flags = [send],
+ {Prt, S} = trace_and_open(Flags,[binary]),
+
+ erlang:port_command(Prt, <<?ECHO_DRV_OUTPUT_TERM, 123456:32>>),
+ recv({echo, Prt, <<123456:32>>}),
+ [{trace, Prt, send, {echo, Prt, <<123456:32>>}, S}] = flush(),
+
+ close(Prt, Flags),
+
+ ok.
+
+%% Test that driver_output_term generate correct trace messages
+driver_output_term(_Config) ->
+
+ Flags = [send],
+ {Prt, S} = trace_and_open(Flags,[binary]),
+
+ erlang:port_command(Prt, <<?ECHO_DRV_DRIVER_OUTPUT_TERM, 123456:32>>),
+ recv({echo, Prt, <<123456:32>>}),
+ [{trace, Prt, send, {echo, Prt, <<123456:32>>}, S}] = flush(),
+
+ close(Prt, Flags),
+
+ ok.
+
+%% Test that erl_drv_send_term generate correct trace messages
+send_term(_Config) ->
+
+ Flags = [send],
+ {Prt, S} = trace_and_open(Flags,[binary]),
+
+ erlang:port_command(Prt, <<?ECHO_DRV_SEND_TERM, 123456:32>>),
+ recv({echo, Prt, <<123456:32>>}),
+ [{trace, Prt, send, {echo, Prt, <<123456:32>>}, S}] = flush(),
+
+ {Pid, Ref} = spawn_monitor(fun() -> erlang:port_command(Prt, <<?ECHO_DRV_SAVE_CALLER>>) end),
+ recv({'DOWN',Ref,process,Pid,normal}),
+ erlang:port_command(Prt, <<?ECHO_DRV_SEND_TERM, 123456:32>>),
+ [{trace, Prt, send_to_non_existing_process, {echo, Prt, <<123456:32>>}, Pid}] = flush(),
+
+ close(Prt, Flags),
+
+ ok.
+
+%% Test that driver_send_term generate correct trace messages
+driver_send_term(_Config) ->
+
+ Flags = [send],
+ {Prt, S} = trace_and_open(Flags,[binary]),
+
+ erlang:port_command(Prt, <<?ECHO_DRV_DRIVER_SEND_TERM, 123456:32>>),
+ recv({echo, Prt, <<123456:32>>}),
+ [{trace, Prt, send, {echo, Prt, <<123456:32>>}, S}] = flush(),
+
+ {Pid, Ref} = spawn_monitor(fun() -> erlang:port_command(Prt, <<?ECHO_DRV_SAVE_CALLER>>) end),
+ recv({'DOWN',Ref,process,Pid,normal}),
+ erlang:port_command(Prt, <<?ECHO_DRV_SEND_TERM, 123456:32>>),
+ [{trace, Prt, send_to_non_existing_process, {echo, Prt, <<123456:32>>}, Pid}] = flush(),
+
+ close(Prt, Flags),
+
+ ok.
+
+%%%%%%%%%%%%%%%%%%%
+%% Helper functions
+%%%%%%%%%%%%%%%%%%%
+
+trace_ports(TraceFlags) ->
+ erlang:trace(new_ports, true, TraceFlags),
+ self().
+
+trace_and_open(TraceFlags, OpenFlags) ->
+ S = self(),
+ Ports = proplists:get_value(ports, TraceFlags),
+ [trace_ports(TraceFlags) || Ports],
+ Prt = erlang:open_port({spawn, echo_drv}, OpenFlags),
+ [erlang:trace(Prt, true, TraceFlags) || Ports == undefined],
+ {Prt, S}.
+
+close(Prt, Flags) ->
+ Recv = proplists:get_value('receive', Flags),
+ Ports = proplists:get_value(ports, Flags),
+ S = self(),
+
+ erlang:port_close(Prt),
+
+ if Recv, Ports ->
+ [{trace, Prt, 'receive', {S, close}},
+ {trace, Prt, closed, normal},
+ {trace, Prt, unlink, S}] = flush();
+ Recv ->
+ [{trace, Prt, 'receive', {S, close}}] = flush();
+ Ports ->
+ [{trace, Prt, closed, normal},
+ {trace, Prt, unlink, S}] = flush();
+ true ->
+ [] = flush()
+ end.
+
+trace_delivered() ->
+ Ref = erlang:trace_delivered(all),
+ receive {trace_delivered, all, Ref} -> ok end.
+
+flush() ->
+ flush(all).
+flush(From) ->
+ trace_delivered(),
+ f(From).
+
+f(From) ->
+ receive
+ M when From =:= all; element(2, M) == From ->
+ [M | f(From)]
+ after 0 ->
+ []
+ end.
+
+recv(Msg) ->
+ receive Msg -> ok after 100 -> ct:fail({did_not_get_data,Msg,flush()}) end.
+
+load_drv(Config) ->
+ Path = proplists:get_value(data_dir, Config),
+ case erl_ddll:load_driver(Path, echo_drv) of
+ ok -> ok;
+ {error, Error} = Res ->
+ io:format("~s\n", [erl_ddll:format_error(Error)]),
+ ct:fail(Res)
+ end.
+
+reload_drv(Config) ->
+ erl_ddll:unload_driver(echo_drv),
+ load_drv(Config).
diff --git a/erts/emulator/test/port_trace_SUITE_data/Makefile.src b/erts/emulator/test/port_trace_SUITE_data/Makefile.src
new file mode 100644
index 0000000000..c1bf142ccf
--- /dev/null
+++ b/erts/emulator/test/port_trace_SUITE_data/Makefile.src
@@ -0,0 +1,3 @@
+all: echo_drv@dll@
+
+@SHLIB_RULES@
diff --git a/erts/emulator/test/port_trace_SUITE_data/echo_drv.c b/erts/emulator/test/port_trace_SUITE_data/echo_drv.c
new file mode 100644
index 0000000000..b5ae9389b4
--- /dev/null
+++ b/erts/emulator/test/port_trace_SUITE_data/echo_drv.c
@@ -0,0 +1,241 @@
+#include <stdio.h>
+#include "erl_driver.h"
+#include <errno.h>
+#include <string.h>
+
+
+/* -------------------------------------------------------------------------
+** Data types
+**/
+
+
+typedef struct _erl_drv_data {
+ ErlDrvPort erlang_port;
+ ErlDrvTermData caller;
+} EchoDrvData;
+
+#define ECHO_DRV_NOOP 0
+#define ECHO_DRV_OUTPUT 1
+#define ECHO_DRV_OUTPUT2 2
+#define ECHO_DRV_OUTPUT_BINARY 3
+#define ECHO_DRV_OUTPUTV 4
+#define ECHO_DRV_SET_TIMER 5
+#define ECHO_DRV_FAILURE_EOF 6
+#define ECHO_DRV_FAILURE_ATOM 7
+#define ECHO_DRV_FAILURE_POSIX 8
+#define ECHO_DRV_FAILURE 9
+#define ECHO_DRV_OUTPUT_TERM 10
+#define ECHO_DRV_DRIVER_OUTPUT_TERM 11
+#define ECHO_DRV_SEND_TERM 12
+#define ECHO_DRV_DRIVER_SEND_TERM 13
+#define ECHO_DRV_SAVE_CALLER 14
+
+
+/* -------------------------------------------------------------------------
+** Entry struct
+**/
+
+static EchoDrvData *echo_drv_start(ErlDrvPort port, char *command);
+static void echo_drv_stop(ErlDrvData drv_data);
+static void echo_drv_output(ErlDrvData drv_data, char *buf,
+ ErlDrvSizeT len);
+static void echo_drv_outputv(ErlDrvData drv_data, ErlIOVec *iov);
+static void echo_drv_finish(void);
+static ErlDrvSSizeT echo_drv_control(ErlDrvData drv_data,
+ unsigned int command,
+ char *buf, ErlDrvSizeT len,
+ char **rbuf, ErlDrvSizeT rlen);
+static void echo_drv_timeout(ErlDrvData drv_data);
+static ErlDrvSSizeT echo_drv_call(ErlDrvData drv_data,
+ unsigned int command,
+ char *buf, ErlDrvSizeT len,
+ char **rbuf, ErlDrvSizeT rlen,
+ unsigned int *flags);
+
+static ErlDrvEntry echo_drv_entry = {
+ NULL, /* init */
+ echo_drv_start,
+ echo_drv_stop,
+ echo_drv_output,
+ NULL, /* ready_input */
+ NULL, /* ready_output */
+ "echo_drv",
+ echo_drv_finish,
+ NULL, /* handle */
+ echo_drv_control,
+ echo_drv_timeout, /* timeout */
+ NULL, /* outputv */
+ NULL, /* ready_async */
+ NULL, /* flush */
+ echo_drv_call, /* call */
+ NULL, /* event */
+ ERL_DRV_EXTENDED_MARKER,
+ ERL_DRV_EXTENDED_MAJOR_VERSION,
+ ERL_DRV_EXTENDED_MINOR_VERSION,
+ 0,
+ NULL,
+ NULL,
+ NULL
+};
+
+/* -------------------------------------------------------------------------
+** Entry functions
+**/
+
+DRIVER_INIT(echo_drv)
+{
+ char buff[5];
+ size_t size = sizeof(buff);
+
+ if (erl_drv_getenv("OUTPUTV", buff, &size) == -1) {
+ echo_drv_entry.outputv = NULL;
+ } else {
+ echo_drv_entry.outputv = echo_drv_outputv;
+ }
+
+ return &echo_drv_entry;
+}
+
+static EchoDrvData *echo_drv_start(ErlDrvPort port, char *command)
+{
+ EchoDrvData *echo_drv_data_p = driver_alloc(sizeof(EchoDrvData));
+ echo_drv_data_p->erlang_port = port;
+ echo_drv_data_p->caller = driver_caller(port);
+ return echo_drv_data_p;
+}
+
+static void echo_drv_stop(EchoDrvData *data_p) {
+ driver_free(data_p);
+}
+
+static void echo_drv_outputv(ErlDrvData drv_data, ErlIOVec *iov)
+{
+ return;
+}
+
+static void echo_drv_output(ErlDrvData drv_data, char *buf, ErlDrvSizeT len) {
+ EchoDrvData* data_p = (EchoDrvData *) drv_data;
+ ErlDrvPort port = data_p->erlang_port;
+
+ switch (buf[0]) {
+ case ECHO_DRV_OUTPUT:
+ {
+ driver_output(port, buf+1, len-1);
+ break;
+ }
+ case ECHO_DRV_OUTPUT2:
+ {
+ driver_output2(port, "a", 1, buf+1, len-1);
+ break;
+ }
+ case ECHO_DRV_OUTPUT_BINARY:
+ {
+ ErlDrvBinary *bin = driver_alloc_binary(len-1);
+ memcpy(&bin->orig_bytes, buf+1, len-1);
+ driver_output_binary(port, "a", 1, bin, 1, len - 2);
+ driver_free_binary(bin);
+ break;
+ }
+ case ECHO_DRV_OUTPUTV:
+ {
+ ErlIOVec iov;
+ ErlDrvSizeT sz;
+ driver_enq(port, buf + 1, len - 1);
+ sz = driver_peekqv(port, &iov);
+ driver_outputv(port, "a", 1, &iov, 0);
+ driver_deq(port, sz);
+ break;
+ }
+ case ECHO_DRV_SET_TIMER:
+ {
+ driver_set_timer(port, 10);
+ break;
+ }
+ case ECHO_DRV_FAILURE_EOF:
+ {
+ driver_failure_eof(port);
+ break;
+ }
+ case ECHO_DRV_FAILURE_ATOM:
+ {
+ driver_failure_atom(port, buf+1);
+ break;
+ }
+ case ECHO_DRV_FAILURE_POSIX:
+ {
+ driver_failure_posix(port, EAGAIN);
+ break;
+ }
+ case ECHO_DRV_FAILURE:
+ {
+ driver_failure(port, buf[1]);
+ break;
+ }
+ case ECHO_DRV_OUTPUT_TERM:
+ case ECHO_DRV_DRIVER_OUTPUT_TERM:
+ case ECHO_DRV_SEND_TERM:
+ case ECHO_DRV_DRIVER_SEND_TERM:
+ {
+ ErlDrvTermData term[] = {
+ ERL_DRV_ATOM, driver_mk_atom("echo"),
+ ERL_DRV_PORT, driver_mk_port(port),
+ ERL_DRV_BUF2BINARY, (ErlDrvTermData)(buf+1),
+ (ErlDrvTermData)(len - 1),
+ ERL_DRV_TUPLE, 3};
+ switch (buf[0]) {
+ case ECHO_DRV_OUTPUT_TERM:
+ erl_drv_output_term(driver_mk_port(port), term, sizeof(term) / sizeof(ErlDrvTermData));
+ break;
+ case ECHO_DRV_DRIVER_OUTPUT_TERM:
+ driver_output_term(port, term, sizeof(term) / sizeof(ErlDrvTermData));
+ break;
+ case ECHO_DRV_SEND_TERM:
+ driver_send_term(port, data_p->caller,
+ term, sizeof(term) / sizeof(ErlDrvTermData));
+ break;
+ case ECHO_DRV_DRIVER_SEND_TERM:
+ erl_drv_send_term(driver_mk_port(port), data_p->caller,
+ term, sizeof(term) / sizeof(ErlDrvTermData));
+ break;
+ }
+ break;
+ }
+ case ECHO_DRV_SAVE_CALLER:
+ data_p->caller = driver_caller(port);
+ break;
+ default:
+ break;
+ }
+}
+
+static void echo_drv_finish() {
+
+}
+
+static ErlDrvSSizeT echo_drv_control(ErlDrvData drv_data,
+ unsigned int command,
+ char *buf, ErlDrvSizeT len,
+ char **rbuf, ErlDrvSizeT rlen)
+{
+ if ((len - 1) > rlen)
+ *rbuf = driver_alloc(len - 1);
+ memcpy(*rbuf, buf+1, len-1);
+ return len-1;
+}
+
+static void echo_drv_timeout(ErlDrvData drv_data)
+{
+
+}
+
+static ErlDrvSSizeT echo_drv_call(ErlDrvData drv_data,
+ unsigned int command,
+ char *buf, ErlDrvSizeT len,
+ char **rbuf, ErlDrvSizeT rlen,
+ unsigned int *flags)
+{
+ if ((len - command) > rlen)
+ *rbuf = driver_alloc(len - command);
+ memcpy(*rbuf, buf+command, len-command);
+ return len-command;
+}
diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl
index 5bb216ff79..61a68f9759 100644
--- a/erts/emulator/test/process_SUITE.erl
+++ b/erts/emulator/test/process_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1003,7 +1003,7 @@ low_prio_test(Config) when is_list(Config) ->
process_flag(trap_exit, true),
S = spawn_link(?MODULE, prio_server, [0, 0]),
PCs = spawn_prio_clients(S, erlang:system_info(schedulers_online)),
- timer:sleep(2000),
+ ct:sleep({seconds,3}),
lists:foreach(fun (P) -> exit(P, kill) end, PCs),
S ! exit,
receive {'EXIT', S, {A, B}} -> check_prio(A, B) end,
diff --git a/erts/emulator/test/pseudoknot_SUITE.erl b/erts/emulator/test/pseudoknot_SUITE.erl
index 58ef3cd563..ed4d40ac65 100644
--- a/erts/emulator/test/pseudoknot_SUITE.erl
+++ b/erts/emulator/test/pseudoknot_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/random_iolist.erl b/erts/emulator/test/random_iolist.erl
index 6da7da04de..555f063e0a 100644
--- a/erts/emulator/test/random_iolist.erl
+++ b/erts/emulator/test/random_iolist.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/receive_SUITE.erl b/erts/emulator/test/receive_SUITE.erl
index 6097e54219..83653a7a36 100644
--- a/erts/emulator/test/receive_SUITE.erl
+++ b/erts/emulator/test/receive_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/ref_SUITE.erl b/erts/emulator/test/ref_SUITE.erl
index 287a2ffb73..5f519d522e 100644
--- a/erts/emulator/test/ref_SUITE.erl
+++ b/erts/emulator/test/ref_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/register_SUITE.erl b/erts/emulator/test/register_SUITE.erl
index ad8a9c29f3..43ae749498 100644
--- a/erts/emulator/test/register_SUITE.erl
+++ b/erts/emulator/test/register_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/save_calls_SUITE.erl b/erts/emulator/test/save_calls_SUITE.erl
index bbdc2e6688..aae7651f6d 100644
--- a/erts/emulator/test/save_calls_SUITE.erl
+++ b/erts/emulator/test/save_calls_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -60,7 +60,7 @@ dont_break_reductions(Config) when is_list(Config) ->
RPS1 = reds_per_sched(0),
RPS2 = reds_per_sched(20),
Diff = abs(RPS1 - RPS2),
- true = (Diff < (0.05 * RPS1)),
+ true = (Diff < (0.2 * RPS1)),
ok.
@@ -114,7 +114,7 @@ save_calls_1(Config) when is_list(Config) ->
save_calls_1() ->
erlang:process_flag(self(), save_calls, 0),
{last_calls, false} = process_info(self(), last_calls),
-
+
erlang:process_flag(self(), save_calls, 10),
{last_calls, _L1} = process_info(self(), last_calls),
?MODULE:do_bipp(),
@@ -132,11 +132,22 @@ save_calls_1() ->
X ->
ct:fail({l21, X})
end,
-
+
erlang:process_flag(self(), save_calls, 10),
{last_calls, L3} = process_info(self(), last_calls),
+ true = (L3 /= false),
L31 = lists:filter(fun is_local_function/1, L3),
[] = L31,
+ erlang:process_flag(self(), save_calls, 0),
+
+ %% Also check that it works on another process ...
+ Pid = spawn(fun () -> receive after infinity -> ok end end),
+ erlang:process_flag(Pid, save_calls, 10),
+ {last_calls, L4} = process_info(Pid, last_calls),
+ true = (L4 /= false),
+ L41 = lists:filter(fun is_local_function/1, L4),
+ [] = L41,
+ exit(Pid,kill),
ok.
do_bipp() ->
diff --git a/erts/emulator/test/scheduler_SUITE.erl b/erts/emulator/test/scheduler_SUITE.erl
index 64c280b198..6b49b68ec8 100644
--- a/erts/emulator/test/scheduler_SUITE.erl
+++ b/erts/emulator/test/scheduler_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -876,7 +876,7 @@ get_affinity_mask(_Port, _Status, Affinity) ->
Affinity.
get_affinity_mask() ->
- case test_server:os_type() of
+ case os:type() of
{unix, linux} ->
case catch open_port({spawn, "taskset -p " ++ os:getpid()},
[exit_status]) of
@@ -1733,7 +1733,7 @@ sched_state([], N, DC, DI) ->
{N, DC, DI}
catch
_ : _ ->
- ?t:fail({inconsisten_scheduler_state, {N, DC, DI}})
+ ct:fail({inconsisten_scheduler_state, {N, DC, DI}})
end;
sched_state([{normal, _, _, _} = S | Rest], _S, DC, DI) ->
sched_state(Rest, S, DC, DI);
diff --git a/erts/emulator/test/scheduler_SUITE_data/scheduler_SUITE.c b/erts/emulator/test/scheduler_SUITE_data/scheduler_SUITE.c
index 022858c114..ab4863337f 100644
--- a/erts/emulator/test/scheduler_SUITE_data/scheduler_SUITE.c
+++ b/erts/emulator/test/scheduler_SUITE_data/scheduler_SUITE.c
@@ -1,4 +1,6 @@
+#ifndef __WIN32__
#include <unistd.h>
+#endif
#include "erl_nif.h"
static int
@@ -15,8 +17,12 @@ static ERL_NIF_TERM
dirty_sleeper(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
#ifdef ERL_NIF_DIRTY_SCHEDULER_SUPPORT
+#ifdef __WIN32__
+ Sleep(3000);
+#else
sleep(3);
#endif
+#endif
return enif_make_atom(env, "ok");
}
diff --git a/erts/emulator/test/send_term_SUITE.erl b/erts/emulator/test/send_term_SUITE.erl
index 75161389b1..8afe4e4ac1 100644
--- a/erts/emulator/test/send_term_SUITE.erl
+++ b/erts/emulator/test/send_term_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/sensitive_SUITE.erl b/erts/emulator/test/sensitive_SUITE.erl
index e2236774a7..c3e303bbd1 100644
--- a/erts/emulator/test/sensitive_SUITE.erl
+++ b/erts/emulator/test/sensitive_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -311,7 +311,7 @@ gc_trace(Config) when is_list(Config) ->
wait_trace(Self),
{messages,Messages} = process_info(Tracer, messages),
- [{trace,Self,gc_start,_},{trace,Self,gc_end,_}] = Messages,
+ [{trace,Self,gc_major_start,_},{trace,Self,gc_major_end,_}] = Messages,
unlink(Tracer), exit(Tracer, kill),
ok.
diff --git a/erts/emulator/test/signal_SUITE.erl b/erts/emulator/test/signal_SUITE.erl
index 63397fbbb4..0b11fa13f5 100644
--- a/erts/emulator/test/signal_SUITE.erl
+++ b/erts/emulator/test/signal_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/smoke_test_SUITE.erl b/erts/emulator/test/smoke_test_SUITE.erl
index 900dd124c0..042c7225d5 100644
--- a/erts/emulator/test/smoke_test_SUITE.erl
+++ b/erts/emulator/test/smoke_test_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/statistics_SUITE.erl b/erts/emulator/test/statistics_SUITE.erl
index 7d5b07f21f..71ef003b25 100644
--- a/erts/emulator/test/statistics_SUITE.erl
+++ b/erts/emulator/test/statistics_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/system_info_SUITE.erl b/erts/emulator/test/system_info_SUITE.erl
index ffea5bc15b..f31d474c20 100644
--- a/erts/emulator/test/system_info_SUITE.erl
+++ b/erts/emulator/test/system_info_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/system_profile_SUITE.erl b/erts/emulator/test/system_profile_SUITE.erl
index 6d80d436ba..2e359b11ce 100644
--- a/erts/emulator/test/system_profile_SUITE.erl
+++ b/erts/emulator/test/system_profile_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@
system_profile_on_and_off/1,
runnable_procs/1, runnable_ports/1,
dont_profile_profiler/1,
- scheduler/1]).
+ scheduler/1, sane_location/1]).
-export([profiler_process/1, ring_loop/1, port_echo_start/0,
list_load/0, run_load/2]).
@@ -40,7 +40,8 @@ suite() ->
all() ->
[system_profile_on_and_off, runnable_procs,
- runnable_ports, scheduler, dont_profile_profiler].
+ runnable_ports, scheduler, dont_profile_profiler,
+ sane_location].
%% No specification clause needed for an init function in a conf case!!!
@@ -183,6 +184,33 @@ dont_profile_profiler(Config) when is_list(Config) ->
exit(Pid,kill),
ok.
+%% Check sane location (of exits)
+sane_location(Config) when is_list(Config) ->
+ Check = spawn_link(fun() -> flush_sane_location() end),
+ erlang:system_profile(Check, [runnable_procs]),
+ Me = self(),
+ Pids = [spawn_link(fun() -> wat(Me) end) || _ <- lists:seq(1,100)],
+ [receive {Pid,ok} -> ok end || Pid <- Pids],
+ Check ! {Me, done},
+ receive {Check,ok} -> ok end,
+ ok.
+
+wat(Pid) ->
+ Pid ! {self(), ok}.
+
+flush_sane_location() ->
+ receive
+ {profile,_,_,{M,F,A},_} when is_atom(M), is_atom(F),
+ is_integer(A) ->
+ flush_sane_location();
+ {profile,_,_,0,_} ->
+ flush_sane_location();
+ {Pid,done} when is_pid(Pid) ->
+ Pid ! {self(), ok};
+ M ->
+ ct:fail({badness,M})
+ end.
+
%%% Check scheduler profiling
diff --git a/erts/emulator/test/time_SUITE.erl b/erts/emulator/test/time_SUITE.erl
index e6da5e89fa..76d440529f 100644
--- a/erts/emulator/test/time_SUITE.erl
+++ b/erts/emulator/test/time_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/timer_bif_SUITE.erl b/erts/emulator/test/timer_bif_SUITE.erl
index fa72700604..a5f11bd959 100644
--- a/erts/emulator/test/timer_bif_SUITE.erl
+++ b/erts/emulator/test/timer_bif_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/trace_SUITE.erl b/erts/emulator/test/trace_SUITE.erl
index dcd5e95434..29e043dd5c 100644
--- a/erts/emulator/test/trace_SUITE.erl
+++ b/erts/emulator/test/trace_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,14 +24,15 @@
%%% Tests the trace BIF.
%%%
--export([all/0, suite/0,
- receive_trace/1, self_send/1,
+-export([all/0, suite/0, link_receive_call_correlation/0,
+ receive_trace/1, link_receive_call_correlation/1, self_send/1,
timeout_trace/1, send_trace/1,
- procs_trace/1, dist_procs_trace/1,
+ procs_trace/1, dist_procs_trace/1, procs_new_trace/1,
suspend/1, mutual_suspend/1, suspend_exit/1, suspender_exit/1,
suspend_system_limit/1, suspend_opts/1, suspend_waiting/1,
new_clear/1, existing_clear/1,
set_on_spawn/1, set_on_first_spawn/1, cpu_timestamp/1,
+ set_on_link/1, set_on_first_link/1,
system_monitor_args/1, more_system_monitor_args/1,
system_monitor_long_gc_1/1, system_monitor_long_gc_2/1,
system_monitor_large_heap_1/1, system_monitor_large_heap_2/1,
@@ -48,12 +49,14 @@ suite() ->
{timetrap, {seconds, 5}}].
all() ->
- [cpu_timestamp, receive_trace, self_send, timeout_trace,
+ [cpu_timestamp, receive_trace, link_receive_call_correlation,
+ self_send, timeout_trace,
send_trace, procs_trace, dist_procs_trace, suspend,
mutual_suspend, suspend_exit, suspender_exit,
suspend_system_limit, suspend_opts, suspend_waiting,
new_clear, existing_clear, set_on_spawn,
- set_on_first_spawn, system_monitor_args,
+ set_on_first_spawn, set_on_link, set_on_first_link,
+ system_monitor_args,
more_system_monitor_args, system_monitor_long_gc_1,
system_monitor_long_gc_2, system_monitor_large_heap_1,
system_monitor_long_schedule,
@@ -87,10 +90,10 @@ receive_trace(Config) when is_list(Config) ->
1 = erlang:trace(Receiver, true, ['receive']),
Hello = {hello, world},
Receiver ! Hello,
- {trace, Receiver, 'receive', Hello} = receive_first(),
+ {trace, Receiver, 'receive', Hello} = receive_first_trace(),
Hello2 = {hello, again, world},
Receiver ! Hello2,
- {trace, Receiver, 'receive', Hello2} = receive_first(),
+ {trace, Receiver, 'receive', Hello2} = receive_first_trace(),
receive_nothing(),
%% Another process should not be able to trace Receiver.
@@ -104,6 +107,112 @@ receive_trace(Config) when is_list(Config) ->
receive_nothing(),
ok.
+%% Tests that receive of a message always happens before a call with
+%% that message and that links/unlinks are ordered together with the
+%% 'receive'.
+link_receive_call_correlation() ->
+ [{timetrap, {minutes, 5}}].
+link_receive_call_correlation(Config) when is_list(Config) ->
+ Receiver = fun_spawn(fun F() ->
+ receive
+ stop -> ok;
+ M -> receive_msg(M), F()
+ end
+ end),
+ process_flag(trap_exit, true),
+
+ %% Trace the process; make sure that we receive the trace messages.
+ 1 = erlang:trace(Receiver, true, ['receive', procs, call, timestamp, scheduler_id]),
+ 1 = erlang:trace_pattern({?MODULE, receive_msg, '_'}, [], [local]),
+
+ Num = 100000,
+
+ (fun F(0) -> [];
+ F(N) ->
+ if N rem 2 == 0 ->
+ link(Receiver);
+ true ->
+ unlink(Receiver)
+ end,
+ [Receiver ! N | F(N-1)]
+ end)(Num),
+
+ Receiver ! stop,
+ MonRef = erlang:monitor(process, Receiver),
+ receive {'DOWN', MonRef, _, _, _} -> ok end,
+ Ref = erlang:trace_delivered(Receiver),
+ receive {trace_delivered, _, Ref} -> ok end,
+
+ Msgs = (fun F() -> receive M -> [M | F()] after 1 -> [] end end)(),
+
+ case check_consistent(Receiver, Num, Num, Num, Msgs) of
+ ok ->
+ ok;
+ {error, Reason} ->
+ ct:log("~p", [Msgs]),
+ ct:fail({error, Reason})
+ end.
+
+-define(schedid, , _).
+
+check_consistent(_Pid, Recv, Call, _LU, [Msg | _]) when Recv > Call ->
+ {error, Msg};
+check_consistent(Pid, Recv, Call, LU, [Msg | Msgs]) ->
+
+ case Msg of
+ {trace, Pid, 'receive', Recv ?schedid} ->
+ check_consistent(Pid,Recv - 1, Call, LU, Msgs);
+ {trace_ts, Pid, 'receive', Recv ?schedid, _} ->
+ check_consistent(Pid,Recv - 1, Call, LU, Msgs);
+
+ {trace, Pid, call, {?MODULE, receive_msg, [Call]} ?schedid} ->
+ check_consistent(Pid,Recv, Call - 1, LU, Msgs);
+ {trace_ts, Pid, call, {?MODULE, receive_msg, [Call]} ?schedid, _} ->
+ check_consistent(Pid,Recv, Call - 1, LU, Msgs);
+
+ %% We check that for each receive we have gotten a
+ %% getting_linked or getting_unlinked message. Also
+ %% if we receive a getting_linked, then the next
+ %% message we expect to receive is an even number
+ %% and odd number for getting_unlinked.
+ {trace, Pid, getting_linked, _Self ?schedid}
+ when Recv rem 2 == 0, Recv == LU ->
+ check_consistent(Pid, Recv, Call, LU - 1, Msgs);
+ {trace_ts, Pid, getting_linked, _Self ?schedid, _}
+ when Recv rem 2 == 0, Recv == LU ->
+ check_consistent(Pid, Recv, Call, LU - 1, Msgs);
+
+ {trace, Pid, getting_unlinked, _Self ?schedid}
+ when Recv rem 2 == 1, Recv == LU ->
+ check_consistent(Pid, Recv, Call, LU - 1, Msgs);
+ {trace_ts, Pid, getting_unlinked, _Self ?schedid, _}
+ when Recv rem 2 == 1, Recv == LU ->
+ check_consistent(Pid, Recv, Call, LU - 1, Msgs);
+
+ {trace,Pid,'receive',Ignore ?schedid}
+ when Ignore == stop; Ignore == timeout ->
+ check_consistent(Pid, Recv, Call, LU, Msgs);
+ {trace_ts,Pid,'receive',Ignore ?schedid,_}
+ when Ignore == stop; Ignore == timeout ->
+ check_consistent(Pid, Recv, Call, LU, Msgs);
+
+ {trace, Pid, exit, normal ?schedid} ->
+ check_consistent(Pid, Recv, Call, LU, Msgs);
+ {trace_ts, Pid, exit, normal ?schedid, _} ->
+ check_consistent(Pid, Recv, Call, LU, Msgs);
+ {'EXIT', Pid, normal} ->
+ check_consistent(Pid, Recv, Call, LU, Msgs);
+ Msg ->
+ {error, Msg}
+ end;
+check_consistent(_, 0, 0, 0, []) ->
+ ok;
+check_consistent(_, Recv, Call, LU, []) ->
+ {error,{Recv, Call, LU}}.
+
+receive_msg(M) ->
+ M.
+
%% Test that traces are generated for messages sent
%% and received to/from self().
self_send(Config) when is_list(Config) ->
@@ -134,8 +243,8 @@ timeout_trace(Config) when is_list(Config) ->
Process = fun_spawn(fun process/0),
1 = erlang:trace(Process, true, ['receive']),
Process ! timeout_please,
- {trace, Process, 'receive', timeout_please} = receive_first(),
- {trace, Process, 'receive', timeout} = receive_first(),
+ {trace, Process, 'receive', timeout_please} = receive_first_trace(),
+ {trace, Process, 'receive', timeout} = receive_first_trace(),
receive_nothing(),
ok.
@@ -149,13 +258,13 @@ send_trace(Config) when is_list(Config) ->
%% Check that a message sent to another process is traced.
1 = erlang:trace(Sender, true, [send]),
Sender ! {send_please, Receiver, to_receiver},
- {trace, Sender, send, to_receiver, Receiver} = receive_first(),
+ {trace, Sender, send, to_receiver, Receiver} = receive_first_trace(),
receive_nothing(),
%% Check that a message sent to another registered process is traced.
register(?MODULE,Receiver),
Sender ! {send_please, ?MODULE, to_receiver},
- {trace, Sender, send, to_receiver, ?MODULE} = receive_first(),
+ {trace, Sender, send, to_receiver, ?MODULE} = receive_first_trace(),
receive_nothing(),
unregister(?MODULE),
@@ -163,14 +272,14 @@ send_trace(Config) when is_list(Config) ->
Sender ! {send_please, self(), to_myself},
receive to_myself -> ok end,
Self = self(),
- {trace, Sender, send, to_myself, Self} = receive_first(),
+ {trace, Sender, send, to_myself, Self} = receive_first_trace(),
receive_nothing(),
%% Check that a message sent to dead process is traced.
{Pid,Ref} = spawn_monitor(fun() -> ok end),
receive {'DOWN',Ref,_,_,_} -> ok end,
Sender ! {send_please, Pid, to_dead},
- {trace, Sender, send_to_non_existing_process, to_dead, Pid} = receive_first(),
+ {trace, Sender, send_to_non_existing_process, to_dead, Pid} = receive_first_trace(),
receive_nothing(),
%% Check that a message sent to unknown registrated process is traced.
@@ -178,7 +287,7 @@ send_trace(Config) when is_list(Config) ->
1 = erlang:trace(BadargSender, true, [send]),
unlink(BadargSender),
BadargSender ! {send_please, not_registered, to_unknown},
- {trace, BadargSender, send, to_unknown, not_registered} = receive_first(),
+ {trace, BadargSender, send, to_unknown, not_registered} = receive_first_trace(),
receive_nothing(),
%% Another process should not be able to trace Sender.
@@ -205,15 +314,17 @@ procs_trace(Config) when is_list(Config) ->
Proc2 = spawn(?MODULE, process, [Self]),
io:format("Proc2 = ~p ~n", [Proc2]),
%%
- 1 = erlang:trace(Proc1, true, [procs]),
+ 1 = erlang:trace(Proc1, true, [procs, set_on_first_spawn]),
MFA = {?MODULE, process, [Self]},
%%
%% spawn, link
Proc1 ! {spawn_link_please, Self, MFA},
Proc3 = receive {spawned, Proc1, P3} -> P3 end,
- {trace, Proc1, spawn, Proc3, MFA} = receive_first(),
+ receive {trace, Proc3, spawned, Proc1, MFA} -> ok end,
+ receive {trace, Proc3, getting_linked, Proc1} -> ok end,
+ {trace, Proc1, spawn, Proc3, MFA} = receive_first_trace(),
io:format("Proc3 = ~p ~n", [Proc3]),
- {trace, Proc1, link, Proc3} = receive_first(),
+ {trace, Proc1, link, Proc3} = receive_first_trace(),
receive_nothing(),
%%
%% getting_unlinked by exit()
@@ -221,60 +332,61 @@ procs_trace(Config) when is_list(Config) ->
Reason3 = make_ref(),
Proc1 ! {send_please, Proc3, {exit_please, Reason3}},
receive {Proc1, {'EXIT', Proc3, Reason3}} -> ok end,
- {trace, Proc1, getting_unlinked, Proc3} = receive_first(),
+ receive {trace, Proc3, exit, Reason3} -> ok end,
+ {trace, Proc1, getting_unlinked, Proc3} = receive_first_trace(),
Proc1 ! {trap_exit_please, false},
receive_nothing(),
%%
%% link
Proc1 ! {link_please, Proc2},
- {trace, Proc1, link, Proc2} = receive_first(),
+ {trace, Proc1, link, Proc2} = receive_first_trace(),
receive_nothing(),
%%
%% unlink
Proc1 ! {unlink_please, Proc2},
- {trace, Proc1, unlink, Proc2} = receive_first(),
+ {trace, Proc1, unlink, Proc2} = receive_first_trace(),
receive_nothing(),
%%
%% getting_linked
Proc2 ! {link_please, Proc1},
- {trace, Proc1, getting_linked, Proc2} = receive_first(),
+ {trace, Proc1, getting_linked, Proc2} = receive_first_trace(),
receive_nothing(),
%%
%% getting_unlinked
Proc2 ! {unlink_please, Proc1},
- {trace, Proc1, getting_unlinked, Proc2} = receive_first(),
+ {trace, Proc1, getting_unlinked, Proc2} = receive_first_trace(),
receive_nothing(),
%%
%% register
true = register(Name, Proc1),
- {trace, Proc1, register, Name} = receive_first(),
+ {trace, Proc1, register, Name} = receive_first_trace(),
receive_nothing(),
%%
%% unregister
true = unregister(Name),
- {trace, Proc1, unregister, Name} = receive_first(),
+ {trace, Proc1, unregister, Name} = receive_first_trace(),
receive_nothing(),
%%
%% exit (with registered name, due to link)
Reason4 = make_ref(),
Proc1 ! {spawn_link_please, Self, MFA},
Proc4 = receive {spawned, Proc1, P4} -> P4 end,
- {trace, Proc1, spawn, Proc4, MFA} = receive_first(),
+ {trace, Proc1, spawn, Proc4, MFA} = receive_first_trace(),
io:format("Proc4 = ~p ~n", [Proc4]),
- {trace, Proc1, link, Proc4} = receive_first(),
+ {trace, Proc1, link, Proc4} = receive_first_trace(),
Proc1 ! {register_please, Name, Proc1},
- {trace, Proc1, register, Name} = receive_first(),
+ {trace, Proc1, register, Name} = receive_first_trace(),
Proc4 ! {exit_please, Reason4},
receive {'EXIT', Proc1, Reason4} -> ok end,
- {trace, Proc1, exit, Reason4} = receive_first(),
- {trace, Proc1, unregister, Name} = receive_first(),
+ {trace, Proc1, exit, Reason4} = receive_first_trace(),
+ {trace, Proc1, unregister, Name} = receive_first_trace(),
receive_nothing(),
%%
%% exit (not linked to tracing process)
1 = erlang:trace(Proc2, true, [procs]),
Reason2 = make_ref(),
Proc2 ! {exit_please, Reason2},
- {trace, Proc2, exit, Reason2} = receive_first(),
+ {trace, Proc2, exit, Reason2} = receive_first_trace(),
receive_nothing(),
ok.
@@ -299,51 +411,79 @@ dist_procs_trace(Config) when is_list(Config) ->
Proc1 ! {trap_exit_please, true},
Proc3 = receive {spawned, Proc1, P3} -> P3 end,
io:format("Proc3 = ~p ~n", [Proc3]),
- {trace, Proc1, getting_linked, Proc3} = receive_first(),
+ {trace, Proc1, getting_linked, Proc3} = receive_first_trace(),
Reason3 = make_ref(),
Proc1 ! {send_please, Proc3, {exit_please, Reason3}},
receive {Proc1, {'EXIT', Proc3, Reason3}} -> ok end,
- {trace, Proc1, getting_unlinked, Proc3} = receive_first(),
+ {trace, Proc1, getting_unlinked, Proc3} = receive_first_trace(),
Proc1 ! {trap_exit_please, false},
receive_nothing(),
%%
%% link
Proc1 ! {link_please, Proc2},
- {trace, Proc1, link, Proc2} = receive_first(),
+ {trace, Proc1, link, Proc2} = receive_first_trace(),
receive_nothing(),
%%
%% unlink
Proc1 ! {unlink_please, Proc2},
- {trace, Proc1, unlink, Proc2} = receive_first(),
+ {trace, Proc1, unlink, Proc2} = receive_first_trace(),
receive_nothing(),
%%
%% getting_linked
Proc2 ! {link_please, Proc1},
- {trace, Proc1, getting_linked, Proc2} = receive_first(),
+ {trace, Proc1, getting_linked, Proc2} = receive_first_trace(),
receive_nothing(),
%%
%% getting_unlinked
Proc2 ! {unlink_please, Proc1},
- {trace, Proc1, getting_unlinked, Proc2} = receive_first(),
+ {trace, Proc1, getting_unlinked, Proc2} = receive_first_trace(),
receive_nothing(),
%%
%% exit (with registered name, due to link)
Name = list_to_atom(OtherName),
Reason2 = make_ref(),
Proc1 ! {link_please, Proc2},
- {trace, Proc1, link, Proc2} = receive_first(),
+ {trace, Proc1, link, Proc2} = receive_first_trace(),
Proc1 ! {register_please, Name, Proc1},
- {trace, Proc1, register, Name} = receive_first(),
+ {trace, Proc1, register, Name} = receive_first_trace(),
Proc2 ! {exit_please, Reason2},
receive {'EXIT', Proc1, Reason2} -> ok end,
- {trace, Proc1, exit, Reason2} = receive_first(),
- {trace, Proc1, unregister, Name} = receive_first(),
+ {trace, Proc1, exit, Reason2} = receive_first_trace(),
+ {trace, Proc1, unregister, Name} = receive_first_trace(),
receive_nothing(),
%%
%% Done.
true = stop_node(OtherNode),
ok.
+%% Test trace(new, How, [procs]).
+procs_new_trace(Config) when is_list(Config) ->
+ Self = self(),
+ process_flag(trap_exit, true),
+ %%
+ Proc1 = spawn_link(?MODULE, process, [Self]),
+ io:format("Proc1 = ~p ~n", [Proc1]),
+ %%
+ 0 = erlang:trace(new, true, [procs]),
+
+ MFA = {?MODULE, process, [Self]},
+ %%
+ %% spawn, link
+ Proc1 ! {spawn_link_please, Self, MFA},
+ Proc3 = receive {spawned, Proc1, P3} -> P3 end,
+ receive {trace, Proc3, spawned, Proc1, MFA} -> ok end,
+ receive {trace, Proc3, getting_linked, Proc1} -> ok end,
+ io:format("Proc3 = ~p ~n", [Proc3]),
+ receive_nothing(),
+ %%
+ %%
+ %% exit (not linked to tracing process)
+ Reason1 = make_ref(),
+ Proc1 ! {exit_please, Reason1},
+ receive {'EXIT', Proc1, Reason1} -> ok end,
+ {trace, Proc3, exit, Reason1} = receive_first_trace(),
+ receive_nothing(),
+ ok.
@@ -391,6 +531,51 @@ set_on_first_spawn(Config) when is_list(Config) ->
receive_nothing(),
ok.
+%% Tests trace(Pid, How, [set_on_link]).
+
+set_on_link(Config) ->
+ Listener = fun_spawn(fun process/0),
+
+ %% Create and trace a process with the set_on_link flag.
+ %% Make sure it is traced.
+ Father_SOL = fun_spawn(fun process/0),
+ 1 = erlang:trace(Father_SOL, true, [send, set_on_link]),
+ true = is_send_traced(Father_SOL, Listener, sol_father),
+
+ %% Have the process spawn of two children and test that they
+ %% are traced.
+ [Child1, Child2] = spawn_children(Father_SOL, 2),
+ true = is_send_traced(Child1, Listener, child1),
+ true = is_send_traced(Child2, Listener, child2),
+
+ %% Second generation.
+ [Child11, Child12] = spawn_children(Child1, 2),
+ true = is_send_traced(Child11, Listener, child11),
+ true = is_send_traced(Child12, Listener, child12),
+ ok.
+
+%% Tests trace(Pid, How, [set_on_first_spawn]).
+
+set_on_first_link(Config) ->
+ ct:timetrap({seconds, 10}),
+ Listener = fun_spawn(fun process/0),
+
+ %% Create and trace a process with the set_on_first_spawn flag.
+ %% Make sure it is traced.
+ Parent = fun_spawn(fun process/0),
+ 1 = erlang:trace(Parent, true, [send, set_on_first_link]),
+ is_send_traced(Parent, Listener, sol_father),
+
+ %% Have the process spawn off three children and test that the
+ %% first is traced.
+ [Child1, Child2, Child3] = spawn_children(Parent, 3),
+ true = is_send_traced(Child1, Listener, child1),
+ false = is_send_traced(Child2, Listener, child2),
+ false = is_send_traced(Child3, Listener, child3),
+ receive_nothing(),
+ ok.
+
+
%% Tests arguments to erlang:system_monitor/0,1,2
system_monitor_args(Config) when is_list(Config) ->
@@ -1247,7 +1432,8 @@ existing_clear(Config) when is_list(Config) ->
[N, M]),
{flags, []} = erlang:trace_info(Self, flags),
{tracer, []} = erlang:trace_info(Self, tracer),
- M = N + 1, % Since trace could not be enabled on the tracer.
+ M = N, % Used to be N + 1, but from 19.0 the tracer is also traced
+
ok.
%% Test that an invalid flag cause badarg
@@ -1317,6 +1503,13 @@ receive_first() ->
Any -> Any
end.
+%% Waits for and returns the first message in the message queue.
+
+receive_first_trace() ->
+ receive
+ Any when element(1,Any) =:= trace; element(1,Any) =:= trace_ts -> Any
+ end.
+
%% Ensures that there is no message in the message queue.
receive_nothing() ->
@@ -1421,7 +1614,7 @@ fun_spawn(Fun, Args) ->
start_node(Name) ->
Pa = filename:dirname(code:which(?MODULE)),
Cookie = atom_to_list(erlang:get_cookie()),
- test_server:start_node(Name, slave,
+ test_server:start_node(Name, slave,
[{args, "-setcookie " ++ Cookie ++" -pa " ++ Pa}]).
stop_node(Node) ->
diff --git a/erts/emulator/test/trace_bif_SUITE.erl b/erts/emulator/test/trace_bif_SUITE.erl
index b774210456..8c3ffccc45 100644
--- a/erts/emulator/test/trace_bif_SUITE.erl
+++ b/erts/emulator/test/trace_bif_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -247,7 +247,8 @@ receive_trace_msg(Mess) ->
receive_trace_msg_ts({trace_ts, Pid, call, {erlang,F,A}}, PrevTs, TsType) ->
receive
- {trace_ts, Pid, call, {erlang, F, A}, Ts} ->
+ {trace_ts, Pid, call, {erlang, F, A}, Ts} = M ->
+ io:format("~p (PrevTs: ~p)~n",[M, PrevTs]),
check_ts(TsType, PrevTs, Ts),
Ts;
Other ->
@@ -260,7 +261,8 @@ receive_trace_msg_ts({trace_ts, Pid, call, {erlang,F,A}}, PrevTs, TsType) ->
receive_trace_msg_ts_return_from({trace_ts, Pid, return_from, {erlang,F,A}}, PrevTs, TsType) ->
receive
- {trace_ts, Pid, return_from, {erlang, F, A}, _Value, Ts} ->
+ {trace_ts, Pid, return_from, {erlang, F, A}, _Value, Ts} = M ->
+ io:format("~p (PrevTs: ~p)~n",[M, PrevTs]),
check_ts(TsType, PrevTs, Ts),
Ts;
Other ->
@@ -272,7 +274,8 @@ receive_trace_msg_ts_return_from({trace_ts, Pid, return_from, {erlang,F,A}}, Pre
receive_trace_msg_ts_return_to({trace_ts, Pid, return_to, {M,F,A}}, PrevTs, TsType) ->
receive
- {trace_ts, Pid, return_to, {M, F, A}, Ts} ->
+ {trace_ts, Pid, return_to, {M, F, A}, Ts} = Msg ->
+ io:format("~p (PrevTs: ~p)~n",[Msg, PrevTs]),
check_ts(TsType, PrevTs, Ts),
Ts;
Other ->
diff --git a/erts/emulator/test/trace_call_count_SUITE.erl b/erts/emulator/test/trace_call_count_SUITE.erl
index c849668e84..5f871835bc 100644
--- a/erts/emulator/test/trace_call_count_SUITE.erl
+++ b/erts/emulator/test/trace_call_count_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/trace_call_time_SUITE.erl b/erts/emulator/test/trace_call_time_SUITE.erl
index 38972c9c02..40c8bc4340 100644
--- a/erts/emulator/test/trace_call_time_SUITE.erl
+++ b/erts/emulator/test/trace_call_time_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/trace_local_SUITE.erl b/erts/emulator/test/trace_local_SUITE.erl
index 24864dcbef..74c05f24e0 100644
--- a/erts/emulator/test/trace_local_SUITE.erl
+++ b/erts/emulator/test/trace_local_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1224,18 +1224,22 @@ setup(ProcFlags) ->
shutdown() ->
trace_off(),
- {Pid,Mref} = get(slave),
- try erlang:is_process_alive(Pid) of
- true ->
- Pid ! die,
- receive
- {'DOWN',Mref,process,Pid,Reason} ->
- Reason
+ case get(slave) of
+ {Pid,Mref} ->
+ try erlang:is_process_alive(Pid) of
+ true ->
+ Pid ! die,
+ receive
+ {'DOWN',Mref,process,Pid,Reason} ->
+ Reason
+ end;
+ _ ->
+ not_alive
+ catch _:_ ->
+ undefined
end;
_ ->
- not_alive
- catch _:_ ->
- undefined
+ undefined
end.
trace_off() ->
diff --git a/erts/emulator/test/trace_local_SUITE_data/trace_local_dummy.erl b/erts/emulator/test/trace_local_SUITE_data/trace_local_dummy.erl
index a5947de4aa..a886323302 100644
--- a/erts/emulator/test/trace_local_SUITE_data/trace_local_dummy.erl
+++ b/erts/emulator/test/trace_local_SUITE_data/trace_local_dummy.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/trace_meta_SUITE.erl b/erts/emulator/test/trace_meta_SUITE.erl
index dcc2cc807b..b6a6fd5404 100644
--- a/erts/emulator/test/trace_meta_SUITE.erl
+++ b/erts/emulator/test/trace_meta_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/trace_nif_SUITE.erl b/erts/emulator/test/trace_nif_SUITE.erl
index 49757a414d..8d5bff2a48 100644
--- a/erts/emulator/test/trace_nif_SUITE.erl
+++ b/erts/emulator/test/trace_nif_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/trace_port_SUITE.erl b/erts/emulator/test/trace_port_SUITE.erl
index d33f18543a..a66563d15b 100644
--- a/erts/emulator/test/trace_port_SUITE.erl
+++ b/erts/emulator/test/trace_port_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,10 +28,6 @@
receive_trace/1,
process_events/1,
schedule/1,
- fake_schedule/1,
- fake_schedule_after_register/1,
- fake_schedule_after_getting_linked/1,
- fake_schedule_after_getting_unlinked/1,
gc/1,
default_tracer/1,
tracer_port_crash/1]).
@@ -44,10 +40,7 @@ suite() ->
all() ->
[call_trace, return_trace, send, receive_trace,
- process_events, schedule, fake_schedule,
- fake_schedule_after_register,
- fake_schedule_after_getting_linked,
- fake_schedule_after_getting_unlinked, gc,
+ process_events, schedule, gc,
default_tracer, tracer_port_crash].
%% Test sending call trace messages to a port.
@@ -234,162 +227,6 @@ schedule(Config) when is_list(Config) ->
ok.
-run_fake_sched_test(Fun, Config) when is_function(Fun), is_list(Config) ->
- case catch erlang:system_info(smp_support) of
- true ->
- {skipped,
- "No need for faked schedule out/in trace messages "
- "when smp support is enabled"};
- _ ->
- Fun(Config)
- end.
-
-%% Tests time compensating fake out/in scheduling.
-fake_schedule(Config) when is_list(Config) ->
- run_fake_sched_test(fun fake_schedule_test/1, Config).
-
-fake_schedule_test(Config) when is_list(Config) ->
- Tracer = start_tracer(Config),
- Port = get(tracer_port),
- General = fun_spawn(fun general/0),
- %%
- trac(General, true, [send, running]),
- %%
- %% Test that fake out/in scheduling is not generated unless
- %% both 'running' and 'timestamp' is active.
- [] = erlang:port_control(Port, $h, []),
- General ! nop,
- expect({trace, General, in, {?MODULE, general, 0}}),
- expect({trace, General, out, {?MODULE, general, 0}}),
- expect(),
- %%
- trac(General, false, [running]),
- trac(General, true, [timestamp]),
- %%
- Ref1 = make_ref(),
- Msg1 = {Port, {data, term_to_binary(Ref1)}},
- [] = erlang:port_control(Port, $h, []),
- General ! {send, Tracer, Msg1},
- expect({trace_ts, General, send, Msg1, Tracer, ts}),
- expect(Ref1),
- expect(),
- %%
- trac(General, true, [running]),
- %%
- %% Test that fake out/in scheduling can be generated by the driver
- Ref2 = make_ref(),
- Msg2 = {Port, {data, term_to_binary(Ref2)}},
- [] = erlang:port_control(Port, $h, []),
- General ! {send, Tracer, Msg2},
- {_,_,_,_,Ts} =
- expect({trace_ts, General, in, {?MODULE, general, 0}, ts}),
- expect({trace_ts, General, out, 0, Ts}),
- expect({trace_ts, General, in, 0, ts}),
- expect({trace_ts, General, send, Msg2, Tracer, ts}),
- expect(Ref2),
- expect({trace_ts, General, out, {?MODULE, general, 0}, ts}),
- expect(),
- %%
- %% Test that fake out/in scheduling is not generated after an
- %% 'out' scheduling event
- Ref3 = make_ref(),
- Msg3 = {Port, {data, term_to_binary(Ref3)}},
- General ! {apply, {erlang, port_control, [Port, $h, []]}},
- expect({trace_ts, General, in, {?MODULE, general, 0}, ts}),
- expect({trace_ts, General, out, {?MODULE, general, 0}, ts}),
- General ! {send, Tracer, Msg3},
- expect({trace_ts, General, in, {?MODULE, general, 0}, ts}),
- expect({trace_ts, General, send, Msg3, Tracer, ts}),
- expect(Ref3),
- expect({trace_ts, General, out, {?MODULE, general, 0}, ts}),
- expect(),
- %%
- ok.
-
-%% Tests fake out/in scheduling contents.
-fake_schedule_after_register(Config) when is_list(Config) ->
- run_fake_sched_test(fun fake_schedule_after_register_test/1, Config).
-
-fake_schedule_after_register_test(Config) when is_list(Config) ->
- start_tracer(Config),
- Port = get(tracer_port),
- G1 = fun_spawn(fun general/0),
- G2 = fun_spawn(fun general/0),
- %%
- trac(G1, true, [running, timestamp, procs]),
- trac(G2, true, [running, timestamp]),
- %%
- %% Test fake out/in scheduling after certain messages
- erlang:yield(),
- G2 ! {apply, {erlang, port_control, [Port, $h, []]}},
- G2 ! {apply, {erlang, register, [fake_schedule_after_register, G1]}},
- expect({trace_ts, G2, in, {?MODULE, general, 0}, ts}),
- {_,_,_,_,Ts} =
- expect({trace_ts, G1, register, fake_schedule_after_register, ts}),
- expect({trace_ts, G2, out, 0, Ts}),
- expect({trace_ts, G2, in, 0, ts}),
- expect({trace_ts, G2, out, {?MODULE, general, 0}, ts}),
- expect(),
- %%
- ok.
-
-%% Tests fake out/in scheduling contents.
-fake_schedule_after_getting_linked(Config) when is_list(Config) ->
- run_fake_sched_test(fun fake_schedule_after_getting_linked_test/1,
- Config).
-
-fake_schedule_after_getting_linked_test(Config) when is_list(Config) ->
- start_tracer(Config),
- Port = get(tracer_port),
- G1 = fun_spawn(fun general/0),
- G2 = fun_spawn(fun general/0),
- %%
- trac(G1, true, [running, timestamp, procs]),
- trac(G2, true, [running, timestamp]),
- %%
- %% Test fake out/in scheduling after certain messages
- erlang:yield(),
- G2 ! {apply, {erlang, port_control, [Port, $h, []]}},
- G2 ! {apply, {erlang, link, [G1]}},
- expect({trace_ts, G2, in, {?MODULE, general, 0}, ts}),
- {_,_,_,_,Ts} =
- expect({trace_ts, G1, getting_linked, G2, ts}),
- expect({trace_ts, G2, out, 0, Ts}),
- expect({trace_ts, G2, in, 0, ts}),
- expect({trace_ts, G2, out, {?MODULE, general, 0}, ts}),
- expect(),
- %%
- ok.
-
-%% Tests fake out/in scheduling contents.
-fake_schedule_after_getting_unlinked(Config) when is_list(Config) ->
- run_fake_sched_test(fun fake_schedule_after_getting_unlinked_test/1,
- Config).
-
-fake_schedule_after_getting_unlinked_test(Config) when is_list(Config) ->
- start_tracer(Config),
- Port = get(tracer_port),
- G1 = fun_spawn(fun general/0),
- G2 = fun_spawn(fun general/0),
- %%
- trac(G1, true, [running, procs]),
- trac(G2, true, [running, timestamp]),
- %%
- %% Test fake out/in scheduling after certain messages
- erlang:yield(),
- G2 ! {apply, {erlang, link, [G1]}},
- G2 ! {apply, {erlang, port_control, [Port, $h, []]}},
- G2 ! {apply, {erlang, unlink, [G1]}},
- expect({trace_ts, G2, in, {?MODULE, general, 0}, ts}),
- expect({trace, G1, getting_linked, G2}),
- expect({trace, G1, getting_unlinked, G2}),
- expect({trace_ts, G2, out, 0, ts}),
- expect({trace_ts, G2, in, 0, ts}),
- expect({trace_ts, G2, out, {?MODULE, general, 0}, ts}),
- expect(),
- %%
- ok.
-
%% Test sending garbage collection events to a port.
gc(Config) when is_list(Config) ->
start_tracer(Config),
@@ -399,13 +236,13 @@ gc(Config) when is_list(Config) ->
trace_info(Garber, flags),
Garber ! hi,
- expect({trace,Garber,gc_start,info}),
- expect({trace,Garber,gc_end,info}),
+ expect({trace,Garber,gc_major_start,info}),
+ expect({trace,Garber,gc_major_end,info}),
trac(Garber, true, [garbage_collection,timestamp]),
Garber ! hi,
- expect({trace_ts,Garber,gc_start,info,ts}),
- expect({trace_ts,Garber,gc_end,info,ts}),
+ expect({trace_ts,Garber,gc_major_start,info,ts}),
+ expect({trace_ts,Garber,gc_major_end,info,ts}),
ok.
@@ -440,7 +277,7 @@ default_tracer(Config) when is_list(Config) ->
{tracer, []} = erlang:trace_info(G1, tracer),
G1 ! {apply,{erlang,exit,[normal]}},
io:format("~p = ~p.~n", [M, N]),
- M = N,
+ M = N - 1, % G1 has been started, but Tracer and Port have died
ok.
tracer_port_crash(Config) when is_list(Config) ->
diff --git a/erts/emulator/test/tracer_SUITE.erl b/erts/emulator/test/tracer_SUITE.erl
new file mode 100644
index 0000000000..de44d6656a
--- /dev/null
+++ b/erts/emulator/test/tracer_SUITE.erl
@@ -0,0 +1,627 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(tracer_SUITE).
+
+%%%
+%%% Tests the tracer module interface
+%%%
+
+-export([all/0, suite/0,groups/0, init_per_suite/1, end_per_suite/1,
+ init_per_group/2,end_per_group/2, init_per_testcase/2,
+ end_per_testcase/2]).
+-export([load/1, unload/1, reload/1, invalid_tracers/1]).
+-export([send/1, recv/1, spawn/1, exit/1, link/1, unlink/1,
+ getting_linked/1, getting_unlinked/1, register/1, unregister/1,
+ in/1, out/1, gc_start/1, gc_end/1]).
+
+suite() -> [{ct_hooks,[ts_install_cth]},
+ {timetrap, {minutes, 1}}].
+
+all() ->
+ [load, unload, reload, invalid_tracers, {group, basic}].
+
+groups() ->
+ [{ basic, [], [send, recv, spawn, exit, link, unlink, getting_linked,
+ getting_unlinked, register, unregister, in, out,
+ gc_start, gc_end]}].
+
+init_per_suite(Config) ->
+ purge(),
+ Config.
+
+end_per_suite(_Config) ->
+ ok.
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+init_per_testcase(TC, Config) when TC =:= load; TC =:= reload ->
+
+ DataDir = proplists:get_value(data_dir, Config),
+
+ Pid = erlang:spawn(fun F() ->
+ receive
+ {get, Pid} ->
+ Pid ! DataDir,
+ F()
+ end
+ end),
+ register(tracer_test_config, Pid),
+ Config;
+init_per_testcase(_, Config) ->
+ DataDir = proplists:get_value(data_dir, Config),
+ case catch tracer_test:enabled(trace_status, self(), self()) of
+ discard ->
+ ok;
+ _ ->
+ tracer_test:load(DataDir)
+ end,
+ Config.
+
+end_per_testcase(TC, _Config) when TC =:= load; TC =:= reload ->
+ purge(),
+ exit(whereis(tracer_test_config), kill),
+ ok;
+end_per_testcase(_, _Config) ->
+ purge(),
+ ok.
+
+load(_Config) ->
+ purge(),
+ 1 = erlang:trace(self(), true, [{tracer, tracer_test, []}, call]),
+ purge(),
+ 1 = erlang:trace_pattern({?MODULE, all, 0}, [],
+ [{meta, tracer_test, []}]),
+ ok.
+
+unload(_Config) ->
+
+ ServerFun = fun F(0, undefined) ->
+ receive
+ {N, Pid} -> F(N, Pid)
+ end;
+ F(0, Pid) ->
+ Pid ! done,
+ F(0, undefined);
+ F(N, Pid) ->
+ ?MODULE:all(),
+ F(N-1, Pid)
+ end,
+
+ Pid = erlang:spawn_link(fun() -> ServerFun(0, undefined) end),
+
+
+ Tc = fun(N) ->
+ Pid ! {N, self()},
+ receive done -> ok after 1000 -> ct:fail(timeout) end,
+ trace_delivered(Pid)
+ end,
+
+ 1 = erlang:trace(Pid, true, [{tracer, tracer_test,
+ {#{ call => trace}, self(), []}},
+ call]),
+ 1 = erlang:trace_pattern({?MODULE, all, 0}, [], []),
+
+ Tc(1),
+ receive _ -> ok after 0 -> ct:fail(timeout) end,
+
+ code:purge(tracer_test),
+ code:delete(tracer_test),
+
+ Tc(1),
+ receive M1 -> ct:fail({unexpected_message, M1}) after 0 -> ok end,
+
+ code:purge(tracer_test),
+
+ Tc(1),
+ receive M2 -> ct:fail({unexpected_message, M2}) after 0 -> ok end,
+
+ ok.
+
+%% This testcase is here to make sure there are not
+%% segfaults when reloading the current nifs.
+reload(_Config) ->
+
+ Tracer = spawn_opt(fun F() -> receive _M -> F() end end,
+ [{message_queue_data, off_heap}]),
+ erlang:link(Tracer),
+ Tracee = spawn_link(fun reload_loop/0),
+
+ [begin
+ Ref = make_ref(),
+ State = {#{ call => trace }, Tracer, [Ref]},
+ erlang:trace(Tracee, true, [{tracer, tracer_test,State}, call]),
+ erlang:trace_pattern({?MODULE, all, 0}, []),
+
+ false = code:purge(tracer_test),
+ {module, _} = code:load_file(tracer_test),
+
+ %% There is a race involved in between when the internal nif cache
+ %% is purged and when the reload_loop needs the tracer module
+ %% so the tracer may be removed or still there.
+ case erlang:trace_info(Tracee, tracer) of
+ {tracer, []} -> ok;
+ {tracer, {tracer_test, State}} -> ok
+ end,
+
+ false = code:purge(tracer_test),
+ true = code:delete(tracer_test),
+ false = code:purge(tracer_test)
+ end || _ <- lists:seq(1,15)],
+
+ ok.
+
+reload_loop() ->
+ ?MODULE:all(),
+ reload_loop().
+
+invalid_tracers(_Config) ->
+ FailTrace = fun(A) ->
+ try erlang:trace(self(), true, A) of
+ _ -> ct:fail(A)
+ catch _:_ -> ok end
+ end,
+
+ FailTrace([{tracer, foobar}, call]),
+ FailTrace([{tracer, foobar, []}, call]),
+ FailTrace([{tracer, make_ref(), []}, call]),
+ FailTrace([{tracer, lists, []}, call]),
+
+ FailTP = fun(MS,FL) ->
+ try erlang:trace_pattern({?MODULE,all,0}, MS, FL) of
+ _ -> ct:fail({MS, FL})
+ catch _:_ -> ok end
+ end,
+
+ FailTP([],[{meta, foobar}]),
+ FailTP([],[{meta, foobar, []}]),
+ FailTP([],[{meta, make_ref(), []}]),
+ FailTP([],[{meta, lists, []}]),
+
+ ok.
+
+
+
+send(_Config) ->
+
+ Self = self(),
+ Tc = fun(Pid) ->
+ Pid ! fun() -> Self ! ok end,
+ receive ok -> ok after 100 -> ct:fail(timeout) end
+ end,
+
+ Expect = fun(Pid, State, EOpts) ->
+ receive
+ Msg ->
+ {Pid, send, State, Pid, ok, Self, Opts} = Msg,
+ check_opts(EOpts, Opts)
+ end
+ end,
+ test(send, Tc, Expect).
+
+
+recv(_Config) ->
+
+ Tc = fun(Pid) ->
+ Pid ! ok
+ end,
+
+ Expect = fun(Pid, State, EOpts) ->
+ receive
+ Msg ->
+ {undefined, 'receive', State, Pid, ok, undefined, Opts} = Msg,
+ check_opts(EOpts, Opts)
+ end
+ end,
+
+ test('receive', Tc, Expect, false).
+
+spawn(_Config) ->
+
+ Tc = fun(Pid) ->
+ Pid ! fun() -> erlang:spawn(lists,seq,[1,10]), ok end
+ end,
+
+ Expect =
+ fun(Pid, State, EOpts) ->
+ receive
+ Msg ->
+ {Pid, spawn, State, Pid, NewPid,
+ {lists,seq,[1,10]}, Opts} = Msg,
+ check_opts(EOpts, Opts),
+ true = is_pid(NewPid) andalso NewPid /= Pid
+ end
+ end,
+
+ test(spawn, procs, Tc, Expect, true).
+
+exit(_Config) ->
+ Tc = fun(Pid) ->
+ Pid ! fun() -> exit end
+ end,
+
+ Expect =
+ fun(Pid, State, EOpts) ->
+ receive
+ Msg ->
+ {Pid, exit, State, Pid, normal, undefined, Opts} = Msg,
+ check_opts(EOpts, Opts)
+ end
+ end,
+
+ test(exit, procs, Tc, Expect, true, true).
+
+link(_Config) ->
+
+ Tc = fun(Pid) ->
+ Pid ! fun() ->
+ SPid = erlang:spawn(fun() -> receive _ -> ok end end),
+ erlang:link(SPid),
+ ok
+ end
+ end,
+
+ Expect =
+ fun(Pid, State, EOpts) ->
+ receive
+ Msg ->
+ {Pid, link, State, Pid, NewPid, undefined, Opts} = Msg,
+ check_opts(EOpts, Opts),
+ true = is_pid(NewPid) andalso NewPid /= Pid
+ end
+ end,
+
+ test(link, procs, Tc, Expect, true).
+
+unlink(_Config) ->
+
+ Tc = fun(Pid) ->
+ Pid ! fun() ->
+ SPid = erlang:spawn(fun() -> receive _ -> ok end end),
+ erlang:link(SPid),
+ erlang:unlink(SPid),
+ ok
+ end
+ end,
+
+ Expect =
+ fun(Pid, State, EOpts) ->
+ receive
+ Msg ->
+ {Pid, unlink, State, Pid, NewPid, undefined, Opts} = Msg,
+ check_opts(EOpts, Opts),
+ true = is_pid(NewPid) andalso NewPid /= Pid
+ end
+ end,
+
+ test(unlink, procs, Tc, Expect, true).
+
+getting_linked(_Config) ->
+
+ Tc = fun(Pid) ->
+ Pid ! fun() ->
+ Self = self(),
+ erlang:spawn(fun() -> erlang:link(Self) end),
+ ok
+ end
+ end,
+
+ Expect =
+ fun(Pid, State, EOpts) ->
+ receive
+ Msg ->
+ {NewPid, getting_linked, State, Pid, NewPid, undefined, Opts} = Msg,
+ check_opts(EOpts, Opts),
+ true = is_pid(NewPid) andalso NewPid /= Pid
+ end
+ end,
+
+ test(getting_linked, procs, Tc, Expect, false).
+
+getting_unlinked(_Config) ->
+ Tc = fun(Pid) ->
+ Pid ! fun() ->
+ Self = self(),
+ erlang:spawn(fun() ->
+ erlang:link(Self),
+ erlang:unlink(Self)
+ end),
+ ok
+ end
+ end,
+
+ Expect =
+ fun(Pid, State, EOpts) ->
+ receive
+ Msg ->
+ {NewPid, getting_unlinked, State, Pid, NewPid, undefined, Opts} = Msg,
+ check_opts(EOpts, Opts),
+ true = is_pid(NewPid) andalso NewPid /= Pid
+ end
+ end,
+
+ test(getting_unlinked, procs, Tc, Expect, false).
+
+register(_Config) ->
+
+ Tc = fun(Pid) ->
+ Pid ! fun() ->
+ erlang:register(?MODULE, self()),
+ erlang:unregister(?MODULE),
+ ok
+ end
+ end,
+
+ Expect =
+ fun(Pid, State, EOpts) ->
+ receive
+ Msg ->
+ {Pid, register, State, Pid, ?MODULE, undefined, Opts} = Msg,
+ check_opts(EOpts, Opts)
+ end
+ end,
+
+ test(register, procs, Tc, Expect, true).
+
+unregister(_Config) ->
+
+ Tc = fun(Pid) ->
+ Pid ! fun() ->
+ erlang:register(?MODULE, self()),
+ erlang:unregister(?MODULE),
+ ok
+ end
+ end,
+
+ Expect =
+ fun(Pid, State, EOpts) ->
+ receive
+ Msg ->
+ {Pid, unregister, State, Pid, ?MODULE, undefined, Opts} = Msg,
+ check_opts(EOpts, Opts)
+ end
+ end,
+
+ test(unregister, procs, Tc, Expect, true).
+
+in(_Config) ->
+
+ Tc = fun(Pid) ->
+ Self = self(),
+ Pid ! fun() -> receive after 1 -> Self ! ok end end,
+ receive ok -> ok end
+ end,
+
+ Expect =
+ fun(Pid, State, EOpts) ->
+ N = (fun F(N) ->
+ receive
+ Msg ->
+ {Pid, in, State, Pid, _,
+ undefined, Opts} = Msg,
+ check_opts(EOpts, Opts),
+ F(N+1)
+ after 0 -> N
+ end
+ end)(0),
+ true = N > 0
+ end,
+
+ test(in, running, Tc, Expect, true).
+
+out(_Config) ->
+ Tc = fun(Pid) ->
+ Pid ! fun() -> receive after 10 -> exit end end,
+ Ref = erlang:monitor(process, Pid),
+ receive {'DOWN', Ref, _, _, _} -> ok end
+ end,
+
+ Expect =
+ fun(Pid, State, EOpts) ->
+ %% We cannot predict how many out schedules there will be
+ N = (fun F(N) ->
+ receive
+ Msg ->
+ {Pid, out, State, Pid, _,
+ undefined, Opts} = Msg,
+ check_opts(EOpts, Opts),
+ F(N+1)
+ after 0 -> N
+ end
+ end)(0),
+ true = N > 0
+ end,
+
+ test(out, running, Tc, Expect, true, true).
+
+gc_start(_Config) ->
+
+ Tc = fun(Pid) ->
+ Pid ! fun() ->
+ erlang:garbage_collect(),
+ ok
+ end
+ end,
+
+ Expect =
+ fun(Pid, State, EOpts) ->
+ receive
+ Msg ->
+ {Pid, gc_major_start, State, Pid, _, undefined, Opts} = Msg,
+ check_opts(EOpts, Opts)
+ end
+ end,
+
+ test(gc_major_start, garbage_collection, Tc, Expect, true).
+
+gc_end(_Config) ->
+
+ Tc = fun(Pid) ->
+ Pid ! fun() ->
+ erlang:garbage_collect(),
+ ok
+ end
+ end,
+
+ Expect =
+ fun(Pid, State, EOpts) ->
+ receive
+ Msg ->
+ {Pid, gc_major_end, State, Pid, _, undefined, Opts} = Msg,
+ check_opts(EOpts, Opts)
+ end
+ end,
+
+ test(gc_major_end, garbage_collection, Tc, Expect, true).
+
+test(Event, Tc, Expect) ->
+ test(Event, Tc, Expect, true).
+test(Event, Tc, Expect, Removes) ->
+ test(Event, Event, Tc, Expect, Removes).
+test(Event, TraceFlag, Tc, Expect, Removes) ->
+ test(Event, TraceFlag, Tc, Expect, Removes, false).
+test(Event, TraceFlag, Tc, Expect, Removes, Dies) ->
+
+ ComplexState = {fun() -> ok end, <<0:(128*8)>>},
+ Opts = #{ timestamp => undefined,
+ scheduler_id => undefined,
+ match_spec_result => true },
+
+ %% Test that trace works
+ State1 = {#{ Event => trace }, self(), ComplexState},
+ Pid1 = start_tracee(),
+ 1 = erlang:trace(Pid1, true, [TraceFlag, {tracer, tracer_test, State1}]),
+ Tc(Pid1),
+ ok = trace_delivered(Pid1),
+
+ Expect(Pid1, State1, Opts),
+ receive M11 -> ct:fail({unexpected, M11}) after 0 -> ok end,
+ if not Dies ->
+ {flags, [TraceFlag]} = erlang:trace_info(Pid1, flags),
+ {tracer, {tracer_test, State1}} = erlang:trace_info(Pid1, tracer),
+ erlang:trace(Pid1, false, [TraceFlag]);
+ true -> ok
+ end,
+
+ %% Test that trace works with scheduler id and timestamp
+ Pid1T = start_tracee(),
+ 1 = erlang:trace(Pid1T, true, [TraceFlag, {tracer, tracer_test, State1},
+ timestamp, scheduler_id]),
+ Tc(Pid1T),
+ ok = trace_delivered(Pid1T),
+
+ Expect(Pid1T, State1, Opts#{ scheduler_id := number,
+ timestamp := timestamp}),
+ receive M11T -> ct:fail({unexpected, M11T}) after 0 -> ok end,
+ if not Dies ->
+ {flags, [scheduler_id, TraceFlag, timestamp]}
+ = erlang:trace_info(Pid1T, flags),
+ {tracer, {tracer_test, State1}} = erlang:trace_info(Pid1T, tracer),
+ erlang:trace(Pid1T, false, [TraceFlag]);
+ true -> ok
+ end,
+
+ %% Test that discard works
+ Pid2 = start_tracee(),
+ State2 = {#{ Event => discard }, self(), ComplexState},
+ 1 = erlang:trace(Pid2, true, [TraceFlag, {tracer, tracer_test, State2}]),
+ Tc(Pid2),
+ ok = trace_delivered(Pid2),
+ receive M2 -> ct:fail({unexpected, M2}) after 0 -> ok end,
+ if not Dies ->
+ {flags, [TraceFlag]} = erlang:trace_info(Pid2, flags),
+ {tracer, {tracer_test, State2}} = erlang:trace_info(Pid2, tracer),
+ erlang:trace(Pid2, false, [TraceFlag]);
+ true ->
+ ok
+ end,
+
+ %% Test that remove works
+ Pid3 = start_tracee(),
+ State3 = {#{ Event => remove }, self(), ComplexState},
+ 1 = erlang:trace(Pid3, true, [TraceFlag, {tracer, tracer_test, State3}]),
+ Tc(Pid3),
+ ok = trace_delivered(Pid3),
+ receive M3 -> ct:fail({unexpected, M3}) after 0 -> ok end,
+ if not Dies ->
+ if Removes ->
+ {flags, []} = erlang:trace_info(Pid3, flags),
+ {tracer, []} = erlang:trace_info(Pid3, tracer);
+ true ->
+ {flags, [TraceFlag]} = erlang:trace_info(Pid3, flags),
+ {tracer, {tracer_test, State3}} = erlang:trace_info(Pid3, tracer)
+ end,
+ erlang:trace(Pid3, false, [TraceFlag]);
+ true ->
+ ok
+ end,
+ ok.
+
+check_opts(#{ scheduler_id := number } = E, #{ scheduler_id := N } = O)
+ when is_integer(N) ->
+ E1 = maps:remove(scheduler_id, E),
+ O1 = maps:remove(scheduler_id, O),
+ if E1 == O1 -> ok;
+ true -> ct:fail({invalid_opts, E, O})
+ end;
+check_opts(Opts, Opts) ->
+ ok;
+check_opts(E,O) ->
+ ct:fail({invalid_opts, E, O}).
+
+start_tracee() ->
+ spawn_link(
+ fun F() ->
+ receive
+ Action when is_function(Action) ->
+ case Action() of
+ ok ->
+ F();
+ Err ->
+ Err
+ end;
+ _ ->
+ F()
+ end
+ end).
+
+trace_delivered(Pid) ->
+ Ref = erlang:trace_delivered(Pid),
+ receive
+ {trace_delivered, Pid, Ref} ->
+ ok
+ after 1000 ->
+ timeout
+ end.
+
+purge() ->
+ %% Make sure module is not loaded
+ case erlang:module_loaded(tracer_test) of
+ true ->
+ code:purge(tracer_test),
+ true = code:delete(tracer_test),
+ code:purge(tracer_test);
+ _ ->
+ ok
+ end.
diff --git a/erts/emulator/test/tracer_SUITE_data/Makefile.src b/erts/emulator/test/tracer_SUITE_data/Makefile.src
new file mode 100644
index 0000000000..154bd70ccc
--- /dev/null
+++ b/erts/emulator/test/tracer_SUITE_data/Makefile.src
@@ -0,0 +1,8 @@
+
+NIF_LIBS = tracer_test@dll@
+
+all: $(NIF_LIBS)
+
+@SHLIB_RULES@
+
+$(NIF_LIBS): tracer_test.c
diff --git a/erts/emulator/test/tracer_SUITE_data/tracer_test.c b/erts/emulator/test/tracer_SUITE_data/tracer_test.c
new file mode 100644
index 0000000000..8b4be1345d
--- /dev/null
+++ b/erts/emulator/test/tracer_SUITE_data/tracer_test.c
@@ -0,0 +1,122 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Ericsson AB 2009-2014. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+#include "erl_nif.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <limits.h>
+
+/* NIF interface declarations */
+static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info);
+static int upgrade(ErlNifEnv* env, void** priv_data, void** old_priv_data, ERL_NIF_TERM load_info);
+static void unload(ErlNifEnv* env, void* priv_data);
+
+/* The NIFs: */
+static ERL_NIF_TERM enabled(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM trace(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+
+static ErlNifFunc nif_funcs[] = {
+ {"enabled", 3, enabled},
+ {"trace", 6, trace}
+};
+
+ERL_NIF_INIT(tracer_test, nif_funcs, load, NULL, upgrade, unload)
+
+static ERL_NIF_TERM atom_discard;
+static ERL_NIF_TERM atom_ok;
+
+#define ASSERT(expr) assert(expr)
+
+static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info)
+{
+
+ atom_discard = enif_make_atom(env, "discard");
+ atom_ok = enif_make_atom(env, "ok");
+
+ *priv_data = NULL;
+
+ return 0;
+}
+
+static void unload(ErlNifEnv* env, void* priv_data)
+{
+
+}
+
+static int upgrade(ErlNifEnv* env, void** priv_data, void** old_priv_data,
+ ERL_NIF_TERM load_info)
+{
+ if (*old_priv_data != NULL) {
+ return -1; /* Don't know how to do that */
+ }
+ if (*priv_data != NULL) {
+ return -1; /* Don't know how to do that */
+ }
+ if (load(env, priv_data, load_info)) {
+ return -1;
+ }
+ return 0;
+}
+
+static ERL_NIF_TERM enabled(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ int state_arity;
+ const ERL_NIF_TERM *state_tuple;
+ ERL_NIF_TERM value;
+ ASSERT(argc == 3);
+
+ if (!enif_get_tuple(env, argv[1], &state_arity, &state_tuple))
+ return atom_discard;
+
+ if (enif_get_map_value(env, state_tuple[0], argv[0], &value)) {
+ return value;
+ } else {
+ return atom_discard;
+ }
+}
+
+static ERL_NIF_TERM trace(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ int state_arity;
+ ErlNifPid self, to;
+ ERL_NIF_TERM *tuple, msg;
+ const ERL_NIF_TERM *state_tuple;
+ ASSERT(argc == 6);
+
+ enif_get_tuple(env, argv[1], &state_arity, &state_tuple);
+
+ tuple = enif_alloc(sizeof(ERL_NIF_TERM)*(argc+1));
+ memcpy(tuple+1,argv,sizeof(ERL_NIF_TERM)*argc);
+
+ if (enif_self(env, &self)) {
+ tuple[0] = enif_make_pid(env, &self);
+ } else {
+ tuple[0] = enif_make_atom(env, "undefined");
+ }
+
+ msg = enif_make_tuple_from_array(env, tuple, argc + 1);
+ enif_get_local_pid(env, state_tuple[1], &to);
+ enif_send(env, &to, NULL, msg);
+ enif_free(tuple);
+
+ return atom_ok;
+}
diff --git a/erts/emulator/test/tracer_test.erl b/erts/emulator/test/tracer_test.erl
new file mode 100644
index 0000000000..d4778f4531
--- /dev/null
+++ b/erts/emulator/test/tracer_test.erl
@@ -0,0 +1,55 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(tracer_test).
+
+%%%
+%%% Test tracer
+%%%
+
+-export([enabled/3, trace/6]).
+-export([load/1, load/2]).
+-on_load(load/0).
+
+enabled(_, _, _) ->
+ erlang:nif_error(nif_not_loaded).
+
+trace(_, _, _, _, _, _) ->
+ erlang:nif_error(nif_not_loaded).
+
+load() ->
+ case whereis(tracer_test_config) of
+ undefined ->
+ ok;
+ Pid ->
+ Pid ! {get, self()},
+ receive
+ {Conf, Postfix} ->
+ load(Conf, Postfix);
+ Conf ->
+ load(Conf)
+ end
+ end.
+
+load(DataDir) ->
+ load(DataDir, "").
+load(DataDir, Postfix) ->
+ SoFile = atom_to_list(?MODULE) ++ Postfix,
+ erlang:load_nif(filename:join(DataDir, SoFile) , 0).
diff --git a/erts/emulator/test/tuple_SUITE.erl b/erts/emulator/test/tuple_SUITE.erl
index d59d7d12d3..79b681b4d1 100644
--- a/erts/emulator/test/tuple_SUITE.erl
+++ b/erts/emulator/test/tuple_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/unique_SUITE.erl b/erts/emulator/test/unique_SUITE.erl
index e8537e6152..c5aa80c7b4 100644
--- a/erts/emulator/test/unique_SUITE.erl
+++ b/erts/emulator/test/unique_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/test/z_SUITE.erl b/erts/emulator/test/z_SUITE.erl
index 93a03e8f91..d1085c1958 100644
--- a/erts/emulator/test/z_SUITE.erl
+++ b/erts/emulator/test/z_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops
index f805e7cc64..4407f7e289 100755
--- a/erts/emulator/utils/beam_makeops
+++ b/erts/emulator/utils/beam_makeops
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2012. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ $pack_shift[4] = ['0', 'BEAM_LOOSE_SHIFT', # Only for 64 bit wordsize
'(3*BEAM_LOOSE_SHIFT)'];
$pack_mask[2] = ['BEAM_LOOSE_MASK', $WHOLE_WORD];
-$pack_mask[3] = ['BEAM_TIGHT_MASK', 'BEAM_TIGHT_MASK', $WHOLE_WORD];
+$pack_mask[3] = ['BEAM_TIGHT_MASK', 'BEAM_TIGHT_MASK', 'BEAM_TIGHT_MASK'];
$pack_mask[4] = ['BEAM_LOOSE_MASK', # Only for 64 bit wordsize
'BEAM_LOOSE_MASK',
'BEAM_LOOSE_MASK',
@@ -113,7 +113,6 @@ my @if_line;
#
my $te_max_vars = 0; # Max number of variables ever needed.
my %gen_transform;
-my %min_window;
my %match_engine_ops; # All opcodes for the match engine.
my %gen_transform_offset;
my @transformations;
@@ -252,6 +251,7 @@ $args_per_word[5] = 3;
$args_per_word[6] = 3;
if ($wordsize == 64) {
+ $pack_mask[3] = ['BEAM_TIGHT_MASK', 'BEAM_TIGHT_MASK', $WHOLE_WORD];
$args_per_word[4] = 4;
}
@@ -382,7 +382,6 @@ while (<>) {
$gen_arity{$name} = $arity;
$gen_to_spec{"$name/$arity"} = undef;
$num_specific{"$name/$arity"} = 0;
- $min_window{"$name/$arity"} = 255;
$obsolete[$op_num] = defined $obsolete;
} else { # Unnumbered generic operation.
push(@unnumbered_generic, [$name, $arity]);
@@ -440,7 +439,6 @@ $num_file_opcodes = @gen_opname;
$gen_arity{$name} = $arity;
$gen_to_spec{"$name/$arity"} = undef;
$num_specific{"$name/$arity"} = 0;
- $min_window{"$name/$arity"} = 255;
}
}
@@ -607,7 +605,7 @@ sub emulator_output {
$is_transformed{$name,$arity} or
error("instruction $key has no specific instruction");
$spec_op = -1 unless defined $spec_op;
- &init_item($name, $arity, $spec_op, $num_specific, $tr, $min_window{$key});
+ &init_item($name, $arity, $spec_op, $num_specific, $tr);
}
}
print "};\n";
@@ -627,19 +625,25 @@ sub emulator_output {
print "#define NUM_SPECIFIC_OPS ", scalar(@op_to_name), "\n";
print "#define SCRATCH_X_REG 1023\n";
print "\n";
- print "#ifdef ARCH_64\n";
- print "# define BEAM_WIDE_MASK 0xFFFFUL\n";
- print "# define BEAM_LOOSE_MASK 0xFFFFUL\n";
- print "# define BEAM_TIGHT_MASK 0xFFFFUL\n";
- print "# define BEAM_WIDE_SHIFT 32\n";
- print "# define BEAM_LOOSE_SHIFT 16\n";
- print "# define BEAM_TIGHT_SHIFT 16\n";
- print "#else\n";
- print "# define BEAM_LOOSE_MASK 0xFFF\n";
- print "# define BEAM_TIGHT_MASK 0xFFC\n";
- print "# define BEAM_LOOSE_SHIFT 16\n";
- print "# define BEAM_TIGHT_SHIFT 10\n";
- print "#endif\n";
+ if ($wordsize == 32) {
+ print "#if defined(ARCH_64)\n";
+ print qq[ #error "32-bit architecture assumed, but ARCH_64 is defined"\n];
+ print "#endif\n";
+ print "#define BEAM_LOOSE_MASK 0xFFF\n";
+ print "#define BEAM_TIGHT_MASK 0xFFC\n";
+ print "#define BEAM_LOOSE_SHIFT 16\n";
+ print "#define BEAM_TIGHT_SHIFT 10\n";
+ } elsif ($wordsize == 64) {
+ print "#if !defined(ARCH_64)\n";
+ print qq[ #error "64-bit architecture assumed, but ARCH_64 not defined"\n];
+ print "#endif\n";
+ print "#define BEAM_WIDE_MASK 0xFFFFUL\n";
+ print "#define BEAM_LOOSE_MASK 0xFFFFUL\n";
+ print "#define BEAM_TIGHT_MASK 0xFFFFUL\n";
+ print "#define BEAM_WIDE_SHIFT 32\n";
+ print "#define BEAM_LOOSE_SHIFT 16\n";
+ print "#define BEAM_TIGHT_SHIFT 16\n";
+ }
print "\n";
#
@@ -1405,8 +1409,7 @@ sub tr_gen {
foreach $ref (@g) {
my($line, $orig_transform, $from_ref, $to_ref) = @$ref;
- my $used_ref = used_vars($from_ref, $to_ref);
- my $so_far = tr_gen_from($line, $used_ref, @$from_ref);
+ my $so_far = tr_gen_from($line, @$from_ref);
tr_gen_to($line, $orig_transform, $so_far, @$to_ref);
}
@@ -1457,58 +1460,14 @@ sub tr_gen {
print "};\n\n";
}
-sub used_vars {
- my($from_ref,$to_ref) = @_;
- my %used;
- my %seen;
-
- foreach my $ref (@$from_ref) {
- my($name,$arity,@ops) = @$ref;
- if ($name =~ /^[.]/) {
- foreach my $var (@ops) {
- $used{$var} = 1;
- }
- } else {
- # Any variable that is used at least twice on the
- # left-hand side is used. (E.g. "move R R".)
- foreach my $op (@ops) {
- my($var, $type, $type_val) = @$op;
- next if $var eq '';
- $used{$var} = 1 if $seen{$var};
- $seen{$var} = 1;
- }
- }
- }
-
- foreach my $ref (@$to_ref) {
- my($name, $arity, @ops) = @$ref;
- if ($name =~ /^[.]/) {
- foreach my $var (@ops) {
- $used{$var} = 1;
- }
- } else {
- foreach my $op (@ops) {
- my($var, $type, $type_val) = @$op;
- next if $var eq '';
- $used{$var} = 1;
- }
- }
- }
- \%used;
-}
-
sub tr_gen_from {
- my($line,$used_ref,@tr) = @_;
+ my($line,@tr) = @_;
my(%var) = ();
my(%var_type);
my($var_num) = 0;
my(@code);
- my($min_window) = 0;
- my(@fix_rest_args);
- my(@fix_pred_funcs);
my($op, $ref); # Loop variables.
my $where = "left side of transformation in line $line: ";
- my %var_used = %$used_ref;
my $may_fail = 0;
my $is_first = 1;
@@ -1530,8 +1489,20 @@ sub tr_gen_from {
my $var;
my(@args);
- push(@fix_pred_funcs, scalar(@code));
- push(@code, [$name, @ops]);
+ foreach $var (@ops) {
+ error($where, "variable '$var' unbound")
+ unless defined $var{$var};
+ if ($var_type{$var} eq 'scalar') {
+ push(@args, "var[$var{$var}]");
+ } else {
+ push(@args, "rest_args");
+ }
+ }
+ my $pi = tr_next_index(\@pred_table, \%pred_table, $name, @args);
+ my $op = make_op("$name()", 'pred', $pi);
+ my @slots = grep(/^\d+/, map { $var{$_} } @ops);
+ op_slot_usage($op, @slots);
+ push(@code, $op);
next;
}
@@ -1544,7 +1515,6 @@ sub tr_gen_from {
$opnum = $gen_opnum{$name,$arity};
push(@code, make_op("$name/$arity", 'next_instr', $opnum));
- $min_window++;
foreach $op (@ops) {
my($var, $type, $type_val, $cond, $val) = @$op;
my $ignored_var = "$var (ignored)";
@@ -1593,15 +1563,21 @@ sub tr_gen_from {
if (defined $var{$var}) {
$ignored_var = '';
$may_fail = 1;
- push(@code, &make_op($var, 'is_same_var', $var{$var}));
+ my $op = make_op($var, 'is_same_var', $var{$var});
+ op_slot_usage($op, $var{$var});
+ push(@code, $op);
} elsif ($type eq '*') {
- #
- # Reserve a hole for a 'rest_args' instruction.
- #
+ foreach my $type (values %var_type) {
+ error("only one use of a '*' variable is " .
+ "allowed on the left hand side of " .
+ "a transformation")
+ if $type eq 'array';
+ }
$ignored_var = '';
- push(@fix_rest_args, scalar(@code));
- push(@code, $var);
- } elsif ($var_used{$var}) {
+ $var{$var} = 'unnumbered';
+ $var_type{$var} = 'array';
+ push(@code, make_op($var, 'rest_args'));
+ } else {
$ignored_var = '';
$var_type{$var} = 'scalar';
$var{$var} = $var_num;
@@ -1629,46 +1605,14 @@ sub tr_gen_from {
#
push(@code, make_op($may_fail ? '' : 'always reached', 'commit'));
- #
- # If there is an rest_args instruction, we must insert its correct
- # variable number (higher than any other).
- #
- my $index;
- &error("only one use of a '*' variable is allowed on the left hand side of a transformation")
- if @fix_rest_args > 1;
- foreach $index (@fix_rest_args) {
- my $var = $code[$index];
- $var{$var} = $var_num++;
- $var_type{$var} = 'array';
- splice(@code, $index, 1, &make_op($var, 'rest_args', $var{$var}));
- }
-
- foreach $index (@fix_pred_funcs) {
- my($name, @ops) = @{$code[$index]};
- my(@args);
- my $var;
-
- foreach $var (@ops) {
- &error($where, "variable '$var' unbound")
- unless defined $var{$var};
- if ($var_type{$var} eq 'scalar') {
- push(@args, "var[$var{$var}]");
- } else {
- push(@args, "var+$var{$var}");
- }
- }
- my $pi = tr_next_index(\@pred_table, \%pred_table, $name, @args);
- splice(@code, $index, 1, make_op("$name()", 'pred', $pi));
- }
-
$te_max_vars = $var_num
if $te_max_vars < $var_num;
- [$min_window, \%var, \%var_type, \@code];
+ [\%var, \%var_type, \@code];
}
sub tr_gen_to {
my($line, $orig_transform, $so_far, @tr) = @_;
- my($min_window, $var_ref, $var_type_ref, $code_ref) = @$so_far;
+ my($var_ref, $var_type_ref, $code_ref) = @$so_far;
my(%var) = %$var_ref;
my(%var_type) = %$var_type_ref;
my(@code) = @$code_ref;
@@ -1697,13 +1641,16 @@ sub tr_gen_to {
if ($var_type{$var} eq 'scalar') {
push(@args, "var[$var{$var}]");
} else {
- push(@args, "var+$var{$var}");
+ push(@args, "rest_args");
}
}
pop(@code); # Get rid of 'commit' instruction
my $index = tr_next_index(\@call_table, \%call_table,
$name, @args);
- push(@code, make_op("$name()", 'call_end', $index));
+ my $op = make_op("$name()", 'call_end', $index);
+ my @slots = grep(/^\d+/, map { $var{$_} } @ops);
+ op_slot_usage($op, @slots);
+ push(@code, $op);
last;
}
@@ -1725,11 +1672,13 @@ sub tr_gen_to {
my($var, $type, $type_val) = @$op;
if ($type eq '*') {
- push(@code, make_op($var, 'store_rest_args', $var{$var}));
+ push(@code, make_op($var, 'store_rest_args'));
} elsif ($var ne '') {
&error($where, "variable '$var' unbound")
unless defined $var{$var};
- push(@code, &make_op($var, 'store_var_next_arg', $var{$var}));
+ my $op = make_op($var, 'store_var_next_arg', $var{$var});
+ op_slot_usage($op, $var{$var});
+ push(@code, $op);
} elsif ($type ne '') {
push(@code, &make_op('', 'store_type', "TAG_$type"));
if ($type_val) {
@@ -1744,6 +1693,10 @@ sub tr_gen_to {
push(@code, make_op('', 'end'))
unless is_instr($code[$#code], 'call_end');
+ tr_maybe_keep(\@code);
+ tr_maybe_rename(\@code);
+ tr_remove_unused(\@code);
+
#
# Chain together all codes segments having the same first operation.
#
@@ -1752,8 +1705,6 @@ sub tr_gen_to {
my($dummy, $arity);
($dummy, $op, $arity) = @$first;
my($comment) = "\n/*\n * Line $line:\n * $orig_transform\n */\n\n";
- $min_window{$key} = $min_window
- if $min_window{$key} > $min_window;
my $prev_last;
$prev_last = pop(@{$gen_transform{$key}})
@@ -1771,6 +1722,148 @@ sub tr_gen_to {
push(@{$gen_transform{$key}}, @code),
}
+sub tr_maybe_keep {
+ my($ref) = @_;
+ my @last_instr;
+ my $pos;
+ my $reused_instr;
+
+ for (my $i = 0; $i < @$ref; $i++) {
+ my $instr = $$ref[$i];
+ my($size, $instr_ref, $comment) = @$instr;
+ my($op, @args) = @$instr_ref;
+ if ($op eq 'next_instr') {
+ @last_instr = ($args[0]);
+ } elsif ($op eq 'set_var_next_arg') {
+ push @last_instr, $args[0];
+ } elsif ($op eq 'next_arg') {
+ push @last_instr, 'ignored';
+ } elsif ($op eq 'new_instr') {
+ unless (defined $pos) {
+ # 'new_instr' immediately after 'commit'.
+ $reused_instr = $args[0];
+ return unless shift(@last_instr) == $reused_instr;
+ $pos = $i - 1;
+ } else {
+ # Second 'new_instr' after 'commit'. The instructions
+ # from $pos up to and including $i - 1 rebuilds the
+ # existing instruction exactly.
+ my $name = $gen_opname[$reused_instr];
+ my $arity = $gen_arity[$reused_instr];
+ my $reuse = make_op("$name/$arity", 'keep');
+ splice @$ref, $pos, $i-$pos, ($reuse);
+ return;
+ }
+ } elsif ($op eq 'store_var_next_arg') {
+ return unless shift(@last_instr) eq $args[0];
+ } elsif (defined $pos) {
+ return;
+ }
+ }
+}
+
+sub tr_maybe_rename {
+ my($ref) = @_;
+ my $s = 'left';
+ my $a = 0;
+ my $num_args = 0;
+ my $new_instr;
+ my $first;
+ my $i;
+
+ for ($i = 1; $i < @$ref; $i++) {
+ my $instr = $$ref[$i];
+ my($size, $instr_ref, $comment) = @$instr;
+ my($op, @args) = @$instr_ref;
+
+ if ($s eq 'left') {
+ if ($op eq 'set_var_next_arg') {
+ if ($num_args == $a and $args[0] == $a) {
+ $num_args++;
+ }
+ $a++;
+ } elsif ($op eq 'next_arg') {
+ $a++;
+ } elsif ($op eq 'commit') {
+ $a = 0;
+ $first = $i;
+ $s = 'committed';
+ } elsif ($op eq 'next_instr') {
+ return;
+ }
+ } elsif ($s eq 'committed') {
+ if ($op eq 'new_instr') {
+ $new_instr = $args[0];
+ $a = 0;
+ $s = 'right';
+ } else {
+ return;
+ }
+ } elsif ($s eq 'right') {
+ if ($op eq 'store_var_next_arg' && $args[0] == $a) {
+ $a++;
+ } elsif ($op eq 'end' && $a <= $num_args) {
+ my $name = $gen_opname[$new_instr];
+ my $arity = $gen_arity[$new_instr];
+ my $new_op = make_op("$name/$arity", 'rename', $new_instr);
+ splice @$ref, $first, $i-$first+1, ($new_op);
+ return;
+ } else {
+ return;
+ }
+ }
+ }
+}
+
+sub tr_remove_unused {
+ my($ref) = @_;
+ my %used;
+
+ # Collect all used variables.
+ for my $instr (@$ref) {
+ my $uref = $$instr[3];
+ for my $slot (@$uref) {
+ $used{$slot} = 1;
+ }
+ }
+
+ # Replace 'set_var_next_arg' with 'next_arg' if the variable
+ # is never used.
+ for my $instr (@$ref) {
+ my($size, $instr_ref, $comment) = @$instr;
+ my($op, @args) = @$instr_ref;
+ if ($op eq 'set_var_next_arg') {
+ my $var = $args[0];
+ next if $used{$var};
+ $instr = make_op("$comment (ignored)", 'next_arg');
+ }
+ }
+
+ # Delete a sequence of 'next_arg' instructions when they are
+ # redundant before instructions such as 'commit'.
+ my @opcode;
+ my %ending = (call_end => 1,
+ commit => 1,
+ next_instr => 1,
+ pred => 1,
+ rename => 1,
+ keep => 1);
+ for (my $i = 0; $i < @$ref; $i++) {
+ my $instr = $$ref[$i];
+ my($size, $instr_ref, $comment) = @$instr;
+ my($opcode) = @$instr_ref;
+
+ if ($ending{$opcode}) {
+ my $first = $i;
+ $first-- while $first > 0 and $opcode[$first-1] eq 'next_arg';
+ my $n = $i - $first;
+ splice @$ref, $first, $n;
+ $i -= $n;
+ }
+ $opcode[$i] = $opcode;
+ }
+}
+
sub tr_code_len {
my($sum) = 0;
my($ref);
@@ -1783,7 +1876,12 @@ sub tr_code_len {
sub make_op {
my($comment, @op) = @_;
- [scalar(@op), [@op], $comment];
+ [scalar(@op), [@op], $comment, []];
+}
+
+sub op_slot_usage {
+ my($op_ref, @slots) = @_;
+ $$op_ref[3] = \@slots;
}
sub is_instr {
diff --git a/erts/emulator/utils/beam_strip b/erts/emulator/utils/beam_strip
index 0e7bc46b63..2a2d761940 100755
--- a/erts/emulator/utils/beam_strip
+++ b/erts/emulator/utils/beam_strip
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/utils/count b/erts/emulator/utils/count
index c4dd42c949..e0a5e8bb9a 100755
--- a/erts/emulator/utils/count
+++ b/erts/emulator/utils/count
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/utils/loaded b/erts/emulator/utils/loaded
index ab77ffdb6c..5e0a29c014 100644
--- a/erts/emulator/utils/loaded
+++ b/erts/emulator/utils/loaded
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/emulator/utils/make_alloc_types b/erts/emulator/utils/make_alloc_types
index 925b9d5810..33afe139a2 100755
--- a/erts/emulator/utils/make_alloc_types
+++ b/erts/emulator/utils/make_alloc_types
@@ -3,7 +3,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2009. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/utils/make_compiler_flags b/erts/emulator/utils/make_compiler_flags
index d75ea0817e..47491a4832 100755
--- a/erts/emulator/utils/make_compiler_flags
+++ b/erts/emulator/utils/make_compiler_flags
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/utils/make_driver_tab b/erts/emulator/utils/make_driver_tab
index 3203c7110a..ffb5f58ebf 100755
--- a/erts/emulator/utils/make_driver_tab
+++ b/erts/emulator/utils/make_driver_tab
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2013. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@ my $file = "";
my $nif = "";
my @emu_drivers = ();
my @static_drivers = ();
-my @nifs = ();
+my @static_nifs = ();
my $mode = 1;
while (@ARGV) {
@@ -55,9 +55,14 @@ while (@ARGV) {
push(@static_drivers, $d);
}
if ($mode == 2) {
- push(@nifs, $d);
+ push(@static_nifs, $d);
}
next;
+ } elsif ($mode == 2) {
+ $d = basename $d;
+ $d =~ s/_nif(\..*|)$//; # strip nif.* or just nif
+ push(@static_nifs, $d);
+ next;
}
$d = basename $d;
$d =~ s/drv(\..*|)$//; # strip drv.* or just drv
@@ -120,7 +125,7 @@ typedef struct ErtsStaticNifEntry_ {
EOF
# prototypes
-foreach (@nifs) {
+foreach (@static_nifs) {
my $d = ${_};
$d =~ s/\.debug//; # strip .debug
print "void *".$d."_nif_init(void);\n";
@@ -129,7 +134,7 @@ foreach (@nifs) {
# The array itself
print "static ErtsStaticNifEntry static_nif_tab[] =\n{\n";
-foreach (@nifs) {
+foreach (@static_nifs) {
my $d = ${_};
$d =~ s/\.debug//; # strip .debug
print "{\"${_}\",&".$d."_nif_init},\n";
diff --git a/erts/emulator/utils/make_preload b/erts/emulator/utils/make_preload
index 62c4419589..f489bc2a39 100755
--- a/erts/emulator/utils/make_preload
+++ b/erts/emulator/utils/make_preload
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/utils/make_tables b/erts/emulator/utils/make_tables
index 233e95f176..c158778f43 100755
--- a/erts/emulator/utils/make_tables
+++ b/erts/emulator/utils/make_tables
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2013. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/utils/make_version b/erts/emulator/utils/make_version
index 37bdff181a..e02a42c66d 100755
--- a/erts/emulator/utils/make_version
+++ b/erts/emulator/utils/make_version
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/emulator/utils/mkver.c b/erts/emulator/utils/mkver.c
index 6641873712..6183246433 100644
--- a/erts/emulator/utils/mkver.c
+++ b/erts/emulator/utils/mkver.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/emulator/zlib/zlib.mk b/erts/emulator/zlib/zlib.mk
index 53d7badd64..3f0d64d250 100644
--- a/erts/emulator/zlib/zlib.mk
+++ b/erts/emulator/zlib/zlib.mk
@@ -4,7 +4,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2011-2012. All Rights Reserved.
+# Copyright Ericsson AB 2011-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/epmd/Makefile b/erts/epmd/Makefile
index 25a33462ee..d3308ddedc 100644
--- a/erts/epmd/Makefile
+++ b/erts/epmd/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2009. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/epmd/epmd.mk b/erts/epmd/epmd.mk
index 08245b784e..b1fd04dc04 100644
--- a/erts/epmd/epmd.mk
+++ b/erts/epmd/epmd.mk
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2009. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/epmd/src/Makefile b/erts/epmd/src/Makefile
index 3e09a40566..4ae13fe05a 100644
--- a/erts/epmd/src/Makefile
+++ b/erts/epmd/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2009. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/epmd/src/Makefile.in b/erts/epmd/src/Makefile.in
index 1266be44cb..da4370d5f9 100644
--- a/erts/epmd/src/Makefile.in
+++ b/erts/epmd/src/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2012. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/epmd/src/epmd.c b/erts/epmd/src/epmd.c
index 324ae6ac40..44e997e609 100644
--- a/erts/epmd/src/epmd.c
+++ b/erts/epmd/src/epmd.c
@@ -2,7 +2,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -592,8 +592,10 @@ void epmd_cleanup_exit(EpmdVars *g, int exitval)
free(g->argv);
}
#ifdef HAVE_SYSTEMD_DAEMON
- sd_notifyf(0, "STATUS=Exited.\n"
- "ERRNO=%i", exitval);
+ if (g->is_systemd){
+ sd_notifyf(0, "STATUS=Exited.\n"
+ "ERRNO=%i", exitval);
+ }
#endif /* HAVE_SYSTEMD_DAEMON */
exit(exitval);
}
diff --git a/erts/epmd/src/epmd.h b/erts/epmd/src/epmd.h
index 10483bb5a2..cffcd4ae7a 100644
--- a/erts/epmd/src/epmd.h
+++ b/erts/epmd/src/epmd.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2010. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/epmd/src/epmd_cli.c b/erts/epmd/src/epmd_cli.c
index 6fc05e153e..6fd27d46ea 100644
--- a/erts/epmd/src/epmd_cli.c
+++ b/erts/epmd/src/epmd_cli.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/epmd/src/epmd_int.h b/erts/epmd/src/epmd_int.h
index e127eff097..ed9bbdb8cd 100644
--- a/erts/epmd/src/epmd_int.h
+++ b/erts/epmd/src/epmd_int.h
@@ -2,7 +2,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -237,8 +237,8 @@ static const struct in6_addr in6addr_loopback =
#define EPMD_TRUE 1
/* If no activity we let select() return every IDLE_TIMEOUT second
- A file descriptor that are idle for CLOSE_TIMEOUT seconds and
- isn't a ALIVE socket is probably hanging and we close it */
+ A file descriptor that has been idle for CLOSE_TIMEOUT seconds and
+ isn't an ALIVE socket has probably hanged and should be closed */
#define IDLE_TIMEOUT 5
#define CLOSE_TIMEOUT 60
diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c
index 75a33f28cb..66c10a65bc 100644
--- a/erts/epmd/src/epmd_srv.c
+++ b/erts/epmd/src/epmd_srv.c
@@ -2,7 +2,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -447,9 +447,11 @@ void run(EpmdVars *g)
num_sockets = bound;
#ifdef HAVE_SYSTEMD_DAEMON
}
- sd_notifyf(0, "READY=1\n"
- "STATUS=Processing port mapping requests...\n"
- "MAINPID=%lu", (unsigned long) getpid());
+ if (g->is_systemd) {
+ sd_notifyf(0, "READY=1\n"
+ "STATUS=Processing port mapping requests...\n"
+ "MAINPID=%lu", (unsigned long) getpid());
+ }
#endif /* HAVE_SYSTEMD_DAEMON */
dbg_tty_printf(g,2,"entering the main select() loop");
diff --git a/erts/epmd/test/Makefile b/erts/epmd/test/Makefile
index 7c5302a2f1..ad1315440f 100644
--- a/erts/epmd/test/Makefile
+++ b/erts/epmd/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2012. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/epmd/test/epmd_SUITE.erl b/erts/epmd/test/epmd_SUITE.erl
index 44d3c5a880..763984267a 100644
--- a/erts/epmd/test/epmd_SUITE.erl
+++ b/erts/epmd/test/epmd_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/etc/Makefile b/erts/etc/Makefile
index 9a14cee89c..788dfff132 100644
--- a/erts/etc/Makefile
+++ b/erts/etc/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/common/Makefile b/erts/etc/common/Makefile
index bbf51d0efd..bad1d3ddb0 100644
--- a/erts/etc/common/Makefile
+++ b/erts/etc/common/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/common/Makefile.in b/erts/etc/common/Makefile.in
index 05d925f19f..cb053a1b7c 100644
--- a/erts/etc/common/Makefile.in
+++ b/erts/etc/common/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2014. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/common/ct_run.c b/erts/etc/common/ct_run.c
index 548514ee6c..acdfa8c8b8 100644
--- a/erts/etc/common/ct_run.c
+++ b/erts/etc/common/ct_run.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -81,13 +81,14 @@ static int eargc; /* Number of arguments in eargv. */
*/
static void error(char* format, ...);
-static char* emalloc(size_t size);
+static void* emalloc(size_t size);
static char* strsave(char* string);
static void push_words(char* src);
static int run_erlang(char* name, char** argv);
static char* get_default_emulator(char* progname);
#ifdef __WIN32__
static char* possibly_quote(char* arg);
+static void* erealloc(void *p, size_t size);
#endif
/*
@@ -141,10 +142,10 @@ int main(int argc, char** argv)
int i;
int len;
/* Convert argv to utf8 */
- argv = malloc((argc+1) * sizeof(char*));
+ argv = emalloc((argc+1) * sizeof(char*));
for (i=0; i<argc; i++) {
len = WideCharToMultiByte(CP_UTF8, 0, wcargv[i], -1, NULL, 0, NULL, NULL);
- argv[i] = malloc(len*sizeof(char));
+ argv[i] = emalloc(len*sizeof(char));
WideCharToMultiByte(CP_UTF8, 0, wcargv[i], -1, argv[i], len, NULL, NULL);
}
argv[argc] = NULL;
@@ -334,7 +335,7 @@ wchar_t *make_commandline(char **argv)
buff = (wchar_t *) emalloc(siz*sizeof(wchar_t));
} else if (siz < num) {
siz = num;
- buff = (wchar_t *) realloc(buff,siz*sizeof(wchar_t));
+ buff = (wchar_t *) erealloc(buff,siz*sizeof(wchar_t));
}
p = buff;
num=0;
@@ -437,15 +438,26 @@ error(char* format, ...)
exit(1);
}
-static char*
+static void*
emalloc(size_t size)
{
- char *p = malloc(size);
+ void *p = malloc(size);
if (p == NULL)
error("Insufficient memory");
return p;
}
+#ifdef __WIN32__
+static void *
+erealloc(void *p, size_t size)
+{
+ void *res = realloc(p, size);
+ if (res == NULL)
+ error("Insufficient memory");
+ return res;
+}
+#endif
+
static char*
strsave(char* string)
{
diff --git a/erts/etc/common/dialyzer.c b/erts/etc/common/dialyzer.c
index c45626606c..6ba3605422 100644
--- a/erts/etc/common/dialyzer.c
+++ b/erts/etc/common/dialyzer.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -63,13 +63,14 @@ static int eargc; /* Number of arguments in eargv. */
*/
static void error(char* format, ...);
-static char* emalloc(size_t size);
+static void* emalloc(size_t size);
static char* strsave(char* string);
static void push_words(char* src);
static int run_erlang(char* name, char** argv);
static char* get_default_emulator(char* progname);
#ifdef __WIN32__
static char* possibly_quote(char* arg);
+static void* erealloc(void *p, size_t size);
#endif
/*
@@ -164,10 +165,10 @@ int main(int argc, char** argv)
#ifdef __WIN32__
int len;
/* Convert argv to utf8 */
- argv = malloc((argc+1) * sizeof(char*));
+ argv = emalloc((argc+1) * sizeof(char*));
for (i=0; i<argc; i++) {
len = WideCharToMultiByte(CP_UTF8, 0, wcargv[i], -1, NULL, 0, NULL, NULL);
- argv[i] = malloc(len*sizeof(char));
+ argv[i] = emalloc(len*sizeof(char));
WideCharToMultiByte(CP_UTF8, 0, wcargv[i], -1, argv[i], len, NULL, NULL);
}
argv[argc] = NULL;
@@ -310,7 +311,7 @@ wchar_t *make_commandline(char **argv)
buff = (wchar_t *) emalloc(siz*sizeof(wchar_t));
} else if (siz < num) {
siz = num;
- buff = (wchar_t *) realloc(buff,siz*sizeof(wchar_t));
+ buff = (wchar_t *) erealloc(buff,siz*sizeof(wchar_t));
}
p = buff;
num=0;
@@ -413,15 +414,26 @@ error(char* format, ...)
exit(1);
}
-static char*
+static void*
emalloc(size_t size)
{
- char *p = malloc(size);
+ void *p = malloc(size);
if (p == NULL)
error("Insufficient memory");
return p;
}
+#ifdef __WIN32__
+static void *
+erealloc(void *p, size_t size)
+{
+ void *res = realloc(p, size);
+ if (res == NULL)
+ error("Insufficient memory");
+ return res;
+}
+#endif
+
static char*
strsave(char* string)
{
diff --git a/erts/etc/common/erlc.c b/erts/etc/common/erlc.c
index f9d909e01c..b54cb31bef 100644
--- a/erts/etc/common/erlc.c
+++ b/erts/etc/common/erlc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -71,13 +71,14 @@ static int pause_after_execution = 0;
static char* process_opt(int* pArgc, char*** pArgv, int offset);
static void error(char* format, ...);
-static char* emalloc(size_t size);
+static void* emalloc(size_t size);
static char* strsave(char* string);
static void push_words(char* src);
static int run_erlang(char* name, char** argv);
static char* get_default_emulator(char* progname);
#ifdef __WIN32__
static char* possibly_quote(char* arg);
+static void* erealloc(void *p, size_t size);
#endif
/*
@@ -171,10 +172,10 @@ int main(int argc, char** argv)
int i;
int len;
/* Convert argv to utf8 */
- argv = malloc((argc+1) * sizeof(char*));
+ argv = emalloc((argc+1) * sizeof(char*));
for (i=0; i<argc; i++) {
len = WideCharToMultiByte(CP_UTF8, 0, wcargv[i], -1, NULL, 0, NULL, NULL);
- argv[i] = malloc(len*sizeof(char));
+ argv[i] = emalloc(len*sizeof(char));
WideCharToMultiByte(CP_UTF8, 0, wcargv[i], -1, argv[i], len, NULL, NULL);
}
argv[argc] = NULL;
@@ -370,7 +371,7 @@ wchar_t *make_commandline(char **argv)
buff = (wchar_t *) emalloc(siz*sizeof(wchar_t));
} else if (siz < num) {
siz = num;
- buff = (wchar_t *) realloc(buff,siz*sizeof(wchar_t));
+ buff = (wchar_t *) erealloc(buff,siz*sizeof(wchar_t));
}
p = buff;
num=0;
@@ -478,15 +479,26 @@ error(char* format, ...)
exit(1);
}
-static char*
+static void*
emalloc(size_t size)
{
- char *p = malloc(size);
+ void *p = malloc(size);
if (p == NULL)
error("Insufficient memory");
return p;
}
+#ifdef __WIN32__
+static void *
+erealloc(void *p, size_t size)
+{
+ void *res = realloc(p, size);
+ if (res == NULL)
+ error("Insufficient memory");
+ return res;
+}
+#endif
+
static char*
strsave(char* string)
{
diff --git a/erts/etc/common/erlexec.c b/erts/etc/common/erlexec.c
index 54da59e50d..5a5021b003 100644
--- a/erts/etc/common/erlexec.c
+++ b/erts/etc/common/erlexec.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -74,6 +74,7 @@ static const char plusM_au_allocs[]= {
'R', /* driver_alloc */
'S', /* sl_alloc */
'T', /* temp_alloc */
+ 'X', /* exec_alloc */
'Z', /* test_alloc */
'\0'
};
@@ -123,6 +124,7 @@ static char *plusM_other_switches[] = {
"Ytp",
"Ytt",
"Iscs",
+ "Xscs",
NULL
};
@@ -148,6 +150,7 @@ static char *plush_val_switches[] = {
"ms",
"mbs",
"pds",
+ "mqd",
"",
NULL
};
@@ -158,12 +161,6 @@ static char *plusr_val_switches[] = {
NULL
};
-/* +x arguments with values */
-static char *plusx_val_switches[] = {
- "mqd",
- NULL
-};
-
/* +z arguments with values */
static char *plusz_val_switches[] = {
"dbbl",
@@ -984,20 +981,6 @@ int main(int argc, char **argv)
add_Eargs(argv[i+1]);
i++;
break;
- case 'x':
- if (!is_one_of_strings(&argv[i][2], plusx_val_switches)) {
- goto the_default;
- } else {
- if (i+1 >= argc
- || argv[i+1][0] == '-'
- || argv[i+1][0] == '+')
- usage(argv[i]);
- argv[i][0] = '-';
- add_Eargs(argv[i]);
- add_Eargs(argv[i+1]);
- i++;
- }
- break;
case 'z':
if (!is_one_of_strings(&argv[i][2], plusz_val_switches)) {
goto the_default;
@@ -1198,7 +1181,7 @@ usage_aux(void)
"[+S NO_SCHEDULERS:NO_SCHEDULERS_ONLINE] "
"[+SP PERCENTAGE_SCHEDULERS:PERCENTAGE_SCHEDULERS_ONLINE] "
"[+T LEVEL] [+V] [+v] "
- "[+W<i|w|e>] [+x DEFAULT_PROC_FLAGS] [+z MISC_OPTION] [args ...]\n");
+ "[+W<i|w|e>] [+z MISC_OPTION] [args ...]\n");
exit(1);
}
diff --git a/erts/etc/common/escript.c b/erts/etc/common/escript.c
index 7fd02ed436..71c278881c 100644
--- a/erts/etc/common/escript.c
+++ b/erts/etc/common/escript.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2007-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -71,7 +71,7 @@ static int eargc; /* Number of arguments in eargv. */
*/
static void error(char* format, ...);
-static char* emalloc(size_t size);
+static void* emalloc(size_t size);
static void efree(void *p);
static char* strsave(char* string);
static void push_words(char* src);
@@ -79,6 +79,7 @@ static int run_erlang(char* name, char** argv);
static char* get_default_emulator(char* progname);
#ifdef __WIN32__
static char* possibly_quote(char* arg);
+static void* erealloc(void *p, size_t size);
#endif
/*
@@ -418,10 +419,10 @@ main(int argc, char** argv)
int i;
int len;
/* Convert argv to utf8 */
- argv = malloc((argc+1) * sizeof(char*));
+ argv = emalloc((argc+1) * sizeof(char*));
for (i=0; i<argc; i++) {
len = WideCharToMultiByte(CP_UTF8, 0, wcargv[i], -1, NULL, 0, NULL, NULL);
- argv[i] = malloc(len*sizeof(char));
+ argv[i] = emalloc(len*sizeof(char));
WideCharToMultiByte(CP_UTF8, 0, wcargv[i], -1, argv[i], len, NULL, NULL);
}
argv[argc] = NULL;
@@ -594,7 +595,7 @@ wchar_t *make_commandline(char **argv)
buff = (wchar_t *) emalloc(siz*sizeof(wchar_t));
} else if (siz < num) {
siz = num;
- buff = (wchar_t *) realloc(buff,siz*sizeof(wchar_t));
+ buff = (wchar_t *) erealloc(buff,siz*sizeof(wchar_t));
}
p = buff;
num=0;
@@ -694,15 +695,26 @@ error(char* format, ...)
exit(1);
}
-static char*
+static void*
emalloc(size_t size)
{
- char *p = malloc(size);
+ void *p = malloc(size);
if (p == NULL)
error("Insufficient memory");
return p;
}
+#ifdef __WIN32__
+static void *
+erealloc(void *p, size_t size)
+{
+ void *res = realloc(p, size);
+ if (res == NULL)
+ error("Insufficient memory");
+ return res;
+}
+#endif
+
static void
efree(void *p)
{
diff --git a/erts/etc/common/heart.c b/erts/etc/common/heart.c
index 1a826221fb..e931ae4641 100644
--- a/erts/etc/common/heart.c
+++ b/erts/etc/common/heart.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/common/inet_gethost.c b/erts/etc/common/inet_gethost.c
index e298c5e7f7..bc4893b0eb 100644
--- a/erts/etc/common/inet_gethost.c
+++ b/erts/etc/common/inet_gethost.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2012. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -2646,7 +2646,7 @@ static void *my_realloc(void *old, size_t size)
BOOL create_mesq(MesQ **q)
{
- MesQ *tmp = malloc(sizeof(MesQ));
+ MesQ *tmp = ALLOC(sizeof(MesQ));
tmp->data_present = CreateEvent(NULL, TRUE, FALSE,NULL);
if (tmp->data_present == NULL) {
free(tmp);
diff --git a/erts/etc/common/typer.c b/erts/etc/common/typer.c
index 0aa0996808..77a95ccded 100644
--- a/erts/etc/common/typer.c
+++ b/erts/etc/common/typer.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -63,13 +63,14 @@ static int eargc; /* Number of arguments in eargv. */
*/
static void error(char* format, ...);
-static char* emalloc(size_t size);
+static void* emalloc(size_t size);
static char* strsave(char* string);
static void push_words(char* src);
static int run_erlang(char* name, char** argv);
static char* get_default_emulator(char* progname);
#ifdef __WIN32__
static char* possibly_quote(char* arg);
+static void* erealloc(void *p, size_t size);
#endif
/*
@@ -118,10 +119,10 @@ main(int argc, char** argv)
int i;
int len;
/* Convert argv to utf8 */
- argv = malloc((argc+1) * sizeof(char*));
+ argv = emalloc((argc+1) * sizeof(char*));
for (i=0; i<argc; i++) {
len = WideCharToMultiByte(CP_UTF8, 0, wcargv[i], -1, NULL, 0, NULL, NULL);
- argv[i] = malloc(len*sizeof(char));
+ argv[i] = emalloc(len*sizeof(char));
WideCharToMultiByte(CP_UTF8, 0, wcargv[i], -1, argv[i], len, NULL, NULL);
}
argv[argc] = NULL;
@@ -232,7 +233,7 @@ wchar_t *make_commandline(char **argv)
buff = (wchar_t *) emalloc(siz*sizeof(wchar_t));
} else if (siz < num) {
siz = num;
- buff = (wchar_t *) realloc(buff,siz*sizeof(wchar_t));
+ buff = (wchar_t *) erealloc(buff,siz*sizeof(wchar_t));
}
p = buff;
num=0;
@@ -332,15 +333,26 @@ error(char* format, ...)
exit(1);
}
-static char*
+static void*
emalloc(size_t size)
{
- char *p = malloc(size);
+ void *p = malloc(size);
if (p == NULL)
error("Insufficient memory");
return p;
}
+#ifdef __WIN32__
+static void *
+erealloc(void *p, size_t size)
+{
+ void *res = realloc(p, size);
+ if (res == NULL)
+ error("Insufficient memory");
+ return res;
+}
+#endif
+
static char*
strsave(char* string)
{
diff --git a/erts/etc/unix/Install.src b/erts/etc/unix/Install.src
index 6634ae31d3..e71308edbe 100644
--- a/erts/etc/unix/Install.src
+++ b/erts/etc/unix/Install.src
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2013. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/unix/Makefile b/erts/etc/unix/Makefile
index 04ae11de3b..2fa9cd047b 100644
--- a/erts/etc/unix/Makefile
+++ b/erts/etc/unix/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2013. All Rights Reserved.
+# Copyright Ericsson AB 2013-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/unix/README b/erts/etc/unix/README
index 6bda610a03..adc6db4300 100644
--- a/erts/etc/unix/README
+++ b/erts/etc/unix/README
@@ -1,7 +1,7 @@
%CopyrightBegin%
- Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ Copyright Ericsson AB 1996-2016. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/erts/etc/unix/RELNOTES b/erts/etc/unix/RELNOTES
index 629867d2ae..7b4a1746fe 100644
--- a/erts/etc/unix/RELNOTES
+++ b/erts/etc/unix/RELNOTES
@@ -1,7 +1,7 @@
%CopyrightBegin%
- Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ Copyright Ericsson AB 1996-2016. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/erts/etc/unix/cerl.src b/erts/etc/unix/cerl.src
index 2a806bb2f1..c5422ab2ed 100644
--- a/erts/etc/unix/cerl.src
+++ b/erts/etc/unix/cerl.src
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2013. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/unix/dyn_erl.c b/erts/etc/unix/dyn_erl.c
index 4eebfae50a..d6d2201648 100644
--- a/erts/etc/unix/dyn_erl.c
+++ b/erts/etc/unix/dyn_erl.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/unix/erl.src.src b/erts/etc/unix/erl.src.src
index 94c6f9f854..959c099e8f 100644
--- a/erts/etc/unix/erl.src.src
+++ b/erts/etc/unix/erl.src.src
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2012. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/unix/etp-commands.in b/erts/etc/unix/etp-commands.in
index 7b554e71f2..4dc24d68b4 100644
--- a/erts/etc/unix/etp-commands.in
+++ b/erts/etc/unix/etp-commands.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2014. All Rights Reserved.
+# Copyright Ericsson AB 2005-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -776,7 +776,7 @@ define etp-pid-1
if ($etp_pid_1 & 0xF) == 0x3
if (etp_arch_bits == 64)
if (etp_big_endian)
- set $etp_pid_data = (unsigned) ((((Uint64) $etp_pid_1) >> 36) & 0x0fffffff)
+ set $etp_pid_data = (unsigned) ((((Uint64) $etp_pid_1) >> 35) & 0x0fffffff)
else
set $etp_pid_data = (unsigned) ((((Uint64) $etp_pid_1) >> 4) & 0x0fffffff)
end
diff --git a/erts/etc/unix/etp-thr.py b/erts/etc/unix/etp-thr.py
index 16bc7f4016..fb82dcaf1f 100644
--- a/erts/etc/unix/etp-thr.py
+++ b/erts/etc/unix/etp-thr.py
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2013. All Rights Reserved.
+# Copyright Ericsson AB 2013-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/unix/etp_commands.erl b/erts/etc/unix/etp_commands.erl
index fe16a71876..fe8f2dd556 100644
--- a/erts/etc/unix/etp_commands.erl
+++ b/erts/etc/unix/etp_commands.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/etc/unix/etp_commands.mk b/erts/etc/unix/etp_commands.mk
index def6f7bda0..983ee9f919 100644
--- a/erts/etc/unix/etp_commands.mk
+++ b/erts/etc/unix/etp_commands.mk
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2009. All Rights Reserved.
+# Copyright Ericsson AB 2005-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/unix/format_man_pages b/erts/etc/unix/format_man_pages
index 7abe65cecb..54f2d90c28 100644
--- a/erts/etc/unix/format_man_pages
+++ b/erts/etc/unix/format_man_pages
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2010. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/unix/run_erl.c b/erts/etc/unix/run_erl.c
index 22302d539a..30210ac172 100644
--- a/erts/etc/unix/run_erl.c
+++ b/erts/etc/unix/run_erl.c
@@ -43,10 +43,10 @@
#endif
#ifdef HAVE_WORKING_POSIX_OPENPT
# ifndef _XOPEN_SOURCE
- /* On OS X, we must leave _XOPEN_SOURCE undefined in order for
+ /* On OS X and BSD, we must leave _XOPEN_SOURCE undefined in order for
* the prototype of vsyslog() to be included.
*/
-# ifndef __APPLE__
+# if !(defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__))
# define _XOPEN_SOURCE 600
# endif
# endif
@@ -69,10 +69,6 @@
#include <termios.h>
#include <time.h>
-#ifdef __ANDROID__
-# include <termios.h>
-#endif
-
#ifdef HAVE_SYSLOG_H
# include <syslog.h>
#endif
@@ -82,6 +78,9 @@
#ifdef HAVE_UTMP_H
# include <utmp.h>
#endif
+#ifdef HAVE_LIBUTIL_H
+# include <libutil.h>
+#endif
#ifdef HAVE_UTIL_H
# include <util.h>
#endif
diff --git a/erts/etc/unix/run_erl.h b/erts/etc/unix/run_erl.h
index cc70a98e52..83bdfdfb19 100644
--- a/erts/etc/unix/run_erl.h
+++ b/erts/etc/unix/run_erl.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/unix/safe_string.c b/erts/etc/unix/safe_string.c
index a5c11d41d8..666022dc61 100644
--- a/erts/etc/unix/safe_string.c
+++ b/erts/etc/unix/safe_string.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/unix/safe_string.h b/erts/etc/unix/safe_string.h
index 5a471f10de..cafd3fc71a 100644
--- a/erts/etc/unix/safe_string.h
+++ b/erts/etc/unix/safe_string.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/unix/setuid_socket_wrap.c b/erts/etc/unix/setuid_socket_wrap.c
index 59ed8eae6f..461c69ee3e 100644
--- a/erts/etc/unix/setuid_socket_wrap.c
+++ b/erts/etc/unix/setuid_socket_wrap.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/unix/start.src b/erts/etc/unix/start.src
index 377f5e85c8..bdd146951f 100644
--- a/erts/etc/unix/start.src
+++ b/erts/etc/unix/start.src
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/unix/start_erl.src b/erts/etc/unix/start_erl.src
index b889101783..34e0369710 100644
--- a/erts/etc/unix/start_erl.src
+++ b/erts/etc/unix/start_erl.src
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/Install.c b/erts/etc/win32/Install.c
index 82bae947d4..43930ff284 100644
--- a/erts/etc/win32/Install.c
+++ b/erts/etc/win32/Install.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/Makefile b/erts/etc/win32/Makefile
index 12c04fc9a5..c6376ebe74 100644
--- a/erts/etc/win32/Makefile
+++ b/erts/etc/win32/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2012. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/Nmakefile.start_erl b/erts/etc/win32/Nmakefile.start_erl
index cf83713bab..00d22461fb 100644
--- a/erts/etc/win32/Nmakefile.start_erl
+++ b/erts/etc/win32/Nmakefile.start_erl
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2009. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/beam.rc b/erts/etc/win32/beam.rc
index 9e137ecd62..0aaabf1097 100644
--- a/erts/etc/win32/beam.rc
+++ b/erts/etc/win32/beam.rc
@@ -1,7 +1,7 @@
//
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2009. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/erl b/erts/etc/win32/cygwin_tools/erl
index 51a7be5584..897bbfac87 100755
--- a/erts/etc/win32/cygwin_tools/erl
+++ b/erts/etc/win32/cygwin_tools/erl
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2009. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/erlc b/erts/etc/win32/cygwin_tools/erlc
index 588b53b1be..eda9fdb7fc 100755
--- a/erts/etc/win32/cygwin_tools/erlc
+++ b/erts/etc/win32/cygwin_tools/erlc
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2009. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/javac.sh b/erts/etc/win32/cygwin_tools/javac.sh
index f2f97ef152..f53e5a3cc6 100755
--- a/erts/etc/win32/cygwin_tools/javac.sh
+++ b/erts/etc/win32/cygwin_tools/javac.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2009. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/make_bootstrap_ini.sh b/erts/etc/win32/cygwin_tools/make_bootstrap_ini.sh
index 0f87f3d077..377c0dda6c 100755
--- a/erts/etc/win32/cygwin_tools/make_bootstrap_ini.sh
+++ b/erts/etc/win32/cygwin_tools/make_bootstrap_ini.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2009. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/make_local_ini.sh b/erts/etc/win32/cygwin_tools/make_local_ini.sh
index 0bcb362ffe..e5db98468b 100755
--- a/erts/etc/win32/cygwin_tools/make_local_ini.sh
+++ b/erts/etc/win32/cygwin_tools/make_local_ini.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2009. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/mingw/ar.sh b/erts/etc/win32/cygwin_tools/mingw/ar.sh
index 2ebfe4e435..de166284d8 100755
--- a/erts/etc/win32/cygwin_tools/mingw/ar.sh
+++ b/erts/etc/win32/cygwin_tools/mingw/ar.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2009. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/mingw/cc.sh b/erts/etc/win32/cygwin_tools/mingw/cc.sh
index 5993f70686..0b321a5099 100755
--- a/erts/etc/win32/cygwin_tools/mingw/cc.sh
+++ b/erts/etc/win32/cygwin_tools/mingw/cc.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2009. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/mingw/coffix.c b/erts/etc/win32/cygwin_tools/mingw/coffix.c
index 383c422008..ff3f3de3d1 100644
--- a/erts/etc/win32/cygwin_tools/mingw/coffix.c
+++ b/erts/etc/win32/cygwin_tools/mingw/coffix.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/mingw/emu_cc.sh b/erts/etc/win32/cygwin_tools/mingw/emu_cc.sh
index 8da91dd0ef..5f510467fe 100755
--- a/erts/etc/win32/cygwin_tools/mingw/emu_cc.sh
+++ b/erts/etc/win32/cygwin_tools/mingw/emu_cc.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2009. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/mingw/ld.sh b/erts/etc/win32/cygwin_tools/mingw/ld.sh
index 16caf0b6d2..8b7e1a54c4 100755
--- a/erts/etc/win32/cygwin_tools/mingw/ld.sh
+++ b/erts/etc/win32/cygwin_tools/mingw/ld.sh
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2009. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/mingw/mc.sh b/erts/etc/win32/cygwin_tools/mingw/mc.sh
index 4462bfc5d3..8228f8699e 100755
--- a/erts/etc/win32/cygwin_tools/mingw/mc.sh
+++ b/erts/etc/win32/cygwin_tools/mingw/mc.sh
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2009. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/mingw/rc.sh b/erts/etc/win32/cygwin_tools/mingw/rc.sh
index b8a2d2fbcf..de1b15a432 100755
--- a/erts/etc/win32/cygwin_tools/mingw/rc.sh
+++ b/erts/etc/win32/cygwin_tools/mingw/rc.sh
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2009. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/vc/ar.sh b/erts/etc/win32/cygwin_tools/vc/ar.sh
index e0bd1bd5ca..0989cc878b 100755
--- a/erts/etc/win32/cygwin_tools/vc/ar.sh
+++ b/erts/etc/win32/cygwin_tools/vc/ar.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2009. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/vc/cc.sh b/erts/etc/win32/cygwin_tools/vc/cc.sh
index 651b6e098d..9eeb004f0e 100755
--- a/erts/etc/win32/cygwin_tools/vc/cc.sh
+++ b/erts/etc/win32/cygwin_tools/vc/cc.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2009. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/vc/cc_wrap.c b/erts/etc/win32/cygwin_tools/vc/cc_wrap.c
index b42e0e1037..198f3b5649 100644
--- a/erts/etc/win32/cygwin_tools/vc/cc_wrap.c
+++ b/erts/etc/win32/cygwin_tools/vc/cc_wrap.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/vc/coffix.c b/erts/etc/win32/cygwin_tools/vc/coffix.c
index 0633c6ddea..bf1096c425 100644
--- a/erts/etc/win32/cygwin_tools/vc/coffix.c
+++ b/erts/etc/win32/cygwin_tools/vc/coffix.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/vc/emu_cc.sh b/erts/etc/win32/cygwin_tools/vc/emu_cc.sh
index fb6ee2d7a2..343cd366a6 100755
--- a/erts/etc/win32/cygwin_tools/vc/emu_cc.sh
+++ b/erts/etc/win32/cygwin_tools/vc/emu_cc.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/vc/ld.sh b/erts/etc/win32/cygwin_tools/vc/ld.sh
index ff538122b2..2b7d7c6694 100755
--- a/erts/etc/win32/cygwin_tools/vc/ld.sh
+++ b/erts/etc/win32/cygwin_tools/vc/ld.sh
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2010. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/vc/ld_wrap.c b/erts/etc/win32/cygwin_tools/vc/ld_wrap.c
index 000c13befd..94b5c38751 100644
--- a/erts/etc/win32/cygwin_tools/vc/ld_wrap.c
+++ b/erts/etc/win32/cygwin_tools/vc/ld_wrap.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/vc/mc.sh b/erts/etc/win32/cygwin_tools/vc/mc.sh
index 2de5cbba9b..c88f2ff1a7 100755
--- a/erts/etc/win32/cygwin_tools/vc/mc.sh
+++ b/erts/etc/win32/cygwin_tools/vc/mc.sh
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2009. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/cygwin_tools/vc/rc.sh b/erts/etc/win32/cygwin_tools/vc/rc.sh
index 414ffa0448..286ebb03f0 100755
--- a/erts/etc/win32/cygwin_tools/vc/rc.sh
+++ b/erts/etc/win32/cygwin_tools/vc/rc.sh
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2010. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/erl.c b/erts/etc/win32/erl.c
index 59693955a5..b230aa6a40 100644
--- a/erts/etc/win32/erl.c
+++ b/erts/etc/win32/erl.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/erl.rc b/erts/etc/win32/erl.rc
index e8848e7969..772213ac86 100644
--- a/erts/etc/win32/erl.rc
+++ b/erts/etc/win32/erl.rc
@@ -1,7 +1,7 @@
//
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2009. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/erl_log.c b/erts/etc/win32/erl_log.c
index 2a873dffac..de0d8e39f0 100644
--- a/erts/etc/win32/erl_log.c
+++ b/erts/etc/win32/erl_log.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/erlsrv/erlsrv_global.h b/erts/etc/win32/erlsrv/erlsrv_global.h
index f535599cf1..fc6166fc7c 100644
--- a/erts/etc/win32/erlsrv/erlsrv_global.h
+++ b/erts/etc/win32/erlsrv/erlsrv_global.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/erlsrv/erlsrv_interactive.c b/erts/etc/win32/erlsrv/erlsrv_interactive.c
index d2236ac9f7..c616ef86e3 100644
--- a/erts/etc/win32/erlsrv/erlsrv_interactive.c
+++ b/erts/etc/win32/erlsrv/erlsrv_interactive.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/erlsrv/erlsrv_interactive.h b/erts/etc/win32/erlsrv/erlsrv_interactive.h
index a83f5a4b85..03cf4b3339 100644
--- a/erts/etc/win32/erlsrv/erlsrv_interactive.h
+++ b/erts/etc/win32/erlsrv/erlsrv_interactive.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/erlsrv/erlsrv_main.c b/erts/etc/win32/erlsrv/erlsrv_main.c
index caca18de00..521e7687f4 100644
--- a/erts/etc/win32/erlsrv/erlsrv_main.c
+++ b/erts/etc/win32/erlsrv/erlsrv_main.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/erlsrv/erlsrv_registry.c b/erts/etc/win32/erlsrv/erlsrv_registry.c
index f95f4ef074..eb2a8c567c 100644
--- a/erts/etc/win32/erlsrv/erlsrv_registry.c
+++ b/erts/etc/win32/erlsrv/erlsrv_registry.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/erlsrv/erlsrv_registry.h b/erts/etc/win32/erlsrv/erlsrv_registry.h
index 3aa265686a..885d021497 100644
--- a/erts/etc/win32/erlsrv/erlsrv_registry.h
+++ b/erts/etc/win32/erlsrv/erlsrv_registry.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/erlsrv/erlsrv_service.c b/erts/etc/win32/erlsrv/erlsrv_service.c
index d9fa165355..f5d5c0b174 100644
--- a/erts/etc/win32/erlsrv/erlsrv_service.c
+++ b/erts/etc/win32/erlsrv/erlsrv_service.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/erlsrv/erlsrv_service.h b/erts/etc/win32/erlsrv/erlsrv_service.h
index c87292325c..4e1148cac2 100644
--- a/erts/etc/win32/erlsrv/erlsrv_service.h
+++ b/erts/etc/win32/erlsrv/erlsrv_service.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/erlsrv/erlsrv_util.c b/erts/etc/win32/erlsrv/erlsrv_util.c
index 800395ff12..f719082d37 100644
--- a/erts/etc/win32/erlsrv/erlsrv_util.c
+++ b/erts/etc/win32/erlsrv/erlsrv_util.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/erlsrv/erlsrv_util.h b/erts/etc/win32/erlsrv/erlsrv_util.h
index 1afcd1dd7e..97cc91834f 100644
--- a/erts/etc/win32/erlsrv/erlsrv_util.h
+++ b/erts/etc/win32/erlsrv/erlsrv_util.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/init_file.c b/erts/etc/win32/init_file.c
index 93d82b1823..147e299798 100644
--- a/erts/etc/win32/init_file.c
+++ b/erts/etc/win32/init_file.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/init_file.h b/erts/etc/win32/init_file.h
index 404b5fd03b..df33d23a35 100644
--- a/erts/etc/win32/init_file.h
+++ b/erts/etc/win32/init_file.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/msys_tools/erl b/erts/etc/win32/msys_tools/erl
index 110d48c769..a2fe924e78 100644
--- a/erts/etc/win32/msys_tools/erl
+++ b/erts/etc/win32/msys_tools/erl
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/msys_tools/erlc b/erts/etc/win32/msys_tools/erlc
index b50090b6de..45d466743e 100644
--- a/erts/etc/win32/msys_tools/erlc
+++ b/erts/etc/win32/msys_tools/erlc
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/msys_tools/javac.sh b/erts/etc/win32/msys_tools/javac.sh
index 5b51648a19..6a8b245601 100644
--- a/erts/etc/win32/msys_tools/javac.sh
+++ b/erts/etc/win32/msys_tools/javac.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/msys_tools/make_bootstrap_ini.sh b/erts/etc/win32/msys_tools/make_bootstrap_ini.sh
index 1797f67c78..59fc6fc09a 100644
--- a/erts/etc/win32/msys_tools/make_bootstrap_ini.sh
+++ b/erts/etc/win32/msys_tools/make_bootstrap_ini.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2011. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/msys_tools/make_local_ini.sh b/erts/etc/win32/msys_tools/make_local_ini.sh
index 11f722e7f8..046b3e9d00 100644
--- a/erts/etc/win32/msys_tools/make_local_ini.sh
+++ b/erts/etc/win32/msys_tools/make_local_ini.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2011. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/msys_tools/vc/ar.sh b/erts/etc/win32/msys_tools/vc/ar.sh
index 4c98e3cc29..a33c954c0f 100644
--- a/erts/etc/win32/msys_tools/vc/ar.sh
+++ b/erts/etc/win32/msys_tools/vc/ar.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/msys_tools/vc/cc.sh b/erts/etc/win32/msys_tools/vc/cc.sh
index 72005862ed..2b0482e876 100644
--- a/erts/etc/win32/msys_tools/vc/cc.sh
+++ b/erts/etc/win32/msys_tools/vc/cc.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/msys_tools/vc/coffix.c b/erts/etc/win32/msys_tools/vc/coffix.c
index 4f21cfc389..bf1096c425 100644
--- a/erts/etc/win32/msys_tools/vc/coffix.c
+++ b/erts/etc/win32/msys_tools/vc/coffix.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/msys_tools/vc/emu_cc.sh b/erts/etc/win32/msys_tools/vc/emu_cc.sh
index 10d59214ea..2de3a07aca 100644
--- a/erts/etc/win32/msys_tools/vc/emu_cc.sh
+++ b/erts/etc/win32/msys_tools/vc/emu_cc.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/msys_tools/vc/ld.sh b/erts/etc/win32/msys_tools/vc/ld.sh
index 11b2fc077b..8917251f51 100644
--- a/erts/etc/win32/msys_tools/vc/ld.sh
+++ b/erts/etc/win32/msys_tools/vc/ld.sh
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/msys_tools/vc/mc.sh b/erts/etc/win32/msys_tools/vc/mc.sh
index 14b5ebaa8f..a074a1a89f 100644
--- a/erts/etc/win32/msys_tools/vc/mc.sh
+++ b/erts/etc/win32/msys_tools/vc/mc.sh
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/msys_tools/vc/rc.sh b/erts/etc/win32/msys_tools/vc/rc.sh
index 1f8ade17cb..3d1186ca91 100644
--- a/erts/etc/win32/msys_tools/vc/rc.sh
+++ b/erts/etc/win32/msys_tools/vc/rc.sh
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/nsis/Makefile b/erts/etc/win32/nsis/Makefile
index 64f44ff86d..0b4e0d0359 100644
--- a/erts/etc/win32/nsis/Makefile
+++ b/erts/etc/win32/nsis/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2012. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/nsis/dll_version_helper.sh b/erts/etc/win32/nsis/dll_version_helper.sh
index 86e36f62c9..9eafb6ce0e 100755
--- a/erts/etc/win32/nsis/dll_version_helper.sh
+++ b/erts/etc/win32/nsis/dll_version_helper.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2013. All Rights Reserved.
+# Copyright Ericsson AB 2007-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/nsis/erlang20.nsi b/erts/etc/win32/nsis/erlang20.nsi
index bf6ba0b9a6..66746b684d 100644
--- a/erts/etc/win32/nsis/erlang20.nsi
+++ b/erts/etc/win32/nsis/erlang20.nsi
@@ -7,7 +7,7 @@
;
; %CopyrightBegin%
;
-; Copyright Ericsson AB 2012. All Rights Reserved.
+; Copyright Ericsson AB 2012-2016. All Rights Reserved.
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/nsis/find_redist.sh b/erts/etc/win32/nsis/find_redist.sh
index 03e92b21c7..c070ad469a 100755
--- a/erts/etc/win32/nsis/find_redist.sh
+++ b/erts/etc/win32/nsis/find_redist.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2011. All Rights Reserved.
+# Copyright Ericsson AB 2007-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/port_entry.c b/erts/etc/win32/port_entry.c
index 5681a2a548..8b1d3a44b8 100644
--- a/erts/etc/win32/port_entry.c
+++ b/erts/etc/win32/port_entry.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2012. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/resource.h b/erts/etc/win32/resource.h
index 32d8b8885d..e59baadb50 100644
--- a/erts/etc/win32/resource.h
+++ b/erts/etc/win32/resource.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/start_erl.c b/erts/etc/win32/start_erl.c
index a4437c2f6b..07bcd19b81 100644
--- a/erts/etc/win32/start_erl.c
+++ b/erts/etc/win32/start_erl.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2012. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/etc/win32/win_erlexec.c b/erts/etc/win32/win_erlexec.c
index f2460197e6..39dac358e9 100644
--- a/erts/etc/win32/win_erlexec.c
+++ b/erts/etc/win32/win_erlexec.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/example/Makefile b/erts/example/Makefile
index cc5bcce191..f00321ac45 100644
--- a/erts/example/Makefile
+++ b/erts/example/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2009. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/example/matrix_nif.c b/erts/example/matrix_nif.c
index dfe446e879..6452084eb7 100644
--- a/erts/example/matrix_nif.c
+++ b/erts/example/matrix_nif.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/example/matrix_nif.erl b/erts/example/matrix_nif.erl
index d56b358247..bdc7228ac0 100644
--- a/erts/example/matrix_nif.erl
+++ b/erts/example/matrix_nif.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/example/next_perm.cc b/erts/example/next_perm.cc
index c7b7096e7b..882af4cd1e 100644
--- a/erts/example/next_perm.cc
+++ b/erts/example/next_perm.cc
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/example/next_perm.erl b/erts/example/next_perm.erl
index d414470f3a..b6f47b975c 100644
--- a/erts/example/next_perm.erl
+++ b/erts/example/next_perm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/example/pg_async.c b/erts/example/pg_async.c
index cd6bc9e0c2..3167ce5227 100644
--- a/erts/example/pg_async.c
+++ b/erts/example/pg_async.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/example/pg_async.erl b/erts/example/pg_async.erl
index 20ee94f61a..d34d03cf09 100644
--- a/erts/example/pg_async.erl
+++ b/erts/example/pg_async.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/example/pg_async2.c b/erts/example/pg_async2.c
index 9eb3ec9d54..ee772f4447 100644
--- a/erts/example/pg_async2.c
+++ b/erts/example/pg_async2.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/example/pg_async2.erl b/erts/example/pg_async2.erl
index 082852f617..9398f4ccbe 100644
--- a/erts/example/pg_async2.erl
+++ b/erts/example/pg_async2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/example/pg_encode.c b/erts/example/pg_encode.c
index e1ec4abb1d..1efc4c1eaf 100644
--- a/erts/example/pg_encode.c
+++ b/erts/example/pg_encode.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/example/pg_encode.h b/erts/example/pg_encode.h
index df3f8fcaaa..213e20198e 100644
--- a/erts/example/pg_encode.h
+++ b/erts/example/pg_encode.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/example/pg_encode2.c b/erts/example/pg_encode2.c
index cdf8e71e44..df5ec9771b 100644
--- a/erts/example/pg_encode2.c
+++ b/erts/example/pg_encode2.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/example/pg_encode2.h b/erts/example/pg_encode2.h
index df3f8fcaaa..213e20198e 100644
--- a/erts/example/pg_encode2.h
+++ b/erts/example/pg_encode2.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/example/pg_sync.c b/erts/example/pg_sync.c
index 88096671a5..81b99f98d3 100644
--- a/erts/example/pg_sync.c
+++ b/erts/example/pg_sync.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/example/pg_sync.erl b/erts/example/pg_sync.erl
index 76fb27332e..29a975727a 100644
--- a/erts/example/pg_sync.erl
+++ b/erts/example/pg_sync.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/include/erl_fixed_size_int_types.h b/erts/include/erl_fixed_size_int_types.h
index dfaea5650b..9f47bdd797 100644
--- a/erts/include/erl_fixed_size_int_types.h
+++ b/erts/include/erl_fixed_size_int_types.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/erl_int_sizes_config.h.in b/erts/include/erl_int_sizes_config.h.in
index 88c74cdeff..e0e60f0e2f 100644
--- a/erts/include/erl_int_sizes_config.h.in
+++ b/erts/include/erl_int_sizes_config.h.in
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/erl_memory_trace_parser.h b/erts/include/erl_memory_trace_parser.h
index 426ff05061..3170ebc0d0 100644
--- a/erts/include/erl_memory_trace_parser.h
+++ b/erts/include/erl_memory_trace_parser.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/erl_native_features_config.h.in b/erts/include/erl_native_features_config.h.in
index 2bd1d96229..59a5dde09e 100644
--- a/erts/include/erl_native_features_config.h.in
+++ b/erts/include/erl_native_features_config.h.in
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/README b/erts/include/internal/README
index fca0c5e489..a79b241556 100644
--- a/erts/include/internal/README
+++ b/erts/include/internal/README
@@ -1,7 +1,7 @@
%CopyrightBegin%
- Copyright Ericsson AB 2004-2009. All Rights Reserved.
+ Copyright Ericsson AB 2004-2016. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/erl_errno.h b/erts/include/internal/erl_errno.h
index 33bfbe3d51..1ae045805e 100644
--- a/erts/include/internal/erl_errno.h
+++ b/erts/include/internal/erl_errno.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/erl_memory_trace_protocol.h b/erts/include/internal/erl_memory_trace_protocol.h
index b86e2de278..d3e0bcc1f4 100644
--- a/erts/include/internal/erl_memory_trace_protocol.h
+++ b/erts/include/internal/erl_memory_trace_protocol.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/erl_misc_utils.h b/erts/include/internal/erl_misc_utils.h
index 7ab7a26838..a4a5d1d510 100644
--- a/erts/include/internal/erl_misc_utils.h
+++ b/erts/include/internal/erl_misc_utils.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/erl_printf.h b/erts/include/internal/erl_printf.h
index 3846828fb9..c4565dfafc 100644
--- a/erts/include/internal/erl_printf.h
+++ b/erts/include/internal/erl_printf.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/erl_printf_format.h b/erts/include/internal/erl_printf_format.h
index 953022017a..4f969bdbcb 100644
--- a/erts/include/internal/erl_printf_format.h
+++ b/erts/include/internal/erl_printf_format.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/erts_internal.mk.in b/erts/include/internal/erts_internal.mk.in
index 76aab59c38..8faa33135e 100644
--- a/erts/include/internal/erts_internal.mk.in
+++ b/erts/include/internal/erts_internal.mk.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/ethr_atomics.h b/erts/include/internal/ethr_atomics.h
index f366c2d0ad..06568201ad 100644
--- a/erts/include/internal/ethr_atomics.h
+++ b/erts/include/internal/ethr_atomics.h
@@ -10,7 +10,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/ethr_internal.h b/erts/include/internal/ethr_internal.h
index 693b34df61..6657c8affc 100644
--- a/erts/include/internal/ethr_internal.h
+++ b/erts/include/internal/ethr_internal.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/ethr_mutex.h b/erts/include/internal/ethr_mutex.h
index b402a139f5..a510a2c97f 100644
--- a/erts/include/internal/ethr_mutex.h
+++ b/erts/include/internal/ethr_mutex.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/ethr_optimized_fallbacks.h b/erts/include/internal/ethr_optimized_fallbacks.h
index 6ef4e2bace..8c27a9ba5b 100644
--- a/erts/include/internal/ethr_optimized_fallbacks.h
+++ b/erts/include/internal/ethr_optimized_fallbacks.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/ethread.h b/erts/include/internal/ethread.h
index e5c5cdfa33..b23644d361 100644
--- a/erts/include/internal/ethread.h
+++ b/erts/include/internal/ethread.h
@@ -112,6 +112,10 @@ int ethr_assert_failed(const char *file, int line, const char *func, char *a);
#error "_GNU_SOURCE not defined. Please, compile all files with -D_GNU_SOURCE."
#endif
+#ifdef ETHR_HAVE_PTHREAD_SETNAME_NP_1
+#define _DARWIN_C_SOURCE
+#endif
+
#if defined(ETHR_NEED_NPTL_PTHREAD_H)
#include <nptl/pthread.h>
#elif defined(ETHR_HAVE_MIT_PTHREAD_H)
diff --git a/erts/include/internal/ethread.mk.in b/erts/include/internal/ethread.mk.in
index 89924a3215..486a7a9401 100644
--- a/erts/include/internal/ethread.mk.in
+++ b/erts/include/internal/ethread.mk.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/ethread_header_config.h.in b/erts/include/internal/ethread_header_config.h.in
index f4b08cfced..6309f10439 100644
--- a/erts/include/internal/ethread_header_config.h.in
+++ b/erts/include/internal/ethread_header_config.h.in
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2015. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/ethread_inline.h b/erts/include/internal/ethread_inline.h
index 3ba910d993..8e6bcfc4a8 100644
--- a/erts/include/internal/ethread_inline.h
+++ b/erts/include/internal/ethread_inline.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/i386/atomic.h b/erts/include/internal/i386/atomic.h
index 6a6435e58d..52ef1762d5 100644
--- a/erts/include/internal/i386/atomic.h
+++ b/erts/include/internal/i386/atomic.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/i386/ethr_dw_atomic.h b/erts/include/internal/i386/ethr_dw_atomic.h
index 5444a6345c..91acdb0483 100644
--- a/erts/include/internal/i386/ethr_dw_atomic.h
+++ b/erts/include/internal/i386/ethr_dw_atomic.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/i386/ethr_membar.h b/erts/include/internal/i386/ethr_membar.h
index 97ae5eda2c..d1b72cd538 100644
--- a/erts/include/internal/i386/ethr_membar.h
+++ b/erts/include/internal/i386/ethr_membar.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/i386/ethread.h b/erts/include/internal/i386/ethread.h
index 23dcd1dc19..fef1674c7e 100644
--- a/erts/include/internal/i386/ethread.h
+++ b/erts/include/internal/i386/ethread.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/i386/rwlock.h b/erts/include/internal/i386/rwlock.h
index 9859338eab..8d22bac7e9 100644
--- a/erts/include/internal/i386/rwlock.h
+++ b/erts/include/internal/i386/rwlock.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/i386/spinlock.h b/erts/include/internal/i386/spinlock.h
index e010684d14..1a8e359981 100644
--- a/erts/include/internal/i386/spinlock.h
+++ b/erts/include/internal/i386/spinlock.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/libatomic_ops/ethr_atomic.h b/erts/include/internal/libatomic_ops/ethr_atomic.h
index 828210036c..da3b15a878 100644
--- a/erts/include/internal/libatomic_ops/ethr_atomic.h
+++ b/erts/include/internal/libatomic_ops/ethr_atomic.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/libatomic_ops/ethr_dw_atomic.h b/erts/include/internal/libatomic_ops/ethr_dw_atomic.h
index ce9b251cbe..8643600fa5 100644
--- a/erts/include/internal/libatomic_ops/ethr_dw_atomic.h
+++ b/erts/include/internal/libatomic_ops/ethr_dw_atomic.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2014. All Rights Reserved.
+ * Copyright Ericsson AB 2014-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/libatomic_ops/ethr_membar.h b/erts/include/internal/libatomic_ops/ethr_membar.h
index 7d2b807586..1d3d332c90 100644
--- a/erts/include/internal/libatomic_ops/ethr_membar.h
+++ b/erts/include/internal/libatomic_ops/ethr_membar.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/libatomic_ops/ethread.h b/erts/include/internal/libatomic_ops/ethread.h
index e34f43bb46..4adc31ed2a 100644
--- a/erts/include/internal/libatomic_ops/ethread.h
+++ b/erts/include/internal/libatomic_ops/ethread.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/ppc32/atomic.h b/erts/include/internal/ppc32/atomic.h
index 572b0e5191..198f057b3f 100644
--- a/erts/include/internal/ppc32/atomic.h
+++ b/erts/include/internal/ppc32/atomic.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/ppc32/ethr_membar.h b/erts/include/internal/ppc32/ethr_membar.h
index fe77721cd9..88ba4a2ea5 100644
--- a/erts/include/internal/ppc32/ethr_membar.h
+++ b/erts/include/internal/ppc32/ethr_membar.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/ppc32/ethread.h b/erts/include/internal/ppc32/ethread.h
index 25e85c58bd..bead019f41 100644
--- a/erts/include/internal/ppc32/ethread.h
+++ b/erts/include/internal/ppc32/ethread.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/ppc32/rwlock.h b/erts/include/internal/ppc32/rwlock.h
index aee232f79d..6493629e49 100644
--- a/erts/include/internal/ppc32/rwlock.h
+++ b/erts/include/internal/ppc32/rwlock.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/ppc32/spinlock.h b/erts/include/internal/ppc32/spinlock.h
index 829db6a135..3b35cafcb2 100644
--- a/erts/include/internal/ppc32/spinlock.h
+++ b/erts/include/internal/ppc32/spinlock.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/pthread/ethr_event.h b/erts/include/internal/pthread/ethr_event.h
index deb4b29686..6e470bf6cf 100644
--- a/erts/include/internal/pthread/ethr_event.h
+++ b/erts/include/internal/pthread/ethr_event.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/sparc32/atomic.h b/erts/include/internal/sparc32/atomic.h
index 0b535242ad..032943817d 100644
--- a/erts/include/internal/sparc32/atomic.h
+++ b/erts/include/internal/sparc32/atomic.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/sparc32/ethr_membar.h b/erts/include/internal/sparc32/ethr_membar.h
index 6133de5eb7..fb8ceef12b 100644
--- a/erts/include/internal/sparc32/ethr_membar.h
+++ b/erts/include/internal/sparc32/ethr_membar.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/sparc32/ethread.h b/erts/include/internal/sparc32/ethread.h
index 513d9f8773..8d49465008 100644
--- a/erts/include/internal/sparc32/ethread.h
+++ b/erts/include/internal/sparc32/ethread.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/sparc32/rwlock.h b/erts/include/internal/sparc32/rwlock.h
index 44de6113b7..1cc516cdad 100644
--- a/erts/include/internal/sparc32/rwlock.h
+++ b/erts/include/internal/sparc32/rwlock.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/sparc32/spinlock.h b/erts/include/internal/sparc32/spinlock.h
index 695fa112b6..ae3b1c9dee 100644
--- a/erts/include/internal/sparc32/spinlock.h
+++ b/erts/include/internal/sparc32/spinlock.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/sparc64/ethread.h b/erts/include/internal/sparc64/ethread.h
index 5f518e5596..6018e738b5 100644
--- a/erts/include/internal/sparc64/ethread.h
+++ b/erts/include/internal/sparc64/ethread.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2007-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/tile/atomic.h b/erts/include/internal/tile/atomic.h
index 1a2881442e..7f5f83bcc7 100644
--- a/erts/include/internal/tile/atomic.h
+++ b/erts/include/internal/tile/atomic.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/tile/ethr_membar.h b/erts/include/internal/tile/ethr_membar.h
index ccb420d558..50ea2c0265 100644
--- a/erts/include/internal/tile/ethr_membar.h
+++ b/erts/include/internal/tile/ethr_membar.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/tile/ethread.h b/erts/include/internal/tile/ethread.h
index 577d275965..0d69673a1c 100644
--- a/erts/include/internal/tile/ethread.h
+++ b/erts/include/internal/tile/ethread.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/win/ethr_atomic.h b/erts/include/internal/win/ethr_atomic.h
index f17526a94d..32c28f692d 100644
--- a/erts/include/internal/win/ethr_atomic.h
+++ b/erts/include/internal/win/ethr_atomic.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/win/ethr_dw_atomic.h b/erts/include/internal/win/ethr_dw_atomic.h
index 8bed4fb26e..a6b26ab7bb 100644
--- a/erts/include/internal/win/ethr_dw_atomic.h
+++ b/erts/include/internal/win/ethr_dw_atomic.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/win/ethr_event.h b/erts/include/internal/win/ethr_event.h
index 458565b9ea..9ee78183ab 100644
--- a/erts/include/internal/win/ethr_event.h
+++ b/erts/include/internal/win/ethr_event.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/win/ethr_membar.h b/erts/include/internal/win/ethr_membar.h
index 9cba6b605d..c018f6d869 100644
--- a/erts/include/internal/win/ethr_membar.h
+++ b/erts/include/internal/win/ethr_membar.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/win/ethread.h b/erts/include/internal/win/ethread.h
index 2fda028825..773be08a9b 100644
--- a/erts/include/internal/win/ethread.h
+++ b/erts/include/internal/win/ethread.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/include/internal/x86_64/ethread.h b/erts/include/internal/x86_64/ethread.h
index 8887b8d77f..7fc5481629 100644
--- a/erts/include/internal/x86_64/ethread.h
+++ b/erts/include/internal/x86_64/ethread.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/lib/internal/README b/erts/lib/internal/README
index 9beba10bc2..9e5cab26d3 100644
--- a/erts/lib/internal/README
+++ b/erts/lib/internal/README
@@ -1,7 +1,7 @@
%CopyrightBegin%
- Copyright Ericsson AB 2004-2009. All Rights Reserved.
+ Copyright Ericsson AB 2004-2016. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/erts/lib_src/Makefile b/erts/lib_src/Makefile
index 632b8a0b09..882a050ffd 100644
--- a/erts/lib_src/Makefile
+++ b/erts/lib_src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/lib_src/Makefile.in b/erts/lib_src/Makefile.in
index 74e32ccdce..6e2f236bdf 100644
--- a/erts/lib_src/Makefile.in
+++ b/erts/lib_src/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2013. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/lib_src/common/erl_memory_trace_parser.c b/erts/lib_src/common/erl_memory_trace_parser.c
index a81068089e..0232708ad1 100644
--- a/erts/lib_src/common/erl_memory_trace_parser.c
+++ b/erts/lib_src/common/erl_memory_trace_parser.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/lib_src/common/erl_misc_utils.c b/erts/lib_src/common/erl_misc_utils.c
index 053217304b..8186463b9c 100644
--- a/erts/lib_src/common/erl_misc_utils.c
+++ b/erts/lib_src/common/erl_misc_utils.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/lib_src/common/erl_printf.c b/erts/lib_src/common/erl_printf.c
index 387a104a7a..b5e90dfeef 100644
--- a/erts/lib_src/common/erl_printf.c
+++ b/erts/lib_src/common/erl_printf.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/lib_src/common/erl_printf_format.c b/erts/lib_src/common/erl_printf_format.c
index e7d5d4413e..3daa066fd3 100644
--- a/erts/lib_src/common/erl_printf_format.c
+++ b/erts/lib_src/common/erl_printf_format.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/lib_src/common/ethr_atomics.c b/erts/lib_src/common/ethr_atomics.c
index 42c078377d..1594d78f5e 100644
--- a/erts/lib_src/common/ethr_atomics.c
+++ b/erts/lib_src/common/ethr_atomics.c
@@ -10,7 +10,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/lib_src/common/ethr_aux.c b/erts/lib_src/common/ethr_aux.c
index 3e7aad16c7..420efd725f 100644
--- a/erts/lib_src/common/ethr_aux.c
+++ b/erts/lib_src/common/ethr_aux.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/lib_src/common/ethr_cbf.c b/erts/lib_src/common/ethr_cbf.c
index e79ec2b40c..037559be22 100644
--- a/erts/lib_src/common/ethr_cbf.c
+++ b/erts/lib_src/common/ethr_cbf.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/lib_src/common/ethr_mutex.c b/erts/lib_src/common/ethr_mutex.c
index a596e6c31c..5e7e7b2f32 100644
--- a/erts/lib_src/common/ethr_mutex.c
+++ b/erts/lib_src/common/ethr_mutex.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/lib_src/pthread/ethr_event.c b/erts/lib_src/pthread/ethr_event.c
index 0629b4dfcd..eef88d5002 100644
--- a/erts/lib_src/pthread/ethr_event.c
+++ b/erts/lib_src/pthread/ethr_event.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -94,6 +94,9 @@ wait__(ethr_event *e, int spincount, ethr_sint64_t timeout)
tsp = NULL;
}
else {
+#ifdef ETHR_HAVE_ETHR_GET_MONOTONIC_TIME
+ start = ethr_get_monotonic_time();
+#endif
tsp = &ts;
time = timeout;
if (spincount == 0) {
@@ -102,9 +105,6 @@ wait__(ethr_event *e, int spincount, ethr_sint64_t timeout)
goto return_event_on;
goto set_timeout;
}
-#ifdef ETHR_HAVE_ETHR_GET_MONOTONIC_TIME
- start = ethr_get_monotonic_time();
-#endif
}
while (1) {
diff --git a/erts/lib_src/pthread/ethr_x86_sse2_asm.c b/erts/lib_src/pthread/ethr_x86_sse2_asm.c
index 7ce5a6d98a..bdcf3ac1c3 100644
--- a/erts/lib_src/pthread/ethr_x86_sse2_asm.c
+++ b/erts/lib_src/pthread/ethr_x86_sse2_asm.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/lib_src/pthread/ethread.c b/erts/lib_src/pthread/ethread.c
index ef11559654..29bffa7e12 100644
--- a/erts/lib_src/pthread/ethread.c
+++ b/erts/lib_src/pthread/ethread.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/lib_src/utils/make_atomics_api b/erts/lib_src/utils/make_atomics_api
index 4b37e3fa74..f960b97c87 100755
--- a/erts/lib_src/utils/make_atomics_api
+++ b/erts/lib_src/utils/make_atomics_api
@@ -4,7 +4,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/lib_src/win/ethr_event.c b/erts/lib_src/win/ethr_event.c
index 6951a216c5..383f7c876e 100644
--- a/erts/lib_src/win/ethr_event.c
+++ b/erts/lib_src/win/ethr_event.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/lib_src/win/ethread.c b/erts/lib_src/win/ethread.c
index 22b0b4040c..e0f19f7ba1 100644
--- a/erts/lib_src/win/ethread.c
+++ b/erts/lib_src/win/ethread.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/preloaded/Makefile b/erts/preloaded/Makefile
index fbe62d57bb..e8935d4410 100644
--- a/erts/preloaded/Makefile
+++ b/erts/preloaded/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2009. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/preloaded/ebin/erl_prim_loader.beam b/erts/preloaded/ebin/erl_prim_loader.beam
index 6d777fa811..3e82b8e20e 100644
--- a/erts/preloaded/ebin/erl_prim_loader.beam
+++ b/erts/preloaded/ebin/erl_prim_loader.beam
Binary files differ
diff --git a/erts/preloaded/ebin/erl_tracer.beam b/erts/preloaded/ebin/erl_tracer.beam
new file mode 100644
index 0000000000..67d96d0f0d
--- /dev/null
+++ b/erts/preloaded/ebin/erl_tracer.beam
Binary files differ
diff --git a/erts/preloaded/ebin/erlang.beam b/erts/preloaded/ebin/erlang.beam
index 2ea2de4c70..321e4e7e1b 100644
--- a/erts/preloaded/ebin/erlang.beam
+++ b/erts/preloaded/ebin/erlang.beam
Binary files differ
diff --git a/erts/preloaded/ebin/erts_code_purger.beam b/erts/preloaded/ebin/erts_code_purger.beam
index 4188e5fd9b..0c667663fd 100644
--- a/erts/preloaded/ebin/erts_code_purger.beam
+++ b/erts/preloaded/ebin/erts_code_purger.beam
Binary files differ
diff --git a/erts/preloaded/ebin/erts_internal.beam b/erts/preloaded/ebin/erts_internal.beam
index 88da34b192..ed2e328f5b 100644
--- a/erts/preloaded/ebin/erts_internal.beam
+++ b/erts/preloaded/ebin/erts_internal.beam
Binary files differ
diff --git a/erts/preloaded/ebin/init.beam b/erts/preloaded/ebin/init.beam
index 9d2dd38f3a..23ebd2cad9 100644
--- a/erts/preloaded/ebin/init.beam
+++ b/erts/preloaded/ebin/init.beam
Binary files differ
diff --git a/erts/preloaded/ebin/otp_ring0.beam b/erts/preloaded/ebin/otp_ring0.beam
index 3cd2515ba8..b63fa24848 100644
--- a/erts/preloaded/ebin/otp_ring0.beam
+++ b/erts/preloaded/ebin/otp_ring0.beam
Binary files differ
diff --git a/erts/preloaded/ebin/prim_eval.beam b/erts/preloaded/ebin/prim_eval.beam
index 9a208d1545..7c8fdc82c0 100644
--- a/erts/preloaded/ebin/prim_eval.beam
+++ b/erts/preloaded/ebin/prim_eval.beam
Binary files differ
diff --git a/erts/preloaded/ebin/prim_file.beam b/erts/preloaded/ebin/prim_file.beam
index 426e764127..d4559bc9ed 100644
--- a/erts/preloaded/ebin/prim_file.beam
+++ b/erts/preloaded/ebin/prim_file.beam
Binary files differ
diff --git a/erts/preloaded/ebin/prim_inet.beam b/erts/preloaded/ebin/prim_inet.beam
index d68d18ecba..5a0678632e 100644
--- a/erts/preloaded/ebin/prim_inet.beam
+++ b/erts/preloaded/ebin/prim_inet.beam
Binary files differ
diff --git a/erts/preloaded/ebin/prim_zip.beam b/erts/preloaded/ebin/prim_zip.beam
index 01b3b1feb8..3d32dd8449 100644
--- a/erts/preloaded/ebin/prim_zip.beam
+++ b/erts/preloaded/ebin/prim_zip.beam
Binary files differ
diff --git a/erts/preloaded/ebin/zlib.beam b/erts/preloaded/ebin/zlib.beam
index 7252d866bb..ced9f9c952 100644
--- a/erts/preloaded/ebin/zlib.beam
+++ b/erts/preloaded/ebin/zlib.beam
Binary files differ
diff --git a/erts/preloaded/src/Makefile b/erts/preloaded/src/Makefile
index 31383dda83..4a447d3a09 100644
--- a/erts/preloaded/src/Makefile
+++ b/erts/preloaded/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2013. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -43,7 +43,8 @@ PRE_LOADED_ERL_MODULES = \
otp_ring0 \
erts_code_purger \
erlang \
- erts_internal
+ erts_internal \
+ erl_tracer
PRE_LOADED_BEAM_MODULES = \
prim_eval
diff --git a/erts/preloaded/src/add_abstract_code b/erts/preloaded/src/add_abstract_code
index 4f479db2e8..943987872e 100644
--- a/erts/preloaded/src/add_abstract_code
+++ b/erts/preloaded/src/add_abstract_code
@@ -4,7 +4,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/preloaded/src/erl_prim_loader.erl b/erts/preloaded/src/erl_prim_loader.erl
index cbcced5512..e18e187cb7 100644
--- a/erts/preloaded/src/erl_prim_loader.erl
+++ b/erts/preloaded/src/erl_prim_loader.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -56,7 +56,7 @@
-export([purge_archive_cache/0]).
%% Used by init and the code server.
--export([get_modules/3]).
+-export([get_modules/2,get_modules/3]).
-include_lib("kernel/include/file.hrl").
@@ -239,6 +239,13 @@ set_primary_archive(File, ArchiveBin, FileInfo, ParserFun)
purge_archive_cache() ->
request(purge_archive_cache).
+-spec get_modules([module()],
+ fun((atom(), string(), binary()) ->
+ {'ok',any()} | {'error',any()})) ->
+ {'ok',{[any()],[any()]}}.
+
+get_modules(Modules, Fun) ->
+ request({get_modules,{Modules,Fun}}).
-spec get_modules([module()],
fun((atom(), string(), binary()) ->
@@ -338,6 +345,8 @@ handle_request(Req, Paths, St0) ->
{{ok,Paths},St0};
{get_file,File} ->
handle_get_file(St0, Paths, File);
+ {get_modules,{Modules,Fun}} ->
+ handle_get_modules(St0, Modules, Fun, Paths);
{get_modules,{Modules,Fun,ModPaths}} ->
handle_get_modules(St0, Modules, Fun, ModPaths);
{list_dir,Dir} ->
diff --git a/erts/preloaded/src/erl_tracer.erl b/erts/preloaded/src/erl_tracer.erl
new file mode 100644
index 0000000000..de1e9ca01e
--- /dev/null
+++ b/erts/preloaded/src/erl_tracer.erl
@@ -0,0 +1,59 @@
+-module(erl_tracer).
+
+-export([enabled/3, trace/6, on_load/0]).
+
+-type tracee() :: port() | pid() | undefined.
+
+-type trace_tag_running_ports() :: in | out | in_exiting | out_exiting | out_exited.
+-type trace_tag_running_procs() :: in | out | in_exiting | out_exiting | out_exited.
+-type trace_tag_send() :: send | send_to_non_existing_process.
+-type trace_tag_receive() :: 'receive'.
+-type trace_tag_call() :: call | return_to | return_from | exception_from.
+-type trace_tag_procs() :: spawn | spawned | exit | link | unlink
+ | getting_linked | getting_unlinked
+ | register | unregister.
+-type trace_tag_ports() :: open | closed | link | unlink
+ | getting_linked | getting_unlinked.
+-type trace_tag_gc() :: gc_minor_start | gc_minor_end
+ | gc_major_start | gc_major_end.
+
+-type trace_tag() :: trace_tag_send()
+ | trace_tag_receive()
+ | trace_tag_call()
+ | trace_tag_procs()
+ | trace_tag_ports()
+ | trace_tag_running_procs()
+ | trace_tag_running_ports()
+ | trace_tag_gc().
+
+-type trace_opts() :: #{ match_spec_result => true | term(),
+ scheduler_id => undefined | non_neg_integer(),
+ timestamp => undefined | timestamp | cpu_timestamp |
+ monotonic | strict_monotonic }.
+-type tracer_state() :: term().
+
+on_load() ->
+ case erlang:load_nif(atom_to_list(?MODULE), 0) of
+ ok -> ok
+ end.
+
+%%%
+%%% NIF placeholders
+%%%
+
+-spec enabled(Tag :: trace_tag() | seq_trace | trace_status,
+ TracerState :: tracer_state(),
+ Tracee :: tracee()) ->
+ trace | discard | remove.
+enabled(_, _, _) ->
+ erlang:nif_error(nif_not_loaded).
+
+-spec trace(Tag :: trace_tag() | seq_trace,
+ TracerState :: tracer_state(),
+ Tracee :: tracee(),
+ Msg :: term(),
+ Extra :: term(),
+ Opts :: trace_opts()) -> any().
+
+trace(_, _, _, _, _, _) ->
+ erlang:nif_error(nif_not_loaded).
diff --git a/erts/preloaded/src/erlang.erl b/erts/preloaded/src/erlang.erl
index dfbd116d6e..20a64e81b4 100644
--- a/erts/preloaded/src/erlang.erl
+++ b/erts/preloaded/src/erlang.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -230,27 +230,32 @@
send |
'receive' |
procs |
+ ports |
call |
- silent |
+ arity |
return_to |
+ silent |
running |
exiting |
+ running_procs |
+ running_ports |
garbage_collection |
timestamp |
cpu_timestamp |
monotonic_timestamp |
strict_monotonic_timestamp |
- arity |
set_on_spawn |
set_on_first_spawn |
set_on_link |
set_on_first_link |
- {tracer, pid() | port()}.
+ {tracer, pid() | port()} |
+ {tracer, module(), term()}.
-type trace_info_item_result() ::
{traced, global | local | false | undefined} |
{match_spec, trace_match_spec() | false | undefined} |
{meta, pid() | port() | false | undefined | []} |
+ {meta, module(), term() } |
{meta_match_spec, trace_match_spec() | false | undefined} |
{call_count, non_neg_integer() | boolean() | undefined} |
{call_time, [{pid(), non_neg_integer(),
@@ -276,6 +281,7 @@
undefined |
{flags, [trace_info_flag()]} |
{tracer, pid() | port() | []} |
+ {tracer, module(), term()} |
trace_info_item_result() |
{all, [ trace_info_item_result() ] | false | undefined}.
@@ -1157,10 +1163,10 @@ map_size(_Map) ->
erlang:nif_error(undefined).
%% match_spec_test/3
--spec erlang:match_spec_test(P1, P2, P3) -> TestResult when
- P1 :: [term()] | tuple(),
- P2 :: term(),
- P3 :: table | trace,
+-spec erlang:match_spec_test(MatchAgainst, MatchSpec, Type) -> TestResult when
+ MatchAgainst :: [term()] | tuple(),
+ MatchSpec :: term(),
+ Type :: table | trace,
TestResult :: {ok, term(), [return_trace], [ {error | warning, string()} ]} | {error, [ {error | warning, string()} ]}.
match_spec_test(_P1, _P2, _P3) ->
erlang:nif_error(undefined).
@@ -1705,12 +1711,35 @@ time() ->
erlang:nif_error(undefined).
%% trace/3
--spec erlang:trace(PidSpec, How, FlagList) -> integer() when
- PidSpec :: pid() | existing | new | all,
+-spec erlang:trace(PidPortSpec, How, FlagList) -> integer() when
+ PidPortSpec :: pid() | port()
+ | all | processes | ports
+ | existing | existing_processes | existing_ports
+ | new | new_processes | new_ports,
How :: boolean(),
FlagList :: [trace_flag()].
-trace(_PidSpec, _How, _FlagList) ->
- erlang:nif_error(undefined).
+trace(PidPortSpec, How, FlagList) ->
+ %% Make sure that we have loaded the tracer module
+ case lists:keyfind(tracer, 1, FlagList) of
+ {tracer, Module, State} when erlang:is_atom(Module) ->
+ case erlang:module_loaded(Module) of
+ false ->
+ Module:enabled(trace_status, erlang:self(), State);
+ true ->
+ ok
+ end;
+ _ ->
+ ignore
+ end,
+
+ try erts_internal:trace(PidPortSpec, How, FlagList) of
+ Res -> Res
+ catch E:R ->
+ {_, [_ | CST]} = erlang:process_info(
+ erlang:self(), current_stacktrace),
+ erlang:raise(
+ E, R, [{?MODULE, trace, [PidPortSpec, How, FlagList], []} | CST])
+ end.
%% trace_delivered/1
-spec erlang:trace_delivered(Tracee) -> Ref when
@@ -1720,14 +1749,16 @@ trace_delivered(_Tracee) ->
erlang:nif_error(undefined).
%% trace_info/2
--spec erlang:trace_info(PidOrFunc, Item) -> Res when
- PidOrFunc :: pid() | new | {Module, Function, Arity} | on_load,
+-spec erlang:trace_info(PidPortOrFunc, Item) -> Res when
+ PidPortOrFunc :: pid() | port() | new | new_processes | new_ports
+ | {Module, Function, Arity} | on_load,
Module :: module(),
Function :: atom(),
Arity :: arity(),
- Item :: flags | tracer | traced | match_spec | meta | meta_match_spec | call_count | call_time | all,
+ Item :: flags | tracer | traced | match_spec
+ | meta | meta_match_spec | call_count | call_time | all,
Res :: trace_info_return().
-trace_info(_PidOrFunc, _Item) ->
+trace_info(_PidPortOrFunc, _Item) ->
erlang:nif_error(undefined).
%% trunc/1
@@ -2130,7 +2161,7 @@ process_flag(_Flag, _Value) ->
{message_queue_data, MQD :: message_queue_data()} |
{priority, Level :: priority_level()} |
{reductions, Number :: non_neg_integer()} |
- {registered_name, Atom :: atom()} |
+ {registered_name, [] | (Atom :: atom())} |
{sequential_trace_token, [] | (SequentialTraceToken :: term())} |
{stack_size, Size :: non_neg_integer()} |
{status, Status :: exiting | garbage_collecting | waiting | running | runnable | suspended} |
@@ -2226,9 +2257,9 @@ spawn_opt(_Tuple) ->
Input :: non_neg_integer(),
Output :: non_neg_integer();
(microstate_accounting) -> [MSAcc_Thread] | undefined when
- MSAcc_Thread :: #{ type => MSAcc_Thread_Type,
- id => MSAcc_Thread_Id,
- counters => MSAcc_Counters},
+ MSAcc_Thread :: #{ type := MSAcc_Thread_Type,
+ id := MSAcc_Thread_Id,
+ counters := MSAcc_Counters},
MSAcc_Thread_Type :: scheduler | async | aux,
MSAcc_Thread_Id :: non_neg_integer(),
MSAcc_Counters :: #{ MSAcc_Thread_State => non_neg_integer() },
@@ -2319,7 +2350,7 @@ subtract(_,_) ->
OldState :: preliminary | final | volatile;
%% These are deliberately not documented
(internal_cpu_topology, term()) -> term();
- (sequential_tracer, pid() | port() | false) -> pid() | port() | false;
+ (sequential_tracer, pid() | port() | {module(), term()} | false) -> pid() | port() | false;
(1,0) -> true.
system_flag(_Flag, _Value) ->
@@ -2355,12 +2386,20 @@ tl(_List) ->
| boolean()
| restart
| pause.
-trace_pattern(_MFA, _MatchSpec) ->
- erlang:nif_error(undefined).
+trace_pattern(MFA, MatchSpec) ->
+ try erts_internal:trace_pattern(MFA, MatchSpec, []) of
+ Res -> Res
+ catch E:R ->
+ {_, [_ | CST]} = erlang:process_info(
+ erlang:self(), current_stacktrace),
+ erlang:raise(
+ E, R, [{?MODULE, trace_pattern, [MFA, MatchSpec], []} | CST])
+ end.
-type trace_pattern_flag() ::
global | local |
meta | {meta, Pid :: pid()} |
+ {meta, TracerModule :: module(), TracerState :: term()} |
call_count |
call_time.
@@ -2371,8 +2410,28 @@ trace_pattern(_MFA, _MatchSpec) ->
| restart
| pause,
FlagList :: [ trace_pattern_flag() ].
-trace_pattern(_MFA, _MatchSpec, _FlagList) ->
- erlang:nif_error(undefined).
+trace_pattern(MFA, MatchSpec, FlagList) ->
+ %% Make sure that we have loaded the tracer module
+ case lists:keyfind(meta, 1, FlagList) of
+ {meta, Module, State} when erlang:is_atom(Module) ->
+ case erlang:module_loaded(Module) of
+ false ->
+ Module:enabled(trace_status, erlang:self(), State);
+ true ->
+ ok
+ end;
+ _ ->
+ ignore
+ end,
+
+ try erts_internal:trace_pattern(MFA, MatchSpec, FlagList) of
+ Res -> Res
+ catch E:R ->
+ {_, [_ | CST]} = erlang:process_info(
+ erlang:self(), current_stacktrace),
+ erlang:raise(
+ E, R, [{?MODULE, trace_pattern, [MFA, MatchSpec, FlagList], []} | CST])
+ end.
%% Shadowed by erl_bif_types: erlang:tuple_to_list/1
-spec tuple_to_list(Tuple) -> [term()] when
diff --git a/erts/preloaded/src/erts.app.src b/erts/preloaded/src/erts.app.src
index e53b6e5bab..98e0224a5f 100644
--- a/erts/preloaded/src/erts.app.src
+++ b/erts/preloaded/src/erts.app.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/preloaded/src/erts_internal.erl b/erts/preloaded/src/erts_internal.erl
index 330fcc4a9c..2459ea2a2c 100644
--- a/erts/preloaded/src/erts_internal.erl
+++ b/erts/preloaded/src/erts_internal.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -55,7 +55,9 @@
-export([await_microstate_accounting_modifications/3,
gather_microstate_accounting_result/2]).
-%% Auto-import name clash
+-export([trace/3, trace_pattern/3]).
+
+%% Auto import name clash
-export([check_process_code/2]).
%%
@@ -403,3 +405,28 @@ microstate_accounting(Ref, Threads) ->
{Ref, Res} ->
[Res | microstate_accounting(Ref, Threads - 1)]
end.
+
+-spec trace(PidPortSpec, How, FlagList) -> integer() when
+ PidPortSpec :: pid() | port()
+ | all | processes | ports
+ | existing | existing_processes | existing_ports
+ | new | new_processes | new_ports,
+ How :: boolean(),
+ FlagList :: [].
+trace(_PidSpec, _How, _FlagList) ->
+ erlang:nif_error(undefined).
+
+-type trace_pattern_mfa() ::
+ {atom(),atom(),arity() | '_'} | on_load.
+-type trace_match_spec() ::
+ [{[term()] | '_' ,[term()],[term()]}].
+
+-spec trace_pattern(MFA, MatchSpec, FlagList) -> non_neg_integer() when
+ MFA :: trace_pattern_mfa(),
+ MatchSpec :: (MatchSpecList :: trace_match_spec())
+ | boolean()
+ | restart
+ | pause,
+ FlagList :: [ ].
+trace_pattern(_MFA, _MatchSpec, _FlagList) ->
+ erlang:nif_error(undefined).
diff --git a/erts/preloaded/src/init.erl b/erts/preloaded/src/init.erl
index 5de3732c20..618b53f6bb 100644
--- a/erts/preloaded/src/init.erl
+++ b/erts/preloaded/src/init.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -41,6 +41,7 @@
%% -s : Start own processes.
%%
%% Experimental flags:
+%% -profile_boot : Use an 'eprof light' to profile boot sequence
%% -init_debug : Activate debug printouts in init
%% -loader_debug : Activate debug printouts in erl_prim_loader
%% -code_path_choice : strict | relaxed
@@ -179,7 +180,16 @@ stop(Status) -> init ! {stop,{stop,Status}}, ok.
boot(BootArgs) ->
register(init, self()),
process_flag(trap_exit, true),
+
+ %% Load the tracer nif
+ erl_tracer:on_load(),
+
{Start0,Flags,Args} = parse_boot_args(BootArgs),
+ %% We don't get to profile parsing of BootArgs
+ case get_flag(profile_boot, Flags, false) of
+ false -> ok;
+ true -> debug_profile_start()
+ end,
Start = map(fun prepare_run_args/1, Start0),
boot(Start, Flags, Args).
@@ -297,9 +307,9 @@ crash(String, List) ->
-spec boot_loop(pid(), state()) -> no_return().
boot_loop(BootPid, State) ->
receive
- {BootPid,loaded,ModLoaded} ->
- Loaded = State#state.loaded,
- boot_loop(BootPid,State#state{loaded = [ModLoaded|Loaded]});
+ {BootPid,loaded,NewlyLoaded} ->
+ Loaded = NewlyLoaded ++ State#state.loaded,
+ boot_loop(BootPid, State#state{loaded = Loaded});
{BootPid,started,KernelPid} ->
boot_loop(BootPid, new_kernelpid(KernelPid, BootPid, State));
{BootPid,progress,started} ->
@@ -338,12 +348,25 @@ boot_loop(BootPid, State) ->
end.
ensure_loaded(Module, Loaded) ->
+ case erlang:module_loaded(Module) of
+ true ->
+ {{module, Module}, Loaded};
+ false ->
+ do_ensure_loaded(Module, Loaded)
+ end.
+
+do_ensure_loaded(Module, Loaded) ->
File = atom_to_list(Module) ++ objfile_extension(),
- case catch load_mod(Module,File) of
- {ok, FullName} ->
- {{module, Module}, [{Module, FullName}|Loaded]};
- Res ->
- {Res, Loaded}
+ case erl_prim_loader:get_file(File) of
+ {ok,BinCode,FullName} ->
+ case do_load_module(Module, BinCode) of
+ ok ->
+ {{module, Module}, [{Module, FullName}|Loaded]};
+ error ->
+ {error, [{Module, FullName}|Loaded]}
+ end;
+ Error ->
+ {Error, Loaded}
end.
%% Tell subscribed processes the system has started.
@@ -748,7 +771,14 @@ do_boot(Init,Flags,Start) ->
%% print the node name into the Purify log.
(catch erlang:system_info({purify, "Node: " ++ atom_to_list(node())})),
- start_em(Start).
+ start_em(Start),
+ case get_flag(profile_boot,Flags,false) of
+ false -> ok;
+ true ->
+ debug_profile_format_mfas(debug_profile_mfas()),
+ debug_profile_stop()
+ end,
+ ok.
get_root(Flags) ->
case get_argument(root, Flags) of
@@ -842,13 +872,6 @@ eval_script([{kernel_load_completed}|T], #es{load_mode=Mode}=Es0) ->
_ -> Es0#es{prim_load=false}
end,
eval_script(T, Es);
-eval_script([{primLoad,[Mod]}|T], #es{prim_load=true}=Es) ->
- %% Common special case (loading of error_handler). Nothing
- %% to gain by parallel loading.
- File = atom_to_list(Mod) ++ objfile_extension(),
- {ok,Full} = load_mod(Mod, File),
- init ! {self(),loaded,{Mod,Full}}, % Tell init about loaded module
- eval_script(T, Es);
eval_script([{primLoad,Mods}|T], #es{init=Init,prim_load=PrimLoad}=Es)
when is_list(Mods) ->
case PrimLoad of
@@ -873,14 +896,44 @@ eval_script([], #es{}) ->
eval_script(What, #es{}) ->
exit({'unexpected command in bootfile',What}).
-load_modules([Mod|Mods], Init) ->
- File = atom_to_list(Mod) ++ objfile_extension(),
- {ok,Full} = load_mod(Mod,File),
- Init ! {self(),loaded,{Mod,Full}}, %Tell init about loaded module
- load_modules(Mods, Init);
-load_modules([], _) ->
+load_modules(Mods0, Init) ->
+ Mods = [M || M <- Mods0, not erlang:module_loaded(M)],
+ F = prepare_loading_fun(),
+ case erl_prim_loader:get_modules(Mods, F) of
+ {ok,{Prep0,[]}} ->
+ Prep = [Code || {_,{prepared,Code,_}} <- Prep0],
+ ok = erlang:finish_loading(Prep),
+ Loaded = [{Mod,Full} || {Mod,{_,_,Full}} <- Prep0],
+ Init ! {self(),loaded,Loaded},
+ Beams = [{M,Beam,Full} || {M,{on_load,Beam,Full}} <- Prep0],
+ load_rest(Beams, Init);
+ {ok,{_,[_|_]=Errors}} ->
+ Ms = [M || {M,_} <- Errors],
+ exit({load_failed,Ms})
+ end.
+
+load_rest([{Mod,Beam,Full}|T], Init) ->
+ do_load_module(Mod, Beam),
+ Init ! {self(),loaded,[{Mod,Full}]},
+ load_rest(T, Init);
+load_rest([], _) ->
ok.
+prepare_loading_fun() ->
+ fun(Mod, FullName, Beam) ->
+ case erlang:prepare_loading(Mod, Beam) of
+ Prepared when is_binary(Prepared) ->
+ case erlang:has_prepared_code_on_load(Prepared) of
+ true ->
+ {ok,{on_load,Beam,FullName}};
+ false ->
+ {ok,{prepared,Prepared,FullName}}
+ end;
+ {error,_}=Error ->
+ Error
+ end
+ end.
+
make_path(Pa, Pz, Path, Vars) ->
append([Pa,append([fix_path(Path,Vars),Pz])]).
@@ -1033,35 +1086,17 @@ start_it([_|_]=MFA) ->
[M,F|Args] -> M:F(Args) % Args is a list
end.
-%%
-%% Fetch a module and load it into the system.
-%%
-load_mod(Mod, File) ->
- case erlang:module_loaded(Mod) of
- false ->
- case erl_prim_loader:get_file(File) of
- {ok,BinCode,FullName} ->
- load_mod_code(Mod, BinCode, FullName);
- _ ->
- exit({'cannot load',Mod,get_file})
- end;
- _ -> % Already loaded.
- {ok,File}
- end.
+%% Load a module.
-load_mod_code(Mod, BinCode, FullName) ->
- case erlang:module_loaded(Mod) of
- false ->
- case erlang:load_module(Mod, BinCode) of
- {module,Mod} -> {ok,FullName};
- {error,on_load} ->
- ?ON_LOAD_HANDLER ! {loaded,Mod},
- {ok,FullName};
- Other ->
- exit({'cannot load',Mod,Other})
- end;
- _ -> % Already loaded.
- {ok,FullName}
+do_load_module(Mod, BinCode) ->
+ case erlang:load_module(Mod, BinCode) of
+ {module,Mod} ->
+ ok;
+ {error,on_load} ->
+ ?ON_LOAD_HANDLER ! {loaded,Mod},
+ ok;
+ _ ->
+ error
end.
%% --------------------------------------------------------
@@ -1317,3 +1352,64 @@ run_on_load_handlers([M|Ms], Debug) ->
end
end;
run_on_load_handlers([], _) -> ok.
+
+
+%% debug profile (light variant of eprof)
+debug_profile_start() ->
+ _ = erlang:trace_pattern({'_','_','_'},true,[call_time]),
+ _ = erlang:trace_pattern(on_load,true,[call_time]),
+ _ = erlang:trace(all,true,[call]),
+ ok.
+
+debug_profile_stop() ->
+ _ = erlang:trace_pattern({'_','_','_'},false,[call_time]),
+ _ = erlang:trace_pattern(on_load,false,[call_time]),
+ _ = erlang:trace(all,false,[call]),
+ ok.
+
+debug_profile_mfas() ->
+ _ = erlang:trace_pattern({'_','_','_'},pause,[call_time]),
+ _ = erlang:trace_pattern(on_load,pause,[call_time]),
+ MFAs = collect_loaded_mfas() ++ erlang:system_info(snifs),
+ collect_mfas(MFAs,[]).
+
+%% debug_profile_format_mfas should be called at the end of the boot phase
+%% so all pertinent modules should be loaded at that point.
+debug_profile_format_mfas(MFAs0) ->
+ MFAs = lists:sort(MFAs0),
+ lists:foreach(fun({{Us,C},{M,F,A}}) ->
+ Str = io_lib:format("~w:~w/~w", [M,F,A]),
+ io:format(standard_error,"~55s - ~6w : ~w us~n", [Str,C,Us])
+ end, MFAs),
+ ok.
+
+collect_loaded_mfas() ->
+ Ms = [M || M <- [element(1, Mi) || Mi <- code:all_loaded()]],
+ collect_loaded_mfas(Ms,[]).
+
+collect_loaded_mfas([],MFAs) -> MFAs;
+collect_loaded_mfas([M|Ms],MFAs0) ->
+ MFAs = [{M,F,A} || {F,A} <- M:module_info(functions)],
+ collect_loaded_mfas(Ms,MFAs ++ MFAs0).
+
+
+collect_mfas([], Info) -> Info;
+collect_mfas([MFA|MFAs],Info) ->
+ case erlang:trace_info(MFA,call_time) of
+ {call_time, []} ->
+ collect_mfas(MFAs,Info);
+ {call_time, false} ->
+ collect_mfas(MFAs,Info);
+ {call_time, Data} ->
+ case collect_mfa(MFA,Data,0,0) of
+ {{0,_},_} ->
+ %% ignore mfas with zero time
+ collect_mfas(MFAs,Info);
+ MfaData ->
+ collect_mfas(MFAs,[MfaData|Info])
+ end
+ end.
+
+collect_mfa(Mfa,[],Count,Time) -> {{Time,Count},Mfa};
+collect_mfa(Mfa,[{_Pid,C,S,Us}|Data],Count,Time) ->
+ collect_mfa(Mfa,Data,Count + C,Time + S * 1000000 + Us).
diff --git a/erts/preloaded/src/otp_ring0.erl b/erts/preloaded/src/otp_ring0.erl
index 3158fc7d21..62a60fffe2 100644
--- a/erts/preloaded/src/otp_ring0.erl
+++ b/erts/preloaded/src/otp_ring0.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/preloaded/src/prim_eval.S b/erts/preloaded/src/prim_eval.S
index 1b7b00a7c9..e7f09a870c 100644
--- a/erts/preloaded/src/prim_eval.S
+++ b/erts/preloaded/src/prim_eval.S
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/preloaded/src/prim_eval.erl b/erts/preloaded/src/prim_eval.erl
index 732e22468e..22e924f9e9 100644
--- a/erts/preloaded/src/prim_eval.erl
+++ b/erts/preloaded/src/prim_eval.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/preloaded/src/prim_inet.erl b/erts/preloaded/src/prim_inet.erl
index bd74831bb7..4872ffd00c 100644
--- a/erts/preloaded/src/prim_inet.erl
+++ b/erts/preloaded/src/prim_inet.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/preloaded/src/prim_zip.erl b/erts/preloaded/src/prim_zip.erl
index c4b949afcb..b1ddbbe173 100644
--- a/erts/preloaded/src/prim_zip.erl
+++ b/erts/preloaded/src/prim_zip.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/preloaded/src/zip_internal.hrl b/erts/preloaded/src/zip_internal.hrl
index d5cf52fae4..2769ca152d 100644
--- a/erts/preloaded/src/zip_internal.hrl
+++ b/erts/preloaded/src/zip_internal.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/preloaded/src/zlib.erl b/erts/preloaded/src/zlib.erl
index 473ad649c7..fa0f28c5c3 100644
--- a/erts/preloaded/src/zlib.erl
+++ b/erts/preloaded/src/zlib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/start_scripts/Makefile b/erts/start_scripts/Makefile
index 8025681924..dfd8153f32 100644
--- a/erts/start_scripts/Makefile
+++ b/erts/start_scripts/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2013. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/start_scripts/no_dot_erlang.rel.src b/erts/start_scripts/no_dot_erlang.rel.src
index bcc9fa9e8a..04e5fbf741 100644
--- a/erts/start_scripts/no_dot_erlang.rel.src
+++ b/erts/start_scripts/no_dot_erlang.rel.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/start_scripts/start_all_example.rel.src b/erts/start_scripts/start_all_example.rel.src
index 2c4deb4485..a44f3e2925 100644
--- a/erts/start_scripts/start_all_example.rel.src
+++ b/erts/start_scripts/start_all_example.rel.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/start_scripts/start_clean.rel.src b/erts/start_scripts/start_clean.rel.src
index 25519deb17..ad468aa9df 100644
--- a/erts/start_scripts/start_clean.rel.src
+++ b/erts/start_scripts/start_clean.rel.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/start_scripts/start_sasl.rel.src b/erts/start_scripts/start_sasl.rel.src
index 9cf417ade5..23b6a89e1d 100644
--- a/erts/start_scripts/start_sasl.rel.src
+++ b/erts/start_scripts/start_sasl.rel.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/test/Makefile b/erts/test/Makefile
index a01d67e34f..1fe230adaf 100644
--- a/erts/test/Makefile
+++ b/erts/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2014. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/test/erl_print_SUITE.erl b/erts/test/erl_print_SUITE.erl
index f0fee49024..463d890688 100644
--- a/erts/test/erl_print_SUITE.erl
+++ b/erts/test/erl_print_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,153 +28,133 @@
-module(erl_print_SUITE).
-author('[email protected]').
+-export([all/0, suite/0, init_per_testcase/2, end_per_testcase/2]).
-%-define(line_trace, 1).
-
--define(DEFAULT_TIMEOUT, ?t:minutes(10)).
-
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- init_per_testcase/2, end_per_testcase/2]).
-
--export([erlang_display/1, integer/1, float/1,
- string/1, character/1, snprintf/1, quote/1]).
+-export([erlang_display/1, integer/1, float/1,
+ string/1, character/1, snprintf/1, quote/1]).
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {minutes, 10}}].
all() ->
- test_cases().
-
-groups() ->
- [].
+ [erlang_display, integer, float, string, character,
+ snprintf, quote].
-init_per_suite(Config) ->
- Config.
+init_per_testcase(Case, Config) ->
+ [{testcase, Case}|Config].
-end_per_suite(_Config) ->
+end_per_testcase(_Case, _Config) ->
ok.
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
%%
%%
%% Test cases
%%
%%
-test_cases() ->
- [erlang_display, integer, float, string, character,
- snprintf, quote].
-
-erlang_display(doc) -> [];
-erlang_display(suite) -> [];
erlang_display(Config) when is_list(Config) ->
- ?line put(erlang_display_test, ok),
+ put(erlang_display_test, ok),
OAIS = erts_debug:set_internal_state(available_internal_state, true),
%% atoms
- ?line chk_display(atom, "atom"),
- ?line chk_display(true, "true"),
- ?line chk_display(false, "false"),
- ?line chk_display('DOWN', "'DOWN'"),
- ?line chk_display('EXIT', "'EXIT'"),
- ?line chk_display('asdDofw $@{}][', "'asdDofw $@{}]['"),
+ chk_display(atom, "atom"),
+ chk_display(true, "true"),
+ chk_display(false, "false"),
+ chk_display('DOWN', "'DOWN'"),
+ chk_display('EXIT', "'EXIT'"),
+ chk_display('asdDofw $@{}][', "'asdDofw $@{}]['"),
%% integers
- ?line chk_display(0, "0"),
- ?line chk_display(1, "1"),
- ?line chk_display(4711, "4711"),
- ?line chk_display(((1 bsl 27) - 1), "134217727"),
- ?line chk_display((1 bsl 27), "134217728"),
- ?line chk_display((1 bsl 32), "4294967296"),
- ?line chk_display(11111111111, "11111111111"),
- ?line chk_display((1 bsl 59) - 1, "576460752303423487"),
- ?line chk_display(1 bsl 59, "576460752303423488"),
- ?line chk_display(111111111111111111111, "111111111111111111111"),
- ?line chk_display(123456789012345678901234567890,
- "123456789012345678901234567890"),
- ?line chk_display(1 bsl 10000, str_1_bsl_10000()),
- ?line chk_display(-1, "-1"),
- ?line chk_display(-4711, "-4711"),
- ?line chk_display(-(1 bsl 27), "-134217728"),
- ?line chk_display(-((1 bsl 27) + 1), "-134217729"),
- ?line chk_display(-(1 bsl 32), "-4294967296"),
- ?line chk_display(-11111111111, "-11111111111"),
- ?line chk_display(-(1 bsl 59), "-576460752303423488"),
- ?line chk_display(-((1 bsl 59) + 1), "-576460752303423489"),
- ?line chk_display(-111111111111111111111, "-111111111111111111111"),
- ?line chk_display(-123456789012345678901234567890,
- "-123456789012345678901234567890"),
- ?line chk_display(-(1 bsl 10000), [$- | str_1_bsl_10000()]),
-
- ?line MyCre = my_cre(),
+ chk_display(0, "0"),
+ chk_display(1, "1"),
+ chk_display(4711, "4711"),
+ chk_display(((1 bsl 27) - 1), "134217727"),
+ chk_display((1 bsl 27), "134217728"),
+ chk_display((1 bsl 32), "4294967296"),
+ chk_display(11111111111, "11111111111"),
+ chk_display((1 bsl 59) - 1, "576460752303423487"),
+ chk_display(1 bsl 59, "576460752303423488"),
+ chk_display(111111111111111111111, "111111111111111111111"),
+ chk_display(123456789012345678901234567890,
+ "123456789012345678901234567890"),
+ chk_display(1 bsl 10000, str_1_bsl_10000()),
+ chk_display(-1, "-1"),
+ chk_display(-4711, "-4711"),
+ chk_display(-(1 bsl 27), "-134217728"),
+ chk_display(-((1 bsl 27) + 1), "-134217729"),
+ chk_display(-(1 bsl 32), "-4294967296"),
+ chk_display(-11111111111, "-11111111111"),
+ chk_display(-(1 bsl 59), "-576460752303423488"),
+ chk_display(-((1 bsl 59) + 1), "-576460752303423489"),
+ chk_display(-111111111111111111111, "-111111111111111111111"),
+ chk_display(-123456789012345678901234567890,
+ "-123456789012345678901234567890"),
+ chk_display(-(1 bsl 10000), [$- | str_1_bsl_10000()]),
+
+ MyCre = my_cre(),
%% pids
- ?line chk_display(mk_pid_xstr({node(), MyCre}, 4711, 42)),
- ?line chk_display(mk_pid_xstr({node(), oth_cre(MyCre)}, 4711, 42)),
- ?line chk_display(mk_pid_xstr({node(), oth_cre(oth_cre(MyCre))}, 4711, 42)),
+ chk_display(mk_pid_xstr({node(), MyCre}, 4711, 42)),
+ chk_display(mk_pid_xstr({node(), oth_cre(MyCre)}, 4711, 42)),
+ chk_display(mk_pid_xstr({node(), oth_cre(oth_cre(MyCre))}, 4711, 42)),
- ?line chk_display(mk_pid_xstr({a@b, MyCre}, 4711, 42)),
- ?line chk_display(mk_pid_xstr({a@b, oth_cre(MyCre)}, 4711, 42)),
- ?line chk_display(mk_pid_xstr({a@b, oth_cre(oth_cre(MyCre))}, 4711, 42)),
+ chk_display(mk_pid_xstr({a@b, MyCre}, 4711, 42)),
+ chk_display(mk_pid_xstr({a@b, oth_cre(MyCre)}, 4711, 42)),
+ chk_display(mk_pid_xstr({a@b, oth_cre(oth_cre(MyCre))}, 4711, 42)),
%% ports
- ?line chk_display(mk_port_xstr({node(), MyCre}, 4711)),
- ?line chk_display(mk_port_xstr({node(), oth_cre(MyCre)}, 4711)),
- ?line chk_display(mk_port_xstr({node(), oth_cre(oth_cre(MyCre))}, 4711)),
+ chk_display(mk_port_xstr({node(), MyCre}, 4711)),
+ chk_display(mk_port_xstr({node(), oth_cre(MyCre)}, 4711)),
+ chk_display(mk_port_xstr({node(), oth_cre(oth_cre(MyCre))}, 4711)),
- ?line chk_display(mk_port_xstr({c@d, MyCre}, 4711)),
- ?line chk_display(mk_port_xstr({c@d, oth_cre(MyCre)}, 4711)),
- ?line chk_display(mk_port_xstr({c@d, oth_cre(oth_cre(MyCre))}, 4711)),
+ chk_display(mk_port_xstr({c@d, MyCre}, 4711)),
+ chk_display(mk_port_xstr({c@d, oth_cre(MyCre)}, 4711)),
+ chk_display(mk_port_xstr({c@d, oth_cre(oth_cre(MyCre))}, 4711)),
%% refs
- ?line chk_display(mk_ref_xstr({node(), MyCre}, [1,2,3])),
- ?line chk_display(mk_ref_xstr({node(), oth_cre(MyCre)}, [1,2,3])),
- ?line chk_display(mk_ref_xstr({node(), oth_cre(oth_cre(MyCre))}, [1,2,3])),
+ chk_display(mk_ref_xstr({node(), MyCre}, [1,2,3])),
+ chk_display(mk_ref_xstr({node(), oth_cre(MyCre)}, [1,2,3])),
+ chk_display(mk_ref_xstr({node(), oth_cre(oth_cre(MyCre))}, [1,2,3])),
- ?line chk_display(mk_ref_xstr({e@f, MyCre},[1,2,3] )),
- ?line chk_display(mk_ref_xstr({e@f, oth_cre(MyCre)}, [1,2,3])),
- ?line chk_display(mk_ref_xstr({e@f, oth_cre(oth_cre(MyCre))}, [1,2,3])),
+ chk_display(mk_ref_xstr({e@f, MyCre},[1,2,3] )),
+ chk_display(mk_ref_xstr({e@f, oth_cre(MyCre)}, [1,2,3])),
+ chk_display(mk_ref_xstr({e@f, oth_cre(oth_cre(MyCre))}, [1,2,3])),
%% Compund terms
- ?line {Pid, PidStr} = mk_pid_xstr({x@y, oth_cre(MyCre)}, 4712, 41),
- ?line {Port, PortStr} = mk_port_xstr({x@y, oth_cre(MyCre)}, 4712),
- ?line {Ref, RefStr} = mk_ref_xstr({e@f, oth_cre(MyCre)}, [11,12,13]),
-
- ?line chk_display({atom,-4711,Ref,{"hej",[Pid,222222222222222222222222,Port,4711]}},
- "{atom,-4711,"++RefStr++",{\"hej\",["++PidStr++",222222222222222222222222,"++PortStr++",4711]}}"),
- ?line chk_display({{{{{{{{{{{{{{{{{{{{{{{hi}}}}}}}}}}}}}}}}}}}}}}},
- "{{{{{{{{{{{{{{{{{{{{{{{hi}}}}}}}}}}}}}}}}}}}}}}}"),
- ?line chk_display([[[[[[[[[[[[[[[[[[[[[[[yo]]]]]]]]]]]]]]]]]]]]]]],
- "[[[[[[[[[[[[[[[[[[[[[[[yo]]]]]]]]]]]]]]]]]]]]]]]"),
- ?line chk_display({[{[{[{[{[{[{[{[{[{[{[{[ii]}]}]}]}]}]}]}]}]}]}]}]},
- "{[{[{[{[{[{[{[{[{[{[{[{[ii]}]}]}]}]}]}]}]}]}]}]}]}"),
- ?line chk_display([], "[]"), % Not really a compound term :)
- ?line chk_display([a|b], "[a|b]"),
- ?line chk_display([a,b,c|z], "[a,b,c|z]"),
- ?line chk_display([a,b,c], "[a,b,c]"),
- ?line chk_display([Pid,Port,Ref],
- "["++PidStr++","++PortStr++","++RefStr++"]"),
- ?line chk_display("abcdefghijklmnopqrstuvwxyz",
- "\"abcdefghijklmnopqrstuvwxyz\""),
- ?line chk_display("ABCDEFGHIJKLMNOPQRSTUVWXYZ",
- "\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\""),
- ?line chk_display("H E J", "\"H E J\""),
- ?line chk_display("asdDofw $@{}][", "\"asdDofw $@{}][\""),
-
+ {Pid, PidStr} = mk_pid_xstr({x@y, oth_cre(MyCre)}, 4712, 41),
+ {Port, PortStr} = mk_port_xstr({x@y, oth_cre(MyCre)}, 4712),
+ {Ref, RefStr} = mk_ref_xstr({e@f, oth_cre(MyCre)}, [11,12,13]),
+
+ chk_display({atom,-4711,Ref,{"hej",[Pid,222222222222222222222222,Port,4711]}},
+ "{atom,-4711,"++RefStr++",{\"hej\",["++PidStr++",222222222222222222222222,"++PortStr++",4711]}}"),
+ chk_display({{{{{{{{{{{{{{{{{{{{{{{hi}}}}}}}}}}}}}}}}}}}}}}},
+ "{{{{{{{{{{{{{{{{{{{{{{{hi}}}}}}}}}}}}}}}}}}}}}}}"),
+ chk_display([[[[[[[[[[[[[[[[[[[[[[[yo]]]]]]]]]]]]]]]]]]]]]]],
+ "[[[[[[[[[[[[[[[[[[[[[[[yo]]]]]]]]]]]]]]]]]]]]]]]"),
+ chk_display({[{[{[{[{[{[{[{[{[{[{[{[ii]}]}]}]}]}]}]}]}]}]}]}]},
+ "{[{[{[{[{[{[{[{[{[{[{[{[ii]}]}]}]}]}]}]}]}]}]}]}]}"),
+ chk_display([], "[]"), % Not really a compound term :)
+ chk_display([a|b], "[a|b]"),
+ chk_display([a,b,c|z], "[a,b,c|z]"),
+ chk_display([a,b,c], "[a,b,c]"),
+ chk_display([Pid,Port,Ref],
+ "["++PidStr++","++PortStr++","++RefStr++"]"),
+ chk_display("abcdefghijklmnopqrstuvwxyz",
+ "\"abcdefghijklmnopqrstuvwxyz\""),
+ chk_display("ABCDEFGHIJKLMNOPQRSTUVWXYZ",
+ "\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\""),
+ chk_display("H E J", "\"H E J\""),
+ chk_display("asdDofw $@{}][", "\"asdDofw $@{}][\""),
+
%%
%% TODO: Check binaries, fun and floats...
%%
erts_debug:set_internal_state(available_internal_state, OAIS),
- ?line ok = get(erlang_display_test).
+ ok = get(erlang_display_test).
get_chnl_no(NodeName) when is_atom(NodeName) ->
erts_debug:get_internal_state({channel_number, NodeName}).
@@ -182,20 +162,20 @@ get_chnl_no(NodeName) when is_atom(NodeName) ->
chk_display(Term, Expect) when is_list(Expect) ->
Dstr = erts_debug:display(Term),
case Expect ++ io_lib:nl() of
- Dstr ->
- ?t:format("Test of \"~p\" succeeded.~n"
- " Expected and got: ~s~n",
- [Term, io_lib:write_string(Dstr)]);
- DoExpect ->
- ?t:format("***~n"
- "*** Test of \"~p\" failed!~n"
- "*** Expected: ~s~n"
- "*** Got: ~s~n"
- "***~n",
- [Term,
- io_lib:write_string(DoExpect),
- io_lib:write_string(Dstr)]),
- put(erlang_display_test, failed)
+ Dstr ->
+ io:format("Test of \"~p\" succeeded.~n"
+ " Expected and got: ~s~n",
+ [Term, io_lib:write_string(Dstr)]);
+ DoExpect ->
+ io:format("***~n"
+ "*** Test of \"~p\" failed!~n"
+ "*** Expected: ~s~n"
+ "*** Got: ~s~n"
+ "***~n",
+ [Term,
+ io_lib:write_string(DoExpect),
+ io_lib:write_string(Dstr)]),
+ put(erlang_display_test, failed)
end.
chk_display({Term, Expect}) ->
@@ -204,20 +184,20 @@ chk_display({Term, Expect}) ->
mk_pid_xstr({NodeName, Creation}, Number, Serial) ->
Pid = mk_pid({NodeName, Creation}, Number, Serial),
XStr = "<" ++ integer_to_list(get_chnl_no(NodeName))
- ++ "." ++ integer_to_list(Number)
- ++ "." ++ integer_to_list(Serial) ++ ">",
+ ++ "." ++ integer_to_list(Number)
+ ++ "." ++ integer_to_list(Serial) ++ ">",
{Pid, XStr}.
mk_port_xstr({NodeName, Creation}, Number) ->
Port = mk_port({NodeName, Creation}, Number),
XStr = "#Port<" ++ integer_to_list(get_chnl_no(NodeName))
- ++ "." ++ integer_to_list(Number) ++ ">",
+ ++ "." ++ integer_to_list(Number) ++ ">",
{Port, XStr}.
mk_ref_xstr({NodeName, Creation}, Numbers) ->
Ref = mk_ref({NodeName, Creation}, Numbers),
XStr = "#Ref<" ++ integer_to_list(get_chnl_no(NodeName))
- ++ ref_numbers_xstr(Numbers) ++ ">",
+ ++ ref_numbers_xstr(Numbers) ++ ">",
{Ref, XStr}.
ref_numbers_xstr([]) ->
@@ -240,18 +220,7 @@ ref_numbers_xstr([N | Ns]) ->
%%
%%
-default_testcase_impl(doc) -> [];
-default_testcase_impl(suite) -> [];
-default_testcase_impl(Config) when is_list(Config) -> ?line run_case(Config).
-
-init_per_testcase(Case, Config) ->
- Dog = ?t:timetrap(?DEFAULT_TIMEOUT),
- [{testcase, Case}, {watchdog, Dog} |Config].
-
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
- ok.
+default_testcase_impl(Config) when is_list(Config) -> run_case(Config).
-define(TESTPROG, "erl_print_tests").
-define(FAILED_MARKER, $E,$P,$-,$T,$E,$S,$T,$-,$F,$A,$I,$L,$U,$R,$E).
@@ -260,62 +229,62 @@ end_per_testcase(_Case, Config) ->
-define(PID_MARKER, $E,$P,$-,$T,$E,$S,$T,$-,$P,$I,$D).
port_prog_killer(EProc, OSProc) when is_pid(EProc), is_list(OSProc) ->
- ?line process_flag(trap_exit, true),
- ?line Ref = erlang:monitor(process, EProc),
- ?line receive
- {'DOWN', Ref, _, _, Reason} when is_tuple(Reason),
- element(1, Reason)
- == timetrap_timeout ->
- ?line Cmd = "kill -9 " ++ OSProc,
- ?line ?t:format("Test case timed out. "
- "Trying to kill port program.~n"
- " Executing: ~p~n", [Cmd]),
- ?line case os:cmd(Cmd) of
- [] ->
- ok;
- OsCmdRes ->
- ?line ?t:format(" ~s", [OsCmdRes])
- end;
- {'DOWN', Ref, _, _, _} ->
- %% OSProc is assumed to have terminated by itself
- ?line ok
- end.
+ process_flag(trap_exit, true),
+ Ref = erlang:monitor(process, EProc),
+ receive
+ {'DOWN', Ref, _, _, Reason} when is_tuple(Reason),
+ element(1, Reason)
+ == timetrap_timeout ->
+ Cmd = "kill -9 " ++ OSProc,
+ io:format("Test case timed out. "
+ "Trying to kill port program.~n"
+ " Executing: ~p~n", [Cmd]),
+ case os:cmd(Cmd) of
+ [] ->
+ ok;
+ OsCmdRes ->
+ io:format(" ~s", [OsCmdRes])
+ end;
+ {'DOWN', Ref, _, _, _} ->
+ %% OSProc is assumed to have terminated by itself
+ ok
+ end.
get_line(_Port, eol, Data) ->
- ?line Data;
+ Data;
get_line(Port, noeol, Data) ->
- ?line receive
- {Port, {data, {Flag, NextData}}} ->
- ?line get_line(Port, Flag, Data ++ NextData);
- {Port, eof} ->
- ?line ?t:fail(port_prog_unexpectedly_closed)
- end.
+ receive
+ {Port, {data, {Flag, NextData}}} ->
+ get_line(Port, Flag, Data ++ NextData);
+ {Port, eof} ->
+ ct:fail(port_prog_unexpectedly_closed)
+ end.
read_case_data(Port, TestCase) ->
- ?line receive
- {Port, {data, {eol, [?SUCCESS_MARKER]}}} ->
- ?line ok;
- {Port, {data, {Flag, [?SUCCESS_MARKER | CommentStart]}}} ->
- ?line {comment, get_line(Port, Flag, CommentStart)};
- {Port, {data, {Flag, [?SKIPPED_MARKER | CommentStart]}}} ->
- ?line {skipped, get_line(Port, Flag, CommentStart)};
- {Port, {data, {Flag, [?FAILED_MARKER | ReasonStart]}}} ->
- ?line ?t:fail(get_line(Port, Flag, ReasonStart));
- {Port, {data, {eol, [?PID_MARKER | PidStr]}}} ->
- ?line ?t:format("Port program pid: ~s~n", [PidStr]),
- ?line CaseProc = self(),
- ?line _ = list_to_integer(PidStr), % Sanity check
- spawn_opt(fun () ->
- port_prog_killer(CaseProc, PidStr)
- end,
- [{priority, max}, link]),
- read_case_data(Port, TestCase);
- {Port, {data, {Flag, LineStart}}} ->
- ?line ?t:format("~s~n", [get_line(Port, Flag, LineStart)]),
- read_case_data(Port, TestCase);
- {Port, eof} ->
- ?line ?t:fail(port_prog_unexpectedly_closed)
- end.
+ receive
+ {Port, {data, {eol, [?SUCCESS_MARKER]}}} ->
+ ok;
+ {Port, {data, {Flag, [?SUCCESS_MARKER | CommentStart]}}} ->
+ {comment, get_line(Port, Flag, CommentStart)};
+ {Port, {data, {Flag, [?SKIPPED_MARKER | CommentStart]}}} ->
+ {skipped, get_line(Port, Flag, CommentStart)};
+ {Port, {data, {Flag, [?FAILED_MARKER | ReasonStart]}}} ->
+ ct:fail(get_line(Port, Flag, ReasonStart));
+ {Port, {data, {eol, [?PID_MARKER | PidStr]}}} ->
+ io:format("Port program pid: ~s~n", [PidStr]),
+ CaseProc = self(),
+ _ = list_to_integer(PidStr), % Sanity check
+ spawn_opt(fun () ->
+ port_prog_killer(CaseProc, PidStr)
+ end,
+ [{priority, max}, link]),
+ read_case_data(Port, TestCase);
+ {Port, {data, {Flag, LineStart}}} ->
+ io:format("~s~n", [get_line(Port, Flag, LineStart)]),
+ read_case_data(Port, TestCase);
+ {Port, eof} ->
+ ct:fail(port_prog_unexpectedly_closed)
+ end.
run_case(Config) ->
run_case(Config, "").
@@ -324,27 +293,27 @@ run_case(Config, TestArgs) ->
run_case(Config, TestArgs, fun (_Port) -> ok end).
run_case(Config, TestArgs, Fun) ->
- Test = atom_to_list(?config(testcase, Config)),
- TestProg = filename:join([?config(data_dir, Config),
- ?TESTPROG
- ++ "."
- ++ atom_to_list(erlang:system_info(threads))]),
+ Test = atom_to_list(proplists:get_value(testcase, Config)),
+ TestProg = filename:join([proplists:get_value(data_dir, Config),
+ ?TESTPROG
+ ++ "."
+ ++ atom_to_list(erlang:system_info(threads))]),
Cmd = TestProg ++ " " ++ Test ++ " " ++ TestArgs,
case catch open_port({spawn, Cmd}, [stream,
- use_stdio,
- stderr_to_stdout,
- eof,
- {line, 1024}]) of
- Port when is_port(Port) ->
- ?line Fun(Port),
- ?line CaseResult = read_case_data(Port, Test),
- ?line receive
- {Port, eof} ->
- ?line ok
- end,
- ?line CaseResult;
- Error ->
- ?line ?t:fail({open_port_failed, Error})
+ use_stdio,
+ stderr_to_stdout,
+ eof,
+ {line, 1024}]) of
+ Port when is_port(Port) ->
+ Fun(Port),
+ CaseResult = read_case_data(Port, Test),
+ receive
+ {Port, eof} ->
+ ok
+ end,
+ CaseResult;
+ Error ->
+ ct:fail({open_port_failed, Error})
end.
@@ -382,80 +351,80 @@ 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})
+ ?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})
+ ?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) ->
+ 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) ->
+ 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})
+ ?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) ->
+ 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})
+ ?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.
my_cre() -> erlang:system_info(creation).
diff --git a/erts/test/erl_print_SUITE_data/Makefile.src b/erts/test/erl_print_SUITE_data/Makefile.src
index e6ea5cc6b9..69ff434c56 100644
--- a/erts/test/erl_print_SUITE_data/Makefile.src
+++ b/erts/test/erl_print_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2012. All Rights Reserved.
+# Copyright Ericsson AB 2005-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/test/erl_print_SUITE_data/character_test.h b/erts/test/erl_print_SUITE_data/character_test.h
index 9ff032cb07..82310ee8e7 100644
--- a/erts/test/erl_print_SUITE_data/character_test.h
+++ b/erts/test/erl_print_SUITE_data/character_test.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/test/erl_print_SUITE_data/erl_print_tests.c b/erts/test/erl_print_SUITE_data/erl_print_tests.c
index fb23dc35a6..2fb7d1ff25 100644
--- a/erts/test/erl_print_SUITE_data/erl_print_tests.c
+++ b/erts/test/erl_print_SUITE_data/erl_print_tests.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/test/erl_print_SUITE_data/integer_64_test.h b/erts/test/erl_print_SUITE_data/integer_64_test.h
index 0c3e7b98a8..4bfc91334d 100644
--- a/erts/test/erl_print_SUITE_data/integer_64_test.h
+++ b/erts/test/erl_print_SUITE_data/integer_64_test.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/test/erl_print_SUITE_data/integer_test.h b/erts/test/erl_print_SUITE_data/integer_test.h
index b91f3622d6..b3744928b7 100644
--- a/erts/test/erl_print_SUITE_data/integer_test.h
+++ b/erts/test/erl_print_SUITE_data/integer_test.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/test/erl_print_SUITE_data/snprintf_test.h b/erts/test/erl_print_SUITE_data/snprintf_test.h
index c612a65521..77692304a3 100644
--- a/erts/test/erl_print_SUITE_data/snprintf_test.h
+++ b/erts/test/erl_print_SUITE_data/snprintf_test.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/test/erl_print_SUITE_data/string_test.h b/erts/test/erl_print_SUITE_data/string_test.h
index 0e257888e6..bfe4215d8a 100644
--- a/erts/test/erl_print_SUITE_data/string_test.h
+++ b/erts/test/erl_print_SUITE_data/string_test.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/test/erlc_SUITE.erl b/erts/test/erlc_SUITE.erl
index 7e44be1fe0..237558a129 100644
--- a/erts/test/erlc_SUITE.erl
+++ b/erts/test/erlc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -22,10 +22,10 @@
%% Tests the erlc command by compiling various types of files.
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2, compile_erl/1,
- compile_yecc/1, compile_script/1,
- compile_mib/1, good_citizen/1, deep_cwd/1, arg_overflow/1,
- make_dep_options/1]).
+ init_per_group/2,end_per_group/2, compile_erl/1,
+ compile_yecc/1, compile_script/1,
+ compile_mib/1, good_citizen/1, deep_cwd/1, arg_overflow/1,
+ make_dep_options/1]).
-include_lib("common_test/include/ct.hrl").
@@ -57,113 +57,109 @@ end_per_group(_GroupName, Config) ->
%% Tests that compiling Erlang source code works.
compile_erl(Config) when is_list(Config) ->
- ?line {SrcDir, OutDir, Cmd} = get_cmd(Config),
- ?line FileName = filename:join(SrcDir, "erl_test_ok.erl"),
+ {SrcDir, OutDir, Cmd} = get_cmd(Config),
+ FileName = filename:join(SrcDir, "erl_test_ok.erl"),
%% By default, warnings are now turned on.
- ?line run(Config, Cmd, FileName, "",
- ["Warning: function foo/0 is unused\$",
- "_OK_"]),
+ run(Config, Cmd, FileName, "",
+ ["Warning: function foo/0 is unused\$", "_OK_"]),
%% Test that the compiled file is where it should be,
%% and that it is runnable.
- ?line {module, erl_test_ok} = code:load_abs(filename:join(OutDir,
- "erl_test_ok")),
- ?line 42 = erl_test_ok:shoe_size(#person{shoe_size=42}),
- ?line code:purge(erl_test_ok),
+ {module, erl_test_ok} = code:load_abs(filename:join(OutDir, "erl_test_ok")),
+ 42 = erl_test_ok:shoe_size(#person{shoe_size=42}),
+ code:purge(erl_test_ok),
%% Try disabling warnings.
- ?line run(Config, Cmd, FileName, "-W0", ["_OK_"]),
+ run(Config, Cmd, FileName, "-W0", ["_OK_"]),
%% Try treating warnings as errors.
- ?line run(Config, Cmd, FileName, "-Werror",
- ["compile: warnings being treated as errors\$",
- "function foo/0 is unused\$",
- "_ERROR_"]),
+ run(Config, Cmd, FileName, "-Werror",
+ ["compile: warnings being treated as errors\$",
+ "function foo/0 is unused\$", "_ERROR_"]),
%% Check a bad file.
- ?line BadFile = filename:join(SrcDir, "erl_test_bad.erl"),
- ?line run(Config, Cmd, BadFile, "", ["function non_existing/1 undefined\$",
- "_ERROR_"]),
+ BadFile = filename:join(SrcDir, "erl_test_bad.erl"),
+ run(Config, Cmd, BadFile, "", ["function non_existing/1 undefined\$",
+ "_ERROR_"]),
ok.
%% Test that compiling yecc source code works.
compile_yecc(Config) when is_list(Config) ->
- ?line {SrcDir, _, OutDir} = get_dirs(Config),
- ?line Cmd = erlc() ++ " -o" ++ OutDir ++ " ",
- ?line FileName = filename:join(SrcDir, "yecc_test_ok.yrl"),
- ?line run(Config, Cmd, FileName, "-W0", ["_OK_"]),
- ?line true = exists(filename:join(OutDir, "yecc_test_ok.erl")),
-
- ?line BadFile = filename:join(SrcDir, "yecc_test_bad.yrl"),
- ?line run(Config, Cmd, BadFile, "-W0",
- ["rootsymbol form is not a nonterminal\$",
- "undefined nonterminal: form\$",
- "Nonterminals is missing\$",
- "_ERROR_"]),
- ?line exists(filename:join(OutDir, "yecc_test_ok.erl")),
-
+ {SrcDir, _, OutDir} = get_dirs(Config),
+ Cmd = erlc() ++ " -o" ++ OutDir ++ " ",
+ FileName = filename:join(SrcDir, "yecc_test_ok.yrl"),
+ run(Config, Cmd, FileName, "-W0", ["_OK_"]),
+ true = exists(filename:join(OutDir, "yecc_test_ok.erl")),
+
+ BadFile = filename:join(SrcDir, "yecc_test_bad.yrl"),
+ run(Config, Cmd, BadFile, "-W0",
+ ["rootsymbol form is not a nonterminal\$",
+ "undefined nonterminal: form\$",
+ "Nonterminals is missing\$",
+ "_ERROR_"]),
+ exists(filename:join(OutDir, "yecc_test_ok.erl")),
ok.
%% Test that compiling start scripts works.
compile_script(Config) when is_list(Config) ->
- ?line {SrcDir, OutDir, Cmd} = get_cmd(Config),
- ?line FileName = filename:join(SrcDir, "start_ok.script"),
- ?line run(Config, Cmd, FileName, "", ["_OK_"]),
- ?line true = exists(filename:join(OutDir, "start_ok.boot")),
+ {SrcDir, OutDir, Cmd} = get_cmd(Config),
+ FileName = filename:join(SrcDir, "start_ok.script"),
+ run(Config, Cmd, FileName, "", ["_OK_"]),
+ true = exists(filename:join(OutDir, "start_ok.boot")),
- ?line BadFile = filename:join(SrcDir, "start_bad.script"),
- ?line run(Config, Cmd, BadFile, "", ["syntax error before:", "_ERROR_"]),
+ BadFile = filename:join(SrcDir, "start_bad.script"),
+ run(Config, Cmd, BadFile, "", ["syntax error before:", "_ERROR_"]),
ok.
%% Test that compiling SNMP mibs works.
compile_mib(Config) when is_list(Config) ->
- ?line {SrcDir, OutDir, Cmd} = get_cmd(Config),
- ?line FileName = filename:join(SrcDir, "GOOD-MIB.mib"),
- ?line run(Config, Cmd, FileName, "", ["_OK_"]),
- ?line Output = filename:join(OutDir, "GOOD-MIB.bin"),
- ?line true = exists(Output),
+ {SrcDir, OutDir, Cmd} = get_cmd(Config),
+ FileName = filename:join(SrcDir, "GOOD-MIB.mib"),
+ run(Config, Cmd, FileName, "", ["_OK_"]),
+ Output = filename:join(OutDir, "GOOD-MIB.bin"),
+ true = exists(Output),
%% Try -W option.
- ?line ok = file:delete(Output),
- ?line run(Config, Cmd, FileName, "-W",
- ["_OK_"]),
- ?line true = exists(Output),
+ ok = file:delete(Output),
+ run(Config, Cmd, FileName, "-W",
+ ["_OK_"]),
+ true = exists(Output),
%% Try -W option and more verbose.
- ?line ok = file:delete(Output),
- ?line case test_server:os_type() of
- {unix,_} ->
- ?line run(Config, Cmd, FileName, "-W +'{verbosity,info}'",
- ["\\[GOOD-MIB[.]mib\\]\\[INF\\]: No accessfunction for 'sysDescr' => using default",
- "_OK_"]),
- ?line true = exists(Output),
- ?line ok = file:delete(Output);
- _ -> ok %Don't bother -- too much work.
- end,
+ ok = file:delete(Output),
+ case test_server:os_type() of
+ {unix,_} ->
+ run(Config, Cmd, FileName, "-W +'{verbosity,info}'",
+ ["\\[GOOD-MIB[.]mib\\]\\[INF\\]: No accessfunction for 'sysDescr' => using default",
+ "_OK_"]),
+ true = exists(Output),
+ ok = file:delete(Output);
+ _ -> ok %Don't bother -- too much work.
+ end,
%% Try a bad file.
- ?line BadFile = filename:join(SrcDir, "BAD-MIB.mib"),
- ?line run(Config, Cmd, BadFile, "",
- ["BAD-MIB.mib: 1: syntax error before: mibs\$",
- "compilation_failed_ERROR_"]),
+ BadFile = filename:join(SrcDir, "BAD-MIB.mib"),
+ run(Config, Cmd, BadFile, "",
+ ["BAD-MIB.mib: 1: syntax error before: mibs\$",
+ "compilation_failed_ERROR_"]),
%% Make sure that no -I option works.
- ?line NewCmd = erlc() ++ " -o" ++ OutDir ++ " ",
- ?line run(Config, NewCmd, FileName, "", ["_OK_"]),
- ?line true = exists(Output),
+ NewCmd = erlc() ++ " -o" ++ OutDir ++ " ",
+ run(Config, NewCmd, FileName, "", ["_OK_"]),
+ true = exists(Output),
ok.
@@ -171,91 +167,91 @@ compile_mib(Config) when is_list(Config) ->
%% shell script with redirected input).
good_citizen(Config) when is_list(Config) ->
case os:type() of
- {unix, _} ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Answer = filename:join(PrivDir, "answer"),
- ?line Script = filename:join(PrivDir, "test_script"),
- ?line Test = filename:join(PrivDir, "test.erl"),
- ?line S = ["#! /bin/sh\n", "erlc ", Test, "\n",
- "read reply\n", "echo $reply\n"],
- ?line ok = file:write_file(Script, S),
- ?line ok = file:write_file(Test, "-module(test).\n"),
- ?line Cmd = "echo y | sh " ++ Script ++ " > " ++ Answer,
- ?line os:cmd(Cmd),
- ?line {ok, Answer0} = file:read_file(Answer),
- ?line [$y|_] = binary_to_list(Answer0),
- ok;
- _ ->
- {skip, "Unix specific"}
+ {unix, _} ->
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Answer = filename:join(PrivDir, "answer"),
+ Script = filename:join(PrivDir, "test_script"),
+ Test = filename:join(PrivDir, "test.erl"),
+ S = ["#! /bin/sh\n", "erlc ", Test, "\n",
+ "read reply\n", "echo $reply\n"],
+ ok = file:write_file(Script, S),
+ ok = file:write_file(Test, "-module(test).\n"),
+ Cmd = "echo y | sh " ++ Script ++ " > " ++ Answer,
+ os:cmd(Cmd),
+ {ok, Answer0} = file:read_file(Answer),
+ [$y|_] = binary_to_list(Answer0),
+ ok;
+ _ ->
+ {skip, "Unix specific"}
end.
%% Make sure that compiling an Erlang module deep down in
%% in a directory with more than 255 characters works.
deep_cwd(Config) when is_list(Config) ->
case os:type() of
- {unix, _} ->
- PrivDir = ?config(priv_dir, Config),
- deep_cwd_1(PrivDir);
- _ ->
- {skip, "Only a problem on Unix"}
+ {unix, _} ->
+ PrivDir = proplists:get_value(priv_dir, Config),
+ deep_cwd_1(PrivDir);
+ _ ->
+ {skip, "Only a problem on Unix"}
end.
deep_cwd_1(PrivDir) ->
- ?line DeepDir0 = filename:join(PrivDir, lists:duplicate(128, $a)),
- ?line DeepDir = filename:join(DeepDir0, lists:duplicate(128, $b)),
- ?line ok = file:make_dir(DeepDir0),
- ?line ok = file:make_dir(DeepDir),
- ?line ok = file:set_cwd(DeepDir),
- ?line ok = file:write_file("test.erl", "-module(test).\n\n"),
- ?line io:format("~s\n", [os:cmd("erlc test.erl")]),
- ?line true = filelib:is_file("test.beam"),
+ DeepDir0 = filename:join(PrivDir, lists:duplicate(128, $a)),
+ DeepDir = filename:join(DeepDir0, lists:duplicate(128, $b)),
+ ok = file:make_dir(DeepDir0),
+ ok = file:make_dir(DeepDir),
+ ok = file:set_cwd(DeepDir),
+ ok = file:write_file("test.erl", "-module(test).\n\n"),
+ io:format("~s\n", [os:cmd("erlc test.erl")]),
+ true = filelib:is_file("test.beam"),
ok.
%% Test that a large number of command line switches does not
%% overflow the argument buffer
arg_overflow(Config) when is_list(Config) ->
- ?line {SrcDir, _OutDir, Cmd} = get_cmd(Config),
- ?line FileName = filename:join(SrcDir, "erl_test_ok.erl"),
+ {SrcDir, _OutDir, Cmd} = get_cmd(Config),
+ FileName = filename:join(SrcDir, "erl_test_ok.erl"),
%% Each -D option will be expanded to three arguments when
%% invoking 'erl'.
- ?line NumDOptions = num_d_options(),
- ?line Args = lists:flatten([ ["-D", integer_to_list(N, 36), "=1 "] ||
- N <- lists:seq(1, NumDOptions) ]),
- ?line run(Config, Cmd, FileName, Args,
- ["Warning: function foo/0 is unused\$",
- "_OK_"]),
+ NumDOptions = num_d_options(),
+ Args = lists:flatten([ ["-D", integer_to_list(N, 36), "=1 "] ||
+ N <- lists:seq(1, NumDOptions) ]),
+ run(Config, Cmd, FileName, Args,
+ ["Warning: function foo/0 is unused\$",
+ "_OK_"]),
ok.
num_d_options() ->
case {os:type(),os:version()} of
- {{win32,_},_} ->
- %% The maximum size of a command line in the command
- %% shell on Windows is 8191 characters.
- %% Each -D option is expanded to "@dv NN 1", i.e.
- %% 8 characters. (Numbers up to 1295 can be expressed
- %% as two 36-base digits.)
- 1000;
- {{unix,linux},Version} when Version < {2,6,23} ->
- %% On some older 64-bit versions of Linux, the maximum number
- %% of arguments is 16383.
- %% See: http://www.in-ulm.de/~mascheck/various/argmax/
- 5440;
- {{unix,darwin},{Major,_,_}} when Major >= 11 ->
- %% "getconf ARG_MAX" still reports 262144 (as in previous
- %% version of MacOS X), but the useful space seem to have
- %% shrunk significantly (or possibly the number of arguments).
- %% 7673
- 7500;
- {_,_} ->
- 12000
+ {{win32,_},_} ->
+ %% The maximum size of a command line in the command
+ %% shell on Windows is 8191 characters.
+ %% Each -D option is expanded to "@dv NN 1", i.e.
+ %% 8 characters. (Numbers up to 1295 can be expressed
+ %% as two 36-base digits.)
+ 1000;
+ {{unix,linux},Version} when Version < {2,6,23} ->
+ %% On some older 64-bit versions of Linux, the maximum number
+ %% of arguments is 16383.
+ %% See: http://www.in-ulm.de/~mascheck/various/argmax/
+ 5440;
+ {{unix,darwin},{Major,_,_}} when Major >= 11 ->
+ %% "getconf ARG_MAX" still reports 262144 (as in previous
+ %% version of MacOS X), but the useful space seem to have
+ %% shrunk significantly (or possibly the number of arguments).
+ %% 7673
+ 7500;
+ {_,_} ->
+ 12000
end.
erlc() ->
case os:find_executable("erlc") of
- false ->
- test_server:fail("Can't find erlc");
- Erlc ->
- "\"" ++ Erlc ++ "\""
+ false ->
+ ct:fail("Can't find erlc");
+ Erlc ->
+ "\"" ++ Erlc ++ "\""
end.
make_dep_options(Config) ->
@@ -264,30 +260,30 @@ make_dep_options(Config) ->
DepRE = ["/erl_test_ok[.]beam: \\\\$",
- "/system_test/erlc_SUITE_data/src/erl_test_ok[.]erl \\\\$",
- "/system_test/erlc_SUITE_data/include/erl_test[.]hrl$",
- "_OK_"],
+ "/system_test/erlc_SUITE_data/src/erl_test_ok[.]erl \\\\$",
+ "/system_test/erlc_SUITE_data/include/erl_test[.]hrl$",
+ "_OK_"],
DepRETarget =
- ["^target: \\\\$",
- "/system_test/erlc_SUITE_data/src/erl_test_ok[.]erl \\\\$",
- "/system_test/erlc_SUITE_data/include/erl_test[.]hrl$",
- "_OK_"],
+ ["^target: \\\\$",
+ "/system_test/erlc_SUITE_data/src/erl_test_ok[.]erl \\\\$",
+ "/system_test/erlc_SUITE_data/include/erl_test[.]hrl$",
+ "_OK_"],
DepREMP =
- ["/erl_test_ok[.]beam: \\\\$",
- "/system_test/erlc_SUITE_data/src/erl_test_ok[.]erl \\\\$",
- "/system_test/erlc_SUITE_data/include/erl_test[.]hrl$",
- [],
- "/system_test/erlc_SUITE_data/include/erl_test.hrl:$",
- "_OK_"],
+ ["/erl_test_ok[.]beam: \\\\$",
+ "/system_test/erlc_SUITE_data/src/erl_test_ok[.]erl \\\\$",
+ "/system_test/erlc_SUITE_data/include/erl_test[.]hrl$",
+ [],
+ "/system_test/erlc_SUITE_data/include/erl_test.hrl:$",
+ "_OK_"],
DepREMissing =
- ["/erl_test_missing_header[.]beam: \\\\$",
- "/system_test/erlc_SUITE_data/src/erl_test_missing_header[.]erl \\\\$",
- "/system_test/erlc_SUITE_data/include/erl_test[.]hrl \\\\$",
- "missing.hrl$",
- "_OK_"],
+ ["/erl_test_missing_header[.]beam: \\\\$",
+ "/system_test/erlc_SUITE_data/src/erl_test_missing_header[.]erl \\\\$",
+ "/system_test/erlc_SUITE_data/include/erl_test[.]hrl \\\\$",
+ "missing.hrl$",
+ "_OK_"],
%% Test plain -M
run(Config, Cmd, FileName, "-M", DepRE),
@@ -309,7 +305,7 @@ make_dep_options(Config) ->
%% Test -MF File -MT Target
TargetDepFile = filename:join(OutDir, "target.deps"),
run(Config, Cmd, FileName, "-MF "++TargetDepFile++" -MT target",
- ["_OK_"]),
+ ["_OK_"]),
{ok,TargetBin} = file:read_file(TargetDepFile),
verify_result(binary_to_list(TargetBin)++["_OK_"], DepRETarget),
@@ -358,33 +354,33 @@ split([], Current, Lines) ->
match_messages([Msg|Rest1], [Regexp|Rest2]) ->
case re:run(Msg, Regexp, [{capture,none}, unicode]) of
- match ->
- ok;
- nomatch ->
- io:format("Not matching: ~s\n", [Msg]),
- io:format("Regexp : ~s\n", [Regexp]),
- test_server:fail(message_mismatch)
+ match ->
+ ok;
+ nomatch ->
+ io:format("Not matching: ~s\n", [Msg]),
+ io:format("Regexp : ~s\n", [Regexp]),
+ ct:fail(message_mismatch)
end,
match_messages(Rest1, Rest2);
match_messages([], [Expect|Rest]) ->
- test_server:fail({too_few_messages, [Expect|Rest]});
+ ct:fail({too_few_messages, [Expect|Rest]});
match_messages([Msg|Rest], []) ->
- test_server:fail({too_many_messages, [Msg|Rest]});
+ ct:fail({too_many_messages, [Msg|Rest]});
match_messages([], []) ->
ok.
get_cmd(Cfg) ->
- ?line {SrcDir, IncDir, OutDir} = get_dirs(Cfg),
- ?line Cmd = erlc() ++ " -I" ++ IncDir ++ " -o" ++ OutDir ++ " ",
+ {SrcDir, IncDir, OutDir} = get_dirs(Cfg),
+ Cmd = erlc() ++ " -I" ++ IncDir ++ " -o" ++ OutDir ++ " ",
{SrcDir, OutDir, Cmd}.
get_dirs(Cfg) ->
- ?line DataDir = ?config(data_dir, Cfg),
- ?line PrivDir = ?config(priv_dir, Cfg),
- ?line SrcDir = filename:join(DataDir, "src"),
- ?line IncDir = filename:join(DataDir, "include"),
+ DataDir = proplists:get_value(data_dir, Cfg),
+ PrivDir = proplists:get_value(priv_dir, Cfg),
+ SrcDir = filename:join(DataDir, "src"),
+ IncDir = filename:join(DataDir, "include"),
{SrcDir, IncDir, PrivDir}.
-
+
exists(Name) ->
filelib:is_file(Name).
@@ -396,7 +392,7 @@ exists(Name) ->
%% a non-zero exit status.
run_command(Config, Cmd) ->
- TmpDir = filename:join(?config(priv_dir, Config), "tmp"),
+ TmpDir = filename:join(proplists:get_value(priv_dir, Config), "tmp"),
file:make_dir(TmpDir),
{RunFile, Run, Script} = run_command(TmpDir, os:type(), Cmd),
ok = file:write_file(filename:join(TmpDir, RunFile), unicode:characters_to_binary(Script)),
@@ -405,7 +401,7 @@ run_command(Config, Cmd) ->
run_command(Dir, {win32, _}, Cmd) ->
BatchFile = filename:join(Dir, "run.bat"),
Run = re:replace(filename:rootname(BatchFile), "/", "\\",
- [global,{return,list}]),
+ [global,{return,list}]),
{BatchFile,
Run,
["@echo off\r\n",
@@ -426,5 +422,4 @@ run_command(Dir, {unix, _}, Cmd) ->
" *) echo '_ERROR_';;\n",
"esac\n"]};
run_command(_Dir, Other, _Cmd) ->
- M = io_lib:format("Don't know how to test exit code for ~p", [Other]),
- test_server:fail(lists:flatten(M)).
+ ct:fail("Don't know how to test exit code for ~p", [Other]).
diff --git a/erts/test/erlc_SUITE_data/include/erl_test.hrl b/erts/test/erlc_SUITE_data/include/erl_test.hrl
index e7d096d2c1..70aecc4762 100644
--- a/erts/test/erlc_SUITE_data/include/erl_test.hrl
+++ b/erts/test/erlc_SUITE_data/include/erl_test.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/test/erlc_SUITE_data/src/erl_test_bad.erl b/erts/test/erlc_SUITE_data/src/erl_test_bad.erl
index b8c4ee2786..cbfe81705f 100644
--- a/erts/test/erlc_SUITE_data/src/erl_test_bad.erl
+++ b/erts/test/erlc_SUITE_data/src/erl_test_bad.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/test/erlc_SUITE_data/src/erl_test_missing_header.erl b/erts/test/erlc_SUITE_data/src/erl_test_missing_header.erl
index f043fbebc4..604bb16bd6 100644
--- a/erts/test/erlc_SUITE_data/src/erl_test_missing_header.erl
+++ b/erts/test/erlc_SUITE_data/src/erl_test_missing_header.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/test/erlc_SUITE_data/src/erl_test_ok.erl b/erts/test/erlc_SUITE_data/src/erl_test_ok.erl
index a82eda95b3..f1a48cbf18 100644
--- a/erts/test/erlc_SUITE_data/src/erl_test_ok.erl
+++ b/erts/test/erlc_SUITE_data/src/erl_test_ok.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/test/erlc_SUITE_data/src/yecc_test_bad.yrl b/erts/test/erlc_SUITE_data/src/yecc_test_bad.yrl
index de17b903d6..da488b7232 100644
--- a/erts/test/erlc_SUITE_data/src/yecc_test_bad.yrl
+++ b/erts/test/erlc_SUITE_data/src/yecc_test_bad.yrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/test/erlc_SUITE_data/src/yecc_test_ok.yrl b/erts/test/erlc_SUITE_data/src/yecc_test_ok.yrl
index 9433dcb90d..feb067e34b 100644
--- a/erts/test/erlc_SUITE_data/src/yecc_test_ok.yrl
+++ b/erts/test/erlc_SUITE_data/src/yecc_test_ok.yrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/erts/test/erlexec_SUITE.erl b/erts/test/erlexec_SUITE.erl
index 6440cbf0d7..44d7f63387 100644
--- a/erts/test/erlexec_SUITE.erl
+++ b/erts/test/erlexec_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -27,71 +27,46 @@
%%%-------------------------------------------------------------------
-module(erlexec_SUITE).
+-export([all/0, suite/0, init_per_testcase/2, end_per_testcase/2]).
-%-define(line_trace, 1).
-
--define(DEFAULT_TIMEOUT, ?t:minutes(1)).
-
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- init_per_testcase/2, end_per_testcase/2]).
-
--export([args_file/1, evil_args_file/1, env/1, args_file_env/1, otp_7461/1, otp_7461_remote/1, otp_8209/1, zdbbl_dist_buf_busy_limit/1]).
+-export([args_file/1, evil_args_file/1, env/1, args_file_env/1,
+ otp_7461/1, otp_7461_remote/1, otp_8209/1,
+ zdbbl_dist_buf_busy_limit/1]).
-include_lib("common_test/include/ct.hrl").
-
init_per_testcase(Case, Config) ->
- Dog = ?t:timetrap(?DEFAULT_TIMEOUT),
SavedEnv = save_env(),
- [{testcase, Case}, {watchdog, Dog}, {erl_flags_env, SavedEnv} |Config].
+ [{testcase, Case},{erl_flags_env, SavedEnv}|Config].
end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- SavedEnv = ?config(erl_flags_env, Config),
+ SavedEnv = proplists:get_value(erl_flags_env, Config),
restore_env(SavedEnv),
cleanup_nodes(),
- ?t:timetrap_cancel(Dog),
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {minutes, 1}}].
all() ->
[args_file, evil_args_file, env, args_file_env,
otp_7461, otp_8209, zdbbl_dist_buf_busy_limit].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-otp_8209(doc) ->
- ["Test that plain first argument does not "
- "destroy -home switch [OTP-8209]"];
-otp_8209(suite) ->
- [];
+%% Test that plain first argument does not
+%% destroy -home switch [OTP-8209]
otp_8209(Config) when is_list(Config) ->
- ?line {ok,[[PName]]} = init:get_argument(progname),
- ?line SNameS = "erlexec_test_01",
- ?line SName = list_to_atom(SNameS++"@"++
+ {ok,[[PName]]} = init:get_argument(progname),
+ SNameS = "erlexec_test_01",
+ SName = list_to_atom(SNameS++"@"++
hd(tl(string:tokens(atom_to_list(node()),"@")))),
- ?line Cmd = PName ++ " dummy_param -sname "++SNameS++" -setcookie "++
+ Cmd = PName ++ " dummy_param -sname "++SNameS++" -setcookie "++
atom_to_list(erlang:get_cookie()),
- ?line open_port({spawn,Cmd},[]),
- ?line pong = loop_ping(SName,40),
- ?line {ok,[[_]]} = rpc:call(SName,init,get_argument,[home]),
- ?line ["dummy_param"] = rpc:call(SName,init,get_plain_arguments,[]),
- ?line ok = cleanup_nodes(),
+ open_port({spawn,Cmd},[]),
+ pong = loop_ping(SName,40),
+ {ok,[[_]]} = rpc:call(SName,init,get_argument,[home]),
+ ["dummy_param"] = rpc:call(SName,init,get_plain_arguments,[]),
+ ok = cleanup_nodes(),
ok.
cleanup_nodes() ->
@@ -123,17 +98,14 @@ loop_ping(Node,N) ->
pong
end.
-args_file(doc) -> [];
-args_file(suite) -> [];
args_file(Config) when is_list(Config) ->
- ?line AFN1 = privfile("1", Config),
- ?line AFN2 = privfile("2", Config),
- ?line AFN3 = privfile("3", Config),
- ?line AFN4 = privfile("4", Config),
- ?line AFN5 = privfile("5", Config),
- ?line AFN6 = privfile("6", Config),
- ?line write_file(AFN1,
- "-MiscArg2~n"
+ AFN1 = privfile("1", Config),
+ AFN2 = privfile("2", Config),
+ AFN3 = privfile("3", Config),
+ AFN4 = privfile("4", Config),
+ AFN5 = privfile("5", Config),
+ AFN6 = privfile("6", Config),
+ write_file(AFN1, "-MiscArg2~n"
"# a comment +\\#1000~n"
"+\\#200 # another comment~n"
"~n"
@@ -145,7 +117,7 @@ args_file(Config) when is_list(Config) ->
"+\\#700~n"
"-extra +XtraArg6~n",
[AFN2]),
- ?line write_file(AFN2,
+ write_file(AFN2,
"-MiscArg3~n"
"+\\#300~n"
"-args_file ~s~n"
@@ -156,61 +128,59 @@ args_file(Config) when is_list(Config) ->
"-args_file ~s~n"
"-extra +XtraArg5~n",
[AFN3, AFN4, AFN5, AFN6]),
- ?line write_file(AFN3,
+ write_file(AFN3,
"# comment again~n"
" -MiscArg4 +\\#400 -extra +XtraArg1"),
- ?line write_file(AFN4,
+ write_file(AFN4,
" -MiscArg6 +\\#600 -extra +XtraArg2~n"
"+XtraArg3~n"
"+XtraArg4~n"
"# comment again~n"),
- ?line write_file(AFN5, ""),
- ?line write_file(AFN6, "-extra # +XtraArg10~n"),
- ?line CmdLine = "+#100 -MiscArg1 "
+ write_file(AFN5, ""),
+ write_file(AFN6, "-extra # +XtraArg10~n"),
+ CmdLine = "+#100 -MiscArg1 "
++ "-args_file " ++ AFN1
++ " +#800 -MiscArg8 -extra +XtraArg7 +XtraArg8",
- ?line {Emu, Misc, Extra} = emu_args(CmdLine),
- ?line verify_args(["-#100", "-#200", "-#300", "-#400",
+ {Emu, Misc, Extra} = emu_args(CmdLine),
+ verify_args(["-#100", "-#200", "-#300", "-#400",
"-#500", "-#600", "-#700", "-#800"], Emu),
- ?line verify_args(["-MiscArg1", "-MiscArg2", "-MiscArg3", "-MiscArg4",
+ verify_args(["-MiscArg1", "-MiscArg2", "-MiscArg3", "-MiscArg4",
"-MiscArg5", "-MiscArg6", "-MiscArg7", "-MiscArg8"],
Misc),
- ?line verify_args(["+XtraArg1", "+XtraArg2", "+XtraArg3", "+XtraArg4",
+ verify_args(["+XtraArg1", "+XtraArg2", "+XtraArg3", "+XtraArg4",
"+XtraArg5", "+XtraArg6", "+XtraArg7", "+XtraArg8"],
Extra),
- ?line verify_not_args(["-MiscArg10", "-#1000", "+XtraArg10",
+ verify_not_args(["-MiscArg10", "-#1000", "+XtraArg10",
"-MiscArg1", "-MiscArg2", "-MiscArg3", "-MiscArg4",
"-MiscArg5", "-MiscArg6", "-MiscArg7", "-MiscArg8",
"+XtraArg1", "+XtraArg2", "+XtraArg3", "+XtraArg4",
"+XtraArg5", "+XtraArg6", "+XtraArg7", "+XtraArg8"],
Emu),
- ?line verify_not_args(["-MiscArg10", "-#1000", "+XtraArg10",
+ verify_not_args(["-MiscArg10", "-#1000", "+XtraArg10",
"-#100", "-#200", "-#300", "-#400",
"-#500", "-#600", "-#700", "-#800",
"+XtraArg1", "+XtraArg2", "+XtraArg3", "+XtraArg4",
"+XtraArg5", "+XtraArg6", "+XtraArg7", "+XtraArg8"],
Misc),
- ?line verify_not_args(["-MiscArg10", "-#1000", "+XtraArg10",
+ verify_not_args(["-MiscArg10", "-#1000", "+XtraArg10",
"-#100", "-#200", "-#300", "-#400",
"-#500", "-#600", "-#700", "-#800",
"-MiscArg1", "-MiscArg2", "-MiscArg3", "-MiscArg4",
"-MiscArg5", "-MiscArg6", "-MiscArg7", "-MiscArg8"],
Extra),
- ?line ok.
+ ok.
-evil_args_file(doc) -> [];
-evil_args_file(suite) -> [];
evil_args_file(Config) when is_list(Config) ->
- ?line Lim = 300,
- ?line FNums = lists:seq(1, Lim),
+ Lim = 300,
+ FNums = lists:seq(1, Lim),
lists:foreach(fun (End) when End == Lim ->
- ?line AFN = privfile(integer_to_list(End), Config),
- ?line write_file(AFN,
+ AFN = privfile(integer_to_list(End), Config),
+ write_file(AFN,
"-MiscArg~p ",
[End]);
(I) ->
- ?line AFNX = privfile(integer_to_list(I), Config),
- ?line AFNY = privfile(integer_to_list(I+1), Config),
+ AFNX = privfile(integer_to_list(I), Config),
+ AFNY = privfile(integer_to_list(I+1), Config),
{Frmt, Args} =
case I rem 2 of
0 ->
@@ -220,65 +190,59 @@ evil_args_file(Config) when is_list(Config) ->
{"-MiscArg~p -args_file ~s",
[I, AFNY]}
end,
- ?line write_file(AFNX, Frmt, Args)
+ write_file(AFNX, Frmt, Args)
end,
FNums),
- ?line {_Emu, Misc, _Extra} = emu_args("-args_file "
+ {_Emu, Misc, _Extra} = emu_args("-args_file "
++ privfile("1", Config)),
- ?line ANums = FNums
+ ANums = FNums
++ lists:reverse(lists:filter(fun (I) when I == Lim -> false;
(I) when I rem 2 == 0 -> true;
(_) -> false
end, FNums)),
- ?line verify_args(lists:map(fun (I) -> "-MiscArg"++integer_to_list(I) end,
+ verify_args(lists:map(fun (I) -> "-MiscArg"++integer_to_list(I) end,
ANums),
Misc),
- ?line ok.
+ ok.
-env(doc) -> [];
-env(suite) -> [];
env(Config) when is_list(Config) ->
- ?line os:putenv("ERL_AFLAGS", "-MiscArg1 +#100 -extra +XtraArg1 +XtraArg2"),
- ?line CmdLine = "+#200 -MiscArg2 -extra +XtraArg3 +XtraArg4",
- ?line os:putenv("ERL_FLAGS", "-MiscArg3 +#300 -extra +XtraArg5"),
- ?line os:putenv("ERL_ZFLAGS", "-MiscArg4 +#400 -extra +XtraArg6"),
- ?line {Emu, Misc, Extra} = emu_args(CmdLine),
- ?line verify_args(["-#100", "-#200", "-#300", "-#400"], Emu),
- ?line verify_args(["-MiscArg1", "-MiscArg2", "-MiscArg3", "-MiscArg4"],
+ os:putenv("ERL_AFLAGS", "-MiscArg1 +#100 -extra +XtraArg1 +XtraArg2"),
+ CmdLine = "+#200 -MiscArg2 -extra +XtraArg3 +XtraArg4",
+ os:putenv("ERL_FLAGS", "-MiscArg3 +#300 -extra +XtraArg5"),
+ os:putenv("ERL_ZFLAGS", "-MiscArg4 +#400 -extra +XtraArg6"),
+ {Emu, Misc, Extra} = emu_args(CmdLine),
+ verify_args(["-#100", "-#200", "-#300", "-#400"], Emu),
+ verify_args(["-MiscArg1", "-MiscArg2", "-MiscArg3", "-MiscArg4"],
Misc),
- ?line verify_args(["+XtraArg1", "+XtraArg2", "+XtraArg3", "+XtraArg4",
+ verify_args(["+XtraArg1", "+XtraArg2", "+XtraArg3", "+XtraArg4",
"+XtraArg5", "+XtraArg6"],
Extra),
- ?line ok.
+ ok.
-args_file_env(doc) -> [];
-args_file_env(suite) -> [];
args_file_env(Config) when is_list(Config) ->
- ?line AFN1 = privfile("1", Config),
- ?line AFN2 = privfile("2", Config),
- ?line write_file(AFN1, "-MiscArg2 +\\#200 -extra +XtraArg1"),
- ?line write_file(AFN2, "-MiscArg3 +\\#400 -extra +XtraArg3"),
- ?line os:putenv("ERL_AFLAGS",
+ AFN1 = privfile("1", Config),
+ AFN2 = privfile("2", Config),
+ write_file(AFN1, "-MiscArg2 +\\#200 -extra +XtraArg1"),
+ write_file(AFN2, "-MiscArg3 +\\#400 -extra +XtraArg3"),
+ os:putenv("ERL_AFLAGS",
"-MiscArg1 +#100 -args_file "++AFN1++ " -extra +XtraArg2"),
- ?line CmdLine = "+#300 -args_file "++AFN2++" -MiscArg4 -extra +XtraArg4",
- ?line os:putenv("ERL_FLAGS", "-MiscArg5 +#500 -extra +XtraArg5"),
- ?line os:putenv("ERL_ZFLAGS", "-MiscArg6 +#600 -extra +XtraArg6"),
- ?line {Emu, Misc, Extra} = emu_args(CmdLine),
- ?line verify_args(["-#100", "-#200", "-#300", "-#400",
+ CmdLine = "+#300 -args_file "++AFN2++" -MiscArg4 -extra +XtraArg4",
+ os:putenv("ERL_FLAGS", "-MiscArg5 +#500 -extra +XtraArg5"),
+ os:putenv("ERL_ZFLAGS", "-MiscArg6 +#600 -extra +XtraArg6"),
+ {Emu, Misc, Extra} = emu_args(CmdLine),
+ verify_args(["-#100", "-#200", "-#300", "-#400",
"-#500", "-#600"], Emu),
- ?line verify_args(["-MiscArg1", "-MiscArg2", "-MiscArg3", "-MiscArg4",
+ verify_args(["-MiscArg1", "-MiscArg2", "-MiscArg3", "-MiscArg4",
"-MiscArg5", "-MiscArg6"],
Misc),
- ?line verify_args(["+XtraArg1", "+XtraArg2", "+XtraArg3", "+XtraArg4",
+ verify_args(["+XtraArg1", "+XtraArg2", "+XtraArg3", "+XtraArg4",
"+XtraArg5", "+XtraArg6"],
Extra),
- ?line ok.
+ ok.
%% Make sure "erl -detached" survives when parent process group gets killed
-otp_7461(doc) -> [];
-otp_7461(suite) -> [];
otp_7461(Config) when is_list(Config) ->
case os:type() of
{unix,_} ->
@@ -302,9 +266,9 @@ otp_7461(Config) when is_list(Config) ->
otp_7461_do(Config) ->
io:format("alive=~p node=~p\n",[is_alive(), node()]),
- TestProg = filename:join([?config(data_dir, Config), "erlexec_tests"]),
+ TestProg = filename:join([proplists:get_value(data_dir, Config), "erlexec_tests"]),
{ok, [[ErlProg]]} = init:get_argument(progname),
- ?line Cmd = TestProg ++ " " ++ ErlProg ++
+ Cmd = TestProg ++ " " ++ ErlProg ++
" -detached -sname " ++ get_nodename(otp_7461) ++
" -setcookie " ++ atom_to_list(erlang:get_cookie()) ++
" -pa " ++ filename:dirname(code:which(?MODULE)) ++
@@ -314,29 +278,31 @@ otp_7461_do(Config) ->
%% open_port fork+exec
io:format("spawn port prog ~p\n",[Cmd]),
- ?line Port = open_port({spawn, Cmd}, [eof]),
+ Port = open_port({spawn, Cmd}, [eof]),
io:format("Wait for node to connect...\n",[]),
- ?line {nodeup, Slave} = receive Msg -> Msg
+ {nodeup, Slave} = receive Msg -> Msg
after 20*1000 -> timeout end,
io:format("Node alive: ~p\n", [Slave]),
- ?line pong = net_adm:ping(Slave),
+ pong = net_adm:ping(Slave),
io:format("Ping ok towards ~p\n", [Slave]),
- ?line Port ! { self(), {command, "K"}}, % Kill child process group
- ?line {Port, {data, "K"}} = receive Msg2 -> Msg2 end,
- ?line port_close(Port),
+ Port ! { self(), {command, "K"}}, % Kill child process group
+ {Port, {data, "K"}} = receive Msg2 -> Msg2 end,
+ port_close(Port),
%% Now the actual test. Detached node should still be alive.
- ?line pong = net_adm:ping(Slave),
+ pong = net_adm:ping(Slave),
io:format("Ping still ok towards ~p\n", [Slave]),
%% Halt node
- ?line rpc:cast(Slave, ?MODULE, otp_7461_remote, [[halt, self()]]),
+ rpc:cast(Slave, ?MODULE, otp_7461_remote, [[halt, self()]]),
- ?line {nodedown, Slave} = receive Msg3 -> Msg3
- after 20*1000 -> timeout end,
+ {nodedown, Slave} = receive
+ Msg3 -> Msg3
+ after 20*1000 -> timeout
+ end,
io:format("Node dead: ~p\n", [Slave]),
ok.
@@ -349,24 +315,21 @@ otp_7461_remote([halt, Pid]) ->
io:format("halt order from ~p to node ~p\n",[Pid,node()]),
halt().
-zdbbl_dist_buf_busy_limit(doc) ->
- ["Check +zdbbl flag"];
-zdbbl_dist_buf_busy_limit(suite) ->
- [];
+%% Check +zdbbl flag
zdbbl_dist_buf_busy_limit(Config) when is_list(Config) ->
LimKB = 1122233,
LimB = LimKB*1024,
- ?line {ok,[[PName]]} = init:get_argument(progname),
- ?line SNameS = "erlexec_test_02",
- ?line SName = list_to_atom(SNameS++"@"++
+ {ok,[[PName]]} = init:get_argument(progname),
+ SNameS = "erlexec_test_02",
+ SName = list_to_atom(SNameS++"@"++
hd(tl(string:tokens(atom_to_list(node()),"@")))),
- ?line Cmd = PName ++ " -sname "++SNameS++" -setcookie "++
+ Cmd = PName ++ " -sname "++SNameS++" -setcookie "++
atom_to_list(erlang:get_cookie()) ++
" +zdbbl " ++ integer_to_list(LimKB),
- ?line open_port({spawn,Cmd},[]),
- ?line pong = loop_ping(SName,40),
- ?line LimB = rpc:call(SName,erlang,system_info,[dist_buf_busy_limit]),
- ?line ok = cleanup_node(SNameS, 10),
+ open_port({spawn,Cmd},[]),
+ pong = loop_ping(SName,40),
+ LimB = rpc:call(SName,erlang,system_info,[dist_buf_busy_limit]),
+ ok = cleanup_node(SNameS, 10),
ok.
@@ -404,8 +367,8 @@ restore_env({erl_flags, AFlgs, Flgs, RFlgs, ZFlgs}) ->
ok.
privfile(Name, Config) ->
- filename:join([?config(priv_dir, Config),
- atom_to_list(?config(testcase, Config)) ++ "." ++ Name]).
+ filename:join([proplists:get_value(priv_dir, Config),
+ atom_to_list(proplists:get_value(testcase, Config)) ++ "." ++ Name]).
write_file(FileName, Frmt) ->
write_file(FileName, Frmt, []).
@@ -430,8 +393,7 @@ verify_not_args(Xs, Ys) ->
true -> exit({arg_present, X});
false -> ok
end
- end,
- Xs).
+ end, Xs).
emu_args(CmdLineArgs) ->
io:format("CmdLineArgs = ~ts~n", [CmdLineArgs]),
diff --git a/erts/test/erlexec_SUITE_data/Makefile.src b/erts/test/erlexec_SUITE_data/Makefile.src
index 145aaedd64..641dff1e30 100644
--- a/erts/test/erlexec_SUITE_data/Makefile.src
+++ b/erts/test/erlexec_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2012. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/test/erlexec_SUITE_data/erlexec_tests.c b/erts/test/erlexec_SUITE_data/erlexec_tests.c
index 569bf7bcc4..bd28d2900c 100644
--- a/erts/test/erlexec_SUITE_data/erlexec_tests.c
+++ b/erts/test/erlexec_SUITE_data/erlexec_tests.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/test/ethread_SUITE.erl b/erts/test/ethread_SUITE.erl
index 8ad2a32278..19f738c572 100644
--- a/erts/test/ethread_SUITE.erl
+++ b/erts/test/ethread_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,13 +28,7 @@
-module(ethread_SUITE).
-author('[email protected]').
-%-define(line_trace, 1).
-
--define(DEFAULT_TIMEOUT, ?t:minutes(10)).
-
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- init_per_testcase/2, end_per_testcase/2]).
+-export([all/0, suite/0, init_per_testcase/2, end_per_testcase/2]).
-export([create_join_thread/1,
equal_tids/1,
@@ -53,7 +47,11 @@
-include_lib("common_test/include/ct.hrl").
-tests() ->
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {minutes, 10}}].
+
+all() ->
[create_join_thread,
equal_tids,
mutex,
@@ -69,78 +67,50 @@ tests() ->
atomic,
dw_atomic_massage].
-suite() -> [{ct_hooks,[ts_install_cth]}].
-
-all() ->
- tests().
-
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
+init_per_testcase(Case, Config) ->
+ case inet:gethostname() of
+ {ok,"fenris"} when Case == max_threads ->
+ %% Cannot use os:type+os:version as not all
+ %% solaris10 machines are buggy.
+ {skip, "This machine is buggy"};
+ _Else ->
+ Config
+ end.
-end_per_suite(_Config) ->
+end_per_testcase(_Case, _Config) ->
ok.
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
%%
%%
%% The test-cases
%%
%%
-create_join_thread(doc) ->
- ["Tests ethr_thr_create and ethr_thr_join."];
-create_join_thread(suite) ->
- [];
+%% Tests ethr_thr_create and ethr_thr_join.
create_join_thread(Config) ->
run_case(Config, "create_join_thread", "").
-equal_tids(doc) ->
- ["Tests ethr_equal_tids."];
-equal_tids(suite) ->
- [];
+%% Tests ethr_equal_tids.
equal_tids(Config) ->
run_case(Config, "equal_tids", "").
-mutex(doc) ->
- ["Tests mutexes."];
-mutex(suite) ->
- [];
+%% Tests mutexes.
mutex(Config) ->
run_case(Config, "mutex", "").
-try_lock_mutex(doc) ->
- ["Tests try lock on mutex."];
-try_lock_mutex(suite) ->
- [];
+%% Tests try lock on mutex.
try_lock_mutex(Config) ->
run_case(Config, "try_lock_mutex", "").
-cond_wait(doc) ->
- ["Tests ethr_cond_wait with ethr_cond_signal and ethr_cond_broadcast."];
-cond_wait(suite) ->
- [];
+%% Tests ethr_cond_wait with ethr_cond_signal and ethr_cond_broadcast.
cond_wait(Config) ->
run_case(Config, "cond_wait", "").
-broadcast(doc) ->
- ["Tests that a ethr_cond_broadcast really wakes up all waiting threads"];
-broadcast(suite) ->
- [];
+%% Tests that a ethr_cond_broadcast really wakes up all waiting threads
broadcast(Config) ->
run_case(Config, "broadcast", "").
-detached_thread(doc) ->
- ["Tests detached threads."];
-detached_thread(suite) ->
- [];
+%% Tests detached threads.
detached_thread(Config) ->
case {os:type(), os:version()} of
{{unix,darwin}, {9, _, _}} ->
@@ -152,10 +122,7 @@ detached_thread(Config) ->
run_case(Config, "detached_thread", "")
end.
-max_threads(doc) ->
- ["Tests maximum number of threads."];
-max_threads(suite) ->
- [];
+%% Tests maximum number of threads.
max_threads(Config) ->
case {os:type(), os:version()} of
{{unix,darwin}, {9, _, _}} ->
@@ -167,45 +134,27 @@ max_threads(Config) ->
run_case(Config, "max_threads", "")
end.
-tsd(doc) ->
- ["Tests thread specific data."];
-tsd(suite) ->
- [];
+%% Tests thread specific data.
tsd(Config) ->
run_case(Config, "tsd", "").
-spinlock(doc) ->
- ["Tests spinlocks."];
-spinlock(suite) ->
- [];
+%% Tests spinlocks.
spinlock(Config) ->
run_case(Config, "spinlock", "").
-rwspinlock(doc) ->
- ["Tests rwspinlocks."];
-rwspinlock(suite) ->
- [];
+%% Tests rwspinlocks.
rwspinlock(Config) ->
run_case(Config, "rwspinlock", "").
-rwmutex(doc) ->
- ["Tests rwmutexes."];
-rwmutex(suite) ->
- [];
+%% Tests rwmutexes.
rwmutex(Config) ->
run_case(Config, "rwmutex", "").
-atomic(doc) ->
- ["Tests atomics."];
-atomic(suite) ->
- [];
+%% Tests atomics.
atomic(Config) ->
run_case(Config, "atomic", "").
-dw_atomic_massage(doc) ->
- ["Massage double word atomics"];
-dw_atomic_massage(suite) ->
- [];
+%% Massage double word atomics
dw_atomic_massage(Config) ->
run_case(Config, "dw_atomic_massage", "").
@@ -215,22 +164,6 @@ dw_atomic_massage(Config) ->
%%
%%
-init_per_testcase(Case, Config) ->
- case inet:gethostname() of
- {ok,"fenris"} when Case == max_threads ->
- %% Cannot use os:type+os:version as not all
- %% solaris10 machines are buggy.
- {skip, "This machine is buggy"};
- _Else ->
- Dog = ?t:timetrap(?DEFAULT_TIMEOUT),
- [{watchdog, Dog}|Config]
- end.
-
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
- ok.
-
-define(TESTPROG, "ethread_tests").
-define(FAILED_MARKER, $E,$T,$H,$R,$-,$T,$E,$S,$T,$-,$F,$A,$I,$L,$U,$R,$E).
-define(SKIPPED_MARKER, $E,$T,$H,$R,$-,$T,$E,$S,$T,$-,$S,$K,$I,$P).
@@ -238,68 +171,68 @@ end_per_testcase(_Case, Config) ->
-define(PID_MARKER, $E,$T,$H,$R,$-,$T,$E,$S,$T,$-,$P,$I,$D).
port_prog_killer(EProc, OSProc) when is_pid(EProc), is_list(OSProc) ->
- ?line process_flag(trap_exit, true),
- ?line Ref = erlang:monitor(process, EProc),
- ?line receive
- {'DOWN', Ref, _, _, Reason} when is_tuple(Reason),
- element(1, Reason)
- == timetrap_timeout ->
- ?line Cmd = "kill -9 " ++ OSProc,
- ?line ?t:format("Test case timed out. "
- "Trying to kill port program.~n"
- " Executing: ~p~n", [Cmd]),
- ?line case os:cmd(Cmd) of
- [] ->
- ok;
- OsCmdRes ->
- ?line ?t:format(" ~s", [OsCmdRes])
- end;
- {'DOWN', Ref, _, _, _} ->
- %% OSProc is assumed to have terminated by itself
- ?line ok
- end.
+ process_flag(trap_exit, true),
+ Ref = erlang:monitor(process, EProc),
+ receive
+ {'DOWN', Ref, _, _, Reason} when is_tuple(Reason),
+ element(1, Reason)
+ == timetrap_timeout ->
+ Cmd = "kill -9 " ++ OSProc,
+ io:format("Test case timed out. "
+ "Trying to kill port program.~n"
+ " Executing: ~p~n", [Cmd]),
+ case os:cmd(Cmd) of
+ [] ->
+ ok;
+ OsCmdRes ->
+ io:format(" ~s", [OsCmdRes])
+ end;
+ %% OSProc is assumed to have terminated by itself
+ {'DOWN', Ref, _, _, _} ->
+ ok
+ end.
get_line(_Port, eol, Data) ->
- ?line Data;
+ Data;
get_line(Port, noeol, Data) ->
- ?line receive
+ receive
{Port, {data, {Flag, NextData}}} ->
- ?line get_line(Port, Flag, Data ++ NextData);
+ get_line(Port, Flag, Data ++ NextData);
{Port, eof} ->
- ?line ?t:fail(port_prog_unexpectedly_closed)
+ ct:fail(port_prog_unexpectedly_closed)
end.
read_case_data(Port, TestCase) ->
- ?line receive
- {Port, {data, {eol, [?SUCCESS_MARKER]}}} ->
- ?line ok;
- {Port, {data, {Flag, [?SUCCESS_MARKER | CommentStart]}}} ->
- ?line {comment, get_line(Port, Flag, CommentStart)};
- {Port, {data, {Flag, [?SKIPPED_MARKER | CommentStart]}}} ->
- ?line {skipped, get_line(Port, Flag, CommentStart)};
- {Port, {data, {Flag, [?FAILED_MARKER | ReasonStart]}}} ->
- ?line ?t:fail(get_line(Port, Flag, ReasonStart));
- {Port, {data, {eol, [?PID_MARKER | PidStr]}}} ->
- ?line ?t:format("Port program pid: ~s~n", [PidStr]),
- ?line CaseProc = self(),
- ?line _ = list_to_integer(PidStr), % Sanity check
- spawn_opt(fun () ->
- port_prog_killer(CaseProc, PidStr)
- end,
- [{priority, max}, link]),
- read_case_data(Port, TestCase);
- {Port, {data, {Flag, LineStart}}} ->
- ?line ?t:format("~s~n", [get_line(Port, Flag, LineStart)]),
- read_case_data(Port, TestCase);
- {Port, eof} ->
- ?line ?t:fail(port_prog_unexpectedly_closed)
- end.
+ receive
+ {Port, {data, {eol, [?SUCCESS_MARKER]}}} ->
+ ok;
+ {Port, {data, {Flag, [?SUCCESS_MARKER | CommentStart]}}} ->
+ {comment, get_line(Port, Flag, CommentStart)};
+ {Port, {data, {Flag, [?SKIPPED_MARKER | CommentStart]}}} ->
+ {skipped, get_line(Port, Flag, CommentStart)};
+ {Port, {data, {Flag, [?FAILED_MARKER | ReasonStart]}}} ->
+ ct:fail(get_line(Port, Flag, ReasonStart));
+ {Port, {data, {eol, [?PID_MARKER | PidStr]}}} ->
+ io:format("Port program pid: ~s~n", [PidStr]),
+ CaseProc = self(),
+ _ = list_to_integer(PidStr), % Sanity check
+ spawn_opt(fun () ->
+ port_prog_killer(CaseProc, PidStr)
+ end,
+ [{priority, max}, link]),
+ read_case_data(Port, TestCase);
+ {Port, {data, {Flag, LineStart}}} ->
+ io:format("~s~n", [get_line(Port, Flag, LineStart)]),
+ read_case_data(Port, TestCase);
+ {Port, eof} ->
+ ct:fail(port_prog_unexpectedly_closed)
+ end.
run_case(Config, Test, TestArgs) ->
run_case(Config, Test, TestArgs, fun (_Port) -> ok end).
run_case(Config, Test, TestArgs, Fun) ->
- TestProg = filename:join([?config(data_dir, Config), ?TESTPROG]),
+ TestProg = filename:join([proplists:get_value(data_dir, Config), ?TESTPROG]),
Cmd = TestProg ++ " " ++ Test ++ " " ++ TestArgs,
case catch open_port({spawn, Cmd}, [stream,
use_stdio,
@@ -307,17 +240,13 @@ run_case(Config, Test, TestArgs, Fun) ->
eof,
{line, 1024}]) of
Port when is_port(Port) ->
- ?line Fun(Port),
- ?line CaseResult = read_case_data(Port, Test),
- ?line receive
- {Port, eof} ->
- ?line ok
- end,
- ?line CaseResult;
+ Fun(Port),
+ CaseResult = read_case_data(Port, Test),
+ receive
+ {Port, eof} ->
+ ok
+ end,
+ CaseResult;
Error ->
- ?line ?t:fail({open_port_failed, Error})
+ ct:fail({open_port_failed, Error})
end.
-
-
-
-
diff --git a/erts/test/ethread_SUITE_data/Makefile.src b/erts/test/ethread_SUITE_data/Makefile.src
index e8b9c79576..cf675b92a3 100644
--- a/erts/test/ethread_SUITE_data/Makefile.src
+++ b/erts/test/ethread_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/test/ethread_SUITE_data/ethread_tests.c b/erts/test/ethread_SUITE_data/ethread_tests.c
index b51771c736..fe7f92b012 100644
--- a/erts/test/ethread_SUITE_data/ethread_tests.c
+++ b/erts/test/ethread_SUITE_data/ethread_tests.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/test/ignore_cores.erl b/erts/test/ignore_cores.erl
index e40b91392c..25dce346b9 100644
--- a/erts/test/ignore_cores.erl
+++ b/erts/test/ignore_cores.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ init(Config) ->
fini(Config) ->
#ignore_cores{org_cwd = OrgCWD,
org_path = OrgPath,
- org_pwd_env = OrgPWD} = ?config(ignore_cores, Config),
+ org_pwd_env = OrgPWD} = proplists:get_value(ignore_cores, Config),
ok = file:set_cwd(OrgCWD),
true = code:set_path(OrgPath),
case OrgPWD of
@@ -70,10 +70,10 @@ setup(Suite, Testcase, Config, SetCwd) when is_atom(Suite),
is_list(Config) ->
#ignore_cores{org_cwd = OrgCWD,
org_path = OrgPath,
- org_pwd_env = OrgPWD} = ?config(ignore_cores, Config),
+ org_pwd_env = OrgPWD} = proplists:get_value(ignore_cores, Config),
Path = lists:map(fun (".") -> OrgCWD; (Dir) -> Dir end, OrgPath),
true = code:set_path(Path),
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
IgnDir = filename:join([PrivDir,
atom_to_list(Suite)
++ "_"
@@ -94,7 +94,7 @@ setup(Suite, Testcase, Config, SetCwd) when is_atom(Suite),
end,
ok = file:write_file(filename:join([IgnDir, "ignore_core_files"]), <<>>),
%% cores are dumped in /cores on MacOS X
- CoresDir = case {?t:os_type(), filelib:is_dir("/cores")} of
+ CoresDir = case {os:type(), filelib:is_dir("/cores")} of
{{unix,darwin}, true} ->
filelib:fold_files("/cores",
"^core.*$",
@@ -119,7 +119,7 @@ restore(Config) ->
org_path = OrgPath,
org_pwd_env = OrgPWD,
ign_dir = IgnDir,
- cores_dir = CoresDir} = ?config(ignore_cores, Config),
+ cores_dir = CoresDir} = proplists:get_value(ignore_cores, Config),
try
case CoresDir of
false ->
@@ -155,5 +155,5 @@ restore(Config) ->
dir(Config) ->
- #ignore_cores{ign_dir = Dir} = ?config(ignore_cores, Config),
+ #ignore_cores{ign_dir = Dir} = proplists:get_value(ignore_cores, Config),
Dir.
diff --git a/erts/test/install_SUITE.erl b/erts/test/install_SUITE.erl
index d6df1aab6b..2c7e8972f6 100644
--- a/erts/test/install_SUITE.erl
+++ b/erts/test/install_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,11 +28,9 @@
%%%-------------------------------------------------------------------
-module(install_SUITE).
-%-define(line_trace, 1).
-
--export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,
- init_per_suite/1, end_per_suite/1,
- init_per_testcase/2, end_per_testcase/2]).
+-export([all/0, suite/0,
+ init_per_suite/1, end_per_suite/1,
+ init_per_testcase/2, end_per_testcase/2]).
-export([bin_default/1,
bin_default_dirty/1,
@@ -49,7 +47,6 @@
bin_dirname_fail/1,
bin_no_use_dirname_fail/1]).
--define(DEFAULT_TIMEOUT, ?t:minutes(1)).
-define(JOIN(A,B,C), filename:join(A, B, C)).
-include_lib("common_test/include/ct.hrl").
@@ -77,49 +74,42 @@ dont_need_symlink_cases() ->
bin_unreasonable_path, 'bin white space',
bin_no_srcfile].
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {minutes, 1}}].
all() ->
dont_need_symlink_cases() ++ need_symlink_cases().
-groups() ->
- [].
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
%%
%% The test cases
%%
bin_default(Config) when is_list(Config) ->
- ?line E = "/usr/local",
- ?line Bs = "/usr/local/bin",
- ?line Be = Bs,
- ?line EBs = "/usr/local/lib/erlang/bin",
- ?line EBe = EBs,
- ?line RP = "../lib/erlang/bin",
+ E = "/usr/local",
+ Bs = "/usr/local/bin",
+ Be = Bs,
+ EBs = "/usr/local/lib/erlang/bin",
+ EBe = EBs,
+ RP = "../lib/erlang/bin",
ChkRes = fun (Res, #inst{test_prefix = TP,
destdir = D,
extra_prefix = EP,
bindir_symlinks = BSL,
symlinks = SL}) ->
- ?line B = join([TP, D, EP, Be]),
+ B = join([TP, D, EP, Be]),
Expct = case {SL, BSL} of
{false, _} when BSL == "relative";
BSL == "absolute" ->
- ?line {error, no_ln_s};
+ {error, no_ln_s};
{false, _} ->
- ?line {ok,{absolute,
+ {ok,{absolute,
B,join([TP,D,EP,EBe])}};
{true, "absolute"} ->
- ?line {ok,{absolute,B,join([TP,EP,EBe])}};
+ {ok,{absolute,B,join([TP,EP,EBe])}};
{true, _} ->
- ?line {ok,{relative,B,RP}}
+ {ok,{relative,B,RP}}
end,
expect(Expct, Res)
end,
@@ -128,30 +118,30 @@ bin_default(Config) when is_list(Config) ->
erlang_bindir = EBs}, ChkRes).
bin_default_dirty(Config) when is_list(Config) ->
- ?line E = "/usr/./local/lib/..",
- ?line Bs = "/usr/local//lib/../lib/erlang/../../bin",
- ?line Be = "/usr/local/lib/../lib/erlang/../../bin",
- ?line EBs = "/usr/local/lib/../lib/erlang/../erlang/bin/x/y/../..//",
- ?line EBe = "/usr/local/lib/../lib/erlang/../erlang/bin/x/y/../..",
- ?line RP = "../lib/erlang/bin",
+ E = "/usr/./local/lib/..",
+ Bs = "/usr/local//lib/../lib/erlang/../../bin",
+ Be = "/usr/local/lib/../lib/erlang/../../bin",
+ EBs = "/usr/local/lib/../lib/erlang/../erlang/bin/x/y/../..//",
+ EBe = "/usr/local/lib/../lib/erlang/../erlang/bin/x/y/../..",
+ RP = "../lib/erlang/bin",
ChkRes = fun (Res, #inst{test_prefix = TP,
destdir = D,
extra_prefix = EP,
bindir_symlinks = BSL,
symlinks = SL}) ->
- ?line B = join([TP, D, EP, Be]),
+ B = join([TP, D, EP, Be]),
Expct = case {SL, BSL} of
{false, _} when BSL == "relative";
BSL == "absolute" ->
- ?line {error, no_ln_s};
+ {error, no_ln_s};
{false, _} ->
- ?line {ok,{absolute,
+ {ok,{absolute,
B,join([TP,D,EP,EBe])}};
{true, "absolute"} ->
- ?line {ok,{absolute,
+ {ok,{absolute,
B,join([TP,EP,EBe])}};
{true, _} ->
- ?line {ok,{relative,B,RP}}
+ {ok,{relative,B,RP}}
end,
expect(Expct, Res)
end,
@@ -161,29 +151,29 @@ bin_default_dirty(Config) when is_list(Config) ->
bin_outside_eprfx(Config) when is_list(Config) ->
- ?line E = "/usr/local",
- ?line Bs = "/usr/bin",
- ?line Be = Bs,
- ?line EBs = "/usr/local/lib/erlang/bin",
- ?line EBe = EBs,
- ?line RP = "../local/lib/erlang/bin",
+ E = "/usr/local",
+ Bs = "/usr/bin",
+ Be = Bs,
+ EBs = "/usr/local/lib/erlang/bin",
+ EBe = EBs,
+ RP = "../local/lib/erlang/bin",
ChkRes = fun (Res, #inst{test_prefix = TP,
destdir = D,
extra_prefix = EP,
bindir_symlinks = BSL,
symlinks = SL}) ->
- ?line B = join([TP, D, EP, Be]),
+ B = join([TP, D, EP, Be]),
Expct = case {SL, BSL} of
{false, _} when BSL == "relative";
BSL == "absolute" ->
- ?line {error, no_ln_s};
+ {error, no_ln_s};
{false, _} ->
- ?line {ok,{absolute,
+ {ok,{absolute,
B,join([TP,D,EP,EBe])}};
{true, "relative"} ->
- ?line {ok,{relative,B,RP}};
+ {ok,{relative,B,RP}};
{true, _} ->
- ?line {ok,{absolute,B,join([TP,EP,EBe])}}
+ {ok,{absolute,B,join([TP,EP,EBe])}}
end,
expect(Expct, Res)
end,
@@ -193,29 +183,29 @@ bin_outside_eprfx(Config) when is_list(Config) ->
bin_outside_eprfx_dirty(Config) when is_list(Config) ->
- ?line E = "/usr/local/lib/..",
- ?line Bs = "/usr/local/lib/../../bin",
- ?line Be = Bs,
- ?line EBs = "/usr/local/lib/erlang/bin",
- ?line EBe = EBs,
- ?line RP = "../local/lib/erlang/bin",
+ E = "/usr/local/lib/..",
+ Bs = "/usr/local/lib/../../bin",
+ Be = Bs,
+ EBs = "/usr/local/lib/erlang/bin",
+ EBe = EBs,
+ RP = "../local/lib/erlang/bin",
ChkRes = fun (Res, #inst{test_prefix = TP,
destdir = D,
extra_prefix = EP,
bindir_symlinks = BSL,
symlinks = SL}) ->
- ?line B = join([TP, D, EP, Be]),
+ B = join([TP, D, EP, Be]),
Expct = case {SL, BSL} of
{false, _} when BSL == "relative";
BSL == "absolute" ->
- ?line {error, no_ln_s};
+ {error, no_ln_s};
{false, _} ->
- ?line {ok,{absolute,
+ {ok,{absolute,
B,join([TP,D,EP,EBe])}};
{true, "relative"} ->
- ?line {ok,{relative,B,RP}};
+ {ok,{relative,B,RP}};
{true, _} ->
- ?line {ok,{absolute,B,join([TP,EP,EBe])}}
+ {ok,{absolute,B,join([TP,EP,EBe])}}
end,
expect(Expct, Res)
end,
@@ -224,33 +214,33 @@ bin_outside_eprfx_dirty(Config) when is_list(Config) ->
erlang_bindir = EBs}, ChkRes).
bin_unreasonable_path(Config) when is_list(Config) ->
- ?line E = "/usr/local/../../..",
- ?line Bs = "/usr/local/../../../bin",
- ?line Be = Bs,
- ?line EBs = "/usr/local/../../../bin_unreasonable_path/usr/local/lib/erlang/bin",
- ?line EBe = EBs,
- ?line RP = "../bin_unreasonable_path/usr/local/lib/erlang/bin",
+ E = "/usr/local/../../..",
+ Bs = "/usr/local/../../../bin",
+ Be = Bs,
+ EBs = "/usr/local/../../../bin_unreasonable_path/usr/local/lib/erlang/bin",
+ EBe = EBs,
+ RP = "../bin_unreasonable_path/usr/local/lib/erlang/bin",
ChkRes = fun (Res, #inst{test_prefix = TP,
destdir = D,
extra_prefix = EP,
bindir_symlinks = BSL,
symlinks = SL}) ->
- ?line B = join([TP, D, EP, Be]),
+ B = join([TP, D, EP, Be]),
Expct = case {TP, SL, BSL} of
{_, false, _} when BSL == "relative";
BSL == "absolute" ->
- ?line {error, no_ln_s};
+ {error, no_ln_s};
{_, false, _} ->
- ?line {ok,{absolute,
+ {ok,{absolute,
B,join([TP,D,EP,EBe])}};
{"", true, "relative"} ->
{error, unreasonable_path};
{"", true, _} ->
- ?line {ok,{absolute,B,join([TP,EP,EBe])}};
+ {ok,{absolute,B,join([TP,EP,EBe])}};
{_, true, "absolute"} ->
- ?line {ok,{absolute,B,join([TP,EP,EBe])}};
+ {ok,{absolute,B,join([TP,EP,EBe])}};
_ ->
- ?line {ok,{relative,B,RP}}
+ {ok,{relative,B,RP}}
end,
expect(Expct, Res)
end,
@@ -259,7 +249,7 @@ bin_unreasonable_path(Config) when is_list(Config) ->
erlang_bindir = EBs}, ChkRes).
bin_unreachable_absolute(Config) when is_list(Config) ->
- TDir = ?config(test_dir, Config),
+ TDir = proplists:get_value(test_dir, Config),
make_dirs(TDir, "/opt/local/lib/erlang/usr/bin"),
make_dirs(TDir, "/opt/local/lib/erlang/bin"),
Erl = join([TDir, "/opt/local/lib/erlang/bin/erl"]),
@@ -270,28 +260,28 @@ bin_unreachable_absolute(Config) when is_list(Config) ->
ok = file:write_file(Erlc, "erlc"),
ok = file:make_symlink("../../../opt/local/lib/erlang/usr",
join([TDir, "/usr/local/lib/erlang"])),
- ?line E = "/usr/local",
- ?line Bs = "/usr/local/bin",
- ?line Be = Bs,
- ?line EBs = "/usr/local/lib/erlang/../bin",
- ?line EBe = EBs,
+ E = "/usr/local",
+ Bs = "/usr/local/bin",
+ Be = Bs,
+ EBs = "/usr/local/lib/erlang/../bin",
+ EBe = EBs,
ChkRes = fun (Res, #inst{test_prefix = TP,
destdir = D,
extra_prefix = EP,
bindir_symlinks = BSL,
symlinks = SL}) ->
- ?line B = join([TP, D, EP, Be]),
+ B = join([TP, D, EP, Be]),
Expct = case {SL, BSL} of
{false, _} when BSL == "relative";
BSL == "absolute" ->
- ?line {error, no_ln_s};
+ {error, no_ln_s};
{false, _} ->
- ?line {ok,{absolute,
+ {ok,{absolute,
B,join([TP,D,EP,EBe])}};
{true, "relative"} ->
{error, unreachable_absolute};
{true, _} ->
- ?line {ok,{absolute,B,join([TP,EP,EBe])}}
+ {ok,{absolute,B,join([TP,EP,EBe])}}
end,
expect(Expct, Res)
end,
@@ -300,7 +290,7 @@ bin_unreachable_absolute(Config) when is_list(Config) ->
erlang_bindir = EBs}, ChkRes).
bin_unreachable_relative(Config) when is_list(Config) ->
- TDir = ?config(test_dir, Config),
+ TDir = proplists:get_value(test_dir, Config),
make_dirs(TDir, "/opt/local/lib/erlang/bin"),
make_dirs(TDir, "/opt/local/bin"),
make_dirs(TDir, "/usr/local/lib/erlang/bin"),
@@ -311,28 +301,28 @@ bin_unreachable_relative(Config) when is_list(Config) ->
ok = file:make_symlink("../../opt/local/bin",
join([TDir, "/usr/local/bin"])),
- ?line E = "/usr/local",
- ?line Bs = "/usr/local/bin",
- ?line Be = Bs,
- ?line EBs = "/usr/local/lib/erlang/bin",
- ?line EBe = EBs,
+ E = "/usr/local",
+ Bs = "/usr/local/bin",
+ Be = Bs,
+ EBs = "/usr/local/lib/erlang/bin",
+ EBe = EBs,
ChkRes = fun (Res, #inst{test_prefix = TP,
destdir = D,
extra_prefix = EP,
bindir_symlinks = BSL,
symlinks = SL}) ->
- ?line B = join([TP, D, EP, Be]),
+ B = join([TP, D, EP, Be]),
Expct = case {SL, BSL} of
{false, _} when BSL == "relative";
BSL == "absolute" ->
- ?line {error, no_ln_s};
+ {error, no_ln_s};
{false, _} ->
- ?line {ok,{absolute,
+ {ok,{absolute,
B,join([TP,D,EP,EBe])}};
{true, "relative"} ->
{error, unreachable_relative};
{true, _} ->
- ?line {ok,{absolute,B,join([TP,EP,EBe])}}
+ {ok,{absolute,B,join([TP,EP,EBe])}}
end,
expect(Expct, Res)
end,
@@ -341,7 +331,7 @@ bin_unreachable_relative(Config) when is_list(Config) ->
erlang_bindir = EBs}, ChkRes).
bin_ok_symlink(Config) when is_list(Config) ->
- TDir = ?config(test_dir, Config),
+ TDir = proplists:get_value(test_dir, Config),
make_dirs(TDir, "/usr/local/bin"),
make_dirs(TDir, "/opt/local/lib/erlang/bin"),
Erl = join([TDir, "/opt/local/lib/erlang/bin/erl"]),
@@ -350,29 +340,29 @@ bin_ok_symlink(Config) when is_list(Config) ->
ok = file:write_file(Erlc, "erlc"),
ok = file:make_symlink("../../opt/local/lib",
join([TDir, "/usr/local/lib"])),
- ?line E = "/usr/local",
- ?line Bs = "/usr/local/bin",
- ?line Be = Bs,
- ?line EBs = "/usr/local/lib/erlang/bin",
- ?line EBe = EBs,
- ?line RP = "../lib/erlang/bin",
+ E = "/usr/local",
+ Bs = "/usr/local/bin",
+ Be = Bs,
+ EBs = "/usr/local/lib/erlang/bin",
+ EBe = EBs,
+ RP = "../lib/erlang/bin",
ChkRes = fun (Res, #inst{test_prefix = TP,
destdir = D,
extra_prefix = EP,
bindir_symlinks = BSL,
symlinks = SL}) ->
- ?line B = join([TP, D, EP, Be]),
+ B = join([TP, D, EP, Be]),
Expct = case {SL, BSL} of
{false, _} when BSL == "relative";
BSL == "absolute" ->
- ?line {error, no_ln_s};
+ {error, no_ln_s};
{false, _} ->
- ?line {ok,{absolute,
+ {ok,{absolute,
B,join([TP,D,EP,EBe])}};
{true, "absolute"} ->
- ?line {ok,{absolute,B,join([TP,EP,EBe])}};
+ {ok,{absolute,B,join([TP,EP,EBe])}};
{true, _} ->
- ?line {ok,{relative,B,RP}}
+ {ok,{relative,B,RP}}
end,
expect(Expct, Res)
end,
@@ -381,7 +371,7 @@ bin_ok_symlink(Config) when is_list(Config) ->
erlang_bindir = EBs}, ChkRes).
bin_same_dir(Config) when is_list(Config) ->
- TDir = ?config(test_dir, Config),
+ TDir = proplists:get_value(test_dir, Config),
make_dirs(TDir, "/usr/local/bin"),
make_dirs(TDir, "/usr/local/lib"),
ok = file:make_symlink("..", join([TDir, "/usr/local/lib/erlang"])),
@@ -417,29 +407,29 @@ bin_not_abs(Config) when is_list(Config) ->
'bin white space'(Config) when is_list(Config) ->
- ?line E = "/u s r/local",
- ?line Bs = "/u s r/local/b i n",
- ?line Be = Bs,
- ?line EBs = "/u s r/local/lib/erl ang/bin",
- ?line EBe = EBs,
- ?line RP = "../lib/erl ang/bin",
+ E = "/u s r/local",
+ Bs = "/u s r/local/b i n",
+ Be = Bs,
+ EBs = "/u s r/local/lib/erl ang/bin",
+ EBe = EBs,
+ RP = "../lib/erl ang/bin",
ChkRes = fun (Res, #inst{test_prefix = TP,
destdir = D,
extra_prefix = EP,
bindir_symlinks = BSL,
symlinks = SL}) ->
- ?line B = join([TP, D, EP, Be]),
+ B = join([TP, D, EP, Be]),
Expct = case {SL, BSL} of
{false, _} when BSL == "relative";
BSL == "absolute" ->
- ?line {error, no_ln_s};
+ {error, no_ln_s};
{false, _} ->
- ?line {ok,{absolute,
+ {ok,{absolute,
B,join([TP,D,EP,EBe])}};
{true, "absolute"} ->
- ?line {ok,{absolute,B,join([TP,EP,EBe])}};
+ {ok,{absolute,B,join([TP,EP,EBe])}};
{true, _} ->
- ?line {ok,{relative,B,RP}}
+ {ok,{relative,B,RP}}
end,
expect(Expct, Res)
end,
@@ -448,29 +438,29 @@ bin_not_abs(Config) when is_list(Config) ->
erlang_bindir = EBs}, ChkRes).
bin_dirname_fail(Config) when is_list(Config) ->
- ?line E = "/opt",
- ?line Bs = "/opt/lib/../bin",
- ?line Be = Bs,
- ?line EBs = "/opt/lib/erlang/otp/bin",
- ?line EBe = EBs,
- ?line CMDPRFX = "PATH=\""++?config(data_dir,Config)++":"++os:getenv("PATH")++"\"",
+ E = "/opt",
+ Bs = "/opt/lib/../bin",
+ Be = Bs,
+ EBs = "/opt/lib/erlang/otp/bin",
+ EBe = EBs,
+ CMDPRFX = "PATH=\""++proplists:get_value(data_dir,Config)++":"++os:getenv("PATH")++"\"",
ChkRes = fun (Res, #inst{test_prefix = TP,
destdir = D,
extra_prefix = EP,
bindir_symlinks = BSL,
symlinks = SL}) ->
- ?line B = join([TP, D, EP, Be]),
+ B = join([TP, D, EP, Be]),
Expct = case {SL, BSL} of
{false, _} when BSL == "relative";
BSL == "absolute" ->
- ?line {error, no_ln_s};
+ {error, no_ln_s};
{false, _} ->
- ?line {ok,{absolute,
+ {ok,{absolute,
B,join([TP,D,EP,EBe])}};
{true, "relative"} ->
- ?line {error, dirname_failed};
+ {error, dirname_failed};
{true, _} ->
- ?line {ok,{absolute,B,join([TP,EP,EBe])}}
+ {ok,{absolute,B,join([TP,EP,EBe])}}
end,
expect(Expct, Res)
end,
@@ -480,30 +470,30 @@ bin_dirname_fail(Config) when is_list(Config) ->
erlang_bindir = EBs}, ChkRes).
bin_no_use_dirname_fail(Config) when is_list(Config) ->
- ?line E = "/opt",
- ?line Bs = "/opt/bin",
- ?line Be = Bs,
- ?line EBs = "/opt/lib/erlang/otp/bin",
- ?line EBe = EBs,
- ?line RP = "../lib/erlang/otp/bin",
- ?line CMDPRFX = "PATH=\""++?config(data_dir,Config)++":"++os:getenv("PATH")++"\"",
+ E = "/opt",
+ Bs = "/opt/bin",
+ Be = Bs,
+ EBs = "/opt/lib/erlang/otp/bin",
+ EBe = EBs,
+ RP = "../lib/erlang/otp/bin",
+ CMDPRFX = "PATH=\""++proplists:get_value(data_dir,Config)++":"++os:getenv("PATH")++"\"",
ChkRes = fun (Res, #inst{test_prefix = TP,
destdir = D,
extra_prefix = EP,
bindir_symlinks = BSL,
symlinks = SL}) ->
- ?line B = join([TP, D, EP, Be]),
+ B = join([TP, D, EP, Be]),
Expct = case {SL, BSL} of
{false, _} when BSL == "relative";
BSL == "absolute" ->
- ?line {error, no_ln_s};
+ {error, no_ln_s};
{false, _} ->
- ?line {ok,{absolute,
+ {ok,{absolute,
B,join([TP,D,EP,EBe])}};
{true, "absolute"} ->
- ?line {ok,{absolute,B,join([TP,EP,EBe])}};
+ {ok,{absolute,B,join([TP,EP,EBe])}};
{true, _} ->
- ?line {ok,{relative,B,RP}}
+ {ok,{relative,B,RP}}
end,
expect(Expct, Res)
end,
@@ -513,7 +503,7 @@ bin_no_use_dirname_fail(Config) when is_list(Config) ->
erlang_bindir = EBs}, ChkRes).
bin_no_srcfile(Config) when is_list(Config) ->
- TDir = ?config(test_dir, Config),
+ TDir = proplists:get_value(test_dir, Config),
make_dirs(TDir, "/opt/local/bin"),
make_dirs(TDir, "/opt/local/lib/erlang/bin"),
Erl = join([TDir, "/opt/local/lib/erlang/bin/erl"]),
@@ -525,13 +515,13 @@ bin_no_srcfile(Config) when is_list(Config) ->
Expct = case {SL, BSL} of
{false, _} when BSL == "relative";
BSL == "absolute" ->
- ?line {error, no_ln_s};
+ {error, no_ln_s};
{false,_} ->
- ?line {error,{no_srcfile, Erlc}};
+ {error,{no_srcfile, Erlc}};
{true, "absolute"} ->
- ?line {error,{no_srcfile, Erlc}};
+ {error,{no_srcfile, Erlc}};
{true, _} ->
- ?line {error,{no_srcfile, RP_Erlc}}
+ {error,{no_srcfile, RP_Erlc}}
end,
expect(Expct, Res)
end,
@@ -549,34 +539,34 @@ bin_no_srcfile(Config) when is_list(Config) ->
%%
expect(X, X) ->
- ?t:format("result: ~p~n", [X]),
- ?t:format("-----------------------------------------------~n", []),
+ io:format("result: ~p~n", [X]),
+ io:format("-----------------------------------------------~n", []),
ok;
expect(X, Y) ->
- ?t:format("expected: ~p~n", [X]),
- ?t:format("got : ~p~n", [Y]),
- ?t:format("-----------------------------------------------~n", []),
- ?t:fail({X,Y}).
+ io:format("expected: ~p~n", [X]),
+ io:format("got : ~p~n", [Y]),
+ io:format("-----------------------------------------------~n", []),
+ ct:fail({X,Y}).
init_per_suite(Config) ->
- PD = ?config(priv_dir, Config),
- SymLinks = case ?t:os_type() of
- {win32, _} -> false;
- _ ->
- case file:make_symlink("nothing",
- filename:join(PD,
- "symlink_test")) of
- ok -> true;
- _ -> false
- end
- end,
+ PD = proplists:get_value(priv_dir, Config),
+ SymLinks = case os:type() of
+ {win32, _} -> false;
+ _ ->
+ case file:make_symlink("nothing",
+ filename:join(PD, "symlink_test")) of
+ ok -> true;
+ _ -> false
+ end
+ end,
[{symlinks, SymLinks} | Config].
end_per_suite(_Config) ->
ok.
init_per_testcase(Case, Config) ->
- init_per_testcase_aux(?config(symlinks,Config),?t:os_type(),Case,Config).
+ init_per_testcase_aux(proplists:get_value(symlinks,Config),
+ os:type(),Case,Config).
init_per_testcase_aux(_, {win32, _}, _Case, _Config) ->
{skip, "Not on windows"};
@@ -586,18 +576,13 @@ init_per_testcase_aux(false, OsType, Case, Config) ->
true -> {skip, "Cannot create symbolic links"}
end;
init_per_testcase_aux(true, _OsType, Case, Config) ->
- Dog = ?t:timetrap(?DEFAULT_TIMEOUT),
- [{watchdog, Dog},
- {testcase, Case},
- {test_dir, make_dirs(?config(priv_dir, Config), atom_to_list(Case))}
+ [{testcase, Case},
+ {test_dir, make_dirs(proplists:get_value(priv_dir, Config), atom_to_list(Case))}
| Config].
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-
make_dirs(Root, Suffix) ->
do_make_dirs(Root, string:tokens(Suffix, [$/])).
@@ -616,9 +601,9 @@ install_bin(Config, #inst{mkdirs = MkDirs,
exec_prefix = EXEC_PREFIX,
bindir = BINDIR,
erlang_bindir = ERLANG_BINDIR} = Inst, ChkRes) ->
- PDir = ?config(priv_dir, Config),
- TDir = ?config(test_dir, Config),
- TD = atom_to_list(?config(testcase, Config)),
+ PDir = proplists:get_value(priv_dir, Config),
+ TDir = proplists:get_value(test_dir, Config),
+ TD = atom_to_list(proplists:get_value(testcase, Config)),
case MkDirs of
false -> ok;
true ->
@@ -641,7 +626,7 @@ install_bin(Config, #inst{mkdirs = MkDirs,
bindir = join([TDir, BINDIR]),
erlang_bindir = join([TDir, ERLANG_BINDIR])},
ChkRes),
- case ?config(symlinks, Config) of
+ case proplists:get_value(symlinks, Config) of
true -> ok;
false -> {comment, "No symlink tests run, since symlinks not working"}
end.
@@ -664,7 +649,7 @@ install_bin2(Config, Inst, ChkRes) ->
install_bin3(Config, Inst#inst{symlinks = false,
ln_s = "cp -p",
bindir_symlinks = "absolute"}, ChkRes),
- case ?config(symlinks, Config) of
+ case proplists:get_value(symlinks, Config) of
true ->
install_bin3(Config, Inst#inst{symlinks = true,
ln_s = "ln -s"}, ChkRes),
@@ -690,9 +675,9 @@ install_bin3(Config,
erlang_bindir = ERLANG_BINDIR,
bindir_symlinks = BINDIR_SYMLINKS} = Inst,
ChkRes) ->
- Test = ?config(testcase, Config),
- DDir = ?config(data_dir, Config),
- TDir = ?config(test_dir, Config),
+ Test = proplists:get_value(testcase, Config),
+ DDir = proplists:get_value(data_dir, Config),
+ TDir = proplists:get_value(test_dir, Config),
InstallBin = filename:join(DDir, "install_bin"),
ResFile = filename:join(TDir, atom_to_list(Test) ++ "-result.txt"),
Cmd = CMD_PRFX ++ " "
@@ -705,7 +690,7 @@ install_bin3(Config,
++ "\" --exec-prefix \"" ++ EXEC_PREFIX
++ "\" --test-file \"" ++ ResFile ++ "\" erl erlc",
- ?t:format("CMD_PRFX = \"~s\"~n"
+ io:format("CMD_PRFX = \"~s\"~n"
"LN_S = \"~s\"~n"
"BINDIR_SYMLINKS = \"~s\"~n"
"exec_prefix = \"~s\"~n"
@@ -716,9 +701,9 @@ install_bin3(Config,
[CMD_PRFX, LN_S, BINDIR_SYMLINKS, EXEC_PREFIX, BINDIR,
ERLANG_BINDIR, EXTRA_PREFIX, DESTDIR]),
- ?t:format("$ ~s~n", [Cmd]),
+ io:format("$ ~s~n", [Cmd]),
CmdOutput = os:cmd(Cmd),
- ?t:format("~s~n", [CmdOutput]),
+ io:format("~s~n", [CmdOutput]),
ChkRes(case file:consult(ResFile) of
{ok, [Res]} -> Res;
Err -> exit({result, Err})
@@ -731,4 +716,3 @@ join([""|Ds]) ->
join(Ds);
join([D|Ds]) ->
"/" ++ string:strip(D, both, $/) ++ join(Ds).
-
diff --git a/erts/test/nt_SUITE.erl b/erts/test/nt_SUITE.erl
index 1ddaaaaeb5..624e5484ba 100644
--- a/erts/test/nt_SUITE.erl
+++ b/erts/test/nt_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -23,55 +23,36 @@
-include_lib("common_test/include/ct.hrl").
-include_lib("kernel/include/file.hrl").
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,init_per_testcase/2,
- end_per_testcase/2,nt/1,handle_eventlog/2,
- middleman/1,service_basic/1, service_env/1, user_env/1, synced/1,
- service_prio/1,
- logout/1, debug/1, restart/1, restart_always/1,stopaction/1,
- shutdown_io/0,do_shutdown_io/0]).
--define(TEST_TIMEOUT, ?t:seconds(180)).
+-export([all/0, suite/0,
+ init_per_testcase/2, end_per_testcase/2,
+ nt/1,handle_eventlog/2,
+ middleman/1,service_basic/1, service_env/1, user_env/1, synced/1,
+ service_prio/1,
+ logout/1, debug/1, restart/1, restart_always/1,stopaction/1,
+ shutdown_io/0,do_shutdown_io/0]).
-define(TEST_SERVICES, [1,2,3,4,5,6,7,8,9,10,11]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {minutes, 3}}].
-all() ->
- case os:type() of
- {win32, nt} ->
+all() ->
+ case {os:type(), os:version()} of
+ {{win32, nt}, Vsn} when Vsn =< {6,1,999999} ->
[nt, service_basic, service_env, user_env, synced,
service_prio, logout, debug, restart, restart_always,
stopaction];
_ -> [nt]
end.
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
init_per_testcase(_Func, Config) ->
- Dog = test_server:timetrap(?TEST_TIMEOUT),
- [{watchdog, Dog} | Config].
+ Config.
-end_per_testcase(_Func, Config) ->
+end_per_testcase(_Func, _Config) ->
lists:foreach(fun(X) ->
- catch remove_service("test_service_" ++
- integer_to_list(X)) end,
- ?TEST_SERVICES),
- Dog = ?config(watchdog, Config),
- catch test_server:timetrap_cancel(Dog),
+ catch remove_service("test_service_" ++ integer_to_list(X))
+ end, ?TEST_SERVICES),
ok.
erlsrv() ->
@@ -80,19 +61,18 @@ erlsrv() ->
recv_prog_output(Port) ->
receive
- {Port, {data, {eol,Data}}} ->
- %%io:format("Got data: ~s~n", [Data]),
- [ Data | recv_prog_output(Port)];
- _X ->
- %%io:format("Got data: ~p~n", [_X]),
- Port ! {self(), close},
- receive
- _ ->
- []
- end
+ {Port, {data, {eol,Data}}} ->
+ %%io:format("Got data: ~s~n", [Data]),
+ [ Data | recv_prog_output(Port)];
+ _X ->
+ %%io:format("Got data: ~p~n", [_X]),
+ Port ! {self(), close},
+ receive
+ _ ->
+ []
+ end
end.
-
%%% X == parameters to erlsrv
%%% returns command output without stderr
do_command(X) ->
@@ -100,11 +80,11 @@ do_command(X) ->
Port = open_port({spawn, erlsrv() ++ " " ++ X}, [stream, {line, 100}, eof, in]),
Res = recv_prog_output(Port),
case Res of
- [] ->
- failed;
- _Y ->
- %%io:format("~p~n",[_Y]),
- ok
+ [] ->
+ failed;
+ _Y ->
+ %%io:format("~p~n",[_Y]),
+ ok
end.
@@ -123,13 +103,13 @@ do_wait_for_it(_,0) ->
false;
do_wait_for_it(FullName,N) ->
case net_adm:ping(FullName) of
- pong ->
- true;
- _ ->
- receive
- after 1000 ->
- do_wait_for_it(FullName,N-1)
- end
+ pong ->
+ true;
+ _ ->
+ receive
+ after 1000 ->
+ do_wait_for_it(FullName,N-1)
+ end
end.
wait_for_node(Name) ->
@@ -139,309 +119,282 @@ wait_for_node(Name) ->
make_full_name(Name) ->
[_,Suffix] = string:tokens(atom_to_list(node()),"@"),
list_to_atom(Name ++ "@" ++ Suffix).
-
+
%%% The following tests are only run on NT:
-service_basic(doc) ->
- ["Check some basic (cosmetic) service parameters"];
-service_basic(suite) -> [];
+%% Check some basic (cosmetic) service parameters
service_basic(Config) when is_list(Config) ->
- ?line Name = "test_service_20",
- ?line IntName = Name++"_internal",
- ?line Service = [{servicename,Name},
- {args, ["-setcookie",
- atom_to_list(erlang:get_cookie())]},
- {internalservicename,IntName},
- {comment,"Epic comment"}],
- ?line ok = erlsrv:store_service(Service),
- ?line start_service(Name),
- ?line true = wait_for_node(Name),
- ?line S2 = erlsrv:get_service(Name),
- ?line {value,{comment,"Epic comment"}} = lists:keysearch(comment,1,S2),
- ?line {value,{internalservicename,IntName}} =
- lists:keysearch(internalservicename,1,S2),
- ?line S3 = lists:keyreplace(comment,1,S2,{comment,"Basic comment"}),
- ?line S4 = lists:keyreplace(internalservicename,1,S3,
- {internalservicename,"WillNotHappen"}),
- ?line ok = erlsrv:store_service(S4),
- ?line S5 = erlsrv:get_service(Name),
- ?line {value,{comment,"Basic comment"}} = lists:keysearch(comment,1,S5),
- ?line {value,{internalservicename,IntName}} =
- lists:keysearch(internalservicename,1,S5),
- ?line NewName = "test_service_21",
- ?line S6 = erlsrv:new_service(NewName,S5,[]), % should remove
- % internalservicename
- ?line ok = erlsrv:store_service(S6),
- ?line S7 = erlsrv:get_service(NewName),
- ?line {value,{comment,"Basic comment"}} = lists:keysearch(comment,1,S7),
- ?line {value,{internalservicename,[$t,$e,$s,$t | _]}} =
- lists:keysearch(internalservicename,1,S7),
- ?line remove_service(Name),
- ?line remove_service(NewName),
+ Name = "test_service_20",
+ IntName = Name++"_internal",
+ Service = [{servicename,Name},
+ {args, ["-setcookie", atom_to_list(erlang:get_cookie())]},
+ {internalservicename,IntName},
+ {comment,"Epic comment"}],
+ ok = erlsrv:store_service(Service),
+ start_service(Name),
+ true = wait_for_node(Name),
+ S2 = erlsrv:get_service(Name),
+ {value,{comment,"Epic comment"}} = lists:keysearch(comment,1,S2),
+ {value,{internalservicename,IntName}} =
+ lists:keysearch(internalservicename,1,S2),
+ S3 = lists:keyreplace(comment,1,S2,{comment,"Basic comment"}),
+ S4 = lists:keyreplace(internalservicename,1,S3,
+ {internalservicename,"WillNotHappen"}),
+ ok = erlsrv:store_service(S4),
+ S5 = erlsrv:get_service(Name),
+ {value,{comment,"Basic comment"}} = lists:keysearch(comment,1,S5),
+ {value,{internalservicename,IntName}} =
+ lists:keysearch(internalservicename,1,S5),
+ NewName = "test_service_21",
+ S6 = erlsrv:new_service(NewName,S5,[]), % should remove
+ % internalservicename
+ ok = erlsrv:store_service(S6),
+ S7 = erlsrv:get_service(NewName),
+ {value,{comment,"Basic comment"}} = lists:keysearch(comment,1,S7),
+ {value,{internalservicename,[$t,$e,$s,$t | _]}} =
+ lists:keysearch(internalservicename,1,S7),
+ remove_service(Name),
+ remove_service(NewName),
ok.
-service_env(doc) ->
- ["Check that service name and executable is in the environment of the " ++
- "erlang process created by erlsrv."];
-service_env(suite) -> [];
+%% Check that service name and executable is in the environment of the
+%% erlang process created by erlsrv.
service_env(Config) when is_list(Config) ->
- ?line Name = "test_service_2",
- ?line Service = [{servicename,Name},
- {args, ["-setcookie",
- atom_to_list(erlang:get_cookie())]}],
- ?line ok = erlsrv:store_service(Service),
- ?line start_service(Name),
- ?line true = wait_for_node(Name),
- ?line Name = rpc:call(make_full_name(Name),os,getenv,
- ["ERLSRV_SERVICE_NAME"]),
- ?line "erlsrv.exe" = filename:basename(
- hd(
- string:tokens(
- rpc:call(make_full_name(Name),
- os,
- getenv,
- ["ERLSRV_EXECUTABLE"]),
- "\""))),
- ?line remove_service(Name),
+ Name = "test_service_2",
+ Service = [{servicename,Name},
+ {args, ["-setcookie", atom_to_list(erlang:get_cookie())]}],
+ ok = erlsrv:store_service(Service),
+ start_service(Name),
+ true = wait_for_node(Name),
+ Name = rpc:call(make_full_name(Name),os,getenv,
+ ["ERLSRV_SERVICE_NAME"]),
+ "erlsrv.exe" = filename:basename(
+ hd(
+ string:tokens(
+ rpc:call(make_full_name(Name),
+ os,
+ getenv,
+ ["ERLSRV_EXECUTABLE"]),
+ "\""))),
+ remove_service(Name),
ok.
-user_env(doc) ->
- ["Check that the user defined environment is ADDED to the service's"++
- " normal dito."];
-user_env(suite) -> [];
+
+%% Check that the user defined environment is ADDED to the service's
+%% normal dito.
user_env(Config) when is_list(Config) ->
- ?line Name = "test_service_3",
- ?line Service = [{servicename,Name},{env,[{"HUBBA","BUBBA"}]},
- {args, ["-setcookie",
- atom_to_list(erlang:get_cookie())]}],
- ?line ok = erlsrv:store_service(Service),
- ?line start_service(Name),
- ?line true = wait_for_node(Name),
- ?line true = rpc:call(make_full_name(Name),os,getenv,
- ["SystemDrive"]) =/= false,
- ?line "BUBBA" = rpc:call(make_full_name(Name),os,getenv,["HUBBA"]),
- ?line remove_service(Name),
+ Name = "test_service_3",
+ Service = [{servicename,Name},{env,[{"HUBBA","BUBBA"}]},
+ {args, ["-setcookie", atom_to_list(erlang:get_cookie())]}],
+ ok = erlsrv:store_service(Service),
+ start_service(Name),
+ true = wait_for_node(Name),
+ true = rpc:call(make_full_name(Name),os,getenv,
+ ["SystemDrive"]) =/= false,
+ "BUBBA" = rpc:call(make_full_name(Name),os,getenv,["HUBBA"]),
+ remove_service(Name),
ok.
-synced(doc) ->
- ["Check that services are stopped and started syncronous and that"++
- " failed stopactions kill the erlang machine anyway."];
-synced(suite) -> [];
+
+%% Check that services are stopped and started syncronous and that
+%% failed stopactions kill the erlang machine anyway.
synced(Config) when is_list(Config) ->
- ?line Name0 = "test_service_4",
- ?line Service0 = [{servicename,Name0},
- {machine, "N:\\nickeNyfikenPaSjukhus"}],
- ?line ok = erlsrv:store_service(Service0),
- ?line true = (catch start_service(Name0)) =/= ok,
- ?line remove_service(Name0),
- ?line Name = "test_service_5",
- ?line Service = [{servicename,Name},
- {stopaction,"erlang:info(garbage_collection)."},
- {args, ["-setcookie",
- atom_to_list(erlang:get_cookie())]}],
- ?line ok = erlsrv:store_service(Service),
- ?line start_service(Name),
- ?line true = wait_for_node(Name),
- ?line T1 = calendar:datetime_to_gregorian_seconds(
- calendar:universal_time()),
- ?line stop_service(Name),
- ?line Diff1 = calendar:datetime_to_gregorian_seconds(
- calendar:universal_time()) - T1,
- ?line true = Diff1 > 30,
- ?line start_service(Name),
- ?line true = wait_for_node(Name),
- ?line T2 = calendar:datetime_to_gregorian_seconds(
- calendar:universal_time()),
- ?line remove_service(Name),
- ?line Diff2 = calendar:datetime_to_gregorian_seconds(
- calendar:universal_time()) - T2,
- ?line true = Diff2 > 30,
+ Name0 = "test_service_4",
+ Service0 = [{servicename,Name0},
+ {machine, "N:\\nickeNyfikenPaSjukhus"}],
+ ok = erlsrv:store_service(Service0),
+ true = (catch start_service(Name0)) =/= ok,
+ remove_service(Name0),
+ Name = "test_service_5",
+ Service = [{servicename,Name},
+ {stopaction,"erlang:info(garbage_collection)."},
+ {args, ["-setcookie", atom_to_list(erlang:get_cookie())]}],
+ ok = erlsrv:store_service(Service),
+ start_service(Name),
+ true = wait_for_node(Name),
+ T1 = calendar:datetime_to_gregorian_seconds(
+ calendar:universal_time()),
+ stop_service(Name),
+ Diff1 = calendar:datetime_to_gregorian_seconds(
+ calendar:universal_time()) - T1,
+ true = Diff1 > 30,
+ start_service(Name),
+ true = wait_for_node(Name),
+ T2 = calendar:datetime_to_gregorian_seconds(
+ calendar:universal_time()),
+ remove_service(Name),
+ Diff2 = calendar:datetime_to_gregorian_seconds(
+ calendar:universal_time()) - T2,
+ true = Diff2 > 30,
ok.
-service_prio(doc) ->
- ["Check that a service with higher prio create port programs with "
- "higher prio."];
-service_prio(suite) -> [];
+
+%% Check that a service with higher prio create port programs with
+%% higher prio.
service_prio(Config) when is_list(Config) ->
- ?line Name = "test_service_6",
- ?line Service = [{servicename,Name},{prio,"high"},
- {env, [{"HEART_COMMAND","echo off"}]},
- {args, ["-setcookie",
- atom_to_list(erlang:get_cookie()),
- "-heart"]}],
- ?line ok = erlsrv:store_service(Service),
- ?line {ok, OldProcs} = get_current_procs(Config),
- ?line start_service(Name),
- ?line {ok, NewProcs} = get_current_procs(Config),
+ Name = "test_service_6",
+ Service = [{servicename,Name},{prio,"high"},
+ {env, [{"HEART_COMMAND","echo off"}]},
+ {args, ["-setcookie", atom_to_list(erlang:get_cookie()),
+ "-heart"]}],
+ ok = erlsrv:store_service(Service),
+ {ok, OldProcs} = get_current_procs(Config),
+ start_service(Name),
+ {ok, NewProcs} = get_current_procs(Config),
timer:sleep(2000),
- ?line {ok, NewProcs2} = get_current_procs(Config),
- ?line remove_service(Name),
- ?line Diff = arrived_procs(OldProcs,NewProcs),
+ {ok, NewProcs2} = get_current_procs(Config),
+ remove_service(Name),
+ Diff = arrived_procs(OldProcs,NewProcs),
io:format("NewProcs ~p~n after sleep~n ~p~n",[Diff, arrived_procs(OldProcs,NewProcs2)]),
%% Not really correct, could fail if another heart is
%% started at the same time...
- ?line {value, {"heart.exe",_,"high"}} =
- lists:keysearch("heart.exe",1,Diff),
+ {value, {"heart.exe",_,"high"}} = lists:keysearch("heart.exe",1,Diff),
ok.
-logout(doc) ->
- ["Check that logout does not kill services"];
-logout(suite) -> [];
+
+%% Check that logout does not kill services
logout(Config) when is_list(Config) ->
- ?line {comment, "Have to be run manually by registering a service with " ++
- "heart, logout and log in again and then examine that the heart " ++
- "process id is not changed."}.
-debug(doc) ->
- ["Check the debug options to erlsrv."];
-debug(suite) -> [];
+ {comment, "Have to be run manually by registering a service with " ++
+ "heart, logout and log in again and then examine that the heart " ++
+ "process id is not changed."}.
+
+%% Check the debug options to erlsrv.
debug(Config) when is_list(Config) ->
- ?line Name0 = "test_service_7",
+ Name0 = "test_service_7",
%% We used to set the privdir as temporary directory, but for some
%% reason we don't seem to have write access to that directory,
%% so we'll use the directory specified in the next line.
- ?line TempDir = "C:/TEMP",
- ?line Service0 = [{servicename,Name0},
- {workdir,filename:nativename(TempDir)},
- {debugtype,"reuse"},
- {args, ["-setcookie",
- atom_to_list(erlang:get_cookie())]}],
- ?line ok = erlsrv:store_service(Service0),
- ?line T1 = calendar:datetime_to_gregorian_seconds(
- calendar:local_time()),
+ TempDir = "C:/TEMP",
+ Service0 = [{servicename,Name0},
+ {workdir,filename:nativename(TempDir)},
+ {debugtype,"reuse"},
+ {args, ["-setcookie", atom_to_list(erlang:get_cookie())]}],
+ ok = erlsrv:store_service(Service0),
+ T1 = calendar:datetime_to_gregorian_seconds(
+ calendar:local_time()),
%% sleep a little
- ?line receive after 2000 -> ok end,
- ?line start_service(Name0),
- ?line true = wait_for_node(Name0),
- ?line LF = filename:join(TempDir, Name0++".debug"),
- ?line {ok,Info0} = file:read_file_info(LF),
- ?line T2 = calendar:datetime_to_gregorian_seconds(
- Info0#file_info.mtime),
- ?line true = T2 > T1,
- ?line remove_service(Name0),
- ?line file:delete(LF),
- ?line Name1 = "test_service_8",
- ?line Service1 = [{servicename,Name1},
- {workdir, filename:nativename(TempDir)},
- {debugtype,"new"},
- {args, ["-setcookie",
- atom_to_list(erlang:get_cookie())]}],
- ?line ok = erlsrv:store_service(Service1),
- ?line T3 = calendar:datetime_to_gregorian_seconds(
- calendar:local_time()),
+ receive after 2000 -> ok end,
+ start_service(Name0),
+ true = wait_for_node(Name0),
+ LF = filename:join(TempDir, Name0++".debug"),
+ {ok,Info0} = file:read_file_info(LF),
+ T2 = calendar:datetime_to_gregorian_seconds(
+ Info0#file_info.mtime),
+ true = T2 > T1,
+ remove_service(Name0),
+ file:delete(LF),
+ Name1 = "test_service_8",
+ Service1 = [{servicename,Name1},
+ {workdir, filename:nativename(TempDir)},
+ {debugtype,"new"},
+ {args, ["-setcookie", atom_to_list(erlang:get_cookie())]}],
+ ok = erlsrv:store_service(Service1),
+ T3 = calendar:datetime_to_gregorian_seconds(
+ calendar:local_time()),
%% sleep a little
- ?line receive after 2000 -> ok end,
- ?line NF = next_logfile(TempDir, Name1),
- ?line start_service(Name1),
- ?line true = wait_for_node(Name1),
- ?line {ok,Info1} = file:read_file_info(NF),
- ?line T4 = calendar:datetime_to_gregorian_seconds(
- Info1#file_info.mtime),
- ?line true = T4 > T3,
- ?line remove_service(Name1),
- ?line file:delete(NF),
+ receive after 2000 -> ok end,
+ NF = next_logfile(TempDir, Name1),
+ start_service(Name1),
+ true = wait_for_node(Name1),
+ {ok,Info1} = file:read_file_info(NF),
+ T4 = calendar:datetime_to_gregorian_seconds(
+ Info1#file_info.mtime),
+ true = T4 > T3,
+ remove_service(Name1),
+ file:delete(NF),
ok.
-restart(doc) ->
- ["Check the restart options to erlsrv"];
-restart(suite) -> [];
+%% Check the restart options to erlsrv
restart(Config) when is_list(Config) ->
- ?line Name = "test_service_9",
- ?line Service = [{servicename,Name},
- {workdir, filename:nativename(logdir(Config))},
- {onfail,"restart"},
- {args, ["-setcookie",
- atom_to_list(erlang:get_cookie())]}],
- ?line ok = erlsrv:store_service(Service),
- ?line start_service(Name),
- ?line true = wait_for_node(Name),
- ?line receive after 20000 -> ok end,
- ?line rpc:call(make_full_name(Name),erlang,halt,[]),
- ?line receive after 1000 -> ok end,
- ?line true = wait_for_node(Name),
- ?line rpc:call(make_full_name(Name),erlang,halt,[]),
- ?line receive after 1000 -> ok end,
- ?line false = wait_for_node(Name),
- ?line remove_service(Name),
+ Name = "test_service_9",
+ Service = [{servicename,Name},
+ {workdir, filename:nativename(logdir(Config))},
+ {onfail,"restart"},
+ {args, ["-setcookie", atom_to_list(erlang:get_cookie())]}],
+ ok = erlsrv:store_service(Service),
+ start_service(Name),
+ true = wait_for_node(Name),
+ receive after 20000 -> ok end,
+ rpc:call(make_full_name(Name),erlang,halt,[]),
+ receive after 1000 -> ok end,
+ true = wait_for_node(Name),
+ rpc:call(make_full_name(Name),erlang,halt,[]),
+ receive after 1000 -> ok end,
+ false = wait_for_node(Name),
+ remove_service(Name),
ok.
-restart_always(doc) ->
- ["Check the restart options to erlsrv"];
-restart_always(suite) -> [];
+%% Check the restart options to erlsrv
restart_always(Config) when is_list(Config) ->
- ?line Name = "test_service_10",
- ?line Service = [{servicename,Name},
- {workdir, filename:nativename(logdir(Config))},
- {onfail,"restart_always"},
- {args, ["-setcookie",
- atom_to_list(erlang:get_cookie())]}],
- ?line ok = erlsrv:store_service(Service),
- ?line start_service(Name),
- ?line true = wait_for_node(Name),
- ?line rpc:call(make_full_name(Name),erlang,halt,[]),
- ?line receive after 1000 -> ok end,
- ?line true = wait_for_node(Name),
- ?line rpc:call(make_full_name(Name),erlang,halt,[]),
- ?line receive after 1000 -> ok end,
- ?line true = wait_for_node(Name),
- ?line remove_service(Name),
+ Name = "test_service_10",
+ Service = [{servicename,Name},
+ {workdir, filename:nativename(logdir(Config))},
+ {onfail,"restart_always"},
+ {args, ["-setcookie", atom_to_list(erlang:get_cookie())]}],
+ ok = erlsrv:store_service(Service),
+ start_service(Name),
+ true = wait_for_node(Name),
+ rpc:call(make_full_name(Name),erlang,halt,[]),
+ receive after 1000 -> ok end,
+ true = wait_for_node(Name),
+ rpc:call(make_full_name(Name),erlang,halt,[]),
+ receive after 1000 -> ok end,
+ true = wait_for_node(Name),
+ remove_service(Name),
ok.
-stopaction(doc) ->
- ["Check that stopaction does not hang output while shutting down"];
-stopaction(suite) -> [];
+
+%% Check that stopaction does not hang output while shutting down
stopaction(Config) when is_list(Config) ->
- ?line Name = "test_service_11",
+ Name = "test_service_11",
%% Icky, I prepend the first element in the codepath, cause
%% I "suppose" it's the one to where I am.
- ?line Service = [{servicename,Name},
- {stopaction,atom_to_list(?MODULE) ++ ":shutdown_io()."},
- {args, ["-setcookie",
- atom_to_list(erlang:get_cookie()),
- "-pa", hd(code:get_path())]}],
- ?line ok = erlsrv:store_service(Service),
- ?line start_service(Name),
- ?line true = wait_for_node(Name),
- ?line T1 = calendar:datetime_to_gregorian_seconds(
- calendar:universal_time()),
- ?line stop_service(Name),
- ?line Diff1 = calendar:datetime_to_gregorian_seconds(
- calendar:universal_time()) - T1,
- ?line true = Diff1 < 30,
- ?line remove_service(Name),
+ Service = [{servicename,Name},
+ {stopaction,atom_to_list(?MODULE) ++ ":shutdown_io()."},
+ {args, ["-setcookie", atom_to_list(erlang:get_cookie()),
+ "-pa", hd(code:get_path())]}],
+ ok = erlsrv:store_service(Service),
+ start_service(Name),
+ true = wait_for_node(Name),
+ T1 = calendar:datetime_to_gregorian_seconds(
+ calendar:universal_time()),
+ stop_service(Name),
+ Diff1 = calendar:datetime_to_gregorian_seconds(
+ calendar:universal_time()) - T1,
+ true = Diff1 < 30,
+ remove_service(Name),
ok.
%%% This test is run on all platforms, but just gives a comment on
%%% other platforms than NT.
-nt(doc) ->
- ["Run NT specific tests."];
-nt(suite) ->
- [];
nt(Config) when is_list(Config) ->
- case os:type() of
- {win32,nt} ->
+ case {os:type(), os:version()} of
+ {{win32, nt}, Vsn} when Vsn =< {6,1,999999} ->
nt_run();
+ {{win32, nt}, _} ->
+ {skipped, "This test case requires admin privileges on Win 8 and later."};
_ ->
{skipped, "This test case is intended for Win NT only."}
end.
nt_run() ->
- ?line start_all(),
- ?line create_service("test_service_1"),
- ?line R = start_look_for_single("System","ErlSrv","Informational",
- ".*test_service_1.*started.*"),
- ?line start_service("test_service_1"),
- ?line Res = look_for_single(R),
- ?line io:format("Result from eventlog: ~p~n",
- [Res]),
- ?line remove_service("test_service_1"),
- ?line stop_all(),
+ start_all(),
+ create_service("test_service_1"),
+ R = start_look_for_single("System","ErlSrv","Informational",
+ ".*test_service_1.*started.*"),
+ start_service("test_service_1"),
+ Res = look_for_single(R),
+ io:format("Result from eventlog: ~p~n",
+ [Res]),
+ remove_service("test_service_1"),
+ stop_all(),
ok.
start_all() ->
Pid1 = spawn_link(?MODULE,middleman,[[]]),
register(?MODULE,Pid1),
_Pid2 = nteventlog:start("log_testing",
- {?MODULE,handle_eventlog,[Pid1]}).
+ {?MODULE,handle_eventlog,[Pid1]}).
stop_all() ->
?MODULE ! stop,
@@ -454,10 +407,10 @@ start_look_for_single(Cat,Fac,Sev,MessRE) ->
look_for_single(Ref) ->
receive
- {Ref,Time,Mes} ->
- {Time,Mes}
+ {Ref,Time,Mes} ->
+ {Time,Mes}
after 60000 ->
- timeout
+ timeout
end.
@@ -468,25 +421,25 @@ handle_eventlog(Mes,Pid) ->
%%% Waitfor = [{Pid, Ref, {Category,Facility,Severity,MessageRE}} ...]
middleman(Waitfor) ->
receive
- {Time,Category,Facility,Severity,Message} ->
- io:format("Middleman got ~s...", [Message]),
- case match_event({Time,Category,Facility,Severity,Message},
- Waitfor) of
- {ok, {Pid,Ref,Time,Mes}, Rest} ->
- io:format("matched~n"),
- Pid ! {Ref,Time,Mes},
- middleman(Rest);
- _ ->
- io:format("no match~n"),
- middleman(Waitfor)
- end;
- {lookfor, X} ->
- io:format("Middleman told to look for ~p~n", [X]),
- middleman([X|Waitfor]);
- stop ->
- stopped;
- _ ->
- middleman(Waitfor)
+ {Time,Category,Facility,Severity,Message} ->
+ io:format("Middleman got ~s...", [Message]),
+ case match_event({Time,Category,Facility,Severity,Message},
+ Waitfor) of
+ {ok, {Pid,Ref,Time,Mes}, Rest} ->
+ io:format("matched~n"),
+ Pid ! {Ref,Time,Mes},
+ middleman(Rest);
+ _ ->
+ io:format("no match~n"),
+ middleman(Waitfor)
+ end;
+ {lookfor, X} ->
+ io:format("Middleman told to look for ~p~n", [X]),
+ middleman([X|Waitfor]);
+ stop ->
+ stopped;
+ _ ->
+ middleman(Waitfor)
end.
@@ -495,81 +448,81 @@ match_event(_X, []) ->
nomatch;
match_event({Time,Cat,Fac,Sev,Mes},[{Pid,Ref,{Cat,Fac,Sev,MesRE}} | Tail]) ->
case re:run(Mes,MesRE,[{capture,none}]) of
- match ->
- %%io:format("Match!~n"),
- {ok,{Pid,Ref,Time,Mes},Tail};
- nomatch ->
- %%io:format("No match~n"),
- case match_event({Time,Cat,Fac,Sev,Mes},Tail) of
- {ok,X,Rest} ->
- {ok,X,[{Pid,Ref,{Cat,Fac,Sev,MesRE}} | Rest]};
- X ->
- X
- end
+ match ->
+ %%io:format("Match!~n"),
+ {ok,{Pid,Ref,Time,Mes},Tail};
+ nomatch ->
+ %%io:format("No match~n"),
+ case match_event({Time,Cat,Fac,Sev,Mes},Tail) of
+ {ok,X,Rest} ->
+ {ok,X,[{Pid,Ref,{Cat,Fac,Sev,MesRE}} | Rest]};
+ X ->
+ X
+ end
end;
match_event(X,[Y | T]) ->
%%io:format("X == ~p, Y == ~p~n",[X,Y]),
case match_event(X,T) of
- {ok,Z,R} ->
- {ok,Z,[Y|R]};
- XX ->
- XX
+ {ok,Z,R} ->
+ {ok,Z,[Y|R]};
+ XX ->
+ XX
end.
arrived_procs(_,[]) ->
[];
arrived_procs(OldProcs,[{Executable, Pid, Priority} | TNewProcs]) ->
case lists:keysearch(Pid,2,OldProcs) of
- {value, _} ->
- arrived_procs(OldProcs, TNewProcs);
- false ->
- [{Executable, Pid, Priority} | arrived_procs(OldProcs, TNewProcs)]
+ {value, _} ->
+ arrived_procs(OldProcs, TNewProcs);
+ false ->
+ [{Executable, Pid, Priority} | arrived_procs(OldProcs, TNewProcs)]
end.
-
+
get_current_procs(Config) ->
- ?line P = open_port({spawn,nt_info(Config) ++ " -E"},
- [{line,10000}]),
- ?line L = receive
- {P,{data,{eol,D}}} ->
- D;
- _ -> "error. "
- end,
- ?line P ! {self(), close},
- ?line receive
- {P, closed} -> ok
- end,
- ?line {done,{ok,Tok,_},_} = erl_scan:tokens([],L,0),
- ?line erl_parse:parse_term(Tok).
+ P = open_port({spawn,nt_info(Config) ++ " -E"},
+ [{line,10000}]),
+ L = receive
+ {P,{data,{eol,D}}} ->
+ D;
+ _ -> "error. "
+ end,
+ P ! {self(), close},
+ receive
+ {P, closed} -> ok
+ end,
+ {done,{ok,Tok,_},_} = erl_scan:tokens([],L,0),
+ erl_parse:parse_term(Tok).
nt_info(Config) when is_list(Config) ->
- ?line "\"" ++ filename:join(?config(data_dir, Config), "nt_info") ++ "\"".
+ "\"" ++ filename:join(proplists:get_value(data_dir, Config), "nt_info") ++ "\"".
logdir(Config) ->
- ?line ?config(priv_dir, Config).
+ proplists:get_value(priv_dir, Config).
look_for_next(Template,L,N) ->
- ?line FN = Template ++ integer_to_list(N),
- ?line case lists:member(FN,L) of
- true ->
- ?line look_for_next(Template,L,N+1);
- false ->
- ?line FN
+ FN = Template ++ integer_to_list(N),
+ case lists:member(FN,L) of
+ true ->
+ look_for_next(Template,L,N+1);
+ false ->
+ FN
end.
next_logfile(LD, Servicename) ->
- ?line {ok, Files} = file:list_dir(LD),
- ?line Ftmpl = Servicename ++ ".debug.",
- ?line filename:join(LD,look_for_next(Ftmpl,Files,1)).
+ {ok, Files} = file:list_dir(LD),
+ Ftmpl = Servicename ++ ".debug.",
+ filename:join(LD,look_for_next(Ftmpl,Files,1)).
%%% Functions run by the service
do_shutdown_io() ->
receive
after 2000 ->
- io:format("IO in shutting down...~n"),
- erlang:halt()
+ io:format("IO in shutting down...~n"),
+ erlang:halt()
end.
shutdown_io() ->
diff --git a/erts/test/nt_SUITE_data/Makefile.src b/erts/test/nt_SUITE_data/Makefile.src
index 26da26b195..2317828337 100644
--- a/erts/test/nt_SUITE_data/Makefile.src
+++ b/erts/test/nt_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2009. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/test/nt_SUITE_data/nt_info.c b/erts/test/nt_SUITE_data/nt_info.c
index 41d9a44c18..8ef52cad2d 100644
--- a/erts/test/nt_SUITE_data/nt_info.c
+++ b/erts/test/nt_SUITE_data/nt_info.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/test/otp_SUITE.erl b/erts/test/otp_SUITE.erl
index 2efb5ae200..54fcfd935f 100644
--- a/erts/test/otp_SUITE.erl
+++ b/erts/test/otp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -20,18 +20,20 @@
-module(otp_SUITE).
--export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,
- init_per_suite/1,end_per_suite/1]).
+-export([all/0, suite/0,
+ init_per_suite/1,end_per_suite/1]).
-export([undefined_functions/1,deprecated_not_in_obsolete/1,
- obsolete_but_not_deprecated/1,call_to_deprecated/1,
+ obsolete_but_not_deprecated/1,call_to_deprecated/1,
call_to_size_1/1,call_to_now_0/1,strong_components/1,
- erl_file_encoding/1,xml_file_encoding/1,runtime_dependencies/1]).
+ erl_file_encoding/1,xml_file_encoding/1,runtime_dependencies/1]).
-include_lib("common_test/include/ct.hrl").
-import(lists, [filter/2,foldl/3,foreach/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {minutes, 10}}].
all() ->
[undefined_functions, deprecated_not_in_obsolete,
@@ -40,54 +42,41 @@ all() ->
erl_file_encoding, xml_file_encoding,
runtime_dependencies].
-groups() ->
- [].
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
init_per_suite(Config) ->
- Dog = test_server:timetrap(?t:minutes(10)),
Root = code:root_dir(),
Server = daily_xref,
- ?line xref:start(Server),
- ?line xref:set_default(Server, [{verbose,false},
- {warnings,false},
- {builtins,true}]),
- ?line {ok,_Relname} = xref:add_release(Server, Root, {name,otp}),
+ xref:start(Server),
+ xref:set_default(Server, [{verbose,false},
+ {warnings,false},
+ {builtins,true}]),
+ {ok,_Relname} = xref:add_release(Server, Root, {name,otp}),
%% If we are running the tests in the source tree, the ERTS application
%% is not in the code path. We must add it explicitly.
case code:lib_dir(erts) of
- {error,bad_name} ->
- Erts = filename:join([code:root_dir(),"erts","preloaded","ebin"]),
- ?line {ok,_} = xref:add_directory(Server, Erts, []);
- _ ->
- ok
+ {error,bad_name} ->
+ Erts = filename:join([code:root_dir(),"erts","preloaded","ebin"]),
+ {ok,_} = xref:add_directory(Server, Erts, []);
+ _ ->
+ ok
end,
-
- ?line ?t:timetrap_cancel(Dog),
[{xref_server,Server}|Config].
end_per_suite(Config) ->
- Server = ?config(xref_server, Config),
+ Server = proplists:get_value(xref_server, Config),
catch xref:stop(Server),
Config.
undefined_functions(Config) when is_list(Config) ->
- Server = ?config(xref_server, Config),
+ Server = proplists:get_value(xref_server, Config),
%% Exclude calls from generated modules in the SSL application.
ExcludeFrom = "SSL-PKIX|PKIX.*|ssl_pkix_oid",
- ?line UndefS = xref_base:analysis(undefined_function_calls),
- ?line Q = io_lib:format("Undef = ~s,"
- "ExcludedFrom = ~p:_/_,"
- "Undef - Undef | ExcludedFrom",
- [UndefS,ExcludeFrom]),
+ UndefS = xref_base:analysis(undefined_function_calls),
+ Q = io_lib:format("Undef = ~s,"
+ "ExcludedFrom = ~p:_/_,"
+ "Undef - Undef | ExcludedFrom",
+ [UndefS,ExcludeFrom]),
{ok,Undef0} = xref:q(Server, lists:flatten(Q)),
Undef1 = hipe_filter(Undef0),
Undef2 = ssl_crypto_filter(Undef1),
@@ -99,124 +88,124 @@ undefined_functions(Config) when is_list(Config) ->
Undef = diameter_filter(Undef7),
case Undef of
- [] -> ok;
- _ ->
- Fd = open_log(Config, "undefined_functions"),
- foreach(fun ({MFA1,MFA2}) ->
- io:format("~s calls undefined ~s",
- [format_mfa(Server, MFA1),
- format_mfa(MFA2)]),
- io:format(Fd, "~s ~s\n",
- [format_mfa(Server, MFA1),
- format_mfa(MFA2)])
- end, Undef),
- close_log(Fd),
- ?line ?t:fail({length(Undef),undefined_functions_in_otp})
+ [] -> ok;
+ _ ->
+ Fd = open_log(Config, "undefined_functions"),
+ foreach(fun ({MFA1,MFA2}) ->
+ io:format("~s calls undefined ~s",
+ [format_mfa(Server, MFA1),
+ format_mfa(MFA2)]),
+ io:format(Fd, "~s ~s\n",
+ [format_mfa(Server, MFA1),
+ format_mfa(MFA2)])
+ end, Undef),
+ close_log(Fd),
+ ct:fail({length(Undef),undefined_functions_in_otp})
end.
hipe_filter(Undef) ->
case erlang:system_info(hipe_architecture) of
- undefined ->
- filter(fun ({_,{hipe_bifs,_,_}}) -> false;
- ({_,{hipe,_,_}}) -> false;
- ({_,{hipe_consttab,_,_}}) -> false;
- ({_,{hipe_converters,_,_}}) -> false;
- ({{code,_,_},{Mod,_,_}}) ->
- not is_hipe_module(Mod);
- ({{code_server,_,_},{Mod,_,_}}) ->
- not is_hipe_module(Mod);
- ({{compile,_,_},{Mod,_,_}}) ->
- not is_hipe_module(Mod);
- ({{hipe,_,_},{Mod,_,_}}) ->
- %% See comment for the next clause.
- not is_hipe_module(Mod);
- ({{cerl_to_icode,translate_flags1,2},
- {hipe_rtl_arch,endianess,0}}) ->
- false;
- ({{Caller,_,_},{Callee,_,_}}) ->
- %% Part of the hipe application is here
- %% for the sake of Dialyzer. There are many
- %% undefined calls within the hipe application.
- not is_hipe_module(Caller) orelse
- not is_hipe_module(Callee);
- (_) -> true
- end, Undef);
- _Arch ->
- filter(fun ({{Mod,_,_},{hipe_bifs,write_u64,2}}) ->
- %% Unavailable except in 64 bit AMD. Ignore it.
- not is_hipe_module(Mod);
- (_) -> true
- end, Undef)
+ undefined ->
+ filter(fun ({_,{hipe_bifs,_,_}}) -> false;
+ ({_,{hipe,_,_}}) -> false;
+ ({_,{hipe_consttab,_,_}}) -> false;
+ ({_,{hipe_converters,_,_}}) -> false;
+ ({{code,_,_},{Mod,_,_}}) ->
+ not is_hipe_module(Mod);
+ ({{code_server,_,_},{Mod,_,_}}) ->
+ not is_hipe_module(Mod);
+ ({{compile,_,_},{Mod,_,_}}) ->
+ not is_hipe_module(Mod);
+ ({{hipe,_,_},{Mod,_,_}}) ->
+ %% See comment for the next clause.
+ not is_hipe_module(Mod);
+ ({{cerl_to_icode,translate_flags1,2},
+ {hipe_rtl_arch,endianess,0}}) ->
+ false;
+ ({{Caller,_,_},{Callee,_,_}}) ->
+ %% Part of the hipe application is here
+ %% for the sake of Dialyzer. There are many
+ %% undefined calls within the hipe application.
+ not is_hipe_module(Caller) orelse
+ not is_hipe_module(Callee);
+ (_) -> true
+ end, Undef);
+ _Arch ->
+ filter(fun ({{Mod,_,_},{hipe_bifs,write_u64,2}}) ->
+ %% Unavailable except in 64 bit AMD. Ignore it.
+ not is_hipe_module(Mod);
+ (_) -> true
+ end, Undef)
end.
is_hipe_module(Mod) ->
case atom_to_list(Mod) of
- "hipe_"++_ -> true;
- _ -> false
+ "hipe_"++_ -> true;
+ _ -> false
end.
ssl_crypto_filter(Undef) ->
case {app_exists(crypto),app_exists(ssl)} of
- {false,false} ->
- filter(fun({_,{ssl,_,_}}) -> false;
- ({_,{crypto,_,_}}) -> false;
- ({_,{ssh,_,_}}) -> false;
- ({_,{ssh_connection,_,_}}) -> false;
- ({_,{ssh_sftp,_,_}}) -> false;
- (_) -> true
- end, Undef);
- {_,_} -> Undef
+ {false,false} ->
+ filter(fun({_,{ssl,_,_}}) -> false;
+ ({_,{crypto,_,_}}) -> false;
+ ({_,{ssh,_,_}}) -> false;
+ ({_,{ssh_connection,_,_}}) -> false;
+ ({_,{ssh_sftp,_,_}}) -> false;
+ (_) -> true
+ end, Undef);
+ {_,_} -> Undef
end.
edoc_filter(Undef) ->
%% Filter away function call that is catched.
filter(fun({{edoc_lib,uri_get_http,1},{http,request_sync,2}}) -> false;
- (_) -> true
- end, Undef).
+ (_) -> true
+ end, Undef).
eunit_filter(Undef) ->
filter(fun({{eunit_test,wrapper_test_exported_,0},
- {eunit_test,nonexisting_function,0}}) -> false;
- (_) -> true
- end, Undef).
+ {eunit_test,nonexisting_function,0}}) -> false;
+ (_) -> true
+ end, Undef).
dialyzer_filter(Undef) ->
case app_exists(dialyzer) of
- false ->
- filter(fun({_,{dialyzer_callgraph,_,_}}) -> false;
- ({_,{dialyzer_codeserver,_,_}}) -> false;
- ({_,{dialyzer_contracts,_,_}}) -> false;
- ({_,{dialyzer_cl_parse,_,_}}) -> false;
- ({_,{dialyzer_timing,_,_}}) -> false;
- ({_,{dialyzer_plt,_,_}}) -> false;
- ({_,{dialyzer_succ_typings,_,_}}) -> false;
- ({_,{dialyzer_utils,_,_}}) -> false;
- (_) -> true
- end, Undef);
- _ -> Undef
+ false ->
+ filter(fun({_,{dialyzer_callgraph,_,_}}) -> false;
+ ({_,{dialyzer_codeserver,_,_}}) -> false;
+ ({_,{dialyzer_contracts,_,_}}) -> false;
+ ({_,{dialyzer_cl_parse,_,_}}) -> false;
+ ({_,{dialyzer_timing,_,_}}) -> false;
+ ({_,{dialyzer_plt,_,_}}) -> false;
+ ({_,{dialyzer_succ_typings,_,_}}) -> false;
+ ({_,{dialyzer_utils,_,_}}) -> false;
+ (_) -> true
+ end, Undef);
+ _ -> Undef
end.
wx_filter(Undef) ->
case app_exists(wx) of
- false ->
- filter(fun({_,{MaybeWxModule,_,_}}) ->
- case atom_to_list(MaybeWxModule) of
- "wx"++_ -> false;
- _ -> true
- end
- end, Undef);
- _ -> Undef
+ false ->
+ filter(fun({_,{MaybeWxModule,_,_}}) ->
+ case atom_to_list(MaybeWxModule) of
+ "wx"++_ -> false;
+ _ -> true
+ end
+ end, Undef);
+ _ -> Undef
end.
-
+
gs_filter(Undef) ->
case code:lib_dir(gs) of
- {error,bad_name} ->
- filter(fun({_,{gs,_,_}}) -> false;
- ({_,{gse,_,_}}) -> false;
+ {error,bad_name} ->
+ filter(fun({_,{gs,_,_}}) -> false;
+ ({_,{gse,_,_}}) -> false;
({_,{tool_utils,_,_}}) -> false;
- (_) -> true
- end, Undef);
- _ -> Undef
+ (_) -> true
+ end, Undef);
+ _ -> Undef
end.
diameter_filter(Undef) ->
@@ -229,80 +218,80 @@ diameter_filter(Undef) ->
false;
({{diameter_lib,_,_},{erlang,time_offset,0}}) ->
false;
- (_) -> true
- end, Undef).
+ (_) -> true
+ end, Undef).
deprecated_not_in_obsolete(Config) when is_list(Config) ->
- ?line Server = ?config(xref_server, Config),
- ?line {ok,DeprecatedFunctions} = xref:q(Server, "DF"),
-
- ?line L = foldl(fun({M,F,A}=MFA, Acc) ->
- case otp_internal:obsolete(M, F, A) of
- no -> [MFA|Acc];
- _ -> Acc
- end
- end, [], DeprecatedFunctions),
+ Server = proplists:get_value(xref_server, Config),
+ {ok,DeprecatedFunctions} = xref:q(Server, "DF"),
+
+ L = foldl(fun({M,F,A}=MFA, Acc) ->
+ case otp_internal:obsolete(M, F, A) of
+ no -> [MFA|Acc];
+ _ -> Acc
+ end
+ end, [], DeprecatedFunctions),
case L of
- [] -> ok;
- _ ->
- io:put_chars("The following functions have -deprecated() attributes,\n"
- "but are not listed in otp_internal:obsolete/3.\n"),
- print_mfas(group_leader(), Server, L),
- Fd = open_log(Config, "deprecated_not_obsolete"),
- print_mfas(Fd, Server, L),
- close_log(Fd),
- ?line ?t:fail({length(L),deprecated_but_not_obsolete})
+ [] -> ok;
+ _ ->
+ io:put_chars("The following functions have -deprecated() attributes,\n"
+ "but are not listed in otp_internal:obsolete/3.\n"),
+ print_mfas(group_leader(), Server, L),
+ Fd = open_log(Config, "deprecated_not_obsolete"),
+ print_mfas(Fd, Server, L),
+ close_log(Fd),
+ ct:fail({length(L),deprecated_but_not_obsolete})
end.
obsolete_but_not_deprecated(Config) when is_list(Config) ->
- ?line Server = ?config(xref_server, Config),
- ?line {ok,NotDeprecated} = xref:q(Server, "X - DF"),
+ Server = proplists:get_value(xref_server, Config),
+ {ok,NotDeprecated} = xref:q(Server, "X - DF"),
- ?line L = foldl(fun({M,F,A}=MFA, Acc) ->
- case otp_internal:obsolete(M, F, A) of
- no -> Acc;
- _ -> [MFA|Acc]
- end
- end, [], NotDeprecated),
+ L = foldl(fun({M,F,A}=MFA, Acc) ->
+ case otp_internal:obsolete(M, F, A) of
+ no -> Acc;
+ _ -> [MFA|Acc]
+ end
+ end, [], NotDeprecated),
case L of
- [] -> ok;
- _ ->
- io:put_chars("The following functions are listed "
- "in otp_internal:obsolete/3,\n"
- "but don't have -deprecated() attributes.\n"),
- print_mfas(group_leader(), Server, L),
- Fd = open_log(Config, "obsolete_not_deprecated"),
- print_mfas(Fd, Server, L),
- close_log(Fd),
- ?line ?t:fail({length(L),obsolete_but_not_deprecated})
+ [] -> ok;
+ _ ->
+ io:put_chars("The following functions are listed "
+ "in otp_internal:obsolete/3,\n"
+ "but don't have -deprecated() attributes.\n"),
+ print_mfas(group_leader(), Server, L),
+ Fd = open_log(Config, "obsolete_not_deprecated"),
+ print_mfas(Fd, Server, L),
+ close_log(Fd),
+ ct:fail({length(L),obsolete_but_not_deprecated})
end.
-
+
call_to_deprecated(Config) when is_list(Config) ->
- Server = ?config(xref_server, Config),
- ?line {ok,DeprecatedCalls} = xref:q(Server, "strict(E || DF)"),
+ Server = proplists:get_value(xref_server, Config),
+ {ok,DeprecatedCalls} = xref:q(Server, "strict(E || DF)"),
foreach(fun ({MFA1,MFA2}) ->
- io:format("~s calls deprecated ~s",
- [format_mfa(MFA1),format_mfa(MFA2)])
- end, DeprecatedCalls),
+ io:format("~s calls deprecated ~s",
+ [format_mfa(MFA1),format_mfa(MFA2)])
+ end, DeprecatedCalls),
{comment,integer_to_list(length(DeprecatedCalls))++" calls to deprecated functions"}.
call_to_size_1(Config) when is_list(Config) ->
%% Applications that do not call erlang:size/1:
Apps = [asn1,compiler,debugger,kernel,observer,parsetools,
- runtime_tools,stdlib,tools],
+ runtime_tools,stdlib,tools],
not_recommended_calls(Config, Apps, {erlang,size,1}).
call_to_now_0(Config) when is_list(Config) ->
%% Applications that do not call erlang:now/1:
Apps = [asn1,common_test,compiler,debugger,dialyzer,
- gs,kernel,mnesia,observer,parsetools,reltool,
- runtime_tools,sasl,stdlib,syntax_tools,
- tools],
+ gs,kernel,mnesia,observer,parsetools,reltool,
+ runtime_tools,sasl,stdlib,syntax_tools,
+ tools],
not_recommended_calls(Config, Apps, {erlang,now,0}).
not_recommended_calls(Config, Apps0, MFA) ->
- Server = ?config(xref_server, Config),
+ Server = proplists:get_value(xref_server, Config),
Apps = [App || App <- Apps0, is_present_application(App, Server)],
@@ -315,14 +304,14 @@ not_recommended_calls(Config, Apps0, MFA) ->
{ok,CallsToMFA} = xref:q(Server, lists:flatten(Q2)),
case CallsToMFA of
- [] ->
+ [] ->
ok;
- _ ->
+ _ ->
io:format("These calls are not allowed:\n"),
- foreach(fun ({MFA1,MFA2}) ->
- io:format("~s calls non-recommended ~s",
- [format_mfa(MFA1),format_mfa(MFA2)])
- end, CallsToMFA)
+ foreach(fun ({MFA1,MFA2}) ->
+ io:format("~s calls non-recommended ~s",
+ [format_mfa(MFA1),format_mfa(MFA2)])
+ end, CallsToMFA)
end,
%% Enumerate calls to MFA from other applications than
@@ -338,7 +327,7 @@ not_recommended_calls(Config, Apps0, MFA) ->
end, Calls)
end,
case CallsToMFA of
- [] ->
+ [] ->
SkippedApps = ordsets:subtract(ordsets:from_list(Apps0),
ordsets:from_list(Apps)),
case SkippedApps of
@@ -350,8 +339,8 @@ not_recommended_calls(Config, Apps0, MFA) ->
[string:join(AppStrings, ", ")]),
{comment, Mess}
end;
- _ ->
- ?t:fail({length(CallsToMFA),calls_to_size_1})
+ _ ->
+ ct:fail({length(CallsToMFA),calls_to_size_1})
end.
is_present_application(Name, Server) ->
@@ -362,8 +351,8 @@ is_present_application(Name, Server) ->
end.
strong_components(Config) when is_list(Config) ->
- Server = ?config(xref_server, Config),
- ?line {ok,Cs} = xref:q(Server, "components AE"),
+ Server = proplists:get_value(xref_server, Config),
+ {ok,Cs} = xref:q(Server, "components AE"),
io:format("\n\nStrong components:\n\n~p\n", [Cs]),
ok.
@@ -371,41 +360,41 @@ erl_file_encoding(_Config) ->
Root = code:root_dir(),
Wc = filename:join([Root,"**","*.erl"]),
ErlFiles = ordsets:subtract(ordsets:from_list(filelib:wildcard(Wc)),
- release_files(Root, "*.erl")),
+ release_files(Root, "*.erl")),
{ok, MP} = re:compile(".*lib/(ic)|(orber)|(cos).*", [unicode]),
Fs = [F || F <- ErlFiles,
- filter_use_latin1_coding(F, MP),
- case epp:read_encoding(F) of
- none -> false;
- _ -> true
- end],
+ filter_use_latin1_coding(F, MP),
+ case epp:read_encoding(F) of
+ none -> false;
+ _ -> true
+ end],
case Fs of
- [] ->
- ok;
- [_|_] ->
- io:put_chars("Files with \"coding:\":\n"),
- [io:put_chars(F) || F <- Fs],
- ?t:fail()
+ [] ->
+ ok;
+ [_|_] ->
+ io:put_chars("Files with \"coding:\":\n"),
+ [io:put_chars(F) || F <- Fs],
+ ct:fail(failed)
end.
filter_use_latin1_coding(F, MP) ->
case re:run(F, MP) of
- nomatch ->
- true;
+ nomatch ->
+ true;
{match, _} ->
- false
+ false
end.
xml_file_encoding(_Config) ->
XmlFiles = xml_files(),
Fs = [F || F <- XmlFiles, is_bad_encoding(F)],
case Fs of
- [] ->
- ok;
- [_|_] ->
- io:put_chars("Encoding should be \"utf-8\" or \"UTF-8\":\n"),
- [io:put_chars(F) || F <- Fs],
- ?t:fail()
+ [] ->
+ ok;
+ [_|_] ->
+ io:put_chars("Encoding should be \"utf-8\" or \"UTF-8\":\n"),
+ [io:put_chars(F) || F <- Fs],
+ ct:fail(failed)
end.
xml_files() ->
@@ -417,7 +406,7 @@ xml_files() ->
XmerlWc = filename:join([Root,"lib","xmerl","**","*.xml"]),
XmerlXmlFiles = ordsets:from_list(filelib:wildcard(XmerlWc)),
Ignore = ordsets:union([TestXmlFiles,XmerlXmlFiles,
- release_files(Root, "*.xml")]),
+ release_files(Root, "*.xml")]),
ordsets:subtract(AllXmlFiles, Ignore).
release_files(Root, Ext) ->
@@ -427,12 +416,12 @@ release_files(Root, Ext) ->
is_bad_encoding(File) ->
{ok,Bin} = file:read_file(File),
case Bin of
- <<"<?xml version=\"1.0\" encoding=\"utf-8\"",_/binary>> ->
- false;
- <<"<?xml version=\"1.0\" encoding=\"UTF-8\"",_/binary>> ->
- false;
- _ ->
- true
+ <<"<?xml version=\"1.0\" encoding=\"utf-8\"",_/binary>> ->
+ false;
+ <<"<?xml version=\"1.0\" encoding=\"UTF-8\"",_/binary>> ->
+ false;
+ _ ->
+ true
end.
runtime_dependencies(Config) ->
@@ -444,31 +433,31 @@ runtime_dependencies(Config) ->
%% Verify that (at least) OTP application runtime dependencies found
%% by xref are listed in the runtime_dependencies field of the .app file
%% of each application.
- Server = ?config(xref_server, Config),
+ Server = proplists:get_value(xref_server, Config),
{ok, AE} = xref:q(Server, "AE"),
SAE = lists:keysort(1, AE),
put(ignored_failures, []),
{AppDep, AppDeps} = lists:foldl(fun ({App, App}, Acc) ->
- Acc;
- ({App, Dep}, {undefined, []}) ->
- {{App, [Dep]}, []};
- ({App, Dep}, {{App, Deps}, AppDeps}) ->
- {{App, [Dep|Deps]}, AppDeps};
- ({App, Dep}, {AppDep, AppDeps}) ->
- {{App, [Dep]}, [AppDep | AppDeps]}
- end,
- {undefined, []},
- SAE),
+ Acc;
+ ({App, Dep}, {undefined, []}) ->
+ {{App, [Dep]}, []};
+ ({App, Dep}, {{App, Deps}, AppDeps}) ->
+ {{App, [Dep|Deps]}, AppDeps};
+ ({App, Dep}, {AppDep, AppDeps}) ->
+ {{App, [Dep]}, [AppDep | AppDeps]}
+ end,
+ {undefined, []},
+ SAE),
check_apps_deps([AppDep|AppDeps], IgnoreApps),
case IgnoreApps of
- [] ->
- ok;
- _ ->
- Comment = lists:flatten(io_lib:format("Ignored applications: ~p "
- "Ignored failures: ~p",
- [IgnoreApps,
- get(ignored_failures)])),
- {comment, Comment}
+ [] ->
+ ok;
+ _ ->
+ Comment = lists:flatten(io_lib:format("Ignored applications: ~p "
+ "Ignored failures: ~p",
+ [IgnoreApps,
+ get(ignored_failures)])),
+ {comment, Comment}
end.
have_rdep(_App, [], _Dep) ->
@@ -476,11 +465,11 @@ have_rdep(_App, [], _Dep) ->
have_rdep(App, [RDep | RDeps], Dep) ->
[AppStr, _VsnStr] = string:tokens(RDep, "-"),
case Dep == list_to_atom(AppStr) of
- true ->
- io:format("~p -> ~s~n", [App, RDep]),
- true;
- false ->
- have_rdep(App, RDeps, Dep)
+ true ->
+ io:format("~p -> ~s~n", [App, RDep]),
+ true;
+ false ->
+ have_rdep(App, RDeps, Dep)
end.
check_app_deps(_App, _AppFile, _AFDeps, [], _IgnoreApps) ->
@@ -488,17 +477,17 @@ check_app_deps(_App, _AppFile, _AFDeps, [], _IgnoreApps) ->
check_app_deps(App, AppFile, AFDeps, [XRDep | XRDeps], IgnoreApps) ->
ResOtherDeps = check_app_deps(App, AppFile, AFDeps, XRDeps, IgnoreApps),
case have_rdep(App, AFDeps, XRDep) of
- true ->
- ResOtherDeps;
- false ->
- Failure = {missing_runtime_dependency, AppFile, XRDep},
- case lists:member(App, IgnoreApps) of
- true ->
- put(ignored_failures, [Failure | get(ignored_failures)]),
- ResOtherDeps;
- false ->
- [Failure | ResOtherDeps]
- end
+ true ->
+ ResOtherDeps;
+ false ->
+ Failure = {missing_runtime_dependency, AppFile, XRDep},
+ case lists:member(App, IgnoreApps) of
+ true ->
+ put(ignored_failures, [Failure | get(ignored_failures)]),
+ ResOtherDeps;
+ false ->
+ [Failure | ResOtherDeps]
+ end
end.
check_apps_deps([], _IgnoreApps) ->
@@ -508,24 +497,24 @@ check_apps_deps([{App, Deps}|AppDeps], IgnoreApps) ->
AppFile = code:where_is_file(atom_to_list(App) ++ ".app"),
{ok,[{application, App, Info}]} = file:consult(AppFile),
case lists:keyfind(runtime_dependencies, 1, Info) of
- {runtime_dependencies, RDeps} ->
- check_app_deps(App, AppFile, RDeps, Deps, IgnoreApps)
- ++ ResOtherApps;
- false ->
- Failure = {missing_runtime_dependencies_key, AppFile},
- case lists:member(App, IgnoreApps) of
- true ->
- put(ignored_failures, [Failure | get(ignored_failures)]),
- ResOtherApps;
- false ->
- [Failure | ResOtherApps]
- end
+ {runtime_dependencies, RDeps} ->
+ check_app_deps(App, AppFile, RDeps, Deps, IgnoreApps)
+ ++ ResOtherApps;
+ false ->
+ Failure = {missing_runtime_dependencies_key, AppFile},
+ case lists:member(App, IgnoreApps) of
+ true ->
+ put(ignored_failures, [Failure | get(ignored_failures)]),
+ ResOtherApps;
+ false ->
+ [Failure | ResOtherApps]
+ end
end.
%%%
%%% Common help functions.
%%%
-
+
print_mfas(Fd, Server, MFAs) ->
[io:format(Fd, "~s\n", [format_mfa(Server, MFA)]) || MFA <- MFAs],
ok.
@@ -537,13 +526,13 @@ format_mfa(Server, MFA) ->
MFAString = format_mfa(MFA),
AQ = "(App)" ++ MFAString,
AppPrefix = case xref:q(Server, AQ) of
- {ok,[App]} -> "[" ++ atom_to_list(App) ++ "]";
- _ -> ""
- end,
+ {ok,[App]} -> "[" ++ atom_to_list(App) ++ "]";
+ _ -> ""
+ end,
AppPrefix ++ MFAString.
open_log(Config, Name) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
RunDir = filename:dirname(filename:dirname(PrivDir)),
Path = filename:join(RunDir, "system_"++Name++".log"),
{ok,Fd} = file:open(Path, [write]),
@@ -554,13 +543,13 @@ close_log(Fd) ->
app_exists(AppAtom) ->
case code:lib_dir(AppAtom) of
- {error,bad_name} ->
- false;
- Path ->
- case file:read_file_info(filename:join(Path,"ebin")) of
- {ok,_} ->
- true;
- _ ->
- false
- end
+ {error,bad_name} ->
+ false;
+ Path ->
+ case file:read_file_info(filename:join(Path,"ebin")) of
+ {ok,_} ->
+ true;
+ _ ->
+ false
+ end
end.
diff --git a/erts/test/run_erl_SUITE.erl b/erts/test/run_erl_SUITE.erl
index e3c563d3d9..47d38bde7c 100644
--- a/erts/test/run_erl_SUITE.erl
+++ b/erts/test/run_erl_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -20,43 +20,19 @@
-module(run_erl_SUITE).
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- init_per_testcase/2,end_per_testcase/2,
- basic/1,heavy/1,heavier/1,defunct/1]).
+-export([all/0, suite/0]).
+-export([basic/1,heavy/1,heavier/1,defunct/1]).
-export([ping_me_back/1]).
-include_lib("common_test/include/ct.hrl").
-init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?t:minutes(2)),
- [{watchdog, Dog}|Config].
-
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
- ok.
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {minutes, 2}}].
all() ->
[basic, heavy, heavier, defunct].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
basic(Config) when is_list(Config) ->
case os:type() of
@@ -65,16 +41,16 @@ basic(Config) when is_list(Config) ->
end.
basic_1(Config) ->
- ?line {Node,Pipe} = do_run_erl(Config, "basic"),
+ {Node,Pipe} = do_run_erl(Config, "basic"),
- ?line ToErl = open_port({spawn,"to_erl "++Pipe}, []),
- ?line erlang:port_command(ToErl, "halt().\r\n"),
+ ToErl = open_port({spawn,"to_erl "++Pipe}, []),
+ erlang:port_command(ToErl, "halt().\r\n"),
receive
{nodedown,Node} ->
- ?line io:format("Down: ~p\n", [Node])
+ io:format("Down: ~p\n", [Node])
after 10000 ->
- ?line ?t:fail()
+ ct:fail(timeout)
end,
ok.
@@ -86,29 +62,28 @@ heavy(Config) when is_list(Config) ->
end.
heavy_1(Config) ->
- ?line {Node,Pipe} = do_run_erl(Config, "heavy"),
+ {Node,Pipe} = do_run_erl(Config, "heavy"),
- ?line ToErl = open_port({spawn,"to_erl "++Pipe}, []),
+ ToErl = open_port({spawn,"to_erl "++Pipe}, []),
IoFormat = "io:format(\"~s\n\", [lists:duplicate(10000, 10)]).\r\n",
- ?line erlang:port_command(ToErl, IoFormat),
- ?line erlang:port_command(ToErl, IoFormat),
- ?line erlang:port_command(ToErl, IoFormat),
- ?line erlang:port_command(ToErl, "init:stop().\r\n"),
+ erlang:port_command(ToErl, IoFormat),
+ erlang:port_command(ToErl, IoFormat),
+ erlang:port_command(ToErl, IoFormat),
+ erlang:port_command(ToErl, "init:stop().\r\n"),
receive
{nodedown,Node} ->
- ?line io:format("Down: ~p\n", [Node])
+ io:format("Down: ~p\n", [Node])
after 10000 ->
- ?line ?t:fail()
+ ct:fail(timeout)
end,
- ?line case count_new_lines(ToErl, 0) of
- Nls when Nls > 30000 ->
- ok;
- Nls ->
- ?line io:format("new_lines: ~p\n", [Nls]),
- ?line ?t:fail()
- end.
+ case count_new_lines(ToErl, 0) of
+ Nls when Nls > 30000 ->
+ ok;
+ Nls ->
+ ct:fail("new_lines: ~p\n", [Nls])
+ end.
ping_me_back([Node]) when is_atom(Node) ->
@@ -137,16 +112,16 @@ heavier(Config) when is_list(Config) ->
end.
heavier_1(Config) ->
- ?line {Node,Pipe} = do_run_erl(Config, "heavier"),
+ {Node,Pipe} = do_run_erl(Config, "heavier"),
- ?line ToErl = open_port({spawn,"to_erl "++Pipe}, []),
+ ToErl = open_port({spawn,"to_erl "++Pipe}, []),
io:format("ToErl = ~p\n", [ToErl]),
Seed = {1,555,42},
rand:seed(exsplus, Seed),
SeedCmd = lists:flatten(io_lib:format("rand:seed(exsplus, ~p). \r\n",
[Seed])),
- ?line io:format("~p\n", [SeedCmd]),
- ?line erlang:port_command(ToErl, SeedCmd),
+ io:format("~p\n", [SeedCmd]),
+ erlang:port_command(ToErl, SeedCmd),
Iter = 1000,
MaxLen = 2048,
@@ -165,19 +140,19 @@ heavier_1(Config) ->
"F(F,"++integer_to_list(Iter)++")."++" \r\n",
- ?line io:format("~p\n", [Random]),
- ?line erlang:port_command(ToErl, Random),
+ io:format("~p\n", [Random]),
+ erlang:port_command(ToErl, Random),
%% Finish.
- ?line erlang:port_command(ToErl, "init:stop().\r\n"),
- ?line receive_all(Iter, ToErl, MaxLen),
+ erlang:port_command(ToErl, "init:stop().\r\n"),
+ receive_all(Iter, ToErl, MaxLen),
receive
{nodedown,Node} ->
- ?line io:format("Down: ~p\n", [Node])
+ io:format("Down: ~p\n", [Node])
after 10000 ->
- ?line c:flush(),
- ?line ?t:fail()
+ c:flush(),
+ ct:fail(timeout)
end,
ok.
@@ -204,9 +179,7 @@ receive_all_2(Iter, {NumChars,Pattern}, Line0, ToErl, MaxLen) ->
%%io:format("Recv: ~p\n", [S]),
receive_all_2(Iter, {NumChars,Pattern}, Line++S, ToErl, MaxLen)
after 10000 ->
- io:format("Timeout waiting for\n~p\ngot\n~p\n",
- [Pattern, Line]),
- ?line ?t:fail()
+ ct:fail("Timeout waiting for\n~p\ngot\n~p\n", [Pattern, Line])
end
end.
@@ -241,49 +214,47 @@ defunct_1(Config) ->
end.
defunct_2(Config, Perl) ->
- ?line Data = ?config(data_dir, Config),
- ?line RunErlTest = filename:join(Data, "run_erl_test.pl"),
- ?line Defuncter = filename:join(Data, "defuncter.pl"),
- ?line Priv = ?config(priv_dir, Config),
- ?line LogDir = filename:join(Priv, "defunct"),
- ?line ok = file:make_dir(LogDir),
- ?line Pipe = LogDir ++ "/",
- ?line RunErl = os:find_executable(run_erl),
- ?line Cmd = Perl ++ " " ++ RunErlTest ++ " \"" ++ RunErl ++ "\" " ++
+ Data = proplists:get_value(data_dir, Config),
+ RunErlTest = filename:join(Data, "run_erl_test.pl"),
+ Defuncter = filename:join(Data, "defuncter.pl"),
+ Priv = proplists:get_value(priv_dir, Config),
+ LogDir = filename:join(Priv, "defunct"),
+ ok = file:make_dir(LogDir),
+ Pipe = LogDir ++ "/",
+ RunErl = os:find_executable(run_erl),
+ Cmd = Perl ++ " " ++ RunErlTest ++ " \"" ++ RunErl ++ "\" " ++
Defuncter ++ " " ++ Pipe ++ " " ++ LogDir,
- ?line io:format("~p", [Cmd]),
- ?line Res = os:cmd(Cmd),
- ?line io:format("~p\n", [Res]),
+ io:format("~p", [Cmd]),
+ Res = os:cmd(Cmd),
+ io:format("~p\n", [Res]),
"OK"++_ = Res,
ok.
%%% Utilities.
do_run_erl(Config, Case) ->
- ?line Priv = ?config(priv_dir, Config),
- ?line LogDir = filename:join(Priv, Case),
- ?line ok = file:make_dir(LogDir),
- ?line Pipe = LogDir ++ "/",
- ?line NodeName = "run_erl_node_" ++ Case,
- ?line Cmd = "run_erl "++Pipe++" "++LogDir++" \"erl -sname " ++ NodeName ++
+ Priv = proplists:get_value(priv_dir, Config),
+ LogDir = filename:join(Priv, Case),
+ ok = file:make_dir(LogDir),
+ Pipe = LogDir ++ "/",
+ NodeName = "run_erl_node_" ++ Case,
+ Cmd = "run_erl "++Pipe++" "++LogDir++" \"erl -sname " ++ NodeName ++
" -pa " ++ filename:dirname(code:which(?MODULE)) ++
" -s " ++ ?MODULE_STRING ++ " ping_me_back " ++
atom_to_list(node()) ++ "\"",
- ?line io:format("~p\n", [Cmd]),
+ io:format("~p\n", [Cmd]),
- ?line net_kernel:monitor_nodes(true),
- ?line open_port({spawn,Cmd}, []),
- ?line [_,Host] = string:tokens(atom_to_list(node()), "@"),
- ?line Node = list_to_atom(NodeName++"@"++Host),
+ net_kernel:monitor_nodes(true),
+ open_port({spawn,Cmd}, []),
+ [_,Host] = string:tokens(atom_to_list(node()), "@"),
+ Node = list_to_atom(NodeName++"@"++Host),
receive
{nodeup,Node} ->
- ?line io:format("Up: ~p\n", [Node]);
+ io:format("Up: ~p\n", [Node]);
Other ->
- ?line io:format("Unexpected: ~p\n", [Other]),
- ?line ?t:fail()
+ ct:fail("Unexpected: ~p\n", [Other])
after 10000 ->
- ?line ?t:fail()
+ ct:fail(timeout)
end,
-
{Node,Pipe}.
diff --git a/erts/test/run_erl_SUITE_data/defuncter.pl b/erts/test/run_erl_SUITE_data/defuncter.pl
index 666d4cca41..0b6771a8bb 100644
--- a/erts/test/run_erl_SUITE_data/defuncter.pl
+++ b/erts/test/run_erl_SUITE_data/defuncter.pl
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2009. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/test/run_erl_SUITE_data/run_erl_test.pl b/erts/test/run_erl_SUITE_data/run_erl_test.pl
index b9e3f0a363..9560fa3c14 100644
--- a/erts/test/run_erl_SUITE_data/run_erl_test.pl
+++ b/erts/test/run_erl_SUITE_data/run_erl_test.pl
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2009. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/test/upgrade_SUITE.erl b/erts/test/upgrade_SUITE.erl
index 83cd2359d8..174c028ac7 100644
--- a/erts/test/upgrade_SUITE.erl
+++ b/erts/test/upgrade_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -50,12 +50,12 @@ init_per_suite(Config) ->
%% Fake release, no applications
{skip, "Need a real release running to create other releases"};
_ ->
- rm_rf(filename:join([?config(data_dir,Config),priv_dir])),
+ rm_rf(filename:join([proplists:get_value(data_dir,Config),priv_dir])),
Config
end.
init_per_testcase(Case,Config) ->
- PrivDir = filename:join([?config(data_dir,Config),priv_dir,Case]),
+ PrivDir = filename:join([proplists:get_value(data_dir,Config),priv_dir,Case]),
CreateDir = filename:join([PrivDir,create]),
InstallDir = filename:join([PrivDir,install]),
ok = filelib:ensure_dir(filename:join(CreateDir,"*")),
@@ -66,10 +66,10 @@ init_per_testcase(Case,Config) ->
end_per_testcase(_Case,Config) ->
Nodes = nodes(),
[test_server:stop_node(Node) || Node <- Nodes],
- case ?config(tc_status,Config) of
+ case proplists:get_value(tc_status,Config) of
ok ->
%% Note that priv_dir here is per test case!
- rm_rf(?config(priv_dir,Config));
+ rm_rf(proplists:get_value(priv_dir,Config));
_fail ->
%% Test case data can be found under DataDir/priv_dir/Case
ok
@@ -115,15 +115,15 @@ upgrade_test(FromVsn,ToVsn,Config) ->
case OldRel of
false ->
%% Note that priv_dir here is per test case!
- rm_rf(?config(priv_dir,Config)),
+ rm_rf(proplists:get_value(priv_dir,Config)),
{skip, "no previous release available"};
_ ->
upgrade_test1(FromVsn,ToVsn,[{old_rel,OldRel}|Config])
end.
upgrade_test1(FromVsn,ToVsn,Config) ->
- CreateDir = ?config(create_dir,Config),
- InstallDir = ?config(install_dir,Config),
+ CreateDir = proplists:get_value(create_dir,Config),
+ InstallDir = proplists:get_value(install_dir,Config),
FromRelName = "otp-"++FromVsn,
ToRelName = "otp-"++ToVsn,
@@ -141,7 +141,7 @@ upgrade_test1(FromVsn,ToVsn,Config) ->
%%% - chmod 'start' and 'start_erl'
target_system(RelName0,RelVsn,CreateDir,InstallDir,Config) ->
{ok,Node} = test_server:start_node(list_to_atom(RelName0),peer,
- [{erl,[?config(old_rel,Config)]}]),
+ [{erl,[proplists:get_value(old_rel,Config)]}]),
{RelName,Apps,ErtsVsn} = create_relfile(Node,CreateDir,RelName0,RelVsn),
@@ -184,7 +184,7 @@ target_system(RelName0,RelVsn,CreateDir,InstallDir,Config) ->
write_file(SysConfig, "[]."),
%% Insert 'start' script from data_dir - modified to add sname and heart
- copy_file(filename:join(?config(data_dir,Config),"start.src"),
+ copy_file(filename:join(proplists:get_value(data_dir,Config),"start.src"),
filename:join(ErtsBinDir,"start.src")),
ok = file:change_mode(filename:join(ErtsBinDir,"start.src"),8#0755),
diff --git a/erts/test/upgrade_SUITE_data/start.src b/erts/test/upgrade_SUITE_data/start.src
index 7098a6919a..67d8de8c9e 100644
--- a/erts/test/upgrade_SUITE_data/start.src
+++ b/erts/test/upgrade_SUITE_data/start.src
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2014. All Rights Reserved.
+# Copyright Ericsson AB 2014-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/test/utils/gccifier.c b/erts/test/utils/gccifier.c
index ca022eb390..0c3ef915fb 100644
--- a/erts/test/utils/gccifier.c
+++ b/erts/test/utils/gccifier.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/erts/test/utils/gccifier.sh b/erts/test/utils/gccifier.sh
index 24b4d2f335..9311e34300 100755
--- a/erts/test/utils/gccifier.sh
+++ b/erts/test/utils/gccifier.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2012. All Rights Reserved.
+# Copyright Ericsson AB 2005-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/erts/test/z_SUITE.erl b/erts/test/z_SUITE.erl
index 7f3260e4cb..281a47134f 100644
--- a/erts/test/z_SUITE.erl
+++ b/erts/test/z_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,8 +24,6 @@
%% This suite expects to be run as the last suite of all suites.
%%
-%-define(line_trace, 1).
-
-include_lib("kernel/include/file.hrl").
-record(core_search_conf, {search_dir,
@@ -34,52 +32,19 @@
file,
run_by_ts}).
--define(DEFAULT_TIMEOUT, ?t:minutes(5)).
-
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- init_per_testcase/2, end_per_testcase/2]).
+-export([all/0, suite/0]).
-export([search_for_core_files/1, core_files/1]).
-include_lib("common_test/include/ct.hrl").
-
-init_per_testcase(Case, Config) ->
- Dog = ?t:timetrap(?DEFAULT_TIMEOUT),
- [{testcase, Case}, {watchdog, Dog} |Config].
-
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
- ok.
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {minutes, 5}}].
all() ->
[core_files].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
-
-core_files(doc) ->
- [];
-core_files(suite) ->
- [];
core_files(Config) when is_list(Config) ->
case os:type() of
{win32, _} ->
@@ -354,7 +319,7 @@ core_file_search(#core_search_conf{search_dir = Base,
case {RunByTS, ICores, FCores} of
{true, [], []} -> ok;
{true, _, []} -> {comment, Res};
- {true, _, _} -> ?t:fail(Res);
+ {true, _, _} -> ct:fail(Res);
_ -> Res
end
end.
diff --git a/lib/Makefile b/lib/Makefile
index 82c7cb6e18..bc5d4cdcc1 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2013. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/asn1/Makefile b/lib/asn1/Makefile
index 1db7532024..26e7e37924 100644
--- a/lib/asn1/Makefile
+++ b/lib/asn1/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/asn1/c_src/Makefile b/lib/asn1/c_src/Makefile
index e0d4f09a70..1f714df357 100644
--- a/lib/asn1/c_src/Makefile
+++ b/lib/asn1/c_src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2012. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/asn1/c_src/asn1_erl_nif.c b/lib/asn1/c_src/asn1_erl_nif.c
index 828b55eec6..4577689fc3 100644
--- a/lib/asn1/c_src/asn1_erl_nif.c
+++ b/lib/asn1/c_src/asn1_erl_nif.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/asn1/doc/src/Makefile b/lib/asn1/doc/src/Makefile
index 463e9231dc..559836116f 100644
--- a/lib/asn1/doc/src/Makefile
+++ b/lib/asn1/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/asn1/doc/src/asn1_getting_started.xml b/lib/asn1/doc/src/asn1_getting_started.xml
index ca7dc3a3cc..3c8ec24723 100644
--- a/lib/asn1/doc/src/asn1_getting_started.xml
+++ b/lib/asn1/doc/src/asn1_getting_started.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/asn1/doc/src/asn1_introduction.xml b/lib/asn1/doc/src/asn1_introduction.xml
index 3c69eb82ab..d8b81aa467 100644
--- a/lib/asn1/doc/src/asn1_introduction.xml
+++ b/lib/asn1/doc/src/asn1_introduction.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/asn1/doc/src/asn1_overview.xml b/lib/asn1/doc/src/asn1_overview.xml
index 3929db7a54..b04401b2dc 100644
--- a/lib/asn1/doc/src/asn1_overview.xml
+++ b/lib/asn1/doc/src/asn1_overview.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/asn1/doc/src/asn1_spec.xmlsrc b/lib/asn1/doc/src/asn1_spec.xmlsrc
index 5409ba0aa1..6367376f50 100644
--- a/lib/asn1/doc/src/asn1_spec.xmlsrc
+++ b/lib/asn1/doc/src/asn1_spec.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/asn1/doc/src/asn1ct.xml b/lib/asn1/doc/src/asn1ct.xml
index e056a89432..e5a7b1bcc4 100644
--- a/lib/asn1/doc/src/asn1ct.xml
+++ b/lib/asn1/doc/src/asn1ct.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/asn1/doc/src/asn1rt.xml b/lib/asn1/doc/src/asn1rt.xml
index 65556f3f87..3f53ca0f56 100644
--- a/lib/asn1/doc/src/asn1rt.xml
+++ b/lib/asn1/doc/src/asn1rt.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/asn1/doc/src/book.xml b/lib/asn1/doc/src/book.xml
index 0947938429..2073405f54 100644
--- a/lib/asn1/doc/src/book.xml
+++ b/lib/asn1/doc/src/book.xml
@@ -5,7 +5,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/asn1/doc/src/notes.xml b/lib/asn1/doc/src/notes.xml
index 78d856b0be..7af6ad72d2 100644
--- a/lib/asn1/doc/src/notes.xml
+++ b/lib/asn1/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/asn1/doc/src/part.xml b/lib/asn1/doc/src/part.xml
index 9423dc5b9e..5a1b8e1a40 100644
--- a/lib/asn1/doc/src/part.xml
+++ b/lib/asn1/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/asn1/doc/src/ref_man.xml b/lib/asn1/doc/src/ref_man.xml
index 01f42f54db..d70e2bc05f 100644
--- a/lib/asn1/doc/src/ref_man.xml
+++ b/lib/asn1/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/asn1/doc/users_guide/Makefile b/lib/asn1/doc/users_guide/Makefile
index ae3a55b945..38196f5e1c 100644
--- a/lib/asn1/doc/users_guide/Makefile
+++ b/lib/asn1/doc/users_guide/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/Makefile b/lib/asn1/src/Makefile
index 5b34017e9b..38cf2d496a 100644
--- a/lib/asn1/src/Makefile
+++ b/lib/asn1/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2013. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1.appup.src b/lib/asn1/src/asn1.appup.src
index 66907055b9..9487d6207d 100644
--- a/lib/asn1/src/asn1.appup.src
+++ b/lib/asn1/src/asn1.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1_db.erl b/lib/asn1/src/asn1_db.erl
index 32052885d3..557eca0ffd 100644
--- a/lib/asn1/src/asn1_db.erl
+++ b/lib/asn1/src/asn1_db.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1_records.hrl b/lib/asn1/src/asn1_records.hrl
index 1ffc6c2980..af10c1771c 100644
--- a/lib/asn1/src/asn1_records.hrl
+++ b/lib/asn1/src/asn1_records.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1ct.erl b/lib/asn1/src/asn1ct.erl
index d0ab947f32..dd269f095d 100644
--- a/lib/asn1/src/asn1ct.erl
+++ b/lib/asn1/src/asn1ct.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1ct_constructed_ber_bin_v2.erl b/lib/asn1/src/asn1ct_constructed_ber_bin_v2.erl
index b31f616677..8f4cf2b9ec 100644
--- a/lib/asn1/src/asn1ct_constructed_ber_bin_v2.erl
+++ b/lib/asn1/src/asn1ct_constructed_ber_bin_v2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1ct_constructed_per.erl b/lib/asn1/src/asn1ct_constructed_per.erl
index 42f9bb836e..a34b25182c 100644
--- a/lib/asn1/src/asn1ct_constructed_per.erl
+++ b/lib/asn1/src/asn1ct_constructed_per.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1ct_func.erl b/lib/asn1/src/asn1ct_func.erl
index ad1494f7af..0cd72acf9d 100644
--- a/lib/asn1/src/asn1ct_func.erl
+++ b/lib/asn1/src/asn1ct_func.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl
index 6d5062a118..bfaffa13bf 100644
--- a/lib/asn1/src/asn1ct_gen.erl
+++ b/lib/asn1/src/asn1ct_gen.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl b/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl
index 311307cf78..b884d14b0d 100644
--- a/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl
+++ b/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1ct_gen_check.erl b/lib/asn1/src/asn1ct_gen_check.erl
index 385c67d628..abe77dd0cb 100644
--- a/lib/asn1/src/asn1ct_gen_check.erl
+++ b/lib/asn1/src/asn1ct_gen_check.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1ct_gen_per.erl b/lib/asn1/src/asn1ct_gen_per.erl
index ff5b19b542..aa7223904e 100644
--- a/lib/asn1/src/asn1ct_gen_per.erl
+++ b/lib/asn1/src/asn1ct_gen_per.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1ct_imm.erl b/lib/asn1/src/asn1ct_imm.erl
index e09256cde9..8b96242c56 100644
--- a/lib/asn1/src/asn1ct_imm.erl
+++ b/lib/asn1/src/asn1ct_imm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1ct_name.erl b/lib/asn1/src/asn1ct_name.erl
index 577c15c7c0..72d541cbbc 100644
--- a/lib/asn1/src/asn1ct_name.erl
+++ b/lib/asn1/src/asn1ct_name.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1ct_parser2.erl b/lib/asn1/src/asn1ct_parser2.erl
index 120ca67226..2de9b0e2f0 100644
--- a/lib/asn1/src/asn1ct_parser2.erl
+++ b/lib/asn1/src/asn1ct_parser2.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1ct_pretty_format.erl b/lib/asn1/src/asn1ct_pretty_format.erl
index 7e28543a05..f4669f7eb0 100644
--- a/lib/asn1/src/asn1ct_pretty_format.erl
+++ b/lib/asn1/src/asn1ct_pretty_format.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1ct_table.erl b/lib/asn1/src/asn1ct_table.erl
index b1eaf2b332..1a3a81d329 100644
--- a/lib/asn1/src/asn1ct_table.erl
+++ b/lib/asn1/src/asn1ct_table.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1ct_tok.erl b/lib/asn1/src/asn1ct_tok.erl
index 5aeb8c171e..8235b689f8 100644
--- a/lib/asn1/src/asn1ct_tok.erl
+++ b/lib/asn1/src/asn1ct_tok.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1ct_value.erl b/lib/asn1/src/asn1ct_value.erl
index 61a5661a11..57cd3f8af6 100644
--- a/lib/asn1/src/asn1ct_value.erl
+++ b/lib/asn1/src/asn1ct_value.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1rt.erl b/lib/asn1/src/asn1rt.erl
index 2c38c27dd8..3e09ce2252 100644
--- a/lib/asn1/src/asn1rt.erl
+++ b/lib/asn1/src/asn1rt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1rt_nif.erl b/lib/asn1/src/asn1rt_nif.erl
index 6ee182ed23..ff464885f6 100644
--- a/lib/asn1/src/asn1rt_nif.erl
+++ b/lib/asn1/src/asn1rt_nif.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1rtt_ber.erl b/lib/asn1/src/asn1rtt_ber.erl
index e50b14941c..fdb9b9061f 100644
--- a/lib/asn1/src/asn1rtt_ber.erl
+++ b/lib/asn1/src/asn1rtt_ber.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1rtt_check.erl b/lib/asn1/src/asn1rtt_check.erl
index 4839fa98dc..e81842fd20 100644
--- a/lib/asn1/src/asn1rtt_check.erl
+++ b/lib/asn1/src/asn1rtt_check.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1rtt_ext.erl b/lib/asn1/src/asn1rtt_ext.erl
index fa55ae4d85..3bf01823db 100644
--- a/lib/asn1/src/asn1rtt_ext.erl
+++ b/lib/asn1/src/asn1rtt_ext.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1rtt_per.erl b/lib/asn1/src/asn1rtt_per.erl
index a3803659b6..753a38aa6e 100644
--- a/lib/asn1/src/asn1rtt_per.erl
+++ b/lib/asn1/src/asn1rtt_per.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1rtt_per_common.erl b/lib/asn1/src/asn1rtt_per_common.erl
index e85dc94f4c..3896cb7fa5 100644
--- a/lib/asn1/src/asn1rtt_per_common.erl
+++ b/lib/asn1/src/asn1rtt_per_common.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1rtt_real_common.erl b/lib/asn1/src/asn1rtt_real_common.erl
index 7b155e5c91..3a79209015 100644
--- a/lib/asn1/src/asn1rtt_real_common.erl
+++ b/lib/asn1/src/asn1rtt_real_common.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/asn1rtt_uper.erl b/lib/asn1/src/asn1rtt_uper.erl
index 7a52324252..0ab8fab141 100644
--- a/lib/asn1/src/asn1rtt_uper.erl
+++ b/lib/asn1/src/asn1rtt_uper.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/src/prepare_templates.erl b/lib/asn1/src/prepare_templates.erl
index 3e24366cdf..3f996a563f 100644
--- a/lib/asn1/src/prepare_templates.erl
+++ b/lib/asn1/src/prepare_templates.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/External.hrl b/lib/asn1/test/External.hrl
index dd4fa6de3a..6619e5c42f 100644
--- a/lib/asn1/test/External.hrl
+++ b/lib/asn1/test/External.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/Makefile b/lib/asn1/test/Makefile
index 9a34fa6271..0716d79291 100644
--- a/lib/asn1/test/Makefile
+++ b/lib/asn1/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2013. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl
index 7214c4b300..b6430134ab 100644
--- a/lib/asn1/test/asn1_SUITE.erl
+++ b/lib/asn1/test/asn1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,7 +34,9 @@
%% Suite definition
%%------------------------------------------------------------------------------
-suite() -> [{ct_hooks, [ts_install_cth]}].
+suite() ->
+ [{ct_hooks, [ts_install_cth]},
+ {timetrap,{minutes,60}}].
all() ->
[{group, compile},
@@ -194,18 +196,15 @@ end_per_group(_GroupName, Config) ->
Config.
init_per_testcase(Func, Config) ->
- CaseDir = filename:join(?config(priv_dir, Config), Func),
+ CaseDir = filename:join(proplists:get_value(priv_dir, Config), Func),
ok = filelib:ensure_dir(filename:join([CaseDir, dummy_file])),
true = code:add_patha(CaseDir),
-
- Dog = case Func of
- testRfcs -> ct:timetrap({minutes, 90});
- _ -> ct:timetrap({minutes, 60})
- end,
- [{case_dir, CaseDir}, {watchdog, Dog}|Config].
+ [{case_dir, CaseDir}|Config].
end_per_testcase(_Func, Config) ->
- code:del_path(?config(case_dir, Config)).
+ CaseDir = proplists:get_value(case_dir, Config),
+ asn1_test_lib:rm_dirs([CaseDir]),
+ code:del_path(CaseDir).
%%------------------------------------------------------------------------------
%% Test runners
@@ -243,7 +242,7 @@ opts(Rule) when is_atom(Rule) -> [];
opts({_Rule, Opts}) -> Opts.
run_case(Config, Fun, Rule, Opts) ->
- CaseDir = ?config(case_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
Dir = filename:join([CaseDir, join(Rule, Opts)]),
ok = filelib:ensure_dir(filename:join([Dir, dummy_file])),
replace_path(CaseDir, Dir),
@@ -465,7 +464,7 @@ testSeqExtension(Config, Rule, Opts) ->
"SeqExtension2"],
Config,
[Rule|Opts]),
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
testSeqExtension:main(Rule, DataDir, [Rule|Opts]).
testSeqOptional(Config) -> test(Config, fun testSeqOptional/3).
@@ -585,8 +584,8 @@ constraint_equivalence(Config, Rule, Opts) ->
asn1_test_lib:compile(M, Config, [Rule|Opts]).
constraint_equivalence_abs(Config) ->
- DataDir = ?config(data_dir, Config),
- CaseDir = ?config(case_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
Asn1Spec = "ConstraintEquivalence",
Asn1Src = filename:join(DataDir, Asn1Spec),
ok = asn1ct:compile(Asn1Src, [abs,{outdir,CaseDir}]),
@@ -637,7 +636,7 @@ module_test(M0, Config, Rule, Opts) ->
%% value for 'Filter' is not guaranteed to terminate.
ok;
M ->
- TestOpts = [{i, ?config(case_dir, Config)}],
+ TestOpts = [{i, proplists:get_value(case_dir, Config)}],
case asn1ct:test(M, TestOpts) of
ok ->
ok;
@@ -768,7 +767,7 @@ testInfObjectClass(Config, Rule, Opts) ->
testUniqueObjectSets(Config) -> test(Config, fun testUniqueObjectSets/3).
testUniqueObjectSets(Config, Rule, Opts) ->
- CaseDir = ?config(case_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
testUniqueObjectSets:main(CaseDir, Rule, Opts).
testInfObjExtract(Config) -> test(Config, fun testInfObjExtract/3).
@@ -993,6 +992,9 @@ testS1AP(Config, Rule, Opts) ->
ok
end.
+testRfcs() ->
+ [{timetrap,{minutes,90}}].
+
testRfcs(Config) -> test(Config, fun testRfcs/3, [{ber,[der]}]).
testRfcs(Config, Rule, Opts) ->
case erlang:system_info(system_architecture) of
@@ -1136,7 +1138,7 @@ test_modules() ->
"CCSNARG3"].
test_OTP_9688(Config) ->
- PrivDir = ?config(case_dir, Config),
+ PrivDir = proplists:get_value(case_dir, Config),
Data = "
OTP-9688 DEFINITIONS ::= BEGIN
@@ -1172,12 +1174,10 @@ testTimer_uper(Config) ->
testTimer:go().
%% Test of multiple-line comment, OTP-8043
-testComment(suite) -> [];
testComment(Config) ->
asn1_test_lib:compile("Comment", Config, []),
asn1_test_lib:roundtrip('Comment', 'Seq', {'Seq',12,true}).
-testName2Number(suite) -> [];
testName2Number(Config) ->
N2NOptions = [{n2n,Type} || Type <- ['CauseMisc', 'CauseProtocol',
'CauseRadioNetwork',
diff --git a/lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn b/lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn
index c0315c1489..71bb915662 100644
--- a/lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn
+++ b/lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn
@@ -1,7 +1,7 @@
--
-- %CopyrightBegin%
--
--- Copyright Ericsson AB 2001-2013. All Rights Reserved.
+-- Copyright Ericsson AB 2001-2016. All Rights Reserved.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/asn1_SUITE_data/TCAPPackage_msg.erl b/lib/asn1/test/asn1_SUITE_data/TCAPPackage_msg.erl
index 7f7c013f30..2b2e539ec0 100644
--- a/lib/asn1/test/asn1_SUITE_data/TCAPPackage_msg.erl
+++ b/lib/asn1/test/asn1_SUITE_data/TCAPPackage_msg.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/asn1_SUITE_data/a_SeqIn.erl b/lib/asn1/test/asn1_SUITE_data/a_SeqIn.erl
index e8db7231f1..948f382e1a 100644
--- a/lib/asn1/test/asn1_SUITE_data/a_SeqIn.erl
+++ b/lib/asn1/test/asn1_SUITE_data/a_SeqIn.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/asn1_SUITE_data/b_SeqIn.erl b/lib/asn1/test/asn1_SUITE_data/b_SeqIn.erl
index ba73a72132..1c3352df44 100644
--- a/lib/asn1/test/asn1_SUITE_data/b_SeqIn.erl
+++ b/lib/asn1/test/asn1_SUITE_data/b_SeqIn.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl b/lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl
index 3600ccac26..6cf8ecf451 100644
--- a/lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl
+++ b/lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/asn1_SUITE_data/test_records.erl b/lib/asn1/test/asn1_SUITE_data/test_records.erl
index 65716bb0dc..9fd07c1449 100644
--- a/lib/asn1/test/asn1_SUITE_data/test_records.erl
+++ b/lib/asn1/test/asn1_SUITE_data/test_records.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -45,19 +45,19 @@ check_record_names({initiatingMessage,
transactionID = _TransactionID,
value = Value}}) ->
- ?line ok = check_record_ProcedureID(ProcedureID),
- ?line ok = check_record_Value(Value).
+ ok = check_record_ProcedureID(ProcedureID),
+ ok = check_record_Value(Value).
check_record_ProcedureID(#'ProcedureID'{}) ->
ok;
check_record_ProcedureID(_) -> false.
check_record_Value(#'ResourceStatusIndication'{protocolIEs = ProtocolIEs}) ->
- ?line ok = check_record_ProtocolIEs(ProtocolIEs);
+ ok = check_record_ProtocolIEs(ProtocolIEs);
check_record_Value(_) -> false.
check_record_ProtocolIEs([#'ProtocolIE-Field'{value =IndicationType}|_]) ->
- ?line ok = check_record_NFResourceStatusInd(IndicationType);
+ ok = check_record_NFResourceStatusInd(IndicationType);
check_record_ProtocolIEs(_) -> false.
check_record_NFResourceStatusInd({'no-Failure',#'No-Failure-ResourceStatusInd'{'local-Cell-InformationList'=[LCIPF]}}) ->
@@ -65,13 +65,13 @@ check_record_NFResourceStatusInd({'no-Failure',#'No-Failure-ResourceStatusInd'{'
check_record_NFResourceStatusInd(_) -> false.
'check_record_NFResourceStatusInd_ProtocolIE-Field'(#'ProtocolIE-Field'{value=LCI}) ->
- ?line ok = check_record_LCInfoResourceStatusInd(LCI);
+ ok = check_record_LCInfoResourceStatusInd(LCI);
'check_record_NFResourceStatusInd_ProtocolIE-Field'(_) -> false.
check_record_LCInfoResourceStatusInd(#'Local-Cell-InformationItem-ResourceStatusInd'{commonChannelsCapacityConsumptionLaw=[CCCCL],dedicatedChannelsCapacityConsumptionLaw=[DCCCL],'iE-Extensions' = [LCIRE]}) ->
- ?line ok = check_record_CCCCL(CCCCL),
- ?line ok = check_record_DCCCL(DCCCL),
- ?line ok = check_record_LCIRE(LCIRE).
+ ok = check_record_CCCCL(CCCCL),
+ ok = check_record_DCCCL(DCCCL),
+ ok = check_record_LCIRE(LCIRE).
check_record_CCCCL(#'CommonChannelsCapacityConsumptionLaw_SEQOF'{}) ->
ok;
diff --git a/lib/asn1/test/asn1_SUITE_data/testobj.erl b/lib/asn1/test/asn1_SUITE_data/testobj.erl
index efb1cf4713..a0e00f8314 100644
--- a/lib/asn1/test/asn1_SUITE_data/testobj.erl
+++ b/lib/asn1/test/asn1_SUITE_data/testobj.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/asn1_app_test.erl b/lib/asn1/test/asn1_app_test.erl
index 71aad5c62f..028322f555 100644
--- a/lib/asn1/test/asn1_app_test.erl
+++ b/lib/asn1/test/asn1_app_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -42,8 +42,6 @@ end_per_group(_GroupName, Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-init_per_suite(suite) -> [];
-init_per_suite(doc) -> [];
init_per_suite(Config) when is_list(Config) ->
case is_app(asn1) of
{ok, AppFile} ->
@@ -64,18 +62,13 @@ is_app(App) ->
end.
-end_per_suite(suite) -> [];
-end_per_suite(doc) -> [];
end_per_suite(Config) when is_list(Config) ->
Config.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-fields(suite) ->
- [];
-fields(doc) ->
- [];
+%% .
fields(Config) when is_list(Config) ->
AppFile = key1search(app_file, Config),
Fields = [vsn, description, modules, registered, applications],
@@ -103,10 +96,7 @@ check_field(Name, AppFile, Missing) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-modules(suite) ->
- [];
-modules(doc) ->
- [];
+%% .
modules(Config) when is_list(Config) ->
AppFile = key1search(app_file, Config),
Mods = key1search(modules, AppFile),
@@ -176,10 +166,7 @@ extra_modules(Mods, [Mod|Ebins], Extra) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-exportall(suite) ->
- [];
-exportall(doc) ->
- [];
+%% .
exportall(Config) when is_list(Config) ->
AppFile = key1search(app_file, Config),
Mods = key1search(modules, AppFile),
@@ -209,10 +196,7 @@ check_export_all([Mod|Mods]) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-app_depend(suite) ->
- [];
-app_depend(doc) ->
- [];
+%% .
app_depend(Config) when is_list(Config) ->
AppFile = key1search(app_file, Config),
Apps = key1search(applications, AppFile),
diff --git a/lib/asn1/test/asn1_appup_test.erl b/lib/asn1/test/asn1_appup_test.erl
index 7df6190f92..54540e53cc 100644
--- a/lib/asn1/test/asn1_appup_test.erl
+++ b/lib/asn1/test/asn1_appup_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -42,14 +42,10 @@ end_per_group(_GroupName, Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-init_per_suite(suite) -> [];
-init_per_suite(doc) -> [];
init_per_suite(Config) when is_list(Config) ->
Config.
-end_per_suite(suite) -> [];
-end_per_suite(doc) -> [];
end_per_suite(Config) when is_list(Config) ->
Config.
diff --git a/lib/asn1/test/asn1_test_lib.erl b/lib/asn1/test/asn1_test_lib.erl
index dbb2600b41..1b4c3b3c77 100644
--- a/lib/asn1/test/asn1_test_lib.erl
+++ b/lib/asn1/test/asn1_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
-module(asn1_test_lib).
-export([compile/3,compile_all/3,compile_erlang/3,
+ rm_dirs/1,
hex_to_bin/1,
match_value/2,
parallel/0,
@@ -34,8 +35,8 @@ run_dialyzer() ->
compile(File, Config, Options) -> compile_all([File], Config, Options).
compile_all(Files, Config, Options) ->
- DataDir = ?config(data_dir, Config),
- CaseDir = ?config(case_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
[compile_file(filename:join(DataDir, F), [{outdir, CaseDir},
debug_info|Options])
|| F <- Files],
@@ -99,12 +100,24 @@ compile_file(File, Options) ->
end.
compile_erlang(Mod, Config, Options) ->
- DataDir = ?config(data_dir, Config),
- CaseDir = ?config(case_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
M = list_to_atom(Mod),
{ok, M} = compile:file(filename:join(DataDir, Mod),
[report,{i,CaseDir},{outdir,CaseDir}|Options]).
+rm_dirs([Dir|Dirs]) ->
+ {ok,L0} = file:list_dir(Dir),
+ L = [filename:join(Dir, F) || F <- L0],
+ IsDir = fun(F) -> filelib:is_dir(F) end,
+ {Subdirs,Files} = lists:partition(IsDir, L),
+ _ = [ok = file:delete(F) || F <- Files],
+ rm_dirs(Subdirs),
+ ok = file:del_dir(Dir),
+ rm_dirs(Dirs);
+rm_dirs([]) ->
+ ok.
+
hex_to_bin(S) ->
<< <<(hex2num(C)):4>> || C <- S, C =/= $\s >>.
diff --git a/lib/asn1/test/ber_decode_error.erl b/lib/asn1/test/ber_decode_error.erl
index 8268698b8d..c0840e02d7 100644
--- a/lib/asn1/test/ber_decode_error.erl
+++ b/lib/asn1/test/ber_decode_error.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/error_SUITE.erl b/lib/asn1/test/error_SUITE.erl
index caae845592..6ce77d93fb 100644
--- a/lib/asn1/test/error_SUITE.erl
+++ b/lib/asn1/test/error_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -929,8 +929,8 @@ values(Config) ->
run({Mod,Spec}, Config) ->
Base = atom_to_list(Mod) ++ ".asn1",
- File = filename:join(?config(priv_dir, Config), Base),
- Include0 = filename:dirname(?config(data_dir, Config)),
+ File = filename:join(proplists:get_value(priv_dir, Config), Base),
+ Include0 = filename:dirname(proplists:get_value(data_dir, Config)),
Include = filename:join(filename:dirname(Include0), "asn1_SUITE_data"),
ok = file:write_file(File, Spec),
asn1ct:compile(File, [{i, Include}]).
diff --git a/lib/asn1/test/h323test.erl b/lib/asn1/test/h323test.erl
index 566abd9714..935af0ba09 100644
--- a/lib/asn1/test/h323test.erl
+++ b/lib/asn1/test/h323test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/syntax_SUITE.erl b/lib/asn1/test/syntax_SUITE.erl
index a354b75062..442ec59c70 100644
--- a/lib/asn1/test/syntax_SUITE.erl
+++ b/lib/asn1/test/syntax_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -305,7 +305,7 @@ run(List, File, Config) ->
run(List, File0, Config, Module) ->
Base = File0 ++ ".asn1",
- File = filename:join(?config(priv_dir, Config), Base),
+ File = filename:join(proplists:get_value(priv_dir, Config), Base),
case run_1(List, Base, File, Module, 0) of
0 -> ok;
Errors -> ?t:fail(Errors)
diff --git a/lib/asn1/test/testChoExtension.erl b/lib/asn1/test/testChoExtension.erl
index f4dc00b33c..4c632aab81 100644
--- a/lib/asn1/test/testChoExtension.erl
+++ b/lib/asn1/test/testChoExtension.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testChoExternal.erl b/lib/asn1/test/testChoExternal.erl
index fd9bcf4406..22f4ad859a 100644
--- a/lib/asn1/test/testChoExternal.erl
+++ b/lib/asn1/test/testChoExternal.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testChoOptional.erl b/lib/asn1/test/testChoOptional.erl
index d573e76a89..1f318315e9 100644
--- a/lib/asn1/test/testChoOptional.erl
+++ b/lib/asn1/test/testChoOptional.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testChoPrim.erl b/lib/asn1/test/testChoPrim.erl
index 14518285aa..573c482f2b 100644
--- a/lib/asn1/test/testChoPrim.erl
+++ b/lib/asn1/test/testChoPrim.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testChoRecursive.erl b/lib/asn1/test/testChoRecursive.erl
index 040aeabe48..1147d08442 100644
--- a/lib/asn1/test/testChoRecursive.erl
+++ b/lib/asn1/test/testChoRecursive.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testChoTypeRefCho.erl b/lib/asn1/test/testChoTypeRefCho.erl
index b0a9fd68bd..e0306425b9 100644
--- a/lib/asn1/test/testChoTypeRefCho.erl
+++ b/lib/asn1/test/testChoTypeRefCho.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testChoTypeRefPrim.erl b/lib/asn1/test/testChoTypeRefPrim.erl
index 59d23a8683..a7b77477a5 100644
--- a/lib/asn1/test/testChoTypeRefPrim.erl
+++ b/lib/asn1/test/testChoTypeRefPrim.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testChoTypeRefSeq.erl b/lib/asn1/test/testChoTypeRefSeq.erl
index 87c94fc888..f00b185e0c 100644
--- a/lib/asn1/test/testChoTypeRefSeq.erl
+++ b/lib/asn1/test/testChoTypeRefSeq.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testChoTypeRefSet.erl b/lib/asn1/test/testChoTypeRefSet.erl
index d2ff48af91..87de6057d9 100644
--- a/lib/asn1/test/testChoTypeRefSet.erl
+++ b/lib/asn1/test/testChoTypeRefSet.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testChoiceIndefinite.erl b/lib/asn1/test/testChoiceIndefinite.erl
index f5ae3ff882..765e772648 100644
--- a/lib/asn1/test/testChoiceIndefinite.erl
+++ b/lib/asn1/test/testChoiceIndefinite.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testCompactBitString.erl b/lib/asn1/test/testCompactBitString.erl
index 6265e20ab2..319ecc1a59 100644
--- a/lib/asn1/test/testCompactBitString.erl
+++ b/lib/asn1/test/testCompactBitString.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testConstraints.erl b/lib/asn1/test/testConstraints.erl
index 7da3ea3d38..6a1fbe4f73 100644
--- a/lib/asn1/test/testConstraints.erl
+++ b/lib/asn1/test/testConstraints.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testContextSwitchingTypes.erl b/lib/asn1/test/testContextSwitchingTypes.erl
index 3779f61f2f..10012908a9 100644
--- a/lib/asn1/test/testContextSwitchingTypes.erl
+++ b/lib/asn1/test/testContextSwitchingTypes.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ test(Config) ->
check_EXTERNAL(enc_dec('T', ValT_4)),
{ok,ValT2} = asn1ct:value('ContextSwitchingTypes', 'T',
- [{i,?config(case_dir, Config)}]),
+ [{i,proplists:get_value(case_dir, Config)}]),
io:format("ValT2 ~p~n",[ValT2]),
check_EXTERNAL(enc_dec('T', ValT2)),
diff --git a/lib/asn1/test/testDER.erl b/lib/asn1/test/testDER.erl
index edaaa12eba..c8f28be5f6 100644
--- a/lib/asn1/test/testDER.erl
+++ b/lib/asn1/test/testDER.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testDeepTConstr.erl b/lib/asn1/test/testDeepTConstr.erl
index ed37df7204..9169cf5953 100644
--- a/lib/asn1/test/testDeepTConstr.erl
+++ b/lib/asn1/test/testDeepTConstr.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testDef.erl b/lib/asn1/test/testDef.erl
index 5fa5711473..eae8e6d378 100644
--- a/lib/asn1/test/testDef.erl
+++ b/lib/asn1/test/testDef.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testDoubleEllipses.erl b/lib/asn1/test/testDoubleEllipses.erl
index 4a054a14ed..4b50869fd2 100644
--- a/lib/asn1/test/testDoubleEllipses.erl
+++ b/lib/asn1/test/testDoubleEllipses.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testEnumExt.erl b/lib/asn1/test/testEnumExt.erl
index 057fcb694b..0f8ca816d4 100644
--- a/lib/asn1/test/testEnumExt.erl
+++ b/lib/asn1/test/testEnumExt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testExtensibilityImplied.erl b/lib/asn1/test/testExtensibilityImplied.erl
index a039bec576..3b2e021c48 100644
--- a/lib/asn1/test/testExtensibilityImplied.erl
+++ b/lib/asn1/test/testExtensibilityImplied.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testFragmented.erl b/lib/asn1/test/testFragmented.erl
index 99867c016e..59e5c99c61 100644
--- a/lib/asn1/test/testFragmented.erl
+++ b/lib/asn1/test/testFragmented.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testINSTANCE_OF.erl b/lib/asn1/test/testINSTANCE_OF.erl
index b9079d8e95..aceaaf7a1d 100644
--- a/lib/asn1/test/testINSTANCE_OF.erl
+++ b/lib/asn1/test/testINSTANCE_OF.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testImporting.erl b/lib/asn1/test/testImporting.erl
index 5eb950100d..79ad48c0f4 100644
--- a/lib/asn1/test/testImporting.erl
+++ b/lib/asn1/test/testImporting.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testInfObj.erl b/lib/asn1/test/testInfObj.erl
index 1b38d5414e..5a9f47d865 100644
--- a/lib/asn1/test/testInfObj.erl
+++ b/lib/asn1/test/testInfObj.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testInfObjExtract.erl b/lib/asn1/test/testInfObjExtract.erl
index ba1d92c100..b51611f95f 100644
--- a/lib/asn1/test/testInfObjExtract.erl
+++ b/lib/asn1/test/testInfObjExtract.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testInfObjectClass.erl b/lib/asn1/test/testInfObjectClass.erl
index a7d0f2b6bd..560986fac9 100644
--- a/lib/asn1/test/testInfObjectClass.erl
+++ b/lib/asn1/test/testInfObjectClass.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testMegaco.erl b/lib/asn1/test/testMegaco.erl
index 61794ec02d..0be798b962 100644
--- a/lib/asn1/test/testMegaco.erl
+++ b/lib/asn1/test/testMegaco.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -32,13 +32,13 @@ compile(Config, Erule, Options) ->
main(no_module,_) -> ok;
main('OLD-MEDIA-GATEWAY-CONTROL',Config) ->
- CaseDir = ?config(case_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
{ok,Msg} = asn1ct:value('OLD-MEDIA-GATEWAY-CONTROL','MegacoMessage',
[{i, CaseDir}]),
asn1_test_lib:roundtrip('OLD-MEDIA-GATEWAY-CONTROL', 'MegacoMessage', Msg),
ok;
main('MEDIA-GATEWAY-CONTROL'=Mod, Config) ->
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
Files = filelib:wildcard(filename:join([DataDir,megacomessages,"*.val"])),
lists:foreach(fun(File) ->
{ok,Bin} = file:read_file(File),
diff --git a/lib/asn1/test/testMergeCompile.erl b/lib/asn1/test/testMergeCompile.erl
index 5011c7d576..f0e68e07b7 100644
--- a/lib/asn1/test/testMergeCompile.erl
+++ b/lib/asn1/test/testMergeCompile.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -66,16 +66,16 @@ main(Erule) ->
mvrasn(Erule) ->
case Erule of
ber ->
- ?line ok = test(isd),
- ?line ok = test(isd2),
- ?line ok = test(dsd),
- ?line ok = test(ul_res),
- ?line ok = test(seqofseq),
- ?line ok = test('InsertSubscriberDataArg');
+ ok = test(isd),
+ ok = test(isd2),
+ ok = test(dsd),
+ ok = test(ul_res),
+ ok = test(seqofseq),
+ ok = test('InsertSubscriberDataArg');
_ ->
ok
end,
- ?line ok = test(mvrasn6,'InsertSubscriberDataArg').
+ ok = test(mvrasn6,'InsertSubscriberDataArg').
test(isd)->
EncPdu = <<48,128,129,7,145,148,113,50,1,0,241,131,1,0,176,128,5,0,
diff --git a/lib/asn1/test/testMultipleLevels.erl b/lib/asn1/test/testMultipleLevels.erl
index 0f465ee9da..c610e59f3d 100644
--- a/lib/asn1/test/testMultipleLevels.erl
+++ b/lib/asn1/test/testMultipleLevels.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testNBAPsystem.erl b/lib/asn1/test/testNBAPsystem.erl
index 2a7e39597a..1af283af42 100644
--- a/lib/asn1/test/testNBAPsystem.erl
+++ b/lib/asn1/test/testNBAPsystem.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -92,23 +92,23 @@ compile(Config, Options) ->
test(_Erule,Config) ->
- ?line ok = enc_audit_req_msg(),
- ?line ok = cell_setup_req_msg_test(),
+ ok = enc_audit_req_msg(),
+ ok = cell_setup_req_msg_test(),
ticket_5812(Config).
ticket_5812(Config) ->
- ?line Msg = v_5812(),
+ Msg = v_5812(),
{ok,B2} = 'NBAP-PDU-Discriptions':encode('NBAP-PDU', Msg),
V = <<0,28,74,0,3,48,0,0,1,0,123,64,41,0,0,0,126,64,35,95,208,2,89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,145,0,1,205,0,0,0,0,2,98,64,1,128>>,
- ?line ok = compare(V,B2),
+ ok = compare(V,B2),
{ok,Msg2} = 'NBAP-PDU-Discriptions':decode('NBAP-PDU', B2),
- ?line ok = check_record_names(Msg2,Config).
+ ok = check_record_names(Msg2,Config).
enc_audit_req_msg() ->
Msg = {initiatingMessage, audit_req_msg()},
{ok,B} = 'NBAP-PDU-Discriptions':encode('NBAP-PDU', Msg),
{ok,_Msg} = 'NBAP-PDU-Discriptions':decode('NBAP-PDU', B),
- ?line {initiatingMessage,
+ {initiatingMessage,
#'InitiatingMessage'{value=#'AuditRequest'{protocolIEs=[{_,114,ignore,_}],
protocolExtensions = asn1_NOVALUE}}} = _Msg,
io:format("Msg: ~n~P~n~n_Msg:~n~P~n",[Msg,15,_Msg,15]),
@@ -285,8 +285,8 @@ compare(_,_) ->
false.
check_record_names(Msg,Config) ->
- DataDir = ?config(data_dir,Config),
- CaseDir = ?config(case_dir,Config),
+ DataDir = proplists:get_value(data_dir,Config),
+ CaseDir = proplists:get_value(case_dir,Config),
{ok, test_records} = compile:file(filename:join([DataDir, "test_records"]),
[{i, CaseDir}]),
ok = test_records:'check_record_names_OTP-5812'(Msg).
diff --git a/lib/asn1/test/testOpenTypeImplicitTag.erl b/lib/asn1/test/testOpenTypeImplicitTag.erl
index fc2f2a81e6..b1534bd268 100644
--- a/lib/asn1/test/testOpenTypeImplicitTag.erl
+++ b/lib/asn1/test/testOpenTypeImplicitTag.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testOpt.erl b/lib/asn1/test/testOpt.erl
index a15aa28f02..d7e194078e 100644
--- a/lib/asn1/test/testOpt.erl
+++ b/lib/asn1/test/testOpt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testParamBasic.erl b/lib/asn1/test/testParamBasic.erl
index 768c5ad2fa..1455c6e81a 100644
--- a/lib/asn1/test/testParamBasic.erl
+++ b/lib/asn1/test/testParamBasic.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testParameterizedInfObj.erl b/lib/asn1/test/testParameterizedInfObj.erl
index 8b0353522d..d485ef137e 100644
--- a/lib/asn1/test/testParameterizedInfObj.erl
+++ b/lib/asn1/test/testParameterizedInfObj.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -97,7 +97,7 @@ roundtrip(T, V) ->
ranap(_Erule) ->
PIEVal2 = [{'ProtocolIE-Field',4,ignore,{radioNetwork,'rab-pre-empted'}}],
- ?line Val2 =
+ Val2 =
#'InitiatingMessage'{procedureCode=1,
criticality=ignore,
value=#'Iu-ReleaseCommand'{protocolIEs=PIEVal2,
@@ -121,8 +121,8 @@ param2(Config, Erule) ->
{'ProtocolIE-Field',101,true}]}),
%% Now remove the data after the extension mark in the object set.
- DataDir = ?config(data_dir, Config),
- CaseDir = ?config(case_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
Asn1SrcBase = "Param2.asn1",
Asn1SrcFile0 = filename:join(DataDir, Asn1SrcBase),
{ok,Src0} = file:read_file(Asn1SrcFile0),
diff --git a/lib/asn1/test/testPrim.erl b/lib/asn1/test/testPrim.erl
index 82da953ca1..96a2dd6c79 100644
--- a/lib/asn1/test/testPrim.erl
+++ b/lib/asn1/test/testPrim.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testPrimExternal.erl b/lib/asn1/test/testPrimExternal.erl
index 79c8a3a045..f06acebd66 100644
--- a/lib/asn1/test/testPrimExternal.erl
+++ b/lib/asn1/test/testPrimExternal.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testPrimStrings.erl b/lib/asn1/test/testPrimStrings.erl
index 042b1757ba..cb97655c15 100644
--- a/lib/asn1/test/testPrimStrings.erl
+++ b/lib/asn1/test/testPrimStrings.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testRfcs.erl b/lib/asn1/test/testRfcs.erl
index fa4389b904..da7333ef98 100644
--- a/lib/asn1/test/testRfcs.erl
+++ b/lib/asn1/test/testRfcs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -27,11 +27,11 @@
compile(Config, Erules, Options0) ->
Options = [no_ok_wrapper|Options0],
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
Specs0 = filelib:wildcard("*.asn1", filename:join(DataDir, rfcs)),
Specs = [filename:join(rfcs, Spec) || Spec <- Specs0],
122 = length(Specs),
- CaseDir = ?config(case_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
asn1_test_lib:compile_all(Specs, Config, [Erules,{i,CaseDir}|Options]).
test() ->
diff --git a/lib/asn1/test/testSSLspecs.erl b/lib/asn1/test/testSSLspecs.erl
index 7dc7eedd50..9a0129d91a 100644
--- a/lib/asn1/test/testSSLspecs.erl
+++ b/lib/asn1/test/testSSLspecs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -26,8 +26,8 @@
-include_lib("common_test/include/ct.hrl").
compile(Config, Options) ->
- DataDir = ?config(data_dir, Config),
- CaseDir = ?config(case_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
NewOptions = [{i, DataDir}, {i, CaseDir}|Options],
asn1_test_lib:compile_all(["SSL-PKIX", "PKIXAttributeCertificate"],
@@ -44,16 +44,16 @@ compile(Config, Options) ->
Config, NewOptions).
compile_combined(Config, ber=Rule) ->
- DataDir = ?config(data_dir, Config),
- CaseDir = ?config(case_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ CaseDir = proplists:get_value(case_dir, Config),
Options = [{i, CaseDir}, {i, DataDir}, Rule,
der, compact_bit_string, asn1config],
ok = remove_db_files_combined(CaseDir),
asn1_test_lib:compile("OTP-PKIX.set.asn", Config, Options).
remove_db_files(Dir) ->
- ?line ok = remove_db_file(Dir ++ "PKIX1Explicit93.asn1db"),
- ?line ok = remove_db_file(Dir ++ "PKIX1Implicit93.asn1db").
+ ok = remove_db_file(Dir ++ "PKIX1Explicit93.asn1db"),
+ ok = remove_db_file(Dir ++ "PKIX1Implicit93.asn1db").
remove_db_file(File) ->
case file:delete(File) of
ok ->
@@ -65,23 +65,23 @@ remove_db_file(File) ->
end.
remove_db_files_combined(Dir) ->
- ?line ok = remove_db_file(Dir ++ "OTP-PKIX.asn1db"),
- ?line ok = remove_db_file(Dir ++ "SSL-PKIX.asn1db"),
- ?line ok = remove_db_file(Dir ++ "PKIXAttributeCertificate.asn1db"),
- ?line ok = remove_db_file(Dir ++ "PKIX1Algorithms88.asn1db"),
- ?line ok = remove_db_file(Dir ++ "PKIX1Explicit88.asn1db"),
- ?line ok = remove_db_file(Dir ++ "PKIX1Implicit88.asn1db").
+ ok = remove_db_file(Dir ++ "OTP-PKIX.asn1db"),
+ ok = remove_db_file(Dir ++ "SSL-PKIX.asn1db"),
+ ok = remove_db_file(Dir ++ "PKIXAttributeCertificate.asn1db"),
+ ok = remove_db_file(Dir ++ "PKIX1Algorithms88.asn1db"),
+ ok = remove_db_file(Dir ++ "PKIX1Explicit88.asn1db"),
+ ok = remove_db_file(Dir ++ "PKIX1Implicit88.asn1db").
run(ber) ->
run1(1).
run1(6) ->
- ?line f1(6),
- ?line f2(6),
- ?line transform4(ex(7));
+ f1(6),
+ f2(6),
+ transform4(ex(7));
run1(N) ->
- ?line f1(N),
- ?line f2(N),
+ f1(N),
+ f2(N),
run1(N+1).
@@ -93,22 +93,22 @@ f2(N) ->
transform1(ATAV) ->
- ?line {ok, ATAVEnc} = 'PKIX1Explicit88':encode('AttributeTypeAndValue',
+ {ok, ATAVEnc} = 'PKIX1Explicit88':encode('AttributeTypeAndValue',
ATAV),
- ?line {ok, _ATAVDec} = 'SSL-PKIX':decode('AttributeTypeAndValue',
+ {ok, _ATAVDec} = 'SSL-PKIX':decode('AttributeTypeAndValue',
ATAVEnc).
transform2(ATAV) ->
- ?line {ok, ATAVEnc} = 'PKIX1Explicit88':encode('AttributeTypeAndValue',
+ {ok, ATAVEnc} = 'PKIX1Explicit88':encode('AttributeTypeAndValue',
ATAV),
- ?line {ok, _ATAVDec} = 'PKIX1Explicit88':decode('AttributeTypeAndValue',
+ {ok, _ATAVDec} = 'PKIX1Explicit88':decode('AttributeTypeAndValue',
ATAVEnc).
transform4(ATAV) ->
- ?line {ok, ATAVEnc} = 'PKIX1Explicit88':encode('Attribute',
+ {ok, ATAVEnc} = 'PKIX1Explicit88':encode('Attribute',
ATAV),
- ?line {ok, _ATAVDec} = 'PKIX1Explicit88':decode('Attribute',
+ {ok, _ATAVDec} = 'PKIX1Explicit88':decode('Attribute',
ATAVEnc).
@@ -144,8 +144,8 @@ ex(7) ->
run_combined(ber) ->
Cert = cert(),
- ?line {ok,{'CertificatePKIX1Explicit88',{Type,UnDec},_,_}} = 'OTP-PKIX':decode_TBSCert_exclusive(Cert),
- ?line {ok,_} = 'OTP-PKIX':decode_part(Type,UnDec),
+ {ok,{'CertificatePKIX1Explicit88',{Type,UnDec},_,_}} = 'OTP-PKIX':decode_TBSCert_exclusive(Cert),
+ {ok,_} = 'OTP-PKIX':decode_part(Type,UnDec),
ok.
cert() ->
diff --git a/lib/asn1/test/testSelectionTypes.erl b/lib/asn1/test/testSelectionTypes.erl
index 7039f6da4e..b9f908b251 100644
--- a/lib/asn1/test/testSelectionTypes.erl
+++ b/lib/asn1/test/testSelectionTypes.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSeq2738.erl b/lib/asn1/test/testSeq2738.erl
index a75d058259..105a04a15b 100644
--- a/lib/asn1/test/testSeq2738.erl
+++ b/lib/asn1/test/testSeq2738.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSeqDefault.erl b/lib/asn1/test/testSeqDefault.erl
index ac3cf202b7..d9e9e60541 100644
--- a/lib/asn1/test/testSeqDefault.erl
+++ b/lib/asn1/test/testSeqDefault.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSeqExtension.erl b/lib/asn1/test/testSeqExtension.erl
index a84b6fb27c..f7885cb002 100644
--- a/lib/asn1/test/testSeqExtension.erl
+++ b/lib/asn1/test/testSeqExtension.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSeqExternal.erl b/lib/asn1/test/testSeqExternal.erl
index 9ad2c03208..8f2f2a8f94 100644
--- a/lib/asn1/test/testSeqExternal.erl
+++ b/lib/asn1/test/testSeqExternal.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSeqOf.erl b/lib/asn1/test/testSeqOf.erl
index f4a4181f51..d4cfafc278 100644
--- a/lib/asn1/test/testSeqOf.erl
+++ b/lib/asn1/test/testSeqOf.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSeqOfCho.erl b/lib/asn1/test/testSeqOfCho.erl
index 7bd1ce7aa6..268500d0e1 100644
--- a/lib/asn1/test/testSeqOfCho.erl
+++ b/lib/asn1/test/testSeqOfCho.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSeqOfExternal.erl b/lib/asn1/test/testSeqOfExternal.erl
index de95e081d5..18f2767613 100644
--- a/lib/asn1/test/testSeqOfExternal.erl
+++ b/lib/asn1/test/testSeqOfExternal.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSeqOfIndefinite.erl b/lib/asn1/test/testSeqOfIndefinite.erl
index bebd516c5c..2f66baf9a8 100644
--- a/lib/asn1/test/testSeqOfIndefinite.erl
+++ b/lib/asn1/test/testSeqOfIndefinite.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -25,13 +25,13 @@
-include_lib("common_test/include/ct.hrl").
main() ->
- ?line ok = test(isd),
- ?line ok = test(isd2),
- ?line ok = test(dsd),
- ?line ok = test(ul_res),
- ?line ok = test(prim),
- ?line ok = test(seqofseq),
- ?line ok = test('InsertSubscriberDataArg'). % OTP-4232
+ ok = test(isd),
+ ok = test(isd2),
+ ok = test(dsd),
+ ok = test(ul_res),
+ ok = test(prim),
+ ok = test(seqofseq),
+ ok = test('InsertSubscriberDataArg'). % OTP-4232
test(isd)->
EncPdu = <<48,128,129,7,145,148,113,50,1,0,241,131,1,0,176,128,5,0,
diff --git a/lib/asn1/test/testSeqOfTag.erl b/lib/asn1/test/testSeqOfTag.erl
index cacbc85093..b6e62e15ef 100644
--- a/lib/asn1/test/testSeqOfTag.erl
+++ b/lib/asn1/test/testSeqOfTag.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSeqOptional.erl b/lib/asn1/test/testSeqOptional.erl
index 92b49e9c0d..13d6615ca4 100644
--- a/lib/asn1/test/testSeqOptional.erl
+++ b/lib/asn1/test/testSeqOptional.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSeqPrim.erl b/lib/asn1/test/testSeqPrim.erl
index 5872902ce7..7e782351d9 100644
--- a/lib/asn1/test/testSeqPrim.erl
+++ b/lib/asn1/test/testSeqPrim.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSeqSetDefaultVal.erl b/lib/asn1/test/testSeqSetDefaultVal.erl
index 1c41f64078..fd4ef9c088 100644
--- a/lib/asn1/test/testSeqSetDefaultVal.erl
+++ b/lib/asn1/test/testSeqSetDefaultVal.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSeqSetIndefinite.erl b/lib/asn1/test/testSeqSetIndefinite.erl
index 41e09f7796..155da2c1ca 100644
--- a/lib/asn1/test/testSeqSetIndefinite.erl
+++ b/lib/asn1/test/testSeqSetIndefinite.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSeqTag.erl b/lib/asn1/test/testSeqTag.erl
index 6959e2f7e2..cc561ffe72 100644
--- a/lib/asn1/test/testSeqTag.erl
+++ b/lib/asn1/test/testSeqTag.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSeqTypeRefCho.erl b/lib/asn1/test/testSeqTypeRefCho.erl
index 4a9ba53291..88993ef49a 100644
--- a/lib/asn1/test/testSeqTypeRefCho.erl
+++ b/lib/asn1/test/testSeqTypeRefCho.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSeqTypeRefPrim.erl b/lib/asn1/test/testSeqTypeRefPrim.erl
index e0c3277156..950c9b1de2 100644
--- a/lib/asn1/test/testSeqTypeRefPrim.erl
+++ b/lib/asn1/test/testSeqTypeRefPrim.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSeqTypeRefSeq.erl b/lib/asn1/test/testSeqTypeRefSeq.erl
index befbe5f457..0d88e55d15 100644
--- a/lib/asn1/test/testSeqTypeRefSeq.erl
+++ b/lib/asn1/test/testSeqTypeRefSeq.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSeqTypeRefSet.erl b/lib/asn1/test/testSeqTypeRefSet.erl
index 48c94a8b06..7d0fd20647 100644
--- a/lib/asn1/test/testSeqTypeRefSet.erl
+++ b/lib/asn1/test/testSeqTypeRefSet.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSetDefault.erl b/lib/asn1/test/testSetDefault.erl
index e91a526add..6d84ee3204 100644
--- a/lib/asn1/test/testSetDefault.erl
+++ b/lib/asn1/test/testSetDefault.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSetExtension.erl b/lib/asn1/test/testSetExtension.erl
index 89f27a7fef..58259e9f34 100644
--- a/lib/asn1/test/testSetExtension.erl
+++ b/lib/asn1/test/testSetExtension.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSetExternal.erl b/lib/asn1/test/testSetExternal.erl
index f5d01e23a8..a9b1e3952e 100644
--- a/lib/asn1/test/testSetExternal.erl
+++ b/lib/asn1/test/testSetExternal.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSetOf.erl b/lib/asn1/test/testSetOf.erl
index 02009dc8d5..62caa8b3f9 100644
--- a/lib/asn1/test/testSetOf.erl
+++ b/lib/asn1/test/testSetOf.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSetOfCho.erl b/lib/asn1/test/testSetOfCho.erl
index be199b4688..a6ff2a79be 100644
--- a/lib/asn1/test/testSetOfCho.erl
+++ b/lib/asn1/test/testSetOfCho.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSetOfExternal.erl b/lib/asn1/test/testSetOfExternal.erl
index 7abed66167..faa7cfd239 100644
--- a/lib/asn1/test/testSetOfExternal.erl
+++ b/lib/asn1/test/testSetOfExternal.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSetOfTag.erl b/lib/asn1/test/testSetOfTag.erl
index ce77e2848f..ccaded42ab 100644
--- a/lib/asn1/test/testSetOfTag.erl
+++ b/lib/asn1/test/testSetOfTag.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSetOptional.erl b/lib/asn1/test/testSetOptional.erl
index a0010d203a..8d38f4c9d5 100644
--- a/lib/asn1/test/testSetOptional.erl
+++ b/lib/asn1/test/testSetOptional.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSetPrim.erl b/lib/asn1/test/testSetPrim.erl
index 47913178f3..f91dfeb9bf 100644
--- a/lib/asn1/test/testSetPrim.erl
+++ b/lib/asn1/test/testSetPrim.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSetTag.erl b/lib/asn1/test/testSetTag.erl
index 2e95fb6793..528769c85b 100644
--- a/lib/asn1/test/testSetTag.erl
+++ b/lib/asn1/test/testSetTag.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSetTypeRefCho.erl b/lib/asn1/test/testSetTypeRefCho.erl
index ac5bf5ab02..3015faaa0f 100644
--- a/lib/asn1/test/testSetTypeRefCho.erl
+++ b/lib/asn1/test/testSetTypeRefCho.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSetTypeRefPrim.erl b/lib/asn1/test/testSetTypeRefPrim.erl
index 51190e2ba4..1f31736f1c 100644
--- a/lib/asn1/test/testSetTypeRefPrim.erl
+++ b/lib/asn1/test/testSetTypeRefPrim.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSetTypeRefSeq.erl b/lib/asn1/test/testSetTypeRefSeq.erl
index 44a7910526..d829a5031c 100644
--- a/lib/asn1/test/testSetTypeRefSeq.erl
+++ b/lib/asn1/test/testSetTypeRefSeq.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testSetTypeRefSet.erl b/lib/asn1/test/testSetTypeRefSet.erl
index 7a67e6434c..df9732e52a 100644
--- a/lib/asn1/test/testSetTypeRefSet.erl
+++ b/lib/asn1/test/testSetTypeRefSet.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testTCAP.erl b/lib/asn1/test/testTCAP.erl
index 6e777875f6..422ae1f0fc 100644
--- a/lib/asn1/test/testTCAP.erl
+++ b/lib/asn1/test/testTCAP.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -39,7 +39,6 @@ compile_asn1config(Config, Options) ->
asn1_test_lib:compile_erlang("TCAPPackage_msg", Config, []).
test(Erule,_Config) ->
-% ?line OutDir = ?config(priv_dir,Config),
%% testing OTP-4798, open type encoded with indefinite length
{ok,_Res} = 'TCAPMessages-simple':decode('MessageType',
val_OTP_4798(Erule)),
@@ -49,20 +48,17 @@ test(Erule,_Config) ->
val_OTP_4799(Erule)),
%% testing vance shipley's problems. Parameterized object sets.
- ?line Val3 = 'TCAPPackage_msg':val('PackageType',unidirectional),
+ Val3 = 'TCAPPackage_msg':val('PackageType',unidirectional),
Res3 = enc_dec('PackageType', Val3),
- ?line ok = 'TCAPPackage_msg':check_result('PackageType',unidirectional,Res3),
-%% ?line io:format("Res3:~n~p~n~n",[Res3]),
+ ok = 'TCAPPackage_msg':check_result('PackageType',unidirectional,Res3),
- ?line Val4 = 'TCAPPackage_msg':val('PackageType',abort),
+ Val4 = 'TCAPPackage_msg':val('PackageType',abort),
Res4 = enc_dec('PackageType', Val4),
- ?line ok = 'TCAPPackage_msg':check_result('PackageType',abort,Res4),
-%% ?line io:format("Res4:~n~p~n~n",[Res4]),
+ ok = 'TCAPPackage_msg':check_result('PackageType',abort,Res4),
- ?line Val5 = 'TCAPPackage_msg':val('PackageType',response),
+ Val5 = 'TCAPPackage_msg':val('PackageType',response),
Res5 = enc_dec('PackageType', Val5),
- ?line ok = 'TCAPPackage_msg':check_result('PackageType',response,Res5).
-%% ?line io:format("Res5:~n~p~n~n",[Res5]).
+ ok = 'TCAPPackage_msg':check_result('PackageType',response,Res5).
val_OTP_4798(ber) ->
[100,129,176,73,4,57,3,17,80,107,42,40,40,6,7,0,17,134,5,1,1,1,160,29,97,27,128,2,7,128,161,9,6,7,4,0,0,1,0,14,2,162,3,2,1,0,163,5,161,3,2,1,0,108,128,162,120,2,1,0,48,115,2,1,56,48,128,48,34,4,16,203,87,215,196,217,93,235,90,64,131,106,145,39,26,25,236,4,4,197,241,81,112,4,8,78,225,34,196,215,212,200,0,48,34,4,16,145,125,27,67,42,144,6,161,207,112,55,75,200,191,191,28,4,4,226,219,242,123,4,8,72,46,130,28,206,178,168,0,48,34,4,16,1,8,20,29,70,160,218,160,125,188,244,174,113,115,253,245,4,4,26,5,90,160,4,8,252,75,149,98,153,224,140,0,0,0,0,0];
diff --git a/lib/asn1/test/testTcapsystem.erl b/lib/asn1/test/testTcapsystem.erl
index a050ceac61..ceff4f6b50 100644
--- a/lib/asn1/test/testTcapsystem.erl
+++ b/lib/asn1/test/testTcapsystem.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testTimer.erl b/lib/asn1/test/testTimer.erl
index 6fecee3d78..bd8da85735 100644
--- a/lib/asn1/test/testTimer.erl
+++ b/lib/asn1/test/testTimer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testTypeValueNotation.erl b/lib/asn1/test/testTypeValueNotation.erl
index e75cec04c9..17f1c74dcb 100644
--- a/lib/asn1/test/testTypeValueNotation.erl
+++ b/lib/asn1/test/testTypeValueNotation.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testUniqueObjectSets.erl b/lib/asn1/test/testUniqueObjectSets.erl
index fd82087916..4d3ec94391 100644
--- a/lib/asn1/test/testUniqueObjectSets.erl
+++ b/lib/asn1/test/testUniqueObjectSets.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/testValueTest.erl b/lib/asn1/test/testValueTest.erl
index 1764323e93..6699c0094a 100644
--- a/lib/asn1/test/testValueTest.erl
+++ b/lib/asn1/test/testValueTest.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/test_compile_options.erl b/lib/asn1/test/test_compile_options.erl
index 1af614f49a..ac74470537 100644
--- a/lib/asn1/test/test_compile_options.erl
+++ b/lib/asn1/test/test_compile_options.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -39,50 +39,49 @@ wrong_path(Config) ->
end.
comp(Parent,Config) ->
- DataDir = ?config(data_dir,Config),
- OutDir = ?config(priv_dir,Config),
- ?line Err=asn1ct:compile(DataDir++"NoImport",[{i,OutDir},{i,filename:join([DataDir,"subdir"])},{outdir,OutDir}]),
+ DataDir = proplists:get_value(data_dir,Config),
+ OutDir = proplists:get_value(priv_dir,Config),
+ Err=asn1ct:compile(DataDir++"NoImport",[{i,OutDir},{i,filename:join([DataDir,"subdir"])},{outdir,OutDir}]),
Parent!Err.
%% OTP-5701
path(Config) ->
- DataDir = ?config(data_dir,Config),
- OutDir = ?config(priv_dir,Config),
+ DataDir = proplists:get_value(data_dir,Config),
+ OutDir = proplists:get_value(priv_dir,Config),
{ok,CWD} = file:get_cwd(),
- ?line file:set_cwd(filename:join([DataDir,subdir])),
+ file:set_cwd(filename:join([DataDir,subdir])),
ok = asn1ct:compile("../MyMerge.set.asn",[{outdir,OutDir}]),
- ?line ok=outfiles_check(OutDir),
- ?line outfiles_remove(OutDir),
+ ok=outfiles_check(OutDir),
+ outfiles_remove(OutDir),
file:set_cwd(filename:join([DataDir,subdir,subsubdir])),
ok = asn1ct:compile('../../MyMerge.set.asn',[{i,'..'},{outdir,OutDir}]),
- ?line ok=outfiles_check(OutDir,outfiles2()),
+ ok=outfiles_check(OutDir,outfiles2()),
file:set_cwd(CWD),
ok.
ticket_6143(Config) -> asn1_test_lib:compile("AA1", Config, []).
noobj(Config) ->
- DataDir = ?config(data_dir,Config),
- OutDir = ?config(priv_dir,Config),
+ DataDir = proplists:get_value(data_dir,Config),
+ OutDir = proplists:get_value(priv_dir,Config),
code:purge('P-Record'),
file:delete(filename:join([OutDir,'P-Record.erl'])),
file:delete(filename:join([OutDir,'P-Record.beam'])),
- ?line ok=asn1ct:compile(filename:join([DataDir,"P-Record"]),
+ ok=asn1ct:compile(filename:join([DataDir,"P-Record"]),
[noobj,{outdir,OutDir}]),
-% ?line false = code:is_loaded('P-Record'),
- ?line {ok,_} = file:read_file_info(filename:join([OutDir,
+ {ok,_} = file:read_file_info(filename:join([OutDir,
"P-Record.erl"])),
- ?line {error,enoent} =
+ {error,enoent} =
file:read_file_info(filename:join([OutDir,"P-Record.beam"])),
- ?line {ok,_} = c:c(filename:join([OutDir,'P-Record']),
+ {ok,_} = c:c(filename:join([OutDir,'P-Record']),
[{i,OutDir},{outdir,OutDir}]),
- ?line {file,_} = code:is_loaded('P-Record'),
+ {file,_} = code:is_loaded('P-Record'),
code:purge('P-Record'),
code:delete('P-Record'),
@@ -94,43 +93,41 @@ noobj(Config) ->
file:delete(filename:join([OutDir,'p_record.beam'])),
ok = asn1ct:compile(filename:join([DataDir,"p_record.set.asn"]),
[asn1config,ber,noobj,{outdir,OutDir}]),
-%% ?line false = code:is_loaded('P-Record'),
-%% ?line false = code:is_loaded('p_record'),
- ?line {error,enoent} =
+ {error,enoent} =
file:read_file_info(filename:join([OutDir,"P-Record.beam"])),
- ?line {error,enoent} =
+ {error,enoent} =
file:read_file_info(filename:join([OutDir,"P-Record.erl"])),
- ?line {error,enoent} =
+ {error,enoent} =
file:read_file_info(filename:join([OutDir,"p_record.beam"])),
io:format("read_file_info: p_record.erl~n",[]),
- ?line {ok,_} =
+ {ok,_} =
file:read_file_info(filename:join([OutDir,"p_record.erl"])),
io:format("c:c: p_record.erl~n",[]),
- ?line {ok,_} = c:c(filename:join([OutDir,'p_record']),
+ {ok,_} = c:c(filename:join([OutDir,'p_record']),
[{i,OutDir},{outdir,OutDir}]),
io:format("code:is_loaded: p_record.erl~n",[]),
- ?line {file,_} = code:is_loaded('p_record'),
+ {file,_} = code:is_loaded('p_record'),
io:format("file:delete: p_record.erl~n",[]),
file:delete(filename:join([OutDir,'p_record.erl'])),
file:delete(filename:join([OutDir,'p_record.beam'])).
verbose(Config) when is_list(Config) ->
- DataDir = ?config(data_dir,Config),
- OutDir = ?config(priv_dir,Config),
+ DataDir = proplists:get_value(data_dir,Config),
+ OutDir = proplists:get_value(priv_dir,Config),
Asn1File = filename:join([DataDir,"Comment.asn"]),
%% Test verbose compile
- ?line test_server:capture_start(),
- ?line ok = asn1ct:compile(Asn1File, [{i,DataDir},{outdir,OutDir},noobj,verbose]),
- ?line test_server:capture_stop(),
- ?line [Line0|_] = test_server:capture_get(),
- ?line true = lists:prefix("Erlang ASN.1 compiler", Line0),
+ test_server:capture_start(),
+ ok = asn1ct:compile(Asn1File, [{i,DataDir},{outdir,OutDir},noobj,verbose]),
+ test_server:capture_stop(),
+ [Line0|_] = test_server:capture_get(),
+ true = lists:prefix("Erlang ASN.1 compiler", Line0),
%% Test non-verbose compile
- ?line test_server:capture_start(),
- ?line ok = asn1ct:compile(Asn1File, [{i,DataDir},{outdir,OutDir},noobj]),
- ?line test_server:capture_stop(),
- ?line [] = test_server:capture_get(),
+ test_server:capture_start(),
+ ok = asn1ct:compile(Asn1File, [{i,DataDir},{outdir,OutDir},noobj]),
+ test_server:capture_stop(),
+ [] = test_server:capture_get(),
ok.
outfiles_check(OutDir) ->
@@ -141,7 +138,7 @@ outfiles_check(_OutDir,[])->
ok;
outfiles_check(OutDir,[H|T]) ->
io:format("File: ~p~n",[filename:join([OutDir,H])]),
- ?line {ok,_}=file:read_file_info(filename:join([OutDir,H])),
+ {ok,_}=file:read_file_info(filename:join([OutDir,H])),
outfiles_check(OutDir,T).
outfiles1() ->
@@ -155,8 +152,8 @@ outfiles_remove(OutDir) ->
outfiles1()).
record_name_prefix(Config) ->
- DataDir = ?config(data_dir,Config),
- OutDir = ?config(priv_dir,Config),
+ DataDir = proplists:get_value(data_dir,Config),
+ OutDir = proplists:get_value(priv_dir,Config),
ok = b_SeqIn(DataDir,OutDir),
ok = a_SeqIn(DataDir,OutDir).
@@ -165,15 +162,15 @@ b_SeqIn(DataDir,OutDir) ->
[{record_name_prefix,"b_"},{outdir,OutDir}]),
io:format("FileName: ~p~nOutDir:~p~n",
[filename:join([DataDir,'b_SeqIn']),OutDir]),
- ?line {ok,_} = compile:file(filename:join([DataDir,'b_SeqIn']),
+ {ok,_} = compile:file(filename:join([DataDir,'b_SeqIn']),
[{i,OutDir}]),
- ?line 'b_SeqIn' = b_SeqIn:record_name(),
+ 'b_SeqIn' = b_SeqIn:record_name(),
ok.
a_SeqIn(DataDir,OutDir) ->
asn1ct:compile(filename:join([DataDir,'Seq']),
[{record_name_prefix,"a_"},{outdir,OutDir}]),
- ?line {ok,_} = compile:file(filename:join([DataDir,'a_SeqIn']),
+ {ok,_} = compile:file(filename:join([DataDir,'a_SeqIn']),
[{i,OutDir}]),
- ?line 'a_SeqIn' = a_SeqIn:record_name(),
+ 'a_SeqIn' = a_SeqIn:record_name(),
ok.
diff --git a/lib/asn1/test/test_modified_x420.erl b/lib/asn1/test/test_modified_x420.erl
index c0a32e2a37..6cd9e0e33b 100644
--- a/lib/asn1/test/test_modified_x420.erl
+++ b/lib/asn1/test/test_modified_x420.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@
-include_lib("common_test/include/ct.hrl").
test(Config) ->
- DataDir = ?config(data_dir,Config),
+ DataDir = proplists:get_value(data_dir,Config),
Der = read_pem(filename:join([DataDir,modified_x420,"p7_signed_data.pem"])),
{ok,{_,_,SignedData}} = 'PKCS7':decode( 'ContentInfo', Der),
diff --git a/lib/asn1/test/test_partial_incomplete_decode.erl b/lib/asn1/test/test_partial_incomplete_decode.erl
index 64f2ce22ae..7c5cfab10a 100644
--- a/lib/asn1/test/test_partial_incomplete_decode.erl
+++ b/lib/asn1/test/test_partial_incomplete_decode.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -67,7 +67,7 @@ test(Config) ->
ok.
test_megaco(Config) ->
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
Files = filelib:wildcard(filename:join([DataDir,megacomessages,"*.val"])),
Mod = 'MEDIA-GATEWAY-CONTROL',
lists:foreach(fun(File) ->
@@ -81,72 +81,72 @@ test_megaco(Config) ->
exclusive_decode(Bin,F) ->
Mod='MEDIA-GATEWAY-CONTROL',
io:format("Encoding message: ~p~n",[F]),
- ?line {ok,{_,_,{_,_VsnNo,{MsgMidKey,MsgMid},{MsgMBodyKey,MsgMBody}}}}=
+ {ok,{_,_,{_,_VsnNo,{MsgMidKey,MsgMid},{MsgMBodyKey,MsgMBody}}}}=
Mod:decode_MegacoMessage_exclusive(Bin),
- ?line {ok,_} = Mod:decode_part(MsgMidKey,MsgMid),
- ?line {ok,_} = Mod:decode_part(MsgMBodyKey,MsgMBody),
+ {ok,_} = Mod:decode_part(MsgMidKey,MsgMid),
+ {ok,_} = Mod:decode_part(MsgMBodyKey,MsgMBody),
ok.
decode_parts('F',PartDecMsg) ->
- ?line {fb,{'E',35,{NameE_b,ListBinE_b},false,{NameE_d,BinE_d}}} = PartDecMsg,
- ?line {ok,[{'D',3,true}|_]} = 'PartialDecSeq':decode_part(NameE_b,ListBinE_b),
- ?line {ok,{'D',3,true}} = 'PartialDecSeq':decode_part(NameE_b,
+ {fb,{'E',35,{NameE_b,ListBinE_b},false,{NameE_d,BinE_d}}} = PartDecMsg,
+ {ok,[{'D',3,true}|_]} = 'PartialDecSeq':decode_part(NameE_b,ListBinE_b),
+ {ok,{'D',3,true}} = 'PartialDecSeq':decode_part(NameE_b,
hd(ListBinE_b)),
- ?line {ok,{da,[{'A',16,{'D',17,true}}]}} =
+ {ok,{da,[{'A',16,{'D',17,true}}]}} =
'PartialDecSeq':decode_part(NameE_d,BinE_d),
ok;
decode_parts('F2',PartDecMsg) ->
- ?line {fb,{'E',35,{E_bkey,E_b},false,{da,{E_d_akey,E_d_a}}}} = PartDecMsg,
- ?line {ok,[{'D',3,true},{'D',4,false},{'D',5,true},{'D',6,true},{'D',7,false},{'D',8,true},{'D',9,true},{'D',10,false},{'D',11,true},{'D',12,true},{'D',13,false},{'D',14,true}]} = 'PartialDecSeq':decode_part(E_bkey,E_b),
- ?line {ok,[{'A',16,{'D',17,true}}]} = 'PartialDecSeq':decode_part(E_d_akey,E_d_a);
+ {fb,{'E',35,{E_bkey,E_b},false,{da,{E_d_akey,E_d_a}}}} = PartDecMsg,
+ {ok,[{'D',3,true},{'D',4,false},{'D',5,true},{'D',6,true},{'D',7,false},{'D',8,true},{'D',9,true},{'D',10,false},{'D',11,true},{'D',12,true},{'D',13,false},{'D',14,true}]} = 'PartialDecSeq':decode_part(E_bkey,E_b),
+ {ok,[{'A',16,{'D',17,true}}]} = 'PartialDecSeq':decode_part(E_d_akey,E_d_a);
decode_parts('F3',PartDecMsg) ->
- ?line {fb,{'E',10,{E_bkey,E_b},false,{dc,{'E_d_dc',13,true,{E_d_dc_dcckey,E_d_dc_dcc}}}}} = PartDecMsg,
- ?line {ok,[{'D',11,true},{'D',12,false}]} = 'PartialDecSeq':decode_part(E_bkey,E_b),
- ?line {ok,{'E_d_dc_dcc',14,15}} = 'PartialDecSeq':decode_part(E_d_dc_dcckey,E_d_dc_dcc);
+ {fb,{'E',10,{E_bkey,E_b},false,{dc,{'E_d_dc',13,true,{E_d_dc_dcckey,E_d_dc_dcc}}}}} = PartDecMsg,
+ {ok,[{'D',11,true},{'D',12,false}]} = 'PartialDecSeq':decode_part(E_bkey,E_b),
+ {ok,{'E_d_dc_dcc',14,15}} = 'PartialDecSeq':decode_part(E_d_dc_dcckey,E_d_dc_dcc);
decode_parts('D',PartDecMsg) ->
- ?line {'D',{NameD_a,BinD_a},true} = PartDecMsg,
- ?line {ok,123} = 'PartialDecSeq':decode_part(NameD_a,BinD_a),
+ {'D',{NameD_a,BinD_a},true} = PartDecMsg,
+ {ok,123} = 'PartialDecSeq':decode_part(NameD_a,BinD_a),
ok;
decode_parts('A',PartDecMsg) ->
- ?line {'A',12,{c,{'S',true,false}},{b,{NameA_c_b,BinA_c_b}}} = PartDecMsg,
- ?line {ok,{'A_c_b',false,false}} =
+ {'A',12,{c,{'S',true,false}},{b,{NameA_c_b,BinA_c_b}}} = PartDecMsg,
+ {ok,{'A_c_b',false,false}} =
'PartialDecSeq2':decode_part(NameA_c_b,BinA_c_b),
ok;
decode_parts('GetRequest',PartDecMsg) ->
- ?line {'GetRequest',true,false,
+ {'GetRequest',true,false,
{'AcceptTypes',[html,'plain-text',gif,jpeg],
{NameAcceptTypes_others,ListBinAcceptTypes_others}},
"IamfineThankYOu"} = PartDecMsg,
- ?line {ok,["hell","othe","reho","peyo","uare","fine"]} =
+ {ok,["hell","othe","reho","peyo","uare","fine"]} =
'PartialDecMyHTTP':decode_part(NameAcceptTypes_others,
ListBinAcceptTypes_others),
- ?line {ok,"hell"} =
+ {ok,"hell"} =
'PartialDecMyHTTP':decode_part(NameAcceptTypes_others,
hd(ListBinAcceptTypes_others)),
ok;
decode_parts('S1_1',PartDecMsg) ->
- ?line {'S1',14,{'S2',false,12,{NameS2c,BinS2c}},
+ {'S1',14,{'S2',false,12,{NameS2c,BinS2c}},
{_,{NameS1c_a,ListBinS1c_a}},{NameS1d,BinS1d}} = PartDecMsg,
- ?line {ok,[{'S3',10,"PrintableString","OCTETSTRING",
+ {ok,[{'S3',10,"PrintableString","OCTETSTRING",
[one,two,three,four]}|_Rest1]} =
'PartialDecSeq3':decode_part(NameS2c,BinS2c),
- ?line {ok,[{'S3',10,"PrintableString","OCTETSTRING",
+ {ok,[{'S3',10,"PrintableString","OCTETSTRING",
[one,two,three,four]}|_Rest2]} =
'PartialDecSeq3':decode_part(NameS1c_a,ListBinS1c_a),
- ?line {ok,{'S3',10,"PrintableString","OCTETSTRING",
+ {ok,{'S3',10,"PrintableString","OCTETSTRING",
[one,two,three,four]}} =
'PartialDecSeq3':decode_part(NameS1c_a,hd(ListBinS1c_a)),
- ?line {ok,[{'Name',"Hans","HCA","Andersen"}|_Rest3]} =
+ {ok,[{'Name',"Hans","HCA","Andersen"}|_Rest3]} =
'PartialDecSeq3':decode_part(NameS1d,BinS1d),
ok;
decode_parts('S1_2',PartDecMsg) ->
- ?line {'S1',14,{'S2',false,12,_S2c},S1c_b,{NameS1d,BinS1d}} = PartDecMsg,
- ?line {b,{'C1_b',11,true,
+ {'S1',14,{'S2',false,12,_S2c},S1c_b,{NameS1d,BinS1d}} = PartDecMsg,
+ {b,{'C1_b',11,true,
{'S4',{'Name',"Hans","HCA","Andersen"},"MSc"}}}=S1c_b,
- ?line {ok,[{'Name',"Hans","HCA","Andersen"}|_Rest3]} =
+ {ok,[{'Name',"Hans","HCA","Andersen"}|_Rest3]} =
'PartialDecSeq3':decode_part(NameS1d,BinS1d),
ok.
diff --git a/lib/asn1/test/test_selective_decode.erl b/lib/asn1/test/test_selective_decode.erl
index d7870057a8..c264e919a6 100644
--- a/lib/asn1/test/test_selective_decode.erl
+++ b/lib/asn1/test/test_selective_decode.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/asn1/test/test_special_decode_performance.erl b/lib/asn1/test/test_special_decode_performance.erl
index 6cf7ee2805..35c396575b 100644
--- a/lib/asn1/test/test_special_decode_performance.erl
+++ b/lib/asn1/test/test_special_decode_performance.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -27,29 +27,29 @@
go(all) ->
{Time_S_s,Time_S_e,Time_S_c}=go(10000,'PartialDecSeq'),
{Time_MGC_s,Time_MGC_e,Time_MGC_c}=go(10000,'MEDIA-GATEWAY-CONTROL'),
- ?line do_comment({Time_S_s,Time_MGC_s},
+ do_comment({Time_S_s,Time_MGC_s},
{Time_S_e,Time_MGC_e},
{Time_S_c,Time_MGC_c}).
go(N,Mod) ->
{Type,Val} = val(Mod),
{ok,B} = Mod:encode(Type, Val),
- ?line go(Mod,B,N).
+ go(Mod,B,N).
go(Mod,Bin,N) ->
- ?line FsS = get_selective_funcs(Mod),
- ?line FsE = get_exclusive_funcs(Mod),
- ?line io:format("~nSize of value for module ~p: ~p bytes.~n~n",[Mod,size(Bin)]),
- ?line Time_s=go1(selective,Mod,FsS,Bin,N,0),
- ?line Time_e=go1(exclusive,Mod,FsE,Bin,N,0),
- ?line Time_c=go1(common,Mod,[decode],Bin,N,0),
- ?line {Time_s/length(FsS),Time_e/length(FsE),Time_c}.
+ FsS = get_selective_funcs(Mod),
+ FsE = get_exclusive_funcs(Mod),
+ io:format("~nSize of value for module ~p: ~p bytes.~n~n",[Mod,size(Bin)]),
+ Time_s=go1(selective,Mod,FsS,Bin,N,0),
+ Time_e=go1(exclusive,Mod,FsE,Bin,N,0),
+ Time_c=go1(common,Mod,[decode],Bin,N,0),
+ {Time_s/length(FsS),Time_e/length(FsE),Time_c}.
go1(_,_,[],_,_,AccTime) ->
- ?line AccTime;
+ AccTime;
%% go1 for common decode
go1(common,Mod,_,Bin,N,_) ->
- ?line TT=get_top_type(Mod),
+ TT=get_top_type(Mod),
{Time,Result} = timer:tc(fun() -> loop1(Mod, decode, TT, Bin, N) end),
case Result of
{ok,_R1} ->
diff --git a/lib/asn1/test/test_undecoded_rest.erl b/lib/asn1/test/test_undecoded_rest.erl
index 77147d59cc..f70953330b 100644
--- a/lib/asn1/test/test_undecoded_rest.erl
+++ b/lib/asn1/test/test_undecoded_rest.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@
test(Opts, Config) ->
{ok,Msg} = asn1ct:value('P-Record', 'PersonnelRecord',
- [{i,?config(case_dir, Config)}]),
+ [{i,proplists:get_value(case_dir, Config)}]),
Bytes0 = encode(Opts, 'PersonnelRecord', Msg),
Bytes1 = iolist_to_binary([Bytes0, <<55,55,55>>]),
case proplists:get_bool(undec_rest, Opts) of
diff --git a/lib/asn1/test/test_x691.erl b/lib/asn1/test/test_x691.erl
index 8ef62960ff..878304d94f 100644
--- a/lib/asn1/test/test_x691.erl
+++ b/lib/asn1/test/test_x691.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/Makefile b/lib/common_test/Makefile
index d47d60d1e4..f2065b8a0d 100644
--- a/lib/common_test/Makefile
+++ b/lib/common_test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2010. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/common_test/doc/src/Makefile b/lib/common_test/doc/src/Makefile
index a0c89b1222..e495f587a3 100644
--- a/lib/common_test/doc/src/Makefile
+++ b/lib/common_test/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2012. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/common_test/doc/src/basics_chapter.xml b/lib/common_test/doc/src/basics_chapter.xml
index 1a5a686fa0..b349d93813 100644
--- a/lib/common_test/doc/src/basics_chapter.xml
+++ b/lib/common_test/doc/src/basics_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/book.xml b/lib/common_test/doc/src/book.xml
index 7fe5331aba..def139a0be 100644
--- a/lib/common_test/doc/src/book.xml
+++ b/lib/common_test/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/common_test_app.xml b/lib/common_test/doc/src/common_test_app.xml
index 10c93e2ed1..3f83747485 100644
--- a/lib/common_test/doc/src/common_test_app.xml
+++ b/lib/common_test/doc/src/common_test_app.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/config_file_chapter.xml b/lib/common_test/doc/src/config_file_chapter.xml
index 62ebfccb98..db93744214 100644
--- a/lib/common_test/doc/src/config_file_chapter.xml
+++ b/lib/common_test/doc/src/config_file_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/cover_chapter.xml b/lib/common_test/doc/src/cover_chapter.xml
index 094aa7d80c..6c180c276c 100644
--- a/lib/common_test/doc/src/cover_chapter.xml
+++ b/lib/common_test/doc/src/cover_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2014</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/ct.xml b/lib/common_test/doc/src/ct.xml
index a87be21d73..5231ef24a4 100644
--- a/lib/common_test/doc/src/ct.xml
+++ b/lib/common_test/doc/src/ct.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2010</year><year>2012</year>
+ <year>2010</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -601,18 +601,21 @@
</func>
<func>
- <name>get_timetrap_info() -&gt; {Time, Scale}</name>
+ <name>get_timetrap_info() -&gt; {Time, {Scaling,ScaleVal}}</name>
<fsummary>Reads information about the timetrap set for the current
test case.</fsummary>
<type>
<v>Time = integer() | infinity</v>
- <v>Scale = true | false</v>
+ <v>Scaling = true | false</v>
+ <v>ScaleVal = integer()</v>
</type>
<desc><marker id="get_timetrap_info-0"/>
<p>Reads information about the timetrap set for the current test
- case. <c>Scale</c> indicates if <c>Common Test</c> will attempt
+ case. <c>Scaling</c> indicates if <c>Common Test</c> will attempt
to compensate timetraps automatically for runtime delays
- introduced by, for example, tools like cover.</p>
+ introduced by, for example, tools like cover. <c>ScaleVal</c> is
+ the value of the current scaling multipler (always 1 if scaling is
+ disabled). Note the <c>Time</c> is not the scaled result.</p>
</desc>
</func>
@@ -1136,7 +1139,7 @@
Opts.</fsummary>
<type>
<v>Opts = [OptTuples]</v>
- <v>OptTuples = {dir, TestDirs} | {suite, Suites} | {group, Groups} | {testcase, Cases} | {spec, TestSpecs} | {join_specs, Bool} | {label, Label} | {config, CfgFiles} | {userconfig, UserConfig} | {allow_user_terms, Bool} | {logdir, LogDir} | {silent_connections, Conns} | {stylesheet, CSSFile} | {cover, CoverSpecFile} | {cover_stop, Bool} | {step, StepOpts} | {event_handler, EventHandlers} | {include, InclDirs} | {auto_compile, Bool} | {abort_if_missing_suites, Bool} | {create_priv_dir, CreatePrivDir} | {multiply_timetraps, M} | {scale_timetraps, Bool} | {repeat, N} | {duration, DurTime} | {until, StopTime} | {force_stop, ForceStop} | {decrypt, DecryptKeyOrFile} | {refresh_logs, LogDir} | {logopts, LogOpts} | {verbosity, VLevels} | {basic_html, Bool} | {ct_hooks, CTHs} | {enable_builtin_hooks, Bool} | {release_shell, Bool}</v>
+ <v>OptTuples = {dir, TestDirs} | {suite, Suites} | {group, Groups} | {testcase, Cases} | {spec, TestSpecs} | {join_specs, Bool} | {label, Label} | {config, CfgFiles} | {userconfig, UserConfig} | {allow_user_terms, Bool} | {logdir, LogDir} | {silent_connections, Conns} | {stylesheet, CSSFile} | {cover, CoverSpecFile} | {cover_stop, Bool} | {step, StepOpts} | {event_handler, EventHandlers} | {include, InclDirs} | {auto_compile, Bool} | {abort_if_missing_suites, Bool} | {create_priv_dir, CreatePrivDir} | {multiply_timetraps, M} | {scale_timetraps, Bool} | {repeat, N} | {duration, DurTime} | {until, StopTime} | {force_stop, ForceStop} | {decrypt, DecryptKeyOrFile} | {refresh_logs, LogDir} | {logopts, LogOpts} | {verbosity, VLevels} | {basic_html, Bool} | {esc_chars, Bool} | {ct_hooks, CTHs} | {enable_builtin_hooks, Bool} | {release_shell, Bool}</v>
<v>TestDirs = [string()] | string()</v>
<v>Suites = [string()] | [atom()] | string() | atom()</v>
<v>Cases = [atom()] | atom()</v>
diff --git a/lib/common_test/doc/src/ct_cover.xml b/lib/common_test/doc/src/ct_cover.xml
index be09c08a68..89d944acbe 100644
--- a/lib/common_test/doc/src/ct_cover.xml
+++ b/lib/common_test/doc/src/ct_cover.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2010</year><year>2012</year>
+ <year>2010</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/ct_ftp.xml b/lib/common_test/doc/src/ct_ftp.xml
index 0598dcbe3e..e8c6f72db7 100644
--- a/lib/common_test/doc/src/ct_ftp.xml
+++ b/lib/common_test/doc/src/ct_ftp.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2010</year><year>2012</year>
+ <year>2010</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/ct_hooks.xml b/lib/common_test/doc/src/ct_hooks.xml
index 12ec3bcec3..3b1e564b66 100644
--- a/lib/common_test/doc/src/ct_hooks.xml
+++ b/lib/common_test/doc/src/ct_hooks.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2010</year><year>2012</year>
+ <year>2010</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/ct_hooks_chapter.xml b/lib/common_test/doc/src/ct_hooks_chapter.xml
index 3eb1945a61..1998f15697 100644
--- a/lib/common_test/doc/src/ct_hooks_chapter.xml
+++ b/lib/common_test/doc/src/ct_hooks_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2011</year><year>2013</year>
+ <year>2011</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/ct_master.xml b/lib/common_test/doc/src/ct_master.xml
index 06f9b04f1b..6bde4644c6 100644
--- a/lib/common_test/doc/src/ct_master.xml
+++ b/lib/common_test/doc/src/ct_master.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2010</year><year>2012</year>
+ <year>2010</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/ct_master_chapter.xml b/lib/common_test/doc/src/ct_master_chapter.xml
index 99555164e0..7b5aae7ad8 100644
--- a/lib/common_test/doc/src/ct_master_chapter.xml
+++ b/lib/common_test/doc/src/ct_master_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/ct_netconfc.xml b/lib/common_test/doc/src/ct_netconfc.xml
index d8c82c7f2c..9d1ff25a3a 100644
--- a/lib/common_test/doc/src/ct_netconfc.xml
+++ b/lib/common_test/doc/src/ct_netconfc.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2010</year><year>2012</year>
+ <year>2010</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/ct_property_test.xml b/lib/common_test/doc/src/ct_property_test.xml
index 2e9bd1969c..028e5eb69f 100644
--- a/lib/common_test/doc/src/ct_property_test.xml
+++ b/lib/common_test/doc/src/ct_property_test.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2010</year><year>2012</year>
+ <year>2010</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/ct_rpc.xml b/lib/common_test/doc/src/ct_rpc.xml
index 0169727581..90e6b833f7 100644
--- a/lib/common_test/doc/src/ct_rpc.xml
+++ b/lib/common_test/doc/src/ct_rpc.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2010</year><year>2012</year>
+ <year>2010</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/ct_run.xml b/lib/common_test/doc/src/ct_run.xml
index d0ecc38564..9e6229f1dd 100644
--- a/lib/common_test/doc/src/ct_run.xml
+++ b/lib/common_test/doc/src/ct_run.xml
@@ -4,7 +4,7 @@
<comref>
<header>
<copyright>
- <year>2007</year><year>2013</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -124,6 +124,7 @@
[-duration HHMMSS [-force_stop [skip_rest]]] |
[-until [YYMoMoDD]HHMMSS [-force_stop [skip_rest]]]
[-basic_html]
+ [-no_esc_chars]
[-ct_hooks CTHModule1 CTHOpts1 and CTHModule2 CTHOpts2 and ..
CTHModuleN CTHOptsN]
[-exit_status ignore_config]
@@ -162,6 +163,7 @@
[-duration HHMMSS [-force_stop [skip_rest]]] |
[-until [YYMoMoDD]HHMMSS [-force_stop [skip_rest]]]
[-basic_html]
+ [-no_esc_chars]
[-ct_hooks CTHModule1 CTHOpts1 and CTHModule2 CTHOpts2 and ..
CTHModuleN CTHOptsN]
[-exit_status ignore_config]</pre>
@@ -186,7 +188,8 @@
[-muliply_timetraps Multiplier]
[-scale_timetraps]
[-create_priv_dir auto_per_run | auto_per_tc | manual_per_tc]
- [-basic_html]</pre>
+ [-basic_html]
+ [-no_esc_chars]</pre>
</section>
<section>
diff --git a/lib/common_test/doc/src/ct_slave.xml b/lib/common_test/doc/src/ct_slave.xml
index 44a7b7873f..9d9aa50051 100644
--- a/lib/common_test/doc/src/ct_slave.xml
+++ b/lib/common_test/doc/src/ct_slave.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2010</year><year>2012</year>
+ <year>2010</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/ct_snmp.xml b/lib/common_test/doc/src/ct_snmp.xml
index d001fb24ec..0a5e52b16c 100644
--- a/lib/common_test/doc/src/ct_snmp.xml
+++ b/lib/common_test/doc/src/ct_snmp.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2010</year><year>2012</year>
+ <year>2010</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/ct_ssh.xml b/lib/common_test/doc/src/ct_ssh.xml
index 92b1f60b8c..d00737aa5a 100644
--- a/lib/common_test/doc/src/ct_ssh.xml
+++ b/lib/common_test/doc/src/ct_ssh.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2010</year><year>2012</year>
+ <year>2010</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/ct_telnet.xml b/lib/common_test/doc/src/ct_telnet.xml
index b7ba352104..e2a45e894b 100644
--- a/lib/common_test/doc/src/ct_telnet.xml
+++ b/lib/common_test/doc/src/ct_telnet.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2010</year><year>2012</year>
+ <year>2010</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -64,6 +64,8 @@
remaining string terminated) = 0</p></item>
<item><p>Polling interval (sleep time between polls) = 1 second</p>
</item>
+ <item><p>The TCP_NODELAY option for the telnet socket
+ is disabled (set to <c>false</c>) per default</p></item>
</list>
<p>These parameters can be modified by the user with the following
@@ -76,7 +78,8 @@
{reconnection_interval,Millisec},
{keep_alive,Bool},
{poll_limit,N},
- {poll_interval,Millisec}]}.</pre>
+ {poll_interval,Millisec},
+ {tcp_nodelay,Bool}]}.</pre>
<p><c>Millisec = integer(), N = integer()</c></p>
diff --git a/lib/common_test/doc/src/dependencies_chapter.xml b/lib/common_test/doc/src/dependencies_chapter.xml
index 29c54e819a..8ede822ae5 100644
--- a/lib/common_test/doc/src/dependencies_chapter.xml
+++ b/lib/common_test/doc/src/dependencies_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/event_handler_chapter.xml b/lib/common_test/doc/src/event_handler_chapter.xml
index 31128a7114..2978226a19 100644
--- a/lib/common_test/doc/src/event_handler_chapter.xml
+++ b/lib/common_test/doc/src/event_handler_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/example_chapter.xml b/lib/common_test/doc/src/example_chapter.xml
index 8523c9f485..b82d14d2d8 100644
--- a/lib/common_test/doc/src/example_chapter.xml
+++ b/lib/common_test/doc/src/example_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/getting_started_chapter.xml b/lib/common_test/doc/src/getting_started_chapter.xml
index 802f9ba397..9b021058e8 100644
--- a/lib/common_test/doc/src/getting_started_chapter.xml
+++ b/lib/common_test/doc/src/getting_started_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2007</year><year>2013</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/install_chapter.xml b/lib/common_test/doc/src/install_chapter.xml
index 9dce1e31a4..b29906d381 100644
--- a/lib/common_test/doc/src/install_chapter.xml
+++ b/lib/common_test/doc/src/install_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2007</year><year>2013</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/introduction.xml b/lib/common_test/doc/src/introduction.xml
index e2a42bfd33..40724f24e9 100644
--- a/lib/common_test/doc/src/introduction.xml
+++ b/lib/common_test/doc/src/introduction.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/notes.xml b/lib/common_test/doc/src/notes.xml
index ff51b101cc..ebba864606 100644
--- a/lib/common_test/doc/src/notes.xml
+++ b/lib/common_test/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -33,6 +33,68 @@
<file>notes.xml</file>
</header>
+<section><title>Common_Test 1.12.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ The <c>nodelay</c> option used to be enabled
+ (<c>true</c>) by default for sockets opened by the Common
+ Test telnet client. This appeared to cause communication
+ problems with telnet servers on some systems, and
+ therefore the option is no longer used. Its value may
+ instead be specified in the telnet connection settings.
+ See the man page for <c>ct_telnet</c> for details. Please
+ note that the interface function <c>connect</c> in
+ <c>unix_telnet</c> has been updated with an extra
+ argument and is now <c>unix_telnet:connect/7</c>.</p>
+ <p>
+ Own Id: OTP-13462 Aux Id: seq13077 </p>
+ </item>
+ <item>
+ <p>
+ Fix bug in cth_surefire: When a pre_init_per_suite hook
+ fails before reaching the
+ cth_surefire:pre_init_per_suite, cth_surefire produced
+ incorrect XML.</p>
+ <p>
+ Own Id: OTP-13513</p>
+ </item>
+ <item>
+ <p>
+ The <c>ct:get_timetrap_info/0</c> function has been
+ updated to return more information about timetrap
+ scaling.</p>
+ <p>
+ Own Id: OTP-13535</p>
+ </item>
+ <item>
+ <p>
+ A problem with stylesheet HTML tags getting incorrectly
+ escaped by Common Test has been corrected.</p>
+ <p>
+ Own Id: OTP-13536</p>
+ </item>
+ <item>
+ <p>
+ The <c>ct_run</c> start flag <c>-no_esc_chars</c> and
+ <c>ct:run_test/1</c> start option <c>{esc_chars,Bool}</c>
+ have been introduced to make it possible to disable
+ automatic escaping of characters. Automatic escaping of
+ special HTML characters printed with <c>io:format/1,2</c>
+ and <c>ct:pal/1,2,3,4</c> was introduced in Common Test
+ 1.12. The new flag/option may be used to disable this
+ feature for backwards compatibility reasons. (The option
+ is also supported in test specifications).</p>
+ <p>
+ Own Id: OTP-13537</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Common_Test 1.12</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/common_test/doc/src/notes_history.xml b/lib/common_test/doc/src/notes_history.xml
index ecc0cab651..3a30632579 100644
--- a/lib/common_test/doc/src/notes_history.xml
+++ b/lib/common_test/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/part.xml b/lib/common_test/doc/src/part.xml
index 41e74e57c6..000eb06b82 100644
--- a/lib/common_test/doc/src/part.xml
+++ b/lib/common_test/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/part_notes.xml b/lib/common_test/doc/src/part_notes.xml
index 3d55d8152d..360c535e96 100644
--- a/lib/common_test/doc/src/part_notes.xml
+++ b/lib/common_test/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/part_notes_history.xml b/lib/common_test/doc/src/part_notes_history.xml
index 1e503ce536..d13bb858db 100644
--- a/lib/common_test/doc/src/part_notes_history.xml
+++ b/lib/common_test/doc/src/part_notes_history.xml
@@ -4,7 +4,7 @@
<part>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/ref_man.xml b/lib/common_test/doc/src/ref_man.xml
index 19960bfea7..d1567e2d3c 100644
--- a/lib/common_test/doc/src/ref_man.xml
+++ b/lib/common_test/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/run_test_chapter.xml b/lib/common_test/doc/src/run_test_chapter.xml
index e04bb3e208..43e36adfb6 100644
--- a/lib/common_test/doc/src/run_test_chapter.xml
+++ b/lib/common_test/doc/src/run_test_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -266,6 +266,10 @@
<tag><c><![CDATA[-verbosity <levels>]]></c></tag>
<item><p>Sets <seealso marker="write_test_chapter#logging">verbosity levels
for printouts</seealso>.</p></item>
+
+ <tag><c><![CDATA[-no_esc_chars]]></c></tag>
+ <item><p>Disables automatic escaping of special HTML characters.
+ See the <seealso marker="write_test_chapter#logging">Logging chapter</seealso>.</p></item>
</taglist>
<note><p>Directories passed to <c>Common Test</c> can have either relative or absolute paths.</p></note>
@@ -802,7 +806,7 @@
program</seealso> for an overview of available start flags
(as most flags have a corresponding configuration term)</item>
<item><seealso marker="write_test_chapter#logging">Logging</seealso>
- (for terms <c>verbosity</c>, <c>stylesheet</c> and <c>basic_html</c>)</item>
+ (for terms <c>verbosity</c>, <c>stylesheet</c>, <c>basic_html</c> and <c>esc_chars</c>)</item>
<item><seealso marker="config_file_chapter#top">External Configuration Data</seealso>
(for terms <c>config</c> and <c>userconfig</c>)</item>
<item><seealso marker="event_handler_chapter#event_handling">Event
@@ -887,6 +891,9 @@
{basic_html, Bool}.
{basic_html, NodeRefs, Bool}.
+ {esc_chars, Bool}.
+ {esc_chars, NodeRefs, Bool}.
+
{release_shell, Bool}.</pre>
<p><em>Test terms:</em></p>
diff --git a/lib/common_test/doc/src/test_structure_chapter.xml b/lib/common_test/doc/src/test_structure_chapter.xml
index 8076244928..3ffaa623c3 100644
--- a/lib/common_test/doc/src/test_structure_chapter.xml
+++ b/lib/common_test/doc/src/test_structure_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/unix_telnet.xml b/lib/common_test/doc/src/unix_telnet.xml
index 189379c39a..b2314a53ec 100644
--- a/lib/common_test/doc/src/unix_telnet.xml
+++ b/lib/common_test/doc/src/unix_telnet.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2010</year><year>2012</year>
+ <year>2010</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -80,7 +80,7 @@
<funcs>
<func>
- <name>connect(ConnName, Ip, Port, Timeout, KeepAlive, Extra) -&gt; {ok, Handle} | {error, Reason}</name>
+ <name>connect(ConnName, Ip, Port, Timeout, KeepAlive, TCPNoDelay, Extra) -&gt; {ok, Handle} | {error, Reason}</name>
<fsummary>Callback for ct_telnet.erl.</fsummary>
<type>
<v>ConnName = target_name()</v>
@@ -88,6 +88,7 @@
<v>Port = integer()</v>
<v>Timeout = integer()</v>
<v>KeepAlive = bool()</v>
+ <v>TCPNoDelay = bool()</v>
<v>Extra = target_name() | {Username, Password}</v>
<v>Username = string()</v>
<v>Password = string()</v>
diff --git a/lib/common_test/doc/src/why_test_chapter.xml b/lib/common_test/doc/src/why_test_chapter.xml
index ff6000628b..cdac4e04b2 100644
--- a/lib/common_test/doc/src/why_test_chapter.xml
+++ b/lib/common_test/doc/src/why_test_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/common_test/doc/src/write_test_chapter.xml b/lib/common_test/doc/src/write_test_chapter.xml
index e3811ec4cf..83daf771a6 100644
--- a/lib/common_test/doc/src/write_test_chapter.xml
+++ b/lib/common_test/doc/src/write_test_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -1047,9 +1047,15 @@
<p>Common Test will escape special HTML characters (&lt;, &gt; and &amp;) in printouts
to the log file made with <c>ct:pal/4</c> and <c>io:format/2</c>. In order to print
- strings with HTML tags to the log, use the <c>ct:log/5</c> function. The character escaping
- feature is per default disabled for <c>ct:log/5</c>, but can be enabled with the
- <c>esc_chars</c> option.</p>
+ strings with HTML tags to the log, use the <c>ct:log/3,4,5</c> function. The character
+ escaping feature is per default disabled for <c>ct:log/3,4,5</c> but can be enabled with
+ the <c>esc_chars</c> option in the <c>Opts</c> list, see <seealso marker="ct#log-5">
+ <c>ct:log/3,4,5</c></seealso>.</p>
+
+ <p>If the character escaping feature needs to be disabled (typically for backwards
+ compatibility reasons), use the <c>ct_run</c> start flag <c>-no_esc_chars</c>, or the
+ <c>ct:run_test/1</c> start option <c>{esc_chars,Bool}</c> (this start option is also
+ supported in test specifications).</p>
<p>For more information about log files, see section
<seealso marker="run_test_chapter#log_files">Log Files</seealso>
diff --git a/lib/common_test/include/ct.hrl b/lib/common_test/include/ct.hrl
index 5806f75806..79f0b2d9df 100644
--- a/lib/common_test/include/ct.hrl
+++ b/lib/common_test/include/ct.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/include/ct_event.hrl b/lib/common_test/include/ct_event.hrl
index 51c533297a..d539641b3e 100644
--- a/lib/common_test/include/ct_event.hrl
+++ b/lib/common_test/include/ct_event.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/priv/Makefile b/lib/common_test/priv/Makefile
index c9aff91b8c..c70bde45aa 100644
--- a/lib/common_test/priv/Makefile
+++ b/lib/common_test/priv/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2009. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/common_test/priv/Makefile.in b/lib/common_test/priv/Makefile.in
index 06a4e40ee9..924174e94a 100644
--- a/lib/common_test/priv/Makefile.in
+++ b/lib/common_test/priv/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2012. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/Makefile b/lib/common_test/src/Makefile
index 91c1e8ede8..0f9e044f9e 100644
--- a/lib/common_test/src/Makefile
+++ b/lib/common_test/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2014. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/common_test.app.src b/lib/common_test/src/common_test.app.src
index 26bcf00824..77588af59b 100644
--- a/lib/common_test/src/common_test.app.src
+++ b/lib/common_test/src/common_test.app.src
@@ -1,7 +1,7 @@
% This is an -*- erlang -*- file.
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@
ct_framework,
ct_ftp,
ct_gen_conn,
+ ct_groups,
ct_hooks,
ct_hooks_lock,
ct_logs,
@@ -36,6 +37,8 @@
ct_master_status,
ct_netconfc,
ct_conn_log_h,
+ ct_property_test,
+ ct_release_test,
ct_repeat,
ct_rpc,
ct_run,
@@ -45,6 +48,8 @@
ct_telnet,
ct_testspec,
ct_util,
+ ct_webtool,
+ ct_webtool_sup,
unix_telnet,
vts,
ct_config,
@@ -57,6 +62,7 @@
erl2html2,
test_server_ctrl,
test_server,
+ test_server_gl,
test_server_io,
test_server_node,
test_server_sup
diff --git a/lib/common_test/src/common_test.appup.src b/lib/common_test/src/common_test.appup.src
index a657e4a3a6..e98f947553 100644
--- a/lib/common_test/src/common_test.appup.src
+++ b/lib/common_test/src/common_test.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct.erl b/lib/common_test/src/ct.erl
index 538be514d6..cae7bea406 100644
--- a/lib/common_test/src/ct.erl
+++ b/lib/common_test/src/ct.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -161,9 +161,9 @@ run(TestDirs) ->
%%% {repeat,N} | {duration,DurTime} | {until,StopTime} |
%%% {force_stop,ForceStop} | {decrypt,DecryptKeyOrFile} |
%%% {refresh_logs,LogDir} | {logopts,LogOpts} |
-%%% {verbosity,VLevels} | {basic_html,Bool} |
-%%% {ct_hooks, CTHs} | {enable_builtin_hooks,Bool} |
-%%% {release_shell,Bool}
+%%% {verbosity,VLevels} | {basic_html,Bool} |
+%%% {esc_chars,Bool} | {ct_hooks, CTHs} |
+%%% {enable_builtin_hooks,Bool} | {release_shell,Bool}
%%% TestDirs = [string()] | string()
%%% Suites = [string()] | [atom()] | string() | atom()
%%% Cases = [atom()] | atom()
diff --git a/lib/common_test/src/ct_config.erl b/lib/common_test/src/ct_config.erl
index 33efe7a14a..b499bc8b05 100644
--- a/lib/common_test/src/ct_config.erl
+++ b/lib/common_test/src/ct_config.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_config_plain.erl b/lib/common_test/src/ct_config_plain.erl
index 810dec7c76..e72b55971b 100644
--- a/lib/common_test/src/ct_config_plain.erl
+++ b/lib/common_test/src/ct_config_plain.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_config_xml.erl b/lib/common_test/src/ct_config_xml.erl
index 593ae3de52..4343761707 100644
--- a/lib/common_test/src/ct_config_xml.erl
+++ b/lib/common_test/src/ct_config_xml.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_conn_log_h.erl b/lib/common_test/src/ct_conn_log_h.erl
index 034906a3ba..93e64c65fe 100644
--- a/lib/common_test/src/ct_conn_log_h.erl
+++ b/lib/common_test/src/ct_conn_log_h.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_cover.erl b/lib/common_test/src/ct_cover.erl
index 8e5ce9b245..c258516915 100644
--- a/lib/common_test/src/ct_cover.erl
+++ b/lib/common_test/src/ct_cover.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_event.erl b/lib/common_test/src/ct_event.erl
index 01beabaa73..5fa9f410bf 100644
--- a/lib/common_test/src/ct_event.erl
+++ b/lib/common_test/src/ct_event.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index 19a3a51b88..eb32f7f3fc 100644
--- a/lib/common_test/src/ct_framework.erl
+++ b/lib/common_test/src/ct_framework.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_ftp.erl b/lib/common_test/src/ct_ftp.erl
index 616b1a8934..48914864e4 100644
--- a/lib/common_test/src/ct_ftp.erl
+++ b/lib/common_test/src/ct_ftp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_gen_conn.erl b/lib/common_test/src/ct_gen_conn.erl
index e46fd77383..23ba1ab981 100644
--- a/lib/common_test/src/ct_gen_conn.erl
+++ b/lib/common_test/src/ct_gen_conn.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_groups.erl b/lib/common_test/src/ct_groups.erl
index 92640cf323..dd04c5410a 100644
--- a/lib/common_test/src/ct_groups.erl
+++ b/lib/common_test/src/ct_groups.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -325,7 +325,7 @@ modify_tc_list1(GrSpecTs, TSCs) ->
true ->
{[TC|TSCs1],lists:delete(TC,GrSpecTs2)};
false ->
- case lists:keymember(TC, 2, GrSpecTs) of
+ case lists:keysearch(TC, 2, GrSpecTs) of
{value,Test} ->
{[Test|TSCs1],
lists:keydelete(TC, 2, GrSpecTs2)};
diff --git a/lib/common_test/src/ct_hooks.erl b/lib/common_test/src/ct_hooks.erl
index 83ad33fdd8..5422d449fd 100644
--- a/lib/common_test/src/ct_hooks.erl
+++ b/lib/common_test/src/ct_hooks.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -67,6 +67,8 @@ terminate(Hooks) ->
%% tests.
-spec init_tc(Mod :: atom(),
FuncSpec :: atom() |
+ {ConfigFunc :: init_per_testcase | end_per_testcase,
+ TestCase :: atom()} |
{ConfigFunc :: init_per_group | end_per_group,
GroupName :: atom(),
Properties :: list()},
@@ -103,7 +105,9 @@ init_tc(_Mod, TC = error_in_suite, Config) ->
%% @doc Called as each test case is completed. This includes all configuration
%% tests.
-spec end_tc(Mod :: atom(),
- FuncSpec :: atom() |
+ FuncSpec :: atom() |
+ {ConfigFunc :: init_per_testcase | end_per_testcase,
+ TestCase :: atom()} |
{ConfigFunc :: init_per_group | end_per_group,
GroupName :: atom(),
Properties :: list()},
diff --git a/lib/common_test/src/ct_hooks_lock.erl b/lib/common_test/src/ct_hooks_lock.erl
index 1a058aa8ca..f41f259f7b 100644
--- a/lib/common_test/src/ct_hooks_lock.erl
+++ b/lib/common_test/src/ct_hooks_lock.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl
index 4920383f39..29b38e9748 100644
--- a/lib/common_test/src/ct_logs.erl
+++ b/lib/common_test/src/ct_logs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -609,7 +609,8 @@ log_timestamp({MS,S,US}) ->
ct_log_fd,
tc_groupleaders,
stylesheet,
- async_print_jobs}).
+ async_print_jobs,
+ tc_esc_chars}).
logger(Parent, Mode, Verbosity) ->
register(?MODULE,self()),
@@ -728,14 +729,18 @@ logger(Parent, Mode, Verbosity) ->
end
end || {Cat,VLvl} <- Verbosity],
io:nl(CtLogFd),
-
+ TcEscChars = case application:get_env(common_test, esc_chars) of
+ {ok,ECBool} -> ECBool;
+ _ -> true
+ end,
logger_loop(#logger_state{parent=Parent,
log_dir=AbsDir,
start_time=Time,
orig_GL=group_leader(),
ct_log_fd=CtLogFd,
tc_groupleaders=[],
- async_print_jobs=[]}).
+ async_print_jobs=[],
+ tc_esc_chars=TcEscChars}).
copy_priv_files([SrcF | SrcFs], [DestF | DestFs]) ->
case file:copy(SrcF, DestF) of
@@ -761,20 +766,21 @@ logger_loop(State) ->
end,
if Importance >= (100-VLvl) ->
CtLogFd = State#logger_state.ct_log_fd,
+ DoEscChars = State#logger_state.tc_esc_chars and EscChars,
case get_groupleader(Pid, GL, State) of
{tc_log,TCGL,TCGLs} ->
case erlang:is_process_alive(TCGL) of
true ->
State1 = print_to_log(SyncOrAsync, Pid,
Category, TCGL, Content,
- EscChars, State),
+ DoEscChars, State),
logger_loop(State1#logger_state{
tc_groupleaders = TCGLs});
false ->
%% Group leader is dead, so write to the
%% CtLog or unexpected_io log instead
unexpected_io(Pid, Category, Importance,
- Content, CtLogFd, EscChars),
+ Content, CtLogFd, DoEscChars),
logger_loop(State)
end;
@@ -783,7 +789,7 @@ logger_loop(State) ->
%% to ct_log, else write to unexpected_io
%% log
unexpected_io(Pid, Category, Importance, Content,
- CtLogFd, EscChars),
+ CtLogFd, DoEscChars),
logger_loop(State#logger_state{
tc_groupleaders = TCGLs})
end;
@@ -794,7 +800,7 @@ logger_loop(State) ->
%% make sure no IO for this test case from the
%% CT logger gets rejected
test_server:permit_io(GL, self()),
- print_style(GL, State#logger_state.stylesheet),
+ print_style(GL,GL,State#logger_state.stylesheet),
set_evmgr_gl(GL),
TCGLs = add_tc_gl(TCPid,GL,State),
if not RefreshLog ->
@@ -882,7 +888,7 @@ create_io_fun(FromPid, CtLogFd, EscChars) ->
{_HdOrFt,S,A} -> {false,S,A};
{S,A} -> {true,S,A}
end,
- try io_lib:format(Str,Args) of
+ try io_lib:format(Str, Args) of
IoStr when Escapable, EscChars, IoList == [] ->
escape_chars(IoStr);
IoStr when Escapable, EscChars ->
@@ -925,7 +931,12 @@ print_to_log(sync, FromPid, Category, TCGL, Content, EscChars, State) ->
if FromPid /= TCGL ->
IoFun = create_io_fun(FromPid, CtLogFd, EscChars),
IoList = lists:foldl(IoFun, [], Content),
- io:format(TCGL,["$tc_html","~ts"], [IoList]);
+ try io:format(TCGL,["$tc_html","~ts"], [IoList]) of
+ ok -> ok
+ catch
+ _:_ ->
+ io:format(TCGL,"~ts", [IoList])
+ end;
true ->
unexpected_io(FromPid, Category, ?MAX_IMPORTANCE, Content,
CtLogFd, EscChars)
@@ -958,7 +969,10 @@ print_to_log(async, FromPid, Category, TCGL, Content, EscChars, State) ->
_:terminated ->
unexpected_io(FromPid, Category,
?MAX_IMPORTANCE,
- Content, CtLogFd, EscChars)
+ Content, CtLogFd, EscChars);
+ _:_ ->
+ io:format(TCGL, "~ts",
+ [lists:foldl(IoFun,[],Content)])
end;
false ->
unexpected_io(FromPid, Category,
@@ -1099,26 +1113,27 @@ open_ctlog(MiscIoName) ->
"View I/O logged after the test run</a></li>\n</ul>\n",
[MiscIoName,MiscIoName]),
- print_style(Fd,undefined),
+ print_style(Fd,group_leader(),undefined),
io:format(Fd,
xhtml("<br><h2>Progress Log</h2>\n<pre>\n",
"<br />\n<h4>PROGRESS LOG</h4>\n<pre>\n"), []),
Fd.
-print_style(Fd,undefined) ->
+print_style(Fd,GL,undefined) ->
case basic_html() of
true ->
- io:format(Fd,
- "<style>\n"
- "div.ct_internal { background:lightgrey; color:black; }\n"
- "div.default { background:lightgreen; color:black; }\n"
- "</style>\n",
- []);
+ Style = "<style>\n
+ div.ct_internal { background:lightgrey; color:black; }\n
+ div.default { background:lightgreen; color:black; }\n
+ </style>\n",
+ if Fd == GL -> io:format(["$tc_html",Style], []);
+ true -> io:format(Fd, Style, [])
+ end;
_ ->
ok
end;
-print_style(Fd,StyleSheet) ->
+print_style(Fd,GL,StyleSheet) ->
case file:read_file(StyleSheet) of
{ok,Bin} ->
Str = b2s(Bin,encoding(StyleSheet)),
@@ -1131,23 +1146,30 @@ print_style(Fd,StyleSheet) ->
N1 -> N1
end,
if (Pos0 == 0) and (Pos1 /= 0) ->
- print_style_error(Fd,StyleSheet,missing_style_start_tag);
+ print_style_error(Fd,GL,StyleSheet,missing_style_start_tag);
(Pos0 /= 0) and (Pos1 == 0) ->
- print_style_error(Fd,StyleSheet,missing_style_end_tag);
+ print_style_error(Fd,GL,StyleSheet,missing_style_end_tag);
Pos0 /= 0 ->
Style = string:sub_string(Str,Pos0,Pos1+7),
- io:format(Fd,"~ts\n",[Style]);
+ if Fd == GL -> io:format(Fd,["$tc_html","~ts\n"],[Style]);
+ true -> io:format(Fd,"~ts\n",[Style])
+ end;
Pos0 == 0 ->
- io:format(Fd,"<style>~ts</style>\n",[Str])
+ if Fd == GL -> io:format(Fd,["$tc_html","<style>\n~ts</style>\n"],[Str]);
+ true -> io:format(Fd,"<style>\n~ts</style>\n",[Str])
+ end
end;
{error,Reason} ->
- print_style_error(Fd,StyleSheet,Reason)
+ print_style_error(Fd,GL,StyleSheet,Reason)
end.
-print_style_error(Fd,StyleSheet,Reason) ->
- io:format(Fd,"\n<!-- Failed to load stylesheet ~ts: ~p -->\n",
- [StyleSheet,Reason]),
- print_style(Fd,undefined).
+print_style_error(Fd,GL,StyleSheet,Reason) ->
+ IO = io_lib:format("\n<!-- Failed to load stylesheet ~ts: ~p -->\n",
+ [StyleSheet,Reason]),
+ if Fd == GL -> io:format(Fd,["$tc_html",IO],[]);
+ true -> io:format(Fd,IO,[])
+ end,
+ print_style(Fd,GL,undefined).
close_ctlog(Fd) ->
io:format(Fd, "\n</pre>\n", []),
@@ -1833,7 +1855,7 @@ make_all_runs_index(When) ->
AbsName = ?abs(?all_runs_name),
notify_and_lock_file(AbsName),
if When == start -> ok;
- true -> io:put_chars("Updating " ++ AbsName ++ "... ")
+ true -> io:put_chars("Updating " ++ AbsName ++ " ... ")
end,
%% check if log cache should be used, and if it exists
@@ -2572,7 +2594,7 @@ update_tests_in_cache(TempData,LogCache=#log_cache{tests=Tests}) ->
make_all_suites_index1(When, AbsIndexName, AllTestLogDirs) ->
IndexName = ?index_name,
if When == start -> ok;
- true -> io:put_chars("Updating " ++ AbsIndexName ++ "... ")
+ true -> io:put_chars("Updating " ++ AbsIndexName ++ " ... ")
end,
case catch make_all_suites_index2(IndexName, AllTestLogDirs) of
{'EXIT', Reason} ->
diff --git a/lib/common_test/src/ct_master.erl b/lib/common_test/src/ct_master.erl
index 228daf459b..c4905b316f 100644
--- a/lib/common_test/src/ct_master.erl
+++ b/lib/common_test/src/ct_master.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@
-export([run_on_node/2,run_on_node/3]).
-export([run_test/1,run_test/2]).
-export([get_event_mgr_ref/0]).
--export([basic_html/1]).
+-export([basic_html/1,esc_chars/1]).
-export([abort/0,abort/1,progress/0]).
@@ -317,6 +317,16 @@ basic_html(Bool) ->
ok.
%%%-----------------------------------------------------------------
+%%% @spec esc_chars(Bool) -> ok
+%%% Bool = true | false
+%%%
+%%% @doc If set to false, the ct_master logs will be written without
+%%% special characters being escaped in the HTML logs.
+esc_chars(Bool) ->
+ application:set_env(common_test_master, esc_chars, Bool),
+ ok.
+
+%%%-----------------------------------------------------------------
%%% MASTER, runs on central controlling node.
%%%-----------------------------------------------------------------
start_master(NodeOptsList) ->
diff --git a/lib/common_test/src/ct_master_event.erl b/lib/common_test/src/ct_master_event.erl
index 0d7d220fd0..d28ef42c20 100644
--- a/lib/common_test/src/ct_master_event.erl
+++ b/lib/common_test/src/ct_master_event.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_master_logs.erl b/lib/common_test/src/ct_master_logs.erl
index 54190a8254..39f87a7f09 100644
--- a/lib/common_test/src/ct_master_logs.erl
+++ b/lib/common_test/src/ct_master_logs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_master_status.erl b/lib/common_test/src/ct_master_status.erl
index 6a3572b261..7d3e54e645 100644
--- a/lib/common_test/src/ct_master_status.erl
+++ b/lib/common_test/src/ct_master_status.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_netconfc.erl b/lib/common_test/src/ct_netconfc.erl
index 8812514ad9..ff45407fe0 100644
--- a/lib/common_test/src/ct_netconfc.erl
+++ b/lib/common_test/src/ct_netconfc.erl
@@ -1,7 +1,7 @@
%%----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_netconfc.hrl b/lib/common_test/src/ct_netconfc.hrl
index e4746fe8b7..5eeeafa318 100644
--- a/lib/common_test/src/ct_netconfc.hrl
+++ b/lib/common_test/src/ct_netconfc.hrl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_property_test.erl b/lib/common_test/src/ct_property_test.erl
index 5ee7435695..7dc78e949a 100644
--- a/lib/common_test/src/ct_property_test.erl
+++ b/lib/common_test/src/ct_property_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_release_test.erl b/lib/common_test/src/ct_release_test.erl
index 6c38f51363..4e0f88cf5f 100644
--- a/lib/common_test/src/ct_release_test.erl
+++ b/lib/common_test/src/ct_release_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -655,10 +655,6 @@ do_upgrade({Cb,InitState},FromVsn,FromAppsVsns,ToRel,ToAppsVsns,InstallDir) ->
Start = filename:join([InstallDir,bin,start]),
{ok,Node} = start_node(Start,FromVsn,FromAppsVsns),
- %% Add path to this module, to allow calls to get_appup/2
- Dir = filename:dirname(code:which(?MODULE)),
- _ = rpc:call(Node,code,add_pathz,[Dir]),
-
ct:log("Node started: ~p",[Node]),
CtData = #ct_data{from = [{A,V,code:lib_dir(A)} || {A,V} <- FromAppsVsns],
to=[{A,V,code:lib_dir(A)} || {A,V} <- ToAppsVsns]},
diff --git a/lib/common_test/src/ct_repeat.erl b/lib/common_test/src/ct_repeat.erl
index 1cb32f5bcd..31c5755c7e 100644
--- a/lib/common_test/src/ct_repeat.erl
+++ b/lib/common_test/src/ct_repeat.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_rpc.erl b/lib/common_test/src/ct_rpc.erl
index 73520b3dd5..cbcc212bb8 100644
--- a/lib/common_test/src/ct_rpc.erl
+++ b/lib/common_test/src/ct_rpc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl
index e156c9b773..1e5f935198 100644
--- a/lib/common_test/src/ct_run.erl
+++ b/lib/common_test/src/ct_run.erl
@@ -65,6 +65,7 @@
logdir,
logopts = [],
basic_html,
+ esc_chars = true,
verbosity = [],
config = [],
event_handlers = [],
@@ -346,6 +347,15 @@ script_start1(Parent, Args) ->
application:set_env(common_test, basic_html, true),
true
end,
+ %% esc_chars - used by ct_logs
+ EscChars = case proplists:get_value(no_esc_chars, Args) of
+ undefined ->
+ application:set_env(common_test, esc_chars, true),
+ undefined;
+ _ ->
+ application:set_env(common_test, esc_chars, false),
+ false
+ end,
%% disable_log_cache - used by ct_logs
case proplists:get_value(disable_log_cache, Args) of
undefined ->
@@ -359,6 +369,7 @@ script_start1(Parent, Args) ->
cover = Cover, cover_stop = CoverStop,
logdir = LogDir, logopts = LogOpts,
basic_html = BasicHtml,
+ esc_chars = EscChars,
verbosity = Verbosity,
event_handlers = EvHandlers,
ct_hooks = CTHooks,
@@ -587,6 +598,17 @@ combine_test_opts(TS, Specs, Opts) ->
BHBool
end,
+ EscChars =
+ case choose_val(Opts#opts.esc_chars,
+ TSOpts#opts.esc_chars) of
+ undefined ->
+ true;
+ ECBool ->
+ application:set_env(common_test, esc_chars,
+ ECBool),
+ ECBool
+ end,
+
Opts#opts{label = Label,
profile = Profile,
testspec_files = Specs,
@@ -595,6 +617,7 @@ combine_test_opts(TS, Specs, Opts) ->
logdir = which(logdir, LogDir),
logopts = AllLogOpts,
basic_html = BasicHtml,
+ esc_chars = EscChars,
verbosity = AllVerbosity,
silent_connections = AllSilentConns,
config = TSOpts#opts.config,
@@ -795,6 +818,7 @@ script_usage() ->
"\n\t [-scale_timetraps]"
"\n\t [-create_priv_dir auto_per_run | auto_per_tc | manual_per_tc]"
"\n\t [-basic_html]"
+ "\n\t [-no_esc_chars]"
"\n\t [-repeat N] |"
"\n\t [-duration HHMMSS [-force_stop [skip_rest]]] |"
"\n\t [-until [YYMoMoDD]HHMMSS [-force_stop [skip_rest]]]"
@@ -822,6 +846,7 @@ script_usage() ->
"\n\t [-scale_timetraps]"
"\n\t [-create_priv_dir auto_per_run | auto_per_tc | manual_per_tc]"
"\n\t [-basic_html]"
+ "\n\t [-no_esc_chars]"
"\n\t [-repeat N] |"
"\n\t [-duration HHMMSS [-force_stop [skip_rest]]] |"
"\n\t [-until [YYMoMoDD]HHMMSS [-force_stop [skip_rest]]]\n\n"),
@@ -847,7 +872,8 @@ script_usage() ->
"\n\t [-multiply_timetraps N]"
"\n\t [-scale_timetraps]"
"\n\t [-create_priv_dir auto_per_run | auto_per_tc | manual_per_tc]"
- "\n\t [-basic_html]\n\n").
+ "\n\t [-basic_html]"
+ "\n\t [-no_esc_chars]\n\n").
%%%-----------------------------------------------------------------
%%% @hidden
@@ -1089,7 +1115,17 @@ run_test2(StartOpts) ->
application:set_env(common_test, basic_html, BasicHtmlBool),
BasicHtmlBool
end,
-
+ %% esc_chars - used by ct_logs
+ EscChars =
+ case proplists:get_value(esc_chars, StartOpts) of
+ undefined ->
+ application:set_env(common_test, esc_chars, true),
+ undefined;
+ EscCharsBool ->
+ application:set_env(common_test, esc_chars, EscCharsBool),
+ EscCharsBool
+ end,
+ %% disable_log_cache - used by ct_logs
case proplists:get_value(disable_log_cache, StartOpts) of
undefined ->
application:set_env(common_test, disable_log_cache, false);
@@ -1104,6 +1140,7 @@ run_test2(StartOpts) ->
cover = Cover, cover_stop = CoverStop,
step = Step, logdir = LogDir,
logopts = LogOpts, basic_html = BasicHtml,
+ esc_chars = EscChars,
config = CfgFiles,
verbosity = Verbosity,
event_handlers = EvHandlers,
@@ -1445,6 +1482,7 @@ get_data_for_node(#testspec{label = Labels,
logdir = LogDirs,
logopts = LogOptsList,
basic_html = BHs,
+ esc_chars = EscChs,
stylesheet = SSs,
verbosity = VLvls,
silent_connections = SilentConnsList,
@@ -1472,6 +1510,7 @@ get_data_for_node(#testspec{label = Labels,
LOs -> LOs
end,
BasicHtml = proplists:get_value(Node, BHs),
+ EscChars = proplists:get_value(Node, EscChs),
Stylesheet = proplists:get_value(Node, SSs),
Verbosity = case proplists:get_value(Node, VLvls) of
undefined -> [];
@@ -1498,6 +1537,7 @@ get_data_for_node(#testspec{label = Labels,
logdir = LogDir,
logopts = LogOpts,
basic_html = BasicHtml,
+ esc_chars = EscChars,
stylesheet = Stylesheet,
verbosity = Verbosity,
silent_connections = SilentConns,
@@ -2182,10 +2222,18 @@ do_run_test(Tests, Skip, Opts0) ->
%% test_server needs to know the include path too
InclPath = case application:get_env(common_test, include) of
{ok,Incls} -> Incls;
- _ -> []
+ _ -> []
end,
application:set_env(test_server, include, InclPath),
+ %% copy the escape characters setting to test_server
+ EscChars =
+ case application:get_env(common_test, esc_chars) of
+ {ok,ECBool} -> ECBool;
+ _ -> true
+ end,
+ application:set_env(test_server, esc_chars, EscChars),
+
test_server_ctrl:start_link(local),
%% let test_server expand the test tuples and count no of cases
@@ -3069,6 +3117,10 @@ opts2args(EnvStartOpts) ->
[{basic_html,[]}];
({basic_html,false}) ->
[];
+ ({esc_chars,false}) ->
+ [{no_esc_chars,[]}];
+ ({esc_chars,true}) ->
+ [];
({event_handler,EH}) when is_atom(EH) ->
[{event_handler,[atom_to_list(EH)]}];
({event_handler,EHs}) when is_list(EHs) ->
diff --git a/lib/common_test/src/ct_ssh.erl b/lib/common_test/src/ct_ssh.erl
index d19004fa2c..92d912052e 100644
--- a/lib/common_test/src/ct_ssh.erl
+++ b/lib/common_test/src/ct_ssh.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_telnet.erl b/lib/common_test/src/ct_telnet.erl
index 4d3fd2d094..f5f4f648f4 100644
--- a/lib/common_test/src/ct_telnet.erl
+++ b/lib/common_test/src/ct_telnet.erl
@@ -42,7 +42,8 @@
%% {reconnection_interval,Millisec},
%% {keep_alive,Bool},
%% {poll_limit,N},
-%% {poll_interval,Millisec}]}.</pre>
+%% {poll_interval,Millisec},
+%% {tcp_nodelay,Bool}]}.</pre>
%% <p><code>Millisec = integer(), N = integer()</code></p>
%% <p>Enter the <code>telnet_settings</code> term in a configuration
%% file included in the test and ct_telnet will retrieve the information
@@ -182,7 +183,8 @@
conn_to=?DEFAULT_TIMEOUT,
com_to=?DEFAULT_TIMEOUT,
reconns=?RECONNS,
- reconn_int=?RECONN_TIMEOUT}).
+ reconn_int=?RECONN_TIMEOUT,
+ tcp_nodelay=false}).
%%%-----------------------------------------------------------------
%%% @spec open(Name) -> {ok,Handle} | {error,Reason}
@@ -602,8 +604,18 @@ init(Name,{Ip,Port,Type},{TargetMod,KeepAlive,Extra}) ->
Settings ->
set_telnet_defaults(Settings,#state{})
end,
- case catch TargetMod:connect(Name,Ip,Port,S0#state.conn_to,
- KeepAlive,Extra) of
+ %% Handle old user versions of TargetMod
+ code:ensure_loaded(TargetMod),
+ try
+ case erlang:function_exported(TargetMod,connect,7) of
+ true ->
+ TargetMod:connect(Name,Ip,Port,S0#state.conn_to,
+ KeepAlive,S0#state.tcp_nodelay,Extra);
+ false ->
+ TargetMod:connect(Name,Ip,Port,S0#state.conn_to,
+ KeepAlive,Extra)
+ end
+ of
{ok,TelnPid} ->
put({ct_telnet_pid2name,TelnPid},Name),
S1 = S0#state{host=Ip,
@@ -625,15 +637,18 @@ init(Name,{Ip,Port,Type},{TargetMod,KeepAlive,Extra}) ->
"Connection timeout: ~p\n"
"Keep alive: ~w\n"
"Poll limit: ~w\n"
- "Poll interval: ~w",
+ "Poll interval: ~w\n"
+ "TCP nodelay: ~w",
[Ip,Port,S1#state.com_to,S1#state.reconns,
S1#state.reconn_int,S1#state.conn_to,KeepAlive,
- S1#state.poll_limit,S1#state.poll_interval]),
+ S1#state.poll_limit,S1#state.poll_interval,
+ S1#state.tcp_nodelay]),
{ok,TelnPid,S1};
- {'EXIT',Reason} ->
- {error,Reason};
Error ->
Error
+ catch
+ _:Reason ->
+ {error,Reason}
end.
type(telnet) -> ip;
@@ -653,6 +668,8 @@ set_telnet_defaults([{poll_limit,PL}|Ss],S) ->
set_telnet_defaults(Ss,S#state{poll_limit=PL});
set_telnet_defaults([{poll_interval,PI}|Ss],S) ->
set_telnet_defaults(Ss,S#state{poll_interval=PI});
+set_telnet_defaults([{tcp_nodelay,NoDelay}|Ss],S) ->
+ set_telnet_defaults(Ss,S#state{tcp_nodelay=NoDelay});
set_telnet_defaults([Unknown|Ss],S) ->
force_log(S,error,
"Bad element in telnet_settings: ~p",[Unknown]),
@@ -794,8 +811,17 @@ reconnect(Ip,Port,N,State=#state{name=Name,
keep_alive=KeepAlive,
extra=Extra,
conn_to=ConnTo,
- reconn_int=ReconnInt}) ->
- case TargetMod:connect(Name,Ip,Port,ConnTo,KeepAlive,Extra) of
+ reconn_int=ReconnInt,
+ tcp_nodelay=NoDelay}) ->
+ %% Handle old user versions of TargetMod
+ ConnResult =
+ case erlang:function_exported(TargetMod,connect,7) of
+ true ->
+ TargetMod:connect(Name,Ip,Port,ConnTo,KeepAlive,NoDelay,Extra);
+ false ->
+ TargetMod:connect(Name,Ip,Port,ConnTo,KeepAlive,Extra)
+ end,
+ case ConnResult of
{ok,NewPid} ->
put({ct_telnet_pid2name,NewPid},Name),
{ok, NewPid, State#state{teln_pid=NewPid}};
diff --git a/lib/common_test/src/ct_telnet_client.erl b/lib/common_test/src/ct_telnet_client.erl
index 99d683244c..1f1311776f 100644
--- a/lib/common_test/src/ct_telnet_client.erl
+++ b/lib/common_test/src/ct_telnet_client.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@
%%-define(debug, true).
--export([open/2, open/3, open/4, open/5, close/1]).
+-export([open/2, open/3, open/4, open/5, open/6, close/1]).
-export([send_data/2, send_data/3, get_data/1]).
-define(TELNET_PORT, 23).
@@ -70,19 +70,22 @@
-record(state,{conn_name, get_data, keep_alive=true, log_pos=1}).
open(Server, ConnName) ->
- open(Server, ?TELNET_PORT, ?OPEN_TIMEOUT, true, ConnName).
+ open(Server, ?TELNET_PORT, ?OPEN_TIMEOUT, true, false, ConnName).
open(Server, Port, ConnName) ->
- open(Server, Port, ?OPEN_TIMEOUT, true, ConnName).
+ open(Server, Port, ?OPEN_TIMEOUT, true, false, ConnName).
open(Server, Port, Timeout, ConnName) ->
- open(Server, Port, Timeout, true, ConnName).
+ open(Server, Port, Timeout, true, false, ConnName).
open(Server, Port, Timeout, KeepAlive, ConnName) ->
+ open(Server, Port, Timeout, KeepAlive, false, ConnName).
+
+open(Server, Port, Timeout, KeepAlive, NoDelay, ConnName) ->
Self = self(),
Pid = spawn(fun() ->
init(Self, Server, Port, Timeout,
- KeepAlive, ConnName)
+ KeepAlive, NoDelay, ConnName)
end),
receive
{open,Pid} ->
@@ -114,8 +117,8 @@ get_data(Pid) ->
%%%-----------------------------------------------------------------
%%% Internal functions
-init(Parent, Server, Port, Timeout, KeepAlive, ConnName) ->
- case gen_tcp:connect(Server, Port, [list,{packet,0},{nodelay,true}], Timeout) of
+init(Parent, Server, Port, Timeout, KeepAlive, NoDelay, ConnName) ->
+ case gen_tcp:connect(Server, Port, [list,{packet,0},{nodelay,NoDelay}], Timeout) of
{ok,Sock} ->
dbg("~p connected to: ~p (port: ~w, keep_alive: ~w)\n",
[ConnName,Server,Port,KeepAlive]),
diff --git a/lib/common_test/src/ct_testspec.erl b/lib/common_test/src/ct_testspec.erl
index 5cd52bd042..991abb0666 100644
--- a/lib/common_test/src/ct_testspec.erl
+++ b/lib/common_test/src/ct_testspec.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1146,8 +1146,9 @@ should_be_added(Tag,Node,_Data,Spec) ->
if
%% list terms *without* possible duplicates here
Tag == logdir; Tag == logopts;
- Tag == basic_html; Tag == label;
- Tag == auto_compile; Tag == abort_if_missing_suites;
+ Tag == basic_html; Tag == esc_chars;
+ Tag == label; Tag == auto_compile;
+ Tag == abort_if_missing_suites;
Tag == stylesheet; Tag == verbosity;
Tag == silent_connections ->
lists:keymember(ref2node(Node,Spec#testspec.nodes),1,
@@ -1544,6 +1545,8 @@ valid_terms() ->
{logopts,3},
{basic_html,2},
{basic_html,3},
+ {esc_chars,2},
+ {esc_chars,3},
{verbosity,2},
{verbosity,3},
{silent_connections,2},
diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl
index b7fa7947e2..d5a8e3fbc0 100644
--- a/lib/common_test/src/ct_util.erl
+++ b/lib/common_test/src/ct_util.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -459,6 +459,7 @@ loop(Mode,TestData,StartDir) ->
error:badarg -> []
end,
ct_hooks:terminate(Callbacks),
+
close_connections(ets:tab2list(?conn_table)),
ets:delete(?conn_table),
ets:delete(?board_table),
diff --git a/lib/common_test/src/ct_util.hrl b/lib/common_test/src/ct_util.hrl
index 2c1954c2b3..d7efa26863 100644
--- a/lib/common_test/src/ct_util.hrl
+++ b/lib/common_test/src/ct_util.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -37,6 +37,7 @@
logdir=["."],
logopts=[],
basic_html=[],
+ esc_chars=[],
verbosity=[],
silent_connections=[],
cover=[],
diff --git a/lib/common_test/src/ct_webtool.erl b/lib/common_test/src/ct_webtool.erl
index 014487eb10..6cbcd98cc3 100644
--- a/lib/common_test/src/ct_webtool.erl
+++ b/lib/common_test/src/ct_webtool.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/ct_webtool_sup.erl b/lib/common_test/src/ct_webtool_sup.erl
index 485161c784..c02ec69d04 100644
--- a/lib/common_test/src/ct_webtool_sup.erl
+++ b/lib/common_test/src/ct_webtool_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/cth_conn_log.erl b/lib/common_test/src/cth_conn_log.erl
index 954b4239af..0501c6ed1c 100644
--- a/lib/common_test/src/cth_conn_log.erl
+++ b/lib/common_test/src/cth_conn_log.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/cth_log_redirect.erl b/lib/common_test/src/cth_log_redirect.erl
index a8c4a455e1..33a3813a16 100644
--- a/lib/common_test/src/cth_log_redirect.erl
+++ b/lib/common_test/src/cth_log_redirect.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -130,7 +130,14 @@ handle_event(Event, #eh_state{log_func = LogFunc} = State) ->
tag_event(Event)),
if is_list(SReport) ->
SaslHeader = format_header(State),
- ct_logs:LogFunc(sasl, ?STD_IMPORTANCE, SaslHeader, SReport, []);
+ case LogFunc of
+ tc_log ->
+ ct_logs:tc_log(sasl, ?STD_IMPORTANCE,
+ SaslHeader, SReport, [], []);
+ tc_log_async ->
+ ct_logs:tc_log_async(sasl, ?STD_IMPORTANCE,
+ SaslHeader, SReport, [])
+ end;
true -> %% Report is an atom if no logging is to be done
ignore
end
@@ -139,7 +146,14 @@ handle_event(Event, #eh_state{log_func = LogFunc} = State) ->
tag_event(Event),io_lib),
if is_list(EReport) ->
ErrHeader = format_header(State),
- ct_logs:LogFunc(error_logger, ?STD_IMPORTANCE, ErrHeader, EReport, []);
+ case LogFunc of
+ tc_log ->
+ ct_logs:tc_log(error_logger, ?STD_IMPORTANCE,
+ ErrHeader, EReport, [], []);
+ tc_log_async ->
+ ct_logs:tc_log_async(error_logger, ?STD_IMPORTANCE,
+ ErrHeader, EReport, [])
+ end;
true -> %% Report is an atom if no logging is to be done
ignore
end,
diff --git a/lib/common_test/src/cth_surefire.erl b/lib/common_test/src/cth_surefire.erl
index 31a8e1c076..59b916851e 100644
--- a/lib/common_test/src/cth_surefire.erl
+++ b/lib/common_test/src/cth_surefire.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -82,7 +82,8 @@ init(Path, Opts) ->
url_base = proplists:get_value(url_base,Opts),
timer = ?now }.
-pre_init_per_suite(Suite,SkipOrFail,State) when is_tuple(SkipOrFail) ->
+pre_init_per_suite(Suite,SkipOrFail,#state{ test_cases = [] } = State)
+ when is_tuple(SkipOrFail) ->
{SkipOrFail, init_tc(State#state{curr_suite = Suite,
curr_suite_ts = ?now},
SkipOrFail) };
diff --git a/lib/common_test/src/erl2html2.erl b/lib/common_test/src/erl2html2.erl
index d440d0940d..a1e0bf3879 100644
--- a/lib/common_test/src/erl2html2.erl
+++ b/lib/common_test/src/erl2html2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/test_server.erl b/lib/common_test/src/test_server.erl
index 34acad6fd1..919526c5d7 100644
--- a/lib/common_test/src/test_server.erl
+++ b/lib/common_test/src/test_server.erl
@@ -2165,10 +2165,19 @@ get_timetrap_info(TCPid, SendToServer) ->
Timers ->
case [Info || {Handle,Pid,Info} <- Timers,
Pid == TCPid, Handle /= infinity] of
- [I|_] ->
- I;
+ [{TVal,true}|_] ->
+ {TVal,{true,test_server:timetrap_scale_factor()}};
+ [{TVal,false}|_] ->
+ {TVal,{false,1}};
[] when SendToServer == true ->
- tc_supervisor_req({get_timetrap_info,TCPid});
+ case tc_supervisor_req({get_timetrap_info,TCPid}) of
+ {TVal,true} ->
+ {TVal,{true,test_server:timetrap_scale_factor()}};
+ {TVal,false} ->
+ {TVal,{false,1}};
+ Error ->
+ Error
+ end;
[] ->
undefined
end
diff --git a/lib/common_test/src/test_server_ctrl.erl b/lib/common_test/src/test_server_ctrl.erl
index 833d99907e..ff960c22a5 100644
--- a/lib/common_test/src/test_server_ctrl.erl
+++ b/lib/common_test/src/test_server_ctrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/test_server_gl.erl b/lib/common_test/src/test_server_gl.erl
index 233e59172b..333c8fc06e 100644
--- a/lib/common_test/src/test_server_gl.erl
+++ b/lib/common_test/src/test_server_gl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -131,6 +131,10 @@ set_props(GL, PropList) ->
%%% Internal functions.
init([]) ->
+ EscChars = case application:get_env(test_server, esc_chars) of
+ {ok,ECBool} -> ECBool;
+ _ -> true
+ end,
{ok,#st{tc_supervisor=none,
minor=none,
minor_monitor=none,
@@ -139,7 +143,7 @@ init([]) ->
permit_io=gb_sets:empty(),
auto_nl=true,
levels={1,19,10},
- escape_chars=true
+ escape_chars=EscChars
}}.
req(GL, Req) ->
diff --git a/lib/common_test/src/test_server_internal.hrl b/lib/common_test/src/test_server_internal.hrl
index 1ec2d83417..f0c1876dd6 100644
--- a/lib/common_test/src/test_server_internal.hrl
+++ b/lib/common_test/src/test_server_internal.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/test_server_io.erl b/lib/common_test/src/test_server_io.erl
index 0d881d0ada..8c5c0aef35 100644
--- a/lib/common_test/src/test_server_io.erl
+++ b/lib/common_test/src/test_server_io.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/test_server_sup.erl b/lib/common_test/src/test_server_sup.erl
index c4530ba62f..fa2bb33c2d 100644
--- a/lib/common_test/src/test_server_sup.erl
+++ b/lib/common_test/src/test_server_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/src/unix_telnet.erl b/lib/common_test/src/unix_telnet.erl
index e5b3058999..4897ddb2f8 100644
--- a/lib/common_test/src/unix_telnet.erl
+++ b/lib/common_test/src/unix_telnet.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -27,7 +27,8 @@
%%% {port,PortNum}, % optional
%%% {username,UserName},
%%% {password,Password},
-%%% {keep_alive,Bool}]}. % optional</pre>
+%%% {keep_alive,Bool}, % optional
+%%% {tcp_nodely,Bool}]} % optional</pre>
%%%
%%% <p>To communicate via telnet to the host specified by
%%% <code>HostNameOrIpAddress</code>, use the interface functions in
@@ -55,7 +56,7 @@
-compile(export_all).
%% Callbacks for ct_telnet.erl
--export([connect/6,get_prompt_regexp/0]).
+-export([connect/7,get_prompt_regexp/0]).
-import(ct_telnet,[start_gen_log/1,log/4,end_gen_log/0]).
-define(username,"login: ").
@@ -82,6 +83,7 @@ get_prompt_regexp() ->
%%% Port = integer()
%%% Timeout = integer()
%%% KeepAlive = bool()
+%%% TCPNoDelay = bool()
%%% Extra = ct:target_name() | {Username,Password}
%%% Username = string()
%%% Password = string()
@@ -91,25 +93,25 @@ get_prompt_regexp() ->
%%% @doc Callback for ct_telnet.erl.
%%%
%%% <p>Setup telnet connection to a unix host.</p>
-connect(ConnName,Ip,Port,Timeout,KeepAlive,Extra) ->
+connect(ConnName,Ip,Port,Timeout,KeepAlive,TCPNoDelay,Extra) ->
case Extra of
{Username,Password} ->
- connect1(ConnName,Ip,Port,Timeout,KeepAlive,
+ connect1(ConnName,Ip,Port,Timeout,KeepAlive,TCPNoDelay,
Username,Password);
KeyOrName ->
case get_username_and_password(KeyOrName) of
{ok,{Username,Password}} ->
- connect1(ConnName,Ip,Port,Timeout,KeepAlive,
+ connect1(ConnName,Ip,Port,Timeout,KeepAlive,TCPNoDelay,
Username,Password);
Error ->
Error
end
end.
-connect1(Name,Ip,Port,Timeout,KeepAlive,Username,Password) ->
+connect1(Name,Ip,Port,Timeout,KeepAlive,TCPNoDelay,Username,Password) ->
start_gen_log("unix_telnet connect"),
Result =
- case ct_telnet_client:open(Ip,Port,Timeout,KeepAlive,Name) of
+ case ct_telnet_client:open(Ip,Port,Timeout,KeepAlive,TCPNoDelay,Name) of
{ok,Pid} ->
case ct_telnet:silent_teln_expect(Name,Pid,[],
[prompt],?prx,[]) of
diff --git a/lib/common_test/src/vts.erl b/lib/common_test/src/vts.erl
index df434d62c8..e1c16fbda4 100644
--- a/lib/common_test/src/vts.erl
+++ b/lib/common_test/src/vts.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/Makefile b/lib/common_test/test/Makefile
index fd96d06aab..1532b6c1f7 100644
--- a/lib/common_test/test/Makefile
+++ b/lib/common_test/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2014. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_auto_compile_SUITE.erl b/lib/common_test/test/ct_auto_compile_SUITE.erl
index f00bd46d6f..e6939d23c0 100644
--- a/lib/common_test/test/ct_auto_compile_SUITE.erl
+++ b/lib/common_test/test/ct_auto_compile_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_auto_compile_SUITE_data/bad_SUITE.erl b/lib/common_test/test/ct_auto_compile_SUITE_data/bad_SUITE.erl
index ebeb4a51f6..64ec7dace5 100644
--- a/lib/common_test/test/ct_auto_compile_SUITE_data/bad_SUITE.erl
+++ b/lib/common_test/test/ct_auto_compile_SUITE_data/bad_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_auto_compile_SUITE_data/dummy_SUITE.erl b/lib/common_test/test/ct_auto_compile_SUITE_data/dummy_SUITE.erl
index 935fe1929f..7ce792777f 100644
--- a/lib/common_test/test/ct_auto_compile_SUITE_data/dummy_SUITE.erl
+++ b/lib/common_test/test/ct_auto_compile_SUITE_data/dummy_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_basic_html_SUITE.erl b/lib/common_test/test/ct_basic_html_SUITE.erl
index e8aae9f12a..c6529f6657 100644
--- a/lib/common_test/test/ct_basic_html_SUITE.erl
+++ b/lib/common_test/test/ct_basic_html_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_basic_html_SUITE_data/babbling_SUITE.erl b/lib/common_test/test/ct_basic_html_SUITE_data/babbling_SUITE.erl
index ae408e4ace..c72040d292 100644
--- a/lib/common_test/test/ct_basic_html_SUITE_data/babbling_SUITE.erl
+++ b/lib/common_test/test/ct_basic_html_SUITE_data/babbling_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_config_SUITE.erl b/lib/common_test/test/ct_config_SUITE.erl
index 9de135d786..9879e0f20d 100644
--- a/lib/common_test/test/ct_config_SUITE.erl
+++ b/lib/common_test/test/ct_config_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_config_SUITE_data/config/test/config_driver.erl b/lib/common_test/test/ct_config_SUITE_data/config/test/config_driver.erl
index 98b32ece1f..f817f60172 100644
--- a/lib/common_test/test/ct_config_SUITE_data/config/test/config_driver.erl
+++ b/lib/common_test/test/ct_config_SUITE_data/config/test/config_driver.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_config_SUITE_data/config/test/config_dynamic_SUITE.erl b/lib/common_test/test/ct_config_SUITE_data/config/test/config_dynamic_SUITE.erl
index e4a839d9f5..c64774cd4f 100644
--- a/lib/common_test/test/ct_config_SUITE_data/config/test/config_dynamic_SUITE.erl
+++ b/lib/common_test/test/ct_config_SUITE_data/config/test/config_dynamic_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_config_SUITE_data/config/test/config_server.erl b/lib/common_test/test/ct_config_SUITE_data/config/test/config_server.erl
index 2061ec8d40..d795636606 100644
--- a/lib/common_test/test/ct_config_SUITE_data/config/test/config_server.erl
+++ b/lib/common_test/test/ct_config_SUITE_data/config/test/config_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_config_SUITE_data/config/test/config_static_SUITE.erl b/lib/common_test/test/ct_config_SUITE_data/config/test/config_static_SUITE.erl
index 5e06072bcc..5ebe75e501 100644
--- a/lib/common_test/test/ct_config_SUITE_data/config/test/config_static_SUITE.erl
+++ b/lib/common_test/test/ct_config_SUITE_data/config/test/config_static_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_config_info_SUITE.erl b/lib/common_test/test/ct_config_info_SUITE.erl
index 8ce9d9f16e..1389cd77ba 100644
--- a/lib/common_test/test/ct_config_info_SUITE.erl
+++ b/lib/common_test/test/ct_config_info_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_config_info_SUITE_data/config_info_1_SUITE.erl b/lib/common_test/test/ct_config_info_SUITE_data/config_info_1_SUITE.erl
index ea0e463ea6..ab88194e48 100644
--- a/lib/common_test/test/ct_config_info_SUITE_data/config_info_1_SUITE.erl
+++ b/lib/common_test/test/ct_config_info_SUITE_data/config_info_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_cover_SUITE.erl b/lib/common_test/test/ct_cover_SUITE.erl
index fcd9b15b4b..8c1bf4fe43 100644
--- a/lib/common_test/test/ct_cover_SUITE.erl
+++ b/lib/common_test/test/ct_cover_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_cover_SUITE_data/cover_SUITE.erl b/lib/common_test/test/ct_cover_SUITE_data/cover_SUITE.erl
index bfcc914d8c..4e013b8056 100644
--- a/lib/common_test/test/ct_cover_SUITE_data/cover_SUITE.erl
+++ b/lib/common_test/test/ct_cover_SUITE_data/cover_SUITE.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_cover_nomerge_SUITE.erl b/lib/common_test/test/ct_cover_nomerge_SUITE.erl
index 5ee1eee5a0..918fcc6c0b 100644
--- a/lib/common_test/test/ct_cover_nomerge_SUITE.erl
+++ b/lib/common_test/test/ct_cover_nomerge_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_cover_nomerge_SUITE_data/cover_nomerge_local_SUITE.erl b/lib/common_test/test/ct_cover_nomerge_SUITE_data/cover_nomerge_local_SUITE.erl
index dac039a0b0..10bb912539 100644
--- a/lib/common_test/test/ct_cover_nomerge_SUITE_data/cover_nomerge_local_SUITE.erl
+++ b/lib/common_test/test/ct_cover_nomerge_SUITE_data/cover_nomerge_local_SUITE.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_cover_nomerge_SUITE_data/cover_nomerge_remote_SUITE.erl b/lib/common_test/test/ct_cover_nomerge_SUITE_data/cover_nomerge_remote_SUITE.erl
index e52a38c6c8..87759638bf 100644
--- a/lib/common_test/test/ct_cover_nomerge_SUITE_data/cover_nomerge_remote_SUITE.erl
+++ b/lib/common_test/test/ct_cover_nomerge_SUITE_data/cover_nomerge_remote_SUITE.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_cover_nomerge_SUITE_data/cover_nomerge_remote_nostop_SUITE.erl b/lib/common_test/test/ct_cover_nomerge_SUITE_data/cover_nomerge_remote_nostop_SUITE.erl
index 7e0674f889..29776324af 100644
--- a/lib/common_test/test/ct_cover_nomerge_SUITE_data/cover_nomerge_remote_nostop_SUITE.erl
+++ b/lib/common_test/test/ct_cover_nomerge_SUITE_data/cover_nomerge_remote_nostop_SUITE.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE.erl b/lib/common_test/test/ct_error_SUITE.erl
index 53cfbd7118..fae23484e6 100644
--- a/lib/common_test/test/ct_error_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_10_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_10_SUITE.erl
index 27cd3ecf3c..bcbbd5f04f 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_10_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_10_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_11_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_11_SUITE.erl
index 611ce95b48..97ca442220 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_11_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_11_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_12_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_12_SUITE.erl
index 1f2e06de9d..3677c5384a 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_12_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_12_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_13_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_13_SUITE.erl
index 4f9d3017b5..b4722b8805 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_13_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_13_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_14_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_14_SUITE.erl
index d8ffd029e3..a0bfed8c35 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_14_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_14_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_1_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_1_SUITE.erl
index ae9edb540d..dfe5597386 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_1_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_2_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_2_SUITE.erl
index 2b31ac7eff..abcccca25c 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_2_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_2_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_3_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_3_SUITE.erl
index 884395bfde..bb4a205d0d 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_3_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_3_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_4_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_4_SUITE.erl
index cde1571a3c..69aab90f11 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_4_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_4_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_5_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_5_SUITE.erl
index 5fce02aaf8..22dfd2886f 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_5_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_5_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_6_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_6_SUITE.erl
index becc723c75..43da1b8273 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_6_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_6_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_7_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_7_SUITE.erl
index 3c4c103fac..c91082361b 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_7_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_7_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_8_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_8_SUITE.erl
index 1b98f289a1..591766ef42 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_8_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_8_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_9_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_9_SUITE.erl
index e983c0c7b1..8e53e8a299 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_9_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/cfg_error_9_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/config_func_error_1_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/config_func_error_1_SUITE.erl
index ec331d3444..e211a55b17 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/config_func_error_1_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/config_func_error_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/config_restored_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/config_restored_SUITE.erl
index 366e3d2724..f1fc6445b4 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/config_restored_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/config_restored_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/lib_error_1_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/lib_error_1_SUITE.erl
index 6f1b391ae6..029796b89b 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/lib_error_1_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/lib_error_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/misc_error_1_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/misc_error_1_SUITE.erl
index 8ba6844b27..5e9ff79097 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/misc_error_1_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/misc_error_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/no_compile_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/no_compile_SUITE.erl
index 99f8a68517..87523a932d 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/no_compile_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/no_compile_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_1_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_1_SUITE.erl
index 59a319503d..8e8f13f20b 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_1_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_2_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_2_SUITE.erl
index 759b050b31..21a02a7330 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_2_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_2_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_3_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_3_SUITE.erl
index fc4fa5b2d4..9ccd0fbd44 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_3_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_3_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_4_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_4_SUITE.erl
index b7b662cec6..e010b79c6c 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_4_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_4_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_5_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_5_SUITE.erl
index ce524a706c..d2da126360 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_5_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_5_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_6_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_6_SUITE.erl
index d67cd00318..932ce8f798 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_6_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_6_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_7_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_7_SUITE.erl
index 4701c66702..f5a69c1197 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_7_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_7_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_8_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_8_SUITE.erl
index df0ce55d7b..eb5df8c45d 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_8_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_8_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_utils.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_utils.erl
index 2e06cd7ecf..60a21fcd40 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_utils.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_utils.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/verify_config.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/verify_config.erl
index b3e07288dc..530ee09654 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/verify_config.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/verify_config.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_event_handler_SUITE.erl b/lib/common_test/test/ct_event_handler_SUITE.erl
index 683bbf4ea6..26b382e55d 100644
--- a/lib/common_test/test/ct_event_handler_SUITE.erl
+++ b/lib/common_test/test/ct_event_handler_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_event_handler_SUITE_data/eh_A.erl b/lib/common_test/test/ct_event_handler_SUITE_data/eh_A.erl
index 29c25bf151..07b21b4178 100644
--- a/lib/common_test/test/ct_event_handler_SUITE_data/eh_A.erl
+++ b/lib/common_test/test/ct_event_handler_SUITE_data/eh_A.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_event_handler_SUITE_data/event_handling_1/test/eh_11_SUITE.erl b/lib/common_test/test/ct_event_handler_SUITE_data/event_handling_1/test/eh_11_SUITE.erl
index af88e6775a..9f58bb8369 100644
--- a/lib/common_test/test/ct_event_handler_SUITE_data/event_handling_1/test/eh_11_SUITE.erl
+++ b/lib/common_test/test/ct_event_handler_SUITE_data/event_handling_1/test/eh_11_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_gen_conn_SUITE.erl b/lib/common_test/test/ct_gen_conn_SUITE.erl
index 82f68239d7..27795c7138 100644
--- a/lib/common_test/test/ct_gen_conn_SUITE.erl
+++ b/lib/common_test/test/ct_gen_conn_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_gen_conn_SUITE_data/conn_SUITE.erl b/lib/common_test/test/ct_gen_conn_SUITE_data/conn_SUITE.erl
index 3d122f1de5..1404df6410 100644
--- a/lib/common_test/test/ct_gen_conn_SUITE_data/conn_SUITE.erl
+++ b/lib/common_test/test/ct_gen_conn_SUITE_data/conn_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_gen_conn_SUITE_data/proto.erl b/lib/common_test/test/ct_gen_conn_SUITE_data/proto.erl
index a466891f81..dd754b73e4 100644
--- a/lib/common_test/test/ct_gen_conn_SUITE_data/proto.erl
+++ b/lib/common_test/test/ct_gen_conn_SUITE_data/proto.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_group_info_SUITE.erl b/lib/common_test/test/ct_group_info_SUITE.erl
index 1c73f3244b..044fc441b3 100644
--- a/lib/common_test/test/ct_group_info_SUITE.erl
+++ b/lib/common_test/test/ct_group_info_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_group_info_SUITE_data/group_require_1_SUITE.erl b/lib/common_test/test/ct_group_info_SUITE_data/group_require_1_SUITE.erl
index 50d06cd245..57a4af47c4 100644
--- a/lib/common_test/test/ct_group_info_SUITE_data/group_require_1_SUITE.erl
+++ b/lib/common_test/test/ct_group_info_SUITE_data/group_require_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_group_info_SUITE_data/group_require_2_SUITE.erl b/lib/common_test/test/ct_group_info_SUITE_data/group_require_2_SUITE.erl
index 4d06ff63b2..514ce7d1b5 100644
--- a/lib/common_test/test/ct_group_info_SUITE_data/group_require_2_SUITE.erl
+++ b/lib/common_test/test/ct_group_info_SUITE_data/group_require_2_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_group_info_SUITE_data/group_require_3_SUITE.erl b/lib/common_test/test/ct_group_info_SUITE_data/group_require_3_SUITE.erl
index a4069e9ff4..88818b8a00 100644
--- a/lib/common_test/test/ct_group_info_SUITE_data/group_require_3_SUITE.erl
+++ b/lib/common_test/test/ct_group_info_SUITE_data/group_require_3_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_1_SUITE.erl b/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_1_SUITE.erl
index 888477605f..4b5889ef5c 100644
--- a/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_1_SUITE.erl
+++ b/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_2_SUITE.erl b/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_2_SUITE.erl
index ea1ac39817..3acba27b81 100644
--- a/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_2_SUITE.erl
+++ b/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_2_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_3_SUITE.erl b/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_3_SUITE.erl
index 974a34ef62..e86058d68c 100644
--- a/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_3_SUITE.erl
+++ b/lib/common_test/test/ct_group_info_SUITE_data/group_timetrap_3_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_group_leader_SUITE.erl b/lib/common_test/test/ct_group_leader_SUITE.erl
index 3b9f73bb28..a8108bc183 100644
--- a/lib/common_test/test/ct_group_leader_SUITE.erl
+++ b/lib/common_test/test/ct_group_leader_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_group_leader_SUITE_data/group_leader_SUITE.erl b/lib/common_test/test/ct_group_leader_SUITE_data/group_leader_SUITE.erl
index af9fa31926..4bed60e895 100644
--- a/lib/common_test/test/ct_group_leader_SUITE_data/group_leader_SUITE.erl
+++ b/lib/common_test/test/ct_group_leader_SUITE_data/group_leader_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_groups_search_SUITE.erl b/lib/common_test/test/ct_groups_search_SUITE.erl
index ac1659e3c5..13742c11b1 100644
--- a/lib/common_test/test/ct_groups_search_SUITE.erl
+++ b/lib/common_test/test/ct_groups_search_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_groups_search_SUITE_data/groups_search_dummy_1_SUITE.erl b/lib/common_test/test/ct_groups_search_SUITE_data/groups_search_dummy_1_SUITE.erl
index 27291e7269..8dc0802ed6 100644
--- a/lib/common_test/test/ct_groups_search_SUITE_data/groups_search_dummy_1_SUITE.erl
+++ b/lib/common_test/test/ct_groups_search_SUITE_data/groups_search_dummy_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_groups_search_SUITE_data/groups_search_dummy_2_SUITE.erl b/lib/common_test/test/ct_groups_search_SUITE_data/groups_search_dummy_2_SUITE.erl
index 7e3886b665..8c33125d7b 100644
--- a/lib/common_test/test/ct_groups_search_SUITE_data/groups_search_dummy_2_SUITE.erl
+++ b/lib/common_test/test/ct_groups_search_SUITE_data/groups_search_dummy_2_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_groups_spec_SUITE.erl b/lib/common_test/test/ct_groups_spec_SUITE.erl
index 363a3c6bf0..44c6e433dc 100644
--- a/lib/common_test/test/ct_groups_spec_SUITE.erl
+++ b/lib/common_test/test/ct_groups_spec_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_groups_spec_SUITE_data/groups_spec_1_SUITE.erl b/lib/common_test/test/ct_groups_spec_SUITE_data/groups_spec_1_SUITE.erl
index 909e203099..bef50a4141 100644
--- a/lib/common_test/test/ct_groups_spec_SUITE_data/groups_spec_1_SUITE.erl
+++ b/lib/common_test/test/ct_groups_spec_SUITE_data/groups_spec_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_groups_test_1_SUITE.erl b/lib/common_test/test/ct_groups_test_1_SUITE.erl
index 143fe3e354..a0139462f1 100644
--- a/lib/common_test/test/ct_groups_test_1_SUITE.erl
+++ b/lib/common_test/test/ct_groups_test_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
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 889d44c33a..e211351dcf 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
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_groups_test_1_SUITE_data/groups_1/test/groups_12_SUITE.erl b/lib/common_test/test/ct_groups_test_1_SUITE_data/groups_1/test/groups_12_SUITE.erl
index 2e2385b21a..61210eca7f 100644
--- a/lib/common_test/test/ct_groups_test_1_SUITE_data/groups_1/test/groups_12_SUITE.erl
+++ b/lib/common_test/test/ct_groups_test_1_SUITE_data/groups_1/test/groups_12_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_groups_test_1_SUITE_data/groups_2/test/groups_21_SUITE.erl b/lib/common_test/test/ct_groups_test_1_SUITE_data/groups_2/test/groups_21_SUITE.erl
index 039517227f..b849df678b 100644
--- a/lib/common_test/test/ct_groups_test_1_SUITE_data/groups_2/test/groups_21_SUITE.erl
+++ b/lib/common_test/test/ct_groups_test_1_SUITE_data/groups_2/test/groups_21_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_groups_test_1_SUITE_data/groups_2/test/groups_22_SUITE.erl b/lib/common_test/test/ct_groups_test_1_SUITE_data/groups_2/test/groups_22_SUITE.erl
index 596ae25f05..4731bb738f 100644
--- a/lib/common_test/test/ct_groups_test_1_SUITE_data/groups_2/test/groups_22_SUITE.erl
+++ b/lib/common_test/test/ct_groups_test_1_SUITE_data/groups_2/test/groups_22_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
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 d8075ffc97..cbc8491b37 100644
--- a/lib/common_test/test/ct_groups_test_2_SUITE.erl
+++ b/lib/common_test/test/ct_groups_test_2_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_groups_test_2_SUITE_data/groups_1/missing_conf_SUITE.erl b/lib/common_test/test/ct_groups_test_2_SUITE_data/groups_1/missing_conf_SUITE.erl
index e50e131248..4d868ef6e2 100644
--- a/lib/common_test/test/ct_groups_test_2_SUITE_data/groups_1/missing_conf_SUITE.erl
+++ b/lib/common_test/test/ct_groups_test_2_SUITE_data/groups_1/missing_conf_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_groups_test_2_SUITE_data/groups_1/repeat_1_SUITE.erl b/lib/common_test/test/ct_groups_test_2_SUITE_data/groups_1/repeat_1_SUITE.erl
index 2b9ef5a357..7f6346bc80 100644
--- a/lib/common_test/test/ct_groups_test_2_SUITE_data/groups_1/repeat_1_SUITE.erl
+++ b/lib/common_test/test/ct_groups_test_2_SUITE_data/groups_1/repeat_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_groups_test_2_SUITE_data/groups_2/groups_21_SUITE.erl b/lib/common_test/test/ct_groups_test_2_SUITE_data/groups_2/groups_21_SUITE.erl
index 0138310c36..e99ba8c570 100644
--- a/lib/common_test/test/ct_groups_test_2_SUITE_data/groups_2/groups_21_SUITE.erl
+++ b/lib/common_test/test/ct_groups_test_2_SUITE_data/groups_2/groups_21_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_groups_test_2_SUITE_data/groups_2/groups_22_SUITE.erl b/lib/common_test/test/ct_groups_test_2_SUITE_data/groups_2/groups_22_SUITE.erl
index ea3db09d9e..934f76c4cf 100644
--- a/lib/common_test/test/ct_groups_test_2_SUITE_data/groups_2/groups_22_SUITE.erl
+++ b/lib/common_test/test/ct_groups_test_2_SUITE_data/groups_2/groups_22_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE.erl
index 5ec88b438e..690d0af1bb 100644
--- a/lib/common_test/test/ct_hooks_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_id_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_id_cth.erl
index c7cda285be..5f8656e991 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_id_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_id_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_init_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_init_cth.erl
index 023f6440c2..ea6ee32cfd 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_init_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_init_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_empty_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_empty_SUITE.erl
index c443700dde..efa8b538c1 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_empty_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_empty_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_one_skip_one_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_one_skip_one_SUITE.erl
index 1761b6f8ed..5a23bd9dcb 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_one_skip_one_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_one_skip_one_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_per_suite_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_per_suite_SUITE.erl
index 09cd89a217..64121c3f80 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_per_suite_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_per_suite_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_prio_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_prio_SUITE.erl
index 3569f378c6..0de27621bb 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_prio_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_prio_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_data_dir_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_data_dir_SUITE.erl
index f6b1eab9b6..3fbc536de9 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_data_dir_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_data_dir_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_exit_in_init_scope_suite_cth_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_exit_in_init_scope_suite_cth_SUITE.erl
index 480cd32cb8..749d7a93db 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_exit_in_init_scope_suite_cth_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_exit_in_init_scope_suite_cth_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_no_config_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_no_config_SUITE.erl
index 24f1122e56..ee8f1148a8 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_no_config_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_no_config_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_cth_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_cth_SUITE.erl
index 1800751d71..464fab87cd 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_cth_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_cth_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_state_cth_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_state_cth_SUITE.erl
index ead7e42133..bfdbb4a993 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_state_cth_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_state_cth_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_cth_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_cth_SUITE.erl
index 1eef06419a..26fc2e79c6 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_cth_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_cth_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_state_cth_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_state_cth_SUITE.erl
index a0336be61c..9b7b922cc2 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_state_cth_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_state_cth_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_tc_cth_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_tc_cth_SUITE.erl
index 71a0db3e3f..d400348354 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_tc_cth_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_tc_cth_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_crash_in_cth_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_crash_in_cth_SUITE.erl
index 25523e06f4..d7eadaf356 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_crash_in_cth_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_crash_in_cth_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_cth_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_cth_SUITE.erl
index 33dbac2ed1..8632166a00 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_cth_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_cth_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_state_cth_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_state_cth_SUITE.erl
index 06b256a77d..cec4b2d5b8 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_state_cth_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_state_cth_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_update_config_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_update_config_SUITE.erl
index 9a924a66ac..20f139bcc8 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_update_config_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_update_config_SUITE.erl
@@ -1,8 +1,8 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
-%%
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,46 +14,46 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
-
--module(ct_update_config_SUITE).
-
--suite_defaults([{timetrap, {minutes, 10}}]).
-
-%% Note: This directive should only be used in test suites.
--compile(export_all).
-
--include("ct.hrl").
-
--define(now, os:timestamp()).
-
-%% Test server callback functions
-init_per_suite(Config) ->
- [{init_per_suite,?now}|Config].
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_testcase(_TestCase, Config) ->
- [{init_per_testcase,?now}|Config].
-
-end_per_testcase(_TestCase, _Config) ->
- ok.
-
-init_per_group(GroupName, Config) ->
- [{init_per_group,?now}|Config].
-
-end_per_group(GroupName, Config) ->
- ok.
-
-all() ->
- [{group,group1}].
-
-groups() ->
- [{group1,[],[test_case]}].
-
-%% Test cases starts here.
-test_case(Config) when is_list(Config) ->
- ok.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(ct_update_config_SUITE).
+
+-suite_defaults([{timetrap, {minutes, 10}}]).
+
+%% Note: This directive should only be used in test suites.
+-compile(export_all).
+
+-include("ct.hrl").
+
+-define(now, ct_test_support:unique_timestamp()).
+
+%% Test server callback functions
+init_per_suite(Config) ->
+ [{init_per_suite,?now}|Config].
+
+end_per_suite(_Config) ->
+ ok.
+
+init_per_testcase(_TestCase, Config) ->
+ [{init_per_testcase,?now}|Config].
+
+end_per_testcase(_TestCase, _Config) ->
+ ok.
+
+init_per_group(GroupName, Config) ->
+ [{init_per_group,?now}|Config].
+
+end_per_group(GroupName, Config) ->
+ ok.
+
+all() ->
+ [{group,group1}].
+
+groups() ->
+ [{group1,[],[test_case]}].
+
+%% Test cases starts here.
+test_case(Config) when is_list(Config) ->
+ ok.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/cth_log_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/cth_log_SUITE.erl
index dbbee365dc..7b9b5687e5 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/cth_log_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/cth_log_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl
index e5bb4f3ef6..c00eb5cf93 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -90,7 +90,7 @@ id(Opts) ->
gen_event:notify(?CT_EVMGR_REF, #event{ name = cth, node = node(),
data = {?MODULE, id, [Opts]}}),
ct:log("~w:id called", [?MODULE]),
- os:timestamp().
+ ct_test_support:unique_timestamp().
%% @doc Called before init_per_suite is called. Note that this callback is
%% only called if the CTH is added before init_per_suite is run (eg. in a test
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_post_suite_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_post_suite_cth.erl
index dc5806d23d..559b22bc9f 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_post_suite_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_post_suite_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_pre_suite_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_pre_suite_cth.erl
index a79f4d4541..51202443bf 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_pre_suite_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_pre_suite_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/id_no_init_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/id_no_init_cth.erl
index 8e39123fc1..b9dc2dfb09 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/id_no_init_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/id_no_init_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_cth.erl
index a084423cf3..3625c204f3 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_terminate_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_terminate_cth.erl
index 7895c43aeb..b49cbe7fb4 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_terminate_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_terminate_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/prio_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/prio_cth.erl
index 72d6d186ed..a687743641 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/prio_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/prio_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/recover_post_suite_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/recover_post_suite_cth.erl
index cf484d3cd7..4d9c60f1ca 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/recover_post_suite_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/recover_post_suite_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/same_id_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/same_id_cth.erl
index 60615d97fc..494f398fc1 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/same_id_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/same_id_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_post_suite_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_post_suite_cth.erl
index 56163e730c..d5b347e723 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_post_suite_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_post_suite_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_end_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_end_cth.erl
index deb622b316..36abac0bf8 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_end_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_end_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_suite_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_suite_cth.erl
index ea1d485700..fa510b2d54 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_suite_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_suite_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/state_update_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/state_update_cth.erl
index c2135bbbee..7ec0d458b6 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/state_update_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/state_update_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/undef_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/undef_cth.erl
index 5ac4bdddf8..2b9e726819 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/undef_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/undef_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl
index 5503bf85ae..d48981f667 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
-include_lib("common_test/src/ct_util.hrl").
-include_lib("common_test/include/ct_event.hrl").
--define(now, os:timestamp()).
+-define(now, ct_test_support:unique_timestamp()).
%% CT Hooks
-compile(export_all).
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_config_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_config_cth.erl
index 1df212f266..71d84781e0 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_config_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_config_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_data_dir_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_data_dir_cth.erl
index 7abcea4393..9abd2e5e83 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_data_dir_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_data_dir_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_master_SUITE.erl b/lib/common_test/test/ct_master_SUITE.erl
index 55837352e2..0ec549c4bc 100644
--- a/lib/common_test/test/ct_master_SUITE.erl
+++ b/lib/common_test/test/ct_master_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_master_SUITE_data/master/master_SUITE.erl b/lib/common_test/test/ct_master_SUITE_data/master/master_SUITE.erl
index e16d629ecc..d94ead4b62 100644
--- a/lib/common_test/test/ct_master_SUITE_data/master/master_SUITE.erl
+++ b/lib/common_test/test/ct_master_SUITE_data/master/master_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_misc_1_SUITE.erl b/lib/common_test/test/ct_misc_1_SUITE.erl
index a562719296..4c3d279a82 100644
--- a/lib/common_test/test/ct_misc_1_SUITE.erl
+++ b/lib/common_test/test/ct_misc_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_misc_1_SUITE_data/beam_1_SUITE.erl b/lib/common_test/test/ct_misc_1_SUITE_data/beam_1_SUITE.erl
index ef1defe6ef..1f1e287ddc 100644
--- a/lib/common_test/test/ct_misc_1_SUITE_data/beam_1_SUITE.erl
+++ b/lib/common_test/test/ct_misc_1_SUITE_data/beam_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_misc_1_SUITE_data/beam_2_SUITE.erl b/lib/common_test/test/ct_misc_1_SUITE_data/beam_2_SUITE.erl
index 50b2f3ed10..6b5036081e 100644
--- a/lib/common_test/test/ct_misc_1_SUITE_data/beam_2_SUITE.erl
+++ b/lib/common_test/test/ct_misc_1_SUITE_data/beam_2_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_netconfc_SUITE.erl b/lib/common_test/test/ct_netconfc_SUITE.erl
index af215b72b7..03fbc17bd2 100644
--- a/lib/common_test/test/ct_netconfc_SUITE.erl
+++ b/lib/common_test/test/ct_netconfc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -48,7 +48,12 @@ init_per_suite(Config) ->
{error,Reason} when Reason=/={already_loaded,crypto} ->
{skip, Reason};
_ ->
- ct_test_support:init_per_suite(Config)
+ case application:load(ssh) of
+ {error,Reason} when Reason=/={already_loaded,ssh} ->
+ {skip, Reason};
+ _ ->
+ ct_test_support:init_per_suite(Config)
+ end
end.
end_per_suite(Config) ->
diff --git a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl
index 9d4c798795..065639dd36 100644
--- a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl
+++ b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -123,15 +123,21 @@ init_per_testcase(_Case, Config) ->
end_per_testcase(_Case, _Config) ->
ok.
+init_per_suite() ->
+ [{timetrap,2*?default_timeout}]. % making dsa files can be slow
init_per_suite(Config) ->
- case catch {crypto:start(), ssh:start()} of
- {ok, ok} ->
+ case catch ssh:start() of
+ Ok when Ok==ok; Ok=={error,{already_started,ssh}} ->
+ ct:log("ssh started",[]),
{ok, _} = netconfc_test_lib:get_id_keys(Config),
netconfc_test_lib:make_dsa_files(Config),
+ ct:log("dsa files created",[]),
Server = ?NS:start(?config(data_dir,Config)),
+ ct:log("netconf server started",[]),
[{server,Server}|Config];
- _ ->
- {skip, "Crypto and/or SSH could not be started!"}
+ Other ->
+ ct:log("could not start ssh: ~p",[Other]),
+ {skip, "SSH could not be started!"}
end.
end_per_suite(Config) ->
@@ -806,7 +812,7 @@ close_while_waiting_for_chunked_data(Config) ->
%% Order server to expect a get - then the process above will make
%% sure the rpc-reply is sent - but only a part of it - then close.
?NS:expect('get'),
- {error,closed} = ct_netconfc:get(Client,{server,[{xmlns,"myns"}],[]},2000),
+ {error,closed} = ct_netconfc:get(Client,{server,[{xmlns,"myns"}],[]},4000),
ok.
connection_crash(Config) ->
diff --git a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc_remote_SUITE.erl b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc_remote_SUITE.erl
index 152d5c7cae..04bfe75187 100644
--- a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc_remote_SUITE.erl
+++ b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc_remote_SUITE.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -26,7 +26,8 @@
-compile(export_all).
suite() ->
- [{ct_hooks, [{cth_conn_log,[{ct_netconfc,[{log_type,html}]}]}]}].
+ [{timetrap,?default_timeout},
+ {ct_hooks, [{cth_conn_log,[{ct_netconfc,[{log_type,html}]}]}]}].
all() ->
case os:find_executable("ssh") of
@@ -48,13 +49,10 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(Case, Config) ->
stop_node(Case),
- Dog = test_server:timetrap(?default_timeout),
- [{watchdog, Dog}|Config].
+ Config.
end_per_testcase(Case, Config) ->
stop_node(Case),
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
ok.
stop_node(Case) ->
@@ -63,14 +61,19 @@ stop_node(Case) ->
rpc:call(Node,erlang,halt,[]).
+init_per_suite() ->
+ [{timetrap,2*?default_timeout}]. % making dsa files can be slow
init_per_suite(Config) ->
- case {crypto:start(),ssh:start()} of
- {ok,ok} ->
+ case ssh:start() of
+ Ok when Ok==ok; Ok=={error,{already_started,ssh}} ->
+ ct:log("SSH started locally",[]),
{ok, _} = netconfc_test_lib:get_id_keys(Config),
netconfc_test_lib:make_dsa_files(Config),
+ ct:log("dsa files created",[]),
Config;
- _ ->
- {skip, "Crypto and/or SSH could not be started locally!"}
+ Other ->
+ ct:log("could not start ssh locally: ~p",[Other]),
+ {skip, "SSH could not be started locally!"}
end.
end_per_suite(Config) ->
@@ -87,12 +90,15 @@ remote_crash(Config) ->
Pa = filename:dirname(code:which(?NS)),
true = rpc:call(Node,code,add_patha,[Pa]),
- case {rpc:call(Node,crypto,start,[]),rpc:call(Node,ssh,start,[])} of
- {ok,ok} ->
+ case rpc:call(Node,ssh,start,[]) of
+ Ok when Ok==ok; Ok=={error,{already_started,ssh}} ->
+ ct:log("SSH started remote",[]),
Server = rpc:call(Node,?NS,start,[?config(data_dir,Config)]),
+ ct:log("netconf server started remote",[]),
remote_crash(Node,Config);
- _ ->
- {skip, "Crypto and/or SSH could not be started remote!"}
+ Other ->
+ ct:log("could not start ssh remote: ~p",[Other]),
+ {skip, "SSH could not be started remote!"}
end.
remote_crash(Node,Config) ->
diff --git a/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl b/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl
index 67827a053f..9fb1fb6547 100644
--- a/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl
+++ b/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_pre_post_test_io_SUITE.erl b/lib/common_test/test/ct_pre_post_test_io_SUITE.erl
index 2994ce4a96..7ffe6f045b 100644
--- a/lib/common_test/test/ct_pre_post_test_io_SUITE.erl
+++ b/lib/common_test/test/ct_pre_post_test_io_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -44,13 +44,29 @@
%% instance, the tests need to be performed on a separate node (or
%% there will be clashes with logging processes etc).
%%--------------------------------------------------------------------
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{seconds,120}}].
+
+all() ->
+ [
+ pre_post_io
+ ].
+
init_per_suite(Config) ->
- DataDir = ?config(data_dir, Config),
- CTH = filename:join(DataDir, "cth_ctrl.erl"),
- ct:pal("Compiling ~p: ~p",
- [CTH,compile:file(CTH,[{outdir,DataDir},debug_info])]),
- ct_test_support:init_per_suite([{path_dirs,[DataDir]},
- {start_sasl,true} | Config]).
+ TTInfo = {_T,{_Scaled,ScaleVal}} = ct:get_timetrap_info(),
+ ct:pal("Timetrap info = ~w", [TTInfo]),
+ if ScaleVal > 1 ->
+ {skip,"Skip on systems running e.g. cover or debug!"};
+ ScaleVal =< 1 ->
+ DataDir = ?config(data_dir, Config),
+ CTH = filename:join(DataDir, "cth_ctrl.erl"),
+ ct:pal("Compiling ~p: ~p",
+ [CTH,compile:file(CTH,[{outdir,DataDir},
+ debug_info])]),
+ ct_test_support:init_per_suite([{path_dirs,[DataDir]},
+ {start_sasl,true} | Config])
+ end.
end_per_suite(Config) ->
ct_test_support:end_per_suite(Config).
@@ -61,13 +77,6 @@ init_per_testcase(TestCase, Config) ->
end_per_testcase(TestCase, Config) ->
ct_test_support:end_per_testcase(TestCase, Config).
-suite() -> [{ct_hooks,[ts_install_cth]}].
-
-all() ->
- [
- pre_post_io
- ].
-
%%--------------------------------------------------------------------
%% TEST CASES
%%--------------------------------------------------------------------
@@ -90,31 +99,50 @@ pre_post_io(Config) ->
%%!--------------------------------------------------------------------
spawn(fun() ->
- ct:pal("CONTROLLER: Started!", []),
+ ct:pal("CONTROLLER: Starting test run #1...", []),
%% --- test run 1 ---
- ct:sleep(3000),
- ct:pal("CONTROLLER: Handle remote events = true", []),
- ok = ct_test_support:ct_rpc({cth_log_redirect,
- handle_remote_events,
- [true]}, Config),
- ct:sleep(2000),
- ct:pal("CONTROLLER: Proceeding with test run #1!", []),
+ try_loop(ct_test_support, ct_rpc, [{cth_log_redirect,
+ handle_remote_events,
+ [true]}, Config], 3000),
+ CTLoggerPid1 = ct_test_support:ct_rpc({erlang,whereis,
+ [ct_logs]}, Config),
+ ct:pal("CONTROLLER: Logger = ~w~nHandle remote events = true",
+ [CTLoggerPid1]),
+ ct:sleep(5000),
+ ct:pal("CONTROLLER: Proceeding with test run #1...", []),
ok = ct_test_support:ct_rpc({cth_ctrl,proceed,[]}, Config),
ct:sleep(6000),
- ct:pal("CONTROLLER: Proceeding with shutdown #1!", []),
+ ct:pal("CONTROLLER: Proceeding with shutdown #1...", []),
ok = ct_test_support:ct_rpc({cth_ctrl,proceed,[]}, Config),
+ try_loop(fun() ->
+ false = ct_test_support:ct_rpc({erlang,
+ is_process_alive,
+ [CTLoggerPid1]},
+ Config)
+ end, 3000),
+ ct:pal("CONTROLLER: Shutdown #1 complete!", []),
+ ct:pal("CONTROLLER: Starting test run #2...", []),
%% --- test run 2 ---
- ct:sleep(3000),
- ct:pal("CONTROLLER: Handle remote events = true", []),
- ok = ct_test_support:ct_rpc({cth_log_redirect,
- handle_remote_events,
- [true]}, Config),
- ct:sleep(2000),
- ct:pal("CONTROLLER: Proceeding with test run #2!", []),
+ try_loop(ct_test_support, ct_rpc, [{cth_log_redirect,
+ handle_remote_events,
+ [true]}, Config], 3000),
+ CTLoggerPid2 = ct_test_support:ct_rpc({erlang,whereis,
+ [ct_logs]}, Config),
+ ct:pal("CONTROLLER: Logger = ~w~nHandle remote events = true",
+ [CTLoggerPid2]),
+ ct:sleep(5000),
+ ct:pal("CONTROLLER: Proceeding with test run #2...", []),
ok = ct_test_support:ct_rpc({cth_ctrl,proceed,[]}, Config),
ct:sleep(6000),
- ct:pal("CONTROLLER: Proceeding with shutdown #2!", []),
- ok = ct_test_support:ct_rpc({cth_ctrl,proceed,[]}, Config)
+ ct:pal("CONTROLLER: Proceeding with shutdown #2...", []),
+ ok = ct_test_support:ct_rpc({cth_ctrl,proceed,[]}, Config),
+ try_loop(fun() ->
+ false = ct_test_support:ct_rpc({erlang,
+ is_process_alive,
+ [CTLoggerPid2]},
+ Config)
+ end, 3000),
+ ct:pal("CONTROLLER: Shutdown #2 complete!", [])
end),
ct_test_support:run(Opts, Config),
Events = ct_test_support:get_events(ERPid, Config),
@@ -157,7 +185,7 @@ pre_post_io(Config) ->
Counters
end, {pre,0,0,0,0}, Ts),
[_|Counters] = tuple_to_list(PrePostIOEntries),
- ct:log("Entries in the Pre/Post Test IO Log: ~p", [Counters]),
+ ct:pal("Entries in the Pre/Post Test IO Log: ~w", [Counters]),
case [C || C <- Counters, C < 2] of
[] ->
ok;
@@ -183,7 +211,7 @@ pre_post_io(Config) ->
[LogN,ErrN+1];
(_, Counters) -> Counters
end, [0,0], Ts),
- ct:log("Entries in the Unexpected IO Log: ~p", [UnexpIOEntries]),
+ ct:log("Entries in the Unexpected IO Log: ~w", [UnexpIOEntries]),
case [N || N <- UnexpIOEntries, N < 2] of
[] ->
ok;
@@ -208,6 +236,38 @@ setup(Test, Config) ->
reformat(Events, EH) ->
ct_test_support:reformat(Events, EH).
+try_loop(_Fun, 0) ->
+ ct:pal("WARNING! Fun never succeeded!", []),
+ gave_up;
+try_loop(Fun, N) ->
+ try Fun() of
+ {error,_} ->
+ timer:sleep(10),
+ try_loop(Fun, N-1);
+ Result ->
+ Result
+ catch
+ _:_What ->
+ timer:sleep(10),
+ try_loop(Fun, N-1)
+ end.
+
+try_loop(M, F, _A, 0) ->
+ ct:pal("WARNING! ~w:~w never succeeded!", [M,F]),
+ gave_up;
+try_loop(M, F, A, N) ->
+ try apply(M, F, A) of
+ {error,_} ->
+ timer:sleep(10),
+ try_loop(M, F, A, N-1);
+ Result ->
+ Result
+ catch
+ _:_ ->
+ timer:sleep(10),
+ try_loop(M, F, A, N-1)
+ end.
+
%%%-----------------------------------------------------------------
%%% TEST EVENTS
%%%-----------------------------------------------------------------
diff --git a/lib/common_test/test/ct_pre_post_test_io_SUITE_data/cth_ctrl.erl b/lib/common_test/test/ct_pre_post_test_io_SUITE_data/cth_ctrl.erl
index b8595b40b9..347b507c78 100644
--- a/lib/common_test/test/ct_pre_post_test_io_SUITE_data/cth_ctrl.erl
+++ b/lib/common_test/test/ct_pre_post_test_io_SUITE_data/cth_ctrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -53,8 +53,7 @@ init(_Id, _Opts) ->
receive
{?MODULE,proceed} -> ok
after
- 10000 ->
- ok
+ 10000 -> ok
end,
{ok,[],ct_last}.
@@ -66,8 +65,7 @@ terminate(_State) ->
receive
{?MODULE,proceed} -> ok
after
- 10000 ->
- ok
+ 10000 -> ok
end,
stop_external_logger(cth_logger),
stop_dispatcher(),
@@ -94,7 +92,7 @@ init_logger(Name) ->
logger_loop(N) ->
ct:log("Logger iteration: ~p", [N]),
error_logger:error_report(N),
- timer:sleep(250),
+ timer:sleep(100),
logger_loop(N+1).
%%%-----------------------------------------------------------------
diff --git a/lib/common_test/test/ct_pre_post_test_io_SUITE_data/dummy_SUITE.erl b/lib/common_test/test/ct_pre_post_test_io_SUITE_data/dummy_SUITE.erl
index ad8beb2ae0..71168cb118 100644
--- a/lib/common_test/test/ct_pre_post_test_io_SUITE_data/dummy_SUITE.erl
+++ b/lib/common_test/test/ct_pre_post_test_io_SUITE_data/dummy_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_priv_dir_SUITE.erl b/lib/common_test/test/ct_priv_dir_SUITE.erl
index c42be106de..c881a88d76 100644
--- a/lib/common_test/test/ct_priv_dir_SUITE.erl
+++ b/lib/common_test/test/ct_priv_dir_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_priv_dir_SUITE_data/priv_dir_SUITE.erl b/lib/common_test/test/ct_priv_dir_SUITE_data/priv_dir_SUITE.erl
index 8fae6fe8ed..1b171801a3 100644
--- a/lib/common_test/test/ct_priv_dir_SUITE_data/priv_dir_SUITE.erl
+++ b/lib/common_test/test/ct_priv_dir_SUITE_data/priv_dir_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_release_test_SUITE.erl b/lib/common_test/test/ct_release_test_SUITE.erl
index 66d07155ac..f9450453c9 100644
--- a/lib/common_test/test/ct_release_test_SUITE.erl
+++ b/lib/common_test/test/ct_release_test_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_release_test_SUITE_data/release_test_SUITE.erl b/lib/common_test/test/ct_release_test_SUITE_data/release_test_SUITE.erl
index 04c92be0d1..7f0ba65791 100644
--- a/lib/common_test/test/ct_release_test_SUITE_data/release_test_SUITE.erl
+++ b/lib/common_test/test/ct_release_test_SUITE_data/release_test_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_repeat_1_SUITE.erl b/lib/common_test/test/ct_repeat_1_SUITE.erl
index 7d47bdcf51..42f05aade4 100644
--- a/lib/common_test/test/ct_repeat_1_SUITE.erl
+++ b/lib/common_test/test/ct_repeat_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_repeat_1_SUITE_data/repeat_1_SUITE.erl b/lib/common_test/test/ct_repeat_1_SUITE_data/repeat_1_SUITE.erl
index da00affa30..e7b3c5ad90 100644
--- a/lib/common_test/test/ct_repeat_1_SUITE_data/repeat_1_SUITE.erl
+++ b/lib/common_test/test/ct_repeat_1_SUITE_data/repeat_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_repeat_testrun_SUITE.erl b/lib/common_test/test/ct_repeat_testrun_SUITE.erl
index 7430ceb66d..632597c214 100644
--- a/lib/common_test/test/ct_repeat_testrun_SUITE.erl
+++ b/lib/common_test/test/ct_repeat_testrun_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_repeat_testrun_SUITE_data/a_test/r1_SUITE.erl b/lib/common_test/test/ct_repeat_testrun_SUITE_data/a_test/r1_SUITE.erl
index 7afe526914..4ce375b4ee 100644
--- a/lib/common_test/test/ct_repeat_testrun_SUITE_data/a_test/r1_SUITE.erl
+++ b/lib/common_test/test/ct_repeat_testrun_SUITE_data/a_test/r1_SUITE.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_repeat_testrun_SUITE_data/b_test/r2_SUITE.erl b/lib/common_test/test/ct_repeat_testrun_SUITE_data/b_test/r2_SUITE.erl
index d78b1befab..77bb544080 100644
--- a/lib/common_test/test/ct_repeat_testrun_SUITE_data/b_test/r2_SUITE.erl
+++ b/lib/common_test/test/ct_repeat_testrun_SUITE_data/b_test/r2_SUITE.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_sequence_1_SUITE.erl b/lib/common_test/test/ct_sequence_1_SUITE.erl
index f13d7e32ea..17d168404e 100644
--- a/lib/common_test/test/ct_sequence_1_SUITE.erl
+++ b/lib/common_test/test/ct_sequence_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_sequence_1_SUITE_data/subgroups_1_SUITE.erl b/lib/common_test/test/ct_sequence_1_SUITE_data/subgroups_1_SUITE.erl
index ee0b5d7a02..8e5a7501ce 100644
--- a/lib/common_test/test/ct_sequence_1_SUITE_data/subgroups_1_SUITE.erl
+++ b/lib/common_test/test/ct_sequence_1_SUITE_data/subgroups_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_shell_SUITE.erl b/lib/common_test/test/ct_shell_SUITE.erl
index 786443e9ae..64dfbdb9f7 100644
--- a/lib/common_test/test/ct_shell_SUITE.erl
+++ b/lib/common_test/test/ct_shell_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE.erl b/lib/common_test/test/ct_skip_SUITE.erl
index 4ed6005c65..06152ed354 100644
--- a/lib/common_test/test/ct_skip_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_10_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_10_SUITE.erl
index cf11de8147..5963f3c41e 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_10_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_10_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_11_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_11_SUITE.erl
index 19cd76df62..5a2b57a143 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_11_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_11_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_12_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_12_SUITE.erl
index 877eb6e540..b87ed43bfc 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_12_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_12_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_1_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_1_SUITE.erl
index cf8945c968..9e199c2fb0 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_1_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_2_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_2_SUITE.erl
index dd3be8b6b5..ed9b47f2e1 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_2_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_2_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_3_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_3_SUITE.erl
index 55b6fb254d..1c7ad56448 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_3_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_3_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_4_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_4_SUITE.erl
index 7169517480..9fa1335acb 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_4_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_4_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_5_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_5_SUITE.erl
index 560abd0a6e..4946eeedda 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_5_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_5_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_6_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_6_SUITE.erl
index f209d921c4..a26788d439 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_6_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_6_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_7_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_7_SUITE.erl
index 0497fd2785..a35a7bfe64 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_7_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_7_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_8_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_8_SUITE.erl
index 9b5ce06afb..fb94db9fb4 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_8_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_8_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_9_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_9_SUITE.erl
index 48c5930c5b..e6deab9862 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_9_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/auto_skip_9_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_1_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_1_SUITE.erl
index a74c4601bd..fc67e5b4e7 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_1_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_2_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_2_SUITE.erl
index 8f64f4fe8b..1e637e6916 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_2_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_2_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_3_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_3_SUITE.erl
index 379a579501..8703163800 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_3_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_3_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_4_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_4_SUITE.erl
index 6d875436a4..0b0ee833a0 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_4_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_4_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_5_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_5_SUITE.erl
index 3575bf65e2..4bfe1f2b9a 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_5_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_5_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_6_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_6_SUITE.erl
index 8a5c13d67c..e67ded1f24 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_6_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_6_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_7_SUITE.erl b/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_7_SUITE.erl
index 01efd31d5e..c7b060ff9c 100644
--- a/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_7_SUITE.erl
+++ b/lib/common_test/test/ct_skip_SUITE_data/skip/test/user_skip_7_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_smoke_test_SUITE.erl b/lib/common_test/test/ct_smoke_test_SUITE.erl
index d0a1f14b8d..2dedc7e2cf 100644
--- a/lib/common_test/test/ct_smoke_test_SUITE.erl
+++ b/lib/common_test/test/ct_smoke_test_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_smoke_test_SUITE_data/happy_1/test/happy_11_SUITE.erl b/lib/common_test/test/ct_smoke_test_SUITE_data/happy_1/test/happy_11_SUITE.erl
index 038c44e350..24e52ff58c 100644
--- a/lib/common_test/test/ct_smoke_test_SUITE_data/happy_1/test/happy_11_SUITE.erl
+++ b/lib/common_test/test/ct_smoke_test_SUITE_data/happy_1/test/happy_11_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_smoke_test_SUITE_data/happy_2_test/happy_21_SUITE.erl b/lib/common_test/test/ct_smoke_test_SUITE_data/happy_2_test/happy_21_SUITE.erl
index 1d3da7a245..231fb1f62e 100644
--- a/lib/common_test/test/ct_smoke_test_SUITE_data/happy_2_test/happy_21_SUITE.erl
+++ b/lib/common_test/test/ct_smoke_test_SUITE_data/happy_2_test/happy_21_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_snmp_SUITE.erl b/lib/common_test/test/ct_snmp_SUITE.erl
index 17642c8d63..038f4232c0 100644
--- a/lib/common_test/test/ct_snmp_SUITE.erl
+++ b/lib/common_test/test/ct_snmp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE.erl b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE.erl
index 5afd3a2dde..a6533641d8 100644
--- a/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE.erl
+++ b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_surefire_SUITE.erl b/lib/common_test/test/ct_surefire_SUITE.erl
index 82ab1c19bb..42ec685c16 100644
--- a/lib/common_test/test/ct_surefire_SUITE.erl
+++ b/lib/common_test/test/ct_surefire_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -49,8 +49,11 @@
%% there will be clashes with logging processes etc).
%%--------------------------------------------------------------------
init_per_suite(Config) ->
- Config1 = ct_test_support:init_per_suite(Config),
- Config1.
+ DataDir = ?config(data_dir,Config),
+ Hook = "fail_pre_init_per_suite.erl",
+ io:format("Compiling ~p: ~p~n",
+ [Hook, compile:file(Hook,[{outdir,DataDir},debug_info])]),
+ ct_test_support:init_per_suite([{path_dirs,[DataDir]}|Config]).
end_per_suite(Config) ->
ct_test_support:end_per_suite(Config).
@@ -69,7 +72,8 @@ all() ->
absolute_path,
relative_path,
url,
- logdir
+ logdir,
+ fail_pre_init_per_suite
].
%%--------------------------------------------------------------------
@@ -107,6 +111,14 @@ logdir(Config) when is_list(Config) ->
Path = "logdir.xml",
run(logdir,[{cth_surefire,[{path,Path}]}],Path,Config,[{logdir,MyLogDir}]).
+fail_pre_init_per_suite(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir,Config),
+ Suites = [filename:join(DataDir,"pass_SUITE"),
+ filename:join(DataDir,"fail_SUITE")],
+ Path = "fail_pre_init_per_suite.xml",
+ run(fail_pre_init_per_suite,[fail_pre_init_per_suite,
+ {cth_surefire,[{path,Path}]}],Path,Config,[],Suites).
+
%%%-----------------------------------------------------------------
%%% HELP FUNCTIONS
%%%-----------------------------------------------------------------
@@ -115,6 +127,8 @@ run(Case,CTHs,Report,Config) ->
run(Case,CTHs,Report,Config,ExtraOpts) ->
DataDir = ?config(data_dir, Config),
Suite = filename:join(DataDir, "surefire_SUITE"),
+ run(Case,CTHs,Report,Config,ExtraOpts,Suite).
+run(Case,CTHs,Report,Config,ExtraOpts,Suite) ->
{Opts,ERPid} = setup([{suite,Suite},{ct_hooks,CTHs},{label,Case}|ExtraOpts],
Config),
ok = execute(Case, Opts, ERPid, Config),
@@ -142,7 +156,6 @@ setup(Test, Config) ->
execute(Name, Opts, ERPid, Config) ->
ok = ct_test_support:run(Opts, Config),
Events = ct_test_support:get_events(ERPid, Config),
-
ct_test_support:log_events(Name,
reformat(Events, ?eh),
?config(priv_dir, Config),
@@ -166,10 +179,30 @@ events_to_check(_, 0) ->
events_to_check(Test, N) ->
test_events(Test) ++ events_to_check(Test, N-1).
-test_events(_) ->
- [{?eh,start_logging,'_'},
- {?eh,start_info,{1,1,9}},
- {?eh,tc_start,{surefire_SUITE,init_per_suite}},
+test_suite_events(fail_SUITE, TestStat) ->
+ [{?eh,tc_start,{ct_framework,init_per_suite}},
+ {?eh,tc_done,{ct_framework,init_per_suite,
+ {failed,{error,pre_init_per_suite}}}},
+ {?eh,tc_auto_skip,
+ {fail_SUITE,test_case,
+ {failed,{ct_framework,init_per_suite,{failed,pre_init_per_suite}}}}},
+ {?eh,test_stats,TestStat},
+ {?eh,tc_auto_skip,
+ {ct_framework,end_per_suite,
+ {failed,{ct_framework,init_per_suite,{failed,pre_init_per_suite}}}}}].
+
+test_suite_events(fail_SUITE) ->
+ test_suite_events(fail_SUITE, {0,0,{0,1}});
+test_suite_events(pass_SUITE) ->
+ [{?eh,tc_start,{ct_framework,init_per_suite}},
+ {?eh,tc_done,{ct_framework,init_per_suite,ok}},
+ {?eh,tc_start,{pass_SUITE,test_case}},
+ {?eh,tc_done,{pass_SUITE,test_case,ok}},
+ {?eh,test_stats,{1,0,{0,0}}},
+ {?eh,tc_start,{ct_framework,end_per_suite}},
+ {?eh,tc_done,{ct_framework,end_per_suite,ok}}];
+test_suite_events(_) ->
+ [{?eh,tc_start,{surefire_SUITE,init_per_suite}},
{?eh,tc_done,{surefire_SUITE,init_per_suite,ok}},
{?eh,tc_start,{surefire_SUITE,tc_ok}},
{?eh,tc_done,{surefire_SUITE,tc_ok,ok}},
@@ -216,9 +249,18 @@ test_events(_) ->
{surefire_SUITE,init_per_group,
{'EXIT',all_cases_should_be_skipped}}}}}],
{?eh,tc_start,{surefire_SUITE,end_per_suite}},
- {?eh,tc_done,{surefire_SUITE,end_per_suite,ok}},
- {?eh,stop_logging,[]}].
-
+ {?eh,tc_done,{surefire_SUITE,end_per_suite,ok}}].
+
+test_events(fail_pre_init_per_suite) ->
+ [{?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,start_info,{2,2,2}}] ++
+ test_suite_events(pass_SUITE) ++
+ test_suite_events(fail_SUITE, {1,0,{0,1}}) ++
+ [{?eh,stop_logging,[]}];
+test_events(Test) ->
+ [{?eh,start_logging,'_'}, {?eh,start_info,{1,1,9}}] ++
+ test_suite_events(Test) ++
+ [{?eh,stop_logging,[]}].
%%%-----------------------------------------------------------------
%%% Check generated xml log files
@@ -251,9 +293,9 @@ do_check_xml(Case,[Xml|Xmls]) ->
{E,_} = xmerl_scan:file(Xml),
Expected = events_to_result(lists:flatten(test_events(Case))),
ParseResult = testsuites(Case,E),
- ct:log("Expecting: ~p~n",[[Expected]]),
+ ct:log("Expecting: ~p~n",[Expected]),
ct:log("Actual : ~p~n",[ParseResult]),
- [Expected] = ParseResult,
+ Expected = ParseResult,
do_check_xml(Case,Xmls);
do_check_xml(_,[]) ->
ok.
@@ -265,7 +307,8 @@ testsuites(Case,#xmlElement{name=testsuites,content=TS}) ->
testsuite(Case,TS).
testsuite(Case,[#xmlElement{name=testsuite,content=TC,attributes=A}|TS]) ->
- {ET,EF,ES} = events_to_numbers(lists:flatten(test_events(Case))),
+ TestSuiteEvents = test_suite_events(get_ts_name(A)),
+ {ET,EF,ES} = events_to_numbers(lists:flatten(TestSuiteEvents)),
{T,E,F,S} = get_numbers_from_attrs(A,false,false,false,false),
ct:log("Expecting total:~p, error:~p, failure:~p, skipped:~p~n",[ET,0,EF,ES]),
ct:log("Actual total:~p, error:~p, failure:~p, skipped:~p~n",[T,E,F,S]),
@@ -318,14 +361,32 @@ failed_or_skipped([]) ->
%% Testsuites = [Testsuite]
%% Testsuite = [Testcase]
%% Testcase = [] | [f] | [s], indicating ok, failed and skipped respectively
-events_to_result([{?eh,tc_done,{_Suite,_Case,R}}|E]) ->
- [result(R)|events_to_result(E)];
-events_to_result([{?eh,tc_auto_skip,_}|E]) ->
- [[s]|events_to_result(E)];
-events_to_result([_|E]) ->
- events_to_result(E);
-events_to_result([]) ->
- [].
+events_to_result(E) ->
+ events_to_result(E, []).
+
+events_to_result([{?eh,tc_auto_skip,{_Suite,init_per_suite,_}}|E], Result) ->
+ {Suite,Rest} = events_to_result1(E),
+ events_to_result(Rest, [[[s]|Suite]|Result]);
+events_to_result([{?eh,tc_done,{_Suite,init_per_suite,R}}|E], Result) ->
+ {Suite,Rest} = events_to_result1(E),
+ events_to_result(Rest, [[result(R)|Suite]|Result]);
+events_to_result([_|E], Result) ->
+ events_to_result(E, Result);
+events_to_result([], Result) ->
+ Result.
+
+events_to_result1([{?eh,tc_auto_skip,{_Suite, end_per_suite,_}}|E]) ->
+ {[[s]],E};
+events_to_result1([{?eh,tc_done,{_Suite, end_per_suite,R}}|E]) ->
+ {[result(R)],E};
+events_to_result1([{?eh,tc_done,{_Suite,_Case,R}}|E]) ->
+ {Suite,Rest} = events_to_result1(E),
+ {[result(R)|Suite],Rest};
+events_to_result1([{?eh,tc_auto_skip,_}|E]) ->
+ {Suite,Rest} = events_to_result1(E),
+ {[[s]|Suite],Rest};
+events_to_result1([_|E]) ->
+ events_to_result1(E).
result(ok) ->[];
result({skipped,_}) -> [s];
@@ -374,3 +435,7 @@ del_files(Dir,[F0|Fs] ) ->
end;
del_files(_,[]) ->
ok.
+
+get_ts_name(Attributes) ->
+ {_,name,_,_,_,_,_,_,Name,_} = lists:keyfind(name, 2, Attributes),
+ list_to_atom(Name).
diff --git a/lib/compiler/test/compilation_SUITE_data/bin_syntax_1.erl b/lib/common_test/test/ct_surefire_SUITE_data/fail_SUITE.erl
index b381c539b7..3f5f42c054 100644
--- a/lib/compiler/test/compilation_SUITE_data/bin_syntax_1.erl
+++ b/lib/common_test/test/ct_surefire_SUITE_data/fail_SUITE.erl
@@ -1,8 +1,7 @@
-%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2016. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,19 +13,16 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
+%%
%% %CopyrightEnd%
%%
--module(bin_syntax_1).
+-module(fail_SUITE).
+-include_lib("common_test/include/ct.hrl").
--export([f/2,?MODULE/0]).
+-export([all/0, test_case/1]).
-?MODULE() ->
- ok.
+all() ->
+ [test_case].
-f(X, Y) ->
- case X of
- a ->
- Y2 = 8
- end,
- <<5:Y2>> = Y.
+test_case(_Config) ->
+ ok.
diff --git a/lib/common_test/test/ct_surefire_SUITE_data/fail_pre_init_per_suite.erl b/lib/common_test/test/ct_surefire_SUITE_data/fail_pre_init_per_suite.erl
new file mode 100644
index 0000000000..ff278db378
--- /dev/null
+++ b/lib/common_test/test/ct_surefire_SUITE_data/fail_pre_init_per_suite.erl
@@ -0,0 +1,47 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2016. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%% This tests that the correct XML is produced when pre_init_per_suite
+%%% fails in a hook
+-module(fail_pre_init_per_suite).
+
+%% CT Hooks
+-export([init/2, pre_init_per_suite/3]).
+
+-type config() :: proplists:proplist().
+-type reason() :: term().
+-type skip_or_fail() :: skip | auto_skip | fail | 'EXIT'.
+
+-record(state, {}).
+
+-spec init(Id :: term(), Opts :: proplists:proplist()) ->
+ {ok, proplists:proplist()}.
+init(_Id, Opts) ->
+ {ok, Opts}.
+
+-spec pre_init_per_suite(Suite :: atom(),
+ Config :: config(),
+ State :: #state{}) ->
+ {config() | {skip_or_fail(), reason()}, NewState :: #state{}}.
+pre_init_per_suite(fail_SUITE, _Config, State) ->
+ {{fail, pre_init_per_suite}, State};
+pre_init_per_suite(_Suite, Config, State) ->
+ {Config, State}.
+
diff --git a/lib/compiler/test/compilation_SUITE_data/beam_compiler_5.erl b/lib/common_test/test/ct_surefire_SUITE_data/pass_SUITE.erl
index 21bab01c82..74ed5b730e 100644
--- a/lib/compiler/test/compilation_SUITE_data/beam_compiler_5.erl
+++ b/lib/common_test/test/ct_surefire_SUITE_data/pass_SUITE.erl
@@ -1,8 +1,7 @@
-%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2016. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,16 +13,16 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
+%%
%% %CopyrightEnd%
%%
--module(beam_compiler_5).
--export([beam_compiler_5/0]).
+-module(pass_SUITE).
+-include_lib("common_test/include/ct.hrl").
--compile(export_all).
+-export([all/0, test_case/1]).
-beam_compiler_5() ->
- ok.
+all() ->
+ [test_case].
-t() ->
- [_|_] = x.
+test_case(_Config) ->
+ ok.
diff --git a/lib/common_test/test/ct_surefire_SUITE_data/surefire_SUITE.erl b/lib/common_test/test/ct_surefire_SUITE_data/surefire_SUITE.erl
index ab387c2ea4..ed10356cdd 100644
--- a/lib/common_test/test/ct_surefire_SUITE_data/surefire_SUITE.erl
+++ b/lib/common_test/test/ct_surefire_SUITE_data/surefire_SUITE.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_system_error_SUITE.erl b/lib/common_test/test/ct_system_error_SUITE.erl
index f783a09553..686d0a46fd 100644
--- a/lib/common_test/test/ct_system_error_SUITE.erl
+++ b/lib/common_test/test/ct_system_error_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_system_error_SUITE_data/a_SUITE.erl b/lib/common_test/test/ct_system_error_SUITE_data/a_SUITE.erl
index 35efbb851f..7f9e7595ab 100644
--- a/lib/common_test/test/ct_system_error_SUITE_data/a_SUITE.erl
+++ b/lib/common_test/test/ct_system_error_SUITE_data/a_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_telnet_SUITE.erl b/lib/common_test/test/ct_telnet_SUITE.erl
index 006a921fc1..a0089c9bc9 100644
--- a/lib/common_test/test/ct_telnet_SUITE.erl
+++ b/lib/common_test/test/ct_telnet_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_test_server_if_1_SUITE.erl b/lib/common_test/test/ct_test_server_if_1_SUITE.erl
index 4b2f4ee504..228d900545 100644
--- a/lib/common_test/test/ct_test_server_if_1_SUITE.erl
+++ b/lib/common_test/test/ct_test_server_if_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/skipped_by_spec_1_SUITE.erl b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/skipped_by_spec_1_SUITE.erl
index d32283c859..dbb57ddbb9 100644
--- a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/skipped_by_spec_1_SUITE.erl
+++ b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/skipped_by_spec_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/skipped_by_spec_2_SUITE.erl b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/skipped_by_spec_2_SUITE.erl
index 62f2bdc8d5..af1ccd317b 100644
--- a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/skipped_by_spec_2_SUITE.erl
+++ b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/skipped_by_spec_2_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_1_SUITE.erl b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_1_SUITE.erl
index c7673577ab..631d14c8ea 100644
--- a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_1_SUITE.erl
+++ b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_2_SUITE.erl b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_2_SUITE.erl
index d25330d746..f6da881d18 100644
--- a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_2_SUITE.erl
+++ b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_2_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_3_SUITE.erl b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_3_SUITE.erl
index c56c684588..3cd028a82e 100644
--- a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_3_SUITE.erl
+++ b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_3_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_4_SUITE.erl b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_4_SUITE.erl
index eaad6d2044..06d7760566 100644
--- a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_4_SUITE.erl
+++ b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_4_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_5_SUITE.erl b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_5_SUITE.erl
index b51d76e707..0b14e22cfe 100644
--- a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_5_SUITE.erl
+++ b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_5_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_6_SUITE.erl b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_6_SUITE.erl
index 9bfd102409..e48fe904e1 100644
--- a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_6_SUITE.erl
+++ b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_6_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_7_SUITE.erl b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_7_SUITE.erl
index 9131874c48..be6f9777d1 100644
--- a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_7_SUITE.erl
+++ b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_7_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_8_SUITE.erl b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_8_SUITE.erl
index e3247ed3ea..343cabcaa0 100644
--- a/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_8_SUITE.erl
+++ b/lib/common_test/test/ct_test_server_if_1_SUITE_data/test_server_if/test/ts_if_8_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_test_support.erl b/lib/common_test/test/ct_test_support.erl
index 0ee83f45b8..477fcb8a26 100644
--- a/lib/common_test/test/ct_test_support.erl
+++ b/lib/common_test/test/ct_test_support.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -43,6 +43,8 @@
-export([random_error/1]).
+-export([unique_timestamp/0]).
+
-include_lib("kernel/include/file.hrl").
%%%-----------------------------------------------------------------
@@ -110,7 +112,8 @@ start_slave(NodeName, Config, Level) ->
undefined -> [];
Ds -> Ds
end,
- PathDirs = [PrivDir,TSDir | AddPathDirs],
+ TestSupDir = filename:dirname(code:which(?MODULE)),
+ PathDirs = [PrivDir,TSDir,TestSupDir | AddPathDirs],
[true = rpc:call(CTNode, code, add_patha, [D]) || D <- PathDirs],
test_server:format(Level, "Dirs added to code path (on ~w):~n",
[CTNode]),
@@ -1430,7 +1433,21 @@ rm_files([F | Fs]) ->
end;
rm_files([]) ->
ok.
-
+
+unique_timestamp() ->
+ unique_timestamp(os:timestamp(), 100000).
+
+unique_timestamp(TS, 0) ->
+ TS;
+unique_timestamp(TS0, N) ->
+ case os:timestamp() of
+ TS0 ->
+ timer:sleep(1),
+ unique_timestamp(TS0, N-1);
+ TS1 ->
+ TS1
+ end.
+
%%%-----------------------------------------------------------------
%%%
slave_stop(Node) ->
diff --git a/lib/common_test/test/ct_test_support_eh.erl b/lib/common_test/test/ct_test_support_eh.erl
index f3d933da04..e8db52dcd3 100644
--- a/lib/common_test/test/ct_test_support_eh.erl
+++ b/lib/common_test/test/ct_test_support_eh.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_testspec_1_SUITE.erl b/lib/common_test/test/ct_testspec_1_SUITE.erl
index 6401ed181c..fca5ef3eb3 100644
--- a/lib/common_test/test/ct_testspec_1_SUITE.erl
+++ b/lib/common_test/test/ct_testspec_1_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
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
index abc53c93f5..4d481fe3b8 100644
--- 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
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
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
index f55ccb0792..61bde4bbfd 100644
--- 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
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
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
index 0138310c36..e99ba8c570 100644
--- 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
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
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
index 4d253dae6f..ae03ae9149 100644
--- 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
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
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
index 381742278a..dfd7bc1495 100644
--- 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
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
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
index fb646071b8..7d5df52ee5 100644
--- 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
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_testspec_2_SUITE.erl b/lib/common_test/test/ct_testspec_2_SUITE.erl
index 887b156cde..1a941df185 100644
--- a/lib/common_test/test/ct_testspec_2_SUITE.erl
+++ b/lib/common_test/test/ct_testspec_2_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_testspec_3_SUITE.erl b/lib/common_test/test/ct_testspec_3_SUITE.erl
index 09c649ef78..5ca0fcbfac 100644
--- a/lib/common_test/test/ct_testspec_3_SUITE.erl
+++ b/lib/common_test/test/ct_testspec_3_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_testspec_3_SUITE_data/tests1/t11_SUITE.erl b/lib/common_test/test/ct_testspec_3_SUITE_data/tests1/t11_SUITE.erl
index fd66bf5423..f27ecc6360 100644
--- a/lib/common_test/test/ct_testspec_3_SUITE_data/tests1/t11_SUITE.erl
+++ b/lib/common_test/test/ct_testspec_3_SUITE_data/tests1/t11_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_testspec_3_SUITE_data/tests1/t12_SUITE.erl b/lib/common_test/test/ct_testspec_3_SUITE_data/tests1/t12_SUITE.erl
index bc0cf84c8e..35a94a039e 100644
--- a/lib/common_test/test/ct_testspec_3_SUITE_data/tests1/t12_SUITE.erl
+++ b/lib/common_test/test/ct_testspec_3_SUITE_data/tests1/t12_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_testspec_3_SUITE_data/tests2/t21_SUITE.erl b/lib/common_test/test/ct_testspec_3_SUITE_data/tests2/t21_SUITE.erl
index bcc1e5ac3d..bd08ef24bf 100644
--- a/lib/common_test/test/ct_testspec_3_SUITE_data/tests2/t21_SUITE.erl
+++ b/lib/common_test/test/ct_testspec_3_SUITE_data/tests2/t21_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_testspec_3_SUITE_data/tests2/t22_SUITE.erl b/lib/common_test/test/ct_testspec_3_SUITE_data/tests2/t22_SUITE.erl
index 2dee793c70..9721d48aa1 100644
--- a/lib/common_test/test/ct_testspec_3_SUITE_data/tests2/t22_SUITE.erl
+++ b/lib/common_test/test/ct_testspec_3_SUITE_data/tests2/t22_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_testspec_3_SUITE_data/tests2/t23_SUITE.erl b/lib/common_test/test/ct_testspec_3_SUITE_data/tests2/t23_SUITE.erl
index 66b1d10f28..caa5e30ff6 100644
--- a/lib/common_test/test/ct_testspec_3_SUITE_data/tests2/t23_SUITE.erl
+++ b/lib/common_test/test/ct_testspec_3_SUITE_data/tests2/t23_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_userconfig_callback.erl b/lib/common_test/test/ct_userconfig_callback.erl
index 8b269c695c..c723f4ca1c 100644
--- a/lib/common_test/test/ct_userconfig_callback.erl
+++ b/lib/common_test/test/ct_userconfig_callback.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_verbosity_SUITE.erl b/lib/common_test/test/ct_verbosity_SUITE.erl
index f19322c183..b9298e54ca 100644
--- a/lib/common_test/test/ct_verbosity_SUITE.erl
+++ b/lib/common_test/test/ct_verbosity_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_verbosity_SUITE_data/io_test_SUITE.erl b/lib/common_test/test/ct_verbosity_SUITE_data/io_test_SUITE.erl
index cc799c1923..0b3c82bf2b 100644
--- a/lib/common_test/test/ct_verbosity_SUITE_data/io_test_SUITE.erl
+++ b/lib/common_test/test/ct_verbosity_SUITE_data/io_test_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/ct_verbosity_SUITE_data/simple_evh.erl b/lib/common_test/test/ct_verbosity_SUITE_data/simple_evh.erl
index 37987538b5..03a0832e53 100644
--- a/lib/common_test/test/ct_verbosity_SUITE_data/simple_evh.erl
+++ b/lib/common_test/test/ct_verbosity_SUITE_data/simple_evh.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/erl2html2_SUITE.erl b/lib/common_test/test/erl2html2_SUITE.erl
index 8e9f6e773a..bdce43c9c9 100644
--- a/lib/common_test/test/erl2html2_SUITE.erl
+++ b/lib/common_test/test/erl2html2_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/test_server_SUITE.erl b/lib/common_test/test/test_server_SUITE.erl
index d1c789f34c..50d8bdd1ac 100644
--- a/lib/common_test/test/test_server_SUITE.erl
+++ b/lib/common_test/test/test_server_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/test_server_SUITE_data/test_server_SUITE.erl b/lib/common_test/test/test_server_SUITE_data/test_server_SUITE.erl
index c3d4315cb8..559e23fad3 100644
--- a/lib/common_test/test/test_server_SUITE_data/test_server_SUITE.erl
+++ b/lib/common_test/test/test_server_SUITE_data/test_server_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/test_server_SUITE_data/test_server_break_SUITE.erl b/lib/common_test/test/test_server_SUITE_data/test_server_break_SUITE.erl
index 171f83df0f..85b9cb1151 100644
--- a/lib/common_test/test/test_server_SUITE_data/test_server_break_SUITE.erl
+++ b/lib/common_test/test/test_server_SUITE_data/test_server_break_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/test_server_SUITE_data/test_server_conf01_SUITE.erl b/lib/common_test/test/test_server_SUITE_data/test_server_conf01_SUITE.erl
index e4f40f6c03..5921582713 100644
--- a/lib/common_test/test/test_server_SUITE_data/test_server_conf01_SUITE.erl
+++ b/lib/common_test/test/test_server_SUITE_data/test_server_conf01_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/test_server_SUITE_data/test_server_conf02_SUITE.erl b/lib/common_test/test/test_server_SUITE_data/test_server_conf02_SUITE.erl
index 1c6fe6dd0b..90e6f0b8ee 100644
--- a/lib/common_test/test/test_server_SUITE_data/test_server_conf02_SUITE.erl
+++ b/lib/common_test/test/test_server_SUITE_data/test_server_conf02_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/test_server_SUITE_data/test_server_cover_SUITE.erl b/lib/common_test/test/test_server_SUITE_data/test_server_cover_SUITE.erl
index 3371418980..2c7cbb6473 100644
--- a/lib/common_test/test/test_server_SUITE_data/test_server_cover_SUITE.erl
+++ b/lib/common_test/test/test_server_SUITE_data/test_server_cover_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/test_server_SUITE_data/test_server_parallel01_SUITE.erl b/lib/common_test/test/test_server_SUITE_data/test_server_parallel01_SUITE.erl
index ad639b585d..cd704e986f 100644
--- a/lib/common_test/test/test_server_SUITE_data/test_server_parallel01_SUITE.erl
+++ b/lib/common_test/test/test_server_SUITE_data/test_server_parallel01_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/test_server_SUITE_data/test_server_shuffle01_SUITE.erl b/lib/common_test/test/test_server_SUITE_data/test_server_shuffle01_SUITE.erl
index 0f7118a810..ebd686c3c0 100644
--- a/lib/common_test/test/test_server_SUITE_data/test_server_shuffle01_SUITE.erl
+++ b/lib/common_test/test/test_server_SUITE_data/test_server_shuffle01_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/test_server_SUITE_data/test_server_skip_SUITE.erl b/lib/common_test/test/test_server_SUITE_data/test_server_skip_SUITE.erl
index ae2321c6ad..cfdca8dd00 100644
--- a/lib/common_test/test/test_server_SUITE_data/test_server_skip_SUITE.erl
+++ b/lib/common_test/test/test_server_SUITE_data/test_server_skip_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/test_server_SUITE_data/test_server_unicode_SUITE.erl b/lib/common_test/test/test_server_SUITE_data/test_server_unicode_SUITE.erl
index 0cabce995f..5249756565 100644
--- a/lib/common_test/test/test_server_SUITE_data/test_server_unicode_SUITE.erl
+++ b/lib/common_test/test/test_server_SUITE_data/test_server_unicode_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test/test_server_test_lib.erl b/lib/common_test/test/test_server_test_lib.erl
index e2680938e0..cf5951ae03 100644
--- a/lib/common_test/test/test_server_test_lib.erl
+++ b/lib/common_test/test/test_server_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test_server/Makefile b/lib/common_test/test_server/Makefile
index 0adf64b837..f015064b39 100644
--- a/lib/common_test/test_server/Makefile
+++ b/lib/common_test/test_server/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2013. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test_server/configure.in b/lib/common_test/test_server/configure.in
index 001de72a1e..0511d126b4 100644
--- a/lib/common_test/test_server/configure.in
+++ b/lib/common_test/test_server/configure.in
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script for Erlang.
dnl
dnl %CopyrightBegin%
dnl
-dnl Copyright Ericsson AB 1997-2014. All Rights Reserved.
+dnl Copyright Ericsson AB 1997-2016. All Rights Reserved.
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test_server/ts.config b/lib/common_test/test_server/ts.config
index cf3d269616..d05e4885fc 100644
--- a/lib/common_test/test_server/ts.config
+++ b/lib/common_test/test_server/ts.config
@@ -44,3 +44,7 @@
% {295,0,0,0,0,0,0,1},
% ["dummy6-ip6"]
% }}.
+
+%% Used by erl_interface tests
+%% Known hostname with an unreachable ip
+%{test_host_not_reachable, "ghost.mydomain.com"}.
diff --git a/lib/common_test/test_server/ts.erl b/lib/common_test/test_server/ts.erl
index 8bbdc8f8cf..5bfea9f4de 100644
--- a/lib/common_test/test_server/ts.erl
+++ b/lib/common_test/test_server/ts.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test_server/ts.hrl b/lib/common_test/test_server/ts.hrl
index 4c940fdc4f..403c62d22e 100644
--- a/lib/common_test/test_server/ts.hrl
+++ b/lib/common_test/test_server/ts.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test_server/ts_autoconf_win32.erl b/lib/common_test/test_server/ts_autoconf_win32.erl
index 288305b406..52e5ac8e69 100644
--- a/lib/common_test/test_server/ts_autoconf_win32.erl
+++ b/lib/common_test/test_server/ts_autoconf_win32.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -139,15 +139,15 @@ visual_cxx(Vars) ->
{"-MTd ",
"-MDd ",
"-LDd ",
- "-debug -pdb:none ",
+ "-link -debug -pdb:none ",
"-Z7 -DDEBUG",
" "};
false ->
{"-MT ",
"-MD ",
"-LD ",
- " ",
- " ",
+ "-Zi -link ",
+ "-Zi ",
"-Ox "}
end,
WIN32 = "-D__WIN32__ ",
@@ -158,7 +158,7 @@ visual_cxx(Vars) ->
{'LD', CC},
{'SHLIB_LD', CC},
{'SHLIB_LDFLAGS', ERTS_THR_LIB ++ DLL},
- {'SHLIB_LDLIBS', "-link " ++ DBG_LINK ++ "kernel32.lib"},
+ {'SHLIB_LDLIBS', DBG_LINK ++ "kernel32.lib"},
{'SHLIB_EXTRACT_ALL', ""},
{'CFLAGS', DEFAULT_THR_LIB ++ WIN32 ++ DBG_COMP},
{'EI_CFLAGS', DEFAULT_THR_LIB ++ WIN32 ++ DBG_COMP},
@@ -168,7 +168,7 @@ visual_cxx(Vars) ->
{'DEFS', common_c_defs()},
{'SHLIB_SUFFIX', ".dll"},
{'ERTS_LIBS', ERTS_THR_LIB ++ LIBS},
- {'LIBS', DEFAULT_THR_LIB ++ "-link " ++ DBG_LINK ++ LIBS},
+ {'LIBS', DEFAULT_THR_LIB ++ DBG_LINK ++ LIBS},
{obj,".obj"},
{exe, ".exe"},
{test_c_compiler, "{msc, undefined}"}
diff --git a/lib/common_test/test_server/ts_benchmark.erl b/lib/common_test/test_server/ts_benchmark.erl
index 3e55edefb0..e4e06b54c2 100644
--- a/lib/common_test/test_server/ts_benchmark.erl
+++ b/lib/common_test/test_server/ts_benchmark.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test_server/ts_erl_config.erl b/lib/common_test/test_server/ts_erl_config.erl
index ab7363c106..032593bdda 100644
--- a/lib/common_test/test_server/ts_erl_config.erl
+++ b/lib/common_test/test_server/ts_erl_config.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test_server/ts_install.erl b/lib/common_test/test_server/ts_install.erl
index 600a576820..b906eb21f5 100644
--- a/lib/common_test/test_server/ts_install.erl
+++ b/lib/common_test/test_server/ts_install.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test_server/ts_install_cth.erl b/lib/common_test/test_server/ts_install_cth.erl
index 0462e62611..5d325b1115 100644
--- a/lib/common_test/test_server/ts_install_cth.erl
+++ b/lib/common_test/test_server/ts_install_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test_server/ts_lib.erl b/lib/common_test/test_server/ts_lib.erl
index 7c3f450194..a7be740c5c 100644
--- a/lib/common_test/test_server/ts_lib.erl
+++ b/lib/common_test/test_server/ts_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test_server/ts_make.erl b/lib/common_test/test_server/ts_make.erl
index 921edb264a..456e913c39 100644
--- a/lib/common_test/test_server/ts_make.erl
+++ b/lib/common_test/test_server/ts_make.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/common_test/test_server/ts_run.erl b/lib/common_test/test_server/ts_run.erl
index 188094921d..66db1ff9a7 100644
--- a/lib/common_test/test_server/ts_run.erl
+++ b/lib/common_test/test_server/ts_run.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -261,7 +261,7 @@ run_batch(Vars, _Spec, State) ->
Command = State#state.command ++ " -noinput -s erlang halt",
ts_lib:progress(Vars, 1, "Command: ~ts~n", [Command]),
io:format(user, "Command: ~ts~n",[Command]),
- Port = open_port({spawn, Command}, [stream, in, eof]),
+ Port = open_port({spawn, Command}, [stream, in, eof, exit_status]),
Timeout = 30000 * case os:getenv("TS_RUN_VALGRIND") of
false -> 1;
_ -> 100
@@ -284,7 +284,16 @@ tricky_print_data(Port, Timeout) ->
ok
after 1 -> % force context switch
ok
- end
+ end,
+ receive
+ {Port, {exit_status, 0}} ->
+ ok;
+ {Port, {exit_status, N}} ->
+ io:format(user, "Test run exited with status ~p~n", [N])
+ after 1 ->
+ %% This shouldn't happen, but better safe then hanging
+ ok
+ end
after Timeout ->
case erl_epmd:names() of
{ok,Names} ->
diff --git a/lib/common_test/vsn.mk b/lib/common_test/vsn.mk
index bcd31293fb..2fab4d3883 100644
--- a/lib/common_test/vsn.mk
+++ b/lib/common_test/vsn.mk
@@ -1 +1 @@
-COMMON_TEST_VSN = 1.12
+COMMON_TEST_VSN = 1.13
diff --git a/lib/compiler/Makefile b/lib/compiler/Makefile
index bd63f7031a..b8b2f562a2 100644
--- a/lib/compiler/Makefile
+++ b/lib/compiler/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/compiler/doc/src/Makefile b/lib/compiler/doc/src/Makefile
index b989325686..c6864cb835 100644
--- a/lib/compiler/doc/src/Makefile
+++ b/lib/compiler/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/compiler/doc/src/book.xml b/lib/compiler/doc/src/book.xml
index 8de3fae69a..af6b4cf47a 100644
--- a/lib/compiler/doc/src/book.xml
+++ b/lib/compiler/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml
index db701409db..954750fcdd 100644
--- a/lib/compiler/doc/src/compile.xml
+++ b/lib/compiler/doc/src/compile.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml
index 8ed71db54a..ae375c5f58 100644
--- a/lib/compiler/doc/src/notes.xml
+++ b/lib/compiler/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/compiler/doc/src/notes_history.xml b/lib/compiler/doc/src/notes_history.xml
index 85216b2c66..16bfb3d34b 100644
--- a/lib/compiler/doc/src/notes_history.xml
+++ b/lib/compiler/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/compiler/doc/src/part_notes.xml b/lib/compiler/doc/src/part_notes.xml
index 5000f50dca..c1f0ff3861 100644
--- a/lib/compiler/doc/src/part_notes.xml
+++ b/lib/compiler/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/compiler/doc/src/part_notes_history.xml b/lib/compiler/doc/src/part_notes_history.xml
index 046b4893c3..4019676b83 100644
--- a/lib/compiler/doc/src/part_notes_history.xml
+++ b/lib/compiler/doc/src/part_notes_history.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2006</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/compiler/doc/src/ref_man.xml b/lib/compiler/doc/src/ref_man.xml
index d360e7963f..f5466553c0 100644
--- a/lib/compiler/doc/src/ref_man.xml
+++ b/lib/compiler/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/compiler/src/Makefile b/lib/compiler/src/Makefile
index f75beaba20..518c89d044 100644
--- a/lib/compiler/src/Makefile
+++ b/lib/compiler/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2013. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_a.erl b/lib/compiler/src/beam_a.erl
index f0f2ee08c2..91e6d80da3 100644
--- a/lib/compiler/src/beam_a.erl
+++ b/lib/compiler/src/beam_a.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_asm.erl b/lib/compiler/src/beam_asm.erl
index 95be471de3..f6ca7a0afb 100644
--- a/lib/compiler/src/beam_asm.erl
+++ b/lib/compiler/src/beam_asm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -225,10 +225,12 @@ flatten_imports(Imps) ->
list_to_binary(map(fun({M,F,A}) -> <<M:32,F:32,A:32>> end, Imps)).
build_attributes(Opts, SourceFile, Attr, MD5) ->
+ Misc0 = case SourceFile of
+ [] -> [];
+ [_|_] -> [{source,SourceFile}]
+ end,
Misc = case member(slim, Opts) of
- false ->
- {{Y,Mo,D},{H,Mi,S}} = erlang:universaltime(),
- [{time,{Y,Mo,D,H,Mi,S}},{source,SourceFile}];
+ false -> Misc0;
true -> []
end,
Compile = [{options,Opts},{version,?COMPILER_VSN}|Misc],
diff --git a/lib/compiler/src/beam_block.erl b/lib/compiler/src/beam_block.erl
index d1052303e0..a8cfdffdf3 100644
--- a/lib/compiler/src/beam_block.erl
+++ b/lib/compiler/src/beam_block.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -88,7 +88,9 @@ collect_block([I|Is]=Is0, Acc) ->
case collect(I) of
error -> {reverse(Acc),Is0};
Instr -> collect_block(Is, [Instr|Acc])
- end.
+ end;
+collect_block([], Acc) ->
+ {reverse(Acc),[]}.
collect({allocate,N,R}) -> {set,[],[],{alloc,R,{nozero,N,0,[]}}};
collect({allocate_zero,N,R}) -> {set,[],[],{alloc,R,{zero,N,0,[]}}};
diff --git a/lib/compiler/src/beam_bool.erl b/lib/compiler/src/beam_bool.erl
index efd935f666..f9a08f8718 100644
--- a/lib/compiler/src/beam_bool.erl
+++ b/lib/compiler/src/beam_bool.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_bs.erl b/lib/compiler/src/beam_bs.erl
index 55fa7ce10c..2aed98d4e7 100644
--- a/lib/compiler/src/beam_bs.erl
+++ b/lib/compiler/src/beam_bs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_bsm.erl b/lib/compiler/src/beam_bsm.erl
index 62356928ae..286307a4be 100644
--- a/lib/compiler/src/beam_bsm.erl
+++ b/lib/compiler/src/beam_bsm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_clean.erl b/lib/compiler/src/beam_clean.erl
index d9108c383d..10805a3c36 100644
--- a/lib/compiler/src/beam_clean.erl
+++ b/lib/compiler/src/beam_clean.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_dead.erl b/lib/compiler/src/beam_dead.erl
index 11129c39bc..dd42add433 100644
--- a/lib/compiler/src/beam_dead.erl
+++ b/lib/compiler/src/beam_dead.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_dict.erl b/lib/compiler/src/beam_dict.erl
index 654fb47dbd..9565ab74c4 100644
--- a/lib/compiler/src/beam_dict.erl
+++ b/lib/compiler/src/beam_dict.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_disasm.erl b/lib/compiler/src/beam_disasm.erl
index 84a94f09e3..5badcce696 100644
--- a/lib/compiler/src/beam_disasm.erl
+++ b/lib/compiler/src/beam_disasm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_disasm.hrl b/lib/compiler/src/beam_disasm.hrl
index 30e3f22665..e18214644f 100644
--- a/lib/compiler/src/beam_disasm.hrl
+++ b/lib/compiler/src/beam_disasm.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_except.erl b/lib/compiler/src/beam_except.erl
index e33655281f..cb3a6b79de 100644
--- a/lib/compiler/src/beam_except.erl
+++ b/lib/compiler/src/beam_except.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_flatten.erl b/lib/compiler/src/beam_flatten.erl
index 13c243b155..36369bd0b4 100644
--- a/lib/compiler/src/beam_flatten.erl
+++ b/lib/compiler/src/beam_flatten.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_jump.erl b/lib/compiler/src/beam_jump.erl
index 3b6eb19fe8..359248c6af 100644
--- a/lib/compiler/src/beam_jump.erl
+++ b/lib/compiler/src/beam_jump.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_listing.erl b/lib/compiler/src/beam_listing.erl
index fd5c0a042b..ce566373bb 100644
--- a/lib/compiler/src/beam_listing.erl
+++ b/lib/compiler/src/beam_listing.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_peep.erl b/lib/compiler/src/beam_peep.erl
index 0c1abfe6a0..c8bef31824 100644
--- a/lib/compiler/src/beam_peep.erl
+++ b/lib/compiler/src/beam_peep.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -83,6 +83,9 @@ peep([{gc_bif,_,_,_,_,Dst}=I|Is], SeenTests0, Acc) ->
%% Kill all remembered tests that depend on the destination register.
SeenTests = kill_seen(Dst, SeenTests0),
peep(Is, SeenTests, [I|Acc]);
+peep([{jump,{f,L}},{label,L}=I|Is], _, Acc) ->
+ %% Sometimes beam_jump has missed this optimization.
+ peep(Is, gb_sets:empty(), [I|Acc]);
peep([{select,Op,R,F,Vls0}|Is], _, Acc) ->
case prune_redundant_values(Vls0, F) of
[] ->
diff --git a/lib/compiler/src/beam_receive.erl b/lib/compiler/src/beam_receive.erl
index 7276537949..c593184746 100644
--- a/lib/compiler/src/beam_receive.erl
+++ b/lib/compiler/src/beam_receive.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_reorder.erl b/lib/compiler/src/beam_reorder.erl
index 41586a7bf2..f1c0b3ef91 100644
--- a/lib/compiler/src/beam_reorder.erl
+++ b/lib/compiler/src/beam_reorder.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_split.erl b/lib/compiler/src/beam_split.erl
index bb1c0e23a9..c83c686953 100644
--- a/lib/compiler/src/beam_split.erl
+++ b/lib/compiler/src/beam_split.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -47,6 +47,8 @@ split_block([{set,[R],[_,_,_]=As,{bif,is_record,{f,Lbl}}}|Is], Bl, Acc) ->
split_block(Is, [], [{bif,is_record,{f,Lbl},As,R}|make_block(Bl, Acc)]);
split_block([{set,[R],As,{bif,N,{f,Lbl}=Fail}}|Is], Bl, Acc) when Lbl =/= 0 ->
split_block(Is, [], [{bif,N,Fail,As,R}|make_block(Bl, Acc)]);
+split_block([{set,[R],As,{bif,raise,{f,_}=Fail}}|Is], Bl, Acc) ->
+ split_block(Is, [], [{bif,raise,Fail,As,R}|make_block(Bl, Acc)]);
split_block([{set,[R],As,{alloc,Live,{gc_bif,N,{f,Lbl}=Fail}}}|Is], Bl, Acc)
when Lbl =/= 0 ->
split_block(Is, [], [{gc_bif,N,Fail,Live,As,R}|make_block(Bl, Acc)]);
diff --git a/lib/compiler/src/beam_trim.erl b/lib/compiler/src/beam_trim.erl
index 509e013b62..a8dc6805bc 100644
--- a/lib/compiler/src/beam_trim.erl
+++ b/lib/compiler/src/beam_trim.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_type.erl b/lib/compiler/src/beam_type.erl
index 4b45c28623..5076c5eb96 100644
--- a/lib/compiler/src/beam_type.erl
+++ b/lib/compiler/src/beam_type.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/beam_utils.erl b/lib/compiler/src/beam_utils.erl
index 68d6105cfa..37f89dd677 100644
--- a/lib/compiler/src/beam_utils.erl
+++ b/lib/compiler/src/beam_utils.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -484,6 +484,17 @@ check_liveness(R, [{get_map_elements,{f,Fail},S,{list,L}}|Is], St0) ->
Other
end
end;
+check_liveness(R, [{put_map,{f,_},_,Src,_D,Live,{list,_}}|_], St0) ->
+ case R of
+ Src ->
+ {used,St0};
+ {x,X} when X < Live ->
+ {used,St0};
+ {x,_} ->
+ {killed,St0};
+ {y,_} ->
+ {unknown,St0}
+ end;
check_liveness(R, [{test_heap,N,Live}|Is], St) ->
I = {block,[{set,[],[],{alloc,Live,{nozero,nostack,N,[]}}}]},
check_liveness(R, [I|Is], St);
@@ -570,9 +581,9 @@ check_killed_block(R, [{set,Ds,Ss,_Op}|Is]) ->
false -> check_killed_block(R, Is)
end
end;
-check_killed_block(R, [{'%live',Live,_}|Is]) ->
+check_killed_block(R, [{'%live',_,Regs}|Is]) ->
case R of
- {x,X} when X >= Live -> killed;
+ {x,X} when (Regs bsr X) band 1 =:= 0 -> killed;
_ -> check_killed_block(R, Is)
end;
check_killed_block(_, []) -> transparent.
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl
index fd38fc0095..6877141885 100644
--- a/lib/compiler/src/beam_validator.erl
+++ b/lib/compiler/src/beam_validator.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -509,6 +509,9 @@ valfun_4({bif,element,{f,Fail},[Pos,Tuple],Dst}, Vst0) ->
TupleType = upgrade_tuple_type({tuple,[get_tuple_size(PosType)]}, TupleType0),
Vst = set_type(TupleType, Tuple, Vst1),
set_type_reg(term, Dst, Vst);
+valfun_4({bif,raise,{f,0},Src,_Dst}, Vst) ->
+ validate_src(Src, Vst),
+ kill_state(Vst);
valfun_4({bif,Op,{f,Fail},Src,Dst}, Vst0) ->
validate_src(Src, Vst0),
Vst = branch_state(Fail, Vst0),
diff --git a/lib/compiler/src/beam_z.erl b/lib/compiler/src/beam_z.erl
index 8381578b68..6c7f8543c2 100644
--- a/lib/compiler/src/beam_z.erl
+++ b/lib/compiler/src/beam_z.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,6 +24,8 @@
-export([module/2]).
+-import(lists, [dropwhile/2]).
+
module({Mod,Exp,Attr,Fs0,Lc}, _Opt) ->
Fs = [function(F) || F <- Fs0],
{ok,{Mod,Exp,Attr,Fs,Lc}}.
@@ -51,6 +53,16 @@ undo_renames([{call,A,F},return|Is]) ->
[{call_only,A,F}|undo_renames(Is)];
undo_renames([{call_ext,A,F},return|Is]) ->
[{call_ext_only,A,F}|undo_renames(Is)];
+undo_renames([{bif,raise,_,_,_}=I|Is0]) ->
+ %% A minor optimization. Done here because:
+ %% (1) beam_jump may move or share 'raise' instructions, and that
+ %% may confuse beam_validator.
+ %% (2) beam_trim cannot do its optimization if the 'deallocate'
+ %% instruction after 'raise' has been removed.
+ Is = dropwhile(fun({label,_}) -> false;
+ (_) -> true
+ end, Is0),
+ [I|undo_renames(Is)];
undo_renames([I|Is]) ->
[undo_rename(I)|undo_renames(Is)];
undo_renames([]) -> [].
diff --git a/lib/compiler/src/cerl.erl b/lib/compiler/src/cerl.erl
index e7a2b8177a..6dc162db40 100644
--- a/lib/compiler/src/cerl.erl
+++ b/lib/compiler/src/cerl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -126,6 +126,7 @@
%% keep map exports here for now
c_map_pattern/1,
is_c_map/1,
+ is_c_map_pattern/1,
map_es/1,
map_arg/1,
update_c_map/3,
@@ -134,7 +135,7 @@
ann_c_map_pattern/2,
map_pair_op/1,map_pair_key/1,map_pair_val/1,
update_c_map_pair/4,
- c_map_pair/2,
+ c_map_pair/2, c_map_pair_exact/2,
ann_c_map_pair/4
]).
@@ -1636,6 +1637,11 @@ is_c_map_empty(#c_map{ es=[] }) -> true;
is_c_map_empty(#c_literal{val=M}) when is_map(M),map_size(M) =:= 0 -> true;
is_c_map_empty(_) -> false.
+-spec is_c_map_pattern(c_map()) -> boolean().
+
+is_c_map_pattern(#c_map{is_pat=IsPat}) ->
+ IsPat.
+
-spec ann_c_map([term()], [c_map_pair()]) -> c_map() | c_literal().
ann_c_map(As, Es) ->
@@ -1688,6 +1694,11 @@ map_pair_op(#c_map_pair{op=Op}) -> Op.
c_map_pair(Key,Val) ->
#c_map_pair{op=#c_literal{val=assoc},key=Key,val=Val}.
+-spec c_map_pair_exact(cerl(), cerl()) -> c_map_pair().
+
+c_map_pair_exact(Key,Val) ->
+ #c_map_pair{op=#c_literal{val=exact},key=Key,val=Val}.
+
-spec ann_c_map_pair([term()], cerl(), cerl(), cerl()) ->
c_map_pair().
diff --git a/lib/compiler/src/cerl_clauses.erl b/lib/compiler/src/cerl_clauses.erl
index 4d2f1ebd1b..805095e30c 100644
--- a/lib/compiler/src/cerl_clauses.erl
+++ b/lib/compiler/src/cerl_clauses.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/cerl_inline.erl b/lib/compiler/src/cerl_inline.erl
index cbcacf9e8e..2a8cf2e758 100644
--- a/lib/compiler/src/cerl_inline.erl
+++ b/lib/compiler/src/cerl_inline.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/cerl_trees.erl b/lib/compiler/src/cerl_trees.erl
index b86be95cab..b3decbec1f 100644
--- a/lib/compiler/src/cerl_trees.erl
+++ b/lib/compiler/src/cerl_trees.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -61,6 +61,7 @@
map_arg/1, map_es/1,
ann_c_map/3,
update_c_map/3,
+ is_c_map_pattern/1, ann_c_map_pattern/2,
map_pair_key/1,map_pair_val/1,map_pair_op/1,
ann_c_map_pair/4,
update_c_map_pair/4
@@ -752,10 +753,17 @@ label(T, N, Env) ->
{As, N2} = label_ann(T, N1),
{ann_c_tuple_skel(As, Ts), N2};
map ->
- {M, N1} = label(map_arg(T), N, Env),
- {Ts, N2} = label_list(map_es(T), N1, Env),
- {As, N3} = label_ann(T, N2),
- {ann_c_map(As, M, Ts), N3};
+ case is_c_map_pattern(T) of
+ false ->
+ {M, N1} = label(map_arg(T), N, Env),
+ {Ts, N2} = label_list(map_es(T), N1, Env),
+ {As, N3} = label_ann(T, N2),
+ {ann_c_map(As, M, Ts), N3};
+ true ->
+ {Ts, N1} = label_list(map_es(T), N, Env),
+ {As, N2} = label_ann(T, N1),
+ {ann_c_map_pattern(As, Ts), N2}
+ end;
map_pair ->
{Op, N1} = label(map_pair_op(T), N, Env),
{Key, N2} = label(map_pair_key(T), N1, Env),
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index 46917905de..149086152a 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -1317,7 +1317,7 @@ generate_key(String) when is_list(String) ->
encrypt({des3_cbc=Type,Key,IVec,BlockSize}, Bin0) ->
Bin1 = case byte_size(Bin0) rem BlockSize of
0 -> Bin0;
- N -> list_to_binary([Bin0,crypto:rand_bytes(BlockSize-N)])
+ N -> list_to_binary([Bin0,crypto:strong_rand_bytes(BlockSize-N)])
end,
Bin = crypto:block_encrypt(Type, Key, IVec, Bin1),
TypeString = atom_to_list(Type),
@@ -1328,7 +1328,7 @@ save_core_code(St) ->
beam_asm(#compile{ifile=File,code=Code0,
abstract_code=Abst,mod_options=Opts0}=St) ->
- Source = filename:absname(File),
+ Source = paranoid_absname(File),
Opts1 = lists:map(fun({debug_info_key,_}) -> {debug_info_key,'********'};
(Other) -> Other
end, Opts0),
@@ -1337,6 +1337,16 @@ beam_asm(#compile{ifile=File,code=Code0,
{ok,Code} -> {ok,St#compile{code=Code,abstract_code=[]}}
end.
+paranoid_absname(""=File) ->
+ File;
+paranoid_absname(File) ->
+ case file:get_cwd() of
+ {ok,Cwd} ->
+ filename:absname(File, Cwd);
+ _ ->
+ File
+ end.
+
test_native(#compile{options=Opts}) ->
%% This test is done late, in case some other option has turned off native.
%% 'native' given on the command line can be overridden by
@@ -1681,6 +1691,7 @@ help(_) ->
%% Compile entry point for erl_compile.
compile(File0, _OutFile, Options) ->
+ pre_load(),
File = shorten_filename(File0),
case file(File, make_erl_options(Options)) of
{ok,_Mod} -> ok;
@@ -1745,3 +1756,47 @@ make_erl_options(Opts) ->
end,
Options ++ [report_errors, {cwd, Cwd}, {outdir, Outdir}|
[{i, Dir} || Dir <- Includes]] ++ Specific.
+
+pre_load() ->
+ L = [beam_a,
+ beam_asm,
+ beam_block,
+ beam_bool,
+ beam_bs,
+ beam_bsm,
+ beam_clean,
+ beam_dead,
+ beam_dict,
+ beam_except,
+ beam_flatten,
+ beam_jump,
+ beam_opcodes,
+ beam_peep,
+ beam_receive,
+ beam_reorder,
+ beam_split,
+ beam_trim,
+ beam_type,
+ beam_utils,
+ beam_validator,
+ beam_z,
+ cerl,
+ cerl_clauses,
+ cerl_sets,
+ cerl_trees,
+ core_lib,
+ epp,
+ erl_bifs,
+ erl_expand_records,
+ erl_lint,
+ erl_parse,
+ erl_scan,
+ sys_core_dsetel,
+ sys_core_fold,
+ sys_pre_expand,
+ v3_codegen,
+ v3_core,
+ v3_kernel,
+ v3_life],
+ _ = code:ensure_modules_loaded(L),
+ ok.
diff --git a/lib/compiler/src/compiler.app.src b/lib/compiler/src/compiler.app.src
index a2b2a1d277..1fd7800e85 100644
--- a/lib/compiler/src/compiler.app.src
+++ b/lib/compiler/src/compiler.app.src
@@ -1,7 +1,7 @@
% This is an -*- erlang -*- file.
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/compiler.appup.src b/lib/compiler/src/compiler.appup.src
index 3ada2e933f..e9db37e203 100644
--- a/lib/compiler/src/compiler.appup.src
+++ b/lib/compiler/src/compiler.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/core_lib.erl b/lib/compiler/src/core_lib.erl
index 839c736ff2..c1806272bd 100644
--- a/lib/compiler/src/core_lib.erl
+++ b/lib/compiler/src/core_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/core_parse.hrl b/lib/compiler/src/core_parse.hrl
index ecf6cc9956..83a6f0179c 100644
--- a/lib/compiler/src/core_parse.hrl
+++ b/lib/compiler/src/core_parse.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/core_parse.yrl b/lib/compiler/src/core_parse.yrl
index 59cfc97ebd..8028aa99bb 100644
--- a/lib/compiler/src/core_parse.yrl
+++ b/lib/compiler/src/core_parse.yrl
@@ -1,7 +1,7 @@
%% -*-Erlang-*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -47,12 +47,14 @@ receive_expr timeout try_expr
sequence catch_expr
variable clause clause_pattern
-map_expr map_pairs map_pair map_pair_assoc map_pair_exact
+map_expr anno_map_expr map_pairs anno_map_pair map_pair map_pair_assoc map_pair_exact
map_pattern map_pair_patterns map_pair_pattern
-annotation anno_fun anno_expression anno_expressions
+annotation anno_atom anno_fun anno_expression anno_expressions
anno_variable anno_variables anno_pattern anno_patterns
anno_function_name
+anno_literal
+anno_segment anno_segment_pattern
anno_clause anno_clauses.
Terminals
@@ -90,7 +92,7 @@ module_definition ->
module_definition ->
'(' 'module' atom module_export module_attribute module_defs 'end'
'-|' annotation ')' :
- #c_module{anno='$9',name=tok_val('$3'),exports='$4',
+ #c_module{anno='$9',name=#c_literal{val=tok_val('$3')},exports='$4',
attrs='$5',defs='$6'}.
module_export -> '[' ']' : [].
@@ -99,7 +101,7 @@ module_export -> '[' exported_names ']' : '$2'.
exported_names -> exported_name ',' exported_names : ['$1' | '$3'].
exported_names -> exported_name : ['$1'].
-exported_name -> function_name : '$1'.
+exported_name -> anno_function_name : '$1'.
module_attribute -> 'attributes' '[' ']' : [].
module_attribute -> 'attributes' '[' attribute_list ']' : '$3'.
@@ -107,8 +109,16 @@ module_attribute -> 'attributes' '[' attribute_list ']' : '$3'.
attribute_list -> attribute ',' attribute_list : ['$1' | '$3'].
attribute_list -> attribute : ['$1'].
-attribute -> atom '=' literal :
- {#c_literal{val=tok_val('$1')},'$3'}.
+attribute -> anno_atom '=' anno_literal :
+ {'$1','$3'}.
+
+anno_atom -> atom :
+ cerl:c_atom(tok_val('$1')).
+anno_atom -> '(' atom '-|' annotation ')' :
+ cerl:ann_c_atom('$4', tok_val('$2')).
+
+anno_literal -> literal : '$1'.
+anno_literal -> '(' literal '-|' annotation ')' : cerl:set_ann('$2', '$4').
module_defs -> function_definitions : '$1'.
@@ -186,7 +196,9 @@ tuple_pattern -> '{' anno_patterns '}' : c_tuple('$2').
map_pattern -> '~' '{' '}' '~' : c_map_pattern([]).
map_pattern -> '~' '{' map_pair_patterns '}' '~' :
- c_map_pattern(lists:sort('$3')).
+ c_map_pattern('$3').
+map_pattern -> '~' '{' map_pair_patterns '|' anno_map_expr '}' '~' :
+ ann_c_map_pattern('$5', '$3').
map_pair_patterns -> map_pair_pattern : ['$1'].
map_pair_patterns -> map_pair_pattern ',' map_pair_patterns : ['$1' | '$3'].
@@ -194,6 +206,9 @@ map_pair_patterns -> map_pair_pattern ',' map_pair_patterns : ['$1' | '$3'].
map_pair_pattern -> anno_expression ':=' anno_pattern :
#c_map_pair{op=#c_literal{val=exact},
key='$1',val='$3'}.
+map_pair_pattern -> '(' anno_expression ':=' anno_pattern '-|' annotation ')' :
+ #c_map_pair{anno='$6',op=#c_literal{val=exact},
+ key='$2',val='$4'}.
cons_pattern -> '[' anno_pattern tail_pattern :
c_cons('$2', '$3').
@@ -206,8 +221,12 @@ tail_pattern -> ',' anno_pattern tail_pattern :
binary_pattern -> '#' '{' '}' '#' : #c_binary{segments=[]}.
binary_pattern -> '#' '{' segment_patterns '}' '#' : #c_binary{segments='$3'}.
-segment_patterns -> segment_pattern ',' segment_patterns : ['$1' | '$3'].
-segment_patterns -> segment_pattern : ['$1'].
+segment_patterns -> anno_segment_pattern ',' segment_patterns : ['$1' | '$3'].
+segment_patterns -> anno_segment_pattern : ['$1'].
+
+anno_segment_pattern -> segment_pattern : '$1'.
+anno_segment_pattern -> '(' segment_pattern '-|' annotation ')' :
+ cerl:set_ann('$2', '$4').
segment_pattern -> '#' '<' anno_pattern '>' '(' anno_expressions ')':
case '$6' of
@@ -289,11 +308,17 @@ tuple -> '{' anno_expressions '}' : c_tuple('$2').
map_expr -> '~' '{' '}' '~' : c_map([]).
map_expr -> '~' '{' map_pairs '}' '~' : c_map('$3').
-map_expr -> '~' '{' map_pairs '|' variable '}' '~' : ann_c_map([], '$5', '$3').
-map_expr -> '~' '{' map_pairs '|' map_expr '}' '~' : ann_c_map([], '$5', '$3').
+map_expr -> '~' '{' map_pairs '|' anno_variable '}' '~' : ann_c_map([], '$5', '$3').
+map_expr -> '~' '{' map_pairs '|' anno_map_expr '}' '~' : ann_c_map([], '$5', '$3').
-map_pairs -> map_pair : ['$1'].
-map_pairs -> map_pair ',' map_pairs : ['$1' | '$3'].
+anno_map_expr -> map_expr : '$1'.
+anno_map_expr -> '(' map_expr '-|' annotation ')' : cerl:set_ann('$2', '$4').
+
+map_pairs -> anno_map_pair : ['$1'].
+map_pairs -> anno_map_pair ',' map_pairs : ['$1' | '$3'].
+
+anno_map_pair -> map_pair : '$1'.
+anno_map_pair -> '(' map_pair '-|' annotation ')' : cerl:set_ann('$2', '$4').
map_pair -> map_pair_assoc : '$1'.
map_pair -> map_pair_exact : '$1'.
@@ -312,8 +337,11 @@ tail -> ',' anno_expression tail : c_cons('$2', '$3').
binary -> '#' '{' '}' '#' : #c_literal{val = <<>>}.
binary -> '#' '{' segments '}' '#' : make_binary('$3').
-segments -> segment ',' segments : ['$1' | '$3'].
-segments -> segment : ['$1'].
+segments -> anno_segment ',' segments : ['$1' | '$3'].
+segments -> anno_segment : ['$1'].
+
+anno_segment -> segment : '$1'.
+anno_segment -> '(' segment '-|' annotation ')' : cerl:set_ann('$2', '$4').
segment -> '#' '<' anno_expression '>' '(' anno_expressions ')':
case '$6' of
@@ -413,7 +441,8 @@ Erlang code.
-include("core_parse.hrl").
--import(cerl, [ann_c_map/3,c_cons/2,c_map/1,c_map_pattern/1,c_tuple/1]).
+-import(cerl, [ann_c_map/3,ann_c_map_pattern/2,c_cons/2,c_map/1,
+ c_map_pattern/1,c_tuple/1]).
tok_val(T) -> element(3, T).
tok_line(T) -> element(2, T).
diff --git a/lib/compiler/src/core_pp.erl b/lib/compiler/src/core_pp.erl
index c2a6a81d5e..f34a5c034f 100644
--- a/lib/compiler/src/core_pp.erl
+++ b/lib/compiler/src/core_pp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
-module(core_pp).
--export([format/1]).
+-export([format/1,format_all/1]).
-include("core_parse.hrl").
@@ -37,21 +37,32 @@
indent = 0 :: integer(),
item_indent = 2 :: integer(),
body_indent = 4 :: integer(),
- tab_width = 8 :: non_neg_integer(),
- line = 0 :: integer()}).
+ line = 0 :: integer(),
+ clean = true :: boolean()}).
+
+-define(TAB_WIDTH, 8).
-spec format(cerl:cerl()) -> iolist().
format(Node) ->
format(Node, #ctxt{}).
-maybe_anno(Node, Fun, Ctxt) ->
+-spec format_all(cerl:cerl()) -> iolist().
+
+format_all(Node) ->
+ format(Node, #ctxt{clean=false}).
+
+maybe_anno(Node, Fun, #ctxt{clean=false}=Ctxt) ->
As = cerl:get_ann(Node),
- case get_line(As) of
+ maybe_anno(Node, Fun, Ctxt, As);
+maybe_anno(Node, Fun, #ctxt{clean=true}=Ctxt) ->
+ As0 = cerl:get_ann(Node),
+ case get_line(As0) of
none ->
- maybe_anno(Node, Fun, Ctxt, As);
+ maybe_anno(Node, Fun, Ctxt, As0);
Line ->
- if Line > Ctxt#ctxt.line ->
+ As = strip_line(As0),
+ if Line > Ctxt#ctxt.line ->
[io_lib:format("%% Line ~w",[Line]),
nl_indent(Ctxt),
maybe_anno(Node, Fun, Ctxt#ctxt{line = Line}, As)
@@ -61,22 +72,22 @@ maybe_anno(Node, Fun, Ctxt) ->
end
end.
-maybe_anno(Node, Fun, Ctxt, As) ->
- case strip_line(As) of
- [] ->
- Fun(Node, Ctxt);
- List ->
- Ctxt1 = add_indent(Ctxt, 2),
- Ctxt2 = add_indent(Ctxt1, 3),
- ["( ",
- Fun(Node, Ctxt1),
- nl_indent(Ctxt1),
- "-| ",format_anno(List, Ctxt2)," )"
- ]
- end.
+maybe_anno(Node, Fun, Ctxt, []) ->
+ Fun(Node, Ctxt);
+maybe_anno(Node, Fun, Ctxt, List) ->
+ Ctxt1 = add_indent(Ctxt, 2),
+ Ctxt2 = add_indent(Ctxt1, 3),
+ ["( ",
+ Fun(Node, Ctxt1),
+ nl_indent(Ctxt1),
+ "-| ",format_anno(List, Ctxt2)," )"
+ ].
format_anno([_|_]=List, Ctxt) ->
[$[,format_anno_list(List, Ctxt),$]];
+format_anno({file,Name}, _Ctxt) ->
+ %% Optimization: Reduces file size considerably.
+ io_lib:format("{'file',~p}", [Name]);
format_anno(Tuple, Ctxt) when is_tuple(Tuple) ->
[${,format_anno_list(tuple_to_list(Tuple), Ctxt),$}];
format_anno(Val, Ctxt) when is_atom(Val) ->
@@ -172,7 +183,8 @@ format_1(#c_tuple{es=Es}, Ctxt) ->
format_hseq(Es, ",", add_indent(Ctxt, 1), fun format/2),
$}
];
-format_1(#c_map{arg=#c_literal{val=M},es=Es}, Ctxt) when is_map(M),map_size(M)=:=0 ->
+format_1(#c_map{arg=#c_literal{anno=[],val=M},es=Es}, Ctxt)
+ when is_map(M), map_size(M) =:= 0 ->
["~{",
format_hseq(Es, ",", add_indent(Ctxt, 1), fun format/2),
"}~"
@@ -195,9 +207,16 @@ format_1(#c_values{es=Es}, Ctxt) ->
format_1(#c_alias{var=V,pat=P}, Ctxt) ->
Txt = [format(V, Ctxt)|" = "],
[Txt|format(P, add_indent(Ctxt, width(Txt, Ctxt)))];
-format_1(#c_let{vars=Vs0,arg=A,body=B}, Ctxt) ->
- Vs = [cerl:set_ann(V, []) || V <- Vs0],
- case is_simple_term(A) of
+format_1(#c_let{anno=Anno0,vars=Vs0,arg=A0,body=B}, #ctxt{clean=Clean}=Ctxt) ->
+ {Vs,A,Anno} = case Clean of
+ false ->
+ {Vs0,A0,Anno0};
+ true ->
+ {[cerl:set_ann(V, []) || V <- Vs0],
+ cerl:set_ann(A0, []),
+ []}
+ end,
+ case is_simple_term(A) andalso Anno =:= [] of
false ->
Ctxt1 = add_indent(Ctxt, Ctxt#ctxt.body_indent),
["let ",
@@ -214,7 +233,7 @@ format_1(#c_let{vars=Vs0,arg=A,body=B}, Ctxt) ->
["let ",
format_values(Vs, add_indent(Ctxt, 4)),
" = ",
- format(cerl:set_ann(A, []), Ctxt1),
+ format(A, Ctxt1),
nl_indent(Ctxt),
"in "
| format(B, add_indent(Ctxt, 4))
@@ -362,7 +381,10 @@ format_values(Vs, Ctxt) ->
format_hseq(Vs, ",", add_indent(Ctxt, 1), fun format/2),
$>].
-format_bitstr(#c_bitstr{val=V,size=S,unit=U,type=T,flags=Fs}, Ctxt0) ->
+format_bitstr(Node, Ctxt) ->
+ maybe_anno(Node, fun do_format_bitstr/2, Ctxt).
+
+do_format_bitstr(#c_bitstr{val=V,size=S,unit=U,type=T,flags=Fs}, Ctxt0) ->
Vs = [S, U, T, Fs],
Ctxt1 = add_indent(Ctxt0, 2),
Val = format(V, Ctxt1),
@@ -387,7 +409,7 @@ format_clause_1(#c_clause{pats=Ps,guard=G,body=B}, Ctxt) ->
width(Ptxt, Ctxt) + 6))];
false ->
[nl_indent(Ctxt2), "when ",
- format_guard(G, add_indent(Ctxt2, 2))]
+ format_guard(G, add_indent(set_class(Ctxt2, expr), 2))]
end++
" ->",
nl_indent(Ctxt2)
@@ -449,37 +471,46 @@ format_map_pair(Op, K, V, Ctxt0) ->
Ctxt2 = add_indent(Ctxt0, width(Txt, Ctxt1)),
[Txt,Op,format(V, Ctxt2)].
-indent(Ctxt) -> indent(Ctxt#ctxt.indent, Ctxt).
-
-indent(N, _) when N =< 0 -> "";
-indent(N, Ctxt) ->
- T = Ctxt#ctxt.tab_width,
- string:chars($\t, N div T, string:chars($\s, N rem T)).
+indent(#ctxt{indent=N}) ->
+ if
+ N =< 0 ->
+ "";
+ true ->
+ string:chars($\t, N div ?TAB_WIDTH, spaces(N rem ?TAB_WIDTH))
+ end.
nl_indent(Ctxt) -> [$\n|indent(Ctxt)].
+spaces(0) -> "";
+spaces(1) -> " ";
+spaces(2) -> " ";
+spaces(3) -> " ";
+spaces(4) -> " ";
+spaces(5) -> " ";
+spaces(6) -> " ";
+spaces(7) -> " ".
unindent(T, Ctxt) ->
- unindent(T, Ctxt#ctxt.indent, Ctxt, []).
+ unindent(T, Ctxt#ctxt.indent, []).
-unindent(T, N, _, C) when N =< 0 ->
+unindent(T, N, C) when N =< 0 ->
[T|C];
-unindent([$\s|T], N, Ctxt, C) ->
- unindent(T, N - 1, Ctxt, C);
-unindent([$\t|T], N, Ctxt, C) ->
- Tab = Ctxt#ctxt.tab_width,
+unindent([$\s|T], N, C) ->
+ unindent(T, N - 1, C);
+unindent([$\t|T], N, C) ->
+ Tab = ?TAB_WIDTH,
if N >= Tab ->
- unindent(T, N - Tab, Ctxt, C);
+ unindent(T, N - Tab, C);
true ->
- unindent([string:chars($\s, Tab - N)|T], 0, Ctxt, C)
+ unindent([spaces(Tab - N)|T], 0, C)
end;
-unindent([L|T], N, Ctxt, C) when is_list(L) ->
- unindent(L, N, Ctxt, [T|C]);
-unindent([H|T], _, _, C) ->
+unindent([L|T], N, C) when is_list(L) ->
+ unindent(L, N, [T|C]);
+unindent([H|T], _, C) ->
[H|[T|C]];
-unindent([], N, Ctxt, [H|T]) ->
- unindent(H, N, Ctxt, T);
-unindent([], _, _, []) -> [].
+unindent([], N, [H|T]) ->
+ unindent(H, N, T);
+unindent([], _, []) -> [].
width(Txt, Ctxt) ->
@@ -488,7 +519,7 @@ width(Txt, Ctxt) ->
end.
width([$\t|T], A, Ctxt, C) ->
- width(T, A + Ctxt#ctxt.tab_width, Ctxt, C);
+ width(T, A + ?TAB_WIDTH, Ctxt, C);
width([$\n|T], _, Ctxt, C) ->
width(unindent([T|C], Ctxt), Ctxt);
width([H|T], A, Ctxt, C) when is_list(H) ->
diff --git a/lib/compiler/src/core_scan.erl b/lib/compiler/src/core_scan.erl
index 5e85bba2bd..11b52f6c5f 100644
--- a/lib/compiler/src/core_scan.erl
+++ b/lib/compiler/src/core_scan.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/erl_bifs.erl b/lib/compiler/src/erl_bifs.erl
index c00f5eab70..6b2d781a76 100644
--- a/lib/compiler/src/erl_bifs.erl
+++ b/lib/compiler/src/erl_bifs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/genop.tab b/lib/compiler/src/genop.tab
index 3a877f2403..dcbdeb32e6 100755
--- a/lib/compiler/src/genop.tab
+++ b/lib/compiler/src/genop.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2011. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/rec_env.erl b/lib/compiler/src/rec_env.erl
index 5a4a870769..936c5f6106 100644
--- a/lib/compiler/src/rec_env.erl
+++ b/lib/compiler/src/rec_env.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -603,7 +603,8 @@ generate(_N, Range) ->
%% same BEAM code.
case rand:export_seed() of
undefined ->
- rand:seed(exsplus, {1,42,2053});
+ _ = rand:seed(exsplus, {1,42,2053}),
+ ok;
_ ->
ok
end,
diff --git a/lib/compiler/src/sys_core_dsetel.erl b/lib/compiler/src/sys_core_dsetel.erl
index c6cfdbae7e..bd3eeae238 100644
--- a/lib/compiler/src/sys_core_dsetel.erl
+++ b/lib/compiler/src/sys_core_dsetel.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/sys_core_fold.erl b/lib/compiler/src/sys_core_fold.erl
index ab67c8164b..b5b8d8a8ec 100644
--- a/lib/compiler/src/sys_core_fold.erl
+++ b/lib/compiler/src/sys_core_fold.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/sys_core_inline.erl b/lib/compiler/src/sys_core_inline.erl
index 838dda68c6..8c1f69d5de 100644
--- a/lib/compiler/src/sys_core_inline.erl
+++ b/lib/compiler/src/sys_core_inline.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/sys_pre_attributes.erl b/lib/compiler/src/sys_pre_attributes.erl
index f0cb630205..bc93c85989 100644
--- a/lib/compiler/src/sys_pre_attributes.erl
+++ b/lib/compiler/src/sys_pre_attributes.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/v3_codegen.erl b/lib/compiler/src/v3_codegen.erl
index 6f1912c616..f531056591 100644
--- a/lib/compiler/src/v3_codegen.erl
+++ b/lib/compiler/src/v3_codegen.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/v3_core.erl b/lib/compiler/src/v3_core.erl
index 830dd9973a..83b3650180 100644
--- a/lib/compiler/src/v3_core.erl
+++ b/lib/compiler/src/v3_core.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -510,8 +510,16 @@ unforce(_, Vs) -> Vs.
exprs([E0|Es0], St0) ->
{E1,Eps,St1} = expr(E0, St0),
- {Es1,St2} = exprs(Es0, St1),
- {Eps ++ [E1] ++ Es1,St2};
+ case E1 of
+ #iprimop{name=#c_literal{val=match_fail}} ->
+ %% Must discard the rest of the body, because it
+ %% may refer to variables that have not been bound.
+ %% Example: {ok={error,E}} = foo(), E.
+ {Eps ++ [E1],St1};
+ _ ->
+ {Es1,St2} = exprs(Es0, St1),
+ {Eps ++ [E1] ++ Es1,St2}
+ end;
exprs([], St) -> {[],St}.
%% expr(Expr, State) -> {Cexpr,[PreExp],State}.
@@ -681,9 +689,14 @@ expr({match,L,P0,E0}, St0) ->
Fc = fail_clause([Fpat], Lanno, c_tuple([#c_literal{val=badmatch},Fpat])),
case P2 of
nomatch ->
- St = add_warning(L, nomatch, St5),
- {#icase{anno=#a{anno=Lanno},
- args=[E2],clauses=[],fc=Fc},Eps1++Eps2,St};
+ St6 = add_warning(L, nomatch, St5),
+ {Expr,Eps3,St} = safe(E1, St6),
+ Eps = Eps1 ++ Eps2 ++ Eps3,
+ Badmatch = c_tuple([#c_literal{val=badmatch},Expr]),
+ Fail = #iprimop{anno=#a{anno=Lanno},
+ name=#c_literal{val=match_fail},
+ args=[Badmatch]},
+ {Fail,Eps,St};
Other when not is_atom(Other) ->
{#imatch{anno=#a{anno=Lanno},pat=P2,arg=E2,fc=Fc},Eps1++Eps2,St5}
end;
@@ -784,7 +797,7 @@ badmap_term(_Map, #core{in_guard=true}) ->
%% since it is not user-visible.
#c_literal{val=badmap};
badmap_term(Map, #core{in_guard=false}) ->
- #c_tuple{es=[#c_literal{val=badmap},Map]}.
+ c_tuple([#c_literal{val=badmap},Map]).
map_build_pairs(Map, Es0, Ann, St0) ->
{Es,Pre,St1} = map_build_pairs_1(Es0, St0),
diff --git a/lib/compiler/src/v3_kernel.erl b/lib/compiler/src/v3_kernel.erl
index 4446d5ff1d..402e3c4912 100644
--- a/lib/compiler/src/v3_kernel.erl
+++ b/lib/compiler/src/v3_kernel.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -147,6 +147,7 @@ include_attribute(callback) -> false;
include_attribute(opaque) -> false;
include_attribute(export_type) -> false;
include_attribute(record) -> false;
+include_attribute(optional_callbacks) -> false;
include_attribute(_) -> true.
function({#c_var{name={F,Arity}=FA},Body}, St0) ->
@@ -401,7 +402,7 @@ expr(#c_call{anno=A,module=M0,name=F0,args=Cargs}, Sub, St0) ->
Call = #c_call{anno=A,
module=#c_literal{val=erlang},
name=#c_literal{val=apply},
- args=[M0,F0,make_list(Cargs)]},
+ args=[M0,F0,cerl:make_list(Cargs)]},
expr(Call, Sub, St1);
_ ->
{[M1,F1|Kargs],Ap,St} = atomic_list([M0,F0|Cargs], Sub, St1),
@@ -496,7 +497,7 @@ translate_match_fail_1(Anno, As, Sub, #kern{ff=FF}) ->
end.
translate_fc(Args) ->
- [#c_literal{val=function_clause},make_list(Args)].
+ [#c_literal{val=function_clause},cerl:make_list(Args)].
expr_map(A,Var0,Ces,Sub,St0) ->
{Var,Mps,St1} = expr(Var0, Sub, St0),
@@ -1988,11 +1989,6 @@ pat_list_vars(Ps) ->
{union(Used0, Used),union(New0, New)} end,
{[],[]}, Ps).
-make_list(Es) ->
- foldr(fun(E, Acc) ->
- #c_cons{hd=E,tl=Acc}
- end, #c_literal{val=[]}, Es).
-
%% List of integers in interval [N,M]. Empty list if N > M.
integers(N, M) when N =< M ->
diff --git a/lib/compiler/src/v3_kernel.hrl b/lib/compiler/src/v3_kernel.hrl
index 03b2eae006..5216a1a620 100644
--- a/lib/compiler/src/v3_kernel.hrl
+++ b/lib/compiler/src/v3_kernel.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/v3_kernel_pp.erl b/lib/compiler/src/v3_kernel_pp.erl
index 03b034ae98..0b90f0a1e0 100644
--- a/lib/compiler/src/v3_kernel_pp.erl
+++ b/lib/compiler/src/v3_kernel_pp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/v3_life.erl b/lib/compiler/src/v3_life.erl
index fa057ae211..1452b78d1d 100644
--- a/lib/compiler/src/v3_life.erl
+++ b/lib/compiler/src/v3_life.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/src/v3_life.hrl b/lib/compiler/src/v3_life.hrl
index 29a08f8c72..9d03a86ccd 100644
--- a/lib/compiler/src/v3_life.hrl
+++ b/lib/compiler/src/v3_life.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/andor_SUITE.erl b/lib/compiler/test/andor_SUITE.erl
index 9736f75fe8..f6e7b09010 100644
--- a/lib/compiler/test/andor_SUITE.erl
+++ b/lib/compiler/test/andor_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/apply_SUITE.erl b/lib/compiler/test/apply_SUITE.erl
index 8abcfe9dac..cca92e4713 100644
--- a/lib/compiler/test/apply_SUITE.erl
+++ b/lib/compiler/test/apply_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/beam_block_SUITE.erl b/lib/compiler/test/beam_block_SUITE.erl
index 7b6f2066be..81f8d10687 100644
--- a/lib/compiler/test/beam_block_SUITE.erl
+++ b/lib/compiler/test/beam_block_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2015. All Rights Reserved.
+%% Copyright Ericsson AB 2015-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -21,7 +21,11 @@
-export([all/0,suite/0,groups/0,init_per_suite/1,end_per_suite/1,
init_per_group/2,end_per_group/2,
- get_map_elements/1]).
+ get_map_elements/1,otp_7345/1]).
+
+%% The only test for the following functions is that
+%% the code compiles and is accepted by beam_validator.
+-export([encode_wildcards3/4,find_operands/4]).
suite() -> [{ct_hooks,[ts_install_cth]}].
@@ -64,3 +68,114 @@ get_map_elements([{Pred,Var}|Left], Map, Acc) ->
end;
get_map_elements([], _Map, Acc) ->
Acc.
+
+%% The following code
+%%
+%% {get_list,{x,2},{x,0},{x,1}}.
+%% {gc_bif,length,{f,0},1,[{x,0}],{x,0}}.
+%% {move,{x,0},{x,1}}.
+%%
+%% was incorrectly optimized to
+%%
+%% {get_list,{x,2},{x,0},{y,0}}.
+%% {gc_bif,length,{f,0},3,[{x,0}],{x,1}}.
+%%
+%% because beam_block:is_transparent({x,1},
+%% {gc_bif,length,{f,0},3,[{x,0}],{x,1}}
+%% incorrectly returned true.
+
+-record(contextId,{cid,device_type,contextRef}).
+-record(dpRef,{cid,tlli,ms_device_context_id}).
+-record(qosProfileBssgp,{peak_bit_rate_msb,
+ peak_bit_rate_lsb,
+ t_a_precedence}).
+-record(llUnitdataReq,{sapi,
+ l3_pdu_length,
+ pdu_life}).
+-record(ptmsi,{value}).
+
+otp_7345(_Config) ->
+ #llUnitdataReq{l3_pdu_length=3,pdu_life=4} =
+ otp_7345(#contextId{}, 0, [[1,2,3],4,5]).
+
+
+otp_7345(ObjRef, _RdEnv, Args) ->
+ Cid = ObjRef#contextId.cid,
+ _ = #dpRef{cid = Cid,
+ ms_device_context_id = cid_id,
+ tlli = #ptmsi{value = 0}},
+ _ = #qosProfileBssgp{peak_bit_rate_msb = 0,
+ peak_bit_rate_lsb = 80,
+ t_a_precedence = 49},
+ [Cpdu|_] = Args,
+ LlUnitdataReq =
+ #llUnitdataReq{sapi = 7,
+ l3_pdu_length = length(Cpdu),
+ pdu_life =
+ id(42)
+ div
+ 10},
+ id(LlUnitdataReq).
+
+%%%
+%%% The only test of the following code is that it compiles.
+%%%
+
+%% Slightly simplifed from megaco_binary_term_id_gen.
+%% beam_block failed to note that the {gc_bif,'-'...} instruction could
+%% fail, and that therefore {y,0} need to be initialized.
+%% {allocate,8,6}.
+%% %% {init,{y,0}} needed here.
+%% {get_list,{x,1},{x,6},{x,7}}.
+%% {'catch',{y,7},{f,3}}.
+%% {move,{x,4},{y,1}}.
+%% {move,{x,3},{y,2}}.
+%% {move,{x,2},{y,3}}.
+%% {move,{x,5},{y,4}}.
+%% {move,{x,7},{y,5}}.
+%% {move,{x,6},{y,6}}.
+%% {gc_bif,'-',{f,0},8,[{x,3},{x,6}],{x,0}}.
+%% {move,{x,0},{y,0}}.
+
+encode_wildcards3([],[],_,_) -> [];
+encode_wildcards3([Level|Levels],[BitsInLevel|BitsRest],LevelNo,TotSize) ->
+ case (catch ?MODULE:encode_wildcard(Level,BitsInLevel,TotSize-BitsInLevel,
+ length(Levels))) of
+ {'EXIT',{Reason,Info}} ->
+ exit({Reason,{LevelNo,Info}});
+
+ no_wildcard ->
+ encode_wildcards3(Levels,BitsRest,LevelNo+1,TotSize-BitsInLevel);
+
+ {level,Wl} ->
+ [Wl|
+ encode_wildcards3(Levels,BitsRest,LevelNo+1,TotSize-BitsInLevel)];
+
+ {recursive,Wr} ->
+ [Wr]
+ end.
+
+%% Slightly simplified code from hipe_rtl_ssapre.
+%% beam_block used to do the following incorrect optimization:
+%%
+%% {gc_bif,length,{f,0},1,[{x,0}],{x,3}}.
+%% ^^^^^ Was {x,0} - changing to {x,3} is not safe.
+%% {gc_bif,'+',{f,0},0,[{y,2},{integer,1}],{x,0}}.
+%% ^^^ Only one register live
+%% . . .
+%% {call_last,4,{f,2},4}. %% beam_validator noted that {x,3} wasn't live.
+
+find_operands(Cfg,XsiGraph,[],_Count) ->
+ {Cfg,XsiGraph};
+find_operands(Cfg,XsiGraph,ActiveList,Count) ->
+ {NewCfg,TempActiveList}=?MODULE:find_operands_for_active_list(Cfg,XsiGraph,
+ ActiveList,[]),
+ NewActiveList=lists:reverse(TempActiveList),
+ [Count+1, length(NewActiveList), length(digraph:vertices(XsiGraph))],
+ find_operands(NewCfg,XsiGraph,NewActiveList,Count+1).
+
+%%%
+%%% Common functions.
+%%%
+
+id(I) -> I.
diff --git a/lib/compiler/test/beam_disasm_SUITE.erl b/lib/compiler/test/beam_disasm_SUITE.erl
index 90598d9639..e2ec030d31 100644
--- a/lib/compiler/test/beam_disasm_SUITE.erl
+++ b/lib/compiler/test/beam_disasm_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/beam_except_SUITE.erl b/lib/compiler/test/beam_except_SUITE.erl
index afacb939d1..8746e62fb9 100644
--- a/lib/compiler/test/beam_except_SUITE.erl
+++ b/lib/compiler/test/beam_except_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/beam_utils_SUITE.erl b/lib/compiler/test/beam_utils_SUITE.erl
index 70c00f163c..6353ed3242 100644
--- a/lib/compiler/test/beam_utils_SUITE.erl
+++ b/lib/compiler/test/beam_utils_SUITE.erl
@@ -23,7 +23,7 @@
init_per_group/2,end_per_group/2,
apply_fun/1,apply_mf/1,bs_init/1,bs_save/1,
is_not_killed/1,is_not_used_at/1,
- select/1,y_catch/1]).
+ select/1,y_catch/1,otp_8949_b/1,liveopt/1]).
-export([id/1]).
suite() -> [{ct_hooks,[ts_install_cth]}].
@@ -41,7 +41,9 @@ groups() ->
is_not_killed,
is_not_used_at,
select,
- y_catch
+ y_catch,
+ otp_8949_b,
+ liveopt
]}].
init_per_suite(Config) ->
@@ -232,6 +234,40 @@ do_y_catch_1(<<_,_/binary>>, _) ->
do_y_catch_2(_) -> {a,b,c}.
+otp_8949_b(_Config) ->
+ self() ! something,
+ value = otp_8949_b([], false),
+ {'EXIT',_} = (catch otp_8949_b([], true)),
+ ok.
+
+%% Would cause an endless loop in beam_utils.
+otp_8949_b(A, B) ->
+ Var = id(value),
+ if
+ A == [], B == false ->
+ ok
+ end,
+ receive
+ something ->
+ id(Var)
+ end.
+
+-record(alarmInfo, {type,cause,origin}).
+
+liveopt(_Config) ->
+ F = liveopt_fun(42, pebkac, user),
+ void = F(42, #alarmInfo{type=sctp,cause=pebkac,origin=user}),
+ ok.
+
+liveopt_fun(Peer, Cause, Origin) ->
+ fun(PeerNo, AlarmInfo)
+ when PeerNo == Peer andalso
+ AlarmInfo == #alarmInfo{type=sctp,
+ cause=Cause,
+ origin=Origin} ->
+ void
+ end.
+
%% The identity function.
id(I) -> I.
diff --git a/lib/compiler/test/beam_validator_SUITE.erl b/lib/compiler/test/beam_validator_SUITE.erl
index d27512b6eb..7c4e88ca3e 100644
--- a/lib/compiler/test/beam_validator_SUITE.erl
+++ b/lib/compiler/test/beam_validator_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -312,7 +312,7 @@ state_after_fault_in_catch(Config) when is_list(Config) ->
no_exception_in_catch(Config) when is_list(Config) ->
Errors = do_val(no_exception_in_catch, Config),
[{{no_exception_in_catch,nested_of_1,4},
- {{move,{x,3},{x,0}},88,{uninitialized_reg,{x,3}}}}] = Errors,
+ {{move,{x,3},{x,0}},87,{uninitialized_reg,{x,3}}}}] = Errors,
ok.
undef_label(Config) when is_list(Config) ->
diff --git a/lib/compiler/test/bs_bincomp_SUITE.erl b/lib/compiler/test/bs_bincomp_SUITE.erl
index 5e5f6e2169..4743821337 100644
--- a/lib/compiler/test/bs_bincomp_SUITE.erl
+++ b/lib/compiler/test/bs_bincomp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/bs_bit_binaries_SUITE.erl b/lib/compiler/test/bs_bit_binaries_SUITE.erl
index c1f8f12bf1..208d8c5487 100644
--- a/lib/compiler/test/bs_bit_binaries_SUITE.erl
+++ b/lib/compiler/test/bs_bit_binaries_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/bs_construct_SUITE.erl b/lib/compiler/test/bs_construct_SUITE.erl
index d94e870e21..ff18f8b41c 100644
--- a/lib/compiler/test/bs_construct_SUITE.erl
+++ b/lib/compiler/test/bs_construct_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/bs_match_SUITE.erl b/lib/compiler/test/bs_match_SUITE.erl
index 7fa26b6c26..224abf6c29 100644
--- a/lib/compiler/test/bs_match_SUITE.erl
+++ b/lib/compiler/test/bs_match_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,11 +24,11 @@
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
init_per_testcase/2,end_per_testcase/2,
- fun_shadow/1,int_float/1,otp_5269/1,null_fields/1,wiger/1,
+ size_shadow/1,int_float/1,otp_5269/1,null_fields/1,wiger/1,
bin_tail/1,save_restore/1,
partitioned_bs_match/1,function_clause/1,
unit/1,shared_sub_bins/1,bin_and_float/1,
- dec_subidentifiers/1,skip_optional_tag/1,
+ dec_subidentifiers/1,skip_optional_tag/1,decode_integer/1,
wfbm/1,degenerated_match/1,bs_sum/1,coverage/1,
multiple_uses/1,zero_label/1,followed_by_catch/1,
matching_meets_construction/1,simon/1,matching_and_andalso/1,
@@ -38,7 +38,7 @@
no_partition/1,calling_a_binary/1,binary_in_map/1,
match_string_opt/1,select_on_integer/1,
map_and_binary/1,unsafe_branch_caching/1,
- bad_literals/1,good_literals/1]).
+ bad_literals/1,good_literals/1,constant_propagation/1]).
-export([coverage_id/1,coverage_external_ignore/2]).
@@ -56,11 +56,11 @@ all() ->
groups() ->
[{p,[parallel],
- [fun_shadow,int_float,otp_5269,null_fields,wiger,
+ [size_shadow,int_float,otp_5269,null_fields,wiger,
bin_tail,save_restore,
partitioned_bs_match,function_clause,unit,
shared_sub_bins,bin_and_float,dec_subidentifiers,
- skip_optional_tag,wfbm,degenerated_match,bs_sum,
+ skip_optional_tag,decode_integer,wfbm,degenerated_match,bs_sum,
coverage,multiple_uses,zero_label,followed_by_catch,
matching_meets_construction,simon,
matching_and_andalso,otp_7188,otp_7233,otp_7240,
@@ -69,7 +69,7 @@ groups() ->
no_partition,calling_a_binary,binary_in_map,
match_string_opt,select_on_integer,
map_and_binary,unsafe_branch_caching,
- bad_literals,good_literals]}].
+ bad_literals,good_literals,constant_propagation]}].
init_per_suite(Config) ->
@@ -91,33 +91,54 @@ init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) ->
end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) ->
ok.
-fun_shadow(Config) when is_list(Config) ->
- %% OTP-5270
- 7 = fun_shadow_1(),
- 7 = fun_shadow_2(8),
- 7 = fun_shadow_3(),
- no = fun_shadow_4(8),
+size_shadow(Config) when is_list(Config) ->
+ %% Originally OTP-5270.
+ 7 = size_shadow_1(),
+ 7 = size_shadow_2(8),
+ 7 = size_shadow_3(),
+ no = size_shadow_4(8),
+ Any = {any,term,goes},
+ {2577,Any,-175,whatever} =
+ (size_shadow_5(Any, 12))(<<2577:12>>, -175, whatever),
+ {7777,Any,42,whatever} =
+ (size_shadow_6(Any, 13))(42, <<7777:13>>, whatever),
+ {<<45>>,<<>>} = size_shadow_7({int,1}, <<1:16,45>>),
+ {'EXIT',{function_clause,_}} =
+ (catch size_shadow_7({int,42}, <<1:16,45>>)),
ok.
-fun_shadow_1() ->
+size_shadow_1() ->
L = 8,
F = fun(<<L:L,B:L>>) -> B end,
F(<<16:8, 7:16>>).
-fun_shadow_2(L) ->
+size_shadow_2(L) ->
F = fun(<<L:L,B:L>>) -> B end,
F(<<16:8, 7:16>>).
-fun_shadow_3() ->
+size_shadow_3() ->
L = 8,
F = fun(<<L:L,B:L,L:L>>) -> B end,
F(<<16:8, 7:16,16:16>>).
-fun_shadow_4(L) ->
+size_shadow_4(L) ->
F = fun(<<L:L,B:L,L:L>>) -> B;
(_) -> no end,
F(<<16:8, 7:16,15:16>>).
+size_shadow_5(X, Y) ->
+ fun (<< A:Y >>, Y, B) -> fum(A, X, Y, B) end.
+
+size_shadow_6(X, Y) ->
+ fun (Y, << A:Y >>, B) -> fum(A, X, Y, B) end.
+
+fum(A, B, C, D) ->
+ {A,B,C,D}.
+
+size_shadow_7({int,N}, <<N:16,B:N/binary,T/binary>>) ->
+ {B,T}.
+
+
int_float(Config) when is_list(Config) ->
%% OTP-5323
<<103133.0:64/float>> = <<103133:64/float>>,
@@ -504,6 +525,23 @@ skip_optional_tag(<<Tag,RestTag/binary>>, <<Tag,Rest/binary>>) ->
skip_optional_tag(RestTag, Rest);
skip_optional_tag(_, _) -> missing.
+decode_integer(_Config) ->
+ {10795,<<43>>,whatever} = decode_integer(1, <<42,43>>, whatever),
+ {-28909,<<19>>,whatever} = decode_integer(1, <<143,19>>, whatever),
+ ok.
+
+decode_integer(Len, <<B1:1,B2:7,Bs/binary>>, RemovedBytes) when B1 == 0 ->
+ Bin = <<_Skip:Len/unit:8, Buffer2/binary>> = <<B1:1,B2:7,Bs/binary>>,
+ Size = byte_size(Bin),
+ <<Int:Size/unit:8>> = Bin,
+ {Int,Buffer2,RemovedBytes};
+decode_integer(Len, <<B1:1,B2:7,Bs/binary>>, RemovedBytes) ->
+ Bin = <<_Skip:Len/unit:8,Buffer2/binary>> = <<B1:1,B2:7,Bs/binary>>,
+ Size = byte_size(Bin),
+ <<N:Size/unit:8>> = <<B2,Bs/binary>>,
+ Int = N - (1 bsl (8 * size(Bin) -1)),
+ {Int,Buffer2,RemovedBytes}.
+
-define(DATELEN, 16).
wfbm(Config) when is_list(Config) ->
@@ -1387,6 +1425,32 @@ good_literals(_Config) ->
<<16#cafebeef:4/unit:8>> = id(<<16#cafebeef:32>>),
ok.
+constant_propagation(_Config) ->
+ <<5>> = constant_propagation_a(a, <<5>>),
+ {'EXIT',{{case_clause,b},_}} = (catch constant_propagation_a(b, <<5>>)),
+ 258 = constant_propagation_b(<<1,2>>),
+ F = constant_propagation_c(),
+ 259 = F(<<1,3>>),
+ ok.
+
+constant_propagation_a(X, Y) ->
+ case X of
+ a -> Y2 = 8
+ end,
+ <<5:Y2>> = Y.
+
+constant_propagation_b(B) ->
+ Sz = 16,
+ <<X:Sz/integer>> = B,
+ X.
+
+constant_propagation_c() ->
+ Size = 16,
+ fun(Bin) ->
+ <<X:Size/integer>> = Bin,
+ X
+ end.
+
check(F, R) ->
R = F().
diff --git a/lib/compiler/test/bs_utf_SUITE.erl b/lib/compiler/test/bs_utf_SUITE.erl
index 518e89a9cb..c894041f72 100644
--- a/lib/compiler/test/bs_utf_SUITE.erl
+++ b/lib/compiler/test/bs_utf_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl
index 76b7e852f1..cd1bc099e9 100644
--- a/lib/compiler/test/compilation_SUITE.erl
+++ b/lib/compiler/test/compilation_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -19,11 +19,48 @@
%%% Purpose : Compiles various modules with tough code
-module(compilation_SUITE).
+-export([all/0,suite/0,groups/0,init_per_suite/1,end_per_suite/1,
+ init_per_group/2,end_per_group/2,
+ beam_compiler_4/1,
+ beam_compiler_6/1,
+ beam_compiler_7/1,
+ beam_compiler_8/1,
+ beam_compiler_9/1,
+ beam_compiler_10/1,
+ beam_compiler_11/1,
+ compiler_1/1,
+ const_list_256/1,
+ convopts/1,
+ live_var/1,
+ on_load/1,
+ on_load_inline/1,
+ opt_crash/1,
+ otp_2330/1,
+ otp_2380/1,
+ otp_4790/1,
+ otp_5151/1,
+ otp_5235/1,
+ otp_5404/1,
+ otp_5436/1,
+ otp_5481/1,
+ otp_5553/1,
+ otp_5632/1,
+ otp_5714/1,
+ otp_5872/1,
+ otp_6121/1,
+ otp_7202/1,
+ otp_8949_a/1,
+ redundant_case/1,
+ self_compile/1,
+ self_compile_old_inliner/1,
+ split_cases/1,
+ string_table/1,
+ vsn_1/1,
+ vsn_2/1,
+ vsn_3/1]).
-include_lib("common_test/include/ct.hrl").
--compile(export_all).
-
suite() ->
[{ct_hooks,[ts_install_cth]},
{timetrap,{minutes,10}}].
@@ -37,23 +74,18 @@ groups() ->
[{vsn,[parallel],[vsn_1,vsn_2,vsn_3]},
{p,test_lib:parallel(),
[compiler_1,
- compiler_3,compiler_5,beam_compiler_1,
- beam_compiler_2,beam_compiler_3,beam_compiler_4,
- beam_compiler_5,beam_compiler_6,beam_compiler_7,
+ beam_compiler_4,beam_compiler_6,beam_compiler_7,
beam_compiler_8,beam_compiler_9,beam_compiler_10,
- beam_compiler_11,beam_compiler_12,
- nested_tuples_in_case_expr,otp_2330,guards,
- {group,vsn},otp_2380,otp_2141,otp_2173,otp_4790,
- const_list_256,bin_syntax_1,bin_syntax_2,
- bin_syntax_3,bin_syntax_4,bin_syntax_5,bin_syntax_6,
- live_var,convopts,
- catch_in_catch,redundant_case,long_string,otp_5076,
- complex_guard,otp_5092,otp_5151,otp_5235,otp_5244,
- trycatch_4,opt_crash,otp_5404,otp_5436,otp_5481,
+ beam_compiler_11,
+ otp_2330,
+ {group,vsn},otp_2380,otp_4790,
+ const_list_256,live_var,convopts,
+ redundant_case,
+ otp_5151,otp_5235,
+ 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,
- string_table,otp_8949_a,otp_8949_b,split_cases,
- beam_utils_liveopt]}].
+ otp_7202,on_load,on_load_inline,
+ string_table,otp_8949_a,split_cases]}].
init_per_suite(Config) ->
Config.
@@ -70,85 +102,25 @@ end_per_group(_GroupName, Config) ->
-define(comp(N),
N(Config) when is_list(Config) -> try_it(N, Config)).
--define(comp_fail(N),
- N(Config) when is_list(Config) -> failure(N, Config)).
-
?comp(compiler_1).
-?comp(compiler_3).
-?comp(compiler_4).
-?comp(compiler_5).
-?comp(beam_compiler_1).
-?comp(beam_compiler_2).
-?comp(beam_compiler_3).
?comp(beam_compiler_4).
-?comp(beam_compiler_5).
?comp(beam_compiler_6).
?comp(beam_compiler_8).
?comp(beam_compiler_9).
?comp(beam_compiler_10).
?comp(beam_compiler_11).
-?comp(beam_compiler_12).
-?comp(beam_compiler_13).
-
-?comp(nested_tuples_in_case_expr).
?comp(otp_2330).
?comp(otp_2380).
-?comp(otp_2141).
-?comp(otp_2173).
?comp(otp_4790).
?comp(otp_5235).
-?comp(otp_5244).
-
-?comp(guards).
-
-?comp(pattern_expr).
-
?comp(const_list_256).
-?comp(bin_syntax_1).
-?comp(bin_syntax_2).
-?comp(bin_syntax_3).
-?comp(bin_syntax_4).
-
-?comp(bin_syntax_6).
-
-?comp(otp_5076).
-
-?comp(complex_guard).
-
-?comp(otp_5092).
?comp(otp_5151).
-%%% By Per Gustafsson <[email protected]>
-
-bin_syntax_5(Config) when is_list(Config) ->
- {<<45>>,<<>>} = split({int, 1}, <<1:16,45>>).
-
-split({int, N}, <<N:16,B:N/binary,T/binary>>) ->
- {B,T}.
-
-%% This program works with the old version of the compiler
-%% but, the core erlang that it produces have the same variable appearing
-%% looks like this:
-%%
-%% split({int, N}, <<_core1:16, B:N/binary, T/binary>>) when _core1==N
-%%
-%% with my change it will look like this:
-%%
-%% split({int, N}, <<_core1:16, B:_core1/binary, T/binary>>) when _core1==N
-%%
-%% This means that everything worked fine as long as the pattern
-%% matching order was left-to-right but on core erlang any order should be possible
-
?comp(live_var).
-
-?comp(trycatch_4).
-
-?comp(catch_in_catch).
-
?comp(opt_crash).
?comp(otp_5404).
@@ -159,8 +131,6 @@ split({int, N}, <<N:16,B:N/binary,T/binary>>) ->
?comp(otp_5714).
?comp(otp_5872).
?comp(otp_6121).
-?comp(otp_6121a).
-?comp(otp_6121b).
?comp(convopts).
?comp(otp_7202).
?comp(on_load).
@@ -193,91 +163,38 @@ redundant_case_1(3) -> d;
redundant_case_1(4) -> d;
redundant_case_1(_) -> d.
-failure(Module, Conf) ->
- Src = filename:join(proplists:get_value(data_dir, Conf),
- atom_to_list(Module)),
- Out = proplists:get_value(priv_dir, Conf),
- io:format("Compiling: ~ts\n", [Src]),
- CompRc = compile:file(Src, [{outdir,Out},return,time]),
- io:format("Result: ~p\n",[CompRc]),
- case CompRc of
- error -> ok;
- {error,Errors,_} -> check_errors(Errors);
- _ -> ct:fail({no_error, CompRc})
- end,
- ok.
-
-check_errors([{_,Eds}|T]) ->
- check_error(Eds),
- check_errors(T);
-check_errors([]) -> ok.
-
-check_error([{_,Mod,Error}|T]) ->
- check_error_1(Mod:format_error(Error)),
- check_error(T);
-check_error([{Mod,Error}|T]) ->
- check_error_1(Mod:format_error(Error)),
- check_error(T);
-check_error([]) -> ok.
-
-check_error_1(Str0) ->
- Str = lists:flatten(Str0),
- io:format("~s\n", [Str]),
- case Str of
- "internal"++_=Str ->
- ct:fail(internal_compiler_error);
- _ ->
- ok
- end.
-
--define(TC(Body), tc(fun() -> Body end, ?LINE)).
-
try_it(Module, Conf) ->
- %% Change 'false' to 'true' to start a new node for every module.
- try_it(false, Module, Conf).
-
-try_it(StartNode, Module, Conf) ->
- try_it(StartNode, Module, {minutes,10}, Conf).
-
-try_it(StartNode, Module, Timetrap, Conf) ->
+ Timetrap = {minutes,10},
OtherOpts = [], %Can be changed to [time] if needed
Src = filename:join(proplists:get_value(data_dir, Conf),
atom_to_list(Module)),
Out = proplists:get_value(priv_dir,Conf),
io:format("Compiling: ~s\n", [Src]),
- CompRc0 = compile:file(Src, [clint,{outdir,Out},report,
- bin_opt_info|OtherOpts]),
+ CompRc0 = compile:file(Src, [clint0,clint,{outdir,Out},report,
+ bin_opt_info|OtherOpts]),
io:format("Result: ~p\n",[CompRc0]),
{ok,_Mod} = CompRc0,
- Node = case StartNode of
- false ->
- node();
- true ->
- Pa = "-pa " ++ filename:dirname(code:which(?MODULE)),
- {ok,Node0} = start_node(compiler, Pa),
- Node0
- end,
-
- ok = rpc:call(Node, ?MODULE, load_and_call, [Out, Module]),
load_and_call(Out, Module),
ct:timetrap(Timetrap),
io:format("Compiling (without optimization): ~s\n", [Src]),
CompRc1 = compile:file(Src,
- [no_copt,no_postopt,{outdir,Out},report|OtherOpts]),
+ [no_copt,no_postopt,
+ {outdir,Out},report|OtherOpts]),
io:format("Result: ~p\n",[CompRc1]),
{ok,_Mod} = CompRc1,
- ok = rpc:call(Node, ?MODULE, load_and_call, [Out, Module]),
+ load_and_call(Out, Module),
ct:timetrap(Timetrap),
io:format("Compiling (with old inliner): ~s\n", [Src]),
- CompRc2 = compile:file(Src, [{outdir,Out},report,bin_opt_info,
- {inline,1000}|OtherOpts]),
+ CompRc2 = compile:file(Src, [clint,
+ {outdir,Out},report,bin_opt_info,
+ {inline,1000}|OtherOpts]),
io:format("Result: ~p\n",[CompRc2]),
{ok,_Mod} = CompRc2,
- ok = rpc:call(Node, ?MODULE, load_and_call, [Out, Module]),
+ load_and_call(Out, Module),
ct:timetrap(Timetrap),
io:format("Compiling (from assembly): ~s\n", [Src]),
@@ -286,12 +203,8 @@ try_it(StartNode, Module, Timetrap, Conf) ->
CompRc3 = compile:file(Asm, [from_asm,{outdir,Out},report|OtherOpts]),
io:format("Result: ~p\n",[CompRc3]),
{ok,_} = CompRc3,
- ok = rpc:call(Node, ?MODULE, load_and_call, [Out, Module]),
+ load_and_call(Out, Module),
- case StartNode of
- false -> ok;
- true -> test_server:stop_node(Node)
- end,
ok.
load_and_call(Out, Module) ->
@@ -319,24 +232,6 @@ load_and_call(Out, Module) ->
ok.
-tc(F, Line) ->
- {Diff,Value} = timer:tc(erlang, apply, [F,[]]),
- io:format("~p: ~p\n", [Line,Diff]),
- Value.
-
-start_node(Name, Args) ->
- case test_server:start_node(Name, slave, [{args, Args}]) of
- {ok, Node} ->
- {ok, Node};
- Error ->
- ct:fail(Error)
- end.
-
-from(H, [H | T]) -> T;
-from(H, [_ | T]) -> from(H, T);
-from(_, []) -> [].
-
-
%% Test generation of 'vsn' attribute.
vsn_1(Conf) when is_list(Conf) ->
M = vsn_1,
@@ -397,11 +292,6 @@ get_vsn(M) ->
{vsn,V} = lists:keyfind(vsn, 1, M:module_info(attributes)),
V.
-long_string(Config) when is_list(Config) ->
- %% The test must complete in one minute - it should be plenty of time.
- try_it(false, long_string, {minutes,1}, Config),
- ok.
-
compile_load(Module, Dir, Conf) ->
Src = filename:join(Dir, atom_to_list(Module)),
Out = proplists:get_value(priv_dir,Conf),
@@ -465,6 +355,7 @@ compile_compiler(Files, OutDir, Version, InlineOpts) ->
io:format("~ts", [code:which(compile)]),
io:format("Compiling ~s into ~ts", [Version,OutDir]),
Opts = [report,
+ clint0,clint,
bin_opt_info,
{outdir,OutDir},
{d,'COMPILER_VSN',"\""++Version++"\""},
@@ -480,10 +371,6 @@ compile_compiler(Files, OutDir, Version, InlineOpts) ->
compiler_src() ->
filelib:wildcard(filename:join([code:lib_dir(compiler), "src", "*.erl"])).
-compiler_modules(Dir) ->
- Files = filelib:wildcard(filename:join(Dir, "*.beam")),
- [list_to_atom(filename:rootname(filename:basename(F))) || F <- Files].
-
make_compiler_dir(Priv, Dir0) ->
Dir = filename:join(Priv, Dir0),
ok = file:make_dir(Dir),
@@ -502,112 +389,6 @@ compare_compilers(ADir, BDir) ->
["beam_asm.beam"] = [filename:basename(A) || {A,_} <- D],
ok.
-%%%
-%%% The only test of the following code is that it compiles.
-%%%
-
-%% Slightly simplifed from megaco_binary_term_id_gen.
-%% beam_block failed to note that the {gc_bif,'-'...} instruction could
-%% fail, and that therefore {y,0} need to be initialized.
-%% {allocate,8,6}.
-%% %% {init,{y,0}} needed here.
-%% {get_list,{x,1},{x,6},{x,7}}.
-%% {'catch',{y,7},{f,3}}.
-%% {move,{x,4},{y,1}}.
-%% {move,{x,3},{y,2}}.
-%% {move,{x,2},{y,3}}.
-%% {move,{x,5},{y,4}}.
-%% {move,{x,7},{y,5}}.
-%% {move,{x,6},{y,6}}.
-%% {gc_bif,'-',{f,0},8,[{x,3},{x,6}],{x,0}}.
-%% {move,{x,0},{y,0}}.
-
-encode_wildcards3([],[],_,_) -> [];
-encode_wildcards3([Level|Levels],[BitsInLevel|BitsRest],LevelNo,TotSize) ->
- case (catch ?MODULE:encode_wildcard(Level,BitsInLevel,TotSize-BitsInLevel,
- length(Levels))) of
- {'EXIT',{Reason,Info}} ->
- exit({Reason,{LevelNo,Info}});
-
- no_wildcard ->
- encode_wildcards3(Levels,BitsRest,LevelNo+1,TotSize-BitsInLevel);
-
- {level,Wl} ->
- [Wl|
- encode_wildcards3(Levels,BitsRest,LevelNo+1,TotSize-BitsInLevel)];
-
- {recursive,Wr} ->
- [Wr]
- end.
-
-%% Slightly simplified code from hipe_rtl_ssapre.
-%% beam_block used to do the following incorrect optimization:
-%%
-%% {gc_bif,length,{f,0},1,[{x,0}],{x,3}}.
-%% ^^^^^ Was {x,0} - changing to {x,3} is not safe.
-%% {gc_bif,'+',{f,0},0,[{y,2},{integer,1}],{x,0}}.
-%% ^^^ Only one register live
-%% . . .
-%% {call_last,4,{f,2},4}. %% beam_validator noted that {x,3} wasn't live.
-
-find_operands(Cfg,XsiGraph,[],_Count) ->
- {Cfg,XsiGraph};
-find_operands(Cfg,XsiGraph,ActiveList,Count) ->
- {NewCfg,TempActiveList}=?MODULE:find_operands_for_active_list(Cfg,XsiGraph,
- ActiveList,[]),
- NewActiveList=lists:reverse(TempActiveList),
- [Count+1, length(NewActiveList), length(digraph:vertices(XsiGraph))],
- find_operands(NewCfg,XsiGraph,NewActiveList,Count+1).
-
-
-%% The following code
-%%
-%% {get_list,{x,2},{x,0},{x,1}}.
-%% {gc_bif,length,{f,0},1,[{x,0}],{x,0}}.
-%% {move,{x,0},{x,1}}.
-%%
-%% was incorrectly optimized to
-%%
-%% {get_list,{x,2},{x,0},{y,0}}.
-%% {gc_bif,length,{f,0},3,[{x,0}],{x,1}}.
-%%
-%% because beam_block:is_transparent({x,1},
-%% {gc_bif,length,{f,0},3,[{x,0}],{x,1}}
-%% incorrectly returned true.
-
--record(contextId,{cid,device_type,contextRef}).
--record(dpRef,{cid,tlli,ms_device_context_id}).
--record(qosProfileBssgp,{peak_bit_rate_msb,
- peak_bit_rate_lsb,
- t_a_precedence}).
--record(llUnitdataReq,{sapi,
- l3_pdu_length,
- pdu_life}).
--record(ptmsi,{value}).
-
-otp_7345(Config) when is_list(Config) ->
- #llUnitdataReq{l3_pdu_length=3,pdu_life=4} =
- otp_7345(#contextId{}, 0, [[1,2,3],4,5]).
-
-
-otp_7345(ObjRef, _RdEnv, Args) ->
- Cid = ObjRef#contextId.cid,
- _ = #dpRef{cid = Cid,
- ms_device_context_id = cid_id,
- tlli = #ptmsi{value = 0}},
- _ = #qosProfileBssgp{peak_bit_rate_msb = 0,
- peak_bit_rate_lsb = 80,
- t_a_precedence = 49},
- [Cpdu|_] = Args,
- LlUnitdataReq =
- #llUnitdataReq{sapi = 7,
- l3_pdu_length = length(Cpdu),
- pdu_life =
- id(42)
- div
- 10},
- id(LlUnitdataReq).
-
%% Check the generation of the string table.
string_table(Config) when is_list(Config) ->
@@ -640,24 +421,6 @@ do_otp_8949_a() ->
end
end.
-otp_8949_b(Config) when is_list(Config) ->
- self() ! something,
- value = otp_8949_b([], false),
- {'EXIT',_} = (catch otp_8949_b([], true)),
- ok.
-
-%% Would cause an endless loop in beam_utils.
-otp_8949_b(A, B) ->
- Var = id(value),
- if
- A == [], B == false ->
- ok
- end,
- receive
- something ->
- id(Var)
- end.
-
split_cases(_) ->
dummy1 = do_split_cases(x),
{'EXIT',{{badmatch,b},_}} = (catch do_split_cases(y)),
@@ -673,21 +436,5 @@ do_split_cases(A) ->
end,
Z.
--record(alarmInfo, {type,cause,origin}).
-
-beam_utils_liveopt(Config) ->
- F = beam_utils_liveopt_fun(42, pebkac, user),
- void = F(42, #alarmInfo{type=sctp,cause=pebkac,origin=user}),
- ok.
-
-beam_utils_liveopt_fun(Peer, Cause, Origin) ->
- fun(PeerNo, AlarmInfo)
- when PeerNo == Peer andalso
- AlarmInfo == #alarmInfo{type=sctp,
- cause=Cause,
- origin=Origin} ->
- void
- end.
-
id(I) -> I.
diff --git a/lib/compiler/test/compilation_SUITE_data/beam_compiler_1.erl b/lib/compiler/test/compilation_SUITE_data/beam_compiler_1.erl
deleted file mode 100644
index ce72d0d0f2..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/beam_compiler_1.erl
+++ /dev/null
@@ -1,32 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(beam_compiler_1).
--export([beam_compiler_1/0]).
-
-beam_compiler_1() ->
- ok.
-
--record(foo,{a,b}).
-
-try_me() ->
- X = #foo{},
- Y = #foo{},
- {X#foo.a == Y#foo.a,X#foo.b}.
-
diff --git a/lib/compiler/test/compilation_SUITE_data/beam_compiler_10.erl b/lib/compiler/test/compilation_SUITE_data/beam_compiler_10.erl
index 41c5e7b4d2..66f2f78b32 100644
--- a/lib/compiler/test/compilation_SUITE_data/beam_compiler_10.erl
+++ b/lib/compiler/test/compilation_SUITE_data/beam_compiler_10.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/beam_compiler_11.erl b/lib/compiler/test/compilation_SUITE_data/beam_compiler_11.erl
index 1b6cd66953..0339b2a488 100644
--- a/lib/compiler/test/compilation_SUITE_data/beam_compiler_11.erl
+++ b/lib/compiler/test/compilation_SUITE_data/beam_compiler_11.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/beam_compiler_12.erl b/lib/compiler/test/compilation_SUITE_data/beam_compiler_12.erl
deleted file mode 100644
index 8bb6ce9e4a..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/beam_compiler_12.erl
+++ /dev/null
@@ -1,30 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(beam_compiler_12).
-
--export([?MODULE/0,t/1]).
-
-?MODULE() ->
- ok.
-
-t(Name) ->
- {ok = {file_info,_,regular,_,AccTime1,ModTime1,_,_,_,_,_,_,_,_}} =
- prim_file:read_file_info(Name).
-
diff --git a/lib/compiler/test/compilation_SUITE_data/beam_compiler_2.erl b/lib/compiler/test/compilation_SUITE_data/beam_compiler_2.erl
deleted file mode 100644
index 66fdcae4d0..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/beam_compiler_2.erl
+++ /dev/null
@@ -1,36 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(beam_compiler_2).
--export([beam_compiler_2/0]).
-
-beam_compiler_2() ->
- ok.
-
--record(foo,{a,b}).
-
-try_me() ->
- try_me({foo,x,z},{foo,y,z}).
-
-try_me(X,Y) ->
- f(X#foo.a =/= Y#foo.a,X#foo.b =/= X#foo.b).
-
-f(A,B) ->
- A.
-
diff --git a/lib/compiler/test/compilation_SUITE_data/beam_compiler_3.erl b/lib/compiler/test/compilation_SUITE_data/beam_compiler_3.erl
deleted file mode 100644
index adf6fa2720..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/beam_compiler_3.erl
+++ /dev/null
@@ -1,30 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(beam_compiler_3).
--export([beam_compiler_3/0, f/0]).
-
-%% From Ulf Wiger.
-
-beam_compiler_3() ->
- ok.
-
-f() ->
- [_|T] = lists:reverse("xxx"),
- T.
diff --git a/lib/compiler/test/compilation_SUITE_data/beam_compiler_4.erl b/lib/compiler/test/compilation_SUITE_data/beam_compiler_4.erl
index 5ecfed52df..0a394619de 100644
--- a/lib/compiler/test/compilation_SUITE_data/beam_compiler_4.erl
+++ b/lib/compiler/test/compilation_SUITE_data/beam_compiler_4.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/beam_compiler_6.erl b/lib/compiler/test/compilation_SUITE_data/beam_compiler_6.erl
index a14c05de10..1fe1b2d693 100644
--- a/lib/compiler/test/compilation_SUITE_data/beam_compiler_6.erl
+++ b/lib/compiler/test/compilation_SUITE_data/beam_compiler_6.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/beam_compiler_8.erl b/lib/compiler/test/compilation_SUITE_data/beam_compiler_8.erl
index d8eebc07d1..de51c59aae 100644
--- a/lib/compiler/test/compilation_SUITE_data/beam_compiler_8.erl
+++ b/lib/compiler/test/compilation_SUITE_data/beam_compiler_8.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/beam_compiler_9.erl b/lib/compiler/test/compilation_SUITE_data/beam_compiler_9.erl
index fecc566a95..5d0097f0fd 100644
--- a/lib/compiler/test/compilation_SUITE_data/beam_compiler_9.erl
+++ b/lib/compiler/test/compilation_SUITE_data/beam_compiler_9.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/bin_syntax_2.erl b/lib/compiler/test/compilation_SUITE_data/bin_syntax_2.erl
deleted file mode 100644
index b3e3785249..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/bin_syntax_2.erl
+++ /dev/null
@@ -1,42 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(bin_syntax_2).
-
--export([?MODULE/0]).
-
-%% This module tests that constant propagation is done properly.
-
-?MODULE() ->
- 258 = b(<<1,2>>),
- F = c(),
- 259 = F(<<1,3>>),
- ok.
-
-b(B) ->
- Sz = 16,
- <<X:Sz/integer>> = B,
- X.
-
-c() ->
- Size = 16,
- fun(Bin) ->
- <<X:Size/integer>> = Bin,
- X
- end.
diff --git a/lib/compiler/test/compilation_SUITE_data/bin_syntax_3.erl b/lib/compiler/test/compilation_SUITE_data/bin_syntax_3.erl
deleted file mode 100644
index b881d2769e..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/bin_syntax_3.erl
+++ /dev/null
@@ -1,36 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(bin_syntax_3).
--export([?MODULE/0,decode_integer/3]).
-
-?MODULE() ->
- ok.
-
-decode_integer(Len, <<B1:1,B2:7,Bs/binary>>, RemovedBytes) when B1 == 0 ->
- Bin = <<Skip:Len/unit:8, Buffer2/binary>> = <<B1:1,B2:7,Bs/binary>>,
- Size = size(Bin),
- <<Int:Size/unit:8>> = Bin,
- {Int,Buffer2,RemovedBytes};
-decode_integer(Len,<<B1:1,B2:7,Bs/binary>>,RemovedBytes) ->
- Bin = <<Skip:Len/unit:8,Buffer2/binary>> = <<B1:1,B2:7,Bs/binary>>,
- Size = size(Bin),
- <<N:Size/unit:8>> = <<B2,Bs/binary>>,
- Int = N - (1 bsl (8 * size(Bin) -1)),
- {Int,Buffer2,RemovedBytes}.
diff --git a/lib/compiler/test/compilation_SUITE_data/bin_syntax_4.erl b/lib/compiler/test/compilation_SUITE_data/bin_syntax_4.erl
deleted file mode 100644
index f63eb34fb2..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/bin_syntax_4.erl
+++ /dev/null
@@ -1,33 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(bin_syntax_4).
--export([?MODULE/0,f4b/2,f4c/2]).
-
-?MODULE() ->
- ok.
-
-f4b(X, Y) ->
- fun (<< A:Y >>, Y, B) -> fum(A, X, Y, B) end.
-
-f4c(X, Y) ->
- fun (Y, << A:Y >>, B) -> fum(A, X, Y, B) end.
-
-fum(A, B, C, D) ->
- {A,B,C,D}.
diff --git a/lib/compiler/test/compilation_SUITE_data/bin_syntax_6.erl b/lib/compiler/test/compilation_SUITE_data/bin_syntax_6.erl
deleted file mode 100644
index 13e4bb8707..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/bin_syntax_6.erl
+++ /dev/null
@@ -1,40 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(bin_syntax_6).
--export([?MODULE/0,x/1,y/1]).
-
-?MODULE() ->
- ok.
-
-x(X) ->
- blurf(),
- B = {X,"OK",<<>>},
- catch b({a,B}).
-
-y(X) ->
- blurf(),
- B = {X,"OK",<<42>>},
- catch b({a,B}).
-
-blurf() ->
- ok.
-
-b(_) ->
- ok.
diff --git a/lib/compiler/test/compilation_SUITE_data/catch_in_catch.erl b/lib/compiler/test/compilation_SUITE_data/catch_in_catch.erl
deleted file mode 100644
index 0abde0ff5d..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/catch_in_catch.erl
+++ /dev/null
@@ -1,52 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(catch_in_catch).
-
--export([?MODULE/0,do_start/1]).
-
-?MODULE() ->
- process_flag(trap_exit, true),
- Pid = spawn_link(?MODULE, do_start, [x]),
- receive
- {'EXIT',Pid,good_exit} -> ok;
- Other ->
- io:format("Unexpected: ~p\n", [Other]),
- error
- after 32000 ->
- io:format("No message received\n"),
- error
- end.
-
-do_start(Param) ->
- init(Param),
- exit(good_exit).
-
-init(Param) ->
- process_flag(trap_exit, true),
- %% The catches were improperly nested, causing a "No catch found" crash.
- (catch begin
- foo(Param),
- (catch exit(bar))
- end
- ),
- ignore.
-
-foo(_) ->
- ok.
diff --git a/lib/compiler/test/compilation_SUITE_data/compiler_1.erl b/lib/compiler/test/compilation_SUITE_data/compiler_1.erl
index 02858ec308..87985bdf80 100644
--- a/lib/compiler/test/compilation_SUITE_data/compiler_1.erl
+++ b/lib/compiler/test/compilation_SUITE_data/compiler_1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/compiler_3.erl b/lib/compiler/test/compilation_SUITE_data/compiler_3.erl
deleted file mode 100644
index 4b99eafc63..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/compiler_3.erl
+++ /dev/null
@@ -1,34 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(compiler_3).
--export([compiler_3/0]).
--record(rec,{a}).
-
-compiler_3() ->
- guard_record().
-
-guard_record() ->
- 1=func(#rec{}),
- {'EXIT',_} = (catch func({rec})),
- ok.
-
-func(X) when record(X,
-rec) ->
- 1.
diff --git a/lib/compiler/test/compilation_SUITE_data/compiler_5.erl b/lib/compiler/test/compilation_SUITE_data/compiler_5.erl
deleted file mode 100644
index 63564ac938..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/compiler_5.erl
+++ /dev/null
@@ -1,50 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(compiler_5).
--export([compiler_5/0]).
-
-compiler_5() ->
- f0(),
- f1(),
- f2(),
- ok.
-
-%% compiler treats records with 1 and 2 fields differently...
--record(nil, {}).
--record(foo, {hello=1}).
--record(bar, {hello=2,there=3}).
-
-f0() ->
- R1 = #nil{},
- R2 = R1#nil{}, %% stupid code, but compiler shouldn't crash
- R1 = R2,
- ok.
-
-f1() ->
- R1 = #foo{},
- R2 = R1#foo{}, %% stupid code, but compiler shouldn't crash
- R1 = R2,
- ok.
-
-f2() ->
- R1 = #bar{},
- R2 = R1#bar{}, %% stupid code, but compiler shouldn't crash
- R1 = R2,
- ok.
diff --git a/lib/compiler/test/compilation_SUITE_data/complex_guard.erl b/lib/compiler/test/compilation_SUITE_data/complex_guard.erl
deleted file mode 100644
index 37b861b0b5..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/complex_guard.erl
+++ /dev/null
@@ -1,32 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(complex_guard).
-
--compile(export_all).
-
-?MODULE() ->
- ok.
-
-f(X1,Y1,Z1) ->
- if
- ((X1 =:= 4) or (X1 =:= 5)) and ((Y1 =:= 4) or (Y1 =:= 5)) and ((Z1 =:= 4) or (Z1 =:= 5)) or ((X1 =:= 1) or (X1 =:= 2) or (X1 =:= 3)) and ((Y1 =:= 1) or (Y1 =:= 2) or (Y1 =:= 3)) and ((Z1 =:= 1) or (Z1 =:= 2) or (Z1 =:= 3)) ->
- true
- end.
-
diff --git a/lib/compiler/test/compilation_SUITE_data/const_list_256.erl b/lib/compiler/test/compilation_SUITE_data/const_list_256.erl
index 18f4d52d7b..bdce438162 100644
--- a/lib/compiler/test/compilation_SUITE_data/const_list_256.erl
+++ b/lib/compiler/test/compilation_SUITE_data/const_list_256.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/convopts.erl b/lib/compiler/test/compilation_SUITE_data/convopts.erl
index 55b65d6763..8404eb82fd 100644
--- a/lib/compiler/test/compilation_SUITE_data/convopts.erl
+++ b/lib/compiler/test/compilation_SUITE_data/convopts.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/guards.erl b/lib/compiler/test/compilation_SUITE_data/guards.erl
deleted file mode 100644
index f0d11fc79a..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/guards.erl
+++ /dev/null
@@ -1,107 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(guards).
-
--export([guards/0]).
-
-guards() ->
- ok = t(),
- ok = f(),
- ok = ct(1),
- ok = multi(1),
- ok = multi(2),
- ok = multi(3).
-
-%% The following tests are always true.
-t() when integer(42) ->
- ok;
-t() when float(2.0) ->
- ok;
-t() when number(7) ->
- ok;
-t() when number(3.14) ->
- ok;
-t() when atom(error) ->
- ok;
-t() when list([a]) ->
- ok;
-t() when tuple({}) ->
- ok;
-t() when tuple({1, 2}) ->
- ok.
-
-%% The following tests are always false.
-f() when integer(a) ->
- ok;
-f() when float(b) ->
- ok;
-f() when number(c) ->
- ok;
-f() when atom(42) ->
- ok;
-f() when list(33) ->
- ok;
-f() when list({}) ->
- ok;
-f() when list({1, 2}) ->
- ok;
-f() when tuple(33) ->
- ok;
-f() when tuple([a]) ->
- ok;
-f() when tuple([]) ->
- ok;
-f() when tuple(35) ->
- ok;
-f() ->
- ok.
-
-%% The following tests are always true.
-ct(X) ->
- case X of
- Y when integer(42) ->
- ok;
- Y when float(2.0) ->
- ok;
- Y when number(7) ->
- ok;
- Y when number(3.14) ->
- ok;
- Y when atom(error) ->
- ok;
- Y when list([a]) ->
- ok;
- Y when tuple({}) ->
- ok;
- Y when tuple({1, 2}) ->
- ok
- end.
-
-multi(X) ->
- case X of
- Y when float(Y) ; integer(Y) ->
- ok;
- Y when Y > 1, Y < 10 ; atom(Y) ->
- ok;
- Y when Y == 4, number(Y) ; list(Y) ->
- pannkaka;
- Y when Y==3 ; Y==5 ; Y==6 ->
- ok
- end.
diff --git a/lib/compiler/test/compilation_SUITE_data/live_var.erl b/lib/compiler/test/compilation_SUITE_data/live_var.erl
index be79041baf..b984d98c2b 100644
--- a/lib/compiler/test/compilation_SUITE_data/live_var.erl
+++ b/lib/compiler/test/compilation_SUITE_data/live_var.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/long_string.erl b/lib/compiler/test/compilation_SUITE_data/long_string.erl
deleted file mode 100644
index 1624e222ab..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/long_string.erl
+++ /dev/null
@@ -1,671 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(long_string).
-
--export([?MODULE/0]).
-
-?MODULE() ->
- Options = "some stupid long string",
- 49252 = length(generate(Options, "348927432097sfkjfkljf329")),
- ok.
-
-generate(Options, Glurf) ->
- "asdhfaslfdjhhwleirsk e4kjhr430usduy fdk;///s llsjkf;laskjfsdfkjasdfkj
-sdkljflasdfkjasldkfjasd" ++ Options ++
-"CSAgICAgICBWZXJzaW9uIDIsIEp1bmUgMTk5MQoKIENvcHlyaWdodCAoQykgMTk4OSwgMTk5MSBG
-cmVlIFNvZnR3YXJlIEZvdW5kYXRpb24sIEluYy4KICAgICAgICAgICAgICAgICAgICAgICA1OSBU
-ZW1wbGUgUGxhY2UsIFN1aXRlIDMzMCwgQm9zdG9uLCBNQSAgMDIxMTEtMTMwNyAgVVNBCiBFdmVy
-eW9uZSBpcyBwZXJtaXR0ZWQgdG8gY29weSBhbmQgZGlzdHJpYnV0ZSB2ZXJiYXRpbSBjb3BpZXMK
-IG9mIHRoaXMgbGljZW5zZSBkb2N1bWVudCwgYnV0IGNoYW5naW5nIGl0IGlzIG5vdCBhbGxvd2Vk
-LgoKCQkJICAgIFByZWFtYmxlCgogIFRoZSBsaWNlbnNlcyBmb3IgbW9zdCBzb2Z0d2FyZSBhcmUg
-ZGVzaWduZWQgdG8gdGFrZSBhd2F5IHlvdXIKZnJlZWRvbSB0byBzaGFyZSBhbmQgY2hhbmdlIGl0
-LiAgQnkgY29udHJhc3QsIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMKTGljZW5zZSBpcyBpbnRlbmRl
-ZCB0byBndWFyYW50ZWUgeW91ciBmcmVlZG9tIHRvIHNoYXJlIGFuZCBjaGFuZ2UgZnJlZQpzb2Z0
-d2FyZS0tdG8gbWFrZSBzdXJlIHRoZSBzb2Z0d2FyZSBpcyBmcmVlIGZvciBhbGwgaXRzIHVzZXJz
-LiAgVGhpcwpHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFwcGxpZXMgdG8gbW9zdCBvZiB0aGUgRnJl
-ZSBTb2Z0d2FyZQpGb3VuZGF0aW9uJ3Mgc29mdHdhcmUgYW5kIHRvIGFueSBvdGhlciBwcm9ncmFt
-IHdob3NlIGF1dGhvcnMgY29tbWl0IHRvCnVzaW5nIGl0LiAgKFNvbWUgb3RoZXIgRnJlZSBTb2Z0
-d2FyZSBGb3VuZGF0aW9uIHNvZnR3YXJlIGlzIGNvdmVyZWQgYnkKdGhlIEdOVSBMaWJyYXJ5IEdl
-bmVyYWwgUHVibGljIExpY2Vuc2UgaW5zdGVhZC4pICBZb3UgY2FuIGFwcGx5IGl0IHRvCnlvdXIg
-cHJvZ3JhbXMsIHRvby4KCiAgV2hlbiB3ZSBzcGVhayBvZiBmcmVlIHNvZnR3YXJlLCB3ZSBhcmUg
-cmVmZXJyaW5nIHRvIGZyZWVkb20sIG5vdApwcmljZS4gIE91ciBHZW5lcmFsIFB1YmxpYyBMaWNl
-bnNlcyBhcmUgZGVzaWduZWQgdG8gbWFrZSBzdXJlIHRoYXQgeW91CmhhdmUgdGhlIGZyZWVkb20g
-dG8gZGlzdHJpYnV0ZSBjb3BpZXMgb2YgZnJlZSBzb2Z0d2FyZSAoYW5kIGNoYXJnZSBmb3IKdGhp
-cyBzZXJ2aWNlIGlmIHlvdSB3aXNoKSwgdGhhdCB5b3UgcmVjZWl2ZSBzb3VyY2UgY29kZSBvciBj
-YW4gZ2V0IGl0CmlmIHlvdSB3YW50IGl0LCB0aGF0IHlvdSBjYW4gY2hhbmdlIHRoZSBzb2Z0d2Fy
-ZSBvciB1c2UgcGllY2VzIG9mIGl0CmluIG5ldyBmcmVlIHByb2dyYW1zOyBhbmQgdGhhdCB5b3Ug
-a25vdyB5b3UgY2FuIGRvIHRoZXNlIHRoaW5ncy4KCiAgVG8gcHJvdGVjdCB5b3VyIHJpZ2h0cywg
-d2UgbmVlZCB0byBtYWtlIHJlc3RyaWN0aW9ucyB0aGF0IGZvcmJpZAphbnlvbmUgdG8gZGVueSB5
-b3UgdGhlc2UgcmlnaHRzIG9yIHRvIGFzayB5b3UgdG8gc3VycmVuZGVyIHRoZSByaWdodHMuClRo
-ZXNlIHJlc3RyaWN0aW9ucyB0cmFuc2xhdGUgdG8gY2VydGFpbiByZXNwb25zaWJpbGl0aWVzIGZv
-ciB5b3UgaWYgeW91CmRpc3RyaWJ1dGUgY29waWVzIG9mIHRoZSBzb2Z0d2FyZSwgb3IgaWYgeW91
-IG1vZGlmeSBpdC4KCiAgRm9yIGV4YW1wbGUsIGlmIHlvdSBkaXN0cmlidXRlIGNvcGllcyBvZiBz
-dWNoIGEgcHJvZ3JhbSwgd2hldGhlcgpncmF0aXMgb3IgZm9yIGEgZmVlLCB5b3UgbXVzdCBnaXZl
-IHRoZSByZWNpcGllbnRzIGFsbCB0aGUgcmlnaHRzIHRoYXQKeW91IGhhdmUuICBZb3UgbXVzdCBt
-YWtlIHN1cmUgdGhhdCB0aGV5LCB0b28sIHJlY2VpdmUgb3IgY2FuIGdldCB0aGUKc291cmNlIGNv
-ZGUuICBBbmQgeW91IG11c3Qgc2hvdyB0aGVtIHRoZXNlIHRlcm1zIHNvIHRoZXkga25vdyB0aGVp
-cgpyaWdodHMuCgogIFdlIHByb3RlY3QgeW91ciByaWdodHMgd2l0aCB0d28gc3RlcHM6ICgxKSBj
-b3B5cmlnaHQgdGhlIHNvZnR3YXJlLCBhbmQKKDIpIG9mZmVyIHlvdSB0aGlzIGxpY2Vuc2Ugd2hp
-Y2ggZ2l2ZXMgeW91IGxlZ2FsIHBlcm1pc3Npb24gdG8gY29weSwKZGlzdHJpYnV0ZSBhbmQvb3Ig
-bW9kaWZ5IHRoZSBzb2Z0d2FyZS4KCiAgQWxzbywgZm9yIGVhY2ggYXV0aG9yJ3MgcHJvdGVjdGlv
-biBhbmQgb3Vycywgd2Ugd2FudCB0byBtYWtlIGNlcnRhaW4KdGhhdCBldmVyeW9uZSB1bmRlcnN0
-YW5kcyB0aGF0IHRoZXJlIGlzIG5vIHdhcnJhbnR5IGZvciB0aGlzIGZyZWUKc29mdHdhcmUuICBJ
-ZiB0aGUgc29mdHdhcmUgaXMgbW9kaWZpZWQgYnkgc29tZW9uZSBlbHNlIGFuZCBwYXNzZWQgb24s
-IHdlCndhbnQgaXRzIHJlY2lwaWVudHMgdG8ga25vdyB0aGF0IHdoYXQgdGhleSBoYXZlIGlzIG5v
-dCB0aGUgb3JpZ2luYWwsIHNvCnRoYXQgYW55IHByb2JsZW1zIGludHJvZHVjZWQgYnkgb3RoZXJz
-IHdpbGwgbm90IHJlZmxlY3Qgb24gdGhlIG9yaWdpbmFsCmF1dGhvcnMnIHJlcHV0YXRpb25zLgoK
-ICBGaW5hbGx5LCBhbnkgZnJlZSBwcm9ncmFtIGlzIHRocmVhdGVuZWQgY29uc3RhbnRseSBieSBz
-b2Z0d2FyZQpwYXRlbnRzLiAgV2Ugd2lzaCB0byBhdm9pZCB0aGUgZGFuZ2VyIHRoYXQgcmVkaXN0
-cmlidXRvcnMgb2YgYSBmcmVlCnByb2dyYW0gd2lsbCBpbmRpdmlkdWFsbHkgb2J0YWluIHBhdGVu
-dCBsaWNlbnNlcywgaW4gZWZmZWN0IG1ha2luZyB0aGUKcHJvZ3JhbSBwcm9wcmlldGFyeS4gIFRv
-IHByZXZlbnQgdGhpcywgd2UgaGF2ZSBtYWRlIGl0IGNsZWFyIHRoYXQgYW55CnBhdGVudCBtdXN0
-IGJlIGxpY2Vuc2VkIGZvciBldmVyeW9uZSdzIGZyZWUgdXNlIG9yIG5vdCBsaWNlbnNlZCBhdCBh
-bGwuCgogIFRoZSBwcmVjaXNlIHRlcm1zIGFuZCBjb25kaXRpb25zIGZvciBjb3B5aW5nLCBkaXN0
-cmlidXRpb24gYW5kCm1vZGlmaWNhdGlvbiBmb2xsb3cuCgwKCQkgICAgR05VIEdFTkVSQUwgUFVC
-TElDIExJQ0VOU0UKICAgVEVSTVMgQU5EIENPTkRJVElPTlMgRk9SIENPUFlJTkcsIERJU1RSSUJV
-VElPTiBBTkQgTU9ESUZJQ0FUSU9OCgogIDAuIFRoaXMgTGljZW5zZSBhcHBsaWVzIHRvIGFueSBw
-cm9ncmFtIG9yIG90aGVyIHdvcmsgd2hpY2ggY29udGFpbnMKYSBub3RpY2UgcGxhY2VkIGJ5IHRo
-ZSBjb3B5cmlnaHQgaG9sZGVyIHNheWluZyBpdCBtYXkgYmUgZGlzdHJpYnV0ZWQKdW5kZXIgdGhl
-IHRlcm1zIG9mIHRoaXMgR2VuZXJhbCBQdWJsaWMgTGljZW5zZS4gIFRoZSAiUHJvZ3JhbSIsIGJl
-bG93LApyZWZlcnMgdG8gYW55IHN1Y2ggcHJvZ3JhbSBvciB3b3JrLCBhbmQgYSAid29yayBiYXNl
-ZCBvbiB0aGUgUHJvZ3JhbSIKbWVhbnMgZWl0aGVyIHRoZSBQcm9ncmFtIG9yIGFueSBkZXJpdmF0
-aXZlIHdvcmsgdW5kZXIgY29weXJpZ2h0IGxhdzoKdGhhdCBpcyB0byBzYXksIGEgd29yayBjb250
-YWluaW5nIHRoZSBQcm9ncmFtIG9yIGEgcG9ydGlvbiBvZiBpdCwKZWl0aGVyIHZlcmJhdGltIG9y
-IHdpdGggbW9kaWZpY2F0aW9ucyBhbmQvb3IgdHJhbnNsYXRlZCBpbnRvIGFub3RoZXIKbGFuZ3Vh
-Z2UuICAoSGVyZWluYWZ0ZXIsIHRyYW5zbGF0aW9uIGlzIGluY2x1ZGVkIHdpdGhvdXQgbGltaXRh
-dGlvbiBpbgp0aGUgdGVybSAibW9kaWZpY2F0aW9uIi4pICBFYWNoIGxpY2Vuc2VlIGlzIGFkZHJl
-c3NlZCBhcyAieW91Ii4KCkFjdGl2aXRpZXMgb3RoZXIgdGhhbiBjb3B5aW5nLCBkaXN0cmlidXRp
-b24gYW5kIG1vZGlmaWNhdGlvbiBhcmUgbm90CmNvdmVyZWQgYnkgdGhpcyBMaWNlbnNlOyB0aGV5
-IGFyZSBvdXRzaWRlIGl0cyBzY29wZS4gIFRoZSBhY3Qgb2YKcnVubmluZyB0aGUgUHJvZ3JhbSBp
-cyBub3QgcmVzdHJpY3RlZCwgYW5kIHRoZSBvdXRwdXQgZnJvbSB0aGUgUHJvZ3JhbQppcyBjb3Zl
-cmVkIG9ubHkgaWYgaXRzIGNvbnRlbnRzIGNvbnN0aXR1dGUgYSB3b3JrIGJhc2VkIG9uIHRoZQpQ
-cm9ncmFtIChpbmRlcGVuZGVudCBvZiBoYXZpbmcgYmVlbiBtYWRlIGJ5IHJ1bm5pbmcgdGhlIFBy
-b2dyYW0pLgpXaGV0aGVyIHRoYXQgaXMgdHJ1ZSBkZXBlbmRzIG9uIHdoYXQgdGhlIFByb2dyYW0g
-ZG9lcy4KCiAgMS4gWW91IG1heSBjb3B5IGFuZCBkaXN0cmlidXRlIHZlcmJhdGltIGNvcGllcyBv
-ZiB0aGUgUHJvZ3JhbSdzCnNvdXJjZSBjb2RlIGFzIHlvdSByZWNlaXZlIGl0LCBpbiBhbnkgbWVk
-aXVtLCBwcm92aWRlZCB0aGF0IHlvdQpjb25zcGljdW91c2x5IGFuZCBhcHByb3ByaWF0ZWx5IHB1
-Ymxpc2ggb24gZWFjaCBjb3B5IGFuIGFwcHJvcHJpYXRlCmNvcHlyaWdodCBub3RpY2UgYW5kIGRp
-c2NsYWltZXIgb2Ygd2FycmFudHk7IGtlZXAgaW50YWN0IGFsbCB0aGUKbm90aWNlcyB0aGF0IHJl
-ZmVyIHRvIHRoaXMgTGljZW5zZSBhbmQgdG8gdGhlIGFic2VuY2Ugb2YgYW55IHdhcnJhbnR5Owph
-bmQgZ2l2ZSBhbnkgb3RoZXIgcmVjaXBpZW50cyBvZiB0aGUgUHJvZ3JhbSBhIGNvcHkgb2YgdGhp
-cyBMaWNlbnNlCmFsb25nIHdpdGggdGhlIFByb2dyYW0uCgpZb3UgbWF5IGNoYXJnZSBhIGZlZSBm
-b3IgdGhlIHBoeXNpY2FsIGFjdCBvZiB0cmFuc2ZlcnJpbmcgYSBjb3B5LCBhbmQKeW91IG1heSBh
-dCB5b3VyIG9wdGlvbiBvZmZlciB3YXJyYW50eSBwcm90ZWN0aW9uIGluIGV4Y2hhbmdlIGZvciBh
-IGZlZS4KCiAgMi4gWW91IG1heSBtb2RpZnkgeW91ciBjb3B5IG9yIGNvcGllcyBvZiB0aGUgUHJv
-Z3JhbSBvciBhbnkgcG9ydGlvbgpvZiBpdCwgdGh1cyBmb3JtaW5nIGEgd29yayBiYXNlZCBvbiB0
-aGUgUHJvZ3JhbSwgYW5kIGNvcHkgYW5kCmRpc3RyaWJ1dGUgc3VjaCBtb2RpZmljYXRpb25zIG9y
-IHdvcmsgdW5kZXIgdGhlIHRlcm1zIG9mIFNlY3Rpb24gMQphYm92ZSwgcHJvdmlkZWQgdGhhdCB5
-b3UgYWxzbyBtZWV0IGFsbCBvZiB0aGVzZSBjb25kaXRpb25zOgoKICAgIGEpIFlvdSBtdXN0IGNh
-dXNlIHRoZSBtb2RpZmllZCBmaWxlcyB0byBjYXJyeSBwcm9taW5lbnQgbm90aWNlcwogICAgc3Rh
-dGluZyB0aGF0IHlvdSBjaGFuZ2VkIHRoZSBmaWxlcyBhbmQgdGhlIGRhdGUgb2YgYW55IGNoYW5n
-ZS4KCiAgICBiKSBZb3UgbXVzdCBjYXVzZSBhbnkgd29yayB0aGF0IHlvdSBkaXN0cmlidXRlIG9y
-IHB1Ymxpc2gsIHRoYXQgaW4KICAgIHdob2xlIG9yIGluIHBhcnQgY29udGFpbnMgb3IgaXMgZGVy
-aXZlZCBmcm9tIHRoZSBQcm9ncmFtIG9yIGFueQogICAgcGFydCB0aGVyZW9mLCB0byBiZSBsaWNl
-bnNlZCBhcyBhIHdob2xlIGF0IG5vIGNoYXJnZSB0byBhbGwgdGhpcmQKICAgIHBhcnRpZXMgdW5k
-ZXIgdGhlIHRlcm1zIG9mIHRoaXMgTGljZW5zZS4KCiAgICBjKSBJZiB0aGUgbW9kaWZpZWQgcHJv
-Z3JhbSBub3JtYWxseSByZWFkcyBjb21tYW5kcyBpbnRlcmFjdGl2ZWx5CiAgICB3aGVuIHJ1biwg
-eW91IG11c3QgY2F1c2UgaXQsIHdoZW4gc3RhcnRlZCBydW5uaW5nIGZvciBzdWNoCiAgICBpbnRl
-cmFjdGl2ZSB1c2UgaW4gdGhlIG1vc3Qgb3JkaW5hcnkgd2F5LCB0byBwcmludCBvciBkaXNwbGF5
-IGFuCiAgICBhbm5vdW5jZW1lbnQgaW5jbHVkaW5nIGFuIGFwcHJvcHJpYXRlIGNvcHlyaWdodCBu
-b3RpY2UgYW5kIGEKICAgIG5vdGljZSB0aGF0IHRoZXJlIGlzIG5vIHdhcnJhbnR5IChvciBlbHNl
-LCBzYXlpbmcgdGhhdCB5b3UgcHJvdmlkZQogICAgYSB3YXJyYW50eSkgYW5kIHRoYXQgdXNlcnMg
-bWF5IHJlZGlzdHJpYnV0ZSB0aGUgcHJvZ3JhbSB1bmRlcgogICAgdGhlc2UgY29uZGl0aW9ucywg
-YW5kIHRlbGxpbmcgdGhlIHVzZXIgaG93IHRvIHZpZXcgYSBjb3B5IG9mIHRoaXMKICAgIExpY2Vu
-c2UuICAoRXhjZXB0aW9uOiBpZiB0aGUgUHJvZ3JhbSBpdHNlbGYgaXMgaW50ZXJhY3RpdmUgYnV0
-CiAgICBkb2VzIG5vdCBub3JtYWxseSBwcmludCBzdWNoIGFuIGFubm91bmNlbWVudCwgeW91ciB3
-b3JrIGJhc2VkIG9uCiAgICB0aGUgUHJvZ3JhbSBpcyBub3QgcmVxdWlyZWQgdG8gcHJpbnQgYW4g
-YW5ub3VuY2VtZW50LikKDApUaGVzZSByZXF1aXJlbWVudHMgYXBwbHkgdG8gdGhlIG1vZGlmaWVk
-IHdvcmsgYXMgYSB3aG9sZS4gIElmCmlkZW50aWZpYWJsZSBzZWN0aW9ucyBvZiB0aGF0IHdvcmsg
-YXJlIG5vdCBkZXJpdmVkIGZyb20gdGhlIFByb2dyYW0sCmFuZCBjYW4gYmUgcmVhc29uYWJseSBj
-b25zaWRlcmVkIGluZGVwZW5kZW50IGFuZCBzZXBhcmF0ZSB3b3JrcyBpbgp0aGVtc2VsdmVzLCB0
-aGVuIHRoaXMgTGljZW5zZSwgYW5kIGl0cyB0ZXJtcywgZG8gbm90IGFwcGx5IHRvIHRob3NlCnNl
-Y3Rpb25zIHdoZW4geW91IGRpc3RyaWJ1dGUgdGhlbSBhcyBzZXBhcmF0ZSB3b3Jrcy4gIEJ1dCB3
-aGVuIHlvdQpkaXN0cmlidXRlIHRoZSBzYW1lIHNlY3Rpb25zIGFzIHBhcnQgb2YgYSB3aG9sZSB3
-aGljaCBpcyBhIHdvcmsgYmFzZWQKb24gdGhlIFByb2dyYW0sIHRoZSBkaXN0cmlidXRpb24gb2Yg
-dGhlIHdob2xlIG11c3QgYmUgb24gdGhlIHRlcm1zIG9mCnRoaXMgTGljZW5zZSwgd2hvc2UgcGVy
-bWlzc2lvbnMgZm9yIG90aGVyIGxpY2Vuc2VlcyBleHRlbmQgdG8gdGhlCmVudGlyZSB3aG9sZSwg
-YW5kIHRodXMgdG8gZWFjaCBhbmQgZXZlcnkgcGFydCByZWdhcmRsZXNzIG9mIHdobyB3cm90ZSBp
-dC4KClRodXMsIGl0IGlzIG5vdCB0aGUgaW50ZW50IG9mIHRoaXMgc2VjdGlvbiB0byBjbGFpbSBy
-aWdodHMgb3IgY29udGVzdAp5b3VyIHJpZ2h0cyB0byB3b3JrIHdyaXR0ZW4gZW50aXJlbHkgYnkg
-eW91OyByYXRoZXIsIHRoZSBpbnRlbnQgaXMgdG8KZXhlcmNpc2UgdGhlIHJpZ2h0IHRvIGNvbnRy
-b2wgdGhlIGRpc3RyaWJ1dGlvbiBvZiBkZXJpdmF0aXZlIG9yCmNvbGxlY3RpdmUgd29ya3MgYmFz
-ZWQgb24gdGhlIFByb2dyYW0uCgpJbiBhZGRpdGlvbiwgbWVyZSBhZ2dyZWdhdGlvbiBvZiBhbm90
-aGVyIHdvcmsgbm90IGJhc2VkIG9uIHRoZSBQcm9ncmFtCndpdGggdGhlIFByb2dyYW0gKG9yIHdp
-dGggYSB3b3JrIGJhc2VkIG9uIHRoZSBQcm9ncmFtKSBvbiBhIHZvbHVtZSBvZgphIHN0b3JhZ2Ug
-b3IgZGlzdHJpYnV0aW9uIG1lZGl1bSBkb2VzIG5vdCBicmluZyB0aGUgb3RoZXIgd29yayB1bmRl
-cgp0aGUgc2NvcGUgb2YgdGhpcyBMaWNlbnNlLgoKICAzLiBZb3UgbWF5IGNvcHkgYW5kIGRpc3Ry
-aWJ1dGUgdGhlIFByb2dyYW0gKG9yIGEgd29yayBiYXNlZCBvbiBpdCwKdW5kZXIgU2VjdGlvbiAy
-KSBpbiBvYmplY3QgY29kZSBvciBleGVjdXRhYmxlIGZvcm0gdW5kZXIgdGhlIHRlcm1zIG9mClNl
-Y3Rpb25zIDEgYW5kIDIgYWJvdmUgcHJvdmlkZWQgdGhhdCB5b3UgYWxzbyBkbyBvbmUgb2YgdGhl
-IGZvbGxvd2luZzoKCiAgICBhKSBBY2NvbXBhbnkgaXQgd2l0aCB0aGUgY29tcGxldGUgY29ycmVz
-cG9uZGluZyBtYWNoaW5lLXJlYWRhYmxlCiAgICBzb3VyY2UgY29kZSwgd2hpY2ggbXVzdCBiZSBk
-aXN0cmlidXRlZCB1bmRlciB0aGUgdGVybXMgb2YgU2VjdGlvbnMKICAgIDEgYW5kIDIgYWJvdmUg
-b24gYSBtZWRpdW0gY3VzdG9tYXJpbHkgdXNlZCBmb3Igc29mdHdhcmUgaW50ZXJjaGFuZ2U7IG9y
-LAoKICAgIGIpIEFjY29tcGFueSBpdCB3aXRoIGEgd3JpdHRlbiBvZmZlciwgdmFsaWQgZm9yIGF0
-IGxlYXN0IHRocmVlCiAgICB5ZWFycywgdG8gZ2l2ZSBhbnkgdGhpcmQgcGFydHksIGZvciBhIGNo
-YXJnZSBubyBtb3JlIHRoYW4geW91cgogICAgY29zdCBvZiBwaHlzaWNhbGx5IHBlcmZvcm1pbmcg
-c291cmNlIGRpc3RyaWJ1dGlvbiwgYSBjb21wbGV0ZQogICAgbWFjaGluZS1yZWFkYWJsZSBjb3B5
-IG9mIHRoZSBjb3JyZXNwb25kaW5nIHNvdXJjZSBjb2RlLCB0byBiZQogICAgZGlzdHJpYnV0ZWQg
-dW5kZXIgdGhlIHRlcm1zIG9mIFNlY3Rpb25zIDEgYW5kIDIgYWJvdmUgb24gYSBtZWRpdW0KICAg
-IGN1c3RvbWFyaWx5IHVzZWQgZm9yIHNvZnR3YXJlIGludGVyY2hhbmdlOyBvciwKCiAgICBjKSBB
-Y2NvbXBhbnkgaXQgd2l0aCB0aGUgaW5mb3JtYXRpb24geW91IHJlY2VpdmVkIGFzIHRvIHRoZSBv
-ZmZlcgogICAgdG8gZGlzdHJpYnV0ZSBjb3JyZXNwb25kaW5nIHNvdXJjZSBjb2RlLiAgKFRoaXMg
-YWx0ZXJuYXRpdmUgaXMKICAgIGFsbG93ZWQgb25seSBmb3Igbm9uY29tbWVyY2lhbCBkaXN0cmli
-dXRpb24gYW5kIG9ubHkgaWYgeW91CiAgICByZWNlaXZlZCB0aGUgcHJvZ3JhbSBpbiBvYmplY3Qg
-Y29kZSBvciBleGVjdXRhYmxlIGZvcm0gd2l0aCBzdWNoCiAgICBhbiBvZmZlciwgaW4gYWNjb3Jk
-IHdpdGggU3Vic2VjdGlvbiBiIGFib3ZlLikKClRoZSBzb3VyY2UgY29kZSBmb3IgYSB3b3JrIG1l
-YW5zIHRoZSBwcmVmZXJyZWQgZm9ybSBvZiB0aGUgd29yayBmb3IKbWFraW5nIG1vZGlmaWNhdGlv
-bnMgdG8gaXQuICBGb3IgYW4gZXhlY3V0YWJsZSB3b3JrLCBjb21wbGV0ZSBzb3VyY2UKY29kZSBt
-ZWFucyBhbGwgdGhlIHNvdXJjZSBjb2RlIGZvciBhbGwgbW9kdWxlcyBpdCBjb250YWlucywgcGx1
-cyBhbnkKYXNzb2NpYXRlZCBpbnRlcmZhY2UgZGVmaW5pdGlvbiBmaWxlcywgcGx1cyB0aGUgc2Ny
-aXB0cyB1c2VkIHRvCmNvbnRyb2wgY29tcGlsYXRpb24gYW5kIGluc3RhbGxhdGlvbiBvZiB0aGUg
-ZXhlY3V0YWJsZS4gIEhvd2V2ZXIsIGFzIGEKc3BlY2lhbCBleGNlcHRpb24sIHRoZSBzb3VyY2Ug
-Y29kZSBkaXN0cmlidXRlZCBuZWVkIG5vdCBpbmNsdWRlCmFueXRoaW5nIHRoYXQgaXMgbm9ybWFs
-bHkgZGlzdHJpYnV0ZWQgKGluIGVpdGhlciBzb3VyY2Ugb3IgYmluYXJ5CmZvcm0pIHdpdGggdGhl
-IG1ham9yIGNvbXBvbmVudHMgKGNvbXBpbGVyLCBrZXJuZWwsIGFuZCBzbyBvbikgb2YgdGhlCm9w
-ZXJhdGluZyBzeXN0ZW0gb24gd2hpY2ggdGhlIGV4ZWN1dGFibGUgcnVucywgdW5sZXNzIHRoYXQg
-Y29tcG9uZW50Cml0c2VsZiBhY2NvbXBhbmllcyB0aGUgZXhlY3V0YWJsZS4KCklmIGRpc3RyaWJ1
-dGlvbiBvZiBleGVjdXRhYmxlIG9yIG9iamVjdCBjb2RlIGlzIG1hZGUgYnkgb2ZmZXJpbmcKYWNj
-ZXNzIHRvIGNvcHkgZnJvbSBhIGRlc2lnbmF0ZWQgcGxhY2UsIHRoZW4gb2ZmZXJpbmcgZXF1aXZh
-bGVudAphY2Nlc3MgdG8gY29weSB0aGUgc291cmNlIGNvZGUgZnJvbSB0aGUgc2FtZSBwbGFjZSBj
-b3VudHMgYXMKZGlzdHJpYnV0aW9uIG9mIHRoZSBzb3VyY2UgY29kZSwgZXZlbiB0aG91Z2ggdGhp
-cmQgcGFydGllcyBhcmUgbm90CmNvbXBlbGxlZCB0byBjb3B5IHRoZSBzb3VyY2UgYWxvbmcgd2l0
-aCB0aGUgb2JqZWN0IGNvZGUuCgwKICA0LiBZb3UgbWF5IG5vdCBjb3B5LCBtb2RpZnksIHN1Ymxp
-Y2Vuc2UsIG9yIGRpc3RyaWJ1dGUgdGhlIFByb2dyYW0KZXhjZXB0IGFzIGV4cHJlc3NseSBwcm92
-aWRlZCB1bmRlciB0aGlzIExpY2Vuc2UuICBBbnkgYXR0ZW1wdApvdGhlcndpc2UgdG8gY29weSwg
-bW9kaWZ5LCBzdWJsaWNlbnNlIG9yIGRpc3RyaWJ1dGUgdGhlIFByb2dyYW0gaXMKdm9pZCwgYW5k
-IHdpbGwgYXV0b21hdGljYWxseSB0ZXJtaW5hdGUgeW91ciByaWdodHMgdW5kZXIgdGhpcyBMaWNl
-bnNlLgpIb3dldmVyLCBwYXJ0aWVzIHdobyBoYXZlIHJlY2VpdmVkIGNvcGllcywgb3IgcmlnaHRz
-LCBmcm9tIHlvdSB1bmRlcgp0aGlzIExpY2Vuc2Ugd2lsbCBub3QgaGF2ZSB0aGVpciBsaWNlbnNl
-cyB0ZXJtaW5hdGVkIHNvIGxvbmcgYXMgc3VjaApwYXJ0aWVzIHJlbWFpbiBpbiBmdWxsIGNvbXBs
-aWFuY2UuCgogIDUuIFlvdSBhcmUgbm90IHJlcXVpcmVkIHRvIGFjY2VwdCB0aGlzIExpY2Vuc2Us
-IHNpbmNlIHlvdSBoYXZlIG5vdApzaWduZWQgaXQuICBIb3dldmVyLCBub3RoaW5nIGVsc2UgZ3Jh
-bnRzIHlvdSBwZXJtaXNzaW9uIHRvIG1vZGlmeSBvcgpkaXN0cmlidXRlIHRoZSBQcm9ncmFtIG9y
-IGl0cyBkZXJpdmF0aXZlIHdvcmtzLiAgVGhlc2UgYWN0aW9ucyBhcmUKcHJvaGliaXRlZCBieSBs
-YXcgaWYgeW91IGRvIG5vdCBhY2NlcHQgdGhpcyBMaWNlbnNlLiAgVGhlcmVmb3JlLCBieQptb2Rp
-Znlpbmcgb3IgZGlzdHJpYnV0aW5nIHRoZSBQcm9ncmFtIChvciBhbnkgd29yayBiYXNlZCBvbiB0
-aGUKUHJvZ3JhbSksIHlvdSBpbmRpY2F0ZSB5b3VyIGFjY2VwdGFuY2Ugb2YgdGhpcyBMaWNlbnNl
-IHRvIGRvIHNvLCBhbmQKYWxsIGl0cyB0ZXJtcyBhbmQgY29uZGl0aW9ucyBmb3IgY29weWluZywg
-ZGlzdHJpYnV0aW5nIG9yIG1vZGlmeWluZwp0aGUgUHJvZ3JhbSBvciB3b3JrcyBiYXNlZCBvbiBp
-dC4KCiAgNi4gRWFjaCB0aW1lIHlvdSByZWRpc3RyaWJ1dGUgdGhlIFByb2dyYW0gKG9yIGFueSB3
-b3JrIGJhc2VkIG9uIHRoZQpQcm9ncmFtKSwgdGhlIHJlY2lwaWVudCBhdXRvbWF0aWNhbGx5IHJl
-Y2VpdmVzIGEgbGljZW5zZSBmcm9tIHRoZQpvcmlnaW5hbCBsaWNlbnNvciB0byBjb3B5LCBkaXN0
-cmlidXRlIG9yIG1vZGlmeSB0aGUgUHJvZ3JhbSBzdWJqZWN0IHRvCnRoZXNlIHRlcm1zIGFuZCBj
-b25kaXRpb25zLiAgWW91IG1heSBub3QgaW1wb3NlIGFueSBmdXJ0aGVyCnJlc3RyaWN0aW9ucyBv
-biB0aGUgcmVjaXBpZW50cycgZXhlcmNpc2Ugb2YgdGhlIHJpZ2h0cyBncmFudGVkIGhlcmVpbi4K
-WW91IGFyZSBub3QgcmVzcG9uc2libGUgZm9yIGVuZm9yY2luZyBjb21wbGlhbmNlIGJ5IHRoaXJk
-IHBhcnRpZXMgdG8KdGhpcyBMaWNlbnNlLgoKICA3LiBJZiwgYXMgYSBjb25zZXF1ZW5jZSBvZiBh
-IGNvdXJ0IGp1ZGdtZW50IG9yIGFsbGVnYXRpb24gb2YgcGF0ZW50CmluZnJpbmdlbWVudCBvciBm
-b3IgYW55IG90aGVyIHJlYXNvbiAobm90IGxpbWl0ZWQgdG8gcGF0ZW50IGlzc3VlcyksCmNvbmRp
-dGlvbnMgYXJlIGltcG9zZWQgb24geW91ICh3aGV0aGVyIGJ5IGNvdXJ0IG9yZGVyLCBhZ3JlZW1l
-bnQgb3IKb3RoZXJ3aXNlKSB0aGF0IGNvbnRyYWRpY3QgdGhlIGNvbmRpdGlvbnMgb2YgdGhpcyBM
-aWNlbnNlLCB0aGV5IGRvIG5vdApleGN1c2UgeW91IGZyb20gdGhlIGNvbmRpdGlvbnMgb2YgdGhp
-cyBMaWNlbnNlLiAgSWYgeW91IGNhbm5vdApkaXN0cmlidXRlIHNvIGFzIHRvIHNhdGlzZnkgc2lt
-dWx0YW5lb3VzbHkgeW91ciBvYmxpZ2F0aW9ucyB1bmRlciB0aGlzCkxpY2Vuc2UgYW5kIGFueSBv
-dGhlciBwZXJ0aW5lbnQgb2JsaWdhdGlvbnMsIHRoZW4gYXMgYSBjb25zZXF1ZW5jZSB5b3UKbWF5
-IG5vdCBkaXN0cmlidXRlIHRoZSBQcm9ncmFtIGF0IGFsbC4gIEZvciBleGFtcGxlLCBpZiBhIHBh
-dGVudApsaWNlbnNlIHdvdWxkIG5vdCBwZXJtaXQgcm95YWx0eS1mcmVlIHJlZGlzdHJpYnV0aW9u
-IG9mIHRoZSBQcm9ncmFtIGJ5CmFsbCB0aG9zZSB3aG8gcmVjZWl2ZSBjb3BpZXMgZGlyZWN0bHkg
-b3IgaW5kaXJlY3RseSB0aHJvdWdoIHlvdSwgdGhlbgp0aGUgb25seSB3YXkgeW91IGNvdWxkIHNh
-dGlzZnkgYm90aCBpdCBhbmQgdGhpcyBMaWNlbnNlIHdvdWxkIGJlIHRvCnJlZnJhaW4gZW50aXJl
-bHkgZnJvbSBkaXN0cmlidXRpb24gb2YgdGhlIFByb2dyYW0uCgpJZiBhbnkgcG9ydGlvbiBvZiB0
-aGlzIHNlY3Rpb24gaXMgaGVsZCBpbnZhbGlkIG9yIHVuZW5mb3JjZWFibGUgdW5kZXIKYW55IHBh
-cnRpY3VsYXIgY2lyY3Vtc3RhbmNlLCB0aGUgYmFsYW5jZSBvZiB0aGUgc2VjdGlvbiBpcyBpbnRl
-bmRlZCB0bwphcHBseSBhbmQgdGhlIHNlY3Rpb24gYXMgYSB3aG9sZSBpcyBpbnRlbmRlZCB0byBh
-cHBseSBpbiBvdGhlcgpjaXJjdW1zdGFuY2VzLgoKSXQgaXMgbm90IHRoZSBwdXJwb3NlIG9mIHRo
-aXMgc2VjdGlvbiB0byBpbmR1Y2UgeW91IHRvIGluZnJpbmdlIGFueQpwYXRlbnRzIG9yIG90aGVy
-IHByb3BlcnR5IHJpZ2h0IGNsYWltcyBvciB0byBjb250ZXN0IHZhbGlkaXR5IG9mIGFueQpzdWNo
-IGNsYWltczsgdGhpcyBzZWN0aW9uIGhhcyB0aGUgc29sZSBwdXJwb3NlIG9mIHByb3RlY3Rpbmcg
-dGhlCmludGVncml0eSBvZiB0aGUgZnJlZSBzb2Z0d2FyZSBkaXN0cmlidXRpb24gc3lzdGVtLCB3
-aGljaCBpcwppbXBsZW1lbnRlZCBieSBwdWJsaWMgbGljZW5zZSBwcmFjdGljZXMuICBNYW55IHBl
-b3BsZSBoYXZlIG1hZGUKZ2VuZXJvdXMgY29udHJpYnV0aW9ucyB0byB0aGUgd2lkZSByYW5nZSBv
-ZiBzb2Z0d2FyZSBkaXN0cmlidXRlZAp0aHJvdWdoIHRoYXQgc3lzdGVtIGluIHJlbGlhbmNlIG9u
-IGNvbnNpc3RlbnQgYXBwbGljYXRpb24gb2YgdGhhdApzeXN0ZW07IGl0IGlzIHVwIHRvIHRoZSBh
-dXRob3IvZG9ub3IgdG8gZGVjaWRlIGlmIGhlIG9yIHNoZSBpcyB3aWxsaW5nCnRvIGRpc3RyaWJ1
-dGUgc29mdHdhcmUgdGhyb3VnaCBhbnkgb3RoZXIgc3lzdGVtIGFuZCBhIGxpY2Vuc2VlIGNhbm5v
-dAppbXBvc2UgdGhhdCBjaG9pY2UuCgpUaGlzIHNlY3Rpb24gaXMgaW50ZW5kZWQgdG8gbWFrZSB0
-aG9yb3VnaGx5IGNsZWFyIHdoYXQgaXMgYmVsaWV2ZWQgdG8KYmUgYSBjb25zZXF1ZW5jZSBvZiB0
-aGUgcmVzdCBvZiB0aGlzIExpY2Vuc2UuCgwKICA4LiBJZiB0aGUgZGlzdHJpYnV0aW9uIGFuZC9v
-ciB1c2Ugb2YgdGhlIFByb2dyYW0gaXMgcmVzdHJpY3RlZCBpbgpjZXJ0YWluIGNvdW50cmllcyBl
-aXRoZXIgYnkgcGF0ZW50cyBvciBieSBjb3B5cmlnaHRlZCBpbnRlcmZhY2VzLCB0aGUKb3JpZ2lu
-YWwgY29weXJpZ2h0IGhvbGRlciB3aG8gcGxhY2VzIHRoZSBQcm9ncmFtIHVuZGVyIHRoaXMgTGlj
-ZW5zZQptYXkgYWRkIGFuIGV4cGxpY2l0IGdlb2dyYXBoaWNhbCBkaXN0cmlidXRpb24gbGltaXRh
-dGlvbiBleGNsdWRpbmcKdGhvc2UgY291bnRyaWVzLCBzbyB0aGF0IGRpc3RyaWJ1dGlvbiBpcyBw
-ZXJtaXR0ZWQgb25seSBpbiBvciBhbW9uZwpjb3VudHJpZXMgbm90IHRodXMgZXhjbHVkZWQuICBJ
-biBzdWNoIGNhc2UsIHRoaXMgTGljZW5zZSBpbmNvcnBvcmF0ZXMKdGhlIGxpbWl0YXRpb24gYXMg
-aWYgd3JpdHRlbiBpbiB0aGUgYm9keSBvZiB0aGlzIExpY2Vuc2UuCgogIDkuIFRoZSBGcmVlIFNv
-ZnR3YXJlIEZvdW5kYXRpb24gbWF5IHB1Ymxpc2ggcmV2aXNlZCBhbmQvb3IgbmV3IHZlcnNpb25z
-Cm9mIHRoZSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGZyb20gdGltZSB0byB0aW1lLiAgU3VjaCBu
-ZXcgdmVyc2lvbnMgd2lsbApiZSBzaW1pbGFyIGluIHNwaXJpdCB0byB0aGUgcHJlc2VudCB2ZXJz
-aW9uLCBidXQgbWF5IGRpZmZlciBpbiBkZXRhaWwgdG8KYWRkcmVzcyBuZXcgcHJvYmxlbXMgb3Ig
-Y29uY2VybnMuCgpFYWNoIHZlcnNpb24gaXMgZ2l2ZW4gYSBkaXN0aW5ndWlzaGluZyB2ZXJzaW9u
-IG51bWJlci4gIElmIHRoZSBQcm9ncmFtCnNwZWNpZmllcyBhIHZlcnNpb24gbnVtYmVyIG9mIHRo
-aXMgTGljZW5zZSB3aGljaCBhcHBsaWVzIHRvIGl0IGFuZCAiYW55CmxhdGVyIHZlcnNpb24iLCB5
-b3UgaGF2ZSB0aGUgb3B0aW9uIG9mIGZvbGxvd2luZyB0aGUgdGVybXMgYW5kIGNvbmRpdGlvbnMK
-ZWl0aGVyIG9mIHRoYXQgdmVyc2lvbiBvciBvZiBhbnkgbGF0ZXIgdmVyc2lvbiBwdWJsaXNoZWQg
-YnkgdGhlIEZyZWUKU29mdHdhcmUgRm91bmRhdGlvbi4gIElmIHRoZSBQcm9ncmFtIGRvZXMgbm90
-IHNwZWNpZnkgYSB2ZXJzaW9uIG51bWJlciBvZgp0aGlzIExpY2Vuc2UsIHlvdSBtYXkgY2hvb3Nl
-IGFueSB2ZXJzaW9uIGV2ZXIgcHVibGlzaGVkIGJ5IHRoZSBGcmVlIFNvZnR3YXJlCkZvdW5kYXRp
-b24uCgogIDEwLiBJZiB5b3Ugd2lzaCB0byBpbmNvcnBvcmF0ZSBwYXJ0cyBvZiB0aGUgUHJvZ3Jh
-bSBpbnRvIG90aGVyIGZyZWUKcHJvZ3JhbXMgd2hvc2UgZGlzdHJpYnV0aW9uIGNvbmRpdGlvbnMg
-YXJlIGRpZmZlcmVudCwgd3JpdGUgdG8gdGhlIGF1dGhvcgp0byBhc2sgZm9yIHBlcm1pc3Npb24u
-ICBGb3Igc29mdHdhcmUgd2hpY2ggaXMgY29weXJpZ2h0ZWQgYnkgdGhlIEZyZWUKU29mdHdhcmUg
-Rm91bmRhdGlvbiwgd3JpdGUgdG8gdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbjsgd2Ugc29t
-ZXRpbWVzCm1ha2UgZXhjZXB0aW9ucyBmb3IgdGhpcy4gIE91ciBkZWNpc2lvbiB3aWxsIGJlIGd1
-aWRlZCBieSB0aGUgdHdvIGdvYWxzCm9mIHByZXNlcnZpbmcgdGhlIGZyZWUgc3RhdHVzIG9mIGFs
-bCBkZXJpdmF0aXZlcyBvZiBvdXIgZnJlZSBzb2Z0d2FyZSBhbmQKb2YgcHJvbW90aW5nIHRoZSBz
-aGFyaW5nIGFuZCByZXVzZSBvZiBzb2Z0d2FyZSBnZW5lcmFsbHkuCgoJCQkgICAgTk8gV0FSUkFO
-VFkKCiAgMTEuIEJFQ0FVU0UgVEhFIFBST0dSQU0gSVMgTElDRU5TRUQgRlJFRSBPRiBDSEFSR0Us
-IFRIRVJFIElTIE5PIFdBUlJBTlRZCkZPUiBUSEUgUFJPR1JBTSwgVE8gVEhFIEVYVEVOVCBQRVJN
-SVRURUQgQlkgQVBQTElDQUJMRSBMQVcuICBFWENFUFQgV0hFTgpPVEhFUldJU0UgU1RBVEVEIElO
-IFdSSVRJTkcgVEhFIENPUFlSSUdIVCBIT0xERVJTIEFORC9PUiBPVEhFUiBQQVJUSUVTClBST1ZJ
-REUgVEhFIFBST0dSQU0gIkFTIElTIiBXSVRIT1VUIFdBUlJBTlRZIE9GIEFOWSBLSU5ELCBFSVRI
-RVIgRVhQUkVTU0VECk9SIElNUExJRUQsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBU
-SEUgSU1QTElFRCBXQVJSQU5USUVTIE9GCk1FUkNIQU5UQUJJTElUWSBBTkQgRklUTkVTUyBGT1Ig
-QSBQQVJUSUNVTEFSIFBVUlBPU0UuICBUSEUgRU5USVJFIFJJU0sgQVMKVE8gVEhFIFFVQUxJVFkg
-QU5EIFBFUkZPUk1BTkNFIE9GIFRIRSBQUk9HUkFNIElTIFdJVEggWU9VLiAgU0hPVUxEIFRIRQpQ
-Uk9HUkFNIFBST1ZFIERFRkVDVElWRSwgWU9VIEFTU1VNRSBUSEUgQ09TVCBPRiBBTEwgTkVDRVNT
-QVJZIFNFUlZJQ0lORywKUkVQQUlSIE9SIENPUlJFQ1RJT04uCgogIDEyLiBJTiBOTyBFVkVOVCBV
-TkxFU1MgUkVRVUlSRUQgQlkgQVBQTElDQUJMRSBMQVcgT1IgQUdSRUVEIFRPIElOIFdSSVRJTkcK
-V0lMTCBBTlkgQ09QWVJJR0hUIEhPTERFUiwgT1IgQU5ZIE9USEVSIFBBUlRZIFdITyBNQVkgTU9E
-SUZZIEFORC9PUgpSRURJU1RSSUJVVEUgVEhFIFBST0dSQU0gQVMgUEVSTUlUVEVEIEFCT1ZFLCBC
-RSBMSUFCTEUgVE8gWU9VIEZPUiBEQU1BR0VTLApJTkNMVURJTkcgQU5ZIEdFTkVSQUwsIFNQRUNJ
-QUwsIElOQ0lERU5UQUwgT1IgQ09OU0VRVUVOVElBTCBEQU1BR0VTIEFSSVNJTkcKT1VUIE9GIFRI
-RSBVU0UgT1IgSU5BQklMSVRZIFRPIFVTRSBUSEUgUFJPR1JBTSAoSU5DTFVESU5HIEJVVCBOT1Qg
-TElNSVRFRApUTyBMT1NTIE9GIERBVEEgT1IgREFUQSBCRUlORyBSRU5ERVJFRCBJTkFDQ1VSQVRF
-IE9SIExPU1NFUyBTVVNUQUlORUQgQlkKWU9VIE9SIFRISVJEIFBBUlRJRVMgT1IgQSBGQUlMVVJF
-IE9GIFRIRSBQUk9HUkFNIFRPIE9QRVJBVEUgV0lUSCBBTlkgT1RIRVIKUFJPR1JBTVMpLCBFVkVO
-IElGIFNVQ0ggSE9MREVSIE9SIE9USEVSIFBBUlRZIEhBUyBCRUVOIEFEVklTRUQgT0YgVEhFClBP
-U1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFUy4KCgkJICAgICBFTkQgT0YgVEVSTVMgQU5EIENPTkRJ
-VElPTlMKDAoJICAgIEhvdyB0byBBcHBseSBUaGVzZSBUZXJtcyB0byBZb3VyIE5ldyBQcm9ncmFt
-cwoKICBJZiB5b3UgZGV2ZWxvcCBhIG5ldyBwcm9ncmFtLCBhbmQgeW91IHdhbnQgaXQgdG8gYmUg
-b2YgdGhlIGdyZWF0ZXN0CnBvc3NpYmxlIHVzZSB0byB0aGUgcHVibGljLCB0aGUgYmVzdCB3YXkg
-dG8gYWNoaWV2ZSB0aGlzIGlzIHRvIG1ha2UgaXQKZnJlZSBzb2Z0d2FyZSB3aGljaCBldmVyeW9u
-ZSBjYW4gcmVkaXN0cmlidXRlIGFuZCBjaGFuZ2UgdW5kZXIgdGhlc2UgdGVybXMuCgogIFRvIGRv
-IHNvLCBhdHRhY2ggdGhlIGZvbGxvd2luZyBub3RpY2VzIHRvIHRoZSBwcm9ncmFtLiAgSXQgaXMg
-c2FmZXN0CnRvIGF0dGFjaCB0aGVtIHRvIHRoZSBzdGFydCBvZiBlYWNoIHNvdXJjZSBmaWxlIHRv
-IG1vc3QgZWZmZWN0aXZlbHkKY29udmV5IHRoZSBleGNsdXNpb24gb2Ygd2FycmFudHk7IGFuZCBl
-YWNoIGZpbGUgc2hvdWxkIGhhdmUgYXQgbGVhc3QKdGhlICJjb3B5cmlnaHQiIGxpbmUgYW5kIGEg
-cG9pbnRlciB0byB3aGVyZSB0aGUgZnVsbCBub3RpY2UgaXMgZm91bmQuCgogICAgPG9uZSBsaW5l
-IHRvIGdpdmUgdGhlIHByb2dyYW0ncyBuYW1lIGFuZCBhIGJyaWVmIGlkZWEgb2Ygd2hhdCBpdCBk
-b2VzLj4KICAgIENvcHlyaWdodCAoQykgPHllYXI+ICA8bmFtZSBvZiBhdXRob3I+CgogICAgVGhp
-cyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9v
-ciBtb2RpZnkKICAgIGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGlj
-IExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5CiAgICB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9u
-OyBlaXRoZXIgdmVyc2lvbiAyIG9mIHRoZSBMaWNlbnNlLCBvcgogICAgKGF0IHlvdXIgb3B0aW9u
-KSBhbnkgbGF0ZXIgdmVyc2lvbi4KCiAgICBUaGlzIHByb2dyYW0gaXMgZGlzdHJpYnV0ZWQgaW4g
-dGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVzZWZ1bCwKICAgIGJ1dCBXSVRIT1VUIEFOWSBXQVJS
-QU5UWTsgd2l0aG91dCBldmVuIHRoZSBpbXBsaWVkIHdhcnJhbnR5IG9mCiAgICBNRVJDSEFOVEFC
-SUxJVFkgb3IgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UuICBTZWUgdGhlCiAgICBH
-TlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBmb3IgbW9yZSBkZXRhaWxzLgoKICAgIFlvdSBzaG91
-bGQgaGF2ZSByZWNlaXZlZCBhIGNvcHkgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNl
-CiAgICBhbG9uZyB3aXRoIHRoaXMgcHJvZ3JhbTsgaWYgbm90LCB3cml0ZSB0byB0aGUgRnJlZSBT
-b2Z0d2FyZQogICAgRm91bmRhdGlvbiwgSW5jLiwgNTkgVGVtcGxlIFBsYWNlLCBTdWl0ZSAzMzAs
-IEJvc3RvbiwgTUEgIDAyMTExLTEzMDcgIFVTQQoKCkFsc28gYWRkIGluZm9ybWF0aW9uIG9uIGhv
-dyB0byBjb250YWN0IHlvdSBieSBlbGVjdHJvbmljIGFuZCBwYXBlciBtYWlsLgoKSWYgdGhlIHBy
-b2dyYW0gaXMgaW50ZXJhY3RpdmUsIG1ha2UgaXQgb3V0cHV0IGEgc2hvcnQgbm90aWNlIGxpa2Ug
-dGhpcwp3aGVuIGl0IHN0YXJ0cyBpbiBhbiBpbnRlcmFjdGl2ZSBtb2RlOgoKICAgIEdub21vdmlz
-aW9uIHZlcnNpb24gNjksIENvcHlyaWdodCAoQykgeWVhciBuYW1lIG9mIGF1dGhvcgogICAgR25v
-bW92aXNpb24gY29tZXMgd2l0aCBBQlNPTFVURUxZIE5PIFdBUlJBTlRZOyBmb3IgZGV0YWlscyB0
-eXBlIGBzaG93IHcnLgogICAgVGhpcyBpcyBmcmVlIHNvZnR3YXJlLCBhbmQgeW91IGFyZSB3ZWxj
-b21lIHRvIHJlZGlzdHJpYnV0ZSBpdAogICAgdW5kZXIgY2VydGFpbiBjb25kaXRpb25zOyB0eXBl
-IGBzaG93IGMnIGZvciBkZXRhaWxzLgoKVGhlIGh5cG90aGV0aWNhbCBjb21tYW5kcyBgc2hvdyB3
-JyBhbmQgYHNob3cgYycgc2hvdWxkIHNob3cgdGhlIGFwcHJvcHJpYXRlCnBhcnRzIG9mIHRoZSBH
-ZW5lcmFsIFB1YmxpYyBMaWNlbnNlLiAgT2YgY291cnNlLCB0aGUgY29tbWFuZHMgeW91IHVzZSBt
-YXkKYmUgY2FsbGVkIHNvbWV0aGluZyBvdGhlciB0aGFuIGBzaG93IHcnIGFuZCBgc2hvdyBjJzsg
-dGhleSBjb3VsZCBldmVuIGJlCm1vdXNlLWNsaWNrcyBvciBtZW51IGl0ZW1zLS13aGF0ZXZlciBz
-dWl0cyB5b3VyIHByb2dyYW0uCgpZb3Ugc2hvdWxkIGFsc28gZ2V0IHlvdXIgZW1wbG95ZXIgKGlm
-IHlvdSB3b3JrIGFzIGEgcHJvZ3JhbW1lcikgb3IgeW91cgpzY2hvb2wsIGlmIGFueSwgdG8gc2ln
-biBhICJjb3B5cmlnaHQgZGlzY2xhaW1lciIgZm9yIHRoZSBwcm9ncmFtLCBpZgpuZWNlc3Nhcnku
-ICBIZXJlIGlzIGEgc2FtcGxlOyBhbHRlciB0aGUgbmFtZXM6CgogIFlveW9keW5lLCBJbmMuLCBo
-ZXJlYnkgZGlzY2xhaW1zIGFsbCBjb3B5cmlnaHQgaW50ZXJlc3QgaW4gdGhlIHByb2dyYW0KICBg
-R25vbW92aXNpb24nICh3aGljaCBtYWtlcyBwYXNzZXMgYXQgY29tcGlsZXJzKSB3cml0dGVuIGJ5
-IEphbWVzIEhhY2tlci4KCiAgPHNpZ25hdHVyZSBvZiBUeSBDb29uPiwgMSBBcHJpbCAxOTg5CiAg
-VHkgQ29vbiwgUHJlc2lkZW50IG9mIFZpY2UKClRoaXMgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBk
-b2VzIG5vdCBwZXJtaXQgaW5jb3Jwb3JhdGluZyB5b3VyIHByb2dyYW0gaW50bwpwcm9wcmlldGFy
-eSBwcm9ncmFtcy4gIElmIHlvdXIgcHJvZ3JhbSBpcyBhIHN1YnJvdXRpbmUgbGlicmFyeSwgeW91
-IG1heQpjb25zaWRlciBpdCBtb3JlIHVzZWZ1bCB0byBwZXJtaXQgbGlua2luZyBwcm9wcmlldGFy
-eSBhcHBsaWNhdGlvbnMgd2l0aCB0aGUKbGlicmFyeS4gIElmIHRoaXMgaXMgd2hhdCB5b3Ugd2Fu
-dCB0byBkbywgdXNlIHRoZSBHTlUgTGlicmFyeSBHZW5lcmFsClB1YmxpYyBMaWNlbnNlIGluc3Rl
-YWQgb2YgdGhpcyBMaWNlbnNlLgo=
-ClxjaGFwdGVye1RoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZX0KClxiZWdpbntjZW50ZXJ9
-CntccGFyaW5kZW50IDBpbgoKVmVyc2lvbiAyLCBKdW5lIDE5OTEKCkNvcHlyaWdodCBcY29weXJp
-Z2h0XCAxOTg5LCAxOTkxIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbiwgSW5jLgoKXGJpZ3NraXAK
-CjU5IFRlbXBsZSBQbGFjZSAtIFN1aXRlIDMzMCwgQm9zdG9uLCBNQSAgMDIxMTEtMTMwNywgVVNB
-CgpcYmlnc2tpcAoKRXZlcnlvbmUgaXMgcGVybWl0dGVkIHRvIGNvcHkgYW5kIGRpc3RyaWJ1dGUg
-dmVyYmF0aW0gY29waWVzCm9mIHRoaXMgbGljZW5zZSBkb2N1bWVudCwgYnV0IGNoYW5naW5nIGl0
-IGlzIG5vdCBhbGxvd2VkLgp9ClxlbmR7Y2VudGVyfQoKXGJlZ2lue2NlbnRlcn0Ke1xiZlxsYXJn
-ZSBQcmVhbWJsZX0KXGVuZHtjZW50ZXJ9CgoKVGhlIGxpY2Vuc2VzIGZvciBtb3N0IHNvZnR3YXJl
-IGFyZSBkZXNpZ25lZCB0byB0YWtlIGF3YXkgeW91ciBmcmVlZG9tIHRvCnNoYXJlIGFuZCBjaGFu
-Z2UgaXQuICBCeSBjb250cmFzdCwgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGlzCmlu
-dGVuZGVkIHRvIGd1YXJhbnRlZSB5b3VyIGZyZWVkb20gdG8gc2hhcmUgYW5kIGNoYW5nZSBmcmVl
-IHNvZnR3YXJlLS0tdG8KbWFrZSBzdXJlIHRoZSBzb2Z0d2FyZSBpcyBmcmVlIGZvciBhbGwgaXRz
-IHVzZXJzLiAgVGhpcyBHZW5lcmFsIFB1YmxpYwpMaWNlbnNlIGFwcGxpZXMgdG8gbW9zdCBvZiB0
-aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uJ3Mgc29mdHdhcmUgYW5kIHRvCmFueSBvdGhlciBw
-cm9ncmFtIHdob3NlIGF1dGhvcnMgY29tbWl0IHRvIHVzaW5nIGl0LiAgKFNvbWUgb3RoZXIgRnJl
-ZQpTb2Z0d2FyZSBGb3VuZGF0aW9uIHNvZnR3YXJlIGlzIGNvdmVyZWQgYnkgdGhlIEdOVSBMaWJy
-YXJ5IEdlbmVyYWwgUHVibGljCkxpY2Vuc2UgaW5zdGVhZC4pICBZb3UgY2FuIGFwcGx5IGl0IHRv
-IHlvdXIgcHJvZ3JhbXMsIHRvby4KCldoZW4gd2Ugc3BlYWsgb2YgZnJlZSBzb2Z0d2FyZSwgd2Ug
-YXJlIHJlZmVycmluZyB0byBmcmVlZG9tLCBub3QgcHJpY2UuCk91ciBHZW5lcmFsIFB1YmxpYyBM
-aWNlbnNlcyBhcmUgZGVzaWduZWQgdG8gbWFrZSBzdXJlIHRoYXQgeW91IGhhdmUgdGhlCmZyZWVk
-b20gdG8gZGlzdHJpYnV0ZSBjb3BpZXMgb2YgZnJlZSBzb2Z0d2FyZSAoYW5kIGNoYXJnZSBmb3Ig
-dGhpcyBzZXJ2aWNlCmlmIHlvdSB3aXNoKSwgdGhhdCB5b3UgcmVjZWl2ZSBzb3VyY2UgY29kZSBv
-ciBjYW4gZ2V0IGl0IGlmIHlvdSB3YW50IGl0LAp0aGF0IHlvdSBjYW4gY2hhbmdlIHRoZSBzb2Z0
-d2FyZSBvciB1c2UgcGllY2VzIG9mIGl0IGluIG5ldyBmcmVlIHByb2dyYW1zOwphbmQgdGhhdCB5
-b3Uga25vdyB5b3UgY2FuIGRvIHRoZXNlIHRoaW5ncy4KClRvIHByb3RlY3QgeW91ciByaWdodHMs
-IHdlIG5lZWQgdG8gbWFrZSByZXN0cmljdGlvbnMgdGhhdCBmb3JiaWQgYW55b25lIHRvCmRlbnkg
-eW91IHRoZXNlIHJpZ2h0cyBvciB0byBhc2sgeW91IHRvIHN1cnJlbmRlciB0aGUgcmlnaHRzLiAg
-VGhlc2UKcmVzdHJpY3Rpb25zIHRyYW5zbGF0ZSB0byBjZXJ0YWluIHJlc3BvbnNpYmlsaXRpZXMg
-Zm9yIHlvdSBpZiB5b3UKZGlzdHJpYnV0ZSBjb3BpZXMgb2YgdGhlIHNvZnR3YXJlLCBvciBpZiB5
-b3UgbW9kaWZ5IGl0LgoKRm9yIGV4YW1wbGUsIGlmIHlvdSBkaXN0cmlidXRlIGNvcGllcyBvZiBz
-dWNoIGEgcHJvZ3JhbSwgd2hldGhlciBncmF0aXMgb3IKZm9yIGEgZmVlLCB5b3UgbXVzdCBnaXZl
-IHRoZSByZWNpcGllbnRzIGFsbCB0aGUgcmlnaHRzIHRoYXQgeW91IGhhdmUuICBZb3UKbXVzdCBt
-YWtlIHN1cmUgdGhhdCB0aGV5LCB0b28sIHJlY2VpdmUgb3IgY2FuIGdldCB0aGUgc291cmNlIGNv
-ZGUuICBBbmQKeW91IG11c3Qgc2hvdyB0aGVtIHRoZXNlIHRlcm1zIHNvIHRoZXkga25vdyB0aGVp
-ciByaWdodHMuCgpXZSBwcm90ZWN0IHlvdXIgcmlnaHRzIHdpdGggdHdvIHN0ZXBzOiAoMSkgY29w
-eXJpZ2h0IHRoZSBzb2Z0d2FyZSwgYW5kICgyKQpvZmZlciB5b3UgdGhpcyBsaWNlbnNlIHdoaWNo
-IGdpdmVzIHlvdSBsZWdhbCBwZXJtaXNzaW9uIHRvIGNvcHksCmRpc3RyaWJ1dGUgYW5kL29yIG1v
-ZGlmeSB0aGUgc29mdHdhcmUuCgpBbHNvLCBmb3IgZWFjaCBhdXRob3IncyBwcm90ZWN0aW9uIGFu
-ZCBvdXJzLCB3ZSB3YW50IHRvIG1ha2UgY2VydGFpbiB0aGF0CmV2ZXJ5b25lIHVuZGVyc3RhbmRz
-IHRoYXQgdGhlcmUgaXMgbm8gd2FycmFudHkgZm9yIHRoaXMgZnJlZSBzb2Z0d2FyZS4gIElmCnRo
-ZSBzb2Z0d2FyZSBpcyBtb2RpZmllZCBieSBzb21lb25lIGVsc2UgYW5kIHBhc3NlZCBvbiwgd2Ug
-d2FudCBpdHMKcmVjaXBpZW50cyB0byBrbm93IHRoYXQgd2hhdCB0aGV5IGhhdmUgaXMgbm90IHRo
-ZSBvcmlnaW5hbCwgc28gdGhhdCBhbnkKcHJvYmxlbXMgaW50cm9kdWNlZCBieSBvdGhlcnMgd2ls
-bCBub3QgcmVmbGVjdCBvbiB0aGUgb3JpZ2luYWwgYXV0aG9ycycKcmVwdXRhdGlvbnMuCgpGaW5h
-bGx5LCBhbnkgZnJlZSBwcm9ncmFtIGlzIHRocmVhdGVuZWQgY29uc3RhbnRseSBieSBzb2Z0d2Fy
-ZSBwYXRlbnRzLgpXZSB3aXNoIHRvIGF2b2lkIHRoZSBkYW5nZXIgdGhhdCByZWRpc3RyaWJ1dG9y
-cyBvZiBhIGZyZWUgcHJvZ3JhbSB3aWxsCmluZGl2aWR1YWxseSBvYnRhaW4gcGF0ZW50IGxpY2Vu
-c2VzLCBpbiBlZmZlY3QgbWFraW5nIHRoZSBwcm9ncmFtCnByb3ByaWV0YXJ5LiAgVG8gcHJldmVu
-dCB0aGlzLCB3ZSBoYXZlIG1hZGUgaXQgY2xlYXIgdGhhdCBhbnkgcGF0ZW50IG11c3QKYmUgbGlj
-ZW5zZWQgZm9yIGV2ZXJ5b25lJ3MgZnJlZSB1c2Ugb3Igbm90IGxpY2Vuc2VkIGF0IGFsbC4KClRo
-ZSBwcmVjaXNlIHRlcm1zIGFuZCBjb25kaXRpb25zIGZvciBjb3B5aW5nLCBkaXN0cmlidXRpb24g
-YW5kCm1vZGlmaWNhdGlvbiBmb2xsb3cuCgpcYmVnaW57Y2VudGVyfQp7XExhcmdlIFxzYyBUZXJt
-cyBhbmQgQ29uZGl0aW9ucyBGb3IgQ29weWluZywgRGlzdHJpYnV0aW9uIGFuZAogIE1vZGlmaWNh
-dGlvbn0KXGVuZHtjZW50ZXJ9CgoKJVxyZW5ld2NvbW1hbmR7XHRoZWVudW1pfXtcYWxwaGF7ZW51
-bWl9fQpcYmVnaW57ZW51bWVyYXRlfQoKXGFkZHRvY291bnRlcntlbnVtaX17LTF9CgpcaXRlbSAK
-ClRoaXMgTGljZW5zZSBhcHBsaWVzIHRvIGFueSBwcm9ncmFtIG9yIG90aGVyIHdvcmsgd2hpY2gg
-Y29udGFpbnMgYSBub3RpY2UKcGxhY2VkIGJ5IHRoZSBjb3B5cmlnaHQgaG9sZGVyIHNheWluZyBp
-dCBtYXkgYmUgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlCnRlcm1zIG9mIHRoaXMgR2VuZXJhbCBQdWJs
-aWMgTGljZW5zZS4gIFRoZSBgYFByb2dyYW0nJywgYmVsb3csIHJlZmVycyB0bwphbnkgc3VjaCBw
-cm9ncmFtIG9yIHdvcmssIGFuZCBhIGBgd29yayBiYXNlZCBvbiB0aGUgUHJvZ3JhbScnIG1lYW5z
-IGVpdGhlcgp0aGUgUHJvZ3JhbSBvciBhbnkgZGVyaXZhdGl2ZSB3b3JrIHVuZGVyIGNvcHlyaWdo
-dCBsYXc6IHRoYXQgaXMgdG8gc2F5LCBhCndvcmsgY29udGFpbmluZyB0aGUgUHJvZ3JhbSBvciBh
-IHBvcnRpb24gb2YgaXQsIGVpdGhlciB2ZXJiYXRpbSBvciB3aXRoCm1vZGlmaWNhdGlvbnMgYW5k
-L29yIHRyYW5zbGF0ZWQgaW50byBhbm90aGVyIGxhbmd1YWdlLiAgKEhlcmVpbmFmdGVyLAp0cmFu
-c2xhdGlvbiBpcyBpbmNsdWRlZCB3aXRob3V0IGxpbWl0YXRpb24gaW4gdGhlIHRlcm0gYGBtb2Rp
-ZmljYXRpb24nJy4pCkVhY2ggbGljZW5zZWUgaXMgYWRkcmVzc2VkIGFzIGBgeW91JycuCgpBY3Rp
-dml0aWVzIG90aGVyIHRoYW4gY29weWluZywgZGlzdHJpYnV0aW9uIGFuZCBtb2RpZmljYXRpb24g
-YXJlIG5vdApjb3ZlcmVkIGJ5IHRoaXMgTGljZW5zZTsgdGhleSBhcmUgb3V0c2lkZSBpdHMgc2Nv
-cGUuICBUaGUgYWN0IG9mCnJ1bm5pbmcgdGhlIFByb2dyYW0gaXMgbm90IHJlc3RyaWN0ZWQsIGFu
-ZCB0aGUgb3V0cHV0IGZyb20gdGhlIFByb2dyYW0KaXMgY292ZXJlZCBvbmx5IGlmIGl0cyBjb250
-ZW50cyBjb25zdGl0dXRlIGEgd29yayBiYXNlZCBvbiB0aGUKUHJvZ3JhbSAoaW5kZXBlbmRlbnQg
-b2YgaGF2aW5nIGJlZW4gbWFkZSBieSBydW5uaW5nIHRoZSBQcm9ncmFtKS4KV2hldGhlciB0aGF0
-IGlzIHRydWUgZGVwZW5kcyBvbiB3aGF0IHRoZSBQcm9ncmFtIGRvZXMuCgpcaXRlbSBZb3UgbWF5
-IGNvcHkgYW5kIGRpc3RyaWJ1dGUgdmVyYmF0aW0gY29waWVzIG9mIHRoZSBQcm9ncmFtJ3Mgc291
-cmNlCiAgY29kZSBhcyB5b3UgcmVjZWl2ZSBpdCwgaW4gYW55IG1lZGl1bSwgcHJvdmlkZWQgdGhh
-dCB5b3UgY29uc3BpY3VvdXNseQogIGFuZCBhcHByb3ByaWF0ZWx5IHB1Ymxpc2ggb24gZWFjaCBj
-b3B5IGFuIGFwcHJvcHJpYXRlIGNvcHlyaWdodCBub3RpY2UKICBhbmQgZGlzY2xhaW1lciBvZiB3
-YXJyYW50eTsga2VlcCBpbnRhY3QgYWxsIHRoZSBub3RpY2VzIHRoYXQgcmVmZXIgdG8KICB0aGlz
-IExpY2Vuc2UgYW5kIHRvIHRoZSBhYnNlbmNlIG9mIGFueSB3YXJyYW50eTsgYW5kIGdpdmUgYW55
-IG90aGVyCiAgcmVjaXBpZW50cyBvZiB0aGUgUHJvZ3JhbSBhIGNvcHkgb2YgdGhpcyBMaWNlbnNl
-IGFsb25nIHdpdGggdGhlIFByb2dyYW0uCgpZb3UgbWF5IGNoYXJnZSBhIGZlZSBmb3IgdGhlIHBo
-eXNpY2FsIGFjdCBvZiB0cmFuc2ZlcnJpbmcgYSBjb3B5LCBhbmQgeW91Cm1heSBhdCB5b3VyIG9w
-dGlvbiBvZmZlciB3YXJyYW50eSBwcm90ZWN0aW9uIGluIGV4Y2hhbmdlIGZvciBhIGZlZS4KClxp
-dGVtCgpZb3UgbWF5IG1vZGlmeSB5b3VyIGNvcHkgb3IgY29waWVzIG9mIHRoZSBQcm9ncmFtIG9y
-IGFueSBwb3J0aW9uCm9mIGl0LCB0aHVzIGZvcm1pbmcgYSB3b3JrIGJhc2VkIG9uIHRoZSBQcm9n
-cmFtLCBhbmQgY29weSBhbmQKZGlzdHJpYnV0ZSBzdWNoIG1vZGlmaWNhdGlvbnMgb3Igd29yayB1
-bmRlciB0aGUgdGVybXMgb2YgU2VjdGlvbiAxCmFib3ZlLCBwcm92aWRlZCB0aGF0IHlvdSBhbHNv
-IG1lZXQgYWxsIG9mIHRoZXNlIGNvbmRpdGlvbnM6CgpcYmVnaW57ZW51bWVyYXRlfQoKXGl0ZW0g
-CgpZb3UgbXVzdCBjYXVzZSB0aGUgbW9kaWZpZWQgZmlsZXMgdG8gY2FycnkgcHJvbWluZW50IG5v
-dGljZXMgc3RhdGluZyB0aGF0CnlvdSBjaGFuZ2VkIHRoZSBmaWxlcyBhbmQgdGhlIGRhdGUgb2Yg
-YW55IGNoYW5nZS4KClxpdGVtCgpZb3UgbXVzdCBjYXVzZSBhbnkgd29yayB0aGF0IHlvdSBkaXN0
-cmlidXRlIG9yIHB1Ymxpc2gsIHRoYXQgaW4Kd2hvbGUgb3IgaW4gcGFydCBjb250YWlucyBvciBp
-cyBkZXJpdmVkIGZyb20gdGhlIFByb2dyYW0gb3IgYW55CnBhcnQgdGhlcmVvZiwgdG8gYmUgbGlj
-ZW5zZWQgYXMgYSB3aG9sZSBhdCBubyBjaGFyZ2UgdG8gYWxsIHRoaXJkCnBhcnRpZXMgdW5kZXIg
-dGhlIHRlcm1zIG9mIHRoaXMgTGljZW5zZS4KClxpdGVtCklmIHRoZSBtb2RpZmllZCBwcm9ncmFt
-IG5vcm1hbGx5IHJlYWRzIGNvbW1hbmRzIGludGVyYWN0aXZlbHkKd2hlbiBydW4sIHlvdSBtdXN0
-IGNhdXNlIGl0LCB3aGVuIHN0YXJ0ZWQgcnVubmluZyBmb3Igc3VjaAppbnRlcmFjdGl2ZSB1c2Ug
-aW4gdGhlIG1vc3Qgb3JkaW5hcnkgd2F5LCB0byBwcmludCBvciBkaXNwbGF5IGFuCmFubm91bmNl
-bWVudCBpbmNsdWRpbmcgYW4gYXBwcm9wcmlhdGUgY29weXJpZ2h0IG5vdGljZSBhbmQgYQpub3Rp
-Y2UgdGhhdCB0aGVyZSBpcyBubyB3YXJyYW50eSAob3IgZWxzZSwgc2F5aW5nIHRoYXQgeW91IHBy
-b3ZpZGUKYSB3YXJyYW50eSkgYW5kIHRoYXQgdXNlcnMgbWF5IHJlZGlzdHJpYnV0ZSB0aGUgcHJv
-Z3JhbSB1bmRlcgp0aGVzZSBjb25kaXRpb25zLCBhbmQgdGVsbGluZyB0aGUgdXNlciBob3cgdG8g
-dmlldyBhIGNvcHkgb2YgdGhpcwpMaWNlbnNlLiAgKEV4Y2VwdGlvbjogaWYgdGhlIFByb2dyYW0g
-aXRzZWxmIGlzIGludGVyYWN0aXZlIGJ1dApkb2VzIG5vdCBub3JtYWxseSBwcmludCBzdWNoIGFu
-IGFubm91bmNlbWVudCwgeW91ciB3b3JrIGJhc2VkIG9uCnRoZSBQcm9ncmFtIGlzIG5vdCByZXF1
-aXJlZCB0byBwcmludCBhbiBhbm5vdW5jZW1lbnQuKQoKXGVuZHtlbnVtZXJhdGV9CgoKVGhlc2Ug
-cmVxdWlyZW1lbnRzIGFwcGx5IHRvIHRoZSBtb2RpZmllZCB3b3JrIGFzIGEgd2hvbGUuICBJZgpp
-ZGVudGlmaWFibGUgc2VjdGlvbnMgb2YgdGhhdCB3b3JrIGFyZSBub3QgZGVyaXZlZCBmcm9tIHRo
-ZSBQcm9ncmFtLAphbmQgY2FuIGJlIHJlYXNvbmFibHkgY29uc2lkZXJlZCBpbmRlcGVuZGVudCBh
-bmQgc2VwYXJhdGUgd29ya3MgaW4KdGhlbXNlbHZlcywgdGhlbiB0aGlzIExpY2Vuc2UsIGFuZCBp
-dHMgdGVybXMsIGRvIG5vdCBhcHBseSB0byB0aG9zZQpzZWN0aW9ucyB3aGVuIHlvdSBkaXN0cmli
-dXRlIHRoZW0gYXMgc2VwYXJhdGUgd29ya3MuICBCdXQgd2hlbiB5b3UKZGlzdHJpYnV0ZSB0aGUg
-c2FtZSBzZWN0aW9ucyBhcyBwYXJ0IG9mIGEgd2hvbGUgd2hpY2ggaXMgYSB3b3JrIGJhc2VkCm9u
-IHRoZSBQcm9ncmFtLCB0aGUgZGlzdHJpYnV0aW9uIG9mIHRoZSB3aG9sZSBtdXN0IGJlIG9uIHRo
-ZSB0ZXJtcyBvZgp0aGlzIExpY2Vuc2UsIHdob3NlIHBlcm1pc3Npb25zIGZvciBvdGhlciBsaWNl
-bnNlZXMgZXh0ZW5kIHRvIHRoZQplbnRpcmUgd2hvbGUsIGFuZCB0aHVzIHRvIGVhY2ggYW5kIGV2
-ZXJ5IHBhcnQgcmVnYXJkbGVzcyBvZiB3aG8gd3JvdGUgaXQuCgpUaHVzLCBpdCBpcyBub3QgdGhl
-IGludGVudCBvZiB0aGlzIHNlY3Rpb24gdG8gY2xhaW0gcmlnaHRzIG9yIGNvbnRlc3QKeW91ciBy
-aWdodHMgdG8gd29yayB3cml0dGVuIGVudGlyZWx5IGJ5IHlvdTsgcmF0aGVyLCB0aGUgaW50ZW50
-IGlzIHRvCmV4ZXJjaXNlIHRoZSByaWdodCB0byBjb250cm9sIHRoZSBkaXN0cmlidXRpb24gb2Yg
-ZGVyaXZhdGl2ZSBvcgpjb2xsZWN0aXZlIHdvcmtzIGJhc2VkIG9uIHRoZSBQcm9ncmFtLgoKSW4g
-YWRkaXRpb24sIG1lcmUgYWdncmVnYXRpb24gb2YgYW5vdGhlciB3b3JrIG5vdCBiYXNlZCBvbiB0
-aGUgUHJvZ3JhbQp3aXRoIHRoZSBQcm9ncmFtIChvciB3aXRoIGEgd29yayBiYXNlZCBvbiB0aGUg
-UHJvZ3JhbSkgb24gYSB2b2x1bWUgb2YKYSBzdG9yYWdlIG9yIGRpc3RyaWJ1dGlvbiBtZWRpdW0g
-ZG9lcyBub3QgYnJpbmcgdGhlIG90aGVyIHdvcmsgdW5kZXIKdGhlIHNjb3BlIG9mIHRoaXMgTGlj
-ZW5zZS4KClxpdGVtCllvdSBtYXkgY29weSBhbmQgZGlzdHJpYnV0ZSB0aGUgUHJvZ3JhbSAob3Ig
-YSB3b3JrIGJhc2VkIG9uIGl0LAp1bmRlciBTZWN0aW9uIDIpIGluIG9iamVjdCBjb2RlIG9yIGV4
-ZWN1dGFibGUgZm9ybSB1bmRlciB0aGUgdGVybXMgb2YKU2VjdGlvbnMgMSBhbmQgMiBhYm92ZSBw
-cm92aWRlZCB0aGF0IHlvdSBhbHNvIGRvIG9uZSBvZiB0aGUgZm9sbG93aW5nOgoKXGJlZ2lue2Vu
-dW1lcmF0ZX0KClxpdGVtCgpBY2NvbXBhbnkgaXQgd2l0aCB0aGUgY29tcGxldGUgY29ycmVzcG9u
-ZGluZyBtYWNoaW5lLXJlYWRhYmxlCnNvdXJjZSBjb2RlLCB3aGljaCBtdXN0IGJlIGRpc3RyaWJ1
-dGVkIHVuZGVyIHRoZSB0ZXJtcyBvZiBTZWN0aW9ucwoxIGFuZCAyIGFib3ZlIG9uIGEgbWVkaXVt
-IGN1c3RvbWFyaWx5IHVzZWQgZm9yIHNvZnR3YXJlIGludGVyY2hhbmdlOyBvciwKClxpdGVtCgpB
-Y2NvbXBhbnkgaXQgd2l0aCBhIHdyaXR0ZW4gb2ZmZXIsIHZhbGlkIGZvciBhdCBsZWFzdCB0aHJl
-ZQp5ZWFycywgdG8gZ2l2ZSBhbnkgdGhpcmQgcGFydHksIGZvciBhIGNoYXJnZSBubyBtb3JlIHRo
-YW4geW91cgpjb3N0IG9mIHBoeXNpY2FsbHkgcGVyZm9ybWluZyBzb3VyY2UgZGlzdHJpYnV0aW9u
-LCBhIGNvbXBsZXRlCm1hY2hpbmUtcmVhZGFibGUgY29weSBvZiB0aGUgY29ycmVzcG9uZGluZyBz
-b3VyY2UgY29kZSwgdG8gYmUKZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mIFNlY3Rpb25z
-IDEgYW5kIDIgYWJvdmUgb24gYSBtZWRpdW0KY3VzdG9tYXJpbHkgdXNlZCBmb3Igc29mdHdhcmUg
-aW50ZXJjaGFuZ2U7IG9yLAoKXGl0ZW0KCkFjY29tcGFueSBpdCB3aXRoIHRoZSBpbmZvcm1hdGlv
-biB5b3UgcmVjZWl2ZWQgYXMgdG8gdGhlIG9mZmVyCnRvIGRpc3RyaWJ1dGUgY29ycmVzcG9uZGlu
-ZyBzb3VyY2UgY29kZS4gIChUaGlzIGFsdGVybmF0aXZlIGlzCmFsbG93ZWQgb25seSBmb3Igbm9u
-Y29tbWVyY2lhbCBkaXN0cmlidXRpb24gYW5kIG9ubHkgaWYgeW91CnJlY2VpdmVkIHRoZSBwcm9n
-cmFtIGluIG9iamVjdCBjb2RlIG9yIGV4ZWN1dGFibGUgZm9ybSB3aXRoIHN1Y2gKYW4gb2ZmZXIs
-IGluIGFjY29yZCB3aXRoIFN1YnNlY3Rpb24gYiBhYm92ZS4pCgpcZW5ke2VudW1lcmF0ZX0KCgpU
-aGUgc291cmNlIGNvZGUgZm9yIGEgd29yayBtZWFucyB0aGUgcHJlZmVycmVkIGZvcm0gb2YgdGhl
-IHdvcmsgZm9yCm1ha2luZyBtb2RpZmljYXRpb25zIHRvIGl0LiAgRm9yIGFuIGV4ZWN1dGFibGUg
-d29yaywgY29tcGxldGUgc291cmNlCmNvZGUgbWVhbnMgYWxsIHRoZSBzb3VyY2UgY29kZSBmb3Ig
-YWxsIG1vZHVsZXMgaXQgY29udGFpbnMsIHBsdXMgYW55CmFzc29jaWF0ZWQgaW50ZXJmYWNlIGRl
-ZmluaXRpb24gZmlsZXMsIHBsdXMgdGhlIHNjcmlwdHMgdXNlZCB0bwpjb250cm9sIGNvbXBpbGF0
-aW9uIGFuZCBpbnN0YWxsYXRpb24gb2YgdGhlIGV4ZWN1dGFibGUuICBIb3dldmVyLCBhcyBhCnNw
-ZWNpYWwgZXhjZXB0aW9uLCB0aGUgc291cmNlIGNvZGUgZGlzdHJpYnV0ZWQgbmVlZCBub3QgaW5j
-bHVkZQphbnl0aGluZyB0aGF0IGlzIG5vcm1hbGx5IGRpc3RyaWJ1dGVkIChpbiBlaXRoZXIgc291
-cmNlIG9yIGJpbmFyeQpmb3JtKSB3aXRoIHRoZSBtYWpvciBjb21wb25lbnRzIChjb21waWxlciwg
-a2VybmVsLCBhbmQgc28gb24pIG9mIHRoZQpvcGVyYXRpbmcgc3lzdGVtIG9uIHdoaWNoIHRoZSBl
-eGVjdXRhYmxlIHJ1bnMsIHVubGVzcyB0aGF0IGNvbXBvbmVudAppdHNlbGYgYWNjb21wYW5pZXMg
-dGhlIGV4ZWN1dGFibGUuCgpJZiBkaXN0cmlidXRpb24gb2YgZXhlY3V0YWJsZSBvciBvYmplY3Qg
-Y29kZSBpcyBtYWRlIGJ5IG9mZmVyaW5nCmFjY2VzcyB0byBjb3B5IGZyb20gYSBkZXNpZ25hdGVk
-IHBsYWNlLCB0aGVuIG9mZmVyaW5nIGVxdWl2YWxlbnQKYWNjZXNzIHRvIGNvcHkgdGhlIHNvdXJj
-ZSBjb2RlIGZyb20gdGhlIHNhbWUgcGxhY2UgY291bnRzIGFzCmRpc3RyaWJ1dGlvbiBvZiB0aGUg
-c291cmNlIGNvZGUsIGV2ZW4gdGhvdWdoIHRoaXJkIHBhcnRpZXMgYXJlIG5vdApjb21wZWxsZWQg
-dG8gY29weSB0aGUgc291cmNlIGFsb25nIHdpdGggdGhlIG9iamVjdCBjb2RlLgoKXGl0ZW0KWW91
-IG1heSBub3QgY29weSwgbW9kaWZ5LCBzdWJsaWNlbnNlLCBvciBkaXN0cmlidXRlIHRoZSBQcm9n
-cmFtCmV4Y2VwdCBhcyBleHByZXNzbHkgcHJvdmlkZWQgdW5kZXIgdGhpcyBMaWNlbnNlLiAgQW55
-IGF0dGVtcHQKb3RoZXJ3aXNlIHRvIGNvcHksIG1vZGlmeSwgc3VibGljZW5zZSBvciBkaXN0cmli
-dXRlIHRoZSBQcm9ncmFtIGlzCnZvaWQsIGFuZCB3aWxsIGF1dG9tYXRpY2FsbHkgdGVybWluYXRl
-IHlvdXIgcmlnaHRzIHVuZGVyIHRoaXMgTGljZW5zZS4KSG93ZXZlciwgcGFydGllcyB3aG8gaGF2
-ZSByZWNlaXZlZCBjb3BpZXMsIG9yIHJpZ2h0cywgZnJvbSB5b3UgdW5kZXIKdGhpcyBMaWNlbnNl
-IHdpbGwgbm90IGhhdmUgdGhlaXIgbGljZW5zZXMgdGVybWluYXRlZCBzbyBsb25nIGFzIHN1Y2gK
-cGFydGllcyByZW1haW4gaW4gZnVsbCBjb21wbGlhbmNlLgoKXGl0ZW0KWW91IGFyZSBub3QgcmVx
-dWlyZWQgdG8gYWNjZXB0IHRoaXMgTGljZW5zZSwgc2luY2UgeW91IGhhdmUgbm90CnNpZ25lZCBp
-dC4gIEhvd2V2ZXIsIG5vdGhpbmcgZWxzZSBncmFudHMgeW91IHBlcm1pc3Npb24gdG8gbW9kaWZ5
-IG9yCmRpc3RyaWJ1dGUgdGhlIFByb2dyYW0gb3IgaXRzIGRlcml2YXRpdmUgd29ya3MuICBUaGVz
-ZSBhY3Rpb25zIGFyZQpwcm9oaWJpdGVkIGJ5IGxhdyBpZiB5b3UgZG8gbm90IGFjY2VwdCB0aGlz
-IExpY2Vuc2UuICBUaGVyZWZvcmUsIGJ5Cm1vZGlmeWluZyBvciBkaXN0cmlidXRpbmcgdGhlIFBy
-b2dyYW0gKG9yIGFueSB3b3JrIGJhc2VkIG9uIHRoZQpQcm9ncmFtKSwgeW91IGluZGljYXRlIHlv
-dXIgYWNjZXB0YW5jZSBvZiB0aGlzIExpY2Vuc2UgdG8gZG8gc28sIGFuZAphbGwgaXRzIHRlcm1z
-IGFuZCBjb25kaXRpb25zIGZvciBjb3B5aW5nLCBkaXN0cmlidXRpbmcgb3IgbW9kaWZ5aW5nCnRo
-ZSBQcm9ncmFtIG9yIHdvcmtzIGJhc2VkIG9uIGl0LgoKXGl0ZW0KRWFjaCB0aW1lIHlvdSByZWRp
-c3RyaWJ1dGUgdGhlIFByb2dyYW0gKG9yIGFueSB3b3JrIGJhc2VkIG9uIHRoZQpQcm9ncmFtKSwg
-dGhlIHJlY2lwaWVudCBhdXRvbWF0aWNhbGx5IHJlY2VpdmVzIGEgbGljZW5zZSBmcm9tIHRoZQpv
-cmlnaW5hbCBsaWNlbnNvciB0byBjb3B5LCBkaXN0cmlidXRlIG9yIG1vZGlmeSB0aGUgUHJvZ3Jh
-bSBzdWJqZWN0IHRvCnRoZXNlIHRlcm1zIGFuZCBjb25kaXRpb25zLiAgWW91IG1heSBub3QgaW1w
-b3NlIGFueSBmdXJ0aGVyCnJlc3RyaWN0aW9ucyBvbiB0aGUgcmVjaXBpZW50cycgZXhlcmNpc2Ug
-b2YgdGhlIHJpZ2h0cyBncmFudGVkIGhlcmVpbi4KWW91IGFyZSBub3QgcmVzcG9uc2libGUgZm9y
-IGVuZm9yY2luZyBjb21wbGlhbmNlIGJ5IHRoaXJkIHBhcnRpZXMgdG8KdGhpcyBMaWNlbnNlLgoK
-XGl0ZW0KSWYsIGFzIGEgY29uc2VxdWVuY2Ugb2YgYSBjb3VydCBqdWRnbWVudCBvciBhbGxlZ2F0
-aW9uIG9mIHBhdGVudAppbmZyaW5nZW1lbnQgb3IgZm9yIGFueSBvdGhlciByZWFzb24gKG5vdCBs
-aW1pdGVkIHRvIHBhdGVudCBpc3N1ZXMpLApjb25kaXRpb25zIGFyZSBpbXBvc2VkIG9uIHlvdSAo
-d2hldGhlciBieSBjb3VydCBvcmRlciwgYWdyZWVtZW50IG9yCm90aGVyd2lzZSkgdGhhdCBjb250
-cmFkaWN0IHRoZSBjb25kaXRpb25zIG9mIHRoaXMgTGljZW5zZSwgdGhleSBkbyBub3QKZXhjdXNl
-IHlvdSBmcm9tIHRoZSBjb25kaXRpb25zIG9mIHRoaXMgTGljZW5zZS4gIElmIHlvdSBjYW5ub3QK
-ZGlzdHJpYnV0ZSBzbyBhcyB0byBzYXRpc2Z5IHNpbXVsdGFuZW91c2x5IHlvdXIgb2JsaWdhdGlv
-bnMgdW5kZXIgdGhpcwpMaWNlbnNlIGFuZCBhbnkgb3RoZXIgcGVydGluZW50IG9ibGlnYXRpb25z
-LCB0aGVuIGFzIGEgY29uc2VxdWVuY2UgeW91Cm1heSBub3QgZGlzdHJpYnV0ZSB0aGUgUHJvZ3Jh
-bSBhdCBhbGwuICBGb3IgZXhhbXBsZSwgaWYgYSBwYXRlbnQKbGljZW5zZSB3b3VsZCBub3QgcGVy
-bWl0IHJveWFsdHktZnJlZSByZWRpc3RyaWJ1dGlvbiBvZiB0aGUgUHJvZ3JhbSBieQphbGwgdGhv
-c2Ugd2hvIHJlY2VpdmUgY29waWVzIGRpcmVjdGx5IG9yIGluZGlyZWN0bHkgdGhyb3VnaCB5b3Us
-IHRoZW4KdGhlIG9ubHkgd2F5IHlvdSBjb3VsZCBzYXRpc2Z5IGJvdGggaXQgYW5kIHRoaXMgTGlj
-ZW5zZSB3b3VsZCBiZSB0bwpyZWZyYWluIGVudGlyZWx5IGZyb20gZGlzdHJpYnV0aW9uIG9mIHRo
-ZSBQcm9ncmFtLgoKSWYgYW55IHBvcnRpb24gb2YgdGhpcyBzZWN0aW9uIGlzIGhlbGQgaW52YWxp
-ZCBvciB1bmVuZm9yY2VhYmxlIHVuZGVyCmFueSBwYXJ0aWN1bGFyIGNpcmN1bXN0YW5jZSwgdGhl
-IGJhbGFuY2Ugb2YgdGhlIHNlY3Rpb24gaXMgaW50ZW5kZWQgdG8KYXBwbHkgYW5kIHRoZSBzZWN0
-aW9uIGFzIGEgd2hvbGUgaXMgaW50ZW5kZWQgdG8gYXBwbHkgaW4gb3RoZXIKY2lyY3Vtc3RhbmNl
-cy4KCkl0IGlzIG5vdCB0aGUgcHVycG9zZSBvZiB0aGlzIHNlY3Rpb24gdG8gaW5kdWNlIHlvdSB0
-byBpbmZyaW5nZSBhbnkKcGF0ZW50cyBvciBvdGhlciBwcm9wZXJ0eSByaWdodCBjbGFpbXMgb3Ig
-dG8gY29udGVzdCB2YWxpZGl0eSBvZiBhbnkKc3VjaCBjbGFpbXM7IHRoaXMgc2VjdGlvbiBoYXMg
-dGhlIHNvbGUgcHVycG9zZSBvZiBwcm90ZWN0aW5nIHRoZQppbnRlZ3JpdHkgb2YgdGhlIGZyZWUg
-c29mdHdhcmUgZGlzdHJpYnV0aW9uIHN5c3RlbSwgd2hpY2ggaXMKaW1wbGVtZW50ZWQgYnkgcHVi
-bGljIGxpY2Vuc2UgcHJhY3RpY2VzLiAgTWFueSBwZW9wbGUgaGF2ZSBtYWRlCmdlbmVyb3VzIGNv
-bnRyaWJ1dGlvbnMgdG8gdGhlIHdpZGUgcmFuZ2Ugb2Ygc29mdHdhcmUgZGlzdHJpYnV0ZWQKdGhy
-b3VnaCB0aGF0IHN5c3RlbSBpbiByZWxpYW5jZSBvbiBjb25zaXN0ZW50IGFwcGxpY2F0aW9uIG9m
-IHRoYXQKc3lzdGVtOyBpdCBpcyB1cCB0byB0aGUgYXV0aG9yL2Rvbm9yIHRvIGRlY2lkZSBpZiBo
-ZSBvciBzaGUgaXMgd2lsbGluZwp0byBkaXN0cmlidXRlIHNvZnR3YXJlIHRocm91Z2ggYW55IG90
-aGVyIHN5c3RlbSBhbmQgYSBsaWNlbnNlZSBjYW5ub3QKaW1wb3NlIHRoYXQgY2hvaWNlLgoKVGhp
-cyBzZWN0aW9uIGlzIGludGVuZGVkIHRvIG1ha2UgdGhvcm91Z2hseSBjbGVhciB3aGF0IGlzIGJl
-bGlldmVkIHRvCmJlIGEgY29uc2VxdWVuY2Ugb2YgdGhlIHJlc3Qgb2YgdGhpcyBMaWNlbnNlLgoK
-XGl0ZW0KSWYgdGhlIGRpc3RyaWJ1dGlvbiBhbmQvb3IgdXNlIG9mIHRoZSBQcm9ncmFtIGlzIHJl
-c3RyaWN0ZWQgaW4KY2VydGFpbiBjb3VudHJpZXMgZWl0aGVyIGJ5IHBhdGVudHMgb3IgYnkgY29w
-eXJpZ2h0ZWQgaW50ZXJmYWNlcywgdGhlCm9yaWdpbmFsIGNvcHlyaWdodCBob2xkZXIgd2hvIHBs
-YWNlcyB0aGUgUHJvZ3JhbSB1bmRlciB0aGlzIExpY2Vuc2UKbWF5IGFkZCBhbiBleHBsaWNpdCBn
-ZW9ncmFwaGljYWwgZGlzdHJpYnV0aW9uIGxpbWl0YXRpb24gZXhjbHVkaW5nCnRob3NlIGNvdW50
-cmllcywgc28gdGhhdCBkaXN0cmlidXRpb24gaXMgcGVybWl0dGVkIG9ubHkgaW4gb3IgYW1vbmcK
-Y291bnRyaWVzIG5vdCB0aHVzIGV4Y2x1ZGVkLiAgSW4gc3VjaCBjYXNlLCB0aGlzIExpY2Vuc2Ug
-aW5jb3Jwb3JhdGVzCnRoZSBsaW1pdGF0aW9uIGFzIGlmIHdyaXR0ZW4gaW4gdGhlIGJvZHkgb2Yg
-dGhpcyBMaWNlbnNlLgoKXGl0ZW0KVGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbiBtYXkgcHVi
-bGlzaCByZXZpc2VkIGFuZC9vciBuZXcgdmVyc2lvbnMKb2YgdGhlIEdlbmVyYWwgUHVibGljIExp
-Y2Vuc2UgZnJvbSB0aW1lIHRvIHRpbWUuICBTdWNoIG5ldyB2ZXJzaW9ucyB3aWxsCmJlIHNpbWls
-YXIgaW4gc3Bpcml0IHRvIHRoZSBwcmVzZW50IHZlcnNpb24sIGJ1dCBtYXkgZGlmZmVyIGluIGRl
-dGFpbCB0bwphZGRyZXNzIG5ldyBwcm9ibGVtcyBvciBjb25jZXJucy4KCkVhY2ggdmVyc2lvbiBp
-cyBnaXZlbiBhIGRpc3Rpbmd1aXNoaW5nIHZlcnNpb24gbnVtYmVyLiAgSWYgdGhlIFByb2dyYW0K
-c3BlY2lmaWVzIGEgdmVyc2lvbiBudW1iZXIgb2YgdGhpcyBMaWNlbnNlIHdoaWNoIGFwcGxpZXMg
-dG8gaXQgYW5kIGBgYW55CmxhdGVyIHZlcnNpb24nJywgeW91IGhhdmUgdGhlIG9wdGlvbiBvZiBm
-b2xsb3dpbmcgdGhlIHRlcm1zIGFuZCBjb25kaXRpb25zCmVpdGhlciBvZiB0aGF0IHZlcnNpb24g
-b3Igb2YgYW55IGxhdGVyIHZlcnNpb24gcHVibGlzaGVkIGJ5IHRoZSBGcmVlClNvZnR3YXJlIEZv
-dW5kYXRpb24uICBJZiB0aGUgUHJvZ3JhbSBkb2VzIG5vdCBzcGVjaWZ5IGEgdmVyc2lvbiBudW1i
-ZXIgb2YKdGhpcyBMaWNlbnNlLCB5b3UgbWF5IGNob29zZSBhbnkgdmVyc2lvbiBldmVyIHB1Ymxp
-c2hlZCBieSB0aGUgRnJlZSBTb2Z0d2FyZQpGb3VuZGF0aW9uLgoKXGl0ZW0KSWYgeW91IHdpc2gg
-dG8gaW5jb3Jwb3JhdGUgcGFydHMgb2YgdGhlIFByb2dyYW0gaW50byBvdGhlciBmcmVlCnByb2dy
-YW1zIHdob3NlIGRpc3RyaWJ1dGlvbiBjb25kaXRpb25zIGFyZSBkaWZmZXJlbnQsIHdyaXRlIHRv
-IHRoZSBhdXRob3IKdG8gYXNrIGZvciBwZXJtaXNzaW9uLiAgRm9yIHNvZnR3YXJlIHdoaWNoIGlz
-IGNvcHlyaWdodGVkIGJ5IHRoZSBGcmVlClNvZnR3YXJlIEZvdW5kYXRpb24sIHdyaXRlIHRvIHRo
-ZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IHdlIHNvbWV0aW1lcwptYWtlIGV4Y2VwdGlvbnMg
-Zm9yIHRoaXMuICBPdXIgZGVjaXNpb24gd2lsbCBiZSBndWlkZWQgYnkgdGhlIHR3byBnb2Fscwpv
-ZiBwcmVzZXJ2aW5nIHRoZSBmcmVlIHN0YXR1cyBvZiBhbGwgZGVyaXZhdGl2ZXMgb2Ygb3VyIGZy
-ZWUgc29mdHdhcmUgYW5kCm9mIHByb21vdGluZyB0aGUgc2hhcmluZyBhbmQgcmV1c2Ugb2Ygc29m
-dHdhcmUgZ2VuZXJhbGx5LgoKXGJlZ2lue2NlbnRlcn0Ke1xMYXJnZVxzYwpObyBXYXJyYW50eQp9
-ClxlbmR7Y2VudGVyfQoKXGl0ZW0Ke1xzYyBCZWNhdXNlIHRoZSBwcm9ncmFtIGlzIGxpY2Vuc2Vk
-IGZyZWUgb2YgY2hhcmdlLCB0aGVyZSBpcyBubyB3YXJyYW50eQpmb3IgdGhlIHByb2dyYW0sIHRv
-IHRoZSBleHRlbnQgcGVybWl0dGVkIGJ5IGFwcGxpY2FibGUgbGF3LiAgRXhjZXB0IHdoZW4Kb3Ro
-ZXJ3aXNlIHN0YXRlZCBpbiB3cml0aW5nIHRoZSBjb3B5cmlnaHQgaG9sZGVycyBhbmQvb3Igb3Ro
-ZXIgcGFydGllcwpwcm92aWRlIHRoZSBwcm9ncmFtIGBgYXMgaXMnJyB3aXRob3V0IHdhcnJhbnR5
-IG9mIGFueSBraW5kLCBlaXRoZXIgZXhwcmVzc2VkCm9yIGltcGxpZWQsIGluY2x1ZGluZywgYnV0
-IG5vdCBsaW1pdGVkIHRvLCB0aGUgaW1wbGllZCB3YXJyYW50aWVzIG9mCm1lcmNoYW50YWJpbGl0
-eSBhbmQgZml0bmVzcyBmb3IgYSBwYXJ0aWN1bGFyIHB1cnBvc2UuICBUaGUgZW50aXJlIHJpc2sg
-YXMKdG8gdGhlIHF1YWxpdHkgYW5kIHBlcmZvcm1hbmNlIG9mIHRoZSBwcm9ncmFtIGlzIHdpdGgg
-eW91LiAgU2hvdWxkIHRoZQpwcm9ncmFtIHByb3ZlIGRlZmVjdGl2ZSwgeW91IGFzc3VtZSB0aGUg
-Y29zdCBvZiBhbGwgbmVjZXNzYXJ5IHNlcnZpY2luZywKcmVwYWlyIG9yIGNvcnJlY3Rpb24ufQoK
-XGl0ZW0Ke1xzYyBJbiBubyBldmVudCB1bmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcg
-b3IgYWdyZWVkIHRvIGluIHdyaXRpbmcKd2lsbCBhbnkgY29weXJpZ2h0IGhvbGRlciwgb3IgYW55
-IG90aGVyIHBhcnR5IHdobyBtYXkgbW9kaWZ5IGFuZC9vcgpyZWRpc3RyaWJ1dGUgdGhlIHByb2dy
-YW0gYXMgcGVybWl0dGVkIGFib3ZlLCBiZSBsaWFibGUgdG8geW91IGZvciBkYW1hZ2VzLAppbmNs
-dWRpbmcgYW55IGdlbmVyYWwsIHNwZWNpYWwsIGluY2lkZW50YWwgb3IgY29uc2VxdWVudGlhbCBk
-YW1hZ2VzIGFyaXNpbmcKb3V0IG9mIHRoZSB1c2Ugb3IgaW5hYmlsaXR5IHRvIHVzZSB0aGUgcHJv
-Z3JhbSAoaW5jbHVkaW5nIGJ1dCBub3QgbGltaXRlZAp0byBsb3NzIG9mIGRhdGEgb3IgZGF0YSBi
-ZWluZyByZW5kZXJlZCBpbmFjY3VyYXRlIG9yIGxvc3NlcyBzdXN0YWluZWQgYnkKeW91IG9yIHRo
-aXJkIHBhcnRpZXMgb3IgYSBmYWlsdXJlIG9mIHRoZSBwcm9ncmFtIHRvIG9wZXJhdGUgd2l0aCBh
-bnkgb3RoZXIKcHJvZ3JhbXMpLCBldmVuIGlmIHN1Y2ggaG9sZGVyIG9yIG90aGVyIHBhcnR5IGhh
-cyBiZWVuIGFkdmlzZWQgb2YgdGhlCnBvc3NpYmlsaXR5IG9mIHN1Y2ggZGFtYWdlcy59CgpcZW5k
-e2VudW1lcmF0ZX0KCgpcYmVnaW57Y2VudGVyfQp7XExhcmdlXHNjIEVuZCBvZiBUZXJtcyBhbmQg
-Q29uZGl0aW9uc30KXGVuZHtjZW50ZXJ9CgoKXHBhZ2VicmVha1syXQoKXHNlY3Rpb24qe0FwcGVu
-ZGl4OiBIb3cgdG8gQXBwbHkgVGhlc2UgVGVybXMgdG8gWW91ciBOZXcgUHJvZ3JhbXN9CgpJZiB5
-b3UgZGV2ZWxvcCBhIG5ldyBwcm9ncmFtLCBhbmQgeW91IHdhbnQgaXQgdG8gYmUgb2YgdGhlIGdy
-ZWF0ZXN0CnBvc3NpYmxlIHVzZSB0byB0aGUgcHVibGljLCB0aGUgYmVzdCB3YXkgdG8gYWNoaWV2
-ZSB0aGlzIGlzIHRvIG1ha2UgaXQKZnJlZSBzb2Z0d2FyZSB3aGljaCBldmVyeW9uZSBjYW4gcmVk
-aXN0cmlidXRlIGFuZCBjaGFuZ2UgdW5kZXIgdGhlc2UKdGVybXMuCgogIFRvIGRvIHNvLCBhdHRh
-Y2ggdGhlIGZvbGxvd2luZyBub3RpY2VzIHRvIHRoZSBwcm9ncmFtLiAgSXQgaXMgc2FmZXN0IHRv
-CiAgYXR0YWNoIHRoZW0gdG8gdGhlIHN0YXJ0IG9mIGVhY2ggc291cmNlIGZpbGUgdG8gbW9zdCBl
-ZmZlY3RpdmVseSBjb252ZXkKICB0aGUgZXhjbHVzaW9uIG9mIHdhcnJhbnR5OyBhbmQgZWFjaCBm
-aWxlIHNob3VsZCBoYXZlIGF0IGxlYXN0IHRoZQogIGBgY29weXJpZ2h0JycgbGluZSBhbmQgYSBw
-b2ludGVyIHRvIHdoZXJlIHRoZSBmdWxsIG5vdGljZSBpcyBmb3VuZC4KClxiZWdpbntxdW90ZX0K
-b25lIGxpbmUgdG8gZ2l2ZSB0aGUgcHJvZ3JhbSdzIG5hbWUgYW5kIGEgYnJpZWYgaWRlYSBvZiB3
-aGF0IGl0IGRvZXMuIFxcCkNvcHlyaWdodCAoQykgeXl5eSAgbmFtZSBvZiBhdXRob3IgXFwKClRo
-aXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQv
-b3IgbW9kaWZ5Cml0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExp
-Y2Vuc2UgYXMgcHVibGlzaGVkIGJ5CnRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhl
-ciB2ZXJzaW9uIDIgb2YgdGhlIExpY2Vuc2UsIG9yCihhdCB5b3VyIG9wdGlvbikgYW55IGxhdGVy
-IHZlcnNpb24uCgpUaGlzIHByb2dyYW0gaXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBp
-dCB3aWxsIGJlIHVzZWZ1bCwKYnV0IFdJVEhPVVQgQU5ZIFdBUlJBTlRZOyB3aXRob3V0IGV2ZW4g
-dGhlIGltcGxpZWQgd2FycmFudHkgb2YKTUVSQ0hBTlRBQklMSVRZIG9yIEZJVE5FU1MgRk9SIEEg
-UEFSVElDVUxBUiBQVVJQT1NFLiAgU2VlIHRoZQpHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBm
-b3IgbW9yZSBkZXRhaWxzLgoKWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUg
-R05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UKYWxvbmcgd2l0aCB0aGlzIHByb2dyYW07IGlmIG5v
-dCwgd3JpdGUgdG8gdGhlIEZyZWUgU29mdHdhcmUKRm91bmRhdGlvbiwgSW5jLiwgNTkgVGVtcGxl
-IFBsYWNlIC0gU3VpdGUgMzMwLCBCb3N0b24sIE1BICAwMjExMS0xMzA3LCBVU0EuClxlbmR7cXVv
-dGV9CgpBbHNvIGFkZCBpbmZvcm1hdGlvbiBvbiBob3cgdG8gY29udGFjdCB5b3UgYnkgZWxlY3Ry
-b25pYyBhbmQgcGFwZXIgbWFpbC4KCklmIHRoZSBwcm9ncmFtIGlzIGludGVyYWN0aXZlLCBtYWtl
-IGl0IG91dHB1dCBhIHNob3J0IG5vdGljZSBsaWtlIHRoaXMKd2hlbiBpdCBzdGFydHMgaW4gYW4g
-aW50ZXJhY3RpdmUgbW9kZToKClxiZWdpbntxdW90ZX0KR25vbW92aXNpb24gdmVyc2lvbiA2OSwg
-Q29weXJpZ2h0IChDKSB5eXl5ICBuYW1lIG9mIGF1dGhvciBcXApHbm9tb3Zpc2lvbiBjb21lcyB3
-aXRoIEFCU09MVVRFTFkgTk8gV0FSUkFOVFk7IGZvciBkZXRhaWxzIHR5cGUgYHNob3cgdycuIFxc
-ClRoaXMgaXMgZnJlZSBzb2Z0d2FyZSwgYW5kIHlvdSBhcmUgd2VsY29tZSB0byByZWRpc3RyaWJ1
-dGUgaXQKdW5kZXIgY2VydGFpbiBjb25kaXRpb25zOyB0eXBlIGBzaG93IGMnIGZvciBkZXRhaWxz
-LgpcZW5ke3F1b3RlfQoKClRoZSBoeXBvdGhldGljYWwgY29tbWFuZHMge1x0dCBzaG93IHd9IGFu
-ZCB7XHR0IHNob3cgY30gc2hvdWxkIHNob3cgdGhlCmFwcHJvcHJpYXRlIHBhcnRzIG9mIHRoZSBH
-ZW5lcmFsIFB1YmxpYyBMaWNlbnNlLiAgT2YgY291cnNlLCB0aGUgY29tbWFuZHMKeW91IHVzZSBt
-YXkgYmUgY2FsbGVkIHNvbWV0aGluZyBvdGhlciB0aGFuIHtcdHQgc2hvdyB3fSBhbmQge1x0dCBz
-aG93IGN9Owp0aGV5IGNvdWxkIGV2ZW4gYmUgbW91c2UtY2xpY2tzIG9yIG1lbnUgaXRlbXMtLS13
-aGF0ZXZlciBzdWl0cyB5b3VyCnByb2dyYW0uCgpZb3Ugc2hvdWxkIGFsc28gZ2V0IHlvdXIgZW1w
-bG95ZXIgKGlmIHlvdSB3b3JrIGFzIGEgcHJvZ3JhbW1lcikgb3IgeW91cgpzY2hvb2wsIGlmIGFu
-eSwgdG8gc2lnbiBhIGBgY29weXJpZ2h0IGRpc2NsYWltZXInJyBmb3IgdGhlIHByb2dyYW0sIGlm
-Cm5lY2Vzc2FyeS4gIEhlcmUgaXMgYSBzYW1wbGU7IGFsdGVyIHRoZSBuYW1lczoKClxiZWdpbntx
-dW90ZX0KWW95b2R5bmUsIEluYy4sIGhlcmVieSBkaXNjbGFpbXMgYWxsIGNvcHlyaWdodCBpbnRl
-cmVzdCBpbiB0aGUgcHJvZ3JhbSBcXApgR25vbW92aXNpb24nICh3aGljaCBtYWtlcyBwYXNzZXMg
-YXQgY29tcGlsZXJzKSB3cml0dGVuIGJ5IEphbWVzIEhhY2tlci4gXFwKCnNpZ25hdHVyZSBvZiBU
-eSBDb29uLCAxIEFwcmlsIDE5ODkgXFwKVHkgQ29vbiwgUHJlc2lkZW50IG9mIFZpY2UKXGVuZHtx
-dW90ZX0KCgpUaGlzIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgZG9lcyBub3QgcGVybWl0IGluY29y
-cG9yYXRpbmcgeW91ciBwcm9ncmFtCmludG8gcHJvcHJpZXRhcnkgcHJvZ3JhbXMuICBJZiB5b3Vy
-IHByb2dyYW0gaXMgYSBzdWJyb3V0aW5lIGxpYnJhcnksIHlvdQptYXkgY29uc2lkZXIgaXQgbW9y
-ZSB1c2VmdWwgdG8gcGVybWl0IGxpbmtpbmcgcHJvcHJpZXRhcnkgYXBwbGljYXRpb25zCndpdGgg
-dGhlIGxpYnJhcnkuICBJZiB0aGlzIGlzIHdoYXQgeW91IHdhbnQgdG8gZG8sIHVzZSB0aGUgR05V
-IExpYnJhcnkKR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBpbnN0ZWFkIG9mIHRoaXMgTGljZW5zZS4K
-Cgo=
-" ++ Glurf ++ lists:reverse(Glurf++"kalle").
diff --git a/lib/compiler/test/compilation_SUITE_data/nested_tuples_in_case_expr.erl b/lib/compiler/test/compilation_SUITE_data/nested_tuples_in_case_expr.erl
deleted file mode 100644
index 76401cea97..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/nested_tuples_in_case_expr.erl
+++ /dev/null
@@ -1,37 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(nested_tuples_in_case_expr).
--export([nested_tuples_in_case_expr/0,t/2]).
-
-nested_tuples_in_case_expr() ->
- ok.
-
-t(A, B) ->
- case {{element(1, A),element(2, B)},{element(2, A),element(2, B)}} of
- {Same,Same} -> ok;
- {{0,1},{up,X}} -> bar(X);
- {_,{X,_}} -> bar(X)
- end.
-
-bar(X) -> X.
-
-
-
-
diff --git a/lib/compiler/test/compilation_SUITE_data/opt_crash.erl b/lib/compiler/test/compilation_SUITE_data/opt_crash.erl
index 9a88df33af..f1607cca68 100644
--- a/lib/compiler/test/compilation_SUITE_data/opt_crash.erl
+++ b/lib/compiler/test/compilation_SUITE_data/opt_crash.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/other/vsn_1.erl b/lib/compiler/test/compilation_SUITE_data/other/vsn_1.erl
index 7acdb047fb..ea9b32bcbb 100644
--- a/lib/compiler/test/compilation_SUITE_data/other/vsn_1.erl
+++ b/lib/compiler/test/compilation_SUITE_data/other/vsn_1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/other/vsn_3.erl b/lib/compiler/test/compilation_SUITE_data/other/vsn_3.erl
index c8c9975d9b..9815138886 100644
--- a/lib/compiler/test/compilation_SUITE_data/other/vsn_3.erl
+++ b/lib/compiler/test/compilation_SUITE_data/other/vsn_3.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_2141.erl b/lib/compiler/test/compilation_SUITE_data/otp_2141.erl
deleted file mode 100644
index 97daf8bffd..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/otp_2141.erl
+++ /dev/null
@@ -1,25 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(otp_2141).
--export([otp_2141/0]).
-
-
-otp_2141() ->
- ok.
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_2173.erl b/lib/compiler/test/compilation_SUITE_data/otp_2173.erl
deleted file mode 100644
index 4155e2d1ff..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/otp_2173.erl
+++ /dev/null
@@ -1,32 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(otp_2173).
--compile(export_all).
-
--record(t, {a = fun(X) -> X*X end}).
-
-otp_2173() ->
- ok.
-
-t() ->
- #t{}.
-
-
-
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_2330.erl b/lib/compiler/test/compilation_SUITE_data/otp_2330.erl
index c9ba7c7ba5..92e93be1c1 100644
--- a/lib/compiler/test/compilation_SUITE_data/otp_2330.erl
+++ b/lib/compiler/test/compilation_SUITE_data/otp_2330.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_2380.erl b/lib/compiler/test/compilation_SUITE_data/otp_2380.erl
index dbf44e5fb8..b7b2b04793 100644
--- a/lib/compiler/test/compilation_SUITE_data/otp_2380.erl
+++ b/lib/compiler/test/compilation_SUITE_data/otp_2380.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_4790.erl b/lib/compiler/test/compilation_SUITE_data/otp_4790.erl
index 3a32372cc9..08769c5303 100644
--- a/lib/compiler/test/compilation_SUITE_data/otp_4790.erl
+++ b/lib/compiler/test/compilation_SUITE_data/otp_4790.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_5076.erl b/lib/compiler/test/compilation_SUITE_data/otp_5076.erl
deleted file mode 100644
index 7d96b5c734..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/otp_5076.erl
+++ /dev/null
@@ -1,28 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(otp_5076).
--export([?MODULE/0]).
-
-?MODULE() ->
- [] = t(),
- ok.
-
-t() ->
- [3 || {3=4} <- []].
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_5092.erl b/lib/compiler/test/compilation_SUITE_data/otp_5092.erl
deleted file mode 100644
index b675e09af6..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/otp_5092.erl
+++ /dev/null
@@ -1,40 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(otp_5092).
--export([?MODULE/0]).
-
-?MODULE() ->
- [] = t(),
- [] = t2(),
- [t] = t4(),
- [] = t5(),
- ok.
-
-t() ->
- [t || {C=D}={_,_} <- []].
-
-t2() ->
- [X || {X,{Y}={X,X}} <- []].
-
-t4() ->
- [t || "a"++"b" = "ab" <- ["ab"]].
-
-t5() ->
- [{X,Y} || {X} <- [], begin Y = X, Y =:= X end].
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_5151.erl b/lib/compiler/test/compilation_SUITE_data/otp_5151.erl
index c40de9e508..02a19ebd3d 100644
--- a/lib/compiler/test/compilation_SUITE_data/otp_5151.erl
+++ b/lib/compiler/test/compilation_SUITE_data/otp_5151.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_5235.erl b/lib/compiler/test/compilation_SUITE_data/otp_5235.erl
index 69a0a476fb..e0f77c73f6 100644
--- a/lib/compiler/test/compilation_SUITE_data/otp_5235.erl
+++ b/lib/compiler/test/compilation_SUITE_data/otp_5235.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_5244.erl b/lib/compiler/test/compilation_SUITE_data/otp_5244.erl
deleted file mode 100644
index 0fc32ddd36..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/otp_5244.erl
+++ /dev/null
@@ -1,48 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(otp_5244).
--export([?MODULE/0]).
-
-?MODULE() ->
- L = [{stretch,0,0},
- {bad,[]},
- {bad,atom},
- {bad,0},
- {bad,16#AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA},
- {bad,16#555555555555555555555555555555555555555555555555555}],
- remove_failure(L, unit, 0).
-
-remove_failure([], _Unit, _MaxFailure) ->
- ok;
-remove_failure([{bad,Bad}|_], _Unit, _MaxFailure) ->
- Bad;
-remove_failure([{stretch,_,Mi}=Stretch | Specs], Unit, _MaxFailure) ->
- {MinMax,NewMaxFailure} = max_failure(),
- case {MinMax,remove_failure(Specs, Unit, NewMaxFailure)} of
- {min,{NewMaxFailure,Rest}} ->
- {done,[{fixed,Mi} | Rest]};
- {min,_} when Specs =/= [] ->
- remove_failure([Stretch|tl(Specs)], Unit, NewMaxFailure);
- {min,_} ->
- ok
- end.
-
-max_failure() ->
- {min,1}.
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_5404.erl b/lib/compiler/test/compilation_SUITE_data/otp_5404.erl
index 66256fe33b..393c32aa00 100644
--- a/lib/compiler/test/compilation_SUITE_data/otp_5404.erl
+++ b/lib/compiler/test/compilation_SUITE_data/otp_5404.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_5436.erl b/lib/compiler/test/compilation_SUITE_data/otp_5436.erl
index 1ae564eed0..842d46e93e 100644
--- a/lib/compiler/test/compilation_SUITE_data/otp_5436.erl
+++ b/lib/compiler/test/compilation_SUITE_data/otp_5436.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_5481.erl b/lib/compiler/test/compilation_SUITE_data/otp_5481.erl
index 068845ac98..881d2cd239 100644
--- a/lib/compiler/test/compilation_SUITE_data/otp_5481.erl
+++ b/lib/compiler/test/compilation_SUITE_data/otp_5481.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_5553.erl b/lib/compiler/test/compilation_SUITE_data/otp_5553.erl
index fb654dca8a..fd7757ac1e 100644
--- a/lib/compiler/test/compilation_SUITE_data/otp_5553.erl
+++ b/lib/compiler/test/compilation_SUITE_data/otp_5553.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_5632.erl b/lib/compiler/test/compilation_SUITE_data/otp_5632.erl
index 229b5197bc..aaf6814f4e 100644
--- a/lib/compiler/test/compilation_SUITE_data/otp_5632.erl
+++ b/lib/compiler/test/compilation_SUITE_data/otp_5632.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_5714.erl b/lib/compiler/test/compilation_SUITE_data/otp_5714.erl
index d90f937385..b65663f063 100644
--- a/lib/compiler/test/compilation_SUITE_data/otp_5714.erl
+++ b/lib/compiler/test/compilation_SUITE_data/otp_5714.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_5872.erl b/lib/compiler/test/compilation_SUITE_data/otp_5872.erl
index 00d210c4c8..b9b9677a14 100644
--- a/lib/compiler/test/compilation_SUITE_data/otp_5872.erl
+++ b/lib/compiler/test/compilation_SUITE_data/otp_5872.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_6121.erl b/lib/compiler/test/compilation_SUITE_data/otp_6121.erl
index 898e6304d6..f2bc9b3ee8 100644
--- a/lib/compiler/test/compilation_SUITE_data/otp_6121.erl
+++ b/lib/compiler/test/compilation_SUITE_data/otp_6121.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_6121a.erl b/lib/compiler/test/compilation_SUITE_data/otp_6121a.erl
deleted file mode 100644
index fd0a25c779..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/otp_6121a.erl
+++ /dev/null
@@ -1,33 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(otp_6121a).
--export([?MODULE/0]).
-
-%% Thanks to Martin Bjorklund.
-
-?MODULE() ->
- G = fun() -> ok end,
- try
- fun() -> ok end
- after
- fun({A, B}) -> A + B end
- end,
- ok.
-
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_6121b.erl b/lib/compiler/test/compilation_SUITE_data/otp_6121b.erl
deleted file mode 100644
index 0c6b511bec..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/otp_6121b.erl
+++ /dev/null
@@ -1,34 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(otp_6121b).
--export([?MODULE/0]).
-
-%% Thanks to Tim Rath.
-
-?MODULE() ->
- A = {6},
- try
- io:fwrite("")
- after
- fun () ->
- fun () -> {B} = A end
- end
- end.
-
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_7202.erl b/lib/compiler/test/compilation_SUITE_data/otp_7202.erl
index 4437c484b4..4d86763b52 100644
--- a/lib/compiler/test/compilation_SUITE_data/otp_7202.erl
+++ b/lib/compiler/test/compilation_SUITE_data/otp_7202.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/pattern_expr.erl b/lib/compiler/test/compilation_SUITE_data/pattern_expr.erl
deleted file mode 100644
index da9c3c0a9a..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/pattern_expr.erl
+++ /dev/null
@@ -1,31 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(pattern_expr).
-
--export(pattern_expr/0).
-
-pattern_expr() ->
- f().
-
-f() ->
- case 4 of
- 2+2 ->
- ok
- end.
diff --git a/lib/compiler/test/compilation_SUITE_data/trycatch_4.erl b/lib/compiler/test/compilation_SUITE_data/trycatch_4.erl
deleted file mode 100644
index e6f87bf01b..0000000000
--- a/lib/compiler/test/compilation_SUITE_data/trycatch_4.erl
+++ /dev/null
@@ -1,51 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(trycatch_4).
--export([trycatch_4/0]).
--record(state, {foo}).
-
-trycatch_4() ->
- handle_info({foo}, #state{}),
- ok.
-
-handle_info({_}, State) ->
- foo(),
- State#state{foo = bar},
- case ok of
- _ ->
- case catch foo() of
- ok ->
- {stop, State}
- end
- end;
-handle_info(_, State) ->
- (catch begin
- foo(),
- State#state{foo = bar}
- end),
- case ok of
- _ ->
- case catch foo() of
- ok ->
- {stop, State}
- end
- end.
-
-foo() -> ok.
diff --git a/lib/compiler/test/compilation_SUITE_data/vsn_1.erl b/lib/compiler/test/compilation_SUITE_data/vsn_1.erl
index c3ce2f0445..fed91a25c6 100644
--- a/lib/compiler/test/compilation_SUITE_data/vsn_1.erl
+++ b/lib/compiler/test/compilation_SUITE_data/vsn_1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/vsn_2.erl b/lib/compiler/test/compilation_SUITE_data/vsn_2.erl
index ced2d7ca0b..670b3b34ed 100644
--- a/lib/compiler/test/compilation_SUITE_data/vsn_2.erl
+++ b/lib/compiler/test/compilation_SUITE_data/vsn_2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compilation_SUITE_data/vsn_3.erl b/lib/compiler/test/compilation_SUITE_data/vsn_3.erl
index 8312668d27..8fcd596636 100644
--- a/lib/compiler/test/compilation_SUITE_data/vsn_3.erl
+++ b/lib/compiler/test/compilation_SUITE_data/vsn_3.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compile_SUITE.erl b/lib/compiler/test/compile_SUITE.erl
index b2e9558cba..e634f0fcc2 100644
--- a/lib/compiler/test/compile_SUITE.erl
+++ b/lib/compiler/test/compile_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@
%% Tests compile:file/1 and compile:file/2 with various options.
-include_lib("common_test/include/ct.hrl").
+-include_lib("stdlib/include/erl_compile.hrl").
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
@@ -30,13 +31,12 @@
binary/1, makedep/1, cond_and_ifdef/1, listings/1, listings_big/1,
other_output/1, encrypted_abstr/1,
strict_record/1,
- missing_testheap/1, cover/1, env/1, core/1, asm/1,
+ cover/1, env/1, core/1,
+ core_roundtrip/1, asm/1,
sys_pre_attributes/1, dialyzer/1,
- warnings/1
+ warnings/1, pre_load_check/1
]).
--export([init/3]).
-
suite() -> [{ct_hooks,[ts_install_cth]}].
%% To cover the stripping of 'type' and 'spec' in beam_asm.
@@ -49,8 +49,8 @@ all() ->
binary, makedep, cond_and_ifdef, listings, listings_big,
other_output, encrypted_abstr,
strict_record,
- missing_testheap, cover, env, core, asm,
- sys_pre_attributes, dialyzer, warnings].
+ cover, env, core, core_roundtrip, asm,
+ sys_pre_attributes, dialyzer, warnings, pre_load_check].
groups() ->
[].
@@ -126,13 +126,39 @@ forms_2(Config) when is_list(Config) ->
Src = "/foo/bar",
AbsSrc = filename:absname(Src),
Anno = erl_anno:new(1),
- {ok,simple,Binary} = compile:forms([{attribute,Anno,module,simple}],
- [binary,{source,Src}]),
- code:load_binary(simple, Src, Binary),
- Info = simple:module_info(compile),
+ SimpleCode = [{attribute,Anno,module,simple}],
+ {ok,simple,Bin1} = compile:forms(SimpleCode, [binary,{source,Src}]),
+
+ %% Load and test that the proper source is returned.
+ AbsSrc = forms_load_code(simple, Src, Bin1),
+
+ %% Work in a deleted directory.
+ PrivDir = proplists:get_value(priv_dir, Config),
+ WorkDir = filename:join(PrivDir, ?FUNCTION_NAME),
+ ok = file:make_dir(WorkDir),
+ ok = file:set_cwd(WorkDir),
+ case os:type() of
+ {unix,_} -> os:cmd("rm -rf " ++ WorkDir);
+ _ -> ok
+ end,
+ {ok,simple,Bin2} = compile:forms(SimpleCode),
+ undefined = forms_load_code(simple, "ignore", Bin2),
+
+ {ok,simple,Bin3} = compile:forms(SimpleCode, [{source,Src},report]),
+ case forms_load_code(simple, "ignore", Bin3) of
+ Src -> %Unix.
+ ok;
+ AbsSrc -> %Windows.
+ ok
+ end,
+
+ ok.
+
- %% Test that the proper source is returned.
- AbsSrc = proplists:get_value(source, Info),
+forms_load_code(Mod, Src, Bin) ->
+ {module,Mod} = code:load_binary(Mod, Src, Bin),
+ Info = Mod:module_info(compile),
+ SourceOption = proplists:get_value(source, Info),
%% Ensure that the options are not polluted with 'source'.
[] = proplists:get_value(options, Info),
@@ -140,7 +166,9 @@ forms_2(Config) when is_list(Config) ->
%% Cleanup.
true = code:delete(simple),
false = code:purge(simple),
- ok.
+
+ SourceOption.
+
module_mismatch(Config) when is_list(Config) ->
DataDir = proplists:get_value(data_dir, Config),
@@ -516,7 +544,6 @@ verify_abstract(Target) ->
has_crypto() ->
try
crypto:start(),
- <<_,_,_,_,_>> = crypto:rand_bytes(5),
crypto:stop(),
true
catch
@@ -620,46 +647,6 @@ test_sloppy() ->
{1,2} = record_access:test(Turtle),
Turtle.
-missing_testheap(Config) when is_list(Config) ->
- DataDir = proplists:get_value(data_dir, Config),
- PrivDir = proplists:get_value(priv_dir, Config),
- Opts = [{outdir,PrivDir}],
- OldPath = code:get_path(),
- try
- code:add_patha(PrivDir),
- c:c(filename:join(DataDir, "missing_testheap1"), Opts),
- c:c(filename:join(DataDir, "missing_testheap2"), Opts),
- ok = test(fun() ->
- missing_testheap1:f({a,self()},{state,true,b})
- end, {a,b}),
- ok = test(fun() ->
- missing_testheap2:f({a,self()},16#80000000) end,
- bigger)
- after
- code:set_path(OldPath),
- file:delete(filename:join(PrivDir, "missing_testheap1.beam")),
- file:delete(filename:join(PrivDir, "missing_testheap2.beam"))
- end,
- ok.
-
-test(Fun, Result) ->
- test(500, Fun, Result, []).
-
-test(0, _, _, _) ->
- ok;
-test(Iter, Fun, Result, Filler) ->
- spawn(?MODULE, init, [self(), Fun, list_to_tuple(Filler)]),
- receive
- {result, Result} ->
- test(Iter-1, Fun, Result, [0|Filler]);
- {result, Other} ->
- io:format("Expected ~p; got ~p~n", [Result, Other]),
- ct:fail(failed)
- end.
-
-init(ReplyTo, Fun, _Filler) ->
- ReplyTo ! {result, Fun()}.
-
env(Config) when is_list(Config) ->
{Simple,Target} = get_files(Config, simple, env),
{ok,Cwd} = file:get_cwd(),
@@ -761,6 +748,120 @@ compile_forms(Forms, Opts) ->
Other -> throw({error,Other})
end.
+%% Pretty-print core and read it back. Should be identical.
+
+core_roundtrip(Config) ->
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Outdir = filename:join(PrivDir, atom_to_list(?FUNCTION_NAME)),
+ ok = file:make_dir(Outdir),
+
+ Wc = filename:join(filename:dirname(code:which(?MODULE)), "*.beam"),
+ TestBeams = filelib:wildcard(Wc),
+ test_lib:p_run(fun(F) -> do_core_roundtrip(F, Outdir) end, TestBeams).
+
+do_core_roundtrip(Beam, Outdir) ->
+ try
+ {ok,{Mod,[{abstract_code,{raw_abstract_v1,Abstr}}]}} =
+ beam_lib:chunks(Beam, [abstract_code]),
+ do_core_roundtrip_1(Mod, Abstr, Outdir)
+ catch
+ throw:{error,Error} ->
+ io:format("*** compilation failure '~p' for file ~s\n",
+ [Error,Beam]),
+ error;
+ Class:Error ->
+ io:format("~p: ~p ~p\n~p\n",
+ [Beam,Class,Error,erlang:get_stacktrace()]),
+ error
+ end.
+
+do_core_roundtrip_1(Mod, Abstr, Outdir) ->
+ {ok,Mod,Core0} = compile:forms(Abstr, [to_core0]),
+ do_core_roundtrip_2(Mod, Core0, Outdir),
+
+ %% Primarily, test that annotations are accepted for all
+ %% constructs. Secondarily, smoke test cerl_trees:label/1.
+ {Core,_} = cerl_trees:label(Core0),
+ do_core_roundtrip_2(Mod, Core, Outdir).
+
+do_core_roundtrip_2(M, Core0, Outdir) ->
+ CoreFile = filename:join(Outdir, atom_to_list(M)++".core"),
+ CorePP = core_pp:format_all(Core0),
+ ok = file:write_file(CoreFile, CorePP),
+
+ %% Parse the .core file and return the result as Core Erlang Terms.
+ Core2 = case compile:file(CoreFile, [report_errors,from_core,
+ no_copt,to_core,binary]) of
+ {ok,M,Core1} -> Core1;
+ Other -> throw({error,Other})
+ end,
+ Core = undo_var_translation(Core2),
+ ok = file:delete(CoreFile),
+
+ case cmp_core(Core0, Core, M) of
+ true -> ok;
+ false -> error
+ end,
+
+ ok.
+
+undo_var_translation(Tree) ->
+ F = fun(Node) ->
+ case cerl:is_c_var(Node) of
+ true ->
+ Name0 = cerl:var_name(Node),
+ try atom_to_list(Name0) of
+ "_X"++Name ->
+ cerl:update_c_var(Node, list_to_atom(Name));
+ "_"++Name ->
+ cerl:update_c_var(Node, list_to_atom(Name));
+ _ ->
+ Node
+ catch
+ error:badarg ->
+ Node
+
+ end;
+ false ->
+ Node
+ end
+ end,
+ cerl_trees:map(F, Tree).
+
+cmp_core(E, E, _Mod) ->
+ true;
+cmp_core(M1, M2, Mod) ->
+ cmp_core_fs(cerl:module_defs(M1), cerl:module_defs(M2), Mod).
+
+cmp_core_fs([F1|T1], [F2|T2], Mod) ->
+ cmp_core_f(F1, F2, Mod) andalso cmp_core_fs(T1, T2, Mod);
+cmp_core_fs([], [], _Mod) ->
+ true;
+cmp_core_fs(_, _, _Mod) ->
+ false.
+
+cmp_core_f(E, E, _Mod) ->
+ true;
+cmp_core_f({Name,F1}, {Name,F2}, Mod) ->
+ case diff(F1, F2) of
+ F1 ->
+ true;
+ Diff ->
+ io:format("~p ~p:\n~p\n", [Mod,Name,Diff]),
+ false
+ end.
+
+diff(E, E) ->
+ E;
+diff([H1|T1], [H2|T2]) ->
+ [diff(H1, H2)|diff(T1, T2)];
+diff(T1, T2) when tuple_size(T1) =:= tuple_size(T2) ->
+ L = diff(tuple_to_list(T1), tuple_to_list(T2)),
+ list_to_tuple(L);
+diff(E1, E2) ->
+ {'DIFF',E1,E2}.
+
+
%% Compile to Beam assembly language (.S) and then try to
%% run .S through the compiler again.
@@ -881,6 +982,115 @@ do_warnings_2([], Next, F) ->
do_warnings_1(Next, F).
+%% Test that the compile:pre_load/0 function (used by 'erlc')
+%% pre-loads the modules that are used by a typical compilation.
+
+pre_load_check(Config) ->
+ case test_server:is_cover() of
+ true ->
+ {skip,"Cover is running"};
+ false ->
+ try
+ do_pre_load_check(Config)
+ after
+ dbg:stop_clear()
+ end
+ end.
+
+do_pre_load_check(Config) ->
+ DataDir = ?config(data_dir, Config),
+ Simple = filename:join(DataDir, "simple.erl"),
+ Big = filename:join(DataDir, "big.erl"),
+ {ok,_} = dbg:tracer(process, {fun pre_load_trace/2,[]}),
+ dbg:p(self(), call),
+ dbg:p(new, call),
+ {ok,_} = dbg:tpl({?MODULE,get_trace_data,0}, []),
+ {ok,_} = dbg:tp({code,ensure_modules_loaded,1}, []),
+
+ %% Compile a simple module using the erl_compile interface
+ %% to find out the modules that are pre-loaded by
+ %% compile:pre_load/0.
+ Opts = #options{specific=[binary]},
+ {ok,simple,_} = compile:compile(Simple, "", Opts),
+ [{code,ensure_modules_loaded,[PreLoaded0]}] = get_trace_data(),
+ PreLoaded1 = ordsets:from_list(PreLoaded0),
+
+ %% Since 'compile' is the function doing the pre-loaded,
+ %% it is useless to include it in the list.
+ case ordsets:is_element(compile, PreLoaded1) of
+ true ->
+ io:put_chars("The 'compile' module should not be included "
+ "in the list of modules to be pre-loaded."),
+ ?t:fail(compile);
+ false ->
+ []
+ end,
+ PreLoaded = ordsets:add_element(compile, PreLoaded1),
+
+ %% Now unload all pre-loaded modules and all modules in
+ %% compiler application. Then compile a module to find
+ %% which modules that get loaded.
+ CompilerMods = compiler_modules(),
+ Unload = ordsets:union(ordsets:from_list(CompilerMods), PreLoaded),
+ _ = [begin
+ code:delete(M),
+ code:purge(M)
+ end || M <- Unload],
+
+ {ok,_} = dbg:ctp({code,ensure_modules_loaded,1}),
+ {ok,_} = dbg:tp({code,ensure_loaded,1}, []),
+ {ok,big,_} = compile:file(Big, [binary]),
+ WasLoaded0 = get_trace_data(),
+ WasLoaded1 = [M || {code,ensure_loaded,[M]} <- WasLoaded0],
+ WasLoaded = ordsets:from_list(WasLoaded1),
+
+ %% Check for modules that should have been pre-loaded.
+ case ordsets:subtract(WasLoaded, PreLoaded) of
+ [] ->
+ ok;
+ [_|_]=NotPreLoaded ->
+ io:format("The following modules were used "
+ "but not pre-loaded:\n~p\n",
+ [NotPreLoaded]),
+ ?t:fail({not_preload,NotPreLoaded})
+ end,
+
+ %% Check for modules that should not be pre-loaded.
+ case ordsets:subtract(PreLoaded, WasLoaded) of
+ [] ->
+ ok;
+ [_|_]=NotUsed ->
+ io:format("The following modules were pre-loaded"
+ " but not used:\n~p\n",
+ [NotUsed]),
+ ?t:fail({not_used,NotUsed})
+ end,
+
+ ok.
+
+get_trace_data() ->
+ %% Apparantely, doing a receive at the beginning of
+ %% a traced function can cause extra trace messages.
+ %% To avoid that, don't do the receive in this function.
+ do_get_trace_data().
+
+do_get_trace_data() ->
+ receive
+ {trace_data,Data} -> Data
+ end.
+
+pre_load_trace({trace,Pid,call,{?MODULE,get_trace_data,[]}}, Acc) ->
+ Pid ! {trace_data,Acc},
+ [];
+pre_load_trace({trace,_,call,MFA}, Acc) ->
+ [MFA|Acc].
+
+compiler_modules() ->
+ Wc = filename:join([code:lib_dir(compiler),"ebin","*.beam"]),
+ Ms = filelib:wildcard(Wc),
+ FN = filename,
+ [list_to_atom(FN:rootname(FN:basename(M), ".beam")) || M <- Ms].
+
%%%
%%% Utilities.
%%%
diff --git a/lib/compiler/test/compile_SUITE_data/attributes.erl b/lib/compiler/test/compile_SUITE_data/attributes.erl
index 00e635a021..140965c97d 100644
--- a/lib/compiler/test/compile_SUITE_data/attributes.erl
+++ b/lib/compiler/test/compile_SUITE_data/attributes.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compile_SUITE_data/big.erl b/lib/compiler/test/compile_SUITE_data/big.erl
index d916742770..2e54ee8660 100644
--- a/lib/compiler/test/compile_SUITE_data/big.erl
+++ b/lib/compiler/test/compile_SUITE_data/big.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compile_SUITE_data/include/simple.hrl b/lib/compiler/test/compile_SUITE_data/include/simple.hrl
index 91398e209a..065378f820 100644
--- a/lib/compiler/test/compile_SUITE_data/include/simple.hrl
+++ b/lib/compiler/test/compile_SUITE_data/include/simple.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compile_SUITE_data/missing_testheap1.erl b/lib/compiler/test/compile_SUITE_data/missing_testheap1.erl
deleted file mode 100644
index 9d88bc4afe..0000000000
--- a/lib/compiler/test/compile_SUITE_data/missing_testheap1.erl
+++ /dev/null
@@ -1,36 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(missing_testheap1).
-
--compile(export_all).
-%%-export([Function/Arity, ...]).
--record(state,{e1,e2}).
-
-f({a,DpId},State) when State ==
-#state{e1=true,
- e2=a} ->
- {a,a};
-
-f({a,DpId},State) when State ==
-#state{e1=true,
- e2=b} ->
- {a,b}.
-
-
diff --git a/lib/compiler/test/compile_SUITE_data/missing_testheap2.erl b/lib/compiler/test/compile_SUITE_data/missing_testheap2.erl
deleted file mode 100644
index b61e8d3c88..0000000000
--- a/lib/compiler/test/compile_SUITE_data/missing_testheap2.erl
+++ /dev/null
@@ -1,30 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(missing_testheap2).
-
--compile(export_all).
-
-f({a,DpId},16#7fffffff) ->
- big;
-
-f({a,DpId},16#80000000) ->
- bigger.
-
-
diff --git a/lib/compiler/test/compile_SUITE_data/record_access.erl b/lib/compiler/test/compile_SUITE_data/record_access.erl
index 9a83472da4..537e9c8536 100644
--- a/lib/compiler/test/compile_SUITE_data/record_access.erl
+++ b/lib/compiler/test/compile_SUITE_data/record_access.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compile_SUITE_data/simple.erl b/lib/compiler/test/compile_SUITE_data/simple.erl
index 37e7b508f9..d8324dafaf 100644
--- a/lib/compiler/test/compile_SUITE_data/simple.erl
+++ b/lib/compiler/test/compile_SUITE_data/simple.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/compile_SUITE_data/wrong_module_name.erl b/lib/compiler/test/compile_SUITE_data/wrong_module_name.erl
index 8b4db1cfa3..77dd4747f0 100644
--- a/lib/compiler/test/compile_SUITE_data/wrong_module_name.erl
+++ b/lib/compiler/test/compile_SUITE_data/wrong_module_name.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/core_SUITE.erl b/lib/compiler/test/core_SUITE.erl
index 22f6443a77..b768f49e2c 100644
--- a/lib/compiler/test/core_SUITE.erl
+++ b/lib/compiler/test/core_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/core_fold_SUITE.erl b/lib/compiler/test/core_fold_SUITE.erl
index ee2a2c523f..442b2d424c 100644
--- a/lib/compiler/test/core_fold_SUITE.erl
+++ b/lib/compiler/test/core_fold_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/error_SUITE.erl b/lib/compiler/test/error_SUITE.erl
index dd2e766599..01c779b181 100644
--- a/lib/compiler/test/error_SUITE.erl
+++ b/lib/compiler/test/error_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/error_SUITE_data/head_mismatch_line.erl b/lib/compiler/test/error_SUITE_data/head_mismatch_line.erl
index 090f2fb829..5676d60daa 100644
--- a/lib/compiler/test/error_SUITE_data/head_mismatch_line.erl
+++ b/lib/compiler/test/error_SUITE_data/head_mismatch_line.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/float_SUITE.erl b/lib/compiler/test/float_SUITE.erl
index 771016812b..f6095947ca 100644
--- a/lib/compiler/test/float_SUITE.erl
+++ b/lib/compiler/test/float_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/fun_SUITE.erl b/lib/compiler/test/fun_SUITE.erl
index 77559ae2e6..17ff8601d9 100644
--- a/lib/compiler/test/fun_SUITE.erl
+++ b/lib/compiler/test/fun_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/guard_SUITE.erl b/lib/compiler/test/guard_SUITE.erl
index 129db039e1..13d274d98a 100644
--- a/lib/compiler/test/guard_SUITE.erl
+++ b/lib/compiler/test/guard_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
or_guard/1,more_or_guards/1,
complex_or_guards/1,and_guard/1,
xor_guard/1,more_xor_guards/1,
- old_guard_tests/1,
+ old_guard_tests/1,complex_guard/1,
build_in_guard/1,gbif/1,
t_is_boolean/1,is_function_2/1,
tricky/1,rel_ops/1,rel_op_combinations/1,literal_type_tests/1,
@@ -48,7 +48,8 @@ groups() ->
[misc,const_cond,basic_not,complex_not,nested_nots,
semicolon,complex_semicolon,comma,or_guard,
more_or_guards,complex_or_guards,and_guard,xor_guard,
- more_xor_guards,build_in_guard,old_guard_tests,gbif,
+ more_xor_guards,build_in_guard,
+ old_guard_tests,complex_guard,gbif,
t_is_boolean,is_function_2,tricky,
rel_ops,rel_op_combinations,
literal_type_tests,basic_andalso_orelse,traverse_dcd,
@@ -947,6 +948,26 @@ og(_) -> what.
on(V) when number(V) -> number;
on(_) -> not_number.
+complex_guard(_Config) ->
+ _ = [true = do_complex_guard(X, Y, Z) ||
+ X <- [4,5], Y <- [4,5], Z <- [4,5]],
+ _ = [true = do_complex_guard(X, Y, Z) ||
+ X <- [1,2,3], Y <- [1,2,3], Z <- [1,2,3]],
+ _ = [catch do_complex_guard(X, Y, Z) ||
+ X <- [1,2,3,4,5], Y <- [0,6], Z <- [1,2,3,4,5]],
+ ok.
+
+do_complex_guard(X1, Y1, Z1) ->
+ if
+ ((X1 =:= 4) or (X1 =:= 5)) and
+ ((Y1 =:= 4) or (Y1 =:= 5)) and
+ ((Z1 =:= 4) or (Z1 =:= 5)) or
+ ((X1 =:= 1) or (X1 =:= 2) or (X1 =:= 3)) and
+ ((Y1 =:= 1) or (Y1 =:= 2) or (Y1 =:= 3)) and
+ ((Z1 =:= 1) or (Z1 =:= 2) or (Z1 =:= 3)) ->
+ true
+ end.
+
gbif(Config) when is_list(Config) ->
error = gbif_1(1, {false,true}),
ok = gbif_1(2, {false,true}),
diff --git a/lib/compiler/test/inline_SUITE.erl b/lib/compiler/test/inline_SUITE.erl
index 4c53b96fe6..ae59cc8026 100644
--- a/lib/compiler/test/inline_SUITE.erl
+++ b/lib/compiler/test/inline_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/inline_SUITE_data/attribute.erl b/lib/compiler/test/inline_SUITE_data/attribute.erl
index 08ef230c47..4bd9d65032 100644
--- a/lib/compiler/test/inline_SUITE_data/attribute.erl
+++ b/lib/compiler/test/inline_SUITE_data/attribute.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/inline_SUITE_data/bsdecode.erl b/lib/compiler/test/inline_SUITE_data/bsdecode.erl
index e72d5ec73d..f6419b33d1 100644
--- a/lib/compiler/test/inline_SUITE_data/bsdecode.erl
+++ b/lib/compiler/test/inline_SUITE_data/bsdecode.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/inline_SUITE_data/bsdes.erl b/lib/compiler/test/inline_SUITE_data/bsdes.erl
index a9717219d1..43d941f144 100644
--- a/lib/compiler/test/inline_SUITE_data/bsdes.erl
+++ b/lib/compiler/test/inline_SUITE_data/bsdes.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/inline_SUITE_data/decode1.erl b/lib/compiler/test/inline_SUITE_data/decode1.erl
index e89b5305a5..f390a32061 100644
--- a/lib/compiler/test/inline_SUITE_data/decode1.erl
+++ b/lib/compiler/test/inline_SUITE_data/decode1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/inline_SUITE_data/fname.erl b/lib/compiler/test/inline_SUITE_data/fname.erl
index 90da1d17ac..5df8ee6b8c 100644
--- a/lib/compiler/test/inline_SUITE_data/fname.erl
+++ b/lib/compiler/test/inline_SUITE_data/fname.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/inline_SUITE_data/itracer.erl b/lib/compiler/test/inline_SUITE_data/itracer.erl
index 66122e33b5..a6df21f233 100644
--- a/lib/compiler/test/inline_SUITE_data/itracer.erl
+++ b/lib/compiler/test/inline_SUITE_data/itracer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/inline_SUITE_data/maps_inline_test.erl b/lib/compiler/test/inline_SUITE_data/maps_inline_test.erl
index 83ac8b2084..776a1a5950 100644
--- a/lib/compiler/test/inline_SUITE_data/maps_inline_test.erl
+++ b/lib/compiler/test/inline_SUITE_data/maps_inline_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/lc_SUITE.erl b/lib/compiler/test/lc_SUITE.erl
index 70c80d3353..3cb49433ce 100644
--- a/lib/compiler/test/lc_SUITE.erl
+++ b/lib/compiler/test/lc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -89,6 +89,18 @@ basic(Config) when is_list(Config) ->
%% Filter expressions with andalso/orelse.
"abc123" = alphanum("?abc123.;"),
+ %% Aliased patterns.
+ [] = [t || {C=D}={_,_} <- []],
+ [] = [X || {X,{Y}={X,X}} <- []],
+ [t] = [t || "a"++"b" = "ab" <- ["ab"]],
+
+ %% Strange filter block.
+ [] = [{X,Y} || {X} <- [], begin Y = X, Y =:= X end],
+ [{a,a}] = [{X,Y} || {X} <- [{a}], begin Y = X, Y =:= X end],
+
+ %% Not matching.
+ [] = [3 || {3=4} <- []],
+
%% Error cases.
[] = [{xx,X} || X <- L0, element(2, X) == no_no_no],
{'EXIT',_} = (catch [X || X <- L1, list_to_atom(X) == dum]),
diff --git a/lib/compiler/test/match_SUITE.erl b/lib/compiler/test/match_SUITE.erl
index 41fa1603ef..92a9802cad 100644
--- a/lib/compiler/test/match_SUITE.erl
+++ b/lib/compiler/test/match_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@
pmatch/1,mixed/1,aliases/1,match_in_call/1,
untuplify/1,shortcut_boolean/1,letify_guard/1,
selectify/1,underscore/1,match_map/1,map_vars_used/1,
- coverage/1]).
+ coverage/1,grab_bag/1]).
-include_lib("common_test/include/ct.hrl").
@@ -38,7 +38,8 @@ groups() ->
[{p,[parallel],
[pmatch,mixed,aliases,match_in_call,untuplify,
shortcut_boolean,letify_guard,selectify,
- underscore,match_map,map_vars_used,coverage]}].
+ underscore,match_map,map_vars_used,coverage,
+ grab_bag]}].
init_per_suite(Config) ->
@@ -93,9 +94,9 @@ mixit(X) ->
2 -> b;
3 -> 42;
4 -> 77;
- 5 -> blurf;
- 6 -> 87987987;
- 7 -> {a,b,c}
+ 4+1 -> blurf;
+ 5+1 -> 87987987;
+ 6+1 -> {a,b,c}
end of
a -> glufs;
b -> klafs;
@@ -149,6 +150,9 @@ aliases(Config) when is_list(Config) ->
none = mixed_aliases({a,42}),
none = mixed_aliases(42),
+ %% Non-matching aliases.
+ {'EXIT',{{badmatch,42},_}} = (catch nomatch_alias(42)),
+
ok.
str_alias(V) ->
@@ -258,6 +262,10 @@ mixed_aliases(<<X:8>> = {a,X}) -> {c,X};
mixed_aliases([X] = <<X:8>>) -> {d,X};
mixed_aliases(_) -> none.
+nomatch_alias(I) ->
+ {ok={A,B}} = id(I),
+ {A,B}.
+
%% OTP-7018.
match_in_call(Config) when is_list(Config) ->
@@ -465,4 +473,53 @@ coverage_2(2, b, x) -> ok.
coverage_3([$a]++[]++"bc") -> ok.
+grab_bag(_Config) ->
+ [_|T] = id([a,b,c]),
+ [b,c] = id(T),
+
+ T1 = fun() ->
+ [_|_] = x
+ end,
+ {'EXIT',_} = (catch T1()),
+
+ T2 = fun(A, B) ->
+ case {{element(1, A),element(2, B)},
+ {element(2, A),element(2, B)}} of
+ {Same,Same} -> ok;
+ {{0,1},{up,X}} -> id(X);
+ {_,{X,_}} -> id(X)
+ end
+ end,
+ ok = T2({a,a,z,z}, {z,a,z}),
+ 1 = T2({0,up}, {zzz,1}),
+ y = T2({x,y}, {a,z,z}),
+
+ %% OTP-5244.
+ L = [{stretch,0,0},
+ {bad,[]},
+ {bad,atom},
+ {bad,0},
+ {bad,16#AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA},
+ {bad,16#555555555555555555555555555555555555555555555555555}],
+ ok = grab_bag_remove_failure(L, unit, 0),
+
+ ok.
+
+grab_bag_remove_failure([], _Unit, _MaxFailure) ->
+ ok;
+grab_bag_remove_failure([{bad,Bad}|_], _Unit, _MaxFailure) ->
+ Bad;
+grab_bag_remove_failure([{stretch,_,Mi}=Stretch | Specs], Unit, _MaxFailure) ->
+ {MinMax,NewMaxFailure} = id({min,1}),
+ case {MinMax,grab_bag_remove_failure(Specs, Unit, NewMaxFailure)} of
+ {min,{NewMaxFailure,Rest}} ->
+ {done,[{fixed,Mi} | Rest]};
+ {min,_} when Specs =/= [] ->
+ grab_bag_remove_failure([Stretch|tl(Specs)], Unit, NewMaxFailure);
+ {min,_} ->
+ ok
+ end.
+
+
+
id(I) -> I.
diff --git a/lib/compiler/test/misc_SUITE.erl b/lib/compiler/test/misc_SUITE.erl
index 8a639f741f..f05fe6c943 100644
--- a/lib/compiler/test/misc_SUITE.erl
+++ b/lib/compiler/test/misc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -23,7 +23,8 @@
init_per_group/2,end_per_group/2,
init_per_testcase/2,end_per_testcase/2,
tobias/1,empty_string/1,md5/1,silly_coverage/1,
- confused_literals/1,integer_encoding/1,override_bif/1]).
+ confused_literals/1,integer_encoding/0,integer_encoding/1,
+ override_bif/1]).
-include_lib("common_test/include/ct.hrl").
diff --git a/lib/compiler/test/num_bif_SUITE.erl b/lib/compiler/test/num_bif_SUITE.erl
index 78f6fdc3c7..7eac90bac3 100644
--- a/lib/compiler/test/num_bif_SUITE.erl
+++ b/lib/compiler/test/num_bif_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/receive_SUITE.erl b/lib/compiler/test/receive_SUITE.erl
index 8d2c78aae2..3c397561fc 100644
--- a/lib/compiler/test/receive_SUITE.erl
+++ b/lib/compiler/test/receive_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/record_SUITE.erl b/lib/compiler/test/record_SUITE.erl
index 680bd38317..5546765f26 100644
--- a/lib/compiler/test/record_SUITE.erl
+++ b/lib/compiler/test/record_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
init_per_testcase/2,end_per_testcase/2,
errors/1,record_test_2/1,record_test_3/1,record_access_in_guards/1,
guard_opt/1,eval_once/1,foobar/1,missing_test_heap/1,
- nested_access/1,coverage/1]).
+ nested_access/1,coverage/1,grab_bag/1]).
init_per_testcase(_Case, Config) ->
Config.
@@ -48,7 +48,7 @@ groups() ->
[{p,test_lib:parallel(),
[errors,record_test_2,record_test_3,
record_access_in_guards,guard_opt,eval_once,foobar,
- missing_test_heap,nested_access,coverage]}].
+ missing_test_heap,nested_access,coverage,grab_bag]}].
init_per_suite(Config) ->
@@ -601,4 +601,60 @@ coverage(Config) when is_list(Config) ->
#rr{a=1,b=2,c=42} = id(R), %Test for correctness.
ok.
+
+-record(default_fun, {a = fun(X) -> X*X end}).
+
+%% compiler treats records with 1 and 2 fields differently...
+-record(gb_nil, {}).
+-record(gb_foo, {hello=1}).
+-record(gb_bar, {hello=2,there=3}).
+
+%% Taken from compilation_SUITE.
+grab_bag(_Config) ->
+ T1 = fun() ->
+ X = #foo{},
+ Y = #foo{},
+ {X#foo.a == Y#foo.a,X#foo.b}
+ end,
+ {true,undefined} = T1(),
+
+ T2 = fun(X, Y) ->
+ first_arg(X#foo.a =/= Y#foo.a, X#foo.b =/= X#foo.b)
+ end,
+ true = T2(#foo{a=x,b=z}, #foo{a=y,b=z}),
+
+ T3 = fun() ->
+ #default_fun{a=Fun} = id(#default_fun{}),
+ 9 = Fun(3)
+ end,
+ T3(),
+
+ %% Stupid code, but the compiler used to crash.
+ T4 = fun() ->
+ F0 = fun() ->
+ R1 = #gb_nil{},
+ R2 = R1#gb_nil{},
+ R1 = R2
+ end,
+ F1 = fun() ->
+ R1 = #gb_foo{},
+ R2 = R1#gb_foo{},
+ R1 = R2
+ end,
+
+ F2 = fun() ->
+ R1 = #gb_bar{},
+ R2 = R1#gb_bar{},
+ R1 = R2
+ end,
+ F0(),
+ F1(),
+ F2()
+ end,
+ T4(),
+
+ ok.
+
+first_arg(First, _) -> First.
+
id(I) -> I.
diff --git a/lib/compiler/test/record_SUITE_data/record_access_in_guards.erl b/lib/compiler/test/record_SUITE_data/record_access_in_guards.erl
index fb3d7d3ae4..9b72432246 100644
--- a/lib/compiler/test/record_SUITE_data/record_access_in_guards.erl
+++ b/lib/compiler/test/record_SUITE_data/record_access_in_guards.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/regressions_SUITE.erl b/lib/compiler/test/regressions_SUITE.erl
index 3fd4645529..7d2c2ac974 100644
--- a/lib/compiler/test/regressions_SUITE.erl
+++ b/lib/compiler/test/regressions_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2015. All Rights Reserved.
+%% Copyright Ericsson AB 2015-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/test_lib.erl b/lib/compiler/test/test_lib.erl
index 3ca93fb021..d141d86021 100644
--- a/lib/compiler/test/test_lib.erl
+++ b/lib/compiler/test/test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/compiler/test/trycatch_SUITE.erl b/lib/compiler/test/trycatch_SUITE.erl
index 82e3c86649..f7ad78cb8d 100644
--- a/lib/compiler/test/trycatch_SUITE.erl
+++ b/lib/compiler/test/trycatch_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@
nested_of/1,nested_catch/1,nested_after/1,
nested_horrid/1,last_call_optimization/1,bool/1,
plain_catch_coverage/1,andalso_orelse/1,get_in_try/1,
- hockey/1]).
+ hockey/1,handle_info/1,catch_in_catch/1,grab_bag/1]).
-include_lib("common_test/include/ct.hrl").
@@ -42,7 +42,7 @@ groups() ->
after_oops,eclectic,rethrow,nested_of,nested_catch,
nested_after,nested_horrid,last_call_optimization,
bool,plain_catch_coverage,andalso_orelse,get_in_try,
- hockey]}].
+ hockey,handle_info,catch_in_catch,grab_bag]}].
init_per_suite(Config) ->
@@ -919,8 +919,6 @@ andalso_orelse_1(A, B) ->
catched
end,B}.
-id(I) -> I.
-
andalso_orelse_2({Type,Keyval}) ->
try
if is_atom(Type) andalso length(Keyval) > 0 -> ok;
@@ -957,3 +955,86 @@ hockey() ->
receive _ -> (b = fun() -> ok end)
+ hockey, +x after 0 -> ok end, try (a = fun() -> ok end) + hockey, +
y catch _ -> ok end.
+
+
+-record(state, {foo}).
+
+handle_info(_Config) ->
+ do_handle_info({foo}, #state{}),
+ ok.
+
+do_handle_info({_}, State) ->
+ handle_info_ok(),
+ State#state{foo = bar},
+ case ok of
+ _ ->
+ case catch handle_info_ok() of
+ ok ->
+ {stop, State}
+ end
+ end;
+do_handle_info(_, State) ->
+ (catch begin
+ handle_info_ok(),
+ State#state{foo = bar}
+ end),
+ case ok of
+ _ ->
+ case catch handle_info_ok() of
+ ok ->
+ {stop, State}
+ end
+ end.
+
+handle_info_ok() -> ok.
+
+'catch_in_catch'(_Config) ->
+ process_flag(trap_exit, true),
+ Pid = spawn_link(fun() ->
+ catch_in_catch_init(x),
+ exit(good_exit)
+ end),
+ receive
+ {'EXIT',Pid,good_exit} ->
+ ok;
+ Other ->
+ io:format("Unexpected: ~p\n", [Other]),
+ error
+ after 32000 ->
+ io:format("No message received\n"),
+ error
+ end.
+
+'catch_in_catch_init'(Param) ->
+ process_flag(trap_exit, true),
+ %% The catches were improperly nested, causing a "No catch found" crash.
+ (catch begin
+ id(Param),
+ (catch exit(bar))
+ end
+ ),
+ ignore.
+
+grab_bag(_Config) ->
+ %% Thanks to Martin Bjorklund.
+ _ = fun() -> ok end,
+ try
+ fun() -> ok end
+ after
+ fun({A, B}) -> A + B end
+ end,
+
+ %% Thanks to Tim Rath.
+ A = {6},
+ try
+ io:fwrite("")
+ after
+ fun () ->
+ fun () -> {_} = A end
+ end
+ end,
+
+ ok.
+
+
+id(I) -> I.
diff --git a/lib/compiler/test/warnings_SUITE.erl b/lib/compiler/test/warnings_SUITE.erl
index d66f2d5053..f884e6e7d6 100644
--- a/lib/compiler/test/warnings_SUITE.erl
+++ b/lib/compiler/test/warnings_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/configure.in.src b/lib/configure.in.src
index 7ac52f8a97..d507a5c0dd 100644
--- a/lib/configure.in.src
+++ b/lib/configure.in.src
@@ -1,7 +1,7 @@
dnl
dnl %CopyrightBegin%
dnl
-dnl Copyright Ericsson AB 1999-2011. All Rights Reserved.
+dnl Copyright Ericsson AB 1999-2016. All Rights Reserved.
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/Makefile b/lib/cosEvent/Makefile
index 4c13a8ce01..276b7bd865 100644
--- a/lib/cosEvent/Makefile
+++ b/lib/cosEvent/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/doc/src/CosEventChannelAdmin.xml b/lib/cosEvent/doc/src/CosEventChannelAdmin.xml
index 1e82dd684a..29336c1878 100644
--- a/lib/cosEvent/doc/src/CosEventChannelAdmin.xml
+++ b/lib/cosEvent/doc/src/CosEventChannelAdmin.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEvent/doc/src/CosEventChannelAdmin_ConsumerAdmin.xml b/lib/cosEvent/doc/src/CosEventChannelAdmin_ConsumerAdmin.xml
index 1903812e5e..80d36ba5c5 100644
--- a/lib/cosEvent/doc/src/CosEventChannelAdmin_ConsumerAdmin.xml
+++ b/lib/cosEvent/doc/src/CosEventChannelAdmin_ConsumerAdmin.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEvent/doc/src/CosEventChannelAdmin_EventChannel.xml b/lib/cosEvent/doc/src/CosEventChannelAdmin_EventChannel.xml
index 159c0b87e2..f32e742240 100644
--- a/lib/cosEvent/doc/src/CosEventChannelAdmin_EventChannel.xml
+++ b/lib/cosEvent/doc/src/CosEventChannelAdmin_EventChannel.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPullConsumer.xml b/lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPullConsumer.xml
index de18f047a9..83bf8acbf2 100644
--- a/lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPullConsumer.xml
+++ b/lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPullConsumer.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPullSupplier.xml b/lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPullSupplier.xml
index 212372b4c2..0060e71e2b 100644
--- a/lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPullSupplier.xml
+++ b/lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPullSupplier.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPushConsumer.xml b/lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPushConsumer.xml
index 58127cac95..9f19d001f9 100644
--- a/lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPushConsumer.xml
+++ b/lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPushConsumer.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPushSupplier.xml b/lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPushSupplier.xml
index 650a303d7e..2b1098b9a7 100644
--- a/lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPushSupplier.xml
+++ b/lib/cosEvent/doc/src/CosEventChannelAdmin_ProxyPushSupplier.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEvent/doc/src/CosEventChannelAdmin_SupplierAdmin.xml b/lib/cosEvent/doc/src/CosEventChannelAdmin_SupplierAdmin.xml
index f29bb5994b..2a58c0a873 100644
--- a/lib/cosEvent/doc/src/CosEventChannelAdmin_SupplierAdmin.xml
+++ b/lib/cosEvent/doc/src/CosEventChannelAdmin_SupplierAdmin.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEvent/doc/src/Makefile b/lib/cosEvent/doc/src/Makefile
index ed69d70d47..ba505d6f7b 100644
--- a/lib/cosEvent/doc/src/Makefile
+++ b/lib/cosEvent/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/doc/src/book.xml b/lib/cosEvent/doc/src/book.xml
index f7c4e853c7..5c0172b4cd 100644
--- a/lib/cosEvent/doc/src/book.xml
+++ b/lib/cosEvent/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEvent/doc/src/ch_contents.xml b/lib/cosEvent/doc/src/ch_contents.xml
index 1fe0f772e6..07773877ea 100644
--- a/lib/cosEvent/doc/src/ch_contents.xml
+++ b/lib/cosEvent/doc/src/ch_contents.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1999</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEvent/doc/src/ch_event_service.xml b/lib/cosEvent/doc/src/ch_event_service.xml
index 60d948b323..3a783234af 100644
--- a/lib/cosEvent/doc/src/ch_event_service.xml
+++ b/lib/cosEvent/doc/src/ch_event_service.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEvent/doc/src/ch_introduction.xml b/lib/cosEvent/doc/src/ch_introduction.xml
index b3d26f23f6..c88e96e40d 100644
--- a/lib/cosEvent/doc/src/ch_introduction.xml
+++ b/lib/cosEvent/doc/src/ch_introduction.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1999</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEvent/doc/src/cosEventApp.xml b/lib/cosEvent/doc/src/cosEventApp.xml
index 5b911fec4f..d26512e0c3 100644
--- a/lib/cosEvent/doc/src/cosEventApp.xml
+++ b/lib/cosEvent/doc/src/cosEventApp.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2001</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEvent/doc/src/notes.xml b/lib/cosEvent/doc/src/notes.xml
index 3af3a9e141..83fa5fa4b7 100644
--- a/lib/cosEvent/doc/src/notes.xml
+++ b/lib/cosEvent/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEvent/doc/src/part.xml b/lib/cosEvent/doc/src/part.xml
index 43ed8e9184..5e32455ebb 100644
--- a/lib/cosEvent/doc/src/part.xml
+++ b/lib/cosEvent/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEvent/doc/src/part_notes.xml b/lib/cosEvent/doc/src/part_notes.xml
index e406f16a70..37103a5592 100644
--- a/lib/cosEvent/doc/src/part_notes.xml
+++ b/lib/cosEvent/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEvent/doc/src/ref_man.xml b/lib/cosEvent/doc/src/ref_man.xml
index 38a52c1b61..5db5626478 100644
--- a/lib/cosEvent/doc/src/ref_man.xml
+++ b/lib/cosEvent/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEvent/src/CosEventChannelAdmin_ProxyPullConsumer_impl.erl b/lib/cosEvent/src/CosEventChannelAdmin_ProxyPullConsumer_impl.erl
index 424b86e956..cb9bb4f4a4 100644
--- a/lib/cosEvent/src/CosEventChannelAdmin_ProxyPullConsumer_impl.erl
+++ b/lib/cosEvent/src/CosEventChannelAdmin_ProxyPullConsumer_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/src/CosEventChannelAdmin_ProxyPushConsumer_impl.erl b/lib/cosEvent/src/CosEventChannelAdmin_ProxyPushConsumer_impl.erl
index bf00399429..4c2b8629f2 100644
--- a/lib/cosEvent/src/CosEventChannelAdmin_ProxyPushConsumer_impl.erl
+++ b/lib/cosEvent/src/CosEventChannelAdmin_ProxyPushConsumer_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/src/CosEventChannelAdmin_SupplierAdmin_impl.erl b/lib/cosEvent/src/CosEventChannelAdmin_SupplierAdmin_impl.erl
index 52b18fc824..fb5304292b 100644
--- a/lib/cosEvent/src/CosEventChannelAdmin_SupplierAdmin_impl.erl
+++ b/lib/cosEvent/src/CosEventChannelAdmin_SupplierAdmin_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/src/Makefile b/lib/cosEvent/src/Makefile
index b79f0ec1e5..29d6223005 100644
--- a/lib/cosEvent/src/Makefile
+++ b/lib/cosEvent/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/src/cosEventApp.erl b/lib/cosEvent/src/cosEventApp.erl
index 065032d933..b3c38cef0e 100644
--- a/lib/cosEvent/src/cosEventApp.erl
+++ b/lib/cosEvent/src/cosEventApp.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/src/cosEventApp.hrl b/lib/cosEvent/src/cosEventApp.hrl
index 6b7f23c827..d801e83530 100644
--- a/lib/cosEvent/src/cosEventApp.hrl
+++ b/lib/cosEvent/src/cosEventApp.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/src/oe_CosEventComm_CAdmin_impl.erl b/lib/cosEvent/src/oe_CosEventComm_CAdmin_impl.erl
index d1e4c9c758..728c4cc5ab 100644
--- a/lib/cosEvent/src/oe_CosEventComm_CAdmin_impl.erl
+++ b/lib/cosEvent/src/oe_CosEventComm_CAdmin_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/src/oe_CosEventComm_Channel_impl.erl b/lib/cosEvent/src/oe_CosEventComm_Channel_impl.erl
index 61d96a51e0..4f53ca6164 100644
--- a/lib/cosEvent/src/oe_CosEventComm_Channel_impl.erl
+++ b/lib/cosEvent/src/oe_CosEventComm_Channel_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/src/oe_CosEventComm_PusherS_impl.erl b/lib/cosEvent/src/oe_CosEventComm_PusherS_impl.erl
index e9482e77d6..ac23412000 100644
--- a/lib/cosEvent/src/oe_CosEventComm_PusherS_impl.erl
+++ b/lib/cosEvent/src/oe_CosEventComm_PusherS_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/test/Makefile b/lib/cosEvent/test/Makefile
index 028b0221b6..878e1c8a4c 100644
--- a/lib/cosEvent/test/Makefile
+++ b/lib/cosEvent/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/test/event_channel_SUITE.erl b/lib/cosEvent/test/event_channel_SUITE.erl
index 3a01a0eab6..d237db8e9b 100644
--- a/lib/cosEvent/test/event_channel_SUITE.erl
+++ b/lib/cosEvent/test/event_channel_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/test/event_test_PullC_impl.erl b/lib/cosEvent/test/event_test_PullC_impl.erl
index e1824dceae..fb72d2e595 100644
--- a/lib/cosEvent/test/event_test_PullC_impl.erl
+++ b/lib/cosEvent/test/event_test_PullC_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/test/event_test_PullS_impl.erl b/lib/cosEvent/test/event_test_PullS_impl.erl
index 2bfb86d4c3..de59b251da 100644
--- a/lib/cosEvent/test/event_test_PullS_impl.erl
+++ b/lib/cosEvent/test/event_test_PullS_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/test/event_test_PushC_impl.erl b/lib/cosEvent/test/event_test_PushC_impl.erl
index e035f7cf0a..98e4d611fc 100644
--- a/lib/cosEvent/test/event_test_PushC_impl.erl
+++ b/lib/cosEvent/test/event_test_PushC_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/test/event_test_PushS_impl.erl b/lib/cosEvent/test/event_test_PushS_impl.erl
index b60c634d05..062ee8a311 100644
--- a/lib/cosEvent/test/event_test_PushS_impl.erl
+++ b/lib/cosEvent/test/event_test_PushS_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/test/event_test_server.idl b/lib/cosEvent/test/event_test_server.idl
index 74bab08444..f76ac085e1 100644
--- a/lib/cosEvent/test/event_test_server.idl
+++ b/lib/cosEvent/test/event_test_server.idl
@@ -1,7 +1,7 @@
//
// %CopyrightBegin%
//
-// Copyright Ericsson AB 2001-2010. All Rights Reserved.
+// Copyright Ericsson AB 2001-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/cosEvent/test/generated_SUITE.erl b/lib/cosEvent/test/generated_SUITE.erl
index 1533c0be9c..2fa15c3a96 100644
--- a/lib/cosEvent/test/generated_SUITE.erl
+++ b/lib/cosEvent/test/generated_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEventDomain/Makefile b/lib/cosEventDomain/Makefile
index f74d77bd2e..8e8ae7e4da 100644
--- a/lib/cosEventDomain/Makefile
+++ b/lib/cosEventDomain/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosEventDomain/doc/src/CosEventDomainAdmin.xml b/lib/cosEventDomain/doc/src/CosEventDomainAdmin.xml
index ca7ec31969..6931059e67 100644
--- a/lib/cosEventDomain/doc/src/CosEventDomainAdmin.xml
+++ b/lib/cosEventDomain/doc/src/CosEventDomainAdmin.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2002</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEventDomain/doc/src/CosEventDomainAdmin_EventDomain.xml b/lib/cosEventDomain/doc/src/CosEventDomainAdmin_EventDomain.xml
index 143d448089..e99c8d380b 100644
--- a/lib/cosEventDomain/doc/src/CosEventDomainAdmin_EventDomain.xml
+++ b/lib/cosEventDomain/doc/src/CosEventDomainAdmin_EventDomain.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEventDomain/doc/src/CosEventDomainAdmin_EventDomainFactory.xml b/lib/cosEventDomain/doc/src/CosEventDomainAdmin_EventDomainFactory.xml
index b6d64299b8..602e0e5fb0 100644
--- a/lib/cosEventDomain/doc/src/CosEventDomainAdmin_EventDomainFactory.xml
+++ b/lib/cosEventDomain/doc/src/CosEventDomainAdmin_EventDomainFactory.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2001</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEventDomain/doc/src/Makefile b/lib/cosEventDomain/doc/src/Makefile
index 8b2450e64d..0f18e43547 100644
--- a/lib/cosEventDomain/doc/src/Makefile
+++ b/lib/cosEventDomain/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosEventDomain/doc/src/book.xml b/lib/cosEventDomain/doc/src/book.xml
index 3dde504cfd..b073e5edc0 100644
--- a/lib/cosEventDomain/doc/src/book.xml
+++ b/lib/cosEventDomain/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEventDomain/doc/src/ch_QoS.xml b/lib/cosEventDomain/doc/src/ch_QoS.xml
index bdc9a8dcfb..c356e38752 100644
--- a/lib/cosEventDomain/doc/src/ch_QoS.xml
+++ b/lib/cosEventDomain/doc/src/ch_QoS.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEventDomain/doc/src/ch_contents.xml b/lib/cosEventDomain/doc/src/ch_contents.xml
index 4e98e21948..b8fefecf44 100644
--- a/lib/cosEventDomain/doc/src/ch_contents.xml
+++ b/lib/cosEventDomain/doc/src/ch_contents.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEventDomain/doc/src/ch_event_domain_service.xml b/lib/cosEventDomain/doc/src/ch_event_domain_service.xml
index f1d2405e9f..a0ecf20415 100644
--- a/lib/cosEventDomain/doc/src/ch_event_domain_service.xml
+++ b/lib/cosEventDomain/doc/src/ch_event_domain_service.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEventDomain/doc/src/ch_introduction.xml b/lib/cosEventDomain/doc/src/ch_introduction.xml
index 59034ca84a..f7a3426673 100644
--- a/lib/cosEventDomain/doc/src/ch_introduction.xml
+++ b/lib/cosEventDomain/doc/src/ch_introduction.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEventDomain/doc/src/cosEventDomainApp.xml b/lib/cosEventDomain/doc/src/cosEventDomainApp.xml
index 2efba82094..c75ee05512 100644
--- a/lib/cosEventDomain/doc/src/cosEventDomainApp.xml
+++ b/lib/cosEventDomain/doc/src/cosEventDomainApp.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2001</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEventDomain/doc/src/notes.xml b/lib/cosEventDomain/doc/src/notes.xml
index d4af1b66f0..5617efe697 100644
--- a/lib/cosEventDomain/doc/src/notes.xml
+++ b/lib/cosEventDomain/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEventDomain/doc/src/part.xml b/lib/cosEventDomain/doc/src/part.xml
index 2d8512fc87..328fdfc20f 100644
--- a/lib/cosEventDomain/doc/src/part.xml
+++ b/lib/cosEventDomain/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEventDomain/doc/src/part_notes.xml b/lib/cosEventDomain/doc/src/part_notes.xml
index 55d4d21c3a..af6864decf 100644
--- a/lib/cosEventDomain/doc/src/part_notes.xml
+++ b/lib/cosEventDomain/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEventDomain/doc/src/ref_man.xml b/lib/cosEventDomain/doc/src/ref_man.xml
index 8ad8366e5b..14b826e4f9 100644
--- a/lib/cosEventDomain/doc/src/ref_man.xml
+++ b/lib/cosEventDomain/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosEventDomain/src/CosEventDomainAdmin_EventDomainFactory_impl.erl b/lib/cosEventDomain/src/CosEventDomainAdmin_EventDomainFactory_impl.erl
index 21024913c1..75ff81196c 100644
--- a/lib/cosEventDomain/src/CosEventDomainAdmin_EventDomainFactory_impl.erl
+++ b/lib/cosEventDomain/src/CosEventDomainAdmin_EventDomainFactory_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEventDomain/src/CosEventDomainAdmin_EventDomain_impl.erl b/lib/cosEventDomain/src/CosEventDomainAdmin_EventDomain_impl.erl
index 50b076df65..a31a70acc2 100644
--- a/lib/cosEventDomain/src/CosEventDomainAdmin_EventDomain_impl.erl
+++ b/lib/cosEventDomain/src/CosEventDomainAdmin_EventDomain_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEventDomain/src/Makefile b/lib/cosEventDomain/src/Makefile
index da8dcf08b6..cdaf9e5f1f 100644
--- a/lib/cosEventDomain/src/Makefile
+++ b/lib/cosEventDomain/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosEventDomain/src/cosEventDomainApp.hrl b/lib/cosEventDomain/src/cosEventDomainApp.hrl
index ff8b004fb9..6df20692be 100644
--- a/lib/cosEventDomain/src/cosEventDomainApp.hrl
+++ b/lib/cosEventDomain/src/cosEventDomainApp.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEventDomain/test/Makefile b/lib/cosEventDomain/test/Makefile
index d8f6a863d6..1841676be7 100644
--- a/lib/cosEventDomain/test/Makefile
+++ b/lib/cosEventDomain/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosEventDomain/test/event_domain_SUITE.erl b/lib/cosEventDomain/test/event_domain_SUITE.erl
index 37a04a34aa..b80b16ae6f 100644
--- a/lib/cosEventDomain/test/event_domain_SUITE.erl
+++ b/lib/cosEventDomain/test/event_domain_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosEventDomain/test/generated_SUITE.erl b/lib/cosEventDomain/test/generated_SUITE.erl
index afaa70db0a..51b627f0d6 100644
--- a/lib/cosEventDomain/test/generated_SUITE.erl
+++ b/lib/cosEventDomain/test/generated_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosFileTransfer/Makefile b/lib/cosFileTransfer/Makefile
index c811d7be8f..c9c07dcdad 100644
--- a/lib/cosFileTransfer/Makefile
+++ b/lib/cosFileTransfer/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2009. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosFileTransfer/doc/src/CosFileTransfer_Directory.xml b/lib/cosFileTransfer/doc/src/CosFileTransfer_Directory.xml
index 3d5e4f024f..da5810521a 100644
--- a/lib/cosFileTransfer/doc/src/CosFileTransfer_Directory.xml
+++ b/lib/cosFileTransfer/doc/src/CosFileTransfer_Directory.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosFileTransfer/doc/src/CosFileTransfer_File.xml b/lib/cosFileTransfer/doc/src/CosFileTransfer_File.xml
index 97ea054c46..373c14d1f1 100644
--- a/lib/cosFileTransfer/doc/src/CosFileTransfer_File.xml
+++ b/lib/cosFileTransfer/doc/src/CosFileTransfer_File.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosFileTransfer/doc/src/CosFileTransfer_FileIterator.xml b/lib/cosFileTransfer/doc/src/CosFileTransfer_FileIterator.xml
index c26449a4dd..f5c219b9c1 100644
--- a/lib/cosFileTransfer/doc/src/CosFileTransfer_FileIterator.xml
+++ b/lib/cosFileTransfer/doc/src/CosFileTransfer_FileIterator.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosFileTransfer/doc/src/CosFileTransfer_FileTransferSession.xml b/lib/cosFileTransfer/doc/src/CosFileTransfer_FileTransferSession.xml
index 19caace060..312af3b8c2 100644
--- a/lib/cosFileTransfer/doc/src/CosFileTransfer_FileTransferSession.xml
+++ b/lib/cosFileTransfer/doc/src/CosFileTransfer_FileTransferSession.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosFileTransfer/doc/src/CosFileTransfer_VirtualFileSystem.xml b/lib/cosFileTransfer/doc/src/CosFileTransfer_VirtualFileSystem.xml
index 67a9fa72fd..701e56e660 100644
--- a/lib/cosFileTransfer/doc/src/CosFileTransfer_VirtualFileSystem.xml
+++ b/lib/cosFileTransfer/doc/src/CosFileTransfer_VirtualFileSystem.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosFileTransfer/doc/src/Makefile b/lib/cosFileTransfer/doc/src/Makefile
index 96cb983ff2..8d8c736f1b 100644
--- a/lib/cosFileTransfer/doc/src/Makefile
+++ b/lib/cosFileTransfer/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosFileTransfer/doc/src/book.xml b/lib/cosFileTransfer/doc/src/book.xml
index c6b8e05b33..9a9ec3d0a2 100644
--- a/lib/cosFileTransfer/doc/src/book.xml
+++ b/lib/cosFileTransfer/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosFileTransfer/doc/src/ch_contents.xml b/lib/cosFileTransfer/doc/src/ch_contents.xml
index 79b39308ab..bd4ed5116f 100644
--- a/lib/cosFileTransfer/doc/src/ch_contents.xml
+++ b/lib/cosFileTransfer/doc/src/ch_contents.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosFileTransfer/doc/src/ch_example.xml b/lib/cosFileTransfer/doc/src/ch_example.xml
index 79e47d73f4..7e3c65eedd 100644
--- a/lib/cosFileTransfer/doc/src/ch_example.xml
+++ b/lib/cosFileTransfer/doc/src/ch_example.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosFileTransfer/doc/src/ch_install.xml b/lib/cosFileTransfer/doc/src/ch_install.xml
index 260fb14d65..9681f98b45 100644
--- a/lib/cosFileTransfer/doc/src/ch_install.xml
+++ b/lib/cosFileTransfer/doc/src/ch_install.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosFileTransfer/doc/src/ch_introduction.xml b/lib/cosFileTransfer/doc/src/ch_introduction.xml
index 24f64cfa49..67616b0a39 100644
--- a/lib/cosFileTransfer/doc/src/ch_introduction.xml
+++ b/lib/cosFileTransfer/doc/src/ch_introduction.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosFileTransfer/doc/src/ch_system.xml b/lib/cosFileTransfer/doc/src/ch_system.xml
index 18f4e84e56..377ec1fa49 100644
--- a/lib/cosFileTransfer/doc/src/ch_system.xml
+++ b/lib/cosFileTransfer/doc/src/ch_system.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosFileTransfer/doc/src/cosFileTransferApp.xml b/lib/cosFileTransfer/doc/src/cosFileTransferApp.xml
index b9c6ec8aad..ae7b4f1ec5 100644
--- a/lib/cosFileTransfer/doc/src/cosFileTransferApp.xml
+++ b/lib/cosFileTransfer/doc/src/cosFileTransferApp.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosFileTransfer/doc/src/notes.xml b/lib/cosFileTransfer/doc/src/notes.xml
index 9f5b7ae6e5..eacc75062b 100644
--- a/lib/cosFileTransfer/doc/src/notes.xml
+++ b/lib/cosFileTransfer/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosFileTransfer/doc/src/part.xml b/lib/cosFileTransfer/doc/src/part.xml
index 22fa434c08..b4e6f573dd 100644
--- a/lib/cosFileTransfer/doc/src/part.xml
+++ b/lib/cosFileTransfer/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosFileTransfer/doc/src/part_notes.xml b/lib/cosFileTransfer/doc/src/part_notes.xml
index 6d383099c2..d91de39b1f 100644
--- a/lib/cosFileTransfer/doc/src/part_notes.xml
+++ b/lib/cosFileTransfer/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosFileTransfer/doc/src/ref_man.xml b/lib/cosFileTransfer/doc/src/ref_man.xml
index 884ba809b9..ce050128e6 100644
--- a/lib/cosFileTransfer/doc/src/ref_man.xml
+++ b/lib/cosFileTransfer/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosFileTransfer/src/CosFileTransfer_Directory_impl.erl b/lib/cosFileTransfer/src/CosFileTransfer_Directory_impl.erl
index a63cad4c6d..8ce6cebf77 100644
--- a/lib/cosFileTransfer/src/CosFileTransfer_Directory_impl.erl
+++ b/lib/cosFileTransfer/src/CosFileTransfer_Directory_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosFileTransfer/src/CosFileTransfer_FileIterator_impl.erl b/lib/cosFileTransfer/src/CosFileTransfer_FileIterator_impl.erl
index 93890629bf..d824129147 100644
--- a/lib/cosFileTransfer/src/CosFileTransfer_FileIterator_impl.erl
+++ b/lib/cosFileTransfer/src/CosFileTransfer_FileIterator_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosFileTransfer/src/CosFileTransfer_FileTransferSession_impl.erl b/lib/cosFileTransfer/src/CosFileTransfer_FileTransferSession_impl.erl
index 01281f8056..3a8285f092 100644
--- a/lib/cosFileTransfer/src/CosFileTransfer_FileTransferSession_impl.erl
+++ b/lib/cosFileTransfer/src/CosFileTransfer_FileTransferSession_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosFileTransfer/src/CosFileTransfer_File_impl.erl b/lib/cosFileTransfer/src/CosFileTransfer_File_impl.erl
index b87583976c..263255413e 100644
--- a/lib/cosFileTransfer/src/CosFileTransfer_File_impl.erl
+++ b/lib/cosFileTransfer/src/CosFileTransfer_File_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosFileTransfer/src/CosFileTransfer_VirtualFileSystem_impl.erl b/lib/cosFileTransfer/src/CosFileTransfer_VirtualFileSystem_impl.erl
index 919aa3f2ad..7440498a23 100644
--- a/lib/cosFileTransfer/src/CosFileTransfer_VirtualFileSystem_impl.erl
+++ b/lib/cosFileTransfer/src/CosFileTransfer_VirtualFileSystem_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosFileTransfer/src/Makefile b/lib/cosFileTransfer/src/Makefile
index f9107ff48f..b3967101e9 100644
--- a/lib/cosFileTransfer/src/Makefile
+++ b/lib/cosFileTransfer/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosFileTransfer/src/cosFileTransferApp.hrl b/lib/cosFileTransfer/src/cosFileTransferApp.hrl
index 97ef8a2bde..037be7a4af 100644
--- a/lib/cosFileTransfer/src/cosFileTransferApp.hrl
+++ b/lib/cosFileTransfer/src/cosFileTransferApp.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosFileTransfer/src/cosFileTransferNATIVE_file.erl b/lib/cosFileTransfer/src/cosFileTransferNATIVE_file.erl
index 0a374749ff..2969e61a2b 100644
--- a/lib/cosFileTransfer/src/cosFileTransferNATIVE_file.erl
+++ b/lib/cosFileTransfer/src/cosFileTransferNATIVE_file.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosFileTransfer/test/Makefile b/lib/cosFileTransfer/test/Makefile
index 332f90cb39..45c67a95dd 100644
--- a/lib/cosFileTransfer/test/Makefile
+++ b/lib/cosFileTransfer/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl
index 173cf71e61..7ca6eaf7b3 100644
--- a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl
+++ b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/Makefile b/lib/cosNotification/Makefile
index e04a837483..0408417a3b 100644
--- a/lib/cosNotification/Makefile
+++ b/lib/cosNotification/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/doc/src/CosNotification.xml b/lib/cosNotification/doc/src/CosNotification.xml
index 8c89b8830f..6aac312d5e 100644
--- a/lib/cosNotification/doc/src/CosNotification.xml
+++ b/lib/cosNotification/doc/src/CosNotification.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2002</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotification_AdminPropertiesAdmin.xml b/lib/cosNotification/doc/src/CosNotification_AdminPropertiesAdmin.xml
index f5ffd4cdf1..6086402f1a 100644
--- a/lib/cosNotification/doc/src/CosNotification_AdminPropertiesAdmin.xml
+++ b/lib/cosNotification/doc/src/CosNotification_AdminPropertiesAdmin.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotification_QoSAdmin.xml b/lib/cosNotification/doc/src/CosNotification_QoSAdmin.xml
index 034c86fb9f..7774652e60 100644
--- a/lib/cosNotification/doc/src/CosNotification_QoSAdmin.xml
+++ b/lib/cosNotification/doc/src/CosNotification_QoSAdmin.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ConsumerAdmin.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ConsumerAdmin.xml
index b06ddcc61e..cbe22ce7cd 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ConsumerAdmin.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ConsumerAdmin.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_EventChannel.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_EventChannel.xml
index 4bd3e7bd30..7696e6a26c 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_EventChannel.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_EventChannel.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_EventChannelFactory.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_EventChannelFactory.xml
index 7f9e980433..552ea182c0 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_EventChannelFactory.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_EventChannelFactory.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyConsumer.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyConsumer.xml
index f0367c2d10..3d61893162 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyConsumer.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyConsumer.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPullConsumer.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPullConsumer.xml
index df93aade22..caf572dee8 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPullConsumer.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPullConsumer.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPullSupplier.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPullSupplier.xml
index 9305b4aed1..42aaaec319 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPullSupplier.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPullSupplier.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPushConsumer.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPushConsumer.xml
index e9dea15bcc..9808b460c7 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPushConsumer.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPushConsumer.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPushSupplier.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPushSupplier.xml
index 9333c89cd0..6f85de114a 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPushSupplier.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxyPushSupplier.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxySupplier.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxySupplier.xml
index 1638d1192e..69013fdb1e 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxySupplier.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_ProxySupplier.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPullConsumer.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPullConsumer.xml
index 1cbb5ec491..043472df55 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPullConsumer.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPullConsumer.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPullSupplier.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPullSupplier.xml
index d367736a62..a0040a50d7 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPullSupplier.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPullSupplier.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPushConsumer.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPushConsumer.xml
index db6d273dd1..efec1f99cc 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPushConsumer.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPushConsumer.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPushSupplier.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPushSupplier.xml
index 9d0f1ee3fa..229d3667c5 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPushSupplier.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SequenceProxyPushSupplier.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPullConsumer.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPullConsumer.xml
index cf9d97e2d0..5a86cb84da 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPullConsumer.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPullConsumer.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPullSupplier.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPullSupplier.xml
index 0b56d1b7af..1ca7c2d7df 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPullSupplier.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPullSupplier.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPushConsumer.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPushConsumer.xml
index ecbcc08e63..63bcdf120c 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPushConsumer.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPushConsumer.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPushSupplier.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPushSupplier.xml
index 2e9d925d0d..9ba5497fd8 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPushSupplier.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_StructuredProxyPushSupplier.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SupplierAdmin.xml b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SupplierAdmin.xml
index 4b6bc29aba..540edaff3f 100644
--- a/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SupplierAdmin.xml
+++ b/lib/cosNotification/doc/src/CosNotifyChannelAdmin_SupplierAdmin.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyComm_NotifyPublish.xml b/lib/cosNotification/doc/src/CosNotifyComm_NotifyPublish.xml
index 7c128cf102..a41319cb5c 100644
--- a/lib/cosNotification/doc/src/CosNotifyComm_NotifyPublish.xml
+++ b/lib/cosNotification/doc/src/CosNotifyComm_NotifyPublish.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyComm_NotifySubscribe.xml b/lib/cosNotification/doc/src/CosNotifyComm_NotifySubscribe.xml
index fd8cba1f2d..277c666459 100644
--- a/lib/cosNotification/doc/src/CosNotifyComm_NotifySubscribe.xml
+++ b/lib/cosNotification/doc/src/CosNotifyComm_NotifySubscribe.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyFilter_Filter.xml b/lib/cosNotification/doc/src/CosNotifyFilter_Filter.xml
index 7dc522d4a5..a953540849 100644
--- a/lib/cosNotification/doc/src/CosNotifyFilter_Filter.xml
+++ b/lib/cosNotification/doc/src/CosNotifyFilter_Filter.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyFilter_FilterAdmin.xml b/lib/cosNotification/doc/src/CosNotifyFilter_FilterAdmin.xml
index 32467ed07e..5cb56963f1 100644
--- a/lib/cosNotification/doc/src/CosNotifyFilter_FilterAdmin.xml
+++ b/lib/cosNotification/doc/src/CosNotifyFilter_FilterAdmin.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyFilter_FilterFactory.xml b/lib/cosNotification/doc/src/CosNotifyFilter_FilterFactory.xml
index c4294572df..adacbc3281 100644
--- a/lib/cosNotification/doc/src/CosNotifyFilter_FilterFactory.xml
+++ b/lib/cosNotification/doc/src/CosNotifyFilter_FilterFactory.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/CosNotifyFilter_MappingFilter.xml b/lib/cosNotification/doc/src/CosNotifyFilter_MappingFilter.xml
index 6fa16dc363..c0db8c1ae0 100644
--- a/lib/cosNotification/doc/src/CosNotifyFilter_MappingFilter.xml
+++ b/lib/cosNotification/doc/src/CosNotifyFilter_MappingFilter.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/Makefile b/lib/cosNotification/doc/src/Makefile
index d0d3ec6bdf..6207290101 100644
--- a/lib/cosNotification/doc/src/Makefile
+++ b/lib/cosNotification/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/doc/src/book.xml b/lib/cosNotification/doc/src/book.xml
index 80515f9654..3151abceaa 100644
--- a/lib/cosNotification/doc/src/book.xml
+++ b/lib/cosNotification/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/ch_BNF.xml b/lib/cosNotification/doc/src/ch_BNF.xml
index b9f411d34f..9763c0c4ca 100644
--- a/lib/cosNotification/doc/src/ch_BNF.xml
+++ b/lib/cosNotification/doc/src/ch_BNF.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/ch_QoS.xml b/lib/cosNotification/doc/src/ch_QoS.xml
index 147761d37a..7f7a26f69a 100644
--- a/lib/cosNotification/doc/src/ch_QoS.xml
+++ b/lib/cosNotification/doc/src/ch_QoS.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/ch_contents.xml b/lib/cosNotification/doc/src/ch_contents.xml
index bfa2cebb07..11014f693b 100644
--- a/lib/cosNotification/doc/src/ch_contents.xml
+++ b/lib/cosNotification/doc/src/ch_contents.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/ch_example.xml b/lib/cosNotification/doc/src/ch_example.xml
index 2d368730d3..a86aaccc82 100644
--- a/lib/cosNotification/doc/src/ch_example.xml
+++ b/lib/cosNotification/doc/src/ch_example.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/ch_install.xml b/lib/cosNotification/doc/src/ch_install.xml
index 41e9461d20..c76c68cb42 100644
--- a/lib/cosNotification/doc/src/ch_install.xml
+++ b/lib/cosNotification/doc/src/ch_install.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/ch_introduction.xml b/lib/cosNotification/doc/src/ch_introduction.xml
index fcd15fd2bc..39cd12f1e6 100644
--- a/lib/cosNotification/doc/src/ch_introduction.xml
+++ b/lib/cosNotification/doc/src/ch_introduction.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/ch_system.xml b/lib/cosNotification/doc/src/ch_system.xml
index a9a444afdc..91375088a0 100644
--- a/lib/cosNotification/doc/src/ch_system.xml
+++ b/lib/cosNotification/doc/src/ch_system.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/cosNotificationApp.xml b/lib/cosNotification/doc/src/cosNotificationApp.xml
index e2f7f2f2f2..4f662a5dc4 100644
--- a/lib/cosNotification/doc/src/cosNotificationApp.xml
+++ b/lib/cosNotification/doc/src/cosNotificationApp.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/notes.xml b/lib/cosNotification/doc/src/notes.xml
index f896d219b5..3f3f0be3e7 100644
--- a/lib/cosNotification/doc/src/notes.xml
+++ b/lib/cosNotification/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/part.xml b/lib/cosNotification/doc/src/part.xml
index 2f3d45e63d..9cc5a8a95a 100644
--- a/lib/cosNotification/doc/src/part.xml
+++ b/lib/cosNotification/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/part_notes.xml b/lib/cosNotification/doc/src/part_notes.xml
index 22ede75ca1..c999d885c1 100644
--- a/lib/cosNotification/doc/src/part_notes.xml
+++ b/lib/cosNotification/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/doc/src/ref_man.xml b/lib/cosNotification/doc/src/ref_man.xml
index 65197fac37..58fb4febd2 100644
--- a/lib/cosNotification/doc/src/ref_man.xml
+++ b/lib/cosNotification/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosNotification/src/CosNotifyChannelAdmin_ConsumerAdmin_impl.erl b/lib/cosNotification/src/CosNotifyChannelAdmin_ConsumerAdmin_impl.erl
index c7cecd87d4..e7a6a35ea7 100644
--- a/lib/cosNotification/src/CosNotifyChannelAdmin_ConsumerAdmin_impl.erl
+++ b/lib/cosNotification/src/CosNotifyChannelAdmin_ConsumerAdmin_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/src/CosNotifyChannelAdmin_EventChannelFactory_impl.erl b/lib/cosNotification/src/CosNotifyChannelAdmin_EventChannelFactory_impl.erl
index ea09e7ff82..eb3fb4a6a3 100644
--- a/lib/cosNotification/src/CosNotifyChannelAdmin_EventChannelFactory_impl.erl
+++ b/lib/cosNotification/src/CosNotifyChannelAdmin_EventChannelFactory_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/src/CosNotifyChannelAdmin_EventChannel_impl.erl b/lib/cosNotification/src/CosNotifyChannelAdmin_EventChannel_impl.erl
index 064c356171..485c9aeef4 100644
--- a/lib/cosNotification/src/CosNotifyChannelAdmin_EventChannel_impl.erl
+++ b/lib/cosNotification/src/CosNotifyChannelAdmin_EventChannel_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/src/CosNotifyChannelAdmin_SupplierAdmin_impl.erl b/lib/cosNotification/src/CosNotifyChannelAdmin_SupplierAdmin_impl.erl
index f85f52e9df..2810bef93d 100644
--- a/lib/cosNotification/src/CosNotifyChannelAdmin_SupplierAdmin_impl.erl
+++ b/lib/cosNotification/src/CosNotifyChannelAdmin_SupplierAdmin_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/src/CosNotifyFilter_FilterFactory_impl.erl b/lib/cosNotification/src/CosNotifyFilter_FilterFactory_impl.erl
index bb82eee525..760dcf40b8 100644
--- a/lib/cosNotification/src/CosNotifyFilter_FilterFactory_impl.erl
+++ b/lib/cosNotification/src/CosNotifyFilter_FilterFactory_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/src/Makefile b/lib/cosNotification/src/Makefile
index 72b063fd1c..009c6be4a5 100644
--- a/lib/cosNotification/src/Makefile
+++ b/lib/cosNotification/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/src/PullerConsumer_impl.erl b/lib/cosNotification/src/PullerConsumer_impl.erl
index 3f8ec5c7c5..52bd13918f 100644
--- a/lib/cosNotification/src/PullerConsumer_impl.erl
+++ b/lib/cosNotification/src/PullerConsumer_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/src/PusherConsumer_impl.erl b/lib/cosNotification/src/PusherConsumer_impl.erl
index c99c7ea434..f82f9d8bbd 100644
--- a/lib/cosNotification/src/PusherConsumer_impl.erl
+++ b/lib/cosNotification/src/PusherConsumer_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/src/PusherSupplier_impl.erl b/lib/cosNotification/src/PusherSupplier_impl.erl
index df0b5b77b3..d3e44f3ef9 100644
--- a/lib/cosNotification/src/PusherSupplier_impl.erl
+++ b/lib/cosNotification/src/PusherSupplier_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/src/cosNotification_Filter.erl b/lib/cosNotification/src/cosNotification_Filter.erl
index 40e7cf02ae..a92c9b8d41 100644
--- a/lib/cosNotification/src/cosNotification_Filter.erl
+++ b/lib/cosNotification/src/cosNotification_Filter.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/src/cosNotification_Grammar.yrl b/lib/cosNotification/src/cosNotification_Grammar.yrl
index 2650efcdfe..f4a42d022e 100644
--- a/lib/cosNotification/src/cosNotification_Grammar.yrl
+++ b/lib/cosNotification/src/cosNotification_Grammar.yrl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/src/cosNotification_Scanner.erl b/lib/cosNotification/src/cosNotification_Scanner.erl
index e79f0380b0..31f27a8d78 100644
--- a/lib/cosNotification/src/cosNotification_Scanner.erl
+++ b/lib/cosNotification/src/cosNotification_Scanner.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/test/Makefile b/lib/cosNotification/test/Makefile
index 5a4c5e18aa..583cca1f42 100644
--- a/lib/cosNotification/test/Makefile
+++ b/lib/cosNotification/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/test/eventDB_SUITE.erl b/lib/cosNotification/test/eventDB_SUITE.erl
index 2d095adfae..337c7effed 100644
--- a/lib/cosNotification/test/eventDB_SUITE.erl
+++ b/lib/cosNotification/test/eventDB_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/test/generated_SUITE.erl b/lib/cosNotification/test/generated_SUITE.erl
index 8e29989e30..810a007672 100644
--- a/lib/cosNotification/test/generated_SUITE.erl
+++ b/lib/cosNotification/test/generated_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/test/grammar_SUITE.erl b/lib/cosNotification/test/grammar_SUITE.erl
index b17ddba1c4..34b832327d 100644
--- a/lib/cosNotification/test/grammar_SUITE.erl
+++ b/lib/cosNotification/test/grammar_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/test/notification_SUITE.erl b/lib/cosNotification/test/notification_SUITE.erl
index 6824a2805f..f23dacce4f 100644
--- a/lib/cosNotification/test/notification_SUITE.erl
+++ b/lib/cosNotification/test/notification_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/test/notify_test_impl.erl b/lib/cosNotification/test/notify_test_impl.erl
index 76973db04b..6c833f4915 100644
--- a/lib/cosNotification/test/notify_test_impl.erl
+++ b/lib/cosNotification/test/notify_test_impl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/test/notify_test_server.cfg b/lib/cosNotification/test/notify_test_server.cfg
index 87ef97873c..60f50b23bb 100644
--- a/lib/cosNotification/test/notify_test_server.cfg
+++ b/lib/cosNotification/test/notify_test_server.cfg
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosNotification/test/notify_test_server.idl b/lib/cosNotification/test/notify_test_server.idl
index e7f3bccf4c..0334d67717 100644
--- a/lib/cosNotification/test/notify_test_server.idl
+++ b/lib/cosNotification/test/notify_test_server.idl
@@ -1,7 +1,7 @@
//
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1999-2010. All Rights Reserved.
+// Copyright Ericsson AB 1999-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/cosProperty/Makefile b/lib/cosProperty/Makefile
index da3718e99c..44d1aafade 100644
--- a/lib/cosProperty/Makefile
+++ b/lib/cosProperty/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2009. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosProperty/doc/src/CosPropertyService_PropertiesIterator.xml b/lib/cosProperty/doc/src/CosPropertyService_PropertiesIterator.xml
index 9f5b79ce08..62a1732e99 100644
--- a/lib/cosProperty/doc/src/CosPropertyService_PropertiesIterator.xml
+++ b/lib/cosProperty/doc/src/CosPropertyService_PropertiesIterator.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosProperty/doc/src/CosPropertyService_PropertyNamesIterator.xml b/lib/cosProperty/doc/src/CosPropertyService_PropertyNamesIterator.xml
index f95e98b1af..5948490547 100644
--- a/lib/cosProperty/doc/src/CosPropertyService_PropertyNamesIterator.xml
+++ b/lib/cosProperty/doc/src/CosPropertyService_PropertyNamesIterator.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosProperty/doc/src/CosPropertyService_PropertySet.xml b/lib/cosProperty/doc/src/CosPropertyService_PropertySet.xml
index 8a204d536c..8e7fbbd80a 100644
--- a/lib/cosProperty/doc/src/CosPropertyService_PropertySet.xml
+++ b/lib/cosProperty/doc/src/CosPropertyService_PropertySet.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosProperty/doc/src/CosPropertyService_PropertySetDef.xml b/lib/cosProperty/doc/src/CosPropertyService_PropertySetDef.xml
index 5c5000858f..2cbf2fc4f9 100644
--- a/lib/cosProperty/doc/src/CosPropertyService_PropertySetDef.xml
+++ b/lib/cosProperty/doc/src/CosPropertyService_PropertySetDef.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosProperty/doc/src/CosPropertyService_PropertySetDefFactory.xml b/lib/cosProperty/doc/src/CosPropertyService_PropertySetDefFactory.xml
index 39b2548f5d..d6425db9cf 100644
--- a/lib/cosProperty/doc/src/CosPropertyService_PropertySetDefFactory.xml
+++ b/lib/cosProperty/doc/src/CosPropertyService_PropertySetDefFactory.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosProperty/doc/src/CosPropertyService_PropertySetFactory.xml b/lib/cosProperty/doc/src/CosPropertyService_PropertySetFactory.xml
index a8e843ca95..0aa22dd716 100644
--- a/lib/cosProperty/doc/src/CosPropertyService_PropertySetFactory.xml
+++ b/lib/cosProperty/doc/src/CosPropertyService_PropertySetFactory.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosProperty/doc/src/Makefile b/lib/cosProperty/doc/src/Makefile
index 5fd117c01a..6b210500f9 100644
--- a/lib/cosProperty/doc/src/Makefile
+++ b/lib/cosProperty/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosProperty/doc/src/book.xml b/lib/cosProperty/doc/src/book.xml
index 4ed3c57edf..9ee681b057 100644
--- a/lib/cosProperty/doc/src/book.xml
+++ b/lib/cosProperty/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosProperty/doc/src/ch_contents.xml b/lib/cosProperty/doc/src/ch_contents.xml
index e054a2aa12..5c3112a644 100644
--- a/lib/cosProperty/doc/src/ch_contents.xml
+++ b/lib/cosProperty/doc/src/ch_contents.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosProperty/doc/src/ch_example.xml b/lib/cosProperty/doc/src/ch_example.xml
index f4e990b876..da13af2312 100644
--- a/lib/cosProperty/doc/src/ch_example.xml
+++ b/lib/cosProperty/doc/src/ch_example.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosProperty/doc/src/ch_install.xml b/lib/cosProperty/doc/src/ch_install.xml
index 9df82bc794..a1aa2914b4 100644
--- a/lib/cosProperty/doc/src/ch_install.xml
+++ b/lib/cosProperty/doc/src/ch_install.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosProperty/doc/src/ch_introduction.xml b/lib/cosProperty/doc/src/ch_introduction.xml
index 7e79e58f18..03ef6f619c 100644
--- a/lib/cosProperty/doc/src/ch_introduction.xml
+++ b/lib/cosProperty/doc/src/ch_introduction.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosProperty/doc/src/cosProperty.xml b/lib/cosProperty/doc/src/cosProperty.xml
index e0eaca4f1d..d9310b3113 100644
--- a/lib/cosProperty/doc/src/cosProperty.xml
+++ b/lib/cosProperty/doc/src/cosProperty.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosProperty/doc/src/notes.xml b/lib/cosProperty/doc/src/notes.xml
index fe6983c10f..4ec7eca94a 100644
--- a/lib/cosProperty/doc/src/notes.xml
+++ b/lib/cosProperty/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosProperty/doc/src/part.xml b/lib/cosProperty/doc/src/part.xml
index 6be119f0cc..9d28c6dda4 100644
--- a/lib/cosProperty/doc/src/part.xml
+++ b/lib/cosProperty/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosProperty/doc/src/part_notes.xml b/lib/cosProperty/doc/src/part_notes.xml
index 07af5dac14..bb3221e41c 100644
--- a/lib/cosProperty/doc/src/part_notes.xml
+++ b/lib/cosProperty/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosProperty/doc/src/ref_man.xml b/lib/cosProperty/doc/src/ref_man.xml
index 55502ecb9b..a315c0285f 100644
--- a/lib/cosProperty/doc/src/ref_man.xml
+++ b/lib/cosProperty/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosProperty/src/CosPropertyService_PropertiesIterator_impl.erl b/lib/cosProperty/src/CosPropertyService_PropertiesIterator_impl.erl
index 3c930ecc2c..5972e8f4d2 100644
--- a/lib/cosProperty/src/CosPropertyService_PropertiesIterator_impl.erl
+++ b/lib/cosProperty/src/CosPropertyService_PropertiesIterator_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosProperty/src/CosPropertyService_PropertyNamesIterator_impl.erl b/lib/cosProperty/src/CosPropertyService_PropertyNamesIterator_impl.erl
index 976ecda89f..7ce4f6b303 100644
--- a/lib/cosProperty/src/CosPropertyService_PropertyNamesIterator_impl.erl
+++ b/lib/cosProperty/src/CosPropertyService_PropertyNamesIterator_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosProperty/src/CosPropertyService_PropertySetDefFactory_impl.erl b/lib/cosProperty/src/CosPropertyService_PropertySetDefFactory_impl.erl
index 29093b8ad6..722bb45eb7 100644
--- a/lib/cosProperty/src/CosPropertyService_PropertySetDefFactory_impl.erl
+++ b/lib/cosProperty/src/CosPropertyService_PropertySetDefFactory_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosProperty/src/CosPropertyService_PropertySetFactory_impl.erl b/lib/cosProperty/src/CosPropertyService_PropertySetFactory_impl.erl
index 8b4b5a2769..bc6572b634 100644
--- a/lib/cosProperty/src/CosPropertyService_PropertySetFactory_impl.erl
+++ b/lib/cosProperty/src/CosPropertyService_PropertySetFactory_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosProperty/src/Makefile b/lib/cosProperty/src/Makefile
index cd559e168f..1fdc258a6d 100644
--- a/lib/cosProperty/src/Makefile
+++ b/lib/cosProperty/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosProperty/src/cosProperty.hrl b/lib/cosProperty/src/cosProperty.hrl
index 4bc71e5465..0225a43ebd 100644
--- a/lib/cosProperty/src/cosProperty.hrl
+++ b/lib/cosProperty/src/cosProperty.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosProperty/test/Makefile b/lib/cosProperty/test/Makefile
index b5e063129d..5f599c9621 100644
--- a/lib/cosProperty/test/Makefile
+++ b/lib/cosProperty/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosProperty/test/generated_SUITE.erl b/lib/cosProperty/test/generated_SUITE.erl
index 1789650cbd..8eb794bd8f 100644
--- a/lib/cosProperty/test/generated_SUITE.erl
+++ b/lib/cosProperty/test/generated_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosProperty/test/property_SUITE.erl b/lib/cosProperty/test/property_SUITE.erl
index ae508fa7b6..42ddf04038 100644
--- a/lib/cosProperty/test/property_SUITE.erl
+++ b/lib/cosProperty/test/property_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTime/Makefile b/lib/cosTime/Makefile
index 8f17b0249d..e1b0b27284 100644
--- a/lib/cosTime/Makefile
+++ b/lib/cosTime/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2009. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosTime/doc/src/CosTime_TIO.xml b/lib/cosTime/doc/src/CosTime_TIO.xml
index 622b2eaeaf..c01154a2c5 100644
--- a/lib/cosTime/doc/src/CosTime_TIO.xml
+++ b/lib/cosTime/doc/src/CosTime_TIO.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTime/doc/src/CosTime_TimeService.xml b/lib/cosTime/doc/src/CosTime_TimeService.xml
index 076eb2a73c..b578128277 100644
--- a/lib/cosTime/doc/src/CosTime_TimeService.xml
+++ b/lib/cosTime/doc/src/CosTime_TimeService.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTime/doc/src/CosTime_UTO.xml b/lib/cosTime/doc/src/CosTime_UTO.xml
index eb41a2133a..432d9d92f9 100644
--- a/lib/cosTime/doc/src/CosTime_UTO.xml
+++ b/lib/cosTime/doc/src/CosTime_UTO.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTime/doc/src/CosTimerEvent_TimerEventHandler.xml b/lib/cosTime/doc/src/CosTimerEvent_TimerEventHandler.xml
index d5b45f4280..4b43b0b12e 100644
--- a/lib/cosTime/doc/src/CosTimerEvent_TimerEventHandler.xml
+++ b/lib/cosTime/doc/src/CosTimerEvent_TimerEventHandler.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTime/doc/src/CosTimerEvent_TimerEventService.xml b/lib/cosTime/doc/src/CosTimerEvent_TimerEventService.xml
index 0620acd0af..1db4760c81 100644
--- a/lib/cosTime/doc/src/CosTimerEvent_TimerEventService.xml
+++ b/lib/cosTime/doc/src/CosTimerEvent_TimerEventService.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTime/doc/src/Makefile b/lib/cosTime/doc/src/Makefile
index ec2692e538..f3fdafa58a 100644
--- a/lib/cosTime/doc/src/Makefile
+++ b/lib/cosTime/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosTime/doc/src/book.xml b/lib/cosTime/doc/src/book.xml
index 93cf36acdf..a89b005e84 100644
--- a/lib/cosTime/doc/src/book.xml
+++ b/lib/cosTime/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTime/doc/src/ch_contents.xml b/lib/cosTime/doc/src/ch_contents.xml
index d016e3404a..8b1c9dd646 100644
--- a/lib/cosTime/doc/src/ch_contents.xml
+++ b/lib/cosTime/doc/src/ch_contents.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTime/doc/src/ch_example.xml b/lib/cosTime/doc/src/ch_example.xml
index efea0814c9..690fba8d93 100644
--- a/lib/cosTime/doc/src/ch_example.xml
+++ b/lib/cosTime/doc/src/ch_example.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTime/doc/src/ch_install.xml b/lib/cosTime/doc/src/ch_install.xml
index 982845ea6f..9d819a7be7 100644
--- a/lib/cosTime/doc/src/ch_install.xml
+++ b/lib/cosTime/doc/src/ch_install.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTime/doc/src/ch_introduction.xml b/lib/cosTime/doc/src/ch_introduction.xml
index c0c62e7b09..1a11606716 100644
--- a/lib/cosTime/doc/src/ch_introduction.xml
+++ b/lib/cosTime/doc/src/ch_introduction.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTime/doc/src/cosTime.xml b/lib/cosTime/doc/src/cosTime.xml
index f052191c03..02aef1401c 100644
--- a/lib/cosTime/doc/src/cosTime.xml
+++ b/lib/cosTime/doc/src/cosTime.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTime/doc/src/notes.xml b/lib/cosTime/doc/src/notes.xml
index bf75f7f617..62c1aa3c26 100644
--- a/lib/cosTime/doc/src/notes.xml
+++ b/lib/cosTime/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTime/doc/src/part.xml b/lib/cosTime/doc/src/part.xml
index 3a3e3fcf6e..f0b26d4a56 100644
--- a/lib/cosTime/doc/src/part.xml
+++ b/lib/cosTime/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTime/doc/src/part_notes.xml b/lib/cosTime/doc/src/part_notes.xml
index f441961b7c..dbc9185038 100644
--- a/lib/cosTime/doc/src/part_notes.xml
+++ b/lib/cosTime/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTime/doc/src/ref_man.xml b/lib/cosTime/doc/src/ref_man.xml
index be44a80b91..66bca4af0e 100644
--- a/lib/cosTime/doc/src/ref_man.xml
+++ b/lib/cosTime/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTime/src/CosTime_TIO_impl.erl b/lib/cosTime/src/CosTime_TIO_impl.erl
index 7dc3c743bd..6d4046d428 100644
--- a/lib/cosTime/src/CosTime_TIO_impl.erl
+++ b/lib/cosTime/src/CosTime_TIO_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTime/src/CosTime_UTO_impl.erl b/lib/cosTime/src/CosTime_UTO_impl.erl
index 9453881c65..09f3eb2fdb 100644
--- a/lib/cosTime/src/CosTime_UTO_impl.erl
+++ b/lib/cosTime/src/CosTime_UTO_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTime/src/CosTimerEvent_TimerEventHandler_impl.erl b/lib/cosTime/src/CosTimerEvent_TimerEventHandler_impl.erl
index 6ebcafef77..5bc751dfb1 100644
--- a/lib/cosTime/src/CosTimerEvent_TimerEventHandler_impl.erl
+++ b/lib/cosTime/src/CosTimerEvent_TimerEventHandler_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTime/src/CosTimerEvent_TimerEventService_impl.erl b/lib/cosTime/src/CosTimerEvent_TimerEventService_impl.erl
index fe9b2013b8..59552e4b1b 100644
--- a/lib/cosTime/src/CosTimerEvent_TimerEventService_impl.erl
+++ b/lib/cosTime/src/CosTimerEvent_TimerEventService_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTime/src/Makefile b/lib/cosTime/src/Makefile
index 7a14db6974..55d59baea3 100644
--- a/lib/cosTime/src/Makefile
+++ b/lib/cosTime/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosTime/src/cosTime.erl b/lib/cosTime/src/cosTime.erl
index afb611beff..a32e210a26 100644
--- a/lib/cosTime/src/cosTime.erl
+++ b/lib/cosTime/src/cosTime.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTime/src/cosTimeApp.hrl b/lib/cosTime/src/cosTimeApp.hrl
index 74c9bcca5d..7c084dc585 100644
--- a/lib/cosTime/src/cosTimeApp.hrl
+++ b/lib/cosTime/src/cosTimeApp.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTime/test/Makefile b/lib/cosTime/test/Makefile
index 003ea886a3..91d3eccf43 100644
--- a/lib/cosTime/test/Makefile
+++ b/lib/cosTime/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosTime/test/generated_SUITE.erl b/lib/cosTime/test/generated_SUITE.erl
index 03dffedc05..ea1362adef 100644
--- a/lib/cosTime/test/generated_SUITE.erl
+++ b/lib/cosTime/test/generated_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTime/test/time_SUITE.erl b/lib/cosTime/test/time_SUITE.erl
index 7213680b99..431b1d2d8a 100644
--- a/lib/cosTime/test/time_SUITE.erl
+++ b/lib/cosTime/test/time_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTransactions/Makefile b/lib/cosTransactions/Makefile
index 459fc8b271..e8d0d1c0cd 100644
--- a/lib/cosTransactions/Makefile
+++ b/lib/cosTransactions/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosTransactions/doc/src/CosTransactions_Control.xml b/lib/cosTransactions/doc/src/CosTransactions_Control.xml
index 2092ca42dd..bf5e25a701 100644
--- a/lib/cosTransactions/doc/src/CosTransactions_Control.xml
+++ b/lib/cosTransactions/doc/src/CosTransactions_Control.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1999</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/CosTransactions_Coordinator.xml b/lib/cosTransactions/doc/src/CosTransactions_Coordinator.xml
index 64b1f0dd0f..006ba4cc29 100644
--- a/lib/cosTransactions/doc/src/CosTransactions_Coordinator.xml
+++ b/lib/cosTransactions/doc/src/CosTransactions_Coordinator.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/CosTransactions_RecoveryCoordinator.xml b/lib/cosTransactions/doc/src/CosTransactions_RecoveryCoordinator.xml
index 5888f1ada9..2d61f815a3 100644
--- a/lib/cosTransactions/doc/src/CosTransactions_RecoveryCoordinator.xml
+++ b/lib/cosTransactions/doc/src/CosTransactions_RecoveryCoordinator.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/CosTransactions_Resource.xml b/lib/cosTransactions/doc/src/CosTransactions_Resource.xml
index 3e6e0eb7d6..40006b55d9 100644
--- a/lib/cosTransactions/doc/src/CosTransactions_Resource.xml
+++ b/lib/cosTransactions/doc/src/CosTransactions_Resource.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/CosTransactions_SubtransactionAwareResource.xml b/lib/cosTransactions/doc/src/CosTransactions_SubtransactionAwareResource.xml
index fec970db33..30102d18d9 100644
--- a/lib/cosTransactions/doc/src/CosTransactions_SubtransactionAwareResource.xml
+++ b/lib/cosTransactions/doc/src/CosTransactions_SubtransactionAwareResource.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/CosTransactions_Synchronization.xml b/lib/cosTransactions/doc/src/CosTransactions_Synchronization.xml
index 2181134086..c21e7c559d 100644
--- a/lib/cosTransactions/doc/src/CosTransactions_Synchronization.xml
+++ b/lib/cosTransactions/doc/src/CosTransactions_Synchronization.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1999</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/CosTransactions_Terminator.xml b/lib/cosTransactions/doc/src/CosTransactions_Terminator.xml
index ef92e327c5..f75f4d912d 100644
--- a/lib/cosTransactions/doc/src/CosTransactions_Terminator.xml
+++ b/lib/cosTransactions/doc/src/CosTransactions_Terminator.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1999</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/CosTransactions_TransactionFactory.xml b/lib/cosTransactions/doc/src/CosTransactions_TransactionFactory.xml
index 00919d3e5a..c4469ef850 100644
--- a/lib/cosTransactions/doc/src/CosTransactions_TransactionFactory.xml
+++ b/lib/cosTransactions/doc/src/CosTransactions_TransactionFactory.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1999</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/CosTransactions_TransactionalObject.xml b/lib/cosTransactions/doc/src/CosTransactions_TransactionalObject.xml
index f7db880f31..319da2bd16 100644
--- a/lib/cosTransactions/doc/src/CosTransactions_TransactionalObject.xml
+++ b/lib/cosTransactions/doc/src/CosTransactions_TransactionalObject.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/Makefile b/lib/cosTransactions/doc/src/Makefile
index 4aaba44f96..b70d7647b1 100644
--- a/lib/cosTransactions/doc/src/Makefile
+++ b/lib/cosTransactions/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosTransactions/doc/src/book.xml b/lib/cosTransactions/doc/src/book.xml
index 723c5199cb..33a8c323bb 100644
--- a/lib/cosTransactions/doc/src/book.xml
+++ b/lib/cosTransactions/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/ch_contents.xml b/lib/cosTransactions/doc/src/ch_contents.xml
index d8d9395e65..9b2832a032 100644
--- a/lib/cosTransactions/doc/src/ch_contents.xml
+++ b/lib/cosTransactions/doc/src/ch_contents.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/ch_example.xml b/lib/cosTransactions/doc/src/ch_example.xml
index 6e1ec1d600..a2451e5fbc 100644
--- a/lib/cosTransactions/doc/src/ch_example.xml
+++ b/lib/cosTransactions/doc/src/ch_example.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/ch_install.xml b/lib/cosTransactions/doc/src/ch_install.xml
index 2b518c8678..4270c320b5 100644
--- a/lib/cosTransactions/doc/src/ch_install.xml
+++ b/lib/cosTransactions/doc/src/ch_install.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/ch_introduction.xml b/lib/cosTransactions/doc/src/ch_introduction.xml
index e1fade751c..43d25360bc 100644
--- a/lib/cosTransactions/doc/src/ch_introduction.xml
+++ b/lib/cosTransactions/doc/src/ch_introduction.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/ch_skeletons.xml b/lib/cosTransactions/doc/src/ch_skeletons.xml
index 8c7e07ed59..e101cff5da 100644
--- a/lib/cosTransactions/doc/src/ch_skeletons.xml
+++ b/lib/cosTransactions/doc/src/ch_skeletons.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/cosTransactions.xml b/lib/cosTransactions/doc/src/cosTransactions.xml
index e0adb7fead..772baaf18a 100644
--- a/lib/cosTransactions/doc/src/cosTransactions.xml
+++ b/lib/cosTransactions/doc/src/cosTransactions.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1999</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/notes.xml b/lib/cosTransactions/doc/src/notes.xml
index 76d14962b7..b681330391 100644
--- a/lib/cosTransactions/doc/src/notes.xml
+++ b/lib/cosTransactions/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/part.xml b/lib/cosTransactions/doc/src/part.xml
index 934b27311d..6777d7d979 100644
--- a/lib/cosTransactions/doc/src/part.xml
+++ b/lib/cosTransactions/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/part_notes.xml b/lib/cosTransactions/doc/src/part_notes.xml
index 05f98e653a..48cc04aa4c 100644
--- a/lib/cosTransactions/doc/src/part_notes.xml
+++ b/lib/cosTransactions/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/doc/src/ref_man.xml b/lib/cosTransactions/doc/src/ref_man.xml
index bcc489ed0f..9d296967b3 100644
--- a/lib/cosTransactions/doc/src/ref_man.xml
+++ b/lib/cosTransactions/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/cosTransactions/examples/Makefile b/lib/cosTransactions/examples/Makefile
index 1289f4c845..57a51f5932 100644
--- a/lib/cosTransactions/examples/Makefile
+++ b/lib/cosTransactions/examples/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosTransactions/src/CosTransactions_Terminator_impl.erl b/lib/cosTransactions/src/CosTransactions_Terminator_impl.erl
index 9b8a0d93e2..d995eb64e4 100644
--- a/lib/cosTransactions/src/CosTransactions_Terminator_impl.erl
+++ b/lib/cosTransactions/src/CosTransactions_Terminator_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTransactions/src/ETraP_Common.hrl b/lib/cosTransactions/src/ETraP_Common.hrl
index 971aef669a..906e984a5b 100644
--- a/lib/cosTransactions/src/ETraP_Common.hrl
+++ b/lib/cosTransactions/src/ETraP_Common.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTransactions/src/Makefile b/lib/cosTransactions/src/Makefile
index 90e1e5130f..4cc1e487c2 100644
--- a/lib/cosTransactions/src/Makefile
+++ b/lib/cosTransactions/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosTransactions/src/cosTransactions.erl b/lib/cosTransactions/src/cosTransactions.erl
index 6284b8abd1..60e5fff46d 100644
--- a/lib/cosTransactions/src/cosTransactions.erl
+++ b/lib/cosTransactions/src/cosTransactions.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTransactions/src/etrap_logmgr.erl b/lib/cosTransactions/src/etrap_logmgr.erl
index 188cc27d35..a5d9affe7d 100644
--- a/lib/cosTransactions/src/etrap_logmgr.erl
+++ b/lib/cosTransactions/src/etrap_logmgr.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTransactions/test/Makefile b/lib/cosTransactions/test/Makefile
index 9bcd461f04..58199248d1 100644
--- a/lib/cosTransactions/test/Makefile
+++ b/lib/cosTransactions/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/cosTransactions/test/etrap_test.cfg b/lib/cosTransactions/test/etrap_test.cfg
index a047a6fb1b..a2bc7d3fb7 100644
--- a/lib/cosTransactions/test/etrap_test.cfg
+++ b/lib/cosTransactions/test/etrap_test.cfg
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTransactions/test/etrap_test.idl b/lib/cosTransactions/test/etrap_test.idl
index 6b1dbbc8f8..7379115be7 100644
--- a/lib/cosTransactions/test/etrap_test.idl
+++ b/lib/cosTransactions/test/etrap_test.idl
@@ -1,7 +1,7 @@
//
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1999-2010. All Rights Reserved.
+// Copyright Ericsson AB 1999-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/cosTransactions/test/etrap_test_lib.erl b/lib/cosTransactions/test/etrap_test_lib.erl
index 9774222531..e8d8c3a429 100644
--- a/lib/cosTransactions/test/etrap_test_lib.erl
+++ b/lib/cosTransactions/test/etrap_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTransactions/test/etrap_test_lib.hrl b/lib/cosTransactions/test/etrap_test_lib.hrl
index 01e507d5ac..6fe61a4d45 100644
--- a/lib/cosTransactions/test/etrap_test_lib.hrl
+++ b/lib/cosTransactions/test/etrap_test_lib.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTransactions/test/etrap_test_server_impl.erl b/lib/cosTransactions/test/etrap_test_server_impl.erl
index e5d360808f..8a244b42c7 100644
--- a/lib/cosTransactions/test/etrap_test_server_impl.erl
+++ b/lib/cosTransactions/test/etrap_test_server_impl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTransactions/test/generated_SUITE.erl b/lib/cosTransactions/test/generated_SUITE.erl
index c4bd86a892..e4a7a5bf27 100644
--- a/lib/cosTransactions/test/generated_SUITE.erl
+++ b/lib/cosTransactions/test/generated_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/cosTransactions/test/transactions_SUITE.erl b/lib/cosTransactions/test/transactions_SUITE.erl
index 63ec04f74f..0d270c1f07 100644
--- a/lib/cosTransactions/test/transactions_SUITE.erl
+++ b/lib/cosTransactions/test/transactions_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/crypto/Makefile b/lib/crypto/Makefile
index fbf108c410..afe56aa7d6 100644
--- a/lib/crypto/Makefile
+++ b/lib/crypto/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/crypto/c_src/Makefile.in b/lib/crypto/c_src/Makefile.in
index e7f750b60a..c62f25b3ee 100644
--- a/lib/crypto/c_src/Makefile.in
+++ b/lib/crypto/c_src/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c
index d1f620d892..067e220863 100644
--- a/lib/crypto/c_src/crypto.c
+++ b/lib/crypto/c_src/crypto.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -214,7 +214,6 @@ static ERL_NIF_TERM aes_ctr_stream_init(ErlNifEnv* env, int argc, const ERL_NIF_
static ERL_NIF_TERM aes_ctr_stream_encrypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM rand_bytes_1(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM strong_rand_bytes_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
-static ERL_NIF_TERM rand_bytes_3(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM strong_rand_mpint_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM rand_uniform_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM mod_exp_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
@@ -285,7 +284,6 @@ static ErlNifFunc nif_funcs[] = {
{"aes_ctr_stream_decrypt", 2, aes_ctr_stream_encrypt},
{"rand_bytes", 1, rand_bytes_1},
{"strong_rand_bytes_nif", 1, strong_rand_bytes_nif},
- {"rand_bytes", 3, rand_bytes_3},
{"strong_rand_mpint_nif", 3, strong_rand_mpint_nif},
{"rand_uniform_nif", 2, rand_uniform_nif},
{"mod_exp_nif", 4, mod_exp_nif},
@@ -314,7 +312,7 @@ static ErlNifFunc nif_funcs[] = {
{"rand_seed_nif", 1, rand_seed_nif},
- {"aes_gcm_encrypt", 4, aes_gcm_encrypt},
+ {"aes_gcm_encrypt", 5, aes_gcm_encrypt},
{"aes_gcm_decrypt", 5, aes_gcm_decrypt},
{"chacha20_poly1305_encrypt", 4, chacha20_poly1305_encrypt},
@@ -378,86 +376,96 @@ struct hmac_context
static void hmac_context_dtor(ErlNifEnv* env, struct hmac_context*);
struct digest_type_t {
- const char* type_str;
- const EVP_MD* (*md_func)(void); /* NULL if notsup */
- ERL_NIF_TERM type_atom;
+ union {
+ const char* str; /* before init, NULL for end-of-table */
+ ERL_NIF_TERM atom; /* after init, 'false' for end-of-table */
+ }type;
+ union {
+ const EVP_MD* (*funcp)(void); /* before init, NULL if notsup */
+ const EVP_MD* p; /* after init, NULL if notsup */
+ }md;
};
struct digest_type_t digest_types[] =
{
- {"md4", &EVP_md4},
- {"md5", &EVP_md5},
- {"ripemd160", &EVP_ripemd160},
- {"sha", &EVP_sha1},
- {"sha224",
+ {{"md4"}, {&EVP_md4}},
+ {{"md5"}, {&EVP_md5}},
+ {{"ripemd160"}, {&EVP_ripemd160}},
+ {{"sha"}, {&EVP_sha1}},
+ {{"sha224"},
#ifdef HAVE_SHA224
- &EVP_sha224
+ {&EVP_sha224}
#else
- NULL
+ {NULL}
#endif
},
- {"sha256",
+ {{"sha256"},
#ifdef HAVE_SHA256
- &EVP_sha256
+ {&EVP_sha256}
#else
- NULL
+ {NULL}
#endif
},
- {"sha384",
+ {{"sha384"},
#ifdef HAVE_SHA384
- &EVP_sha384
+ {&EVP_sha384}
#else
- NULL
+ {NULL}
#endif
},
- {"sha512",
+ {{"sha512"},
#ifdef HAVE_SHA512
- &EVP_sha512
+ {&EVP_sha512}
#else
- NULL
+ {NULL}
#endif
},
- {NULL}
+ {{NULL}}
};
static struct digest_type_t* get_digest_type(ERL_NIF_TERM type);
struct cipher_type_t {
- const char* type_str;
- const EVP_CIPHER* (*cipher_func)(void); /* NULL if notsup */
+ union {
+ const char* str; /* before init */
+ ERL_NIF_TERM atom; /* after init */
+ }type;
+ union {
+ const EVP_CIPHER* (*funcp)(void); /* before init, NULL if notsup */
+ const EVP_CIPHER* p; /* after init, NULL if notsup */
+ }cipher;
const size_t key_len; /* != 0 to also match on key_len */
- ERL_NIF_TERM type_atom;
};
struct cipher_type_t cipher_types[] =
{
- {"rc2_cbc", &EVP_rc2_cbc},
- {"des_cbc", &EVP_des_cbc},
- {"des_cfb", &EVP_des_cfb8},
- {"des_ecb", &EVP_des_ecb},
- {"des_ede3_cbc", &EVP_des_ede3_cbc},
- {"des_ede3_cbf",
+ {{"rc2_cbc"}, {&EVP_rc2_cbc}},
+ {{"des_cbc"}, {&EVP_des_cbc}},
+ {{"des_cfb"}, {&EVP_des_cfb8}},
+ {{"des_ecb"}, {&EVP_des_ecb}},
+ {{"des_ede3_cbc"}, {&EVP_des_ede3_cbc}},
+ {{"des_ede3_cbf"},
#ifdef HAVE_DES_ede3_cfb_encrypt
- &EVP_des_ede3_cfb8
+ {&EVP_des_ede3_cfb8}
#else
- NULL
+ {NULL}
#endif
},
- {"blowfish_cbc", &EVP_bf_cbc},
- {"blowfish_cfb64", &EVP_bf_cfb64},
- {"blowfish_ofb64", &EVP_bf_ofb},
- {"blowfish_ecb", &EVP_bf_ecb},
- {"aes_cbc", &EVP_aes_128_cbc, 16},
- {"aes_cbc", &EVP_aes_192_cbc, 24},
- {"aes_cbc", &EVP_aes_256_cbc, 32},
- {"aes_cbc128", &EVP_aes_128_cbc},
- {"aes_cbc256", &EVP_aes_256_cbc},
- {"aes_cfb8", &EVP_aes_128_cfb8},
- {"aes_cfb128", &EVP_aes_128_cfb128},
- {"aes_ecb", &EVP_aes_128_ecb, 16},
- {"aes_ecb", &EVP_aes_192_ecb, 24},
- {"aes_ecb", &EVP_aes_256_ecb, 32},
- {NULL}
+ {{"blowfish_cbc"}, {&EVP_bf_cbc}},
+ {{"blowfish_cfb64"}, {&EVP_bf_cfb64}},
+ {{"blowfish_ofb64"}, {&EVP_bf_ofb}},
+ {{"blowfish_ecb"}, {&EVP_bf_ecb}},
+ {{"aes_cbc"}, {&EVP_aes_128_cbc}, 16},
+ {{"aes_cbc"}, {&EVP_aes_192_cbc}, 24},
+ {{"aes_cbc"}, {&EVP_aes_256_cbc}, 32},
+ {{"aes_cbc128"}, {&EVP_aes_128_cbc}},
+ {{"aes_cbc256"}, {&EVP_aes_256_cbc}},
+ {{"aes_cfb8"}, {&EVP_aes_128_cfb8}},
+ {{"aes_cfb128"}, {&EVP_aes_128_cfb128}},
+ {{"aes_ecb"}, {&EVP_aes_128_ecb}, 16},
+ {{"aes_ecb"}, {&EVP_aes_192_ecb}, 24},
+ {{"aes_ecb"}, {&EVP_aes_256_ecb}, 32},
+ {{NULL}}
};
static struct cipher_type_t* get_cipher_type(ERL_NIF_TERM type, size_t key_len);
@@ -829,6 +837,15 @@ static ERL_NIF_TERM info_lib(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]
ver_term));
}
+static ERL_NIF_TERM make_badarg_maybe(ErlNifEnv* env)
+{
+ ERL_NIF_TERM reason;
+ if (enif_has_pending_exception(env, &reason))
+ return reason; /* dummy return value ignored */
+ else
+ return enif_make_badarg(env);
+}
+
static ERL_NIF_TERM hash_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{/* (Type, Data) */
struct digest_type_t *digp = NULL;
@@ -842,11 +859,11 @@ static ERL_NIF_TERM hash_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]
!enif_inspect_iolist_as_binary(env, argv[1], &data)) {
return enif_make_badarg(env);
}
- if (!digp->md_func) {
+ md = digp->md.p;
+ if (!md) {
return atom_notsup;
}
- md = digp->md_func();
ret_size = (unsigned)EVP_MD_size(md);
ASSERT(0 < ret_size && ret_size <= EVP_MAX_MD_SIZE);
if (!EVP_Digest(data.data, data.size,
@@ -872,12 +889,12 @@ static ERL_NIF_TERM hash_init_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM a
if (!digp) {
return enif_make_badarg(env);
}
- if (!digp->md_func) {
+ if (!digp->md.p) {
return atom_notsup;
}
ctx = enif_alloc_resource(evp_md_ctx_rtype, sizeof(EVP_MD_CTX));
- if (!EVP_DigestInit(ctx, digp->md_func())) {
+ if (!EVP_DigestInit(ctx, digp->md.p)) {
enif_release_resource(ctx);
return atom_notsup;
}
@@ -946,11 +963,11 @@ static ERL_NIF_TERM hash_init_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM a
if (!digp) {
return enif_make_badarg(env);
}
- if (!digp->md_func) {
+ if (!digp->md.p) {
return atom_notsup;
}
- switch (EVP_MD_type(digp->md_func()))
+ switch (EVP_MD_type(digp->md.p))
{
case NID_md4:
ctx_size = MD4_CTX_LEN;
@@ -1020,11 +1037,11 @@ static ERL_NIF_TERM hash_update_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM
!enif_inspect_iolist_as_binary(env, argv[1], &data)) {
return enif_make_badarg(env);
}
- if (!digp->md_func) {
+ if (!digp->md.p) {
return atom_notsup;
}
- switch (EVP_MD_type(digp->md_func()))
+ switch (EVP_MD_type(digp->md.p))
{
case NID_md4:
ctx_size = MD4_CTX_LEN;
@@ -1102,11 +1119,11 @@ static ERL_NIF_TERM hash_final_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM
!enif_inspect_binary(env, tuple[1], &ctx)) {
return enif_make_badarg(env);
}
- if (!digp->md_func) {
+ md = digp->md.p;
+ if (!md) {
return atom_notsup;
}
- md = digp->md_func();
switch (EVP_MD_type(md))
{
@@ -1186,8 +1203,8 @@ static ERL_NIF_TERM hmac_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]
return enif_make_badarg(env);
}
- if (!digp->md_func ||
- !HMAC(digp->md_func(),
+ if (!digp->md.p ||
+ !HMAC(digp->md.p,
key.data, key.size,
data.data, data.size,
buff, &size)) {
@@ -1229,7 +1246,7 @@ static ERL_NIF_TERM hmac_init_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM a
!enif_inspect_iolist_as_binary(env, argv[1], &key)) {
return enif_make_badarg(env);
}
- if (!digp->md_func) {
+ if (!digp->md.p) {
return atom_notsup;
}
@@ -1239,12 +1256,12 @@ static ERL_NIF_TERM hmac_init_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM a
#if OPENSSL_VERSION_NUMBER >= 0x1000000fL
// Check the return value of HMAC_Init: it may fail in FIPS mode
// for disabled algorithms
- if (!HMAC_Init(&obj->ctx, key.data, key.size, digp->md_func())) {
+ if (!HMAC_Init(&obj->ctx, key.data, key.size, digp->md.p)) {
enif_release_resource(obj);
return atom_notsup;
}
#else
- HMAC_Init(&obj->ctx, key.data, key.size, digp->md_func());
+ HMAC_Init(&obj->ctx, key.data, key.size, digp->md.p);
#endif
ret = enif_make_resource(env, obj);
@@ -1323,7 +1340,8 @@ static ERL_NIF_TERM block_crypt_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM
|| !enif_inspect_iolist_as_binary(env, argv[argc - 2], &text)) {
return enif_make_badarg(env);
}
- if (!cipherp->cipher_func) {
+ cipher = cipherp->cipher.p;
+ if (!cipher) {
return enif_raise_exception(env, atom_notsup);
}
@@ -1335,7 +1353,6 @@ static ERL_NIF_TERM block_crypt_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM
return aes_cfb_8_crypt(env, argc-1, argv+1);
}
- cipher = cipherp->cipher_func();
ivec_size = EVP_CIPHER_iv_length(cipher);
#ifdef HAVE_ECB_IVEC_BUG
@@ -1629,6 +1646,7 @@ static ERL_NIF_TERM aes_gcm_encrypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM
EVP_CIPHER_CTX ctx;
const EVP_CIPHER *cipher = NULL;
ErlNifBinary key, iv, aad, in;
+ unsigned int tag_len;
unsigned char *outp, *tagp;
ERL_NIF_TERM out, out_tag;
int len;
@@ -1637,7 +1655,8 @@ static ERL_NIF_TERM aes_gcm_encrypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM
|| (key.size != 16 && key.size != 24 && key.size != 32)
|| !enif_inspect_binary(env, argv[1], &iv) || iv.size == 0
|| !enif_inspect_iolist_as_binary(env, argv[2], &aad)
- || !enif_inspect_iolist_as_binary(env, argv[3], &in)) {
+ || !enif_inspect_iolist_as_binary(env, argv[3], &in)
+ || !enif_get_uint(env, argv[4], &tag_len) || tag_len < 1 || tag_len > 16) {
return enif_make_badarg(env);
}
@@ -1669,9 +1688,9 @@ static ERL_NIF_TERM aes_gcm_encrypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM
if (EVP_EncryptFinal_ex(&ctx, outp+len, &len) != 1)
goto out_err;
- tagp = enif_make_new_binary(env, EVP_GCM_TLS_TAG_LEN, &out_tag);
+ tagp = enif_make_new_binary(env, tag_len, &out_tag);
- if (EVP_CIPHER_CTX_ctrl(&ctx, EVP_CTRL_GCM_GET_TAG, EVP_GCM_TLS_TAG_LEN, tagp) != 1)
+ if (EVP_CIPHER_CTX_ctrl(&ctx, EVP_CTRL_GCM_GET_TAG, tag_len, tagp) != 1)
goto out_err;
EVP_CIPHER_CTX_cleanup(&ctx);
@@ -1704,7 +1723,7 @@ static ERL_NIF_TERM aes_gcm_decrypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM
|| !enif_inspect_binary(env, argv[1], &iv) || iv.size == 0
|| !enif_inspect_iolist_as_binary(env, argv[2], &aad)
|| !enif_inspect_iolist_as_binary(env, argv[3], &in)
- || !enif_inspect_iolist_as_binary(env, argv[4], &tag) || tag.size != EVP_GCM_TLS_TAG_LEN) {
+ || !enif_inspect_iolist_as_binary(env, argv[4], &tag)) {
return enif_make_badarg(env);
}
@@ -1730,7 +1749,7 @@ static ERL_NIF_TERM aes_gcm_decrypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM
if (EVP_DecryptUpdate(&ctx, outp, &len, in.data, in.size) != 1)
goto out_err;
- if (EVP_CIPHER_CTX_ctrl(&ctx, EVP_CTRL_GCM_SET_TAG, EVP_GCM_TLS_TAG_LEN, tag.data) != 1)
+ if (EVP_CIPHER_CTX_ctrl(&ctx, EVP_CTRL_GCM_SET_TAG, tag.size, tag.data) != 1)
goto out_err;
if (EVP_DecryptFinal_ex(&ctx, outp+len, &len) != 1)
goto out_err;
@@ -1906,27 +1925,7 @@ static ERL_NIF_TERM strong_rand_bytes_nif(ErlNifEnv* env, int argc, const ERL_NI
return ret;
}
-static ERL_NIF_TERM rand_bytes_3(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
-{/* (Bytes, TopMask, BottomMask) */
- unsigned bytes;
- unsigned char* data;
- unsigned top_mask, bot_mask;
- ERL_NIF_TERM ret;
- if (!enif_get_uint(env, argv[0], &bytes)
- || !enif_get_uint(env, argv[1], &top_mask)
- || !enif_get_uint(env, argv[2], &bot_mask)) {
- return enif_make_badarg(env);
- }
- data = enif_make_new_binary(env, bytes, &ret);
- RAND_pseudo_bytes(data, bytes);
- ERL_VALGRIND_MAKE_MEM_DEFINED(data, bytes);
- if (bytes > 0) {
- data[bytes-1] |= top_mask;
- data[0] |= bot_mask;
- }
- return ret;
-}
static ERL_NIF_TERM strong_rand_mpint_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{/* (Bytes, TopMask, BottomMask) */
unsigned bits;
@@ -2110,27 +2109,31 @@ static void init_digest_types(ErlNifEnv* env)
{
struct digest_type_t* p = digest_types;
- for (p = digest_types; p->type_str; p++) {
- p->type_atom = enif_make_atom(env, p->type_str);
+ for (p = digest_types; p->type.str; p++) {
+ p->type.atom = enif_make_atom(env, p->type.str);
+ if (p->md.funcp)
+ p->md.p = p->md.funcp();
}
-
+ p->type.atom = atom_false; /* end marker */
}
static void init_cipher_types(ErlNifEnv* env)
{
struct cipher_type_t* p = cipher_types;
- for (p = cipher_types; p->type_str; p++) {
- p->type_atom = enif_make_atom(env, p->type_str);
+ for (p = cipher_types; p->type.str; p++) {
+ p->type.atom = enif_make_atom(env, p->type.str);
+ if (p->cipher.funcp)
+ p->cipher.p = p->cipher.funcp();
}
-
+ p->type.atom = atom_false; /* end marker */
}
static struct digest_type_t* get_digest_type(ERL_NIF_TERM type)
{
struct digest_type_t* p = NULL;
- for (p = digest_types; p->type_str; p++) {
- if (type == p->type_atom) {
+ for (p = digest_types; p->type.atom != atom_false; p++) {
+ if (type == p->type.atom) {
return p;
}
}
@@ -2140,8 +2143,8 @@ static struct digest_type_t* get_digest_type(ERL_NIF_TERM type)
static struct cipher_type_t* get_cipher_type(ERL_NIF_TERM type, size_t key_len)
{
struct cipher_type_t* p = NULL;
- for (p = cipher_types; p->type_str; p++) {
- if (type == p->type_atom && (!p->key_len || key_len == p->key_len)) {
+ for (p = cipher_types; p->type.atom != atom_false; p++) {
+ if (type == p->type.atom && (!p->key_len || key_len == p->key_len)) {
return p;
}
}
@@ -2166,12 +2169,12 @@ static ERL_NIF_TERM rsa_verify_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM
if (!digp) {
return enif_make_badarg(env);
}
- if (!digp->md_func) {
+ md = digp->md.p;
+ if (!md) {
return atom_notsup;
}
rsa = RSA_new();
- md = digp->md_func();
if (!enif_inspect_binary(env, argv[1], &digest_bin)
|| digest_bin.size != EVP_MD_size(md)
@@ -2329,10 +2332,10 @@ static ERL_NIF_TERM rsa_sign_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM ar
if (!digp) {
return enif_make_badarg(env);
}
- if (!digp->md_func) {
+ md = digp->md.p;
+ if (!md) {
return atom_notsup;
}
- md = digp->md_func();
if (!enif_inspect_binary(env,argv[1],&digest_bin)
|| digest_bin.size != EVP_MD_size(md)) {
@@ -2904,8 +2907,7 @@ static EC_KEY* ec_key_new(ErlNifEnv* env, ERL_NIF_TERM curve_arg)
EC_POINT *point = NULL;
/* {Field, Prime, Point, Order, CoFactor} = Curve */
- if (enif_is_tuple(env, curve_arg)
- && enif_get_tuple(env,curve_arg,&c_arity,&curve)
+ if (enif_get_tuple(env,curve_arg,&c_arity,&curve)
&& c_arity == 5
&& get_bn_from_bin(env, curve[3], &bn_order)
&& (curve[4] != atom_none && get_bn_from_bin(env, curve[4], &cofactor))) {
@@ -2942,9 +2944,11 @@ static EC_KEY* ec_key_new(ErlNifEnv* env, ERL_NIF_TERM curve_arg)
/* create the EC_GROUP structure */
group = EC_GROUP_new_curve_GFp(p, a, b, NULL);
-#if !defined(OPENSSL_NO_EC2M)
-
} else if (f_arity == 3 && field[0] == atom_characteristic_two_field) {
+#if defined(OPENSSL_NO_EC2M)
+ enif_raise_exception(env, atom_notsup);
+ goto out_err;
+#else
/* {characteristic_two_field, M, Basis} */
int b_arity = -1;
@@ -3221,7 +3225,7 @@ static ERL_NIF_TERM ec_key_generate(ErlNifEnv* env, int argc, const ERL_NIF_TERM
badarg:
if (key)
EC_KEY_free(key);
- return enif_make_badarg(env);
+ return make_badarg_maybe(env);
#else
return atom_notsup;
#endif
@@ -3241,10 +3245,10 @@ static ERL_NIF_TERM ecdsa_sign_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM
if (!digp) {
return enif_make_badarg(env);
}
- if (!digp->md_func) {
+ md = digp->md.p;
+ if (!md) {
return atom_notsup;
}
- md = digp->md_func();
len = EVP_MD_size(md);
if (!enif_inspect_binary(env,argv[1],&digest_bin)
@@ -3272,7 +3276,7 @@ static ERL_NIF_TERM ecdsa_sign_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM
badarg:
if (key)
EC_KEY_free(key);
- return enif_make_badarg(env);
+ return make_badarg_maybe(env);
#else
return atom_notsup;
#endif
@@ -3292,10 +3296,10 @@ static ERL_NIF_TERM ecdsa_verify_nif(ErlNifEnv* env, int argc, const ERL_NIF_TER
if (!digp) {
return enif_make_badarg(env);
}
- if (!digp->md_func) {
+ md = digp->md.p;
+ if (!md) {
return atom_notsup;
}
- md = digp->md_func();
len = EVP_MD_size(md);
if (!enif_inspect_binary(env, argv[1], &digest_bin)
@@ -3314,7 +3318,7 @@ static ERL_NIF_TERM ecdsa_verify_nif(ErlNifEnv* env, int argc, const ERL_NIF_TER
badarg:
if (key)
EC_KEY_free(key);
- return enif_make_badarg(env);
+ return make_badarg_maybe(env);
#else
return atom_notsup;
#endif
@@ -3339,7 +3343,7 @@ static ERL_NIF_TERM ecdh_compute_key_nif(ErlNifEnv* env, int argc, const ERL_NIF
EC_KEY *other_ecdh = NULL;
if (!get_ec_key(env, argv[1], argv[2], atom_undefined, &key))
- return enif_make_badarg(env);
+ return make_badarg_maybe(env);
group = EC_GROUP_dup(EC_KEY_get0_group(key));
priv_key = EC_KEY_get0_private_key(key);
diff --git a/lib/crypto/c_src/crypto_callback.c b/lib/crypto/c_src/crypto_callback.c
index af9545bd63..3acbbf406b 100644
--- a/lib/crypto/c_src/crypto_callback.c
+++ b/lib/crypto/c_src/crypto_callback.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2014. All Rights Reserved.
+ * Copyright Ericsson AB 2014-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/crypto/c_src/crypto_callback.h b/lib/crypto/c_src/crypto_callback.h
index df5c99d4d3..894d86cfd9 100644
--- a/lib/crypto/c_src/crypto_callback.h
+++ b/lib/crypto/c_src/crypto_callback.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2012. All Rights Reserved.
+ * Copyright Ericsson AB 2012-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/crypto/doc/src/book.xml b/lib/crypto/doc/src/book.xml
index 43ed49113f..b8b2c935b3 100644
--- a/lib/crypto/doc/src/book.xml
+++ b/lib/crypto/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml
index d3e827b3e6..5a5627747c 100644
--- a/lib/crypto/doc/src/crypto.xml
+++ b/lib/crypto/doc/src/crypto.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1999</year><year>2014</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -203,6 +203,7 @@
<func>
<name>block_encrypt(Type, Key, Ivec, PlainText) -> CipherText</name>
<name>block_encrypt(AeadType, Key, Ivec, {AAD, PlainText}) -> {CipherText, CipherTag}</name>
+ <name>block_encrypt(aes_gcm, Key, Ivec, {AAD, PlainText, TagLength}) -> {CipherText, CipherTag}</name>
<fsummary>Encrypt <c>PlainText</c> according to <c>Type</c> block cipher</fsummary>
<type>
<v>Type = block_cipher() </v>
@@ -210,6 +211,7 @@
<v>Key = block_key() </v>
<v>PlainText = iodata() </v>
<v>AAD = IVec = CipherText = CipherTag = binary()</v>
+ <v>TagLength = 1..16</v>
</type>
<desc>
<p>Encrypt <c>PlainText</c> according to <c>Type</c> block cipher.
@@ -306,6 +308,8 @@
<desc>
<p>Generates public keys of type <c>Type</c>.
See also <seealso marker="public_key:public_key#generate_key-1">public_key:generate_key/1</seealso>
+ May throw exception <c>low_entropy</c> in case the random generator
+ failed due to lack of secure "randomness".
</p>
</desc>
</func>
@@ -594,22 +598,6 @@
</func>
<func>
- <name>rand_bytes(N) -> binary()</name>
- <fsummary>Generate a binary of random bytes</fsummary>
- <type>
- <v>N = integer()</v>
- </type>
- <desc>
- <p>Generates N bytes randomly uniform 0..255, and returns the
- result in a binary. Uses the <c>crypto</c> library pseudo-random
- number generator.</p>
- <p>This function is not recommended for cryptographic purposes.
- Please use <seealso marker="#strong_rand_bytes/1">
- strong_rand_bytes/1</seealso> instead.</p>
- </desc>
- </func>
-
- <func>
<name>rand_seed(Seed) -> ok</name>
<fsummary>Set the seed for random bytes generation</fsummary>
<type>
diff --git a/lib/crypto/doc/src/crypto_app.xml b/lib/crypto/doc/src/crypto_app.xml
index 4ba2d34934..2b9e505988 100644
--- a/lib/crypto/doc/src/crypto_app.xml
+++ b/lib/crypto/doc/src/crypto_app.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1999</year>
- <year>2014</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/crypto/doc/src/licenses.xml b/lib/crypto/doc/src/licenses.xml
index 57d78f7bd9..e5c06cf7ce 100644
--- a/lib/crypto/doc/src/licenses.xml
+++ b/lib/crypto/doc/src/licenses.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/crypto/doc/src/notes.xml b/lib/crypto/doc/src/notes.xml
index 0138eb6ad2..6c76a0d7b0 100644
--- a/lib/crypto/doc/src/notes.xml
+++ b/lib/crypto/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/crypto/doc/src/ref_man.xml b/lib/crypto/doc/src/ref_man.xml
index ccdb5afb9b..14922cbcec 100644
--- a/lib/crypto/doc/src/ref_man.xml
+++ b/lib/crypto/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/crypto/doc/src/release_notes.xml b/lib/crypto/doc/src/release_notes.xml
index 5253027b9c..a2d7964455 100644
--- a/lib/crypto/doc/src/release_notes.xml
+++ b/lib/crypto/doc/src/release_notes.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1999</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/crypto/doc/src/usersguide.xml b/lib/crypto/doc/src/usersguide.xml
index 469ab10cc8..fb088a8285 100644
--- a/lib/crypto/doc/src/usersguide.xml
+++ b/lib/crypto/doc/src/usersguide.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/crypto/src/Makefile b/lib/crypto/src/Makefile
index 6e4008e434..456b8be64d 100644
--- a/lib/crypto/src/Makefile
+++ b/lib/crypto/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2014. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/crypto/src/crypto.app.src b/lib/crypto/src/crypto.app.src
index 70611bb637..8a47b8a78b 100644
--- a/lib/crypto/src/crypto.app.src
+++ b/lib/crypto/src/crypto.app.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/crypto/src/crypto.appup.src b/lib/crypto/src/crypto.appup.src
index ce13746a07..a177de22fb 100644
--- a/lib/crypto/src/crypto.appup.src
+++ b/lib/crypto/src/crypto.appup.src
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl
index 3e24ff2b0a..025d57e9c5 100644
--- a/lib/crypto/src/crypto.erl
+++ b/lib/crypto/src/crypto.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
-export([generate_key/2, generate_key/3, compute_key/4]).
-export([hmac/3, hmac/4, hmac_init/2, hmac_update/2, hmac_final/1, hmac_final_n/2]).
-export([exor/2, strong_rand_bytes/1, mod_pow/3]).
--export([rand_bytes/1, rand_bytes/3, rand_uniform/2]).
+-export([rand_uniform/2]).
-export([block_encrypt/3, block_decrypt/3, block_encrypt/4, block_decrypt/4]).
-export([next_iv/2, next_iv/3]).
-export([stream_init/2, stream_init/3, stream_encrypt/2, stream_decrypt/2]).
@@ -39,6 +39,9 @@
-export([rand_seed/1]).
%% DEPRECATED
+-export([rand_bytes/1]).
+-deprecated({rand_bytes, 1, next_major_release}).
+
%% Replaced by hash_*
-export([md4/1, md4_init/0, md4_update/2, md4_final/1]).
-export([md5/1, md5_init/0, md5_update/2, md5_final/1]).
@@ -302,6 +305,8 @@ block_encrypt(aes_ige256, Key, Ivec, Data) ->
aes_ige_crypt_nif(Key, Ivec, Data, true);
block_encrypt(aes_gcm, Key, Ivec, {AAD, Data}) ->
aes_gcm_encrypt(Key, Ivec, AAD, Data);
+block_encrypt(aes_gcm, Key, Ivec, {AAD, Data, TagLength}) ->
+ aes_gcm_encrypt(Key, Ivec, AAD, Data, TagLength);
block_encrypt(chacha20_poly1305, Key, Ivec, {AAD, Data}) ->
chacha20_poly1305_encrypt(Key, Ivec, AAD, Data).
@@ -405,8 +410,6 @@ strong_rand_bytes(Bytes) ->
end.
strong_rand_bytes_nif(_Bytes) -> ?nif_stub.
-rand_bytes(_Bytes, _Topmask, _Bottommask) -> ?nif_stub.
-
rand_uniform(From,To) when is_binary(From), is_binary(To) ->
case rand_uniform_nif(From,To) of
@@ -544,7 +547,7 @@ generate_key(dh, DHParameters, PrivateKey) ->
generate_key(srp, {host, [Verifier, Generator, Prime, Version]}, PrivArg)
when is_binary(Verifier), is_binary(Generator), is_binary(Prime), is_atom(Version) ->
Private = case PrivArg of
- undefined -> random_bytes(32);
+ undefined -> strong_rand_bytes(32);
_ -> ensure_int_as_bin(PrivArg)
end,
host_srp_gen_key(Private, Verifier, Generator, Prime, Version);
@@ -552,7 +555,7 @@ generate_key(srp, {host, [Verifier, Generator, Prime, Version]}, PrivArg)
generate_key(srp, {user, [Generator, Prime, Version]}, PrivateArg)
when is_binary(Generator), is_binary(Prime), is_atom(Version) ->
Private = case PrivateArg of
- undefined -> random_bytes(32);
+ undefined -> strong_rand_bytes(32);
_ -> PrivateArg
end,
user_srp_gen_key(Private, Generator, Prime);
@@ -604,16 +607,6 @@ compute_key(ecdh, Others, My, Curve) ->
nif_curve_params(Curve),
ensure_int_as_bin(My)).
-
-random_bytes(N) ->
- try strong_rand_bytes(N) of
- RandBytes ->
- RandBytes
- catch
- error:low_entropy ->
- rand_bytes(N)
- end.
-
%%--------------------------------------------------------------------
%%% On load
%%--------------------------------------------------------------------
@@ -917,7 +910,10 @@ aes_cfb_128_decrypt(Key, IVec, Data) ->
%%
%% AES - in Galois/Counter Mode (GCM)
%%
-aes_gcm_encrypt(_Key, _Ivec, _AAD, _In) -> ?nif_stub.
+%% The default tag length is EVP_GCM_TLS_TAG_LEN(16),
+aes_gcm_encrypt(Key, Ivec, AAD, In) ->
+ aes_gcm_encrypt(Key, Ivec, AAD, In, 16).
+aes_gcm_encrypt(_Key, _Ivec, _AAD, _In, _TagLength) -> ?nif_stub.
aes_gcm_decrypt(_Key, _Ivec, _AAD, _In, _Tag) -> ?nif_stub.
%%
diff --git a/lib/crypto/test/blowfish_SUITE.erl b/lib/crypto/test/blowfish_SUITE.erl
index 19f60450e9..d7c50dc6de 100644
--- a/lib/crypto/test/blowfish_SUITE.erl
+++ b/lib/crypto/test/blowfish_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl
index f34d27649a..6732f27824 100644
--- a/lib/crypto/test/crypto_SUITE.erl
+++ b/lib/crypto/test/crypto_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -269,7 +269,6 @@ rand_uniform() ->
[{doc, "rand_uniform and random_bytes testing"}].
rand_uniform(Config) when is_list(Config) ->
rand_uniform_aux_test(10),
- 10 = byte_size(crypto:rand_bytes(10)),
10 = byte_size(crypto:strong_rand_bytes(10)).
%%--------------------------------------------------------------------
@@ -462,6 +461,21 @@ aead_cipher({Type, Key, PlainText, IV, AAD, CipherText, CipherTag}) ->
ok;
Other1 ->
ct:fail({{crypto, block_decrypt, [CipherText]}, {expected, Plain}, {got, Other1}})
+ end;
+aead_cipher({Type, Key, PlainText, IV, AAD, CipherText, CipherTag, TagLen}) ->
+ <<TruncatedCipherTag:TagLen/binary, _/binary>> = CipherTag,
+ Plain = iolist_to_binary(PlainText),
+ case crypto:block_encrypt(Type, Key, IV, {AAD, Plain, TagLen}) of
+ {CipherText, TruncatedCipherTag} ->
+ ok;
+ Other0 ->
+ ct:fail({{crypto, block_encrypt, [Plain, PlainText]}, {expected, {CipherText, TruncatedCipherTag}}, {got, Other0}})
+ end,
+ case crypto:block_decrypt(Type, Key, IV, {AAD, CipherText, TruncatedCipherTag}) of
+ Plain ->
+ ok;
+ Other1 ->
+ ct:fail({{crypto, block_decrypt, [CipherText]}, {expected, Plain}, {got, Other1}})
end.
do_sign_verify({Type, Hash, Public, Private, Msg}) ->
@@ -634,8 +648,8 @@ ipow(A, B, M, Prod) ->
do_exor(B) ->
Z1 = zero_bin(B),
Z1 = crypto:exor(B, B),
- B1 = crypto:rand_bytes(100),
- B2 = crypto:rand_bytes(100),
+ B1 = crypto:strong_rand_bytes(100),
+ B2 = crypto:strong_rand_bytes(100),
Z2 = zero_bin(B1),
Z2 = crypto:exor(B1, B1),
Z2 = crypto:exor(B2, B2),
@@ -1938,7 +1952,36 @@ aes_gcm() ->
"eeb2b22aafde6419a058ab4f6f746bf4"
"0fc0c3b780f244452da3ebf1c5d82cde"
"a2418997200ef82e44ae7e3f"),
- hexstr2bin("a44a8266ee1c8eb0c8b5d4cf5ae9f19a")} %% CipherTag
+ hexstr2bin("a44a8266ee1c8eb0c8b5d4cf5ae9f19a")}, %% CipherTag
+
+ %% Test Case 0 for TagLength = 1
+ {aes_gcm, hexstr2bin("00000000000000000000000000000000"), %% Key
+ hexstr2bin(""), %% PlainText
+ hexstr2bin("000000000000000000000000"), %% IV
+ hexstr2bin(""), %% AAD
+ hexstr2bin(""), %% CipherText
+ hexstr2bin("58"), %% CipherTag
+ 1}, %% TagLength
+
+ %% Test Case 18 for TagLength = 1
+ {aes_gcm, hexstr2bin("feffe9928665731c6d6a8f9467308308" %% Key
+ "feffe9928665731c6d6a8f9467308308"),
+ hexstr2bin("d9313225f88406e5a55909c5aff5269a" %% PlainText
+ "86a7a9531534f7da2e4c303d8a318a72"
+ "1c3c0c95956809532fcf0e2449a6b525"
+ "b16aedf5aa0de657ba637b39"),
+ hexstr2bin("9313225df88406e555909c5aff5269aa" %% IV
+ "6a7a9538534f7da1e4c303d2a318a728"
+ "c3c0c95156809539fcf0e2429a6b5254"
+ "16aedbf5a0de6a57a637b39b"),
+ hexstr2bin("feedfacedeadbeeffeedfacedeadbeef" %% AAD
+ "abaddad2"),
+ hexstr2bin("5a8def2f0c9e53f1f75d7853659e2a20" %% CipherText
+ "eeb2b22aafde6419a058ab4f6f746bf4"
+ "0fc0c3b780f244452da3ebf1c5d82cde"
+ "a2418997200ef82e44ae7e3f"),
+ hexstr2bin("a4"), %% CipherTag
+ 1} %% TagLength
].
%% http://tools.ietf.org/html/draft-agl-tls-chacha20poly1305-04
diff --git a/lib/crypto/test/old_crypto_SUITE.erl b/lib/crypto/test/old_crypto_SUITE.erl
index 37cce2ebd2..0d97290d10 100644
--- a/lib/crypto/test/old_crypto_SUITE.erl
+++ b/lib/crypto/test/old_crypto_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -187,7 +187,9 @@ ldd_program() ->
case os:find_executable("otool") of
false -> none;
Otool -> Otool ++ " -L"
- end
+ end;
+ _ ->
+ none
end;
Ldd when is_list(Ldd) -> Ldd
end.
@@ -2066,8 +2068,8 @@ exor_test(Config) when is_list(Config) ->
B = <<1, 2, 3, 4, 5, 6, 7, 8, 9, 10>>,
Z1 = zero_bin(B),
Z1 = crypto:exor(B, B),
- B1 = crypto:rand_bytes(100),
- B2 = crypto:rand_bytes(100),
+ B1 = crypto:strong_rand_bytes(100),
+ B2 = crypto:strong_rand_bytes(100),
Z2 = zero_bin(B1),
Z2 = crypto:exor(B1, B1),
Z2 = crypto:exor(B2, B2),
diff --git a/lib/debugger/Makefile b/lib/debugger/Makefile
index 9c761d216b..8c8b617831 100644
--- a/lib/debugger/Makefile
+++ b/lib/debugger/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/debugger/doc/src/Makefile b/lib/debugger/doc/src/Makefile
index 226dbe5b44..6c9617ca69 100644
--- a/lib/debugger/doc/src/Makefile
+++ b/lib/debugger/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2013. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/debugger/doc/src/book.xml b/lib/debugger/doc/src/book.xml
index 5424ef2c04..10356e14d0 100644
--- a/lib/debugger/doc/src/book.xml
+++ b/lib/debugger/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/debugger/doc/src/introduction.xml b/lib/debugger/doc/src/introduction.xml
index 9f5f279bb0..95a42cad09 100644
--- a/lib/debugger/doc/src/introduction.xml
+++ b/lib/debugger/doc/src/introduction.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/debugger/doc/src/notes.xml b/lib/debugger/doc/src/notes.xml
index 6e8cf54ae4..3028d8dd41 100644
--- a/lib/debugger/doc/src/notes.xml
+++ b/lib/debugger/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/debugger/doc/src/ref_man.xml b/lib/debugger/doc/src/ref_man.xml
index c44f07f912..0f224cdb4b 100644
--- a/lib/debugger/doc/src/ref_man.xml
+++ b/lib/debugger/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/debugger/priv/Makefile b/lib/debugger/priv/Makefile
index 77c114fa35..726d7eb2f3 100644
--- a/lib/debugger/priv/Makefile
+++ b/lib/debugger/priv/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/Makefile b/lib/debugger/src/Makefile
index f115f49d98..9594a0bfe3 100644
--- a/lib/debugger/src/Makefile
+++ b/lib/debugger/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2013. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_debugged.erl b/lib/debugger/src/dbg_debugged.erl
index 99bed6f01b..5b1469a10e 100644
--- a/lib/debugger/src/dbg_debugged.erl
+++ b/lib/debugger/src/dbg_debugged.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_idb.erl b/lib/debugger/src/dbg_idb.erl
index 9ce3ec3ef2..55177bbe76 100644
--- a/lib/debugger/src/dbg_idb.erl
+++ b/lib/debugger/src/dbg_idb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_iserver.erl b/lib/debugger/src/dbg_iserver.erl
index 28e8012f71..0ad303d8d9 100644
--- a/lib/debugger/src/dbg_iserver.erl
+++ b/lib/debugger/src/dbg_iserver.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_istk.erl b/lib/debugger/src/dbg_istk.erl
index d6c512bdf8..886ea142af 100644
--- a/lib/debugger/src/dbg_istk.erl
+++ b/lib/debugger/src/dbg_istk.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_break.erl b/lib/debugger/src/dbg_wx_break.erl
index b577cfdaec..764322d7c4 100644
--- a/lib/debugger/src/dbg_wx_break.erl
+++ b/lib/debugger/src/dbg_wx_break.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_break_win.erl b/lib/debugger/src/dbg_wx_break_win.erl
index c9464f1e07..cd1e81456f 100644
--- a/lib/debugger/src/dbg_wx_break_win.erl
+++ b/lib/debugger/src/dbg_wx_break_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_code.erl b/lib/debugger/src/dbg_wx_code.erl
index a0e6c94d60..f8fc331a81 100644
--- a/lib/debugger/src/dbg_wx_code.erl
+++ b/lib/debugger/src/dbg_wx_code.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_filedialog_win.erl b/lib/debugger/src/dbg_wx_filedialog_win.erl
index 910eda7fad..2103536a04 100644
--- a/lib/debugger/src/dbg_wx_filedialog_win.erl
+++ b/lib/debugger/src/dbg_wx_filedialog_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_filedialog_win.hrl b/lib/debugger/src/dbg_wx_filedialog_win.hrl
index 96a6fb2ae9..3eb21ffb29 100644
--- a/lib/debugger/src/dbg_wx_filedialog_win.hrl
+++ b/lib/debugger/src/dbg_wx_filedialog_win.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_interpret.erl b/lib/debugger/src/dbg_wx_interpret.erl
index f93a9089d7..4dcb5b65ac 100644
--- a/lib/debugger/src/dbg_wx_interpret.erl
+++ b/lib/debugger/src/dbg_wx_interpret.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_mon.erl b/lib/debugger/src/dbg_wx_mon.erl
index cd09dd1273..345367a911 100644
--- a/lib/debugger/src/dbg_wx_mon.erl
+++ b/lib/debugger/src/dbg_wx_mon.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_mon_win.erl b/lib/debugger/src/dbg_wx_mon_win.erl
index 5377ef83af..2e48210f55 100644
--- a/lib/debugger/src/dbg_wx_mon_win.erl
+++ b/lib/debugger/src/dbg_wx_mon_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_settings.erl b/lib/debugger/src/dbg_wx_settings.erl
index e45d74f67e..3a355f18a9 100644
--- a/lib/debugger/src/dbg_wx_settings.erl
+++ b/lib/debugger/src/dbg_wx_settings.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_src_view.erl b/lib/debugger/src/dbg_wx_src_view.erl
index 43c36a4d8e..571c6b01bb 100644
--- a/lib/debugger/src/dbg_wx_src_view.erl
+++ b/lib/debugger/src/dbg_wx_src_view.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_trace_win.erl b/lib/debugger/src/dbg_wx_trace_win.erl
index 232d61b1db..51687ad4e9 100644
--- a/lib/debugger/src/dbg_wx_trace_win.erl
+++ b/lib/debugger/src/dbg_wx_trace_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_view.erl b/lib/debugger/src/dbg_wx_view.erl
index 9715a9c17b..91fc0d08cb 100644
--- a/lib/debugger/src/dbg_wx_view.erl
+++ b/lib/debugger/src/dbg_wx_view.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_winman.erl b/lib/debugger/src/dbg_wx_winman.erl
index 0045948d2f..efa58ae325 100644
--- a/lib/debugger/src/dbg_wx_winman.erl
+++ b/lib/debugger/src/dbg_wx_winman.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/debugger.appup.src b/lib/debugger/src/debugger.appup.src
index 2fa3f5de5f..afad2a6a09 100644
--- a/lib/debugger/src/debugger.appup.src
+++ b/lib/debugger/src/debugger.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/debugger.erl b/lib/debugger/src/debugger.erl
index c188663668..f92c8e4a23 100644
--- a/lib/debugger/src/debugger.erl
+++ b/lib/debugger/src/debugger.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/i.erl b/lib/debugger/src/i.erl
index f8f6a3b245..4ed5265bdf 100644
--- a/lib/debugger/src/i.erl
+++ b/lib/debugger/src/i.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/int.erl b/lib/debugger/src/int.erl
index 1e43d1858a..3906c22afd 100644
--- a/lib/debugger/src/int.erl
+++ b/lib/debugger/src/int.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/Makefile b/lib/debugger/test/Makefile
index 1594c891b4..125abcacda 100644
--- a/lib/debugger/test/Makefile
+++ b/lib/debugger/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2012. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/andor_SUITE.erl b/lib/debugger/test/andor_SUITE.erl
index 9750fa018d..d7bbd4fccb 100644
--- a/lib/debugger/test/andor_SUITE.erl
+++ b/lib/debugger/test/andor_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -29,7 +29,9 @@
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
cases().
@@ -46,17 +48,14 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- ?line Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
@@ -71,23 +70,23 @@ t_andalso(Config) when is_list(Config) ->
Ps = [{X,Y} || X <- Bs, Y <- Bs],
lists:foreach(fun (P) -> t_andalso_1(P) end, Ps),
- ?line true = true andalso true,
- ?line false = true andalso false,
- ?line false = false andalso true,
- ?line false = false andalso false,
+ true = true andalso true,
+ false = true andalso false,
+ false = false andalso true,
+ false = false andalso false,
- ?line false = false andalso glurf,
- ?line false = false andalso exit(exit_now),
+ false = false andalso glurf,
+ false = false andalso exit(exit_now),
- ?line true = not id(false) andalso not id(false),
- ?line false = not id(false) andalso not id(true),
- ?line false = not id(true) andalso not id(false),
- ?line false = not id(true) andalso not id(true),
+ true = not id(false) andalso not id(false),
+ false = not id(false) andalso not id(true),
+ false = not id(true) andalso not id(false),
+ false = not id(true) andalso not id(true),
- ?line {'EXIT',{badarg,_}} = (catch not id(glurf) andalso id(true)),
- ?line {'EXIT',{badarg,_}} = (catch not id(false) andalso not id(glurf)),
- ?line false = id(false) andalso not id(glurf),
- ?line false = false andalso not id(glurf),
+ {'EXIT',{badarg,_}} = (catch not id(glurf) andalso id(true)),
+ {'EXIT',{badarg,_}} = (catch not id(false) andalso not id(glurf)),
+ false = id(false) andalso not id(glurf),
+ false = false andalso not id(glurf),
ok.
@@ -96,23 +95,23 @@ t_orelse(Config) when is_list(Config) ->
Ps = [{X,Y} || X <- Bs, Y <- Bs],
lists:foreach(fun (P) -> t_orelse_1(P) end, Ps),
- ?line true = true orelse true,
- ?line true = true orelse false,
- ?line true = false orelse true,
- ?line false = false orelse false,
+ true = true orelse true,
+ true = true orelse false,
+ true = false orelse true,
+ false = false orelse false,
- ?line true = true orelse glurf,
- ?line true = true orelse exit(exit_now),
+ true = true orelse glurf,
+ true = true orelse exit(exit_now),
- ?line true = not id(false) orelse not id(false),
- ?line true = not id(false) orelse not id(true),
- ?line true = not id(true) orelse not id(false),
- ?line false = not id(true) orelse not id(true),
+ true = not id(false) orelse not id(false),
+ true = not id(false) orelse not id(true),
+ true = not id(true) orelse not id(false),
+ false = not id(true) orelse not id(true),
- ?line {'EXIT',{badarg,_}} = (catch not id(glurf) orelse id(true)),
- ?line {'EXIT',{badarg,_}} = (catch not id(true) orelse not id(glurf)),
- ?line true = id(true) orelse not id(glurf),
- ?line true = true orelse not id(glurf),
+ {'EXIT',{badarg,_}} = (catch not id(glurf) orelse id(true)),
+ {'EXIT',{badarg,_}} = (catch not id(true) orelse not id(glurf)),
+ true = id(true) orelse not id(glurf),
+ true = true orelse not id(glurf),
ok.
@@ -135,16 +134,16 @@ t_orelse_1({X,Y}) ->
check(V1, X or Y).
inside(Config) when is_list(Config) ->
- ?line true = inside(-8, 1),
- ?line false = inside(-53.5, -879798),
- ?line false = inside(1.0, -879),
- ?line false = inside(59, -879),
- ?line false = inside(-11, 1.0),
- ?line false = inside(100, 0.2),
- ?line false = inside(100, 1.2),
- ?line false = inside(-53.5, 4),
- ?line false = inside(1.0, 5.3),
- ?line false = inside(59, 879),
+ true = inside(-8, 1),
+ false = inside(-53.5, -879798),
+ false = inside(1.0, -879),
+ false = inside(59, -879),
+ false = inside(-11, 1.0),
+ false = inside(100, 0.2),
+ false = inside(100, 1.2),
+ false = inside(-53.5, 4),
+ false = inside(1.0, 5.3),
+ false = inside(59, 879),
ok.
inside(Xm, Ym) ->
@@ -179,15 +178,15 @@ inside_guard(Xm, Ym, X, Y, W, H) ->
{false,Xm,Ym,X,Y,W,H}.
overlap(Config) when is_list(Config) ->
- ?line true = overlap(7.0, 2.0, 8.0, 0.5),
- ?line true = overlap(7.0, 2.0, 8.0, 2.5),
- ?line true = overlap(7.0, 2.0, 5.3, 2),
- ?line true = overlap(7.0, 2.0, 0.0, 100.0),
-
- ?line false = overlap(-1, 2, -35, 0.5),
- ?line false = overlap(-1, 2, 777, 0.5),
- ?line false = overlap(-1, 2, 2, 10),
- ?line false = overlap(2, 10, 12, 55.3),
+ true = overlap(7.0, 2.0, 8.0, 0.5),
+ true = overlap(7.0, 2.0, 8.0, 2.5),
+ true = overlap(7.0, 2.0, 5.3, 2),
+ true = overlap(7.0, 2.0, 0.0, 100.0),
+
+ false = overlap(-1, 2, -35, 0.5),
+ false = overlap(-1, 2, 777, 0.5),
+ false = overlap(-1, 2, 2, 10),
+ false = overlap(2, 10, 12, 55.3),
ok.
overlap(Pos1, Len1, Pos2, Len2) ->
@@ -211,33 +210,33 @@ overlap(Pos1, Len1, Pos2, Len2) ->
-define(COMB(A,B,C), (A andalso B orelse C)).
combined(Config) when is_list(Config) ->
- ?line false = comb(false, false, false),
- ?line true = comb(false, false, true),
- ?line false = comb(false, true, false),
- ?line true = comb(false, true, true),
-
- ?line false = comb(true, false, false),
- ?line true = comb(true, true, false),
- ?line true = comb(true, false, true),
- ?line true = comb(true, true, true),
-
- ?line false = comb(false, blurf, false),
- ?line true = comb(false, blurf, true),
- ?line true = comb(true, true, blurf),
-
- ?line false = ?COMB(false, false, false),
- ?line true = ?COMB(false, false, true),
- ?line false = ?COMB(false, true, false),
- ?line true = ?COMB(false, true, true),
-
- ?line false = ?COMB(true, false, false),
- ?line true = ?COMB(true, true, false),
- ?line true = ?COMB(true, false, true),
- ?line true = ?COMB(true, true, true),
-
- ?line false = ?COMB(false, blurf, false),
- ?line true = ?COMB(false, blurf, true),
- ?line true = ?COMB(true, true, blurf),
+ false = comb(false, false, false),
+ true = comb(false, false, true),
+ false = comb(false, true, false),
+ true = comb(false, true, true),
+
+ false = comb(true, false, false),
+ true = comb(true, true, false),
+ true = comb(true, false, true),
+ true = comb(true, true, true),
+
+ false = comb(false, blurf, false),
+ true = comb(false, blurf, true),
+ true = comb(true, true, blurf),
+
+ false = ?COMB(false, false, false),
+ true = ?COMB(false, false, true),
+ false = ?COMB(false, true, false),
+ true = ?COMB(false, true, true),
+
+ false = ?COMB(true, false, false),
+ true = ?COMB(true, true, false),
+ true = ?COMB(true, false, true),
+ true = ?COMB(true, true, true),
+
+ false = ?COMB(false, blurf, false),
+ true = ?COMB(false, blurf, true),
+ true = ?COMB(true, true, blurf),
ok.
-undef(COMB).
@@ -268,13 +267,13 @@ comb(A, B, C) ->
%% Test that a boolean expression in a case expression is properly
%% optimized (in particular, that the error behaviour is correct).
in_case(Config) when is_list(Config) ->
- ?line edge_rings = in_case_1(1, 1, 1, 1, 1),
- ?line not_loop = in_case_1(0.5, 1, 1, 1, 1),
- ?line loop = in_case_1(0.5, 0.9, 1.1, 1, 4),
- ?line {'EXIT',{badarith,_}} = (catch in_case_1(1, 1, 1, 1, 0)),
- ?line {'EXIT',{badarith,_}} = (catch in_case_1(1, 1, 1, 1, nan)),
- ?line {'EXIT',{badarg,_}} = (catch in_case_1(1, 1, 1, blurf, 1)),
- ?line {'EXIT',{badarith,_}} = (catch in_case_1([nan], 1, 1, 1, 1)),
+ edge_rings = in_case_1(1, 1, 1, 1, 1),
+ not_loop = in_case_1(0.5, 1, 1, 1, 1),
+ loop = in_case_1(0.5, 0.9, 1.1, 1, 4),
+ {'EXIT',{badarith,_}} = (catch in_case_1(1, 1, 1, 1, 0)),
+ {'EXIT',{badarith,_}} = (catch in_case_1(1, 1, 1, 1, nan)),
+ {'EXIT',{badarg,_}} = (catch in_case_1(1, 1, 1, blurf, 1)),
+ {'EXIT',{badarith,_}} = (catch in_case_1([nan], 1, 1, 1, 1)),
ok.
in_case_1(LenUp, LenDw, LenN, Rotation, Count) ->
@@ -302,14 +301,14 @@ in_case_1_guard(LenUp, LenDw, LenN, Rotation, Count) ->
(abs(Rotation) > 0.707) of
true -> edge_rings;
false when LenUp >= 1 orelse LenDw >= 1 orelse
- LenN =< 1 orelse Count < 4 -> not_loop;
+ LenN =< 1 orelse Count < 4 -> not_loop;
false -> loop
end.
check(V1, V0) ->
if V1 /= V0 ->
io:fwrite("error: ~w.\n", [V1]),
- ?t:fail();
+ ct:fail(failed);
true ->
io:fwrite("ok: ~w.\n", [V1])
end.
diff --git a/lib/debugger/test/bs_bincomp_SUITE.erl b/lib/debugger/test/bs_bincomp_SUITE.erl
index 18b4198354..39e2240f2d 100644
--- a/lib/debugger/test/bs_bincomp_SUITE.erl
+++ b/lib/debugger/test/bs_bincomp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,15 +34,14 @@
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[byte_aligned, bit_aligned, extended_byte_aligned,
@@ -66,62 +65,62 @@ end_per_group(_GroupName, Config) ->
byte_aligned(Config) when is_list(Config) ->
- ?line <<"abcdefg">> = << <<(X+32)>> || <<X>> <= <<"ABCDEFG">> >>,
- ?line <<1:32/little,2:32/little,3:32/little,4:32/little>> =
+ <<"abcdefg">> = << <<(X+32)>> || <<X>> <= <<"ABCDEFG">> >>,
+ <<1:32/little,2:32/little,3:32/little,4:32/little>> =
<< <<X:32/little>> || <<X:32>> <= <<1:32,2:32,3:32,4:32>> >>,
- ?line <<1:32/little,2:32/little,3:32/little,4:32/little>> =
+ <<1:32/little,2:32/little,3:32/little,4:32/little>> =
<< <<X:32/little>> || <<X:16>> <= <<1:16,2:16,3:16,4:16>> >>,
- ok.
+ ok.
bit_aligned(Config) when is_list(Config) ->
- ?line <<$a:7,$b:7,$c:7,$d:7,$e:7,$f:7,$g:7>> =
+ <<$a:7,$b:7,$c:7,$d:7,$e:7,$f:7,$g:7>> =
<< <<(X+32):7>> || <<X>> <= <<"ABCDEFG">> >>,
- ?line <<"ABCDEFG">> =
+ <<"ABCDEFG">> =
<< <<(X-32)>> || <<X:7>> <= <<$a:7,$b:7,$c:7,$d:7,$e:7,$f:7,$g:7>> >>,
- ?line <<1:31/little,2:31/little,3:31/little,4:31/little>> =
+ <<1:31/little,2:31/little,3:31/little,4:31/little>> =
<< <<X:31/little>> || <<X:31>> <= <<1:31,2:31,3:31,4:31>> >>,
- ?line <<1:31/little,2:31/little,3:31/little,4:31/little>> =
+ <<1:31/little,2:31/little,3:31/little,4:31/little>> =
<< <<X:31/little>> || <<X:15>> <= <<1:15,2:15,3:15,4:15>> >>,
- ok.
+ ok.
extended_byte_aligned(Config) when is_list(Config) ->
- ?line <<"abcdefg">> = << <<(X+32)>> || X <- "ABCDEFG" >>,
- ?line "abcdefg" = [(X+32) || <<X>> <= <<"ABCDEFG">>],
- ?line <<1:32/little,2:32/little,3:32/little,4:32/little>> =
+ <<"abcdefg">> = << <<(X+32)>> || X <- "ABCDEFG" >>,
+ "abcdefg" = [(X+32) || <<X>> <= <<"ABCDEFG">>],
+ <<1:32/little,2:32/little,3:32/little,4:32/little>> =
<< <<X:32/little>> || X <- [1,2,3,4] >>,
- ?line [256,512,768,1024] =
+ [256,512,768,1024] =
[X || <<X:16/little>> <= <<1:16,2:16,3:16,4:16>>],
- ok.
+ ok.
extended_bit_aligned(Config) when is_list(Config) ->
- ?line <<$a:7,$b:7,$c:7,$d:7,$e:7,$f:7,$g:7>> =
+ <<$a:7,$b:7,$c:7,$d:7,$e:7,$f:7,$g:7>> =
<< <<(X+32):7>> || X <- "ABCDEFG" >>,
- ?line "ABCDEFG" = [(X-32) || <<X:7>> <= <<$a:7,$b:7,$c:7,$d:7,$e:7,$f:7,$g:7>>],
- ?line <<1:31/little,2:31/little,3:31/little,4:31/little>> =
+ "ABCDEFG" = [(X-32) || <<X:7>> <= <<$a:7,$b:7,$c:7,$d:7,$e:7,$f:7,$g:7>>],
+ <<1:31/little,2:31/little,3:31/little,4:31/little>> =
<< <<X:31/little>> || X <- [1,2,3,4] >>,
- ?line [256,512,768,1024] =
+ [256,512,768,1024] =
[X || <<X:15/little>> <= <<1:15,2:15,3:15,4:15>>],
ok.
mixed(Config) when is_list(Config) ->
- ?line <<2,3,3,4,4,5,5,6>> =
+ <<2,3,3,4,4,5,5,6>> =
<< <<(X+Y)>> || <<X>> <= <<1,2,3,4>>, <<Y>> <= <<1,2>> >>,
- ?line <<2,3,3,4,4,5,5,6>> =
+ <<2,3,3,4,4,5,5,6>> =
<< <<(X+Y)>> || <<X>> <= <<1,2,3,4>>, Y <- [1,2] >>,
- ?line <<2,3,3,4,4,5,5,6>> =
+ <<2,3,3,4,4,5,5,6>> =
<< <<(X+Y)>> || X <- [1,2,3,4], Y <- [1,2] >>,
- ?line [2,3,3,4,4,5,5,6] =
+ [2,3,3,4,4,5,5,6] =
[(X+Y) || <<X>> <= <<1,2,3,4>>, <<Y>> <= <<1,2>>],
- ?line [2,3,3,4,4,5,5,6] =
+ [2,3,3,4,4,5,5,6] =
[(X+Y) || <<X>> <= <<1,2,3,4>>, Y <- [1,2]],
- ?line <<2:3,3:3,3:3,4:3,4:3,5:3,5:3,6:3>> =
+ <<2:3,3:3,3:3,4:3,4:3,5:3,5:3,6:3>> =
<< <<(X+Y):3>> || <<X:3>> <= <<1:3,2:3,3:3,4:3>>, <<Y:3>> <= <<1:3,2:3>> >>,
- ?line <<2:3,3:3,3:3,4:3,4:3,5:3,5:3,6:3>> =
+ <<2:3,3:3,3:3,4:3,4:3,5:3,5:3,6:3>> =
<< <<(X+Y):3>> || <<X:3>> <= <<1:3,2:3,3:3,4:3>>, Y <- [1,2] >>,
- ?line <<2:3,3:3,3:3,4:3,4:3,5:3,5:3,6:3>> =
+ <<2:3,3:3,3:3,4:3,4:3,5:3,5:3,6:3>> =
<< <<(X+Y):3>> || X <- [1,2,3,4], Y <- [1,2] >>,
- ?line [2,3,3,4,4,5,5,6] =
+ [2,3,3,4,4,5,5,6] =
[(X+Y) || <<X:3>> <= <<1:3,2:3,3:3,4:3>>, <<Y:3>> <= <<1:3,2:3>>],
- ?line [2,3,3,4,4,5,5,6] =
+ [2,3,3,4,4,5,5,6] =
[(X+Y) || <<X:3>> <= <<1:3,2:3,3:3,4:3>>, Y <- [1,2]],
ok.
diff --git a/lib/debugger/test/bs_construct_SUITE.erl b/lib/debugger/test/bs_construct_SUITE.erl
index 966c096c3a..6c6435c61a 100644
--- a/lib/debugger/test/bs_construct_SUITE.erl
+++ b/lib/debugger/test/bs_construct_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -38,7 +38,9 @@
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,15}}].
all() ->
[test1, test2, test3, test4, test5, testf, not_used,
@@ -57,17 +59,14 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(15)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
@@ -84,9 +83,9 @@ r(L) ->
-define(T(B, L), {B, ??B, L}).
-define(N(B), {B, ??B, unknown}).
--define(FAIL(Expr), ?line fail_check(catch Expr, ??Expr, [])).
+-define(FAIL(Expr), fail_check(catch Expr, ??Expr, [])).
--define(FAIL_VARS(Expr, Vars), ?line fail_check(catch Expr, ??Expr, Vars)).
+-define(FAIL_VARS(Expr, Vars), fail_check(catch Expr, ??Expr, Vars)).
l(I_13, I_big1) ->
[
@@ -162,7 +161,7 @@ l(I_13, I_big1) ->
?T(<<<<344:17>>/binary-unit:17>>, <<344:17>>),
?T(<<<<42,3,7656:16>>/binary-unit:16>>, <<42,3,7656:16>>)
- ].
+ ].
native_3798() ->
case <<1:16/native>> of
@@ -205,7 +204,7 @@ one_test({C_bin, E_bin, Str, Bytes}) when is_list(Bytes) ->
true ->
io:format("ERROR: Compiled: ~p. Expected ~p. Got ~p.~n",
[Str, Bytes, binary_to_list(C_bin)]),
- test_server:fail(comp)
+ ct:fail(comp)
end,
if
E_bin == Bin ->
@@ -213,7 +212,7 @@ one_test({C_bin, E_bin, Str, Bytes}) when is_list(Bytes) ->
true ->
io:format("ERROR: Interpreted: ~p. Expected ~p. Got ~p.~n",
[Str, Bytes, binary_to_list(E_bin)]),
- test_server:fail(comp)
+ ct:fail(comp)
end;
one_test({C_bin, E_bin, Str, Result}) ->
io:format(" ~s ~p~n", [Str, C_bin]),
@@ -234,7 +233,7 @@ one_test({C_bin, E_bin, Str, Result}) ->
io:format("ERROR: Compiled not equal to interpreted:"
"~n ~p, ~p.~n",
[binary_to_list(C_bin), binary_to_list(E_bin)]),
- test_server:fail(comp);
+ ct:fail(comp);
0 ->
ok;
%% For situations where the final bits may not matter, like
@@ -269,23 +268,22 @@ fail_check({'EXIT',{badarg,_}}, Str, Vars) ->
try evaluate(Str, Vars) of
Res ->
io:format("Interpreted result: ~p", [Res]),
- ?t:fail(did_not_fail_in_intepreted_code)
+ ct:fail(did_not_fail_in_intepreted_code)
catch
error:badarg ->
ok
end;
fail_check(Res, _, _) ->
io:format("Compiled result: ~p", [Res]),
- ?t:fail(did_not_fail_in_compiled_code).
+ ct:fail(did_not_fail_in_compiled_code).
%%% Simple working cases
-test1(suite) -> [];
test1(Config) when is_list(Config) ->
- ?line I_13 = i(13),
- ?line I_big1 = big(1),
- ?line Vars = [{'I_13', I_13},
- {'I_big1', I_big1}],
- ?line lists:foreach(fun one_test/1, eval_list(l(I_13, I_big1), Vars)).
+ I_13 = i(13),
+ I_big1 = big(1),
+ Vars = [{'I_13', I_13},
+ {'I_big1', I_big1}],
+ lists:foreach(fun one_test/1, eval_list(l(I_13, I_big1), Vars)).
%%% Misc
@@ -301,10 +299,9 @@ gen(N, S, A) ->
gen_l(N, S, A) ->
[?T(<<A:S/little, A:(N-S)/little>>, comp(N, A, S))].
-test2(suite) -> [];
test2(Config) when is_list(Config) ->
- ?line test2(0, 8, 2#10101010101010101),
- ?line test2(0, 8, 2#1111111111).
+ test2(0, 8, 2#10101010101010101),
+ test2(0, 8, 2#1111111111).
test2(End, End, _) ->
ok;
@@ -329,10 +326,9 @@ t3() ->
?N(<<>>)
].
-test3(suite) -> [];
test3(Config) when is_list(Config) ->
- ?line Vars = [],
- ?line lists:foreach(fun one_test/1, eval_list(t3(), Vars)).
+ Vars = [],
+ lists:foreach(fun one_test/1, eval_list(t3(), Vars)).
gen_u(N, S, A) ->
[?N(<<A:S, A:(N-S)>>)].
@@ -340,10 +336,9 @@ gen_u(N, S, A) ->
gen_u_l(N, S, A) ->
[?N(<<A:S/little, A:(N-S)/little>>)].
-test4(suite) -> [];
test4(Config) when is_list(Config) ->
- ?line test4(0, 16, 2#10101010101010101),
- ?line test4(0, 16, 2#1111111111).
+ test4(0, 16, 2#10101010101010101),
+ test4(0, 16, 2#1111111111).
test4(End, End, _) ->
ok;
@@ -361,11 +356,10 @@ gen_b(N, S, A) ->
[?T(<<A:S/binary-unit:1, A:(N-S)/binary-unit:1>>,
binary_to_list(<<A:S/binary-unit:1, A:(N-S)/binary-unit:1>>))].
-test5(suite) -> [];
-test5(doc) -> ["OTP-3995"];
+%% OTP-3995.
test5(Config) when is_list(Config) ->
- ?line test5(0, 8, <<73>>),
- ?line test5(0, 8, <<68>>).
+ test5(0, 8, <<73>>),
+ test5(0, 8, <<68>>).
test5(End, End, _) ->
ok;
@@ -379,47 +373,46 @@ test5(S, A) ->
lists:foreach(fun one_test/1, eval_list(gen_b(N, S, A), Vars)).
%%% Failure cases
-testf(suite) -> [];
testf(Config) when is_list(Config) ->
- ?line ?FAIL(<<3.14>>),
- ?line ?FAIL(<<<<1,2>>>>),
+ ?FAIL(<<3.14>>),
+ ?FAIL(<<<<1,2>>>>),
- ?line ?FAIL(<<2.71/binary>>),
- ?line ?FAIL(<<24334/binary>>),
- ?line ?FAIL(<<24334344294788947129487129487219847/binary>>),
+ ?FAIL(<<2.71/binary>>),
+ ?FAIL(<<24334/binary>>),
+ ?FAIL(<<24334344294788947129487129487219847/binary>>),
BigInt = id(24334344294788947129487129487219847),
- ?line ?FAIL_VARS(<<BigInt/binary>>, [{'BigInt',BigInt}]),
- ?line ?FAIL_VARS(<<42,BigInt/binary>>, [{'BigInt',BigInt}]),
- ?line ?FAIL_VARS(<<BigInt:2/binary>>, [{'BigInt',BigInt}]),
+ ?FAIL_VARS(<<BigInt/binary>>, [{'BigInt',BigInt}]),
+ ?FAIL_VARS(<<42,BigInt/binary>>, [{'BigInt',BigInt}]),
+ ?FAIL_VARS(<<BigInt:2/binary>>, [{'BigInt',BigInt}]),
%% One negative field size, but the sum of field sizes will be 1 byte.
%% Make sure that we reject that properly.
I_minus_777 = id(-777),
I_minus_2047 = id(-2047),
- ?line ?FAIL_VARS(<<I_minus_777:2048/unit:8,57:I_minus_2047/unit:8>>,
- ordsets:from_list([{'I_minus_777',I_minus_777},
- {'I_minus_2047',I_minus_2047}])),
- ?line ?FAIL(<<<<1,2,3>>/float>>),
+ ?FAIL_VARS(<<I_minus_777:2048/unit:8,57:I_minus_2047/unit:8>>,
+ ordsets:from_list([{'I_minus_777',I_minus_777},
+ {'I_minus_2047',I_minus_2047}])),
+ ?FAIL(<<<<1,2,3>>/float>>),
%% Negative field widths.
- ?line testf_1(-8, <<1,2,3,4,5>>),
- ?line ?FAIL(<<0:(-(1 bsl 100))>>),
+ testf_1(-8, <<1,2,3,4,5>>),
+ ?FAIL(<<0:(-(1 bsl 100))>>),
- ?line ?FAIL(<<42:(-16)>>),
- ?line ?FAIL(<<3.14:(-8)/float>>),
- ?line ?FAIL(<<<<23,56,0,2>>:(-16)/binary>>),
- ?line ?FAIL(<<<<23,56,0,2>>:(2.5)/binary>>),
- ?line ?FAIL(<<<<23,56,0,2>>:(anka)>>),
- ?line ?FAIL(<<<<23,56,0,2>>:(anka)>>),
+ ?FAIL(<<42:(-16)>>),
+ ?FAIL(<<3.14:(-8)/float>>),
+ ?FAIL(<<<<23,56,0,2>>:(-16)/binary>>),
+ ?FAIL(<<<<23,56,0,2>>:(2.5)/binary>>),
+ ?FAIL(<<<<23,56,0,2>>:(anka)>>),
+ ?FAIL(<<<<23,56,0,2>>:(anka)>>),
%% Unit failures.
- ?line ?FAIL(<<<<1:1>>/binary>>),
+ ?FAIL(<<<<1:1>>/binary>>),
Sz = id(1),
- ?line ?FAIL_VARS(<<<<1:Sz>>/binary>>, [{'Sz',Sz}]),
- ?line {'EXIT',{badarg,_}} = (catch <<<<1:(id(1))>>/binary>>),
- ?line ?FAIL(<<<<7,8,9>>/binary-unit:16>>),
- ?line ?FAIL(<<<<7,8,9,3:7>>/binary-unit:16>>),
- ?line ?FAIL(<<<<7,8,9,3:7>>/binary-unit:17>>),
+ ?FAIL_VARS(<<<<1:Sz>>/binary>>, [{'Sz',Sz}]),
+ {'EXIT',{badarg,_}} = (catch <<<<1:(id(1))>>/binary>>),
+ ?FAIL(<<<<7,8,9>>/binary-unit:16>>),
+ ?FAIL(<<<<7,8,9,3:7>>/binary-unit:16>>),
+ ?FAIL(<<<<7,8,9,3:7>>/binary-unit:17>>),
ok.
@@ -429,14 +422,13 @@ testf_1(W, B) ->
?FAIL_VARS(<<3.14:W/float>>, Vars),
?FAIL_VARS(<<B:W/binary>>, [{'B',B}|Vars]).
-not_used(doc) ->
- "Test that constructed binaries that are not used will still give an exception.";
+%% Test that constructed binaries that are not used will still give an exception.
not_used(Config) when is_list(Config) ->
- ?line ok = not_used1(3, <<"dum">>),
- ?line {'EXIT',{badarg,_}} = (catch not_used1(3, "dum")),
- ?line {'EXIT',{badarg,_}} = (catch not_used2(444, -2)),
- ?line {'EXIT',{badarg,_}} = (catch not_used2(444, anka)),
- ?line {'EXIT',{badarg,_}} = (catch not_used3(444)),
+ ok = not_used1(3, <<"dum">>),
+ {'EXIT',{badarg,_}} = (catch not_used1(3, "dum")),
+ {'EXIT',{badarg,_}} = (catch not_used2(444, -2)),
+ {'EXIT',{badarg,_}} = (catch not_used2(444, anka)),
+ {'EXIT',{badarg,_}} = (catch not_used3(444)),
ok.
not_used1(I, BinString) ->
@@ -452,11 +444,11 @@ not_used3(I) ->
ok.
in_guard(Config) when is_list(Config) ->
- ?line 1 = in_guard(<<16#74ad:16>>, 16#e95, 5),
- ?line 2 = in_guard(<<16#3A,16#F7,"hello">>, 16#3AF7, <<"hello">>),
- ?line 3 = in_guard(<<16#FBCD:14,3.1415/float,3:2>>, 16#FBCD, 3.1415),
- ?line 3 = in_guard(<<16#FBCD:14,3/float,3:2>>, 16#FBCD, 3),
- ?line 3 = in_guard(<<16#FBCD:14,(2 bsl 226)/float,3:2>>, 16#FBCD, 2 bsl 226),
+ 1 = in_guard(<<16#74ad:16>>, 16#e95, 5),
+ 2 = in_guard(<<16#3A,16#F7,"hello">>, 16#3AF7, <<"hello">>),
+ 3 = in_guard(<<16#FBCD:14,3.1415/float,3:2>>, 16#FBCD, 3.1415),
+ 3 = in_guard(<<16#FBCD:14,3/float,3:2>>, 16#FBCD, 3),
+ 3 = in_guard(<<16#FBCD:14,(2 bsl 226)/float,3:2>>, 16#FBCD, 2 bsl 226),
nope = in_guard(<<1>>, 42, b),
nope = in_guard(<<1>>, a, b),
nope = in_guard(<<1,2>>, 1, 1),
@@ -470,16 +462,16 @@ in_guard(Bin, A, B) when <<A:14,B/float,3:2>> == Bin -> 3;
in_guard(Bin, A, B) when {a,b,<<A:14,B/float,3:2>>} == Bin -> cant_happen;
in_guard(_, _, _) -> nope.
-mem_leak(doc) -> "Make sure that construction has no memory leak";
+%% Make sure that construction has no memory leak.
mem_leak(Config) when is_list(Config) ->
- ?line B = make_bin(16, <<0>>),
- ?line mem_leak(1024, B),
+ B = make_bin(16, <<0>>),
+ mem_leak(1024, B),
ok.
mem_leak(0, _) -> ok;
mem_leak(N, B) ->
- ?line big_bin(B, <<23>>),
- ?line {'EXIT',{badarg,_}} = (catch big_bin(B, bad)),
+ big_bin(B, <<23>>),
+ {'EXIT',{badarg,_}} = (catch big_bin(B, bad)),
mem_leak(N-1, B).
big_bin(B1, B2) ->
@@ -493,18 +485,18 @@ make_bin(0, Acc) -> Acc;
make_bin(N, Acc) -> make_bin(N-1, <<Acc/binary,Acc/binary>>).
-define(COF(Int0),
- ?line (fun(Int) ->
- true = <<Int:32/float>> =:= <<(float(Int)):32/float>>,
- true = <<Int:64/float>> =:= <<(float(Int)):64/float>>
- end)(nonliteral(Int0)),
- ?line true = <<Int0:32/float>> =:= <<(float(Int0)):32/float>>,
- ?line true = <<Int0:64/float>> =:= <<(float(Int0)):64/float>>).
+ (fun(Int) ->
+ true = <<Int:32/float>> =:= <<(float(Int)):32/float>>,
+ true = <<Int:64/float>> =:= <<(float(Int)):64/float>>
+ end)(nonliteral(Int0)),
+ true = <<Int0:32/float>> =:= <<(float(Int0)):32/float>>,
+ true = <<Int0:64/float>> =:= <<(float(Int0)):64/float>>).
-define(COF64(Int0),
- ?line (fun(Int) ->
- true = <<Int:64/float>> =:= <<(float(Int)):64/float>>
- end)(nonliteral(Int0)),
- ?line true = <<Int0:64/float>> =:= <<(float(Int0)):64/float>>).
+ (fun(Int) ->
+ true = <<Int:64/float>> =:= <<(float(Int)):64/float>>
+ end)(nonliteral(Int0)),
+ true = <<Int0:64/float>> =:= <<(float(Int0)):64/float>>).
nonliteral(X) -> X.
@@ -523,7 +515,7 @@ coerce_to_float(Config) when is_list(Config) ->
ok.
bjorn(Config) when is_list(Config) ->
- ?line error = bjorn_1(),
+ error = bjorn_1(),
ok.
bjorn_1() ->
@@ -551,30 +543,30 @@ do_something() ->
throw(blurf).
huge_float_field(Config) when is_list(Config) ->
- ?line {'EXIT',{badarg,_}} = (catch <<0.0:9/float-unit:8>>),
- ?line huge_float_check(catch <<0.0:67108865/float-unit:64>>),
- ?line huge_float_check(catch <<0.0:((1 bsl 26)+1)/float-unit:64>>),
- ?line huge_float_check(catch <<0.0:(id(67108865))/float-unit:64>>),
-%% ?line huge_float_check(catch <<0.0:((1 bsl 60)+1)/float-unit:64>>),
- ?line huge_float_check(catch <<3839739387439387383739387987347983:((1 bsl 26)+1)/float-unit:64>>),
-%% ?line huge_float_check(catch <<3839739387439387383739387987347983:((1 bsl 60)+1)/float-unit:64>>),
+ {'EXIT',{badarg,_}} = (catch <<0.0:9/float-unit:8>>),
+ huge_float_check(catch <<0.0:67108865/float-unit:64>>),
+ huge_float_check(catch <<0.0:((1 bsl 26)+1)/float-unit:64>>),
+ huge_float_check(catch <<0.0:(id(67108865))/float-unit:64>>),
+ %% huge_float_check(catch <<0.0:((1 bsl 60)+1)/float-unit:64>>),
+ huge_float_check(catch <<3839739387439387383739387987347983:((1 bsl 26)+1)/float-unit:64>>),
+ %% huge_float_check(catch <<3839739387439387383739387987347983:((1 bsl 60)+1)/float-unit:64>>),
ok.
huge_float_check({'EXIT',{system_limit,_}}) -> ok;
huge_float_check({'EXIT',{badarg,_}}) -> ok.
huge_binary(Config) when is_list(Config) ->
- ?line 16777216 = size(<<0:(id(1 bsl 26)),(-1):(id(1 bsl 26))>>),
+ 16777216 = size(<<0:(id(1 bsl 26)),(-1):(id(1 bsl 26))>>),
ok.
system_limit(Config) when is_list(Config) ->
WordSize = erlang:system_info(wordsize),
BitsPerWord = WordSize * 8,
- ?line {'EXIT',{system_limit,_}} =
+ {'EXIT',{system_limit,_}} =
(catch <<0:(id(0)),42:(id(1 bsl BitsPerWord))>>),
- ?line {'EXIT',{system_limit,_}} =
+ {'EXIT',{system_limit,_}} =
(catch <<42:(id(1 bsl BitsPerWord)),0:(id(0))>>),
- ?line {'EXIT',{system_limit,_}} =
+ {'EXIT',{system_limit,_}} =
(catch <<(id(<<>>))/binary,0:(id(1 bsl 100))>>),
case WordSize of
@@ -585,13 +577,13 @@ system_limit(Config) when is_list(Config) ->
end.
system_limit_32() ->
- ?line {'EXIT',{badarg,_}} = (catch <<42:(-1)>>),
- ?line {'EXIT',{badarg,_}} = (catch <<42:(id(-1))>>),
- ?line {'EXIT',{badarg,_}} = (catch <<42:(id(-389739873536870912))/unit:8>>),
- ?line {'EXIT',{system_limit,_}} = (catch <<42:536870912/unit:8>>),
- ?line {'EXIT',{system_limit,_}} = (catch <<42:(id(536870912))/unit:8>>),
- ?line {'EXIT',{system_limit,_}} = (catch <<0:(id(8)),42:536870912/unit:8>>),
- ?line {'EXIT',{system_limit,_}} =
+ {'EXIT',{badarg,_}} = (catch <<42:(-1)>>),
+ {'EXIT',{badarg,_}} = (catch <<42:(id(-1))>>),
+ {'EXIT',{badarg,_}} = (catch <<42:(id(-389739873536870912))/unit:8>>),
+ {'EXIT',{system_limit,_}} = (catch <<42:536870912/unit:8>>),
+ {'EXIT',{system_limit,_}} = (catch <<42:(id(536870912))/unit:8>>),
+ {'EXIT',{system_limit,_}} = (catch <<0:(id(8)),42:536870912/unit:8>>),
+ {'EXIT',{system_limit,_}} =
(catch <<0:(id(8)),42:(id(536870912))/unit:8>>),
ok.
@@ -601,34 +593,34 @@ badarg(Config) when is_list(Config) ->
%% but the debugger will generate a system_limit exception.
%% It does not seems worthwhile to fix the debugger.
- ?line {'EXIT',{badarg,_}} =
+ {'EXIT',{badarg,_}} =
(catch <<(id(<<>>))/binary,0:(id(-(1 bsl 100)))>>),
ok.
copy_writable_binary(Config) when is_list(Config) ->
- ?line [copy_writable_binary_1(I) || I <- lists:seq(0, 256)],
+ [copy_writable_binary_1(I) || I <- lists:seq(0, 256)],
ok.
copy_writable_binary_1(_) ->
- ?line Bin0 = <<(id(<<>>))/binary,0,1,2,3,4,5,6,7>>,
- ?line SubBin = make_sub_bin(Bin0),
- ?line id(<<42,34,55,Bin0/binary>>), %Make reallocation likelier.
- ?line Pid = spawn(fun() ->
- copy_writable_binary_holder(Bin0, SubBin)
- end),
- ?line Tab = ets:new(holder, []),
- ?line ets:insert(Tab, {17,Bin0}),
- ?line ets:insert(Tab, {42,SubBin}),
- ?line id(<<Bin0/binary,0:(64*1024*8)>>),
- ?line Pid ! self(),
- ?line [{17,Bin0}] = ets:lookup(Tab, 17),
- ?line [{42,Bin0}] = ets:lookup(Tab, 42),
+ Bin0 = <<(id(<<>>))/binary,0,1,2,3,4,5,6,7>>,
+ SubBin = make_sub_bin(Bin0),
+ id(<<42,34,55,Bin0/binary>>), %Make reallocation likelier.
+ Pid = spawn(fun() ->
+ copy_writable_binary_holder(Bin0, SubBin)
+ end),
+ Tab = ets:new(holder, []),
+ ets:insert(Tab, {17,Bin0}),
+ ets:insert(Tab, {42,SubBin}),
+ id(<<Bin0/binary,0:(64*1024*8)>>),
+ Pid ! self(),
+ [{17,Bin0}] = ets:lookup(Tab, 17),
+ [{42,Bin0}] = ets:lookup(Tab, 42),
receive
{Pid,Bin0,Bin0} -> ok;
Other ->
io:format("Unexpected message: ~p", [Other]),
- ?line ?t:fail()
+ ct:fail(failed)
end,
ok.
@@ -656,7 +648,7 @@ dynamic(Config) when is_list(Config) ->
{'DOWN',Ref,process,Pid,normal} ->
ok;
{'DOWN',Ref,process,Pid,Exit} ->
- ?t:fail({Pid,Exit})
+ ct:fail({Pid,Exit})
end || {Pid,Ref} <- Ps],
ok.
@@ -743,17 +735,17 @@ otp_7422_bin(N) when N < 512 ->
otp_7422_bin(_) -> ok.
zero_width(Config) when is_list(Config) ->
- ?line Z = id(0),
+ Z = id(0),
Small = id(42),
Big = id(1 bsl 128),
- ?line <<>> = <<Small:Z>>,
- ?line <<>> = <<Small:0>>,
- ?line <<>> = <<Big:Z>>,
- ?line <<>> = <<Big:0>>,
-
- ?line {'EXIT',{badarg,_}} = (catch <<not_a_number:0>>),
- ?line {'EXIT',{badarg,_}} = (catch <<(id(not_a_number)):Z>>),
- ?line {'EXIT',{badarg,_}} = (catch <<(id(not_a_number)):0>>),
+ <<>> = <<Small:Z>>,
+ <<>> = <<Small:0>>,
+ <<>> = <<Big:Z>>,
+ <<>> = <<Big:0>>,
+
+ {'EXIT',{badarg,_}} = (catch <<not_a_number:0>>),
+ {'EXIT',{badarg,_}} = (catch <<(id(not_a_number)):Z>>),
+ {'EXIT',{badarg,_}} = (catch <<(id(not_a_number)):0>>),
ok.
diff --git a/lib/debugger/test/bs_match_bin_SUITE.erl b/lib/debugger/test/bs_match_bin_SUITE.erl
index 98c1013210..cd62874a9d 100644
--- a/lib/debugger/test/bs_match_bin_SUITE.erl
+++ b/lib/debugger/test/bs_match_bin_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -29,7 +29,9 @@
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[byte_split_binary, bit_split_binary, match_huge_bin].
@@ -45,50 +47,47 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
ok.
-byte_split_binary(doc) -> "Tries to split a binary at all byte-aligned positions.";
+%% Tries to split a binary at all byte-aligned positions.
byte_split_binary(Config) when is_list(Config) ->
- ?line L = lists:seq(0, 57),
- ?line B = mkbin(L),
- ?line byte_split(L, B, size(B)),
- ?line Unaligned = make_unaligned_sub_binary(B),
- ?line byte_split(L, Unaligned, size(Unaligned)).
+ L = lists:seq(0, 57),
+ B = mkbin(L),
+ byte_split(L, B, size(B)),
+ Unaligned = make_unaligned_sub_binary(B),
+ byte_split(L, Unaligned, size(Unaligned)).
byte_split(L, B, Pos) when Pos >= 0 ->
- ?line Sz1 = Pos,
- ?line Sz2 = size(B) - Pos,
- ?line <<B1:Sz1/binary,B2:Sz2/binary>> = B,
- ?line B1 = list_to_binary(lists:sublist(L, 1, Pos)),
- ?line B2 = list_to_binary(lists:nthtail(Pos, L)),
- ?line byte_split(L, B, Pos-1);
+ Sz1 = Pos,
+ Sz2 = size(B) - Pos,
+ <<B1:Sz1/binary,B2:Sz2/binary>> = B,
+ B1 = list_to_binary(lists:sublist(L, 1, Pos)),
+ B2 = list_to_binary(lists:nthtail(Pos, L)),
+ byte_split(L, B, Pos-1);
byte_split(_, _, _) -> ok.
-bit_split_binary(doc) -> "Tries to split a binary at all positions.";
+%% Tries to split a binary at all positions.
bit_split_binary(Config) when is_list(Config) ->
Fun = fun(Bin, List, SkipBef, N) ->
- ?line SkipAft = 8*size(Bin) - N - SkipBef,
+ SkipAft = 8*size(Bin) - N - SkipBef,
%%io:format("~p, ~p, ~p", [SkipBef,N,SkipAft]),
- ?line <<_:SkipBef,OutBin:N/binary-unit:1,_:SkipAft>> = Bin,
- ?line OutBin = make_bin_from_list(List, N)
+ <<_:SkipBef,OutBin:N/binary-unit:1,_:SkipAft>> = Bin,
+ OutBin = make_bin_from_list(List, N)
end,
- ?line bit_split_binary1(Fun, erlang:md5(<<1,2,3>>)),
- ?line bit_split_binary1(Fun,
- make_unaligned_sub_binary(erlang:md5(<<1,2,3>>))),
+ bit_split_binary1(Fun, erlang:md5(<<1,2,3>>)),
+ bit_split_binary1(Fun,
+ make_unaligned_sub_binary(erlang:md5(<<1,2,3>>))),
ok.
bit_split_binary1(Action, Bin) ->
@@ -133,19 +132,19 @@ make_unaligned_sub_binary(Bin0) ->
id(I) -> I.
match_huge_bin(Config) when is_list(Config) ->
- ?line Bin = <<0:(1 bsl 27),13:8>>,
- ?line skip_huge_bin_1(1 bsl 27, Bin),
- ?line 16777216 = match_huge_bin_1(1 bsl 27, Bin),
+ Bin = <<0:(1 bsl 27),13:8>>,
+ skip_huge_bin_1(1 bsl 27, Bin),
+ 16777216 = match_huge_bin_1(1 bsl 27, Bin),
%% Test overflowing the size of a binary field.
- ?line nomatch = overflow_huge_bin_skip_32(Bin),
- ?line nomatch = overflow_huge_bin_32(Bin),
- ?line nomatch = overflow_huge_bin_skip_64(Bin),
- ?line nomatch = overflow_huge_bin_64(Bin),
+ nomatch = overflow_huge_bin_skip_32(Bin),
+ nomatch = overflow_huge_bin_32(Bin),
+ nomatch = overflow_huge_bin_skip_64(Bin),
+ nomatch = overflow_huge_bin_64(Bin),
%% Size in variable
- ?line ok = overflow_huge_bin(Bin, lists:seq(25, 32)++lists:seq(50, 64)),
- ?line ok = overflow_huge_bin_unit128(Bin, lists:seq(25, 32)++lists:seq(50, 64)),
+ ok = overflow_huge_bin(Bin, lists:seq(25, 32)++lists:seq(50, 64)),
+ ok = overflow_huge_bin_unit128(Bin, lists:seq(25, 32)++lists:seq(50, 64)),
ok.
diff --git a/lib/debugger/test/bs_match_int_SUITE.erl b/lib/debugger/test/bs_match_int_SUITE.erl
index 11b5e30efd..8ff5fe260e 100644
--- a/lib/debugger/test/bs_match_int_SUITE.erl
+++ b/lib/debugger/test/bs_match_int_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -30,7 +30,9 @@
-import(lists, [seq/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,4}}].
all() ->
[integer, signed_integer, dynamic, more_dynamic, mml,
@@ -47,39 +49,36 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(4)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
ok.
integer(Config) when is_list(Config) ->
- ?line 0 = get_int(mkbin([])),
- ?line 0 = get_int(mkbin([0])),
- ?line 42 = get_int(mkbin([42])),
- ?line 255 = get_int(mkbin([255])),
- ?line 256 = get_int(mkbin([1,0])),
- ?line 257 = get_int(mkbin([1,1])),
- ?line 258 = get_int(mkbin([1,2])),
- ?line 258 = get_int(mkbin([1,2])),
- ?line 65534 = get_int(mkbin([255,254])),
- ?line 16776455 = get_int(mkbin([255,253,7])),
- ?line 4245492555 = get_int(mkbin([253,13,19,75])),
- ?line 4294967294 = get_int(mkbin([255,255,255,254])),
- ?line 4294967295 = get_int(mkbin([255,255,255,255])),
- ?line Eight = [200,1,19,128,222,42,97,111],
- ?line cmp128(Eight, uint(Eight)),
- ?line fun_clause(catch get_int(mkbin(seq(1,5)))),
+ 0 = get_int(mkbin([])),
+ 0 = get_int(mkbin([0])),
+ 42 = get_int(mkbin([42])),
+ 255 = get_int(mkbin([255])),
+ 256 = get_int(mkbin([1,0])),
+ 257 = get_int(mkbin([1,1])),
+ 258 = get_int(mkbin([1,2])),
+ 258 = get_int(mkbin([1,2])),
+ 65534 = get_int(mkbin([255,254])),
+ 16776455 = get_int(mkbin([255,253,7])),
+ 4245492555 = get_int(mkbin([253,13,19,75])),
+ 4294967294 = get_int(mkbin([255,255,255,254])),
+ 4294967295 = get_int(mkbin([255,255,255,255])),
+ Eight = [200,1,19,128,222,42,97,111],
+ cmp128(Eight, uint(Eight)),
+ fun_clause(catch get_int(mkbin(seq(1,5)))),
ok.
get_int(Bin) ->
@@ -102,13 +101,13 @@ cmp128(<<I:128>>, I) -> equal;
cmp128(_, _) -> not_equal.
signed_integer(Config) when is_list(Config) ->
- ?line {no_match,_} = sint(mkbin([])),
- ?line {no_match,_} = sint(mkbin([1,2,3])),
- ?line 127 = sint(mkbin([127])),
- ?line -1 = sint(mkbin([255])),
- ?line -128 = sint(mkbin([128])),
- ?line 42 = sint(mkbin([42,255])),
- ?line 127 = sint(mkbin([127,255])).
+ {no_match,_} = sint(mkbin([])),
+ {no_match,_} = sint(mkbin([1,2,3])),
+ 127 = sint(mkbin([127])),
+ -1 = sint(mkbin([255])),
+ -128 = sint(mkbin([128])),
+ 42 = sint(mkbin([42,255])),
+ 127 = sint(mkbin([127,255])).
sint(Bin) ->
case Bin of
@@ -135,7 +134,7 @@ dynamic(Bin, S1) when S1 >= 0 ->
dynamic(_, _) -> ok.
dynamic(Bin, S1, S2, A, B) ->
-% io:format("~p ~p ~p ~p\n", [S1,S2,A,B]),
+ %% io:format("~p ~p ~p ~p\n", [S1,S2,A,B]),
case Bin of
<<A:S1,B:S2>> ->
io:format("~p ~p ~p ~p\n", [S1,S2,A,B]),
@@ -143,16 +142,16 @@ dynamic(Bin, S1, S2, A, B) ->
_Other -> erlang:error(badmatch, [Bin,S1,S2,A,B])
end.
-more_dynamic(doc) -> "Extract integers at different alignments and of different sizes.";
+%% Extract integers at different alignments and of different sizes.
more_dynamic(Config) when is_list(Config) ->
- % Unsigned big-endian numbers.
+ %% Unsigned big-endian numbers.
Unsigned = fun(Bin, List, SkipBef, N) ->
SkipAft = 8*size(Bin) - N - SkipBef,
<<_:SkipBef,Int:N,_:SkipAft>> = Bin,
Int = make_int(List, N, 0)
end,
- ?line more_dynamic1(Unsigned, funny_binary(42)),
+ more_dynamic1(Unsigned, funny_binary(42)),
%% Signed big-endian numbers.
Signed = fun(Bin, List, SkipBef, N) ->
@@ -164,10 +163,10 @@ more_dynamic(Config) when is_list(Config) ->
io:format("Bin = ~p,", [Bin]),
io:format("SkipBef = ~p, N = ~p", [SkipBef,N]),
io:format("Expected ~p, got ~p", [Int,Other]),
- ?t:fail()
+ ct:fail(failed)
end
end,
- ?line more_dynamic1(Signed, funny_binary(43)),
+ more_dynamic1(Signed, funny_binary(43)),
%% Unsigned little-endian numbers.
UnsLittle = fun(Bin, List, SkipBef, N) ->
@@ -175,7 +174,7 @@ more_dynamic(Config) when is_list(Config) ->
<<_:SkipBef,Int:N/little,_:SkipAft>> = Bin,
Int = make_int(big_to_little(List, N), N, 0)
end,
- ?line more_dynamic1(UnsLittle, funny_binary(44)),
+ more_dynamic1(UnsLittle, funny_binary(44)),
%% Signed little-endian numbers.
SignLittle = fun(Bin, List, SkipBef, N) ->
@@ -184,7 +183,7 @@ more_dynamic(Config) when is_list(Config) ->
Little = big_to_little(List, N),
Int = make_signed_int(Little, N)
end,
- ?line more_dynamic1(SignLittle, funny_binary(45)),
+ more_dynamic1(SignLittle, funny_binary(45)),
ok.
@@ -198,7 +197,7 @@ more_dynamic2(Action, Bin, [_|T]=List, Bef) ->
more_dynamic2(_, _, [], _) -> ok.
more_dynamic3(Action, Bin, List, Bef, Aft) when Bef =< Aft ->
-%% io:format("~p, ~p", [Bef,Aft-Bef]),
+ %% io:format("~p, ~p", [Bef,Aft-Bef]),
Action(Bin, List, Bef, Aft-Bef),
more_dynamic3(Action, Bin, List, Bef, Aft-1);
more_dynamic3(_, _, _, _, _) -> ok.
@@ -244,23 +243,23 @@ funny_binary(N) ->
B1.
mml(Config) when is_list(Config) ->
- ?line single_byte_binary = mml_choose(<<42>>),
- ?line multi_byte_binary = mml_choose(<<42,43>>).
+ single_byte_binary = mml_choose(<<42>>),
+ multi_byte_binary = mml_choose(<<42,43>>).
mml_choose(<<_A:8>>) -> single_byte_binary;
mml_choose(<<_A:8,_T/binary>>) -> multi_byte_binary.
match_huge_int(Config) when is_list(Config) ->
Sz = 1 bsl 27,
- ?line Bin = <<0:Sz,13:8>>,
- ?line skip_huge_int_1(Sz, Bin),
- ?line 0 = match_huge_int_1(Sz, Bin),
+ Bin = <<0:Sz,13:8>>,
+ skip_huge_int_1(Sz, Bin),
+ 0 = match_huge_int_1(Sz, Bin),
%% Test overflowing the size of an integer field.
- ?line nomatch = overflow_huge_int_skip_32(Bin),
+ nomatch = overflow_huge_int_skip_32(Bin),
case erlang:system_info(wordsize) of
4 ->
- ?line nomatch = overflow_huge_int_32(Bin);
+ nomatch = overflow_huge_int_32(Bin);
8 ->
%% An attempt will be made to allocate heap space for
%% the bignum (which will probably fail); only if the
@@ -268,15 +267,15 @@ match_huge_int(Config) when is_list(Config) ->
%% the binary is too small.
ok
end,
- ?line nomatch = overflow_huge_int_skip_64(Bin),
- ?line nomatch = overflow_huge_int_64(Bin),
+ nomatch = overflow_huge_int_skip_64(Bin),
+ nomatch = overflow_huge_int_64(Bin),
%% Test overflowing the size of an integer field using variables as sizes.
- ?line Sizes = case erlang:system_info(wordsize) of
- 4 -> lists:seq(25, 32);
- 8 -> []
- end ++ lists:seq(50, 64),
- ?line ok = overflow_huge_int_unit128(Bin, Sizes),
+ Sizes = case erlang:system_info(wordsize) of
+ 4 -> lists:seq(25, 32);
+ 8 -> []
+ end ++ lists:seq(50, 64),
+ ok = overflow_huge_int_unit128(Bin, Sizes),
ok.
@@ -343,19 +342,19 @@ overflow_huge_int_64(<<Int:9223372036854775808/unit:128,0,_/binary>>) -> {8,Int}
overflow_huge_int_64(_) -> nomatch.
bignum(Config) when is_list(Config) ->
- ?line Bin = id(<<42,0:1024/unit:8,43>>),
- ?line <<42:1025/little-integer-unit:8,_:8>> = Bin,
- ?line <<_:8,43:1025/integer-unit:8>> = Bin,
+ Bin = id(<<42,0:1024/unit:8,43>>),
+ <<42:1025/little-integer-unit:8,_:8>> = Bin,
+ <<_:8,43:1025/integer-unit:8>> = Bin,
- ?line BignumBin = id(<<0:512/unit:8,258254417031933722623:9/unit:8>>),
- ?line <<258254417031933722623:(512+9)/unit:8>> = BignumBin,
+ BignumBin = id(<<0:512/unit:8,258254417031933722623:9/unit:8>>),
+ <<258254417031933722623:(512+9)/unit:8>> = BignumBin,
erlang:garbage_collect(), %Search for holes in debug-build.
ok.
unaligned_32_bit(Config) when is_list(Config) ->
%% There used to be a risk for heap overflow (fixed in R11B-5).
- ?line L = unaligned_32_bit_1(<<-1:(64*1024)>>),
- ?line unaligned_32_bit_verify(L, 1638).
+ L = unaligned_32_bit_1(<<-1:(64*1024)>>),
+ unaligned_32_bit_verify(L, 1638).
unaligned_32_bit_1(<<1:1,U:32,_:7,T/binary>>) ->
[U|unaligned_32_bit_1(T)];
diff --git a/lib/debugger/test/bs_match_misc_SUITE.erl b/lib/debugger/test/bs_match_misc_SUITE.erl
index 7196026dc7..fe86b54992 100644
--- a/lib/debugger/test/bs_match_misc_SUITE.erl
+++ b/lib/debugger/test/bs_match_misc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -31,7 +31,9 @@
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,15}}].
all() ->
[bound_var, bound_tail, t_float, little_float, sean,
@@ -49,8 +51,8 @@ end_per_group(_GroupName, Config) ->
Config.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
@@ -58,31 +60,28 @@ end_per_suite(Config) when is_list(Config) ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(15)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-bound_var(doc) -> "Test matching of bound variables.";
+%% Test matching of bound variables.
bound_var(Config) when is_list(Config) ->
- ?line ok = bound_var(42, 13, <<42,13>>),
- ?line nope = bound_var(42, 13, <<42,255>>),
- ?line nope = bound_var(42, 13, <<154,255>>),
+ ok = bound_var(42, 13, <<42,13>>),
+ nope = bound_var(42, 13, <<42,255>>),
+ nope = bound_var(42, 13, <<154,255>>),
ok.
bound_var(A, B, <<A:8,B:8>>) -> ok;
bound_var(_, _, _) -> nope.
-bound_tail(doc) -> "Test matching of a bound tail.";
+%% Test matching of a bound tail.
bound_tail(Config) when is_list(Config) ->
- ?line ok = bound_tail(<<>>, <<13,14>>),
- ?line ok = bound_tail(<<2,3>>, <<1,1,2,3>>),
- ?line nope = bound_tail(<<2,3>>, <<1,1,2,7>>),
- ?line nope = bound_tail(<<2,3>>, <<1,1,2,3,4>>),
- ?line nope = bound_tail(<<2,3>>, <<>>),
+ ok = bound_tail(<<>>, <<13,14>>),
+ ok = bound_tail(<<2,3>>, <<1,1,2,3>>),
+ nope = bound_tail(<<2,3>>, <<1,1,2,7>>),
+ nope = bound_tail(<<2,3>>, <<1,1,2,3,4>>),
+ nope = bound_tail(<<2,3>>, <<>>),
ok.
bound_tail(T, <<_:16,T/binary>>) -> ok;
@@ -92,26 +91,26 @@ t_float(Config) when is_list(Config) ->
F = f1(),
G = f_one(),
- ?line G = match_float(<<63,128,0,0>>, 32, 0),
- ?line G = match_float(<<63,240,0,0,0,0,0,0>>, 64, 0),
+ G = match_float(<<63,128,0,0>>, 32, 0),
+ G = match_float(<<63,240,0,0,0,0,0,0>>, 64, 0),
- ?line fcmp(F, match_float(<<F:32/float>>, 32, 0)),
- ?line fcmp(F, match_float(<<F:64/float>>, 64, 0)),
- ?line fcmp(F, match_float(<<1:1,F:32/float,127:7>>, 32, 1)),
- ?line fcmp(F, match_float(<<1:1,F:64/float,127:7>>, 64, 1)),
- ?line fcmp(F, match_float(<<1:13,F:32/float,127:3>>, 32, 13)),
- ?line fcmp(F, match_float(<<1:13,F:64/float,127:3>>, 64, 13)),
+ fcmp(F, match_float(<<F:32/float>>, 32, 0)),
+ fcmp(F, match_float(<<F:64/float>>, 64, 0)),
+ fcmp(F, match_float(<<1:1,F:32/float,127:7>>, 32, 1)),
+ fcmp(F, match_float(<<1:1,F:64/float,127:7>>, 64, 1)),
+ fcmp(F, match_float(<<1:13,F:32/float,127:3>>, 32, 13)),
+ fcmp(F, match_float(<<1:13,F:64/float,127:3>>, 64, 13)),
- ?line {'EXIT',{{badmatch,_},_}} = (catch match_float(<<0,0>>, 16, 0)),
- ?line {'EXIT',{{badmatch,_},_}} = (catch match_float(<<0,0>>, 16#7fffffff, 0)),
+ {'EXIT',{{badmatch,_},_}} = (catch match_float(<<0,0>>, 16, 0)),
+ {'EXIT',{{badmatch,_},_}} = (catch match_float(<<0,0>>, 16#7fffffff, 0)),
ok.
float_middle_endian(Config) when is_list(Config) ->
F = 9007199254740990.0, % turns to -NaN when word-swapped
- ?line fcmp(F, match_float(<<F:64/float>>, 64, 0)),
- ?line fcmp(F, match_float(<<1:1,F:64/float,127:7>>, 64, 1)),
- ?line fcmp(F, match_float(<<1:13,F:64/float,127:3>>, 64, 13)),
+ fcmp(F, match_float(<<F:64/float>>, 64, 0)),
+ fcmp(F, match_float(<<1:1,F:64/float,127:7>>, 64, 1)),
+ fcmp(F, match_float(<<1:13,F:64/float,127:3>>, 64, 13)),
ok.
@@ -128,15 +127,15 @@ little_float(Config) when is_list(Config) ->
F = f2(),
G = f_one(),
- ?line G = match_float_little(<<0,0,0,0,0,0,240,63>>, 64, 0),
- ?line G = match_float_little(<<0,0,128,63>>, 32, 0),
+ G = match_float_little(<<0,0,0,0,0,0,240,63>>, 64, 0),
+ G = match_float_little(<<0,0,128,63>>, 32, 0),
- ?line fcmp(F, match_float_little(<<F:32/float-little>>, 32, 0)),
- ?line fcmp(F, match_float_little(<<F:64/float-little>>, 64, 0)),
- ?line fcmp(F, match_float_little(<<1:1,F:32/float-little,127:7>>, 32, 1)),
- ?line fcmp(F, match_float_little(<<1:1,F:64/float-little,127:7>>, 64, 1)),
- ?line fcmp(F, match_float_little(<<1:13,F:32/float-little,127:3>>, 32, 13)),
- ?line fcmp(F, match_float_little(<<1:13,F:64/float-little,127:3>>, 64, 13)),
+ fcmp(F, match_float_little(<<F:32/float-little>>, 32, 0)),
+ fcmp(F, match_float_little(<<F:64/float-little>>, 64, 0)),
+ fcmp(F, match_float_little(<<1:1,F:32/float-little,127:7>>, 32, 1)),
+ fcmp(F, match_float_little(<<1:1,F:64/float-little,127:7>>, 64, 1)),
+ fcmp(F, match_float_little(<<1:13,F:32/float-little,127:3>>, 32, 13)),
+ fcmp(F, match_float_little(<<1:13,F:64/float-little,127:3>>, 64, 13)),
ok.
@@ -164,16 +163,16 @@ f_one() ->
1.0.
sean(Config) when is_list(Config) ->
- ?line small = sean1(<<>>),
- ?line small = sean1(<<1>>),
- ?line small = sean1(<<1,2>>),
- ?line small = sean1(<<1,2,3>>),
- ?line large = sean1(<<1,2,3,4>>),
-
- ?line small = sean1(<<4>>),
- ?line small = sean1(<<4,5>>),
- ?line small = sean1(<<4,5,6>>),
- ?line {'EXIT',{function_clause,_}} = (catch sean1(<<4,5,6,7>>)),
+ small = sean1(<<>>),
+ small = sean1(<<1>>),
+ small = sean1(<<1,2>>),
+ small = sean1(<<1,2,3>>),
+ large = sean1(<<1,2,3,4>>),
+
+ small = sean1(<<4>>),
+ small = sean1(<<4,5>>),
+ small = sean1(<<4,5,6>>),
+ {'EXIT',{function_clause,_}} = (catch sean1(<<4,5,6,7>>)),
ok.
sean1(<<B/binary>>) when byte_size(B) < 4 -> small;
@@ -188,11 +187,11 @@ msisdn_internal_storage(<<>>,MSISDN) ->
msisdn_internal_storage(<<2#11111111:8,_Rest/binary>>,MSISDN) ->
{ok,lists:reverse(MSISDN)};
msisdn_internal_storage(<<2#1111:4,DigitN:4,_Rest/binary>>,MSISDN) when
- DigitN < 10 ->
+ DigitN < 10 ->
{ok,lists:reverse([(DigitN bor 2#11110000)|MSISDN])};
msisdn_internal_storage(<<DigitNplus1:4,DigitN:4,Rest/binary>>,MSISDN) when
- DigitNplus1 < 10,
- DigitN < 10 ->
+ DigitNplus1 < 10,
+ DigitN < 10 ->
NewMSISDN=[((DigitNplus1 bsl 4) bor DigitN)|MSISDN],
msisdn_internal_storage(Rest,NewMSISDN);
msisdn_internal_storage(_Rest,_MSISDN) ->
@@ -297,36 +296,36 @@ getBase64Char(62) -> "+";
getBase64Char(63) -> "/";
getBase64Char(_Else) ->
%% This is an illegal input.
-% cgLogEM:log(error, ?MODULE, getBase64Char, [Else],
-% "illegal input",
-% ?LINE, version()),
+ %% cgLogEM:log(error, ?MODULE, getBase64Char, [Else],
+ %% "illegal input",
+ %% ?LINE, version()),
"**".
-define(M(F), <<F>> = <<F>>).
native(Config) when is_list(Config) ->
- ?line ?M(3.14:64/native-float),
- ?line ?M(333:16/native),
- ?line ?M(38658345:32/native),
+ ?M(3.14:64/native-float),
+ ?M(333:16/native),
+ ?M(38658345:32/native),
case <<1:16/native>> of
<<0,1>> -> native_big();
<<1,0>> -> native_little()
end.
native_big() ->
- ?line <<37.33:64/native-float>> = <<37.33:64/big-float>>,
- ?line <<3974:16/native-integer>> = <<3974:16/big-integer>>,
+ <<37.33:64/native-float>> = <<37.33:64/big-float>>,
+ <<3974:16/native-integer>> = <<3974:16/big-integer>>,
{comment,"Big endian"}.
native_little() ->
- ?line <<37869.32343:64/native-float>> = <<37869.32343:64/little-float>>,
- ?line <<7974:16/native-integer>> = <<7974:16/little-integer>>,
+ <<37869.32343:64/native-float>> = <<37869.32343:64/little-float>>,
+ <<7974:16/native-integer>> = <<7974:16/little-integer>>,
{comment,"Little endian"}.
happi(Config) when is_list(Config) ->
Bin = <<".123">>,
- ?line <<"123">> = lex_digits1(Bin, 1, []),
- ?line <<"123">> = lex_digits2(Bin, 1, []),
+ <<"123">> = lex_digits1(Bin, 1, []),
+ <<"123">> = lex_digits2(Bin, 1, []),
ok.
lex_digits1(<<$., Rest/binary>>,_Val,_Acc) ->
@@ -347,16 +346,16 @@ dec(A) ->
A-$0.
size_var(Config) when is_list(Config) ->
- ?line {<<45>>,<<>>} = split(<<1:16,45>>),
- ?line {<<45>>,<<46,47>>} = split(<<1:16,45,46,47>>),
- ?line {<<45,46>>,<<47>>} = split(<<2:16,45,46,47>>),
+ {<<45>>,<<>>} = split(<<1:16,45>>),
+ {<<45>>,<<46,47>>} = split(<<1:16,45,46,47>>),
+ {<<45,46>>,<<47>>} = split(<<2:16,45,46,47>>),
- ?line {<<45,46,47>>,<<48>>} = split_2(<<16:8,3:16,45,46,47,48>>),
+ {<<45,46,47>>,<<48>>} = split_2(<<16:8,3:16,45,46,47,48>>),
- ?line {<<45,46>>,<<47>>} = split(2, <<2:16,45,46,47>>),
- ?line {'EXIT',{function_clause,_}} = (catch split(42, <<2:16,45,46,47>>)),
+ {<<45,46>>,<<47>>} = split(2, <<2:16,45,46,47>>),
+ {'EXIT',{function_clause,_}} = (catch split(42, <<2:16,45,46,47>>)),
- ?line <<"cdef">> = skip(<<2:8,"abcdef">>),
+ <<"cdef">> = skip(<<2:8,"abcdef">>),
ok.
@@ -372,11 +371,11 @@ split_2(<<N0:8,N:N0,B:N/binary,T/binary>>) ->
skip(<<N:8,_:N/binary,T/binary>>) -> T.
wiger(Config) when is_list(Config) ->
- ?line ok1 = wcheck(<<3>>),
- ?line ok2 = wcheck(<<1,2,3>>),
- ?line ok3 = wcheck(<<4>>),
- ?line {error,<<1,2,3,4>>} = wcheck(<<1,2,3,4>>),
- ?line {error,<<>>} = wcheck(<<>>),
+ ok1 = wcheck(<<3>>),
+ ok2 = wcheck(<<1,2,3>>),
+ ok3 = wcheck(<<4>>),
+ {error,<<1,2,3,4>>} = wcheck(<<1,2,3,4>>),
+ {error,<<>>} = wcheck(<<>>),
ok.
wcheck(<<A>>) when A==3->
@@ -410,9 +409,9 @@ x0_2(_, Bin) ->
x0_3(_, Bin) ->
case Bin of
<<_:72,7:8,_/binary>> ->
- ?line ?t:fail();
+ ct:fail(failed);
<<_:64,0:16,_/binary>> ->
- ?line ?t:fail();
+ ct:fail(failed);
<<_:64,42:16,123456:32,_/binary>> ->
ok
end.
@@ -420,13 +419,13 @@ x0_3(_, Bin) ->
huge_float_field(Config) when is_list(Config) ->
Sz = 1 bsl 27,
- ?line Bin = <<0:Sz>>,
+ Bin = <<0:Sz>>,
- ?line nomatch = overflow_huge_float_skip_32(Bin),
- ?line nomatch = overflow_huge_float_32(Bin),
+ nomatch = overflow_huge_float_skip_32(Bin),
+ nomatch = overflow_huge_float_32(Bin),
- ?line ok = overflow_huge_float(Bin, lists:seq(25, 32)++lists:seq(50, 64)),
- ?line ok = overflow_huge_float_unit128(Bin, lists:seq(25, 32)++lists:seq(50, 64)),
+ ok = overflow_huge_float(Bin, lists:seq(25, 32)++lists:seq(50, 64)),
+ ok = overflow_huge_float_unit128(Bin, lists:seq(25, 32)++lists:seq(50, 64)),
ok.
overflow_huge_float_skip_32(<<_:4294967296/float,0,_/binary>>) -> 1; % 1 bsl 32
@@ -486,36 +485,36 @@ overflow_huge_float_unit128(_, []) -> ok.
%%
writable_binary_matched(Config) when is_list(Config) ->
- ?line WritableBin = create_writeable_binary(),
- ?line writable_binary_matched(WritableBin, WritableBin, 500).
+ WritableBin = create_writeable_binary(),
+ writable_binary_matched(WritableBin, WritableBin, 500).
writable_binary_matched(<<0>>, _, N) ->
if
N =:= 0 -> ok;
true ->
put(grow_heap, [N|get(grow_heap)]),
- ?line WritableBin = create_writeable_binary(),
- ?line writable_binary_matched(WritableBin, WritableBin, N-1)
+ WritableBin = create_writeable_binary(),
+ writable_binary_matched(WritableBin, WritableBin, N-1)
end;
writable_binary_matched(<<B:8,T/binary>>, WritableBin0, N) ->
- ?line WritableBin = writable_binary(WritableBin0, B),
+ WritableBin = writable_binary(WritableBin0, B),
writable_binary_matched(T, WritableBin, N).
writable_binary(WritableBin0, B) when is_binary(WritableBin0) ->
%% Heavy append to force the binary to move.
- ?line WritableBin = <<WritableBin0/binary,0:(size(WritableBin0))/unit:8,B>>,
- ?line id(<<(id(0)):128/unit:8>>),
+ WritableBin = <<WritableBin0/binary,0:(size(WritableBin0))/unit:8,B>>,
+ id(<<(id(0)):128/unit:8>>),
WritableBin.
create_writeable_binary() ->
- <<(id(<<>>))/binary,1,2,3,4,5,6,0>>.
+ <<(id(<<>>))/binary,1,2,3,4,5,6,0>>.
otp_7198(Config) when is_list(Config) ->
%% When a match context was reused, and grown at the same time to
%% increase the number of saved positions, the thing word was not updated
%% to account for the new size. Therefore, if there was a garbage collection,
%% the new slots would be included in the garbage collection.
- ?line [do_otp_7198(FillerSize) || FillerSize <- lists:seq(0, 256)],
+ [do_otp_7198(FillerSize) || FillerSize <- lists:seq(0, 256)],
ok.
do_otp_7198(FillerSize) ->
@@ -526,7 +525,7 @@ do_otp_7198(FillerSize) ->
ok;
{'DOWN',Ref,process,Pid,Reason} ->
io:format("unexpected: ~p", [Reason]),
- ?line ?t:fail()
+ ct:fail(failed)
end.
do_otp_7198_test(_) ->
@@ -548,32 +547,32 @@ do_otp_7198_test(_) ->
otp_7198_scan(<<>>, TokAcc) ->
- lists:reverse(['$thats_all_folks$' | TokAcc]);
+ lists:reverse(['$thats_all_folks$' | TokAcc]);
otp_7198_scan(<<D, Z, Rest/binary>>, TokAcc) when
- (D =:= $D orelse D =:= $d) and
- ((Z =:= $\s) or (Z =:= $() or (Z =:= $))) ->
- otp_7198_scan(<<Z, Rest/binary>>, ['AND' | TokAcc]);
+ (D =:= $D orelse D =:= $d) and
+ ((Z =:= $\s) or (Z =:= $() or (Z =:= $))) ->
+ otp_7198_scan(<<Z, Rest/binary>>, ['AND' | TokAcc]);
otp_7198_scan(<<D>>, TokAcc) when
- (D =:= $D) or (D =:= $d) ->
- otp_7198_scan(<<>>, ['AND' | TokAcc]);
+ (D =:= $D) or (D =:= $d) ->
+ otp_7198_scan(<<>>, ['AND' | TokAcc]);
otp_7198_scan(<<N, Z, Rest/binary>>, TokAcc) when
- (N =:= $N orelse N =:= $n) and
- ((Z =:= $\s) or (Z =:= $() or (Z =:= $))) ->
- otp_7198_scan(<<Z, Rest/binary>>, ['NOT' | TokAcc]);
+ (N =:= $N orelse N =:= $n) and
+ ((Z =:= $\s) or (Z =:= $() or (Z =:= $))) ->
+ otp_7198_scan(<<Z, Rest/binary>>, ['NOT' | TokAcc]);
otp_7198_scan(<<C, Rest/binary>>, TokAcc) when
- (C >= $A) and (C =< $Z);
- (C >= $a) and (C =< $z);
- (C >= $0) and (C =< $9) ->
- case Rest of
- <<$:, R/binary>> ->
- otp_7198_scan(R, [{'FIELD', C} | TokAcc]);
- _ ->
- otp_7198_scan(Rest, [{'KEYWORD', C} | TokAcc])
- end.
+ (C >= $A) and (C =< $Z);
+ (C >= $a) and (C =< $z);
+ (C >= $0) and (C =< $9) ->
+ case Rest of
+ <<$:, R/binary>> ->
+ otp_7198_scan(R, [{'FIELD', C} | TokAcc]);
+ _ ->
+ otp_7198_scan(Rest, [{'KEYWORD', C} | TokAcc])
+ end.
unordered_bindings(Config) when is_list(Config) ->
{<<1,2,3,4>>,<<42,42>>,<<3,3,3>>} =
@@ -582,7 +581,7 @@ unordered_bindings(Config) when is_list(Config) ->
unordered_bindings(CompressedLength, HashSize, PadLength, T) ->
<<Content:CompressedLength/binary,Mac:HashSize/binary,
- Padding:PadLength/binary,PadLength>> = T,
+ Padding:PadLength/binary,PadLength>> = T,
{Content,Mac,Padding}.
diff --git a/lib/debugger/test/bs_match_tail_SUITE.erl b/lib/debugger/test/bs_match_tail_SUITE.erl
index f4201ee7db..4faa0360ce 100644
--- a/lib/debugger/test/bs_match_tail_SUITE.erl
+++ b/lib/debugger/test/bs_match_tail_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,7 +28,9 @@
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
cases().
@@ -48,51 +50,48 @@ cases() ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
ok.
-aligned(doc) -> "Test aligned tails.";
+%% Test aligned tails.
aligned(Config) when is_list(Config) ->
- ?line Tail1 = mkbin([]),
- ?line {258,Tail1} = al_get_tail_used(mkbin([1,2])),
- ?line Tail2 = mkbin(lists:seq(1, 127)),
- ?line {35091,Tail2} = al_get_tail_used(mkbin([137,19|Tail2])),
-
- ?line 64896 = al_get_tail_unused(mkbin([253,128])),
- ?line 64895 = al_get_tail_unused(mkbin([253,127|lists:seq(42, 255)])),
-
- ?line Tail3 = mkbin(lists:seq(0, 19)),
- ?line {0,Tail1} = get_dyn_tail_used(Tail1, 0),
- ?line {0,Tail3} = get_dyn_tail_used(mkbin([Tail3]), 0),
- ?line {73,Tail3} = get_dyn_tail_used(mkbin([73|Tail3]), 8),
-
- ?line 0 = get_dyn_tail_unused(mkbin([]), 0),
- ?line 233 = get_dyn_tail_unused(mkbin([233]), 8),
- ?line 23 = get_dyn_tail_unused(mkbin([23,22,2]), 8),
+ Tail1 = mkbin([]),
+ {258,Tail1} = al_get_tail_used(mkbin([1,2])),
+ Tail2 = mkbin(lists:seq(1, 127)),
+ {35091,Tail2} = al_get_tail_used(mkbin([137,19|Tail2])),
+
+ 64896 = al_get_tail_unused(mkbin([253,128])),
+ 64895 = al_get_tail_unused(mkbin([253,127|lists:seq(42, 255)])),
+
+ Tail3 = mkbin(lists:seq(0, 19)),
+ {0,Tail1} = get_dyn_tail_used(Tail1, 0),
+ {0,Tail3} = get_dyn_tail_used(mkbin([Tail3]), 0),
+ {73,Tail3} = get_dyn_tail_used(mkbin([73|Tail3]), 8),
+
+ 0 = get_dyn_tail_unused(mkbin([]), 0),
+ 233 = get_dyn_tail_unused(mkbin([233]), 8),
+ 23 = get_dyn_tail_unused(mkbin([23,22,2]), 8),
ok.
al_get_tail_used(<<A:16,T/binary>>) -> {A,T}.
al_get_tail_unused(<<A:16,_/binary>>) -> A.
-unaligned(doc) -> "Test that an non-aligned tail cannot be matched out.";
+%% Test that an non-aligned tail cannot be matched out.
unaligned(Config) when is_list(Config) ->
- ?line {'EXIT',{function_clause,_}} = (catch get_tail_used(mkbin([42]))),
- ?line {'EXIT',{{badmatch,_},_}} = (catch get_dyn_tail_used(mkbin([137]), 3)),
- ?line {'EXIT',{function_clause,_}} = (catch get_tail_unused(mkbin([42,33]))),
- ?line {'EXIT',{{badmatch,_},_}} = (catch get_dyn_tail_unused(mkbin([44]), 7)),
+ {'EXIT',{function_clause,_}} = (catch get_tail_used(mkbin([42]))),
+ {'EXIT',{{badmatch,_},_}} = (catch get_dyn_tail_used(mkbin([137]), 3)),
+ {'EXIT',{function_clause,_}} = (catch get_tail_unused(mkbin([42,33]))),
+ {'EXIT',{{badmatch,_},_}} = (catch get_dyn_tail_unused(mkbin([44]), 7)),
ok.
get_tail_used(<<A:1,T/binary>>) -> {A,T}.
@@ -107,11 +106,11 @@ get_dyn_tail_unused(Bin, Sz) ->
<<A:Sz,_/binary>> = Bin,
A.
-zero_tail(doc) -> "Test that zero tails are tested correctly.";
+%% Test that zero tails are tested correctly.
zero_tail(Config) when is_list(Config) ->
- ?line 7 = (catch test_zero_tail(mkbin([7]))),
- ?line {'EXIT',{function_clause,_}} = (catch test_zero_tail(mkbin([1,2]))),
- ?line {'EXIT',{function_clause,_}} = (catch test_zero_tail2(mkbin([1,2,3]))),
+ 7 = (catch test_zero_tail(mkbin([7]))),
+ {'EXIT',{function_clause,_}} = (catch test_zero_tail(mkbin([1,2]))),
+ {'EXIT',{function_clause,_}} = (catch test_zero_tail2(mkbin([1,2,3]))),
ok.
test_zero_tail(<<A:8>>) -> A.
diff --git a/lib/debugger/test/bs_utf_SUITE.erl b/lib/debugger/test/bs_utf_SUITE.erl
index 5bf776226a..ccedc42064 100644
--- a/lib/debugger/test/bs_utf_SUITE.erl
+++ b/lib/debugger/test/bs_utf_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -31,7 +31,9 @@
-include_lib("common_test/include/ct.hrl").
-compile([no_jopt,time]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
cases().
@@ -52,31 +54,28 @@ cases() ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
ok.
utf8_roundtrip(Config) when is_list(Config) ->
- ?line [utf8_roundtrip_1(P) || P <- utf_data()],
+ [utf8_roundtrip_1(P) || P <- utf_data()],
ok.
utf8_roundtrip_1({Str,Bin,Bin}) ->
- ?line Str = utf8_to_list(Bin),
- ?line Bin = list_to_utf8(Str),
- ?line [ok = utf8_guard(C, <<42,C/utf8>>) || C <- Str],
- ?line [error = utf8_guard(C, <<C/utf8>>) || C <- Str],
+ Str = utf8_to_list(Bin),
+ Bin = list_to_utf8(Str),
+ [ok = utf8_guard(C, <<42,C/utf8>>) || C <- Str],
+ [error = utf8_guard(C, <<C/utf8>>) || C <- Str],
ok.
utf8_guard(C, Bin) when <<42,C/utf8>> =:= Bin -> ok;
@@ -106,14 +105,14 @@ utf8_len(<<_/utf8,T/binary>>, N) ->
utf8_len(<<>>, N) -> N.
utf16_roundtrip(Config) when is_list(Config) ->
- ?line {Str,Big,Big,Little,Little} = utf16_data(),
- ?line 4 = utf16_big_len(Big),
- ?line 4 = utf16_little_len(Little),
- ?line Str = big_utf16_to_list(Big),
- ?line Str = little_utf16_to_list(Little),
+ {Str,Big,Big,Little,Little} = utf16_data(),
+ 4 = utf16_big_len(Big),
+ 4 = utf16_little_len(Little),
+ Str = big_utf16_to_list(Big),
+ Str = little_utf16_to_list(Little),
- ?line Big = list_to_big_utf16(Str),
- ?line Little = list_to_little_utf16(Str),
+ Big = list_to_big_utf16(Str),
+ Little = list_to_little_utf16(Str),
ok.
@@ -154,14 +153,14 @@ little_utf16_to_list(<<H/little-utf16,T/binary>>) ->
little_utf16_to_list(<<>>) -> [].
utf32_roundtrip(Config) when is_list(Config) ->
- ?line {Str,Big,Big,Little,Little} = utf32_data(),
- ?line 4 = utf32_big_len(Big),
- ?line 4 = utf32_little_len(Little),
- ?line Str = big_utf32_to_list(Big),
- ?line Str = little_utf32_to_list(Little),
+ {Str,Big,Big,Little,Little} = utf32_data(),
+ 4 = utf32_big_len(Big),
+ 4 = utf32_little_len(Little),
+ Str = big_utf32_to_list(Big),
+ Str = little_utf32_to_list(Little),
- ?line Big = list_to_big_utf32(Str),
- ?line Little = list_to_little_utf32(Str),
+ Big = list_to_big_utf32(Str),
+ Little = list_to_little_utf32(Str),
ok.
@@ -203,7 +202,7 @@ little_utf32_to_list(<<>>) -> [].
guard(Config) when is_list(Config) ->
- ?line error = do_guard(16#D800),
+ error = do_guard(16#D800),
ok.
do_guard(C) when byte_size(<<C/utf8>>) =/= 42 -> ok;
@@ -215,13 +214,13 @@ do_guard(_) -> error.
%% the delayed creation of sub-binaries works.
extreme_tripping(Config) when is_list(Config) ->
- ?line Unicode = lists:seq(0, 1024),
- ?line Utf8 = unicode_to_utf8(Unicode, <<>>),
- ?line Utf16 = utf8_to_utf16(Utf8, <<>>),
- ?line Utf32 = utf8_to_utf32(Utf8, <<>>),
- ?line Utf32 = utf16_to_utf32(Utf16, <<>>),
- ?line Utf8 = utf32_to_utf8(Utf32, <<>>),
- ?line Unicode = utf32_to_unicode(Utf32),
+ Unicode = lists:seq(0, 1024),
+ Utf8 = unicode_to_utf8(Unicode, <<>>),
+ Utf16 = utf8_to_utf16(Utf8, <<>>),
+ Utf32 = utf8_to_utf32(Utf8, <<>>),
+ Utf32 = utf16_to_utf32(Utf16, <<>>),
+ Utf8 = utf32_to_utf8(Utf32, <<>>),
+ Unicode = utf32_to_unicode(Utf32),
ok.
unicode_to_utf8([C|T], Bin) ->
@@ -249,7 +248,7 @@ utf32_to_unicode(<<C/utf32,T/binary>>) ->
utf32_to_unicode(<<>>) -> [].
utf_data() ->
-%% From RFC-3629.
+ %% From RFC-3629.
%% Give the compiler a change to do some constant propagation.
NotIdentical = 16#2262,
@@ -287,7 +286,7 @@ utf16_data() ->
%% Little endian (the two binaries should be equal).
<<RaHieroglyph/little-utf16,16#3D/little-utf16,
- 16#52/little-utf16,16#61/little-utf16>>,
+ 16#52/little-utf16,16#61/little-utf16>>,
<<16#08,16#D8,16#45,16#DF,16#3D,16#00,16#52,16#00,16#61,16#00>>}.
utf32_data() ->
@@ -301,6 +300,6 @@ utf32_data() ->
%% Little endian.
<<16#0041/little-utf32,NotIdentical/little-utf32,
- 16#0391/little-utf32,16#002E/little-utf32>>,
+ 16#0391/little-utf32,16#002E/little-utf32>>,
<<16#41:32/little,NotIdentical:32/little,
- 16#0391:32/little,16#2E:32/little>>}.
+ 16#0391:32/little,16#2E:32/little>>}.
diff --git a/lib/debugger/test/bug_SUITE.erl b/lib/debugger/test/bug_SUITE.erl
index 516d9f4b8d..ac73672d2a 100644
--- a/lib/debugger/test/bug_SUITE.erl
+++ b/lib/debugger/test/bug_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,7 +28,9 @@
-export([otp2163/1, otp4845/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[{group, ticket_tests}].
@@ -43,54 +45,52 @@ end_per_suite(_Config) ->
ok.
init_per_group(_GroupName, Config) ->
- Config.
+ Config.
end_per_group(_GroupName, Config) ->
- Config.
+ Config.
-otp2163(doc) -> ["BIF exit reason"];
-otp2163(suite) -> [];
+%% BIF exit reason.
otp2163(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
%% First compile and get the expected results:
- ?line FileName = filename:join(DataDir, "otp2163"),
- ?line {module,otp2163} = code:load_abs(FileName),
+ FileName = filename:join(DataDir, "otp2163"),
+ {module,otp2163} = code:load_abs(FileName),
- ?line {'EXIT',{badarg,[ApplyRes|_]}} = (catch otp2163:apply_test()),
- ?line {'EXIT',{badarg,[ListRes|_]}} = (catch otp2163:list_to_atom_test()),
+ {'EXIT',{badarg,[ApplyRes|_]}} = (catch otp2163:apply_test()),
+ {'EXIT',{badarg,[ListRes|_]}} = (catch otp2163:list_to_atom_test()),
%% Then interpret, and check if the results are OK.
- ?line {module,otp2163} = int:i(FileName),
+ {module,otp2163} = int:i(FileName),
- ?line ok = io:format("Expecting ~p", [ApplyRes]),
- ?line {'EXIT',{badarg,[ApplyRes|_]}} = (catch otp2163:apply_test()),
- ?line ok = io:format("Expecting ~p", [ListRes]),
- ?line {'EXIT',{badarg,[ListRes|_]}} = (catch otp2163:list_to_atom_test()),
+ ok = io:format("Expecting ~p", [ApplyRes]),
+ {'EXIT',{badarg,[ApplyRes|_]}} = (catch otp2163:apply_test()),
+ ok = io:format("Expecting ~p", [ListRes]),
+ {'EXIT',{badarg,[ListRes|_]}} = (catch otp2163:list_to_atom_test()),
ok.
-otp4845(doc) -> ["BIF not loading and not bug compatible, OTP-4845 OTP-4859"];
-otp4845(suite) -> [];
+%% BIF not loading and not bug compatible, OTP-4845 OTP-4859.
otp4845(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
%% First compile and get the expected results:
- ?line FileName = filename:join(DataDir, "otp4845"),
- ?line {module,otp4845} = code:load_abs(FileName),
+ FileName = filename:join(DataDir, "otp4845"),
+ {module,otp4845} = code:load_abs(FileName),
- ?line CompiledRes = (catch otp4845:test()),
- ?line ok = io:format("Compiled ~p", [CompiledRes]),
+ CompiledRes = (catch otp4845:test()),
+ ok = io:format("Compiled ~p", [CompiledRes]),
%% Then interpret, and check if the results are OK.
- ?line {module,otp4845} = int:i(FileName),
+ {module,otp4845} = int:i(FileName),
- ?line IntRes = (catch otp4845:test()),
- ?line ok = io:format("Interpreted ~p", [IntRes]),
+ IntRes = (catch otp4845:test()),
+ ok = io:format("Interpreted ~p", [IntRes]),
- ?line CompiledRes = IntRes,
+ CompiledRes = IntRes,
ok.
diff --git a/lib/debugger/test/bug_SUITE_data/Makefile.src b/lib/debugger/test/bug_SUITE_data/Makefile.src
index 244c9025f0..621eebc389 100644
--- a/lib/debugger/test/bug_SUITE_data/Makefile.src
+++ b/lib/debugger/test/bug_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2010. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/bug_SUITE_data/otp2163.erl b/lib/debugger/test/bug_SUITE_data/otp2163.erl
index 6b6dcffa8c..f80b019854 100644
--- a/lib/debugger/test/bug_SUITE_data/otp2163.erl
+++ b/lib/debugger/test/bug_SUITE_data/otp2163.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/bug_SUITE_data/otp4845.erl b/lib/debugger/test/bug_SUITE_data/otp4845.erl
index ffb038cc9e..43e0263df0 100644
--- a/lib/debugger/test/bug_SUITE_data/otp4845.erl
+++ b/lib/debugger/test/bug_SUITE_data/otp4845.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/cleanup.erl b/lib/debugger/test/cleanup.erl
index 58f3c9380f..7970b53086 100644
--- a/lib/debugger/test/cleanup.erl
+++ b/lib/debugger/test/cleanup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -26,22 +26,21 @@
-include_lib("common_test/include/ct.hrl").
all() ->
-[cleanup].
+ [cleanup].
groups() ->
[].
init_per_group(_GroupName, Config) ->
- Config.
+ Config.
end_per_group(_GroupName, Config) ->
- Config.
+ Config.
-cleanup(suite) -> [];
cleanup(_) ->
- ?line Mods = int:interpreted(),
- ?line ok = int:n(Mods),
+ Mods = int:interpreted(),
+ ok = int:n(Mods),
case whereis(interpret) of
undefined ->
ok;
diff --git a/lib/debugger/test/dbg_ui_SUITE.erl b/lib/debugger/test/dbg_ui_SUITE.erl
index 39ecb51b57..32577d48cd 100644
--- a/lib/debugger/test/dbg_ui_SUITE.erl
+++ b/lib/debugger/test/dbg_ui_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -25,14 +25,14 @@
-include_lib("common_test/include/ct.hrl").
-% Test server specific exports
+%% Test server specific exports
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2]).
-% Test cases must be exported.
+%% Test cases must be exported.
-export ([dbg_ui/1]).
-% Manual test suites/cases exports
+%% Manual test suites/cases exports
-export([start1/1, interpret1/1, quit1/1,
start2/1, interpret2/1, break2/1, options2/1, quit2/1,
interpret3/1, all_step3/1,all_next3/1,save3/1,restore3/1,finish3/1,
@@ -44,15 +44,14 @@
-export([init_per_testcase/2, end_per_testcase/2]).
init_per_testcase(_Func, Config) ->
- Dog=test_server:timetrap(60*1000),
- [{watchdog, Dog}|Config].
-
-end_per_testcase(_Func, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+ Config.
+end_per_testcase(_Func, _Config) ->
+ ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[dbg_ui, {group, manual_tests}].
@@ -78,22 +77,17 @@ init_per_group(_GroupName, Config) ->
end_per_group(_GroupName, Config) ->
Config.
-dbg_ui (doc) ->
- ["Debugger GUI"];
-
-dbg_ui (suite) ->
- [];
-
+%% Test Debugger GUI.
dbg_ui (_Config) ->
case os:getenv("DISPLAY") of
false ->
{skipped,"No display"};
Other when is_list(Other) ->
-% ?line {ok, Pid} = debugger:start (),
-% ?line ok = is_pid (Pid),
-% ?line true = erlang:is_process_alive(Pid),
-% ?line ok = debugger:stop(),
-% ?line false = erlang:is_process_alive(Pid)
+ %% {ok, Pid} = debugger:start (),
+ %% ok = is_pid (Pid),
+ %% true = erlang:is_process_alive(Pid),
+ %% ok = debugger:stop(),
+ %% false = erlang:is_process_alive(Pid)
{skipped,"Gunilla: Workaround"}
end.
@@ -105,11 +99,11 @@ dbg_ui (_Config) ->
check(Case, Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line ResultFileName = filename:join([DataDir, "manual_results.erl"]),
+ DataDir = proplists:get_value(data_dir, Config),
+ ResultFileName = filename:join([DataDir, "manual_results.erl"]),
case file:consult(ResultFileName) of
{ok, Results} ->
- ?line io:format("Results: ~p~n",[Results]),
+ io:format("Results: ~p~n",[Results]),
case Results of
[] ->
no_result;
@@ -136,29 +130,27 @@ check(Case, Config) ->
-define(MAN_CASE(Name,Doc, Description),
- Name(doc) -> [Doc];
- Name(suite) -> [];
Name(Config) ->
- ?line io:format("Checking ~p~n",[Name]),
- ?line io:format("Config = ~p~n",[Config]),
+ io:format("Checking ~p~n",[Name]),
+ io:format("Config = ~p~n",[Config]),
case check(Name, Config) of
pass ->
- ?line ok;
+ ok;
fail ->
- ?line test_server:fail("Manual test failed");
+ ct:fail("Manual test failed");
unknown ->
- ?line {skipped, "Manual test result unknown"};
+ {skipped, "Manual test result unknown"};
no_result ->
- ?line {skipped, Description};
+ {skipped, Description};
{error, _Reason} ->
-%% Text = lists:flatten(
-%% io_lib:format("[File problem: ~s]~s",
-%% [Reason,Description])),
- ?line {skipped, Description}
+ %% Text = lists:flatten(
+ %% io_lib:format("[File problem: ~s]~s",
+ %% [Reason,Description])),
+ {skipped, Description}
end
- ).
+ ).
%% SET 1
@@ -170,101 +162,101 @@ please start the debugger from the toolbar").
?MAN_CASE(interpret1, "Interpreting modules",
"In this test case and all of the ones following, the source code
files to use can be found in the test data directory for this debugger test
- suite (probably in
-/clearcase/otp/tools/debugger/test/dbg_ui_SUITE_data/manual_data/src ).
+ suite (probably in
+ /clearcase/otp/tools/debugger/test/dbg_ui_SUITE_data/manual_data/src ).
Interpret one module").
?MAN_CASE(quit1, "Quit the debugger",
-"Quit the debugger using File->Exit in the main window").
+ "Quit the debugger using File->Exit in the main window").
%% SET 2
?MAN_CASE(start2, "Start the debugger from the shell",
-"Start the debugger from the shell. Use debugger:start()").
+ "Start the debugger from the shell. Use debugger:start()").
?MAN_CASE(interpret2, "Interpret all modules",
-"Interpret all modules").
+ "Interpret all modules").
?MAN_CASE(break2, "Set break points",
-"Set break points").
+ "Set break points").
?MAN_CASE(options2, "Set options to attach on break",
-"Set options to attach on break").
+ "Set options to attach on break").
?MAN_CASE(quit2, "Quit the debugger",
-"Quit the debugger using the close box in the main window title frame").
+ "Quit the debugger using the close box in the main window title frame").
%% SET3
?MAN_CASE(interpret3, "Test attach options",
-"Start the debugger and interpret the modules [test, lists1, ordsets1]. Close the Interpret dialog. Set Attach on First Call and Attach on Break.").
+ "Start the debugger and interpret the modules [test, lists1, ordsets1]. Close the Interpret dialog. Set Attach on First Call and Attach on Break.").
?MAN_CASE(all_step3, "Click Step through all evaluation",
-"In the shell, call test:test1(). Use the Step button, the Process->Step menu item and the ctrl-s shortcut to step through the *entire* execution of the call. (Approx 36 steps). Then close the Attach window. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
+ "In the shell, call test:test1(). Use the Step button, the Process->Step menu item and the ctrl-s shortcut to step through the *entire* execution of the call. (Approx 36 steps). Then close the Attach window. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
?MAN_CASE(all_next3,"Click Next through all evaluation",
-"Again call test:test1() in the shell. This time Use the Next button, the Process->Next menu and the ctrl-n shortcut to quickly step over the execution of the four lines in the test1-function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
+ "Again call test:test1() in the shell. This time Use the Next button, the Process->Next menu and the ctrl-n shortcut to quickly step over the execution of the four lines in the test1-function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
?MAN_CASE(save3, "Save the debugger state",
-"Use File->Save Settings to save the debugger state with the name 'three.state'").
+ "Use File->Save Settings to save the debugger state with the name 'three.state'").
?MAN_CASE(restore3,"Quit the debugger, restart and restore the state",
-"Quit the debugger. Start it again. Use File->Load Settings to restore the state saved in 'three.state'. Check that the Attach-options are the same as what you set them to in the interpret3 test case. Check that the three modules [test,lists1,ordsets1] are interpreted.").
+ "Quit the debugger. Start it again. Use File->Load Settings to restore the state saved in 'three.state'. Check that the Attach-options are the same as what you set them to in the interpret3 test case. Check that the three modules [test,lists1,ordsets1] are interpreted.").
?MAN_CASE(finish3, "Finish the current function body",
-"Call the fucntion test:test1() from the shell. Press Finish to evaluate the remaining lines in the function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
+ "Call the fucntion test:test1() from the shell. Press Finish to evaluate the remaining lines in the function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
?MAN_CASE(killinit3,"Set up for killing and clearing processes",
-"Call test:test2() from the shell. Set a break point at the last line of test:test2. Click Continue. This should open three new attach windows. One for each spawn called in test:test2/0. ").
+ "Call test:test2() from the shell. Set a break point at the last line of test:test2. Click Continue. This should open three new attach windows. One for each spawn called in test:test2/0. ").
?MAN_CASE(killone3, "Kill a process and clear it",
-"In one of the newly openend Attach windows: select Process->Kill. A message should appear above the Code Area in the Attach window. Use Windows->Monitor to verify that the Monitor window also shows that the process has been killed. In the Monitor window: select Edit->Clear. This should do two things: 1) close/remove the window of the killed process. 2) Remove the entry of the killed process from the monitor window.").
+ "In one of the newly openend Attach windows: select Process->Kill. A message should appear above the Code Area in the Attach window. Use Windows->Monitor to verify that the Monitor window also shows that the process has been killed. In the Monitor window: select Edit->Clear. This should do two things: 1) close/remove the window of the killed process. 2) Remove the entry of the killed process from the monitor window.").
?MAN_CASE(killall3,"KIll all processes, and clear them",
-"In the Monitor window: Select Edit->Kill All. Verify that all processes have been killed (in their respective windows and in the monitor window). Windows will be raised as their processes die. Next select, Edit->Clear. All attach windows should now be closed. Their entris should also disappear from the monitor window. The shell should have reported: ** exited: killed **").
+ "In the Monitor window: Select Edit->Kill All. Verify that all processes have been killed (in their respective windows and in the monitor window). Windows will be raised as their processes die. Next select, Edit->Clear. All attach windows should now be closed. Their entris should also disappear from the monitor window. The shell should have reported: ** exited: killed **").
?MAN_CASE(deleteone3,"Delete/uniterpret one module",
-"In the Monitor window: Select Module->test->Delete. This should remove the breakpoints set in the test module, and the test module should disappear from the Module menu.").
+ "In the Monitor window: Select Module->test->Delete. This should remove the breakpoints set in the test module, and the test module should disappear from the Module menu.").
?MAN_CASE(deleteall3,"Delete/uniterpret all modules",
-"In the Monitor window: Select Module->Delete All Modules. This should remove all modules from the Module menu. ").
+ "In the Monitor window: Select Module->Delete All Modules. This should remove all modules from the Module menu. ").
%% SET 4
?MAN_CASE(viewbreak4, "Test the View window",
-"Restore the settings from the three.state file again. In the Monitor window: Use Module->test->View to view the source code of the test module. In the View window, select Break->Line Break and set a break at line 53. Check that it appears in the View window and in the Monitor Window Break-menu. Also in the View window, select Break->Function Break and set a break at function test:test4. Check that the break (at line 59) appears in the View Window and in the Monitor Window Break-menu.").
+ "Restore the settings from the three.state file again. In the Monitor window: Use Module->test->View to view the source code of the test module. In the View window, select Break->Line Break and set a break at line 53. Check that it appears in the View window and in the Monitor Window Break-menu. Also in the View window, select Break->Function Break and set a break at function test:test4. Check that the break (at line 59) appears in the View Window and in the Monitor Window Break-menu.").
?MAN_CASE(delete4, "Remove breaks",
-"Use the Break->Delete All function in the View window to remove all breaks in the test module. Check that they are all removed. Close the View window.").
+ "Use the Break->Delete All function in the View window to remove all breaks in the test module. Check that they are all removed. Close the View window.").
%% SET 5
?MAN_CASE(attach5,"Set attach options",
-"Set the attach options to only attach on exit").
+ "Set the attach options to only attach on exit").
?MAN_CASE(normal5, "Test normal exit",
-"Call test:test12(normal) in the shell. This should return the atom 'done', and no windows should be opened.").
+ "Call test:test12(normal) in the shell. This should return the atom 'done', and no windows should be opened.").
?MAN_CASE(exit5, "Test abnormal exit",
-"Call test:test12(crash) in the shell. This should give the error message ** exited: crash **, and an attach window should be opened highlighting the last line in the test12-function.").
+ "Call test:test12(crash) in the shell. This should give the error message ** exited: crash **, and an attach window should be opened highlighting the last line in the test12-function.").
?MAN_CASE(options5, "Experiment with the frames in the attach window",
-"Try all possible configurations of the [Button, Evaluator, Bindings, Trace] Frames in the attach window and see that the expected frames are shown/hidden.").
+ "Try all possible configurations of the [Button, Evaluator, Bindings, Trace] Frames in the attach window and see that the expected frames are shown/hidden.").
%% SET 6 (Distribution)
?MAN_CASE(distsetup6,"Set up distribution",
-"Start two erlang systems [foo,bar] (with option -sname), make them aware of eachother using net_adm:ping/1. Start the debugger on foo. Interpret the modules [test, lists1, ordsets1]. Set attach on First call. ").
+ "Start two erlang systems [foo,bar] (with option -sname), make them aware of eachother using net_adm:ping/1. Start the debugger on foo. Interpret the modules [test, lists1, ordsets1]. Set attach on First call. ").
?MAN_CASE(all_step6, "Click Step through all evaluation",
-"In the bar shell, call test:test1().This should open an attach window. Use the Step button, the Process->Step menu item and the ctrl-s shortcut to step through the *entire* execution of the call. (Approx 36 steps). Then close the Attach window. The result printed in the bar shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
+ "In the bar shell, call test:test1().This should open an attach window. Use the Step button, the Process->Step menu item and the ctrl-s shortcut to step through the *entire* execution of the call. (Approx 36 steps). Then close the Attach window. The result printed in the bar shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
?MAN_CASE(all_next6,"Click Next through all evaluation",
-"Again, in the bar shell, call test:test1(). This time Use the Next button, the Process->Next menu and the ctrl-n shortcut to quickly step over the execution of the four lines in the test1-function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
+ "Again, in the bar shell, call test:test1(). This time Use the Next button, the Process->Next menu and the ctrl-n shortcut to quickly step over the execution of the four lines in the test1-function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
diff --git a/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/lists1.erl b/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/lists1.erl
index c26ccfceda..32aabfcbb9 100644
--- a/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/lists1.erl
+++ b/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/lists1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/ordsets1.erl b/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/ordsets1.erl
index 63224fc493..bb7439aac0 100644
--- a/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/ordsets1.erl
+++ b/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/ordsets1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/test.erl b/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/test.erl
index d7af58e573..6c38fd011a 100644
--- a/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/test.erl
+++ b/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/debugger_SUITE.erl b/lib/debugger/test/debugger_SUITE.erl
index 678ca0e5c3..c72f154928 100644
--- a/lib/debugger/test/debugger_SUITE.erl
+++ b/lib/debugger/test/debugger_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -31,7 +31,9 @@
app_test/1,appup_test/1,erts_debug/1,encrypted_debug_info/1,
no_abstract_code/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[app_test, appup_test, erts_debug, no_abstract_code,
@@ -54,39 +56,37 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- Dog=test_server:timetrap(?t:minutes(0.5)),
- [{watchdog, Dog}|Config].
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
ok.
app_test(Config) when is_list(Config) ->
- ?line ?t:app_test(debugger),
+ test_server:app_test(debugger),
ok.
appup_test(Config) when is_list(Config) ->
- ok = ?t:appup_test(debugger).
+ ok = test_server:appup_test(debugger).
erts_debug(Config) when is_list(Config) ->
c:l(erts_debug),
ok.
no_abstract_code(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Simple = filename:join(PrivDir, "simple"),
- ?line Source = Simple ++ ".erl",
- ?line BeamFile = Simple ++ ".beam",
- ?line simple_file(Source),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Simple = filename:join(PrivDir, "simple"),
+ Source = Simple ++ ".erl",
+ BeamFile = Simple ++ ".beam",
+ simple_file(Source),
%% Compile module without abstract code.
CompileFlags = [{outdir,PrivDir}],
- ?line {ok,_} = compile:file(Source, CompileFlags),
- ?line error = int:i(Simple),
+ {ok,_} = compile:file(Source, CompileFlags),
+ error = int:i(Simple),
%% Cleanup.
- ?line ok = file:delete(Source),
- ?line ok = file:delete(BeamFile),
+ ok = file:delete(Source),
+ ok = file:delete(BeamFile),
ok.
@@ -100,28 +100,28 @@ encrypted_debug_info(Config) when is_list(Config) ->
end.
encrypted_debug_info_1(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Simple = filename:join(PrivDir, "simple"),
- ?line Source = Simple ++ ".erl",
- ?line BeamFile = Simple ++ ".beam",
- ?line simple_file(Source),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Simple = filename:join(PrivDir, "simple"),
+ Source = Simple ++ ".erl",
+ BeamFile = Simple ++ ".beam",
+ simple_file(Source),
%% Compile module.
Key = "_This a Crypto Key_",
CompileFlags = [{outdir,PrivDir},debug_info,{debug_info_key,Key}],
- ?line {ok,_} = compile:file(Source, CompileFlags),
+ {ok,_} = compile:file(Source, CompileFlags),
%% Interpret module
- ?line ok = beam_lib:crypto_key_fun(simple_crypto_fun(Key)),
- ?line {module,simple} = int:i(Simple),
+ ok = beam_lib:crypto_key_fun(simple_crypto_fun(Key)),
+ {module,simple} = int:i(Simple),
%% Remove key.
- ?line {ok,_} = beam_lib:clear_crypto_key_fun(),
- ?line error = int:i(Simple),
+ {ok,_} = beam_lib:clear_crypto_key_fun(),
+ error = int:i(Simple),
%% Cleanup.
- ?line ok = file:delete(Source),
- ?line ok = file:delete(BeamFile),
+ ok = file:delete(Source),
+ ok = file:delete(BeamFile),
ok.
diff --git a/lib/debugger/test/debugger_test.erl b/lib/debugger/test/debugger_test.erl
index 9a5fb11b8c..d895f25db2 100644
--- a/lib/debugger/test/debugger_test.erl
+++ b/lib/debugger/test/debugger_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/erl_eval_SUITE.erl b/lib/debugger/test/erl_eval_SUITE.erl
index c75e4012f3..8907856583 100644
--- a/lib/debugger/test/erl_eval_SUITE.erl
+++ b/lib/debugger/test/erl_eval_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
-module(erl_eval_SUITE).
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
+ init_per_testcase/2, end_per_testcase/2,
init_per_group/2,end_per_group/2]).
-export([guard_1/1, guard_2/1,
@@ -43,38 +44,23 @@
eval_expr_5/1,
eep37/1]).
-%%
-%% Define to run outside of test server
-%%
-%%-define(STANDALONE,1).
+-include_lib("common_test/include/ct.hrl").
-import(lists,[concat/1, sort/1]).
-export([count_down/2, count_down_fun/0, do_apply/2,
local_func/3, local_func_value/2]).
--ifdef(STANDALONE).
--define(config(A,B),config(A,B)).
--export([config/2]).
--define(line, noop, ).
-config(priv_dir,_) ->
- ".".
--else.
--include_lib("common_test/include/ct.hrl").
--export([init_per_testcase/2, end_per_testcase/2]).
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- ?line Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
ok.
--endif.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[guard_1, guard_2, match_pattern, string_plusplus,
@@ -99,125 +85,101 @@ end_per_group(_GroupName, Config) ->
Config.
-guard_1(doc) ->
- ["(OTP-2405)"];
-guard_1(suite) ->
- [];
+%% (OTP-2405).
guard_1(Config) when is_list(Config) ->
- ?line {ok,Tokens ,_} =
+ {ok,Tokens ,_} =
erl_scan:string("if a+4 == 4 -> yes; true -> no end. "),
- ?line {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
- ?line no = guard_1_compiled(),
- ?line {value, no, []} = erl_eval:expr(Expr, []),
+ {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
+ no = guard_1_compiled(),
+ {value, no, []} = erl_eval:expr(Expr, []),
ok.
guard_1_compiled() ->
if a+4 == 4 -> yes; true -> no end.
-guard_2(doc) ->
- ["Similar to guard_1, but type-correct"];
-guard_2(suite) ->
- [];
+%% Similar to guard_1, but type-correct.
guard_2(Config) when is_list(Config) ->
- ?line {ok,Tokens ,_} =
+ {ok,Tokens ,_} =
erl_scan:string("if 6+4 == 4 -> yes; true -> no end. "),
- ?line {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
- ?line no = guard_2_compiled(),
- ?line {value, no, []} = erl_eval:expr(Expr, []),
+ {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
+ no = guard_2_compiled(),
+ {value, no, []} = erl_eval:expr(Expr, []),
ok.
guard_2_compiled() ->
if 6+4 == 4 -> yes; true -> no end.
-string_plusplus(doc) ->
- ["OTP-3069: syntactic sugar string ++ ..."];
-string_plusplus(suite) ->
- [];
+%% OTP-3069: syntactic sugar string ++ ...
string_plusplus(Config) when is_list(Config) ->
- ?line check(fun() -> case "abc" of "ab" ++ L -> L end end,
- "case \"abc\" of \"ab\" ++ L -> L end. ",
- "c"),
- ?line check(fun() -> case "abcde" of "ab" ++ "cd" ++ L -> L end end,
- "case \"abcde\" of \"ab\" ++ \"cd\" ++ L -> L end. ",
- "e"),
- ?line check(fun() -> case "abc" of [97, 98] ++ L -> L end end,
- "case \"abc\" of [97, 98] ++ L -> L end. ",
- "c"),
+ check(fun() -> case "abc" of "ab" ++ L -> L end end,
+ "case \"abc\" of \"ab\" ++ L -> L end. ",
+ "c"),
+ check(fun() -> case "abcde" of "ab" ++ "cd" ++ L -> L end end,
+ "case \"abcde\" of \"ab\" ++ \"cd\" ++ L -> L end. ",
+ "e"),
+ check(fun() -> case "abc" of [97, 98] ++ L -> L end end,
+ "case \"abc\" of [97, 98] ++ L -> L end. ",
+ "c"),
ok.
-match_pattern(doc) ->
- ["OTP-2983: match operator in pattern"];
-match_pattern(suite) ->
- [];
+%% OTP-2983: match operator in pattern.
match_pattern(Config) when is_list(Config) ->
- ?line check(fun() -> case {a, b} of {a, _X}=Y -> {x,Y} end end,
- "case {a, b} of {a, X}=Y -> {x,Y} end. ",
- {x, {a, b}}),
- ?line check(fun() -> case {a, b} of Y={a, _X} -> {x,Y} end end,
- "case {a, b} of Y={a, X} -> {x,Y} end. ",
- {x, {a, b}}),
- ?line check(fun() -> case {a, b} of Y={a, _X}=Z -> {Z,Y} end end,
- "case {a, b} of Y={a, X}=Z -> {Z,Y} end. ",
- {{a, b}, {a, b}}),
- ?line check(fun() -> A = 4, B = 28, <<13:(A+(X=B))>>, X end,
- "begin A = 4, B = 28, <<13:(A+(X=B))>>, X end.",
- 28),
+ check(fun() -> case {a, b} of {a, _X}=Y -> {x,Y} end end,
+ "case {a, b} of {a, X}=Y -> {x,Y} end. ",
+ {x, {a, b}}),
+ check(fun() -> case {a, b} of Y={a, _X} -> {x,Y} end end,
+ "case {a, b} of Y={a, X} -> {x,Y} end. ",
+ {x, {a, b}}),
+ check(fun() -> case {a, b} of Y={a, _X}=Z -> {Z,Y} end end,
+ "case {a, b} of Y={a, X}=Z -> {Z,Y} end. ",
+ {{a, b}, {a, b}}),
+ check(fun() -> A = 4, B = 28, <<13:(A+(X=B))>>, X end,
+ "begin A = 4, B = 28, <<13:(A+(X=B))>>, X end.",
+ 28),
ok.
-match_bin(doc) ->
- ["binary match problems"];
-match_bin(suite) ->
- [];
+%% binary match problems.
match_bin(Config) when is_list(Config) ->
- ?line check(fun() -> <<"abc">> = <<"abc">> end,
- "<<\"abc\">> = <<\"abc\">>. ",
- <<"abc">>),
- ?line check(fun() ->
- <<Size,B:Size/binary,Rest/binary>> = <<2,"AB","CD">>,
- {Size,B,Rest}
- end,
- "begin <<Size,B:Size/binary,Rest/binary>> = <<2,\"AB\",\"CD\">>, "
- "{Size,B,Rest} end. ",
- {2,<<"AB">>,<<"CD">>}),
+ check(fun() -> <<"abc">> = <<"abc">> end,
+ "<<\"abc\">> = <<\"abc\">>. ",
+ <<"abc">>),
+ check(fun() ->
+ <<Size,B:Size/binary,Rest/binary>> = <<2,"AB","CD">>,
+ {Size,B,Rest}
+ end,
+ "begin <<Size,B:Size/binary,Rest/binary>> = <<2,\"AB\",\"CD\">>, "
+ "{Size,B,Rest} end. ",
+ {2,<<"AB">>,<<"CD">>}),
ok.
-pattern_expr(doc) ->
- ["OTP-3144: compile-time expressions in pattern"];
-pattern_expr(suite) ->
- [];
+%% OTP-3144: compile-time expressions in pattern.
pattern_expr(Config) when is_list(Config) ->
- ?line check(fun() -> case 4 of 2+2 -> ok end end,
- "case 4 of 2+2 -> ok end. ",
- ok),
- ?line check(fun() -> case 2 of +2 -> ok end end,
- "case 2 of +2 -> ok end. ",
- ok),
+ check(fun() -> case 4 of 2+2 -> ok end end,
+ "case 4 of 2+2 -> ok end. ",
+ ok),
+ check(fun() -> case 2 of +2 -> ok end end,
+ "case 2 of +2 -> ok end. ",
+ ok),
ok.
-guard_3(doc) ->
- ["OTP-4518."];
-guard_3(suite) ->
- [];
+%% OTP-4518.
guard_3(Config) when is_list(Config) ->
- ?line check(fun() -> if false -> false; true -> true end end,
- "if false -> false; true -> true end.",
- true),
- ?line check(fun() -> if <<"hej">> == <<"hopp">> -> true;
- true -> false end end,
- "begin if <<\"hej\">> == <<\"hopp\">> -> true;
+ check(fun() -> if false -> false; true -> true end end,
+ "if false -> false; true -> true end.",
+ true),
+ check(fun() -> if <<"hej">> == <<"hopp">> -> true;
+ true -> false end end,
+ "begin if <<\"hej\">> == <<\"hopp\">> -> true;
true -> false end end.",
false),
- ?line check(fun() -> if <<"hej">> == <<"hej">> -> true;
- true -> false end end,
- "begin if <<\"hej\">> == <<\"hej\">> -> true;
+ check(fun() -> if <<"hej">> == <<"hej">> -> true;
+ true -> false end end,
+ "begin if <<\"hej\">> == <<\"hej\">> -> true;
true -> false end end.",
true),
ok.
-guard_4(doc) ->
- ["OTP-4885."];
-guard_4(suite) ->
- [];
+%% OTP-4885.
guard_4(Config) when is_list(Config) ->
check(fun() -> if erlang:'+'(3,a) -> true ; true -> false end end,
"if erlang:'+'(3,a) -> true ; true -> false end.",
@@ -226,315 +188,300 @@ guard_4(Config) when is_list(Config) ->
end,
"if erlang:is_integer(3) -> true ; true -> false end.",
true),
- ?line check(fun() -> [X || X <- [1,2,3], erlang:is_integer(X)] end,
- "[X || X <- [1,2,3], erlang:is_integer(X)].",
- [1,2,3]),
- ?line check(fun() -> if is_atom(is_integer(a)) -> true ; true -> false end
- end,
- "if is_atom(is_integer(a)) -> true ; true -> false end.",
- true),
+ check(fun() -> [X || X <- [1,2,3], erlang:is_integer(X)] end,
+ "[X || X <- [1,2,3], erlang:is_integer(X)].",
+ [1,2,3]),
+ check(fun() -> if is_atom(is_integer(a)) -> true ; true -> false end
+ end,
+ "if is_atom(is_integer(a)) -> true ; true -> false end.",
+ true),
check(fun() -> if erlang:is_atom(erlang:is_integer(a)) -> true;
true -> false end end,
"if erlang:is_atom(erlang:is_integer(a)) -> true; "
"true -> false end.",
true),
- ?line check(fun() -> if is_atom(3+a) -> true ; true -> false end end,
- "if is_atom(3+a) -> true ; true -> false end.",
- false),
- ?line check(fun() -> if erlang:is_atom(3+a) -> true ; true -> false end
- end,
- "if erlang:is_atom(3+a) -> true ; true -> false end.",
- false),
+ check(fun() -> if is_atom(3+a) -> true ; true -> false end end,
+ "if is_atom(3+a) -> true ; true -> false end.",
+ false),
+ check(fun() -> if erlang:is_atom(3+a) -> true ; true -> false end
+ end,
+ "if erlang:is_atom(3+a) -> true ; true -> false end.",
+ false),
ok.
-lc(doc) ->
- ["OTP-4518."];
-lc(suite) ->
- [];
+%% OTP-4518.
lc(Config) when is_list(Config) ->
- ?line check(fun() -> X = 32, [X || X <- [1,2,3]] end,
- "begin X = 32, [X || X <- [1,2,3]] end.",
- [1,2,3]),
- ?line check(fun() -> X = 32,
- [X || <<X:X>> <- [<<1:32>>,<<2:32>>,<<3:8>>]] end,
- %% "binsize variable" ^
- "begin X = 32,
+ check(fun() -> X = 32, [X || X <- [1,2,3]] end,
+ "begin X = 32, [X || X <- [1,2,3]] end.",
+ [1,2,3]),
+ check(fun() -> X = 32,
+ [X || <<X:X>> <- [<<1:32>>,<<2:32>>,<<3:8>>]] end,
+ %% "binsize variable" ^
+ "begin X = 32,
[X || <<X:X>> <- [<<1:32>>,<<2:32>>,<<3:8>>]] end.",
[1,2]),
- ?line check(fun() -> Y = 13,[X || {X,Y} <- [{1,2}]] end,
- "begin Y = 13,[X || {X,Y} <- [{1,2}]] end.",
- [1]),
- ?line error_check("begin [A || X <- [{1,2}], 1 == A] end.",
- {unbound_var,'A'}),
- ?line error_check("begin X = 32,
+ check(fun() -> Y = 13,[X || {X,Y} <- [{1,2}]] end,
+ "begin Y = 13,[X || {X,Y} <- [{1,2}]] end.",
+ [1]),
+ error_check("begin [A || X <- [{1,2}], 1 == A] end.",
+ {unbound_var,'A'}),
+ error_check("begin X = 32,
[{Y,W} || X <- [1,2,32,Y=4], Z <- [1,2,W=3]] end.",
{unbound_var,'Y'}),
- ?line error_check("begin X = 32,<<A:B>> = <<100:X>> end.",
- {unbound_var,'B'}),
- ?line check(fun() -> [X || X <- [1,2,3,4], not (X < 2)] end,
- "begin [X || X <- [1,2,3,4], not (X < 2)] end.",
- [2,3,4]),
- ?line check(fun() -> [X || X <- [true,false], X] end,
- "[X || X <- [true,false], X].", [true]),
+ error_check("begin X = 32,<<A:B>> = <<100:X>> end.",
+ {unbound_var,'B'}),
+ check(fun() -> [X || X <- [1,2,3,4], not (X < 2)] end,
+ "begin [X || X <- [1,2,3,4], not (X < 2)] end.",
+ [2,3,4]),
+ check(fun() -> [X || X <- [true,false], X] end,
+ "[X || X <- [true,false], X].", [true]),
ok.
-simple_cases(doc) ->
- ["Simple cases, just to cover some code."];
-simple_cases(suite) ->
- [];
+%% Simple cases, just to cover some code.
simple_cases(Config) when is_list(Config) ->
- ?line check(fun() -> A = $C end, "A = $C.", $C),
- %% ?line check(fun() -> A = 3.14 end, "A = 3.14.", 3.14),
- ?line check(fun() -> self() ! a, A = receive a -> true end end,
- "begin self() ! a, A = receive a -> true end end.",
- true),
- ?line check(fun() -> c:flush(), self() ! a, self() ! b, self() ! c,
- receive b -> b end,
- {messages, [a,c]} =
- erlang:process_info(self(), messages),
- c:flush() end,
- "begin c:flush(), self() ! a, self() ! b, self() ! c,"
- "receive b -> b end,"
- "{messages, [a,c]} ="
- " erlang:process_info(self(), messages), c:flush() end.",
- ok),
- ?line check(fun() -> self() ! a, A = receive a -> true
- after 0 -> false end end,
- "begin self() ! a, A = receive a -> true"
- " after 0 -> false end end.",
- true),
- ?line check(fun() -> c:flush(), self() ! a, self() ! b, self() ! c,
- receive b -> b after 0 -> true end,
- {messages, [a,c]} =
- erlang:process_info(self(), messages),
- c:flush() end,
- "begin c:flush(), self() ! a, self() ! b, self() ! c,"
- "receive b -> b after 0 -> true end,"
- "{messages, [a,c]} ="
- " erlang:process_info(self(), messages), c:flush() end.",
- ok),
- ?line check(fun() -> receive _ -> true after 10 -> false end end,
- "receive _ -> true after 10 -> false end.",
- false),
- ?line check(fun() -> F = fun(A) -> A end, true = 3 == F(3) end,
- "begin F = fun(A) -> A end, true = 3 == F(3) end.",
- true),
- ?line check(fun() -> F = fun(A) -> A end, true = 3 == apply(F, [3]) end,
- "begin F = fun(A) -> A end, true = 3 == apply(F,[3]) end.",
- true),
- ?line check(fun() -> catch throw(a) end, "catch throw(a).", a),
- ?line check(fun() -> catch a end, "catch a.", a),
- ?line check(fun() -> 4 == 3 end, "4 == 3.", false),
- ?line check(fun() -> not true end, "not true.", false),
- ?line check(fun() -> -3 end, "-3.", -3),
-
- ?line error_check("3.0 = 4.0.", {badmatch,4.0}),
- ?line check(fun() -> <<(3.0+2.0):32/float>> = <<5.0:32/float>> end,
- "<<(3.0+2.0):32/float>> = <<5.0:32/float>>.",
- <<5.0:32/float>>),
-
- ?line check(fun() -> false andalso kludd end, "false andalso kludd.",
- false),
- ?line check(fun() -> true andalso true end, "true andalso true.",
- true),
- ?line check(fun() -> true andalso false end, "true andalso false.",
- false),
- ?line check(fun() -> true andalso kludd end, "true andalso kludd.",
- kludd),
- ?line error_check("kladd andalso kludd.", {badarg,kladd}),
-
- ?line check(fun() -> if false andalso kludd -> a; true -> b end end,
- "if false andalso kludd -> a; true -> b end.",
- b),
- ?line check(fun() -> if true andalso true -> a; true -> b end end,
- "if true andalso true -> a; true -> b end.",
- a),
- ?line check(fun() -> if true andalso false -> a; true -> b end end,
- "if true andalso false -> a; true -> b end.",
- b),
-
- ?line check(fun() -> true orelse kludd end,
- "true orelse kludd.", true),
- ?line check(fun() -> false orelse false end,
- "false orelse false.", false),
- ?line check(fun() -> false orelse true end,
- "false orelse true.", true),
- ?line check(fun() -> false orelse kludd end,
- "false orelse kludd.", kludd),
- ?line error_check("kladd orelse kludd.", {badarg,kladd}),
- ?line error_check("[X || X <- [1,2,3], begin 1 end].",{bad_filter,1}),
- ?line error_check("[X || X <- a].",{bad_generator,a}),
-
- ?line check(fun() -> if true orelse kludd -> a; true -> b end end,
- "if true orelse kludd -> a; true -> b end.", a),
- ?line check(fun() -> if false orelse false -> a; true -> b end end,
- "if false orelse false -> a; true -> b end.", b),
- ?line check(fun() -> if false orelse true -> a; true -> b end end,
- "if false orelse true -> a; true -> b end.", a),
-
- ?line check(fun() -> [X || X <- [1,2,3], X+2] end,
- "[X || X <- [1,2,3], X+2].", []),
-
- ?line check(fun() -> [X || X <- [1,2,3], [X] == [X || X <- [2]]] end,
- "[X || X <- [1,2,3], [X] == [X || X <- [2]]].",
- [2]),
- ?line check(fun() -> F = fun(1) -> ett; (2) -> zwei end,
- ett = F(1), zwei = F(2) end,
- "begin F = fun(1) -> ett; (2) -> zwei end,
+ check(fun() -> A = $C end, "A = $C.", $C),
+ %% check(fun() -> A = 3.14 end, "A = 3.14.", 3.14),
+ check(fun() -> self() ! a, A = receive a -> true end end,
+ "begin self() ! a, A = receive a -> true end end.",
+ true),
+ check(fun() -> c:flush(), self() ! a, self() ! b, self() ! c,
+ receive b -> b end,
+ {messages, [a,c]} =
+ erlang:process_info(self(), messages),
+ c:flush() end,
+ "begin c:flush(), self() ! a, self() ! b, self() ! c,"
+ "receive b -> b end,"
+ "{messages, [a,c]} ="
+ " erlang:process_info(self(), messages), c:flush() end.",
+ ok),
+ check(fun() -> self() ! a, A = receive a -> true
+ after 0 -> false end end,
+ "begin self() ! a, A = receive a -> true"
+ " after 0 -> false end end.",
+ true),
+ check(fun() -> c:flush(), self() ! a, self() ! b, self() ! c,
+ receive b -> b after 0 -> true end,
+ {messages, [a,c]} =
+ erlang:process_info(self(), messages),
+ c:flush() end,
+ "begin c:flush(), self() ! a, self() ! b, self() ! c,"
+ "receive b -> b after 0 -> true end,"
+ "{messages, [a,c]} ="
+ " erlang:process_info(self(), messages), c:flush() end.",
+ ok),
+ check(fun() -> receive _ -> true after 10 -> false end end,
+ "receive _ -> true after 10 -> false end.",
+ false),
+ check(fun() -> F = fun(A) -> A end, true = 3 == F(3) end,
+ "begin F = fun(A) -> A end, true = 3 == F(3) end.",
+ true),
+ check(fun() -> F = fun(A) -> A end, true = 3 == apply(F, [3]) end,
+ "begin F = fun(A) -> A end, true = 3 == apply(F,[3]) end.",
+ true),
+ check(fun() -> catch throw(a) end, "catch throw(a).", a),
+ check(fun() -> catch a end, "catch a.", a),
+ check(fun() -> 4 == 3 end, "4 == 3.", false),
+ check(fun() -> not true end, "not true.", false),
+ check(fun() -> -3 end, "-3.", -3),
+
+ error_check("3.0 = 4.0.", {badmatch,4.0}),
+ check(fun() -> <<(3.0+2.0):32/float>> = <<5.0:32/float>> end,
+ "<<(3.0+2.0):32/float>> = <<5.0:32/float>>.",
+ <<5.0:32/float>>),
+
+ check(fun() -> false andalso kludd end, "false andalso kludd.",
+ false),
+ check(fun() -> true andalso true end, "true andalso true.",
+ true),
+ check(fun() -> true andalso false end, "true andalso false.",
+ false),
+ check(fun() -> true andalso kludd end, "true andalso kludd.",
+ kludd),
+ error_check("kladd andalso kludd.", {badarg,kladd}),
+
+ check(fun() -> if false andalso kludd -> a; true -> b end end,
+ "if false andalso kludd -> a; true -> b end.",
+ b),
+ check(fun() -> if true andalso true -> a; true -> b end end,
+ "if true andalso true -> a; true -> b end.",
+ a),
+ check(fun() -> if true andalso false -> a; true -> b end end,
+ "if true andalso false -> a; true -> b end.",
+ b),
+
+ check(fun() -> true orelse kludd end,
+ "true orelse kludd.", true),
+ check(fun() -> false orelse false end,
+ "false orelse false.", false),
+ check(fun() -> false orelse true end,
+ "false orelse true.", true),
+ check(fun() -> false orelse kludd end,
+ "false orelse kludd.", kludd),
+ error_check("kladd orelse kludd.", {badarg,kladd}),
+ error_check("[X || X <- [1,2,3], begin 1 end].",{bad_filter,1}),
+ error_check("[X || X <- a].",{bad_generator,a}),
+
+ check(fun() -> if true orelse kludd -> a; true -> b end end,
+ "if true orelse kludd -> a; true -> b end.", a),
+ check(fun() -> if false orelse false -> a; true -> b end end,
+ "if false orelse false -> a; true -> b end.", b),
+ check(fun() -> if false orelse true -> a; true -> b end end,
+ "if false orelse true -> a; true -> b end.", a),
+
+ check(fun() -> [X || X <- [1,2,3], X+2] end,
+ "[X || X <- [1,2,3], X+2].", []),
+
+ check(fun() -> [X || X <- [1,2,3], [X] == [X || X <- [2]]] end,
+ "[X || X <- [1,2,3], [X] == [X || X <- [2]]].",
+ [2]),
+ check(fun() -> F = fun(1) -> ett; (2) -> zwei end,
+ ett = F(1), zwei = F(2) end,
+ "begin F = fun(1) -> ett; (2) -> zwei end,
ett = F(1), zwei = F(2) end.",
zwei),
- ?line check(fun() -> F = fun(X) when X == 1 -> ett;
- (X) when X == 2 -> zwei end,
- ett = F(1), zwei = F(2) end,
- "begin F = fun(X) when X == 1 -> ett;
+ check(fun() -> F = fun(X) when X == 1 -> ett;
+ (X) when X == 2 -> zwei end,
+ ett = F(1), zwei = F(2) end,
+ "begin F = fun(X) when X == 1 -> ett;
(X) when X == 2 -> zwei end,
- ett = F(1), zwei = F(2) end.",
+ ett = F(1), zwei = F(2) end.",
zwei),
- ?line error_check("begin F = fun(1) -> ett end, zwei = F(2) end.",
- function_clause),
- ?line check(fun() -> if length([1]) == 1 -> yes;
- true -> no end end,
- "if length([1]) == 1 -> yes;
+ error_check("begin F = fun(1) -> ett end, zwei = F(2) end.",
+ function_clause),
+ check(fun() -> if length([1]) == 1 -> yes;
+ true -> no end end,
+ "if length([1]) == 1 -> yes;
true -> no end.",
yes),
- ?line check(fun() -> if is_integer(3) -> true; true -> false end end,
- "if is_integer(3) -> true; true -> false end.", true),
- ?line check(fun() -> if integer(3) -> true; true -> false end end,
- "if integer(3) -> true; true -> false end.", true),
- ?line check(fun() -> if is_float(3) -> true; true -> false end end,
- "if is_float(3) -> true; true -> false end.", false),
- ?line check(fun() -> if float(3) -> true; true -> false end end,
- "if float(3) -> true; true -> false end.", false),
- ?line check(fun() -> if is_number(3) -> true; true -> false end end,
- "if is_number(3) -> true; true -> false end.", true),
- ?line check(fun() -> if number(3) -> true; true -> false end end,
- "if number(3) -> true; true -> false end.", true),
- ?line check(fun() -> if is_atom(a) -> true; true -> false end end,
- "if is_atom(a) -> true; true -> false end.", true),
- ?line check(fun() -> if atom(a) -> true; true -> false end end,
- "if atom(a) -> true; true -> false end.", true),
- ?line check(fun() -> if is_list([]) -> true; true -> false end end,
- "if is_list([]) -> true; true -> false end.", true),
- ?line check(fun() -> if list([]) -> true; true -> false end end,
- "if list([]) -> true; true -> false end.", true),
- ?line check(fun() -> if is_tuple({}) -> true; true -> false end end,
- "if is_tuple({}) -> true; true -> false end.", true),
- ?line check(fun() -> if tuple({}) -> true; true -> false end end,
- "if tuple({}) -> true; true -> false end.", true),
- ?line check(fun() -> if is_pid(self()) -> true; true -> false end end,
- "if is_pid(self()) -> true; true -> false end.", true),
- ?line check(fun() -> if pid(self()) -> true; true -> false end end,
- "if pid(self()) -> true; true -> false end.", true),
- ?line check(fun() -> R = make_ref(), if is_reference(R) -> true;
- true -> false end end,
- "begin R = make_ref(), if is_reference(R) -> true;"
- "true -> false end end.", true),
- ?line check(fun() -> R = make_ref(), if reference(R) -> true;
- true -> false end end,
- "begin R = make_ref(), if reference(R) -> true;"
- "true -> false end end.", true),
- ?line check(fun() -> if is_port(a) -> true; true -> false end end,
- "if is_port(a) -> true; true -> false end.", false),
- ?line check(fun() -> if port(a) -> true; true -> false end end,
- "if port(a) -> true; true -> false end.", false),
- ?line check(fun() -> if is_function(a) -> true; true -> false end end,
- "if is_function(a) -> true; true -> false end.", false),
- ?line check(fun() -> if function(a) -> true; true -> false end end,
- "if function(a) -> true; true -> false end.", false),
- ?line check(fun() -> if is_binary(<<>>) -> true; true -> false end end,
- "if is_binary(<<>>) -> true; true -> false end.", true),
- ?line check(fun() -> if binary(<<>>) -> true; true -> false end end,
- "if binary(<<>>) -> true; true -> false end.", true),
- ?line check(fun() -> if is_integer(a) == true -> yes;
- true -> no end end,
- "if is_integer(a) == true -> yes;
+ check(fun() -> if is_integer(3) -> true; true -> false end end,
+ "if is_integer(3) -> true; true -> false end.", true),
+ check(fun() -> if integer(3) -> true; true -> false end end,
+ "if integer(3) -> true; true -> false end.", true),
+ check(fun() -> if is_float(3) -> true; true -> false end end,
+ "if is_float(3) -> true; true -> false end.", false),
+ check(fun() -> if float(3) -> true; true -> false end end,
+ "if float(3) -> true; true -> false end.", false),
+ check(fun() -> if is_number(3) -> true; true -> false end end,
+ "if is_number(3) -> true; true -> false end.", true),
+ check(fun() -> if number(3) -> true; true -> false end end,
+ "if number(3) -> true; true -> false end.", true),
+ check(fun() -> if is_atom(a) -> true; true -> false end end,
+ "if is_atom(a) -> true; true -> false end.", true),
+ check(fun() -> if atom(a) -> true; true -> false end end,
+ "if atom(a) -> true; true -> false end.", true),
+ check(fun() -> if is_list([]) -> true; true -> false end end,
+ "if is_list([]) -> true; true -> false end.", true),
+ check(fun() -> if list([]) -> true; true -> false end end,
+ "if list([]) -> true; true -> false end.", true),
+ check(fun() -> if is_tuple({}) -> true; true -> false end end,
+ "if is_tuple({}) -> true; true -> false end.", true),
+ check(fun() -> if tuple({}) -> true; true -> false end end,
+ "if tuple({}) -> true; true -> false end.", true),
+ check(fun() -> if is_pid(self()) -> true; true -> false end end,
+ "if is_pid(self()) -> true; true -> false end.", true),
+ check(fun() -> if pid(self()) -> true; true -> false end end,
+ "if pid(self()) -> true; true -> false end.", true),
+ check(fun() -> R = make_ref(), if is_reference(R) -> true;
+ true -> false end end,
+ "begin R = make_ref(), if is_reference(R) -> true;"
+ "true -> false end end.", true),
+ check(fun() -> R = make_ref(), if reference(R) -> true;
+ true -> false end end,
+ "begin R = make_ref(), if reference(R) -> true;"
+ "true -> false end end.", true),
+ check(fun() -> if is_port(a) -> true; true -> false end end,
+ "if is_port(a) -> true; true -> false end.", false),
+ check(fun() -> if port(a) -> true; true -> false end end,
+ "if port(a) -> true; true -> false end.", false),
+ check(fun() -> if is_function(a) -> true; true -> false end end,
+ "if is_function(a) -> true; true -> false end.", false),
+ check(fun() -> if function(a) -> true; true -> false end end,
+ "if function(a) -> true; true -> false end.", false),
+ check(fun() -> if is_binary(<<>>) -> true; true -> false end end,
+ "if is_binary(<<>>) -> true; true -> false end.", true),
+ check(fun() -> if binary(<<>>) -> true; true -> false end end,
+ "if binary(<<>>) -> true; true -> false end.", true),
+ check(fun() -> if is_integer(a) == true -> yes;
+ true -> no end end,
+ "if is_integer(a) == true -> yes;
true -> no end.",
no),
- ?line check(fun() -> if [] -> true; true -> false end end,
- "if [] -> true; true -> false end.", false),
- ?line error_check("if lists:member(1,[1]) -> true; true -> false end.",
- illegal_guard_expr),
- ?line error_check("if false -> true end.", if_clause),
- ?line check(fun() -> if a+b -> true; true -> false end end,
- "if a + b -> true; true -> false end.", false),
- ?line check(fun() -> if + b -> true; true -> false end end,
- "if + b -> true; true -> false end.", false),
- ?line error_check("case foo of bar -> true end.", {case_clause,foo}),
- ?line error_check("case 4 of 2+a -> true; _ -> false end.",
- illegal_pattern),
- ?line error_check("case 4 of +a -> true; _ -> false end.",
- illegal_pattern),
- ?line check(fun() -> case a of
- X when X == b -> one;
- X when X == a -> two
- end end,
- "begin case a of
+ check(fun() -> if [] -> true; true -> false end end,
+ "if [] -> true; true -> false end.", false),
+ error_check("if lists:member(1,[1]) -> true; true -> false end.",
+ illegal_guard_expr),
+ error_check("if false -> true end.", if_clause),
+ check(fun() -> if a+b -> true; true -> false end end,
+ "if a + b -> true; true -> false end.", false),
+ check(fun() -> if + b -> true; true -> false end end,
+ "if + b -> true; true -> false end.", false),
+ error_check("case foo of bar -> true end.", {case_clause,foo}),
+ error_check("case 4 of 2+a -> true; _ -> false end.",
+ illegal_pattern),
+ error_check("case 4 of +a -> true; _ -> false end.",
+ illegal_pattern),
+ check(fun() -> case a of
+ X when X == b -> one;
+ X when X == a -> two
+ end end,
+ "begin case a of
X when X == b -> one;
- X when X == a -> two
- end end.", two),
- ?line error_check("3 = 4.", {badmatch,4}),
- ?line error_check("a = 3.", {badmatch,3}),
- %% ?line error_check("3.1 = 2.7.",{badmatch,2.7}),
- ?line error_check("$c = 4.", {badmatch,4}),
- ?line check(fun() -> $c = $c end, "$c = $c.", $c),
- ?line check(fun() -> _ = bar end, "_ = bar.", bar),
- ?line check(fun() -> A = 14, A = 14 end,
+ X when X == a -> two
+ end end.", two),
+ error_check("3 = 4.", {badmatch,4}),
+ error_check("a = 3.", {badmatch,3}),
+ %% error_check("3.1 = 2.7.",{badmatch,2.7}),
+ error_check("$c = 4.", {badmatch,4}),
+ check(fun() -> $c = $c end, "$c = $c.", $c),
+ check(fun() -> _ = bar end, "_ = bar.", bar),
+ check(fun() -> A = 14, A = 14 end,
"begin A = 14, A = 14 end.", 14),
- ?line error_check("begin A = 14, A = 16 end.", {badmatch,16}),
- ?line error_check("\"hej\" = \"san\".", {badmatch,"san"}),
- ?line check(fun() -> "hej" = "hej" end,
+ error_check("begin A = 14, A = 16 end.", {badmatch,16}),
+ error_check("\"hej\" = \"san\".", {badmatch,"san"}),
+ check(fun() -> "hej" = "hej" end,
"\"hej\" = \"hej\".", "hej"),
- ?line error_check("[] = [a].", {badmatch,[a]}),
- ?line check(fun() -> [] = [] end, "[] = [].", []),
- ?line error_check("[a] = [].", {badmatch,[]}),
- ?line error_check("{a,b} = 34.", {badmatch,34}),
- ?line check(fun() -> <<X:7>> = <<8:7>>, X end,
+ error_check("[] = [a].", {badmatch,[a]}),
+ check(fun() -> [] = [] end, "[] = [].", []),
+ error_check("[a] = [].", {badmatch,[]}),
+ error_check("{a,b} = 34.", {badmatch,34}),
+ check(fun() -> <<X:7>> = <<8:7>>, X end,
"begin <<X:7>> = <<8:7>>, X end.", 8),
- ?line error_check("<<34:32>> = \"hej\".", {badmatch,"hej"}),
- ?line check(fun() -> trunc((1 * 3 div 3 + 4 - 3) / 1) rem 2 end,
+ error_check("<<34:32>> = \"hej\".", {badmatch,"hej"}),
+ check(fun() -> trunc((1 * 3 div 3 + 4 - 3) / 1) rem 2 end,
"begin trunc((1 * 3 div 3 + 4 - 3) / 1) rem 2 end.", 0),
- ?line check(fun() -> (2#101 band 2#10101) bor (2#110 bxor 2#010) end,
+ check(fun() -> (2#101 band 2#10101) bor (2#110 bxor 2#010) end,
"(2#101 band 2#10101) bor (2#110 bxor 2#010).", 5),
- ?line check(fun() -> (2#1 bsl 4) + (2#10000 bsr 3) end,
+ check(fun() -> (2#1 bsl 4) + (2#10000 bsr 3) end,
"(2#1 bsl 4) + (2#10000 bsr 3).", 18),
- ?line check(fun() -> ((1<3) and ((1 =:= 2) or (1 =/= 2))) xor (1=<2) end,
+ check(fun() -> ((1<3) and ((1 =:= 2) or (1 =/= 2))) xor (1=<2) end,
"((1<3) and ((1 =:= 2) or (1 =/= 2))) xor (1=<2).", false),
- ?line check(fun() -> (a /= b) or (2 > 4) or (3 >= 3) end,
+ check(fun() -> (a /= b) or (2 > 4) or (3 >= 3) end,
"(a /= b) or (2 > 4) or (3 >= 3).", true),
- ?line check(fun() -> "hej" ++ "san" =/= "hejsan" -- "san" end,
+ check(fun() -> "hej" ++ "san" =/= "hejsan" -- "san" end,
"\"hej\" ++ \"san\" =/= \"hejsan\" -- \"san\".", true),
- ?line check(fun() -> (bnot 1) < -0 end, "(bnot (+1)) < -0.", true),
- ok.
+ check(fun() -> (bnot 1) < -0 end, "(bnot (+1)) < -0.", true),
+ ok.
-unary_plus(doc) ->
- ["OTP-4929. Unary plus rejects non-numbers."];
-unary_plus(suite) ->
- [];
+%% OTP-4929. Unary plus rejects non-numbers.
unary_plus(Config) when is_list(Config) ->
- ?line check(fun() -> F = fun(X) -> + X end,
- true = -1 == F(-1) end,
- "begin F = fun(X) -> + X end,"
- " true = -1 == F(-1) end.", true, ['F'], none, none),
- ?line error_check("+a.", badarith),
+ check(fun() -> F = fun(X) -> + X end,
+ true = -1 == F(-1) end,
+ "begin F = fun(X) -> + X end,"
+ " true = -1 == F(-1) end.", true, ['F'], none, none),
+ error_check("+a.", badarith),
ok.
-apply_atom(doc) ->
- ["OTP-5064. Can no longer apply atoms."];
-apply_atom(suite) ->
- [];
+%% OTP-5064. Can no longer apply atoms.
apply_atom(Config) when is_list(Config) ->
- ?line error_check("[X || X <- [[1],[2]],
+ error_check("[X || X <- [[1],[2]],
begin L = length, L(X) =:= 1 end].",
{badfun,length}),
ok.
-otp_5269(doc) ->
- ["OTP-5269. Bugs in the bit syntax."];
-otp_5269(suite) ->
- [];
+%% OTP-5269. Bugs in the bit syntax.
otp_5269(Config) when is_list(Config) ->
- ?line check(fun() -> L = 8,
+ check(fun() -> L = 8,
F = fun(<<A:L,B:A>>) -> B end,
F(<<16:8, 7:16>>)
end,
@@ -542,7 +489,7 @@ otp_5269(Config) when is_list(Config) ->
L = 8, F = fun(<<A:L,B:A>>) -> B end, F(<<16:8, 7:16>>)
end.",
7),
- ?line check(fun() -> L = 8,
+ check(fun() -> L = 8,
F = fun(<<L:L,B:L>>) -> B end,
F(<<16:8, 7:16>>)
end,
@@ -550,24 +497,24 @@ otp_5269(Config) when is_list(Config) ->
L = 8, F = fun(<<L:L,B:L>>) -> B end, F(<<16:8, 7:16>>)
end.",
7),
- ?line check(fun() -> L = 8, <<A:L,B:A>> = <<16:8, 7:16>>, B end,
+ check(fun() -> L = 8, <<A:L,B:A>> = <<16:8, 7:16>>, B end,
"begin L = 8, <<A:L,B:A>> = <<16:8, 7:16>>, B end.",
7),
- ?line error_check("begin L = 8, <<L:L,B:L>> = <<16:8, 7:16>> end.",
+ error_check("begin L = 8, <<L:L,B:L>> = <<16:8, 7:16>> end.",
{badmatch,<<16:8,7:16>>}),
- ?line error_check("begin <<L:16,L:L>> = <<16:16,8:16>>, L end.",
+ error_check("begin <<L:16,L:L>> = <<16:16,8:16>>, L end.",
{badmatch, <<16:16,8:16>>}),
- ?line check(fun() -> U = 8, (fun(<<U:U>>) -> U end)(<<32:8>>) end,
+ check(fun() -> U = 8, (fun(<<U:U>>) -> U end)(<<32:8>>) end,
"begin U = 8, (fun(<<U:U>>) -> U end)(<<32:8>>) end.",
32),
- ?line check(fun() -> U = 8, [U || <<U:U>> <- [<<32:8>>]] end,
+ check(fun() -> U = 8, [U || <<U:U>> <- [<<32:8>>]] end,
"begin U = 8, [U || <<U:U>> <- [<<32:8>>]] end.",
[32]),
- ?line error_check("(fun({3,<<A:32,A:32>>}) -> a end)
+ error_check("(fun({3,<<A:32,A:32>>}) -> a end)
({3,<<17:32,19:32>>}).",
function_clause),
- ?line check(fun() -> [X || <<A:8,
+ check(fun() -> [X || <<A:8,
B:A>> <- [<<16:8,19:16>>],
<<X:8>> <- [<<B:8>>]] end,
"[X || <<A:8,
@@ -576,12 +523,9 @@ otp_5269(Config) when is_list(Config) ->
[19]),
ok.
-otp_6539(doc) ->
- ["OTP-6539. try/catch bugs."];
-otp_6539(suite) ->
- [];
+%% OTP-6539. try/catch bugs.
otp_6539(Config) when is_list(Config) ->
- ?line check(fun() ->
+ check(fun() ->
F = fun(A,B) ->
try A+B
catch _:_ -> dontthinkso
@@ -600,152 +544,149 @@ otp_6539(Config) when is_list(Config) ->
[3, 5]),
ok.
-otp_6543(doc) ->
- ["OTP-6543. bitlevel binaries."];
-otp_6543(suite) ->
- [];
+%% OTP-6543. bitlevel binaries.
otp_6543(Config) when is_list(Config) ->
- ?line check(fun() ->
+ check(fun() ->
<< <<X>> || <<X>> <- [1,2,3] >>
end,
"<< <<X>> || <<X>> <- [1,2,3] >>.",
<<>>),
- ?line check(fun() ->
+ check(fun() ->
<< <<X>> || X <- [1,2,3] >>
end,
"<< <<X>> || X <- [1,2,3] >>.",
<<1,2,3>>),
- ?line check(fun() ->
+ check(fun() ->
<< <<X:8>> || <<X:2>> <= <<"hej">> >>
end,
"<< <<X:8>> || <<X:2>> <= <<\"hej\">> >>.",
<<1,2,2,0,1,2,1,1,1,2,2,2>>),
- ?line check(fun() ->
+ check(fun() ->
<< <<X:8>> ||
<<65,X:4>> <= <<65,7:4,65,3:4,66,8:4>> >>
end,
"<< <<X:8>> ||
<<65,X:4>> <= <<65,7:4,65,3:4,66,8:4>> >>.",
<<7,3>>),
- ?line check(fun() -> <<34:18/big>> end,
+ check(fun() -> <<34:18/big>> end,
"<<34:18/big>>.",
<<0,8,2:2>>),
- ?line check(fun() -> <<34:18/big-unit:2>> end,
+ check(fun() -> <<34:18/big-unit:2>> end,
"<<34:18/big-unit:2>>.",
<<0,0,0,2,2:4>>),
- ?line check(fun() -> <<34:18/little>> end,
+ check(fun() -> <<34:18/little>> end,
"<<34:18/little>>.",
<<34,0,0:2>>),
- ?line case eval_string("<<34:18/native>>.") of
+ case eval_string("<<34:18/native>>.") of
<<0,8,2:2>> -> ok;
<<34,0,0:2>> -> ok
end,
- ?line check(fun() -> <<34:18/big-signed>> end,
+ check(fun() -> <<34:18/big-signed>> end,
"<<34:18/big-signed>>.",
<<0,8,2:2>>),
- ?line check(fun() -> <<34:18/little-signed>> end,
+ check(fun() -> <<34:18/little-signed>> end,
"<<34:18/little-signed>>.",
<<34,0,0:2>>),
- ?line case eval_string("<<34:18/native-signed>>.") of
+ case eval_string("<<34:18/native-signed>>.") of
<<0,8,2:2>> -> ok;
<<34,0,0:2>> -> ok
end,
- ?line check(fun() -> <<34:18/big-unsigned>> end,
+ check(fun() -> <<34:18/big-unsigned>> end,
"<<34:18/big-unsigned>>.",
<<0,8,2:2>>),
- ?line check(fun() -> <<34:18/little-unsigned>> end,
+ check(fun() -> <<34:18/little-unsigned>> end,
"<<34:18/little-unsigned>>.",
<<34,0,0:2>>),
- ?line case eval_string("<<34:18/native-unsigned>>.") of
+ case eval_string("<<34:18/native-unsigned>>.") of
<<0,8,2:2>> -> ok;
<<34,0,0:2>> -> ok
end,
- ?line check(fun() -> <<3.14:32/float-big>> end,
+ check(fun() -> <<3.14:32/float-big>> end,
"<<3.14:32/float-big>>.",
<<64,72,245,195>>),
- ?line check(fun() -> <<3.14:32/float-little>> end,
+ check(fun() -> <<3.14:32/float-little>> end,
"<<3.14:32/float-little>>.",
<<195,245,72,64>>),
- ?line case eval_string("<<3.14:32/float-native>>.") of
+ case eval_string("<<3.14:32/float-native>>.") of
<<64,72,245,195>> -> ok;
<<195,245,72,64>> -> ok
end,
- ?line error_check("<<(<<17,3:2>>)/binary>>.", badarg),
- ?line check(fun() -> <<(<<17,3:2>>)/bitstring>> end,
+ error_check("<<(<<17,3:2>>)/binary>>.", badarg),
+ check(fun() -> <<(<<17,3:2>>)/bitstring>> end,
"<<(<<17,3:2>>)/bitstring>>.",
<<17,3:2>>),
- ?line check(fun() -> <<(<<17,3:2>>):10/bitstring>> end,
+ check(fun() -> <<(<<17,3:2>>):10/bitstring>> end,
"<<(<<17,3:2>>):10/bitstring>>.",
<<17,3:2>>),
- ?line check(fun() -> <<<<344:17>>/binary-unit:17>> end,
+ check(fun() -> <<<<344:17>>/binary-unit:17>> end,
"<<<<344:17>>/binary-unit:17>>.",
<<344:17>>),
- ?line check(fun() -> <<X:18/big>> = <<34:18/big>>, X end,
+ check(fun() -> <<X:18/big>> = <<34:18/big>>, X end,
"begin <<X:18/big>> = <<34:18/big>>, X end.",
34),
- ?line check(fun() -> <<X:18/big-unit:2>> = <<34:18/big-unit:2>>, X end,
+ check(fun() -> <<X:18/big-unit:2>> = <<34:18/big-unit:2>>, X end,
"begin <<X:18/big-unit:2>> = <<34:18/big-unit:2>>, X end.",
34),
- ?line check(fun() -> <<X:18/little>> = <<34:18/little>>, X end,
+ check(fun() -> <<X:18/little>> = <<34:18/little>>, X end,
"begin <<X:18/little>> = <<34:18/little>>, X end.",
34),
- ?line check(fun() -> <<X:18/native>> = <<34:18/native>>, X end,
+ check(fun() -> <<X:18/native>> = <<34:18/native>>, X end,
"begin <<X:18/native>> = <<34:18/native>>, X end.",
34),
- ?line check(fun() -> <<X:18/big-signed>> = <<34:18/big-signed>>, X end,
+ check(fun() -> <<X:18/big-signed>> = <<34:18/big-signed>>, X end,
"begin <<X:18/big-signed>> = <<34:18/big-signed>>, X end.",
34),
- ?line check(fun() -> <<X:18/little-signed>> = <<34:18/little-signed>>,
+ check(fun() -> <<X:18/little-signed>> = <<34:18/little-signed>>,
X end,
"begin <<X:18/little-signed>> = <<34:18/little-signed>>,
X end.",
34),
- ?line check(fun() -> <<X:18/native-signed>> = <<34:18/native-signed>>,
+ check(fun() -> <<X:18/native-signed>> = <<34:18/native-signed>>,
X end,
"begin <<X:18/native-signed>> = <<34:18/native-signed>>,
X end.",
34),
- ?line check(fun() -> <<X:18/big-unsigned>> = <<34:18/big-unsigned>>,
+ check(fun() -> <<X:18/big-unsigned>> = <<34:18/big-unsigned>>,
X end,
"begin <<X:18/big-unsigned>> = <<34:18/big-unsigned>>,
X end.",
34),
- ?line check(fun() ->
+ check(fun() ->
<<X:18/little-unsigned>> = <<34:18/little-unsigned>>,
X end,
"begin <<X:18/little-unsigned>> = <<34:18/little-unsigned>>,
X end.",
34),
- ?line check(fun() ->
+ check(fun() ->
<<X:18/native-unsigned>> = <<34:18/native-unsigned>>,
X end,
"begin <<X:18/native-unsigned>> = <<34:18/native-unsigned>>,
X end.",
34),
- ?line check(fun() -> <<X:32/float-big>> = <<2.0:32/float-big>>, X end,
+ check(fun() -> <<X:32/float-big>> = <<2.0:32/float-big>>, X end,
"begin <<X:32/float-big>> = <<2.0:32/float-big>>,
X end.",
2.0),
- ?line check(fun() -> <<X:32/float-little>> = <<2.0:32/float-little>>,
+ check(fun() -> <<X:32/float-little>> = <<2.0:32/float-little>>,
X end,
"begin <<X:32/float-little>> = <<2.0:32/float-little>>,
X end.",
2.0),
- ?line check(fun() -> <<X:32/float-native>> = <<2.0:32/float-native>>,
+ check(fun() -> <<X:32/float-native>> = <<2.0:32/float-native>>,
X end,
"begin <<X:32/float-native>> = <<2.0:32/float-native>>,
X end.",
2.0),
- ?line check(
+ check(
fun() ->
[X || <<"hej",X:8>> <= <<"hej",8,"san",9,"hej",17,"hej">>]
end,
"[X || <<\"hej\",X:8>> <=
<<\"hej\",8,\"san\",9,\"hej\",17,\"hej\">>].",
[8,17]),
- ?line check(
+ check(
fun() ->
L = 8, << <<B:32>> || <<L:L,B:L>> <= <<16:8, 7:16>> >>
end,
@@ -754,41 +695,41 @@ otp_6543(Config) when is_list(Config) ->
<<0,0,0,7>>),
%% Test the Value part of a binary segment.
%% "Old" bugs have been fixed (partial_eval is called on Value).
- ?line check(fun() -> [ 3 || <<17/float>> <= <<17.0/float>>] end,
+ check(fun() -> [ 3 || <<17/float>> <= <<17.0/float>>] end,
"[ 3 || <<17/float>> <= <<17.0/float>>].",
[3]),
- ?line check(fun() -> [ 3 || <<17/float>> <- [<<17.0/float>>]] end,
+ check(fun() -> [ 3 || <<17/float>> <- [<<17.0/float>>]] end,
"[ 3 || <<17/float>> <- [<<17.0/float>>]].",
[3]),
- ?line check(fun() -> [ X || <<17/float,X:3>> <= <<17.0/float,2:3>>] end,
+ check(fun() -> [ X || <<17/float,X:3>> <= <<17.0/float,2:3>>] end,
"[ X || <<17/float,X:3>> <= <<17.0/float,2:3>>].",
[2]),
- ?line check(fun() ->
+ check(fun() ->
[ foo || <<(1 bsl 1023)/float>> <= <<(1 bsl 1023)/float>>]
end,
"[ foo || <<(1 bsl 1023)/float>> <= <<(1 bsl 1023)/float>>].",
[foo]),
- ?line check(fun() ->
+ check(fun() ->
[ foo || <<(1 bsl 1023)/float>> <- [<<(1 bsl 1023)/float>>]]
end,
"[ foo || <<(1 bsl 1023)/float>> <- [<<(1 bsl 1023)/float>>]].",
[foo]),
- ?line error_check("[ foo || <<(1 bsl 1024)/float>> <-
+ error_check("[ foo || <<(1 bsl 1024)/float>> <-
[<<(1 bsl 1024)/float>>]].",
badarg),
- ?line check(fun() ->
+ check(fun() ->
[ foo || <<(1 bsl 1024)/float>> <- [<<(1 bsl 1023)/float>>]]
end,
"[ foo || <<(1 bsl 1024)/float>> <-
[<<(1 bsl 1023)/float>>]].",
[]),
- ?line check(fun() ->
+ check(fun() ->
[ foo || <<(1 bsl 1024)/float>> <= <<(1 bsl 1023)/float>>]
end,
"[ foo || <<(1 bsl 1024)/float>> <=
<<(1 bsl 1023)/float>>].",
[]),
- ?line check(fun() ->
+ check(fun() ->
L = 8,
[{L,B} || <<L:L,B:L/float>> <= <<32:8,7:32/float>>]
end,
@@ -796,7 +737,7 @@ otp_6543(Config) when is_list(Config) ->
[{L,B} || <<L:L,B:L/float>> <= <<32:8,7:32/float>>]
end.",
[{32,7.0}]),
- ?line check(fun() ->
+ check(fun() ->
L = 8,
[{L,B} || <<L:L,B:L/float>> <- [<<32:8,7:32/float>>]]
end,
@@ -804,127 +745,117 @@ otp_6543(Config) when is_list(Config) ->
[{L,B} || <<L:L,B:L/float>> <- [<<32:8,7:32/float>>]]
end.",
[{32,7.0}]),
- ?line check(fun() ->
+ check(fun() ->
[foo || <<"s">> <= <<"st">>]
end,
"[foo || <<\"s\">> <= <<\"st\">>].",
[foo]),
- ?line check(fun() -> <<_:32>> = <<17:32>> end,
+ check(fun() -> <<_:32>> = <<17:32>> end,
"<<_:32>> = <<17:32>>.",
<<17:32>>),
- ?line check(fun() -> [foo || <<_:32>> <= <<17:32,20:32>>] end,
+ check(fun() -> [foo || <<_:32>> <= <<17:32,20:32>>] end,
"[foo || <<_:32>> <= <<17:32,20:32>>].",
[foo,foo]),
- ?line check(fun() -> << <<X:32>> || X <- [1,2,3], X > 1 >> end,
+ check(fun() -> << <<X:32>> || X <- [1,2,3], X > 1 >> end,
"<< <<X:32>> || X <- [1,2,3], X > 1 >>.",
<<0,0,0,2,0,0,0,3>>),
- ?line error_check("[X || <<X>> <= [a,b]].",{bad_generator,[a,b]}),
+ error_check("[X || <<X>> <= [a,b]].",{bad_generator,[a,b]}),
ok.
-otp_6787(doc) ->
- ["OTP-6787. bitlevel binaries."];
-otp_6787(suite) ->
- [];
+%% OTP-6787. bitlevel binaries.
otp_6787(Config) when is_list(Config) ->
- ?line check(
+ check(
fun() -> <<16:(1024*1024)>> = <<16:(1024*1024)>> end,
"<<16:(1024*1024)>> = <<16:(1024*1024)>>.",
<<16:1048576>>),
ok.
-otp_6977(doc) ->
- ["OTP-6977. ++ bug."];
-otp_6977(suite) ->
- [];
+%% OTP-6977. ++ bug.
otp_6977(Config) when is_list(Config) ->
- ?line check(
+ check(
fun() -> (fun([$X] ++ _) -> ok end)("X") end,
"(fun([$X] ++ _) -> ok end)(\"X\").",
ok),
ok.
-otp_7550(doc) ->
- ["OTP-7550. Support for UTF-8, UTF-16, UTF-32."];
+%% OTP-7550. Support for UTF-8, UTF-16, UTF-32.
otp_7550(Config) when is_list(Config) ->
%% UTF-8.
- ?line check(
+ check(
fun() -> <<65>> = <<65/utf8>> end,
"<<65>> = <<65/utf8>>.",
<<65>>),
- ?line check(
+ check(
fun() -> <<350/utf8>> = <<197,158>> end,
"<<350/utf8>> = <<197,158>>.",
<<197,158>>),
- ?line check(
+ check(
fun() -> <<$b,$j,$\303,$\266,$r,$n>> = <<"bj\366rn"/utf8>> end,
"<<$b,$j,$\303,$\266,$r,$n>> = <<\"bj\366rn\"/utf8>>.",
<<$b,$j,$\303,$\266,$r,$n>>),
%% UTF-16.
- ?line check(
+ check(
fun() -> <<0,65>> = <<65/utf16>> end,
"<<0,65>> = <<65/utf16>>.",
<<0,65>>),
- ?line check(
+ check(
fun() -> <<16#D8,16#08,16#DF,16#45>> = <<16#12345/utf16>> end,
"<<16#D8,16#08,16#DF,16#45>> = <<16#12345/utf16>>.",
<<16#D8,16#08,16#DF,16#45>>),
- ?line check(
+ check(
fun() -> <<16#08,16#D8,16#45,16#DF>> = <<16#12345/little-utf16>> end,
"<<16#08,16#D8,16#45,16#DF>> = <<16#12345/little-utf16>>.",
<<16#08,16#D8,16#45,16#DF>>),
- ?line check(
+ check(
fun() -> <<350/utf16>> = <<1,94>> end,
"<<350/utf16>> = <<1,94>>.",
<<1,94>>),
- ?line check(
+ check(
fun() -> <<350/little-utf16>> = <<94,1>> end,
"<<350/little-utf16>> = <<94,1>>.",
<<94,1>>),
- ?line check(
+ check(
fun() -> <<16#12345/utf16>> = <<16#D8,16#08,16#DF,16#45>> end,
"<<16#12345/utf16>> = <<16#D8,16#08,16#DF,16#45>>.",
<<16#D8,16#08,16#DF,16#45>>),
- ?line check(
+ check(
fun() -> <<16#12345/little-utf16>> = <<16#08,16#D8,16#45,16#DF>> end,
"<<16#12345/little-utf16>> = <<16#08,16#D8,16#45,16#DF>>.",
<<16#08,16#D8,16#45,16#DF>>),
%% UTF-32.
- ?line check(
+ check(
fun() -> <<16#12345/utf32>> = <<16#0,16#01,16#23,16#45>> end,
"<<16#12345/utf32>> = <<16#0,16#01,16#23,16#45>>.",
<<16#0,16#01,16#23,16#45>>),
- ?line check(
+ check(
fun() -> <<16#0,16#01,16#23,16#45>> = <<16#12345/utf32>> end,
"<<16#0,16#01,16#23,16#45>> = <<16#12345/utf32>>.",
<<16#0,16#01,16#23,16#45>>),
- ?line check(
+ check(
fun() -> <<16#12345/little-utf32>> = <<16#45,16#23,16#01,16#00>> end,
"<<16#12345/little-utf32>> = <<16#45,16#23,16#01,16#00>>.",
<<16#45,16#23,16#01,16#00>>),
- ?line check(
+ check(
fun() -> <<16#12345/little-utf32>> end,
"<<16#12345/little-utf32>>.",
<<16#45,16#23,16#01,16#00>>),
%% Mixed.
- ?line check(
+ check(
fun() -> <<16#41,16#12345/utf32,16#0391:16,16#2E:8>> end,
"<<16#41,16#12345/utf32,16#0391:16,16#2E:8>>.",
<<16#41,16#00,16#01,16#23,16#45,16#03,16#91,16#2E>>),
ok.
-otp_8133(doc) ->
- ["OTP-8133. Bit comprehension bug."];
-otp_8133(suite) ->
- [];
+%% OTP-8133. Bit comprehension bug.
otp_8133(Config) when is_list(Config) ->
- ?line check(
+ check(
fun() ->
E = fun(N) ->
if
@@ -947,7 +878,7 @@ otp_8133(Config) when is_list(Config) ->
end
end.",
ok),
- ?line check(
+ check(
fun() ->
E = fun(N) ->
if
@@ -972,44 +903,41 @@ otp_8133(Config) when is_list(Config) ->
ok),
ok.
-funs(doc) ->
- ["Simple cases, just to cover some code."];
-funs(suite) ->
- [];
+%% Simple cases, just to cover some code.
funs(Config) when is_list(Config) ->
do_funs(none, none),
do_funs(lfh(), none),
do_funs(lfh(), efh()),
- ?line error_check("nix:foo().", {access_not_allowed,nix}, lfh(), efh()),
- ?line error_check("bar().", undef, none, none),
+ error_check("nix:foo().", {access_not_allowed,nix}, lfh(), efh()),
+ error_check("bar().", undef, none, none),
- ?line check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
+ check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
F1(F1, 1000) end,
"begin F1 = fun(F,N) -> count_down(F, N) end,"
"F1(F1,1000) end.",
0, ['F1'], lfh(), none),
- ?line check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
+ check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
F1(F1, 1000) end,
"begin F1 = fun(F,N) -> count_down(F, N) end,"
"F1(F1,1000) end.",
0, ['F1'], lfh_value(), none),
- ?line check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
+ check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
F1(F1, 1000) end,
"begin F1 = fun(F,N) -> count_down(F, N) end,"
"F1(F1,1000) end.",
0, ['F1'], lfh_value_extra(), none),
- ?line check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
+ check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
F1(F1, 1000) end,
"begin F1 = fun(F,N) -> count_down(F, N) end,"
"F1(F1,1000) end.",
0, ['F1'], {?MODULE,local_func_value}, none),
%% This is not documented, and only for backward compatibility (good!).
B0 = erl_eval:new_bindings(),
- ?line check(fun() -> is_function(?MODULE:count_down_fun()) end,
+ check(fun() -> is_function(?MODULE:count_down_fun()) end,
"begin is_function(count_down_fun()) end.",
true, [], {?MODULE,local_func,[B0]},none),
@@ -1017,16 +945,16 @@ funs(Config) when is_list(Config) ->
({M,F}, As) -> apply(M, F, As)
end,
EFH = {value, EF},
- ?line error_check("apply(timer, sleep, [1]).", got_it, none, EFH),
- ?line error_check("begin F = fun(T) -> timer:sleep(T) end,F(1) end.",
+ error_check("apply(timer, sleep, [1]).", got_it, none, EFH),
+ error_check("begin F = fun(T) -> timer:sleep(T) end,F(1) end.",
got_it, none, EFH),
- ?line error_check("fun c/1.", undef),
- ?line error_check("fun a:b/0().", undef),
+ error_check("fun c/1.", undef),
+ error_check("fun a:b/0().", undef),
MaxArgs = 20,
- ?line [true] =
+ [true] =
lists:usort([run_many_args(SAs) || SAs <- many_args(MaxArgs)]),
- ?line {'EXIT',{{argument_limit,_},_}} =
+ {'EXIT',{{argument_limit,_},_}} =
(catch run_many_args(many_args1(MaxArgs+1))),
ok.
@@ -1053,17 +981,17 @@ do_funs(LFH, EFH) ->
%% manually with 1000 replaced by 1000000.
M = atom_to_list(?MODULE),
- ?line check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
+ check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
F1(F1, 1000) end,
concat(["begin F1 = fun(F,N) -> ", M,
":count_down(F, N) end, F1(F1,1000) end."]),
0, ['F1'], LFH, EFH),
- ?line check(fun() -> F1 = fun(F,N) -> apply(?MODULE,count_down,[F,N])
+ check(fun() -> F1 = fun(F,N) -> apply(?MODULE,count_down,[F,N])
end, F1(F1, 1000) end,
concat(["begin F1 = fun(F,N) -> apply(", M,
",count_down,[F, N]) end, F1(F1,1000) end."]),
0, ['F1'], LFH, EFH),
- ?line check(fun() -> F = fun(F,N) when N > 0 -> apply(F,[F,N-1]);
+ check(fun() -> F = fun(F,N) when N > 0 -> apply(F,[F,N-1]);
(_F,0) -> ok end,
F(F, 1000)
end,
@@ -1071,7 +999,7 @@ do_funs(LFH, EFH) ->
"(_F,0) -> ok end,"
"F(F, 1000) end.",
ok, ['F'], LFH, EFH),
- ?line check(fun() -> F = fun(F,N) when N > 0 ->
+ check(fun() -> F = fun(F,N) when N > 0 ->
apply(erlang,apply,[F,[F,N-1]]);
(_F,0) -> ok end,
F(F, 1000)
@@ -1081,7 +1009,7 @@ do_funs(LFH, EFH) ->
"(_F,0) -> ok end,"
"F(F, 1000) end.",
ok, ['F'], LFH, EFH),
- ?line check(fun() -> F = count_down_fun(),
+ check(fun() -> F = count_down_fun(),
SF = fun(SF, F1, N) -> F(SF, F1, N) end,
SF(SF, F, 1000) end,
concat(["begin F = ", M, ":count_down_fun(),"
@@ -1090,17 +1018,17 @@ do_funs(LFH, EFH) ->
ok, ['F','SF'], LFH, EFH),
- ?line check(fun() -> F = fun(X) -> A = 1+X, {X,A} end,
+ check(fun() -> F = fun(X) -> A = 1+X, {X,A} end,
true = {2,3} == F(2) end,
"begin F = fun(X) -> A = 1+X, {X,A} end,
true = {2,3} == F(2) end.", true, ['F'], LFH, EFH),
- ?line check(fun() -> F = fun(X) -> byte_size(X) end,
+ check(fun() -> F = fun(X) -> byte_size(X) end,
?MODULE:do_apply(F,<<"hej">>) end,
concat(["begin F = fun(X) -> size(X) end,",
M,":do_apply(F,<<\"hej\">>) end."]),
3, ['F'], LFH, EFH),
- ?line check(fun() -> F1 = fun(X, Z) -> {X,Z} end,
+ check(fun() -> F1 = fun(X, Z) -> {X,Z} end,
Z = 5,
F2 = fun(X, Y) -> F1(Z,{X,Y}) end,
F3 = fun(X, Y) -> {a,F1(Z,{X,Y})} end,
@@ -1117,26 +1045,26 @@ do_funs(LFH, EFH) ->
{5,{5,y}} = F2(Z,y),
true = {5,{x,5}} == F2(x,Z) end.",
true, ['F1','Z','F2','F3'], LFH, EFH),
- ?line check(fun() -> F = fun(X) -> byte_size(X) end,
+ check(fun() -> F = fun(X) -> byte_size(X) end,
F2 = fun(Y) -> F(Y) end,
?MODULE:do_apply(F2,<<"hej">>) end,
concat(["begin F = fun(X) -> size(X) end,",
"F2 = fun(Y) -> F(Y) end,",
M,":do_apply(F2,<<\"hej\">>) end."]),
3, ['F','F2'], LFH, EFH),
- ?line check(fun() -> Z = 5, F = fun(X) -> {Z,X} end,
+ check(fun() -> Z = 5, F = fun(X) -> {Z,X} end,
F2 = fun(Z) -> F(Z) end, F2(3) end,
"begin Z = 5, F = fun(X) -> {Z,X} end,
F2 = fun(Z) -> F(Z) end, F2(3) end.",
{5,3},['F','F2','Z'], LFH, EFH),
- ?line check(fun() -> F = fun(Z) -> Z end,
+ check(fun() -> F = fun(Z) -> Z end,
F2 = fun(X) -> F(X), Z = {X,X}, Z end,
{1,1} = F2(1), Z = 7, Z end,
"begin F = fun(Z) -> Z end,
F2 = fun(X) -> F(X), Z = {X,X}, Z end,
{1,1} = F2(1), Z = 7, Z end.", 7, ['F','F2','Z'],
LFH, EFH),
- ?line check(fun() -> F = fun(F, N) -> [?MODULE:count_down(F,N) || X <-[1]]
+ check(fun() -> F = fun(F, N) -> [?MODULE:count_down(F,N) || X <-[1]]
end, F(F,2) end,
concat(["begin F = fun(F, N) -> [", M,
":count_down(F,N) || X <-[1]] end, F(F,2) end."]),
@@ -1195,45 +1123,42 @@ external_func({M,F}, As) ->
-try_catch(doc) ->
- ["Test try-of-catch-after-end statement"];
-try_catch(suite) ->
- [];
+%% Test try-of-catch-after-end statement.
try_catch(Config) when is_list(Config) ->
%% Match in of with catch
- ?line check(fun() -> try 1 of 1 -> 2 catch _:_ -> 3 end end,
+ check(fun() -> try 1 of 1 -> 2 catch _:_ -> 3 end end,
"try 1 of 1 -> 2 catch _:_ -> 3 end.", 2),
- ?line check(fun() -> try 1 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end end,
+ check(fun() -> try 1 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end end,
"try 1 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end.", 2),
- ?line check(fun() -> try 3 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end end,
+ check(fun() -> try 3 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end end,
"try 3 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end.", 4),
%% Just after
- ?line check(fun () -> X = try 1 after put(try_catch, 2) end,
+ check(fun () -> X = try 1 after put(try_catch, 2) end,
{X,get(try_catch)} end,
"begin X = try 1 after put(try_catch, 2) end, "
"{X,get(try_catch)} end.", {1,2}),
%% Match in of with after
- ?line check(fun() -> X = try 1 of 1 -> 2 after put(try_catch, 3) end,
+ check(fun() -> X = try 1 of 1 -> 2 after put(try_catch, 3) end,
{X,get(try_catch)} end,
"begin X = try 1 of 1 -> 2 after put(try_catch, 3) end, "
"{X,get(try_catch)} end.", {2,3}),
- ?line check(fun() -> X = try 1 of 1 -> 2; 3 -> 4
+ check(fun() -> X = try 1 of 1 -> 2; 3 -> 4
after put(try_catch, 5) end,
{X,get(try_catch)} end,
"begin X = try 1 of 1 -> 2; 3 -> 4 "
" after put(try_catch, 5) end, "
" {X,get(try_catch)} end.", {2,5}),
- ?line check(fun() -> X = try 3 of 1 -> 2; 3 -> 4
+ check(fun() -> X = try 3 of 1 -> 2; 3 -> 4
after put(try_catch, 5) end,
{X,get(try_catch)} end,
"begin X = try 3 of 1 -> 2; 3 -> 4 "
" after put(try_catch, 5) end, "
" {X,get(try_catch)} end.", {4,5}),
%% Nomatch in of
- ?line error_check("try 1 of 2 -> 3 catch _:_ -> 4 end.",
+ error_check("try 1 of 2 -> 3 catch _:_ -> 4 end.",
{try_clause,1}),
%% Nomatch in of with after
- ?line check(fun () -> {'EXIT',{{try_clause,1},_}} =
+ check(fun () -> {'EXIT',{{try_clause,1},_}} =
begin catch try 1 of 2 -> 3
after put(try_catch, 4) end end,
get(try_catch) end,
@@ -1242,14 +1167,14 @@ try_catch(Config) when is_list(Config) ->
" after put(try_catch, 4) end end, "
" get(try_catch) end. ", 4),
%% Exception in try
- ?line check(fun () -> try 1=2 catch error:{badmatch,2} -> 3 end end,
+ check(fun () -> try 1=2 catch error:{badmatch,2} -> 3 end end,
"try 1=2 catch error:{badmatch,2} -> 3 end.", 3),
- ?line check(fun () -> try 1=2 of 3 -> 4
+ check(fun () -> try 1=2 of 3 -> 4
catch error:{badmatch,2} -> 5 end end,
"try 1=2 of 3 -> 4 "
"catch error:{badmatch,2} -> 5 end.", 5),
%% Exception in try with after
- ?line check(fun () -> X = try 1=2
+ check(fun () -> X = try 1=2
catch error:{badmatch,2} -> 3
after put(try_catch, 4) end,
{X,get(try_catch)} end,
@@ -1257,7 +1182,7 @@ try_catch(Config) when is_list(Config) ->
" catch error:{badmatch,2} -> 3 "
" after put(try_catch, 4) end, "
" {X,get(try_catch)} end. ", {3,4}),
- ?line check(fun () -> X = try 1=2 of 3 -> 4
+ check(fun () -> X = try 1=2 of 3 -> 4
catch error:{badmatch,2} -> 5
after put(try_catch, 6) end,
{X,get(try_catch)} end,
@@ -1266,12 +1191,12 @@ try_catch(Config) when is_list(Config) ->
" after put(try_catch, 6) end, "
" {X,get(try_catch)} end. ", {5,6}),
%% Uncaught exception
- ?line error_check("try 1=2 catch error:undefined -> 3 end. ",
+ error_check("try 1=2 catch error:undefined -> 3 end. ",
{badmatch,2}),
- ?line error_check("try 1=2 of 3 -> 4 catch error:undefined -> 5 end. ",
+ error_check("try 1=2 of 3 -> 4 catch error:undefined -> 5 end. ",
{badmatch,2}),
%% Uncaught exception with after
- ?line check(fun () -> {'EXIT',{{badmatch,2},_}} =
+ check(fun () -> {'EXIT',{{badmatch,2},_}} =
begin catch try 1=2
after put(try_catch, 3) end end,
get(try_catch) end,
@@ -1279,7 +1204,7 @@ try_catch(Config) when is_list(Config) ->
" begin catch try 1=2 "
" after put(try_catch, 3) end end, "
" get(try_catch) end. ", 3),
- ?line check(fun () -> {'EXIT',{{badmatch,2},_}} =
+ check(fun () -> {'EXIT',{{badmatch,2},_}} =
begin catch try 1=2 of 3 -> 4
after put(try_catch, 5) end end,
get(try_catch) end,
@@ -1287,7 +1212,7 @@ try_catch(Config) when is_list(Config) ->
" begin catch try 1=2 of 3 -> 4"
" after put(try_catch, 5) end end, "
" get(try_catch) end. ", 5),
- ?line check(fun () -> {'EXIT',{{badmatch,2},_}} =
+ check(fun () -> {'EXIT',{{badmatch,2},_}} =
begin catch try 1=2 catch error:undefined -> 3
after put(try_catch, 4) end end,
get(try_catch) end,
@@ -1295,7 +1220,7 @@ try_catch(Config) when is_list(Config) ->
" begin catch try 1=2 catch error:undefined -> 3 "
" after put(try_catch, 4) end end, "
" get(try_catch) end. ", 4),
- ?line check(fun () -> {'EXIT',{{badmatch,2},_}} =
+ check(fun () -> {'EXIT',{{badmatch,2},_}} =
begin catch try 1=2 of 3 -> 4
catch error:undefined -> 5
after put(try_catch, 6) end end,
@@ -1308,19 +1233,16 @@ try_catch(Config) when is_list(Config) ->
ok.
-eval_expr_5(doc) ->
- ["(OTP-7933)"];
-eval_expr_5(suite) ->
- [];
+%% (OTP-7933).
eval_expr_5(Config) when is_list(Config) ->
- ?line {ok,Tokens ,_} =
+ {ok,Tokens ,_} =
erl_scan:string("if a+4 == 4 -> yes; true -> no end. "),
- ?line {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
- ?line {value, no, []} = erl_eval:expr(Expr, [], none, none, none),
- ?line no = erl_eval:expr(Expr, [], none, none, value),
+ {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
+ {value, no, []} = erl_eval:expr(Expr, [], none, none, none),
+ no = erl_eval:expr(Expr, [], none, none, value),
try
erl_eval:expr(Expr, [], none, none, 4711),
- ?line function_clause = should_never_reach_here
+ function_clause = should_never_reach_here
catch
error:function_clause ->
ok
@@ -1362,7 +1284,7 @@ check1(F, String, Result) ->
{value, Result, _} ->
ok;
Other ->
- test_server:fail({eval, Other, Result})
+ ct:fail({eval, Other, Result})
end.
check(F, String, Result, BoundVars, LFH, EFH) ->
@@ -1375,11 +1297,11 @@ check(F, String, Result, BoundVars, LFH, EFH) ->
true ->
ok;
false ->
- test_server:fail({check, BoundVars, Keys})
+ ct:fail({check, BoundVars, Keys})
end,
ok;
Other ->
- test_server:fail({check, Other, Result})
+ ct:fail({check, Other, Result})
end.
error_check(String, Result) ->
@@ -1387,7 +1309,7 @@ error_check(String, Result) ->
{'EXIT', {Result,_}} ->
ok;
Other ->
- test_server:fail({eval, Other, Result})
+ ct:fail({eval, Other, Result})
end.
error_check(String, Result, LFH, EFH) ->
@@ -1395,7 +1317,7 @@ error_check(String, Result, LFH, EFH) ->
{'EXIT', {Result,_}} ->
ok;
Other ->
- test_server:fail({eval, Other, Result})
+ ct:fail({eval, Other, Result})
end.
eval_string(String) ->
diff --git a/lib/debugger/test/exception_SUITE.erl b/lib/debugger/test/exception_SUITE.erl
index e35326a798..ef824b00be 100644
--- a/lib/debugger/test/exception_SUITE.erl
+++ b/lib/debugger/test/exception_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -30,13 +30,13 @@
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
%% Filler.
%%
%%
-%%
-%%
%% This is line 40.
even(N) when is_integer(N), N > 1, (N rem 2) == 0 ->
odd(N-1)++[N].
@@ -68,17 +68,14 @@ cases() ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
@@ -87,25 +84,25 @@ end_per_suite(Config) when is_list(Config) ->
%% Test that deliberately bad matches are reported correctly.
badmatch(Config) when is_list(Config) ->
- ?line ?try_match(a),
- ?line ?try_match(42),
- ?line ?try_match({a, b, c}),
- ?line ?try_match([]),
- ?line ?try_match(1.0),
+ ?try_match(a),
+ ?try_match(42),
+ ?try_match({a, b, c}),
+ ?try_match([]),
+ ?try_match(1.0),
ok.
%% Test various exceptions, in the presence of a previous error suppressed
%% in a guard.
pending_errors(Config) when is_list(Config) ->
- ?line pending(e_badmatch, {badmatch, b}),
- ?line pending(x, function_clause),
- ?line pending(e_case, {case_clause, xxx}),
- ?line pending(e_if, if_clause),
- ?line pending(e_badarith, badarith),
- ?line pending(e_undef, undef),
- ?line pending(e_timeoutval, timeout_value),
- ?line pending(e_badarg, badarg),
- ?line pending(e_badarg_spawn, badarg),
+ pending(e_badmatch, {badmatch, b}),
+ pending(x, function_clause),
+ pending(e_case, {case_clause, xxx}),
+ pending(e_if, if_clause),
+ pending(e_badarith, badarith),
+ pending(e_undef, undef),
+ pending(e_timeoutval, timeout_value),
+ pending(e_badarg, badarg),
+ pending(e_badarg_spawn, badarg),
ok.
bad_guy(pe_badarith, Other) when Other+1 == 0 -> % badarith (suppressed)
@@ -126,9 +123,9 @@ bad_guy(_, e_undef) ->
non_existing_module:foo(); % undef
bad_guy(_, e_timeoutval) ->
receive
- after arne -> % timeout_value
- ok
- end;
+ after arne -> % timeout_value
+ ok
+ end;
bad_guy(_, e_badarg) ->
node(xxx); % badarg
bad_guy(_, e_badarg_spawn) ->
@@ -150,7 +147,7 @@ pending_catched(First, Second, Expected) ->
{'EXIT', Reason} ->
pending(Reason, bad_guy, [First, Second], Expected);
Other ->
- test_server:fail({not_exit, Other})
+ ct:fail({not_exit, Other})
end.
pending_exit_message(Args, Expected) ->
@@ -162,9 +159,9 @@ pending_exit_message(Args, Expected) ->
{'EXIT', Pid, Reason} ->
pending(Reason, bad_guy, Args, Expected);
Other ->
- test_server:fail({unexpected_message, Other})
+ ct:fail({unexpected_message, Other})
after 10000 ->
- test_server:fail(timeout)
+ ct:fail(timeout)
end,
process_flag(trap_exit, false).
@@ -180,67 +177,67 @@ pending({Code,[{?MODULE,Func,Arity,_}|_]}, Func, Args, Code)
when length(Args) == Arity ->
ok;
pending(Reason, _Function, _Args, _Code) ->
- test_server:fail({bad_exit_reason,Reason}).
+ ct:fail({bad_exit_reason,Reason}).
%% Test that doing arithmetics on [] gives a badarith EXIT and not a crash.
nil_arith(Config) when is_list(Config) ->
- ?line ba_plus_minus_times([], []),
-
- ?line ba_plus_minus_times([], 0),
- ?line ba_plus_minus_times([], 42),
- ?line ba_plus_minus_times([], 38724978123478923784),
- ?line ba_plus_minus_times([], 38.72),
-
- ?line ba_plus_minus_times(0, []),
- ?line ba_plus_minus_times(334, []),
- ?line ba_plus_minus_times(387249797813478923784, []),
- ?line ba_plus_minus_times(344.22, []),
-
- ?line ba_div_rem([], []),
-
- ?line ba_div_rem([], 0),
- ?line ba_div_rem([], 1),
- ?line ba_div_rem([], 42),
- ?line ba_div_rem([], 38724978123478923784),
- ?line ba_div_rem(344.22, []),
-
- ?line ba_div_rem(0, []),
- ?line ba_div_rem(1, []),
- ?line ba_div_rem(334, []),
- ?line ba_div_rem(387249797813478923784, []),
- ?line ba_div_rem(344.22, []),
-
- ?line ba_div_rem(344.22, 0.0),
- ?line ba_div_rem(1, 0.0),
- ?line ba_div_rem(392873498733971, 0.0),
-
- ?line ba_bop([], []),
- ?line ba_bop(0, []),
- ?line ba_bop(42, []),
- ?line ba_bop(-42342742987343, []),
- ?line ba_bop(238.342, []),
- ?line ba_bop([], 0),
- ?line ba_bop([], -243),
- ?line ba_bop([], 243),
- ?line ba_bop([], 2438724982478933),
- ?line ba_bop([], 3987.37),
-
- ?line ba_bnot([]),
- ?line ba_bnot(23.33),
-
- ?line ba_shift([], []),
- ?line ba_shift([], 0),
- ?line ba_shift([], 4),
- ?line ba_shift([], -4),
- ?line ba_shift([], 2343333333333),
- ?line ba_shift([], -333333333),
- ?line ba_shift([], 234.00),
- ?line ba_shift(23, []),
- ?line ba_shift(0, []),
- ?line ba_shift(-3433443433433323, []),
- ?line ba_shift(433443433433323, []),
- ?line ba_shift(343.93, []),
+ ba_plus_minus_times([], []),
+
+ ba_plus_minus_times([], 0),
+ ba_plus_minus_times([], 42),
+ ba_plus_minus_times([], 38724978123478923784),
+ ba_plus_minus_times([], 38.72),
+
+ ba_plus_minus_times(0, []),
+ ba_plus_minus_times(334, []),
+ ba_plus_minus_times(387249797813478923784, []),
+ ba_plus_minus_times(344.22, []),
+
+ ba_div_rem([], []),
+
+ ba_div_rem([], 0),
+ ba_div_rem([], 1),
+ ba_div_rem([], 42),
+ ba_div_rem([], 38724978123478923784),
+ ba_div_rem(344.22, []),
+
+ ba_div_rem(0, []),
+ ba_div_rem(1, []),
+ ba_div_rem(334, []),
+ ba_div_rem(387249797813478923784, []),
+ ba_div_rem(344.22, []),
+
+ ba_div_rem(344.22, 0.0),
+ ba_div_rem(1, 0.0),
+ ba_div_rem(392873498733971, 0.0),
+
+ ba_bop([], []),
+ ba_bop(0, []),
+ ba_bop(42, []),
+ ba_bop(-42342742987343, []),
+ ba_bop(238.342, []),
+ ba_bop([], 0),
+ ba_bop([], -243),
+ ba_bop([], 243),
+ ba_bop([], 2438724982478933),
+ ba_bop([], 3987.37),
+
+ ba_bnot([]),
+ ba_bnot(23.33),
+
+ ba_shift([], []),
+ ba_shift([], 0),
+ ba_shift([], 4),
+ ba_shift([], -4),
+ ba_shift([], 2343333333333),
+ ba_shift([], -333333333),
+ ba_shift([], 234.00),
+ ba_shift(23, []),
+ ba_shift(0, []),
+ ba_shift(-3433443433433323, []),
+ ba_shift(433443433433323, []),
+ ba_shift(343.93, []),
ok.
ba_plus_minus_times(A, B) ->
@@ -279,29 +276,29 @@ ba_bnot(A) ->
stacktrace(Conf) when is_list(Conf) ->
Tag = make_ref(),
- ?line {_,Mref} = spawn_monitor(fun() -> exit({Tag,erlang:get_stacktrace()}) end),
- ?line {Tag,[]} = receive {'DOWN',Mref,_,_,Info} -> Info end,
+ {_,Mref} = spawn_monitor(fun() -> exit({Tag,erlang:get_stacktrace()}) end),
+ {Tag,[]} = receive {'DOWN',Mref,_,_,Info} -> Info end,
V = [make_ref()|self()],
- ?line {value2,{caught1,badarg,[{erlang,abs,[V],_}|_]=St1}} =
+ {value2,{caught1,badarg,[{erlang,abs,[V],_}|_]=St1}} =
stacktrace_1({'abs',V}, error, {value,V}),
- ?line St1 = erase(stacktrace1),
- ?line St1 = erase(stacktrace2),
- ?line St1 = erlang:get_stacktrace(),
- ?line {caught2,{error,badarith},[{?MODULE,my_add,2,_}|_]=St2} =
+ St1 = erase(stacktrace1),
+ St1 = erase(stacktrace2),
+ St1 = erlang:get_stacktrace(),
+ {caught2,{error,badarith},[{?MODULE,my_add,2,_}|_]=St2} =
stacktrace_1({'div',{1,0}}, error, {'add',{0,a}}),
- ?line [{?MODULE,my_div,2,_}|_] = erase(stacktrace1),
- ?line St2 = erase(stacktrace2),
- ?line St2 = erlang:get_stacktrace(),
- ?line {caught2,{error,{try_clause,V}},[{?MODULE,stacktrace_1,3,_}|_]=St3} =
+ [{?MODULE,my_div,2,_}|_] = erase(stacktrace1),
+ St2 = erase(stacktrace2),
+ St2 = erlang:get_stacktrace(),
+ {caught2,{error,{try_clause,V}},[{?MODULE,stacktrace_1,3,_}|_]=St3} =
stacktrace_1({value,V}, error, {value,V}),
- ?line St3 = erase(stacktrace1),
- ?line St3 = erase(stacktrace2),
- ?line St3 = erlang:get_stacktrace(),
- ?line {caught2,{throw,V},[{?MODULE,foo,1,_}|_]=St4} =
+ St3 = erase(stacktrace1),
+ St3 = erase(stacktrace2),
+ St3 = erlang:get_stacktrace(),
+ {caught2,{throw,V},[{?MODULE,foo,1,_}|_]=St4} =
stacktrace_1({value,V}, error, {throw,V}),
- ?line [{?MODULE,stacktrace_1,3,_}|_] = erase(stacktrace1),
- ?line St4 = erase(stacktrace2),
- ?line St4 = erlang:get_stacktrace(),
+ [{?MODULE,stacktrace_1,3,_}|_] = erase(stacktrace1),
+ St4 = erase(stacktrace2),
+ St4 = erlang:get_stacktrace(),
ok.
stacktrace_1(X, C1, Y) ->
@@ -326,19 +323,19 @@ stacktrace_1(X, C1, Y) ->
nested_stacktrace(Conf) when is_list(Conf) ->
V = [{make_ref()}|[self()]],
- ?line value1 =
+ value1 =
nested_stacktrace_1({{value,{V,x1}},void,{V,x1}},
{void,void,void}),
- ?line {caught1,
- [{?MODULE,my_add,2,_}|_],
- value2,
- [{?MODULE,my_add,2,_}|_]} =
+ {caught1,
+ [{?MODULE,my_add,2,_}|_],
+ value2,
+ [{?MODULE,my_add,2,_}|_]} =
nested_stacktrace_1({{'add',{V,x1}},error,badarith},
{{value,{V,x2}},void,{V,x2}}),
- ?line {caught1,
- [{?MODULE,my_add,2,_}|_],
- {caught2,[{erlang,abs,[V],_}|_]},
- [{erlang,abs,[V],_}|_]} =
+ {caught1,
+ [{?MODULE,my_add,2,_}|_],
+ {caught2,[{erlang,abs,[V],_}|_]},
+ [{erlang,abs,[V],_}|_]} =
nested_stacktrace_1({{'add',{V,x1}},error,badarith},
{{'abs',V},error,badarg}),
ok.
@@ -361,42 +358,42 @@ nested_stacktrace_1({X1,C1,V1}, {X2,C2,V2}) ->
raise(Conf) when is_list(Conf) ->
- ?line erase(raise),
- ?line A =
+ erase(raise),
+ A =
try
- ?line try foo({'div',{1,0}})
- catch
- error:badarith ->
- put(raise, A0 = erlang:get_stacktrace()),
- ?line erlang:raise(error, badarith, A0)
- end
+ try foo({'div',{1,0}})
+ catch
+ error:badarith ->
+ put(raise, A0 = erlang:get_stacktrace()),
+ erlang:raise(error, badarith, A0)
+ end
catch
error:badarith ->
- ?line A1 = erlang:get_stacktrace(),
- ?line A1 = get(raise)
+ A1 = erlang:get_stacktrace(),
+ A1 = get(raise)
end,
- ?line A = erlang:get_stacktrace(),
- ?line A = get(raise),
- ?line [{?MODULE,my_div,2,_}|_] = A,
+ A = erlang:get_stacktrace(),
+ A = get(raise),
+ [{?MODULE,my_div,2,_}|_] = A,
%%
N = 8, % Must be even
- ?line N = erlang:system_flag(backtrace_depth, N),
- ?line try even(N)
- catch error:function_clause -> ok
- end,
- ?line B = odd_even(N, []),
- ?line B = erlang:get_stacktrace(),
+ N = erlang:system_flag(backtrace_depth, N),
+ try even(N)
+ catch error:function_clause -> ok
+ end,
+ B = odd_even(N, []),
+ B = erlang:get_stacktrace(),
%%
- ?line C0 = odd_even(N+1, []),
- ?line C = lists:sublist(C0, N),
- ?line try odd(N+1)
- catch error:function_clause -> ok
- end,
- ?line C = erlang:get_stacktrace(),
- ?line try erlang:raise(error, function_clause, C0)
- catch error:function_clause -> ok
- end,
- ?line C = erlang:get_stacktrace(),
+ C0 = odd_even(N+1, []),
+ C = lists:sublist(C0, N),
+ try odd(N+1)
+ catch error:function_clause -> ok
+ end,
+ C = erlang:get_stacktrace(),
+ try erlang:raise(error, function_clause, C0)
+ catch error:function_clause -> ok
+ end,
+ C = erlang:get_stacktrace(),
ok.
odd_even(N, R) when is_integer(N), N > 1 ->
@@ -438,8 +435,8 @@ my_add(A, B) ->
my_abs(X) -> abs(X).
gunilla(Config) when is_list(Config) ->
- ?line {throw,kalle} = gunilla_1(),
- ?line [] = erlang:get_stacktrace(),
+ {throw,kalle} = gunilla_1(),
+ [] = erlang:get_stacktrace(),
ok.
gunilla_1() ->
@@ -466,9 +463,9 @@ per(Config) when is_list(Config) ->
end.
t1(_,X,_) ->
- (1 bsl X) + 1.
+ (1 bsl X) + 1.
t2(_,X,_) ->
- (X bsl 1) + 1.
+ (X bsl 1) + 1.
id(I) -> I.
diff --git a/lib/debugger/test/fun_SUITE.erl b/lib/debugger/test/fun_SUITE.erl
index b8092ab16c..7eb53e4ce4 100644
--- a/lib/debugger/test/fun_SUITE.erl
+++ b/lib/debugger/test/fun_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -32,7 +32,9 @@
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
cases().
@@ -53,43 +55,38 @@ cases() ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
ok.
good_call(Config) when is_list(Config) ->
- ?line F = fun() -> ok end,
- ?line ok = F(),
- ?line FF = fun ?MODULE:nothing/0,
- ?line ok = FF(),
+ F = fun() -> ok end,
+ ok = F(),
+ FF = fun ?MODULE:nothing/0,
+ ok = FF(),
ok.
-bad_apply(doc) ->
- "Test that the correct EXIT code is returned for all types of bad funs.";
-bad_apply(suite) -> [];
+%% Test that the correct EXIT code is returned for all types of bad funs.
bad_apply(Config) when is_list(Config) ->
- ?line bad_apply_fc(42, [0]),
- ?line bad_apply_fc(xx, [1]),
- ?line bad_apply_fc({}, [2]),
- ?line bad_apply_fc({1}, [3]),
- ?line bad_apply_fc({1,2,3}, [4]),
- ?line bad_apply_fc({1,2,3}, [5]),
- ?line bad_apply_fc({1,2,3,4}, [6]),
- ?line bad_apply_fc({1,2,3,4,5,6}, [7]),
- ?line bad_apply_fc({1,2,3,4,5}, [8]),
- ?line bad_apply_badarg({1,2}, [9]),
+ bad_apply_fc(42, [0]),
+ bad_apply_fc(xx, [1]),
+ bad_apply_fc({}, [2]),
+ bad_apply_fc({1}, [3]),
+ bad_apply_fc({1,2,3}, [4]),
+ bad_apply_fc({1,2,3}, [5]),
+ bad_apply_fc({1,2,3,4}, [6]),
+ bad_apply_fc({1,2,3,4,5,6}, [7]),
+ bad_apply_fc({1,2,3,4,5}, [8]),
+ bad_apply_badarg({1,2}, [9]),
ok.
bad_apply_fc(Fun, Args) ->
@@ -101,7 +98,7 @@ bad_apply_fc(Fun, Args) ->
ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res]);
Other ->
ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res]),
- ?t:fail({bad_result,Other})
+ ct:fail({bad_result,Other})
end.
bad_apply_badarg(Fun, Args) ->
@@ -113,23 +110,21 @@ bad_apply_badarg(Fun, Args) ->
ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res]);
Other ->
ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res]),
- ?t:fail({bad_result, Other})
+ ct:fail({bad_result, Other})
end.
-bad_fun_call(doc) ->
- "Try directly calling bad funs.";
-bad_fun_call(suite) -> [];
+%% Try directly calling bad funs.
bad_fun_call(Config) when is_list(Config) ->
- ?line bad_call_fc(42),
- ?line bad_call_fc(xx),
- ?line bad_call_fc({}),
- ?line bad_call_fc({1}),
- ?line bad_call_fc({1,2,3}),
- ?line bad_call_fc({1,2,3}),
- ?line bad_call_fc({1,2,3,4}),
- ?line bad_call_fc({1,2,3,4,5,6}),
- ?line bad_call_fc({1,2,3,4,5}),
- ?line bad_call_fc({1,2}),
+ bad_call_fc(42),
+ bad_call_fc(xx),
+ bad_call_fc({}),
+ bad_call_fc({1}),
+ bad_call_fc({1,2,3}),
+ bad_call_fc({1,2,3}),
+ bad_call_fc({1,2,3,4}),
+ bad_call_fc({1,2,3,4,5,6}),
+ bad_call_fc({1,2,3,4,5}),
+ bad_call_fc({1,2}),
ok.
bad_call_fc(Fun) ->
@@ -140,104 +135,101 @@ bad_call_fc(Fun) ->
ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]);
Other ->
ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]),
- ?t:fail({bad_result,Other})
+ ct:fail({bad_result,Other})
end.
%% Call and apply valid external funs with wrong number of arguments.
badarity(Config) when is_list(Config) ->
- ?line Fun = fun() -> ok end,
- ?line Stupid = {stupid,arguments},
- ?line Args = [some,{stupid,arguments},here],
+ Fun = fun() -> ok end,
+ Stupid = {stupid,arguments},
+ Args = [some,{stupid,arguments},here],
%% Simple call.
- ?line Res = (catch Fun(some, Stupid, here)),
+ Res = (catch Fun(some, Stupid, here)),
erlang:garbage_collect(),
erlang:yield(),
case Res of
{'EXIT',{{badarity,{Fun,Args}},[_|_]}} ->
- ?line ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]);
+ ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]);
_ ->
- ?line ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]),
- ?line ?t:fail({bad_result,Res})
+ ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]),
+ ct:fail({bad_result,Res})
end,
%% Apply.
- ?line Res2 = (catch apply(Fun, Args)),
+ Res2 = (catch apply(Fun, Args)),
erlang:garbage_collect(),
erlang:yield(),
case Res2 of
{'EXIT',{{badarity,{Fun,Args}},[_|_]}} ->
- ?line ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res2]);
+ ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res2]);
_ ->
- ?line ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res2]),
- ?line ?t:fail({bad_result,Res2})
+ ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res2]),
+ ct:fail({bad_result,Res2})
end,
ok.
%% Call and apply valid external funs with wrong number of arguments.
ext_badarity(Config) when is_list(Config) ->
- ?line Fun = fun ?MODULE:nothing/0,
- ?line Stupid = {stupid,arguments},
- ?line Args = [some,{stupid,arguments},here],
+ Fun = fun ?MODULE:nothing/0,
+ Stupid = {stupid,arguments},
+ Args = [some,{stupid,arguments},here],
%% Simple call.
- ?line Res = (catch Fun(some, Stupid, here)),
+ Res = (catch Fun(some, Stupid, here)),
erlang:garbage_collect(),
erlang:yield(),
case Res of
{'EXIT',{{badarity,{Fun,Args}},_}} ->
- ?line ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]);
+ ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]);
_ ->
- ?line ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]),
- ?line ?t:fail({bad_result,Res})
+ ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]),
+ ct:fail({bad_result,Res})
end,
%% Apply.
- ?line Res2 = (catch apply(Fun, Args)),
+ Res2 = (catch apply(Fun, Args)),
erlang:garbage_collect(),
erlang:yield(),
case Res2 of
{'EXIT',{{badarity,{Fun,Args}},_}} ->
- ?line ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res2]);
+ ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res2]);
_ ->
- ?line ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res2]),
- ?line ?t:fail({bad_result,Res2})
+ ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res2]),
+ ct:fail({bad_result,Res2})
end,
ok.
nothing() ->
ok.
-otp_6061(suite) ->
- [];
-otp_6061(doc) ->
- ["Test handling of fun expression referring to uninterpreted code"];
+%% Test handling of fun expression referring to uninterpreted code.
otp_6061(Config) when is_list(Config) ->
- ?line OrigFlag = process_flag(trap_exit, true),
+ OrigFlag = process_flag(trap_exit, true),
- ?line Self = self(),
- ?line Pid = spawn_link(fun() -> test_otp_6061(Self) end),
+ Self = self(),
+ Pid = spawn_link(fun() -> test_otp_6061(Self) end),
receive
working ->
- ?line ok;
+ ok;
not_working ->
- ?line ?t:fail(not_working);
+ ct:fail(not_working);
{'EXIT', Pid, Reason} ->
- ?line ?t:fail({crash, Reason})
+ ct:fail({crash, Reason})
after
5000 ->
- ?line ?t:fail(timeout)
+ ct:fail(timeout)
end,
- ?line process_flag(trap_exit, OrigFlag),
+ process_flag(trap_exit, OrigFlag),
ok.
diff --git a/lib/debugger/test/guard_SUITE.erl b/lib/debugger/test/guard_SUITE.erl
index 2b87ef23ba..f7874f79df 100644
--- a/lib/debugger/test/guard_SUITE.erl
+++ b/lib/debugger/test/guard_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -44,7 +44,9 @@
-export([init/4]).
-import(lists, [member/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
cases().
@@ -72,29 +74,25 @@ cases() ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- ?line Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
ok.
-bad_arith(doc) -> "Test that a bad arithmetic operation in a guard works correctly.";
-bad_arith(suite) -> [];
+%% Test that a bad arithmetic operation in a guard works correctly.
bad_arith(Config) when list(Config) ->
- ?line 5 = bad_arith1(2, 3),
- ?line 10 = bad_arith1(1, infinity),
- ?line 10 = bad_arith1(infinity, 1),
- ?line 42 = bad_div(24, 0),
+ 5 = bad_arith1(2, 3),
+ 10 = bad_arith1(1, infinity),
+ 10 = bad_arith1(infinity, 1),
+ 42 = bad_div(24, 0),
ok.
bad_arith1(T1, T2) when T1+T2 < 10 ->
@@ -109,37 +107,35 @@ bad_div(A, B) when A div B > 0 ->
bad_div(_A, _B) ->
42.
-bad_tuple(doc) -> "Test that bad arguments to element/2 are handled correctly.";
-bad_tuple(suite) -> [];
+%% Test that bad arguments to element/2 are handled correctly.
bad_tuple(Config) when list(Config) ->
- ?line error = bad_tuple1(a),
- ?line error = bad_tuple1({a, b}),
- ?line x = bad_tuple1({x, b}),
- ?line y = bad_tuple1({a, b, y}),
+ error = bad_tuple1(a),
+ error = bad_tuple1({a, b}),
+ x = bad_tuple1({x, b}),
+ y = bad_tuple1({a, b, y}),
ok.
bad_tuple1(T) when element(1, T) == x -> x;
bad_tuple1(T) when element(3, T) == y -> y;
bad_tuple1(_) -> error.
-test_heap_guards(doc) -> "";
-test_heap_guards(suite) -> [];
+%% .
test_heap_guards(Config) when list(Config) ->
- ?line process_flag(trap_exit, true),
- ?line Tuple = {a, tuple, is, built, here, xxx},
- ?line List = [a, list, is, built, here],
+ process_flag(trap_exit, true),
+ Tuple = {a, tuple, is, built, here, xxx},
+ List = [a, list, is, built, here],
- ?line try_fun(fun a_case/1, [Tuple], [Tuple]),
- ?line try_fun(fun a_case/1, [List], [List, List]),
- ?line try_fun(fun a_case/1, [a], [a]),
+ try_fun(fun a_case/1, [Tuple], [Tuple]),
+ try_fun(fun a_case/1, [List], [List, List]),
+ try_fun(fun a_case/1, [a], [a]),
- ?line try_fun(fun an_if/1, [Tuple], [Tuple]),
- ?line try_fun(fun an_if/1, [List], [List, List]),
- ?line try_fun(fun an_if/1, [a], [a]),
+ try_fun(fun an_if/1, [Tuple], [Tuple]),
+ try_fun(fun an_if/1, [List], [List, List]),
+ try_fun(fun an_if/1, [a], [a]),
- ?line try_fun(fun receive_test/1, [Tuple], [Tuple]),
- ?line try_fun(fun receive_test/1, [List], [List, List]),
- ?line try_fun(fun receive_test/1, [a], [a]),
+ try_fun(fun receive_test/1, [Tuple], [Tuple]),
+ try_fun(fun receive_test/1, [List], [List, List]),
+ try_fun(fun receive_test/1, [a], [a]),
ok.
a_case(V) ->
@@ -185,12 +181,12 @@ try_fun(Iter, Fun, Args, Result, Filler) ->
Pid = spawn_link(?MODULE, init, [self(),Fun,Args,list_to_tuple(Filler)]),
receive
{'EXIT',Pid,{result,Result}} ->
- ?line try_fun(Iter-1, Fun, Args, Result, [0|Filler]);
+ try_fun(Iter-1, Fun, Args, Result, [0|Filler]);
{'EXIT',Pid,{result,Other}} ->
- ?line io:format("Expected ~p; got ~p~n", [Result,Other]),
- ?line test_server:fail();
+ io:format("Expected ~p; got ~p~n", [Result,Other]),
+ ct:fail(failed);
Other ->
- ?line test_server:fail({unexpected_message,Other})
+ ct:fail({unexpected_message,Other})
end.
init(_ReplyTo, Fun, Args, Filler) ->
@@ -202,87 +198,86 @@ init(_ReplyTo, Fun, Args, Filler) ->
dummy(_) ->
ok.
-guard_bifs(doc) -> "Test all guard bifs with nasty (but legal arguments).";
-guard_bifs(suite) -> [];
+%% Test all guard bifs with nasty (but legal arguments).
guard_bifs(Config) when list(Config) ->
- ?line Big = -237849247829874297658726487367328971246284736473821617265433,
- ?line Float = 387924.874,
+ Big = -237849247829874297658726487367328971246284736473821617265433,
+ Float = 387924.874,
%% Succeding use of guard bifs.
- ?line try_gbif('abs/1', Big, -Big),
- ?line try_gbif('float/1', Big, float(Big)),
- ?line try_gbif('trunc/1', Float, 387924.0),
- ?line try_gbif('round/1', Float, 387925.0),
- ?line try_gbif('length/1', [], 0),
+ try_gbif('abs/1', Big, -Big),
+ try_gbif('float/1', Big, float(Big)),
+ try_gbif('trunc/1', Float, 387924.0),
+ try_gbif('round/1', Float, 387925.0),
+ try_gbif('length/1', [], 0),
- ?line try_gbif('length/1', [a], 1),
- ?line try_gbif('length/1', [a, b], 2),
- ?line try_gbif('length/1', lists:seq(0, 31), 32),
+ try_gbif('length/1', [a], 1),
+ try_gbif('length/1', [a, b], 2),
+ try_gbif('length/1', lists:seq(0, 31), 32),
- ?line try_gbif('hd/1', [a], a),
- ?line try_gbif('hd/1', [a, b], a),
+ try_gbif('hd/1', [a], a),
+ try_gbif('hd/1', [a, b], a),
- ?line try_gbif('tl/1', [a], []),
- ?line try_gbif('tl/1', [a, b], [b]),
- ?line try_gbif('tl/1', [a, b, c], [b, c]),
+ try_gbif('tl/1', [a], []),
+ try_gbif('tl/1', [a, b], [b]),
+ try_gbif('tl/1', [a, b, c], [b, c]),
- ?line try_gbif('size/1', {}, 0),
- ?line try_gbif('size/1', {a}, 1),
- ?line try_gbif('size/1', {a, b}, 2),
- ?line try_gbif('size/1', {a, b, c}, 3),
- ?line try_gbif('size/1', list_to_binary([]), 0),
- ?line try_gbif('size/1', list_to_binary([1]), 1),
- ?line try_gbif('size/1', list_to_binary([1, 2]), 2),
- ?line try_gbif('size/1', list_to_binary([1, 2, 3]), 3),
+ try_gbif('size/1', {}, 0),
+ try_gbif('size/1', {a}, 1),
+ try_gbif('size/1', {a, b}, 2),
+ try_gbif('size/1', {a, b, c}, 3),
+ try_gbif('size/1', list_to_binary([]), 0),
+ try_gbif('size/1', list_to_binary([1]), 1),
+ try_gbif('size/1', list_to_binary([1, 2]), 2),
+ try_gbif('size/1', list_to_binary([1, 2, 3]), 3),
- ?line try_gbif('element/2', {x}, {1, x}),
- ?line try_gbif('element/2', {x, y}, {1, x}),
- ?line try_gbif('element/2', {x, y}, {2, y}),
+ try_gbif('element/2', {x}, {1, x}),
+ try_gbif('element/2', {x, y}, {1, x}),
+ try_gbif('element/2', {x, y}, {2, y}),
- ?line try_gbif('self/0', 0, self()),
- ?line try_gbif('node/0', 0, node()),
- ?line try_gbif('node/1', self(), node()),
+ try_gbif('self/0', 0, self()),
+ try_gbif('node/0', 0, node()),
+ try_gbif('node/1', self(), node()),
%% Failing use of guard bifs.
- ?line try_fail_gbif('abs/1', Big, 1),
- ?line try_fail_gbif('abs/1', [], 1),
+ try_fail_gbif('abs/1', Big, 1),
+ try_fail_gbif('abs/1', [], 1),
- ?line try_fail_gbif('float/1', Big, 42),
- ?line try_fail_gbif('float/1', [], 42),
+ try_fail_gbif('float/1', Big, 42),
+ try_fail_gbif('float/1', [], 42),
- ?line try_fail_gbif('trunc/1', Float, 0.0),
- ?line try_fail_gbif('trunc/1', [], 0.0),
+ try_fail_gbif('trunc/1', Float, 0.0),
+ try_fail_gbif('trunc/1', [], 0.0),
- ?line try_fail_gbif('round/1', Float, 1.0),
- ?line try_fail_gbif('round/1', [], a),
+ try_fail_gbif('round/1', Float, 1.0),
+ try_fail_gbif('round/1', [], a),
- ?line try_fail_gbif('length/1', [], 1),
- ?line try_fail_gbif('length/1', [a], 0),
- ?line try_fail_gbif('length/1', a, 0),
- ?line try_fail_gbif('length/1', {a}, 0),
+ try_fail_gbif('length/1', [], 1),
+ try_fail_gbif('length/1', [a], 0),
+ try_fail_gbif('length/1', a, 0),
+ try_fail_gbif('length/1', {a}, 0),
- ?line try_fail_gbif('hd/1', [], 0),
- ?line try_fail_gbif('hd/1', [a], x),
- ?line try_fail_gbif('hd/1', x, x),
+ try_fail_gbif('hd/1', [], 0),
+ try_fail_gbif('hd/1', [a], x),
+ try_fail_gbif('hd/1', x, x),
- ?line try_fail_gbif('tl/1', [], 0),
- ?line try_fail_gbif('tl/1', [a], x),
- ?line try_fail_gbif('tl/1', x, x),
+ try_fail_gbif('tl/1', [], 0),
+ try_fail_gbif('tl/1', [a], x),
+ try_fail_gbif('tl/1', x, x),
- ?line try_fail_gbif('size/1', {}, 1),
- ?line try_fail_gbif('size/1', [], 0),
- ?line try_fail_gbif('size/1', [a], 1),
+ try_fail_gbif('size/1', {}, 1),
+ try_fail_gbif('size/1', [], 0),
+ try_fail_gbif('size/1', [a], 1),
- ?line try_fail_gbif('element/2', {}, {1, x}),
- ?line try_fail_gbif('element/2', {x}, {1, y}),
- ?line try_fail_gbif('element/2', [], {1, z}),
+ try_fail_gbif('element/2', {}, {1, x}),
+ try_fail_gbif('element/2', {x}, {1, y}),
+ try_fail_gbif('element/2', [], {1, z}),
- ?line try_fail_gbif('self/0', 0, list_to_pid("<0.0.0>")),
- ?line try_fail_gbif('node/0', 0, xxxx),
- ?line try_fail_gbif('node/1', self(), xxx),
- ?line try_fail_gbif('node/1', yyy, xxx),
+ try_fail_gbif('self/0', 0, list_to_pid("<0.0.0>")),
+ try_fail_gbif('node/0', 0, xxxx),
+ try_fail_gbif('node/1', self(), xxx),
+ try_fail_gbif('node/1', yyy, xxx),
ok.
try_gbif(Id, X, Y) ->
@@ -290,9 +285,9 @@ try_gbif(Id, X, Y) ->
{Id, X, Y} ->
io:format("guard_bif(~p, ~p, ~p) -- ok", [Id, X, Y]);
Other ->
- ?line ok = io:format("guard_bif(~p, ~p, ~p) -- bad result: ~p\n",
- [Id, X, Y, Other]),
- ?line test_server:fail()
+ ok = io:format("guard_bif(~p, ~p, ~p) -- bad result: ~p\n",
+ [Id, X, Y, Other]),
+ ct:fail(failed)
end.
try_fail_gbif(Id, X, Y) ->
@@ -300,9 +295,9 @@ try_fail_gbif(Id, X, Y) ->
{'EXIT', {function_clause,[{?MODULE,guard_bif,[Id,X,Y],_}|_]}} ->
io:format("guard_bif(~p, ~p, ~p) -- ok", [Id,X,Y]);
Other ->
- ?line ok = io:format("guard_bif(~p, ~p, ~p) -- bad result: ~p\n",
- [Id, X, Y, Other]),
- ?line test_server:fail()
+ ok = io:format("guard_bif(~p, ~p, ~p) -- bad result: ~p\n",
+ [Id, X, Y, Other]),
+ ct:fail(failed)
end.
guard_bif('abs/1', X, Y) when abs(X) == Y ->
@@ -330,24 +325,23 @@ guard_bif('node/0', X, Y) when node() == Y ->
guard_bif('node/1', X, Y) when node(X) == Y ->
{'node/1', X, Y}.
-type_tests(doc) -> "Test the type tests.";
-type_tests(suite) -> [];
+%% Test the type tests.
type_tests(Config) when list(Config) ->
- ?line Types = all_types(),
- ?line Tests = type_test_desc(),
- ?line put(errors, 0),
- ?line put(violations, 0),
- ?line type_tests(Tests, Types),
- ?line case {get(errors), get(violations)} of
- {0, 0} ->
- ok;
- {0, N} ->
- {comment, integer_to_list(N) ++ " standard violation(s)"};
- {Errors, Violations} ->
- io:format("~p sub test(s) failed, ~p violation(s)",
- [Errors, Violations]),
- ?line test_server:fail()
- end.
+ Types = all_types(),
+ Tests = type_test_desc(),
+ put(errors, 0),
+ put(violations, 0),
+ type_tests(Tests, Types),
+ case {get(errors), get(violations)} of
+ {0, 0} ->
+ ok;
+ {0, N} ->
+ {comment, integer_to_list(N) ++ " standard violation(s)"};
+ {Errors, Violations} ->
+ io:format("~p sub test(s) failed, ~p violation(s)",
+ [Errors, Violations]),
+ ct:fail(failed)
+ end.
type_tests([{Test, AllowedTypes}| T], AllTypes) ->
type_tests(Test, AllTypes, AllowedTypes),
@@ -372,7 +366,7 @@ type_tests(Test, [Type|T], Allowed) ->
[{?MODULE,type_test,[Test,Value],_}|_]}} ->
ok;
{'EXIT',Other} ->
- ?line test_server:fail({unexpected_error_reason,Other});
+ ct:fail({unexpected_error_reason,Other});
tuple when function(Value) ->
io:format("Standard violation: Test ~p(~p) should fail",
[Test, Value]),
@@ -442,18 +436,18 @@ type_test(function, X) when function(X) ->
function.
const_guard(Config) when is_list(Config) ->
- ?line if
- (0 == 0) and ((0 == 0) or (0 == 0)) ->
- ok
- end.
+ if
+ (0 == 0) and ((0 == 0) or (0 == 0)) ->
+ ok
+ end.
const_cond(Config) when is_list(Config) ->
- ?line ok = const_cond({}, 0),
- ?line ok = const_cond({a}, 1),
- ?line error = const_cond({a,b}, 3),
- ?line error = const_cond({a}, 0),
- ?line error = const_cond({a,b}, 1),
+ ok = const_cond({}, 0),
+ ok = const_cond({a}, 1),
+ error = const_cond({a,b}, 3),
+ error = const_cond({a}, 0),
+ error = const_cond({a,b}, 1),
ok.
const_cond(T, Sz) ->
@@ -474,59 +468,59 @@ basic_not(Config) when is_list(Config) ->
D = id(5),
ATuple = {False,True,Glurf},
- ?line check(fun() -> if not false -> ok; true -> error end end, ok),
- ?line check(fun() -> if not true -> ok; true -> error end end, error),
- ?line check(fun() -> if not False -> ok; true -> error end end, ok),
- ?line check(fun() -> if not True -> ok; true -> error end end, error),
+ check(fun() -> if not false -> ok; true -> error end end, ok),
+ check(fun() -> if not true -> ok; true -> error end end, error),
+ check(fun() -> if not False -> ok; true -> error end end, ok),
+ check(fun() -> if not True -> ok; true -> error end end, error),
- ?line check(fun() -> if A > B -> gt; A < B -> lt; A == B -> eq end end, lt),
- ?line check(fun() -> if A > C -> gt; A < C -> lt; A == C -> eq end end, gt),
- ?line check(fun() -> if A > D -> gt; A < D -> lt; A == D -> eq end end, eq),
+ check(fun() -> if A > B -> gt; A < B -> lt; A == B -> eq end end, lt),
+ check(fun() -> if A > C -> gt; A < C -> lt; A == C -> eq end end, gt),
+ check(fun() -> if A > D -> gt; A < D -> lt; A == D -> eq end end, eq),
- ?line check(fun() -> if not (7 > 453) -> le; not (7 < 453) -> ge;
- not (7 == 453) -> ne; true -> eq end end, le),
- ?line check(fun() -> if not (7 > -8) -> le; not (7 < -8) -> ge;
- not (7 == -8) -> ne; true -> eq end end, ge),
- ?line check(fun() -> if not (7 > 7) -> le; not (7 < 7) -> ge;
- not (7 == 7) -> ne; true -> eq end end, le),
+ check(fun() -> if not (7 > 453) -> le; not (7 < 453) -> ge;
+ not (7 == 453) -> ne; true -> eq end end, le),
+ check(fun() -> if not (7 > -8) -> le; not (7 < -8) -> ge;
+ not (7 == -8) -> ne; true -> eq end end, ge),
+ check(fun() -> if not (7 > 7) -> le; not (7 < 7) -> ge;
+ not (7 == 7) -> ne; true -> eq end end, le),
- ?line check(fun() -> if not (A > B) -> le; not (A < B) -> ge;
- not (A == B) -> ne; true -> eq end end, le),
- ?line check(fun() -> if not (A > C) -> le; not (A < C) -> ge;
- not (A == C) -> ne; true -> eq end end, ge),
- ?line check(fun() -> if not (A > D) -> le; not (A < D) -> ge;
- not (A == D) -> ne; true -> eq end end, le),
+ check(fun() -> if not (A > B) -> le; not (A < B) -> ge;
+ not (A == B) -> ne; true -> eq end end, le),
+ check(fun() -> if not (A > C) -> le; not (A < C) -> ge;
+ not (A == C) -> ne; true -> eq end end, ge),
+ check(fun() -> if not (A > D) -> le; not (A < D) -> ge;
+ not (A == D) -> ne; true -> eq end end, le),
- ?line check(fun() -> if not element(1, ATuple) -> ok; true -> error end end, ok),
- ?line check(fun() -> if not element(2, ATuple) -> ok; true -> error end end, error),
- ?line check(fun() -> if not element(3, ATuple) -> ok; true -> error end end, error),
+ check(fun() -> if not element(1, ATuple) -> ok; true -> error end end, ok),
+ check(fun() -> if not element(2, ATuple) -> ok; true -> error end end, error),
+ check(fun() -> if not element(3, ATuple) -> ok; true -> error end end, error),
- ?line check(fun() -> if not glurf -> ok; true -> error end end, error),
- ?line check(fun() -> if not Glurf -> ok; true -> error end end, error),
+ check(fun() -> if not glurf -> ok; true -> error end end, error),
+ check(fun() -> if not Glurf -> ok; true -> error end end, error),
ok.
complex_not(Config) when is_list(Config) ->
ATuple = id({false,true,gurka}),
- ?line check(fun() -> if not(element(1, ATuple)) -> ok; true -> error end end, ok),
- ?line check(fun() -> if not(element(2, ATuple)) -> ok; true -> error end end, error),
+ check(fun() -> if not(element(1, ATuple)) -> ok; true -> error end end, ok),
+ check(fun() -> if not(element(2, ATuple)) -> ok; true -> error end end, error),
- ?line check(fun() -> if not(element(3, ATuple) == gurka) -> ok;
- true -> error end end, error),
- ?line check(fun() -> if not(element(3, ATuple) =/= gurka) -> ok;
- true -> error end end, ok),
+ check(fun() -> if not(element(3, ATuple) == gurka) -> ok;
+ true -> error end end, error),
+ check(fun() -> if not(element(3, ATuple) =/= gurka) -> ok;
+ true -> error end end, ok),
- ?line check(fun() -> if {a,not(element(2, ATuple))} == {a,false} -> ok;
- true -> error end end, ok),
- ?line check(fun() -> if {a,not(element(1, ATuple))} == {a,false} -> ok;
- true -> error end end, error),
+ check(fun() -> if {a,not(element(2, ATuple))} == {a,false} -> ok;
+ true -> error end end, ok),
+ check(fun() -> if {a,not(element(1, ATuple))} == {a,false} -> ok;
+ true -> error end end, error),
- ?line check(fun() -> if not(element(1, ATuple) or element(3, ATuple)) -> ok;
- true -> error end end, error),
+ check(fun() -> if not(element(1, ATuple) or element(3, ATuple)) -> ok;
+ true -> error end end, error),
%% orelse
- ?line check(fun() -> if not(element(1, ATuple) orelse element(3, ATuple)) -> ok;
- true -> error end end, error),
+ check(fun() -> if not(element(1, ATuple) orelse element(3, ATuple)) -> ok;
+ true -> error end end, error),
ok.
@@ -534,100 +528,100 @@ semicolon(Config) when is_list(Config) ->
%% True/false combined using ';' (literal atoms).
- ?line check(fun() -> if true; false -> ok end end, ok),
- ?line check(fun() -> if false; true -> ok end end, ok),
- ?line check(fun() -> if true; true -> ok end end, ok),
- ?line check(fun() -> if false; false -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if false; false -> ok end),
- exit
- end, exit),
+ check(fun() -> if true; false -> ok end end, ok),
+ check(fun() -> if false; true -> ok end end, ok),
+ check(fun() -> if true; true -> ok end end, ok),
+ check(fun() -> if false; false -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if false; false -> ok end),
+ exit
+ end, exit),
%% True/false combined used ';'.
True = id(true),
False = id(false),
- ?line check(fun() -> if True; False -> ok end end, ok),
- ?line check(fun() -> if False; True -> ok end end, ok),
- ?line check(fun() -> if True; True -> ok end end, ok),
- ?line check(fun() -> if False; False -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if False; False -> ok end),
- exit
- end, exit),
+ check(fun() -> if True; False -> ok end end, ok),
+ check(fun() -> if False; True -> ok end end, ok),
+ check(fun() -> if True; True -> ok end end, ok),
+ check(fun() -> if False; False -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if False; False -> ok end),
+ exit
+ end, exit),
%% Combine true/false with a non-boolean value.
Glurf = id(glurf),
- ?line check(fun() -> if True; Glurf -> ok end end, ok),
- ?line check(fun() -> if Glurf; True -> ok end end, ok),
- ?line check(fun() -> if Glurf; Glurf -> ok; true -> error end end, error),
- ?line check(fun() -> if False; Glurf -> ok; true -> error end end, error),
- ?line check(fun() -> if Glurf; False -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if Glurf; Glurf -> ok end),
- exit
- end, exit),
+ check(fun() -> if True; Glurf -> ok end end, ok),
+ check(fun() -> if Glurf; True -> ok end end, ok),
+ check(fun() -> if Glurf; Glurf -> ok; true -> error end end, error),
+ check(fun() -> if False; Glurf -> ok; true -> error end end, error),
+ check(fun() -> if Glurf; False -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if Glurf; Glurf -> ok end),
+ exit
+ end, exit),
%% Combine true/false with errors.
ATuple = id({false,true,gurka}),
- ?line check(fun() -> if True; element(42, ATuple) -> ok end end, ok),
- ?line check(fun() -> if element(42, ATuple); True -> ok end end, ok),
- ?line check(fun() -> if element(42, ATuple); element(42, ATuple) -> ok;
- true -> error end end, error),
- ?line check(fun() -> if False; element(42, ATuple) -> ok;
- true -> error end end, error),
- ?line check(fun() -> if element(42, ATuple);
- False -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if element(42, ATuple);
- element(42, ATuple) -> ok end),
- exit
- end, exit),
+ check(fun() -> if True; element(42, ATuple) -> ok end end, ok),
+ check(fun() -> if element(42, ATuple); True -> ok end end, ok),
+ check(fun() -> if element(42, ATuple); element(42, ATuple) -> ok;
+ true -> error end end, error),
+ check(fun() -> if False; element(42, ATuple) -> ok;
+ true -> error end end, error),
+ check(fun() -> if element(42, ATuple);
+ False -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if element(42, ATuple);
+ element(42, ATuple) -> ok end),
+ exit
+ end, exit),
ok.
complex_semicolon(Config) when is_list(Config) ->
- ?line ok = csemi1(int, {blurf}),
- ?line ok = csemi1(string, {blurf}),
- ?line ok = csemi1(float, [a]),
- ?line error = csemi1(35, 42),
+ ok = csemi1(int, {blurf}),
+ ok = csemi1(string, {blurf}),
+ ok = csemi1(float, [a]),
+ error = csemi1(35, 42),
%% 2
- ?line ok = csemi2({}, {a,b,c}),
- ?line ok = csemi2({1,3.5}, {a,b,c}),
- ?line ok = csemi2(dum, {a,b,c}),
+ ok = csemi2({}, {a,b,c}),
+ ok = csemi2({1,3.5}, {a,b,c}),
+ ok = csemi2(dum, {a,b,c}),
- ?line ok = csemi2({45,-19.3}, {}),
- ?line ok = csemi2({45,-19.3}, {dum}),
- ?line ok = csemi2({45,-19.3}, {dum,dum}),
+ ok = csemi2({45,-19.3}, {}),
+ ok = csemi2({45,-19.3}, {dum}),
+ ok = csemi2({45,-19.3}, {dum,dum}),
- ?line error = csemi2({45}, {dum}),
- ?line error = csemi2([], {dum}),
- ?line error = csemi2({dum}, []),
- ?line error = csemi2([], []),
+ error = csemi2({45}, {dum}),
+ error = csemi2([], {dum}),
+ error = csemi2({dum}, []),
+ error = csemi2([], []),
%% 3
- ?line csemi3(fun csemi3a/4),
- ?line csemi3(fun csemi3b/4),
- ?line csemi3(fun csemi3c/4),
+ csemi3(fun csemi3a/4),
+ csemi3(fun csemi3b/4),
+ csemi3(fun csemi3c/4),
%% 4
- ?line csemi4(fun csemi4a/4),
- ?line csemi4(fun csemi4b/4),
- ?line csemi4(fun csemi4c/4),
- ?line csemi4(fun csemi4d/4),
+ csemi4(fun csemi4a/4),
+ csemi4(fun csemi4b/4),
+ csemi4(fun csemi4c/4),
+ csemi4(fun csemi4d/4),
%% 4, 'orelse' instead of 'or'
- ?line csemi4_orelse(fun csemi4_orelse_a/4),
- ?line csemi4_orelse(fun csemi4_orelse_b/4),
- ?line csemi4_orelse(fun csemi4_orelse_c/4),
- ?line csemi4_orelse(fun csemi4_orelse_d/4),
+ csemi4_orelse(fun csemi4_orelse_a/4),
+ csemi4_orelse(fun csemi4_orelse_b/4),
+ csemi4_orelse(fun csemi4_orelse_c/4),
+ csemi4_orelse(fun csemi4_orelse_d/4),
ok.
@@ -713,24 +707,24 @@ csemi4_orelse(Test) ->
ok = Test({}, 2, blurf, 0),
ok = Test({}, 2, {1}, 2),
- ?line error = Test([], 1, {}, 0),
+ error = Test([], 1, {}, 0),
ok.
csemi4_orelse_a(A, X, B, Y) when (size(A) > 1) orelse (X > 1);
- (size(B) > 1) orelse (Y > 1) -> ok;
+ (size(B) > 1) orelse (Y > 1) -> ok;
csemi4_orelse_a(_, _, _, _) -> error.
csemi4_orelse_b(A, X, B, Y) when (X > 1) orelse (size(A) > 1);
- (size(B) > 1) orelse (Y > 1) -> ok;
+ (size(B) > 1) orelse (Y > 1) -> ok;
csemi4_orelse_b(_, _, _, _) -> error.
csemi4_orelse_c(A, X, B, Y) when (size(A) > 1) orelse (X > 1);
- (Y > 1) orelse (size(B) > 1) -> ok;
+ (Y > 1) orelse (size(B) > 1) -> ok;
csemi4_orelse_c(_, _, _, _) -> error.
csemi4_orelse_d(A, X, B, Y) when (X > 1) or (size(A) > 1);
- (Y > 1) or (size(B) > 1) -> ok;
+ (Y > 1) or (size(B) > 1) -> ok;
csemi4_orelse_d(_, _, _, _) -> error.
@@ -738,72 +732,72 @@ comma(Config) when is_list(Config) ->
%% ',' combinations of literal true/false.
- ?line check(fun() -> if true, false -> ok; true -> error end end, error),
- ?line check(fun() -> if false, true -> ok; true -> error end end, error),
- ?line check(fun() -> if true, true -> ok end end, ok),
- ?line check(fun() -> if false, false -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if true, false -> ok;
- false, true -> ok;
- false, false -> ok
- end),
- exit
- end, exit),
+ check(fun() -> if true, false -> ok; true -> error end end, error),
+ check(fun() -> if false, true -> ok; true -> error end end, error),
+ check(fun() -> if true, true -> ok end end, ok),
+ check(fun() -> if false, false -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if true, false -> ok;
+ false, true -> ok;
+ false, false -> ok
+ end),
+ exit
+ end, exit),
%% ',' combinations of true/false in variables.
True = id(true),
False = id(false),
- ?line check(fun() -> if True, False -> ok; true -> error end end, error),
- ?line check(fun() -> if False, True -> ok; true -> error end end, error),
- ?line check(fun() -> if True, True -> ok end end, ok),
- ?line check(fun() -> if False, False -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if True, False -> ok;
- False, True -> ok;
- False, False -> ok
- end),
- exit
- end, exit),
+ check(fun() -> if True, False -> ok; true -> error end end, error),
+ check(fun() -> if False, True -> ok; true -> error end end, error),
+ check(fun() -> if True, True -> ok end end, ok),
+ check(fun() -> if False, False -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if True, False -> ok;
+ False, True -> ok;
+ False, False -> ok
+ end),
+ exit
+ end, exit),
%% ',' combinations of true/false, and non-boolean in variables.
Glurf = id(glurf),
- ?line check(fun() -> if True, Glurf -> ok; true -> error end end, error),
- ?line check(fun() -> if Glurf, True -> ok; true -> error end end, error),
- ?line check(fun() -> if True, True -> ok end end, ok),
- ?line check(fun() -> if Glurf, Glurf -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if True, Glurf -> ok;
- Glurf, True -> ok;
- Glurf, Glurf -> ok
- end),
- exit
- end, exit),
+ check(fun() -> if True, Glurf -> ok; true -> error end end, error),
+ check(fun() -> if Glurf, True -> ok; true -> error end end, error),
+ check(fun() -> if True, True -> ok end end, ok),
+ check(fun() -> if Glurf, Glurf -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if True, Glurf -> ok;
+ Glurf, True -> ok;
+ Glurf, Glurf -> ok
+ end),
+ exit
+ end, exit),
%% ',' combinations of true/false with errors.
ATuple = id({a,b,c}),
- ?line check(fun() -> if True, element(42, ATuple) -> ok;
- true -> error end end, error),
- ?line check(fun() -> if element(42, ATuple), True -> ok;
- true -> error end end, error),
- ?line check(fun() -> if True, True -> ok end end, ok),
- ?line check(fun() -> if element(42, ATuple), element(42, ATuple) -> ok;
- true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if True, element(42, ATuple) -> ok;
- element(42, ATuple), True -> ok;
- element(42, ATuple), element(42, ATuple) -> ok
- end),
- exit
- end, exit),
+ check(fun() -> if True, element(42, ATuple) -> ok;
+ true -> error end end, error),
+ check(fun() -> if element(42, ATuple), True -> ok;
+ true -> error end end, error),
+ check(fun() -> if True, True -> ok end end, ok),
+ check(fun() -> if element(42, ATuple), element(42, ATuple) -> ok;
+ true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if True, element(42, ATuple) -> ok;
+ element(42, ATuple), True -> ok;
+ element(42, ATuple), element(42, ATuple) -> ok
+ end),
+ exit
+ end, exit),
ok.
@@ -813,35 +807,35 @@ or_guard(Config) when is_list(Config) ->
Glurf = id(glurf),
%% 'or' combinations of literal true/false.
- ?line check(fun() -> if true or false -> ok end end, ok),
- ?line check(fun() -> if false or true -> ok end end, ok),
- ?line check(fun() -> if true or true -> ok end end, ok),
- ?line check(fun() -> if false or false -> ok; true -> error end end, error),
+ check(fun() -> if true or false -> ok end end, ok),
+ check(fun() -> if false or true -> ok end end, ok),
+ check(fun() -> if true or true -> ok end end, ok),
+ check(fun() -> if false or false -> ok; true -> error end end, error),
- ?line check(fun() -> if glurf or true -> ok; true -> error end end, error),
- ?line check(fun() -> if true or glurf -> ok; true -> error end end, error),
- ?line check(fun() -> if glurf or glurf -> ok; true -> error end end, error),
+ check(fun() -> if glurf or true -> ok; true -> error end end, error),
+ check(fun() -> if true or glurf -> ok; true -> error end end, error),
+ check(fun() -> if glurf or glurf -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if false or false -> ok end),
- exit
- end, exit),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if false or false -> ok end),
+ exit
+ end, exit),
%% 'or' combinations using variables containing true/false.
- ?line check(fun() -> if True or False -> ok end end, ok),
- ?line check(fun() -> if False or True -> ok end end, ok),
- ?line check(fun() -> if True or True -> ok end end, ok),
- ?line check(fun() -> if False or False -> ok; true -> error end end, error),
+ check(fun() -> if True or False -> ok end end, ok),
+ check(fun() -> if False or True -> ok end end, ok),
+ check(fun() -> if True or True -> ok end end, ok),
+ check(fun() -> if False or False -> ok; true -> error end end, error),
- ?line check(fun() -> if True or Glurf -> ok; true -> error end end, error),
- ?line check(fun() -> if Glurf or True -> ok; true -> error end end, error),
- ?line check(fun() -> if Glurf or Glurf -> ok; true -> error end end, error),
+ check(fun() -> if True or Glurf -> ok; true -> error end end, error),
+ check(fun() -> if Glurf or True -> ok; true -> error end end, error),
+ check(fun() -> if Glurf or Glurf -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if False or False -> ok end),
- exit
- end, exit),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if False or False -> ok end),
+ exit
+ end, exit),
ok.
@@ -850,142 +844,142 @@ more_or_guards(Config) when is_list(Config) ->
False = id(false),
ATuple = id({false,true,gurka}),
- ?line check(fun() ->
- if element(42, ATuple) or False -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if False or element(42, ATuple) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if element(18, ATuple) or element(42, ATuple) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if True or element(42, ATuple) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if element(42, ATuple) or True -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if element(1, ATuple) or element(42, ATuple) or True -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if element(1, ATuple) or True or element(42, ATuple) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if
- (<<False:8>> == <<0>>) or element(2, ATuple) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if
- element(2, ATuple) or (<<True:8>> == <<1>>) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if element(2, ATuple) or element(42, ATuple) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if
- element(1, ATuple) or
- element(2, ATuple) or
- element(19, ATuple) -> ok;
- true -> error end
- end, error),
+ check(fun() ->
+ if element(42, ATuple) or False -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if False or element(42, ATuple) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if element(18, ATuple) or element(42, ATuple) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if True or element(42, ATuple) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if element(42, ATuple) or True -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if element(1, ATuple) or element(42, ATuple) or True -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if element(1, ATuple) or True or element(42, ATuple) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if
+ (<<False:8>> == <<0>>) or element(2, ATuple) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if
+ element(2, ATuple) or (<<True:8>> == <<1>>) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if element(2, ATuple) or element(42, ATuple) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if
+ element(1, ATuple) or
+ element(2, ATuple) or
+ element(19, ATuple) -> ok;
+ true -> error end
+ end, error),
ok.
complex_or_guards(Config) when is_list(Config) ->
%% complex_or_1/2
- ?line ok = complex_or_1({a,b,c,d}, {1,2,3}),
- ?line ok = complex_or_1({a,b,c,d}, {1}),
- ?line ok = complex_or_1({a}, {1,2,3}),
- ?line error = complex_or_1({a}, {1}),
+ ok = complex_or_1({a,b,c,d}, {1,2,3}),
+ ok = complex_or_1({a,b,c,d}, {1}),
+ ok = complex_or_1({a}, {1,2,3}),
+ error = complex_or_1({a}, {1}),
- ?line error = complex_or_1(1, 2),
- ?line error = complex_or_1([], {a,b,c,d}),
- ?line error = complex_or_1({a,b,c,d}, []),
+ error = complex_or_1(1, 2),
+ error = complex_or_1([], {a,b,c,d}),
+ error = complex_or_1({a,b,c,d}, []),
%% complex_or_2/1
- ?line ok = complex_or_2({true,{}}),
- ?line ok = complex_or_2({false,{a}}),
- ?line ok = complex_or_2({false,{a,b,c}}),
- ?line ok = complex_or_2({true,{a,b,c,d}}),
+ ok = complex_or_2({true,{}}),
+ ok = complex_or_2({false,{a}}),
+ ok = complex_or_2({false,{a,b,c}}),
+ ok = complex_or_2({true,{a,b,c,d}}),
- ?line error = complex_or_2({blurf,{a,b,c}}),
+ error = complex_or_2({blurf,{a,b,c}}),
- ?line error = complex_or_2({true}),
- ?line error = complex_or_2({true,no_tuple}),
- ?line error = complex_or_2({true,[]}),
+ error = complex_or_2({true}),
+ error = complex_or_2({true,no_tuple}),
+ error = complex_or_2({true,[]}),
%% complex_or_3/2
- ?line ok = complex_or_3({true}, {}),
- ?line ok = complex_or_3({false}, {a}),
- ?line ok = complex_or_3({false}, {a,b,c}),
- ?line ok = complex_or_3({true}, {a,b,c,d}),
- ?line ok = complex_or_3({false}, <<1,2,3>>),
- ?line ok = complex_or_3({true}, <<1,2,3,4>>),
+ ok = complex_or_3({true}, {}),
+ ok = complex_or_3({false}, {a}),
+ ok = complex_or_3({false}, {a,b,c}),
+ ok = complex_or_3({true}, {a,b,c,d}),
+ ok = complex_or_3({false}, <<1,2,3>>),
+ ok = complex_or_3({true}, <<1,2,3,4>>),
- ?line error = complex_or_3(blurf, {a,b,c}),
+ error = complex_or_3(blurf, {a,b,c}),
- ?line error = complex_or_3({false}, <<1,2,3,4>>),
- ?line error = complex_or_3([], <<1,2>>),
- ?line error = complex_or_3({true}, 45),
- ?line error = complex_or_3(<<>>, <<>>),
+ error = complex_or_3({false}, <<1,2,3,4>>),
+ error = complex_or_3([], <<1,2>>),
+ error = complex_or_3({true}, 45),
+ error = complex_or_3(<<>>, <<>>),
%% complex_or_4/2
- ?line ok = complex_or_4(<<1,2,3>>, {true}),
- ?line ok = complex_or_4(<<1,2,3>>, {false}),
- ?line ok = complex_or_4(<<1,2,3>>, {true}),
- ?line ok = complex_or_4({1,2,3}, {true}),
- ?line error = complex_or_4({1,2,3,4}, {false}),
+ ok = complex_or_4(<<1,2,3>>, {true}),
+ ok = complex_or_4(<<1,2,3>>, {false}),
+ ok = complex_or_4(<<1,2,3>>, {true}),
+ ok = complex_or_4({1,2,3}, {true}),
+ error = complex_or_4({1,2,3,4}, {false}),
- ?line error = complex_or_4(<<1,2,3,4>>, []),
- ?line error = complex_or_4([], {true}),
+ error = complex_or_4(<<1,2,3,4>>, []),
+ error = complex_or_4([], {true}),
%% complex_or_5/2
- ?line ok = complex_or_5(<<1>>, {false}),
- ?line ok = complex_or_5(<<1,2,3>>, {true}),
- ?line ok = complex_or_5(<<1,2,3,4>>, {false}),
- ?line ok = complex_or_5({1,2,3}, {false}),
- ?line ok = complex_or_5({1,2,3,4}, {false}),
+ ok = complex_or_5(<<1>>, {false}),
+ ok = complex_or_5(<<1,2,3>>, {true}),
+ ok = complex_or_5(<<1,2,3,4>>, {false}),
+ ok = complex_or_5({1,2,3}, {false}),
+ ok = complex_or_5({1,2,3,4}, {false}),
- ?line error = complex_or_5(blurf, {false}),
- ?line error = complex_or_5(<<1>>, klarf),
- ?line error = complex_or_5(blurf, klarf),
+ error = complex_or_5(blurf, {false}),
+ error = complex_or_5(<<1>>, klarf),
+ error = complex_or_5(blurf, klarf),
%% complex_or_6/2
- ?line ok = complex_or_6({true,true}, {1,2,3,4}),
- ?line ok = complex_or_6({true,true}, <<1,2,3,4>>),
- ?line ok = complex_or_6({false,false}, <<1,2,3,4>>),
- ?line ok = complex_or_6({false,true}, <<1>>),
- ?line ok = complex_or_6({true,false}, {1}),
- ?line ok = complex_or_6({true,true}, {1}),
+ ok = complex_or_6({true,true}, {1,2,3,4}),
+ ok = complex_or_6({true,true}, <<1,2,3,4>>),
+ ok = complex_or_6({false,false}, <<1,2,3,4>>),
+ ok = complex_or_6({false,true}, <<1>>),
+ ok = complex_or_6({true,false}, {1}),
+ ok = complex_or_6({true,true}, {1}),
- ?line error = complex_or_6({false,false}, {1}),
+ error = complex_or_6({false,false}, {1}),
- ?line error = complex_or_6({true}, {1,2,3,4}),
- ?line error = complex_or_6({}, {1,2,3,4}),
- ?line error = complex_or_6([], {1,2,3,4}),
- ?line error = complex_or_6([], {1,2,3,4}),
- ?line error = complex_or_6({true,false}, klurf),
+ error = complex_or_6({true}, {1,2,3,4}),
+ error = complex_or_6({}, {1,2,3,4}),
+ error = complex_or_6([], {1,2,3,4}),
+ error = complex_or_6([], {1,2,3,4}),
+ error = complex_or_6({true,false}, klurf),
ok.
@@ -1031,79 +1025,79 @@ and_guard(Config) when is_list(Config) ->
%% 'and' combinations of literal true/false.
- ?line check(fun() -> if true and false -> ok; true -> error end end, error),
- ?line check(fun() -> if false and true -> ok; true -> error end end, error),
- ?line check(fun() -> if true and true -> ok end end, ok),
- ?line check(fun() -> if false and false -> ok; true -> error end end, error),
+ check(fun() -> if true and false -> ok; true -> error end end, error),
+ check(fun() -> if false and true -> ok; true -> error end end, error),
+ check(fun() -> if true and true -> ok end end, ok),
+ check(fun() -> if false and false -> ok; true -> error end end, error),
- ?line check(fun() -> if glurf and true -> ok; true -> error end end, error),
- ?line check(fun() -> if true and glurf -> ok; true -> error end end, error),
- ?line check(fun() -> if glurf and glurf -> ok; true -> error end end, error),
+ check(fun() -> if glurf and true -> ok; true -> error end end, error),
+ check(fun() -> if true and glurf -> ok; true -> error end end, error),
+ check(fun() -> if glurf and glurf -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if true and false -> ok;
- false and true -> ok;
- false and false -> ok
- end),
- exit
- end, exit),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if true and false -> ok;
+ false and true -> ok;
+ false and false -> ok
+ end),
+ exit
+ end, exit),
%% 'and' combinations of true/false in variables.
True = id(true),
False = id(false),
- ?line check(fun() -> if True and False -> ok; true -> error end end, error),
- ?line check(fun() -> if False and True -> ok; true -> error end end, error),
- ?line check(fun() -> if True and True -> ok end end, ok),
- ?line check(fun() -> if False and False -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if True and False -> ok;
- False and True -> ok;
- False and False -> ok
- end),
- exit
- end, exit),
+ check(fun() -> if True and False -> ok; true -> error end end, error),
+ check(fun() -> if False and True -> ok; true -> error end end, error),
+ check(fun() -> if True and True -> ok end end, ok),
+ check(fun() -> if False and False -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if True and False -> ok;
+ False and True -> ok;
+ False and False -> ok
+ end),
+ exit
+ end, exit),
%% 'and' combinations of true/false and a non-boolean in variables.
Glurf = id(glurf),
- ?line check(fun() -> if True and Glurf -> ok; true -> error end end, error),
- ?line check(fun() -> if Glurf and True -> ok; true -> error end end, error),
- ?line check(fun() -> if True and True -> ok end end, ok),
- ?line check(fun() -> if Glurf and Glurf -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if True and Glurf -> ok;
- Glurf and True -> ok;
- Glurf and Glurf -> ok
- end),
- exit
- end, exit),
+ check(fun() -> if True and Glurf -> ok; true -> error end end, error),
+ check(fun() -> if Glurf and True -> ok; true -> error end end, error),
+ check(fun() -> if True and True -> ok end end, ok),
+ check(fun() -> if Glurf and Glurf -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if True and Glurf -> ok;
+ Glurf and True -> ok;
+ Glurf and Glurf -> ok
+ end),
+ exit
+ end, exit),
%% 'and' combinations of true/false with errors.
ATuple = id({a,b,c}),
- ?line check(fun() -> if True and element(42, ATuple) -> ok;
- true -> error end end, error),
- ?line check(fun() -> if element(42, ATuple) and True -> ok;
- true -> error end end, error),
- ?line check(fun() -> if True and True -> ok end end, ok),
- ?line check(fun() -> if element(42, ATuple) and element(42, ATuple) -> ok;
- true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if True and element(42, ATuple) -> ok;
- element(42, ATuple) and True -> ok;
- element(42, ATuple) and element(42, ATuple) -> ok
- end),
- exit
- end, exit),
-
- ?line ok = relprod({'Set',a,b}, {'Set',a,b}),
+ check(fun() -> if True and element(42, ATuple) -> ok;
+ true -> error end end, error),
+ check(fun() -> if element(42, ATuple) and True -> ok;
+ true -> error end end, error),
+ check(fun() -> if True and True -> ok end end, ok),
+ check(fun() -> if element(42, ATuple) and element(42, ATuple) -> ok;
+ true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if True and element(42, ATuple) -> ok;
+ element(42, ATuple) and True -> ok;
+ element(42, ATuple) and element(42, ATuple) -> ok
+ end),
+ exit
+ end, exit),
+
+ ok = relprod({'Set',a,b}, {'Set',a,b}),
ok.
@@ -1114,18 +1108,18 @@ relprod(R1, R2) when (erlang:size(R1) =:= 3) and (erlang:element(1,R1) =:= 'Set'
xor_guard(Config) when is_list(Config) ->
%% 'xor' combinations of literal true/false.
- ?line check(fun() -> if true xor false -> ok end end, ok),
- ?line check(fun() -> if false xor true -> ok end end, ok),
- ?line check(fun() -> if true xor true -> ok; true -> error end end, error),
- ?line check(fun() -> if false xor false -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if false xor false -> ok end),
- exit
- end, exit),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if true xor true -> ok end),
- exit
- end, exit),
+ check(fun() -> if true xor false -> ok end end, ok),
+ check(fun() -> if false xor true -> ok end end, ok),
+ check(fun() -> if true xor true -> ok; true -> error end end, error),
+ check(fun() -> if false xor false -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if false xor false -> ok end),
+ exit
+ end, exit),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if true xor true -> ok end),
+ exit
+ end, exit),
%% 'xor' combinations using variables containing true/false.
@@ -1133,18 +1127,18 @@ xor_guard(Config) when is_list(Config) ->
True = id(true),
False = id(false),
- ?line check(fun() -> if True xor False -> ok end end, ok),
- ?line check(fun() -> if False xor True -> ok end end, ok),
- ?line check(fun() -> if True xor True -> ok; true -> error end end, error),
- ?line check(fun() -> if False xor False -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if False xor False -> ok end),
- exit
- end, exit),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if True xor True -> ok end),
- exit
- end, exit),
+ check(fun() -> if True xor False -> ok end end, ok),
+ check(fun() -> if False xor True -> ok end end, ok),
+ check(fun() -> if True xor True -> ok; true -> error end end, error),
+ check(fun() -> if False xor False -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if False xor False -> ok end),
+ exit
+ end, exit),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if True xor True -> ok end),
+ exit
+ end, exit),
ok.
@@ -1153,53 +1147,53 @@ more_xor_guards(Config) when is_list(Config) ->
False = id(false),
ATuple = id({false,true,gurka}),
- ?line check(fun() ->
- if element(42, ATuple) xor False -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if False xor element(42, ATuple) xor False -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if element(18, ATuple) xor element(42, ATuple) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if True xor element(42, ATuple) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if element(42, ATuple) xor True -> ok;
- true -> error end
- end, error),
+ check(fun() ->
+ if element(42, ATuple) xor False -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if False xor element(42, ATuple) xor False -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if element(18, ATuple) xor element(42, ATuple) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if True xor element(42, ATuple) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if element(42, ATuple) xor True -> ok;
+ true -> error end
+ end, error),
ok.
build_in_guard(Config) when is_list(Config) ->
SubBin = <<5.0/float>>,
- ?line B = <<1,SubBin/binary,3.5/float>>,
- ?line if
- B =:= <<1,SubBin/binary,3.5/float>> -> ok
- end.
+ B = <<1,SubBin/binary,3.5/float>>,
+ if
+ B =:= <<1,SubBin/binary,3.5/float>> -> ok
+ end.
old_guard_tests(Config) when list(Config) ->
%% Check that all the old guard tests are still recognized.
- ?line list = og(Config),
- ?line atom = og(an_atom),
- ?line binary = og(<<1,2>>),
- ?line float = og(3.14),
- ?line integer = og(43),
- ?line a_function = og(fun() -> ok end),
- ?line pid = og(self()),
- ?line reference = og(make_ref()),
- ?line tuple = og({}),
-
- ?line number = on(45.333),
- ?line number = on(-19),
+ list = og(Config),
+ atom = og(an_atom),
+ binary = og(<<1,2>>),
+ float = og(3.14),
+ integer = og(43),
+ a_function = og(fun() -> ok end),
+ pid = og(self()),
+ reference = og(make_ref()),
+ tuple = og({}),
+
+ number = on(45.333),
+ number = on(-19),
ok.
og(V) when atom(V) -> atom;
@@ -1218,8 +1212,8 @@ on(V) when number(V) -> number;
on(_) -> not_number.
gbif(Config) when is_list(Config) ->
- ?line error = gbif_1(1, {false,true}),
- ?line ok = gbif_1(2, {false,true}),
+ error = gbif_1(1, {false,true}),
+ ok = gbif_1(2, {false,true}),
ok.
gbif_1(P, T) when element(P, T) -> ok;
@@ -1227,49 +1221,49 @@ gbif_1(_, _) -> error.
t_is_boolean(Config) when is_list(Config) ->
- ?line true = is_boolean(true),
- ?line true = is_boolean(false),
- ?line true = is_boolean(id(true)),
- ?line true = is_boolean(id(false)),
-
- ?line false = is_boolean(glurf),
- ?line false = is_boolean(id(glurf)),
-
- ?line false = is_boolean([]),
- ?line false = is_boolean(id([])),
- ?line false = is_boolean(42),
- ?line false = is_boolean(id(-42)),
-
- ?line false = is_boolean(math:pi()),
- ?line false = is_boolean(384793478934378924978439789873478934897),
-
- ?line false = is_boolean(id(self())),
- ?line false = is_boolean(id({x,y,z})),
- ?line false = is_boolean(id([a,b,c])),
- ?line false = is_boolean(id(make_ref())),
- ?line false = is_boolean(id(<<1,2,3>>)),
-
- ?line ok = bool(true),
- ?line ok = bool(false),
- ?line ok = bool(id(true)),
- ?line ok = bool(id(false)),
-
- ?line error = bool(glurf),
- ?line error = bool(id(glurf)),
-
- ?line error = bool([]),
- ?line error = bool(id([])),
- ?line error = bool(42),
- ?line error = bool(id(-42)),
-
- ?line error = bool(math:pi()),
- ?line error = bool(384793478934378924978439789873478934897),
-
- ?line error = bool(id(self())),
- ?line error = bool(id({x,y,z})),
- ?line error = bool(id([a,b,c])),
- ?line error = bool(id(make_ref())),
- ?line error = bool(id(<<1,2,3>>)),
+ true = is_boolean(true),
+ true = is_boolean(false),
+ true = is_boolean(id(true)),
+ true = is_boolean(id(false)),
+
+ false = is_boolean(glurf),
+ false = is_boolean(id(glurf)),
+
+ false = is_boolean([]),
+ false = is_boolean(id([])),
+ false = is_boolean(42),
+ false = is_boolean(id(-42)),
+
+ false = is_boolean(math:pi()),
+ false = is_boolean(384793478934378924978439789873478934897),
+
+ false = is_boolean(id(self())),
+ false = is_boolean(id({x,y,z})),
+ false = is_boolean(id([a,b,c])),
+ false = is_boolean(id(make_ref())),
+ false = is_boolean(id(<<1,2,3>>)),
+
+ ok = bool(true),
+ ok = bool(false),
+ ok = bool(id(true)),
+ ok = bool(id(false)),
+
+ error = bool(glurf),
+ error = bool(id(glurf)),
+
+ error = bool([]),
+ error = bool(id([])),
+ error = bool(42),
+ error = bool(id(-42)),
+
+ error = bool(math:pi()),
+ error = bool(384793478934378924978439789873478934897),
+
+ error = bool(id(self())),
+ error = bool(id({x,y,z})),
+ error = bool(id([a,b,c])),
+ error = bool(id(make_ref())),
+ error = bool(id(<<1,2,3>>)),
ok.
@@ -1289,14 +1283,14 @@ is_function_2(Config) when is_list(Config) ->
end.
tricky(Config) when is_list(Config) ->
- ?line not_ok = tricky_1(1, 2),
- ?line not_ok = tricky_1(1, blurf),
- ?line not_ok = tricky_1(foo, 2),
- ?line not_ok = tricky_1(a, b),
-
- ?line false = rb(100000, [1], 42),
- ?line true = rb(100000, [], 42),
- ?line true = rb(555, [a,b,c], 19),
+ not_ok = tricky_1(1, 2),
+ not_ok = tricky_1(1, blurf),
+ not_ok = tricky_1(foo, 2),
+ not_ok = tricky_1(a, b),
+
+ false = rb(100000, [1], 42),
+ true = rb(100000, [], 42),
+ true = rb(555, [a,b,c], 19),
ok.
tricky_1(X, Y) when abs((X == 1) or (Y == 2)) -> ok;
@@ -1331,66 +1325,66 @@ rb(_, _, _) -> false.
rel_ops(Config) when is_list(Config) ->
- ?line ?T(=/=, 1, 1.0),
- ?line ?F(=/=, 2, 2),
- ?line ?F(=/=, {a}, {a}),
+ ?T(=/=, 1, 1.0),
+ ?F(=/=, 2, 2),
+ ?F(=/=, {a}, {a}),
- ?line ?F(/=, a, a),
- ?line ?F(/=, 0, 0.0),
- ?line ?T(/=, 0, 1),
- ?line ?F(/=, {a}, {a}),
+ ?F(/=, a, a),
+ ?F(/=, 0, 0.0),
+ ?T(/=, 0, 1),
+ ?F(/=, {a}, {a}),
- ?line ?T(==, 1, 1.0),
- ?line ?F(==, a, {}),
+ ?T(==, 1, 1.0),
+ ?F(==, a, {}),
- ?line ?F(=:=, 1, 1.0),
- ?line ?T(=:=, 42.0, 42.0),
+ ?F(=:=, 1, 1.0),
+ ?T(=:=, 42.0, 42.0),
- ?line ?F(>, a, b),
- ?line ?T(>, 42, 1.0),
- ?line ?F(>, 42, 42.0),
+ ?F(>, a, b),
+ ?T(>, 42, 1.0),
+ ?F(>, 42, 42.0),
- ?line ?T(<, a, b),
- ?line ?F(<, 42, 1.0),
- ?line ?F(<, 42, 42.0),
+ ?T(<, a, b),
+ ?F(<, 42, 1.0),
+ ?F(<, 42, 42.0),
- ?line ?T(=<, 1.5, 5),
- ?line ?F(=<, -9, -100.344),
- ?line ?T(=<, 42, 42.0),
+ ?T(=<, 1.5, 5),
+ ?F(=<, -9, -100.344),
+ ?T(=<, 42, 42.0),
- ?line ?T(>=, 42, 42.0),
- ?line ?F(>=, a, b),
- ?line ?T(>=, 1.0, 0),
+ ?T(>=, 42, 42.0),
+ ?F(>=, a, b),
+ ?T(>=, 1.0, 0),
ok.
-undef(TestOp).
basic_andalso_orelse(Config) when is_list(Config) ->
- ?line T = id({type,integers,23,42}),
- ?line 65 = if
- ((element(1, T) =:= type) andalso (size(T) =:= 4) andalso
- element(2, T) == integers) ->
- element(3, T) + element(4, T);
- true -> error
- end,
- ?line 65 = case [] of
- [] when ((element(1, T) =:= type) andalso (size(T) =:= 4) andalso
- element(2, T) == integers) ->
- element(3, T) + element(4, T)
- end,
-
- ?line 42 = basic_rt({type,integers,40,2}),
- ?line 5.0 = basic_rt({vector,{3.0,4.0}}),
- ?line 20 = basic_rt(['+',3,7]),
- ?line {'Set',a,b} = basic_rt({{'Set',a,b},{'Set',a,b}}),
- ?line 12 = basic_rt({klurf,4}),
-
- ?line error = basic_rt({type,integers,40,2,3}),
- ?line error = basic_rt({kalle,integers,40,2}),
- ?line error = basic_rt({kalle,integers,40,2}),
- ?line error = basic_rt({1,2}),
- ?line error = basic_rt([]),
+ T = id({type,integers,23,42}),
+ 65 = if
+ ((element(1, T) =:= type) andalso (size(T) =:= 4) andalso
+ element(2, T) == integers) ->
+ element(3, T) + element(4, T);
+ true -> error
+ end,
+ 65 = case [] of
+ [] when ((element(1, T) =:= type) andalso (size(T) =:= 4) andalso
+ element(2, T) == integers) ->
+ element(3, T) + element(4, T)
+ end,
+
+ 42 = basic_rt({type,integers,40,2}),
+ 5.0 = basic_rt({vector,{3.0,4.0}}),
+ 20 = basic_rt(['+',3,7]),
+ {'Set',a,b} = basic_rt({{'Set',a,b},{'Set',a,b}}),
+ 12 = basic_rt({klurf,4}),
+
+ error = basic_rt({type,integers,40,2,3}),
+ error = basic_rt({kalle,integers,40,2}),
+ error = basic_rt({kalle,integers,40,2}),
+ error = basic_rt({1,2}),
+ error = basic_rt([]),
RelProdBody =
fun(R1, R2) ->
@@ -1401,7 +1395,7 @@ basic_andalso_orelse(Config) when is_list(Config) ->
end
end,
- ?line ok = RelProdBody({'Set',a,b}, {'Set',a,b}),
+ ok = RelProdBody({'Set',a,b}, {'Set',a,b}),
ok.
basic_rt(T) when is_tuple(T) andalso size(T) =:= 4 andalso element(1, T) =:= type andalso
@@ -1445,9 +1439,9 @@ traverse_dcd(Config) when is_list(Config) ->
traverse_dcd({Cont,[LogH|Rest]},Log,Fun)
when is_tuple(LogH) andalso size(LogH) =:= 6 andalso element(1, LogH) =:= log_header
-andalso erlang:element(2,LogH) == dcd_log,
-is_tuple(LogH) andalso size(LogH) =:= 6 andalso element(1, LogH) =:= log_header
-andalso erlang:element(3,LogH) >= "1.0" ->
+ andalso erlang:element(2,LogH) == dcd_log,
+ is_tuple(LogH) andalso size(LogH) =:= 6 andalso element(1, LogH) =:= log_header
+ andalso erlang:element(3,LogH) >= "1.0" ->
traverse_dcd({Cont,Rest},Log,Fun);
traverse_dcd({Cont,Recs},Log,Fun) ->
{Cont,Recs,Log,Fun}.
@@ -1455,14 +1449,14 @@ traverse_dcd({Cont,Recs},Log,Fun) ->
check_qlc_hrl(Config) when is_list(Config) ->
St = {r1,false,dum},
- ?line foo = cqlc(qlc, q, [{lc,1,2,3}], St),
- ?line foo = cqlc(qlc, q, [{lc,1,2,3},b], St),
- ?line St = cqlc(qlc, q, [], St),
- ?line St = cqlc(qlc, blurf, [{lc,1,2,3},b], St),
- ?line St = cqlc(q, q, [{lc,1,2,3},b], St),
- ?line St = cqlc(qlc, q, [{lc,1,2,3},b,c], St),
- ?line St = cqlc(qlc, q, [a,b], St),
- ?line {r1,true,kalle} = cqlc(qlc, q, [{lc,1,2,3},b], {r1,true,kalle}),
+ foo = cqlc(qlc, q, [{lc,1,2,3}], St),
+ foo = cqlc(qlc, q, [{lc,1,2,3},b], St),
+ St = cqlc(qlc, q, [], St),
+ St = cqlc(qlc, blurf, [{lc,1,2,3},b], St),
+ St = cqlc(q, q, [{lc,1,2,3},b], St),
+ St = cqlc(qlc, q, [{lc,1,2,3},b,c], St),
+ St = cqlc(qlc, q, [a,b], St),
+ {r1,true,kalle} = cqlc(qlc, q, [{lc,1,2,3},b], {r1,true,kalle}),
ok.
%% From erl_lint.erl; original name was check_qlc_hrl/4.
@@ -1479,29 +1473,29 @@ cqlc(M, F, As, St) ->
%% OTP-7679: Thanks to Hunter Morris.
andalso_semi(Config) when is_list(Config) ->
- ?line ok = andalso_semi_foo(0),
- ?line ok = andalso_semi_foo(1),
- ?line fc(catch andalso_semi_foo(2)),
+ ok = andalso_semi_foo(0),
+ ok = andalso_semi_foo(1),
+ fc(catch andalso_semi_foo(2)),
- ?line ok = andalso_semi_bar([a,b,c]),
- ?line ok = andalso_semi_bar(1),
- ?line fc(catch andalso_semi_bar([a,b])),
+ ok = andalso_semi_bar([a,b,c]),
+ ok = andalso_semi_bar(1),
+ fc(catch andalso_semi_bar([a,b])),
ok.
andalso_semi_foo(Bar) when is_integer(Bar) andalso Bar =:= 0; Bar =:= 1 ->
- ok.
+ ok.
andalso_semi_bar(Bar) when is_list(Bar) andalso length(Bar) =:= 3; Bar =:= 1 ->
- ok.
+ ok.
t_tuple_size(Config) when is_list(Config) ->
- ?line 10 = do_tuple_size({1,2,3,4}),
- ?line fc(catch do_tuple_size({1,2,3})),
- ?line fc(catch do_tuple_size(42)),
+ 10 = do_tuple_size({1,2,3,4}),
+ fc(catch do_tuple_size({1,2,3})),
+ fc(catch do_tuple_size(42)),
- ?line error = ludicrous_tuple_size({a,b,c}),
- ?line error = ludicrous_tuple_size([a,b,c]),
+ error = ludicrous_tuple_size({a,b,c}),
+ error = ludicrous_tuple_size([a,b,c]),
ok.
@@ -1528,77 +1522,76 @@ mask_error({'EXIT',{Err,_}}) ->
mask_error(Else) ->
Else.
-binary_part(doc) ->
- ["Tests the binary_part/2,3 guard (GC) bif's"];
+%% Tests the binary_part/2,3 guard (GC) bif's.
binary_part(Config) when is_list(Config) ->
%% This is more or less a copy of what the guard_SUITE in emulator
%% does to cover the guard bif's
- ?line 1 = bptest(<<1,2,3>>),
- ?line 2 = bptest(<<2,1,3>>),
- ?line error = bptest(<<1>>),
- ?line error = bptest(<<>>),
- ?line error = bptest(apa),
- ?line 3 = bptest(<<2,3,3>>),
- % With one variable (pos)
- ?line 1 = bptest(<<1,2,3>>,1),
- ?line 2 = bptest(<<2,1,3>>,1),
- ?line error = bptest(<<1>>,1),
- ?line error = bptest(<<>>,1),
- ?line error = bptest(apa,1),
- ?line 3 = bptest(<<2,3,3>>,1),
- % With one variable (length)
- ?line 1 = bptesty(<<1,2,3>>,1),
- ?line 2 = bptesty(<<2,1,3>>,1),
- ?line error = bptesty(<<1>>,1),
- ?line error = bptesty(<<>>,1),
- ?line error = bptesty(apa,1),
- ?line 3 = bptesty(<<2,3,3>>,2),
- % With one variable (whole tuple)
- ?line 1 = bptestx(<<1,2,3>>,{1,1}),
- ?line 2 = bptestx(<<2,1,3>>,{1,1}),
- ?line error = bptestx(<<1>>,{1,1}),
- ?line error = bptestx(<<>>,{1,1}),
- ?line error = bptestx(apa,{1,1}),
- ?line 3 = bptestx(<<2,3,3>>,{1,2}),
- % With two variables
- ?line 1 = bptest(<<1,2,3>>,1,1),
- ?line 2 = bptest(<<2,1,3>>,1,1),
- ?line error = bptest(<<1>>,1,1),
- ?line error = bptest(<<>>,1,1),
- ?line error = bptest(apa,1,1),
- ?line 3 = bptest(<<2,3,3>>,1,2),
- % Direct (autoimported) call, these will be evaluated by the compiler...
- ?line <<2>> = binary_part(<<1,2,3>>,1,1),
- ?line <<1>> = binary_part(<<2,1,3>>,1,1),
- % Compiler warnings due to constant evaluation expected (3)
- ?line badarg = ?MASK_ERROR(binary_part(<<1>>,1,1)),
- ?line badarg = ?MASK_ERROR(binary_part(<<>>,1,1)),
- ?line badarg = ?MASK_ERROR(binary_part(apa,1,1)),
- ?line <<3,3>> = binary_part(<<2,3,3>>,1,2),
- % Direct call through apply
- ?line <<2>> = apply(erlang,binary_part,[<<1,2,3>>,1,1]),
- ?line <<1>> = apply(erlang,binary_part,[<<2,1,3>>,1,1]),
- % Compiler warnings due to constant evaluation expected (3)
- ?line badarg = ?MASK_ERROR(apply(erlang,binary_part,[<<1>>,1,1])),
- ?line badarg = ?MASK_ERROR(apply(erlang,binary_part,[<<>>,1,1])),
- ?line badarg = ?MASK_ERROR(apply(erlang,binary_part,[apa,1,1])),
- ?line <<3,3>> = apply(erlang,binary_part,[<<2,3,3>>,1,2]),
- % Constant propagation
- ?line Bin = <<1,2,3>>,
- ?line ok = if
- binary_part(Bin,1,1) =:= <<2>> ->
- ok;
- %% Compiler warning, clause cannot match (expected)
- true ->
- error
- end,
- ?line ok = if
- binary_part(Bin,{1,1}) =:= <<2>> ->
- ok;
- %% Compiler warning, clause cannot match (expected)
- true ->
- error
- end,
+ 1 = bptest(<<1,2,3>>),
+ 2 = bptest(<<2,1,3>>),
+ error = bptest(<<1>>),
+ error = bptest(<<>>),
+ error = bptest(apa),
+ 3 = bptest(<<2,3,3>>),
+ %% With one variable (pos)
+ 1 = bptest(<<1,2,3>>,1),
+ 2 = bptest(<<2,1,3>>,1),
+ error = bptest(<<1>>,1),
+ error = bptest(<<>>,1),
+ error = bptest(apa,1),
+ 3 = bptest(<<2,3,3>>,1),
+ %% With one variable (length)
+ 1 = bptesty(<<1,2,3>>,1),
+ 2 = bptesty(<<2,1,3>>,1),
+ error = bptesty(<<1>>,1),
+ error = bptesty(<<>>,1),
+ error = bptesty(apa,1),
+ 3 = bptesty(<<2,3,3>>,2),
+ %% With one variable (whole tuple)
+ 1 = bptestx(<<1,2,3>>,{1,1}),
+ 2 = bptestx(<<2,1,3>>,{1,1}),
+ error = bptestx(<<1>>,{1,1}),
+ error = bptestx(<<>>,{1,1}),
+ error = bptestx(apa,{1,1}),
+ 3 = bptestx(<<2,3,3>>,{1,2}),
+ %% With two variables
+ 1 = bptest(<<1,2,3>>,1,1),
+ 2 = bptest(<<2,1,3>>,1,1),
+ error = bptest(<<1>>,1,1),
+ error = bptest(<<>>,1,1),
+ error = bptest(apa,1,1),
+ 3 = bptest(<<2,3,3>>,1,2),
+ %% Direct (autoimported) call, these will be evaluated by the compiler...
+ <<2>> = binary_part(<<1,2,3>>,1,1),
+ <<1>> = binary_part(<<2,1,3>>,1,1),
+ %% Compiler warnings due to constant evaluation expected (3)
+ badarg = ?MASK_ERROR(binary_part(<<1>>,1,1)),
+ badarg = ?MASK_ERROR(binary_part(<<>>,1,1)),
+ badarg = ?MASK_ERROR(binary_part(apa,1,1)),
+ <<3,3>> = binary_part(<<2,3,3>>,1,2),
+ %% Direct call through apply
+ <<2>> = apply(erlang,binary_part,[<<1,2,3>>,1,1]),
+ <<1>> = apply(erlang,binary_part,[<<2,1,3>>,1,1]),
+ %% Compiler warnings due to constant evaluation expected (3)
+ badarg = ?MASK_ERROR(apply(erlang,binary_part,[<<1>>,1,1])),
+ badarg = ?MASK_ERROR(apply(erlang,binary_part,[<<>>,1,1])),
+ badarg = ?MASK_ERROR(apply(erlang,binary_part,[apa,1,1])),
+ <<3,3>> = apply(erlang,binary_part,[<<2,3,3>>,1,2]),
+ %% Constant propagation
+ Bin = <<1,2,3>>,
+ ok = if
+ binary_part(Bin,1,1) =:= <<2>> ->
+ ok;
+ %% Compiler warning, clause cannot match (expected)
+ true ->
+ error
+ end,
+ ok = if
+ binary_part(Bin,{1,1}) =:= <<2>> ->
+ ok;
+ %% Compiler warning, clause cannot match (expected)
+ true ->
+ error
+ end,
ok.
@@ -1659,24 +1652,24 @@ bptest(_,_,_) ->
-define(FAILING(C),
if
- C -> ?t:fail(should_fail);
+ C -> ct:fail(should_fail);
true -> ok
end,
if
- true, C -> ?t:fail(should_fail);
+ true, C -> ct:fail(should_fail);
true -> ok
end).
bad_constants(Config) when is_list(Config) ->
- ?line ?FAILING(false),
- ?line ?FAILING([]),
- ?line ?FAILING([a]),
- ?line ?FAILING([Config]),
- ?line ?FAILING({a,b}),
- ?line ?FAILING({a,Config}),
- ?line ?FAILING(<<1>>),
- ?line ?FAILING(42),
- ?line ?FAILING(3.14),
+ ?FAILING(false),
+ ?FAILING([]),
+ ?FAILING([a]),
+ ?FAILING([Config]),
+ ?FAILING({a,b}),
+ ?FAILING({a,Config}),
+ ?FAILING(<<1>>),
+ ?FAILING(42),
+ ?FAILING(3.14),
ok.
%% Call this function to turn off constant propagation.
@@ -1688,7 +1681,7 @@ check(F, Result) ->
Other ->
io:format("Expected: ~p\n", [Result]),
io:format(" Got: ~p\n", [Other]),
- test_server:fail()
+ ct:fail(failed)
end.
fc({'EXIT',{function_clause,_}}) -> ok.
diff --git a/lib/debugger/test/int_SUITE.erl b/lib/debugger/test/int_SUITE.erl
index ec4de88331..f697ace4e5 100644
--- a/lib/debugger/test/int_SUITE.erl
+++ b/lib/debugger/test/int_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -31,37 +31,30 @@
-export([interpret/1, guards/1, interpretable/1]).
-export([ append_1/1, append_2/1, member/1, reverse/1]).
-%% Default timetrap timeout (set in init_per_testcase)
--define(default_timeout, ?t:minutes(1)).
-
init_per_testcase(interpretable, Config) ->
- ?line Dog=test_server:timetrap(?default_timeout),
- [{watchdog, Dog}|Config];
+ Config;
init_per_testcase(_Case, Config) ->
%% Interpret some existing and non-existing modules
- ?line DataDir = ?config(data_dir, Config),
- ?line {module, lists1} = int:i(filename:join([DataDir,lists1])),
- ?line {module, guards} = int:i(filename:join([DataDir,guards])),
+ DataDir = proplists:get_value(data_dir, Config),
+ {module, lists1} = int:i(filename:join([DataDir,lists1])),
+ {module, guards} = int:i(filename:join([DataDir,guards])),
- ?line Dog=test_server:timetrap(?default_timeout),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(interpretable, Config) ->
- ?line Dog=?config(watchdog, Config),
- ?line test_server:timetrap_cancel(Dog),
+end_per_testcase(interpretable, _Config) ->
ok;
end_per_testcase(_Case, Config) ->
%% Quit interpreting
- ?line ok = int:n(lists1),
- ?line ok = int:n(guards),
+ ok = int:n(lists1),
+ ok = int:n(guards),
- ?line Dog=?config(watchdog, Config),
- ?line test_server:timetrap_cancel(Dog),
- ?line ok.
+ ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[interpret, guards, {group, list_suite}, interpretable].
@@ -71,6 +64,14 @@ groups() ->
{append, [], [append_1, append_2]}].
init_per_suite(Config) ->
+ DataDir = proplists:get_value(data_dir, Config),
+ {ok,OldCwd} = file:get_cwd(),
+ try
+ ok = file:set_cwd(DataDir),
+ make:all()
+ after
+ file:set_cwd(OldCwd)
+ end,
Config.
end_per_suite(_Config) ->
@@ -83,83 +84,62 @@ end_per_group(_GroupName, Config) ->
Config.
-interpret(suite) ->
- [];
-interpret(doc) ->
- ["Interpreting modules"];
+%% Interpreting modules.
interpret(Config) when is_list(Config) ->
- ?line int:n(int:interpreted()),
+ int:n(int:interpreted()),
%% Interpret some existing and non-existing modules
- ?line DataDir = ?config(data_dir, Config),
- ?line {module, lists1} = int:i(filename:join([DataDir,lists1])),
- ?line {module, ordsets1} = int:i(filename:join([DataDir,ordsets1])),
- ?line error = int:i(non_existent_module),
+ DataDir = proplists:get_value(data_dir, Config),
+ {module, lists1} = int:i(filename:join([DataDir,lists1])),
+ {module, ordsets1} = int:i(filename:join([DataDir,ordsets1])),
+ error = int:i(non_existent_module),
%% Check that the interpreter has the right view.
- ?line ExpectedResult = lists:sort([lists1, ordsets1]),
- ?line Result = int:interpreted(),
- ?line ExpectedResult = lists:sort(Result),
+ ExpectedResult = lists:sort([lists1, ordsets1]),
+ Result = int:interpreted(),
+ ExpectedResult = lists:sort(Result),
%% Uniterpret the modules.
- ?line ok = int:n(non_existent_module),
- ?line ok = int:n(lists1),
- ?line [ordsets1] = int:interpreted(),
- ?line ok = int:n("ordsets1"),
- ?line [] = int:interpreted(),
+ ok = int:n(non_existent_module),
+ ok = int:n(lists1),
+ [ordsets1] = int:interpreted(),
+ ok = int:n("ordsets1"),
+ [] = int:interpreted(),
ok.
-guards(suite) ->
- [];
-guards(doc) ->
- "Evaluate guards.";
+%% Evaluate guards.
guards(Config) when is_list(Config) ->
ok = guards:guards().
-
-
-
-append_1(suite) ->
- [];
-append_1(doc) ->
- [];
append_1(Config) when is_list(Config) ->
- ?line test_server:format("In append_1~n"),
- ?line test_server:format("code:which(lists1)=~p~n",
- [code:which(lists1)]),
- ?line test_server:format("lists1:append([a],[b])=~p~n",
- [spawn_eval(lists1,append,[[a],[b]])]),
-
- ?line "abcdef"=spawn_eval(lists1,append,[["abc","def"]]),
- ?line [hej, du,[glade, [bagare]]]=
+ io:format("In append_1~n"),
+ io:format("code:which(lists1)=~p~n",
+ [code:which(lists1)]),
+ io:format("lists1:append([a],[b])=~p~n",
+ [spawn_eval(lists1,append,[[a],[b]])]),
+
+ "abcdef"=spawn_eval(lists1,append,[["abc","def"]]),
+ [hej, du,[glade, [bagare]]]=
spawn_eval(lists1,append,[[[hej], [du], [[glade, [bagare]]]]]),
- ?line [10, [elem]]=spawn_eval(lists1,append,[[[10], [[elem]]]]),
+ [10, [elem]]=spawn_eval(lists1,append,[[[10], [[elem]]]]),
ok.
-append_2(suite) ->
- [];
-append_2(doc) ->
- [];
append_2(Config) when is_list(Config) ->
- ?line test_server:format("In append_2~n"),
- ?line test_server:format("code:which(lists1)=~p~n",
- [code:which(lists1)]),
+ io:format("In append_2~n"),
+ io:format("code:which(lists1)=~p~n",
+ [code:which(lists1)]),
- ?line "abcdef"=spawn_eval(lists1,append,["abc", "def"]),
- ?line [hej, du]=spawn_eval(lists1,append,[[hej], [du]]),
- ?line [10, [elem]]=spawn_eval(lists1,append,[[10], [[elem]]]),
+ "abcdef"=spawn_eval(lists1,append,["abc", "def"]),
+ [hej, du]=spawn_eval(lists1,append,[[hej], [du]]),
+ [10, [elem]]=spawn_eval(lists1,append,[[10], [[elem]]]),
ok.
-reverse(suite) ->
- [];
-reverse(doc) ->
- [];
reverse(Config) when is_list(Config) ->
- ?line ok=reverse_test(0),
- ?line ok=reverse_test(1),
- ?line ok=reverse_test(2),
- ?line ok=reverse_test(537),
+ ok=reverse_test(0),
+ ok=reverse_test(1),
+ ok=reverse_test(2),
+ ok=reverse_test(537),
ok.
reverse_test(0) ->
@@ -179,19 +159,16 @@ reverse_test(Num) ->
error
end.
-member(suite) ->
- [];
-member(doc) ->
- ["Tests the lists1:member() implementation. The function "
- "is `non-blocking', and only processes 2000 elements "
- "at a time.",
- "This test case depends on lists1:reverse() to work, "
- "wich is tested in a separate test case."];
+%% Tests the lists1:member() implementation. The function
+%% is `non-blocking', and only processes 2000 elements
+%% at a time.
+%% This test case depends on lists1:reverse() to work,
+%% which is tested in a separate test case.
member(Config) when list(Config) ->
- ?line ok=member_test(0),
- ?line ok=member_test(1),
- ?line ok=member_test(100),
- ?line ok=member_test(537),
+ ok=member_test(0),
+ ok=member_test(1),
+ ok=member_test(100),
+ ok=member_test(537),
ok.
member_test(0) ->
@@ -223,48 +200,45 @@ spawn_eval(M,F,A) ->
evaluator(Pid, M,F,A) ->
Pid ! (catch apply(M,F,A)).
-interpretable(suite) ->
- [];
-interpretable(doc) ->
- ["Test int:interpretable/1"];
+%% Test int:interpretable/1.
interpretable(Config) when is_list(Config) ->
%% First make sure that 'lists1' is not loaded
case code:is_loaded(lists1) of
{file, _Loaded} ->
- ?line code:purge(lists1),
- ?line code:delete(lists1),
- ?line code:purge(lists1);
+ code:purge(lists1),
+ code:delete(lists1),
+ code:purge(lists1);
false -> ignore
end,
%% true
- ?line DataDir = filename:dirname(?config(data_dir, Config)),
- ?line true = code:add_patha(DataDir),
- ?line true = int:interpretable(lists1),
- ?line true = int:interpretable(filename:join([DataDir,lists1])),
- ?line true = code:del_path(DataDir),
+ DataDir = filename:dirname(proplists:get_value(data_dir, Config)),
+ true = code:add_patha(DataDir),
+ true = int:interpretable(lists1),
+ true = int:interpretable(filename:join([DataDir,lists1])),
+ true = code:del_path(DataDir),
%% true (from source)
- PrivDir = filename:join(?config(priv_dir, Config), ""),
+ PrivDir = filename:join(proplists:get_value(priv_dir, Config), ""),
{ok, _} = file:copy(filename:join([DataDir,"lists1.beam"]),
- filename:join([PrivDir,"lists1.beam"])),
+ filename:join([PrivDir,"lists1.beam"])),
true = code:add_patha(PrivDir),
true = int:interpretable(lists1),
ok = file:delete(filename:join([PrivDir,"lists1.beam"])),
%% {error, no_beam}
Src = filename:join([PrivDir,"lists1.erl"]),
- ?line {ok, _} = file:copy(filename:join([DataDir,"lists1.erl"]),
- Src),
- ?line {error, no_beam} = int:interpretable(Src),
+ {ok, _} = file:copy(filename:join([DataDir,"lists1.erl"]),
+ Src),
+ {error, no_beam} = int:interpretable(Src),
%% {error, no_debug_info}
- ?line {ok, _} = compile:file(Src, [{outdir,PrivDir}]),
- ?line {error, no_debug_info} = int:interpretable(Src),
- ?line {error, no_debug_info} = int:interpretable(lists1),
- ?line ok = file:delete(Src),
- ?line true = code:del_path(PrivDir),
+ {ok, _} = compile:file(Src, [{outdir,PrivDir}]),
+ {error, no_debug_info} = int:interpretable(Src),
+ {error, no_debug_info} = int:interpretable(lists1),
+ ok = file:delete(Src),
+ true = code:del_path(PrivDir),
%% {error, no_src}
{ok, lists2, Binary} = compile:forms([{attribute,1,module,lists2}], []),
@@ -272,24 +246,33 @@ interpretable(Config) when is_list(Config) ->
{error, no_src} = int:interpretable(lists2),
%% {error, badarg}
- ?line {error, badarg} = int:interpretable(pride),
- ?line {error, badarg} = int:interpretable("prejudice.erl"),
+ {error, badarg} = int:interpretable(pride),
+ {error, badarg} = int:interpretable("prejudice.erl"),
%% {error, {app,App}}
- ?line {error, {app,_}} = int:interpretable(file),
- ?line {error, {app,_}} = int:interpretable(lists),
- ?line case int:interpretable(dbg_ieval) of
- {error, {app,_}} ->
- ok;
- {error, badarg} ->
- case code:which(dbg_ieval) of
- cover_compiled ->
- ok;
- Other1 ->
- ?line ?t:fail({unexpected_result, Other1})
- end;
- Other2 ->
- ?line ?t:fail({unexpected_result, Other2})
- end,
-
+ case filename:basename(code:lib_dir(kernel)) of
+ "kernel" ->
+ %% Development system (not installed). We are allowed
+ %% to interpret modules in kernel and stdlib
+ %% (at our own risk).
+ ok;
+ "kernel-" ++ _ ->
+ %% Installed system. Certain applications (including
+ %% kernel and stdlib) cannot be interpreted.
+ {error, {app,_}} = int:interpretable(file),
+ {error, {app,_}} = int:interpretable(lists),
+ case int:interpretable(dbg_ieval) of
+ {error, {app,_}} ->
+ ok;
+ {error, badarg} ->
+ case code:which(dbg_ieval) of
+ cover_compiled ->
+ ok;
+ Other1 ->
+ ct:fail({unexpected_result, Other1})
+ end;
+ Other2 ->
+ ct:fail({unexpected_result, Other2})
+ end
+ end,
ok.
diff --git a/lib/debugger/test/int_SUITE_data/Emakefile b/lib/debugger/test/int_SUITE_data/Emakefile
new file mode 100644
index 0000000000..6158d66764
--- /dev/null
+++ b/lib/debugger/test/int_SUITE_data/Emakefile
@@ -0,0 +1 @@
+{[guards,lists1,my_lists,ordsets1,test,test1],[{outdir,"."},debug_info]}.
diff --git a/lib/debugger/test/int_SUITE_data/Makefile.src b/lib/debugger/test/int_SUITE_data/Makefile.src
deleted file mode 100644
index 0bbb90734f..0000000000
--- a/lib/debugger/test/int_SUITE_data/Makefile.src
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# %CopyrightBegin%
-#
-# Copyright Ericsson AB 2000-2010. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# %CopyrightEnd%
-#
-EFLAGS=+debug_info
-all: guards.@EMULATOR@ lists1.@EMULATOR@ my_lists.@EMULATOR@ \
- ordsets1.@EMULATOR@ test.@EMULATOR@ test1.@EMULATOR@
-
-guards.@EMULATOR@: guards.erl
- erlc $(EFLAGS) guards.erl
-
-lists1.@EMULATOR@: lists1.erl
- erlc $(EFLAGS) lists1.erl
-
-my_lists.@EMULATOR@: my_lists.erl
- erlc $(EFLAGS) my_lists.erl
-
-ordsets1.@EMULATOR@: ordsets1.erl
- erlc $(EFLAGS) ordsets1.erl
-
-test.@EMULATOR@: test.erl
- erlc $(EFLAGS) test.erl
-
-test1.@EMULATOR@: test1.erl
- erlc $(EFLAGS) test1.erl
diff --git a/lib/debugger/test/int_SUITE_data/guards.erl b/lib/debugger/test/int_SUITE_data/guards.erl
index d148974e53..b790bc5934 100644
--- a/lib/debugger/test/int_SUITE_data/guards.erl
+++ b/lib/debugger/test/int_SUITE_data/guards.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_SUITE_data/lists1.erl b/lib/debugger/test/int_SUITE_data/lists1.erl
index c26ccfceda..32aabfcbb9 100644
--- a/lib/debugger/test/int_SUITE_data/lists1.erl
+++ b/lib/debugger/test/int_SUITE_data/lists1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_SUITE_data/my_lists.erl b/lib/debugger/test/int_SUITE_data/my_lists.erl
index 0ec2a7585f..dade8e824c 100644
--- a/lib/debugger/test/int_SUITE_data/my_lists.erl
+++ b/lib/debugger/test/int_SUITE_data/my_lists.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_SUITE_data/ordsets1.erl b/lib/debugger/test/int_SUITE_data/ordsets1.erl
index 349921b951..f96548a52c 100644
--- a/lib/debugger/test/int_SUITE_data/ordsets1.erl
+++ b/lib/debugger/test/int_SUITE_data/ordsets1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_SUITE_data/test.erl b/lib/debugger/test/int_SUITE_data/test.erl
index b29394302b..c2165a9856 100644
--- a/lib/debugger/test/int_SUITE_data/test.erl
+++ b/lib/debugger/test/int_SUITE_data/test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_SUITE_data/test1.erl b/lib/debugger/test/int_SUITE_data/test1.erl
index cb60c67bc4..2a7b8ab329 100644
--- a/lib/debugger/test/int_SUITE_data/test1.erl
+++ b/lib/debugger/test/int_SUITE_data/test1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_break_SUITE.erl b/lib/debugger/test/int_break_SUITE.erl
index 75bdd69a7d..9894c27b81 100644
--- a/lib/debugger/test/int_break_SUITE.erl
+++ b/lib/debugger/test/int_break_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -31,7 +31,9 @@
-export([auto_attach/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[basic, cleanup].
@@ -53,38 +55,33 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line Mod = ordsets1,
- ?line {module,Mod} = int:i(filename:join(DataDir, Mod)),
- ?line ok = io:format("Interpreted modules: ~p", [int:interpreted()]),
- ?line Dog = test_server:timetrap(?t:minutes(0.5)),
- [{watchdog,Dog}|Config].
-
-end_per_testcase(_Case, Config) ->
- ?line ok = io:format("Interpreted modules: ~p", [int:interpreted()]),
- ?line Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+ DataDir = proplists:get_value(data_dir, Config),
+ Mod = ordsets1,
+ {module,Mod} = int:i(filename:join(DataDir, Mod)),
+ ok = io:format("Interpreted modules: ~p", [int:interpreted()]),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
+ ok = io:format("Interpreted modules: ~p", [int:interpreted()]),
ok.
-basic(doc) -> "Tests setting a few break points.";
-basic(suite) -> [];
+%% Tests setting a few break points.
basic(Config) when list(Config) ->
- ?line int:auto_attach([init], {?MODULE,auto_attach}),
- ?line S1 = [] = ordsets1:new_set(),
- ?line ok = i:ib(ordsets1, 86),
- ?line S2 = [xxx] = ordsets1:add_element(xxx, S1),
- ?line S3 = [xxx,y] = ordsets1:add_element(y, S2),
- ?line ok = i:ib(ordsets1, union, 2),
- ?line [xxx,y,z] = ordsets1:union(S3, [z]),
+ int:auto_attach([init], {?MODULE,auto_attach}),
+ S1 = [] = ordsets1:new_set(),
+ ok = i:ib(ordsets1, 86),
+ S2 = [xxx] = ordsets1:add_element(xxx, S1),
+ S3 = [xxx,y] = ordsets1:add_element(y, S2),
+ ok = i:ib(ordsets1, union, 2),
+ [xxx,y,z] = ordsets1:union(S3, [z]),
All = [{{ordsets1,86}, _}, {{ordsets1,_},_}|_] = lists:sort(int:all_breaks()),
[] = lists:sort(int:all_breaks(foobar)),
All = lists:sort(int:all_breaks(ordsets1)),
ok.
-cleanup(doc) -> "Make sure that the auto-attach flag is turned off.";
-cleanup(suite) -> [];
+%% Make sure that the auto-attach flag is turned off.
cleanup(Config) when list(Config) ->
- ?line int:auto_attach(false),
+ int:auto_attach(false),
ok.
auto_attach(Pid) ->
diff --git a/lib/debugger/test/int_break_SUITE_data/Makefile.src b/lib/debugger/test/int_break_SUITE_data/Makefile.src
index 7b79aec4aa..2002b51a41 100644
--- a/lib/debugger/test/int_break_SUITE_data/Makefile.src
+++ b/lib/debugger/test/int_break_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2010. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_break_SUITE_data/ordsets1.erl b/lib/debugger/test/int_break_SUITE_data/ordsets1.erl
index b2c7221eea..a23c057fbe 100644
--- a/lib/debugger/test/int_break_SUITE_data/ordsets1.erl
+++ b/lib/debugger/test/int_break_SUITE_data/ordsets1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_eval_SUITE.erl b/lib/debugger/test/int_eval_SUITE.erl
index 3f3c03492e..27ca4852b5 100644
--- a/lib/debugger/test/int_eval_SUITE.erl
+++ b/lib/debugger/test/int_eval_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -64,19 +64,16 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line {module,?IM} = int:i(filename:join(DataDir, ?IM)),
- ?line ok = io:format("Interpreted modules: ~p",[int:interpreted()]),
+ DataDir = proplists:get_value(data_dir, Config),
+ {module,?IM} = int:i(filename:join(DataDir, ?IM)),
+ ok = io:format("Interpreted modules: ~p",[int:interpreted()]),
Config.
end_per_testcase(_Case, _Config) ->
ok = io:format("Interpreted modules: ~p", [int:interpreted()]),
ok.
-bifs_outside_erlang(doc) ->
- "Test that BIFs outside the erlang module are correctly evaluated.";
-bifs_outside_erlang(suite) ->
- [];
+%% Test that BIFs outside the erlang module are correctly evaluated.
bifs_outside_erlang(Config) when is_list(Config) ->
Fun = fun() ->
Id = ?IM:ets_new(),
@@ -87,164 +84,145 @@ bifs_outside_erlang(Config) when is_list(Config) ->
?IM:ets_delete(Id),
ok
end,
- ?line ok = spawn_eval(Fun),
+ ok = spawn_eval(Fun),
ok.
-spawning(doc) ->
- "Try evalutate spawn_link/3.";
-spawning(suite) ->
- [];
+%% Try evalutate spawn_link/3.
spawning(Config) when is_list(Config) ->
- ?line ok = spawn_eval(fun() -> ?IM:spawn_test() end).
+ ok = spawn_eval(fun() -> ?IM:spawn_test() end).
-applying(doc) ->
- "Try various sorts of applies.";
-applying(suite) ->
- [];
+%% Try various sorts of applies.
applying(Config) when is_list(Config) ->
Fun = fun({number,X}, {number,Y}) -> X+Y end,
- ?line ok = spawn_eval(fun() -> ?IM:apply_test(Fun) end).
+ ok = spawn_eval(fun() -> ?IM:apply_test(Fun) end).
-catch_and_throw(doc) ->
- "Test catch and throw/1.";
-catch_and_throw(suite) ->
- [];
+%% Test catch and throw/1.
catch_and_throw(Config) when is_list(Config) ->
- {a,ball} = spawn_eval(fun() -> ok = ?IM:catch_a_ball(),
- catch ?IM:throw_a_ball() end),
-
- %% Throw and catch without any extra outer catch.
-
- ?line process_flag(trap_exit, true),
- ?line Pid1 = spawn_link(fun() -> exit(?IM:catch_a_ball()) end),
- receive
- {'EXIT',Pid1,ok} -> ok;
- {'EXIT',Pid1,Bad1} -> ?line ?t:fail({bad_message,Bad1})
- after 5000 ->
- ?line ?t:fail(timeout)
- end,
+ {a,ball} = spawn_eval(fun() -> ok = ?IM:catch_a_ball(),
+ catch ?IM:throw_a_ball() end),
+
+ %% Throw and catch without any extra outer catch.
+
+ process_flag(trap_exit, true),
+ Pid1 = spawn_link(fun() -> exit(?IM:catch_a_ball()) end),
+ receive
+ {'EXIT',Pid1,ok} -> ok;
+ {'EXIT',Pid1,Bad1} -> ct:fail({bad_message,Bad1})
+ after 5000 ->
+ ct:fail(timeout)
+ end,
- %% Throw without catch.
+ %% Throw without catch.
- ?line Pid2 = spawn_link(fun() -> ?IM:throw_a_ball() end),
- receive
- {'EXIT',Pid2,{{nocatch,{a,ball}},[_|_]}} -> ok;
- {'EXIT',Pid2,Bad2} -> ?line ?t:fail({bad_message,Bad2})
- after 5000 ->
- ?line ?t:fail(timeout)
- end,
+ Pid2 = spawn_link(fun() -> ?IM:throw_a_ball() end),
+ receive
+ {'EXIT',Pid2,{{nocatch,{a,ball}},[_|_]}} -> ok;
+ {'EXIT',Pid2,Bad2} -> ct:fail({bad_message,Bad2})
+ after 5000 ->
+ ct:fail(timeout)
+ end,
- ?line ok = ?IM:more_catch(fun(_) -> ?IM:exit_me() end),
- ?line ok = ?IM:more_catch(fun(_) -> exit({unint, exit}) end),
- ?line {a, ball} = ?IM:more_catch(fun(_) -> ?IM:throw_a_ball() end),
- ?line {b, ball} = ?IM:more_catch(fun(_) -> throw({b,ball}) end),
+ ok = ?IM:more_catch(fun(_) -> ?IM:exit_me() end),
+ ok = ?IM:more_catch(fun(_) -> exit({unint, exit}) end),
+ {a, ball} = ?IM:more_catch(fun(_) -> ?IM:throw_a_ball() end),
+ {b, ball} = ?IM:more_catch(fun(_) -> throw({b,ball}) end),
- ExitInt = {'EXIT',{int,exit}},
- ExitU = {'EXIT',{unint,exit}},
+ ExitInt = {'EXIT',{int,exit}},
+ ExitU = {'EXIT',{unint,exit}},
- ?line ExitInt = (catch ?IM:more_nocatch(fun(_) -> ?IM:exit_me() end)),
- ?line ExitU = (catch ?IM:more_nocatch(fun(_) -> exit({unint, exit}) end)),
- ?line {a, ball} = (catch {error, ?IM:more_nocatch(fun(_) -> ?IM:throw_a_ball() end)}),
- ?line {b, ball} = (catch {error, ?IM:more_nocatch(fun(_) -> throw({b,ball}) end)}),
- ok.
+ ExitInt = (catch ?IM:more_nocatch(fun(_) -> ?IM:exit_me() end)),
+ ExitU = (catch ?IM:more_nocatch(fun(_) -> exit({unint, exit}) end)),
+ {a, ball} = (catch {error, ?IM:more_nocatch(fun(_) -> ?IM:throw_a_ball() end)}),
+ {b, ball} = (catch {error, ?IM:more_nocatch(fun(_) -> throw({b,ball}) end)}),
+ ok.
-external_call(doc) ->
- "Test external calls.";
-external_call(suite) ->
- [];
+%% Test external calls.
external_call(Config) when is_list(Config) ->
- ?line ok = spawn_eval(fun() -> ?IM:external_call_test({some,stupid,data}) end).
+ ok = spawn_eval(fun() -> ?IM:external_call_test({some,stupid,data}) end).
-test_module_info(doc) ->
- "Test the module_info/0,1 functions.";
-test_module_info(suite) ->
- [];
+%% Test the module_info/0,1 functions.
test_module_info(Config) when is_list(Config) ->
- ?line ModInfo = ?IM:module_info(),
- ?line {value,{exports,Exp}} = lists:keysearch(exports, 1, ModInfo),
- ?line {value,{attributes,Attr}} = lists:keysearch(attributes, 1, ModInfo),
- ?line Exp = ?IM:module_info(exports),
- ?line Attr = ?IM:module_info(attributes),
- ?line {value,{stupid_attribute,[{a,b}]}} =
+ ModInfo = ?IM:module_info(),
+ {value,{exports,Exp}} = lists:keysearch(exports, 1, ModInfo),
+ {value,{attributes,Attr}} = lists:keysearch(attributes, 1, ModInfo),
+ Exp = ?IM:module_info(exports),
+ Attr = ?IM:module_info(attributes),
+ {value,{stupid_attribute,[{a,b}]}} =
lists:keysearch(stupid_attribute, 1, Attr),
%% Check exports using a list comprehension in the module itself.
- ?line ok = ?IM:check_exports(Exp),
+ ok = ?IM:check_exports(Exp),
%% Call module_info/0,1 from the module itself.
- ?line ok = ?IM:check_module_info(ModInfo, Exp),
+ ok = ?IM:check_module_info(ModInfo, Exp),
ok.
-apply_interpreted_fun(doc) ->
- "Apply a fun defined in interpreted code.";
-apply_interpreted_fun(suite) -> [];
+%% Apply a fun defined in interpreted code.
apply_interpreted_fun(Config) when is_list(Config) ->
%% Called from uninterpreted code
- ?line F1 = spawn_eval(fun() -> ?IM:give_me_a_fun_0() end),
- ?line perfectly_alright = spawn_eval(fun() -> F1() end),
- ?line ATerm = {a,term},
- ?line F2 = spawn_eval(fun() -> ?IM:give_me_a_fun_0(ATerm) end),
- ?line {ok,ATerm} = spawn_eval(fun() -> F2() end),
+ F1 = spawn_eval(fun() -> ?IM:give_me_a_fun_0() end),
+ perfectly_alright = spawn_eval(fun() -> F1() end),
+ ATerm = {a,term},
+ F2 = spawn_eval(fun() -> ?IM:give_me_a_fun_0(ATerm) end),
+ {ok,ATerm} = spawn_eval(fun() -> F2() end),
%% Called from uninterpreted code, badarity
- ?line {'EXIT',{{badarity,{F1,[snape]}},[{?MODULE,_,_,_}|_]}} =
+ {'EXIT',{{badarity,{F1,[snape]}},[{?MODULE,_,_,_}|_]}} =
spawn_eval(fun() -> F1(snape) end),
%% Called from uninterpreted code, error in fun
- ?line F3 = spawn_eval(fun() -> ?IM:give_me_a_bad_fun() end),
- ?line {'EXIT',{snape,[{?IM,_FunName,_,_}|_]}} =
+ F3 = spawn_eval(fun() -> ?IM:give_me_a_bad_fun() end),
+ {'EXIT',{snape,[{?IM,_FunName,_,_}|_]}} =
spawn_eval(fun() -> F3(snape) end),
%% Called from within interpreted code
- ?line perfectly_alright = spawn_eval(fun() -> ?IM:do_apply(F1) end),
+ perfectly_alright = spawn_eval(fun() -> ?IM:do_apply(F1) end),
%% Called from within interpreted code, badarity
- ?line {'EXIT',{{badarity,{F1,[snape]}},[{?IM,do_apply,_,_}|_]}} =
+ {'EXIT',{{badarity,{F1,[snape]}},[{?IM,do_apply,_,_}|_]}} =
spawn_eval(fun() -> ?IM:do_apply(F1, snape) end),
%% Called from within interpreted code, error in fun
- ?line {'EXIT',{snape,[{?IM,_FunName,_,_}|_]}} =
+ {'EXIT',{snape,[{?IM,_FunName,_,_}|_]}} =
spawn_eval(fun() -> ?IM:do_apply(F3, snape) end),
%% Try some more complex funs.
- ?line F4 = ?IM:give_me_a_fun_1(14, 42),
- ?line {false,yes,yeah,false} =
+ F4 = ?IM:give_me_a_fun_1(14, 42),
+ {false,yes,yeah,false} =
F4({{1,nope},{14,yes},{42,yeah},{100,forget_it}}),
- ?line [this_is_ok,me_too] =
+ [this_is_ok,me_too] =
F4([{-24,no_way},{15,this_is_ok},{1333,forget_me},{37,me_too}]),
%% OTP-5837
%% Try fun with guard containing variable bound in environment
- ?line [yes,no,no,no] = ?IM:otp_5837(1),
+ [yes,no,no,no] = ?IM:otp_5837(1),
ok.
-apply_uninterpreted_fun(doc) ->
- "Apply a fun defined outside interpreted code.";
-apply_uninterpreted_fun(suite) -> [];
+%% Apply a fun defined outside interpreted code.
apply_uninterpreted_fun(Config) when is_list(Config) ->
- ?line F1 = fun(snape) ->
- erlang:error(snape);
- (_Arg) ->
- perfectly_alright
- end,
+ F1 = fun(snape) ->
+ erlang:error(snape);
+ (_Arg) ->
+ perfectly_alright
+ end,
%% Ok
- ?line perfectly_alright =
+ perfectly_alright =
spawn_eval(fun() -> ?IM:do_apply(F1, any_arg) end),
%% Badarity (evaluated in dbg_debugged, which calls erlang:apply/2)
- ?line {'EXIT',{{badarity,{F1,[]}},[{erlang,apply,_,_}|_]}} =
+ {'EXIT',{{badarity,{F1,[]}},[{erlang,apply,_,_}|_]}} =
spawn_eval(fun() -> ?IM:do_apply(F1) end),
%% Error in fun
- ?line {'EXIT',{snape,[{?MODULE,_FunName,_,_}|_]}} =
+ {'EXIT',{snape,[{?MODULE,_FunName,_,_}|_]}} =
spawn_eval(fun() -> ?IM:do_apply(F1, snape) end),
ok.
@@ -254,23 +232,22 @@ apply_uninterpreted_fun(Config) when is_list(Config) ->
%%
interpreted_exit(Config) when is_list(Config) ->
- ?line process_flag(trap_exit, true),
- ?line Reason = make_ref(),
- ?line Pid = spawn_link(fun() -> ?IM:please_call_exit(Reason) end),
- ?line receive
- {'EXIT',Pid,Reason} ->
- ok;
- {'EXIT',Pid,BadReason} ->
- ?line ?t:fail({bad_message,BadReason})
- after 10000 ->
- ?line ?t:fail(timeout)
- end,
+ process_flag(trap_exit, true),
+ Reason = make_ref(),
+ Pid = spawn_link(fun() -> ?IM:please_call_exit(Reason) end),
+ receive
+ {'EXIT',Pid,Reason} ->
+ ok;
+ {'EXIT',Pid,BadReason} ->
+ ct:fail({bad_message,BadReason})
+ after 10000 ->
+ ct:fail(timeout)
+ end,
ok.
-otp_8310(doc) ->
- "OTP-8310. Bugfixes lc/bc and andalso/orelse.";
+%% OTP-8310. Bugfixes lc/bc and andalso/orelse.
otp_8310(Config) when is_list(Config) ->
- ?line ok = ?IM:otp_8310(),
+ ok = ?IM:otp_8310(),
ok.
applier(M, F, A) ->
@@ -279,17 +256,17 @@ applier(M, F, A) ->
Res.
stacktrace(Config) when is_list(Config) ->
- ?line {done,Stk} = do_eval(Config, stacktrace),
- ?line 13 = length(Stk),
- ?line OldStackTraceFlag = int:stack_trace(),
- ?line int:stack_trace(no_tail),
+ {done,Stk} = do_eval(Config, stacktrace),
+ 13 = length(Stk),
+ OldStackTraceFlag = int:stack_trace(),
+ int:stack_trace(no_tail),
try
- ?line Res = spawn_eval(fun() -> stacktrace:stacktrace() end),
- ?line io:format("\nInterpreted (no_tail):\n~p", [Res]),
- ?line {done,Stk} = Res
- after
- ?line int:stack_trace(OldStackTraceFlag)
- end,
+ Res = spawn_eval(fun() -> stacktrace:stacktrace() end),
+ io:format("\nInterpreted (no_tail):\n~p", [Res]),
+ {done,Stk} = Res
+ after
+ int:stack_trace(OldStackTraceFlag)
+ end,
ok.
maps(Config) when is_list(Config) ->
@@ -300,20 +277,20 @@ maps(Config) when is_list(Config) ->
do_eval(Config, Mod) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line ok = file:set_cwd(DataDir),
+ DataDir = proplists:get_value(data_dir, Config),
+ ok = file:set_cwd(DataDir),
- ?line {ok,Mod} = compile:file(Mod, [report,debug_info]),
- ?line {module,Mod} = code:load_file(Mod),
- ?line CompiledRes = Mod:Mod(),
- ?line ok = io:format("Compiled:\n~p", [CompiledRes]),
+ {ok,Mod} = compile:file(Mod, [report,debug_info]),
+ {module,Mod} = code:load_file(Mod),
+ CompiledRes = Mod:Mod(),
+ ok = io:format("Compiled:\n~p", [CompiledRes]),
io:nl(),
- ?line {module,Mod} = int:i(Mod),
- ?line IntRes = Mod:Mod(),
- ?line ok = io:format("Interpreted:\n~p", [IntRes]),
+ {module,Mod} = int:i(Mod),
+ IntRes = Mod:Mod(),
+ ok = io:format("Interpreted:\n~p", [IntRes]),
- ?line CompiledRes = IntRes.
+ CompiledRes = IntRes.
%%
%% Evaluate in another process, to prevent the test_case process to become
diff --git a/lib/debugger/test/int_eval_SUITE_data/Makefile.src b/lib/debugger/test/int_eval_SUITE_data/Makefile.src
index bc2eb9a37d..01cdb8d7b7 100644
--- a/lib/debugger/test/int_eval_SUITE_data/Makefile.src
+++ b/lib/debugger/test/int_eval_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2010. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl b/lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl
index b0ff4ce752..ca7929c10b 100644
--- a/lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl
+++ b/lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/lc_SUITE.erl b/lib/debugger/test/lc_SUITE.erl
index 851d0fbc20..28415b412b 100644
--- a/lib/debugger/test/lc_SUITE.erl
+++ b/lib/debugger/test/lc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -30,7 +30,9 @@
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[basic, deeply_nested, no_generator, empty_generator].
@@ -46,53 +48,50 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
ok.
basic(Config) when is_list(Config) ->
- ?line L0 = lists:seq(1, 10),
- ?line L1 = my_map(fun(X) -> {x,X} end, L0),
- ?line L1 = [{x,X} || X <- L0],
- ?line L0 = my_map(fun({x,X}) -> X end, L1),
- ?line [1,2,3,4,5] = [X || X <- L0, X < 6],
- ?line [4,5,6] = [X || X <- L0, X > 3, X < 7],
- ?line [] = [X || X <- L0, X > 32, X < 7],
- ?line [1,3,5,7,9] = [X || X <- L0, odd(X)],
- ?line [2,4,6,8,10] = [X || X <- L0, not odd(X)],
- ?line [1,3,5,9] = [X || X <- L0, odd(X), X =/= 7],
- ?line [2,4,8,10] = [X || X <- L0, not odd(X), X =/= 6],
+ L0 = lists:seq(1, 10),
+ L1 = my_map(fun(X) -> {x,X} end, L0),
+ L1 = [{x,X} || X <- L0],
+ L0 = my_map(fun({x,X}) -> X end, L1),
+ [1,2,3,4,5] = [X || X <- L0, X < 6],
+ [4,5,6] = [X || X <- L0, X > 3, X < 7],
+ [] = [X || X <- L0, X > 32, X < 7],
+ [1,3,5,7,9] = [X || X <- L0, odd(X)],
+ [2,4,6,8,10] = [X || X <- L0, not odd(X)],
+ [1,3,5,9] = [X || X <- L0, odd(X), X =/= 7],
+ [2,4,8,10] = [X || X <- L0, not odd(X), X =/= 6],
%% Append is specially handled.
- ?line [1,3,5,9,2,4,8,10] = [X || X <- L0, odd(X), X =/= 7] ++
+ [1,3,5,9,2,4,8,10] = [X || X <- L0, odd(X), X =/= 7] ++
[X || X <- L0, not odd(X), X =/= 6],
%% Guards BIFs are evaluated in guard context. Weird, but true.
- ?line [{a,b,true},{x,y,true,true}] = [X || X <- tuple_list(), element(3, X)],
+ [{a,b,true},{x,y,true,true}] = [X || X <- tuple_list(), element(3, X)],
%% Filter expressions with andalso/orelse.
- ?line "abc123" = alphanum("?abc123.;"),
+ "abc123" = alphanum("?abc123.;"),
%% Error cases.
- ?line [] = [{xx,X} || X <- L0, element(2, X) == no_no_no],
- ?line {'EXIT',_} = (catch [X || X <- L1, list_to_atom(X) == dum]),
- ?line [] = [X || X <- L1, X+1 < 2],
- ?line {'EXIT',_} = (catch [X || X <- L1, odd(X)]),
+ [] = [{xx,X} || X <- L0, element(2, X) == no_no_no],
+ {'EXIT',_} = (catch [X || X <- L1, list_to_atom(X) == dum]),
+ [] = [X || X <- L1, X+1 < 2],
+ {'EXIT',_} = (catch [X || X <- L1, odd(X)]),
%% A bad generator has a different exception compared to BEAM.
- ?line {'EXIT',{{bad_generator,x},_}} = (catch [E || E <- id(x)]),
+ {'EXIT',{{bad_generator,x},_}} = (catch [E || E <- id(x)]),
ok.
tuple_list() ->
@@ -122,12 +121,12 @@ deeply_nested_1() ->
X16 <- [4],X17 <- [3],X18 <- [fun() -> X16+X17 end],X19 <- [2],X20 <- [1]].
no_generator(Config) when is_list(Config) ->
- ?line Seq = lists:seq(-10, 17),
- ?line [no_gen_verify(no_gen(A, B), A, B) || A <- Seq, B <- Seq],
+ Seq = lists:seq(-10, 17),
+ [no_gen_verify(no_gen(A, B), A, B) || A <- Seq, B <- Seq],
%% Literal expression, for coverage.
- ?line [a] = [a || true],
- ?line [a,b,c] = [a || true] ++ [b,c],
+ [a] = [a || true],
+ [a,b,c] = [a || true] ++ [b,c],
ok.
no_gen(A, B) ->
@@ -168,7 +167,7 @@ no_gen_verify(Res, A, B) ->
ShouldBe -> ok;
_ ->
io:format("A = ~p; B = ~p; Expected = ~p, actual = ~p", [A,B,ShouldBe,Res]),
- ?t:fail()
+ ct:fail(failed)
end.
no_gen_eval(Fun, Res) ->
@@ -180,7 +179,7 @@ no_gen_eval(Fun, Res) ->
no_gen_one_more(A, B) -> A + 1 =:= B.
empty_generator(Config) when is_list(Config) ->
- ?line [] = [X || {X} <- [], (false or (X/0 > 3))],
+ [] = [X || {X} <- [], (false or (X/0 > 3))],
ok.
id(I) -> I.
diff --git a/lib/debugger/test/line_number_SUITE.erl b/lib/debugger/test/line_number_SUITE.erl
index 592f0a1f32..276473b95f 100644
--- a/lib/debugger/test/line_number_SUITE.erl
+++ b/lib/debugger/test/line_number_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,7 +28,9 @@
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
cases().
@@ -47,17 +49,14 @@ cases() ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
@@ -66,6 +65,7 @@ end_per_suite(Config) when is_list(Config) ->
+
%%
%% === Make sure that this is always line 70 ===
%%
diff --git a/lib/debugger/test/map_SUITE.erl b/lib/debugger/test/map_SUITE.erl
index eabcdcbf42..42484ff723 100644
--- a/lib/debugger/test/map_SUITE.erl
+++ b/lib/debugger/test/map_SUITE.erl
@@ -191,8 +191,8 @@ t_build_and_match_literals(Config) when is_list(Config) ->
id(#{ map_1=>#{ map_2=>#{value_3 => third}, value_2=> second}, value_1=>first}),
%% error case
- %V = 32,
- %{'EXIT',{{badmatch,_},_}} = (catch (#{<<"hi all">> => 1} = id(#{<<"hi",V,"all">> => 1}))),
+ %% V = 32,
+ %%{'EXIT',{{badmatch,_},_}} = (catch (#{<<"hi all">> => 1} = id(#{<<"hi",V,"all">> => 1}))),
{'EXIT',{{badmatch,_},_}} = (catch (#{x:=3,x:=2} = id(#{x=>3}))),
{'EXIT',{{badmatch,_},_}} = (catch (#{x:=2} = id(#{x=>3}))),
{'EXIT',{{badmatch,_},_}} = (catch (#{x:=3} = id({a,b,c}))),
@@ -201,7 +201,7 @@ t_build_and_match_literals(Config) when is_list(Config) ->
ok.
t_build_and_match_literals_large(Config) when is_list(Config) ->
- % normal non-repeating
+ %% normal non-repeating
M0 = id(#{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
@@ -229,7 +229,7 @@ t_build_and_match_literals_large(Config) when is_list(Config) ->
60 = map_size(M0),
60 = maps:size(M0),
- % with repeating
+ %% with repeating
M1 = id(#{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
@@ -265,7 +265,7 @@ t_build_and_match_literals_large(Config) when is_list(Config) ->
60 = map_size(M1),
60 = maps:size(M1),
- % with floats
+ %% with floats
M2 = id(#{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
@@ -318,7 +318,7 @@ t_build_and_match_literals_large(Config) when is_list(Config) ->
90 = map_size(M2),
90 = maps:size(M2),
- % with bignums
+ %% with bignums
M3 = id(#{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
@@ -501,7 +501,7 @@ t_build_and_match_literals_large(Config) when is_list(Config) ->
95 = map_size(M4),
95 = maps:size(M4),
- % call for value
+ %% call for value
M5 = id(#{ 10=>id(a0),20=>b0,30=>id("c0"),"40"=>"d0",<<"50">>=>id("e0"),{["00"]}=>"10",
11=>id(a1),21=>b1,31=>id("c1"),"41"=>"d1",<<"51">>=>id("e1"),{["01"]}=>"11",
@@ -681,7 +681,7 @@ t_map_size(Config) when is_list(Config) ->
map_is_size(M,N) when map_size(M) =:= N -> true;
map_is_size(_,_) -> false.
-% test map updates without matching
+%% test map updates without matching
t_update_literals(Config) when is_list(Config) ->
Map = #{x=>1,y=>2,z=>3,q=>4},
#{x:="d",q:="4"} = loop_update_literals_x_q(Map, [
@@ -751,7 +751,7 @@ loop_update_literals_x_q(Map, []) -> Map;
loop_update_literals_x_q(Map, [{X,Q}|Vs]) ->
loop_update_literals_x_q(Map#{q=>Q,x=>X},Vs).
-% test map updates with matching
+%% test map updates with matching
t_match_and_update_literals(Config) when is_list(Config) ->
Map = #{ x=>0,y=>"untouched",z=>"also untouched",q=>1,
#{ "one" => small, map => key } => "small map key 1" },
@@ -1413,7 +1413,7 @@ t_guard_fun(Config) when is_list(Config) ->
t_map_sort_literals(Config) when is_list(Config) ->
- % test relation
+ %% test relation
%% size order
true = #{ a => 1, b => 2} < id(#{ a => 1, b => 1, c => 1}),
@@ -1983,10 +1983,10 @@ t_ets(_Config) ->
[] = ets:select(Tid,[{{'$1','_'},[{'==','$1',#{ b => c }}],['$_']}]),
%% Test match with map of different size
- %[{#{ a := b },_}] = ets:select(Tid,[{{#{ b => c },'_'},[],['$_']}]),
+ %%[{#{ a := b },_}] = ets:select(Tid,[{{#{ b => c },'_'},[],['$_']}]),
%%% Test match with don't care value
- %[{#{ a := b },_}] = ets:select(Tid,[{{#{ b => '_' },'_'},[],['$_']}]),
+ %%[{#{ a := b },_}] = ets:select(Tid,[{{#{ b => '_' },'_'},[],['$_']}]),
%% Test is_map bif
101 = length(ets:select(Tid,[{'$1',[{is_map,{element,1,'$1'}}],['$1']}])),
@@ -2138,13 +2138,13 @@ t_update_exact_variables(Config) when is_list(Config) ->
t_nested_pattern_expressions(Config) when is_list(Config) ->
K1 = id("hello"),
- %K2 = id({ok}),
+ %% K2 = id({ok}),
[_,_,#{ <<"hi">> := wat, K1 := 42 }|_] = id([k,k,#{<<"hi">> => wat, K1 => 42}]),
[_,_,#{ -1 := wat, K1 := 42 }|_] = id([k,k,#{-1 => wat, K1 => 42}]),
[_,_,{#{ -1 := #{ {-3,<<0:300>>} := V1 }, K1 := 42 },3}|_] = id([k,k,{#{-1 => #{{-3,<<0:300>>}=>"hi"}, K1 => 42},3}]),
"hi" = V1,
- %[k,#{ {-1,K1,[]} := {wat,K1}, K2 := 42 }|_] = id([k,#{{-1,K1,[]} => {wat,K1}, K2 => 42}]),
- %[k,#{ [-1,K2,[]] := {wat,K1}, K1 := 42 }|_] = id([k,#{[-1,K2,[]] => {wat,K1}, K1 => 42}]),
+ %%[k,#{ {-1,K1,[]} := {wat,K1}, K2 := 42 }|_] = id([k,#{{-1,K1,[]} => {wat,K1}, K2 => 42}]),
+ %%[k,#{ [-1,K2,[]] := {wat,K1}, K1 := 42 }|_] = id([k,#{[-1,K2,[]] => {wat,K1}, K1 => 42}]),
ok.
t_guard_update_variables(Config) when is_list(Config) ->
@@ -2335,7 +2335,7 @@ t_build_and_match_empty_val(Config) when is_list(Config) ->
{'EXIT',{function_clause,_}} -> ok;
{'EXIT', {{case_clause,_},_}} -> {comment,inlined};
Other ->
- test_server:fail({no_match, Other})
+ ct:fail({no_match, Other})
end.
t_build_and_match_val(Config) when is_list(Config) ->
@@ -2353,7 +2353,7 @@ t_build_and_match_val(Config) when is_list(Config) ->
{'EXIT',{function_clause,_}} -> ok;
{'EXIT', {{case_clause,_},_}} -> {comment,inlined};
Other ->
- test_server:fail({no_match, Other})
+ ct:fail({no_match, Other})
end.
t_build_and_match_nil(Config) when is_list(Config) ->
diff --git a/lib/debugger/test/record_SUITE.erl b/lib/debugger/test/record_SUITE.erl
index 115e65c685..0edb3786be 100644
--- a/lib/debugger/test/record_SUITE.erl
+++ b/lib/debugger/test/record_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -30,7 +30,9 @@
init_per_suite/1,end_per_suite/1,
errors/1,record_test/1,eval_once/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
cases().
@@ -50,17 +52,14 @@ cases() ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
@@ -72,19 +71,19 @@ end_per_suite(Config) when is_list(Config) ->
errors(Config) when is_list(Config) ->
Foo = #foo{a=1,b=2,c=3,d=4},
- ?line #foo{a=19,b=42,c=3,d=4} = update_foo(Foo, 19, 42),
+ #foo{a=19,b=42,c=3,d=4} = update_foo(Foo, 19, 42),
- ?line {'EXIT',{{badrecord,bar},_}} = (catch update_foo_bar(Foo, 19)),
- ?line {'EXIT',{{badrecord,bar},_}} = (catch update_foo_bar(Foo, 19, 35)),
- ?line {'EXIT',{{badrecord,bar},_}} = (catch update_foo_bar(Foo, 19, 35, 17)),
- ?line {'EXIT',{{badrecord,bar},_}} = (catch update_foo_bar(Foo, 19, 35, 17, 42)),
+ {'EXIT',{{badrecord,bar},_}} = (catch update_foo_bar(Foo, 19)),
+ {'EXIT',{{badrecord,bar},_}} = (catch update_foo_bar(Foo, 19, 35)),
+ {'EXIT',{{badrecord,bar},_}} = (catch update_foo_bar(Foo, 19, 35, 17)),
+ {'EXIT',{{badrecord,bar},_}} = (catch update_foo_bar(Foo, 19, 35, 17, 42)),
- ?line {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19)),
- ?line {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19, 35)),
- ?line {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19, 35, 17)),
- ?line {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19, 35, 17, 42)),
- ?line {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19,
- 35, 17, 42, -2)),
+ {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19)),
+ {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19, 35)),
+ {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19, 35, 17)),
+ {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19, 35, 17, 42)),
+ {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19,
+ 35, 17, 42, -2)),
ok.
@@ -119,134 +118,134 @@ update_foo_barf(#foo{}=R, A, _B, C, D, E) ->
R#barf{a=A,b=A,c=C,d=D,e=E}.
--define(TrueGuard(Expr), if Expr -> ok; true -> ?t:fail() end).
--define(FalseGuard(Expr), if Expr -> ?t:fail(); true -> ok end).
+-define(TrueGuard(Expr), if Expr -> ok; true -> ct:fail(failed) end).
+-define(FalseGuard(Expr), if Expr -> ct:fail(failed); true -> ok end).
record_test(Config) when is_list(Config) ->
- ?line true = is_record(#foo{}, foo),
- ?line false = is_record(#foo{}, barf),
- ?line false = is_record({foo}, foo),
+ true = is_record(#foo{}, foo),
+ false = is_record(#foo{}, barf),
+ false = is_record({foo}, foo),
- ?line true = erlang:is_record(#foo{}, foo),
- ?line false = erlang:is_record(#foo{}, barf),
- ?line false = erlang:is_record({foo}, foo),
+ true = erlang:is_record(#foo{}, foo),
+ false = erlang:is_record(#foo{}, barf),
+ false = erlang:is_record({foo}, foo),
- ?line false = is_record([], foo),
- ?line false = is_record(Config, foo),
+ false = is_record([], foo),
+ false = is_record(Config, foo),
- ?line ?TrueGuard(is_record(#foo{}, foo)),
- ?line ?FalseGuard(is_record(#foo{}, barf)),
- ?line ?FalseGuard(is_record({foo}, foo)),
+ ?TrueGuard(is_record(#foo{}, foo)),
+ ?FalseGuard(is_record(#foo{}, barf)),
+ ?FalseGuard(is_record({foo}, foo)),
- ?line ?TrueGuard(erlang:is_record(#foo{}, foo)),
- ?line ?FalseGuard(erlang:is_record(#foo{}, barf)),
- ?line ?FalseGuard(erlang:is_record({foo}, foo)),
+ ?TrueGuard(erlang:is_record(#foo{}, foo)),
+ ?FalseGuard(erlang:is_record(#foo{}, barf)),
+ ?FalseGuard(erlang:is_record({foo}, foo)),
- ?line ?FalseGuard(is_record([], foo)),
- ?line ?FalseGuard(is_record(Config, foo)),
+ ?FalseGuard(is_record([], foo)),
+ ?FalseGuard(is_record(Config, foo)),
%% 'not is_record/2' to test guard optimization.
- ?line ?FalseGuard(not is_record(#foo{}, foo)),
- ?line ?TrueGuard(not is_record(#foo{}, barf)),
- ?line ?TrueGuard(not is_record({foo}, foo)),
+ ?FalseGuard(not is_record(#foo{}, foo)),
+ ?TrueGuard(not is_record(#foo{}, barf)),
+ ?TrueGuard(not is_record({foo}, foo)),
- ?line ?FalseGuard(not erlang:is_record(#foo{}, foo)),
- ?line ?TrueGuard(not erlang:is_record(#foo{}, barf)),
- ?line ?TrueGuard(not erlang:is_record({foo}, foo)),
+ ?FalseGuard(not erlang:is_record(#foo{}, foo)),
+ ?TrueGuard(not erlang:is_record(#foo{}, barf)),
+ ?TrueGuard(not erlang:is_record({foo}, foo)),
Foo = id(#foo{}),
- ?line ?FalseGuard(not erlang:is_record(Foo, foo)),
- ?line ?TrueGuard(not erlang:is_record(Foo, barf)),
+ ?FalseGuard(not erlang:is_record(Foo, foo)),
+ ?TrueGuard(not erlang:is_record(Foo, barf)),
- ?line ?TrueGuard(not is_record(Config, foo)),
+ ?TrueGuard(not is_record(Config, foo)),
- ?line ?TrueGuard(not is_record(a, foo)),
- ?line ?TrueGuard(not is_record([], foo)),
+ ?TrueGuard(not is_record(a, foo)),
+ ?TrueGuard(not is_record([], foo)),
%% Pass non-literal first argument.
- ?line true = is_record(id(#foo{}), foo),
- ?line false = is_record(id(#foo{}), barf),
- ?line false = is_record(id({foo}), foo),
+ true = is_record(id(#foo{}), foo),
+ false = is_record(id(#foo{}), barf),
+ false = is_record(id({foo}), foo),
- ?line true = erlang:is_record(id(#foo{}), foo),
- ?line false = erlang:is_record(id(#foo{}), barf),
- ?line false = erlang:is_record(id({foo}), foo),
+ true = erlang:is_record(id(#foo{}), foo),
+ false = erlang:is_record(id(#foo{}), barf),
+ false = erlang:is_record(id({foo}), foo),
NoRec1 = id(blurf),
NoRec2 = id([]),
- ?line ?TrueGuard(not is_record(NoRec1, foo)),
- ?line ?TrueGuard(not is_record(NoRec2, foo)),
+ ?TrueGuard(not is_record(NoRec1, foo)),
+ ?TrueGuard(not is_record(NoRec2, foo)),
%% Force the use of guard bifs by using the 'xor' operation.
False = id(false),
- ?line ?TrueGuard(is_record(#foo{}, foo) xor False),
- ?line ?FalseGuard(is_record(#foo{}, barf) xor False),
- ?line ?FalseGuard(is_record({foo}, foo) xor False ),
+ ?TrueGuard(is_record(#foo{}, foo) xor False),
+ ?FalseGuard(is_record(#foo{}, barf) xor False),
+ ?FalseGuard(is_record({foo}, foo) xor False ),
- ?line ?TrueGuard(is_record(Foo, foo) xor False),
- ?line ?FalseGuard(is_record(Foo, barf) xor False),
+ ?TrueGuard(is_record(Foo, foo) xor False),
+ ?FalseGuard(is_record(Foo, barf) xor False),
%% Implicit guards by using a list comprehension.
List = id([1,#foo{a=2},3,#bar{d=4},5,#foo{a=6},7]),
- ?line [#foo{a=2},#foo{a=6}] = [X || X <- List, is_record(X, foo)],
- ?line [#bar{d=4}] = [X || X <- List, is_record(X, bar)],
- ?line [1,#foo{a=2},3,5,#foo{a=6},7] =
+ [#foo{a=2},#foo{a=6}] = [X || X <- List, is_record(X, foo)],
+ [#bar{d=4}] = [X || X <- List, is_record(X, bar)],
+ [1,#foo{a=2},3,5,#foo{a=6},7] =
[X || X <- List, not is_record(X, bar)],
- ?line [1,3,5,7] =
+ [1,3,5,7] =
[X || X <- List, ((not is_record(X, bar)) and (not is_record(X, foo)))],
- ?line [#foo{a=2},#bar{d=4},#foo{a=6}] =
+ [#foo{a=2},#bar{d=4},#foo{a=6}] =
[X || X <- List, ((is_record(X, bar)) or (is_record(X, foo)))],
- ?line [1,3,#bar{d=4}] =
+ [1,3,#bar{d=4}] =
[X || X <- List, ((is_record(X, bar)) or (X < 5))],
- ?line MyList = [#foo{a=3},x,[],{a,b}],
- ?line [#foo{a=3}] = [X || X <- MyList, is_record(X, foo)],
- ?line [x,[],{a,b}] = [X || X <- MyList, not is_record(X, foo)],
- ?line [#foo{a=3}] = [X || X <- MyList, begin is_record(X, foo) end],
- ?line [x,[],{a,b}] = [X || X <- MyList, begin not is_record(X, foo) end],
- ?line [#foo{a=3},x,[],{a,b}] = [X || X <- MyList, is_record(X, foo) or
- not is_binary(X)],
- ?line [#foo{a=3},x,[],{a,b}] = [X || X <- MyList, not is_record(X, foo) or
- not is_binary(X)],
- ?line [#foo{a=3}] = [X || X <- MyList, is_record(X, foo) or is_reference(X)],
- ?line [x,[],{a,b}] = [X || X <- MyList, not is_record(X, foo) or
- is_reference(X)],
- ?line [#foo{a=3},x,[],{a,b}] = [X || X <- MyList,
- begin is_record(X, foo) or
- not is_binary(X) end],
- ?line [#foo{a=3},x,[],{a,b}] = [X || X <- MyList,
- begin not is_record(X, foo) or
- not is_binary(X) end],
- ?line [#foo{a=3}] = [X || X <- MyList,
- begin is_record(X, foo) or is_reference(X) end],
- ?line [x,[],{a,b}] = [X || X <- MyList,
- begin not is_record(X, foo) or
- is_reference(X) end],
+ MyList = [#foo{a=3},x,[],{a,b}],
+ [#foo{a=3}] = [X || X <- MyList, is_record(X, foo)],
+ [x,[],{a,b}] = [X || X <- MyList, not is_record(X, foo)],
+ [#foo{a=3}] = [X || X <- MyList, begin is_record(X, foo) end],
+ [x,[],{a,b}] = [X || X <- MyList, begin not is_record(X, foo) end],
+ [#foo{a=3},x,[],{a,b}] = [X || X <- MyList, is_record(X, foo) or
+ not is_binary(X)],
+ [#foo{a=3},x,[],{a,b}] = [X || X <- MyList, not is_record(X, foo) or
+ not is_binary(X)],
+ [#foo{a=3}] = [X || X <- MyList, is_record(X, foo) or is_reference(X)],
+ [x,[],{a,b}] = [X || X <- MyList, not is_record(X, foo) or
+ is_reference(X)],
+ [#foo{a=3},x,[],{a,b}] = [X || X <- MyList,
+ begin is_record(X, foo) or
+ not is_binary(X) end],
+ [#foo{a=3},x,[],{a,b}] = [X || X <- MyList,
+ begin not is_record(X, foo) or
+ not is_binary(X) end],
+ [#foo{a=3}] = [X || X <- MyList,
+ begin is_record(X, foo) or is_reference(X) end],
+ [x,[],{a,b}] = [X || X <- MyList,
+ begin not is_record(X, foo) or
+ is_reference(X) end],
ok.
eval_once(Config) when is_list(Config) ->
- ?line once(fun(GetRec) ->
- true = erlang:is_record(GetRec(), foo)
- end, #foo{}),
- ?line once(fun(GetRec) ->
- (GetRec())#foo{a=1}
- end, #foo{}),
- ?line once(fun(GetRec) ->
- (GetRec())#foo{a=1,b=2}
- end, #foo{}),
- ?line once(fun(GetRec) ->
- (GetRec())#foo{a=1,b=2,c=3}
- end, #foo{}),
- ?line once(fun(GetRec) ->
- (GetRec())#foo{a=1,b=2,c=3,d=4}
- end, #foo{}),
+ once(fun(GetRec) ->
+ true = erlang:is_record(GetRec(), foo)
+ end, #foo{}),
+ once(fun(GetRec) ->
+ (GetRec())#foo{a=1}
+ end, #foo{}),
+ once(fun(GetRec) ->
+ (GetRec())#foo{a=1,b=2}
+ end, #foo{}),
+ once(fun(GetRec) ->
+ (GetRec())#foo{a=1,b=2,c=3}
+ end, #foo{}),
+ once(fun(GetRec) ->
+ (GetRec())#foo{a=1,b=2,c=3,d=4}
+ end, #foo{}),
ok.
once(Test, Record) ->
@@ -260,7 +259,7 @@ once(Test, Record) ->
1 -> ok;
N ->
io:format("Evaluated ~w times\n", [N]),
- ?t:fail()
+ ct:fail(failed)
end,
Result.
diff --git a/lib/debugger/test/test_lib.erl b/lib/debugger/test/test_lib.erl
index 2d3e772fc8..b9ac486694 100644
--- a/lib/debugger/test/test_lib.erl
+++ b/lib/debugger/test/test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/trycatch_SUITE.erl b/lib/debugger/test/trycatch_SUITE.erl
index 0303d1bd82..2857cac9a3 100644
--- a/lib/debugger/test/trycatch_SUITE.erl
+++ b/lib/debugger/test/trycatch_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -30,7 +30,9 @@
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
cases().
@@ -52,49 +54,46 @@ cases() ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
ok.
basic(Conf) when is_list(Conf) ->
- ?line 2 =
+ 2 =
try my_div(4, 2)
catch
Class:Reason -> {Class,Reason}
end,
- ?line error =
+ error =
try my_div(1, 0)
catch
error:badarith -> error
end,
- ?line error =
+ error =
try 1/0
catch
error:badarith -> error
end,
- ?line ok =
+ ok =
try my_add(53, atom)
catch
error:badarith -> ok
end,
- ?line exit_nisse =
+ exit_nisse =
try exit(nisse)
catch
exit:nisse -> exit_nisse
end,
- ?line ok =
+ ok =
try throw(kalle)
catch
kalle -> ok
@@ -103,26 +102,26 @@ basic(Conf) when is_list(Conf) ->
%% Try some stuff where the compiler will optimize away the try.
V = id({a,variable}),
- ?line V = try V catch nisse -> error end,
- ?line 42 = try 42 catch nisse -> error end,
- ?line [V] = try [V] catch nisse -> error end,
- ?line {ok,V} = try {ok,V} catch nisse -> error end,
+ V = try V catch nisse -> error end,
+ 42 = try 42 catch nisse -> error end,
+ [V] = try [V] catch nisse -> error end,
+ {ok,V} = try {ok,V} catch nisse -> error end,
%% Same idea, but use an after too.
- ?line V = try V catch nisse -> error after after_call() end,
- ?line after_clean(),
- ?line 42 = try 42 after after_call() end,
- ?line after_clean(),
- ?line [V] = try [V] catch nisse -> error after after_call() end,
- ?line after_clean(),
- ?line {ok,V} = try {ok,V} after after_call() end,
+ V = try V catch nisse -> error after after_call() end,
+ after_clean(),
+ 42 = try 42 after after_call() end,
+ after_clean(),
+ [V] = try [V] catch nisse -> error after after_call() end,
+ after_clean(),
+ {ok,V} = try {ok,V} after after_call() end,
%% Try/of
- ?line ok = try V of
- {a,variable} -> ok
- catch nisse -> erro
- end,
+ ok = try V of
+ {a,variable} -> ok
+ catch nisse -> erro
+ end,
ok.
@@ -133,24 +132,24 @@ after_clean() ->
after_was_called = erase(basic).
lean_throw(Conf) when is_list(Conf) ->
- ?line {throw,kalle} =
+ {throw,kalle} =
try throw(kalle)
catch
Kalle -> {throw,Kalle}
end,
- ?line {exit,kalle} =
+ {exit,kalle} =
try exit(kalle)
catch
Throw1 -> {throw,Throw1};
exit:Reason1 -> {exit,Reason1}
end,
- ?line {exit,kalle} =
+ {exit,kalle} =
try exit(kalle)
catch
exit:Reason2 -> {exit,Reason2};
Throw2 -> {throw,Throw2}
end,
- ?line {exit,kalle} =
+ {exit,kalle} =
try try exit(kalle)
catch
Throw3 -> {throw,Throw3}
@@ -161,25 +160,25 @@ lean_throw(Conf) when is_list(Conf) ->
ok.
try_of(Conf) when is_list(Conf) ->
- ?line {ok,{some,content}} =
+ {ok,{some,content}} =
try_of_1({value,{good,{some,content}}}),
- ?line {error,[other,content]} =
+ {error,[other,content]} =
try_of_1({value,{bad,[other,content]}}),
- ?line {caught,{exit,{ex,it,[reason]}}} =
+ {caught,{exit,{ex,it,[reason]}}} =
try_of_1({exit,{ex,it,[reason]}}),
- ?line {caught,{throw,[term,{in,a,{tuple}}]}} =
+ {caught,{throw,[term,{in,a,{tuple}}]}} =
try_of_1({throw,[term,{in,a,{tuple}}]}),
- ?line {caught,{error,[bad,arg]}} =
+ {caught,{error,[bad,arg]}} =
try_of_1({error,[bad,arg]}),
- ?line {caught,{error,badarith}} =
+ {caught,{error,badarith}} =
try_of_1({'div',{1,0}}),
- ?line {caught,{error,badarith}} =
+ {caught,{error,badarith}} =
try_of_1({'add',{a,0}}),
- ?line {caught,{error,badarg}} =
+ {caught,{error,badarg}} =
try_of_1({'abs',x}),
- ?line {caught,{error,function_clause}} =
+ {caught,{error,function_clause}} =
try_of_1(illegal),
- ?line {error,{try_clause,{some,other_garbage}}} =
+ {error,{try_clause,{some,other_garbage}}} =
try try_of_1({value,{some,other_garbage}})
catch error:Reason -> {error,Reason}
end,
@@ -191,33 +190,33 @@ try_of_1(X) ->
{bad,Y} -> {error,Y}
catch
Class:Reason ->
- {caught,{Class,Reason}}
+ {caught,{Class,Reason}}
end.
try_after(Conf) when is_list(Conf) ->
- ?line {{ok,[some,value],undefined},finalized} =
+ {{ok,[some,value],undefined},finalized} =
try_after_1({value,{ok,[some,value]}},finalized),
- ?line {{error,badarith,undefined},finalized} =
+ {{error,badarith,undefined},finalized} =
try_after_1({'div',{1,0}},finalized),
- ?line {{error,badarith,undefined},finalized} =
+ {{error,badarith,undefined},finalized} =
try_after_1({'add',{1,a}},finalized),
- ?line {{error,badarg,undefined},finalized} =
+ {{error,badarg,undefined},finalized} =
try_after_1({'abs',a},finalized),
- ?line {{error,[the,{reason}],undefined},finalized} =
+ {{error,[the,{reason}],undefined},finalized} =
try_after_1({error,[the,{reason}]},finalized),
- ?line {{throw,{thrown,[reason]},undefined},finalized} =
+ {{throw,{thrown,[reason]},undefined},finalized} =
try_after_1({throw,{thrown,[reason]}},finalized),
- ?line {{exit,{exited,{reason}},undefined},finalized} =
+ {{exit,{exited,{reason}},undefined},finalized} =
try_after_1({exit,{exited,{reason}}},finalized),
- ?line {{error,function_clause,undefined},finalized} =
+ {{error,function_clause,undefined},finalized} =
try_after_1(function_clause,finalized),
- ?line ok =
+ ok =
try try_after_1({'add',{1,1}}, finalized)
catch
error:{try_clause,2} -> ok
end,
- ?line finalized = erase(try_after),
- ?line ok =
+ finalized = erase(try_after),
+ ok =
try try foo({exit,[reaso,{n}]})
after put(try_after, finalized)
end
@@ -244,7 +243,7 @@ try_after_1(X, Y) ->
after_bind(Conf) when is_list(Conf) ->
V = [make_ref(),self()|value],
- ?line {value,{value,V}} =
+ {value,{value,V}} =
after_bind_1({value,V}, V, {value,V}),
ok.
@@ -268,35 +267,35 @@ after_bind_1(X, V, Y) ->
-endif.
catch_oops(Conf) when is_list(Conf) ->
- V = {v,[a,l|u],{e},self()},
- ?line {value,V} = catch_oops_1({value,V}),
- ?line {value,1} = catch_oops_1({'div',{1,1}}),
- ?line {error,badarith} = catch_oops_1({'div',{1,0}}),
- ?line {error,function_clause} = catch_oops_1(function_clause),
- ?line {throw,V} = catch_oops_1({throw,V}),
- ?line {exit,V} = catch_oops_1({exit,V}),
- ok.
+ V = {v,[a,l|u],{e},self()},
+ {value,V} = catch_oops_1({value,V}),
+ {value,1} = catch_oops_1({'div',{1,1}}),
+ {error,badarith} = catch_oops_1({'div',{1,0}}),
+ {error,function_clause} = catch_oops_1(function_clause),
+ {throw,V} = catch_oops_1({throw,V}),
+ {exit,V} = catch_oops_1({exit,V}),
+ ok.
catch_oops_1(X) ->
- Ref = make_ref(),
- try try foo({error,Ref})
- catch
- error:Ref ->
- foo(X)
- end of
- Value -> {value,Value}
- catch
- Class:Data -> {Class,Data}
- end.
+ Ref = make_ref(),
+ try try foo({error,Ref})
+ catch
+ error:Ref ->
+ foo(X)
+ end of
+ Value -> {value,Value}
+ catch
+ Class:Data -> {Class,Data}
+ end.
after_oops(Conf) when is_list(Conf) ->
V = {self(),make_ref()},
- ?line {{value,V},V} = after_oops_1({value,V}, {value,V}),
- ?line {{exit,V},V} = after_oops_1({exit,V}, {value,V}),
- ?line {{error,V},undefined} = after_oops_1({value,V}, {error,V}),
- ?line {{error,function_clause},undefined} =
+ {{value,V},V} = after_oops_1({value,V}, {value,V}),
+ {{exit,V},V} = after_oops_1({exit,V}, {value,V}),
+ {{error,V},undefined} = after_oops_1({value,V}, {error,V}),
+ {{error,function_clause},undefined} =
after_oops_1({exit,V}, function_clause),
ok.
@@ -317,37 +316,37 @@ after_oops_1(X, Y) ->
eclectic(Conf) when is_list(Conf) ->
V = {make_ref(),3.1415926535,[[]|{}]},
- ?line {{value,{value,V},V},V} =
+ {{value,{value,V},V},V} =
eclectic_1({foo,{value,{value,V}}}, undefined, {value,V}),
- ?line {{'EXIT',{V,[{?MODULE,foo,_,_}|_]}},V} =
+ {{'EXIT',{V,[{?MODULE,foo,_,_}|_]}},V} =
eclectic_1({catch_foo,{error,V}}, undefined, {value,V}),
- ?line {{error,{exit,V},{'EXIT',V}},V} =
+ {{error,{exit,V},{'EXIT',V}},V} =
eclectic_1({foo,{error,{exit,V}}}, error, {value,V}),
- ?line {{value,{value,V},V},{'EXIT',{badarith,[{?MODULE,my_add,_,_}|_]}}} =
+ {{value,{value,V},V},{'EXIT',{badarith,[{?MODULE,my_add,_,_}|_]}}} =
eclectic_1({foo,{value,{value,V}}}, undefined, {'add',{0,a}}),
- ?line {{'EXIT',V},V} =
+ {{'EXIT',V},V} =
eclectic_1({catch_foo,{exit,V}}, undefined, {throw,V}),
- ?line {{error,{'div',{1,0}},{'EXIT',{badarith,[{?MODULE,my_div,_,_}|_]}}},
- {'EXIT',V}} =
+ {{error,{'div',{1,0}},{'EXIT',{badarith,[{?MODULE,my_div,_,_}|_]}}},
+ {'EXIT',V}} =
eclectic_1({foo,{error,{'div',{1,0}}}}, error, {exit,V}),
- ?line {{{error,V},{'EXIT',{V,[{?MODULE,foo,_,_}|_]}}},{'EXIT',V}} =
+ {{{error,V},{'EXIT',{V,[{?MODULE,foo,_,_}|_]}}},{'EXIT',V}} =
eclectic_1({catch_foo,{throw,{error,V}}}, undefined, {exit,V}),
%%
- ?line {{value,{value,{value,V},V}},V} =
+ {{value,{value,{value,V},V}},V} =
eclectic_2({value,{value,V}}, undefined, {value,V}),
- ?line {{value,{throw,{value,V},V}},V} =
+ {{value,{throw,{value,V},V}},V} =
eclectic_2({throw,{value,V}}, throw, {value,V}),
- ?line {{caught,{'EXIT',V}},undefined} =
+ {{caught,{'EXIT',V}},undefined} =
eclectic_2({value,{value,V}}, undefined, {exit,V}),
- ?line {{caught,{'EXIT',{V,[{?MODULE,foo,_,_}|_]}}},undefined} =
+ {{caught,{'EXIT',{V,[{?MODULE,foo,_,_}|_]}}},undefined} =
eclectic_2({error,{value,V}}, throw, {error,V}),
- ?line {{caught,{'EXIT',{badarg,[{erlang,abs,[V],_}|_]}}},V} =
+ {{caught,{'EXIT',{badarg,[{erlang,abs,[V],_}|_]}}},V} =
eclectic_2({value,{'abs',V}}, undefined, {value,V}),
- ?line {{caught,{'EXIT',{badarith,[{?MODULE,my_add,_,_}|_]}}},V} =
+ {{caught,{'EXIT',{badarith,[{?MODULE,my_add,_,_}|_]}}},V} =
eclectic_2({exit,{'add',{0,a}}}, exit, {value,V}),
- ?line {{caught,{'EXIT',V}},undefined} =
+ {{caught,{'EXIT',V}},undefined} =
eclectic_2({value,{error,V}}, undefined, {exit,V}),
- ?line {{caught,{'EXIT',{V,[{?MODULE,foo,_,_}|_]}}},undefined} =
+ {{caught,{'EXIT',{V,[{?MODULE,foo,_,_}|_]}}},undefined} =
eclectic_2({throw,{'div',{1,0}}}, throw, {error,V}),
ok.
@@ -375,42 +374,42 @@ eclectic_2(X, C, Y) ->
Catch =
case
catch
- {Done,
- try foo(X) of
- V -> {value,V,foo(V)}
- catch
- C:D -> {C,D,foo(D)}
- after
- put(eclectic, foo(Y))
- end} of
- {Done,Z} -> {value,Z};
- Z -> {caught,Z}
- end,
+ {Done,
+ try foo(X) of
+ V -> {value,V,foo(V)}
+ catch
+ C:D -> {C,D,foo(D)}
+ after
+ put(eclectic, foo(Y))
+ end} of
+ {Done,Z} -> {value,Z};
+ Z -> {caught,Z}
+ end,
{Catch,erase(eclectic)}.
rethrow(Conf) when is_list(Conf) ->
V = {a,[b,{c,self()},make_ref]},
- ?line {value2,value1} =
+ {value2,value1} =
rethrow_1({value,V}, V),
- ?line {caught2,{error,V}} =
+ {caught2,{error,V}} =
rethrow_2({error,V}, undefined),
- ?line {caught2,{exit,V}} =
+ {caught2,{exit,V}} =
rethrow_1({exit,V}, error),
- ?line {caught2,{throw,V}} =
+ {caught2,{throw,V}} =
rethrow_1({throw,V}, undefined),
- ?line {caught2,{throw,V}} =
+ {caught2,{throw,V}} =
rethrow_2({throw,V}, undefined),
- ?line {caught2,{error,badarith}} =
+ {caught2,{error,badarith}} =
rethrow_1({'add',{0,a}}, throw),
- ?line {caught2,{error,function_clause}} =
+ {caught2,{error,function_clause}} =
rethrow_2(function_clause, undefined),
- ?line {caught2,{error,{try_clause,V}}} =
+ {caught2,{error,{try_clause,V}}} =
rethrow_1({value,V}, exit),
- ?line {value2,{caught1,V}} =
+ {value2,{caught1,V}} =
rethrow_1({error,V}, error),
- ?line {value2,{caught1,V}} =
+ {value2,{caught1,V}} =
rethrow_1({exit,V}, exit),
- ?line {value2,caught1} =
+ {value2,caught1} =
rethrow_2({throw,V}, V),
ok.
@@ -440,91 +439,91 @@ rethrow_2(X, C1) ->
nested_of(Conf) when is_list(Conf) ->
V = {[self()|make_ref()],1.4142136},
- ?line {{value,{value1,{V,x2}}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{value,{value1,{V,x2}}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_of_1({{value,{V,x1}},void,{V,x1}},
{value,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{throw,{V,x2}}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{caught,{throw,{V,x2}}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_of_1({{value,{V,x1}},void,{V,x1}},
{throw,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{error,badarith}},
- undefined,
- {V,x4},
- finalized} =
+ {{caught,{error,badarith}},
+ undefined,
+ {V,x4},
+ finalized} =
nested_of_1({{value,{V,x1}},void,{V,x1}},
{throw,{V,x2}}, {'div',{1,0}}, {value,{V,x4}}),
- ?line {{caught,{error,badarith}},
- undefined,
- undefined,
- finalized} =
+ {{caught,{error,badarith}},
+ undefined,
+ undefined,
+ finalized} =
nested_of_1({{value,{V,x1}},void,{V,x1}},
{throw,{V,x2}}, {'div',{1,0}}, {'add',{0,b}}),
%%
- ?line {{caught,{error,{try_clause,{V,x1}}}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{caught,{error,{try_clause,{V,x1}}}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_of_1({{value,{V,x1}},void,try_clause},
void, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{exit,{V,x3}}},
- undefined,
- {V,x4},
- finalized} =
+ {{caught,{exit,{V,x3}}},
+ undefined,
+ {V,x4},
+ finalized} =
nested_of_1({{value,{V,x1}},void,try_clause},
void, {exit,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{throw,{V,x4}}},
- undefined,
- undefined,
- finalized} =
+ {{caught,{throw,{V,x4}}},
+ undefined,
+ undefined,
+ finalized} =
nested_of_1({{value,{V,x1}},void,try_clause},
void, {exit,{V,x3}}, {throw,{V,x4}}),
%%
- ?line {{value,{caught1,{V,x2}}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{value,{caught1,{V,x2}}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_of_1({{error,{V,x1}},error,{V,x1}},
{value,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{error,badarith}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{caught,{error,badarith}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_of_1({{error,{V,x1}},error,{V,x1}},
{'add',{1,c}}, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{error,badarith}},
- undefined,
- {V,x4},
- finalized} =
+ {{caught,{error,badarith}},
+ undefined,
+ {V,x4},
+ finalized} =
nested_of_1({{error,{V,x1}},error,{V,x1}},
{'add',{1,c}}, {'div',{17,0}}, {value,{V,x4}}),
- ?line {{caught,{error,badarg}},
- undefined,
- undefined,
- finalized} =
+ {{caught,{error,badarg}},
+ undefined,
+ undefined,
+ finalized} =
nested_of_1({{error,{V,x1}},error,{V,x1}},
{'add',{1,c}}, {'div',{17,0}}, {'abs',V}),
%%
- ?line {{caught,{error,badarith}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{caught,{error,badarith}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_of_1({{'add',{2,c}},rethrow,void},
void, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{error,badarg}},
- undefined,
- {V,x4},
- finalized} =
+ {{caught,{error,badarg}},
+ undefined,
+ {V,x4},
+ finalized} =
nested_of_1({{'add',{2,c}},rethrow,void},
void, {'abs',V}, {value,{V,x4}}),
- ?line {{caught,{error,function_clause}},
- undefined,
- undefined,
- finalized} =
+ {{caught,{error,function_clause}},
+ undefined,
+ undefined,
+ finalized} =
nested_of_1({{'add',{2,c}},rethrow,void},
void, {'abs',V}, function_clause),
ok.
@@ -565,97 +564,97 @@ nested_of_1({X1,C1,V1},
nested_catch(Conf) when is_list(Conf) ->
V = {[make_ref(),1.4142136,self()]},
- ?line {{value,{value1,{V,x2}}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{value,{value1,{V,x2}}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_catch_1({{value,{V,x1}},void,{V,x1}},
- {value,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{throw,{V,x2}}},
- {V,x3},
- {V,x4},
- finalized} =
+ {value,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
+ {{caught,{throw,{V,x2}}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_catch_1({{value,{V,x1}},void,{V,x1}},
- {throw,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{error,badarith}},
- undefined,
- {V,x4},
- finalized} =
+ {throw,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
+ {{caught,{error,badarith}},
+ undefined,
+ {V,x4},
+ finalized} =
nested_catch_1({{value,{V,x1}},void,{V,x1}},
- {throw,{V,x2}}, {'div',{1,0}}, {value,{V,x4}}),
- ?line {{caught,{error,badarith}},
- undefined,
- undefined,
- finalized} =
+ {throw,{V,x2}}, {'div',{1,0}}, {value,{V,x4}}),
+ {{caught,{error,badarith}},
+ undefined,
+ undefined,
+ finalized} =
nested_catch_1({{value,{V,x1}},void,{V,x1}},
- {throw,{V,x2}}, {'div',{1,0}}, {'add',{0,b}}),
+ {throw,{V,x2}}, {'div',{1,0}}, {'add',{0,b}}),
%%
- ?line {{caught,{error,{try_clause,{V,x1}}}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{caught,{error,{try_clause,{V,x1}}}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_catch_1({{value,{V,x1}},void,try_clause},
- void, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{exit,{V,x3}}},
- undefined,
- {V,x4},
- finalized} =
+ void, {value,{V,x3}}, {value,{V,x4}}),
+ {{caught,{exit,{V,x3}}},
+ undefined,
+ {V,x4},
+ finalized} =
nested_catch_1({{value,{V,x1}},void,try_clause},
- void, {exit,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{throw,{V,x4}}},
- undefined,
- undefined,
- finalized} =
+ void, {exit,{V,x3}}, {value,{V,x4}}),
+ {{caught,{throw,{V,x4}}},
+ undefined,
+ undefined,
+ finalized} =
nested_catch_1({{value,{V,x1}},void,try_clause},
- void, {exit,{V,x3}}, {throw,{V,x4}}),
+ void, {exit,{V,x3}}, {throw,{V,x4}}),
%%
- ?line {{value,{caught1,{V,x2}}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{value,{caught1,{V,x2}}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_catch_1({{error,{V,x1}},error,{V,x1}},
- {value,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{error,badarith}},
- {V,x3},
- {V,x4},
- finalized} =
+ {value,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
+ {{caught,{error,badarith}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_catch_1({{error,{V,x1}},error,{V,x1}},
- {'add',{1,c}}, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{error,badarith}},
- undefined,
- {V,x4},
- finalized} =
+ {'add',{1,c}}, {value,{V,x3}}, {value,{V,x4}}),
+ {{caught,{error,badarith}},
+ undefined,
+ {V,x4},
+ finalized} =
nested_catch_1({{error,{V,x1}},error,{V,x1}},
- {'add',{1,c}}, {'div',{17,0}}, {value,{V,x4}}),
- ?line {{caught,{error,badarg}},
- undefined,
- undefined,
- finalized} =
+ {'add',{1,c}}, {'div',{17,0}}, {value,{V,x4}}),
+ {{caught,{error,badarg}},
+ undefined,
+ undefined,
+ finalized} =
nested_catch_1({{error,{V,x1}},error,{V,x1}},
- {'add',{1,c}}, {'div',{17,0}}, {'abs',V}),
+ {'add',{1,c}}, {'div',{17,0}}, {'abs',V}),
%%
- ?line {{caught,{error,badarith}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{caught,{error,badarith}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_catch_1({{'add',{2,c}},rethrow,void},
- void, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{error,badarg}},
- undefined,
- {V,x4},
- finalized} =
+ void, {value,{V,x3}}, {value,{V,x4}}),
+ {{caught,{error,badarg}},
+ undefined,
+ {V,x4},
+ finalized} =
nested_catch_1({{'add',{2,c}},rethrow,void},
- void, {'abs',V}, {value,{V,x4}}),
- ?line {{caught,{error,function_clause}},
- undefined,
- undefined,
- finalized} =
+ void, {'abs',V}, {value,{V,x4}}),
+ {{caught,{error,function_clause}},
+ undefined,
+ undefined,
+ finalized} =
nested_catch_1({{'add',{2,c}},rethrow,void},
- void, {'abs',V}, function_clause),
+ void, {'abs',V}, function_clause),
ok.
nested_catch_1({X1,C1,V1},
- X2, X3, X4) ->
+ X2, X3, X4) ->
erase(nested3),
erase(nested4),
erase(nested),
@@ -688,73 +687,73 @@ nested_catch_1({X1,C1,V1},
nested_after(Conf) when is_list(Conf) ->
V = [{make_ref(),1.4142136,self()}],
- ?line {value,
- {V,x3},
- {value1,{V,x2}},
- finalized} =
+ {value,
+ {V,x3},
+ {value1,{V,x2}},
+ finalized} =
nested_after_1({{value,{V,x1}},void,{V,x1}},
{value,{V,x2}}, {value,{V,x3}}),
- ?line {{caught,{error,{V,x2}}},
- {V,x3},
- undefined,
- finalized} =
+ {{caught,{error,{V,x2}}},
+ {V,x3},
+ undefined,
+ finalized} =
nested_after_1({{value,{V,x1}},void,{V,x1}},
{error,{V,x2}}, {value,{V,x3}}),
- ?line {{caught,{exit,{V,x3}}},
- undefined,
- undefined,
- finalized} =
+ {{caught,{exit,{V,x3}}},
+ undefined,
+ undefined,
+ finalized} =
nested_after_1({{value,{V,x1}},void,{V,x1}},
{error,{V,x2}}, {exit,{V,x3}}),
%%
- ?line {{caught,{error,{try_clause,{V,x1}}}},
- {V,x3},
- undefined,
- finalized} =
+ {{caught,{error,{try_clause,{V,x1}}}},
+ {V,x3},
+ undefined,
+ finalized} =
nested_after_1({{value,{V,x1}},void,try_clause},
void, {value,{V,x3}}),
- ?line {{caught,{error,badarith}},
- undefined,
- undefined,
- finalized} =
+ {{caught,{error,badarith}},
+ undefined,
+ undefined,
+ finalized} =
nested_after_1({{value,{V,x1}},void,try_clause},
void, {'div',{17,0}}),
%%
- ?line {value,
- {V,x3},
- {caught1,{V,x2}},
- finalized} =
+ {value,
+ {V,x3},
+ {caught1,{V,x2}},
+ finalized} =
nested_after_1({{throw,{V,x1}},throw,{V,x1}},
{value,{V,x2}}, {value,{V,x3}}),
- ?line {{caught,{error,badarith}},
- {V,x3},
- undefined,
- finalized} =
+ {{caught,{error,badarith}},
+ {V,x3},
+ undefined,
+ finalized} =
nested_after_1({{throw,{V,x1}},throw,{V,x1}},
{'add',{a,b}}, {value,{V,x3}}),
- ?line {{caught,{error,badarg}},
- undefined,
- undefined,
- finalized} =
+ {{caught,{error,badarg}},
+ undefined,
+ undefined,
+ finalized} =
nested_after_1({{throw,{V,x1}},throw,{V,x1}},
{'add',{a,b}}, {'abs',V}),
%%
- ?line {{caught,{throw,{V,x1}}},
- {V,x3},
- undefined,
- finalized} =
+ {{caught,{throw,{V,x1}}},
+ {V,x3},
+ undefined,
+ finalized} =
nested_after_1({{throw,{V,x1}},rethrow,void},
void, {value,{V,x3}}),
- ?line {{caught,{error,badarith}},
- undefined,
- undefined,
- finalized} =
+ {{caught,{error,badarith}},
+ undefined,
+ undefined,
+ finalized} =
nested_after_1({{throw,{V,x1}},rethrow,void},
void, {'div',{1,0}}),
ok.
nested_after_1({X1,C1,V1},
- X2, X3) ->
+ X2, X3) ->
erase(nested3),
erase(nested4),
erase(nested),
diff --git a/lib/dialyzer/Makefile b/lib/dialyzer/Makefile
index 0e59376240..e4f681dcd9 100644
--- a/lib/dialyzer/Makefile
+++ b/lib/dialyzer/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2009. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/dialyzer/README b/lib/dialyzer/README
index 82d0f5ec48..951a92469b 100644
--- a/lib/dialyzer/README
+++ b/lib/dialyzer/README
@@ -6,7 +6,7 @@
## Copyright: Held by the authors; all rights reserved (2004 - 2010).
##----------------------------------------------------------------------------
-The DIALYZER, a DIscrepany AnaLYZer for ERlang programs.
+The DIALYZER, a DIscrepancy AnaLYZer for ERlang programs.
-----------------------------------------------
diff --git a/lib/dialyzer/doc/about.txt b/lib/dialyzer/doc/about.txt
index 7d9d819731..1318d9a65e 100644
--- a/lib/dialyzer/doc/about.txt
+++ b/lib/dialyzer/doc/about.txt
@@ -1,5 +1,5 @@
This is DIALYZER version 2.1.0
- DIALYZER is a DIscrepany AnaLYZer for ERlang programs.
+ DIALYZER is a DIscrepancy AnaLYZer for ERlang programs.
Copyright (C) Tobias Lindahl <[email protected]>
Kostis Sagonas <[email protected]>
diff --git a/lib/dialyzer/doc/manual.txt b/lib/dialyzer/doc/manual.txt
index 29c9518d84..be1fd2f8bc 100644
--- a/lib/dialyzer/doc/manual.txt
+++ b/lib/dialyzer/doc/manual.txt
@@ -4,7 +4,7 @@
## Kostis Sagonas <[email protected]>
##----------------------------------------------------------------------------
-The DIALYZER, a DIscrepany AnaLYZer for ERlang programs.
+The DIALYZER, a DIscrepancy AnaLYZer for ERlang programs.
-----------------------------------------------
diff --git a/lib/dialyzer/doc/src/book.xml b/lib/dialyzer/doc/src/book.xml
index 4cc2a9db7c..aecc0e5bfa 100644
--- a/lib/dialyzer/doc/src/book.xml
+++ b/lib/dialyzer/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/dialyzer/doc/src/dialyzer_chapter.xml b/lib/dialyzer/doc/src/dialyzer_chapter.xml
index 9bfb7ea2e1..c445f2633f 100644
--- a/lib/dialyzer/doc/src/dialyzer_chapter.xml
+++ b/lib/dialyzer/doc/src/dialyzer_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml
index 4202730eed..d9af2cb4cd 100644
--- a/lib/dialyzer/doc/src/notes.xml
+++ b/lib/dialyzer/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/dialyzer/doc/src/part.xml b/lib/dialyzer/doc/src/part.xml
index eff8e05257..575f77549a 100644
--- a/lib/dialyzer/doc/src/part.xml
+++ b/lib/dialyzer/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/dialyzer/doc/src/part_notes.xml b/lib/dialyzer/doc/src/part_notes.xml
index ba8d30e1be..4a0a0af2d1 100644
--- a/lib/dialyzer/doc/src/part_notes.xml
+++ b/lib/dialyzer/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/dialyzer/doc/src/ref_man.xml b/lib/dialyzer/doc/src/ref_man.xml
index 9c3887b599..01478cfb40 100644
--- a/lib/dialyzer/doc/src/ref_man.xml
+++ b/lib/dialyzer/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/dialyzer/info b/lib/dialyzer/info
index 9fba4b54ad..b9ea26b712 100644
--- a/lib/dialyzer/info
+++ b/lib/dialyzer/info
@@ -1,2 +1,2 @@
group: tools
-short: The DIALYZER, a DIscrepany AnaLYZer for ERlang programs.
+short: The DIALYZER, a DIscrepancy AnaLYZer for ERlang programs.
diff --git a/lib/dialyzer/src/Makefile b/lib/dialyzer/src/Makefile
index fd75cd5cd8..256f20f549 100644
--- a/lib/dialyzer/src/Makefile
+++ b/lib/dialyzer/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2012. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/dialyzer/src/dialyzer.app.src b/lib/dialyzer/src/dialyzer.app.src
index 003d7f2ba4..5b28f7ae86 100644
--- a/lib/dialyzer/src/dialyzer.app.src
+++ b/lib/dialyzer/src/dialyzer.app.src
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -47,6 +47,6 @@
{registered, []},
{applications, [compiler, hipe, kernel, stdlib, wx]},
{env, []},
- {runtime_dependencies, ["wx-1.2","syntax_tools-1.6.14","stdlib-2.5",
- "kernel-3.0","hipe-3.13","erts-7.0",
- "compiler-5.0"]}]}.
+ {runtime_dependencies, ["wx-1.2","syntax_tools-2.0","stdlib-3.0",
+ "kernel-5.0","hipe-3.15.1","erts-8.0",
+ "compiler-7.0"]}]}.
diff --git a/lib/dialyzer/src/dialyzer.appup.src b/lib/dialyzer/src/dialyzer.appup.src
index 727e961629..d81ff641d7 100644
--- a/lib/dialyzer/src/dialyzer.appup.src
+++ b/lib/dialyzer/src/dialyzer.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/dialyzer/src/dialyzer.erl b/lib/dialyzer/src/dialyzer.erl
index 9f51dfe356..bcac8afe64 100644
--- a/lib/dialyzer/src/dialyzer.erl
+++ b/lib/dialyzer/src/dialyzer.erl
@@ -336,6 +336,9 @@ message_to_string({guard_fail, []}) ->
"Clause guard cannot succeed.\n";
message_to_string({guard_fail, [Arg1, Infix, Arg2]}) ->
io_lib:format("Guard test ~s ~s ~s can never succeed\n", [Arg1, Infix, Arg2]);
+message_to_string({map_update, [Type, Key]}) ->
+ io_lib:format("A key of type ~s cannot exist "
+ "in a map of type ~s\n", [Key, Type]);
message_to_string({neg_guard_fail, [Arg1, Infix, Arg2]}) ->
io_lib:format("Guard test not(~s ~s ~s) can never succeed\n",
[Arg1, Infix, Arg2]);
diff --git a/lib/dialyzer/src/dialyzer.hrl b/lib/dialyzer/src/dialyzer.hrl
index 601e2e954b..ea6a71217c 100644
--- a/lib/dialyzer/src/dialyzer.hrl
+++ b/lib/dialyzer/src/dialyzer.hrl
@@ -60,6 +60,7 @@
-define(WARN_BEHAVIOUR, warn_behaviour).
-define(WARN_UNDEFINED_CALLBACK, warn_undefined_callbacks).
-define(WARN_UNKNOWN, warn_unknown).
+-define(WARN_MAP_CONSTRUCTION, warn_map_construction).
%%
%% The following type has double role:
@@ -75,7 +76,8 @@
| ?WARN_CONTRACT_SUPERTYPE | ?WARN_CALLGRAPH
| ?WARN_UNMATCHED_RETURN | ?WARN_RACE_CONDITION
| ?WARN_BEHAVIOUR | ?WARN_CONTRACT_RANGE
- | ?WARN_UNDEFINED_CALLBACK | ?WARN_UNKNOWN.
+ | ?WARN_UNDEFINED_CALLBACK | ?WARN_UNKNOWN
+ | ?WARN_MAP_CONSTRUCTION.
%%
%% This is the representation of each warning as they will be returned
diff --git a/lib/dialyzer/src/dialyzer_behaviours.erl b/lib/dialyzer/src/dialyzer_behaviours.erl
index b6f15fdc0e..5623929a43 100644
--- a/lib/dialyzer/src/dialyzer_behaviours.erl
+++ b/lib/dialyzer/src/dialyzer_behaviours.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/dialyzer/src/dialyzer_cl.erl b/lib/dialyzer/src/dialyzer_cl.erl
index 50ff5304d6..fc56693ea3 100644
--- a/lib/dialyzer/src/dialyzer_cl.erl
+++ b/lib/dialyzer/src/dialyzer_cl.erl
@@ -2,7 +2,7 @@
%%-------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/dialyzer/src/dialyzer_contracts.erl b/lib/dialyzer/src/dialyzer_contracts.erl
index e03e4d5bb4..116260778c 100644
--- a/lib/dialyzer/src/dialyzer_contracts.erl
+++ b/lib/dialyzer/src/dialyzer_contracts.erl
@@ -210,10 +210,10 @@ check_contract(Contract, SuccType) ->
check_contract(#contract{contracts = Contracts}, SuccType, Opaques) ->
try
- Contracts1 = [{Contract, insert_constraints(Constraints, dict:new())}
+ Contracts1 = [{Contract, insert_constraints(Constraints)}
|| {Contract, Constraints} <- Contracts],
- Contracts2 = [erl_types:t_subst(Contract, Dict)
- || {Contract, Dict} <- Contracts1],
+ Contracts2 = [erl_types:t_subst(Contract, Map)
+ || {Contract, Map} <- Contracts1],
GenDomains = [erl_types:t_fun_args(C) || C <- Contracts2],
case check_domains(GenDomains) of
error ->
@@ -277,28 +277,45 @@ check_extraneous_1(Contract, SuccType) ->
case [CR || CR <- CRngs,
erl_types:t_is_none(erl_types:t_inf(CR, STRng))] of
[] ->
- CRngList = list_part(CRng),
- STRngList = list_part(STRng),
- case is_not_nil_list(CRngList) andalso is_not_nil_list(STRngList) of
- false -> ok;
- true ->
- CRngElements = erl_types:t_list_elements(CRngList),
- STRngElements = erl_types:t_list_elements(STRngList),
- Inf = erl_types:t_inf(CRngElements, STRngElements),
- case erl_types:t_is_none(Inf) of
- true -> {error, invalid_contract};
- false -> ok
- end
+ case bad_extraneous_list(CRng, STRng)
+ orelse bad_extraneous_map(CRng, STRng)
+ of
+ true -> {error, invalid_contract};
+ false -> ok
end;
CRs -> {error, {extra_range, erl_types:t_sup(CRs), STRng}}
end.
+bad_extraneous_list(CRng, STRng) ->
+ CRngList = list_part(CRng),
+ STRngList = list_part(STRng),
+ case is_not_nil_list(CRngList) andalso is_not_nil_list(STRngList) of
+ false -> false;
+ true ->
+ CRngElements = erl_types:t_list_elements(CRngList),
+ STRngElements = erl_types:t_list_elements(STRngList),
+ Inf = erl_types:t_inf(CRngElements, STRngElements),
+ erl_types:t_is_none(Inf)
+ end.
+
list_part(Type) ->
erl_types:t_inf(erl_types:t_list(), Type).
is_not_nil_list(Type) ->
erl_types:t_is_list(Type) andalso not erl_types:t_is_nil(Type).
+bad_extraneous_map(CRng, STRng) ->
+ CRngMap = map_part(CRng),
+ STRngMap = map_part(STRng),
+ (not is_empty_map(CRngMap)) andalso (not is_empty_map(STRngMap))
+ andalso is_empty_map(erl_types:t_inf(CRngMap, STRngMap)).
+
+map_part(Type) ->
+ erl_types:t_inf(erl_types:t_map(), Type).
+
+is_empty_map(Type) ->
+ erl_types:t_is_equal(Type, erl_types:t_from_term(#{})).
+
%% This is the heart of the "range function"
-spec process_contracts([contract_pair()], [erl_types:erl_type()]) ->
erl_types:erl_type().
@@ -327,15 +344,15 @@ process_contract({Contract, Constraints}, CallTypes0) ->
[erl_types:t_to_string(ContArgsFun),
erl_types:t_to_string(CallTypesFun)]),
case solve_constraints(ContArgsFun, CallTypesFun, Constraints) of
- {ok, VarDict} ->
- {ok, erl_types:t_subst(erl_types:t_fun_range(Contract), VarDict)};
+ {ok, VarMap} ->
+ {ok, erl_types:t_subst(erl_types:t_fun_range(Contract), VarMap)};
error -> error
end.
solve_constraints(Contract, Call, Constraints) ->
%% First make sure the call follows the constraints
- CDict = insert_constraints(Constraints, dict:new()),
- Contract1 = erl_types:t_subst(Contract, CDict),
+ CMap = insert_constraints(Constraints),
+ Contract1 = erl_types:t_subst(Contract, CMap),
%% Just a safe over-approximation.
%% TODO: Find the types for type variables properly
ContrArgs = erl_types:t_fun_args(Contract1),
@@ -343,7 +360,7 @@ solve_constraints(Contract, Call, Constraints) ->
InfList = erl_types:t_inf_lists(ContrArgs, CallArgs),
case erl_types:any_none_or_unit(InfList) of
true -> error;
- false -> {ok, CDict}
+ false -> {ok, CMap}
end.
%%Inf = erl_types:t_inf(Contract1, Call),
%% Then unify with the constrained call type.
@@ -373,23 +390,26 @@ warn_spec_missing_fun({M, F, A} = MFA, Contracts) ->
{?WARN_CONTRACT_SYNTAX, WarningInfo, {spec_missing_fun, [M, F, A]}}.
%% This treats the "when" constraints. It will be extended, we hope.
-insert_constraints([{subtype, Type1, Type2}|Left], Dict) ->
+insert_constraints(Constraints) ->
+ insert_constraints(Constraints, maps:new()).
+
+insert_constraints([{subtype, Type1, Type2}|Left], Map) ->
case erl_types:t_is_var(Type1) of
true ->
Name = erl_types:t_var_name(Type1),
- Dict1 = case dict:find(Name, Dict) of
- error ->
- dict:store(Name, Type2, Dict);
- {ok, VarType} ->
- dict:store(Name, erl_types:t_inf(VarType, Type2), Dict)
- end,
- insert_constraints(Left, Dict1);
+ Map1 = case maps:find(Name, Map) of
+ error ->
+ maps:put(Name, Type2, Map);
+ {ok, VarType} ->
+ maps:put(Name, erl_types:t_inf(VarType, Type2), Map)
+ end,
+ insert_constraints(Left, Map1);
false ->
%% A lot of things should change to add supertypes
throw({error, io_lib:format("First argument of is_subtype constraint "
"must be a type variable: ~p\n", [Type1])})
end;
-insert_constraints([], Dict) -> Dict.
+insert_constraints([], Map) -> Map.
-type types() :: erl_types:type_table().
@@ -459,7 +479,7 @@ initialize_constraints([], _MFA, _RecDict, _ExpTypes, _AllRecords, Acc) ->
initialize_constraints([Constr|Rest], MFA, RecDict, ExpTypes, AllRecords, Acc) ->
case Constr of
{type, _, constraint, [{atom, _, is_subtype}, [Type1, Type2]]} ->
- T1 = final_form(Type1, ExpTypes, MFA, AllRecords, dict:new()),
+ T1 = final_form(Type1, ExpTypes, MFA, AllRecords, maps:new()),
Entry = {T1, Type2},
initialize_constraints(Rest, MFA, RecDict, ExpTypes, AllRecords, [Entry|Acc]);
{type, _, constraint, [{atom,_,Name}, List]} ->
@@ -470,7 +490,7 @@ initialize_constraints([Constr|Rest], MFA, RecDict, ExpTypes, AllRecords, Acc) -
constraints_fixpoint(Constrs, MFA, RecDict, ExpTypes, AllRecords) ->
VarDict =
- constraints_to_dict(Constrs, MFA, RecDict, ExpTypes, AllRecords, dict:new()),
+ constraints_to_dict(Constrs, MFA, RecDict, ExpTypes, AllRecords, maps:new()),
constraints_fixpoint(VarDict, MFA, Constrs, RecDict, ExpTypes, AllRecords).
constraints_fixpoint(OldVarDict, MFA, Constrs, RecDict, ExpTypes, AllRecords) ->
@@ -482,7 +502,7 @@ constraints_fixpoint(OldVarDict, MFA, Constrs, RecDict, ExpTypes, AllRecords) ->
fun(Key, Value, Acc) ->
[{subtype, erl_types:t_var(Key), Value}|Acc]
end,
- FinalConstrs = dict:fold(DictFold, [], NewVarDict),
+ FinalConstrs = maps:fold(DictFold, [], NewVarDict),
{FinalConstrs, NewVarDict};
_Other ->
constraints_fixpoint(NewVarDict, MFA, Constrs, RecDict, ExpTypes, AllRecords)
@@ -492,7 +512,7 @@ final_form(Form, ExpTypes, MFA, AllRecords, VarDict) ->
from_form_with_check(Form, ExpTypes, MFA, AllRecords, VarDict).
from_form_with_check(Form, ExpTypes, MFA, AllRecords) ->
- from_form_with_check(Form, ExpTypes, MFA, AllRecords, dict:new()).
+ from_form_with_check(Form, ExpTypes, MFA, AllRecords, maps:new()).
from_form_with_check(Form, ExpTypes, MFA, AllRecords, VarDict) ->
Site = {spec, MFA},
@@ -503,7 +523,7 @@ from_form_with_check(Form, ExpTypes, MFA, AllRecords, VarDict) ->
constraints_to_dict(Constrs, MFA, RecDict, ExpTypes, AllRecords, VarDict) ->
Subtypes =
constraints_to_subs(Constrs, MFA, RecDict, ExpTypes, AllRecords, VarDict, []),
- insert_constraints(Subtypes, dict:new()).
+ insert_constraints(Subtypes).
constraints_to_subs([], _MFA, _RecDict, _ExpTypes, _AllRecords, _VarDict, Acc) ->
Acc;
@@ -588,8 +608,8 @@ general_domain(List) ->
general_domain(List, erl_types:t_none()).
general_domain([{Sig, Constraints}|Left], AccSig) ->
- Dict = insert_constraints(Constraints, dict:new()),
- Sig1 = erl_types:t_subst(Sig, Dict),
+ Map = insert_constraints(Constraints),
+ Sig1 = erl_types:t_subst(Sig, Map),
general_domain(Left, erl_types:t_sup(AccSig, Sig1));
general_domain([], AccSig) ->
%% Get rid of all variables in the domain.
diff --git a/lib/dialyzer/src/dialyzer_dataflow.erl b/lib/dialyzer/src/dialyzer_dataflow.erl
index 6e49043551..5ab0c39c04 100644
--- a/lib/dialyzer/src/dialyzer_dataflow.erl
+++ b/lib/dialyzer/src/dialyzer_dataflow.erl
@@ -2,7 +2,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -43,7 +43,6 @@
-include("dialyzer.hrl").
-%%-import(helper, %% 'helper' could be any module doing sanity checks...
-import(erl_types,
[t_inf/2, t_inf/3, t_inf_lists/2, t_inf_lists/3,
t_inf_lists/3, t_is_equal/2, t_is_subtype/2, t_subtract/2,
@@ -72,7 +71,7 @@
t_tuple/0, t_tuple/1, t_tuple_args/1, t_tuple_args/2,
t_tuple_subtypes/2,
t_unit/0, t_unopaque/2,
- t_map/1
+ t_map/0, t_map/1, t_is_singleton/2
]).
%%-define(DEBUG, true).
@@ -126,8 +125,8 @@
curr_fun :: curr_fun()
}).
--record(map, {dict = dict:new() :: type_tab(),
- subst = dict:new() :: subst_tab(),
+-record(map, {map = maps:new() :: type_tab(),
+ subst = maps:new() :: subst_tab(),
modified = [] :: [Key :: term()],
modified_stack = [] :: [{[Key :: term()],reference()}],
ref = undefined :: reference() | undefined}).
@@ -135,10 +134,10 @@
-type env_tab() :: dict:dict(label(), #map{}).
-type fun_entry() :: {Args :: [type()], RetType :: type()}.
-type fun_tab() :: dict:dict('top' | label(),
- {'not_handled', fun_entry()} | fun_entry()).
+ {'not_handled', fun_entry()} | fun_entry()).
-type key() :: label() | cerl:cerl().
--type type_tab() :: dict:dict(key(), type()).
--type subst_tab() :: dict:dict(key(), cerl:cerl()).
+-type type_tab() :: #{key() => type()}.
+-type subst_tab() :: #{key() => cerl:cerl()}.
%% Exported Types
@@ -342,8 +341,6 @@ traverse(Tree, Map, State) ->
handle_tuple(Tree, Map, State);
map ->
handle_map(Tree, Map, State);
- map_pair ->
- handle_map_pair(Tree, Map, State);
values ->
Elements = cerl:values_es(Tree),
{State1, Map1, EsType} = traverse_list(Elements, Map, State),
@@ -1102,15 +1099,54 @@ handle_try(Tree, Map, State) ->
%%----------------------------------------
handle_map(Tree,Map,State) ->
- Pairs = cerl:map_es(Tree),
- {State1, Map1, TypePairs} = traverse_list(Pairs,Map,State),
- {State1, Map1, t_map(TypePairs)}.
+ Pairs = cerl:map_es(Tree),
+ Arg = cerl:map_arg(Tree),
+ {State1, Map1, ArgType} = traverse(Arg, Map, State),
+ ArgType1 = t_inf(t_map(), ArgType),
+ case t_is_none_or_unit(ArgType1) of
+ true ->
+ {State1, Map1, ArgType1};
+ false ->
+ {State2, Map2, TypePairs, ExactKeys} =
+ traverse_map_pairs(Pairs, Map1, State1, t_none(), [], []),
+ InsertPair = fun({KV,assoc,_},Acc) -> erl_types:t_map_put(KV,Acc);
+ ({KV,exact,KVTree},Acc) ->
+ case t_is_none(T=erl_types:t_map_update(KV,Acc)) of
+ true -> throw({none, Acc, KV, KVTree});
+ false -> T
+ end
+ end,
+ try lists:foldl(InsertPair, ArgType1, TypePairs)
+ of ResT ->
+ BindT = t_map([{K, t_any()} || K <- ExactKeys]),
+ case bind_pat_vars_reverse([Arg], [BindT], [], Map2, State2) of
+ {error, _, _, _, _} -> {State2, Map2, ResT};
+ {Map3, _} -> {State2, Map3, ResT}
+ end
+ catch {none, MapType, {K,_}, KVTree} ->
+ Msg2 = {map_update, [format_type(MapType, State2),
+ format_type(K, State2)]},
+ {state__add_warning(State2, ?WARN_MAP_CONSTRUCTION, KVTree, Msg2),
+ Map2, t_none()}
+ end
+ end.
-handle_map_pair(Tree,Map,State) ->
- Key = cerl:map_pair_key(Tree),
- Val = cerl:map_pair_val(Tree),
+traverse_map_pairs([], Map, State, _ShadowKeys, PairAcc, KeyAcc) ->
+ {State, Map, lists:reverse(PairAcc), KeyAcc};
+traverse_map_pairs([Pair|Pairs], Map, State, ShadowKeys, PairAcc, KeyAcc) ->
+ Key = cerl:map_pair_key(Pair),
+ Val = cerl:map_pair_val(Pair),
+ Op = cerl:map_pair_op(Pair),
{State1, Map1, [K,V]} = traverse_list([Key,Val],Map,State),
- {State1, Map1, {K,V}}.
+ KeyAcc1 =
+ case cerl:is_literal(Op) andalso cerl:concrete(Op) =:= exact andalso
+ t_is_singleton(K, State#state.opaques) andalso
+ t_is_none(t_inf(ShadowKeys, K)) of
+ true -> [K|KeyAcc];
+ false -> KeyAcc
+ end,
+ traverse_map_pairs(Pairs, Map1, State1, t_sup(K, ShadowKeys),
+ [{{K,V},cerl:concrete(Op),Pair}|PairAcc], KeyAcc1).
%%----------------------------------------
@@ -1445,7 +1481,9 @@ bind_pat_vars([Pat|PatLeft], [Type|TypeLeft], Acc, Map, State, Rev) ->
{NewMap, TypeOut} =
case cerl:type(Pat) of
alias ->
- AliasPat = cerl:alias_pat(Pat),
+ %% Map patterns are more allowing than the type of their literal. We
+ %% must unfold AliasPat if it is a literal.
+ AliasPat = dialyzer_utils:refold_pattern(cerl:alias_pat(Pat)),
Var = cerl:alias_var(Pat),
Map1 = enter_subst(Var, AliasPat, Map),
{Map2, [PatType]} = bind_pat_vars([AliasPat], [Type], [],
@@ -1486,14 +1524,59 @@ bind_pat_vars([Pat|PatLeft], [Type|TypeLeft], Acc, Map, State, Rev) ->
{Map1, t_cons(HdType, TlType)}
end;
literal ->
- Literal = literal_type(Pat),
- case t_is_none(t_inf(Literal, Type, Opaques)) of
+ Pat0 = dialyzer_utils:refold_pattern(Pat),
+ case cerl:is_literal(Pat0) of
true ->
- bind_opaque_pats(Literal, Type, Pat, State);
- false -> {Map, Literal}
+ Literal = literal_type(Pat),
+ case t_is_none(t_inf(Literal, Type, Opaques)) of
+ true ->
+ bind_opaque_pats(Literal, Type, Pat, State);
+ false -> {Map, Literal}
+ end;
+ false ->
+ %% Retry with the unfolded pattern
+ {Map1, [PatType]}
+ = bind_pat_vars([Pat0], [Type], [], Map, State, Rev),
+ {Map1, PatType}
end;
map ->
- {Map, t_map([])};
+ MapT = t_inf(Type, t_map(), Opaques),
+ case t_is_none(MapT) of
+ true ->
+ bind_opaque_pats(t_map(), Type, Pat, State);
+ false ->
+ case Rev of
+ %% TODO: Reverse matching (propagating a matched subset back to a value)
+ true -> {Map, MapT};
+ false ->
+ FoldFun =
+ fun(Pair, {MapAcc, ListAcc}) ->
+ %% Only exact (:=) can appear in patterns
+ exact = cerl:concrete(cerl:map_pair_op(Pair)),
+ Key = cerl:map_pair_key(Pair),
+ KeyType =
+ case cerl:type(Key) of
+ var ->
+ case state__lookup_type_for_letrec(Key, State) of
+ error -> lookup_type(Key, MapAcc);
+ {ok, RecType} -> RecType
+ end;
+ literal ->
+ literal_type(Key)
+ end,
+ Bind = erl_types:t_map_get(KeyType, MapT),
+ {MapAcc1, [ValType]} =
+ bind_pat_vars([cerl:map_pair_val(Pair)],
+ [Bind], [], MapAcc, State, Rev),
+ case t_is_singleton(KeyType, Opaques) of
+ true -> {MapAcc1, [{KeyType, ValType}|ListAcc]};
+ false -> {MapAcc1, ListAcc}
+ end
+ end,
+ {Map1, Pairs} = lists:foldl(FoldFun, {Map, []}, cerl:map_es(Pat)),
+ {Map1, t_inf(MapT, t_map(Pairs))}
+ end
+ end;
tuple ->
Es = cerl:tuple_es(Pat),
{TypedRecord, Prototype} =
@@ -1682,7 +1765,7 @@ bind_opaque_pats(GenType, Type, Pat, State) ->
%%
bind_guard(Guard, Map, State) ->
- try bind_guard(Guard, Map, dict:new(), pos, State) of
+ try bind_guard(Guard, Map, maps:new(), pos, State) of
{Map1, _Type} -> Map1
catch
throw:{fail, Warning} -> {error, Warning};
@@ -1710,20 +1793,63 @@ bind_guard(Guard, Map, Env, Eval, State) ->
'try' ->
Arg = cerl:try_arg(Guard),
[Var] = cerl:try_vars(Guard),
+ EVars = cerl:try_evars(Guard),
%%?debug("Storing: ~w\n", [Var]),
- NewEnv = dict:store(get_label(Var), Arg, Env),
- bind_guard(cerl:try_body(Guard), Map, NewEnv, Eval, State);
+ Map1 = join_maps_begin(Map),
+ Map2 = mark_as_fresh(EVars, Map1),
+ %% Visit handler first so we know if it should be ignored
+ {{HandlerMap, HandlerType}, HandlerE} =
+ try {bind_guard(cerl:try_handler(Guard), Map2, Env, Eval, State), none}
+ catch throw:HE ->
+ {{Map2, t_none()}, HE}
+ end,
+ BodyEnv = maps:put(get_label(Var), Arg, Env),
+ Wanted = case Eval of pos -> t_atom(true); neg -> t_atom(false);
+ dont_know -> t_any() end,
+ case t_is_none(t_inf(HandlerType, Wanted)) of
+ %% Handler won't save us; pretend it does not exist
+ true -> bind_guard(cerl:try_body(Guard), Map, BodyEnv, Eval, State);
+ false ->
+ {{BodyMap, BodyType}, BodyE} =
+ try {bind_guard(cerl:try_body(Guard), Map1, BodyEnv,
+ Eval, State), none}
+ catch throw:BE ->
+ {{Map1, t_none()}, BE}
+ end,
+ Map3 = join_maps_end([BodyMap, HandlerMap], Map1),
+ case t_is_none(Sup = t_sup(BodyType, HandlerType)) of
+ true ->
+ %% Pick a reason. N.B. We assume that the handler is always
+ %% compiler-generated if the body is; that way, we won't need to
+ %% check.
+ Fatality = case {BodyE, HandlerE} of
+ {{fatal_fail, _}, _} -> fatal_fail;
+ {_, {fatal_fail, _}} -> fatal_fail;
+ _ -> fail
+ end,
+ throw({Fatality,
+ case {BodyE, HandlerE} of
+ {{_, Rsn}, _} when Rsn =/= none -> Rsn;
+ {_, {_,Rsn}} -> Rsn;
+ _ -> none
+ end});
+ false -> {Map3, Sup}
+ end
+ end;
tuple ->
Es0 = cerl:tuple_es(Guard),
{Map1, Es} = bind_guard_list(Es0, Map, Env, dont_know, State),
{Map1, t_tuple(Es)};
map ->
- {Map, t_map([])};
+ case Eval of
+ dont_know -> handle_guard_map(Guard, Map, Env, State);
+ _PosOrNeg -> {Map, t_none()} %% Map exprs do not produce bools
+ end;
'let' ->
Arg = cerl:let_arg(Guard),
[Var] = cerl:let_vars(Guard),
%%?debug("Storing: ~w\n", [Var]),
- NewEnv = dict:store(get_label(Var), Arg, Env),
+ NewEnv = maps:put(get_label(Var), Arg, Env),
bind_guard(cerl:let_body(Guard), Map, NewEnv, Eval, State);
values ->
Es = cerl:values_es(Guard),
@@ -1732,7 +1858,7 @@ bind_guard(Guard, Map, Env, Eval, State) ->
{Map, Type};
var ->
?debug("Looking for var(~w)...", [cerl_trees:get_label(Guard)]),
- case dict:find(get_label(Guard), Env) of
+ case maps:find(get_label(Guard), Env) of
error ->
?debug("Did not find it\n", []),
Type = lookup_type(Guard, Map),
@@ -1761,7 +1887,7 @@ handle_guard_call(Guard, Map, Env, Eval, State) ->
{erlang, F, 1} when F =:= is_atom; F =:= is_boolean;
F =:= is_binary; F =:= is_bitstring;
F =:= is_float; F =:= is_function;
- F =:= is_integer; F =:= is_list;
+ F =:= is_integer; F =:= is_list; F =:= is_map;
F =:= is_number; F =:= is_pid; F =:= is_port;
F =:= is_reference; F =:= is_tuple ->
handle_guard_type_test(Guard, F, Map, Env, Eval, State);
@@ -1841,6 +1967,7 @@ bind_type_test(Eval, TypeTest, ArgType, State) ->
is_function -> t_fun();
is_integer -> t_integer();
is_list -> t_maybe_improper_list();
+ is_map -> t_map();
is_number -> t_number();
is_pid -> t_pid();
is_port -> t_port();
@@ -2349,6 +2476,30 @@ bind_guard_list([G|Gs], Map, Env, Eval, State, Acc) ->
bind_guard_list([], Map, _Env, _Eval, _State, Acc) ->
{Map, lists:reverse(Acc)}.
+handle_guard_map(Guard, Map, Env, State) ->
+ Pairs = cerl:map_es(Guard),
+ Arg = cerl:map_arg(Guard),
+ {Map1, ArgType0} = bind_guard(Arg, Map, Env, dont_know, State),
+ ArgType1 = t_inf(t_map(), ArgType0),
+ case t_is_none_or_unit(ArgType1) of
+ true -> {Map1, t_none()};
+ false ->
+ {Map2, TypePairs} = bind_guard_map_pairs(Pairs, Map1, Env, State, []),
+ {Map2, lists:foldl(fun({KV,assoc},Acc) -> erl_types:t_map_put(KV,Acc);
+ ({KV,exact},Acc) -> erl_types:t_map_update(KV,Acc)
+ end, ArgType1, TypePairs)}
+ end.
+
+bind_guard_map_pairs([], Map, _Env, _State, PairAcc) ->
+ {Map, lists:reverse(PairAcc)};
+bind_guard_map_pairs([Pair|Pairs], Map, Env, State, PairAcc) ->
+ Key = cerl:map_pair_key(Pair),
+ Val = cerl:map_pair_val(Pair),
+ Op = cerl:map_pair_op(Pair),
+ {Map1, [K,V]} = bind_guard_list([Key,Val],Map,Env,dont_know,State),
+ bind_guard_map_pairs(Pairs, Map1, Env, State,
+ [{{K,V},cerl:concrete(Op)}|PairAcc]).
+
-type eval() :: 'pos' | 'neg' | 'dont_know'.
-spec signal_guard_fail(eval(), cerl:c_call(), [type()],
@@ -2421,7 +2572,9 @@ filter_fail_clauses([Clause|Left]) ->
case (cerl:clause_pats(Clause) =:= []) of
true ->
Body = cerl:clause_body(Clause),
- case cerl:is_literal(Body) andalso (cerl:concrete(Body) =:= fail) of
+ case cerl:is_literal(Body) andalso (cerl:concrete(Body) =:= fail) orelse
+ cerl:is_c_primop(Body) andalso
+ (cerl:atom_val(cerl:primop_name(Body)) =:= match_fail) of
true -> filter_fail_clauses(Left);
false -> [Clause|filter_fail_clauses(Left)]
end;
@@ -2535,10 +2688,10 @@ join_maps_end(Maps, MapOut) ->
#map{ref = Ref, modified_stack = [{M1,R1} | S]} = MapOut,
true = lists:all(fun(M) -> M#map.ref =:= Ref end, Maps), % sanity
Keys0 = lists:usort(lists:append([M#map.modified || M <- Maps])),
- #map{dict = Dict, subst = Subst} = MapOut,
+ #map{map = Map, subst = Subst} = MapOut,
Keys = [Key ||
Key <- Keys0,
- dict:is_key(Key, Dict) orelse dict:is_key(Key, Subst)],
+ maps:is_key(Key, Map) orelse maps:is_key(Key, Subst)],
Out = case Maps of
[] -> join_maps(Maps, MapOut);
_ -> join_maps(Keys, Maps, MapOut)
@@ -2549,8 +2702,8 @@ join_maps_end(Maps, MapOut) ->
modified_stack = S}.
join_maps(Maps, MapOut) ->
- #map{dict = Dict, subst = Subst} = MapOut,
- Keys = ordsets:from_list(dict:fetch_keys(Dict) ++ dict:fetch_keys(Subst)),
+ #map{map = Map, subst = Subst} = MapOut,
+ Keys = ordsets:from_list(maps:keys(Map) ++ maps:keys(Subst)),
join_maps(Keys, Maps, MapOut).
join_maps(Keys, Maps, MapOut) ->
@@ -2579,11 +2732,11 @@ join_maps_one_key([], _Key, AccType) ->
-ifdef(DEBUG).
debug_join_check(Maps, MapOut, Out) ->
- #map{dict = Dict, subst = Subst} = Out,
- #map{dict = Dict2, subst = Subst2} = join_maps(Maps, MapOut),
- F = fun(D) -> lists:keysort(1, dict:to_list(D)) end,
+ #map{map = Map, subst = Subst} = Out,
+ #map{map = Map2, subst = Subst2} = join_maps(Maps, MapOut),
+ F = fun(D) -> lists:keysort(1, maps:to_list(D)) end,
[throw({bug, join_maps}) ||
- F(Dict) =/= F(Dict2) orelse F(Subst) =/= F(Subst2)].
+ F(Map) =/= F(Map2) orelse F(Subst) =/= F(Subst2)].
-else.
debug_join_check(_Maps, _MapOut, _Out) -> ok.
-endif.
@@ -2614,15 +2767,15 @@ enter_type(Key, Val, MS) ->
enter_type_lists(Keys, t_to_tlist(Val), MS)
end;
false ->
- #map{dict = Dict, subst = Subst} = MS,
+ #map{map = Map, subst = Subst} = MS,
KeyLabel = get_label(Key),
- case dict:find(KeyLabel, Subst) of
+ case maps:find(KeyLabel, Subst) of
{ok, NewKey} ->
?debug("Binding ~p to ~p\n", [KeyLabel, NewKey]),
enter_type(NewKey, Val, MS);
error ->
?debug("Entering ~p :: ~s\n", [KeyLabel, t_to_string(Val)]),
- case dict:find(KeyLabel, Dict) of
+ case maps:find(KeyLabel, Map) of
{ok, Value} ->
case erl_types:t_is_equal(Val, Value) of
true -> MS;
@@ -2634,13 +2787,14 @@ enter_type(Key, Val, MS) ->
end
end.
-store_map(Key, Val, #map{dict = Dict, ref = undefined} = Map) ->
- Map#map{dict = dict:store(Key, Val, Dict)};
-store_map(Key, Val, #map{dict = Dict, modified = Mod} = Map) ->
- Map#map{dict = dict:store(Key, Val, Dict), modified = [Key | Mod]}.
+store_map(Key, Val, #map{map = Map, ref = undefined} = MapRec) ->
+ MapRec#map{map = maps:put(Key, Val, Map)};
+store_map(Key, Val, #map{map = Map, modified = Mod} = MapRec) ->
+ MapRec#map{map = maps:put(Key, Val, Map), modified = [Key | Mod]}.
-enter_subst(Key, Val, #map{subst = Subst} = MS) ->
+enter_subst(Key, Val0, #map{subst = Subst} = MS) ->
KeyLabel = get_label(Key),
+ Val = dialyzer_utils:refold_pattern(Val0),
case cerl:is_literal(Val) of
true ->
store_map(KeyLabel, literal_type(Val), MS);
@@ -2649,7 +2803,7 @@ enter_subst(Key, Val, #map{subst = Subst} = MS) ->
false -> MS;
true ->
ValLabel = get_label(Val),
- case dict:find(ValLabel, Subst) of
+ case maps:find(ValLabel, Subst) of
{ok, NewVal} ->
enter_subst(Key, NewVal, MS);
error ->
@@ -2663,22 +2817,22 @@ enter_subst(Key, Val, #map{subst = Subst} = MS) ->
end.
store_subst(Key, Val, #map{subst = S, ref = undefined} = Map) ->
- Map#map{subst = dict:store(Key, Val, S)};
+ Map#map{subst = maps:put(Key, Val, S)};
store_subst(Key, Val, #map{subst = S, modified = Mod} = Map) ->
- Map#map{subst = dict:store(Key, Val, S), modified = [Key | Mod]}.
+ Map#map{subst = maps:put(Key, Val, S), modified = [Key | Mod]}.
-lookup_type(Key, #map{dict = Dict, subst = Subst}) ->
- lookup(Key, Dict, Subst, t_none()).
+lookup_type(Key, #map{map = Map, subst = Subst}) ->
+ lookup(Key, Map, Subst, t_none()).
-lookup(Key, Dict, Subst, AnyNone) ->
+lookup(Key, Map, Subst, AnyNone) ->
case cerl:is_literal(Key) of
true -> literal_type(Key);
false ->
Label = get_label(Key),
- case dict:find(Label, Subst) of
- {ok, NewKey} -> lookup(NewKey, Dict, Subst, AnyNone);
+ case maps:find(Label, Subst) of
+ {ok, NewKey} -> lookup(NewKey, Map, Subst, AnyNone);
error ->
- case dict:find(Label, Dict) of
+ case maps:find(Label, Map) of
{ok, Val} -> Val;
error -> AnyNone
end
@@ -2703,6 +2857,9 @@ mark_as_fresh([Tree|Left], Map) ->
bitstr ->
%% The Size field is not fresh.
{SubTrees1 -- [cerl:bitstr_size(Tree)], Map};
+ map_pair ->
+ %% The keys are not fresh
+ {SubTrees1 -- [cerl:map_pair_key(Tree)], Map};
var ->
{SubTrees1, enter_type(Tree, t_any(), Map)};
_ ->
@@ -2713,12 +2870,12 @@ mark_as_fresh([], Map) ->
Map.
-ifdef(DEBUG).
-debug_pp_map(#map{dict = Dict}=Map) ->
- Keys = dict:fetch_keys(Dict),
+debug_pp_map(#map{map = Map}=MapRec) ->
+ Keys = maps:keys(Map),
io:format("Map:\n", []),
lists:foreach(fun (Key) ->
io:format("\t~w :: ~s\n",
- [Key, t_to_string(lookup_type(Key, Map))])
+ [Key, t_to_string(lookup_type(Key, MapRec))])
end, Keys),
ok.
-else.
diff --git a/lib/dialyzer/src/dialyzer_dep.erl b/lib/dialyzer/src/dialyzer_dep.erl
index a7bc074d02..6678037bc0 100644
--- a/lib/dialyzer/src/dialyzer_dep.erl
+++ b/lib/dialyzer/src/dialyzer_dep.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/dialyzer/src/dialyzer_explanation.erl b/lib/dialyzer/src/dialyzer_explanation.erl
index 20fbcfed35..968f8df78e 100644
--- a/lib/dialyzer/src/dialyzer_explanation.erl
+++ b/lib/dialyzer/src/dialyzer_explanation.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/dialyzer/src/dialyzer_gui_wx.erl b/lib/dialyzer/src/dialyzer_gui_wx.erl
index 9f344d87ff..30d2bdeca4 100644
--- a/lib/dialyzer/src/dialyzer_gui_wx.erl
+++ b/lib/dialyzer/src/dialyzer_gui_wx.erl
@@ -422,7 +422,7 @@ gui_loop(#gui_state{backend_pid = BackendPid, doc_plt = DocPlt,
#wx{id=?menuID_HELP_ABOUT, obj=Frame,
event=#wxCommand{type=command_menu_selected}} ->
Message = " This is DIALYZER version " ++ ?VSN ++ " \n"++
- "DIALYZER is a DIscrepany AnaLYZer for ERlang programs.\n\n"++
+ "DIALYZER is a DIscrepancy AnaLYZer for ERlang programs.\n\n"++
" Copyright (C) Tobias Lindahl <[email protected]>\n"++
" Kostis Sagonas <[email protected]>\n\n",
output_sms(State, "About Dialyzer", Message, info),
diff --git a/lib/dialyzer/src/dialyzer_options.erl b/lib/dialyzer/src/dialyzer_options.erl
index dd81dd01ed..add660eae9 100644
--- a/lib/dialyzer/src/dialyzer_options.erl
+++ b/lib/dialyzer/src/dialyzer_options.erl
@@ -47,6 +47,7 @@ build(Opts) ->
?WARN_CALLGRAPH,
?WARN_FAILING_CALL,
?WARN_BIN_CONSTRUCTION,
+ ?WARN_MAP_CONSTRUCTION,
?WARN_CONTRACT_RANGE,
?WARN_CONTRACT_TYPES,
?WARN_CONTRACT_SYNTAX,
diff --git a/lib/dialyzer/src/dialyzer_plt.erl b/lib/dialyzer/src/dialyzer_plt.erl
index 769f26a3df..cf2f0e919e 100644
--- a/lib/dialyzer/src/dialyzer_plt.erl
+++ b/lib/dialyzer/src/dialyzer_plt.erl
@@ -2,7 +2,7 @@
%%----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/dialyzer/src/dialyzer_timing.erl b/lib/dialyzer/src/dialyzer_timing.erl
index 33fd008732..aa71318d8e 100644
--- a/lib/dialyzer/src/dialyzer_timing.erl
+++ b/lib/dialyzer/src/dialyzer_timing.erl
@@ -2,7 +2,7 @@
%%-------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/dialyzer/src/dialyzer_typesig.erl b/lib/dialyzer/src/dialyzer_typesig.erl
index 5f0881bbcd..1787b66192 100644
--- a/lib/dialyzer/src/dialyzer_typesig.erl
+++ b/lib/dialyzer/src/dialyzer_typesig.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -48,6 +48,7 @@
t_is_float/1, t_is_fun/1,
t_is_integer/1, t_non_neg_integer/0,
t_is_list/1, t_is_nil/1, t_is_none/1, t_is_number/1,
+ t_is_singleton/1,
t_limit/2, t_list/0, t_list/1,
t_list_elements/1, t_nonempty_list/1, t_maybe_improper_list/0,
@@ -57,7 +58,7 @@
t_timeout/0, t_tuple/0, t_tuple/1,
t_var/1, t_var_name/1,
t_none/0, t_unit/0,
- t_map/1
+ t_map/0, t_map/1, t_map_get/2, t_map_put/2
]).
-include("dialyzer.hrl").
@@ -65,9 +66,11 @@
%%-----------------------------------------------------------------------------
-type dep() :: integer(). %% type variable names used as constraint ids
+-type deps() :: ordsets:ordset(dep()).
+
-type type_var() :: erl_types:erl_type(). %% actually: {'c','var',_,_}
--record(fun_var, {'fun' :: fun((_) -> erl_types:erl_type()), deps :: [dep()],
+-record(fun_var, {'fun' :: fun((_) -> erl_types:erl_type()), deps :: deps(),
origin :: integer() | 'undefined'}).
-type constr_op() :: 'eq' | 'sub'.
@@ -76,20 +79,21 @@
-record(constraint, {lhs :: erl_types:erl_type(),
op :: constr_op(),
rhs :: fvar_or_type(),
- deps :: [dep()]}).
+ deps :: deps()}).
-type constraint() :: #constraint{}.
+-type mask() :: ordsets:ordset(non_neg_integer()).
+
-record(constraint_list, {type :: 'conj' | 'disj',
list :: [constr()],
- deps :: [dep()],
- masks = [] :: [{dep(),[non_neg_integer()]}] |
- {'d',dict:dict(dep(), [non_neg_integer()])},
+ deps :: deps(),
+ masks = maps:new() :: #{dep() => mask()},
id :: {'list', dep()} | 'undefined'}).
-type constraint_list() :: #constraint_list{}.
--record(constraint_ref, {id :: type_var(), deps :: [dep()]}).
+-record(constraint_ref, {id :: type_var(), deps :: deps()}).
-type constraint_ref() :: #constraint_ref{}.
@@ -98,34 +102,33 @@
-type types() :: erl_types:type_table().
-type typesig_scc() :: [{mfa(), {cerl:c_var(), cerl:c_fun()}, types()}].
--type typesig_funmap() :: [{type_var(), type_var()}]. %% Orddict
+-type typesig_funmap() :: #{type_var() => type_var()}.
-type prop_types() :: dict:dict(label(), types()).
--type dict_or_ets() :: {'d', prop_types()} | {'e', ets:tid()}.
-
--record(state, {callgraph :: dialyzer_callgraph:callgraph()
- | 'undefined',
- cs = [] :: [constr()],
- cmap = {'d', dict:new()} :: dict_or_ets(),
- fun_map = [] :: typesig_funmap(),
- fun_arities = dict:new() :: dict:dict(type_var(), arity()),
- in_match = false :: boolean(),
- in_guard = false :: boolean(),
- module :: module(),
- name_map = dict:new() :: dict:dict(mfa(),
- cerl:c_fun()),
- next_label = 0 :: label(),
- self_rec :: 'false' | erl_types:erl_type(),
- plt :: dialyzer_plt:plt()
- | 'undefined',
- prop_types = {'d', dict:new()} :: dict_or_ets(),
- records = dict:new() :: types(),
- scc = [] :: [type_var()],
- mfas :: [tuple()],
- solvers = [] :: [solver()]
+-record(state, {callgraph :: dialyzer_callgraph:callgraph()
+ | 'undefined',
+ cs = [] :: [constr()],
+ cmap = maps:new() :: #{type_var() => constr()},
+ fun_map = maps:new() :: typesig_funmap(),
+ fun_arities = maps:new() :: #{type_var() => arity()},
+ in_match = false :: boolean(),
+ in_guard = false :: boolean(),
+ module :: module(),
+ name_map = maps:new() :: #{mfa() => cerl:c_fun()},
+ next_label = 0 :: label(),
+ self_rec :: 'false' | erl_types:erl_type(),
+ plt :: dialyzer_plt:plt()
+ | 'undefined',
+ prop_types = dict:new() :: prop_types(),
+ records = dict:new() :: types(),
+ scc = [] :: ordsets:ordset(type_var()),
+ mfas :: [mfa()],
+ solvers = [] :: [solver()]
}).
+-type state() :: #state{}.
+
%%-----------------------------------------------------------------------------
-define(TYPE_LIMIT, 4).
@@ -187,7 +190,8 @@ analyze_scc(SCC, NextLabel, CallGraph, Plt, PropTypes, Solvers0) ->
Funs = state__scc(State3),
pp_constrs_scc(Funs, State3),
constraints_to_dot_scc(Funs, State3),
- solve(Funs, State3).
+ T = solve(Funs, State3),
+ dict:from_list(maps:to_list(T)).
assert_format_of_scc([{_MFA, {_Var, _Fun}, _Records}|Left]) ->
assert_format_of_scc(Left);
@@ -311,7 +315,7 @@ traverse(Tree, DefinedVars, State) ->
Hd = cerl:cons_hd(Tree),
Tl = cerl:cons_tl(Tree),
{State1, [HdVar, TlVar]} = traverse_list([Hd, Tl], DefinedVars, State),
- case cerl:is_literal(cerl:fold_literal(Tree)) of
+ case cerl:is_literal(fold_literal_maybe_match(Tree, State)) of
true ->
%% We do not need to do anything more here.
{State, t_cons(HdVar, TlVar)};
@@ -392,8 +396,18 @@ traverse(Tree, DefinedVars, State) ->
{State2, _} = traverse_list(Funs, DefinedVars1, State1),
traverse(Body, DefinedVars1, State2);
literal ->
- Type = t_from_term(cerl:concrete(Tree)),
- {State, Type};
+ %% Maps are special; a literal pattern matches more than just the value
+ %% constructed by the literal. For example #{} constructs the empty map,
+ %% but matches every map.
+ case state__is_in_match(State) of
+ true ->
+ Tree1 = dialyzer_utils:refold_pattern(Tree),
+ case cerl:is_literal(Tree1) of
+ false -> traverse(Tree1, DefinedVars, State);
+ true -> {State, t_from_term(cerl:concrete(Tree))}
+ end;
+ _ -> {State, t_from_term(cerl:concrete(Tree))}
+ end;
module ->
Defs = cerl:module_defs(Tree),
Funs = [Fun || {_Var, Fun} <- Defs],
@@ -437,7 +451,7 @@ traverse(Tree, DefinedVars, State) ->
Elements = cerl:tuple_es(Tree),
{State1, EVars} = traverse_list(Elements, DefinedVars, State),
{State2, TupleType} =
- case cerl:is_literal(cerl:fold_literal(Tree)) of
+ case cerl:is_literal(fold_literal_maybe_match(Tree, State1)) of
true ->
%% We do not need to do anything more here.
{State, t_tuple(EVars)};
@@ -476,7 +490,111 @@ traverse(Tree, DefinedVars, State) ->
[] -> {State2, TupleType}
end;
map ->
- {State, t_map([])};
+ Entries = cerl:map_es(Tree),
+ MapFoldFun = fun(Entry, AccState) ->
+ AccState1 = state__set_in_match(AccState, false),
+ {AccState2, KeyVar} = traverse(cerl:map_pair_key(Entry),
+ DefinedVars, AccState1),
+ AccState3 = state__set_in_match(
+ AccState2, state__is_in_match(AccState)),
+ {AccState4, ValVar} = traverse(cerl:map_pair_val(Entry),
+ DefinedVars, AccState3),
+ {{KeyVar, ValVar}, AccState4}
+ end,
+ {Pairs, State1} = lists:mapfoldl(MapFoldFun, State, Entries),
+ %% We mustn't recurse into map arguments to matches. Not only are they
+ %% syntactically only allowed to be the literal #{}, but that would also
+ %% cause an infinite recursion, since traverse/3 unfolds literals with
+ %% maps in them using dialyzer_utils:reflow_pattern/1.
+ {State2, ArgVar} =
+ case state__is_in_match(State) of
+ false -> traverse(cerl:map_arg(Tree), DefinedVars, State1);
+ true -> {State1, t_map()}
+ end,
+ MapVar = mk_var(Tree),
+ MapType = ?mk_fun_var(
+ fun(Map) ->
+ lists:foldl(
+ fun({K,V}, TypeAcc) ->
+ t_map_put({lookup_type(K, Map),
+ lookup_type(V, Map)},
+ TypeAcc)
+ end, t_inf(t_map(), lookup_type(ArgVar, Map)),
+ Pairs)
+ end, [ArgVar | lists:append([[K,V] || {K,V} <- Pairs])]),
+ %% TODO: does the "same element appearing several times" problem apply
+ %% here too?
+ Fun =
+ fun({KeyVar, ValVar}, {AccState, ShadowKeys}) ->
+ %% If Val is known to be the last association of Key (i.e. Key
+ %% is not in ShadowKeys), Val must be a subtype of what is
+ %% associated to Key in Tree
+ TypeFun =
+ fun(Map) ->
+ KeyType = lookup_type(KeyVar, Map),
+ case t_is_singleton(KeyType) of
+ false -> t_any();
+ true ->
+ MT = t_inf(lookup_type(MapVar, Map), t_map()),
+ case t_is_none(MT) of
+ true -> t_none();
+ false ->
+ DisjointFromKeyType =
+ fun(ShadowKey) ->
+ t_is_none(t_inf(lookup_type(ShadowKey, Map),
+ KeyType))
+ end,
+ case lists:all(DisjointFromKeyType, ShadowKeys) of
+ true -> t_map_get(KeyType, MT);
+ %% A later association might shadow this one
+ false -> t_any()
+ end
+ end
+ end
+ end,
+ ValType = ?mk_fun_var(TypeFun, [KeyVar, MapVar | ShadowKeys]),
+ {state__store_conj(ValVar, sub, ValType, AccState),
+ [KeyVar | ShadowKeys]}
+ end,
+ %% Accumulate shadowing keys right-to-left
+ {State3, _} = lists:foldr(Fun, {State2, []}, Pairs),
+ %% In a map expression, Arg must contain all keys that are inserted with
+ %% the exact (:=) operator, and are known (i.e. are not in ShadowedKeys)
+ %% to not have been introduced by a previous association
+ State4 =
+ case state__is_in_match(State) of
+ true -> State3;
+ false ->
+ ArgFun =
+ fun(Map) ->
+ FoldFun =
+ fun({{KeyVar, _}, Entry}, {AccType, ShadowedKeys}) ->
+ OpTree = cerl:map_pair_op(Entry),
+ KeyType = lookup_type(KeyVar, Map),
+ AccType1 =
+ case cerl:is_literal(OpTree) andalso
+ cerl:concrete(OpTree) =:= exact of
+ true ->
+ case t_is_none(t_inf(ShadowedKeys, KeyType)) of
+ true ->
+ t_map_put({KeyType, t_any()}, AccType);
+ false ->
+ AccType
+ end;
+ false ->
+ AccType
+ end,
+ {AccType1, t_sup(KeyType, ShadowedKeys)}
+ end,
+ %% Accumulate shadowed keys left-to-right
+ {ResType, _} = lists:foldl(FoldFun, {t_map(), t_none()},
+ lists:zip(Pairs, Entries)),
+ ResType
+ end,
+ ArgType = ?mk_fun_var(ArgFun, [KeyVar || {KeyVar, _} <- Pairs]),
+ state__store_conj(ArgVar, sub, ArgType, State3)
+ end,
+ {state__store_conj(MapVar, sub, MapType, State4), MapVar};
values ->
%% We can get into trouble when unifying products that have the
%% same element appearing several times. Handle these cases by
@@ -827,11 +945,11 @@ get_safe_underapprox(Pats, Guard) ->
Map1 = cerl_trees:fold(fun(X, Acc) ->
case cerl:is_c_var(X) of
true ->
- dict:store(cerl_trees:get_label(X), t_any(),
- Acc);
+ maps:put(cerl_trees:get_label(X), t_any(),
+ Acc);
false -> Acc
end
- end, dict:new(), cerl:c_values(Pats)),
+ end, maps:new(), cerl:c_values(Pats)),
{Type, Map2} = get_underapprox_from_guard(Guard, Map1),
Map3 = case t_is_none(t_inf(t_from_term(true), Type)) of
true -> throw(dont_know);
@@ -839,8 +957,8 @@ get_safe_underapprox(Pats, Guard) ->
case cerl:is_c_var(Guard) of
false -> Map2;
true ->
- dict:store(cerl_trees:get_label(Guard),
- t_from_term(true), Map2)
+ maps:put(cerl_trees:get_label(Guard),
+ t_from_term(true), Map2)
end
end,
{Ts, _Map4} = get_safe_underapprox_1(Pats, [], Map3),
@@ -866,7 +984,7 @@ get_underapprox_from_guard(Tree, Map) ->
case t_is_none(Inf) of
true -> throw(dont_know);
false ->
- {True, dict:store(cerl_trees:get_label(Fun), Inf, Map1)}
+ {True, maps:put(cerl_trees:get_label(Fun), Inf, Map1)}
end
end;
MFA ->
@@ -882,7 +1000,7 @@ get_underapprox_from_guard(Tree, Map) ->
case cerl:is_literal(Arg) of
true -> {True, Map1};
false ->
- {True, dict:store(cerl_trees:get_label(Arg), Inf, Map1)}
+ {True, maps:put(cerl_trees:get_label(Arg), Inf, Map1)}
end
end;
error ->
@@ -914,7 +1032,7 @@ get_underapprox_from_guard(Tree, Map) ->
end;
var ->
Type =
- case dict:find(cerl_trees:get_label(Tree), Map) of
+ case maps:find(cerl_trees:get_label(Tree), Map) of
error -> throw(dont_know);
{ok, T} -> T
end,
@@ -948,6 +1066,7 @@ get_type_test({erlang, is_float, 1}) -> {ok, t_float()};
get_type_test({erlang, is_function, 1}) -> {ok, t_fun()};
get_type_test({erlang, is_integer, 1}) -> {ok, t_integer()};
get_type_test({erlang, is_list, 1}) -> {ok, t_list()};
+get_type_test({erlang, is_map, 1}) -> {ok, t_map()};
get_type_test({erlang, is_number, 1}) -> {ok, t_number()};
get_type_test({erlang, is_pid, 1}) -> {ok, t_pid()};
get_type_test({erlang, is_port, 1}) -> {ok, t_port()};
@@ -1004,7 +1123,9 @@ bitstr_val_constr(SizeType, UnitVal, Flags) ->
end
end.
-get_safe_underapprox_1([Pat|Left], Acc, Map) ->
+get_safe_underapprox_1([Pat0|Left], Acc, Map) ->
+ %% Maps should be treated as patterns, not as literals
+ Pat = dialyzer_utils:refold_pattern(Pat0),
case cerl:type(Pat) of
alias ->
APat = cerl:alias_pat(Pat),
@@ -1015,7 +1136,7 @@ get_safe_underapprox_1([Pat|Left], Acc, Map) ->
case t_is_none(Inf) of
true -> throw(dont_know);
false ->
- Map3 = dict:store(cerl_trees:get_label(AVar), Inf, Map2),
+ Map3 = maps:put(cerl_trees:get_label(AVar), Inf, Map2),
get_safe_underapprox_1(Left, [Inf|Acc], Map3)
end;
binary ->
@@ -1048,15 +1169,42 @@ get_safe_underapprox_1([Pat|Left], Acc, Map) ->
Type = t_tuple(Ts),
get_safe_underapprox_1(Left, [Type|Acc], Map1);
map ->
- %% TODO: Can maybe do something here
- throw(dont_know);
+ %% Some assertions in case the syntax gets more premissive in the future
+ true = #{} =:= cerl:concrete(cerl:map_arg(Pat)),
+ true = lists:all(fun(P) ->
+ cerl:is_literal(Op = cerl:map_pair_op(P)) andalso
+ exact =:= cerl:concrete(Op)
+ end, cerl:map_es(Pat)),
+ KeyTrees = lists:map(fun cerl:map_pair_key/1, cerl:map_es(Pat)),
+ ValTrees = lists:map(fun cerl:map_pair_val/1, cerl:map_es(Pat)),
+ %% Keys must not be underapproximated. Overapproximations are safe.
+ Keys = get_safe_overapprox(KeyTrees),
+ {Vals, Map1} = get_safe_underapprox_1(ValTrees, [], Map),
+ case lists:all(fun erl_types:t_is_singleton/1, Keys) of
+ false -> throw(dont_know);
+ true -> ok
+ end,
+ SortedPairs = lists:sort(lists:zip(Keys, Vals)),
+ %% We need to deal with duplicates ourselves
+ SquashDuplicates =
+ fun SquashDuplicates([{K,First},{K,Second}|List]) ->
+ case t_is_none(Inf = t_inf(First, Second)) of
+ true -> throw(dont_know);
+ false -> [{K, Inf}|SquashDuplicates(List)]
+ end;
+ SquashDuplicates([Good|Rest]) ->
+ [Good|SquashDuplicates(Rest)];
+ SquashDuplicates([]) -> []
+ end,
+ Type = t_map(SquashDuplicates(SortedPairs)),
+ get_safe_underapprox_1(Left, [Type|Acc], Map1);
values ->
Es = cerl:values_es(Pat),
{Ts, Map1} = get_safe_underapprox_1(Es, [], Map),
Type = t_product(Ts),
get_safe_underapprox_1(Left, [Type|Acc], Map1);
var ->
- case dict:find(cerl_trees:get_label(Pat), Map) of
+ case maps:find(cerl_trees:get_label(Pat), Map) of
error -> throw(dont_know);
{ok, VarType} -> get_safe_underapprox_1(Left, [VarType|Acc], Map)
end
@@ -1064,6 +1212,15 @@ get_safe_underapprox_1([Pat|Left], Acc, Map) ->
get_safe_underapprox_1([], Acc, Map) ->
{lists:reverse(Acc), Map}.
+get_safe_overapprox(Pats) ->
+ lists:map(fun get_safe_overapprox_1/1, Pats).
+
+get_safe_overapprox_1(Pat) ->
+ case cerl:is_literal(Lit = cerl:fold_literal(Pat)) of
+ true -> t_from_term(cerl:concrete(Lit));
+ false -> t_any()
+ end.
+
%%----------------------------------------
%% Guards
%%
@@ -1263,6 +1420,8 @@ get_bif_constr({erlang, is_integer, 1}, Dst, [Arg], State) ->
get_bif_test_constr(Dst, Arg, t_integer(), State);
get_bif_constr({erlang, is_list, 1}, Dst, [Arg], State) ->
get_bif_test_constr(Dst, Arg, t_maybe_improper_list(), State);
+get_bif_constr({erlang, is_map, 1}, Dst, [Arg], State) ->
+ get_bif_test_constr(Dst, Arg, t_map(), State);
get_bif_constr({erlang, is_number, 1}, Dst, [Arg], State) ->
get_bif_test_constr(Dst, Arg, t_number(), State);
get_bif_constr({erlang, is_pid, 1}, Dst, [Arg], State) ->
@@ -1644,12 +1803,16 @@ solve([Fun], State) ->
solve([_|_] = SCC, State) ->
?debug("============ Analyzing SCC: ~w ===========\n",
[[debug_lookup_name(F) || F <- SCC]]),
- {Parallel, NewState} =
- case parallel_split(SCC) of
- false -> {false, State};
- SplitSCC -> {SplitSCC, minimize_state(State)}
- end,
- solve_scc(SCC, Parallel, map_new(), NewState, false).
+ Users = comp_users(SCC, State),
+ solve_scc(SCC, map_new(), State, Users, _ToSolve=SCC, false).
+
+comp_users(SCC, State) ->
+ Vars0 = [{Fun, state__get_rec_var(Fun, State)} || Fun <- SCC],
+ Vars = lists:sort([t_var_name(Var) || {_, {ok, Var}} <- Vars0]),
+ family([{t_var(V), F} ||
+ F <- SCC,
+ V <- ordsets:intersection(get_deps(state__get_cs(F, State)),
+ Vars)]).
solve_fun(Fun, FunMap, State) ->
Cs = state__get_cs(Fun, State),
@@ -1664,7 +1827,7 @@ solve_fun(Fun, FunMap, State) ->
end,
enter_type(Fun, NewType, NewFunMap1).
-solve_scc(SCC, Parallel, Map, State, TryingUnit) ->
+solve_scc(SCC, Map, State, Users, ToSolve, TryingUnit) ->
Vars0 = [{Fun, state__get_rec_var(Fun, State)} || Fun <- SCC],
Vars = [Var || {_, {ok, Var}} <- Vars0],
Funs = [Fun || {Fun, {ok, _}} <- Vars0],
@@ -1672,16 +1835,13 @@ solve_scc(SCC, Parallel, Map, State, TryingUnit) ->
RecTypes = [t_limit(Type, ?TYPE_LIMIT) || Type <- Types],
CleanMap = lists:foldl(fun(Fun, AccFunMap) ->
erase_type(t_var_name(Fun), AccFunMap)
- end, Map, SCC),
+ end, Map, ToSolve),
Map1 = enter_type_lists(Vars, RecTypes, CleanMap),
?debug("Checking SCC: ~w\n", [[debug_lookup_name(F) || F <- SCC]]),
- FunSet = ordsets:from_list([t_var_name(F) || F <- SCC]),
- Map2 =
- case Parallel of
- false -> solve_whole_scc(SCC, Map1, State);
- SplitSCC -> solve_whole_scc_parallel(SplitSCC, Map1, State)
- end,
- case maps_are_equal(Map2, Map, FunSet) of
+ SolveFun = fun(X, Y) -> scc_fold_fun(X, Y, State) end,
+ Map2 = lists:foldl(SolveFun, Map1, ToSolve),
+ Updated = updated_vars_only(Vars, Map, Map2),
+ case Updated =:= [] of
true ->
?debug("SCC ~w reached fixpoint\n", [SCC]),
NewTypes = unsafe_lookup_type_list(Funs, Map2),
@@ -1694,130 +1854,21 @@ solve_scc(SCC, Parallel, Map, State, TryingUnit) ->
true -> t_fun(t_fun_args(T), t_unit())
end || T <- NewTypes],
Map3 = enter_type_lists(Funs, UnitTypes, Map2),
- solve_scc(SCC, Parallel, Map3, State, true);
+ solve_scc(SCC, Map3, State, Users, SCC, true);
false ->
- case Parallel of
- false -> true;
- _ -> dispose_state(State)
- end,
Map2
end;
false ->
?debug("SCC ~w did not reach fixpoint\n", [SCC]),
- solve_scc(SCC, Parallel, Map2, State, TryingUnit)
- end.
-
-solve_whole_scc(SCC, Map, State) ->
- SolveFun = fun(X, Y) -> scc_fold_fun(X, Y, State) end,
- lists:foldl(SolveFun, Map, SCC).
-
-%%------------------------------------------------------------------------------
-
--define(worth_it, 42).
-
-parallel_split(SCC) ->
- Length = length(SCC),
- case Length > 2*?worth_it of
- false -> false;
- true ->
- case min(dialyzer_utils:parallelism(), 8) of
- 1 -> false;
- CPUs ->
- FullShare = Length div CPUs + 1,
- Unit = max(FullShare, ?worth_it),
- split(SCC, Unit, [])
- end
- end.
-
-minimize_state(#state{
- cmap = {d, CMap},
- fun_map = FunMap,
- fun_arities = FunArities,
- self_rec = SelfRec,
- prop_types = {d, PropTypes},
- solvers = Solvers
- }) ->
- Opts = [{read_concurrency, true}],
- ETSCMap = ets:new(cmap, Opts),
- ETSPropTypes = ets:new(prop_types, Opts),
- true = ets:insert(ETSCMap, dict:to_list(CMap)),
- true = ets:insert(ETSPropTypes, dict:to_list(PropTypes)),
- #state
- {cmap = {e, ETSCMap},
- fun_map = FunMap,
- fun_arities = FunArities,
- self_rec = SelfRec,
- prop_types = {e, ETSPropTypes},
- solvers = Solvers,
- callgraph = undefined,
- plt = undefined,
- mfas = []
- }.
-
-dispose_state(#state{cmap = {e, ETSCMap},
- prop_types = {e, ETSPropTypes}}) ->
- true = ets:delete(ETSCMap),
- true = ets:delete(ETSPropTypes).
-
-solve_whole_scc_parallel(SplitSCC, Map, State) ->
- Workers = spawn_workers(SplitSCC, Map, State),
- wait_results(Workers, Map, fold_res_fun(State)).
-
-spawn_workers(SplitSCC, Map, State) ->
- Spawner = solve_scc_spawner(self(), Map, State),
- lists:foreach(Spawner, SplitSCC),
- length(SplitSCC).
-
-wait_results(0, Map, _FoldResFun) ->
- Map;
-wait_results(Pending, Map, FoldResFun) ->
- Res = receive_scc_result(),
- NewMap = lists:foldl(FoldResFun, Map, Res),
- wait_results(Pending-1, NewMap, FoldResFun).
-
-solve_scc_spawner(Parent, Map, State) ->
- fun(SCCPart) ->
- spawn_link(fun() -> solve_scc_worker(Parent, SCCPart, Map, State) end)
- end.
-
-split([], _Unit, Acc) ->
- Acc;
-split(List, Unit, Acc) ->
- {Taken, Rest} =
- try
- lists:split(Unit, List)
- catch
- _:_ -> {List, []}
- end,
- split(Rest, Unit, [Taken|Acc]).
-
-solve_scc_worker(Parent, SCCPart, Map, State) ->
- SolveFun = fun(X, Y) -> scc_fold_fun(X, Y, State) end,
- FinalMap = lists:foldl(SolveFun, Map, SCCPart),
- Res =
- [{F, t_limit(unsafe_lookup_type(F, FinalMap), ?TYPE_LIMIT)} ||
- F <- SCCPart],
- send_scc_result(Parent, Res).
-
-fold_res_fun(State) ->
- fun({F, Type}, Map) ->
- case state__get_rec_var(F, State) of
- {ok, R} ->
- enter_type(R, Type, enter_type(F, Type, Map));
- error ->
- enter_type(F, Type, Map)
- end
+ ToSolve1 = affected(Updated, Users),
+ solve_scc(SCC, Map2, State, Users, ToSolve1, TryingUnit)
end.
-receive_scc_result() ->
- receive
- {scc_fun, Res} -> Res
- end.
-
-send_scc_result(Parent, Res) ->
- Parent ! {scc_fun, Res}.
-
-%%------------------------------------------------------------------------------
+affected(Updated, Users) ->
+ lists:umerge([case lists:keyfind(V, 1, Users) of
+ {V, Vs} -> Vs;
+ false -> []
+ end || V <- Updated]).
scc_fold_fun(F, FunMap, State) ->
Deps = get_deps(state__get_cs(F, State)),
@@ -1859,7 +1910,7 @@ solver(Solver, SolveFun) ->
solve_fun(v1, _Fun, Cs, FunMap, State) ->
fun() ->
- {ok, _MapDict, NewMap} = solve_ref_or_list(Cs, FunMap, dict:new(), State),
+ {ok, _MapDict, NewMap} = solve_ref_or_list(Cs, FunMap, map_new(), State),
{ok, NewMap}
end;
solve_fun(v2, Fun, _Cs, FunMap, State) ->
@@ -1899,8 +1950,8 @@ sane_maps(Map1, Map2, Keys, _S1, _S2) ->
%% Solver v2
--record(v2_state, {constr_data = dict:new() :: dict:dict(),
- state :: #state{}}).
+-record(v2_state, {constr_data = maps:new() :: map(),
+ state :: state()}).
v2_solve_ref(Fun, Map, State) ->
V2State = #v2_state{state = State},
@@ -2061,30 +2112,30 @@ v2_solve_disj(Is, [C|Cs], I, Map, V2State, UL, MapL, Eval, Uneval0, Failed) ->
v2_solve_disj(Is, Cs, I+1, Map, V2State, UL, MapL, Eval, Uneval, Failed).
save_local_map(#v2_state{constr_data = ConData}=V2State, Id, U, Map) ->
- Part0 = [{V,dict:fetch(V, Map)} || V <- U],
+ Part0 = [{V,maps:get(V, Map)} || V <- U],
Part1 =
- case dict:find(Id, ConData) of
+ case maps:find(Id, ConData) of
error -> []; % cannot happen
{ok, {Part2,[]}} -> Part2
end,
?debug("save local map Id=~w:\n", [Id]),
Part = lists:ukeymerge(1, lists:keysort(1, Part0), Part1),
- pp_map("New Part", dict:from_list(Part0)),
- pp_map("Old Part", dict:from_list(Part1)),
- pp_map(" => Part", dict:from_list(Part)),
- V2State#v2_state{constr_data = dict:store(Id, {Part,[]}, ConData)}.
+ pp_map("New Part", maps:from_list(Part0)),
+ pp_map("Old Part", maps:from_list(Part1)),
+ pp_map(" => Part", maps:from_list(Part)),
+ V2State#v2_state{constr_data = maps:put(Id, {Part,[]}, ConData)}.
restore_local_map(#v2_state{constr_data = ConData}, Id, Map0) ->
- case dict:find(Id, ConData) of
+ case maps:find(Id, ConData) of
error -> Map0;
{ok, failed} -> Map0;
{ok, {[],_}} -> Map0;
{ok, {Part0,U}} ->
Part = [KV || {K,_V} = KV <- Part0, not lists:member(K, U)],
?debug("restore local map Id=~w U=~w\n", [Id, U]),
- pp_map("Part", dict:from_list(Part)),
+ pp_map("Part", maps:from_list(Part)),
pp_map("Map0", Map0),
- Map = lists:foldl(fun({K,V}, D) -> dict:store(K, V, D) end, Map0, Part),
+ Map = lists:foldl(fun({K,V}, D) -> maps:put(K, V, D) end, Map0, Part),
pp_map("Map", Map),
Map
end.
@@ -2164,31 +2215,26 @@ report_detected_loop(_) ->
add_mask_to_flags(Flags, [Im|M], I, L) when I > Im ->
add_mask_to_flags(Flags, M, I, [Im|L]);
add_mask_to_flags(Flags, [_|M], _I, L) ->
- {lists:umerge(Flags, M), lists:reverse(L)}.
+ {lists:umerge(M, Flags), lists:reverse(L)}.
-get_mask(V, {d, Masks}) ->
- case dict:find(V, Masks) of
+get_mask(V, Masks) ->
+ case maps:find(V, Masks) of
error -> [];
{ok, M} -> M
- end;
-get_mask(V, Masks) ->
- case lists:keyfind(V, 1, Masks) of
- false -> [];
- {V, M} -> M
end.
get_flags(#v2_state{constr_data = ConData}=V2State0, C) ->
#constraint_list{id = Id, list = Cs, masks = Masks} = C,
- case dict:find(Id, ConData) of
+ case maps:find(Id, ConData) of
error ->
?debug("get_flags Id=~w Flags=all ~w\n", [Id, length(Cs)]),
- V2State = V2State0#v2_state{constr_data = dict:store(Id, {[],[]}, ConData)},
+ V2State = V2State0#v2_state{constr_data = maps:put(Id, {[],[]}, ConData)},
{V2State, lists:seq(1, length(Cs))};
{ok, failed} ->
{V2State0, failed_list};
{ok, {Part,U}} when U =/= [] ->
?debug("get_flags Id=~w U=~w\n", [Id, U]),
- V2State = V2State0#v2_state{constr_data = dict:store(Id, {Part,[]}, ConData)},
+ V2State = V2State0#v2_state{constr_data = maps:put(Id, {Part,[]}, ConData)},
save_updated_vars_list(Cs, vars_per_child(U, Masks), V2State)
end.
@@ -2217,13 +2263,13 @@ save_updated_vars(#constraint_ref{id = Id}, U, V2State) ->
save_updated_vars1(V2State, C, U) ->
#v2_state{constr_data = ConData} = V2State,
#constraint_list{id = Id} = C,
- case dict:find(Id, ConData) of
+ case maps:find(Id, ConData) of
error -> V2State; % error means everything is flagged
{ok, failed} -> V2State;
{ok, {Part,U0}} ->
%% Duplicates are not so common; let masks/2 remove them.
U1 = U ++ U0,
- V2State#v2_state{constr_data = dict:store(Id, {Part,U1}, ConData)}
+ V2State#v2_state{constr_data = maps:put(Id, {Part,U1}, ConData)}
end.
-ifdef(DEBUG).
@@ -2233,12 +2279,12 @@ pp_constr_data(_Tag, #v2_state{constr_data = D}) ->
case _PartU of
{_Part, _U} ->
io:format("Id: ~w Vars: ~w\n", [_Id, _U]),
- [pp_map("Part", dict:from_list(_Part)) || _Part =/= []];
+ [pp_map("Part", maps:from_list(_Part)) || _Part =/= []];
failed ->
io:format("Id: ~w failed list\n", [_Id])
end
end ||
- {_Id, _PartU} <- lists:keysort(1, dict:to_list(D))],
+ {_Id, _PartU} <- lists:keysort(1, maps:to_list(D))],
ok.
-else.
@@ -2248,17 +2294,17 @@ pp_constr_data(_Tag, _V2State) ->
failed_list(#constraint_list{id = Id}, #v2_state{constr_data = D}=V2State) ->
?debug("error list ~w~n", [Id]),
- V2State#v2_state{constr_data = dict:store(Id, failed, D)}.
+ V2State#v2_state{constr_data = maps:put(Id, failed, D)}.
is_failed_list(#constraint_list{id = Id}, #v2_state{constr_data = D}) ->
- dict:find(Id, D) =:= {ok, failed}.
+ maps:find(Id, D) =:= {ok, failed}.
%% Solver v1
solve_ref_or_list(#constraint_ref{id = Id, deps = Deps},
Map, MapDict, State) ->
{OldLocalMap, Check} =
- case dict:find(Id, MapDict) of
+ case maps:find(Id, MapDict) of
error -> {map_new(), false};
{ok, M} -> {M, true}
end,
@@ -2304,12 +2350,12 @@ solve_ref_or_list(#constraint_ref{id = Id, deps = Deps},
{ok, Var} -> enter_type(Var, FunType, NewMap1);
error -> NewMap1
end,
- {ok, dict:store(Id, NewMap2, NewMapDict), NewMap2}
+ {ok, maps:put(Id, NewMap2, NewMapDict), NewMap2}
end;
solve_ref_or_list(#constraint_list{type=Type, list = Cs, deps = Deps, id = Id},
Map, MapDict, State) ->
{OldLocalMap, Check} =
- case dict:find(Id, MapDict) of
+ case maps:find(Id, MapDict) of
error -> {map_new(), false};
{ok, M} -> {M, true}
end,
@@ -2359,7 +2405,7 @@ solve_self_recursive(Cs, Map, MapDict, Id, RecType0, State) ->
solve_clist(Cs, conj, Id, Deps, MapDict, Map, State) ->
case solve_cs(Cs, Map, MapDict, State) of
{error, NewMapDict} ->
- {error, dict:store(Id, error, NewMapDict)};
+ {error, maps:put(Id, error, NewMapDict)};
{ok, NewMapDict, NewMap} = Ret ->
case Cs of
[_] ->
@@ -2367,7 +2413,7 @@ solve_clist(Cs, conj, Id, Deps, MapDict, Map, State) ->
Ret;
_ ->
case maps_are_equal(Map, NewMap, Deps) of
- true -> {ok, dict:store(Id, NewMap, NewMapDict), NewMap};
+ true -> {ok, maps:put(Id, NewMap, NewMapDict), NewMap};
false -> solve_clist(Cs, conj, Id, Deps, NewMapDict, NewMap, State)
end
end
@@ -2381,10 +2427,10 @@ solve_clist(Cs, disj, Id, _Deps, MapDict, Map, State) ->
end,
{Maps, NewMapDict} = lists:mapfoldl(Fun, MapDict, Cs),
case [X || {ok, X} <- Maps] of
- [] -> {error, dict:store(Id, error, NewMapDict)};
+ [] -> {error, maps:put(Id, error, NewMapDict)};
MapList ->
NewMap = join_maps(MapList),
- {ok, dict:store(Id, NewMap, NewMapDict), NewMap}
+ {ok, maps:put(Id, NewMap, NewMapDict), NewMap}
end.
solve_cs([#constraint_ref{} = C|Tail], Map, MapDict, State) ->
@@ -2465,7 +2511,7 @@ report_failed_constraint(_C, _Map) ->
%% ============================================================================
map_new() ->
- dict:new().
+ maps:new().
join_maps([Map]) ->
Map;
@@ -2475,9 +2521,9 @@ join_maps(Maps) ->
constrained_keys(Maps) ->
lists:foldl(fun(TmpMap, AccKeys) ->
- [Key || Key <- AccKeys, dict:is_key(Key, TmpMap)]
+ [Key || Key <- AccKeys, maps:is_key(Key, TmpMap)]
end,
- dict:fetch_keys(hd(Maps)), tl(Maps)).
+ maps:keys(hd(Maps)), tl(Maps)).
join_maps([Key|Left], Maps = [Map|MapsLeft], AccMap) ->
NewType = join_one_key(Key, MapsLeft, lookup_type(Key, Map)),
@@ -2523,11 +2569,11 @@ prune_keys(Map1, Map2, Deps) ->
NofDeps = length(Deps),
case NofDeps > ?PRUNE_LIMIT of
true ->
- Keys1 = dict:fetch_keys(Map1),
+ Keys1 = maps:keys(Map1),
case length(Keys1) > NofDeps of
true ->
Set1 = lists:sort(Keys1),
- Set2 = lists:sort(dict:fetch_keys(Map2)),
+ Set2 = lists:sort(maps:keys(Map2)),
ordsets:intersection(ordsets:union(Set1, Set2), Deps);
false ->
Deps
@@ -2548,7 +2594,7 @@ enter_type(Key, Val, Map) when is_integer(Key) ->
true -> ok;
false -> ?debug("LimitedVal ~s\n", [format_type(LimitedVal)])
end,
- case dict:find(Key, Map) of
+ case maps:find(Key, Map) of
{ok, Value} ->
case is_equal(Value, LimitedVal) of
true -> Map;
@@ -2582,16 +2628,16 @@ enter_type2(Key, Val, Map) ->
map_store(Key, Val, Map) ->
?debug("Storing ~w :: ~s\n", [Key, format_type(Val)]),
- dict:store(Key, Val, Map).
+ maps:put(Key, Val, Map).
erase_type(Key, Map) ->
- dict:erase(Key, Map).
+ maps:remove(Key, Map).
lookup_type_list(List, Map) ->
[lookup_type(X, Map) || X <- List].
unsafe_lookup_type(Key, Map) ->
- case dict:find(t_var_name(Key), Map) of
+ case maps:find(t_var_name(Key), Map) of
{ok, Type} -> Type;
error -> t_none()
end.
@@ -2600,7 +2646,7 @@ unsafe_lookup_type_list(List, Map) ->
[unsafe_lookup_type(X, Map) || X <- List].
lookup_type(Key, Map) when is_integer(Key) ->
- case dict:find(Key, Map) of
+ case maps:find(Key, Map) of
error -> t_any();
{ok, Val} -> Val
end;
@@ -2648,7 +2694,7 @@ is_equal(Type1, Type2) ->
pp_map(_S, _Map) ->
?debug("\t~s: ~p\n",
[_S, [{X, lists:flatten(format_type(Y))} ||
- {X, Y} <- lists:keysort(1, dict:to_list(_Map))]]).
+ {X, Y} <- lists:keysort(1, maps:to_list(_Map))]]).
%% ============================================================================
%%
@@ -2658,7 +2704,7 @@ pp_map(_S, _Map) ->
new_state(SCC0, NextLabel, CallGraph, Plt, PropTypes, Solvers) ->
List = [{MFA, Var} || {MFA, {Var, _Fun}, _Rec} <- SCC0],
- NameMap = dict:from_list(List),
+ NameMap = maps:from_list(List),
MFAs = [MFA || {MFA, _Var} <- List],
SCC = [mk_var(Fun) || {_MFA, {_Var, Fun}, _Rec} <- SCC0],
SelfRec =
@@ -2672,7 +2718,7 @@ new_state(SCC0, NextLabel, CallGraph, Plt, PropTypes, Solvers) ->
_Many -> false
end,
#state{callgraph = CallGraph, name_map = NameMap, next_label = NextLabel,
- prop_types = {d, PropTypes}, plt = Plt, scc = ordsets:from_list(SCC),
+ prop_types = PropTypes, plt = Plt, scc = ordsets:from_list(SCC),
mfas = MFAs, self_rec = SelfRec, solvers = Solvers}.
state__set_rec_dict(State, RecDict) ->
@@ -2700,15 +2746,15 @@ state__get_fun_prototype(Op, Arity, State) ->
end.
state__lookup_rec_var_in_scope(MFA, #state{name_map = NameMap}) ->
- dict:find(MFA, NameMap).
+ maps:find(MFA, NameMap).
state__store_fun_arity(Tree, #state{fun_arities = Map} = State) ->
Arity = length(cerl:fun_vars(Tree)),
Id = mk_var(Tree),
- State#state{fun_arities = dict:store(Id, Arity, Map)}.
+ State#state{fun_arities = maps:put(Id, Arity, Map)}.
state__fun_arity(Id, #state{fun_arities = Map}) ->
- dict:fetch(Id, Map).
+ maps:get(Id, Map).
state__lookup_undef_var(Tree, #state{callgraph = CG, plt = Plt}) ->
Label = cerl_trees:get_label(Tree),
@@ -2768,21 +2814,14 @@ state__plt(#state{plt = PLT}) ->
state__new_constraint_context(State) ->
State#state{cs = []}.
-state__prop_domain(FunLabel, #state{prop_types = {e, ETSPropTypes}}) ->
- try ets:lookup_element(ETSPropTypes, FunLabel, 2) of
- {_Range_Fun, Dom} -> {ok, Dom};
- FunType -> {ok, t_fun_args(FunType)}
- catch
- _:_ -> error
- end;
-state__prop_domain(FunLabel, #state{prop_types = {d, PropTypes}}) ->
+state__prop_domain(FunLabel, #state{prop_types = PropTypes}) ->
case dict:find(FunLabel, PropTypes) of
error -> error;
{ok, {_Range_Fun, Dom}} -> {ok, Dom};
{ok, FunType} -> {ok, t_fun_args(FunType)}
end.
-state__add_prop_constrs(Tree, #state{prop_types = {d, PropTypes}} = State) ->
+state__add_prop_constrs(Tree, #state{prop_types = PropTypes} = State) ->
Label = cerl_trees:get_label(Tree),
case dict:find(Label, PropTypes) of
error -> State;
@@ -2845,14 +2884,12 @@ state__mk_vars(N, #state{next_label = NL} = State) ->
Vars = [t_var(X) || X <- lists:seq(NL, NewLabel-1)],
{State#state{next_label = NewLabel}, Vars}.
-state__store_constrs(Id, Cs, #state{cmap = {d, Dict}} = State) ->
- NewDict = dict:store(Id, Cs, Dict),
- State#state{cmap = {d, NewDict}}.
+state__store_constrs(Id, Cs, #state{cmap = Map} = State) ->
+ NewMap = maps:put(Id, Cs, Map),
+ State#state{cmap = NewMap}.
-state__get_cs(Var, #state{cmap = {e, ETSDict}}) ->
- ets:lookup_element(ETSDict, Var, 2);
-state__get_cs(Var, #state{cmap = {d, Dict}}) ->
- dict:fetch(Var, Dict).
+state__get_cs(Var, #state{cmap = Map}) ->
+ maps:get(Var, Map).
state__is_self_rec(Fun, #state{self_rec = SelfRec}) ->
not (SelfRec =:= 'false') andalso is_equal(Fun, SelfRec).
@@ -2861,15 +2898,12 @@ state__store_funs(Vars0, Funs0, #state{fun_map = Map} = State) ->
debug_make_name_map(Vars0, Funs0),
Vars = mk_var_list(Vars0),
Funs = mk_var_list(Funs0),
- NewMap = lists:foldl(fun({Var, Fun}, MP) -> orddict:store(Var, Fun, MP) end,
+ NewMap = lists:foldl(fun({Var, Fun}, MP) -> maps:put(Fun, Var, MP) end,
Map, lists:zip(Vars, Funs)),
State#state{fun_map = NewMap}.
state__get_rec_var(Fun, #state{fun_map = Map}) ->
- case [V || {V, FV} <- Map, FV =:= Fun] of
- [Var] -> {ok, Var};
- [] -> error
- end.
+ maps:find(Fun, Map).
state__finalize(State) ->
State1 = enumerate_constraints(State),
@@ -2936,13 +2970,13 @@ mk_fun_var(Fun, Types) ->
-endif.
--spec get_deps(constr()) -> [dep()].
+-spec get_deps(constr()) -> deps().
get_deps(#constraint{deps = D}) -> D;
get_deps(#constraint_list{deps = D}) -> D;
get_deps(#constraint_ref{deps = D}) -> D.
--spec find_constraint_deps([fvar_or_type()]) -> [dep()].
+-spec find_constraint_deps([fvar_or_type()]) -> deps().
find_constraint_deps(List) ->
ordsets:from_list(find_constraint_deps(List, [])).
@@ -2975,13 +3009,24 @@ mk_constraint_ref(Id, Deps) ->
mk_constraint_list(Type, List) ->
List1 = ordsets:from_list(lift_lists(Type, List)),
- List2 = ordsets:filter(fun(X) -> get_deps(X) =/= [] end, List1),
- Deps = calculate_deps(List2),
+ case Type of
+ conj ->
+ List2 = ordsets:filter(fun(X) -> get_deps(X) =/= [] end, List1),
+ mk_constraint_list_cont(Type, List2);
+ disj ->
+ case lists:any(fun(X) -> get_deps(X) =:= [] end, List1) of
+ true -> mk_constraint_list_cont(Type, [mk_constraint_any(eq)]);
+ false -> mk_constraint_list_cont(Type, List1)
+ end
+ end.
+
+mk_constraint_list_cont(Type, List) ->
+ Deps = calculate_deps(List),
case Deps =:= [] of
true -> #constraint_list{type = conj,
list = [mk_constraint_any(eq)],
deps = []};
- false -> #constraint_list{type = Type, list = List2, deps = Deps}
+ false -> #constraint_list{type = Type, list = List, deps = Deps}
end.
lift_lists(Type, List) ->
@@ -3179,18 +3224,11 @@ order_fun_constraints([], Funs, Acc, State) ->
update_masks(C, Masks) ->
C#constraint_list{masks = Masks}.
--define(VARS_LIMIT, 50).
-
calculate_masks([C|Cs], I, L0) ->
calculate_masks(Cs, I+1, [{V, I} || V <- get_deps(C)] ++ L0);
calculate_masks([], _I, L) ->
M = family(L),
- case length(M) > ?VARS_LIMIT of
- true ->
- {d, dict:from_list(M)};
- false ->
- M
- end.
+ maps:from_list(M).
%% ============================================================================
%%
@@ -3263,6 +3301,15 @@ find_constraint(Tuple, [#constraint_list{list = List}|Cs]) ->
find_constraint(Tuple, [_|Cs]) ->
find_constraint(Tuple, Cs).
+-spec fold_literal_maybe_match(cerl:cerl(), state()) -> cerl:cerl().
+
+fold_literal_maybe_match(Tree0, State) ->
+ Tree1 = cerl:fold_literal(Tree0),
+ case state__is_in_match(State) of
+ false -> Tree1;
+ true -> dialyzer_utils:refold_pattern(Tree1)
+ end.
+
lookup_record(Records, Tag, Arity) ->
case erl_types:lookup_record(Tag, Arity, Records) of
{ok, Fields} ->
@@ -3309,7 +3356,7 @@ join_chars([H|T], Sep) ->
[H|[[Sep,X] || X <- T]].
debug_lookup_name(Var) ->
- case dict:find(t_var_name(Var), get(dialyzer_typesig_map)) of
+ case maps:find(t_var_name(Var), get(dialyzer_typesig_map)) of
error -> Var;
{ok, Name} -> Name
end.
@@ -3319,7 +3366,7 @@ debug_lookup_name(Var) ->
debug_make_name_map(Vars, Funs) ->
Map = get(dialyzer_typesig_map),
NewMap =
- if Map =:= undefined -> debug_make_name_map(Vars, Funs, dict:new());
+ if Map =:= undefined -> debug_make_name_map(Vars, Funs, maps:new());
true -> debug_make_name_map(Vars, Funs, Map)
end,
put(dialyzer_typesig_map, NewMap).
@@ -3327,7 +3374,7 @@ debug_make_name_map(Vars, Funs) ->
debug_make_name_map([Var|VarLeft], [Fun|FunLeft], Map) ->
Name = {cerl:fname_id(Var), cerl:fname_arity(Var)},
FunLabel = cerl_trees:get_label(Fun),
- debug_make_name_map(VarLeft, FunLeft, dict:store(FunLabel, Name, Map));
+ debug_make_name_map(VarLeft, FunLeft, maps:put(FunLabel, Name, Map));
debug_make_name_map([], [], Map) ->
Map.
diff --git a/lib/dialyzer/src/dialyzer_utils.erl b/lib/dialyzer/src/dialyzer_utils.erl
index 5fc1c0e691..d37701f03b 100644
--- a/lib/dialyzer/src/dialyzer_utils.erl
+++ b/lib/dialyzer/src/dialyzer_utils.erl
@@ -49,6 +49,7 @@
process_record_remote_types/1,
sets_filter/2,
src_compiler_opts/0,
+ refold_pattern/1,
parallelism/0,
family/1
]).
@@ -752,6 +753,13 @@ pp_hook(Node, Ctxt, Cont) ->
pp_binary(Node, Ctxt, Cont);
bitstr ->
pp_segment(Node, Ctxt, Cont);
+ map ->
+ pp_map(Node, Ctxt, Cont);
+ literal ->
+ case is_map(cerl:concrete(Node)) of
+ true -> pp_map(Node, Ctxt, Cont);
+ false -> Cont(Node, Ctxt)
+ end;
_ ->
Cont(Node, Ctxt)
end.
@@ -832,6 +840,87 @@ pp_atom(Atom) ->
String = atom_to_list(cerl:atom_val(Atom)),
prettypr:text(String).
+pp_map(Node, Ctxt, Cont) ->
+ Arg = cerl:map_arg(Node),
+ Before = case cerl:is_c_map_empty(Arg) of
+ true -> prettypr:floating(prettypr:text("#{"));
+ false ->
+ prettypr:beside(Cont(Arg,Ctxt),
+ prettypr:floating(prettypr:text("#{")))
+ end,
+ prettypr:beside(
+ Before, prettypr:beside(
+ prettypr:par(seq(cerl:map_es(Node),
+ prettypr:floating(prettypr:text(",")),
+ Ctxt, Cont)),
+ prettypr:floating(prettypr:text("}")))).
+
+seq([H | T], Separator, Ctxt, Fun) ->
+ case T of
+ [] -> [Fun(H, Ctxt)];
+ _ -> [prettypr:beside(Fun(H, Ctxt), Separator)
+ | seq(T, Separator, Ctxt, Fun)]
+ end;
+seq([], _, _, _) ->
+ [prettypr:empty()].
+
+%%------------------------------------------------------------------------------
+
+-spec refold_pattern(cerl:cerl()) -> cerl:cerl().
+
+refold_pattern(Pat) ->
+ %% Avoid the churn of unfolding and refolding
+ case cerl:is_literal(Pat) andalso find_map(cerl:concrete(Pat)) of
+ true ->
+ Tree = refold_concrete_pat(cerl:concrete(Pat)),
+ PatAnn = cerl:get_ann(Pat),
+ case proplists:is_defined(label, PatAnn) of
+ %% Literals are not normally annotated with a label, but can be if, for
+ %% example, they were created by cerl:fold_literal/1.
+ true -> cerl:set_ann(Tree, PatAnn);
+ false ->
+ [{label, Label}] = cerl:get_ann(Tree),
+ cerl:set_ann(Tree, [{label, Label}|PatAnn])
+ end;
+ false -> Pat
+ end.
+
+find_map(#{}) -> true;
+find_map(Tuple) when is_tuple(Tuple) -> find_map(tuple_to_list(Tuple));
+find_map([H|T]) -> find_map(H) orelse find_map(T);
+find_map(_) -> false.
+
+refold_concrete_pat(Val) ->
+ case Val of
+ _ when is_tuple(Val) ->
+ Els = lists:map(fun refold_concrete_pat/1, tuple_to_list(Val)),
+ case lists:all(fun cerl:is_literal/1, Els) of
+ true -> cerl:abstract(Val);
+ false -> label(cerl:c_tuple_skel(Els))
+ end;
+ [H|T] ->
+ case cerl:is_literal(HP=refold_concrete_pat(H))
+ and cerl:is_literal(TP=refold_concrete_pat(T))
+ of
+ true -> cerl:abstract(Val);
+ false -> label(cerl:c_cons_skel(HP, TP))
+ end;
+ M when is_map(M) ->
+ %% Map patterns are not generated by the parser(!), but they have a
+ %% property we want, namely that they are never folded into literals.
+ %% N.B.: The key in a map pattern is an expression, *not* a pattern.
+ label(cerl:c_map_pattern([cerl:c_map_pair_exact(cerl:abstract(K),
+ refold_concrete_pat(V))
+ || {K, V} <- maps:to_list(M)]));
+ _ ->
+ cerl:abstract(Val)
+ end.
+
+label(Tree) ->
+ %% Sigh
+ Label = -erlang:unique_integer([positive]),
+ cerl:set_ann(Tree, [{label, Label}]).
+
%%------------------------------------------------------------------------------
-spec parallelism() -> integer().
diff --git a/lib/dialyzer/test/behaviour_SUITE_data/results/supervisor_incorrect_return b/lib/dialyzer/test/behaviour_SUITE_data/results/supervisor_incorrect_return
index 89eb295604..638d031923 100644
--- a/lib/dialyzer/test/behaviour_SUITE_data/results/supervisor_incorrect_return
+++ b/lib/dialyzer/test/behaviour_SUITE_data/results/supervisor_incorrect_return
@@ -1,2 +1,2 @@
-supervisor_incorrect_return.erl:14: The inferred return type of init/1 ({'ok',{{'one_against_one',0,1},[{_,_,_,_,_,_},...]}}) has nothing in common with 'ignore' | {'ok',{{'one_for_all',non_neg_integer(),pos_integer()} | {'one_for_one',non_neg_integer(),pos_integer()} | {'rest_for_one',non_neg_integer(),pos_integer()} | {'simple_one_for_one',non_neg_integer(),pos_integer()} | #{},[{_,{atom(),atom(),'undefined' | [any()]},'permanent' | 'temporary' | 'transient','brutal_kill' | 'infinity' | non_neg_integer(),'supervisor' | 'worker','dynamic' | [atom()]} | #{}]}}, which is the expected return type for the callback of supervisor behaviour
+supervisor_incorrect_return.erl:14: The inferred return type of init/1 ({'ok',{{'one_against_one',0,1},[{_,_,_,_,_,_},...]}}) has nothing in common with 'ignore' | {'ok',{{'one_for_all',non_neg_integer(),pos_integer()} | {'one_for_one',non_neg_integer(),pos_integer()} | {'rest_for_one',non_neg_integer(),pos_integer()} | {'simple_one_for_one',non_neg_integer(),pos_integer()} | #{'intensity'=>non_neg_integer(), 'period'=>pos_integer(), 'strategy'=>'one_for_all' | 'one_for_one' | 'rest_for_one' | 'simple_one_for_one'},[{_,{atom(),atom(),'undefined' | [any()]},'permanent' | 'temporary' | 'transient','brutal_kill' | 'infinity' | non_neg_integer(),'supervisor' | 'worker','dynamic' | [atom()]} | #{'id':=_, 'start':={atom(),atom(),'undefined' | [any()]}, 'modules'=>'dynamic' | [atom()], 'restart'=>'permanent' | 'temporary' | 'transient', 'shutdown'=>'brutal_kill' | 'infinity' | non_neg_integer(), 'type'=>'supervisor' | 'worker'}]}}, which is the expected return type for the callback of supervisor behaviour
diff --git a/lib/dialyzer/test/behaviour_SUITE_data/src/proper/compile_flags.hrl b/lib/dialyzer/test/behaviour_SUITE_data/src/proper/compile_flags.hrl
new file mode 100644
index 0000000000..e5ee44ace1
--- /dev/null
+++ b/lib/dialyzer/test/behaviour_SUITE_data/src/proper/compile_flags.hrl
@@ -0,0 +1,2 @@
+-define(AT_LEAST_19, 1).
+-define(AT_LEAST_17, 1).
diff --git a/lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_common.hrl b/lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_common.hrl
new file mode 100644
index 0000000000..c10626c5cc
--- /dev/null
+++ b/lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_common.hrl
@@ -0,0 +1,55 @@
+%%% Copyright 2010-2013 Manolis Papadakis <[email protected]>,
+%%% Eirini Arvaniti <[email protected]>
+%%% and Kostis Sagonas <[email protected]>
+%%%
+%%% This file is part of PropEr.
+%%%
+%%% PropEr is free software: you can redistribute it and/or modify
+%%% it under the terms of the GNU General Public License as published by
+%%% the Free Software Foundation, either version 3 of the License, or
+%%% (at your option) any later version.
+%%%
+%%% PropEr is distributed in the hope that it will be useful,
+%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
+%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%%% GNU General Public License for more details.
+%%%
+%%% You should have received a copy of the GNU General Public License
+%%% along with PropEr. If not, see <http://www.gnu.org/licenses/>.
+
+%%% @copyright 2010-2013 Manolis Papadakis, Eirini Arvaniti and Kostis Sagonas
+%%% @version {@version}
+%%% @author Manolis Papadakis
+%%% @doc Common parts of user and internal header files
+
+
+%%------------------------------------------------------------------------------
+%% Test generation macros
+%%------------------------------------------------------------------------------
+
+-define(FORALL(X,RawType,Prop), proper:forall(RawType,fun(X) -> Prop end)).
+-define(IMPLIES(Pre,Prop), proper:implies(Pre,?DELAY(Prop))).
+-define(WHENFAIL(Action,Prop), proper:whenfail(?DELAY(Action),?DELAY(Prop))).
+-define(TRAPEXIT(Prop), proper:trapexit(?DELAY(Prop))).
+-define(TIMEOUT(Limit,Prop), proper:timeout(Limit,?DELAY(Prop))).
+%% TODO: -define(ALWAYS(Tests,Prop), proper:always(Tests,?DELAY(Prop))).
+%% TODO: -define(SOMETIMES(Tests,Prop), proper:sometimes(Tests,?DELAY(Prop))).
+
+
+%%------------------------------------------------------------------------------
+%% Generator macros
+%%------------------------------------------------------------------------------
+
+-define(FORCE(X), (X)()).
+-define(DELAY(X), fun() -> X end).
+-define(LAZY(X), proper_types:lazy(?DELAY(X))).
+-define(SIZED(SizeArg,Gen), proper_types:sized(fun(SizeArg) -> Gen end)).
+-define(LET(X,RawType,Gen), proper_types:bind(RawType,fun(X) -> Gen end,false)).
+-define(SHRINK(Gen,AltGens),
+ proper_types:shrinkwith(?DELAY(Gen),?DELAY(AltGens))).
+-define(LETSHRINK(Xs,RawType,Gen),
+ proper_types:bind(RawType,fun(Xs) -> Gen end,true)).
+-define(SUCHTHAT(X,RawType,Condition),
+ proper_types:add_constraint(RawType,fun(X) -> Condition end,true)).
+-define(SUCHTHATMAYBE(X,RawType,Condition),
+ proper_types:add_constraint(RawType,fun(X) -> Condition end,false)).
diff --git a/lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_gen.erl b/lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_gen.erl
new file mode 100644
index 0000000000..b64a139e4d
--- /dev/null
+++ b/lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_gen.erl
@@ -0,0 +1,611 @@
+%%% Copyright 2010-2015 Manolis Papadakis <[email protected]>,
+%%% Eirini Arvaniti <[email protected]>
+%%% and Kostis Sagonas <[email protected]>
+%%%
+%%% This file is part of PropEr.
+%%%
+%%% PropEr is free software: you can redistribute it and/or modify
+%%% it under the terms of the GNU General Public License as published by
+%%% the Free Software Foundation, either version 3 of the License, or
+%%% (at your option) any later version.
+%%%
+%%% PropEr is distributed in the hope that it will be useful,
+%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
+%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%%% GNU General Public License for more details.
+%%%
+%%% You should have received a copy of the GNU General Public License
+%%% along with PropEr. If not, see <http://www.gnu.org/licenses/>.
+
+%%% @copyright 2010-2015 Manolis Papadakis, Eirini Arvaniti and Kostis Sagonas
+%%% @version {@version}
+%%% @author Manolis Papadakis
+
+%%% @doc Generator subsystem and generators for basic types.
+%%%
+%%% You can use <a href="#index">these</a> functions to try out the random
+%%% instance generation and shrinking subsystems.
+%%%
+%%% CAUTION: These functions should never be used inside properties. They are
+%%% meant for demonstration purposes only.
+
+-module(proper_gen).
+-export([pick/1, pick/2, pick/3,
+ sample/1, sample/3, sampleshrink/1, sampleshrink/2]).
+
+-export([safe_generate/1]).
+-export([generate/1, normal_gen/1, alt_gens/1, clean_instance/1,
+ get_ret_type/1]).
+-export([integer_gen/3, float_gen/3, atom_gen/1, atom_rev/1, binary_gen/1,
+ binary_rev/1, binary_len_gen/1, bitstring_gen/1, bitstring_rev/1,
+ bitstring_len_gen/1, list_gen/2, distlist_gen/3, vector_gen/2,
+ union_gen/1, weighted_union_gen/1, tuple_gen/1, loose_tuple_gen/2,
+ loose_tuple_rev/2, exactly_gen/1, fixed_list_gen/1, function_gen/2,
+ any_gen/1, native_type_gen/2, safe_weighted_union_gen/1,
+ safe_union_gen/1]).
+
+-export_type([instance/0, imm_instance/0, sized_generator/0, nosize_generator/0,
+ generator/0, reverse_gen/0, combine_fun/0, alt_gens/0]).
+
+-include("proper_internal.hrl").
+
+%%-----------------------------------------------------------------------------
+%% Types
+%%-----------------------------------------------------------------------------
+
+%% TODO: update imm_instance() when adding more types: be careful when reading
+%% anything that returns it
+%% @private_type
+-type imm_instance() :: proper_types:raw_type()
+ | instance()
+ | {'$used', imm_instance(), imm_instance()}
+ | {'$to_part', imm_instance()}.
+-type instance() :: term().
+%% A value produced by the random instance generator.
+-type error_reason() :: 'arity_limit' | 'cant_generate' | {'typeserver',term()}.
+
+%% @private_type
+-type sized_generator() :: fun((size()) -> imm_instance()).
+%% @private_type
+-type typed_sized_generator() :: {'typed',
+ fun((proper_types:type(),size()) ->
+ imm_instance())}.
+%% @private_type
+-type nosize_generator() :: fun(() -> imm_instance()).
+%% @private_type
+-type typed_nosize_generator() :: {'typed',
+ fun((proper_types:type()) ->
+ imm_instance())}.
+%% @private_type
+-type generator() :: sized_generator()
+ | typed_sized_generator()
+ | nosize_generator()
+ | typed_nosize_generator().
+%% @private_type
+-type plain_reverse_gen() :: fun((instance()) -> imm_instance()).
+%% @private_type
+-type typed_reverse_gen() :: {'typed',
+ fun((proper_types:type(),instance()) ->
+ imm_instance())}.
+%% @private_type
+-type reverse_gen() :: plain_reverse_gen() | typed_reverse_gen().
+%% @private_type
+-type combine_fun() :: fun((instance()) -> imm_instance()).
+%% @private_type
+-type alt_gens() :: fun(() -> [imm_instance()]).
+%% @private_type
+-type fun_seed() :: {non_neg_integer(),non_neg_integer()}.
+
+
+%%-----------------------------------------------------------------------------
+%% Instance generation functions
+%%-----------------------------------------------------------------------------
+
+%% @private
+-spec safe_generate(proper_types:raw_type()) ->
+ {'ok',imm_instance()} | {'error',error_reason()}.
+safe_generate(RawType) ->
+ try generate(RawType) of
+ ImmInstance -> {ok, ImmInstance}
+ catch
+ throw:'$arity_limit' -> {error, arity_limit};
+ throw:'$cant_generate' -> {error, cant_generate};
+ throw:{'$typeserver',SubReason} -> {error, {typeserver,SubReason}}
+ end.
+
+%% @private
+-spec generate(proper_types:raw_type()) -> imm_instance().
+generate(RawType) ->
+ Type = proper_types:cook_outer(RawType),
+ ok = add_parameters(Type),
+ Instance = generate(Type, get('$constraint_tries'), none),
+ ok = remove_parameters(Type),
+ Instance.
+
+-spec add_parameters(proper_types:type()) -> 'ok'.
+add_parameters(Type) ->
+ case proper_types:find_prop(parameters, Type) of
+ {ok, Params} ->
+ OldParams = erlang:get('$parameters'),
+ case OldParams of
+ undefined ->
+ erlang:put('$parameters', Params);
+ _ ->
+ erlang:put('$parameters', Params ++ OldParams)
+ end,
+ ok;
+ _ ->
+ ok
+ end.
+
+-spec remove_parameters(proper_types:type()) -> 'ok'.
+remove_parameters(Type) ->
+ case proper_types:find_prop(parameters, Type) of
+ {ok, Params} ->
+ AllParams = erlang:get('$parameters'),
+ case AllParams of
+ Params->
+ erlang:erase('$parameters');
+ _ ->
+ erlang:put('$parameters', AllParams -- Params)
+ end,
+ ok;
+ _ ->
+ ok
+ end.
+
+-spec generate(proper_types:type(), non_neg_integer(),
+ 'none' | {'ok',imm_instance()}) -> imm_instance().
+generate(_Type, 0, none) ->
+ throw('$cant_generate');
+generate(_Type, 0, {ok,Fallback}) ->
+ Fallback;
+generate(Type, TriesLeft, Fallback) ->
+ ImmInstance =
+ case proper_types:get_prop(kind, Type) of
+ constructed ->
+ PartsType = proper_types:get_prop(parts_type, Type),
+ Combine = proper_types:get_prop(combine, Type),
+ ImmParts = generate(PartsType),
+ Parts = clean_instance(ImmParts),
+ ImmInstance1 = Combine(Parts),
+ %% TODO: We can just generate the internal type: if it's not
+ %% a type, it will turn into an exactly.
+ ImmInstance2 =
+ case proper_types:is_raw_type(ImmInstance1) of
+ true -> generate(ImmInstance1);
+ false -> ImmInstance1
+ end,
+ {'$used',ImmParts,ImmInstance2};
+ _ ->
+ ImmInstance1 = normal_gen(Type),
+ case proper_types:is_raw_type(ImmInstance1) of
+ true -> generate(ImmInstance1);
+ false -> ImmInstance1
+ end
+ end,
+ case proper_types:satisfies_all(clean_instance(ImmInstance), Type) of
+ {_,true} -> ImmInstance;
+ {true,false} -> generate(Type, TriesLeft - 1, {ok,ImmInstance});
+ {false,false} -> generate(Type, TriesLeft - 1, Fallback)
+ end.
+
+%% @equiv pick(Type, 10)
+-spec pick(Type::proper_types:raw_type()) -> {'ok',instance()} | 'error'.
+pick(RawType) ->
+ pick(RawType, 10).
+
+%% @equiv pick(Type, Size, os:timestamp())
+-spec pick(Type::proper_types:raw_type(), size()) -> {'ok',instance()} | 'error'.
+pick(RawType, Size) ->
+ pick(RawType, Size, os:timestamp()).
+
+%% @doc Generates a random instance of `Type', of size `Size' with seed `Seed'.
+-spec pick(Type::proper_types:raw_type(), size(), seed()) ->
+ {'ok',instance()} | 'error'.
+pick(RawType, Size, Seed) ->
+ proper:global_state_init_size_seed(Size, Seed),
+ case clean_instance(safe_generate(RawType)) of
+ {ok,Instance} = Result ->
+ Msg = "WARNING: Some garbage has been left in the process registry "
+ "and the code server~n"
+ "to allow for the returned function(s) to run normally.~n"
+ "Please run proper:global_state_erase() when done.~n",
+ case contains_fun(Instance) of
+ true -> io:format(Msg, []);
+ false -> proper:global_state_erase()
+ end,
+ Result;
+ {error,Reason} ->
+ proper:report_error(Reason, fun io:format/2),
+ proper:global_state_erase(),
+ error
+ end.
+
+%% @equiv sample(Type, 10, 20)
+-spec sample(Type::proper_types:raw_type()) -> 'ok'.
+sample(RawType) ->
+ sample(RawType, 10, 20).
+
+%% @doc Generates and prints one random instance of `Type' for each size from
+%% `StartSize' up to `EndSize'.
+-spec sample(Type::proper_types:raw_type(), size(), size()) -> 'ok'.
+sample(RawType, StartSize, EndSize) when StartSize =< EndSize ->
+ Tests = EndSize - StartSize + 1,
+ Prop = ?FORALL(X, RawType, begin io:format("~p~n",[X]), true end),
+ Opts = [quiet,{start_size,StartSize},{max_size,EndSize},{numtests,Tests}],
+ _ = proper:quickcheck(Prop, Opts),
+ ok.
+
+%% @equiv sampleshrink(Type, 10)
+-spec sampleshrink(Type::proper_types:raw_type()) -> 'ok'.
+sampleshrink(RawType) ->
+ sampleshrink(RawType, 10).
+
+%% @doc Generates a random instance of `Type', of size `Size', then shrinks it
+%% as far as it goes. The value produced on each step of the shrinking process
+%% is printed on the screen.
+-spec sampleshrink(Type::proper_types:raw_type(), size()) -> 'ok'.
+sampleshrink(RawType, Size) ->
+ proper:global_state_init_size(Size),
+ Type = proper_types:cook_outer(RawType),
+ case safe_generate(Type) of
+ {ok,ImmInstance} ->
+ Shrunk = keep_shrinking(ImmInstance, [], Type),
+ PrintInst = fun(I) -> io:format("~p~n",[clean_instance(I)]) end,
+ lists:foreach(PrintInst, Shrunk);
+ {error,Reason} ->
+ proper:report_error(Reason, fun io:format/2)
+ end,
+ proper:global_state_erase(),
+ ok.
+
+-spec keep_shrinking(imm_instance(), [imm_instance()], proper_types:type()) ->
+ [imm_instance(),...].
+keep_shrinking(ImmInstance, Acc, Type) ->
+ keep_shrinking(ImmInstance, Acc, Type, init).
+
+keep_shrinking(ImmInstance, Acc, Type, State) ->
+ case proper_shrink:shrink(ImmInstance, Type, State) of
+ {[], done} -> %% no more shrinkers
+ lists:reverse([ImmInstance|Acc]);
+ {[], NewState} ->
+ %% try next shrinker
+ keep_shrinking(ImmInstance, Acc, Type, NewState);
+ {[Shrunk|_Rest], _NewState} ->
+ Acc2 = [ImmInstance|Acc],
+ case lists:member(Shrunk, Acc2) of
+ true ->
+ %% Avoid infinite loops
+ lists:reverse(Acc2);
+ false ->
+ keep_shrinking(Shrunk, Acc2, Type)
+ end
+ end.
+
+-spec contains_fun(term()) -> boolean().
+contains_fun(List) when is_list(List) ->
+ proper_arith:safe_any(fun contains_fun/1, List);
+contains_fun(Tuple) when is_tuple(Tuple) ->
+ contains_fun(tuple_to_list(Tuple));
+contains_fun(Fun) when is_function(Fun) ->
+ true;
+contains_fun(_Term) ->
+ false.
+
+
+%%-----------------------------------------------------------------------------
+%% Utility functions
+%%-----------------------------------------------------------------------------
+
+%% @private
+-spec normal_gen(proper_types:type()) -> imm_instance().
+normal_gen(Type) ->
+ case proper_types:get_prop(generator, Type) of
+ {typed, Gen} ->
+ if
+ is_function(Gen, 1) -> Gen(Type);
+ is_function(Gen, 2) -> Gen(Type, proper:get_size(Type))
+ end;
+ Gen ->
+ if
+ is_function(Gen, 0) -> Gen();
+ is_function(Gen, 1) -> Gen(proper:get_size(Type))
+ end
+ end.
+
+%% @private
+-spec alt_gens(proper_types:type()) -> [imm_instance()].
+alt_gens(Type) ->
+ case proper_types:find_prop(alt_gens, Type) of
+ {ok, AltGens} -> ?FORCE(AltGens);
+ error -> []
+ end.
+
+%% @private
+-spec clean_instance(imm_instance()) -> instance().
+clean_instance({'$used',_ImmParts,ImmInstance}) ->
+ clean_instance(ImmInstance);
+clean_instance({'$to_part',ImmInstance}) ->
+ clean_instance(ImmInstance);
+clean_instance(ImmInstance) ->
+ if
+ is_list(ImmInstance) ->
+ %% CAUTION: this must handle improper lists
+ proper_arith:safe_map(fun clean_instance/1, ImmInstance);
+ is_tuple(ImmInstance) ->
+ proper_arith:tuple_map(fun clean_instance/1, ImmInstance);
+ true ->
+ ImmInstance
+ end.
+
+
+%%-----------------------------------------------------------------------------
+%% Basic type generators
+%%-----------------------------------------------------------------------------
+
+%% @private
+-spec integer_gen(size(), proper_types:extint(), proper_types:extint()) ->
+ integer().
+integer_gen(Size, inf, inf) ->
+ proper_arith:rand_int(Size);
+integer_gen(Size, inf, High) ->
+ High - proper_arith:rand_non_neg_int(Size);
+integer_gen(Size, Low, inf) ->
+ Low + proper_arith:rand_non_neg_int(Size);
+integer_gen(Size, Low, High) ->
+ proper_arith:smart_rand_int(Size, Low, High).
+
+%% @private
+-spec float_gen(size(), proper_types:extnum(), proper_types:extnum()) ->
+ float().
+float_gen(Size, inf, inf) ->
+ proper_arith:rand_float(Size);
+float_gen(Size, inf, High) ->
+ High - proper_arith:rand_non_neg_float(Size);
+float_gen(Size, Low, inf) ->
+ Low + proper_arith:rand_non_neg_float(Size);
+float_gen(_Size, Low, High) ->
+ proper_arith:rand_float(Low, High).
+
+%% @private
+-spec atom_gen(size()) -> proper_types:type().
+%% We make sure we never clash with internal atoms by checking that the first
+%% character is not '$'.
+atom_gen(Size) ->
+ ?LET(Str,
+ ?SUCHTHAT(X,
+ proper_types:resize(Size,
+ proper_types:list(proper_types:byte())),
+ X =:= [] orelse hd(X) =/= $$),
+ list_to_atom(Str)).
+
+%% @private
+-spec atom_rev(atom()) -> imm_instance().
+atom_rev(Atom) ->
+ {'$used', atom_to_list(Atom), Atom}.
+
+%% @private
+-spec binary_gen(size()) -> proper_types:type().
+binary_gen(Size) ->
+ ?LET(Bytes,
+ proper_types:resize(Size,
+ proper_types:list(proper_types:byte())),
+ list_to_binary(Bytes)).
+
+%% @private
+-spec binary_rev(binary()) -> imm_instance().
+binary_rev(Binary) ->
+ {'$used', binary_to_list(Binary), Binary}.
+
+%% @private
+-spec binary_len_gen(length()) -> proper_types:type().
+binary_len_gen(Len) ->
+ ?LET(Bytes,
+ proper_types:vector(Len, proper_types:byte()),
+ list_to_binary(Bytes)).
+
+%% @private
+-spec bitstring_gen(size()) -> proper_types:type().
+bitstring_gen(Size) ->
+ ?LET({BytesHead, NumBits, TailByte},
+ {proper_types:resize(Size,proper_types:binary()),
+ proper_types:range(0,7), proper_types:range(0,127)},
+ <<BytesHead/binary, TailByte:NumBits>>).
+
+%% @private
+-spec bitstring_rev(bitstring()) -> imm_instance().
+bitstring_rev(BitString) ->
+ List = bitstring_to_list(BitString),
+ {BytesList, BitsTail} = lists:splitwith(fun erlang:is_integer/1, List),
+ {NumBits, TailByte} = case BitsTail of
+ [] -> {0, 0};
+ [Bits] -> N = bit_size(Bits),
+ <<Byte:N>> = Bits,
+ {N, Byte}
+ end,
+ {'$used',
+ {{'$used',BytesList,list_to_binary(BytesList)}, NumBits, TailByte},
+ BitString}.
+
+%% @private
+-spec bitstring_len_gen(length()) -> proper_types:type().
+bitstring_len_gen(Len) ->
+ BytesLen = Len div 8,
+ BitsLen = Len rem 8,
+ ?LET({BytesHead, NumBits, TailByte},
+ {proper_types:binary(BytesLen), BitsLen,
+ proper_types:range(0, 1 bsl BitsLen - 1)},
+ <<BytesHead/binary, TailByte:NumBits>>).
+
+%% @private
+-spec list_gen(size(), proper_types:type()) -> [imm_instance()].
+list_gen(Size, ElemType) ->
+ Len = proper_arith:rand_int(0, Size),
+ vector_gen(Len, ElemType).
+
+%% @private
+-spec distlist_gen(size(), sized_generator(), boolean()) -> [imm_instance()].
+distlist_gen(RawSize, Gen, NonEmpty) ->
+ Len = case NonEmpty of
+ true -> proper_arith:rand_int(1, erlang:max(1,RawSize));
+ false -> proper_arith:rand_int(0, RawSize)
+ end,
+ Size = case Len of
+ 1 -> RawSize - 1;
+ _ -> RawSize
+ end,
+ %% TODO: this produces a lot of types: maybe a simple 'div' is sufficient?
+ Sizes = proper_arith:distribute(Size, Len),
+ InnerTypes = [Gen(S) || S <- Sizes],
+ fixed_list_gen(InnerTypes).
+
+%% @private
+-spec vector_gen(length(), proper_types:type()) -> [imm_instance()].
+vector_gen(Len, ElemType) ->
+ vector_gen_tr(Len, ElemType, []).
+
+-spec vector_gen_tr(length(), proper_types:type(), [imm_instance()]) ->
+ [imm_instance()].
+vector_gen_tr(0, _ElemType, AccList) ->
+ AccList;
+vector_gen_tr(Left, ElemType, AccList) ->
+ vector_gen_tr(Left - 1, ElemType, [generate(ElemType) | AccList]).
+
+%% @private
+-spec union_gen([proper_types:type(),...]) -> imm_instance().
+union_gen(Choices) ->
+ {_Choice,Type} = proper_arith:rand_choose(Choices),
+ generate(Type).
+
+%% @private
+-spec weighted_union_gen([{frequency(),proper_types:type()},...]) ->
+ imm_instance().
+weighted_union_gen(FreqChoices) ->
+ {_Choice,Type} = proper_arith:freq_choose(FreqChoices),
+ generate(Type).
+
+%% @private
+-spec safe_union_gen([proper_types:type(),...]) -> imm_instance().
+safe_union_gen(Choices) ->
+ {Choice,Type} = proper_arith:rand_choose(Choices),
+ try generate(Type)
+ catch
+ error:_ ->
+ safe_union_gen(proper_arith:list_remove(Choice, Choices))
+ end.
+
+%% @private
+-spec safe_weighted_union_gen([{frequency(),proper_types:type()},...]) ->
+ imm_instance().
+safe_weighted_union_gen(FreqChoices) ->
+ {Choice,Type} = proper_arith:freq_choose(FreqChoices),
+ try generate(Type)
+ catch
+ error:_ ->
+ safe_weighted_union_gen(proper_arith:list_remove(Choice,
+ FreqChoices))
+ end.
+
+%% @private
+-spec tuple_gen([proper_types:type()]) -> tuple().
+tuple_gen(Fields) ->
+ list_to_tuple(fixed_list_gen(Fields)).
+
+%% @private
+-spec loose_tuple_gen(size(), proper_types:type()) -> proper_types:type().
+loose_tuple_gen(Size, ElemType) ->
+ ?LET(L,
+ proper_types:resize(Size, proper_types:list(ElemType)),
+ list_to_tuple(L)).
+
+%% @private
+-spec loose_tuple_rev(tuple(), proper_types:type()) -> imm_instance().
+loose_tuple_rev(Tuple, ElemType) ->
+ CleanList = tuple_to_list(Tuple),
+ List = case proper_types:find_prop(reverse_gen, ElemType) of
+ {ok,{typed, ReverseGen}} ->
+ [ReverseGen(ElemType,X) || X <- CleanList];
+ {ok,ReverseGen} -> [ReverseGen(X) || X <- CleanList];
+ error -> CleanList
+ end,
+ {'$used', List, Tuple}.
+
+%% @private
+-spec exactly_gen(T) -> T.
+exactly_gen(X) ->
+ X.
+
+%% @private
+-spec fixed_list_gen([proper_types:type()]) -> imm_instance()
+ ; ({[proper_types:type()],proper_types:type()}) ->
+ maybe_improper_list(imm_instance(), imm_instance() | []).
+fixed_list_gen({ProperHead,ImproperTail}) ->
+ [generate(F) || F <- ProperHead] ++ generate(ImproperTail);
+fixed_list_gen(ProperFields) ->
+ [generate(F) || F <- ProperFields].
+
+%% @private
+-spec function_gen(arity(), proper_types:type()) -> function().
+function_gen(Arity, RetType) ->
+ FunSeed = {proper_arith:rand_int(0, ?SEED_RANGE - 1),
+ proper_arith:rand_int(0, ?SEED_RANGE - 1)},
+ create_fun(Arity, RetType, FunSeed).
+
+%% @private
+-spec any_gen(size()) -> imm_instance().
+any_gen(Size) ->
+ case get('$any_type') of
+ undefined -> real_any_gen(Size);
+ {type,AnyType} -> generate(proper_types:resize(Size, AnyType))
+ end.
+
+-spec real_any_gen(size()) -> imm_instance().
+real_any_gen(0) ->
+ SimpleTypes = [proper_types:integer(), proper_types:float(),
+ proper_types:atom()],
+ union_gen(SimpleTypes);
+real_any_gen(Size) ->
+ FreqChoices = [{?ANY_SIMPLE_PROB,simple}, {?ANY_BINARY_PROB,binary},
+ {?ANY_EXPAND_PROB,expand}],
+ case proper_arith:freq_choose(FreqChoices) of
+ {_,simple} ->
+ real_any_gen(0);
+ {_,binary} ->
+ generate(proper_types:resize(Size, proper_types:bitstring()));
+ {_,expand} ->
+ %% TODO: statistics of produced terms?
+ NumElems = proper_arith:rand_int(0, Size - 1),
+ ElemSizes = proper_arith:distribute(Size - 1, NumElems),
+ ElemTypes = [?LAZY(real_any_gen(S)) || S <- ElemSizes],
+ case proper_arith:rand_int(1,2) of
+ 1 -> fixed_list_gen(ElemTypes);
+ 2 -> tuple_gen(ElemTypes)
+ end
+ end.
+
+%% @private
+-spec native_type_gen(mod_name(), string()) -> proper_types:type().
+native_type_gen(Mod, TypeStr) ->
+ case proper_typeserver:translate_type({Mod,TypeStr}) of
+ {ok,Type} -> Type;
+ {error,Reason} -> throw({'$typeserver',Reason})
+ end.
+
+
+%%------------------------------------------------------------------------------
+%% Function-generation functions
+%%------------------------------------------------------------------------------
+
+-spec create_fun(arity(), proper_types:type(), fun_seed()) -> function().
+create_fun(_Arity, _RetType, _FunSeed) ->
+ fun() -> throw('$arity_limit') end.
+
+%% @private
+-spec get_ret_type(function()) -> proper_types:type().
+get_ret_type(Fun) ->
+ {arity,Arity} = erlang:fun_info(Fun, arity),
+ put('$get_ret_type', true),
+ RetType = apply(Fun, lists:duplicate(Arity,dummy)),
+ erase('$get_ret_type'),
+ RetType.
diff --git a/lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_internal.hrl b/lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_internal.hrl
new file mode 100644
index 0000000000..89e6b34296
--- /dev/null
+++ b/lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_internal.hrl
@@ -0,0 +1,98 @@
+%%% Copyright 2010-2013 Manolis Papadakis <[email protected]>,
+%%% Eirini Arvaniti <[email protected]>
+%%% and Kostis Sagonas <[email protected]>
+%%%
+%%% This file is part of PropEr.
+%%%
+%%% PropEr is free software: you can redistribute it and/or modify
+%%% it under the terms of the GNU General Public License as published by
+%%% the Free Software Foundation, either version 3 of the License, or
+%%% (at your option) any later version.
+%%%
+%%% PropEr is distributed in the hope that it will be useful,
+%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
+%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%%% GNU General Public License for more details.
+%%%
+%%% You should have received a copy of the GNU General Public License
+%%% along with PropEr. If not, see <http://www.gnu.org/licenses/>.
+
+%%% @copyright 2010-2016 Manolis Papadakis, Eirini Arvaniti and Kostis Sagonas
+%%% @version {@version}
+%%% @author Manolis Papadakis
+%%% @doc Internal header file: This header is included in all PropEr source
+%%% files.
+
+-include("compile_flags.hrl").
+-include("proper_common.hrl").
+
+
+%%------------------------------------------------------------------------------
+%% Activate strip_types parse transform
+%%------------------------------------------------------------------------------
+
+-ifdef(NO_TYPES).
+-compile({parse_transform, strip_types}).
+-endif.
+
+%%------------------------------------------------------------------------------
+%% Random generator selection
+%%------------------------------------------------------------------------------
+
+-ifdef(USE_SFMT).
+-define(RANDOM_MOD, sfmt).
+-define(SEED_NAME, sfmt_seed).
+-else.
+-define(RANDOM_MOD, random).
+-define(SEED_NAME, random_seed).
+-endif.
+
+%%------------------------------------------------------------------------------
+%% Macros
+%%------------------------------------------------------------------------------
+
+-define(PROPERTY_PREFIX, "prop_").
+
+
+%%------------------------------------------------------------------------------
+%% Constants
+%%------------------------------------------------------------------------------
+
+-define(SEED_RANGE, 4294967296).
+-define(MAX_ARITY, 20).
+-define(MAX_TRIES_FACTOR, 5).
+-define(ANY_SIMPLE_PROB, 3).
+-define(ANY_BINARY_PROB, 1).
+-define(ANY_EXPAND_PROB, 8).
+-define(SMALL_RANGE_THRESHOLD, 16#FFFF).
+
+
+%%------------------------------------------------------------------------------
+%% Common type aliases
+%%------------------------------------------------------------------------------
+
+%% TODO: Perhaps these should be moved inside modules.
+-type mod_name() :: atom().
+-type fun_name() :: atom().
+-type size() :: non_neg_integer().
+-type length() :: non_neg_integer().
+-type position() :: pos_integer().
+-type frequency() :: pos_integer().
+-type seed() :: {non_neg_integer(), non_neg_integer(), non_neg_integer()}.
+
+-type abs_form() :: erl_parse:abstract_form().
+-type abs_expr() :: erl_parse:abstract_expr().
+-type abs_clause() :: erl_parse:abstract_clause().
+
+%% TODO: Replace these with the appropriate types from stdlib.
+-ifdef(AT_LEAST_19).
+-type abs_type() :: erl_parse:abstract_type().
+-type abs_rec_field() :: term(). % erl_parse:af_field_decl().
+-else.
+-type abs_type() :: term().
+-type abs_rec_field() :: term().
+-endif.
+
+-type loose_tuple(T) :: {} | {T} | {T,T} | {T,T,T} | {T,T,T,T} | {T,T,T,T,T}
+ | {T,T,T,T,T,T} | {T,T,T,T,T,T,T} | {T,T,T,T,T,T,T,T}
+ | {T,T,T,T,T,T,T,T,T} | {T,T,T,T,T,T,T,T,T,T} | tuple().
diff --git a/lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_types.erl b/lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_types.erl
new file mode 100644
index 0000000000..6b154b813b
--- /dev/null
+++ b/lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_types.erl
@@ -0,0 +1,1353 @@
+%%% Copyright 2010-2013 Manolis Papadakis <[email protected]>,
+%%% Eirini Arvaniti <[email protected]>
+%%% and Kostis Sagonas <[email protected]>
+%%%
+%%% This file is part of PropEr.
+%%%
+%%% PropEr is free software: you can redistribute it and/or modify
+%%% it under the terms of the GNU General Public License as published by
+%%% the Free Software Foundation, either version 3 of the License, or
+%%% (at your option) any later version.
+%%%
+%%% PropEr is distributed in the hope that it will be useful,
+%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
+%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%%% GNU General Public License for more details.
+%%%
+%%% You should have received a copy of the GNU General Public License
+%%% along with PropEr. If not, see <http://www.gnu.org/licenses/>.
+
+%%% @copyright 2010-2013 Manolis Papadakis, Eirini Arvaniti and Kostis Sagonas
+%%% @version {@version}
+%%% @author Manolis Papadakis
+
+%%% @doc Type manipulation functions and predefined types.
+%%%
+%%% == Basic types ==
+%%% This module defines all the basic types of the PropEr type system as
+%%% functions. See the <a href="#index">function index</a> for an overview.
+%%%
+%%% Types can be combined in tuples or lists to produce other types. Exact
+%%% values (such as exact numbers, atoms, binaries and strings) can be combined
+%%% with types inside such structures, like in this example of the type of a
+%%% tagged tuple: ``{'result', integer()}''.
+%%%
+%%% When including the PropEr header file, all
+%%% <a href="#index">API functions</a> of this module are automatically
+%%% imported, unless `PROPER_NO_IMPORTS' is defined.
+%%%
+%%% == Customized types ==
+%%% The following operators can be applied to basic types in order to produce
+%%% new ones:
+%%%
+%%% <dl>
+%%% <dt>`?LET(<Xs>, <Xs_type>, <In>)'</dt>
+%%% <dd>To produce an instance of this type, all appearances of the variables
+%%% in `<Xs>' are replaced inside `<In>' by their corresponding values in a
+%%% randomly generated instance of `<Xs_type>'. It's OK for the `<In>' part to
+%%% evaluate to a type - in that case, an instance of the inner type is
+%%% generated recursively.</dd>
+%%% <dt>`?SUCHTHAT(<X>, <Type>, <Condition>)'</dt>
+%%% <dd>This produces a specialization of `<Type>', which only includes those
+%%% members of `<Type>' that satisfy the constraint `<Condition>' - that is,
+%%% those members for which the function `fun(<X>) -> <Condition> end' returns
+%%% `true'. If the constraint is very strict - that is, only a small
+%%% percentage of instances of `<Type>' pass the test - it will take a lot of
+%%% tries for the instance generation subsystem to randomly produce a valid
+%%% instance. This will result in slower testing, and testing may even be
+%%% stopped short, in case the `constraint_tries' limit is reached (see the
+%%% "Options" section in the documentation of the {@link proper} module). If
+%%% this is the case, it would be more appropriate to generate valid instances
+%%% of the specialized type using the `?LET' macro. Also make sure that even
+%%% small instances can satisfy the constraint, since PropEr will only try
+%%% small instances at the start of testing. If this is not possible, you can
+%%% instruct PropEr to start at a larger size, by supplying a suitable value
+%%% for the `start_size' option (see the "Options" section in the
+%%% documentation of the {@link proper} module).</dd>
+%%% <dt>`?SUCHTHATMAYBE(<X>, <Type>, <Condition>)'</dt>
+%%% <dd>Equivalent to the `?SUCHTHAT' macro, but the constraint `<Condition>'
+%%% is considered non-strict: if the `constraint_tries' limit is reached, the
+%%% generator will just return an instance of `<Type>' instead of failing,
+%%% even if that instance doesn't satisfy the constraint.</dd>
+%%% <dt>`?SHRINK(<Generator>, <List_of_alt_gens>)'</dt>
+%%% <dd>This creates a type whose instances are generated by evaluating the
+%%% statement block `<Generator>' (this may evaluate to a type, which will
+%%% then be generated recursively). If an instance of such a type is to be
+%%% shrunk, the generators in `<List_of_alt_gens>' are first run to produce
+%%% hopefully simpler instances of the type. Thus, the generators in the
+%%% second argument should be simpler than the default. The simplest ones
+%%% should be at the front of the list, since those are the generators
+%%% preferred by the shrinking subsystem. Like the main `<Generator>', the
+%%% alternatives may also evaluate to a type, which is generated recursively.
+%%% </dd>
+%%% <dt>`?LETSHRINK(<List_of_variables>, <List_of_types>, <Generator>)'</dt>
+%%% <dd>This is created by combining a `?LET' and a `?SHRINK' macro. Instances
+%%% are generated by applying a randomly generated list of values inside
+%%% `<Generator>' (just like a `?LET', with the added constraint that the
+%%% variables and types must be provided in a list - alternatively,
+%%% `<List_of_types>' may be a list or vector type). When shrinking instances
+%%% of such a type, the sub-instances that were combined to produce it are
+%%% first tried in place of the failing instance.</dd>
+%%% <dt>`?LAZY(<Generator>)'</dt>
+%%% <dd>This construct returns a type whose only purpose is to delay the
+%%% evaluation of `<Generator>' (`<Generator>' can return a type, which will
+%%% be generated recursively). Using this, you can simulate the lazy
+%%% generation of instances:
+%%% ``` stream() -> ?LAZY(frequency([ {1,[]}, {3,[0|stream()]} ])). '''
+%%% The above type produces lists of zeroes with an average length of 3. Note
+%%% that, had we not enclosed the generator with a `?LAZY' macro, the
+%%% evaluation would continue indefinitely, due to the eager evaluation of
+%%% the Erlang language.</dd>
+%%% <dt>`non_empty(<List_or_binary_type>)'</dt>
+%%% <dd>See the documentation for {@link non_empty/1}.</dd>
+%%% <dt>`noshrink(<Type>)'</dt>
+%%% <dd>See the documentation for {@link noshrink/1}.</dd>
+%%% <dt>`default(<Default_value>, <Type>)'</dt>
+%%% <dd>See the documentation for {@link default/2}.</dd>
+%%% <dt>`with_parameter(<Parameter>, <Value>, <Type>)'</dt>
+%%% <dd>See the documentation for {@link with_parameter/3}.</dd>
+%%% <dt>`with_parameters(<Param_value_pairs>, <Type>)'</dt>
+%%% <dd>See the documentation for {@link with_parameters/2}.</dd>
+%%% </dl>
+%%%
+%%% == Size manipulation ==
+%%% The following operators are related to the `size' parameter, which controls
+%%% the maximum size of produced instances. The actual size of a produced
+%%% instance is chosen randomly, but can never exceed the value of the `size'
+%%% parameter at the moment of generation. A more accurate definition is the
+%%% following: the maximum instance of `size S' can never be smaller than the
+%%% maximum instance of `size S-1'. The actual size of an instance is measured
+%%% differently for each type: the actual size of a list is its length, while
+%%% the actual size of a tree may be the number of its internal nodes. Some
+%%% types, e.g. unions, have no notion of size, thus their generation is not
+%%% influenced by the value of `size'. The `size' parameter starts at 1 and
+%%% grows automatically during testing.
+%%%
+%%% <dl>
+%%% <dt>`?SIZED(<S>, <Generator>)'</dt>
+%%% <dd>Creates a new type, whose instances are produced by replacing all
+%%% appearances of the `<S>' parameter inside the statement block
+%%% `<Generator>' with the value of the `size' parameter. It's OK for the
+%%% `<Generator>' to return a type - in that case, an instance of the inner
+%%% type is generated recursively.</dd>
+%%% <dt>`resize(<New_size>, <Type>)'</dt>
+%%% <dd>See the documentation for {@link resize/2}.</dd>
+%%% </dl>
+
+-module(proper_types).
+-export([is_inst/2, is_inst/3]).
+
+-export([integer/2, float/2, atom/0, binary/0, binary/1, bitstring/0,
+ bitstring/1, list/1, vector/2, union/1, weighted_union/1, tuple/1,
+ loose_tuple/1, exactly/1, fixed_list/1, function/2, any/0,
+ shrink_list/1, safe_union/1, safe_weighted_union/1]).
+-export([integer/0, non_neg_integer/0, pos_integer/0, neg_integer/0, range/2,
+ float/0, non_neg_float/0, number/0, boolean/0, byte/0, char/0,
+ list/0, tuple/0, string/0, wunion/1, term/0, timeout/0, arity/0]).
+-export([int/0, nat/0, largeint/0, real/0, bool/0, choose/2, elements/1,
+ oneof/1, frequency/1, return/1, default/2, orderedlist/1, function0/1,
+ function1/1, function2/1, function3/1, function4/1,
+ weighted_default/2]).
+-export([resize/2, non_empty/1, noshrink/1]).
+
+-export([cook_outer/1, is_type/1, equal_types/2, is_raw_type/1, to_binary/1,
+ from_binary/1, get_prop/2, find_prop/2, safe_is_instance/2,
+ is_instance/2, unwrap/1, weakly/1, strongly/1, satisfies_all/2,
+ new_type/2, subtype/2]).
+-export([lazy/1, sized/1, bind/3, shrinkwith/2, add_constraint/3,
+ native_type/2, distlist/3, with_parameter/3, with_parameters/2,
+ parameter/1, parameter/2]).
+-export([le/2]).
+
+-export_type([type/0, raw_type/0, extint/0, extnum/0]).
+
+-include("proper_internal.hrl").
+
+
+%%------------------------------------------------------------------------------
+%% Comparison with erl_types
+%%------------------------------------------------------------------------------
+
+%% Missing types
+%% -------------------
+%% will do:
+%% records, maybe_improper_list(T,S), nonempty_improper_list(T,S)
+%% maybe_improper_list(), maybe_improper_list(T), iolist, iodata
+%% don't need:
+%% nonempty_{list,string,maybe_improper_list}
+%% won't do:
+%% pid, port, ref, identifier, none, no_return, module, mfa, node
+%% array, dict, digraph, set, gb_tree, gb_set, queue, tid
+
+%% Missing type information
+%% ------------------------
+%% bin types:
+%% other unit sizes? what about size info?
+%% functions:
+%% generally some fun, unspecified number of arguments but specified
+%% return type
+%% any:
+%% doesn't cover functions and improper lists
+
+
+%%------------------------------------------------------------------------------
+%% Type declaration macros
+%%------------------------------------------------------------------------------
+
+-define(BASIC(PropList), new_type(PropList,basic)).
+-define(WRAPPER(PropList), new_type(PropList,wrapper)).
+-define(CONSTRUCTED(PropList), new_type(PropList,constructed)).
+-define(CONTAINER(PropList), new_type(PropList,container)).
+-define(SUBTYPE(Type,PropList), subtype(PropList,Type)).
+
+
+%%------------------------------------------------------------------------------
+%% Types
+%%------------------------------------------------------------------------------
+
+-type type_kind() :: 'basic' | 'wrapper' | 'constructed' | 'container' | atom().
+-type instance_test() :: fun((proper_gen:imm_instance()) -> boolean())
+ | {'typed',
+ fun((proper_types:type(),
+ proper_gen:imm_instance()) -> boolean())}.
+-type index() :: pos_integer().
+%% @alias
+-type value() :: term().
+%% @private_type
+%% @alias
+-type extint() :: integer() | 'inf'.
+%% @private_type
+%% @alias
+-type extnum() :: number() | 'inf'.
+-type constraint_fun() :: fun((proper_gen:instance()) -> boolean()).
+
+-opaque type() :: {'$type', [type_prop()]}.
+%% A type of the PropEr type system
+%% @type raw_type(). You can consider this as an equivalent of {@type type()}.
+-type raw_type() :: type() | [raw_type()] | loose_tuple(raw_type()) | term().
+-type type_prop_name() :: 'kind' | 'generator' | 'reverse_gen' | 'parts_type'
+ | 'combine' | 'alt_gens' | 'shrink_to_parts'
+ | 'size_transform' | 'is_instance' | 'shrinkers'
+ | 'noshrink' | 'internal_type' | 'internal_types'
+ | 'get_length' | 'split' | 'join' | 'get_indices'
+ | 'remove' | 'retrieve' | 'update' | 'constraints'
+ | 'parameters' | 'env' | 'subenv'.
+
+-type type_prop_value() :: term().
+-type type_prop() ::
+ {'kind', type_kind()}
+ | {'generator', proper_gen:generator()}
+ | {'reverse_gen', proper_gen:reverse_gen()}
+ | {'parts_type', type()}
+ | {'combine', proper_gen:combine_fun()}
+ | {'alt_gens', proper_gen:alt_gens()}
+ | {'shrink_to_parts', boolean()}
+ | {'size_transform', fun((size()) -> size())}
+ | {'is_instance', instance_test()}
+ | {'shrinkers', [proper_shrink:shrinker()]}
+ | {'noshrink', boolean()}
+ | {'internal_type', raw_type()}
+ | {'internal_types', tuple() | maybe_improper_list(type(),type() | [])}
+ %% The items returned by 'remove' must be of this type.
+ | {'get_length', fun((proper_gen:imm_instance()) -> length())}
+ %% If this is a container type, this should return the number of elements
+ %% it contains.
+ | {'split', fun((proper_gen:imm_instance()) -> [proper_gen:imm_instance()])
+ | fun((length(),proper_gen:imm_instance()) ->
+ {proper_gen:imm_instance(),proper_gen:imm_instance()})}
+ %% If present, the appropriate form depends on whether get_length is
+ %% defined: if get_length is undefined, this must be in the one-argument
+ %% form (e.g. a tree should be split into its subtrees), else it must be
+ %% in the two-argument form (e.g. a list should be split in two at the
+ %% index provided).
+ | {'join', fun((proper_gen:imm_instance(),proper_gen:imm_instance()) ->
+ proper_gen:imm_instance())}
+ | {'get_indices', fun((proper_types:type(),
+ proper_gen:imm_instance()) -> [index()])}
+ %% If this is a container type, this should return a list of indices we
+ %% can use to remove or insert elements from the given instance.
+ | {'remove', fun((index(),proper_gen:imm_instance()) ->
+ proper_gen:imm_instance())}
+ | {'retrieve', fun((index(), proper_gen:imm_instance() | tuple()
+ | maybe_improper_list(type(),type() | [])) ->
+ value() | type())}
+ | {'update', fun((index(),value(),proper_gen:imm_instance()) ->
+ proper_gen:imm_instance())}
+ | {'constraints', [{constraint_fun(), boolean()}]}
+ %% A list of constraints on instances of this type: each constraint is a
+ %% tuple of a fun that must return 'true' for each valid instance and a
+ %% boolean field that specifies whether the condition is strict.
+ | {'parameters', [{atom(),value()}]}
+ | {'env', term()}
+ | {'subenv', term()}.
+
+
+%%------------------------------------------------------------------------------
+%% Type manipulation functions
+%%------------------------------------------------------------------------------
+
+%% TODO: We shouldn't need the fully qualified type name in the range of these
+%% functions.
+
+%% @private
+%% TODO: just cook/1 ?
+-spec cook_outer(raw_type()) -> proper_types:type().
+cook_outer(Type = {'$type',_Props}) ->
+ Type;
+cook_outer(RawType) ->
+ if
+ is_tuple(RawType) -> tuple(tuple_to_list(RawType));
+ %% CAUTION: this must handle improper lists
+ is_list(RawType) -> fixed_list(RawType);
+ %% default case (covers integers, floats, atoms, binaries, ...):
+ true -> exactly(RawType)
+ end.
+
+%% @private
+-spec is_type(term()) -> boolean().
+is_type({'$type',_Props}) ->
+ true;
+is_type(_) ->
+ false.
+
+%% @private
+-spec equal_types(proper_types:type(), proper_types:type()) -> boolean().
+equal_types(SameType, SameType) ->
+ true;
+equal_types(_, _) ->
+ false.
+
+%% @private
+-spec is_raw_type(term()) -> boolean().
+is_raw_type({'$type',_TypeProps}) ->
+ true;
+is_raw_type(X) ->
+ if
+ is_tuple(X) -> is_raw_type_list(tuple_to_list(X));
+ is_list(X) -> is_raw_type_list(X);
+ true -> false
+ end.
+
+-spec is_raw_type_list(maybe_improper_list()) -> boolean().
+%% CAUTION: this must handle improper lists
+is_raw_type_list(List) ->
+ proper_arith:safe_any(fun is_raw_type/1, List).
+
+%% @private
+-spec to_binary(proper_types:type()) -> binary().
+to_binary(Type) ->
+ term_to_binary(Type).
+
+%% @private
+-ifdef(AT_LEAST_17).
+-spec from_binary(binary()) -> proper_types:type().
+-endif.
+from_binary(Binary) ->
+ binary_to_term(Binary).
+
+-spec type_from_list([type_prop()]) -> proper_types:type().
+type_from_list(KeyValueList) ->
+ {'$type',KeyValueList}.
+
+-spec add_prop(type_prop_name(), type_prop_value(), proper_types:type()) ->
+ proper_types:type().
+add_prop(PropName, Value, {'$type',Props}) ->
+ {'$type',lists:keystore(PropName, 1, Props, {PropName, Value})}.
+
+-spec add_props([type_prop()], proper_types:type()) -> proper_types:type().
+add_props(PropList, {'$type',OldProps}) ->
+ {'$type', lists:foldl(fun({N,_}=NV,Acc) ->
+ lists:keystore(N, 1, Acc, NV)
+ end, OldProps, PropList)}.
+
+-spec append_to_prop(type_prop_name(), type_prop_value(),
+ proper_types:type()) -> proper_types:type().
+append_to_prop(PropName, Value, {'$type',Props}) ->
+ Val = case lists:keyfind(PropName, 1, Props) of
+ {PropName, V} ->
+ V;
+ _ ->
+ []
+ end,
+ {'$type', lists:keystore(PropName, 1, Props,
+ {PropName, lists:reverse([Value|Val])})}.
+
+-spec append_list_to_prop(type_prop_name(), [type_prop_value()],
+ proper_types:type()) -> proper_types:type().
+append_list_to_prop(PropName, List, {'$type',Props}) ->
+ {PropName, Val} = lists:keyfind(PropName, 1, Props),
+ {'$type', lists:keystore(PropName, 1, Props, {PropName, Val++List})}.
+
+%% @private
+-spec get_prop(type_prop_name(), proper_types:type()) -> type_prop_value().
+get_prop(PropName, {'$type',Props}) ->
+ {_PropName, Val} = lists:keyfind(PropName, 1, Props),
+ Val.
+
+%% @private
+-spec find_prop(type_prop_name(), proper_types:type()) ->
+ {'ok',type_prop_value()} | 'error'.
+find_prop(PropName, {'$type',Props}) ->
+ case lists:keyfind(PropName, 1, Props) of
+ {PropName, Value} ->
+ {ok, Value};
+ _ ->
+ error
+ end.
+
+%% @private
+-spec new_type([type_prop()], type_kind()) -> proper_types:type().
+new_type(PropList, Kind) ->
+ Type = type_from_list(PropList),
+ add_prop(kind, Kind, Type).
+
+%% @private
+-spec subtype([type_prop()], proper_types:type()) -> proper_types:type().
+%% TODO: should the 'is_instance' function etc. be reset for subtypes?
+subtype(PropList, Type) ->
+ add_props(PropList, Type).
+
+%% @private
+-spec is_inst(proper_gen:instance(), raw_type()) ->
+ boolean() | {'error',{'typeserver',term()}}.
+is_inst(Instance, RawType) ->
+ is_inst(Instance, RawType, 10).
+
+%% @private
+-spec is_inst(proper_gen:instance(), raw_type(), size()) ->
+ boolean() | {'error',{'typeserver',term()}}.
+is_inst(Instance, RawType, Size) ->
+ proper:global_state_init_size(Size),
+ Result = safe_is_instance(Instance, RawType),
+ proper:global_state_erase(),
+ Result.
+
+%% @private
+-spec safe_is_instance(proper_gen:imm_instance(), raw_type()) ->
+ boolean() | {'error',{'typeserver',term()}}.
+safe_is_instance(ImmInstance, RawType) ->
+ try is_instance(ImmInstance, RawType) catch
+ throw:{'$typeserver',SubReason} -> {error, {typeserver,SubReason}}
+ end.
+
+%% @private
+-spec is_instance(proper_gen:imm_instance(), raw_type()) -> boolean().
+%% TODO: If the second argument is not a type, let it pass (don't even check for
+%% term equality?) - if it's a raw type, don't cook it, instead recurse
+%% into it.
+is_instance(ImmInstance, RawType) ->
+ CleanInstance = proper_gen:clean_instance(ImmInstance),
+ Type = cook_outer(RawType),
+ (case get_prop(kind, Type) of
+ wrapper -> wrapper_test(ImmInstance, Type);
+ constructed -> constructed_test(ImmInstance, Type);
+ _ -> false
+ end
+ orelse
+ case find_prop(is_instance, Type) of
+ {ok,{typed, IsInstance}} -> IsInstance(Type, ImmInstance);
+ {ok,IsInstance} -> IsInstance(ImmInstance);
+ error -> false
+ end)
+ andalso weakly(satisfies_all(CleanInstance, Type)).
+
+-spec wrapper_test(proper_gen:imm_instance(), proper_types:type()) -> boolean().
+wrapper_test(ImmInstance, Type) ->
+ %% TODO: check if it's actually a raw type that's returned?
+ lists:any(fun(T) -> is_instance(ImmInstance, T) end, unwrap(Type)).
+
+%% @private
+-ifdef(AT_LEAST_17).
+-spec unwrap(proper_types:type()) -> [proper_types:type(),...].
+-endif.
+%% TODO: check if it's actually a raw type that's returned?
+unwrap(Type) ->
+ RawInnerTypes = proper_gen:alt_gens(Type) ++ [proper_gen:normal_gen(Type)],
+ [cook_outer(T) || T <- RawInnerTypes].
+
+-spec constructed_test(proper_gen:imm_instance(), proper_types:type()) ->
+ boolean().
+constructed_test({'$used',ImmParts,ImmInstance}, Type) ->
+ PartsType = get_prop(parts_type, Type),
+ Combine = get_prop(combine, Type),
+ is_instance(ImmParts, PartsType) andalso
+ begin
+ %% TODO: check if it's actually a raw type that's returned?
+ %% TODO: move construction code to proper_gen
+ %% TODO: non-type => should we check for strict term equality?
+ RawInnerType = Combine(proper_gen:clean_instance(ImmParts)),
+ is_instance(ImmInstance, RawInnerType)
+ end;
+constructed_test({'$to_part',ImmInstance}, Type) ->
+ PartsType = get_prop(parts_type, Type),
+ get_prop(shrink_to_parts, Type) =:= true andalso
+ %% TODO: we reject non-container types
+ get_prop(kind, PartsType) =:= container andalso
+ case {find_prop(internal_type,PartsType),
+ find_prop(internal_types,PartsType)} of
+ {{ok,EachPartType},error} ->
+ %% The parts are in a list or a vector.
+ is_instance(ImmInstance, EachPartType);
+ {error,{ok,PartTypesList}} ->
+ %% The parts are in a fixed list.
+ %% TODO: It should always be a proper list.
+ lists:any(fun(T) -> is_instance(ImmInstance,T) end, PartTypesList)
+ end;
+constructed_test(_CleanInstance, _Type) ->
+ %% TODO: can we do anything better?
+ false.
+
+%% @private
+-spec weakly({boolean(),boolean()}) -> boolean().
+weakly({B1,_B2}) -> B1.
+
+%% @private
+-spec strongly({boolean(),boolean()}) -> boolean().
+strongly({_B1,B2}) -> B2.
+
+-spec satisfies(proper_gen:instance(), {constraint_fun(),boolean()})
+ -> {boolean(),boolean()}.
+satisfies(Instance, {Test,false}) ->
+ {true,Test(Instance)};
+satisfies(Instance, {Test,true}) ->
+ Result = Test(Instance),
+ {Result,Result}.
+
+%% @private
+-spec satisfies_all(proper_gen:instance(), proper_types:type()) ->
+ {boolean(),boolean()}.
+satisfies_all(Instance, Type) ->
+ case find_prop(constraints, Type) of
+ {ok, Constraints} ->
+ L = [satisfies(Instance, C) || C <- Constraints],
+ {L1,L2} = lists:unzip(L),
+ {lists:all(fun(B) -> B end, L1), lists:all(fun(B) -> B end, L2)};
+ error ->
+ {true,true}
+ end.
+
+
+%%------------------------------------------------------------------------------
+%% Type definition functions
+%%------------------------------------------------------------------------------
+
+%% @private
+-spec lazy(proper_gen:nosize_generator()) -> proper_types:type().
+lazy(Gen) ->
+ ?WRAPPER([
+ {generator, Gen}
+ ]).
+
+%% @private
+-spec sized(proper_gen:sized_generator()) -> proper_types:type().
+sized(Gen) ->
+ ?WRAPPER([
+ {generator, Gen}
+ ]).
+
+%% @private
+-spec bind(raw_type(), proper_gen:combine_fun(), boolean()) ->
+ proper_types:type().
+bind(RawPartsType, Combine, ShrinkToParts) ->
+ PartsType = cook_outer(RawPartsType),
+ ?CONSTRUCTED([
+ {parts_type, PartsType},
+ {combine, Combine},
+ {shrink_to_parts, ShrinkToParts}
+ ]).
+
+%% @private
+-spec shrinkwith(proper_gen:nosize_generator(), proper_gen:alt_gens()) ->
+ proper_types:type().
+shrinkwith(Gen, DelaydAltGens) ->
+ ?WRAPPER([
+ {generator, Gen},
+ {alt_gens, DelaydAltGens}
+ ]).
+
+%% @private
+-spec add_constraint(raw_type(), constraint_fun(), boolean()) ->
+ proper_types:type().
+add_constraint(RawType, Condition, IsStrict) ->
+ Type = cook_outer(RawType),
+ append_to_prop(constraints, {Condition,IsStrict}, Type).
+
+%% @private
+-spec native_type(mod_name(), string()) -> proper_types:type().
+native_type(Mod, TypeStr) ->
+ ?WRAPPER([
+ {generator, fun() -> proper_gen:native_type_gen(Mod,TypeStr) end}
+ ]).
+
+
+%%------------------------------------------------------------------------------
+%% Basic types
+%%------------------------------------------------------------------------------
+
+%% @doc All integers between `Low' and `High', bounds included.
+%% `Low' and `High' must be Erlang expressions that evaluate to integers, with
+%% `Low =< High'. Additionally, `Low' and `High' may have the value `inf', in
+%% which case they represent minus infinity and plus infinity respectively.
+%% Instances shrink towards 0 if `Low =< 0 =< High', or towards the bound with
+%% the smallest absolute value otherwise.
+-spec integer(extint(), extint()) -> proper_types:type().
+integer(Low, High) ->
+ ?BASIC([
+ {env, {Low, High}},
+ {generator, {typed, fun integer_gen/2}},
+ {is_instance, {typed, fun integer_is_instance/2}},
+ {shrinkers, [fun number_shrinker/3]}
+ ]).
+
+integer_gen(Type, Size) ->
+ {Low, High} = get_prop(env, Type),
+ proper_gen:integer_gen(Size, Low, High).
+
+integer_is_instance(Type, X) ->
+ {Low, High} = get_prop(env, Type),
+ is_integer(X) andalso le(Low, X) andalso le(X, High).
+
+number_shrinker(X, Type, S) ->
+ {Low, High} = get_prop(env, Type),
+ proper_shrink:number_shrinker(X, Low, High, S).
+
+%% @doc All floats between `Low' and `High', bounds included.
+%% `Low' and `High' must be Erlang expressions that evaluate to floats, with
+%% `Low =< High'. Additionally, `Low' and `High' may have the value `inf', in
+%% which case they represent minus infinity and plus infinity respectively.
+%% Instances shrink towards 0.0 if `Low =< 0.0 =< High', or towards the bound
+%% with the smallest absolute value otherwise.
+-spec float(extnum(), extnum()) -> proper_types:type().
+float(Low, High) ->
+ ?BASIC([
+ {env, {Low, High}},
+ {generator, {typed, fun float_gen/2}},
+ {is_instance, {typed, fun float_is_instance/2}},
+ {shrinkers, [fun number_shrinker/3]}
+ ]).
+
+float_gen(Type, Size) ->
+ {Low, High} = get_prop(env, Type),
+ proper_gen:float_gen(Size, Low, High).
+
+float_is_instance(Type, X) ->
+ {Low, High} = get_prop(env, Type),
+ is_float(X) andalso le(Low, X) andalso le(X, High).
+
+%% @private
+-spec le(extnum(), extnum()) -> boolean().
+le(inf, _B) -> true;
+le(_A, inf) -> true;
+le(A, B) -> A =< B.
+
+%% @doc All atoms. All atoms used internally by PropEr start with a '`$'', so
+%% such atoms will never be produced as instances of this type. You should also
+%% refrain from using such atoms in your code, to avoid a potential clash.
+%% Instances shrink towards the empty atom, ''.
+-spec atom() -> proper_types:type().
+atom() ->
+ ?WRAPPER([
+ {generator, fun proper_gen:atom_gen/1},
+ {reverse_gen, fun proper_gen:atom_rev/1},
+ {size_transform, fun(Size) -> erlang:min(Size,255) end},
+ {is_instance, fun atom_is_instance/1}
+ ]).
+
+atom_is_instance(X) ->
+ is_atom(X)
+ %% We return false for atoms starting with '$', since these are
+ %% atoms used internally and never produced by the atom generator.
+ andalso (X =:= '' orelse hd(atom_to_list(X)) =/= $$).
+
+%% @doc All binaries. Instances shrink towards the empty binary, `<<>>'.
+-spec binary() -> proper_types:type().
+binary() ->
+ ?WRAPPER([
+ {generator, fun proper_gen:binary_gen/1},
+ {reverse_gen, fun proper_gen:binary_rev/1},
+ {is_instance, fun erlang:is_binary/1}
+ ]).
+
+%% @doc All binaries with a byte size of `Len'.
+%% `Len' must be an Erlang expression that evaluates to a non-negative integer.
+%% Instances shrink towards binaries of zeroes.
+-spec binary(length()) -> proper_types:type().
+binary(Len) ->
+ ?WRAPPER([
+ {env, Len},
+ {generator, {typed, fun binary_len_gen/1}},
+ {reverse_gen, fun proper_gen:binary_rev/1},
+ {is_instance, {typed, fun binary_len_is_instance/2}}
+ ]).
+
+binary_len_gen(Type) ->
+ Len = get_prop(env, Type),
+ proper_gen:binary_len_gen(Len).
+
+binary_len_is_instance(Type, X) ->
+ Len = get_prop(env, Type),
+ is_binary(X) andalso byte_size(X) =:= Len.
+
+%% @doc All bitstrings. Instances shrink towards the empty bitstring, `<<>>'.
+-spec bitstring() -> proper_types:type().
+bitstring() ->
+ ?WRAPPER([
+ {generator, fun proper_gen:bitstring_gen/1},
+ {reverse_gen, fun proper_gen:bitstring_rev/1},
+ {is_instance, fun erlang:is_bitstring/1}
+ ]).
+
+%% @doc All bitstrings with a bit size of `Len'.
+%% `Len' must be an Erlang expression that evaluates to a non-negative integer.
+%% Instances shrink towards bitstrings of zeroes
+-spec bitstring(length()) -> proper_types:type().
+bitstring(Len) ->
+ ?WRAPPER([
+ {env, Len},
+ {generator, {typed, fun bitstring_len_gen/1}},
+ {reverse_gen, fun proper_gen:bitstring_rev/1},
+ {is_instance, {typed, fun bitstring_len_is_instance/2}}
+ ]).
+
+bitstring_len_gen(Type) ->
+ Len = get_prop(env, Type),
+ proper_gen:bitstring_len_gen(Len).
+
+bitstring_len_is_instance(Type, X) ->
+ Len = get_prop(env, Type),
+ is_bitstring(X) andalso bit_size(X) =:= Len.
+
+%% @doc All lists containing elements of type `ElemType'.
+%% Instances shrink towards the empty list, `[]'.
+-spec list(ElemType::raw_type()) -> proper_types:type().
+% TODO: subtyping would be useful here (list, vector, fixed_list)
+list(RawElemType) ->
+ ElemType = cook_outer(RawElemType),
+ ?CONTAINER([
+ {generator, {typed, fun list_gen/2}},
+ {is_instance, {typed, fun list_is_instance/2}},
+ {internal_type, ElemType},
+ {get_length, fun erlang:length/1},
+ {split, fun lists:split/2},
+ {join, fun lists:append/2},
+ {get_indices, fun list_get_indices/2},
+ {remove, fun proper_arith:list_remove/2},
+ {retrieve, fun lists:nth/2},
+ {update, fun proper_arith:list_update/3}
+ ]).
+
+list_gen(Type, Size) ->
+ ElemType = get_prop(internal_type, Type),
+ proper_gen:list_gen(Size, ElemType).
+
+list_is_instance(Type, X) ->
+ ElemType = get_prop(internal_type, Type),
+ list_test(X, ElemType).
+
+%% @doc A type that generates exactly the list `List'. Instances shrink towards
+%% shorter sublists of the original list.
+-spec shrink_list([term()]) -> proper_types:type().
+shrink_list(List) ->
+ ?CONTAINER([
+ {env, List},
+ {generator, {typed, fun shrink_list_gen/1}},
+ {is_instance, {typed, fun shrink_list_is_instance/2}},
+ {get_length, fun erlang:length/1},
+ {split, fun lists:split/2},
+ {join, fun lists:append/2},
+ {get_indices, fun list_get_indices/2},
+ {remove, fun proper_arith:list_remove/2}
+ ]).
+
+shrink_list_gen(Type) ->
+ get_prop(env, Type).
+
+shrink_list_is_instance(Type, X) ->
+ List = get_prop(env, Type),
+ is_sublist(X, List).
+
+-spec is_sublist([term()], [term()]) -> boolean().
+is_sublist([], _) -> true;
+is_sublist(_, []) -> false;
+is_sublist([H|T1], [H|T2]) -> is_sublist(T1, T2);
+is_sublist(Slice, [_|T2]) -> is_sublist(Slice, T2).
+
+-spec list_test(proper_gen:imm_instance(), proper_types:type()) -> boolean().
+list_test(X, ElemType) ->
+ is_list(X) andalso lists:all(fun(E) -> is_instance(E, ElemType) end, X).
+
+%% @private
+-spec list_get_indices(proper_gen:generator(), list()) -> [position()].
+list_get_indices(_, List) ->
+ lists:seq(1, length(List)).
+
+%% @private
+%% This assumes that:
+%% - instances of size S are always valid instances of size >S
+%% - any recursive calls inside Gen are lazy
+-spec distlist(size(), proper_gen:sized_generator(), boolean()) ->
+ proper_types:type().
+distlist(Size, Gen, NonEmpty) ->
+ ParentType = case NonEmpty of
+ true -> non_empty(list(Gen(Size)));
+ false -> list(Gen(Size))
+ end,
+ ?SUBTYPE(ParentType, [
+ {subenv, {Size, Gen, NonEmpty}},
+ {generator, {typed, fun distlist_gen/1}}
+ ]).
+
+distlist_gen(Type) ->
+ {Size, Gen, NonEmpty} = get_prop(subenv, Type),
+ proper_gen:distlist_gen(Size, Gen, NonEmpty).
+
+%% @doc All lists of length `Len' containing elements of type `ElemType'.
+%% `Len' must be an Erlang expression that evaluates to a non-negative integer.
+-spec vector(length(), ElemType::raw_type()) -> proper_types:type().
+vector(Len, RawElemType) ->
+ ElemType = cook_outer(RawElemType),
+ ?CONTAINER([
+ {env, Len},
+ {generator, {typed, fun vector_gen/1}},
+ {is_instance, {typed, fun vector_is_instance/2}},
+ {internal_type, ElemType},
+ {get_indices, fun vector_get_indices/2},
+ {retrieve, fun lists:nth/2},
+ {update, fun proper_arith:list_update/3}
+ ]).
+
+vector_gen(Type) ->
+ Len = get_prop(env, Type),
+ ElemType = get_prop(internal_type, Type),
+ proper_gen:vector_gen(Len, ElemType).
+
+vector_is_instance(Type, X) ->
+ Len = get_prop(env, Type),
+ ElemType = get_prop(internal_type, Type),
+ is_list(X)
+ andalso length(X) =:= Len
+ andalso lists:all(fun(E) -> is_instance(E, ElemType) end, X).
+
+vector_get_indices(Type, _X) ->
+ lists:seq(1, get_prop(env, Type)).
+
+%% @doc The union of all types in `ListOfTypes'. `ListOfTypes' can't be empty.
+%% The random instance generator is equally likely to choose any one of the
+%% types in `ListOfTypes'. The shrinking subsystem will always try to shrink an
+%% instance of a type union to an instance of the first type in `ListOfTypes',
+%% thus you should write the simplest case first.
+-spec union(ListOfTypes::[raw_type(),...]) -> proper_types:type().
+union(RawChoices) ->
+ Choices = [cook_outer(C) || C <- RawChoices],
+ ?BASIC([
+ {env, Choices},
+ {generator, {typed, fun union_gen/1}},
+ {is_instance, {typed, fun union_is_instance/2}},
+ {shrinkers, [fun union_shrinker_1/3, fun union_shrinker_2/3]}
+ ]).
+
+union_gen(Type) ->
+ Choices = get_prop(env,Type),
+ proper_gen:union_gen(Choices).
+
+union_is_instance(Type, X) ->
+ Choices = get_prop(env, Type),
+ lists:any(fun(C) -> is_instance(X, C) end, Choices).
+
+union_shrinker_1(X, Type, S) ->
+ Choices = get_prop(env, Type),
+ proper_shrink:union_first_choice_shrinker(X, Choices, S).
+
+union_shrinker_2(X, Type, S) ->
+ Choices = get_prop(env, Type),
+ proper_shrink:union_recursive_shrinker(X, Choices, S).
+
+%% @doc A specialization of {@link union/1}, where each type in `ListOfTypes' is
+%% assigned a frequency. Frequencies must be Erlang expressions that evaluate to
+%% positive integers. Types with larger frequencies are more likely to be chosen
+%% by the random instance generator. The shrinking subsystem will ignore the
+%% frequencies and try to shrink towards the first type in the list.
+-spec weighted_union(ListOfTypes::[{frequency(),raw_type()},...]) ->
+ proper_types:type().
+weighted_union(RawFreqChoices) ->
+ CookFreqType = fun({Freq,RawType}) -> {Freq,cook_outer(RawType)} end,
+ FreqChoices = lists:map(CookFreqType, RawFreqChoices),
+ Choices = [T || {_F,T} <- FreqChoices],
+ ?SUBTYPE(union(Choices), [
+ {subenv, FreqChoices},
+ {generator, {typed, fun weighted_union_gen/1}}
+ ]).
+
+weighted_union_gen(Gen) ->
+ FreqChoices = get_prop(subenv, Gen),
+ proper_gen:weighted_union_gen(FreqChoices).
+
+%% @private
+-spec safe_union([raw_type(),...]) -> proper_types:type().
+safe_union(RawChoices) ->
+ Choices = [cook_outer(C) || C <- RawChoices],
+ subtype(
+ [{subenv, Choices},
+ {generator, {typed, fun safe_union_gen/1}}],
+ union(Choices)).
+
+safe_union_gen(Type) ->
+ Choices = get_prop(subenv, Type),
+ proper_gen:safe_union_gen(Choices).
+
+%% @private
+-spec safe_weighted_union([{frequency(),raw_type()},...]) ->
+ proper_types:type().
+safe_weighted_union(RawFreqChoices) ->
+ CookFreqType = fun({Freq,RawType}) ->
+ {Freq,cook_outer(RawType)} end,
+ FreqChoices = lists:map(CookFreqType, RawFreqChoices),
+ Choices = [T || {_F,T} <- FreqChoices],
+ subtype([{subenv, FreqChoices},
+ {generator, {typed, fun safe_weighted_union_gen/1}}],
+ union(Choices)).
+
+safe_weighted_union_gen(Type) ->
+ FreqChoices = get_prop(subenv, Type),
+ proper_gen:safe_weighted_union_gen(FreqChoices).
+
+%% @doc All tuples whose i-th element is an instance of the type at index i of
+%% `ListOfTypes'. Also written simply as a tuple of types.
+-spec tuple(ListOfTypes::[raw_type()]) -> proper_types:type().
+tuple(RawFields) ->
+ Fields = [cook_outer(F) || F <- RawFields],
+ ?CONTAINER([
+ {env, Fields},
+ {generator, {typed, fun tuple_gen/1}},
+ {is_instance, {typed, fun tuple_is_instance/2}},
+ {internal_types, list_to_tuple(Fields)},
+ {get_indices, fun tuple_get_indices/2},
+ {retrieve, fun erlang:element/2},
+ {update, fun tuple_update/3}
+ ]).
+
+tuple_gen(Type) ->
+ Fields = get_prop(env, Type),
+ proper_gen:tuple_gen(Fields).
+
+tuple_is_instance(Type, X) ->
+ Fields = get_prop(env, Type),
+ is_tuple(X) andalso fixed_list_test(tuple_to_list(X), Fields).
+
+tuple_get_indices(Type, _X) ->
+ lists:seq(1, length(get_prop(env, Type))).
+
+-spec tuple_update(index(), value(), tuple()) -> tuple().
+tuple_update(Index, NewElem, Tuple) ->
+ setelement(Index, Tuple, NewElem).
+
+%% @doc Tuples whose elements are all of type `ElemType'.
+%% Instances shrink towards the 0-size tuple, `{}'.
+-spec loose_tuple(ElemType::raw_type()) -> proper_types:type().
+loose_tuple(RawElemType) ->
+ ElemType = cook_outer(RawElemType),
+ ?WRAPPER([
+ {env, ElemType},
+ {generator, {typed, fun loose_tuple_gen/2}},
+ {reverse_gen, {typed, fun loose_tuple_rev/2}},
+ {is_instance, {typed, fun loose_tuple_is_instance/2}}
+ ]).
+
+loose_tuple_gen(Type, Size) ->
+ ElemType = get_prop(env, Type),
+ proper_gen:loose_tuple_gen(Size, ElemType).
+
+loose_tuple_rev(Type, X) ->
+ ElemType = get_prop(env, Type),
+ proper_gen:loose_tuple_rev(X, ElemType).
+
+loose_tuple_is_instance(Type, X) ->
+ ElemType = get_prop(env, Type),
+ is_tuple(X) andalso list_test(tuple_to_list(X), ElemType).
+
+%% @doc Singleton type consisting only of `E'. `E' must be an evaluated term.
+%% Also written simply as `E'.
+-spec exactly(term()) -> proper_types:type().
+exactly(E) ->
+ ?BASIC([
+ {env, E},
+ {generator, {typed, fun exactly_gen/1}},
+ {is_instance, {typed, fun exactly_is_instance/2}}
+ ]).
+
+exactly_gen(Type) ->
+ E = get_prop(env, Type),
+ proper_gen:exactly_gen(E).
+
+exactly_is_instance(Type, X) ->
+ E = get_prop(env, Type),
+ X =:= E.
+
+%% @doc All lists whose i-th element is an instance of the type at index i of
+%% `ListOfTypes'. Also written simply as a list of types.
+-spec fixed_list(ListOfTypes::maybe_improper_list(raw_type(),raw_type()|[])) ->
+ proper_types:type().
+fixed_list(MaybeImproperRawFields) ->
+ %% CAUTION: must handle improper lists
+ {Fields, Internal, Len, Retrieve, Update} =
+ case proper_arith:cut_improper_tail(MaybeImproperRawFields) of
+ % TODO: have cut_improper_tail return the length and use it in test?
+ {ProperRawHead, ImproperRawTail} ->
+ HeadLen = length(ProperRawHead),
+ CookedHead = [cook_outer(F) || F <- ProperRawHead],
+ CookedTail = cook_outer(ImproperRawTail),
+ {{CookedHead,CookedTail},
+ CookedHead ++ CookedTail,
+ HeadLen + 1,
+ fun(I,L) -> improper_list_retrieve(I, L, HeadLen) end,
+ fun(I,V,L) -> improper_list_update(I, V, L, HeadLen) end};
+ ProperRawFields ->
+ LocalFields = [cook_outer(F) || F <- ProperRawFields],
+ {LocalFields,
+ LocalFields,
+ length(ProperRawFields),
+ fun lists:nth/2,
+ fun proper_arith:list_update/3}
+ end,
+ ?CONTAINER([
+ {env, {Fields, Len}},
+ {generator, {typed, fun fixed_list_gen/1}},
+ {is_instance, {typed, fun fixed_list_is_instance/2}},
+ {internal_types, Internal},
+ {get_indices, fun fixed_list_get_indices/2},
+ {retrieve, Retrieve},
+ {update, Update}
+ ]).
+
+fixed_list_gen(Type) ->
+ {Fields, _} = get_prop(env, Type),
+ proper_gen:fixed_list_gen(Fields).
+
+fixed_list_is_instance(Type, X) ->
+ {Fields, _} = get_prop(env, Type),
+ fixed_list_test(X, Fields).
+
+fixed_list_get_indices(Type, _X) ->
+ {_, Len} = get_prop(env, Type),
+ lists:seq(1, Len).
+
+-spec fixed_list_test(proper_gen:imm_instance(),
+ [proper_types:type()] | {[proper_types:type()],
+ proper_types:type()}) ->
+ boolean().
+fixed_list_test(X, {ProperHead,ImproperTail}) ->
+ is_list(X) andalso
+ begin
+ ProperHeadLen = length(ProperHead),
+ proper_arith:head_length(X) >= ProperHeadLen andalso
+ begin
+ {XHead,XTail} = lists:split(ProperHeadLen, X),
+ fixed_list_test(XHead, ProperHead)
+ andalso is_instance(XTail, ImproperTail)
+ end
+ end;
+fixed_list_test(X, ProperFields) ->
+ is_list(X)
+ andalso length(X) =:= length(ProperFields)
+ andalso lists:all(fun({E,T}) -> is_instance(E, T) end,
+ lists:zip(X, ProperFields)).
+
+%% TODO: Move these 2 functions to proper_arith?
+-spec improper_list_retrieve(index(), nonempty_improper_list(value(),value()),
+ pos_integer()) -> value().
+improper_list_retrieve(Index, List, HeadLen) ->
+ case Index =< HeadLen of
+ true -> lists:nth(Index, List);
+ false -> lists:nthtail(HeadLen, List)
+ end.
+
+-spec improper_list_update(index(), value(),
+ nonempty_improper_list(value(),value()),
+ pos_integer()) ->
+ nonempty_improper_list(value(),value()).
+improper_list_update(Index, Value, List, HeadLen) ->
+ case Index =< HeadLen of
+ %% TODO: This happens to work, but is not implied by list_update's spec.
+ true -> proper_arith:list_update(Index, Value, List);
+ false -> lists:sublist(List, HeadLen) ++ Value
+ end.
+
+%% @doc All pure functions that map instances of `ArgTypes' to instances of
+%% `RetType'. The syntax `function(Arity, RetType)' is also acceptable.
+-spec function(ArgTypes::[raw_type()] | arity(), RetType::raw_type()) ->
+ proper_types:type().
+function(Arity, RawRetType) when is_integer(Arity), Arity >= 0, Arity =< 255 ->
+ RetType = cook_outer(RawRetType),
+ ?BASIC([
+ {env, {Arity, RetType}},
+ {generator, {typed, fun function_gen/1}},
+ {is_instance, {typed, fun function_is_instance/2}}
+ ]);
+function(RawArgTypes, RawRetType) ->
+ function(length(RawArgTypes), RawRetType).
+
+function_gen(Type) ->
+ {Arity, RetType} = get_prop(env, Type),
+ proper_gen:function_gen(Arity, RetType).
+
+function_is_instance(Type, X) ->
+ {Arity, RetType} = get_prop(env, Type),
+ is_function(X, Arity)
+ %% TODO: what if it's not a function we produced?
+ andalso equal_types(RetType, proper_gen:get_ret_type(X)).
+
+%% @doc All Erlang terms (that PropEr can produce). For reasons of efficiency,
+%% functions are never produced as instances of this type.<br />
+%% CAUTION: Instances of this type are expensive to produce, shrink and instance-
+%% check, both in terms of processing time and consumed memory. Only use this
+%% type if you are certain that you need it.
+-spec any() -> proper_types:type().
+any() ->
+ AllTypes = [integer(),float(),atom(),bitstring(),?LAZY(loose_tuple(any())),
+ ?LAZY(list(any()))],
+ ?SUBTYPE(union(AllTypes), [
+ {generator, fun proper_gen:any_gen/1}
+ ]).
+
+
+%%------------------------------------------------------------------------------
+%% Type aliases
+%%------------------------------------------------------------------------------
+
+%% @equiv integer(inf, inf)
+-spec integer() -> proper_types:type().
+integer() -> integer(inf, inf).
+
+%% @equiv integer(0, inf)
+-spec non_neg_integer() -> proper_types:type().
+non_neg_integer() -> integer(0, inf).
+
+%% @equiv integer(1, inf)
+-spec pos_integer() -> proper_types:type().
+pos_integer() -> integer(1, inf).
+
+%% @equiv integer(inf, -1)
+-spec neg_integer() -> proper_types:type().
+neg_integer() -> integer(inf, -1).
+
+%% @equiv integer(Low, High)
+-spec range(extint(), extint()) -> proper_types:type().
+range(Low, High) -> integer(Low, High).
+
+%% @equiv float(inf, inf)
+-spec float() -> proper_types:type().
+float() -> float(inf, inf).
+
+%% @equiv float(0.0, inf)
+-spec non_neg_float() -> proper_types:type().
+non_neg_float() -> float(0.0, inf).
+
+%% @equiv union([integer(), float()])
+-spec number() -> proper_types:type().
+number() -> union([integer(), float()]).
+
+%% @doc The atoms `true' and `false'. Instances shrink towards `false'.
+-spec boolean() -> proper_types:type().
+boolean() -> union(['false', 'true']).
+
+%% @equiv integer(0, 255)
+-spec byte() -> proper_types:type().
+byte() -> integer(0, 255).
+
+%% @equiv integer(0, 16#10ffff)
+-spec char() -> proper_types:type().
+char() -> integer(0, 16#10ffff).
+
+%% @equiv list(any())
+-spec list() -> proper_types:type().
+list() -> list(any()).
+
+%% @equiv loose_tuple(any())
+-spec tuple() -> proper_types:type().
+tuple() -> loose_tuple(any()).
+
+%% @equiv list(char())
+-spec string() -> proper_types:type().
+string() -> list(char()).
+
+%% @equiv weighted_union(FreqChoices)
+-spec wunion([{frequency(),raw_type()},...]) -> proper_types:type().
+wunion(FreqChoices) -> weighted_union(FreqChoices).
+
+%% @equiv any()
+-spec term() -> proper_types:type().
+term() -> any().
+
+%% @equiv union([non_neg_integer() | infinity])
+-spec timeout() -> proper_types:type().
+timeout() -> union([non_neg_integer(), 'infinity']).
+
+%% @equiv integer(0, 255)
+-spec arity() -> proper_types:type().
+arity() -> integer(0, 255).
+
+
+%%------------------------------------------------------------------------------
+%% QuickCheck compatibility types
+%%------------------------------------------------------------------------------
+
+%% @doc Small integers (bound by the current value of the `size' parameter).
+%% Instances shrink towards `0'.
+-spec int() -> proper_types:type().
+int() -> ?SIZED(Size, integer(-Size,Size)).
+
+%% @doc Small non-negative integers (bound by the current value of the `size'
+%% parameter). Instances shrink towards `0'.
+-spec nat() -> proper_types:type().
+nat() -> ?SIZED(Size, integer(0,Size)).
+
+%% @equiv integer()
+-spec largeint() -> proper_types:type().
+largeint() -> integer().
+
+%% @equiv float()
+-spec real() -> proper_types:type().
+real() -> float().
+
+%% @equiv boolean()
+-spec bool() -> proper_types:type().
+bool() -> boolean().
+
+%% @equiv integer(Low, High)
+-spec choose(extint(), extint()) -> proper_types:type().
+choose(Low, High) -> integer(Low, High).
+
+%% @equiv union(Choices)
+-spec elements([raw_type(),...]) -> proper_types:type().
+elements(Choices) -> union(Choices).
+
+%% @equiv union(Choices)
+-spec oneof([raw_type(),...]) -> proper_types:type().
+oneof(Choices) -> union(Choices).
+
+%% @equiv weighted_union(Choices)
+-spec frequency([{frequency(),raw_type()},...]) -> proper_types:type().
+frequency(FreqChoices) -> weighted_union(FreqChoices).
+
+%% @equiv exactly(E)
+-spec return(term()) -> proper_types:type().
+return(E) -> exactly(E).
+
+%% @doc Adds a default value, `Default', to `Type'.
+%% The default serves as a primary shrinking target for instances, while it
+%% is also chosen by the random instance generation subsystem half the time.
+-spec default(raw_type(), raw_type()) -> proper_types:type().
+default(Default, Type) ->
+ union([Default, Type]).
+
+%% @doc All sorted lists containing elements of type `ElemType'.
+%% Instances shrink towards the empty list, `[]'.
+-spec orderedlist(ElemType::raw_type()) -> proper_types:type().
+orderedlist(RawElemType) ->
+ ?LET(L, list(RawElemType), lists:sort(L)).
+
+%% @equiv function(0, RetType)
+-spec function0(raw_type()) -> proper_types:type().
+function0(RetType) ->
+ function(0, RetType).
+
+%% @equiv function(1, RetType)
+-spec function1(raw_type()) -> proper_types:type().
+function1(RetType) ->
+ function(1, RetType).
+
+%% @equiv function(2, RetType)
+-spec function2(raw_type()) -> proper_types:type().
+function2(RetType) ->
+ function(2, RetType).
+
+%% @equiv function(3, RetType)
+-spec function3(raw_type()) -> proper_types:type().
+function3(RetType) ->
+ function(3, RetType).
+
+%% @equiv function(4, RetType)
+-spec function4(raw_type()) -> proper_types:type().
+function4(RetType) ->
+ function(4, RetType).
+
+%% @doc A specialization of {@link default/2}, where `Default' and `Type' are
+%% assigned weights to be considered by the random instance generator. The
+%% shrinking subsystem will ignore the weights and try to shrink using the
+%% default value.
+-spec weighted_default({frequency(),raw_type()}, {frequency(),raw_type()}) ->
+ proper_types:type().
+weighted_default(Default, Type) ->
+ weighted_union([Default, Type]).
+
+
+%%------------------------------------------------------------------------------
+%% Additional type specification functions
+%%------------------------------------------------------------------------------
+
+%% @doc Overrides the `size' parameter used when generating instances of
+%% `Type' with `NewSize'. Has no effect on size-less types, such as unions.
+%% Also, this will not affect the generation of any internal types contained in
+%% `Type', such as the elements of a list - those will still be generated
+%% using the test-wide value of `size'. One use of this function is to modify
+%% types to produce instances that grow faster or slower, like so:
+%% ```?SIZED(Size, resize(Size * 2, list(integer()))'''
+%% The above specifies a list type that grows twice as fast as normal lists.
+-spec resize(size(), Type::raw_type()) -> proper_types:type().
+resize(NewSize, RawType) ->
+ Type = cook_outer(RawType),
+ case find_prop(size_transform, Type) of
+ {ok,Transform} ->
+ add_prop(size_transform, fun(_S) -> Transform(NewSize) end, Type);
+ error ->
+ add_prop(size_transform, fun(_S) -> NewSize end, Type)
+ end.
+
+%% @doc This is a predefined constraint that can be applied to random-length
+%% list and binary types to ensure that the produced values are never empty.
+%%
+%% e.g. {@link list/0}, {@link string/0}, {@link binary/0})
+-spec non_empty(ListType::raw_type()) -> proper_types:type().
+non_empty(RawListType) ->
+ ?SUCHTHAT(L, RawListType, L =/= [] andalso L =/= <<>>).
+
+%% @doc Creates a new type which is equivalent to `Type', but whose instances
+%% are never shrunk by the shrinking subsystem.
+-spec noshrink(Type::raw_type()) -> proper_types:type().
+noshrink(RawType) ->
+ add_prop(noshrink, true, cook_outer(RawType)).
+
+%% @doc Associates the atom key `Parameter' with the value `Value' while
+%% generating instances of `Type'.
+-spec with_parameter(atom(), value(), Type::raw_type()) -> proper_types:type().
+with_parameter(Parameter, Value, RawType) ->
+ with_parameters([{Parameter,Value}], RawType).
+
+%% @doc Similar to {@link with_parameter/3}, but accepts a list of
+%% `{Parameter, Value}' pairs.
+-spec with_parameters([{atom(),value()}], Type::raw_type()) ->
+ proper_types:type().
+with_parameters(PVlist, RawType) ->
+ Type = cook_outer(RawType),
+ case find_prop(parameters, Type) of
+ {ok,Params} when is_list(Params) ->
+ append_list_to_prop(parameters, PVlist, Type);
+ error ->
+ add_prop(parameters, PVlist, Type)
+ end.
+
+%% @doc Returns the value associated with `Parameter', or `Default' in case
+%% `Parameter' is not associated with any value.
+-spec parameter(atom(), value()) -> value().
+parameter(Parameter, Default) ->
+ Parameters =
+ case erlang:get('$parameters') of
+ undefined -> [];
+ List -> List
+ end,
+ proplists:get_value(Parameter, Parameters, Default).
+
+%% @equiv parameter(Parameter, undefined)
+-spec parameter(atom()) -> value().
+parameter(Parameter) ->
+ parameter(Parameter, undefined).
diff --git a/lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_typeserver.erl b/lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_typeserver.erl
new file mode 100644
index 0000000000..b16075763f
--- /dev/null
+++ b/lib/dialyzer/test/behaviour_SUITE_data/src/proper/proper_typeserver.erl
@@ -0,0 +1,2411 @@
+%%% Copyright 2010-2016 Manolis Papadakis <[email protected]>,
+%%% Eirini Arvaniti <[email protected]>
+%%% and Kostis Sagonas <[email protected]>
+%%%
+%%% This file is part of PropEr.
+%%%
+%%% PropEr is free software: you can redistribute it and/or modify
+%%% it under the terms of the GNU General Public License as published by
+%%% the Free Software Foundation, either version 3 of the License, or
+%%% (at your option) any later version.
+%%%
+%%% PropEr is distributed in the hope that it will be useful,
+%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
+%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%%% GNU General Public License for more details.
+%%%
+%%% You should have received a copy of the GNU General Public License
+%%% along with PropEr. If not, see <http://www.gnu.org/licenses/>.
+
+%%% @copyright 2010-2016 Manolis Papadakis, Eirini Arvaniti and Kostis Sagonas
+%%% @version {@version}
+%%% @author Manolis Papadakis
+
+%%% @doc Erlang type system - PropEr type system integration module.
+%%%
+%%% PropEr can parse types expressed in Erlang's type language and convert them
+%%% to its own type format. Such expressions can be used instead of regular type
+%%% constructors in the second argument of `?FORALL's. No extra notation is
+%%% required; PropEr will detect which calls correspond to native types by
+%%% applying a parse transform during compilation. This parse transform is
+%%% automatically applied to any module that includes the `proper.hrl' header
+%%% file. You can disable this feature by compiling your modules with
+%%% `-DPROPER_NO_TRANS'. Note that this will currently also disable the
+%%% automatic exporting of properties.
+%%%
+%%% The use of native types in properties is subject to the following usage
+%%% rules:
+%%% <ul>
+%%% <li>Native types cannot be used outside of `?FORALL's.</li>
+%%% <li>Inside `?FORALL's, native types can be combined with other native
+%%% types, and even with PropEr types, inside tuples and lists (the constructs
+%%% `[...]', `{...}' and `++' are all allowed).</li>
+%%% <li>All other constructs of Erlang's built-in type system (e.g. `|' for
+%%% union, `_' as an alias of `any()', `<<_:_>>' binary type syntax and
+%%% `fun((...) -> ...)' function type syntax) are not allowed in `?FORALL's,
+%%% because they are rejected by the Erlang parser.</li>
+%%% <li>Anything other than a tuple constructor, list constructor, `++'
+%%% application, local or remote call will automatically be considered a
+%%% PropEr type constructor and not be processed further by the parse
+%%% transform.</li>
+%%% <li>Parametric native types are fully supported; of course, they can only
+%%% appear instantiated in a `?FORALL'. The arguments of parametric native
+%%% types are always interpreted as native types.</li>
+%%% <li>Parametric PropEr types, on the other hand, can take any kind of
+%%% argument. You can even mix native and PropEr types in the arguments of a
+%%% PropEr type. For example, assuming that the following declarations are
+%%% present:
+%%% ``` my_proper_type() -> ?LET(...).
+%%% -type my_native_type() :: ... .'''
+%%% Then the following expressions are all legal:
+%%% ``` vector(2, my_native_type())
+%%% function(0, my_native_type())
+%%% union([my_proper_type(), my_native_type()])''' </li>
+%%% <li>Some type constructors can take native types as arguments (but only
+%%% inside `?FORALL's):
+%%% <ul>
+%%% <li>`?SUCHTHAT', `?SUCHTHATMAYBE', `non_empty', `noshrink': these work
+%%% with native types too</li>
+%%% <li>`?LAZY', `?SHRINK', `resize', `?SIZED': these don't work with native
+%%% types</li>
+%%% <li>`?LET', `?LETSHRINK': only the top-level base type can be a native
+%%% type</li>
+%%% </ul></li>
+%%% <li>Native type declarations in the `?FORALL's of a module can reference any
+%%% custom type declared in a `-type' or `-opaque' attribute of the same
+%%% module, as long as no module identifier is used.</li>
+%%% <li>Typed records cannot be referenced inside `?FORALL's using the
+%%% `#rec_name{}' syntax. To use a typed record in a `?FORALL', enclose the
+%%% record in a custom type like so:
+%%% ``` -type rec_name() :: #rec_name{}. '''
+%%% and use the custom type instead.</li>
+%%% <li>`?FORALL's may contain references to self-recursive or mutually
+%%% recursive native types, so long as each type in the hierarchy has a clear
+%%% base case.
+%%% Currently, PropEr requires that the toplevel of any recursive type
+%%% declaration is either a (maybe empty) list or a union containing at least
+%%% one choice that doesn't reference the type directly (it may, however,
+%%% reference any of the types that are mutually recursive with it). This
+%%% means, for example, that some valid recursive type declarations, such as
+%%% this one:
+%%% ``` ?FORALL(..., a(), ...) '''
+%%% where:
+%%% ``` -type a() :: {'a','none' | a()}. '''
+%%% are not accepted by PropEr. However, such types can be rewritten in a way
+%%% that allows PropEr to parse them:
+%%% ``` ?FORALL(..., a(), ...) '''
+%%% where:
+%%% ``` -type a() :: {'a','none'} | {'a',a()}. '''
+%%% This also means that recursive record declarations are not allowed:
+%%% ``` ?FORALL(..., rec(), ...) '''
+%%% where:
+%%% ``` -type rec() :: #rec{}.
+%%% -record(rec, {a = 0 :: integer(), b = 'nil' :: 'nil' | #rec{}}). '''
+%%% A little rewritting can usually remedy this problem as well:
+%%% ``` ?FORALL(..., rec(), ...) '''
+%%% where:
+%%% ``` -type rec() :: #rec{b :: 'nil'} | #rec{b :: rec()}.
+%%% -record(rec, {a = 0 :: integer(), b = 'nil' :: 'nil' | #rec{}}). '''
+%%% </li>
+%%% <li>Remote types may be referenced in a `?FORALL', so long as they are
+%%% exported from the remote module. Currently, PropEr requires that any
+%%% remote modules whose types are directly referenced from within properties
+%%% are present in the code path at compile time, either compiled with
+%%% `debug_info' enabled or in source form. If PropEr cannot find a remote
+%%% module at all, finds only a compiled object file with no debug
+%%% information or fails to compile the source file, all calls to that module
+%%% will automatically be considered calls to PropEr type constructors.</li>
+%%% <li>For native types to be translated correctly, both the module that
+%%% contains the `?FORALL' declaration as well as any module that contains
+%%% the declaration of a type referenced (directly or indirectly) from inside
+%%% a `?FORALL' must be present in the code path at runtime, either compiled
+%%% with `debug_info' enabled or in source form.</li>
+%%% <li>Local types with the same name as an auto-imported BIF are not accepted
+%%% by PropEr, unless the BIF in question has been declared in a
+%%% `no_auto_import' option.</li>
+%%% <li>When an expression can be interpreted both as a PropEr type and as a
+%%% native type, the former takes precedence. This means that a function
+%%% `foo()' will shadow a type `foo()' if they are both present in the module.
+%%% The same rule applies to remote functions and types as well.</li>
+%%% <li>The above may cause some confusion when list syntax is used:
+%%% <ul>
+%%% <li>The expression `[integer()]' can be interpreted both ways, so the
+%%% PropEr way applies. Therefore, instances of this type will always be
+%%% lists of length 1, not arbitrary integer lists, as would be expected
+%%% when interpreting the expression as a native type.</li>
+%%% <li>Assuming that a custom type foo/1 has been declared, the expression
+%%% `foo([integer()])' can only be interpreted as a native type declaration,
+%%% which means that the generic type of integer lists will be passed to
+%%% `foo/1'.</li>
+%%% </ul></li>
+%%% <li>Currently, PropEr does not detect the following mistakes:
+%%% <ul>
+%%% <li>inline record-field specializations that reference non-existent
+%%% fields</li>
+%%% <li>type parameters that are not present in the RHS of a `-type'
+%%% declaration</li>
+%%% <li>using `_' as a type variable in the LHS of a `-type' declaration</li>
+%%% <li>using the same variable in more than one position in the LHS of a
+%%% `-type' declaration</li>
+%%% </ul>
+%%% </li>
+%%% </ul>
+%%%
+%%% You can use <a href="#index">these</a> functions to try out the type
+%%% translation subsystem.
+%%%
+%%% CAUTION: These functions should never be used inside properties. They are
+%%% meant for demonstration purposes only.
+
+-module(proper_typeserver).
+-behaviour(gen_server).
+-export([demo_translate_type/2, demo_is_instance/3]).
+
+-export([start/0, restart/0, stop/0, create_spec_test/3, get_exp_specced/1,
+ is_instance/3, translate_type/1]).
+-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2,
+ code_change/3]).
+-export([get_exp_info/1, match/2]).
+
+-export_type([imm_type/0, mod_exp_types/0, mod_exp_funs/0]).
+
+-include("proper_internal.hrl").
+
+
+%%------------------------------------------------------------------------------
+%% Macros
+%%------------------------------------------------------------------------------
+
+-define(SRC_FILE_EXT, ".erl").
+
+-ifdef(AT_LEAST_19).
+-define(anno(L), erl_anno:new(L)).
+-else.
+-define(anno(L), L).
+-endif.
+
+%% Starting with 18.0 we need to handle both 'type' and 'user_type' tags;
+%% prior Erlang/OTP releases had only 'type' as a tag.
+-define(IS_TYPE_TAG(T), (T =:= type orelse T =:= user_type)).
+
+%% CAUTION: all these must be sorted
+-define(STD_TYPES_0,
+ [any,arity,atom,binary,bitstring,bool,boolean,byte,char,float,integer,
+ list,neg_integer,non_neg_integer,number,pos_integer,string,term,
+ timeout]).
+-define(HARD_ADTS,
+ %% gb_trees:iterator and gb_sets:iterator are NOT hardcoded
+ [{{array,0},array}, {{array,1},proper_array},
+ {{dict,0},dict}, {{dict,2},proper_dict},
+ {{gb_set,0},gb_sets}, {{gb_set,1},proper_gb_sets},
+ {{gb_tree,0},gb_trees}, {{gb_tree,2},proper_gb_trees},
+ {{orddict,2},proper_orddict},
+ {{ordset,1},proper_ordsets},
+ {{queue,0},queue}, {{queue,1},proper_queue},
+ {{set,0},sets}, {{set,1},proper_sets}]).
+-define(HARD_ADT_MODS,
+ [{array, [{{array,0},
+ {{type,0,record,[{atom,0,array}]},[]}}]},
+ {dict, [{{dict,0},
+ {{type,0,record,[{atom,0,dict}]},[]}}]},
+ {gb_sets, [{{gb_set,0},
+ {{type,0,tuple,[{type,0,non_neg_integer,[]},
+ {type,0,gb_set_node,[]}]},[]}}]},
+ {gb_trees, [{{gb_tree,0},
+ {{type,0,tuple,[{type,0,non_neg_integer,[]},
+ {type,0,gb_tree_node,[]}]},[]}}]},
+ %% Our parametric ADTs are already declared as normal types, we just
+ %% need to change them to opaques.
+ {proper_array, [{{array,1},already_declared}]},
+ {proper_dict, [{{dict,2},already_declared}]},
+ {proper_gb_sets, [{{gb_set,1},already_declared},
+ {{iterator,1},already_declared}]},
+ {proper_gb_trees, [{{gb_tree,2},already_declared},
+ {{iterator,2},already_declared}]},
+ {proper_orddict, [{{orddict,2},already_declared}]},
+ {proper_ordsets, [{{ordset,1},already_declared}]},
+ {proper_queue, [{{queue,1},already_declared}]},
+ {proper_sets, [{{set,1},already_declared}]},
+ {queue, [{{queue,0},
+ {{type,0,tuple,[{type,0,list,[]},{type,0,list,[]}]},[]}}]},
+ {sets, [{{set,0},
+ {{type,0,record,[{atom,0,set}]},[]}}]}]).
+
+
+%%------------------------------------------------------------------------------
+%% Types
+%%------------------------------------------------------------------------------
+
+-type type_name() :: atom().
+-type var_name() :: atom(). %% TODO: also integers?
+-type field_name() :: atom().
+
+-type type_kind() :: 'type' | 'record'.
+-type type_ref() :: {type_kind(),type_name(),arity()}.
+-ifdef(NO_MODULES_IN_OPAQUES).
+-type substs_dict() :: dict(). %% dict(field_name(),ret_type())
+-else.
+-type substs_dict() :: dict:dict(field_name(),ret_type()).
+-endif.
+-type full_type_ref() :: {mod_name(),type_kind(),type_name(),
+ [ret_type()] | substs_dict()}.
+-type symb_info() :: 'not_symb' | {'orig_abs',abs_type()}.
+-type type_repr() :: {'abs_type',abs_type(),[var_name()],symb_info()}
+ | {'cached',fin_type(),abs_type(),symb_info()}
+ | {'abs_record',[{field_name(),abs_type()}]}.
+-type gen_fun() :: fun((size()) -> fin_type()).
+-type rec_fun() :: fun(([gen_fun()],size()) -> fin_type()).
+-type rec_arg() :: {boolean() | {'list',boolean(),rec_fun()},full_type_ref()}.
+-type rec_args() :: [rec_arg()].
+-type ret_type() :: {'simple',fin_type()} | {'rec',rec_fun(),rec_args()}.
+-type rec_fun_info() :: {pos_integer(),pos_integer(),[arity(),...],
+ [rec_fun(),...]}.
+
+-type imm_type_ref() :: {type_name(),arity()}.
+-type hard_adt_repr() :: {abs_type(),[var_name()]} | 'already_declared'.
+-type fun_ref() :: {fun_name(),arity()}.
+-type fun_repr() :: fun_clause_repr().
+-type fun_clause_repr() :: {[abs_type()],abs_type()}.
+-type proc_fun_ref() :: {fun_name(),[abs_type()],abs_type()}.
+-type full_imm_type_ref() :: {mod_name(),type_name(),arity()}.
+-type imm_stack() :: [full_imm_type_ref()].
+-type pat_field() :: 0 | 1 | atom().
+-type pattern() :: loose_tuple(pat_field()).
+-type next_step() :: 'none' | 'take_head' | {'match_with',pattern()}.
+
+-ifdef(NO_MODULES_IN_OPAQUES).
+%% @private_type
+-type mod_exp_types() :: set(). %% set(imm_type_ref())
+-type mod_types() :: dict(). %% dict(type_ref(),type_repr())
+%% @private_type
+-type mod_exp_funs() :: set(). %% set(fun_ref())
+-type mod_specs() :: dict(). %% dict(fun_ref(),fun_repr())
+-else.
+%% @private_type
+-type mod_exp_types() :: sets:set(imm_type_ref()).
+-type mod_types() :: dict:dict(type_ref(),type_repr()).
+%% @private_type
+-type mod_exp_funs() :: sets:set(fun_ref()).
+-type mod_specs() :: dict:dict(fun_ref(),fun_repr()).
+-endif.
+
+-ifdef(NO_MODULES_IN_OPAQUES).
+-record(state,
+ {cached = dict:new() :: dict(), %% dict(imm_type(),fin_type())
+ exp_types = dict:new() :: dict(), %% dict(mod_name(),mod_exp_types())
+ types = dict:new() :: dict(), %% dict(mod_name(),mod_types())
+ exp_specs = dict:new() :: dict()}). %% dict(mod_name(),mod_specs())
+-else.
+-record(state,
+ {cached = dict:new() :: dict:dict(imm_type(),fin_type()),
+ exp_types = dict:new() :: dict:dict(mod_name(),mod_exp_types()),
+ types = dict:new() :: dict:dict(mod_name(),mod_types()),
+ exp_specs = dict:new() :: dict:dict(mod_name(),mod_specs())}).
+-endif.
+-type state() :: #state{}.
+
+-record(mod_info,
+ {mod_exp_types = sets:new() :: mod_exp_types(),
+ mod_types = dict:new() :: mod_types(),
+ mod_opaques = sets:new() :: mod_exp_types(),
+ mod_exp_funs = sets:new() :: mod_exp_funs(),
+ mod_specs = dict:new() :: mod_specs()}).
+-type mod_info() :: #mod_info{}.
+
+-type stack() :: [full_type_ref() | 'tuple' | 'list' | 'union' | 'fun'].
+-ifdef(NO_MODULES_IN_OPAQUES).
+-type var_dict() :: dict(). %% dict(var_name(),ret_type())
+-else.
+-type var_dict() :: dict:dict(var_name(),ret_type()).
+-endif.
+%% @private_type
+-type imm_type() :: {mod_name(),string()}.
+%% @alias
+-type fin_type() :: proper_types:type().
+-type tagged_result(T) :: {'ok',T} | 'error'.
+-type tagged_result2(T,S) :: {'ok',T,S} | 'error'.
+%% @alias
+-type rich_result(T) :: {'ok',T} | {'error',term()}.
+-type rich_result2(T,S) :: {'ok',T,S} | {'error',term()}.
+-type false_positive_mfas() :: proper:false_positive_mfas().
+
+-type server_call() :: {'create_spec_test',mfa(),timeout(),false_positive_mfas()}
+ | {'get_exp_specced',mod_name()}
+ | {'get_type_repr',mod_name(),type_ref(),boolean()}
+ | {'translate_type',imm_type()}.
+-type server_response() :: rich_result(proper:test())
+ | rich_result([mfa()])
+ | rich_result(type_repr())
+ | rich_result(fin_type()).
+
+
+%%------------------------------------------------------------------------------
+%% Server interface functions
+%%------------------------------------------------------------------------------
+
+%% @private
+-spec start() -> 'ok'.
+start() ->
+ {ok,TypeserverPid} = gen_server:start_link(?MODULE, dummy, []),
+ put('$typeserver_pid', TypeserverPid),
+ ok.
+
+%% @private
+-spec restart() -> 'ok'.
+restart() ->
+ TypeserverPid = get('$typeserver_pid'),
+ case (TypeserverPid =:= undefined orelse not is_process_alive(TypeserverPid)) of
+ true -> start();
+ false -> ok
+ end.
+
+%% @private
+-spec stop() -> 'ok'.
+stop() ->
+ TypeserverPid = get('$typeserver_pid'),
+ erase('$typeserver_pid'),
+ gen_server:cast(TypeserverPid, stop).
+
+%% @private
+-spec create_spec_test(mfa(), timeout(), false_positive_mfas()) -> rich_result(proper:test()).
+create_spec_test(MFA, SpecTimeout, FalsePositiveMFAs) ->
+ TypeserverPid = get('$typeserver_pid'),
+ gen_server:call(TypeserverPid, {create_spec_test,MFA,SpecTimeout,FalsePositiveMFAs}).
+
+%% @private
+-spec get_exp_specced(mod_name()) -> rich_result([mfa()]).
+get_exp_specced(Mod) ->
+ TypeserverPid = get('$typeserver_pid'),
+ gen_server:call(TypeserverPid, {get_exp_specced,Mod}).
+
+-spec get_type_repr(mod_name(), type_ref(), boolean()) ->
+ rich_result(type_repr()).
+get_type_repr(Mod, TypeRef, IsRemote) ->
+ TypeserverPid = get('$typeserver_pid'),
+ gen_server:call(TypeserverPid, {get_type_repr,Mod,TypeRef,IsRemote}).
+
+%% @private
+-spec translate_type(imm_type()) -> rich_result(fin_type()).
+translate_type(ImmType) ->
+ TypeserverPid = get('$typeserver_pid'),
+ gen_server:call(TypeserverPid, {translate_type,ImmType}).
+
+%% @doc Translates the native type expression `TypeExpr' (which should be
+%% provided inside a string) into a PropEr type, which can then be passed to any
+%% of the demo functions defined in the {@link proper_gen} module. PropEr acts
+%% as if it found this type expression inside the code of module `Mod'.
+-spec demo_translate_type(mod_name(), string()) -> rich_result(fin_type()).
+demo_translate_type(Mod, TypeExpr) ->
+ start(),
+ Result = translate_type({Mod,TypeExpr}),
+ stop(),
+ Result.
+
+%% @doc Checks if `Term' is a valid instance of native type `TypeExpr' (which
+%% should be provided inside a string). PropEr acts as if it found this type
+%% expression inside the code of module `Mod'.
+-spec demo_is_instance(term(), mod_name(), string()) ->
+ boolean() | {'error',term()}.
+demo_is_instance(Term, Mod, TypeExpr) ->
+ case parse_type(TypeExpr) of
+ {ok,TypeForm} ->
+ start(),
+ Result =
+ %% Force the typeserver to load the module.
+ case translate_type({Mod,"integer()"}) of
+ {ok,_FinType} ->
+ try is_instance(Term, Mod, TypeForm)
+ catch
+ throw:{'$typeserver',Reason} -> {error, Reason}
+ end;
+ {error,_Reason} = Error ->
+ Error
+ end,
+ stop(),
+ Result;
+ {error,_Reason} = Error ->
+ Error
+ end.
+
+
+%%------------------------------------------------------------------------------
+%% Implementation of gen_server interface
+%%------------------------------------------------------------------------------
+
+%% @private
+-spec init(_) -> {'ok',state()}.
+init(_) ->
+ {ok, #state{}}.
+
+%% @private
+-spec handle_call(server_call(), _, state()) ->
+ {'reply',server_response(),state()}.
+handle_call({create_spec_test,MFA,SpecTimeout,FalsePositiveMFAs}, _From, State) ->
+ case create_spec_test(MFA, SpecTimeout, FalsePositiveMFAs, State) of
+ {ok,Test,NewState} ->
+ {reply, {ok,Test}, NewState};
+ {error,_Reason} = Error ->
+ {reply, Error, State}
+ end;
+handle_call({get_exp_specced,Mod}, _From, State) ->
+ case get_exp_specced(Mod, State) of
+ {ok,MFAs,NewState} ->
+ {reply, {ok,MFAs}, NewState};
+ {error,_Reason} = Error ->
+ {reply, Error, State}
+ end;
+handle_call({get_type_repr,Mod,TypeRef,IsRemote}, _From, State) ->
+ case get_type_repr(Mod, TypeRef, IsRemote, State) of
+ {ok,TypeRepr,NewState} ->
+ {reply, {ok,TypeRepr}, NewState};
+ {error,_Reason} = Error ->
+ {reply, Error, State}
+ end;
+handle_call({translate_type,ImmType}, _From, State) ->
+ case translate_type(ImmType, State) of
+ {ok,FinType,NewState} ->
+ {reply, {ok,FinType}, NewState};
+ {error,_Reason} = Error ->
+ {reply, Error, State}
+ end.
+
+%% @private
+-spec handle_cast('stop', state()) -> {'stop','normal',state()}.
+handle_cast(stop, State) ->
+ {stop, normal, State}.
+
+%% @private
+-spec handle_info(term(), state()) -> {'stop',{'received_info',term()},state()}.
+handle_info(Info, State) ->
+ {stop, {received_info,Info}, State}.
+
+%% @private
+-spec terminate(term(), state()) -> 'ok'.
+terminate(_Reason, _State) ->
+ ok.
+
+%% @private
+-spec code_change(term(), state(), _) -> {'ok',state()}.
+code_change(_OldVsn, State, _) ->
+ {ok, State}.
+
+
+%%------------------------------------------------------------------------------
+%% Top-level interface
+%%------------------------------------------------------------------------------
+
+-spec create_spec_test(mfa(), timeout(), false_positive_mfas(), state()) ->
+ rich_result2(proper:test(),state()).
+create_spec_test(MFA, SpecTimeout, FalsePositiveMFAs, State) ->
+ case get_exp_spec(MFA, State) of
+ {ok,FunRepr,NewState} ->
+ make_spec_test(MFA, FunRepr, SpecTimeout, FalsePositiveMFAs, NewState);
+ {error,_Reason} = Error ->
+ Error
+ end.
+
+-spec get_exp_spec(mfa(), state()) -> rich_result2(fun_repr(),state()).
+get_exp_spec({Mod,Fun,Arity} = MFA, State) ->
+ case add_module(Mod, State) of
+ {ok,#state{exp_specs = ExpSpecs} = NewState} ->
+ ModExpSpecs = dict:fetch(Mod, ExpSpecs),
+ case dict:find({Fun,Arity}, ModExpSpecs) of
+ {ok,FunRepr} ->
+ {ok, FunRepr, NewState};
+ error ->
+ {error, {function_not_exported_or_specced,MFA}}
+ end;
+ {error,_Reason} = Error ->
+ Error
+ end.
+
+-spec make_spec_test(mfa(), fun_repr(), timeout(), false_positive_mfas(), state()) ->
+ rich_result2(proper:test(),state()).
+make_spec_test({Mod,_Fun,_Arity}=MFA, {Domain,_Range}=FunRepr, SpecTimeout, FalsePositiveMFAs, State) ->
+ case convert(Mod, {type,?anno(0),'$fixed_list',Domain}, State) of
+ {ok,FinType,NewState} ->
+ Test = ?FORALL(Args, FinType, apply_spec_test(MFA, FunRepr, SpecTimeout, FalsePositiveMFAs, Args)),
+ {ok, Test, NewState};
+ {error,_Reason} = Error ->
+ Error
+ end.
+
+-spec apply_spec_test(mfa(), fun_repr(), timeout(), false_positive_mfas(), term()) -> proper:test().
+apply_spec_test({Mod,Fun,_Arity}=MFA, {_Domain,Range}, SpecTimeout, FalsePositiveMFAs, Args) ->
+ ?TIMEOUT(SpecTimeout,
+ begin
+ %% NOTE: only call apply/3 inside try/catch (do not trust ?MODULE:is_instance/3)
+ Result =
+ try apply(Mod, Fun, Args) of
+ X -> {ok, X}
+ catch
+ X:Y -> {X, Y}
+ end,
+ case Result of
+ {ok, Z} ->
+ case ?MODULE:is_instance(Z, Mod, Range) of
+ true ->
+ true;
+ false when is_function(FalsePositiveMFAs) ->
+ FalsePositiveMFAs(MFA, Args, {fail, Z});
+ false ->
+ false
+ end;
+ Exception when is_function(FalsePositiveMFAs) ->
+ case FalsePositiveMFAs(MFA, Args, Exception) of
+ true ->
+ true;
+ false ->
+ error(Exception, erlang:get_stacktrace())
+ end;
+ Exception ->
+ error(Exception, erlang:get_stacktrace())
+ end
+ end).
+
+-spec get_exp_specced(mod_name(), state()) -> rich_result2([mfa()],state()).
+get_exp_specced(Mod, State) ->
+ case add_module(Mod, State) of
+ {ok,#state{exp_specs = ExpSpecs} = NewState} ->
+ ModExpSpecs = dict:fetch(Mod, ExpSpecs),
+ ExpSpecced = [{Mod,F,A} || {F,A} <- dict:fetch_keys(ModExpSpecs)],
+ {ok, ExpSpecced, NewState};
+ {error,_Reason} = Error ->
+ Error
+ end.
+
+-spec get_type_repr(mod_name(), type_ref(), boolean(), state()) ->
+ rich_result2(type_repr(),state()).
+get_type_repr(Mod, {type,Name,Arity} = TypeRef, true, State) ->
+ case prepare_for_remote(Mod, Name, Arity, State) of
+ {ok,NewState} ->
+ get_type_repr(Mod, TypeRef, false, NewState);
+ {error,_Reason} = Error ->
+ Error
+ end;
+get_type_repr(Mod, TypeRef, false, #state{types = Types} = State) ->
+ ModTypes = dict:fetch(Mod, Types),
+ case dict:find(TypeRef, ModTypes) of
+ {ok,TypeRepr} ->
+ {ok, TypeRepr, State};
+ error ->
+ {error, {missing_type,Mod,TypeRef}}
+ end.
+
+-spec prepare_for_remote(mod_name(), type_name(), arity(), state()) ->
+ rich_result(state()).
+prepare_for_remote(RemMod, Name, Arity, State) ->
+ case add_module(RemMod, State) of
+ {ok,#state{exp_types = ExpTypes} = NewState} ->
+ RemModExpTypes = dict:fetch(RemMod, ExpTypes),
+ case sets:is_element({Name,Arity}, RemModExpTypes) of
+ true -> {ok, NewState};
+ false -> {error, {type_not_exported,{RemMod,Name,Arity}}}
+ end;
+ {error,_Reason} = Error ->
+ Error
+ end.
+
+-spec translate_type(imm_type(), state()) -> rich_result2(fin_type(),state()).
+translate_type({Mod,Str} = ImmType, #state{cached = Cached} = State) ->
+ case dict:find(ImmType, Cached) of
+ {ok,Type} ->
+ {ok, Type, State};
+ error ->
+ case parse_type(Str) of
+ {ok,TypeForm} ->
+ case add_module(Mod, State) of
+ {ok,NewState} ->
+ case convert(Mod, TypeForm, NewState) of
+ {ok,FinType,
+ #state{cached = Cached} = FinalState} ->
+ NewCached = dict:store(ImmType, FinType,
+ Cached),
+ {ok, FinType,
+ FinalState#state{cached = NewCached}};
+ {error,_Reason} = Error ->
+ Error
+ end;
+ {error,_Reason} = Error ->
+ Error
+ end;
+ {error,Reason} ->
+ {error, {parse_error,Str,Reason}}
+ end
+ end.
+
+-spec parse_type(string()) -> rich_result(abs_type()).
+parse_type(Str) ->
+ TypeStr = "-type mytype() :: " ++ Str ++ ".",
+ case erl_scan:string(TypeStr) of
+ {ok,Tokens,_EndLocation} ->
+ case erl_parse:parse_form(Tokens) of
+ {ok,{attribute,_Line,type,{mytype,TypeExpr,[]}}} ->
+ {ok, TypeExpr};
+ {error,_ErrorInfo} = Error ->
+ Error
+ end;
+ {error,ErrorInfo,_EndLocation} ->
+ {error, ErrorInfo}
+ end.
+
+-spec add_module(mod_name(), state()) -> rich_result(state()).
+add_module(Mod, #state{exp_types = ExpTypes} = State) ->
+ case dict:is_key(Mod, ExpTypes) of
+ true ->
+ {ok, State};
+ false ->
+ case get_code_and_exports(Mod) of
+ {ok,AbsCode,ModExpFuns} ->
+ RawModInfo = get_mod_info(Mod, AbsCode, ModExpFuns),
+ ModInfo = process_adts(Mod, RawModInfo),
+ {ok, store_mod_info(Mod, ModInfo, State)};
+ {error,Reason} ->
+ {error, {cant_load_code,Mod,Reason}}
+ end
+ end.
+
+%% @private
+-spec get_exp_info(mod_name()) -> rich_result2(mod_exp_types(),mod_exp_funs()).
+get_exp_info(Mod) ->
+ case get_code_and_exports(Mod) of
+ {ok,AbsCode,ModExpFuns} ->
+ RawModInfo = get_mod_info(Mod, AbsCode, ModExpFuns),
+ {ok, RawModInfo#mod_info.mod_exp_types, ModExpFuns};
+ {error,_Reason} = Error ->
+ Error
+ end.
+
+-spec get_code_and_exports(mod_name()) ->
+ rich_result2([abs_form()],mod_exp_funs()).
+get_code_and_exports(Mod) ->
+ case code:get_object_code(Mod) of
+ {Mod, ObjBin, _ObjFileName} ->
+ case get_chunks(ObjBin) of
+ {ok,_AbsCode,_ModExpFuns} = Result ->
+ Result;
+ {error,Reason} ->
+ get_code_and_exports_from_source(Mod, Reason)
+ end;
+ error ->
+ get_code_and_exports_from_source(Mod, cant_find_object_file)
+ end.
+
+-spec get_code_and_exports_from_source(mod_name(), term()) ->
+ rich_result2([abs_form()],mod_exp_funs()).
+get_code_and_exports_from_source(Mod, ObjError) ->
+ SrcFileName = atom_to_list(Mod) ++ ?SRC_FILE_EXT,
+ case code:where_is_file(SrcFileName) of
+ FullSrcFileName when is_list(FullSrcFileName) ->
+ Opts = [binary,debug_info,return_errors,{d,'PROPER_REMOVE_PROPS'}],
+ case compile:file(FullSrcFileName, Opts) of
+ {ok,Mod,Binary} ->
+ get_chunks(Binary);
+ {error,Errors,_Warnings} ->
+ {error, {ObjError,{cant_compile_source_file,Errors}}}
+ end;
+ non_existing ->
+ {error, {ObjError,cant_find_source_file}}
+ end.
+
+-spec get_chunks(string() | binary()) ->
+ rich_result2([abs_form()],mod_exp_funs()).
+get_chunks(ObjFile) ->
+ case beam_lib:chunks(ObjFile, [abstract_code,exports]) of
+ {ok,{_Mod,[{abstract_code,AbsCodeChunk},{exports,ExpFunsList}]}} ->
+ case AbsCodeChunk of
+ {raw_abstract_v1,AbsCode} ->
+ %% HACK: Add a declaration for iolist() to every module
+ {ok, add_iolist(AbsCode), sets:from_list(ExpFunsList)};
+ no_abstract_code ->
+ {error, no_abstract_code};
+ _ ->
+ {error, unsupported_abstract_code_format}
+ end;
+ {error,beam_lib,Reason} ->
+ {error, Reason}
+ end.
+
+-spec add_iolist([abs_form()]) -> [abs_form()].
+add_iolist(Forms) ->
+ IOListDef =
+ {type,0,maybe_improper_list,
+ [{type,0,union,[{type,0,byte,[]},{type,0,binary,[]},
+ {type,0,iolist,[]}]},
+ {type,0,binary,[]}]},
+ IOListDecl = {attribute,0,type,{iolist,IOListDef,[]}},
+ [IOListDecl | Forms].
+
+-spec get_mod_info(mod_name(), [abs_form()], mod_exp_funs()) -> mod_info().
+get_mod_info(Mod, AbsCode, ModExpFuns) ->
+ StartModInfo = #mod_info{mod_exp_funs = ModExpFuns},
+ ImmModInfo = lists:foldl(fun add_mod_info/2, StartModInfo, AbsCode),
+ #mod_info{mod_specs = AllModSpecs} = ImmModInfo,
+ IsExported = fun(FunRef,_FunRepr) -> sets:is_element(FunRef,ModExpFuns) end,
+ ModExpSpecs = dict:filter(IsExported, AllModSpecs),
+ ModInfo = ImmModInfo#mod_info{mod_specs = ModExpSpecs},
+ case orddict:find(Mod, ?HARD_ADT_MODS) of
+ {ok,ModADTs} ->
+ #mod_info{mod_exp_types = ModExpTypes, mod_types = ModTypes,
+ mod_opaques = ModOpaques} = ModInfo,
+ ModADTsSet =
+ sets:from_list([ImmTypeRef
+ || {ImmTypeRef,_HardADTRepr} <- ModADTs]),
+ NewModExpTypes = sets:union(ModExpTypes, ModADTsSet),
+ NewModTypes = lists:foldl(fun store_hard_adt/2, ModTypes, ModADTs),
+ NewModOpaques = sets:union(ModOpaques, ModADTsSet),
+ ModInfo#mod_info{mod_exp_types = NewModExpTypes,
+ mod_types = NewModTypes,
+ mod_opaques = NewModOpaques};
+ error ->
+ ModInfo
+ end.
+
+-spec store_hard_adt({imm_type_ref(),hard_adt_repr()}, mod_types()) ->
+ mod_types().
+store_hard_adt({_ImmTypeRef,already_declared}, ModTypes) ->
+ ModTypes;
+store_hard_adt({{Name,Arity},{TypeForm,VarNames}}, ModTypes) ->
+ TypeRef = {type,Name,Arity},
+ TypeRepr = {abs_type,TypeForm,VarNames,not_symb},
+ dict:store(TypeRef, TypeRepr, ModTypes).
+
+-spec add_mod_info(abs_form(), mod_info()) -> mod_info().
+add_mod_info({attribute,_Line,export_type,TypesList},
+ #mod_info{mod_exp_types = ModExpTypes} = ModInfo) ->
+ NewModExpTypes = sets:union(sets:from_list(TypesList), ModExpTypes),
+ ModInfo#mod_info{mod_exp_types = NewModExpTypes};
+add_mod_info({attribute,_Line,type,{{record,RecName},Fields,[]}},
+ #mod_info{mod_types = ModTypes} = ModInfo) ->
+ FieldInfo = [process_rec_field(F) || F <- Fields],
+ NewModTypes = dict:store({record,RecName,0}, {abs_record,FieldInfo},
+ ModTypes),
+ ModInfo#mod_info{mod_types = NewModTypes};
+add_mod_info({attribute,Line,record,{RecName,Fields}},
+ #mod_info{mod_types = ModTypes} = ModInfo) ->
+ case dict:is_key(RecName, ModTypes) of
+ true ->
+ ModInfo;
+ false -> % fake an opaque term by using the same Line as annotation
+ TypedRecord = {attribute,Line,type,{{record,RecName},Fields,[]}},
+ add_mod_info(TypedRecord, ModInfo)
+ end;
+add_mod_info({attribute,_Line,Kind,{Name,TypeForm,VarForms}},
+ #mod_info{mod_types = ModTypes,
+ mod_opaques = ModOpaques} = ModInfo)
+ when Kind =:= type; Kind =:= opaque ->
+ Arity = length(VarForms),
+ VarNames = [V || {var,_,V} <- VarForms],
+ %% TODO: No check whether variables are different, or non-'_'.
+ NewModTypes = dict:store({type,Name,Arity},
+ {abs_type,TypeForm,VarNames,not_symb}, ModTypes),
+ NewModOpaques =
+ case Kind of
+ type -> ModOpaques;
+ opaque -> sets:add_element({Name,Arity}, ModOpaques)
+ end,
+ ModInfo#mod_info{mod_types = NewModTypes, mod_opaques = NewModOpaques};
+add_mod_info({attribute,_Line,spec,{RawFunRef,[RawFirstClause | _Rest]}},
+ #mod_info{mod_specs = ModSpecs} = ModInfo) ->
+ FunRef = case RawFunRef of
+ {_Mod,Name,Arity} -> {Name,Arity};
+ {_Name,_Arity} = F -> F
+ end,
+ %% TODO: We just take the first function clause.
+ FirstClause = process_fun_clause(RawFirstClause),
+ NewModSpecs = dict:store(FunRef, FirstClause, ModSpecs),
+ ModInfo#mod_info{mod_specs = NewModSpecs};
+add_mod_info(_Form, ModInfo) ->
+ ModInfo.
+
+-spec process_rec_field(abs_rec_field()) -> {field_name(),abs_type()}.
+process_rec_field({record_field,_,{atom,_,FieldName}}) ->
+ {FieldName, {type,0,any,[]}};
+process_rec_field({record_field,_,{atom,_,FieldName},_Initialization}) ->
+ {FieldName, {type,0,any,[]}};
+process_rec_field({typed_record_field,RecField,FieldType}) ->
+ {FieldName,_} = process_rec_field(RecField),
+ {FieldName, FieldType}.
+
+-spec process_fun_clause(abs_type()) -> fun_clause_repr().
+process_fun_clause({type,_,'fun',[{type,_,product,Domain},Range]}) ->
+ {Domain, Range};
+process_fun_clause({type,_,bounded_fun,[MainClause,Constraints]}) ->
+ {RawDomain,RawRange} = process_fun_clause(MainClause),
+ VarSubsts = [{V,T} || {type,_,constraint,
+ [{atom,_,is_subtype},[{var,_,V},T]]} <- Constraints,
+ V =/= '_'],
+ VarSubstsDict = dict:from_list(VarSubsts),
+ Domain = [update_vars(A, VarSubstsDict, false) || A <- RawDomain],
+ Range = update_vars(RawRange, VarSubstsDict, false),
+ {Domain, Range}.
+
+-spec store_mod_info(mod_name(), mod_info(), state()) -> state().
+store_mod_info(Mod, #mod_info{mod_exp_types = ModExpTypes, mod_types = ModTypes,
+ mod_specs = ImmModExpSpecs},
+ #state{exp_types = ExpTypes, types = Types,
+ exp_specs = ExpSpecs} = State) ->
+ NewExpTypes = dict:store(Mod, ModExpTypes, ExpTypes),
+ NewTypes = dict:store(Mod, ModTypes, Types),
+ ModExpSpecs = dict:map(fun unbound_to_any/2, ImmModExpSpecs),
+ NewExpSpecs = dict:store(Mod, ModExpSpecs, ExpSpecs),
+ State#state{exp_types = NewExpTypes, types = NewTypes,
+ exp_specs = NewExpSpecs}.
+
+-spec unbound_to_any(fun_ref(), fun_repr()) -> fun_repr().
+unbound_to_any(_FunRef, {Domain,Range}) ->
+ EmptySubstsDict = dict:new(),
+ NewDomain = [update_vars(A,EmptySubstsDict,true) || A <- Domain],
+ NewRange = update_vars(Range, EmptySubstsDict, true),
+ {NewDomain, NewRange}.
+
+
+%%------------------------------------------------------------------------------
+%% ADT translation functions
+%%------------------------------------------------------------------------------
+
+-spec process_adts(mod_name(), mod_info()) -> mod_info().
+process_adts(Mod,
+ #mod_info{mod_exp_types = ModExpTypes, mod_opaques = ModOpaques,
+ mod_specs = ModExpSpecs} = ModInfo) ->
+ %% TODO: No warning on unexported opaques.
+ case sets:to_list(sets:intersection(ModExpTypes,ModOpaques)) of
+ [] ->
+ ModInfo;
+ ModADTs ->
+ %% TODO: No warning on unexported API functions.
+ ModExpSpecsList = [{Name,Domain,Range}
+ || {{Name,_Arity},{Domain,Range}}
+ <- dict:to_list(ModExpSpecs)],
+ AddADT = fun(ADT,Acc) -> add_adt(Mod,ADT,Acc,ModExpSpecsList) end,
+ lists:foldl(AddADT, ModInfo, ModADTs)
+ end.
+
+-spec add_adt(mod_name(), imm_type_ref(), mod_info(), [proc_fun_ref()]) ->
+ mod_info().
+add_adt(Mod, {Name,Arity}, #mod_info{mod_types = ModTypes} = ModInfo,
+ ModExpFunSpecs) ->
+ ADTRef = {type,Name,Arity},
+ {abs_type,InternalRepr,VarNames,not_symb} = dict:fetch(ADTRef, ModTypes),
+ FullADTRef = {Mod,Name,Arity},
+ %% TODO: No warning on unsuitable range.
+ SymbCalls1 = [get_symb_call(FullADTRef,Spec) || Spec <- ModExpFunSpecs],
+ %% TODO: No warning on bad use of variables.
+ SymbCalls2 = [fix_vars(FullADTRef,Call,RangeVars,VarNames)
+ || {ok,Call,RangeVars} <- SymbCalls1],
+ case [Call || {ok,Call} <- SymbCalls2] of
+ [] ->
+ %% TODO: No warning on no acceptable spec.
+ ModInfo;
+ SymbCalls3 ->
+ NewADTRepr = {abs_type,{type,0,union,SymbCalls3},VarNames,
+ {orig_abs,InternalRepr}},
+ NewModTypes = dict:store(ADTRef, NewADTRepr, ModTypes),
+ ModInfo#mod_info{mod_types = NewModTypes}
+ end.
+
+-spec get_symb_call(full_imm_type_ref(), proc_fun_ref()) ->
+ tagged_result2(abs_type(),[var_name()]).
+get_symb_call({Mod,_TypeName,_Arity} = FullADTRef, {FunName,Domain,Range}) ->
+ A = ?anno(0),
+ BaseCall = {type,A,tuple,[{atom,A,'$call'},{atom,A,Mod},{atom,A,FunName},
+ {type,A,'$fixed_list',Domain}]},
+ unwrap_range(FullADTRef, BaseCall, Range, false).
+
+-spec unwrap_range(full_imm_type_ref(), abs_type() | next_step(), abs_type(),
+ boolean()) ->
+ tagged_result2(abs_type() | next_step(),[var_name()]).
+unwrap_range(FullADTRef, Call, {paren_type,_,[Type]}, TestRun) ->
+ unwrap_range(FullADTRef, Call, Type, TestRun);
+unwrap_range(FullADTRef, Call, {ann_type,_,[_Var,Type]}, TestRun) ->
+ unwrap_range(FullADTRef, Call, Type, TestRun);
+unwrap_range(FullADTRef, Call, {type,_,list,[ElemType]}, TestRun) ->
+ unwrap_list(FullADTRef, Call, ElemType, TestRun);
+unwrap_range(FullADTRef, Call, {type,_,maybe_improper_list,[Cont,_Term]},
+ TestRun) ->
+ unwrap_list(FullADTRef, Call, Cont, TestRun);
+unwrap_range(FullADTRef, Call, {type,_,nonempty_list,[ElemType]}, TestRun) ->
+ unwrap_list(FullADTRef, Call, ElemType, TestRun);
+unwrap_range(FullADTRef, Call, {type,_,nonempty_improper_list,[Cont,_Term]},
+ TestRun) ->
+ unwrap_list(FullADTRef, Call, Cont, TestRun);
+unwrap_range(FullADTRef, Call,
+ {type,_,nonempty_maybe_improper_list,[Cont,_Term]}, TestRun) ->
+ unwrap_list(FullADTRef, Call, Cont, TestRun);
+unwrap_range(_FullADTRef, _Call, {type,_,tuple,any}, _TestRun) ->
+ error;
+unwrap_range(FullADTRef, Call, {type,_,tuple,FieldForms}, TestRun) ->
+ Translates = fun(T) -> unwrap_range(FullADTRef,none,T,true) =/= error end,
+ case proper_arith:find_first(Translates, FieldForms) of
+ none ->
+ error;
+ {TargetPos,TargetElem} ->
+ Pattern = get_pattern(TargetPos, FieldForms),
+ case TestRun of
+ true ->
+ NewCall =
+ case Call of
+ none -> {match_with,Pattern};
+ _ -> Call
+ end,
+ {ok, NewCall, []};
+ false ->
+ AbsPattern = term_to_singleton_type(Pattern),
+ A = ?anno(0),
+ NewCall =
+ {type,A,tuple,
+ [{atom,A,'$call'},{atom,A,?MODULE},{atom,A,match},
+ {type,A,'$fixed_list',[AbsPattern,Call]}]},
+ unwrap_range(FullADTRef, NewCall, TargetElem, TestRun)
+ end
+ end;
+unwrap_range(FullADTRef, Call, {type,_,union,Choices}, TestRun) ->
+ TestedChoices = [unwrap_range(FullADTRef,none,C,true) || C <- Choices],
+ NotError = fun(error) -> false; (_) -> true end,
+ case proper_arith:find_first(NotError, TestedChoices) of
+ none ->
+ error;
+ {_ChoicePos,{ok,none,_RangeVars}} ->
+ error;
+ {ChoicePos,{ok,NextStep,_RangeVars}} ->
+ {A, [ChoiceElem|B]} = lists:split(ChoicePos-1, Choices),
+ OtherChoices = A ++ B,
+ DistinctChoice =
+ case NextStep of
+ take_head ->
+ fun cant_have_head/1;
+ {match_with,Pattern} ->
+ fun(C) -> cant_match(Pattern, C) end
+ end,
+ case {lists:all(DistinctChoice,OtherChoices), TestRun} of
+ {true,true} ->
+ {ok, NextStep, []};
+ {true,false} ->
+ unwrap_range(FullADTRef, Call, ChoiceElem, TestRun);
+ {false,_} ->
+ error
+ end
+ end;
+unwrap_range({_Mod,SameName,Arity}, Call, {type,_,SameName,ArgForms},
+ _TestRun) ->
+ RangeVars = [V || {var,_,V} <- ArgForms, V =/= '_'],
+ case length(ArgForms) =:= Arity andalso length(RangeVars) =:= Arity of
+ true -> {ok, Call, RangeVars};
+ false -> error
+ end;
+unwrap_range({SameMod,SameName,_Arity} = FullADTRef, Call,
+ {remote_type,_,[{atom,_,SameMod},{atom,_,SameName},ArgForms]},
+ TestRun) ->
+ unwrap_range(FullADTRef, Call, {type,?anno(0),SameName,ArgForms}, TestRun);
+unwrap_range(_FullADTRef, _Call, _Range, _TestRun) ->
+ error.
+
+-spec unwrap_list(full_imm_type_ref(), abs_type() | next_step(), abs_type(),
+ boolean()) ->
+ tagged_result2(abs_type() | next_step(),[var_name()]).
+unwrap_list(FullADTRef, Call, HeadType, TestRun) ->
+ NewCall =
+ case TestRun of
+ true ->
+ case Call of
+ none -> take_head;
+ _ -> Call
+ end;
+ false ->
+ {type,0,tuple,[{atom,0,'$call'},{atom,0,erlang},{atom,0,hd},
+ {type,0,'$fixed_list',[Call]}]}
+ end,
+ unwrap_range(FullADTRef, NewCall, HeadType, TestRun).
+
+-spec fix_vars(full_imm_type_ref(), abs_type(), [var_name()], [var_name()]) ->
+ tagged_result(abs_type()).
+fix_vars(FullADTRef, Call, RangeVars, VarNames) ->
+ NotAnyVar = fun(V) -> V =/= '_' end,
+ case no_duplicates(VarNames) andalso lists:all(NotAnyVar,VarNames) of
+ true ->
+ RawUsedVars =
+ collect_vars(FullADTRef, Call, [[V] || V <- RangeVars]),
+ UsedVars = [lists:usort(L) || L <- RawUsedVars],
+ case correct_var_use(UsedVars) of
+ true ->
+ PairAll = fun(L,Y) -> [{X,{var,0,Y}} || X <- L] end,
+ VarSubsts =
+ lists:flatten(lists:zipwith(PairAll,UsedVars,VarNames)),
+ VarSubstsDict = dict:from_list(VarSubsts),
+ {ok, update_vars(Call,VarSubstsDict,true)};
+ false ->
+ error
+ end;
+ false ->
+ error
+ end.
+
+-spec no_duplicates(list()) -> boolean().
+no_duplicates(L) ->
+ length(lists:usort(L)) =:= length(L).
+
+-spec correct_var_use([[var_name() | 0]]) -> boolean().
+correct_var_use(UsedVars) ->
+ NoNonVarArgs = fun([0|_]) -> false; (_) -> true end,
+ lists:all(NoNonVarArgs, UsedVars)
+ andalso no_duplicates(lists:flatten(UsedVars)).
+
+-spec collect_vars(full_imm_type_ref(), abs_type(), [[var_name() | 0]]) ->
+ [[var_name() | 0]].
+collect_vars(FullADTRef, {paren_type,_,[Type]}, UsedVars) ->
+ collect_vars(FullADTRef, Type, UsedVars);
+collect_vars(FullADTRef, {ann_type,_,[_Var,Type]}, UsedVars) ->
+ collect_vars(FullADTRef, Type, UsedVars);
+collect_vars(_FullADTRef, {type,_,tuple,any}, UsedVars) ->
+ UsedVars;
+collect_vars({_Mod,SameName,Arity} = FullADTRef, {type,_,SameName,ArgForms},
+ UsedVars) ->
+ case length(ArgForms) =:= Arity of
+ true ->
+ VarArgs = [V || {var,_,V} <- ArgForms, V =/= '_'],
+ case length(VarArgs) =:= Arity of
+ true ->
+ AddToList = fun(X,L) -> [X | L] end,
+ lists:zipwith(AddToList, VarArgs, UsedVars);
+ false ->
+ [[0|L] || L <- UsedVars]
+ end;
+ false ->
+ multi_collect_vars(FullADTRef, ArgForms, UsedVars)
+ end;
+collect_vars(FullADTRef, {type,_,_Name,ArgForms}, UsedVars) ->
+ multi_collect_vars(FullADTRef, ArgForms, UsedVars);
+collect_vars({SameMod,SameName,_Arity} = FullADTRef,
+ {remote_type,_,[{atom,_,SameMod},{atom,_,SameName},ArgForms]},
+ UsedVars) ->
+ collect_vars(FullADTRef, {type,?anno(0),SameName,ArgForms}, UsedVars);
+collect_vars(FullADTRef, {remote_type,_,[_RemModForm,_NameForm,ArgForms]},
+ UsedVars) ->
+ multi_collect_vars(FullADTRef, ArgForms, UsedVars);
+collect_vars(_FullADTRef, _Call, UsedVars) ->
+ UsedVars.
+
+-spec multi_collect_vars(full_imm_type_ref(), [abs_type()],
+ [[var_name() | 0]]) -> [[var_name() | 0]].
+multi_collect_vars({_Mod,_Name,Arity} = FullADTRef, Forms, UsedVars) ->
+ NoUsedVars = lists:duplicate(Arity, []),
+ MoreUsedVars = [collect_vars(FullADTRef,T,NoUsedVars) || T <- Forms],
+ CombineVars = fun(L1,L2) -> lists:zipwith(fun erlang:'++'/2, L1, L2) end,
+ lists:foldl(CombineVars, UsedVars, MoreUsedVars).
+
+-ifdef(NO_MODULES_IN_OPAQUES).
+-type var_substs_dict() :: dict().
+-else.
+-type var_substs_dict() :: dict:dict(var_name(),abs_type()).
+-endif.
+-spec update_vars(abs_type(), var_substs_dict(), boolean()) -> abs_type().
+update_vars({paren_type,Line,[Type]}, VarSubstsDict, UnboundToAny) ->
+ {paren_type, Line, [update_vars(Type,VarSubstsDict,UnboundToAny)]};
+update_vars({ann_type,Line,[Var,Type]}, VarSubstsDict, UnboundToAny) ->
+ {ann_type, Line, [Var,update_vars(Type,VarSubstsDict,UnboundToAny)]};
+update_vars({var,Line,VarName} = Call, VarSubstsDict, UnboundToAny) ->
+ case dict:find(VarName, VarSubstsDict) of
+ {ok,SubstType} ->
+ SubstType;
+ error when UnboundToAny =:= false ->
+ Call;
+ error when UnboundToAny =:= true ->
+ {type,Line,any,[]}
+ end;
+update_vars({remote_type,Line,[RemModForm,NameForm,ArgForms]}, VarSubstsDict,
+ UnboundToAny) ->
+ NewArgForms = [update_vars(A,VarSubstsDict,UnboundToAny) || A <- ArgForms],
+ {remote_type, Line, [RemModForm,NameForm,NewArgForms]};
+update_vars({T,_,tuple,any} = Call, _VarSubstsDict, _UnboundToAny) when ?IS_TYPE_TAG(T) ->
+ Call;
+update_vars({T,Line,Name,ArgForms}, VarSubstsDict, UnboundToAny) when ?IS_TYPE_TAG(T) ->
+ NewArgForms = [update_vars(A,VarSubstsDict,UnboundToAny) || A <- ArgForms],
+ {T, Line, Name, NewArgForms};
+update_vars(Call, _VarSubstsDict, _UnboundToAny) ->
+ Call.
+
+
+%%------------------------------------------------------------------------------
+%% Match-related functions
+%%------------------------------------------------------------------------------
+
+-spec get_pattern(position(), [abs_type()]) -> pattern().
+get_pattern(TargetPos, FieldForms) ->
+ {0,RevPattern} = lists:foldl(fun add_field/2, {TargetPos,[]}, FieldForms),
+ list_to_tuple(lists:reverse(RevPattern)).
+
+-spec add_field(abs_type(), {non_neg_integer(),[pat_field()]}) ->
+ {non_neg_integer(),[pat_field(),...]}.
+add_field(_Type, {1,Acc}) ->
+ {0, [1|Acc]};
+add_field({atom,_,Tag}, {Left,Acc}) ->
+ {erlang:max(0,Left-1), [Tag|Acc]};
+add_field(_Type, {Left,Acc}) ->
+ {erlang:max(0,Left-1), [0|Acc]}.
+
+%% @private
+-spec match(pattern(), tuple()) -> term().
+match(Pattern, Term) when tuple_size(Pattern) =:= tuple_size(Term) ->
+ match(tuple_to_list(Pattern), tuple_to_list(Term), none, false);
+match(_Pattern, _Term) ->
+ throw(no_match).
+
+-spec match([pat_field()], [term()], 'none' | {'ok',T}, boolean()) -> T.
+match([], [], {ok,Target}, _TypeMode) ->
+ Target;
+match([0|PatRest], [_|ToMatchRest], Acc, TypeMode) ->
+ match(PatRest, ToMatchRest, Acc, TypeMode);
+match([1|PatRest], [Target|ToMatchRest], none, TypeMode) ->
+ match(PatRest, ToMatchRest, {ok,Target}, TypeMode);
+match([Tag|PatRest], [X|ToMatchRest], Acc, TypeMode) when is_atom(Tag) ->
+ MatchesTag =
+ case TypeMode of
+ true -> can_be_tag(Tag, X);
+ false -> Tag =:= X
+ end,
+ case MatchesTag of
+ true -> match(PatRest, ToMatchRest, Acc, TypeMode);
+ false -> throw(no_match)
+ end.
+
+%% CAUTION: these must be sorted
+-define(NON_ATOM_TYPES,
+ [arity,binary,bitstring,byte,char,float,'fun',function,integer,iodata,
+ iolist,list,maybe_improper_list,mfa,neg_integer,nil,no_return,
+ non_neg_integer,none,nonempty_improper_list,nonempty_list,
+ nonempty_maybe_improper_list,nonempty_string,number,pid,port,
+ pos_integer,range,record,reference,string,tuple]).
+-define(NON_TUPLE_TYPES,
+ [arity,atom,binary,bitstring,bool,boolean,byte,char,float,'fun',
+ function,identifier,integer,iodata,iolist,list,maybe_improper_list,
+ neg_integer,nil,no_return,node,non_neg_integer,none,
+ nonempty_improper_list,nonempty_list,nonempty_maybe_improper_list,
+ nonempty_string,number,pid,port,pos_integer,range,reference,string,
+ timeout]).
+-define(NO_HEAD_TYPES,
+ [arity,atom,binary,bitstring,bool,boolean,byte,char,float,'fun',
+ function,identifier,integer,mfa,module,neg_integer,nil,no_return,node,
+ non_neg_integer,none,number,pid,port,pos_integer,range,record,
+ reference,timeout,tuple]).
+
+-spec can_be_tag(atom(), abs_type()) -> boolean().
+can_be_tag(Tag, {ann_type,_,[_Var,Type]}) ->
+ can_be_tag(Tag, Type);
+can_be_tag(Tag, {paren_type,_,[Type]}) ->
+ can_be_tag(Tag, Type);
+can_be_tag(Tag, {atom,_,Atom}) ->
+ Tag =:= Atom;
+can_be_tag(_Tag, {integer,_,_Int}) ->
+ false;
+can_be_tag(_Tag, {op,_,_Op,_Arg}) ->
+ false;
+can_be_tag(_Tag, {op,_,_Op,_Arg1,_Arg2}) ->
+ false;
+can_be_tag(Tag, {type,_,BName,[]}) when BName =:= bool; BName =:= boolean ->
+ is_boolean(Tag);
+can_be_tag(Tag, {type,_,timeout,[]}) ->
+ Tag =:= infinity;
+can_be_tag(Tag, {type,_,union,Choices}) ->
+ lists:any(fun(C) -> can_be_tag(Tag,C) end, Choices);
+can_be_tag(_Tag, {type,_,Name,_Args}) ->
+ not ordsets:is_element(Name, ?NON_ATOM_TYPES);
+can_be_tag(_Tag, _Type) ->
+ true.
+
+-spec cant_match(pattern(), abs_type()) -> boolean().
+cant_match(Pattern, {ann_type,_,[_Var,Type]}) ->
+ cant_match(Pattern, Type);
+cant_match(Pattern, {paren_type,_,[Type]}) ->
+ cant_match(Pattern, Type);
+cant_match(_Pattern, {atom,_,_Atom}) ->
+ true;
+cant_match(_Pattern, {integer,_,_Int}) ->
+ true;
+cant_match(_Pattern, {op,_,_Op,_Arg}) ->
+ true;
+cant_match(_Pattern, {op,_,_Op,_Arg1,_Arg2}) ->
+ true;
+cant_match(Pattern, {type,Anno,mfa,[]}) ->
+ MFA_Ts = [{type,Anno,atom,[]}, {type,Anno,atom,[]}, {type,Anno,arity,[]}],
+ cant_match(Pattern, {type,Anno,tuple,MFA_Ts});
+cant_match(Pattern, {type,_,union,Choices}) ->
+ lists:all(fun(C) -> cant_match(Pattern,C) end, Choices);
+cant_match(_Pattern, {type,_,tuple,any}) ->
+ false;
+cant_match(Pattern, {type,_,tuple,Fields}) ->
+ tuple_size(Pattern) =/= length(Fields) orelse
+ try match(tuple_to_list(Pattern), Fields, none, true) of
+ _ -> false
+ catch
+ throw:no_match -> true
+ end;
+cant_match(_Pattern, {type,_,Name,_Args}) ->
+ ordsets:is_element(Name, ?NON_TUPLE_TYPES);
+cant_match(_Pattern, _Type) ->
+ false.
+
+-spec cant_have_head(abs_type()) -> boolean().
+cant_have_head({ann_type,_,[_Var,Type]}) ->
+ cant_have_head(Type);
+cant_have_head({paren_type,_,[Type]}) ->
+ cant_have_head(Type);
+cant_have_head({atom,_,_Atom}) ->
+ true;
+cant_have_head({integer,_,_Int}) ->
+ true;
+cant_have_head({op,_,_Op,_Arg}) ->
+ true;
+cant_have_head({op,_,_Op,_Arg1,_Arg2}) ->
+ true;
+cant_have_head({type,_,union,Choices}) ->
+ lists:all(fun cant_have_head/1, Choices);
+cant_have_head({type,_,Name,_Args}) ->
+ ordsets:is_element(Name, ?NO_HEAD_TYPES);
+cant_have_head(_Type) ->
+ false.
+
+%% Only covers atoms, integers and tuples, i.e. those that can be specified
+%% through singleton types.
+-spec term_to_singleton_type(atom() | integer()
+ | loose_tuple(atom() | integer())) -> abs_type().
+term_to_singleton_type(Atom) when is_atom(Atom) ->
+ {atom,?anno(0),Atom};
+term_to_singleton_type(Int) when is_integer(Int), Int >= 0 ->
+ {integer,?anno(0),Int};
+term_to_singleton_type(Int) when is_integer(Int), Int < 0 ->
+ A = ?anno(0),
+ {op,A,'-',{integer,A,-Int}};
+term_to_singleton_type(Tuple) when is_tuple(Tuple) ->
+ Fields = tuple_to_list(Tuple),
+ {type,?anno(0),tuple,[term_to_singleton_type(F) || F <- Fields]}.
+
+
+%%------------------------------------------------------------------------------
+%% Instance testing functions
+%%------------------------------------------------------------------------------
+
+%% CAUTION: this must be sorted
+-define(EQUIV_TYPES,
+ [{arity, {type,0,range,[{integer,0,0},{integer,0,255}]}},
+ {bool, {type,0,boolean,[]}},
+ {byte, {type,0,range,[{integer,0,0},{integer,0,255}]}},
+ {char, {type,0,range,[{integer,0,0},{integer,0,16#10ffff}]}},
+ {function, {type,0,'fun',[]}},
+ {identifier, {type,0,union,[{type,0,pid,[]},{type,0,port,[]},
+ {type,0,reference,[]}]}},
+ {iodata, {type,0,union,[{type,0,binary,[]},{type,0,iolist,[]}]}},
+ {iolist, {type,0,maybe_improper_list,
+ [{type,0,union,[{type,0,byte,[]},{type,0,binary,[]},
+ {type,0,iolist,[]}]},
+ {type,0,binary,[]}]}},
+ {list, {type,0,list,[{type,0,any,[]}]}},
+ {maybe_improper_list, {type,0,maybe_improper_list,[{type,0,any,[]},
+ {type,0,any,[]}]}},
+ {mfa, {type,0,tuple,[{type,0,atom,[]},{type,0,atom,[]},
+ {type,0,arity,[]}]}},
+ {node, {type,0,atom,[]}},
+ {nonempty_list, {type,0,nonempty_list,[{type,0,any,[]}]}},
+ {nonempty_maybe_improper_list, {type,0,nonempty_maybe_improper_list,
+ [{type,0,any,[]},{type,0,any,[]}]}},
+ {nonempty_string, {type,0,nonempty_list,[{type,0,char,[]}]}},
+ {string, {type,0,list,[{type,0,char,[]}]}},
+ {term, {type,0,any,[]}},
+ {timeout, {type,0,union,[{atom,0,infinity},
+ {type,0,non_neg_integer,[]}]}}]).
+
+%% @private
+%% TODO: Most of these functions accept an extended form of abs_type(), namely
+%% the addition of a custom wrapper: {'from_mod',mod_name(),...}
+-spec is_instance(term(), mod_name(), abs_type()) -> boolean().
+is_instance(X, Mod, TypeForm) ->
+ is_instance(X, Mod, TypeForm, []).
+
+-spec is_instance(term(), mod_name(), abs_type(), imm_stack()) -> boolean().
+is_instance(X, _Mod, {from_mod,OrigMod,Type}, Stack) ->
+ is_instance(X, OrigMod, Type, Stack);
+is_instance(_X, _Mod, {var,_,'_'}, _Stack) ->
+ true;
+is_instance(_X, _Mod, {var,_,Name}, _Stack) ->
+ %% All unconstrained spec vars have been replaced by 'any()' and we always
+ %% replace the variables on the RHS of types before recursing into them.
+ %% Provided that '-type' declarations contain no unbound variables, we
+ %% don't expect to find any non-'_' variables while recursing.
+ throw({'$typeserver',{unbound_var_in_type_declaration,Name}});
+is_instance(X, Mod, {ann_type,_,[_Var,Type]}, Stack) ->
+ is_instance(X, Mod, Type, Stack);
+is_instance(X, Mod, {paren_type,_,[Type]}, Stack) ->
+ is_instance(X, Mod, Type, Stack);
+is_instance(X, Mod, {remote_type,_,[{atom,_,RemMod},{atom,_,Name},ArgForms]},
+ Stack) ->
+ is_custom_instance(X, Mod, RemMod, Name, ArgForms, true, Stack);
+is_instance(SameAtom, _Mod, {atom,_,SameAtom}, _Stack) ->
+ true;
+is_instance(SameInt, _Mod, {integer,_,SameInt}, _Stack) ->
+ true;
+is_instance(X, _Mod, {op,_,_Op,_Arg} = Expr, _Stack) ->
+ is_int_const(X, Expr);
+is_instance(X, _Mod, {op,_,_Op,_Arg1,_Arg2} = Expr, _Stack) ->
+ is_int_const(X, Expr);
+is_instance(_X, _Mod, {type,_,any,[]}, _Stack) ->
+ true;
+is_instance(X, _Mod, {type,_,atom,[]}, _Stack) ->
+ is_atom(X);
+is_instance(X, _Mod, {type,_,binary,[]}, _Stack) ->
+ is_binary(X);
+is_instance(X, _Mod, {type,_,binary,[BaseExpr,UnitExpr]}, _Stack) ->
+ %% <<_:X,_:_*Y>> means "bitstrings of X + k*Y bits, k >= 0"
+ case eval_int(BaseExpr) of
+ {ok,Base} when Base >= 0 ->
+ case eval_int(UnitExpr) of
+ {ok,Unit} when Unit >= 0 ->
+ case is_bitstring(X) of
+ true ->
+ BitSizeX = bit_size(X),
+ case Unit =:= 0 of
+ true ->
+ BitSizeX =:= Base;
+ false ->
+ BitSizeX >= Base
+ andalso
+ (BitSizeX - Base) rem Unit =:= 0
+ end;
+ false -> false
+ end;
+ _ ->
+ abs_expr_error(invalid_unit, UnitExpr)
+ end;
+ _ ->
+ abs_expr_error(invalid_base, BaseExpr)
+ end;
+is_instance(X, _Mod, {type,_,bitstring,[]}, _Stack) ->
+ is_bitstring(X);
+is_instance(X, _Mod, {type,_,boolean,[]}, _Stack) ->
+ is_boolean(X);
+is_instance(X, _Mod, {type,_,float,[]}, _Stack) ->
+ is_float(X);
+is_instance(X, _Mod, {type,_,'fun',[]}, _Stack) ->
+ is_function(X);
+%% TODO: how to check range type? random inputs? special case for 0-arity?
+is_instance(X, _Mod, {type,_,'fun',[{type,_,any,[]},_Range]}, _Stack) ->
+ is_function(X);
+is_instance(X, _Mod, {type,_,'fun',[{type,_,product,Domain},_Range]}, _Stack) ->
+ is_function(X, length(Domain));
+is_instance(X, _Mod, {type,_,integer,[]}, _Stack) ->
+ is_integer(X);
+is_instance(X, Mod, {type,_,list,[Type]}, _Stack) ->
+ list_test(X, Mod, Type, dummy, true, true, false);
+is_instance(X, Mod, {type,_,maybe_improper_list,[Cont,Term]}, _Stack) ->
+ list_test(X, Mod, Cont, Term, true, true, true);
+is_instance(X, _Mod, {type,_,module,[]}, _Stack) ->
+ is_atom(X) orelse
+ is_tuple(X) andalso X =/= {} andalso is_atom(element(1,X));
+is_instance([], _Mod, {type,_,nil,[]}, _Stack) ->
+ true;
+is_instance(X, _Mod, {type,_,neg_integer,[]}, _Stack) ->
+ is_integer(X) andalso X < 0;
+is_instance(X, _Mod, {type,_,non_neg_integer,[]}, _Stack) ->
+ is_integer(X) andalso X >= 0;
+is_instance(X, Mod, {type,_,nonempty_list,[Type]}, _Stack) ->
+ list_test(X, Mod, Type, dummy, false, true, false);
+is_instance(X, Mod, {type,_,nonempty_improper_list,[Cont,Term]}, _Stack) ->
+ list_test(X, Mod, Cont, Term, false, false, true);
+is_instance(X, Mod, {type,_,nonempty_maybe_improper_list,[Cont,Term]},
+ _Stack) ->
+ list_test(X, Mod, Cont, Term, false, true, true);
+is_instance(X, _Mod, {type,_,number,[]}, _Stack) ->
+ is_number(X);
+is_instance(X, _Mod, {type,_,pid,[]}, _Stack) ->
+ is_pid(X);
+is_instance(X, _Mod, {type,_,port,[]}, _Stack) ->
+ is_port(X);
+is_instance(X, _Mod, {type,_,pos_integer,[]}, _Stack) ->
+ is_integer(X) andalso X > 0;
+is_instance(_X, _Mod, {type,_,product,_Elements}, _Stack) ->
+ throw({'$typeserver',{internal,product_in_is_instance}});
+is_instance(X, _Mod, {type,_,range,[LowExpr,HighExpr]}, _Stack) ->
+ case {eval_int(LowExpr),eval_int(HighExpr)} of
+ {{ok,Low},{ok,High}} when Low =< High ->
+ X >= Low andalso X =< High;
+ _ ->
+ abs_expr_error(invalid_range, LowExpr, HighExpr)
+ end;
+is_instance(X, Mod, {type,_,record,[{atom,_,Name} = NameForm | RawSubsts]},
+ Stack) ->
+ Substs = [{N,T} || {type,_,field_type,[{atom,_,N},T]} <- RawSubsts],
+ SubstsDict = dict:from_list(Substs),
+ case get_type_repr(Mod, {record,Name,0}, false) of
+ {ok,{abs_record,OrigFields}} ->
+ Fields = [case dict:find(FieldName, SubstsDict) of
+ {ok,NewFieldType} -> NewFieldType;
+ error -> OrigFieldType
+ end
+ || {FieldName,OrigFieldType} <- OrigFields],
+ is_instance(X, Mod, {type,?anno(0),tuple,[NameForm|Fields]}, Stack);
+ {error,Reason} ->
+ throw({'$typeserver',Reason})
+ end;
+is_instance(X, _Mod, {type,_,reference,[]}, _Stack) ->
+ is_reference(X);
+is_instance(X, _Mod, {type,_,tuple,any}, _Stack) ->
+ is_tuple(X);
+is_instance(X, Mod, {type,_,tuple,Fields}, _Stack) ->
+ is_tuple(X) andalso tuple_test(tuple_to_list(X), Mod, Fields);
+is_instance(X, Mod, {type,_,union,Choices}, Stack) ->
+ IsInstance = fun(Choice) -> is_instance(X,Mod,Choice,Stack) end,
+ lists:any(IsInstance, Choices);
+is_instance(X, Mod, {T,_,Name,[]}, Stack) when ?IS_TYPE_TAG(T) ->
+ case orddict:find(Name, ?EQUIV_TYPES) of
+ {ok,EquivType} ->
+ is_instance(X, Mod, EquivType, Stack);
+ error ->
+ is_maybe_hard_adt(X, Mod, Name, [], Stack)
+ end;
+is_instance(X, Mod, {T,_,Name,ArgForms}, Stack) when ?IS_TYPE_TAG(T) ->
+ is_maybe_hard_adt(X, Mod, Name, ArgForms, Stack);
+is_instance(_X, _Mod, _Type, _Stack) ->
+ false.
+
+-spec is_int_const(term(), abs_expr()) -> boolean().
+is_int_const(X, Expr) ->
+ case eval_int(Expr) of
+ {ok,Int} ->
+ X =:= Int;
+ error ->
+ abs_expr_error(invalid_int_const, Expr)
+ end.
+
+%% TODO: We implicitly add the '| []' at the termination of maybe_improper_list.
+%% TODO: We ignore a '[]' termination in improper_list.
+-spec list_test(term(), mod_name(), abs_type(), 'dummy' | abs_type(), boolean(),
+ boolean(), boolean()) -> boolean().
+list_test(X, Mod, Content, Termination, CanEmpty, CanProper, CanImproper) ->
+ is_list(X) andalso
+ list_rec(X, Mod, Content, Termination, CanEmpty, CanProper, CanImproper).
+
+-spec list_rec(term(), mod_name(), abs_type(), 'dummy' | abs_type(), boolean(),
+ boolean(), boolean()) -> boolean().
+list_rec([], _Mod, _Content, _Termination, CanEmpty, CanProper, _CanImproper) ->
+ CanEmpty andalso CanProper;
+list_rec([X | Rest], Mod, Content, Termination, _CanEmpty, CanProper,
+ CanImproper) ->
+ is_instance(X, Mod, Content, []) andalso
+ list_rec(Rest, Mod, Content, Termination, true, CanProper, CanImproper);
+list_rec(X, Mod, _Content, Termination, _CanEmpty, _CanProper, CanImproper) ->
+ CanImproper andalso is_instance(X, Mod, Termination, []).
+
+-spec tuple_test([term()], mod_name(), [abs_type()]) -> boolean().
+tuple_test([], _Mod, []) ->
+ true;
+tuple_test([X | XTail], Mod, [T | TTail]) ->
+ is_instance(X, Mod, T, []) andalso tuple_test(XTail, Mod, TTail);
+tuple_test(_, _Mod, _) ->
+ false.
+
+-spec is_maybe_hard_adt(term(), mod_name(), type_name(), [abs_type()],
+ imm_stack()) -> boolean().
+is_maybe_hard_adt(X, Mod, Name, ArgForms, Stack) ->
+ case orddict:find({Name,length(ArgForms)}, ?HARD_ADTS) of
+ {ok,ADTMod} ->
+ is_custom_instance(X, Mod, ADTMod, Name, ArgForms, true, Stack);
+ error ->
+ is_custom_instance(X, Mod, Mod, Name, ArgForms, false, Stack)
+ end.
+
+-spec is_custom_instance(term(), mod_name(), mod_name(), type_name(),
+ [abs_type()], boolean(), imm_stack()) -> boolean().
+is_custom_instance(X, Mod, RemMod, Name, RawArgForms, IsRemote, Stack) ->
+ ArgForms = case Mod =/= RemMod of
+ true -> [{from_mod,Mod,A} || A <- RawArgForms];
+ false -> RawArgForms
+ end,
+ Arity = length(ArgForms),
+ FullTypeRef = {RemMod,Name,Arity},
+ case lists:member(FullTypeRef, Stack) of
+ true ->
+ throw({'$typeserver',{self_reference,FullTypeRef}});
+ false ->
+ TypeRef = {type,Name,Arity},
+ AbsType = get_abs_type(RemMod, TypeRef, ArgForms, IsRemote),
+ is_instance(X, RemMod, AbsType, [FullTypeRef|Stack])
+ end.
+
+-spec get_abs_type(mod_name(), type_ref(), [abs_type()], boolean()) ->
+ abs_type().
+get_abs_type(RemMod, TypeRef, ArgForms, IsRemote) ->
+ case get_type_repr(RemMod, TypeRef, IsRemote) of
+ {ok,TypeRepr} ->
+ {FinalAbsType,SymbInfo,VarNames} =
+ case TypeRepr of
+ {cached,_FinType,FAT,SI} -> {FAT,SI,[]};
+ {abs_type,FAT,VN,SI} -> {FAT,SI,VN}
+ end,
+ AbsType =
+ case SymbInfo of
+ not_symb -> FinalAbsType;
+ {orig_abs,OrigAbsType} -> OrigAbsType
+ end,
+ VarSubstsDict = dict:from_list(lists:zip(VarNames,ArgForms)),
+ update_vars(AbsType, VarSubstsDict, false);
+ {error,Reason} ->
+ throw({'$typeserver',Reason})
+ end.
+
+-spec abs_expr_error(atom(), abs_expr()) -> no_return().
+abs_expr_error(ImmReason, Expr) ->
+ {error,Reason} = expr_error(ImmReason, Expr),
+ throw({'$typeserver',Reason}).
+
+-spec abs_expr_error(atom(), abs_expr(), abs_expr()) -> no_return().
+abs_expr_error(ImmReason, Expr1, Expr2) ->
+ {error,Reason} = expr_error(ImmReason, Expr1, Expr2),
+ throw({'$typeserver',Reason}).
+
+
+%%------------------------------------------------------------------------------
+%% Type translation functions
+%%------------------------------------------------------------------------------
+
+-spec convert(mod_name(), abs_type(), state()) ->
+ rich_result2(fin_type(),state()).
+convert(Mod, TypeForm, State) ->
+ case convert(Mod, TypeForm, State, [], dict:new()) of
+ {ok,{simple,Type},NewState} ->
+ {ok, Type, NewState};
+ {ok,{rec,_RecFun,_RecArgs},_NewState} ->
+ {error, {internal,rec_returned_to_toplevel}};
+ {error,_Reason} = Error ->
+ Error
+ end.
+
+-spec convert(mod_name(), abs_type(), state(), stack(), var_dict()) ->
+ rich_result2(ret_type(),state()).
+convert(Mod, {paren_type,_,[Type]}, State, Stack, VarDict) ->
+ convert(Mod, Type, State, Stack, VarDict);
+convert(Mod, {ann_type,_,[_Var,Type]}, State, Stack, VarDict) ->
+ convert(Mod, Type, State, Stack, VarDict);
+convert(_Mod, {var,_,'_'}, State, _Stack, _VarDict) ->
+ {ok, {simple,proper_types:any()}, State};
+convert(_Mod, {var,_,VarName}, State, _Stack, VarDict) ->
+ case dict:find(VarName, VarDict) of
+ %% TODO: do we need to check if we are at toplevel of a recursive?
+ {ok,RetType} -> {ok, RetType, State};
+ error -> {error, {unbound_var,VarName}}
+ end;
+convert(Mod, {remote_type,_,[{atom,_,RemMod},{atom,_,Name},ArgForms]}, State,
+ Stack, VarDict) ->
+ case prepare_for_remote(RemMod, Name, length(ArgForms), State) of
+ {ok,NewState} ->
+ convert_custom(Mod,RemMod,Name,ArgForms,NewState,Stack,VarDict);
+ {error,_Reason} = Error ->
+ Error
+ end;
+convert(_Mod, {atom,_,Atom}, State, _Stack, _VarDict) ->
+ {ok, {simple,proper_types:exactly(Atom)}, State};
+convert(_Mod, {integer,_,_Int} = IntExpr, State, _Stack, _VarDict) ->
+ convert_integer(IntExpr, State);
+convert(_Mod, {op,_,_Op,_Arg} = OpExpr, State, _Stack, _VarDict) ->
+ convert_integer(OpExpr, State);
+convert(_Mod, {op,_,_Op,_Arg1,_Arg2} = OpExpr, State, _Stack, _VarDict) ->
+ convert_integer(OpExpr, State);
+convert(_Mod, {type,_,binary,[BaseExpr,UnitExpr]}, State, _Stack, _VarDict) ->
+ %% <<_:X,_:_*Y>> means "bitstrings of X + k*Y bits, k >= 0"
+ case eval_int(BaseExpr) of
+ {ok,0} ->
+ case eval_int(UnitExpr) of
+ {ok,0} -> {ok, {simple,proper_types:exactly(<<>>)}, State};
+ {ok,1} -> {ok, {simple,proper_types:bitstring()}, State};
+ {ok,8} -> {ok, {simple,proper_types:binary()}, State};
+ {ok,N} when N > 0 ->
+ Gen = ?LET(L, proper_types:list(proper_types:bitstring(N)),
+ concat_bitstrings(L)),
+ {ok, {simple,Gen}, State};
+ _ -> expr_error(invalid_unit, UnitExpr)
+ end;
+ {ok,Base} when Base > 0 ->
+ Head = proper_types:bitstring(Base),
+ case eval_int(UnitExpr) of
+ {ok,0} -> {ok, {simple,Head}, State};
+ {ok,1} ->
+ Tail = proper_types:bitstring(),
+ {ok, {simple,concat_binary_gens(Head, Tail)}, State};
+ {ok,8} ->
+ Tail = proper_types:binary(),
+ {ok, {simple,concat_binary_gens(Head, Tail)}, State};
+ {ok,N} when N > 0 ->
+ Tail =
+ ?LET(L, proper_types:list(proper_types:bitstring(N)),
+ concat_bitstrings(L)),
+ {ok, {simple,concat_binary_gens(Head, Tail)}, State};
+ _ -> expr_error(invalid_unit, UnitExpr)
+ end;
+ _ ->
+ expr_error(invalid_base, BaseExpr)
+ end;
+convert(_Mod, {type,_,range,[LowExpr,HighExpr]}, State, _Stack, _VarDict) ->
+ case {eval_int(LowExpr),eval_int(HighExpr)} of
+ {{ok,Low},{ok,High}} when Low =< High ->
+ {ok, {simple,proper_types:integer(Low,High)}, State};
+ _ ->
+ expr_error(invalid_range, LowExpr, HighExpr)
+ end;
+convert(_Mod, {type,_,nil,[]}, State, _Stack, _VarDict) ->
+ {ok, {simple,proper_types:exactly([])}, State};
+convert(Mod, {type,_,list,[ElemForm]}, State, Stack, VarDict) ->
+ convert_list(Mod, false, ElemForm, State, Stack, VarDict);
+convert(Mod, {type,_,nonempty_list,[ElemForm]}, State, Stack, VarDict) ->
+ convert_list(Mod, true, ElemForm, State, Stack, VarDict);
+convert(_Mod, {type,_,nonempty_list,[]}, State, _Stack, _VarDict) ->
+ {ok, {simple,proper_types:non_empty(proper_types:list())}, State};
+convert(_Mod, {type,_,nonempty_string,[]}, State, _Stack, _VarDict) ->
+ {ok, {simple,proper_types:non_empty(proper_types:string())}, State};
+convert(_Mod, {type,_,tuple,any}, State, _Stack, _VarDict) ->
+ {ok, {simple,proper_types:tuple()}, State};
+convert(Mod, {type,_,tuple,ElemForms}, State, Stack, VarDict) ->
+ convert_tuple(Mod, ElemForms, false, State, Stack, VarDict);
+convert(Mod, {type,_,'$fixed_list',ElemForms}, State, Stack, VarDict) ->
+ convert_tuple(Mod, ElemForms, true, State, Stack, VarDict);
+convert(Mod, {type,_,record,[{atom,_,Name}|FieldForms]}, State, Stack,
+ VarDict) ->
+ convert_record(Mod, Name, FieldForms, State, Stack, VarDict);
+convert(Mod, {type,_,union,ChoiceForms}, State, Stack, VarDict) ->
+ convert_union(Mod, ChoiceForms, State, Stack, VarDict);
+convert(Mod, {type,_,'fun',[{type,_,product,Domain},Range]}, State, Stack,
+ VarDict) ->
+ convert_fun(Mod, length(Domain), Range, State, Stack, VarDict);
+%% TODO: These types should be replaced with accurate types.
+%% TODO: Add support for nonempty_improper_list/2.
+convert(Mod, {type,Anno,maybe_improper_list,[]}, State, Stack, VarDict) ->
+ convert(Mod, {type,Anno,list,[]}, State, Stack, VarDict);
+convert(Mod, {type,A,maybe_improper_list,[Cont,_Ter]}, State, Stack, VarDict) ->
+ convert(Mod, {type,A,list,[Cont]}, State, Stack, VarDict);
+convert(Mod, {type,A,nonempty_maybe_improper_list,[]}, State, Stack, VarDict) ->
+ convert(Mod, {type,A,nonempty_list,[]}, State, Stack, VarDict);
+convert(Mod, {type,A,nonempty_maybe_improper_list,[Cont,_Term]}, State, Stack,
+ VarDict) ->
+ convert(Mod, {type,A,nonempty_list,[Cont]}, State, Stack, VarDict);
+convert(Mod, {type,A,iodata,[]}, State, Stack, VarDict) ->
+ RealType = {type,A,union,[{type,A,binary,[]},{type,A,iolist,[]}]},
+ convert(Mod, RealType, State, Stack, VarDict);
+convert(Mod, {T,_,Name,[]}, State, Stack, VarDict) when ?IS_TYPE_TAG(T) ->
+ case ordsets:is_element(Name, ?STD_TYPES_0) of
+ true ->
+ {ok, {simple,proper_types:Name()}, State};
+ false ->
+ convert_maybe_hard_adt(Mod, Name, [], State, Stack, VarDict)
+ end;
+convert(Mod, {T,_,Name,ArgForms}, State, Stack, VarDict) when ?IS_TYPE_TAG(T) ->
+ convert_maybe_hard_adt(Mod, Name, ArgForms, State, Stack, VarDict);
+convert(_Mod, TypeForm, _State, _Stack, _VarDict) ->
+ {error, {unsupported_type,TypeForm}}.
+
+-spec concat_bitstrings([bitstring()]) -> bitstring().
+concat_bitstrings(BitStrings) ->
+ concat_bitstrings_tr(BitStrings, <<>>).
+
+-spec concat_bitstrings_tr([bitstring()], bitstring()) -> bitstring().
+concat_bitstrings_tr([], Acc) ->
+ Acc;
+concat_bitstrings_tr([BitString | Rest], Acc) ->
+ concat_bitstrings_tr(Rest, <<Acc/bits,BitString/bits>>).
+
+-spec concat_binary_gens(fin_type(), fin_type()) -> fin_type().
+concat_binary_gens(HeadType, TailType) ->
+ ?LET({H,T}, {HeadType,TailType}, <<H/bits,T/bits>>).
+
+-spec convert_fun(mod_name(), arity(), abs_type(), state(), stack(),
+ var_dict()) -> rich_result2(ret_type(),state()).
+convert_fun(Mod, Arity, Range, State, Stack, VarDict) ->
+ case convert(Mod, Range, State, ['fun' | Stack], VarDict) of
+ {ok,{simple,RangeType},NewState} ->
+ {ok, {simple,proper_types:function(Arity,RangeType)}, NewState};
+ {ok,{rec,RecFun,RecArgs},NewState} ->
+ case at_toplevel(RecArgs, Stack) of
+ true -> base_case_error(Stack);
+ false -> convert_rec_fun(Arity, RecFun, RecArgs, NewState)
+ end;
+ {error,_Reason} = Error ->
+ Error
+ end.
+
+-spec convert_rec_fun(arity(), rec_fun(), rec_args(), state()) ->
+ {'ok',ret_type(),state()}.
+convert_rec_fun(Arity, RecFun, RecArgs, State) ->
+ %% We bind the generated value by size.
+ NewRecFun =
+ fun(GenFuns,Size) ->
+ proper_types:function(Arity, RecFun(GenFuns,Size))
+ end,
+ NewRecArgs = clean_rec_args(RecArgs),
+ {ok, {rec,NewRecFun,NewRecArgs}, State}.
+
+-spec convert_list(mod_name(), boolean(), abs_type(), state(), stack(),
+ var_dict()) -> rich_result2(ret_type(),state()).
+convert_list(Mod, NonEmpty, ElemForm, State, Stack, VarDict) ->
+ case convert(Mod, ElemForm, State, [list | Stack], VarDict) of
+ {ok,{simple,ElemType},NewState} ->
+ InnerType = proper_types:list(ElemType),
+ FinType = case NonEmpty of
+ true -> proper_types:non_empty(InnerType);
+ false -> InnerType
+ end,
+ {ok, {simple,FinType}, NewState};
+ {ok,{rec,RecFun,RecArgs},NewState} ->
+ case {at_toplevel(RecArgs,Stack), NonEmpty} of
+ {true,true} ->
+ base_case_error(Stack);
+ {true,false} ->
+ NewRecFun =
+ fun(GenFuns,Size) ->
+ ElemGen = fun(S) -> ?LAZY(RecFun(GenFuns,S)) end,
+ proper_types:distlist(Size, ElemGen, false)
+ end,
+ NewRecArgs = clean_rec_args(RecArgs),
+ {ok, {rec,NewRecFun,NewRecArgs}, NewState};
+ {false,_} ->
+ {NewRecFun,NewRecArgs} =
+ convert_rec_list(RecFun, RecArgs, NonEmpty),
+ {ok, {rec,NewRecFun,NewRecArgs}, NewState}
+ end;
+ {error,_Reason} = Error ->
+ Error
+ end.
+
+-spec convert_rec_list(rec_fun(), rec_args(), boolean()) ->
+ {rec_fun(),rec_args()}.
+convert_rec_list(RecFun, [{true,FullTypeRef}] = RecArgs, NonEmpty) ->
+ {NewRecFun,_NormalRecArgs} =
+ convert_normal_rec_list(RecFun, RecArgs, NonEmpty),
+ AltRecFun =
+ fun([InstListGen],Size) ->
+ InstTypesList =
+ proper_types:get_prop(internal_types, InstListGen(Size)),
+ proper_types:fixed_list([RecFun([fun(_Size) -> I end],0)
+ || I <- InstTypesList])
+ end,
+ NewRecArgs = [{{list,NonEmpty,AltRecFun},FullTypeRef}],
+ {NewRecFun, NewRecArgs};
+convert_rec_list(RecFun, RecArgs, NonEmpty) ->
+ convert_normal_rec_list(RecFun, RecArgs, NonEmpty).
+
+-spec convert_normal_rec_list(rec_fun(), rec_args(), boolean()) ->
+ {rec_fun(),rec_args()}.
+convert_normal_rec_list(RecFun, RecArgs, NonEmpty) ->
+ NewRecFun = fun(GenFuns,Size) ->
+ ElemGen = fun(S) -> RecFun(GenFuns, S) end,
+ proper_types:distlist(Size, ElemGen, NonEmpty)
+ end,
+ NewRecArgs = clean_rec_args(RecArgs),
+ {NewRecFun, NewRecArgs}.
+
+-spec convert_tuple(mod_name(), [abs_type()], boolean(), state(), stack(),
+ var_dict()) -> rich_result2(ret_type(),state()).
+convert_tuple(Mod, ElemForms, ToList, State, Stack, VarDict) ->
+ case process_list(Mod, ElemForms, State, [tuple | Stack], VarDict) of
+ {ok,RetTypes,NewState} ->
+ case combine_ret_types(RetTypes, {tuple,ToList}) of
+ {simple,_FinType} = RetType ->
+ {ok, RetType, NewState};
+ {rec,_RecFun,RecArgs} = RetType ->
+ case at_toplevel(RecArgs, Stack) of
+ true -> base_case_error(Stack);
+ false -> {ok, RetType, NewState}
+ end
+ end;
+ {error,_Reason} = Error ->
+ Error
+ end.
+
+-spec convert_union(mod_name(), [abs_type()], state(), stack(), var_dict()) ->
+ rich_result2(ret_type(),state()).
+convert_union(Mod, ChoiceForms, State, Stack, VarDict) ->
+ case process_list(Mod, ChoiceForms, State, [union | Stack], VarDict) of
+ {ok,RawChoices,NewState} ->
+ ProcessChoice = fun(T,A) -> process_choice(T,A,Stack) end,
+ {RevSelfRecs,RevNonSelfRecs,RevNonRecs} =
+ lists:foldl(ProcessChoice, {[],[],[]}, RawChoices),
+ case {lists:reverse(RevSelfRecs),lists:reverse(RevNonSelfRecs),
+ lists:reverse(RevNonRecs)} of
+ {_SelfRecs,[],[]} ->
+ base_case_error(Stack);
+ {[],NonSelfRecs,NonRecs} ->
+ {ok, combine_ret_types(NonRecs ++ NonSelfRecs, union),
+ NewState};
+ {SelfRecs,NonSelfRecs,NonRecs} ->
+ {BCaseRecFun,BCaseRecArgs} =
+ case combine_ret_types(NonRecs ++ NonSelfRecs, union) of
+ {simple,BCaseType} ->
+ {fun([],_Size) -> BCaseType end,[]};
+ {rec,BCRecFun,BCRecArgs} ->
+ {BCRecFun,BCRecArgs}
+ end,
+ NumBCaseGens = length(BCaseRecArgs),
+ [ParentRef | _Upper] = Stack,
+ FallbackRecFun = fun([SelfGen],_Size) -> SelfGen(0) end,
+ FallbackRecArgs = [{false,ParentRef}],
+ FallbackRetType = {rec,FallbackRecFun,FallbackRecArgs},
+ {rec,RCaseRecFun,RCaseRecArgs} =
+ combine_ret_types([FallbackRetType] ++ SelfRecs
+ ++ NonSelfRecs, wunion),
+ NewRecFun =
+ fun(AllGens,Size) ->
+ {BCaseGens,RCaseGens} =
+ lists:split(NumBCaseGens, AllGens),
+ case Size of
+ 0 -> BCaseRecFun(BCaseGens,0);
+ _ -> RCaseRecFun(RCaseGens,Size)
+ end
+ end,
+ NewRecArgs = BCaseRecArgs ++ RCaseRecArgs,
+ {ok, {rec,NewRecFun,NewRecArgs}, NewState}
+ end;
+ {error,_Reason} = Error ->
+ Error
+ end.
+
+-spec process_choice(ret_type(), {[ret_type()],[ret_type()],[ret_type()]},
+ stack()) -> {[ret_type()],[ret_type()],[ret_type()]}.
+process_choice({simple,_} = RetType, {SelfRecs,NonSelfRecs,NonRecs}, _Stack) ->
+ {SelfRecs, NonSelfRecs, [RetType | NonRecs]};
+process_choice({rec,RecFun,RecArgs}, {SelfRecs,NonSelfRecs,NonRecs}, Stack) ->
+ case at_toplevel(RecArgs, Stack) of
+ true ->
+ case partition_by_toplevel(RecArgs, Stack, true) of
+ {[],[],_,_} ->
+ NewRecArgs = clean_rec_args(RecArgs),
+ {[{rec,RecFun,NewRecArgs} | SelfRecs], NonSelfRecs,
+ NonRecs};
+ {SelfRecArgs,SelfPos,OtherRecArgs,_OtherPos} ->
+ NumInstances = length(SelfRecArgs),
+ IsListInst = fun({true,_FTRef}) -> false
+ ; ({{list,_NE,_AltRecFun},_FTRef}) -> true
+ end,
+ NewRecFun =
+ case proper_arith:filter(IsListInst,SelfRecArgs) of
+ {[],[]} ->
+ no_list_inst_rec_fun(RecFun,NumInstances,
+ SelfPos);
+ {[{{list,NonEmpty,AltRecFun},_}],[ListInstPos]} ->
+ list_inst_rec_fun(AltRecFun,NumInstances,
+ SelfPos,NonEmpty,ListInstPos)
+ end,
+ [{_B,SelfRef} | _] = SelfRecArgs,
+ NewRecArgs =
+ [{false,SelfRef} | clean_rec_args(OtherRecArgs)],
+ {[{rec,NewRecFun,NewRecArgs} | SelfRecs], NonSelfRecs,
+ NonRecs}
+ end;
+ false ->
+ NewRecArgs = clean_rec_args(RecArgs),
+ {SelfRecs, [{rec,RecFun,NewRecArgs} | NonSelfRecs], NonRecs}
+ end.
+
+-spec no_list_inst_rec_fun(rec_fun(), pos_integer(), [position()]) -> rec_fun().
+no_list_inst_rec_fun(RecFun, NumInstances, SelfPos) ->
+ fun([SelfGen|OtherGens], Size) ->
+ ?LETSHRINK(
+ Instances,
+ %% Size distribution will be a little off if both normal and
+ %% instance-accepting generators are present.
+ lists:duplicate(NumInstances, SelfGen(Size div NumInstances)),
+ begin
+ InstGens = [fun(_Size) -> proper_types:exactly(I) end
+ || I <- Instances],
+ AllGens = proper_arith:insert(InstGens, SelfPos, OtherGens),
+ RecFun(AllGens, Size)
+ end)
+ end.
+
+-spec list_inst_rec_fun(rec_fun(), pos_integer(), [position()], boolean(),
+ position()) -> rec_fun().
+list_inst_rec_fun(AltRecFun, NumInstances, SelfPos, NonEmpty, ListInstPos) ->
+ fun([SelfGen|OtherGens], Size) ->
+ ?LETSHRINK(
+ AllInsts,
+ lists:duplicate(NumInstances - 1, SelfGen(Size div NumInstances))
+ ++ proper_types:distlist(Size div NumInstances, SelfGen, NonEmpty),
+ begin
+ {Instances,InstList} = lists:split(NumInstances - 1, AllInsts),
+ InstGens = [fun(_Size) -> proper_types:exactly(I) end
+ || I <- Instances],
+ InstTypesList = [proper_types:exactly(I) || I <- InstList],
+ InstListGen =
+ fun(_Size) -> proper_types:fixed_list(InstTypesList) end,
+ AllInstGens = proper_arith:list_insert(ListInstPos, InstListGen,
+ InstGens),
+ AllGens = proper_arith:insert(AllInstGens, SelfPos, OtherGens),
+ AltRecFun(AllGens, Size)
+ end)
+ end.
+
+-spec convert_maybe_hard_adt(mod_name(), type_name(), [abs_type()], state(),
+ stack(), var_dict()) ->
+ rich_result2(ret_type(),state()).
+convert_maybe_hard_adt(Mod, Name, ArgForms, State, Stack, VarDict) ->
+ Arity = length(ArgForms),
+ case orddict:find({Name,Arity}, ?HARD_ADTS) of
+ {ok,Mod} ->
+ convert_custom(Mod, Mod, Name, ArgForms, State, Stack, VarDict);
+ {ok,ADTMod} ->
+ A = ?anno(0),
+ ADT = {remote_type,A,[{atom,A,ADTMod},{atom,A,Name},ArgForms]},
+ convert(Mod, ADT, State, Stack, VarDict);
+ error ->
+ convert_custom(Mod, Mod, Name, ArgForms, State, Stack, VarDict)
+ end.
+
+-spec convert_custom(mod_name(), mod_name(), type_name(), [abs_type()], state(),
+ stack(), var_dict()) -> rich_result2(ret_type(),state()).
+convert_custom(Mod, RemMod, Name, ArgForms, State, Stack, VarDict) ->
+ case process_list(Mod, ArgForms, State, Stack, VarDict) of
+ {ok,Args,NewState} ->
+ Arity = length(Args),
+ TypeRef = {type,Name,Arity},
+ FullTypeRef = {RemMod,type,Name,Args},
+ convert_type(TypeRef, FullTypeRef, NewState, Stack);
+ {error,_Reason} = Error ->
+ Error
+ end.
+
+-spec convert_record(mod_name(), type_name(), [abs_type()], state(), stack(),
+ var_dict()) -> rich_result2(ret_type(),state()).
+convert_record(Mod, Name, RawSubsts, State, Stack, VarDict) ->
+ Substs = [{N,T} || {type,_,field_type,[{atom,_,N},T]} <- RawSubsts],
+ {SubstFields,SubstTypeForms} = lists:unzip(Substs),
+ case process_list(Mod, SubstTypeForms, State, Stack, VarDict) of
+ {ok,SubstTypes,NewState} ->
+ SubstsDict = dict:from_list(lists:zip(SubstFields, SubstTypes)),
+ TypeRef = {record,Name,0},
+ FullTypeRef = {Mod,record,Name,SubstsDict},
+ convert_type(TypeRef, FullTypeRef, NewState, Stack);
+ {error,_Reason} = Error ->
+ Error
+ end.
+
+-spec convert_type(type_ref(), full_type_ref(), state(), stack()) ->
+ rich_result2(ret_type(),state()).
+convert_type(TypeRef, {Mod,_Kind,_Name,_Spec} = FullTypeRef, State, Stack) ->
+ case stack_position(FullTypeRef, Stack) of
+ none ->
+ case get_type_repr(Mod, TypeRef, false, State) of
+ {ok,TypeRepr,NewState} ->
+ convert_new_type(TypeRef, FullTypeRef, TypeRepr, NewState,
+ Stack);
+ {error,_Reason} = Error ->
+ Error
+ end;
+ 1 ->
+ base_case_error(Stack);
+ _Pos ->
+ {ok, {rec,fun([Gen],Size) -> Gen(Size) end,[{true,FullTypeRef}]},
+ State}
+ end.
+
+-spec convert_new_type(type_ref(), full_type_ref(), type_repr(), state(),
+ stack()) -> rich_result2(ret_type(),state()).
+convert_new_type(_TypeRef, {_Mod,type,_Name,[]},
+ {cached,FinType,_TypeForm,_SymbInfo}, State, _Stack) ->
+ {ok, {simple,FinType}, State};
+convert_new_type(TypeRef, {Mod,type,_Name,Args} = FullTypeRef,
+ {abs_type,TypeForm,Vars,SymbInfo}, State, Stack) ->
+ VarDict = dict:from_list(lists:zip(Vars, Args)),
+ case convert(Mod, TypeForm, State, [FullTypeRef | Stack], VarDict) of
+ {ok, {simple,ImmFinType}, NewState} ->
+ FinType = case SymbInfo of
+ not_symb ->
+ ImmFinType;
+ {orig_abs,_OrigAbsType} ->
+ proper_symb:internal_well_defined(ImmFinType)
+ end,
+ FinalState = case Vars of
+ [] -> cache_type(Mod, TypeRef, FinType, TypeForm,
+ SymbInfo, NewState);
+ _ -> NewState
+ end,
+ {ok, {simple,FinType}, FinalState};
+ {ok, {rec,RecFun,RecArgs}, NewState} ->
+ convert_maybe_rec(FullTypeRef, SymbInfo, RecFun, RecArgs, NewState,
+ Stack);
+ {error,_Reason} = Error ->
+ Error
+ end;
+convert_new_type(_TypeRef, {Mod,record,Name,SubstsDict} = FullTypeRef,
+ {abs_record,OrigFields}, State, Stack) ->
+ Fields = [case dict:find(FieldName, SubstsDict) of
+ {ok,NewFieldType} -> NewFieldType;
+ error -> OrigFieldType
+ end
+ || {FieldName,OrigFieldType} <- OrigFields],
+ case convert_tuple(Mod, [{atom,0,Name} | Fields], false, State,
+ [FullTypeRef | Stack], dict:new()) of
+ {ok, {simple,_FinType}, _NewState} = Result ->
+ Result;
+ {ok, {rec,RecFun,RecArgs}, NewState} ->
+ convert_maybe_rec(FullTypeRef, not_symb, RecFun, RecArgs, NewState,
+ Stack);
+ {error,_Reason} = Error ->
+ Error
+ end.
+
+-spec cache_type(mod_name(), type_ref(), fin_type(), abs_type(), symb_info(),
+ state()) -> state().
+cache_type(Mod, TypeRef, FinType, TypeForm, SymbInfo,
+ #state{types = Types} = State) ->
+ TypeRepr = {cached,FinType,TypeForm,SymbInfo},
+ ModTypes = dict:fetch(Mod, Types),
+ NewModTypes = dict:store(TypeRef, TypeRepr, ModTypes),
+ NewTypes = dict:store(Mod, NewModTypes, Types),
+ State#state{types = NewTypes}.
+
+-spec convert_maybe_rec(full_type_ref(), symb_info(), rec_fun(), rec_args(),
+ state(), stack()) -> rich_result2(ret_type(),state()).
+convert_maybe_rec(FullTypeRef, SymbInfo, RecFun, RecArgs, State, Stack) ->
+ case at_toplevel(RecArgs, Stack) of
+ true -> base_case_error(Stack);
+ false -> safe_convert_maybe_rec(FullTypeRef, SymbInfo, RecFun, RecArgs,
+ State)
+ end.
+
+-spec safe_convert_maybe_rec(full_type_ref(),symb_info(),rec_fun(),rec_args(),
+ state()) -> rich_result2(ret_type(),state()).
+safe_convert_maybe_rec(FullTypeRef, SymbInfo, RecFun, RecArgs, State) ->
+ case partition_rec_args(FullTypeRef, RecArgs, false) of
+ {[],[],_,_} ->
+ {ok, {rec,RecFun,RecArgs}, State};
+ {MyRecArgs,MyPos,OtherRecArgs,_OtherPos} ->
+ case lists:all(fun({B,_T}) -> B =:= false end, MyRecArgs) of
+ true -> convert_rec_type(SymbInfo, RecFun, MyPos, OtherRecArgs,
+ State);
+ false -> {error, {internal,true_rec_arg_reached_type}}
+ end
+ end.
+
+-spec convert_rec_type(symb_info(), rec_fun(), [position()], rec_args(),
+ state()) -> {ok, ret_type(), state()}.
+convert_rec_type(SymbInfo, RecFun, MyPos, [], State) ->
+ NumRecArgs = length(MyPos),
+ M = fun(GenFun) ->
+ fun(Size) ->
+ GenFuns = lists:duplicate(NumRecArgs, GenFun),
+ RecFun(GenFuns, erlang:max(0,Size - 1))
+ end
+ end,
+ SizedGen = y(M),
+ ImmFinType = ?SIZED(Size,SizedGen(Size + 1)),
+ FinType = case SymbInfo of
+ not_symb ->
+ ImmFinType;
+ {orig_abs,_OrigAbsType} ->
+ proper_symb:internal_well_defined(ImmFinType)
+ end,
+ {ok, {simple,FinType}, State};
+convert_rec_type(_SymbInfo, RecFun, MyPos, OtherRecArgs, State) ->
+ NumRecArgs = length(MyPos),
+ NewRecFun =
+ fun(OtherGens,TopSize) ->
+ M = fun(GenFun) ->
+ fun(Size) ->
+ GenFuns = lists:duplicate(NumRecArgs, GenFun),
+ AllGens =
+ proper_arith:insert(GenFuns, MyPos, OtherGens),
+ RecFun(AllGens, erlang:max(0,Size - 1))
+ end
+ end,
+ (y(M))(TopSize)
+ end,
+ NewRecArgs = clean_rec_args(OtherRecArgs),
+ {ok, {rec,NewRecFun,NewRecArgs}, State}.
+
+%% Y Combinator: Read more at http://bc.tech.coop/blog/070611.html.
+-spec y(fun((fun((T) -> S)) -> fun((T) -> S))) -> fun((T) -> S).
+y(M) ->
+ G = fun(F) ->
+ M(fun(A) -> (F(F))(A) end)
+ end,
+ G(G).
+
+-spec process_list(mod_name(), [abs_type() | ret_type()], state(), stack(),
+ var_dict()) -> rich_result2([ret_type()],state()).
+process_list(Mod, RawTypes, State, Stack, VarDict) ->
+ Process = fun({simple,_FinType} = Type, {ok,Types,State1}) ->
+ {ok, [Type|Types], State1};
+ ({rec,_RecFun,_RecArgs} = Type, {ok,Types,State1}) ->
+ {ok, [Type|Types], State1};
+ (TypeForm, {ok,Types,State1}) ->
+ case convert(Mod, TypeForm, State1, Stack, VarDict) of
+ {ok,Type,State2} -> {ok,[Type|Types],State2};
+ {error,_} = Err -> Err
+ end;
+ (_RawType, {error,_} = Err) ->
+ Err
+ end,
+ case lists:foldl(Process, {ok,[],State}, RawTypes) of
+ {ok,RevTypes,NewState} ->
+ {ok, lists:reverse(RevTypes), NewState};
+ {error,_Reason} = Error ->
+ Error
+ end.
+
+-spec convert_integer(abs_expr(), state()) -> rich_result2(ret_type(),state()).
+convert_integer(Expr, State) ->
+ case eval_int(Expr) of
+ {ok,Int} -> {ok, {simple,proper_types:exactly(Int)}, State};
+ error -> expr_error(invalid_int_const, Expr)
+ end.
+
+-spec eval_int(abs_expr()) -> tagged_result(integer()).
+eval_int(Expr) ->
+ NoBindings = erl_eval:new_bindings(),
+ try erl_eval:expr(Expr, NoBindings) of
+ {value,Value,_NewBindings} when is_integer(Value) ->
+ {ok, Value};
+ _ ->
+ error
+ catch
+ error:_ ->
+ error
+ end.
+
+-spec expr_error(atom(), abs_expr()) -> {'error',term()}.
+expr_error(Reason, Expr) ->
+ {error, {Reason,lists:flatten(erl_pp:expr(Expr))}}.
+
+-spec expr_error(atom(), abs_expr(), abs_expr()) -> {'error',term()}.
+expr_error(Reason, Expr1, Expr2) ->
+ Str1 = lists:flatten(erl_pp:expr(Expr1)),
+ Str2 = lists:flatten(erl_pp:expr(Expr2)),
+ {error, {Reason,Str1,Str2}}.
+
+-spec base_case_error(stack()) -> {'error',term()}.
+%% TODO: This might confuse, since it doesn't record the arguments to parametric
+%% types or the type subsitutions of a record.
+base_case_error([{Mod,type,Name,Args} | _Upper]) ->
+ Arity = length(Args),
+ {error, {no_base_case,{Mod,type,Name,Arity}}};
+base_case_error([{Mod,record,Name,_SubstsDict} | _Upper]) ->
+ {error, {no_base_case,{Mod,record,Name}}}.
+
+
+%%------------------------------------------------------------------------------
+%% Helper datatypes handling functions
+%%------------------------------------------------------------------------------
+
+-spec stack_position(full_type_ref(), stack()) -> 'none' | pos_integer().
+stack_position(FullTypeRef, Stack) ->
+ SameType = fun(A) -> same_full_type_ref(A,FullTypeRef) end,
+ case proper_arith:find_first(SameType, Stack) of
+ {Pos,_} -> Pos;
+ none -> none
+ end.
+
+-spec partition_by_toplevel(rec_args(), stack(), boolean()) ->
+ {rec_args(),[position()],rec_args(),[position()]}.
+partition_by_toplevel(RecArgs, [], _OnlyInstanceAccepting) ->
+ {[],[],RecArgs,lists:seq(1,length(RecArgs))};
+partition_by_toplevel(RecArgs, [_Parent | _Upper], _OnlyInstanceAccepting)
+ when is_atom(_Parent) ->
+ {[],[],RecArgs,lists:seq(1,length(RecArgs))};
+partition_by_toplevel(RecArgs, [Parent | _Upper], OnlyInstanceAccepting) ->
+ partition_rec_args(Parent, RecArgs, OnlyInstanceAccepting).
+
+-spec at_toplevel(rec_args(), stack()) -> boolean().
+at_toplevel(RecArgs, Stack) ->
+ case partition_by_toplevel(RecArgs, Stack, false) of
+ {[],[],_,_} -> false;
+ _ -> true
+ end.
+
+-spec partition_rec_args(full_type_ref(), rec_args(), boolean()) ->
+ {rec_args(),[position()],rec_args(),[position()]}.
+partition_rec_args(FullTypeRef, RecArgs, OnlyInstanceAccepting) ->
+ SameType =
+ case OnlyInstanceAccepting of
+ true -> fun({false,_T}) -> false
+ ; ({_B,T}) -> same_full_type_ref(T,FullTypeRef) end;
+ false -> fun({_B,T}) -> same_full_type_ref(T,FullTypeRef) end
+ end,
+ proper_arith:partition(SameType, RecArgs).
+
+%% Tuples can be of 0 arity, unions of 1 and wunions at least of 2.
+-spec combine_ret_types([ret_type()], {'tuple',boolean()} | 'union'
+ | 'wunion') -> ret_type().
+combine_ret_types(RetTypes, EnclosingType) ->
+ case lists:all(fun is_simple_ret_type/1, RetTypes) of
+ true ->
+ %% This should never happen for wunion.
+ Combine = case EnclosingType of
+ {tuple,false} -> fun proper_types:tuple/1;
+ {tuple,true} -> fun proper_types:fixed_list/1;
+ union -> fun proper_types:union/1
+ end,
+ FinTypes = [T || {simple,T} <- RetTypes],
+ {simple, Combine(FinTypes)};
+ false ->
+ NumTypes = length(RetTypes),
+ {RevRecFuns,RevRecArgsList,NumRecs} =
+ lists:foldl(fun add_ret_type/2, {[],[],0}, RetTypes),
+ RecFuns = lists:reverse(RevRecFuns),
+ RecArgsList = lists:reverse(RevRecArgsList),
+ RecArgLens = [length(RecArgs) || RecArgs <- RecArgsList],
+ RecFunInfo = {NumTypes,NumRecs,RecArgLens,RecFuns},
+ FlatRecArgs = lists:flatten(RecArgsList),
+ {NewRecFun,NewRecArgs} =
+ case EnclosingType of
+ {tuple,ToList} ->
+ {tuple_rec_fun(RecFunInfo,ToList),
+ soft_clean_rec_args(FlatRecArgs,RecFunInfo,ToList)};
+ union ->
+ {union_rec_fun(RecFunInfo),clean_rec_args(FlatRecArgs)};
+ wunion ->
+ {wunion_rec_fun(RecFunInfo),
+ clean_rec_args(FlatRecArgs)}
+ end,
+ {rec, NewRecFun, NewRecArgs}
+ end.
+
+-spec tuple_rec_fun(rec_fun_info(), boolean()) -> rec_fun().
+tuple_rec_fun({_NumTypes,NumRecs,RecArgLens,RecFuns}, ToList) ->
+ Combine = case ToList of
+ true -> fun proper_types:fixed_list/1;
+ false -> fun proper_types:tuple/1
+ end,
+ fun(AllGFs,TopSize) ->
+ Size = TopSize div NumRecs,
+ GFsList = proper_arith:unflatten(AllGFs, RecArgLens),
+ ArgsList = [[GenFuns,Size] || GenFuns <- GFsList],
+ ZipFun = fun erlang:apply/2,
+ Combine(lists:zipwith(ZipFun, RecFuns, ArgsList))
+ end.
+
+-spec union_rec_fun(rec_fun_info()) -> rec_fun().
+union_rec_fun({_NumTypes,_NumRecs,RecArgLens,RecFuns}) ->
+ fun(AllGFs,Size) ->
+ GFsList = proper_arith:unflatten(AllGFs, RecArgLens),
+ ArgsList = [[GenFuns,Size] || GenFuns <- GFsList],
+ ZipFun = fun(F,A) -> ?LAZY(apply(F,A)) end,
+ proper_types:union(lists:zipwith(ZipFun, RecFuns, ArgsList))
+ end.
+
+-spec wunion_rec_fun(rec_fun_info()) -> rec_fun().
+wunion_rec_fun({NumTypes,_NumRecs,RecArgLens,RecFuns}) ->
+ fun(AllGFs,Size) ->
+ GFsList = proper_arith:unflatten(AllGFs, RecArgLens),
+ ArgsList = [[GenFuns,Size] || GenFuns <- GFsList],
+ ZipFun = fun(W,F,A) -> {W,?LAZY(apply(F,A))} end,
+ RecWeight = erlang:max(1, Size div (NumTypes - 1)),
+ Weights = [1 | lists:duplicate(NumTypes - 1, RecWeight)],
+ WeightedChoices = lists:zipwith3(ZipFun, Weights, RecFuns, ArgsList),
+ proper_types:wunion(WeightedChoices)
+ end.
+
+-spec add_ret_type(ret_type(), {[rec_fun()],[rec_args()],non_neg_integer()}) ->
+ {[rec_fun()],[rec_args()],non_neg_integer()}.
+add_ret_type({simple,FinType}, {RecFuns,RecArgsList,NumRecs}) ->
+ {[fun([],_) -> FinType end | RecFuns], [[] | RecArgsList], NumRecs};
+add_ret_type({rec,RecFun,RecArgs}, {RecFuns,RecArgsList,NumRecs}) ->
+ {[RecFun | RecFuns], [RecArgs | RecArgsList], NumRecs + 1}.
+
+-spec is_simple_ret_type(ret_type()) -> boolean().
+is_simple_ret_type({simple,_FinType}) ->
+ true;
+is_simple_ret_type({rec,_RecFun,_RecArgs}) ->
+ false.
+
+-spec clean_rec_args(rec_args()) -> rec_args().
+clean_rec_args(RecArgs) ->
+ [{false,F} || {_B,F} <- RecArgs].
+
+-spec soft_clean_rec_args(rec_args(), rec_fun_info(), boolean()) -> rec_args().
+soft_clean_rec_args(RecArgs, RecFunInfo, ToList) ->
+ soft_clean_rec_args_tr(RecArgs, [], RecFunInfo, ToList, false, 1).
+
+-spec soft_clean_rec_args_tr(rec_args(), rec_args(), rec_fun_info(), boolean(),
+ boolean(), position()) -> rec_args().
+soft_clean_rec_args_tr([], Acc, _RecFunInfo, _ToList, _FoundListInst, _Pos) ->
+ lists:reverse(Acc);
+soft_clean_rec_args_tr([{{list,_NonEmpty,_AltRecFun},FTRef} | Rest], Acc,
+ RecFunInfo, ToList, true, Pos) ->
+ NewArg = {false,FTRef},
+ soft_clean_rec_args_tr(Rest, [NewArg|Acc], RecFunInfo, ToList, true, Pos+1);
+soft_clean_rec_args_tr([{{list,NonEmpty,AltRecFun},FTRef} | Rest], Acc,
+ RecFunInfo, ToList, false, Pos) ->
+ {NumTypes,NumRecs,RecArgLens,RecFuns} = RecFunInfo,
+ AltRecFunPos = get_group(Pos, RecArgLens),
+ AltRecFuns = proper_arith:list_update(AltRecFunPos, AltRecFun, RecFuns),
+ AltRecFunInfo = {NumTypes,NumRecs,RecArgLens,AltRecFuns},
+ NewArg = {{list,NonEmpty,tuple_rec_fun(AltRecFunInfo,ToList)},FTRef},
+ soft_clean_rec_args_tr(Rest, [NewArg|Acc], RecFunInfo, ToList, true, Pos+1);
+soft_clean_rec_args_tr([Arg | Rest], Acc, RecFunInfo, ToList, FoundListInst,
+ Pos) ->
+ soft_clean_rec_args_tr(Rest, [Arg | Acc], RecFunInfo, ToList, FoundListInst,
+ Pos+1).
+
+-spec get_group(pos_integer(), [non_neg_integer()]) -> pos_integer().
+get_group(Pos, AllMembers) ->
+ get_group_tr(Pos, AllMembers, 1).
+
+-spec get_group_tr(pos_integer(), [non_neg_integer()], pos_integer()) ->
+ pos_integer().
+get_group_tr(Pos, [Members | Rest], GroupNum) ->
+ case Pos =< Members of
+ true -> GroupNum;
+ false -> get_group_tr(Pos - Members, Rest, GroupNum + 1)
+ end.
+
+-spec same_full_type_ref(full_type_ref(), term()) -> boolean().
+same_full_type_ref({SameMod,type,SameName,Args1},
+ {SameMod,type,SameName,Args2}) ->
+ length(Args1) =:= length(Args2)
+ andalso lists:all(fun({A,B}) -> same_ret_type(A,B) end,
+ lists:zip(Args1, Args2));
+same_full_type_ref({SameMod,record,SameName,SubstsDict1},
+ {SameMod,record,SameName,SubstsDict2}) ->
+ same_substs_dict(SubstsDict1, SubstsDict2);
+same_full_type_ref(_, _) ->
+ false.
+
+-spec same_ret_type(ret_type(), ret_type()) -> boolean().
+same_ret_type({simple,FinType1}, {simple,FinType2}) ->
+ same_fin_type(FinType1, FinType2);
+same_ret_type({rec,RecFun1,RecArgs1}, {rec,RecFun2,RecArgs2}) ->
+ NumRecArgs = length(RecArgs1),
+ length(RecArgs2) =:= NumRecArgs
+ andalso lists:all(fun({A1,A2}) -> same_rec_arg(A1,A2,NumRecArgs) end,
+ lists:zip(RecArgs1,RecArgs2))
+ andalso same_rec_fun(RecFun1, RecFun2, NumRecArgs);
+same_ret_type(_, _) ->
+ false.
+
+%% TODO: Is this too strict?
+-spec same_rec_arg(rec_arg(), rec_arg(), arity()) -> boolean().
+same_rec_arg({{list,SameBool,AltRecFun1},FTRef1},
+ {{list,SameBool,AltRecFun2},FTRef2}, NumRecArgs) ->
+ same_rec_fun(AltRecFun1, AltRecFun2, NumRecArgs)
+ andalso same_full_type_ref(FTRef1, FTRef2);
+same_rec_arg({true,FTRef1}, {true,FTRef2}, _NumRecArgs) ->
+ same_full_type_ref(FTRef1, FTRef2);
+same_rec_arg({false,FTRef1}, {false,FTRef2}, _NumRecArgs) ->
+ same_full_type_ref(FTRef1, FTRef2);
+same_rec_arg(_, _, _NumRecArgs) ->
+ false.
+
+-spec same_substs_dict(substs_dict(), substs_dict()) -> boolean().
+same_substs_dict(SubstsDict1, SubstsDict2) ->
+ SameKVPair = fun({{_K,V1},{_K,V2}}) -> same_ret_type(V1,V2);
+ (_) -> false
+ end,
+ SubstsKVList1 = lists:sort(dict:to_list(SubstsDict1)),
+ SubstsKVList2 = lists:sort(dict:to_list(SubstsDict2)),
+ length(SubstsKVList1) =:= length(SubstsKVList2)
+ andalso lists:all(SameKVPair, lists:zip(SubstsKVList1,SubstsKVList2)).
+
+-spec same_fin_type(fin_type(), fin_type()) -> boolean().
+same_fin_type(Type1, Type2) ->
+ proper_types:equal_types(Type1, Type2).
+
+-spec same_rec_fun(rec_fun(), rec_fun(), arity()) -> boolean().
+same_rec_fun(RecFun1, RecFun2, NumRecArgs) ->
+ %% It's ok that we return a type, even if there's a 'true' for use of
+ %% an instance.
+ GenFun = fun(_Size) -> proper_types:exactly('$dummy') end,
+ GenFuns = lists:duplicate(NumRecArgs,GenFun),
+ same_fin_type(RecFun1(GenFuns,0), RecFun2(GenFuns,0)).
diff --git a/lib/dialyzer/test/dialyzer_SUITE.erl b/lib/dialyzer/test/dialyzer_SUITE.erl
index 8a2324a7c2..d46181f66f 100644
--- a/lib/dialyzer/test/dialyzer_SUITE.erl
+++ b/lib/dialyzer/test/dialyzer_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2015. All Rights Reserved.
+%% Copyright Ericsson AB 2015-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/dialyzer/test/map_SUITE_data/dialyzer_options b/lib/dialyzer/test/map_SUITE_data/dialyzer_options
new file mode 100644
index 0000000000..50991c9bc5
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/dialyzer_options
@@ -0,0 +1 @@
+{dialyzer_options, []}.
diff --git a/lib/dialyzer/test/map_SUITE_data/results/bad_argument b/lib/dialyzer/test/map_SUITE_data/results/bad_argument
new file mode 100644
index 0000000000..af61a89638
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/bad_argument
@@ -0,0 +1,5 @@
+
+bad_argument.erl:14: Function t3/0 has no local return
+bad_argument.erl:15: Guard test is_map('not_a_map') can never succeed
+bad_argument.erl:5: Function t/0 has no local return
+bad_argument.erl:6: A key of type 'b' cannot exist in a map of type #{'a':='q'}
diff --git a/lib/dialyzer/test/map_SUITE_data/results/contract b/lib/dialyzer/test/map_SUITE_data/results/contract
new file mode 100644
index 0000000000..0f6e1d0c65
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/contract
@@ -0,0 +1,7 @@
+
+contract.erl:10: Function t2/0 has no local return
+contract.erl:10: The call missing:f(#{'a':=1, 'c':=4}) breaks the contract (#{'a':=1,'b'=>2,'c'=>3}) -> 'ok'
+contract.erl:12: Function t3/0 has no local return
+contract.erl:12: The call missing:f(#{'a':=1, 'b':=2, 'e':=3}) breaks the contract (#{'a':=1,'b'=>2,'c'=>3}) -> 'ok'
+contract.erl:8: Function t1/0 has no local return
+contract.erl:8: The call missing:f(#{'b':=2}) breaks the contract (#{'a':=1,'b'=>2,'c'=>3}) -> 'ok'
diff --git a/lib/dialyzer/test/map_SUITE_data/results/contract_violation b/lib/dialyzer/test/map_SUITE_data/results/contract_violation
new file mode 100644
index 0000000000..958321618f
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/contract_violation
@@ -0,0 +1,3 @@
+
+contract_violation.erl:12: The pattern #{I:=Loc} can never match the type #{}
+contract_violation.erl:16: Invalid type specification for function contract_violation:beam_disasm_lines/2. The success typing is ('none' | <<_:32,_:_*8>>,_) -> #{pos_integer()=>{'location',_,_}}
diff --git a/lib/dialyzer/test/map_SUITE_data/results/exact b/lib/dialyzer/test/map_SUITE_data/results/exact
new file mode 100644
index 0000000000..374ada8869
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/exact
@@ -0,0 +1,3 @@
+
+exact.erl:15: Function t2/1 has no local return
+exact.erl:19: The variable _ can never match since previous clauses completely covered the type #{'a':=_, ...}
diff --git a/lib/dialyzer/test/map_SUITE_data/results/guard_update b/lib/dialyzer/test/map_SUITE_data/results/guard_update
new file mode 100644
index 0000000000..e4bc892195
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/guard_update
@@ -0,0 +1,5 @@
+
+guard_update.erl:5: Function t/0 has no local return
+guard_update.erl:6: The call guard_update:f(#{'a':=2}) will never return since it differs in the 1st argument from the success typing arguments: (#{'b':=_, ...})
+guard_update.erl:8: Clause guard cannot succeed. The variable M was matched against the type #{'a':=2}
+guard_update.erl:8: Function f/1 has no local return
diff --git a/lib/dialyzer/test/map_SUITE_data/results/initial_dataflow b/lib/dialyzer/test/map_SUITE_data/results/initial_dataflow
new file mode 100644
index 0000000000..69144f9208
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/initial_dataflow
@@ -0,0 +1,4 @@
+
+initial_dataflow.erl:11: The variable Q can never match since previous clauses completely covered the type #{}
+initial_dataflow.erl:5: Function test/0 has no local return
+initial_dataflow.erl:6: The pattern 'false' can never match the type 'true'
diff --git a/lib/dialyzer/test/map_SUITE_data/results/is_map_guard b/lib/dialyzer/test/map_SUITE_data/results/is_map_guard
new file mode 100644
index 0000000000..6ab464d865
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/is_map_guard
@@ -0,0 +1,5 @@
+
+is_map_guard.erl:13: Function t2/0 has no local return
+is_map_guard.erl:15: The call is_map_guard:explicit('still_not_map') will never return since it differs in the 1st argument from the success typing arguments: (map())
+is_map_guard.erl:6: Function t1/0 has no local return
+is_map_guard.erl:8: The call is_map_guard:implicit('not_a_map') will never return since it differs in the 1st argument from the success typing arguments: (map())
diff --git a/lib/dialyzer/test/map_SUITE_data/results/map_galore b/lib/dialyzer/test/map_SUITE_data/results/map_galore
new file mode 100644
index 0000000000..6ea88f01f8
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/map_galore
@@ -0,0 +1,28 @@
+
+map_galore.erl:1000: A key of type 42 cannot exist in a map of type #{1:='a', 2:='b', 4:='d', 5:='e', float()=>'c' | 'v'}
+map_galore.erl:1080: A key of type 'nonexisting' cannot exist in a map of type #{#{'map':='key', 'one':='small'}:=[32 | 49 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], #{'map':='key', 'second':='small'}:=[32 | 50 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], #{'map':='key', 'third':='small'}:=[32 | 51 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], 10:='a0', 11:='a1', 12:='a2', 13:='a3', 14:='a4', 15:='a5', 16:='a6', 17:='a7', 18:='a8', 19:='a9', 20:='b0', 21:='b1', 22:='b2', 23:='b3', 24:='b4', 25:='b5', 26:='b6', 27:='b7', 28:='b8', 29:='b9', 30:=[48 | 99,...], 31:=[49 | 99,...], 32:=[50 | 99,...], 33:=[51 | 99,...], 34:=[52 | 99,...], 35:=[53 | 99,...], 36:=[54 | 99,...], 37:=[55 | 99,...], 38:=[56 | 99,...], 39:=[57 | 99,...], <<_:16>> | [48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...] | float() | {[[48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...],...]} | #{10:='a0', 11:='a1', 12:='a2', 13:='a3', 14:='a4', 15:='a5', 17:='a7', 18:='a8', 19:='a9', 20:='b0', 21:='b1', 22:='b2', 23:='b3', 24:='b4', 25:='b5', 27:='b7', 28:='b8', 29:='b9', 30:=[48 | 99,...], 31:=[49 | 99,...], 32:=[50 | 99,...], 33:=[51 | 99,...], 34:=[52 | 99,...], 35:=[53 | 99,...], 37:=[55 | 99,...], 38:=[56 | 99,...], 39:=[57 | 99,...], 'k16'=>'a6', 'k26'=>'b6', 'k36'=>[54 | 99,...], 16=>'a6', 26=>'b6', 36=>[54 | 99,...], <<_:16>> | [48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...] | {[[48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...],...]}=>[48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 100 | 101,...]}=>atom() | [1..255,...]}
+map_galore.erl:1082: A key of type 42 cannot exist in a map of type #{#{'map':='key', 'one':='small'}:=[32 | 49 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], #{'map':='key', 'second':='small'}:=[32 | 50 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], #{'map':='key', 'third':='small'}:=[32 | 51 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], 10:='a0', 11:='a1', 12:='a2', 13:='a3', 14:='a4', 15:='a5', 16:='a6', 17:='a7', 18:='a8', 19:='a9', 20:='b0', 21:='b1', 22:='b2', 23:='b3', 24:='b4', 25:='b5', 26:='b6', 27:='b7', 28:='b8', 29:='b9', 30:=[48 | 99,...], 31:=[49 | 99,...], 32:=[50 | 99,...], 33:=[51 | 99,...], 34:=[52 | 99,...], 35:=[53 | 99,...], 36:=[54 | 99,...], 37:=[55 | 99,...], 38:=[56 | 99,...], 39:=[57 | 99,...], <<_:16>> | [48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...] | float() | {[[48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...],...]} | #{10:='a0', 11:='a1', 12:='a2', 13:='a3', 14:='a4', 15:='a5', 17:='a7', 18:='a8', 19:='a9', 20:='b0', 21:='b1', 22:='b2', 23:='b3', 24:='b4', 25:='b5', 27:='b7', 28:='b8', 29:='b9', 30:=[48 | 99,...], 31:=[49 | 99,...], 32:=[50 | 99,...], 33:=[51 | 99,...], 34:=[52 | 99,...], 35:=[53 | 99,...], 37:=[55 | 99,...], 38:=[56 | 99,...], 39:=[57 | 99,...], 'k16'=>'a6', 'k26'=>'b6', 'k36'=>[54 | 99,...], 16=>'a6', 26=>'b6', 36=>[54 | 99,...], <<_:16>> | [48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...] | {[[48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...],...]}=>[48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 100 | 101,...]}=>atom() | [1..255,...]}
+map_galore.erl:1140: The call map_galore:map_guard_sequence_1(#{'seq':=6, 'val':=[101,...]}) will never return since it differs in the 1st argument from the success typing arguments: (#{'seq':=1 | 2 | 3 | 4 | 5, 'val':=[97 | 98 | 99 | 100 | 101,...], #{'map':='key', 'one':='small'}=>[32 | 49 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], #{'map':='key', 'second':='small'}=>[32 | 50 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], #{'map':='key', 'third':='small'}=>[32 | 51 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], 10=>'a0', 11=>'a1', 12=>'a2', 13=>'a3', 14=>'a4', 15=>'a5', 16=>'a6', 17=>'a7', 18=>'a8', 19=>'a9', 20=>'b0', 21=>'b1', 22=>'b2', 23=>'b3', 24=>'b4', 25=>'b5', 26=>'b6', 27=>'b7', 28=>'b8', 29=>'b9', 30=>[48 | 99,...], 31=>[49 | 99,...], 32=>[50 | 99,...], 33=>[51 | 99,...], 34=>[52 | 99,...], 35=>[53 | 99,...], 36=>[54 | 99,...], 37=>[55 | 99,...], 38=>[56 | 99,...], 39=>[57 | 99,...], <<_:16>> | [48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...] | float() | {[any(),...]} | #{10:='a0', 11:='a1', 12:='a2', 13:='a3', 14:='a4', 15:='a5', 17:='a7', 18:='a8', 19:='a9', 20:='b0', 21:='b1', 22:='b2', 23:='b3', 24:='b4', 25:='b5', 27:='b7', 28:='b8', 29:='b9', 30:=[any(),...], 31:=[any(),...], 32:=[any(),...], 33:=[any(),...], 34:=[any(),...], 35:=[any(),...], 37:=[any(),...], 38:=[any(),...], 39:=[any(),...], 'k16'=>'a6', 'k26'=>'b6', 'k36'=>[any(),...], 16=>'a6', 26=>'b6', 36=>[any(),...], <<_:16>> | [any(),...] | {_}=>[any(),...]}=>atom() | [1..255,...]})
+map_galore.erl:1141: The call map_galore:map_guard_sequence_2(#{'b':=5}) will never return since it differs in the 1st argument from the success typing arguments: (#{'a':='gg' | 'kk' | 'sc' | 3 | 4, 'b'=>'other' | 3 | 4 | 5, 'c'=>'sc2', #{'map':='key', 'one':='small'}=>[32 | 49 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], #{'map':='key', 'second':='small'}=>[32 | 50 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], #{'map':='key', 'third':='small'}=>[32 | 51 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], 10=>'a0', 11=>'a1', 12=>'a2', 13=>'a3', 14=>'a4', 15=>'a5', 16=>'a6', 17=>'a7', 18=>'a8', 19=>'a9', 20=>'b0', 21=>'b1', 22=>'b2', 23=>'b3', 24=>'b4', 25=>'b5', 26=>'b6', 27=>'b7', 28=>'b8', 29=>'b9', 30=>[48 | 99,...], 31=>[49 | 99,...], 32=>[50 | 99,...], 33=>[51 | 99,...], 34=>[52 | 99,...], 35=>[53 | 99,...], 36=>[54 | 99,...], 37=>[55 | 99,...], 38=>[56 | 99,...], 39=>[57 | 99,...], <<_:16>> | [48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...] | float() | {[any(),...]} | #{10:='a0', 11:='a1', 12:='a2', 13:='a3', 14:='a4', 15:='a5', 17:='a7', 18:='a8', 19:='a9', 20:='b0', 21:='b1', 22:='b2', 23:='b3', 24:='b4', 25:='b5', 27:='b7', 28:='b8', 29:='b9', 30:=[any(),...], 31:=[any(),...], 32:=[any(),...], 33:=[any(),...], 34:=[any(),...], 35:=[any(),...], 37:=[any(),...], 38:=[any(),...], 39:=[any(),...], 'k16'=>'a6', 'k26'=>'b6', 'k36'=>[any(),...], 16=>'a6', 26=>'b6', 36=>[any(),...], <<_:16>> | [any(),...] | {_}=>[any(),...]}=>atom() | [1..255,...]})
+map_galore.erl:1209: The call map_galore:map_guard_sequence_1(#{'seq':=6, 'val':=[101,...], #{'map':='key', 'one':='small'}:=[32 | 49 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], #{'map':='key', 'second':='small'}:=[32 | 50 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], #{'map':='key', 'third':='small'}:=[32 | 51 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], 10:='a0', 11:='a1', 12:='a2', 13:='a3', 14:='a4', 15:='a5', 16:='a6', 17:='a7', 18:='a8', 19:='a9', 20:='b0', 21:='b1', 22:='b2', 23:='b3', 24:='b4', 25:='b5', 26:='b6', 27:='b7', 28:='b8', 29:='b9', 30:=[48 | 99,...], 31:=[49 | 99,...], 32:=[50 | 99,...], 33:=[51 | 99,...], 34:=[52 | 99,...], 35:=[53 | 99,...], 36:=[54 | 99,...], 37:=[55 | 99,...], 38:=[56 | 99,...], 39:=[57 | 99,...], <<_:16>> | [48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...] | float() | {[[48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...] | 3,...]} | #{10:='a0', 11:='a1', 12:='a2', 13:='a3', 14:='a4', 15:='a5', 17:='a7', 18:='a8', 19:='a9', 20:='b0', 21:='b1', 22:='b2', 23:='b3', 24:='b4', 25:='b5', 27:='b7', 28:='b8', 29:='b9', 30:=[48 | 99,...], 31:=[49 | 99,...], 32:=[50 | 99,...], 33:=[51 | 99,...], 34:=[52 | 99,...], 35:=[53 | 99,...], 37:=[55 | 99,...], 38:=[56 | 99,...], 39:=[57 | 99,...], 'k16'=>'a6', 'k26'=>'b6', 'k36'=>[54 | 99,...], 16=>'a6', 26=>'b6', 36=>[54 | 99,...], <<_:16>> | [48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...] | {[[48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...],...]}=>[48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 100 | 101,...]}=>atom() | [1..255,...]}) will never return since it differs in the 1st argument from the success typing arguments: (#{'seq':=1 | 2 | 3 | 4 | 5, 'val':=[97 | 98 | 99 | 100 | 101,...], #{'map':='key', 'one':='small'}=>[32 | 49 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], #{'map':='key', 'second':='small'}=>[32 | 50 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], #{'map':='key', 'third':='small'}=>[32 | 51 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], 10=>'a0', 11=>'a1', 12=>'a2', 13=>'a3', 14=>'a4', 15=>'a5', 16=>'a6', 17=>'a7', 18=>'a8', 19=>'a9', 20=>'b0', 21=>'b1', 22=>'b2', 23=>'b3', 24=>'b4', 25=>'b5', 26=>'b6', 27=>'b7', 28=>'b8', 29=>'b9', 30=>[48 | 99,...], 31=>[49 | 99,...], 32=>[50 | 99,...], 33=>[51 | 99,...], 34=>[52 | 99,...], 35=>[53 | 99,...], 36=>[54 | 99,...], 37=>[55 | 99,...], 38=>[56 | 99,...], 39=>[57 | 99,...], <<_:16>> | [48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...] | float() | {[any(),...]} | #{10:='a0', 11:='a1', 12:='a2', 13:='a3', 14:='a4', 15:='a5', 17:='a7', 18:='a8', 19:='a9', 20:='b0', 21:='b1', 22:='b2', 23:='b3', 24:='b4', 25:='b5', 27:='b7', 28:='b8', 29:='b9', 30:=[any(),...], 31:=[any(),...], 32:=[any(),...], 33:=[any(),...], 34:=[any(),...], 35:=[any(),...], 37:=[any(),...], 38:=[any(),...], 39:=[any(),...], 'k16'=>'a6', 'k26'=>'b6', 'k36'=>[any(),...], 16=>'a6', 26=>'b6', 36=>[any(),...], <<_:16>> | [any(),...] | {_}=>[any(),...]}=>atom() | [1..255,...]})
+map_galore.erl:1210: The call map_galore:map_guard_sequence_2(#{'b':=5, #{'map':='key', 'one':='small'}:=[32 | 49 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], #{'map':='key', 'second':='small'}:=[32 | 50 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], #{'map':='key', 'third':='small'}:=[32 | 51 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], 10:='a0', 11:='a1', 12:='a2', 13:='a3', 14:='a4', 15:='a5', 16:='a6', 17:='a7', 18:='a8', 19:='a9', 20:='b0', 21:='b1', 22:='b2', 23:='b3', 24:='b4', 25:='b5', 26:='b6', 27:='b7', 28:='b8', 29:='b9', 30:=[48 | 99,...], 31:=[49 | 99,...], 32:=[50 | 99,...], 33:=[51 | 99,...], 34:=[52 | 99,...], 35:=[53 | 99,...], 36:=[54 | 99,...], 37:=[55 | 99,...], 38:=[56 | 99,...], 39:=[57 | 99,...], <<_:16>> | [48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...] | float() | {[[48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...] | 3,...]} | #{10:='a0', 11:='a1', 12:='a2', 13:='a3', 14:='a4', 15:='a5', 17:='a7', 18:='a8', 19:='a9', 20:='b0', 21:='b1', 22:='b2', 23:='b3', 24:='b4', 25:='b5', 27:='b7', 28:='b8', 29:='b9', 30:=[48 | 99,...], 31:=[49 | 99,...], 32:=[50 | 99,...], 33:=[51 | 99,...], 34:=[52 | 99,...], 35:=[53 | 99,...], 37:=[55 | 99,...], 38:=[56 | 99,...], 39:=[57 | 99,...], 'k16'=>'a6', 'k26'=>'b6', 'k36'=>[54 | 99,...], 16=>'a6', 26=>'b6', 36=>[54 | 99,...], <<_:16>> | [48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...] | {[[48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...],...]}=>[48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 100 | 101,...]}=>atom() | [1..255,...]}) will never return since it differs in the 1st argument from the success typing arguments: (#{'a':='gg' | 'kk' | 'sc' | 3 | 4, 'b'=>'other' | 3 | 4 | 5, 'c'=>'sc2', #{'map':='key', 'one':='small'}=>[32 | 49 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], #{'map':='key', 'second':='small'}=>[32 | 50 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], #{'map':='key', 'third':='small'}=>[32 | 51 | 97 | 101 | 107 | 108 | 109 | 112 | 115 | 121,...], 10=>'a0', 11=>'a1', 12=>'a2', 13=>'a3', 14=>'a4', 15=>'a5', 16=>'a6', 17=>'a7', 18=>'a8', 19=>'a9', 20=>'b0', 21=>'b1', 22=>'b2', 23=>'b3', 24=>'b4', 25=>'b5', 26=>'b6', 27=>'b7', 28=>'b8', 29=>'b9', 30=>[48 | 99,...], 31=>[49 | 99,...], 32=>[50 | 99,...], 33=>[51 | 99,...], 34=>[52 | 99,...], 35=>[53 | 99,...], 36=>[54 | 99,...], 37=>[55 | 99,...], 38=>[56 | 99,...], 39=>[57 | 99,...], <<_:16>> | [48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57,...] | float() | {[any(),...]} | #{10:='a0', 11:='a1', 12:='a2', 13:='a3', 14:='a4', 15:='a5', 17:='a7', 18:='a8', 19:='a9', 20:='b0', 21:='b1', 22:='b2', 23:='b3', 24:='b4', 25:='b5', 27:='b7', 28:='b8', 29:='b9', 30:=[any(),...], 31:=[any(),...], 32:=[any(),...], 33:=[any(),...], 34:=[any(),...], 35:=[any(),...], 37:=[any(),...], 38:=[any(),...], 39:=[any(),...], 'k16'=>'a6', 'k26'=>'b6', 'k36'=>[any(),...], 16=>'a6', 26=>'b6', 36=>[any(),...], <<_:16>> | [any(),...] | {_}=>[any(),...]}=>atom() | [1..255,...]})
+map_galore.erl:1418: Fun application with arguments (#{'s':='none', 'v':='none'}) will never return since it differs in the 1st argument from the success typing arguments: (#{'s':='l' | 't' | 'v', 'v':='none' | <<_:16>> | [<<_:16>>,...] | {<<_:16>>,<<_:16>>}})
+map_galore.erl:1491: The test #{} =:= #{'a':=1} can never evaluate to 'true'
+map_galore.erl:1492: The test #{'a':=1} =:= #{} can never evaluate to 'true'
+map_galore.erl:1495: The test #{'a':=1} =:= #{'a':=2} can never evaluate to 'true'
+map_galore.erl:1496: The test #{'a':=2} =:= #{'a':=1} can never evaluate to 'true'
+map_galore.erl:1497: The test #{'a':=2, 'b':=1} =:= #{'a':=1, 'b':=3} can never evaluate to 'true'
+map_galore.erl:1498: The test #{'a':=1, 'b':=1} =:= #{'a':=1, 'b':=3} can never evaluate to 'true'
+map_galore.erl:1762: The call maps:get({1, 1},#{{1,float()}=>[101 | 108 | 112 | 116 | 117,...]}) will never return since the success typing arguments are (any(),map())
+map_galore.erl:1763: The call maps:get('a',#{}) will never return since the success typing arguments are (any(),map())
+map_galore.erl:1765: The call maps:get('a',#{'b':=1, 'c':=2}) will never return since the success typing arguments are (any(),map())
+map_galore.erl:186: The pattern #{'x':=2} can never match the type #{'x':=3}
+map_galore.erl:187: The pattern #{'x':=3} can never match the type {'a','b','c'}
+map_galore.erl:188: The pattern #{'x':=3} can never match the type #{'y':=3}
+map_galore.erl:189: The pattern #{'x':=3} can never match the type #{'x':=[101 | 104 | 114 | 116,...]}
+map_galore.erl:2304: Cons will produce an improper list since its 2nd argument is {'b','a'}
+map_galore.erl:2304: The call maps:from_list(nonempty_improper_list({'a','b'},{'b','a'})) will never return since it differs in the 1st argument from the success typing arguments: ([{_,_}])
+map_galore.erl:2305: The call maps:from_list('a') will never return since it differs in the 1st argument from the success typing arguments: ([{_,_}])
+map_galore.erl:2306: The call maps:from_list(42) will never return since it differs in the 1st argument from the success typing arguments: ([{_,_}])
+map_galore.erl:997: A key of type 'nonexisting' cannot exist in a map of type #{}
+map_galore.erl:998: A key of type 'nonexisting' cannot exist in a map of type #{1:='a', 2:='b', 4:='d', 5:='e', float()=>'c'}
diff --git a/lib/dialyzer/test/map_SUITE_data/results/map_in_guard b/lib/dialyzer/test/map_SUITE_data/results/map_in_guard
new file mode 100644
index 0000000000..1015f76128
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/map_in_guard
@@ -0,0 +1,4 @@
+
+map_in_guard.erl:10: The call map_in_guard:assoc_update('not_a_map') will never return since it differs in the 1st argument from the success typing arguments: (#{})
+map_in_guard.erl:13: The call map_in_guard:assoc_guard_clause('not_a_map') will never return since it differs in the 1st argument from the success typing arguments: (#{})
+map_in_guard.erl:20: The call map_in_guard:exact_guard_clause(#{}) will never return since it differs in the 1st argument from the success typing arguments: (#{'a':='q'})
diff --git a/lib/dialyzer/test/map_SUITE_data/results/map_in_guard2 b/lib/dialyzer/test/map_SUITE_data/results/map_in_guard2
new file mode 100644
index 0000000000..6bc0c010d7
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/map_in_guard2
@@ -0,0 +1,13 @@
+
+map_in_guard2.erl:10: The call map_in_guard2:assoc_guard_clause('not_a_map') will never return since it differs in the 1st argument from the success typing arguments: (map())
+map_in_guard2.erl:12: The pattern 'true' can never match the type 'false'
+map_in_guard2.erl:14: The call map_in_guard2:exact_guard_clause(#{}) will never return since it differs in the 1st argument from the success typing arguments: (#{'a':=_, ...})
+map_in_guard2.erl:17: Clause guard cannot succeed. The variable M was matched against the type 'not_a_map'
+map_in_guard2.erl:20: Function assoc_update/1 has no local return
+map_in_guard2.erl:20: Guard test is_map(M::'not_a_map') can never succeed
+map_in_guard2.erl:22: Clause guard cannot succeed. The variable M was matched against the type 'not_a_map'
+map_in_guard2.erl:22: Function assoc_guard_clause/1 has no local return
+map_in_guard2.erl:24: Clause guard cannot succeed. The variable M was matched against the type #{}
+map_in_guard2.erl:27: Clause guard cannot succeed. The variable M was matched against the type #{}
+map_in_guard2.erl:27: Function exact_guard_clause/1 has no local return
+map_in_guard2.erl:8: The call map_in_guard2:assoc_update('not_a_map') will never return since it differs in the 1st argument from the success typing arguments: (map())
diff --git a/lib/dialyzer/test/map_SUITE_data/results/map_size b/lib/dialyzer/test/map_SUITE_data/results/map_size
new file mode 100644
index 0000000000..fc6c1f028c
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/map_size
@@ -0,0 +1,13 @@
+
+map_size.erl:11: The pattern 1 can never match the type 0
+map_size.erl:13: Function t2/0 has no local return
+map_size.erl:15: Function p/1 has no local return
+map_size.erl:15: Guard test 1 =:= 0 can never succeed
+map_size.erl:17: Function t3/0 has no local return
+map_size.erl:21: The pattern 4 can never match the type 1 | 2 | 3
+map_size.erl:23: Function t4/0 has no local return
+map_size.erl:24: The pattern 0 can never match the type 1 | 2 | 3
+map_size.erl:26: Function t5/1 has no local return
+map_size.erl:5: Function t1/0 has no local return
+map_size.erl:7: The pattern 1 can never match the type 0
+map_size.erl:9: Function e1/0 has no local return
diff --git a/lib/dialyzer/test/map_SUITE_data/results/maps_merge b/lib/dialyzer/test/map_SUITE_data/results/maps_merge
new file mode 100644
index 0000000000..0c347b4cdb
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/maps_merge
@@ -0,0 +1,11 @@
+
+maps_merge.erl:10: The pattern #{_:=_} can never match the type #{'a':=1, 3:='ok', 'q'=>none(), 7=>none(), atom() | integer()=>_}
+maps_merge.erl:12: Function t3/0 has no local return
+maps_merge.erl:14: The pattern #{7:='q'} can never match the type #{'a':=1, 3:='ok', 'q'=>none(), 7=>none(), atom() | integer()=>_}
+maps_merge.erl:16: Function t4/0 has no local return
+maps_merge.erl:18: The pattern #{7:='q'} can never match the type #{'a':=1, 3:='ok', 'q'=>none(), 7=>none(), atom() | integer()=>_}
+maps_merge.erl:20: Function t5/0 has no local return
+maps_merge.erl:21: The pattern #{'a':=2} can never match the type #{'a':=1, 'q'=>none(), 11=>_, atom()=>_}
+maps_merge.erl:5: Function t1/0 has no local return
+maps_merge.erl:6: The pattern #{'a':=1} can never match the type #{}
+maps_merge.erl:8: Function t2/0 has no local return
diff --git a/lib/dialyzer/test/map_SUITE_data/results/opaque_key b/lib/dialyzer/test/map_SUITE_data/results/opaque_key
new file mode 100644
index 0000000000..fb7080cdc5
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/opaque_key
@@ -0,0 +1,15 @@
+
+opaque_key_adt.erl:41: Invalid type specification for function opaque_key_adt:s4/0. The success typing is () -> #{1:='a'}
+opaque_key_adt.erl:44: Invalid type specification for function opaque_key_adt:s5/0. The success typing is () -> #{2:=3}
+opaque_key_adt.erl:56: Invalid type specification for function opaque_key_adt:smt1/0. The success typing is () -> #{3:='a'}
+opaque_key_adt.erl:59: Invalid type specification for function opaque_key_adt:smt2/0. The success typing is () -> #{1:='a'}
+opaque_key_use.erl:13: The test opaque_key_use:t() =:= opaque_key_use:t(integer()) can never evaluate to 'true'
+opaque_key_use.erl:24: Attempt to test for equality between a term of type opaque_key_adt:t(integer()) and a term of opaque type opaque_key_adt:t()
+opaque_key_use.erl:37: Function adt_mm1/0 has no local return
+opaque_key_use.erl:40: The attempt to match a term of type opaque_key_adt:m() against the pattern #{A:=R} breaks the opaqueness of the term
+opaque_key_use.erl:48: Function adt_mu1/0 has no local return
+opaque_key_use.erl:51: Guard test is_map(M::opaque_key_adt:m()) breaks the opaqueness of its argument
+opaque_key_use.erl:53: Function adt_mu2/0 has no local return
+opaque_key_use.erl:56: Guard test is_map(M::opaque_key_adt:m()) breaks the opaqueness of its argument
+opaque_key_use.erl:58: Function adt_mu3/0 has no local return
+opaque_key_use.erl:60: Guard test is_map(M::opaque_key_adt:m()) breaks the opaqueness of its argument
diff --git a/lib/dialyzer/test/map_SUITE_data/results/order b/lib/dialyzer/test/map_SUITE_data/results/order
new file mode 100644
index 0000000000..7be789a11a
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/order
@@ -0,0 +1,17 @@
+
+order.erl:12: Function t2/0 has no local return
+order.erl:14: Guard test is_integer(Int::'b') can never succeed
+order.erl:16: The variable _Else can never match since previous clauses completely covered the type 'b'
+order.erl:19: Function t3/0 has no local return
+order.erl:21: Guard test is_integer(Int::'b') can never succeed
+order.erl:23: The variable _Else can never match since previous clauses completely covered the type 'b'
+order.erl:30: The variable _Else can never match since previous clauses completely covered the type 'b' | 1
+order.erl:33: Function t5/0 has no local return
+order.erl:36: The variable Atom can never match since previous clauses completely covered the type 1
+order.erl:37: The variable _Else can never match since previous clauses completely covered the type 1
+order.erl:40: Function t6/0 has no local return
+order.erl:42: Guard test is_integer(Int::'b') can never succeed
+order.erl:44: The variable _Else can never match since previous clauses completely covered the type 'b'
+order.erl:5: Function t1/0 has no local return
+order.erl:7: Guard test is_integer(Int::'b') can never succeed
+order.erl:9: The variable _Else can never match since previous clauses completely covered the type 'b'
diff --git a/lib/dialyzer/test/map_SUITE_data/results/subtract_value_flip b/lib/dialyzer/test/map_SUITE_data/results/subtract_value_flip
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/subtract_value_flip
diff --git a/lib/dialyzer/test/map_SUITE_data/results/typeflow b/lib/dialyzer/test/map_SUITE_data/results/typeflow
new file mode 100644
index 0000000000..e3378a24bb
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/typeflow
@@ -0,0 +1,4 @@
+
+typeflow.erl:14: Function t2/1 has no local return
+typeflow.erl:16: The call lists:sort(integer()) will never return since it differs in the 1st argument from the success typing arguments: ([any()])
+typeflow.erl:9: The variable _ can never match since previous clauses completely covered the type #{'a':=integer(), ...}
diff --git a/lib/dialyzer/test/map_SUITE_data/results/typeflow2 b/lib/dialyzer/test/map_SUITE_data/results/typeflow2
new file mode 100644
index 0000000000..3adf638978
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/typeflow2
@@ -0,0 +1,13 @@
+
+typeflow2.erl:10: The pattern #{'a':=X} can never match the type #{'a'=>none(), _=>maybe_improper_list() | integer()}
+typeflow2.erl:11: The pattern #{'a':=X} can never match the type #{'a'=>none(), _=>maybe_improper_list() | integer()}
+typeflow2.erl:26: Function t2/1 has no local return
+typeflow2.erl:29: The call lists:sort(integer()) will never return since it differs in the 1st argument from the success typing arguments: ([any()])
+typeflow2.erl:42: The pattern #{'a':=X} can never match since previous clauses completely covered the type #{'a':=integer()}
+typeflow2.erl:43: The variable _ can never match since previous clauses completely covered the type #{'a':=integer()}
+typeflow2.erl:48: The pattern #{} can never match since previous clauses completely covered the type #{'a':=atom() | maybe_improper_list() | integer()}
+typeflow2.erl:58: The pattern #{'a':=X} can never match the type #{'a'=>none(), _=>maybe_improper_list() | integer()}
+typeflow2.erl:59: The pattern #{'a':=X} can never match the type #{'a'=>none(), _=>maybe_improper_list() | integer()}
+typeflow2.erl:60: The pattern #{'a':=X} can never match the type #{'a'=>none(), _=>maybe_improper_list() | integer()}
+typeflow2.erl:82: The pattern #{'a':=X} can never match the type #{}
+typeflow2.erl:83: The pattern #{'a':=X} can never match the type #{}
diff --git a/lib/dialyzer/test/map_SUITE_data/results/typesig b/lib/dialyzer/test/map_SUITE_data/results/typesig
new file mode 100644
index 0000000000..3049402860
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/results/typesig
@@ -0,0 +1,5 @@
+
+typesig.erl:5: Function t1/0 has no local return
+typesig.erl:5: The call typesig:test(#{'a':=1}) will never return since it differs in the 1st argument from the success typing arguments: (#{'a':={number()}, ...})
+typesig.erl:6: Function t2/0 has no local return
+typesig.erl:6: The call typesig:test(#{'a':={'b'}}) will never return since it differs in the 1st argument from the success typing arguments: (#{'a':={number()}, ...})
diff --git a/lib/dialyzer/test/map_SUITE_data/src/bad_argument.erl b/lib/dialyzer/test/map_SUITE_data/src/bad_argument.erl
new file mode 100644
index 0000000000..95e2b32ddc
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/bad_argument.erl
@@ -0,0 +1,19 @@
+-module(bad_argument).
+
+-export([t/0, t2/0, t3/0]).
+
+t() ->
+ _=(id1(#{a=>q}))#{b:=9}.
+
+t2() ->
+ _ = id2(4),
+ X = id2(3),
+ _ = (#{ X => q})#{3 := p},
+ X.
+
+t3() ->
+ (id3(not_a_map))#{a => b}.
+
+id1(X) -> X.
+id2(X) -> X.
+id3(X) -> X.
diff --git a/lib/dialyzer/test/map_SUITE_data/src/bug.erl b/lib/dialyzer/test/map_SUITE_data/src/bug.erl
new file mode 100644
index 0000000000..fc32f5641a
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/bug.erl
@@ -0,0 +1,63 @@
+-module(bug).
+
+-export([t1/0, f1/1
+ ,t2/0, f2/1
+ ,t3/0, f3/1
+ ,t4/0, f4/1
+ ,t5/0, f5/1
+ ]).
+
+t1() ->
+ V = f1(#{a=>b}),
+ case V of
+ #{a := Q} -> Q; %% Must not warn here
+ _ -> ok
+ end,
+ ok.
+
+f1(M) -> %% Should get map() succ typing
+ #{} = M.
+
+t2() ->
+ V = f2([#{a=>b}]),
+ case V of
+ [#{a := P}] -> P; %% Must not warn here
+ _ -> ok
+ end,
+ ok.
+
+f2(M) -> %% Should get [map(),...] succ typing
+ [#{}] = M.
+
+t3() ->
+ V = f3([#{a=>b},a]),
+ case V of
+ [#{a := P}, _Q] -> P; %% Must not warn here
+ _ -> ok
+ end,
+ ok.
+
+f3(M) -> %% Should get [map()|a,...] succ typing
+ [#{},a] = M.
+
+t4() ->
+ V = f4({#{a=>b},{}}),
+ case V of
+ {#{a := P},{}} -> P; %% Must not warn here
+ _ -> ok
+ end,
+ ok.
+
+f4(M) -> %% Should get {map(),{}} succ typing
+ {#{},{}} = M.
+
+t5() ->
+ V = f5(#{k=>q,a=>b}),
+ case V of
+ #{k := q, a := P} -> P; %% Must not warn here
+ _ -> ok
+ end,
+ ok.
+
+f5(M) -> %% Should get #{k:=q, ...} succ typing
+ #{k:=q} = M.
diff --git a/lib/dialyzer/test/map_SUITE_data/src/contract.erl b/lib/dialyzer/test/map_SUITE_data/src/contract.erl
new file mode 100644
index 0000000000..2b31be0d58
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/contract.erl
@@ -0,0 +1,14 @@
+-module(missing).
+
+-export([t1/0, t2/0, t3/0, t4/0]).
+
+-spec f(#{a := 1, b => 2, c => 3}) -> ok.
+f(_) -> ok.
+
+t1() -> f(#{b => 2}).
+
+t2() -> f(#{a => 1, c => 4}).
+
+t3() -> f(#{a => 1, b => 2, e => 3}).
+
+t4() -> f(#{a => 1, b => 2}).
diff --git a/lib/dialyzer/test/map_SUITE_data/src/contract_violation.erl b/lib/dialyzer/test/map_SUITE_data/src/contract_violation.erl
new file mode 100644
index 0000000000..850f2cad34
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/contract_violation.erl
@@ -0,0 +1,29 @@
+-module(contract_violation).
+
+-export([entry/1, beam_disasm_lines/2]).
+
+%%-----------------------------------------------------------------------
+
+-type lines() :: #{non_neg_integer() => {string(), non_neg_integer()}}.
+
+entry(Bin) ->
+ I = 42,
+ case beam_disasm_lines(Bin, ':-)') of
+ #{I := Loc} -> {good, Loc};
+ _ -> bad
+ end.
+
+-spec beam_disasm_lines(binary() | none, module()) -> lines().
+
+beam_disasm_lines(none, _) -> #{};
+beam_disasm_lines(<<NumLines:32, LineBin:NumLines/binary, FileBin/binary>>,
+ _Module) ->
+ Lines = binary_to_term(LineBin),
+ Files = binary_to_term(FileBin),
+ lines_collect_items(Lines, Files, #{}).
+
+lines_collect_items([], _, Acc) -> Acc;
+lines_collect_items([{FileNo, LineNo}|Rest], Files, Acc) ->
+ #{FileNo := File} = Files,
+ lines_collect_items(
+ Rest, Files, Acc#{map_size(Acc)+1 => {location, File, LineNo}}).
diff --git a/lib/dialyzer/test/map_SUITE_data/src/exact.erl b/lib/dialyzer/test/map_SUITE_data/src/exact.erl
new file mode 100644
index 0000000000..e5ad02ec54
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/exact.erl
@@ -0,0 +1,23 @@
+-module(exact).
+
+-export([t1/1, t2/1]).
+
+t1(M = #{}) ->
+ any_map(M),
+ case M of
+ #{a := _} -> error(fail);
+ _ -> ok
+ end.
+
+any_map(X) ->
+ X#{a => 1, a := 2}.
+
+t2(M = #{}) ->
+ has_a(M),
+ case M of
+ #{a := _} -> error(ok);
+ _ -> unreachable
+ end.
+
+has_a(M) ->
+ M#{a := 1, a => 2}.
diff --git a/lib/dialyzer/test/map_SUITE_data/src/guard_update.erl b/lib/dialyzer/test/map_SUITE_data/src/guard_update.erl
new file mode 100644
index 0000000000..19d0089401
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/guard_update.erl
@@ -0,0 +1,18 @@
+-module(guard_update).
+
+-export([t/0, t2/0]).
+
+t() ->
+ f(#{a=>2}). %% Illegal
+
+f(M)
+ when M#{b := 7} =/= q
+ -> ok.
+
+t2() ->
+ f2(#{a=>2}). %% Legal!
+
+f2(M)
+ when M#{b := 7} =/= q;
+ M =/= p
+ -> ok.
diff --git a/lib/dialyzer/test/map_SUITE_data/src/initial_dataflow.erl b/lib/dialyzer/test/map_SUITE_data/src/initial_dataflow.erl
new file mode 100644
index 0000000000..bbc0d5682a
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/initial_dataflow.erl
@@ -0,0 +1,11 @@
+-module(initial_dataflow).
+
+-export([test/0]).
+
+test() ->
+ false = assoc_guard(#{}),
+ true = assoc_guard(not_a_map),
+ ok.
+
+assoc_guard(#{}) -> true;
+assoc_guard(Q) -> false.
diff --git a/lib/dialyzer/test/map_SUITE_data/src/is_map_guard.erl b/lib/dialyzer/test/map_SUITE_data/src/is_map_guard.erl
new file mode 100644
index 0000000000..ceb4a8763a
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/is_map_guard.erl
@@ -0,0 +1,17 @@
+-module(is_map_guard).
+
+-export([t1/0, t2/0, implicit/1, explicit/1
+ ]).
+
+t1() ->
+ _ = implicit(#{}),
+ implicit(not_a_map).
+
+implicit(M) ->
+ M#{}.
+
+t2() ->
+ explicit(#{q=>d}),
+ explicit(still_not_map).
+
+explicit(M) when is_map(M) -> ok.
diff --git a/lib/dialyzer/test/map_SUITE_data/src/map_galore.erl b/lib/dialyzer/test/map_SUITE_data/src/map_galore.erl
new file mode 100644
index 0000000000..2611241379
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/map_galore.erl
@@ -0,0 +1,2824 @@
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2013. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+-module(map_galore).
+-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
+ init_per_group/2,end_per_group/2
+ ]).
+
+-export([
+ t_build_and_match_literals/1, t_build_and_match_literals_large/1,
+ t_update_literals/1, t_update_literals_large/1,
+ t_match_and_update_literals/1, t_match_and_update_literals_large/1,
+ t_update_map_expressions/1,
+ t_update_assoc/1, t_update_assoc_large/1,
+ t_update_exact/1, t_update_exact_large/1,
+ t_guard_bifs/1,
+ t_guard_sequence/1, t_guard_sequence_large/1,
+ t_guard_update/1, t_guard_update_large/1,
+ t_guard_receive/1, t_guard_receive_large/1,
+ t_guard_fun/1,
+ t_update_deep/1,
+ t_list_comprehension/1,
+ t_map_sort_literals/1,
+ t_map_equal/1,
+ t_map_compare/1,
+ t_map_size/1,
+ t_is_map/1,
+
+ %% Specific Map BIFs
+ t_bif_map_get/1,
+ t_bif_map_find/1,
+ t_bif_map_is_key/1,
+ t_bif_map_keys/1,
+ t_bif_map_merge/1,
+ t_bif_map_new/1,
+ t_bif_map_put/1,
+ t_bif_map_remove/1,
+ t_bif_map_update/1,
+ t_bif_map_values/1,
+ t_bif_map_to_list/1,
+ t_bif_map_from_list/1,
+
+ %% erlang
+ t_erlang_hash/1,
+ t_map_encode_decode/1,
+
+ %% non specific BIF related
+ t_bif_build_and_check/1,
+ t_bif_merge_and_check/1,
+
+ %% maps module not bifs
+ t_maps_fold/1,
+ t_maps_map/1,
+ t_maps_size/1,
+ t_maps_without/1,
+
+ %% misc
+ t_erts_internal_order/1,
+ t_erts_internal_hash/1,
+ t_pdict/1,
+ t_ets/1,
+ t_dets/1,
+ t_tracing/1,
+
+ %% instruction-level tests
+ t_has_map_fields/1,
+ y_regs/1
+ ]).
+
+-include_lib("stdlib/include/ms_transform.hrl").
+
+-define(CHECK(Cond,Term),
+ case (catch (Cond)) of
+ true -> true;
+ _ -> io:format("###### CHECK FAILED ######~nINPUT: ~p~n", [Term]),
+ exit(Term)
+ end).
+
+suite() -> [].
+
+all() -> [
+ t_build_and_match_literals, t_build_and_match_literals_large,
+ t_update_literals, t_update_literals_large,
+ t_match_and_update_literals, t_match_and_update_literals_large,
+ t_update_map_expressions,
+ t_update_assoc, t_update_assoc_large,
+ t_update_exact, t_update_exact_large,
+ t_guard_bifs,
+ t_guard_sequence, t_guard_sequence_large,
+ t_guard_update, t_guard_update_large,
+ t_guard_receive, t_guard_receive_large,
+ t_guard_fun, t_list_comprehension,
+ t_update_deep,
+ t_map_equal, t_map_compare,
+ t_map_sort_literals,
+
+ %% Specific Map BIFs
+ t_bif_map_get,t_bif_map_find,t_bif_map_is_key,
+ t_bif_map_keys, t_bif_map_merge, t_bif_map_new,
+ t_bif_map_put,
+ t_bif_map_remove, t_bif_map_update,
+ t_bif_map_values,
+ t_bif_map_to_list, t_bif_map_from_list,
+
+ %% erlang
+ t_erlang_hash, t_map_encode_decode,
+ t_map_size, t_is_map,
+
+ %% non specific BIF related
+ t_bif_build_and_check,
+ t_bif_merge_and_check,
+
+ %% maps module
+ t_maps_fold, t_maps_map,
+ t_maps_size, t_maps_without,
+
+
+ %% Other functions
+ t_erts_internal_order,
+ t_erts_internal_hash,
+ t_pdict,
+ t_ets,
+ t_tracing,
+
+ %% instruction-level tests
+ t_has_map_fields,
+ y_regs
+ ].
+
+groups() -> [].
+
+init_per_suite(Config) -> Config.
+end_per_suite(_Config) -> ok.
+
+init_per_group(_GroupName, Config) -> Config.
+end_per_group(_GroupName, Config) -> Config.
+
+%% tests
+
+t_build_and_match_literals(Config) when is_list(Config) ->
+ #{} = #{},
+ #{1:=a} = #{1=>a},
+ #{1:=a,2:=b} = #{1=>a,2=>b},
+ #{1:=a,2:=b,3:="c"} = #{1=>a,2=>b,3=>"c"},
+ #{1:=a,2:=b,3:="c","4":="d"} = #{1=>a,2=>b,3=>"c","4"=>"d"},
+ #{1:=a,2:=b,3:="c","4":="d",<<"5">>:=<<"e">>} =
+ #{1=>a,2=>b,3=>"c","4"=>"d",<<"5">>=><<"e">>},
+ #{1:=a,2:=b,3:="c","4":="d",<<"5">>:=<<"e">>,{"6",7}:="f"} =
+ #{1=>a,2=>b,3=>"c","4"=>"d",<<"5">>=><<"e">>,{"6",7}=>"f"},
+ #{1:=a,2:=b,3:="c","4":="d",<<"5">>:=<<"e">>,{"6",7}:="f",8:=g} =
+ #{1=>a,2=>b,3=>"c","4"=>"d",<<"5">>=><<"e">>,{"6",7}=>"f",8=>g},
+
+ #{[]:=a,42.0:=b,x:={x,y},[a,b]:=list} =
+ #{[]=>a,42.0=>b,x=>{x,y},[a,b]=>list},
+
+ #{<<"hi all">> := 1} = #{<<"hi",32,"all">> => 1},
+
+ #{a:=X,a:=X=3,b:=4} = #{a=>3,b=>4}, % weird but ok =)
+
+ #{ a:=#{ b:=#{c := third, b:=second}}, b:=first} =
+ #{ b=>first, a=>#{ b=>#{c => third, b=> second}}},
+
+ M = #{ map_1=>#{ map_2=>#{value_3 => third}, value_2=> second}, value_1=>first},
+ M = #{ map_1:=#{ map_2:=#{value_3 := third}, value_2:= second}, value_1:=first} =
+ #{ map_1=>#{ map_2=>#{value_3 => third}, value_2=> second}, value_1=>first},
+
+ %% error case
+ %V = 32,
+ %{'EXIT',{{badmatch,_},_}} = (catch (#{<<"hi all">> => 1} = #{<<"hi",V,"all">> => 1})),
+ {'EXIT',{{badmatch,_},_}} = (catch (#{x:=3,x:=2} = #{x=>3})),
+ {'EXIT',{{badmatch,_},_}} = (catch (#{x:=2} = #{x=>3})),
+ {'EXIT',{{badmatch,_},_}} = (catch (#{x:=3} = {a,b,c})),
+ {'EXIT',{{badmatch,_},_}} = (catch (#{x:=3} = #{y=>3})),
+ {'EXIT',{{badmatch,_},_}} = (catch (#{x:=3} = #{x=>"three"})),
+ ok.
+
+t_build_and_match_literals_large(Config) when is_list(Config) ->
+ % normal non-repeating
+ M0 = #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" },
+
+ #{10:=a0,20:=b0,30:="c0","40":="d0",<<"50">>:="e0",{["00"]}:="10"} = M0,
+ #{11:=a1,21:=b1,31:="c1","41":="d1",<<"51">>:="e1",{["01"]}:="11"} = M0,
+ #{12:=a2,22:=b2,32:="c2","42":="d2",<<"52">>:="e2",{["02"]}:="12"} = M0,
+ #{13:=a3,23:=b3,33:="c3","43":="d3",<<"53">>:="e3",{["03"]}:="13"} = M0,
+ #{14:=a4,24:=b4,34:="c4","44":="d4",<<"54">>:="e4",{["04"]}:="14"} = M0,
+
+ #{15:=a5,25:=b5,35:="c5","45":="d5",<<"55">>:="e5",{["05"]}:="15"} = M0,
+ #{16:=a6,26:=b6,36:="c6","46":="d6",<<"56">>:="e6",{["06"]}:="16"} = M0,
+ #{17:=a7,27:=b7,37:="c7","47":="d7",<<"57">>:="e7",{["07"]}:="17"} = M0,
+ #{18:=a8,28:=b8,38:="c8","48":="d8",<<"58">>:="e8",{["08"]}:="18"} = M0,
+ #{19:=a9,29:=b9,39:="c9","49":="d9",<<"59">>:="e9",{["09"]}:="19"} = M0,
+
+ 60 = map_size(M0),
+ 60 = maps:size(M0),
+
+ % with repeating
+ M1 = #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 10=>na0,20=>nb0,30=>"nc0","40"=>"nd0",<<"50">>=>"ne0",{["00"]}=>"n10",
+ 11=>na1,21=>nb1,31=>"nc1","41"=>"nd1",<<"51">>=>"ne1",{["01"]}=>"n11",
+ 12=>na2,22=>nb2,32=>"nc2","42"=>"nd2",<<"52">>=>"ne2",{["02"]}=>"n12",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+
+ 13=>na3,23=>nb3,33=>"nc3","43"=>"nd3",<<"53">>=>"ne3",{["03"]}=>"n13",
+ 14=>na4,24=>nb4,34=>"nc4","44"=>"nd4",<<"54">>=>"ne4",{["04"]}=>"n14",
+
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" },
+
+ #{10:=na0,20:=nb0,30:="nc0","40":="nd0",<<"50">>:="ne0",{["00"]}:="n10"} = M1,
+ #{11:=na1,21:=nb1,31:="nc1","41":="nd1",<<"51">>:="ne1",{["01"]}:="n11"} = M1,
+ #{12:=na2,22:=nb2,32:="nc2","42":="nd2",<<"52">>:="ne2",{["02"]}:="n12"} = M1,
+ #{13:=na3,23:=nb3,33:="nc3","43":="nd3",<<"53">>:="ne3",{["03"]}:="n13"} = M1,
+ #{14:=na4,24:=nb4,34:="nc4","44":="nd4",<<"54">>:="ne4",{["04"]}:="n14"} = M1,
+
+ #{15:=a5,25:=b5,35:="c5","45":="d5",<<"55">>:="e5",{["05"]}:="15"} = M1,
+ #{16:=a6,26:=b6,36:="c6","46":="d6",<<"56">>:="e6",{["06"]}:="16"} = M1,
+ #{17:=a7,27:=b7,37:="c7","47":="d7",<<"57">>:="e7",{["07"]}:="17"} = M1,
+ #{18:=a8,28:=b8,38:="c8","48":="d8",<<"58">>:="e8",{["08"]}:="18"} = M1,
+ #{19:=a9,29:=b9,39:="c9","49":="d9",<<"59">>:="e9",{["09"]}:="19"} = M1,
+
+ 60 = map_size(M1),
+ 60 = maps:size(M1),
+
+ % with floats
+
+ M2 = #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19",
+
+ 10.0=>fa0,20.0=>fb0,30.0=>"fc0",
+ 11.0=>fa1,21.0=>fb1,31.0=>"fc1",
+ 12.0=>fa2,22.0=>fb2,32.0=>"fc2",
+ 13.0=>fa3,23.0=>fb3,33.0=>"fc3",
+ 14.0=>fa4,24.0=>fb4,34.0=>"fc4",
+
+ 15.0=>fa5,25.0=>fb5,35.0=>"fc5",
+ 16.0=>fa6,26.0=>fb6,36.0=>"fc6",
+ 17.0=>fa7,27.0=>fb7,37.0=>"fc7",
+ 18.0=>fa8,28.0=>fb8,38.0=>"fc8",
+ 19.0=>fa9,29.0=>fb9,39.0=>"fc9"},
+
+ #{10:=a0,20:=b0,30:="c0","40":="d0",<<"50">>:="e0",{["00"]}:="10"} = M2,
+ #{11:=a1,21:=b1,31:="c1","41":="d1",<<"51">>:="e1",{["01"]}:="11"} = M2,
+ #{12:=a2,22:=b2,32:="c2","42":="d2",<<"52">>:="e2",{["02"]}:="12"} = M2,
+ #{13:=a3,23:=b3,33:="c3","43":="d3",<<"53">>:="e3",{["03"]}:="13"} = M2,
+ #{14:=a4,24:=b4,34:="c4","44":="d4",<<"54">>:="e4",{["04"]}:="14"} = M2,
+
+ #{15:=a5,25:=b5,35:="c5","45":="d5",<<"55">>:="e5",{["05"]}:="15"} = M2,
+ #{16:=a6,26:=b6,36:="c6","46":="d6",<<"56">>:="e6",{["06"]}:="16"} = M2,
+ #{17:=a7,27:=b7,37:="c7","47":="d7",<<"57">>:="e7",{["07"]}:="17"} = M2,
+ #{18:=a8,28:=b8,38:="c8","48":="d8",<<"58">>:="e8",{["08"]}:="18"} = M2,
+ #{19:=a9,29:=b9,39:="c9","49":="d9",<<"59">>:="e9",{["09"]}:="19"} = M2,
+
+ #{10.0:=fa0,20.0:=fb0,30.0:="fc0","40":="d0",<<"50">>:="e0",{["00"]}:="10"} = M2,
+ #{11.0:=fa1,21.0:=fb1,31.0:="fc1","41":="d1",<<"51">>:="e1",{["01"]}:="11"} = M2,
+ #{12.0:=fa2,22.0:=fb2,32.0:="fc2","42":="d2",<<"52">>:="e2",{["02"]}:="12"} = M2,
+ #{13.0:=fa3,23.0:=fb3,33.0:="fc3","43":="d3",<<"53">>:="e3",{["03"]}:="13"} = M2,
+ #{14.0:=fa4,24.0:=fb4,34.0:="fc4","44":="d4",<<"54">>:="e4",{["04"]}:="14"} = M2,
+
+ #{15.0:=fa5,25.0:=fb5,35.0:="fc5","45":="d5",<<"55">>:="e5",{["05"]}:="15"} = M2,
+ #{16.0:=fa6,26.0:=fb6,36.0:="fc6","46":="d6",<<"56">>:="e6",{["06"]}:="16"} = M2,
+ #{17.0:=fa7,27.0:=fb7,37.0:="fc7","47":="d7",<<"57">>:="e7",{["07"]}:="17"} = M2,
+ #{18.0:=fa8,28.0:=fb8,38.0:="fc8","48":="d8",<<"58">>:="e8",{["08"]}:="18"} = M2,
+ #{19.0:=fa9,29.0:=fb9,39.0:="fc9","49":="d9",<<"59">>:="e9",{["09"]}:="19"} = M2,
+
+ 90 = map_size(M2),
+ 90 = maps:size(M2),
+
+ % with bignums
+ M3 = #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19",
+
+ 10.0=>fa0,20.0=>fb0,30.0=>"fc0",
+ 11.0=>fa1,21.0=>fb1,31.0=>"fc1",
+ 12.0=>fa2,22.0=>fb2,32.0=>"fc2",
+ 13.0=>fa3,23.0=>fb3,33.0=>"fc3",
+ 14.0=>fa4,24.0=>fb4,34.0=>"fc4",
+
+ 15.0=>fa5,25.0=>fb5,35.0=>"fc5",
+ 16.0=>fa6,26.0=>fb6,36.0=>"fc6",
+ 17.0=>fa7,27.0=>fb7,37.0=>"fc7",
+ 18.0=>fa8,28.0=>fb8,38.0=>"fc8",
+ 19.0=>fa9,29.0=>fb9,39.0=>"fc9",
+
+ 36893488147419103232=>big1, 73786976294838206464=>big2,
+ 147573952589676412928=>big3, 18446744073709551616=>big4,
+ 4294967296=>big5, 8589934592=>big6,
+ 4294967295=>big7, 67108863=>big8
+ },
+
+ #{10:=a0,20:=b0,30:="c0","40":="d0",<<"50">>:="e0",{["00"]}:="10"} = M3,
+ #{11:=a1,21:=b1,31:="c1","41":="d1",<<"51">>:="e1",{["01"]}:="11"} = M3,
+ #{12:=a2,22:=b2,32:="c2","42":="d2",<<"52">>:="e2",{["02"]}:="12"} = M3,
+ #{13:=a3,23:=b3,33:="c3","43":="d3",<<"53">>:="e3",{["03"]}:="13"} = M3,
+ #{14:=a4,24:=b4,34:="c4","44":="d4",<<"54">>:="e4",{["04"]}:="14"} = M3,
+
+ #{15:=a5,25:=b5,35:="c5","45":="d5",<<"55">>:="e5",{["05"]}:="15"} = M3,
+ #{16:=a6,26:=b6,36:="c6","46":="d6",<<"56">>:="e6",{["06"]}:="16"} = M3,
+ #{17:=a7,27:=b7,37:="c7","47":="d7",<<"57">>:="e7",{["07"]}:="17"} = M3,
+ #{18:=a8,28:=b8,38:="c8","48":="d8",<<"58">>:="e8",{["08"]}:="18"} = M3,
+ #{19:=a9,29:=b9,39:="c9","49":="d9",<<"59">>:="e9",{["09"]}:="19"} = M3,
+
+ #{10.0:=fa0,20.0:=fb0,30.0:="fc0","40":="d0",<<"50">>:="e0",{["00"]}:="10"} = M3,
+ #{11.0:=fa1,21.0:=fb1,31.0:="fc1","41":="d1",<<"51">>:="e1",{["01"]}:="11"} = M3,
+ #{12.0:=fa2,22.0:=fb2,32.0:="fc2","42":="d2",<<"52">>:="e2",{["02"]}:="12"} = M3,
+ #{13.0:=fa3,23.0:=fb3,33.0:="fc3","43":="d3",<<"53">>:="e3",{["03"]}:="13"} = M3,
+ #{14.0:=fa4,24.0:=fb4,34.0:="fc4","44":="d4",<<"54">>:="e4",{["04"]}:="14"} = M3,
+
+ #{15.0:=fa5,25.0:=fb5,35.0:="fc5","45":="d5",<<"55">>:="e5",{["05"]}:="15"} = M3,
+ #{16.0:=fa6,26.0:=fb6,36.0:="fc6","46":="d6",<<"56">>:="e6",{["06"]}:="16"} = M3,
+ #{17.0:=fa7,27.0:=fb7,37.0:="fc7","47":="d7",<<"57">>:="e7",{["07"]}:="17"} = M3,
+ #{18.0:=fa8,28.0:=fb8,38.0:="fc8","48":="d8",<<"58">>:="e8",{["08"]}:="18"} = M3,
+ #{19.0:=fa9,29.0:=fb9,39.0:="fc9","49":="d9",<<"59">>:="e9",{["09"]}:="19"} = M3,
+
+ #{36893488147419103232:=big1,67108863:=big8,"45":="d5",<<"55">>:="e5",{["05"]}:="15"} = M3,
+ #{147573952589676412928:=big3,8589934592:=big6,"46":="d6",<<"56">>:="e6",{["06"]}:="16"} = M3,
+ #{4294967296:=big5,18446744073709551616:=big4,"47":="d7",<<"57">>:="e7",{["07"]}:="17"} = M3,
+ #{4294967295:=big7,73786976294838206464:=big2,"48":="d8",<<"58">>:="e8",{["08"]}:="18"} = M3,
+
+ 98 = map_size(M3),
+ 98 = maps:size(M3),
+
+ %% with maps
+
+ M4 = #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19",
+
+ 10.0=>fa0,20.0=>fb0,30.0=>"fc0",
+ 11.0=>fa1,21.0=>fb1,31.0=>"fc1",
+ 12.0=>fa2,22.0=>fb2,32.0=>"fc2",
+ 13.0=>fa3,23.0=>fb3,33.0=>"fc3",
+ 14.0=>fa4,24.0=>fb4,34.0=>"fc4",
+
+ 15.0=>fa5,25.0=>fb5,35.0=>"fc5",
+ 16.0=>fa6,26.0=>fb6,36.0=>"fc6",
+ 17.0=>fa7,27.0=>fb7,37.0=>"fc7",
+ 18.0=>fa8,28.0=>fb8,38.0=>"fc8",
+ 19.0=>fa9,29.0=>fb9,39.0=>"fc9",
+
+ #{ one => small, map => key } => "small map key 1",
+ #{ second => small, map => key } => "small map key 2",
+ #{ third => small, map => key } => "small map key 3",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } => "large map key 1",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ k16=>a6,k26=>b6,k36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } => "large map key 2" },
+
+ #{10:=a0,20:=b0,30:="c0","40":="d0",<<"50">>:="e0",{["00"]}:="10"} = M4,
+ #{11:=a1,21:=b1,31:="c1","41":="d1",<<"51">>:="e1",{["01"]}:="11"} = M4,
+ #{12:=a2,22:=b2,32:="c2","42":="d2",<<"52">>:="e2",{["02"]}:="12"} = M4,
+ #{13:=a3,23:=b3,33:="c3","43":="d3",<<"53">>:="e3",{["03"]}:="13"} = M4,
+ #{14:=a4,24:=b4,34:="c4","44":="d4",<<"54">>:="e4",{["04"]}:="14"} = M4,
+
+ #{15:=a5,25:=b5,35:="c5","45":="d5",<<"55">>:="e5",{["05"]}:="15"} = M4,
+ #{16:=a6,26:=b6,36:="c6","46":="d6",<<"56">>:="e6",{["06"]}:="16"} = M4,
+ #{17:=a7,27:=b7,37:="c7","47":="d7",<<"57">>:="e7",{["07"]}:="17"} = M4,
+ #{18:=a8,28:=b8,38:="c8","48":="d8",<<"58">>:="e8",{["08"]}:="18"} = M4,
+ #{19:=a9,29:=b9,39:="c9","49":="d9",<<"59">>:="e9",{["09"]}:="19"} = M4,
+
+ #{ #{ one => small, map => key } := "small map key 1",
+ #{ second => small, map => key } := "small map key 2",
+ #{ third => small, map => key } := "small map key 3" } = M4,
+
+ #{ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } := "large map key 1",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ k16=>a6,k26=>b6,k36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } := "large map key 2" } = M4,
+
+
+ #{ 15:=V1,25:=b5,35:=V2,"45":="d5",<<"55">>:=V3,{["05"]}:="15",
+ #{ one => small, map => key } := "small map key 1",
+ #{ second => small, map => key } := V4,
+ #{ third => small, map => key } := "small map key 3",
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } := V5 } = M4,
+
+ a5 = V1,
+ "c5" = V2,
+ "e5" = V3,
+ "small map key 2" = V4,
+ "large map key 1" = V5,
+
+ 95 = map_size(M4),
+ 95 = maps:size(M4),
+
+ % call for value
+
+ M5 = #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19",
+
+ 10.0=>fa0,20.0=>fb0,30.0=>"fc0",
+ 11.0=>fa1,21.0=>fb1,31.0=>"fc1",
+ 12.0=>fa2,22.0=>fb2,32.0=>"fc2",
+ 13.0=>fa3,23.0=>fb3,33.0=>"fc3",
+ 14.0=>fa4,24.0=>fb4,34.0=>"fc4",
+
+ 15.0=>fa5,25.0=>fb5,35.0=>"fc5",
+ 16.0=>fa6,26.0=>fb6,36.0=>"fc6",
+ 17.0=>fa7,27.0=>fb7,37.0=>"fc7",
+ 18.0=>fa8,28.0=>fb8,38.0=>"fc8",
+ 19.0=>fa9,29.0=>fb9,39.0=>"fc9",
+
+ #{ one => small, map => key } => "small map key 1",
+ #{ second => small, map => key } => "small map key 2",
+ #{ third => small, map => key } => "small map key 3",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } => "large map key 1",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ k16=>a6,k26=>b6,k36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } => "large map key 2" },
+
+ #{10:=a0,20:=b0,30:="c0","40":="d0",<<"50">>:="e0",{["00"]}:="10"} = M5,
+ #{11:=a1,21:=b1,31:="c1","41":="d1",<<"51">>:="e1",{["01"]}:="11"} = M5,
+ #{12:=a2,22:=b2,32:="c2","42":="d2",<<"52">>:="e2",{["02"]}:="12"} = M5,
+ #{13:=a3,23:=b3,33:="c3","43":="d3",<<"53">>:="e3",{["03"]}:="13"} = M5,
+ #{14:=a4,24:=b4,34:="c4","44":="d4",<<"54">>:="e4",{["04"]}:="14"} = M5,
+
+ #{15:=a5,25:=b5,35:="c5","45":="d5",<<"55">>:="e5",{["05"]}:="15"} = M5,
+ #{16:=a6,26:=b6,36:="c6","46":="d6",<<"56">>:="e6",{["06"]}:="16"} = M5,
+ #{17:=a7,27:=b7,37:="c7","47":="d7",<<"57">>:="e7",{["07"]}:="17"} = M5,
+ #{18:=a8,28:=b8,38:="c8","48":="d8",<<"58">>:="e8",{["08"]}:="18"} = M5,
+ #{19:=a9,29:=b9,39:="c9","49":="d9",<<"59">>:="e9",{["09"]}:="19"} = M5,
+
+ #{ #{ one => small, map => key } := "small map key 1",
+ #{ second => small, map => key } := "small map key 2",
+ #{ third => small, map => key } := "small map key 3" } = M5,
+
+ #{ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } := "large map key 1",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ k16=>a6,k26=>b6,k36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } := "large map key 2" } = M5,
+
+ 95 = map_size(M5),
+ 95 = maps:size(M5),
+
+ %% remember
+
+ #{10:=a0,20:=b0,30:="c0","40":="d0",<<"50">>:="e0",{["00"]}:="10"} = M0,
+ #{11:=a1,21:=b1,31:="c1","41":="d1",<<"51">>:="e1",{["01"]}:="11"} = M0,
+ #{12:=a2,22:=b2,32:="c2","42":="d2",<<"52">>:="e2",{["02"]}:="12"} = M0,
+ #{13:=a3,23:=b3,33:="c3","43":="d3",<<"53">>:="e3",{["03"]}:="13"} = M0,
+ #{14:=a4,24:=b4,34:="c4","44":="d4",<<"54">>:="e4",{["04"]}:="14"} = M0,
+
+ #{10:=na0,20:=nb0,30:="nc0","40":="nd0",<<"50">>:="ne0",{["00"]}:="n10"} = M1,
+ #{11:=na1,21:=nb1,31:="nc1","41":="nd1",<<"51">>:="ne1",{["01"]}:="n11"} = M1,
+ #{12:=na2,22:=nb2,32:="nc2","42":="nd2",<<"52">>:="ne2",{["02"]}:="n12"} = M1,
+ #{13:=na3,23:=nb3,33:="nc3","43":="nd3",<<"53">>:="ne3",{["03"]}:="n13"} = M1,
+ #{14:=na4,24:=nb4,34:="nc4","44":="nd4",<<"54">>:="ne4",{["04"]}:="n14"} = M1,
+
+ #{15:=a5,25:=b5,35:="c5","45":="d5",<<"55">>:="e5",{["05"]}:="15"} = M1,
+ #{16:=a6,26:=b6,36:="c6","46":="d6",<<"56">>:="e6",{["06"]}:="16"} = M1,
+ #{17:=a7,27:=b7,37:="c7","47":="d7",<<"57">>:="e7",{["07"]}:="17"} = M1,
+ #{18:=a8,28:=b8,38:="c8","48":="d8",<<"58">>:="e8",{["08"]}:="18"} = M1,
+ #{19:=a9,29:=b9,39:="c9","49":="d9",<<"59">>:="e9",{["09"]}:="19"} = M1,
+
+ #{15:=a5,25:=b5,35:="c5","45":="d5",<<"55">>:="e5",{["05"]}:="15"} = M2,
+ #{16:=a6,26:=b6,36:="c6","46":="d6",<<"56">>:="e6",{["06"]}:="16"} = M2,
+ #{17:=a7,27:=b7,37:="c7","47":="d7",<<"57">>:="e7",{["07"]}:="17"} = M2,
+ #{18:=a8,28:=b8,38:="c8","48":="d8",<<"58">>:="e8",{["08"]}:="18"} = M2,
+ #{19:=a9,29:=b9,39:="c9","49":="d9",<<"59">>:="e9",{["09"]}:="19"} = M2,
+
+ #{10.0:=fa0,20.0:=fb0,30.0:="fc0","40":="d0",<<"50">>:="e0",{["00"]}:="10"} = M2,
+ #{11.0:=fa1,21.0:=fb1,31.0:="fc1","41":="d1",<<"51">>:="e1",{["01"]}:="11"} = M2,
+ #{12.0:=fa2,22.0:=fb2,32.0:="fc2","42":="d2",<<"52">>:="e2",{["02"]}:="12"} = M2,
+ #{13.0:=fa3,23.0:=fb3,33.0:="fc3","43":="d3",<<"53">>:="e3",{["03"]}:="13"} = M2,
+ #{14.0:=fa4,24.0:=fb4,34.0:="fc4","44":="d4",<<"54">>:="e4",{["04"]}:="14"} = M2,
+
+ #{15:=a5,25:=b5,35:="c5","45":="d5",<<"55">>:="e5",{["05"]}:="15"} = M3,
+ #{16:=a6,26:=b6,36:="c6","46":="d6",<<"56">>:="e6",{["06"]}:="16"} = M3,
+ #{17:=a7,27:=b7,37:="c7","47":="d7",<<"57">>:="e7",{["07"]}:="17"} = M3,
+ #{18:=a8,28:=b8,38:="c8","48":="d8",<<"58">>:="e8",{["08"]}:="18"} = M3,
+ #{19:=a9,29:=b9,39:="c9","49":="d9",<<"59">>:="e9",{["09"]}:="19"} = M3,
+
+ #{10.0:=fa0,20.0:=fb0,30.0:="fc0","40":="d0",<<"50">>:="e0",{["00"]}:="10"} = M3,
+ #{11.0:=fa1,21.0:=fb1,31.0:="fc1","41":="d1",<<"51">>:="e1",{["01"]}:="11"} = M3,
+ #{12.0:=fa2,22.0:=fb2,32.0:="fc2","42":="d2",<<"52">>:="e2",{["02"]}:="12"} = M3,
+ #{13.0:=fa3,23.0:=fb3,33.0:="fc3","43":="d3",<<"53">>:="e3",{["03"]}:="13"} = M3,
+ #{14.0:=fa4,24.0:=fb4,34.0:="fc4","44":="d4",<<"54">>:="e4",{["04"]}:="14"} = M3,
+
+ #{15.0:=fa5,25.0:=fb5,35.0:="fc5","45":="d5",<<"55">>:="e5",{["05"]}:="15"} = M3,
+ #{16.0:=fa6,26.0:=fb6,36.0:="fc6","46":="d6",<<"56">>:="e6",{["06"]}:="16"} = M3,
+ #{17.0:=fa7,27.0:=fb7,37.0:="fc7","47":="d7",<<"57">>:="e7",{["07"]}:="17"} = M3,
+ #{18.0:=fa8,28.0:=fb8,38.0:="fc8","48":="d8",<<"58">>:="e8",{["08"]}:="18"} = M3,
+ #{19.0:=fa9,29.0:=fb9,39.0:="fc9","49":="d9",<<"59">>:="e9",{["09"]}:="19"} = M3,
+
+ #{36893488147419103232:=big1,67108863:=big8,"45":="d5",<<"55">>:="e5",{["05"]}:="15"} = M3,
+ #{147573952589676412928:=big3,8589934592:=big6,"46":="d6",<<"56">>:="e6",{["06"]}:="16"} = M3,
+ #{4294967296:=big5,18446744073709551616:=big4,"47":="d7",<<"57">>:="e7",{["07"]}:="17"} = M3,
+ #{4294967295:=big7,73786976294838206464:=big2,"48":="d8",<<"58">>:="e8",{["08"]}:="18"} = M3,
+
+ ok.
+
+
+t_map_size(Config) when is_list(Config) ->
+ 0 = map_size(#{}),
+ 1 = map_size(#{a=>1}),
+ 1 = map_size(#{a=>"wat"}),
+ 2 = map_size(#{a=>1, b=>2}),
+ 3 = map_size(#{a=>1, b=>2, b=>"3","33"=><<"n">>}),
+
+ true = map_is_size(#{a=>1}, 1),
+ true = map_is_size(#{a=>1, a=>2}, 1),
+ M = #{ "a" => 1, "b" => 2},
+ true = map_is_size(M, 2),
+ false = map_is_size(M, 3),
+ true = map_is_size(M#{ "a" => 2}, 2),
+ false = map_is_size(M#{ "c" => 2}, 2),
+
+ Ks = [build_key(fun(K) -> <<1,K:32,1>> end,I)||I<-lists:seq(1,100)],
+ ok = build_and_check_size(Ks,0,#{}),
+
+ %% try deep collisions
+ %% statistically we get another subtree at 50k -> 100k elements
+ %% Try to be nice and don't use too much memory in the testcase,
+
+ N = 500000,
+ Is = lists:seq(1,N),
+ N = map_size(maps:from_list([{I,I}||I<-Is])),
+ N = map_size(maps:from_list([{<<I:32>>,I}||I<-Is])),
+ N = map_size(maps:from_list([{integer_to_list(I),I}||I<-Is])),
+ N = map_size(maps:from_list([{float(I),I}||I<-Is])),
+
+ %% Error cases.
+ do_badmap(fun(T) ->
+ {'EXIT',{{badmap,T},_}} =
+ (catch map_size(T))
+ end),
+ ok.
+
+build_and_check_size([K|Ks],N,M0) ->
+ N = map_size(M0),
+ M1 = M0#{ K => K },
+ build_and_check_size(Ks,N + 1,M1);
+build_and_check_size([],N,M) ->
+ N = map_size(M),
+ ok.
+
+map_is_size(M,N) when map_size(M) =:= N -> true;
+map_is_size(_,_) -> false.
+
+t_is_map(Config) when is_list(Config) ->
+ true = is_map(#{}),
+ true = is_map(#{a=>1}),
+ false = is_map({a,b}),
+ false = is_map(x),
+ if is_map(#{}) -> ok end,
+ if is_map(#{b=>1}) -> ok end,
+ if not is_map([1,2,3]) -> ok end,
+ if not is_map(x) -> ok end,
+ ok.
+
+% test map updates without matching
+t_update_literals_large(Config) when is_list(Config) ->
+ Map = #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19",
+
+ 10.0=>fa0,20.0=>fb0,30.0=>"fc0",
+ 11.0=>fa1,21.0=>fb1,31.0=>"fc1",
+ 12.0=>fa2,22.0=>fb2,32.0=>"fc2",
+ 13.0=>fa3,23.0=>fb3,33.0=>"fc3",
+ 14.0=>fa4,24.0=>fb4,34.0=>"fc4",
+
+ 15.0=>fa5,25.0=>fb5,35.0=>"fc5",
+ 16.0=>fa6,26.0=>fb6,36.0=>"fc6",
+ 17.0=>fa7,27.0=>fb7,37.0=>"fc7",
+ 18.0=>fa8,28.0=>fb8,38.0=>"fc8",
+ 19.0=>fa9,29.0=>fb9,39.0=>"fc9",
+
+ #{ one => small, map => key } => "small map key 1",
+ #{ second => small, map => key } => "small map key 2",
+ #{ third => small, map => key } => "small map key 3",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } => "large map key 1",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ k16=>a6,k26=>b6,k36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } => "large map key 2" },
+
+ #{x:="d",q:="4"} = loop_update_literals_x_q(Map, [
+ {"a","1"},{"b","2"},{"c","3"},{"d","4"}
+ ]),
+ ok.
+
+t_update_literals(Config) when is_list(Config) ->
+ Map = #{x=>1,y=>2,z=>3,q=>4},
+ #{x:="d",q:="4"} = loop_update_literals_x_q(Map, [
+ {"a","1"},{"b","2"},{"c","3"},{"d","4"}
+ ]),
+ ok.
+
+
+loop_update_literals_x_q(Map, []) -> Map;
+loop_update_literals_x_q(Map, [{X,Q}|Vs]) ->
+ loop_update_literals_x_q(Map#{q=>Q,x=>X},Vs).
+
+% test map updates with matching
+t_match_and_update_literals(Config) when is_list(Config) ->
+ Map = #{ x=>0,y=>"untouched",z=>"also untouched",q=>1,
+ #{ "one" => small, map => key } => "small map key 1" },
+ #{x:=16,q:=21,y:="untouched",z:="also untouched"} = loop_match_and_update_literals_x_q(Map, [
+ {1,2},{3,4},{5,6},{7,8}
+ ]),
+ M0 = #{ "hi" => "hello", int => 3, <<"key">> => <<"value">>,
+ 4 => number, 18446744073709551629 => wat},
+ M1 = #{},
+ M2 = M1#{ "hi" => "hello", int => 3, <<"key">> => <<"value">>,
+ 4 => number, 18446744073709551629 => wat},
+ M0 = M2,
+
+ #{ 4 := another_number, int := 3 } = M2#{ 4 => another_number },
+ ok.
+
+t_match_and_update_literals_large(Config) when is_list(Config) ->
+ Map = #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19",
+
+ 10.0=>fa0,20.0=>fb0,30.0=>"fc0",
+ 11.0=>fa1,21.0=>fb1,31.0=>"fc1",
+ 12.0=>fa2,22.0=>fb2,32.0=>"fc2",
+ 13.0=>fa3,23.0=>fb3,33.0=>"fc3",
+ 14.0=>fa4,24.0=>fb4,34.0=>"fc4",
+
+ 15.0=>fa5,25.0=>fb5,35.0=>"fc5",
+ 16.0=>fa6,26.0=>fb6,36.0=>"fc6",
+ 17.0=>fa7,27.0=>fb7,37.0=>"fc7",
+ 18.0=>fa8,28.0=>fb8,38.0=>"fc8",
+ 19.0=>fa9,29.0=>fb9,39.0=>"fc9",
+
+ x=>0,y=>"untouched",z=>"also untouched",q=>1,
+
+ #{ "one" => small, map => key } => "small map key 1",
+ #{ second => small, map => key } => "small map key 2",
+ #{ third => small, map => key } => "small map key 3",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } => "large map key 1",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ k16=>a6,k26=>b6,k36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } => "large map key 2" },
+
+ #{x:=16,q:=21,y:="untouched",z:="also untouched"} = loop_match_and_update_literals_x_q(Map, [
+ {1,2},{3,4},{5,6},{7,8}
+ ]),
+ M0 = Map#{ "hi" => "hello", int => 3, <<"key">> => <<"value">>,
+ 4 => number, 18446744073709551629 => wat},
+ M1 = Map#{},
+ M2 = M1#{ "hi" => "hello", int => 3, <<"key">> => <<"value">>,
+ 4 => number, 18446744073709551629 => wat},
+ M0 = M2,
+
+ #{ 4 := another_number, int := 3 } = M2#{ 4 => another_number },
+ ok.
+
+
+loop_match_and_update_literals_x_q(Map, []) -> Map;
+loop_match_and_update_literals_x_q(#{ q:=Q0, x:=X0,
+ #{ "one" => small, map => key } := "small map key 1" } = Map, [{X,Q}|Vs]) ->
+ loop_match_and_update_literals_x_q(Map#{q=>Q0+Q,x=>X0+X},Vs).
+
+
+t_update_map_expressions(Config) when is_list(Config) ->
+ M = maps:new(),
+ #{ a := 1 } = M#{a => 1},
+
+ #{ b := 2 } = (maps:new())#{ b => 2 },
+
+ #{ a :=42, b:=42, c:=42 } = (maps:from_list([{a,1},{b,2},{c,3}]))#{ a := 42, b := 42, c := 42 },
+ #{ "a" :=1, "b":=42, "c":=42 } = (maps:from_list([{"a",1},{"b",2}]))#{ "b" := 42, "c" => 42 },
+ Ks = lists:seq($a,$z),
+ #{ "aa" := {$a,$a}, "ac":=41, "dc":=42 } =
+ (maps:from_list([{[K1,K2],{K1,K2}}|| K1 <- Ks, K2 <- Ks]))#{ "ac" := 41, "dc" => 42 },
+
+ %% Error cases.
+ do_badmap(fun(T) ->
+ {'EXIT',{{badmap,T},_}} =
+ (catch (T)#{a:=42,b=>2})
+ end),
+ ok.
+
+t_update_assoc(Config) when is_list(Config) ->
+ M0 = #{1=>a,2=>b,3.0=>c,4=>d,5=>e},
+
+ M1 = M0#{1=>42,2=>100,4=>[a,b,c]},
+ #{1:=42,2:=100,3.0:=c,4:=[a,b,c],5:=e} = M1,
+ #{1:=42,2:=b,4:=d,5:=e,2.0:=100,3.0:=c,4.0:=[a,b,c]} = M0#{1.0=>float,1:=42,2.0=>wrong,2.0=>100,4.0=>[a,b,c]},
+
+ M2 = M0#{3.0=>new},
+ #{1:=a,2:=b,3.0:=new,4:=d,5:=e} = M2,
+ M2 = M0#{3.0:=wrong,3.0=>new},
+
+ %% Errors cases.
+ do_badmap(fun(T) ->
+ {'EXIT',{{badmap,T},_}} =
+ (catch T#{nonexisting=>val})
+ end),
+ ok.
+
+
+t_update_assoc_large(Config) when is_list(Config) ->
+ M0 = #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19",
+
+ 10.0=>fa0,20.0=>fb0,30.0=>"fc0",
+ 11.0=>fa1,21.0=>fb1,31.0=>"fc1",
+ 12.0=>fa2,22.0=>fb2,32.0=>"fc2",
+ 13.0=>fa3,23.0=>fb3,33.0=>"fc3",
+ 14.0=>fa4,24.0=>fb4,34.0=>"fc4",
+
+ 15.0=>fa5,25.0=>fb5,35.0=>"fc5",
+ 16.0=>fa6,26.0=>fb6,36.0=>"fc6",
+ 17.0=>fa7,27.0=>fb7,37.0=>"fc7",
+ 18.0=>fa8,28.0=>fb8,38.0=>"fc8",
+ 19.0=>fa9,29.0=>fb9,39.0=>"fc9",
+
+ #{ one => small, map => key } => "small map key 1",
+ #{ second => small, map => key } => "small map key 2",
+ #{ third => small, map => key } => "small map key 3",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } => "large map key 1",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ k16=>a6,k26=>b6,k36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } => "large map key 2" },
+
+
+ M1 = M0#{1=>42,2=>100,4=>[a,b,c]},
+ #{1:=42,2:=100,10.0:=fa0,4:=[a,b,c],25:=b5} = M1,
+ #{ 10:=43, 24:=b4, 15:=a5, 35:="c5", 2.0:=100, 13.0:=fa3, 4.0:=[a,b,c]} =
+ M0#{1.0=>float,10:=43,2.0=>wrong,2.0=>100,4.0=>[a,b,c]},
+
+ M2 = M0#{13.0=>new},
+ #{10:=a0,20:=b0,13.0:=new,"40":="d0",<<"50">>:="e0"} = M2,
+ M2 = M0#{13.0:=wrong,13.0=>new},
+
+ ok.
+
+t_update_exact(Config) when is_list(Config) ->
+ M0 = #{1=>a,2=>b,3.0=>c,4=>d,5=>e},
+
+ M1 = M0#{1:=42,2:=100,4:=[a,b,c]},
+ #{1:=42,2:=100,3.0:=c,4:=[a,b,c],5:=e} = M1,
+ M1 = M0#{1:=wrong,1=>42,2=>wrong,2:=100,4:=[a,b,c]},
+
+ M2 = M0#{3.0:=new},
+ #{1:=a,2:=b,3.0:=new,4:=d,5:=e} = M2,
+ M2 = M0#{3.0=>wrong,3.0:=new},
+ true = M2 =/= M0#{3=>right,3.0:=new},
+ #{ 3 := right, 3.0 := new } = M0#{3=>right,3.0:=new},
+
+ M3 = #{ 1 => val},
+ #{1 := update2,1.0 := new_val4} = M3#{
+ 1.0 => new_val1, 1 := update, 1=> update3,
+ 1 := update2, 1.0 := new_val2, 1.0 => new_val3,
+ 1.0 => new_val4 },
+
+ %% Errors cases.
+ do_badmap(fun(T) ->
+ {'EXIT',{{badmap,T},_}} =
+ (catch T#{nonexisting=>val})
+ end),
+ Empty = #{},
+ {'EXIT',{{badkey,nonexisting},_}} = (catch Empty#{nonexisting:=val}),
+ {'EXIT',{{badkey,nonexisting},_}} = (catch M0#{nonexisting:=val}),
+ {'EXIT',{{badkey,1.0},_}} = (catch M0#{1.0:=v,1.0=>v2}),
+ {'EXIT',{{badkey,42},_}} = (catch M0#{42.0:=v,42:=v2}),
+ {'EXIT',{{badkey,42.0},_}} = (catch M0#{42=>v1,42.0:=v2,42:=v3}),
+
+ ok.
+
+t_update_exact_large(Config) when is_list(Config) ->
+ M0 = #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19",
+
+ 10.0=>fa0,20.0=>fb0,30.0=>"fc0",
+ 11.0=>fa1,21.0=>fb1,31.0=>"fc1",
+ 12.0=>fa2,22.0=>fb2,32.0=>"fc2",
+ 13.0=>fa3,23.0=>fb3,33.0=>"fc3",
+ 14.0=>fa4,24.0=>fb4,34.0=>"fc4",
+
+ 15.0=>fa5,25.0=>fb5,35.0=>"fc5",
+ 16.0=>fa6,26.0=>fb6,36.0=>"fc6",
+ 17.0=>fa7,27.0=>fb7,37.0=>"fc7",
+ 18.0=>fa8,28.0=>fb8,38.0=>"fc8",
+ 19.0=>fa9,29.0=>fb9,39.0=>"fc9",
+
+ #{ one => small, map => key } => "small map key 1",
+ #{ second => small, map => key } => "small map key 2",
+ #{ third => small, map => key } => "small map key 3",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } => "large map key 1",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ k16=>a6,k26=>b6,k36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } => "large map key 2" },
+
+
+ M1 = M0#{10:=42,<<"55">>:=100,10.0:=[a,b,c]},
+ #{ 10:=42,<<"55">>:=100,{["05"]}:="15",10.0:=[a,b,c],
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } := "large map key 1" } = M1,
+
+ M1 = M0#{10:=wrong,10=>42,<<"55">>=>wrong,<<"55">>:=100,10.0:=[a,b,c]},
+
+ M2 = M0#{13.0:=new},
+ #{10:=a0,20:=b0,13.0:=new} = M2,
+ M2 = M0#{13.0=>wrong,13.0:=new},
+
+ %% Errors cases.
+ {'EXIT',{{badkey,nonexisting},_}} = (catch M0#{nonexisting:=val}),
+ {'EXIT',{{badkey,1.0},_}} = (catch M0#{1.0:=v,1.0=>v2}),
+ {'EXIT',{{badkey,42},_}} = (catch M0#{42.0:=v,42:=v2}),
+ {'EXIT',{{badkey,42.0},_}} = (catch M0#{42=>v1,42.0:=v2,42:=v3}),
+
+ ok.
+
+t_update_deep(Config) when is_list(Config) ->
+ N = 250000,
+ M0 = maps:from_list([{integer_to_list(I),a}||I<-lists:seq(1,N)]),
+ #{ "1" := a, "10" := a, "100" := a, "1000" := a, "10000" := a } = M0,
+
+ M1 = M0#{ "1" := b, "10" := b, "100" := b, "1000" := b, "10000" := b },
+ #{ "1" := a, "10" := a, "100" := a, "1000" := a, "10000" := a } = M0,
+ #{ "1" := b, "10" := b, "100" := b, "1000" := b, "10000" := b } = M1,
+
+ M2 = M0#{ "1" => c, "10" => c, "100" => c, "1000" => c, "10000" => c },
+ #{ "1" := a, "10" := a, "100" := a, "1000" := a, "10000" := a } = M0,
+ #{ "1" := b, "10" := b, "100" := b, "1000" := b, "10000" := b } = M1,
+ #{ "1" := c, "10" := c, "100" := c, "1000" := c, "10000" := c } = M2,
+
+ M3 = M2#{ "n1" => d, "n10" => d, "n100" => d, "n1000" => d, "n10000" => d },
+ #{ "1" := a, "10" := a, "100" := a, "1000" := a, "10000" := a } = M0,
+ #{ "1" := b, "10" := b, "100" := b, "1000" := b, "10000" := b } = M1,
+ #{ "1" := c, "10" := c, "100" := c, "1000" := c, "10000" := c } = M2,
+ #{ "1" := c, "10" := c, "100" := c, "1000" := c, "10000" := c } = M3,
+ #{ "n1" := d, "n10" := d, "n100" := d, "n1000" := d, "n10000" := d } = M3,
+ ok.
+
+t_guard_bifs(Config) when is_list(Config) ->
+ true = map_guard_head(#{a=>1}),
+ false = map_guard_head([]),
+ true = map_guard_body(#{a=>1}),
+ false = map_guard_body({}),
+ true = map_guard_pattern(#{a=>1, <<"hi">> => "hi" }),
+ false = map_guard_pattern("list"),
+ ok.
+
+map_guard_head(M) when is_map(M) -> true;
+map_guard_head(_) -> false.
+
+map_guard_body(M) -> is_map(M).
+
+map_guard_pattern(#{}) -> true;
+map_guard_pattern(_) -> false.
+
+t_guard_sequence(Config) when is_list(Config) ->
+ {1, "a"} = map_guard_sequence_1(#{seq=>1,val=>"a"}),
+ {2, "b"} = map_guard_sequence_1(#{seq=>2,val=>"b"}),
+ {3, "c"} = map_guard_sequence_1(#{seq=>3,val=>"c"}),
+ {4, "d"} = map_guard_sequence_1(#{seq=>4,val=>"d"}),
+ {5, "e"} = map_guard_sequence_1(#{seq=>5,val=>"e"}),
+
+ {1,M1} = map_guard_sequence_2(M1 = #{a=>3}),
+ {2,M2} = map_guard_sequence_2(M2 = #{a=>4, b=>4}),
+ {3,gg,M3} = map_guard_sequence_2(M3 = #{a=>gg, b=>4}),
+ {4,sc,sc,M4} = map_guard_sequence_2(M4 = #{a=>sc, b=>3, c=>sc2}),
+ {5,kk,kk,M5} = map_guard_sequence_2(M5 = #{a=>kk, b=>other, c=>sc2}),
+
+ %% error case
+ {'EXIT',{function_clause,_}} = (catch map_guard_sequence_1(#{seq=>6,val=>"e"})),
+ {'EXIT',{function_clause,_}} = (catch map_guard_sequence_2(#{b=>5})),
+ ok.
+
+t_guard_sequence_large(Config) when is_list(Config) ->
+ M0 = #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00",03]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01",03]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02",03]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03",03]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04",03]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05",03]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06",03]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07",03]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08",03]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09",03]}=>"19",
+
+ 10.0=>fa0,20.0=>fb0,30.0=>"fc0",
+ 11.0=>fa1,21.0=>fb1,31.0=>"fc1",
+ 12.0=>fa2,22.0=>fb2,32.0=>"fc2",
+ 13.0=>fa3,23.0=>fb3,33.0=>"fc3",
+ 14.0=>fa4,24.0=>fb4,34.0=>"fc4",
+
+ 15.0=>fa5,25.0=>fb5,35.0=>"fc5",
+ 16.0=>fa6,26.0=>fb6,36.0=>"fc6",
+ 17.0=>fa7,27.0=>fb7,37.0=>"fc7",
+ 18.0=>fa8,28.0=>fb8,38.0=>"fc8",
+ 19.0=>fa9,29.0=>fb9,39.0=>"fc9",
+
+ #{ one => small, map => key } => "small map key 1",
+ #{ second => small, map => key } => "small map key 2",
+ #{ third => small, map => key } => "small map key 3",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } => "large map key 1",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ k16=>a6,k26=>b6,k36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } => "large map key 2" },
+
+ {1, "a"} = map_guard_sequence_1(M0#{seq=>1,val=>"a"}),
+ {2, "b"} = map_guard_sequence_1(M0#{seq=>2,val=>"b"}),
+ {3, "c"} = map_guard_sequence_1(M0#{seq=>3,val=>"c"}),
+ {4, "d"} = map_guard_sequence_1(M0#{seq=>4,val=>"d"}),
+ {5, "e"} = map_guard_sequence_1(M0#{seq=>5,val=>"e"}),
+
+ {1,M1} = map_guard_sequence_2(M1 = M0#{a=>3}),
+ {2,M2} = map_guard_sequence_2(M2 = M0#{a=>4, b=>4}),
+ {3,gg,M3} = map_guard_sequence_2(M3 = M0#{a=>gg, b=>4}),
+ {4,sc,sc,M4} = map_guard_sequence_2(M4 = M0#{a=>sc, b=>3, c=>sc2}),
+ {5,kk,kk,M5} = map_guard_sequence_2(M5 = M0#{a=>kk, b=>other, c=>sc2}),
+
+ {'EXIT',{function_clause,_}} = (catch map_guard_sequence_1(M0#{seq=>6,val=>"e"})),
+ {'EXIT',{function_clause,_}} = (catch map_guard_sequence_2(M0#{b=>5})),
+ ok.
+
+
+map_guard_sequence_1(#{seq:=1=Seq, val:=Val}) -> {Seq,Val};
+map_guard_sequence_1(#{seq:=2=Seq, val:=Val}) -> {Seq,Val};
+map_guard_sequence_1(#{seq:=3=Seq, val:=Val}) -> {Seq,Val};
+map_guard_sequence_1(#{seq:=4=Seq, val:=Val}) -> {Seq,Val};
+map_guard_sequence_1(#{seq:=5=Seq, val:=Val}) -> {Seq,Val}.
+
+map_guard_sequence_2(#{ a:=3 }=M) -> {1, M};
+map_guard_sequence_2(#{ a:=4 }=M) -> {2, M};
+map_guard_sequence_2(#{ a:=X, a:=X, b:=4 }=M) -> {3,X,M};
+map_guard_sequence_2(#{ a:=X, a:=Y, b:=3 }=M) when X =:= Y -> {4,X,Y,M};
+map_guard_sequence_2(#{ a:=X, a:=Y }=M) when X =:= Y -> {5,X,Y,M}.
+
+
+t_guard_update(Config) when is_list(Config) ->
+ error = map_guard_update(#{},#{}),
+ first = map_guard_update(#{}, #{x=>first}),
+ second = map_guard_update(#{y=>old}, #{x=>second,y=>old}),
+ ok.
+
+t_guard_update_large(Config) when is_list(Config) ->
+ M0 = #{ 70=>a0,80=>b0,90=>"c0","40"=>"d0",<<"50">>=>"e0",{["00",03]}=>"10",
+ 71=>a1,81=>b1,91=>"c1","41"=>"d1",<<"51">>=>"e1",{["01",03]}=>"11",
+ 72=>a2,82=>b2,92=>"c2","42"=>"d2",<<"52">>=>"e2",{["02",03]}=>"12",
+ 73=>a3,83=>b3,93=>"c3","43"=>"d3",<<"53">>=>"e3",{["03",03]}=>"13",
+ 74=>a4,84=>b4,94=>"c4","44"=>"d4",<<"54">>=>"e4",{["04",03]}=>"14",
+
+ 75=>a5,85=>b5,95=>"c5","45"=>"d5",<<"55">>=>"e5",{["05",03]}=>"15",
+ 76=>a6,86=>b6,96=>"c6","46"=>"d6",<<"56">>=>"e6",{["06",03]}=>"16",
+ 77=>a7,87=>b7,97=>"c7","47"=>"d7",<<"57">>=>"e7",{["07",03]}=>"17",
+ 78=>a8,88=>b8,98=>"c8","48"=>"d8",<<"58">>=>"e8",{["08",03]}=>"18",
+ 79=>a9,89=>b9,99=>"c9","49"=>"d9",<<"59">>=>"e9",{["09",03]}=>"19",
+
+ 70.0=>fa0,80.0=>fb0,90.0=>"fc0",
+ 71.0=>fa1,81.0=>fb1,91.0=>"fc1",
+ 72.0=>fa2,82.0=>fb2,92.0=>"fc2",
+ 73.0=>fa3,83.0=>fb3,93.0=>"fc3",
+ 74.0=>fa4,84.0=>fb4,94.0=>"fc4",
+
+ 75.0=>fa5,85.0=>fb5,95.0=>"fc5",
+ 76.0=>fa6,86.0=>fb6,96.0=>"fc6",
+ 77.0=>fa7,87.0=>fb7,97.0=>"fc7",
+ 78.0=>fa8,88.0=>fb8,98.0=>"fc8",
+ 79.0=>fa9,89.0=>fb9,99.0=>"fc9",
+
+ #{ one => small, map => key } => "small map key 1",
+ #{ second => small, map => key } => "small map key 2",
+ #{ third => small, map => key } => "small map key 3",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ 16=>a6,26=>b6,36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } => "large map key 1",
+
+ #{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
+ 11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
+ 12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
+ 13=>a3,23=>b3,33=>"c3","43"=>"d3",<<"53">>=>"e3",{["03"]}=>"13",
+ 14=>a4,24=>b4,34=>"c4","44"=>"d4",<<"54">>=>"e4",{["04"]}=>"14",
+
+ 15=>a5,25=>b5,35=>"c5","45"=>"d5",<<"55">>=>"e5",{["05"]}=>"15",
+ k16=>a6,k26=>b6,k36=>"c6","46"=>"d6",<<"56">>=>"e6",{["06"]}=>"16",
+ 17=>a7,27=>b7,37=>"c7","47"=>"d7",<<"57">>=>"e7",{["07"]}=>"17",
+ 18=>a8,28=>b8,38=>"c8","48"=>"d8",<<"58">>=>"e8",{["08"]}=>"18",
+ 19=>a9,29=>b9,39=>"c9","49"=>"d9",<<"59">>=>"e9",{["09"]}=>"19" } => "large map key 2" },
+
+
+ error = map_guard_update(M0#{},M0#{}),
+ first = map_guard_update(M0#{},M0#{x=>first}),
+ second = map_guard_update(M0#{y=>old}, M0#{x=>second,y=>old}),
+ ok.
+
+
+map_guard_update(M1, M2) when M1#{x=>first} =:= M2 -> first;
+map_guard_update(M1, M2) when M1#{x=>second} =:= M2 -> second;
+map_guard_update(_, _) -> error.
+
+t_guard_receive(Config) when is_list(Config) ->
+ M0 = #{ id => 0 },
+ Pid = spawn_link(fun() -> guard_receive_loop() end),
+ Big = 36893488147419103229,
+ B1 = <<"some text">>,
+ B2 = <<"was appended">>,
+ B3 = <<B1/binary, B2/binary>>,
+
+ #{id:=1, res:=Big} = M1 = call(Pid, M0#{op=>sub,in=>{1 bsl 65, 3}}),
+ #{id:=2, res:=26} = M2 = call(Pid, M1#{op=>idiv,in=>{53,2}}),
+ #{id:=3, res:=832} = M3 = call(Pid, M2#{op=>imul,in=>{26,32}}),
+ #{id:=4, res:=4} = M4 = call(Pid, M3#{op=>add,in=>{1,3}}),
+ #{id:=5, res:=Big} = M5 = call(Pid, M4#{op=>sub,in=>{1 bsl 65, 3}}),
+ #{id:=6, res:=B3} = M6 = call(Pid, M5#{op=>"append",in=>{B1,B2}}),
+ #{id:=7, res:=4} = _ = call(Pid, M6#{op=>add,in=>{1,3}}),
+
+
+ %% update old maps and check id update
+ #{id:=2, res:=B3} = call(Pid, M1#{op=>"append",in=>{B1,B2}}),
+ #{id:=5, res:=99} = call(Pid, M4#{op=>add,in=>{33, 66}}),
+
+ %% cleanup
+ done = call(Pid, done),
+ ok.
+
+-define(t_guard_receive_large_procs, 1500).
+
+t_guard_receive_large(Config) when is_list(Config) ->
+ M = lists:foldl(fun(_,#{procs := Ps } = M) ->
+ M#{ procs := Ps#{ spawn_link(fun() -> grecv_loop() end) => 0 }}
+ end, #{procs => #{}, done => 0}, lists:seq(1,?t_guard_receive_large_procs)),
+ lists:foreach(fun(Pid) ->
+ Pid ! {self(), hello}
+ end, maps:keys(maps:get(procs,M))),
+ ok = guard_receive_large_loop(M),
+ ok.
+
+guard_receive_large_loop(#{done := ?t_guard_receive_large_procs}) ->
+ ok;
+guard_receive_large_loop(M) ->
+ receive
+ #{pid := Pid, msg := hello} ->
+ case M of
+ #{done := Count, procs := #{Pid := 150}} ->
+ Pid ! {self(), done},
+ guard_receive_large_loop(M#{done := Count + 1});
+ #{procs := #{Pid := Count} = Ps} ->
+ Pid ! {self(), hello},
+ guard_receive_large_loop(M#{procs := Ps#{Pid := Count + 1}})
+ end
+ end.
+
+grecv_loop() ->
+ receive
+ {_, done} ->
+ ok;
+ {Pid, hello} ->
+ Pid ! #{pid=>self(), msg=>hello},
+ grecv_loop()
+ end.
+
+call(Pid, M) ->
+ Pid ! {self(), M}, receive {Pid, Res} -> Res end.
+
+guard_receive_loop() ->
+ receive
+ {Pid, #{ id:=Id, op:="append", in:={X,Y}}=M} when is_binary(X), is_binary(Y) ->
+ Pid ! {self(), M#{ id=>Id+1, res=><<X/binary,Y/binary>>}},
+ guard_receive_loop();
+ {Pid, #{ id:=Id, op:=add, in:={X,Y}}} ->
+ Pid ! {self(), #{ id=>Id+1, res=>X+Y}},
+ guard_receive_loop();
+ {Pid, #{ id:=Id, op:=sub, in:={X,Y}}=M} ->
+ Pid ! {self(), M#{ id=>Id+1, res=>X-Y}},
+ guard_receive_loop();
+ {Pid, #{ id:=Id, op:=idiv, in:={X,Y}}=M} ->
+ Pid ! {self(), M#{ id=>Id+1, res=>X div Y}},
+ guard_receive_loop();
+ {Pid, #{ id:=Id, op:=imul, in:={X,Y}}=M} ->
+ Pid ! {self(), M#{ id=>Id+1, res=>X * Y}},
+ guard_receive_loop();
+ {Pid, done} ->
+ Pid ! {self(), done};
+ {Pid, Other} ->
+ Pid ! {error, Other},
+ guard_receive_loop()
+ end.
+
+
+t_list_comprehension(Config) when is_list(Config) ->
+ [#{k:=1},#{k:=2},#{k:=3}] = [#{k=>I} || I <- [1,2,3]],
+
+ Ks = lists:seq($a,$z),
+ Ms = [#{[K1,K2]=>{K1,K2}} || K1 <- Ks, K2 <- Ks],
+ [#{"aa" := {$a,$a}},#{"ab":={$a,$b}}|_] = Ms,
+ [#{"zz" := {$z,$z}},#{"zy":={$z,$y}}|_] = lists:reverse(Ms),
+ ok.
+
+t_guard_fun(Config) when is_list(Config) ->
+ F1 = fun
+ (#{s:=v,v:=V}) -> {v,V};
+ (#{s:=t,v:={V,V}}) -> {t,V};
+ (#{s:=l,v:=[V,V]}) -> {l,V}
+ end,
+
+ F2 = fun
+ (#{s:=T,v:={V,V}}) -> {T,V};
+ (#{s:=T,v:=[V,V]}) -> {T,V};
+ (#{s:=T,v:=V}) -> {T,V}
+ end,
+ V = <<"hi">>,
+
+ {v,V} = F1(#{s=>v,v=>V}),
+ {t,V} = F1(#{s=>t,v=>{V,V}}),
+ {l,V} = F1(#{s=>l,v=>[V,V]}),
+
+ {v,V} = F2(#{s=>v,v=>V}),
+ {t,V} = F2(#{s=>t,v=>{V,V}}),
+ {l,V} = F2(#{s=>l,v=>[V,V]}),
+
+ %% error case
+ {'EXIT', {function_clause,[{?MODULE,_,[#{s:=none,v:=none}],_}|_]}} = (catch F1(#{s=>none,v=>none})),
+ ok.
+
+
+t_map_sort_literals(Config) when is_list(Config) ->
+ % test relation
+
+ %% size order
+ true = #{ a => 1, b => 2} < #{ a => 1, b => 1, c => 1},
+ true = #{ b => 1, a => 1} < #{ c => 1, a => 1, b => 1},
+ false = #{ c => 1, b => 1, a => 1} < #{ c => 1, a => 1},
+
+ %% key order
+ true = #{ a => 1 } < #{ b => 1},
+ false = #{ b => 1 } < #{ a => 1},
+ true = #{ a => 1, b => 1, c => 1 } < #{ b => 1, c => 1, d => 1},
+ true = #{ b => 1, c => 1, d => 1 } > #{ a => 1, b => 1, c => 1},
+ true = #{ c => 1, b => 1, a => 1 } < #{ b => 1, c => 1, d => 1},
+ true = #{ "a" => 1 } < #{ <<"a">> => 1},
+ false = #{ <<"a">> => 1 } < #{ "a" => 1},
+ true = #{ 1 => 1 } < #{ 1.0 => 1},
+ false = #{ 1.0 => 1 } < #{ 1 => 1},
+
+ %% value order
+ true = #{ a => 1 } < #{ a => 2},
+ false = #{ a => 2 } < #{ a => 1},
+ false = #{ a => 2, b => 1 } < #{ a => 1, b => 3},
+ true = #{ a => 1, b => 1 } < #{ a => 1, b => 3},
+ false = #{ a => 1 } < #{ a => 1.0},
+ false = #{ a => 1.0 } < #{ a => 1},
+
+ true = #{ "a" => "hi", b => 134 } == #{ b => 134,"a" => "hi"},
+
+ %% large maps
+
+ M = maps:from_list([{I,I}||I <- lists:seq(1,500)]),
+
+ %% size order
+ true = M#{ a => 1, b => 2} < M#{ a => 1, b => 1, c => 1},
+ true = M#{ b => 1, a => 1} < M#{ c => 1, a => 1, b => 1},
+ false = M#{ c => 1, b => 1, a => 1} < M#{ c => 1, a => 1},
+
+ %% key order
+ true = M#{ a => 1 } < M#{ b => 1},
+ false = M#{ b => 1 } < M#{ a => 1},
+ true = M#{ a => 1, b => 1, c => 1 } < M#{ b => 1, c => 1, d => 1},
+ true = M#{ b => 1, c => 1, d => 1 } > M#{ a => 1, b => 1, c => 1},
+ true = M#{ c => 1, b => 1, a => 1 } < M#{ b => 1, c => 1, d => 1},
+ true = M#{ "a" => 1 } < M#{ <<"a">> => 1},
+ false = M#{ <<"a">> => 1 } < #{ "a" => 1},
+ true = M#{ 1 => 1 } < maps:remove(1,M#{ 1.0 => 1}),
+ false = M#{ 1.0 => 1 } < M#{ 1 => 1},
+
+ %% value order
+ true = M#{ a => 1 } < M#{ a => 2},
+ false = M#{ a => 2 } < M#{ a => 1},
+ false = M#{ a => 2, b => 1 } < M#{ a => 1, b => 3},
+ true = M#{ a => 1, b => 1 } < M#{ a => 1, b => 3},
+ false = M#{ a => 1 } < M#{ a => 1.0},
+ false = M#{ a => 1.0 } < M#{ a => 1},
+
+ true = M#{ "a" => "hi", b => 134 } == M#{ b => 134,"a" => "hi"},
+
+ %% lists:sort
+
+ SortVs = [#{"a"=>1},#{a=>2},#{1=>3},#{<<"a">>=>4}],
+ [#{1:=ok},#{a:=ok},#{"a":=ok},#{<<"a">>:=ok}] = lists:sort([#{"a"=>ok},#{a=>ok},#{1=>ok},#{<<"a">>=>ok}]),
+ [#{1:=3},#{a:=2},#{"a":=1},#{<<"a">>:=4}] = lists:sort(SortVs),
+ [#{1:=3},#{a:=2},#{"a":=1},#{<<"a">>:=4}] = lists:sort(lists:reverse(SortVs)),
+ ok.
+
+t_map_equal(Config) when is_list(Config) ->
+ true = #{} =:= #{},
+ false = #{} =:= #{a=>1},
+ false = #{a=>1} =:= #{},
+ true = #{ "a" => "hi", b => 134 } =:= #{ b => 134,"a" => "hi"},
+
+ false = #{ a => 1 } =:= #{ a => 2},
+ false = #{ a => 2 } =:= #{ a => 1},
+ false = #{ a => 2, b => 1 } =:= #{ a => 1, b => 3},
+ false = #{ a => 1, b => 1 } =:= #{ a => 1, b => 3},
+
+ true = #{ a => 1 } =:= #{ a => 1},
+ true = #{ "a" => 2 } =:= #{ "a" => 2},
+ true = #{ "a" => 2, b => 3 } =:= #{ "a" => 2, b => 3},
+ true = #{ a => 1, b => 3, c => <<"wat">> } =:= #{ a => 1, b => 3, c=><<"wat">>},
+ ok.
+
+
+t_map_compare(Config) when is_list(Config) ->
+ Seed = {erlang:monotonic_time(),
+ erlang:time_offset(),
+ erlang:unique_integer()},
+ io:format("seed = ~p\n", [Seed]),
+ random:seed(Seed),
+ repeat(100, fun(_) -> float_int_compare() end, []),
+ repeat(100, fun(_) -> recursive_compare() end, []),
+ ok.
+
+float_int_compare() ->
+ Terms = numeric_keys(3),
+ %%io:format("Keys to use: ~p\n", [Terms]),
+ Pairs = lists:map(fun(K) -> list_to_tuple([{K,V} || V <- Terms]) end, Terms),
+ lists:foreach(fun(Size) ->
+ MapGen = fun() -> map_gen(list_to_tuple(Pairs), Size) end,
+ repeat(100, fun do_compare/1, [MapGen, MapGen])
+ end,
+ lists:seq(1,length(Terms))),
+ ok.
+
+numeric_keys(N) ->
+ lists:foldl(fun(_,Acc) ->
+ Int = random:uniform(N*4) - N*2,
+ Float = float(Int),
+ [Int, Float, Float * 0.99, Float * 1.01 | Acc]
+ end,
+ [],
+ lists:seq(1,N)).
+
+
+repeat(0, _, _) ->
+ ok;
+repeat(N, Fun, Arg) ->
+ Fun(Arg),
+ repeat(N-1, Fun, Arg).
+
+copy_term(T) ->
+ Papa = self(),
+ P = spawn_link(fun() -> receive Msg -> Papa ! Msg end end),
+ P ! T,
+ receive R -> R end.
+
+do_compare([Gen1, Gen2]) ->
+ M1 = Gen1(),
+ M2 = Gen2(),
+ %%io:format("Maps to compare: ~p AND ~p\n", [M1, M2]),
+ C = (M1 < M2),
+ Erlang = maps_lessthan(M1, M2),
+ C = Erlang,
+ ?CHECK(M1==M1, M1),
+
+ %% Change one key from int to float (or vice versa) and check compare
+ ML1 = maps:to_list(M1),
+ {K1,V1} = lists:nth(random:uniform(length(ML1)), ML1),
+ case K1 of
+ I when is_integer(I) ->
+ case maps:find(float(I),M1) of
+ error ->
+ M1f = maps:remove(I, maps:put(float(I), V1, M1)),
+ ?CHECK(M1f > M1, [M1f, M1]);
+ _ -> ok
+ end;
+
+ F when is_float(F), round(F) == F ->
+ case maps:find(round(F),M1) of
+ error ->
+ M1i = maps:remove(F, maps:put(round(F), V1, M1)),
+ ?CHECK(M1i < M1, [M1i, M1]);
+ _ -> ok
+ end;
+
+ _ -> ok % skip floats with decimals
+ end,
+
+ ?CHECK(M2 == M2, [M2]).
+
+
+maps_lessthan(M1, M2) ->
+ case {maps:size(M1),maps:size(M2)} of
+ {_S,_S} ->
+ {K1,V1} = lists:unzip(term_sort(maps:to_list(M1))),
+ {K2,V2} = lists:unzip(term_sort(maps:to_list(M2))),
+
+ case erts_internal:cmp_term(K1,K2) of
+ -1 -> true;
+ 0 -> (V1 < V2);
+ 1 -> false
+ end;
+
+ {S1, S2} ->
+ S1 < S2
+ end.
+
+term_sort(L) ->
+ lists:sort(fun(A,B) -> erts_internal:cmp_term(A,B) =< 0 end,
+ L).
+
+
+cmp(T1, T2, Exact) when is_tuple(T1) and is_tuple(T2) ->
+ case {size(T1),size(T2)} of
+ {_S,_S} -> cmp(tuple_to_list(T1), tuple_to_list(T2), Exact);
+ {S1,S2} when S1 < S2 -> -1;
+ {S1,S2} when S1 > S2 -> 1
+ end;
+
+cmp([H1|T1], [H2|T2], Exact) ->
+ case cmp(H1,H2, Exact) of
+ 0 -> cmp(T1,T2, Exact);
+ C -> C
+ end;
+
+cmp(M1, M2, Exact) when is_map(M1) andalso is_map(M2) ->
+ cmp_maps(M1,M2,Exact);
+cmp(M1, M2, Exact) ->
+ cmp_others(M1, M2, Exact).
+
+cmp_maps(M1, M2, Exact) ->
+ case {maps:size(M1),maps:size(M2)} of
+ {_S,_S} ->
+ {K1,V1} = lists:unzip(term_sort(maps:to_list(M1))),
+ {K2,V2} = lists:unzip(term_sort(maps:to_list(M2))),
+
+ case cmp(K1, K2, true) of
+ 0 -> cmp(V1, V2, Exact);
+ C -> C
+ end;
+
+ {S1,S2} when S1 < S2 -> -1;
+ {S1,S2} when S1 > S2 -> 1
+ end.
+
+cmp_others(I, F, true) when is_integer(I), is_float(F) ->
+ -1;
+cmp_others(F, I, true) when is_float(F), is_integer(I) ->
+ 1;
+cmp_others(T1, T2, _) ->
+ case {T1<T2, T1==T2} of
+ {true,false} -> -1;
+ {false,true} -> 0;
+ {false,false} -> 1
+ end.
+
+map_gen(Pairs, Size) ->
+ {_,L} = lists:foldl(fun(_, {Keys, Acc}) ->
+ KI = random:uniform(size(Keys)),
+ K = element(KI,Keys),
+ KV = element(random:uniform(size(K)), K),
+ {erlang:delete_element(KI,Keys), [KV | Acc]}
+ end,
+ {Pairs, []},
+ lists:seq(1,Size)),
+
+ maps:from_list(L).
+
+
+recursive_compare() ->
+ Leafs = {atom, 17, 16.9, 17.1, [], self(), spawn(fun() -> ok end), make_ref(), make_ref()},
+ {A, B} = term_gen_recursive(Leafs, 0, 0),
+ %%io:format("Recursive term A = ~p\n", [A]),
+ %%io:format("Recursive term B = ~p\n", [B]),
+
+ ?CHECK({true,false} =:= case do_cmp(A, B, false) of
+ -1 -> {A<B, A>=B};
+ 0 -> {A==B, A/=B};
+ 1 -> {A>B, A=<B}
+ end,
+ {A,B}),
+ A2 = copy_term(A),
+ ?CHECK(A == A2, {A,A2}),
+ ?CHECK(0 =:= cmp(A, A2, false), {A,A2}),
+
+ B2 = copy_term(B),
+ ?CHECK(B == B2, {B,B2}),
+ ?CHECK(0 =:= cmp(B, B2, false), {B,B2}),
+ ok.
+
+do_cmp(A, B, Exact) ->
+ C = cmp(A, B, Exact),
+ C.
+
+%% Generate two terms {A,B} that may only differ
+%% at float vs integer types.
+term_gen_recursive(Leafs, Flags, Depth) ->
+ MaxDepth = 10,
+ Rnd = case {Flags, Depth} of
+ {_, MaxDepth} -> % Only leafs
+ random:uniform(size(Leafs)) + 3;
+ {0, 0} -> % Only containers
+ random:uniform(3);
+ {0,_} -> % Anything
+ random:uniform(size(Leafs)+3)
+ end,
+ case Rnd of
+ 1 -> % Make map
+ Size = random:uniform(size(Leafs)),
+ lists:foldl(fun(_, {Acc1,Acc2}) ->
+ {K1,K2} = term_gen_recursive(Leafs, Flags,
+ Depth+1),
+ {V1,V2} = term_gen_recursive(Leafs, Flags, Depth+1),
+ {maps:put(K1,V1, Acc1), maps:put(K2,V2, Acc2)}
+ end,
+ {maps:new(), maps:new()},
+ lists:seq(1,Size));
+ 2 -> % Make cons
+ {Car1,Car2} = term_gen_recursive(Leafs, Flags, Depth+1),
+ {Cdr1,Cdr2} = term_gen_recursive(Leafs, Flags, Depth+1),
+ {[Car1 | Cdr1], [Car2 | Cdr2]};
+ 3 -> % Make tuple
+ Size = random:uniform(size(Leafs)),
+ L = lists:map(fun(_) -> term_gen_recursive(Leafs, Flags, Depth+1) end,
+ lists:seq(1,Size)),
+ {L1, L2} = lists:unzip(L),
+ {list_to_tuple(L1), list_to_tuple(L2)};
+
+ N -> % Make leaf
+ case element(N-3, Leafs) of
+ I when is_integer(I) ->
+ case random:uniform(4) of
+ 1 -> {I, float(I)};
+ 2 -> {float(I), I};
+ _ -> {I,I}
+ end;
+ T -> {T,T}
+ end
+ end.
+
+%% BIFs
+t_bif_map_get(Config) when is_list(Config) ->
+ %% small map
+ 1 = maps:get(a, #{ a=> 1}),
+ 2 = maps:get(b, #{ a=> 1, b => 2}),
+ "hi" = maps:get("hello", #{ a=>1, "hello" => "hi"}),
+ "tuple hi" = maps:get({1,1.0}, #{ a=>a, {1,1.0} => "tuple hi"}),
+
+ M0 = #{ k1=>"v1", <<"k2">> => <<"v3">> },
+ "v4" = maps:get(<<"k2">>, M0#{<<"k2">> => "v4"}),
+
+ %% large map
+ M1 = maps:from_list([{I,I}||I<-lists:seq(1,100)] ++
+ [{a,1},{b,2},{"hello","hi"},{{1,1.0},"tuple hi"},
+ {k1,"v1"},{<<"k2">>,"v3"}]),
+ 1 = maps:get(a, M1),
+ 2 = maps:get(b, M1),
+ "hi" = maps:get("hello", M1),
+ "tuple hi" = maps:get({1,1.0}, M1),
+ "v3" = maps:get(<<"k2">>, M1),
+
+ %% error cases
+ do_badmap(fun(T) ->
+ {'EXIT',{{badmap,T},[{maps,get,_,_}|_]}} =
+ (catch maps:get(a, T))
+ end),
+
+ {'EXIT',{{badkey,{1,1}},[{maps,get,_,_}|_]}} =
+ (catch maps:get({1,1}, #{{1,1.0} => "tuple"})),
+ {'EXIT',{{badkey,a},[{maps,get,_,_}|_]}} = (catch maps:get(a, #{})),
+ {'EXIT',{{badkey,a},[{maps,get,_,_}|_]}} =
+ (catch maps:get(a, #{b=>1, c=>2})),
+ ok.
+
+t_bif_map_find(Config) when is_list(Config) ->
+ %% small map
+ {ok, 1} = maps:find(a, #{ a=> 1}),
+ {ok, 2} = maps:find(b, #{ a=> 1, b => 2}),
+ {ok, "int"} = maps:find(1, #{ 1 => "int"}),
+ {ok, "float"} = maps:find(1.0, #{ 1.0=> "float"}),
+
+ {ok, "hi"} = maps:find("hello", #{ a=>1, "hello" => "hi"}),
+ {ok, "tuple hi"} = maps:find({1,1.0}, #{ a=>a, {1,1.0} => "tuple hi"}),
+
+ M0 = #{ k1=>"v1", <<"k2">> => <<"v3">> },
+ {ok, "v4"} = maps:find(<<"k2">>, M0#{ <<"k2">> => "v4" }),
+
+ %% large map
+ M1 = maps:from_list([{I,I}||I<-lists:seq(1,100)] ++
+ [{a,1},{b,2},{"hello","hi"},{{1,1.0},"tuple hi"},
+ {k1,"v1"},{<<"k2">>,"v3"}]),
+ {ok, 1} = maps:find(a, M1),
+ {ok, 2} = maps:find(b, M1),
+ {ok, "hi"} = maps:find("hello", M1),
+ {ok, "tuple hi"} = maps:find({1,1.0}, M1),
+ {ok, "v3"} = maps:find(<<"k2">>, M1),
+
+ %% error case
+ error = maps:find(a,#{}),
+ error = maps:find(a,#{b=>1, c=>2}),
+ error = maps:find(1.0, #{ 1 => "int"}),
+ error = maps:find(1, #{ 1.0 => "float"}),
+ error = maps:find({1.0,1}, #{ a=>a, {1,1.0} => "tuple hi"}), % reverse types in tuple key
+
+ do_badmap(fun(T) ->
+ {'EXIT',{{badmap,T},[{maps,find,_,_}|_]}} =
+ (catch maps:find(a, T))
+ end),
+ ok.
+
+
+t_bif_map_is_key(Config) when is_list(Config) ->
+ M1 = #{ "hi" => "hello", int => 3, <<"key">> => <<"value">>, 4 => number},
+
+ true = maps:is_key("hi", M1),
+ true = maps:is_key(int, M1),
+ true = maps:is_key(<<"key">>, M1),
+ true = maps:is_key(4, M1),
+
+ false = maps:is_key(5, M1),
+ false = maps:is_key(<<"key2">>, M1),
+ false = maps:is_key("h", M1),
+ false = maps:is_key("hello", M1),
+ false = maps:is_key(atom, M1),
+ false = maps:is_key(any, #{}),
+
+ false = maps:is_key("hi", maps:remove("hi", M1)),
+ true = maps:is_key("hi", M1),
+ true = maps:is_key(1, maps:put(1, "number", M1)),
+ false = maps:is_key(1.0, maps:put(1, "number", M1)),
+
+ %% error case
+ do_badmap(fun(T) ->
+ {'EXIT',{{badmap,T},[{maps,is_key,_,_}|_]}} =
+ (catch maps:is_key(a, T))
+ end),
+ ok.
+
+t_bif_map_keys(Config) when is_list(Config) ->
+ [] = maps:keys(#{}),
+
+ [1,2,3,4,5] = lists:sort(maps:keys(#{ 1 => a, 2 => b, 3 => c, 4 => d, 5 => e})),
+ [1,2,3,4,5] = lists:sort(maps:keys(#{ 4 => d, 5 => e, 1 => a, 2 => b, 3 => c})),
+
+ % values in key order: [4,int,"hi",<<"key">>]
+ M1 = #{ "hi" => "hello", int => 3, <<"key">> => <<"value">>, 4 => number},
+ [4,int,"hi",<<"key">>] = lists:sort(maps:keys(M1)),
+
+ %% error case
+ do_badmap(fun(T) ->
+ {'EXIT',{{badmap,T},[{maps,keys,_,_}|_]}} =
+ (catch maps:keys(T))
+ end),
+ ok.
+
+t_bif_map_new(Config) when is_list(Config) ->
+ #{} = maps:new(),
+ 0 = erlang:map_size(maps:new()),
+ ok.
+
+t_bif_map_merge(Config) when is_list(Config) ->
+ 0 = erlang:map_size(maps:merge(#{},#{})),
+
+ M0 = #{ "hi" => "hello", int => 3, <<"key">> => <<"value">>,
+ 4 => number, 18446744073709551629 => wat},
+
+ #{ "hi" := "hello", int := 3, <<"key">> := <<"value">>,
+ 4 := number, 18446744073709551629 := wat} = maps:merge(#{}, M0),
+
+ #{ "hi" := "hello", int := 3, <<"key">> := <<"value">>,
+ 4 := number, 18446744073709551629 := wat} = maps:merge(M0, #{}),
+
+ M1 = #{ "hi" => "hello again", float => 3.3, {1,2} => "tuple", 4 => integer },
+
+ #{4 := number, 18446744073709551629 := wat, float := 3.3, int := 3,
+ {1,2} := "tuple", "hi" := "hello", <<"key">> := <<"value">>} = maps:merge(M1,M0),
+
+ #{4 := integer, 18446744073709551629 := wat, float := 3.3, int := 3,
+ {1,2} := "tuple", "hi" := "hello again", <<"key">> := <<"value">>} = maps:merge(M0,M1),
+
+ %% try deep collisions
+ N = 150000,
+ Is = lists:seq(1,N),
+ M2 = maps:from_list([{I,I}||I<-Is]),
+ 150000 = maps:size(M2),
+ M3 = maps:from_list([{<<I:32>>,I}||I<-Is]),
+ 150000 = maps:size(M3),
+ M4 = maps:merge(M2,M3),
+ 300000 = maps:size(M4),
+ M5 = maps:from_list([{integer_to_list(I),I}||I<-Is]),
+ 150000 = maps:size(M5),
+ M6 = maps:merge(M4,M5),
+ 450000 = maps:size(M6),
+ M7 = maps:from_list([{float(I),I}||I<-Is]),
+ 150000 = maps:size(M7),
+ M8 = maps:merge(M7,M6),
+ 600000 = maps:size(M8),
+
+ #{ 1 := 1, "1" := 1, <<1:32>> := 1 } = M8,
+ #{ 10 := 10, "10" := 10, <<10:32>> := 10 } = M8,
+ #{ 100 := 100, "100" := 100, <<100:32>> := 100 } = M8,
+ #{ 1000 := 1000, "1000" := 1000, <<1000:32>> := 1000 } = M8,
+ #{ 10000 := 10000, "10000" := 10000, <<10000:32>> := 10000 } = M8,
+ #{ 100000 := 100000, "100000" := 100000, <<100000:32>> := 100000 } = M8,
+
+ %% overlapping
+ M8 = maps:merge(M2,M8),
+ M8 = maps:merge(M3,M8),
+ M8 = maps:merge(M4,M8),
+ M8 = maps:merge(M5,M8),
+ M8 = maps:merge(M6,M8),
+ M8 = maps:merge(M7,M8),
+ M8 = maps:merge(M8,M8),
+
+ %% maps:merge/2 and mixed
+
+ Ks1 = [764492191,2361333849], %% deep collision
+ Ks2 = lists:seq(1,33),
+ M9 = maps:from_list([{K,K}||K <- Ks1]),
+ M10 = maps:from_list([{K,K}||K <- Ks2]),
+ M11 = maps:merge(M9,M10),
+ ok = check_keys_exist(Ks1 ++ Ks2, M11),
+
+ %% error case
+ do_badmap(fun(T) ->
+ {'EXIT',{{badmap,T},[{maps,merge,_,_}|_]}} =
+ (catch maps:merge(#{}, T)),
+ {'EXIT',{{badmap,T},[{maps,merge,_,_}|_]}} =
+ (catch maps:merge(T, #{})),
+ {'EXIT',{{badmap,T},[{maps,merge,_,_}|_]}} =
+ (catch maps:merge(T, T))
+ end),
+ ok.
+
+
+t_bif_map_put(Config) when is_list(Config) ->
+ M0 = #{ "hi" => "hello", int => 3, <<"key">> => <<"value">>,
+ 4 => number, 18446744073709551629 => wat},
+
+ M1 = #{ "hi" := "hello"} = maps:put("hi", "hello", #{}),
+
+ true = is_members(["hi"],maps:keys(M1)),
+ true = is_members(["hello"],maps:values(M1)),
+
+ M2 = #{ int := 3 } = maps:put(int, 3, M1),
+
+ true = is_members([int,"hi"],maps:keys(M2)),
+ true = is_members([3,"hello"],maps:values(M2)),
+
+ M3 = #{ <<"key">> := <<"value">> } = maps:put(<<"key">>, <<"value">>, M2),
+
+ true = is_members([int,"hi",<<"key">>],maps:keys(M3)),
+ true = is_members([3,"hello",<<"value">>],maps:values(M3)),
+
+ M4 = #{ 18446744073709551629 := wat } = maps:put(18446744073709551629, wat, M3),
+
+ true = is_members([18446744073709551629,int,"hi",<<"key">>],maps:keys(M4)),
+ true = is_members([wat,3,"hello",<<"value">>],maps:values(M4)),
+
+ M0 = #{ 4 := number } = M5 = maps:put(4, number, M4),
+
+ true = is_members([4,18446744073709551629,int,"hi",<<"key">>],maps:keys(M5)),
+ true = is_members([number,wat,3,"hello",<<"value">>],maps:values(M5)),
+
+ M6 = #{ <<"key">> := <<"other value">> } = maps:put(<<"key">>, <<"other value">>, M5),
+
+ true = is_members([4,18446744073709551629,int,"hi",<<"key">>],maps:keys(M6)),
+ true = is_members([number,wat,3,"hello",<<"other value">>],maps:values(M6)),
+
+ %% error case
+ do_badmap(fun(T) ->
+ {'EXIT',{{badmap,T},[{maps,put,_,_}|_]}} =
+ (catch maps:put(1, a, T))
+ end),
+ ok.
+
+is_members(Ks,Ls) when length(Ks) =/= length(Ls) -> false;
+is_members(Ks,Ls) -> is_members_do(Ks,Ls).
+
+is_members_do([],[]) -> true;
+is_members_do([],_) -> false;
+is_members_do([K|Ks],Ls) ->
+ is_members_do(Ks, lists:delete(K,Ls)).
+
+t_bif_map_remove(Config) when is_list(Config) ->
+ 0 = erlang:map_size(maps:remove(some_key, #{})),
+
+ M0 = #{ "hi" => "hello", int => 3, <<"key">> => <<"value">>,
+ 4 => number, 18446744073709551629 => wat},
+
+ M1 = maps:remove("hi", M0),
+ true = is_members([4,18446744073709551629,int,<<"key">>],maps:keys(M1)),
+ true = is_members([number,wat,3,<<"value">>],maps:values(M1)),
+
+ M2 = maps:remove(int, M1),
+ true = is_members([4,18446744073709551629,<<"key">>],maps:keys(M2)),
+ true = is_members([number,wat,<<"value">>],maps:values(M2)),
+
+ M3 = maps:remove(<<"key">>, M2),
+ true = is_members([4,18446744073709551629],maps:keys(M3)),
+ true = is_members([number,wat],maps:values(M3)),
+
+ M4 = maps:remove(18446744073709551629, M3),
+ true = is_members([4],maps:keys(M4)),
+ true = is_members([number],maps:values(M4)),
+
+ M5 = maps:remove(4, M4),
+ [] = maps:keys(M5),
+ [] = maps:values(M5),
+
+ M0 = maps:remove(5,M0),
+ M0 = maps:remove("hi there",M0),
+
+ #{ "hi" := "hello", int := 3, 4 := number} = maps:remove(18446744073709551629,maps:remove(<<"key">>,M0)),
+
+ %% error case
+ do_badmap(fun(T) ->
+ {'EXIT',{{badmap,T},[{maps,remove,_,_}|_]}} =
+ (catch maps:remove(a, T))
+ end),
+ ok.
+
+t_bif_map_update(Config) when is_list(Config) ->
+ M0 = #{ "hi" => "hello", int => 3, <<"key">> => <<"value">>,
+ 4 => number, 18446744073709551629 => wat},
+
+ #{ "hi" := "hello again", int := 3, <<"key">> := <<"value">>,
+ 4 := number, 18446744073709551629 := wat} = maps:update("hi", "hello again", M0),
+
+ #{ "hi" := "hello", int := 1337, <<"key">> := <<"value">>,
+ 4 := number, 18446744073709551629 := wat} = maps:update(int, 1337, M0),
+
+ #{ "hi" := "hello", int := 3, <<"key">> := <<"new value">>,
+ 4 := number, 18446744073709551629 := wat} = maps:update(<<"key">>, <<"new value">>, M0),
+
+ #{ "hi" := "hello", int := 3, <<"key">> := <<"value">>,
+ 4 := integer, 18446744073709551629 := wat} = maps:update(4, integer, M0),
+
+ #{ "hi" := "hello", int := 3, <<"key">> := <<"value">>,
+ 4 := number, 18446744073709551629 := wazzup} = maps:update(18446744073709551629, wazzup, M0),
+
+ %% error case
+ do_badmap(fun(T) ->
+ {'EXIT',{{badmap,T},[{maps,update,_,_}|_]}} =
+ (catch maps:update(1, none, T))
+ end),
+ ok.
+
+
+
+t_bif_map_values(Config) when is_list(Config) ->
+
+ [] = maps:values(#{}),
+ [1] = maps:values(#{a=>1}),
+
+ true = is_members([a,b,c,d,e],maps:values(#{ 1 => a, 2 => b, 3 => c, 4 => d, 5 => e})),
+ true = is_members([a,b,c,d,e],maps:values(#{ 4 => d, 5 => e, 1 => a, 2 => b, 3 => c})),
+
+ M1 = #{ "hi" => "hello", int => 3, <<"key">> => <<"value">>, 4 => number},
+ M2 = M1#{ "hi" => "hello2", <<"key">> => <<"value2">> },
+ true = is_members([number,3,"hello2",<<"value2">>],maps:values(M2)),
+ true = is_members([number,3,"hello",<<"value">>],maps:values(M1)),
+
+ Vs = lists:seq(1000,20000),
+ M3 = maps:from_list([{K,K}||K<-Vs]),
+ M4 = maps:merge(M1,M3),
+ M5 = maps:merge(M2,M3),
+ true = is_members(Vs,maps:values(M3)),
+ true = is_members([number,3,"hello",<<"value">>]++Vs,maps:values(M4)),
+ true = is_members([number,3,"hello2",<<"value2">>]++Vs,maps:values(M5)),
+
+ %% error case
+ do_badmap(fun(T) ->
+ {'EXIT',{{badmap,T},[{maps,values,_,_}|_]}} =
+ (catch maps:values(T))
+ end),
+ ok.
+
+t_erlang_hash(Config) when is_list(Config) ->
+
+ ok = t_bif_erlang_phash2(),
+ ok = t_bif_erlang_phash(),
+ ok = t_bif_erlang_hash(),
+
+ ok.
+
+t_bif_erlang_phash2() ->
+
+ 39679005 = erlang:phash2(#{}),
+ 33667975 = erlang:phash2(#{ a => 1, "a" => 2, <<"a">> => 3, {a,b} => 4 }), % 78942764
+ 95332690 = erlang:phash2(#{ 1 => a, 2 => "a", 3 => <<"a">>, 4 => {a,b} }), % 37338230
+ 108954384 = erlang:phash2(#{ 1 => a }), % 14363616
+ 59617982 = erlang:phash2(#{ a => 1 }), % 51612236
+
+ 42770201 = erlang:phash2(#{{} => <<>>}), % 37468437
+ 71687700 = erlang:phash2(#{<<>> => {}}), % 44049159
+
+ M0 = #{ a => 1, "key" => <<"value">> },
+ M1 = maps:remove("key",M0),
+ M2 = M1#{ "key" => <<"value">> },
+
+ 70249457 = erlang:phash2(M0), % 118679416
+ 59617982 = erlang:phash2(M1), % 51612236
+ 70249457 = erlang:phash2(M2), % 118679416
+ ok.
+
+t_bif_erlang_phash() ->
+ Sz = 1 bsl 32,
+ 1113425985 = erlang:phash(#{},Sz), % 268440612
+ 1510068139 = erlang:phash(#{ a => 1, "a" => 2, <<"a">> => 3, {a,b} => 4 },Sz), % 1196461908
+ 3182345590 = erlang:phash(#{ 1 => a, 2 => "a", 3 => <<"a">>, 4 => {a,b} },Sz), % 3944426064
+ 2927531828 = erlang:phash(#{ 1 => a },Sz), % 1394238263
+ 1670235874 = erlang:phash(#{ a => 1 },Sz), % 4066388227
+
+ 3935089469 = erlang:phash(#{{} => <<>>},Sz), % 1578050717
+ 71692856 = erlang:phash(#{<<>> => {}},Sz), % 1578050717
+
+ M0 = #{ a => 1, "key" => <<"value">> },
+ M1 = maps:remove("key",M0),
+ M2 = M1#{ "key" => <<"value">> },
+
+ 2620391445 = erlang:phash(M0,Sz), % 3590546636
+ 1670235874 = erlang:phash(M1,Sz), % 4066388227
+ 2620391445 = erlang:phash(M2,Sz), % 3590546636
+ ok.
+
+t_bif_erlang_hash() ->
+ Sz = 1 bsl 27 - 1,
+ 39684169 = erlang:hash(#{},Sz), % 5158
+ 33673142 = erlang:hash(#{ a => 1, "a" => 2, <<"a">> => 3, {a,b} => 4 },Sz), % 71555838
+ 95337869 = erlang:hash(#{ 1 => a, 2 => "a", 3 => <<"a">>, 4 => {a,b} },Sz), % 5497225
+ 108959561 = erlang:hash(#{ 1 => a },Sz), % 126071654
+ 59623150 = erlang:hash(#{ a => 1 },Sz), % 126426236
+
+ 42775386 = erlang:hash(#{{} => <<>>},Sz), % 101655720
+ 71692856 = erlang:hash(#{<<>> => {}},Sz), % 101655720
+
+ M0 = #{ a => 1, "key" => <<"value">> },
+ M1 = maps:remove("key",M0),
+ M2 = M1#{ "key" => <<"value">> },
+
+ 70254632 = erlang:hash(M0,Sz), % 38260486
+ 59623150 = erlang:hash(M1,Sz), % 126426236
+ 70254632 = erlang:hash(M2,Sz), % 38260486
+ ok.
+
+
+t_map_encode_decode(Config) when is_list(Config) ->
+ <<131,116,0,0,0,0>> = erlang:term_to_binary(#{}),
+ Pairs = [
+ {a,b},{"key","values"},{<<"key">>,<<"value">>},
+ {1,b},{[atom,1],{<<"wat">>,1,2,3}},
+ {aa,"values"},
+ {1 bsl 64 + (1 bsl 50 - 1), sc1},
+ {99, sc2},
+ {1 bsl 65 + (1 bsl 51 - 1), sc3},
+ {88, sc4},
+ {1 bsl 66 + (1 bsl 52 - 1), sc5},
+ {77, sc6},
+ {1 bsl 67 + (1 bsl 53 - 1), sc3},
+ {75, sc6}, {-10,sc8},
+ {<<>>, sc9}, {3.14158, sc10},
+ {[3.14158], sc11}, {more_atoms, sc12},
+ {{more_tuples}, sc13}, {self(), sc14},
+ {{},{}},{[],[]}
+ ],
+ ok = map_encode_decode_and_match(Pairs,[],#{}),
+
+ %% check sorting
+
+ %% literally #{ b=>2, a=>1 } in the internal order
+ #{ a:=1, b:=2 } =
+ erlang:binary_to_term(<<131,116,0,0,0,2,100,0,1,98,97,2,100,0,1,97,97,1>>),
+
+
+ %% literally #{ "hi" => "value", a=>33, b=>55 } in the internal order
+ #{ a:=33, b:=55, "hi" := "value"} = erlang:binary_to_term(<<131,116,0,0,0,3,
+ 107,0,2,104,105, % "hi" :: list()
+ 107,0,5,118,97,108,117,101, % "value" :: list()
+ 100,0,1,97, % a :: atom()
+ 97,33, % 33 :: integer()
+ 100,0,1,98, % b :: atom()
+ 97,55 % 55 :: integer()
+ >>),
+
+ %% Maps of different sizes
+ lists:foldl(fun(Key, M0) ->
+ M1 = M0#{Key => Key},
+ case Key rem 17 of
+ 0 ->
+ M1 = binary_to_term(term_to_binary(M1));
+ _ ->
+ ok
+ end,
+ M1
+ end,
+ #{},
+ lists:seq(1,10000)),
+
+ %% many maps in same binary
+ MapList = lists:foldl(fun(K, [M|_]=Acc) -> [M#{K => K} | Acc] end,
+ [#{}],
+ lists:seq(1,100)),
+ MapList = binary_to_term(term_to_binary(MapList)),
+ MapListR = lists:reverse(MapList),
+ MapListR = binary_to_term(term_to_binary(MapListR)),
+
+ %% error cases
+ %% template: <<131,116,0,0,0,2,100,0,1,97,100,0,1,98,97,1,97,1>>
+ %% which is: #{ a=>1, b=>1 }
+
+ %% uniqueness violation
+ %% literally #{ a=>1, "hi"=>"value", a=>2 }
+ {'EXIT',{badarg,[{_,_,_,_}|_]}} = (catch
+ erlang:binary_to_term(<<131,116,0,0,0,3,
+ 100,0,1,97,
+ 97,1,
+ 107,0,2,104,105,
+ 107,0,5,118,97,108,117,101,
+ 100,0,1,97,
+ 97,2>>)),
+
+ %% bad size (too large)
+ {'EXIT',{badarg,[{_,_,_,_}|_]}} = (catch
+ erlang:binary_to_term(<<131,116,0,0,0,12,100,0,1,97,97,1,100,0,1,98,97,1>>)),
+
+ %% bad size (too small) .. should fail just truncate it .. weird.
+ %% possibly change external format so truncated will be #{a:=1}
+ #{ a:=b } =
+ erlang:binary_to_term(<<131,116,0,0,0,1,100,0,1,97,100,0,1,98,97,1,97,1>>),
+
+ ok.
+
+map_encode_decode_and_match([{K,V}|Pairs], EncodedPairs, M0) ->
+ M1 = maps:put(K,V,M0),
+ B0 = erlang:term_to_binary(M1),
+ Ls = [{erlang:term_to_binary(K), erlang:term_to_binary(V)}|EncodedPairs],
+ ok = match_encoded_map(B0, length(Ls), Ls),
+ %% decode and match it
+ M1 = erlang:binary_to_term(B0),
+ map_encode_decode_and_match(Pairs,Ls,M1);
+map_encode_decode_and_match([],_,_) -> ok.
+
+match_encoded_map(<<131,116,Size:32,Encoded/binary>>,Size,Items) ->
+ match_encoded_map_stripped_size(Encoded,Items,Items);
+match_encoded_map(_,_,_) -> no_match_size.
+
+match_encoded_map_stripped_size(<<>>,_,_) -> ok;
+match_encoded_map_stripped_size(B0,[{<<131,K/binary>>,<<131,V/binary>>}|Items],Ls) ->
+ Ksz = byte_size(K),
+ Vsz = byte_size(V),
+ case B0 of
+ <<K:Ksz/binary,V:Vsz/binary,B1/binary>> ->
+ match_encoded_map_stripped_size(B1,Ls,Ls);
+ _ ->
+ match_encoded_map_stripped_size(B0,Items,Ls)
+ end;
+match_encoded_map_stripped_size(_,[],_) -> fail.
+
+
+t_bif_map_to_list(Config) when is_list(Config) ->
+ [] = maps:to_list(#{}),
+ [{a,1},{b,2}] = lists:sort(maps:to_list(#{a=>1,b=>2})),
+ [{a,1},{b,2},{c,3}] = lists:sort(maps:to_list(#{c=>3,a=>1,b=>2})),
+ [{a,1},{b,2},{g,3}] = lists:sort(maps:to_list(#{g=>3,a=>1,b=>2})),
+ [{a,1},{b,2},{g,3},{"c",4}] = lists:sort(maps:to_list(#{g=>3,a=>1,b=>2,"c"=>4})),
+ [{3,v2},{hi,v4},{{hi,3},v5},{"hi",v3},{<<"hi">>,v1}] =
+ lists:sort(maps:to_list(#{<<"hi">>=>v1,3=>v2,"hi"=>v3,hi=>v4,{hi,3}=>v5})),
+
+ [{3,v7},{hi,v9},{{hi,3},v10},{"hi",v8},{<<"hi">>,v6}] =
+ lists:sort(maps:to_list(#{<<"hi">>=>v1,3=>v2,"hi"=>v3,hi=>v4,{hi,3}=>v5,
+ <<"hi">>=>v6,3=>v7,"hi"=>v8,hi=>v9,{hi,3}=>v10})),
+
+ %% error cases
+ do_badmap(fun(T) ->
+ {'EXIT', {{badmap,T},_}} =
+ (catch maps:to_list(T))
+ end),
+ ok.
+
+
+t_bif_map_from_list(Config) when is_list(Config) ->
+ #{} = maps:from_list([]),
+ A = maps:from_list([]),
+ 0 = erlang:map_size(A),
+
+ #{a:=1,b:=2} = maps:from_list([{a,1},{b,2}]),
+ #{c:=3,a:=1,b:=2} = maps:from_list([{a,1},{b,2},{c,3}]),
+ #{g:=3,a:=1,b:=2} = maps:from_list([{a,1},{b,2},{g,3}]),
+
+ #{a:=2} = maps:from_list([{a,1},{a,3},{a,2}]),
+
+ #{ <<"hi">>:=v1,3:=v3,"hi":=v6,hi:=v4,{hi,3}:=v5} =
+ maps:from_list([{3,v3},{"hi",v6},{hi,v4},{{hi,3},v5},{<<"hi">>,v1}]),
+
+ #{<<"hi">>:=v6,3:=v8,"hi":=v11,hi:=v9,{hi,3}:=v10} =
+ maps:from_list([ {{hi,3},v3}, {"hi",v0},{3,v1}, {<<"hi">>,v4}, {hi,v2},
+ {<<"hi">>,v6}, {{hi,3},v10},{"hi",v11}, {hi,v9}, {3,v8}]),
+
+ %% repeated keys (large -> small)
+ Ps1 = [{a,I}|| I <- lists:seq(1,32)],
+ Ps2 = [{a,I}|| I <- lists:seq(33,64)],
+
+ M = maps:from_list(Ps1 ++ [{b,1},{c,1}] ++ Ps2),
+ #{ a := 64, b := 1, c := 1 } = M,
+
+ %% error cases
+ {'EXIT', {badarg,_}} = (catch maps:from_list([{a,b},b])),
+ {'EXIT', {badarg,_}} = (catch maps:from_list([{a,b},{b,b,3}])),
+ {'EXIT', {badarg,_}} = (catch maps:from_list([{a,b},<<>>])),
+ {'EXIT', {badarg,_}} = (catch maps:from_list([{a,b}|{b,a}])),
+ {'EXIT', {badarg,_}} = (catch maps:from_list(a)),
+ {'EXIT', {badarg,_}} = (catch maps:from_list(42)),
+ ok.
+
+t_bif_build_and_check(Config) when is_list(Config) ->
+ ok = check_build_and_remove(750,[
+ fun(K) -> [K,K] end,
+ fun(K) -> [float(K),K] end,
+ fun(K) -> K end,
+ fun(K) -> {1,K} end,
+ fun(K) -> {K} end,
+ fun(K) -> [K|K] end,
+ fun(K) -> [K,1,2,3,4] end,
+ fun(K) -> {K,atom} end,
+ fun(K) -> float(K) end,
+ fun(K) -> integer_to_list(K) end,
+ fun(K) -> list_to_atom(integer_to_list(K)) end,
+ fun(K) -> [K,{K,[K,{K,[K]}]}] end,
+ fun(K) -> <<K:32>> end
+ ]),
+
+ ok.
+
+check_build_and_remove(_,[]) -> ok;
+check_build_and_remove(N,[F|Fs]) ->
+ {M,Ks} = build_and_check(N, maps:new(), F, []),
+ ok = remove_and_check(Ks,M),
+ check_build_and_remove(N,Fs).
+
+build_and_check(0, M0, _, Ks) -> {M0, Ks};
+build_and_check(N, M0, F, Ks) ->
+ K = build_key(F,N),
+ M1 = maps:put(K,K,M0),
+ ok = check_keys_exist([I||{I,_} <- [{K,M1}|Ks]], M1),
+ M2 = maps:update(K,v,M1),
+ v = maps:get(K,M2),
+ build_and_check(N-1,M1,F,[{K,M1}|Ks]).
+
+remove_and_check([],_) -> ok;
+remove_and_check([{K,Mc}|Ks], M0) ->
+ K = maps:get(K,M0),
+ true = maps:is_key(K,M0),
+ true = Mc =:= M0,
+ true = M0 == Mc,
+ M1 = maps:remove(K,M0),
+ false = M1 =:= Mc,
+ false = Mc == M1,
+ false = maps:is_key(K,M1),
+ true = maps:is_key(K,M0),
+ ok = check_keys_exist([I||{I,_} <- Ks],M1),
+ error = maps:find(K,M1),
+ remove_and_check(Ks, M1).
+
+build_key(F,N) when N rem 3 =:= 0 -> F(N);
+build_key(F,N) when N rem 3 =:= 1 -> K = F(N), {K,K};
+build_key(F,N) when N rem 3 =:= 2 -> K = F(N), [K,K].
+
+check_keys_exist([], _) -> ok;
+check_keys_exist([K|Ks],M) ->
+ true = maps:is_key(K,M),
+ check_keys_exist(Ks,M).
+
+t_bif_merge_and_check(Config) when is_list(Config) ->
+
+ io:format("rand:export_seed() -> ~p\n",[rand:export_seed()]),
+
+ %% simple disjunct ones
+ %% make sure all keys are unique
+ Kss = [[a,b,c,d],
+ [1,2,3,4],
+ [],
+ ["hi"],
+ [e],
+ [build_key(fun(K) -> {small,K} end, I) || I <- lists:seq(1,32)],
+ lists:seq(5, 28),
+ lists:seq(29, 59),
+ [build_key(fun(K) -> integer_to_list(K) end, I) || I <- lists:seq(2000,10000)],
+ [build_key(fun(K) -> <<K:32>> end, I) || I <- lists:seq(1,80)],
+ [build_key(fun(K) -> {<<K:32>>} end, I) || I <- lists:seq(100,1000)]],
+
+
+ KsMs = build_keys_map_pairs(Kss),
+ Cs = [{CKs1,CM1,CKs2,CM2} || {CKs1,CM1} <- KsMs, {CKs2,CM2} <- KsMs],
+ ok = merge_and_check_combo(Cs),
+
+ %% overlapping ones
+
+ KVs1 = [{a,1},{b,2},{c,3}],
+ KVs2 = [{b,3},{c,4},{d,5}],
+ KVs = [{I,I} || I <- lists:seq(1,32)],
+ KVs3 = KVs1 ++ KVs,
+ KVs4 = KVs2 ++ KVs,
+
+ M1 = maps:from_list(KVs1),
+ M2 = maps:from_list(KVs2),
+ M3 = maps:from_list(KVs3),
+ M4 = maps:from_list(KVs4),
+
+ M12 = maps:merge(M1,M2),
+ ok = check_key_values(KVs2 ++ [{a,1}], M12),
+ M21 = maps:merge(M2,M1),
+ ok = check_key_values(KVs1 ++ [{d,5}], M21),
+
+ M34 = maps:merge(M3,M4),
+ ok = check_key_values(KVs4 ++ [{a,1}], M34),
+ M43 = maps:merge(M4,M3),
+ ok = check_key_values(KVs3 ++ [{d,5}], M43),
+
+ M14 = maps:merge(M1,M4),
+ ok = check_key_values(KVs4 ++ [{a,1}], M14),
+ M41 = maps:merge(M4,M1),
+ ok = check_key_values(KVs1 ++ [{d,5}] ++ KVs, M41),
+
+ [begin Ma = random_map(SzA, a),
+ Mb = random_map(SzB, b),
+ ok = merge_maps(Ma, Mb)
+ end || SzA <- [3,10,20,100,200,1000], SzB <- [3,10,20,100,200,1000]],
+
+ ok.
+
+% Generate random map with an average of Sz number of pairs: K -> {V,K}
+random_map(Sz, V) ->
+ random_map_insert(#{}, 0, V, Sz*2).
+
+random_map_insert(M0, K0, _, Sz) when K0 > Sz ->
+ M0;
+random_map_insert(M0, K0, V, Sz) ->
+ Key = K0 + rand:uniform(3),
+ random_map_insert(M0#{Key => {V,Key}}, Key, V, Sz).
+
+
+merge_maps(A, B) ->
+ AB = maps:merge(A, B),
+ %%io:format("A=~p\nB=~p\n",[A,B]),
+ maps_foreach(fun(K,VB) -> VB = maps:get(K, AB)
+ end, B),
+ maps_foreach(fun(K,VA) ->
+ case {maps:get(K, AB),maps:find(K, B)} of
+ {VA, error} -> ok;
+ {VB, {ok, VB}} -> ok
+ end
+ end, A),
+
+ maps_foreach(fun(K,V) ->
+ case {maps:find(K, A),maps:find(K, B)} of
+ {{ok, V}, error} -> ok;
+ {error, {ok, V}} -> ok;
+ {{ok,_}, {ok, V}} -> ok
+ end
+ end, AB),
+ ok.
+
+maps_foreach(Fun, Map) ->
+ maps:fold(fun(K,V,_) -> Fun(K,V) end, void, Map).
+
+
+check_key_values([],_) -> ok;
+check_key_values([{K,V}|KVs],M) ->
+ V = maps:get(K,M),
+ check_key_values(KVs,M).
+
+merge_and_check_combo([]) -> ok;
+merge_and_check_combo([{Ks1,M1,Ks2,M2}|Cs]) ->
+ M12 = maps:merge(M1,M2),
+ ok = check_keys_exist(Ks1 ++ Ks2, M12),
+ M21 = maps:merge(M2,M1),
+ ok = check_keys_exist(Ks1 ++ Ks2, M21),
+
+ true = M12 =:= M21,
+ M12 = M21,
+
+ merge_and_check_combo(Cs).
+
+build_keys_map_pairs([]) -> [];
+build_keys_map_pairs([Ks|Kss]) ->
+ M = maps:from_list(keys_to_pairs(Ks)),
+ ok = check_keys_exist(Ks, M),
+ [{Ks,M}|build_keys_map_pairs(Kss)].
+
+keys_to_pairs(Ks) -> [{K,K} || K <- Ks].
+
+
+%% Maps module, not BIFs
+t_maps_fold(_Config) ->
+ Vs = lists:seq(1,100),
+ M = maps:from_list([{{k,I},{v,I}}||I<-Vs]),
+
+ %% fold
+ 5050 = maps:fold(fun({k,_},{v,V},A) -> V + A end, 0, M),
+
+ ok.
+
+t_maps_map(_Config) ->
+ Vs = lists:seq(1,100),
+ M1 = maps:from_list([{I,I}||I<-Vs]),
+ M2 = maps:from_list([{I,{token,I}}||I<-Vs]),
+
+ M2 = maps:map(fun(_K,V) -> {token,V} end, M1),
+ ok.
+
+t_maps_size(_Config) ->
+ Vs = lists:seq(1,100),
+ lists:foldl(fun(I,M) ->
+ M1 = maps:put(I,I,M),
+ I = maps:size(M1),
+ M1
+ end, #{}, Vs),
+ ok.
+
+
+t_maps_without(_Config) ->
+ Ki = [11,22,33,44,55,66,77,88,99],
+ M0 = maps:from_list([{{k,I},{v,I}}||I<-lists:seq(1,100)]),
+ M1 = maps:from_list([{{k,I},{v,I}}||I<-lists:seq(1,100) -- Ki]),
+ M1 = maps:without([{k,I}||I <- Ki],M0),
+ ok.
+
+t_erts_internal_order(_Config) when is_list(_Config) ->
+ M = #{0 => 0,2147483648 => 0},
+ true = M =:= binary_to_term(term_to_binary(M)),
+
+ F1 = fun(_, _) -> 0 end,
+ F2 = fun(_, _) -> 1 end,
+ M0 = maps:from_list( [{-2147483649, 0}, {0,0}, {97, 0}, {false, 0}, {flower, 0}, {F1, 0}, {F2, 0}, {<<>>, 0}]),
+ M1 = maps:merge(M0, #{0 => 1}),
+ 8 = maps:size(M1),
+ 1 = maps:get(0,M1),
+ ok.
+
+t_erts_internal_hash(_Config) when is_list(_Config) ->
+ K1 = 0.0,
+ K2 = 0.0/-1,
+ M = maps:from_list([{I,I}||I<-lists:seq(1,32)]),
+
+ M1 = M#{ K1 => a, K2 => b },
+ b = maps:get(K2,M1),
+
+ M2 = M#{ K2 => a, K1 => b },
+ b = maps:get(K1,M2),
+
+ %% test previously faulty hash list optimization
+
+ M3 = M#{[0] => a, [0,0] => b, [0,0,0] => c, [0,0,0,0] => d},
+ a = maps:get([0],M3),
+ b = maps:get([0,0],M3),
+ c = maps:get([0,0,0],M3),
+ d = maps:get([0,0,0,0],M3),
+
+ M4 = M#{{[0]} => a, {[0,0]} => b, {[0,0,0]} => c, {[0,0,0,0]} => d},
+ a = maps:get({[0]},M4),
+ b = maps:get({[0,0]},M4),
+ c = maps:get({[0,0,0]},M4),
+ d = maps:get({[0,0,0,0]},M4),
+
+ M5 = M3#{[0,0,0] => e, [0,0,0,0] => f, [0,0,0,0,0] => g,
+ [0,0,0,0,0,0] => h, [0,0,0,0,0,0,0] => i,
+ [0,0,0,0,0,0,0,0] => j, [0,0,0,0,0,0,0,0,0] => k},
+
+ a = maps:get([0],M5),
+ b = maps:get([0,0],M5),
+ e = maps:get([0,0,0],M5),
+ f = maps:get([0,0,0,0],M5),
+ g = maps:get([0,0,0,0,0],M5),
+ h = maps:get([0,0,0,0,0,0],M5),
+ i = maps:get([0,0,0,0,0,0,0],M5),
+ j = maps:get([0,0,0,0,0,0,0,0],M5),
+ k = maps:get([0,0,0,0,0,0,0,0,0],M5),
+
+ M6 = M4#{{[0,0,0]} => e, {[0,0,0,0]} => f, {[0,0,0,0,0]} => g,
+ {[0,0,0,0,0,0]} => h, {[0,0,0,0,0,0,0]} => i,
+ {[0,0,0,0,0,0,0,0]} => j, {[0,0,0,0,0,0,0,0,0]} => k},
+
+ a = maps:get({[0]},M6),
+ b = maps:get({[0,0]},M6),
+ e = maps:get({[0,0,0]},M6),
+ f = maps:get({[0,0,0,0]},M6),
+ g = maps:get({[0,0,0,0,0]},M6),
+ h = maps:get({[0,0,0,0,0,0]},M6),
+ i = maps:get({[0,0,0,0,0,0,0]},M6),
+ j = maps:get({[0,0,0,0,0,0,0,0]},M6),
+ k = maps:get({[0,0,0,0,0,0,0,0,0]},M6),
+
+ M7 = maps:merge(M5,M6),
+
+ a = maps:get([0],M7),
+ b = maps:get([0,0],M7),
+ e = maps:get([0,0,0],M7),
+ f = maps:get([0,0,0,0],M7),
+ g = maps:get([0,0,0,0,0],M7),
+ h = maps:get([0,0,0,0,0,0],M7),
+ i = maps:get([0,0,0,0,0,0,0],M7),
+ j = maps:get([0,0,0,0,0,0,0,0],M7),
+ k = maps:get([0,0,0,0,0,0,0,0,0],M7),
+ a = maps:get({[0]},M7),
+ b = maps:get({[0,0]},M7),
+ e = maps:get({[0,0,0]},M7),
+ f = maps:get({[0,0,0,0]},M7),
+ g = maps:get({[0,0,0,0,0]},M7),
+ h = maps:get({[0,0,0,0,0,0]},M7),
+ i = maps:get({[0,0,0,0,0,0,0]},M7),
+ j = maps:get({[0,0,0,0,0,0,0,0]},M7),
+ k = maps:get({[0,0,0,0,0,0,0,0,0]},M7),
+ ok.
+
+t_pdict(_Config) ->
+
+ put(#{ a => b, b => a},#{ c => d}),
+ put(get(#{ a => b, b => a}),1),
+ 1 = get(#{ c => d}),
+ #{ c := d } = get(#{ a => b, b => a}).
+
+t_ets(_Config) ->
+
+ Tid = ets:new(map_table,[]),
+
+ [ets:insert(Tid,{maps:from_list([{I,-I}]),I}) || I <- lists:seq(1,100)],
+
+
+ [{#{ 2 := -2},2}] = ets:lookup(Tid,#{ 2 => -2 }),
+
+ %% Test equal
+ [3,4] = lists:sort(
+ ets:select(Tid,[{{'$1','$2'},
+ [{'or',{'==','$1',#{ 3 => -3 }},
+ {'==','$1',#{ 4 => -4 }}}],
+ ['$2']}])),
+ %% Test match
+ [30,50] = lists:sort(
+ ets:select(Tid,
+ [{{#{ 30 => -30}, '$1'},[],['$1']},
+ {{#{ 50 => -50}, '$1'},[],['$1']}]
+ )),
+
+ ets:insert(Tid,{#{ a => b, b => c, c => a},transitivity}),
+
+ %% Test equal with map of different size
+ [] = ets:select(Tid,[{{'$1','_'},[{'==','$1',#{ b => c }}],['$_']}]),
+
+ %% Test match with map of different size
+ %[{#{ a := b },_}] = ets:select(Tid,[{{#{ b => c },'_'},[],['$_']}]),
+
+ %%% Test match with don't care value
+ %[{#{ a := b },_}] = ets:select(Tid,[{{#{ b => '_' },'_'},[],['$_']}]),
+
+ %% Test is_map bif
+ 101 = length(ets:select(Tid,[{'$1',[{is_map,{element,1,'$1'}}],['$1']}])),
+ ets:insert(Tid,{not_a_map,2}),
+ 101 = length(ets:select(Tid,[{'$1',[{is_map,{element,1,'$1'}}],['$1']}])),
+ ets:insert(Tid,{{nope,a,tuple},2}),
+ 101 = length(ets:select(Tid,[{'$1',[{is_map,{element,1,'$1'}}],['$1']}])),
+
+ %% Test map_size bif
+ [3] = ets:select(Tid,[{{'$1','_'},[{'==',{map_size,'$1'},3}],
+ [{map_size,'$1'}]}]),
+
+ true = ets:delete(Tid,#{50 => -50}),
+ [] = ets:lookup(Tid,#{50 => -50}),
+
+ ets:delete(Tid),
+ ok.
+
+t_dets(_Config) ->
+ ok.
+
+t_tracing(_Config) ->
+
+ dbg:stop_clear(),
+ {ok,Tracer} = dbg:tracer(process,{fun trace_collector/2, self()}),
+ dbg:p(self(),c),
+
+ %% Test basic map call
+ {ok,_} = dbg:tpl(?MODULE,id,x),
+ #{ a => b },
+ {trace,_,call,{?MODULE,id,[#{ a := b }]}} = getmsg(Tracer),
+ {trace,_,return_from,{?MODULE,id,1},#{ a := b }} = getmsg(Tracer),
+ dbg:ctpl(),
+
+ %% Test equals in argument list
+ {ok,_} = dbg:tpl(?MODULE,id,[{['$1'],[{'==','$1',#{ b => c}}],
+ [{return_trace}]}]),
+ #{ a => b },
+ #{ b => c },
+ {trace,_,call,{?MODULE,id,[#{ b := c }]}} = getmsg(Tracer),
+ {trace,_,return_from,{?MODULE,id,1},#{ b := c }} = getmsg(Tracer),
+ dbg:ctpl(),
+
+ %% Test match in head
+ {ok,_} = dbg:tpl(?MODULE,id,[{[#{b => c}],[],[]}]),
+ #{ a => b },
+ #{ b => c },
+ {trace,_,call,{?MODULE,id,[#{ b := c }]}} = getmsg(Tracer),
+ dbg:ctpl(),
+
+ % Test map guard bifs
+ {ok,_} = dbg:tpl(?MODULE,id,[{['$1'],[{is_map,{element,1,'$1'}}],[]}]),
+ #{ a => b },
+ {1,2},
+ {#{ a => b},2},
+ {trace,_,call,{?MODULE,id,[{#{ a := b },2}]}} = getmsg(Tracer),
+ dbg:ctpl(),
+
+ {ok,_} = dbg:tpl(?MODULE,id,[{['$1'],[{'==',{map_size,{element,1,'$1'}},2}],[]}]),
+ #{ a => b },
+ {1,2},
+ {#{ a => b},2},
+ {#{ a => b, b => c},atom},
+ {trace,_,call,{?MODULE,id,[{#{ a := b, b := c },atom}]}} = getmsg(Tracer),
+ dbg:ctpl(),
+
+ %MS = dbg:fun2ms(fun([A]) when A == #{ a => b} -> ok end),
+ %dbg:tpl(?MODULE,id,MS),
+ %#{ a => b },
+ %#{ b => c },
+ %{trace,_,call,{?MODULE,id,[#{ a := b }]}} = getmsg(Tracer),
+ %dbg:ctpl(),
+
+ %% Check to extra messages
+ timeout = getmsg(Tracer),
+
+ dbg:stop_clear(),
+ ok.
+
+getmsg(_Tracer) ->
+ receive V -> V after 100 -> timeout end.
+
+trace_collector(Msg,Parent) ->
+ io:format("~p~n",[Msg]),
+ Parent ! Msg,
+ Parent.
+
+t_has_map_fields(Config) when is_list(Config) ->
+ true = has_map_fields_1(#{one=>1}),
+ true = has_map_fields_1(#{one=>1,two=>2}),
+ false = has_map_fields_1(#{two=>2}),
+ false = has_map_fields_1(#{}),
+
+ true = has_map_fields_2(#{c=>1,b=>2,a=>3}),
+ true = has_map_fields_2(#{c=>1,b=>2,a=>3,x=>42}),
+ false = has_map_fields_2(#{b=>2,c=>1}),
+ false = has_map_fields_2(#{x=>y}),
+ false = has_map_fields_2(#{}),
+
+ true = has_map_fields_3(#{c=>1,b=>2,a=>3}),
+ true = has_map_fields_3(#{c=>1,b=>2,a=>3,[]=>42}),
+ true = has_map_fields_3(#{b=>2,a=>3,[]=>42,42.0=>43}),
+ true = has_map_fields_3(#{a=>3,[]=>42,42.0=>43}),
+ true = has_map_fields_3(#{[]=>42,42.0=>43}),
+ false = has_map_fields_3(#{b=>2,c=>1}),
+ false = has_map_fields_3(#{[]=>y}),
+ false = has_map_fields_3(#{42.0=>x,a=>99}),
+ false = has_map_fields_3(#{}),
+
+ ok.
+
+has_map_fields_1(#{one:=_}) -> true;
+has_map_fields_1(#{}) -> false.
+
+has_map_fields_2(#{a:=_,b:=_,c:=_}) -> true;
+has_map_fields_2(#{}) -> false.
+
+has_map_fields_3(#{a:=_,b:=_}) -> true;
+has_map_fields_3(#{[]:=_,42.0:=_}) -> true;
+has_map_fields_3(#{}) -> false.
+
+y_regs(Config) when is_list(Config) ->
+ Val = [length(Config)],
+ Map0 = y_regs_update(#{}, Val),
+ Map2 = y_regs_update(Map0, Val),
+
+ Map3 = maps:from_list([{I,I*I} || I <- lists:seq(1, 100)]),
+ Map4 = y_regs_update(Map3, Val),
+
+ true = is_map(Map2) andalso is_map(Map4),
+
+ ok.
+
+y_regs_update(Map0, Val0) ->
+ Val1 = {t,Val0},
+ K1 = {key,1},
+ K2 = {key,2},
+ Map1 = Map0#{K1=>K1,
+ a=>Val0,b=>Val0,c=>Val0,d=>Val0,e=>Val0,
+ f=>Val0,g=>Val0,h=>Val0,i=>Val0,j=>Val0,
+ k=>Val0,l=>Val0,m=>Val0,n=>Val0,o=>Val0,
+ p=>Val0,q=>Val0,r=>Val0,s=>Val0,t=>Val0,
+ u=>Val0,v=>Val0,w=>Val0,x=>Val0,y=>Val0,
+ z=>Val0,
+ aa=>Val0,ab=>Val0,ac=>Val0,ad=>Val0,ae=>Val0,
+ af=>Val0,ag=>Val0,ah=>Val0,ai=>Val0,aj=>Val0,
+ ak=>Val0,al=>Val0,am=>Val0,an=>Val0,ao=>Val0,
+ ap=>Val0,aq=>Val0,ar=>Val0,as=>Val0,at=>Val0,
+ au=>Val0,av=>Val0,aw=>Val0,ax=>Val0,ay=>Val0,
+ az=>Val0,
+ K2=>[a,b,c]},
+ Map2 = Map1#{K1=>K1,
+ a:=Val1,b:=Val1,c:=Val1,d:=Val1,e:=Val1,
+ f:=Val1,g:=Val1,h:=Val1,i:=Val1,j:=Val1,
+ k:=Val1,l:=Val1,m:=Val1,n:=Val1,o:=Val1,
+ p:=Val1,q:=Val1,r:=Val1,s:=Val1,t:=Val1,
+ u:=Val1,v:=Val1,w:=Val1,x:=Val1,y:=Val1,
+ z:=Val1,
+ aa:=Val1,ab:=Val1,ac:=Val1,ad:=Val1,ae:=Val1,
+ af:=Val1,ag:=Val1,ah:=Val1,ai:=Val1,aj:=Val1,
+ ak:=Val1,al:=Val1,am:=Val1,an:=Val1,ao:=Val1,
+ ap:=Val1,aq:=Val1,ar:=Val1,as:=Val1,at:=Val1,
+ au:=Val1,av:=Val1,aw:=Val1,ax:=Val1,ay:=Val1,
+ az:=Val1,
+ K2=>[a,b,c]},
+
+ %% Traverse the maps to validate them.
+ _ = erlang:phash2({Map1,Map2}, 100000),
+
+ _ = {K1,K2,Val0,Val1}, %Force use of Y registers.
+ Map2.
+
+do_badmap(Test) ->
+ Terms = [Test,fun erlang:abs/1,make_ref(),self(),0.0/-1,
+ <<0:1024>>,<<1:1>>,<<>>,<<1,2,3>>,
+ [],{a,b,c},[a,b],atom,10.0,42,(1 bsl 65) + 3],
+ [Test(T) || T <- Terms].
diff --git a/lib/dialyzer/test/map_SUITE_data/src/map_in_guard.erl b/lib/dialyzer/test/map_SUITE_data/src/map_in_guard.erl
new file mode 100644
index 0000000000..6176ef1fdf
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/map_in_guard.erl
@@ -0,0 +1,35 @@
+-module(map_in_guard).
+
+-export([test/0, raw_expr/0]).
+
+test() ->
+ false = assoc_guard(#{}),
+ true = assoc_guard(not_a_map),
+ #{a := true} = assoc_update(#{}),
+ {'EXIT', {{badmap, not_a_map}, [{?MODULE, assoc_update, 1, _}|_]}}
+ = (catch assoc_update(not_a_map)),
+ ok = assoc_guard_clause(#{}),
+ {'EXIT', {function_clause, [{?MODULE, assoc_guard_clause, _, _}|_]}}
+ = (catch assoc_guard_clause(not_a_map)),
+ true = exact_guard(#{a=>1}),
+ {'EXIT', {function_clause, [{?MODULE, assoc_guard_clause, _, _}|_]}}
+ %% There's nothing we can do to find the error here, is there?
+ = (catch (begin true = exact_guard(#{}) end)),
+ ok = exact_guard_clause(#{a => q}),
+ {'EXIT', {function_clause, [{?MODULE, exact_guard_clause, _, _}|_]}}
+ = (catch exact_guard_clause(#{})),
+ ok.
+
+assoc_guard(M) when is_map(M#{a => b}) -> true;
+assoc_guard(Q) -> false.
+
+assoc_update(M) -> M#{a => true}.
+
+assoc_guard_clause(M) when is_map(M#{a => 3}) -> ok.
+
+exact_guard(M) when (false =/= M#{a := b}) -> true;
+exact_guard(_) -> false.
+
+exact_guard_clause(M) when (false =/= M#{a := b}) -> ok.
+
+raw_expr() when #{}; true -> ok. %% Must not warn here!
diff --git a/lib/dialyzer/test/map_SUITE_data/src/map_in_guard2.erl b/lib/dialyzer/test/map_SUITE_data/src/map_in_guard2.erl
new file mode 100644
index 0000000000..ac2205e8fa
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/map_in_guard2.erl
@@ -0,0 +1,27 @@
+-module(map_in_guard2).
+
+-export([test/0]).
+
+test() ->
+ false = assoc_guard(not_a_map),
+ {'EXIT', {{badmap, not_a_map}, [{?MODULE, assoc_update, 1, _}|_]}}
+ = (catch assoc_update(not_a_map)),
+ {'EXIT', {function_clause, [{?MODULE, assoc_guard_clause, _, _}|_]}}
+ = (catch assoc_guard_clause(not_a_map)),
+ {'EXIT', {function_clause, [{?MODULE, assoc_guard_clause, _, _}|_]}}
+ = (catch (begin true = exact_guard(#{}) end)),
+ {'EXIT', {function_clause, [{?MODULE, exact_guard_clause, _, _}|_]}}
+ = (catch exact_guard_clause(#{})),
+ ok.
+
+assoc_guard(M) when is_map(M#{a => b}) -> true;
+assoc_guard(_) -> false.
+
+assoc_update(M) -> M#{a => true}.
+
+assoc_guard_clause(M) when is_map(M#{a => 3}) -> ok.
+
+exact_guard(M) when (false =/= M#{a := b}) -> true;
+exact_guard(_) -> false.
+
+exact_guard_clause(M) when (false =/= M#{a := b}) -> ok.
diff --git a/lib/dialyzer/test/map_SUITE_data/src/map_size.erl b/lib/dialyzer/test/map_SUITE_data/src/map_size.erl
new file mode 100644
index 0000000000..2da4f6904e
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/map_size.erl
@@ -0,0 +1,36 @@
+-module(map_size).
+
+-export([t1/0, e1/0, t2/0, t3/0, t4/0, t5/1, t6/1, t7/1]).
+
+t1() ->
+ 0 = maps:size(#{}),
+ 1 = maps:size(#{}).
+
+e1() ->
+ 0 = map_size(#{}),
+ 1 = map_size(#{}).
+
+t2() -> p(#{a=>x}).
+
+p(M) when map_size(M) =:= 0 -> ok.
+
+t3() ->
+ 1 = map_size(cio()),
+ 2 = map_size(cio()),
+ 3 = map_size(cio()),
+ 4 = map_size(cio()).
+
+t4() ->
+ 0 = map_size(cio()).
+
+t5(M) when map_size(M) =:= 0 ->
+ #{a := _} = M. %% Only t5 has no local return; want better message
+
+t6(M) when map_size(M) =:= 0 ->
+ #{} = M.
+
+t7(M=#{a := _}) when map_size(M) =:= 1 ->
+ #{b := _} = M. %% We should warn here too
+
+-spec cio() -> #{3 := ok, 9 => _, 11 => x}.
+cio() -> binary_to_term(<<131,116,0,0,0,2,97,3,100,0,2,111,107,97,9,97,6>>).
diff --git a/lib/dialyzer/test/map_SUITE_data/src/maps_merge.erl b/lib/dialyzer/test/map_SUITE_data/src/maps_merge.erl
new file mode 100644
index 0000000000..d4f3c6887a
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/maps_merge.erl
@@ -0,0 +1,29 @@
+-module(maps_merge).
+
+-export([t1/0, t2/0, t3/0, t4/0, t5/0]).
+
+t1() ->
+ #{a:=1} = maps:merge(#{}, #{}).
+
+t2() ->
+ #{hej := _} = maps:merge(cao(), cio()),
+ #{{} := _} = maps:merge(cao(), cio()).
+
+t3() ->
+ #{a:=1} = maps:merge(cao(), cio()),
+ #{7:=q} = maps:merge(cao(), cio()).
+
+t4() ->
+ #{a:=1} = maps:merge(cio(), cao()),
+ #{7:=q} = maps:merge(cio(), cao()).
+
+t5() ->
+ #{a:=2} = maps:merge(cao(), #{}).
+
+-spec cao() -> #{a := 1, q => none(), 11 => _, atom() => _}.
+cao() ->
+ binary_to_term(<<131,116,0,0,0,3,100,0,1,97,97,1,100,0,1,98,97,9,100,0,1,
+ 102,104,0>>).
+
+-spec cio() -> #{3 := ok, 7 => none(), z => _, integer() => _}.
+cio() -> binary_to_term(<<131,116,0,0,0,2,97,3,100,0,2,111,107,97,9,97,6>>).
diff --git a/lib/dialyzer/test/map_SUITE_data/src/opaque_key/opaque_key_adt.erl b/lib/dialyzer/test/map_SUITE_data/src/opaque_key/opaque_key_adt.erl
new file mode 100644
index 0000000000..b98c713c6b
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/opaque_key/opaque_key_adt.erl
@@ -0,0 +1,69 @@
+-module(opaque_key_adt).
+
+-compile(export_all).
+
+-export_type([t/0, t/1, m/0, s/1, sm/1]).
+
+-opaque t() :: #{atom() => integer()}.
+-opaque t(A) :: #{A => integer()}.
+
+-opaque m() :: #{t() => integer()}.
+-type mt() :: #{t() => integer()}.
+
+-opaque s(K) :: #{K => integer(), integer() => atom()}.
+-opaque sm(K) :: #{K := integer(), integer() := atom()}.
+-type smt(K) :: #{K := integer(), integer() := atom()}.
+
+-spec t0() -> t().
+t0() -> #{}.
+
+-spec t1() -> t(integer()).
+t1() -> #{3 => 1}.
+
+-spec m0() -> m().
+m0() -> #{#{} => 3}.
+
+-spec mt0() -> mt().
+mt0() -> #{#{} => 3}.
+
+-spec s0() -> s(atom()).
+s0() -> #{}.
+
+-spec s1() -> s(atom()).
+s1() -> #{3 => a}.
+
+-spec s2() -> s(atom() | 3).
+s2() -> #{3 => a}. %% Contract breakage (not found)
+
+-spec s3() -> s(atom() | 3).
+s3() -> #{3 => 5, a => 6, 7 => 8}.
+
+-spec s4() -> s(integer()).
+s4() -> #{1 => a}. %% Contract breakage
+
+-spec s5() -> s(1).
+s5() -> #{2 => 3}. %% Contract breakage
+
+-spec s6() -> s(1).
+s6() -> #{1 => 3}.
+
+-spec s7() -> s(integer()).
+s7() -> #{1 => 3}.
+
+-spec sm1() -> sm(1).
+sm1() -> #{1 => 2, 3 => a}.
+
+-spec smt1() -> smt(1).
+smt1() -> #{3 => a}. %% Contract breakage
+
+-spec smt2() -> smt(1).
+smt2() -> #{1 => a}. %% Contract breakage
+
+-spec smt3() -> smt(q).
+smt3() -> #{q => 1}. %% Slight contract breakage (probably requires better map type)
+
+-spec smt4() -> smt(q).
+smt4() -> #{q => 2, 3 => a}.
+
+-spec smt5() -> smt(1).
+smt5() -> #{1 => 2, 3 => a}.
diff --git a/lib/dialyzer/test/map_SUITE_data/src/opaque_key/opaque_key_use.erl b/lib/dialyzer/test/map_SUITE_data/src/opaque_key/opaque_key_use.erl
new file mode 100644
index 0000000000..917413fdd2
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/opaque_key/opaque_key_use.erl
@@ -0,0 +1,97 @@
+-module(opaque_key_use).
+
+-compile(export_all).
+
+-export_type([t/0, t/1]).
+
+-opaque t() :: #{atom() => integer()}.
+-opaque t(A) :: #{A => integer()}.
+
+tt1() ->
+ A = t0(),
+ B = t1(),
+ A =:= B. % never 'true'
+
+-spec t0() -> t().
+t0() -> #{a => 1}.
+
+-spec t1() -> t(integer()).
+t1() -> #{3 => 1}.
+
+adt_tt1() ->
+ A = adt_t0(),
+ B = adt_t1(),
+ A =:= B. % opaque attempt
+
+adt_tt2() ->
+ A = adt_t0(),
+ B = adt_t1(),
+ #{A => 1 % opaque key
+ ,B => 2 % opaque key
+ }.
+
+adt_tt3() ->
+ A = map_adt:t0(),
+ #{A => 1}. % opaque key
+
+adt_mm1() ->
+ A = adt_t0(),
+ M = adt_m0(),
+ #{A := R} = M, % opaque attempt
+ R.
+
+%% adt_ms1() ->
+%% A = adt_t0(),
+%% M = adt_m0(),
+%% M#{A}. % opaque arg
+
+adt_mu1() ->
+ A = adt_t0(),
+ M = adt_m0(),
+ M#{A := 4}. % opaque arg
+
+adt_mu2() ->
+ A = adt_t0(),
+ M = adt_m0(),
+ M#{A => 4}. % opaque arg
+
+adt_mu3() ->
+ M = adt_m0(),
+ M#{}. % opaque arg
+
+adt_mtm1() ->
+ A = adt_t0(),
+ M = adt_mt0(),
+ #{A := R} = M, % opaque key
+ R.
+
+%% adt_mts1() ->
+%% A = adt_t0(),
+%% M = adt_mt0(),
+%% M#{A}. % opaque key
+
+adt_mtu1() ->
+ A = adt_t0(),
+ M = adt_mt0(),
+ M#{A := 4}. % opaque key
+
+adt_mtu2() ->
+ A = adt_t0(),
+ M = adt_mt0(),
+ M#{A => 4}. % opaque key
+
+adt_mtu3() ->
+ M = adt_mt0(),
+ M#{}. % Ok to not warn
+
+adt_t0() ->
+ opaque_key_adt:t0().
+
+adt_t1() ->
+ opaque_key_adt:t1().
+
+adt_m0() ->
+ opaque_key_adt:m0().
+
+adt_mt0() ->
+ opaque_key_adt:mt0().
diff --git a/lib/dialyzer/test/map_SUITE_data/src/order.erl b/lib/dialyzer/test/map_SUITE_data/src/order.erl
new file mode 100644
index 0000000000..51868d7e94
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/order.erl
@@ -0,0 +1,56 @@
+-module(order).
+
+-export([t1/0, t2/0, t3/0, t4/0, t5/0, t6/0]).
+
+t1() ->
+ case maps:get(a, #{a=>1, a=>b}) of
+ Int when is_integer(Int) -> fail;
+ Atom when is_atom(Atom) -> error(ok);
+ _Else -> fail
+ end.
+
+t2() ->
+ case maps:get(a, #{a=>id_1(1), a=>id_b(b)}) of
+ Int when is_integer(Int) -> fail;
+ Atom when is_atom(Atom) -> error(ok);
+ _Else -> fail
+ end.
+
+t3() ->
+ case maps:get(a, #{a=>id_1(1), id_a(a)=>id_b(b)}) of
+ Int when is_integer(Int) -> fail;
+ Atom when is_atom(Atom) -> error(ok);
+ _Else -> fail
+ end.
+
+t4() ->
+ case maps:get(a, #{a=>id_1(1), a_or_b()=>id_b(b)}) of
+ Int when is_integer(Int) -> ok;
+ Atom when is_atom(Atom) -> ok;
+ _Else -> fail
+ end.
+
+t5() ->
+ case maps:get(c, #{c=>id_1(1), a_or_b()=>id_b(b)}) of
+ Int when is_integer(Int) -> error(ok);
+ Atom when is_atom(Atom) -> fail;
+ _Else -> fail
+ end.
+
+t6() ->
+ case maps:get(a, #{a_or_b()=>id_1(1), id_a(a)=>id_b(b)}) of
+ Int when is_integer(Int) -> fail;
+ Atom when is_atom(Atom) -> error(ok);
+ _Else -> fail
+ end.
+
+id_1(X) -> X.
+
+id_a(X) -> X.
+
+id_b(X) -> X.
+
+any() -> binary_to_term(<<>>).
+
+-spec a_or_b() -> a | b.
+a_or_b() -> any().
diff --git a/lib/dialyzer/test/map_SUITE_data/src/subtract_value_flip.erl b/lib/dialyzer/test/map_SUITE_data/src/subtract_value_flip.erl
new file mode 100644
index 0000000000..97e6b54e3c
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/subtract_value_flip.erl
@@ -0,0 +1,9 @@
+-module(subtract_value_flip).
+
+-export([t1/1]).
+
+t1(#{type := _Smth} = Map) ->
+ case Map of
+ #{type := a} -> ok;
+ #{type := b} -> error
+ end.
diff --git a/lib/dialyzer/test/map_SUITE_data/src/typeflow.erl b/lib/dialyzer/test/map_SUITE_data/src/typeflow.erl
new file mode 100644
index 0000000000..b43fd6897b
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/typeflow.erl
@@ -0,0 +1,25 @@
+-module(typeflow).
+
+-export([t1/1, t2/1, t3/1, t4/1]).
+
+t1(M = #{}) ->
+ a_is_integer(M),
+ case M of
+ #{a := X} when is_integer(X) -> ok;
+ _ -> fail
+ end.
+
+a_is_integer(#{a := X}) when is_integer(X) -> ok.
+
+t2(M = #{}) ->
+ a_is_integer(M),
+ lists:sort(maps:get(a, M)),
+ ok.
+
+t3(M = #{}) ->
+ lists:sort(maps:get(a, M)),
+ ok.
+
+t4(M) ->
+ lists:sort(maps:get(a, M)),
+ ok.
diff --git a/lib/dialyzer/test/map_SUITE_data/src/typeflow2.erl b/lib/dialyzer/test/map_SUITE_data/src/typeflow2.erl
new file mode 100644
index 0000000000..71a9657a60
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/typeflow2.erl
@@ -0,0 +1,88 @@
+-module(typeflow2).
+
+-export([t1/1, t2/1, t3/1, t4/1, t5/1, t6/1, t7/1, optional3/1]).
+
+t1(L) ->
+ M = only_integers_and_lists(L),
+ optional(M),
+ case M of
+ #{a := X} when is_integer(X) -> ok;
+ #{a := X} when is_list(X) -> ok; %% Must warn here
+ #{a := X} when is_pid(X) -> ok;
+ _ -> fail
+ end.
+
+optional(#{a:=X}) ->
+ true = is_integer(X);
+optional(#{}) ->
+ true.
+
+only_integers_and_lists(L) -> only_integers_and_lists(L, #{}).
+
+only_integers_and_lists([], M) -> M;
+only_integers_and_lists([{K,V}|T], M) when is_integer(V); is_list(V)->
+ only_integers_and_lists(T, M#{K => V}).
+
+t2(L) ->
+ M = only_integers_and_lists(L),
+ optional(M),
+ lists:sort(maps:get(a, M)),
+ ok.
+
+t3(L) ->
+ M = only_integers_and_lists(L),
+ lists:sort(maps:get(a, M)),
+ ok.
+
+t4(V) ->
+ M=map_with(a,V),
+ optional2(M),
+ case M of
+ #{a := X} when is_integer(X) -> ok;
+ #{a := X} when is_list(X) -> ok; %% Must warn here
+ _ -> fail
+ end.
+
+optional2(#{a:=X}) ->
+ true = is_integer(X);
+optional2(#{}) ->
+ true.
+
+map_with(K, V) when is_integer(V); is_list(V); is_atom(V) -> #{K => V}.
+
+t5(L) ->
+ M = only_integers_and_lists(L),
+ optional3(M),
+ case M of
+ #{a := X} when is_integer(X) -> ok;
+ #{a := X} when is_list(X) -> ok; %% Must warn here
+ #{a := X} when is_pid(X) -> ok; %% Must warn here
+ #{a := X} when is_atom(X) -> ok;
+ _ -> fail
+ end.
+
+t6(L) ->
+ M = only_integers_and_lists(L),
+ case M of
+ #{a := X} when is_integer(X) -> ok;
+ #{a := X} when is_list(X) -> ok; %% Must not warn here
+ _ -> fail
+ end.
+
+optional3(#{a:=X}) ->
+ true = is_integer(X);
+optional3(#{}) ->
+ true.
+
+t7(M) ->
+ optional4(M),
+ case M of
+ #{a := X} when is_integer(X) -> ok;
+ #{a := X} when is_list(X) -> ok;
+ #{a := X} when is_pid(X) -> ok; %% Must warn here
+ #{a := X} when is_atom(X) -> ok; %% Must warn here
+ _ -> fail %% Must not warn here (requires parsing)
+ end.
+
+-spec optional4(#{a=>integer()|list()}) -> true.
+optional4(#{}) -> true.
diff --git a/lib/dialyzer/test/map_SUITE_data/src/typesig.erl b/lib/dialyzer/test/map_SUITE_data/src/typesig.erl
new file mode 100644
index 0000000000..b50511af41
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/typesig.erl
@@ -0,0 +1,9 @@
+-module(typesig).
+
+-export([t1/0, t2/0, t3/0, test/1]).
+
+t1() -> test(#{a=>1}).
+t2() -> test(#{a=>{b}}).
+t3() -> test(#{a=>{3}}).
+
+test(#{a:={X}}) -> X+1.
diff --git a/lib/dialyzer/test/opaque_SUITE_data/src/modules/opaque_digraph.erl b/lib/dialyzer/test/opaque_SUITE_data/src/modules/opaque_digraph.erl
index 47185dc99d..27d937277e 100644
--- a/lib/dialyzer/test/opaque_SUITE_data/src/modules/opaque_digraph.erl
+++ b/lib/dialyzer/test/opaque_SUITE_data/src/modules/opaque_digraph.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/dialyzer/test/opaque_SUITE_data/src/modules/opaque_erl_scan.erl b/lib/dialyzer/test/opaque_SUITE_data/src/modules/opaque_erl_scan.erl
index d6b3a730bb..12506f5b4c 100644
--- a/lib/dialyzer/test/opaque_SUITE_data/src/modules/opaque_erl_scan.erl
+++ b/lib/dialyzer/test/opaque_SUITE_data/src/modules/opaque_erl_scan.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/dialyzer/test/small_SUITE_data/results/literals b/lib/dialyzer/test/small_SUITE_data/results/literals
index 222d2c0cdb..1ee39453a4 100644
--- a/lib/dialyzer/test/small_SUITE_data/results/literals
+++ b/lib/dialyzer/test/small_SUITE_data/results/literals
@@ -5,6 +5,7 @@ literals.erl:14: Function t2/0 has no local return
literals.erl:15: Record construction #r{id::'a'} violates the declared type of field id::'integer'
literals.erl:17: Function t3/0 has no local return
literals.erl:18: Record construction #r{id::'a'} violates the declared type of field id::'integer'
+literals.erl:20: Function t4/0 has no local return
literals.erl:21: Record construction #r{id::'a'} violates the declared type of field id::'integer'
literals.erl:23: Function m1/1 has no local return
literals.erl:23: Matching of pattern {'r', 'a'} tagged with a record name violates the declared type of #r{id::'integer'}
@@ -12,3 +13,5 @@ literals.erl:26: Function m2/1 has no local return
literals.erl:26: Matching of pattern {'r', 'a'} tagged with a record name violates the declared type of #r{id::'integer'}
literals.erl:29: Function m3/1 has no local return
literals.erl:29: The pattern {{'r', 'a'}} can never match the type any()
+literals.erl:32: Function m4/1 has no local return
+literals.erl:32: Matching of pattern {'r', 'a'} tagged with a record name violates the declared type of #r{id::'integer'}
diff --git a/lib/dialyzer/test/small_SUITE_data/results/maps1 b/lib/dialyzer/test/small_SUITE_data/results/maps1
index e88c91f21f..a178e96b20 100644
--- a/lib/dialyzer/test/small_SUITE_data/results/maps1
+++ b/lib/dialyzer/test/small_SUITE_data/results/maps1
@@ -1,4 +1,4 @@
maps1.erl:43: Function t3/0 has no local return
-maps1.erl:44: The call maps1:foo(~{'greger'=>3, ~{'arne'=>'anka'}~=>45}~,1) will never return since it differs in the 2nd argument from the success typing arguments: (#{},'b')
-maps1.erl:52: The call Mod:'function'(~{'literal'=>'map'}~,'another_arg') requires that Mod is of type atom() not #{}
+maps1.erl:44: The call maps1:foo(#{'greger'=>3, #{'arne'=>'anka'}=>45},1) will never return since it differs in the 1st and 2nd argument from the success typing arguments: (#{'beta':=_, ...},'b')
+maps1.erl:52: The variable Mod can never match since previous clauses completely covered the type #{}
diff --git a/lib/dialyzer/test/small_SUITE_data/results/maps_difftype b/lib/dialyzer/test/small_SUITE_data/results/maps_difftype
index 8980321135..3018b888db 100644
--- a/lib/dialyzer/test/small_SUITE_data/results/maps_difftype
+++ b/lib/dialyzer/test/small_SUITE_data/results/maps_difftype
@@ -1,3 +1,3 @@
maps_difftype.erl:10: Function empty_mismatch/1 has no local return
-maps_difftype.erl:11: The pattern ~{}~ can never match the type tuple()
+maps_difftype.erl:11: The pattern #{} can never match the type tuple()
diff --git a/lib/dialyzer/test/small_SUITE_data/results/maps_sum b/lib/dialyzer/test/small_SUITE_data/results/maps_sum
index a19c0bba96..bd192bdb93 100644
--- a/lib/dialyzer/test/small_SUITE_data/results/maps_sum
+++ b/lib/dialyzer/test/small_SUITE_data/results/maps_sum
@@ -1,4 +1,4 @@
-maps_sum.erl:15: Invalid type specification for function maps_sum:wrong1/1. The success typing is (#{}) -> any()
+maps_sum.erl:15: Invalid type specification for function maps_sum:wrong1/1. The success typing is (map()) -> any()
maps_sum.erl:26: Function wrong2/1 has no local return
maps_sum.erl:27: The call lists:foldl(fun((_,_,_) -> any()),0,Data::any()) will never return since it differs in the 1st argument from the success typing arguments: (fun((_,_) -> any()),any(),[any()])
diff --git a/lib/dialyzer/test/small_SUITE_data/src/literals.erl b/lib/dialyzer/test/small_SUITE_data/src/literals.erl
index abd7033712..354a0f4cdc 100644
--- a/lib/dialyzer/test/small_SUITE_data/src/literals.erl
+++ b/lib/dialyzer/test/small_SUITE_data/src/literals.erl
@@ -2,7 +2,7 @@
%% Bad records inside structures used to be ignored. The reason:
%% v3_core:unfold() does not annotate the parts of a literal.
-%% This example does not work perfectly yet, in particular Maps.
+%% This example does not work perfectly yet.
-export([t1/0, t2/0, t3/0, t4/0, m1/1, m2/1, m3/1, m4/1]).
@@ -18,7 +18,7 @@ t3() ->
{#r{id = a}}. % violation
t4() ->
- #{a => #r{id = a}}. % violation found, but t4() returns... (bug)
+ #{a => #r{id = a}}. % violation
m1(#r{id = a}) -> % violation
ok.
@@ -29,5 +29,5 @@ m2([#r{id = a}]) -> % violation
m3({#r{id = a}}) -> % can never match; not so good
ok.
-m4(#{a := #r{id = a}}) -> % violation not found
+m4(#{a := #r{id = a}}) -> % violation
ok.
diff --git a/lib/dialyzer/test/small_SUITE_data/src/maps1.erl b/lib/dialyzer/test/small_SUITE_data/src/maps1.erl
index bb2f66a498..597358d16a 100644
--- a/lib/dialyzer/test/small_SUITE_data/src/maps1.erl
+++ b/lib/dialyzer/test/small_SUITE_data/src/maps1.erl
@@ -21,7 +21,7 @@ recv(Packet, Fun, Chan) ->
#{id := Can_id, data := Can_data} = P = decode(Packet),
Fun(P).
--spec decode(<<_:64,_:_*8>>) -> #{id => <<_:11>>,timestamp => char()}.
+-spec decode(<<_:64,_:_*8>>) -> #{id => <<_:11>>,timestamp => char(),_ => _}.
decode(<<_:12, Len:4, Timestamp:16, 0:3, Id:11/bitstring, 0:18,
Data:Len/binary, _/binary>>) ->
#{id => Id, data => Data, timestamp => Timestamp}.
diff --git a/lib/dialyzer/test/small_SUITE_data/src/maps_redef.erl b/lib/dialyzer/test/small_SUITE_data/src/maps_redef.erl
deleted file mode 100644
index 70059f73b6..0000000000
--- a/lib/dialyzer/test/small_SUITE_data/src/maps_redef.erl
+++ /dev/null
@@ -1,12 +0,0 @@
--module(maps_redef).
-
--export([t/0]).
-
-%% OK in Erlang/OTP 17, at least.
-
--type map() :: atom(). % redefine built-in type
-
--spec t() -> map().
-
-t() ->
- a. % OK
diff --git a/lib/dialyzer/vsn.mk b/lib/dialyzer/vsn.mk
index 44982ab46d..77ea9d0413 100644
--- a/lib/dialyzer/vsn.mk
+++ b/lib/dialyzer/vsn.mk
@@ -1 +1 @@
-DIALYZER_VSN = 2.9
+DIALYZER_VSN = 2.10
diff --git a/lib/diameter/Makefile b/lib/diameter/Makefile
index 111530c75f..a0195a0988 100644
--- a/lib/diameter/Makefile
+++ b/lib/diameter/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2013. All Rights Reserved.
+# Copyright Ericsson AB 2010-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/diameter/bin/diameterc b/lib/diameter/bin/diameterc
index 90588dadb5..3dbd238c19 100755
--- a/lib/diameter/bin/diameterc
+++ b/lib/diameter/bin/diameterc
@@ -4,7 +4,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/doc/src/Makefile b/lib/diameter/doc/src/Makefile
index ae621c3e11..7a7546fc4d 100644
--- a/lib/diameter/doc/src/Makefile
+++ b/lib/diameter/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2013. All Rights Reserved.
+# Copyright Ericsson AB 2010-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/diameter/doc/src/book.xml b/lib/diameter/doc/src/book.xml
index dd5a5ea30c..b6cbcbc560 100644
--- a/lib/diameter/doc/src/book.xml
+++ b/lib/diameter/doc/src/book.xml
@@ -5,7 +5,7 @@
<header titlestyle="normal">
<copyright>
-<year>2011</year><year>2013</year>
+<year>2011</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/diameter/doc/src/depend.sed b/lib/diameter/doc/src/depend.sed
index a878460b00..9c0a417be2 100644
--- a/lib/diameter/doc/src/depend.sed
+++ b/lib/diameter/doc/src/depend.sed
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2011. All Rights Reserved.
+# Copyright Ericsson AB 2011-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml
index 5cb29c80e3..66daf6bb0b 100644
--- a/lib/diameter/doc/src/diameter.xml
+++ b/lib/diameter/doc/src/diameter.xml
@@ -21,7 +21,7 @@
<copyright>
<year>2011</year>
-<year>2015</year>
+<year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/diameter/doc/src/diameter_app.xml b/lib/diameter/doc/src/diameter_app.xml
index 4cd25c18c2..973b6eb732 100644
--- a/lib/diameter/doc/src/diameter_app.xml
+++ b/lib/diameter/doc/src/diameter_app.xml
@@ -13,7 +13,7 @@
<header>
<copyright>
-<year>2011</year><year>2013</year>
+<year>2011</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/diameter/doc/src/diameter_codec.xml b/lib/diameter/doc/src/diameter_codec.xml
index e2ebe7acf6..a0313e2877 100644
--- a/lib/diameter/doc/src/diameter_codec.xml
+++ b/lib/diameter/doc/src/diameter_codec.xml
@@ -13,7 +13,7 @@
<erlref>
<header>
<copyright>
-<year>2012</year><year>2013</year>
+<year>2012</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/diameter/doc/src/diameter_dict.xml b/lib/diameter/doc/src/diameter_dict.xml
index 087b24fb87..ae40f99aee 100644
--- a/lib/diameter/doc/src/diameter_dict.xml
+++ b/lib/diameter/doc/src/diameter_dict.xml
@@ -16,7 +16,7 @@
<header>
<copyright>
-<year>2011</year><year>2013</year>
+<year>2011</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/diameter/doc/src/diameter_examples.xml b/lib/diameter/doc/src/diameter_examples.xml
index ba3b42b88d..853ef96bb3 100644
--- a/lib/diameter/doc/src/diameter_examples.xml
+++ b/lib/diameter/doc/src/diameter_examples.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
-<year>2011</year><year>2013</year>
+<year>2011</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
diff --git a/lib/diameter/doc/src/diameter_intro.xml b/lib/diameter/doc/src/diameter_intro.xml
index 1718d1c612..cb0aa3de2a 100644
--- a/lib/diameter/doc/src/diameter_intro.xml
+++ b/lib/diameter/doc/src/diameter_intro.xml
@@ -7,7 +7,7 @@
<chapter>
<header>
<copyright>
-<year>2011</year><year>2013</year>
+<year>2011</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
diff --git a/lib/diameter/doc/src/diameter_make.xml b/lib/diameter/doc/src/diameter_make.xml
index f53ad434ae..112355816f 100644
--- a/lib/diameter/doc/src/diameter_make.xml
+++ b/lib/diameter/doc/src/diameter_make.xml
@@ -16,7 +16,7 @@
<header>
<copyright>
<year>2012</year>
-<year>2014</year>
+<year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/diameter/doc/src/diameter_sctp.xml b/lib/diameter/doc/src/diameter_sctp.xml
index 09c5c33004..9b6d629f79 100644
--- a/lib/diameter/doc/src/diameter_sctp.xml
+++ b/lib/diameter/doc/src/diameter_sctp.xml
@@ -16,7 +16,7 @@
<header>
<copyright>
<year>2011</year>
-<year>2014</year>
+<year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/diameter/doc/src/diameter_soc.xml b/lib/diameter/doc/src/diameter_soc.xml
index 2ba93bf452..ae404fcda4 100644
--- a/lib/diameter/doc/src/diameter_soc.xml
+++ b/lib/diameter/doc/src/diameter_soc.xml
@@ -9,7 +9,7 @@
<header>
<copyright>
<year>2011</year>
-<year>2013</year>
+<year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
diff --git a/lib/diameter/doc/src/diameter_soc_rfc6733.xml b/lib/diameter/doc/src/diameter_soc_rfc6733.xml
index 61931c6b5a..2098965706 100644
--- a/lib/diameter/doc/src/diameter_soc_rfc6733.xml
+++ b/lib/diameter/doc/src/diameter_soc_rfc6733.xml
@@ -3,7 +3,7 @@
<!--
<copyright>
-<year>2013</year><year>2013</year>
+<year>2013</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
diff --git a/lib/diameter/doc/src/diameter_tcp.xml b/lib/diameter/doc/src/diameter_tcp.xml
index 5fafec283c..00ccc39c15 100644
--- a/lib/diameter/doc/src/diameter_tcp.xml
+++ b/lib/diameter/doc/src/diameter_tcp.xml
@@ -27,7 +27,7 @@
<erlref>
<header>
<copyright>
-<year>2011</year><year>2013</year>
+<year>2011</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/diameter/doc/src/diameter_transport.xml b/lib/diameter/doc/src/diameter_transport.xml
index fd89fbc344..736d4cbfbd 100644
--- a/lib/diameter/doc/src/diameter_transport.xml
+++ b/lib/diameter/doc/src/diameter_transport.xml
@@ -14,7 +14,7 @@
<erlref>
<header>
<copyright>
-<year>2011</year><year>2013</year>
+<year>2011</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/diameter/doc/src/diameter_using.xml b/lib/diameter/doc/src/diameter_using.xml
index 596a6861a1..dbdb1be284 100644
--- a/lib/diameter/doc/src/diameter_using.xml
+++ b/lib/diameter/doc/src/diameter_using.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
-<year>2011</year><year>2013</year>
+<year>2011</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
diff --git a/lib/diameter/doc/src/files.mk b/lib/diameter/doc/src/files.mk
index 72f26c769e..cb4f88a375 100644
--- a/lib/diameter/doc/src/files.mk
+++ b/lib/diameter/doc/src/files.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2013. All Rights Reserved.
+# Copyright Ericsson AB 2010-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/diameter/doc/src/notes.xml b/lib/diameter/doc/src/notes.xml
index 5052515d6a..82448e7f51 100644
--- a/lib/diameter/doc/src/notes.xml
+++ b/lib/diameter/doc/src/notes.xml
@@ -11,7 +11,7 @@
<header>
<copyright>
<year>2011</year>
-<year>2014</year>
+<year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/diameter/doc/src/ref_man.xml b/lib/diameter/doc/src/ref_man.xml
index 4781878fbb..a0ef28844d 100644
--- a/lib/diameter/doc/src/ref_man.xml
+++ b/lib/diameter/doc/src/ref_man.xml
@@ -6,7 +6,7 @@
<header>
<copyright>
<year>2011</year>
-<year>2013</year>
+<year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/diameter/doc/src/seehere.sed b/lib/diameter/doc/src/seehere.sed
index 56932c4178..10eca9258e 100644
--- a/lib/diameter/doc/src/seehere.sed
+++ b/lib/diameter/doc/src/seehere.sed
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2012. All Rights Reserved.
+# Copyright Ericsson AB 2012-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/diameter/doc/src/user_man.xml b/lib/diameter/doc/src/user_man.xml
index ac5bef95f5..adfc8de880 100644
--- a/lib/diameter/doc/src/user_man.xml
+++ b/lib/diameter/doc/src/user_man.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
-<year>2011</year><year>2013</year>
+<year>2011</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/diameter/examples/code/client_cb.erl b/lib/diameter/examples/code/client_cb.erl
index 213c0b8bc6..ed1d3b9b7b 100644
--- a/lib/diameter/examples/code/client_cb.erl
+++ b/lib/diameter/examples/code/client_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/examples/code/redirect.erl b/lib/diameter/examples/code/redirect.erl
index 393e30fe1b..6934e54507 100644
--- a/lib/diameter/examples/code/redirect.erl
+++ b/lib/diameter/examples/code/redirect.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/examples/code/redirect_cb.erl b/lib/diameter/examples/code/redirect_cb.erl
index 021d061e6d..8325e86391 100644
--- a/lib/diameter/examples/code/redirect_cb.erl
+++ b/lib/diameter/examples/code/redirect_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/examples/code/relay_cb.erl b/lib/diameter/examples/code/relay_cb.erl
index dba0f302ec..6df1738143 100644
--- a/lib/diameter/examples/code/relay_cb.erl
+++ b/lib/diameter/examples/code/relay_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/examples/code/sctp.erl b/lib/diameter/examples/code/sctp.erl
index e0fed17fe3..86a7023142 100644
--- a/lib/diameter/examples/code/sctp.erl
+++ b/lib/diameter/examples/code/sctp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/examples/dict/GNUmakefile b/lib/diameter/examples/dict/GNUmakefile
index 3f4178aa49..9f1e74c83a 100644
--- a/lib/diameter/examples/dict/GNUmakefile
+++ b/lib/diameter/examples/dict/GNUmakefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2013. All Rights Reserved.
+# Copyright Ericsson AB 2013-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/diameter/examples/dict/depend.sed b/lib/diameter/examples/dict/depend.sed
index 1b91c493f0..127e4f67cc 100644
--- a/lib/diameter/examples/dict/depend.sed
+++ b/lib/diameter/examples/dict/depend.sed
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2013. All Rights Reserved.
+# Copyright Ericsson AB 2013-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/diameter/examples/dict/rfc4004_mip.dia b/lib/diameter/examples/dict/rfc4004_mip.dia
index 61b2b6eec8..a03d8016b0 100644
--- a/lib/diameter/examples/dict/rfc4004_mip.dia
+++ b/lib/diameter/examples/dict/rfc4004_mip.dia
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2010-2013. All Rights Reserved.
+;; Copyright Ericsson AB 2010-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
diff --git a/lib/diameter/examples/dict/rfc4005_nas.dia b/lib/diameter/examples/dict/rfc4005_nas.dia
index f5619259f0..2039e68941 100644
--- a/lib/diameter/examples/dict/rfc4005_nas.dia
+++ b/lib/diameter/examples/dict/rfc4005_nas.dia
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2010-2013. All Rights Reserved.
+;; Copyright Ericsson AB 2010-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
diff --git a/lib/diameter/examples/dict/rfc4006_cc.dia b/lib/diameter/examples/dict/rfc4006_cc.dia
index 2a9428fc84..971bd98845 100644
--- a/lib/diameter/examples/dict/rfc4006_cc.dia
+++ b/lib/diameter/examples/dict/rfc4006_cc.dia
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2010-2013. All Rights Reserved.
+;; Copyright Ericsson AB 2010-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
diff --git a/lib/diameter/examples/dict/rfc4072_eap.dia b/lib/diameter/examples/dict/rfc4072_eap.dia
index 53be6f445e..2dcaa5f1a6 100644
--- a/lib/diameter/examples/dict/rfc4072_eap.dia
+++ b/lib/diameter/examples/dict/rfc4072_eap.dia
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2010-2013. All Rights Reserved.
+;; Copyright Ericsson AB 2010-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
diff --git a/lib/diameter/examples/dict/rfc4590_digest.dia b/lib/diameter/examples/dict/rfc4590_digest.dia
index 3db91a21a7..6a05294eb4 100644
--- a/lib/diameter/examples/dict/rfc4590_digest.dia
+++ b/lib/diameter/examples/dict/rfc4590_digest.dia
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2010-2013. All Rights Reserved.
+;; Copyright Ericsson AB 2010-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
diff --git a/lib/diameter/examples/dict/rfc4740_sip.dia b/lib/diameter/examples/dict/rfc4740_sip.dia
index 90f4d025e8..80cd15ea52 100644
--- a/lib/diameter/examples/dict/rfc4740_sip.dia
+++ b/lib/diameter/examples/dict/rfc4740_sip.dia
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2010-2013. All Rights Reserved.
+;; Copyright Ericsson AB 2010-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
diff --git a/lib/diameter/include/diameter.hrl b/lib/diameter/include/diameter.hrl
index 91ddd56cd6..1dd6850fa3 100644
--- a/lib/diameter/include/diameter.hrl
+++ b/lib/diameter/include/diameter.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/Makefile b/lib/diameter/src/Makefile
index e0bbbdfe63..7f61620fc1 100644
--- a/lib/diameter/src/Makefile
+++ b/lib/diameter/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2014. All Rights Reserved.
+# Copyright Ericsson AB 2010-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/app.sed b/lib/diameter/src/app.sed
index 78e5bd2bad..dd3806f5f1 100644
--- a/lib/diameter/src/app.sed
+++ b/lib/diameter/src/app.sed
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2014. All Rights Reserved.
+# Copyright Ericsson AB 2014-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/base/diameter_app.erl b/lib/diameter/src/base/diameter_app.erl
index 6f0c78094a..122f60dd88 100644
--- a/lib/diameter/src/base/diameter_app.erl
+++ b/lib/diameter/src/base/diameter_app.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/base/diameter_callback.erl b/lib/diameter/src/base/diameter_callback.erl
index 70c70fb5bd..f479cb6612 100644
--- a/lib/diameter/src/base/diameter_callback.erl
+++ b/lib/diameter/src/base/diameter_callback.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/base/diameter_dict.erl b/lib/diameter/src/base/diameter_dict.erl
index 1013690a5b..7db294a1b1 100644
--- a/lib/diameter/src/base/diameter_dict.erl
+++ b/lib/diameter/src/base/diameter_dict.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/base/diameter_internal.hrl b/lib/diameter/src/base/diameter_internal.hrl
index 518c0b9b1f..a0f4a8567d 100644
--- a/lib/diameter/src/base/diameter_internal.hrl
+++ b/lib/diameter/src/base/diameter_internal.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/base/diameter_misc_sup.erl b/lib/diameter/src/base/diameter_misc_sup.erl
index 2054ea7831..343688be23 100644
--- a/lib/diameter/src/base/diameter_misc_sup.erl
+++ b/lib/diameter/src/base/diameter_misc_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/base/diameter_peer_fsm_sup.erl b/lib/diameter/src/base/diameter_peer_fsm_sup.erl
index 54bd06929d..cf3c205e3f 100644
--- a/lib/diameter/src/base/diameter_peer_fsm_sup.erl
+++ b/lib/diameter/src/base/diameter_peer_fsm_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/base/diameter_session.erl b/lib/diameter/src/base/diameter_session.erl
index 4cd76ed1f1..53973649fd 100644
--- a/lib/diameter/src/base/diameter_session.erl
+++ b/lib/diameter/src/base/diameter_session.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/base/diameter_watchdog_sup.erl b/lib/diameter/src/base/diameter_watchdog_sup.erl
index 5d24e12f19..7b6669f381 100644
--- a/lib/diameter/src/base/diameter_watchdog_sup.erl
+++ b/lib/diameter/src/base/diameter_watchdog_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/compiler/diameter_dict_parser.yrl b/lib/diameter/src/compiler/diameter_dict_parser.yrl
index ef8d58d63b..4d2eb09831 100644
--- a/lib/diameter/src/compiler/diameter_dict_parser.yrl
+++ b/lib/diameter/src/compiler/diameter_dict_parser.yrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/compiler/diameter_dict_scanner.erl b/lib/diameter/src/compiler/diameter_dict_scanner.erl
index aeedc89d83..a9abb67640 100644
--- a/lib/diameter/src/compiler/diameter_dict_scanner.erl
+++ b/lib/diameter/src/compiler/diameter_dict_scanner.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/compiler/diameter_dict_util.erl b/lib/diameter/src/compiler/diameter_dict_util.erl
index 9525393128..f9f2b02e94 100644
--- a/lib/diameter/src/compiler/diameter_dict_util.erl
+++ b/lib/diameter/src/compiler/diameter_dict_util.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/compiler/diameter_exprecs.erl b/lib/diameter/src/compiler/diameter_exprecs.erl
index 2a04917995..9a0cb6baf2 100644
--- a/lib/diameter/src/compiler/diameter_exprecs.erl
+++ b/lib/diameter/src/compiler/diameter_exprecs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/compiler/diameter_make.erl b/lib/diameter/src/compiler/diameter_make.erl
index d9709029ae..eae40dbafd 100644
--- a/lib/diameter/src/compiler/diameter_make.erl
+++ b/lib/diameter/src/compiler/diameter_make.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/compiler/diameter_vsn.hrl b/lib/diameter/src/compiler/diameter_vsn.hrl
index 2efac98bff..5201e6b84d 100644
--- a/lib/diameter/src/compiler/diameter_vsn.hrl
+++ b/lib/diameter/src/compiler/diameter_vsn.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/depend.sed b/lib/diameter/src/depend.sed
index 5adf7f05d5..e385d7db4a 100644
--- a/lib/diameter/src/depend.sed
+++ b/lib/diameter/src/depend.sed
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2011. All Rights Reserved.
+# Copyright Ericsson AB 2010-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/diameter.app.src b/lib/diameter/src/diameter.app.src
index 49bfd803e7..d380ebbd92 100644
--- a/lib/diameter/src/diameter.app.src
+++ b/lib/diameter/src/diameter.app.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/diameter.appup.src b/lib/diameter/src/diameter.appup.src
index a3e21db012..12b09889d1 100644
--- a/lib/diameter/src/diameter.appup.src
+++ b/lib/diameter/src/diameter.appup.src
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/dict/acct_rfc6733.dia b/lib/diameter/src/dict/acct_rfc6733.dia
index 4eb326ce88..7690958932 100644
--- a/lib/diameter/src/dict/acct_rfc6733.dia
+++ b/lib/diameter/src/dict/acct_rfc6733.dia
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2013. All Rights Reserved.
+;; Copyright Ericsson AB 2013-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/dict/base_accounting.dia b/lib/diameter/src/dict/base_accounting.dia
index 839add8764..b719bcd128 100644
--- a/lib/diameter/src/dict/base_accounting.dia
+++ b/lib/diameter/src/dict/base_accounting.dia
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2010-2011. All Rights Reserved.
+;; Copyright Ericsson AB 2010-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/dict/base_rfc3588.dia b/lib/diameter/src/dict/base_rfc3588.dia
index f7316208a6..ef4c8388c3 100644
--- a/lib/diameter/src/dict/base_rfc3588.dia
+++ b/lib/diameter/src/dict/base_rfc3588.dia
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2010-2013. All Rights Reserved.
+;; Copyright Ericsson AB 2010-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/dict/base_rfc6733.dia b/lib/diameter/src/dict/base_rfc6733.dia
index d92760711c..a120b4eece 100644
--- a/lib/diameter/src/dict/base_rfc6733.dia
+++ b/lib/diameter/src/dict/base_rfc6733.dia
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2013. All Rights Reserved.
+;; Copyright Ericsson AB 2013-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/dict/capup_rfc6737.dia b/lib/diameter/src/dict/capup_rfc6737.dia
index 396c7de9ac..a473cc9d22 100644
--- a/lib/diameter/src/dict/capup_rfc6737.dia
+++ b/lib/diameter/src/dict/capup_rfc6737.dia
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2013. All Rights Reserved.
+;; Copyright Ericsson AB 2013-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/dict/relay.dia b/lib/diameter/src/dict/relay.dia
index 23772fedf8..c7320cc737 100644
--- a/lib/diameter/src/dict/relay.dia
+++ b/lib/diameter/src/dict/relay.dia
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2010-2011. All Rights Reserved.
+;; Copyright Ericsson AB 2010-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/info/diameter_dbg.erl b/lib/diameter/src/info/diameter_dbg.erl
index 4f5c91d24f..e1d2086871 100644
--- a/lib/diameter/src/info/diameter_dbg.erl
+++ b/lib/diameter/src/info/diameter_dbg.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/transport/diameter_etcp.erl b/lib/diameter/src/transport/diameter_etcp.erl
index 9db198ff86..10a014754f 100644
--- a/lib/diameter/src/transport/diameter_etcp.erl
+++ b/lib/diameter/src/transport/diameter_etcp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/transport/diameter_etcp_sup.erl b/lib/diameter/src/transport/diameter_etcp_sup.erl
index 48794d4fe1..b230397b59 100644
--- a/lib/diameter/src/transport/diameter_etcp_sup.erl
+++ b/lib/diameter/src/transport/diameter_etcp_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/transport/diameter_sctp_sup.erl b/lib/diameter/src/transport/diameter_sctp_sup.erl
index 48df975ae9..36050aaf28 100644
--- a/lib/diameter/src/transport/diameter_sctp_sup.erl
+++ b/lib/diameter/src/transport/diameter_sctp_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/transport/diameter_tcp_sup.erl b/lib/diameter/src/transport/diameter_tcp_sup.erl
index a7bdb49968..6cf758748a 100644
--- a/lib/diameter/src/transport/diameter_tcp_sup.erl
+++ b/lib/diameter/src/transport/diameter_tcp_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/src/transport/diameter_transport.erl b/lib/diameter/src/transport/diameter_transport.erl
index 5a7c59b4dc..3ca4d97f50 100644
--- a/lib/diameter/src/transport/diameter_transport.erl
+++ b/lib/diameter/src/transport/diameter_transport.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/subdirs.mk b/lib/diameter/subdirs.mk
index 1246d4fb91..6e9581aa08 100644
--- a/lib/diameter/subdirs.mk
+++ b/lib/diameter/subdirs.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2011. All Rights Reserved.
+# Copyright Ericsson AB 2010-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/Makefile b/lib/diameter/test/Makefile
index f9e0a61215..c574d70e45 100644
--- a/lib/diameter/test/Makefile
+++ b/lib/diameter/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2013. All Rights Reserved.
+# Copyright Ericsson AB 2010-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/coverspec.sed b/lib/diameter/test/coverspec.sed
index 3f573e29a2..ef77877f3d 100644
--- a/lib/diameter/test/coverspec.sed
+++ b/lib/diameter/test/coverspec.sed
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2013. All Rights Reserved.
+# Copyright Ericsson AB 2013-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/depend.sed b/lib/diameter/test/depend.sed
index 58680a0c1b..d84a586d8a 100644
--- a/lib/diameter/test/depend.sed
+++ b/lib/diameter/test/depend.sed
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2013. All Rights Reserved.
+# Copyright Ericsson AB 2010-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_3xxx_SUITE.erl b/lib/diameter/test/diameter_3xxx_SUITE.erl
index 856244a691..0f060c4ba7 100644
--- a/lib/diameter/test/diameter_3xxx_SUITE.erl
+++ b/lib/diameter/test/diameter_3xxx_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_codec_SUITE_data/avps.dia b/lib/diameter/test/diameter_codec_SUITE_data/avps.dia
index d8fa7ac02e..bae2edca56 100644
--- a/lib/diameter/test/diameter_codec_SUITE_data/avps.dia
+++ b/lib/diameter/test/diameter_codec_SUITE_data/avps.dia
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2010-2011. All Rights Reserved.
+;; Copyright Ericsson AB 2010-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_codec_SUITE_data/diameter_test_unknown.erl b/lib/diameter/test/diameter_codec_SUITE_data/diameter_test_unknown.erl
index 248fb66f40..50cc6e7eef 100644
--- a/lib/diameter/test/diameter_codec_SUITE_data/diameter_test_unknown.erl
+++ b/lib/diameter/test/diameter_codec_SUITE_data/diameter_test_unknown.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_codec_SUITE_data/recv.dia b/lib/diameter/test/diameter_codec_SUITE_data/recv.dia
index 7302f8cec2..2c5cf5de54 100644
--- a/lib/diameter/test/diameter_codec_SUITE_data/recv.dia
+++ b/lib/diameter/test/diameter_codec_SUITE_data/recv.dia
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2010-2011. All Rights Reserved.
+;; Copyright Ericsson AB 2010-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_codec_SUITE_data/send.dia b/lib/diameter/test/diameter_codec_SUITE_data/send.dia
index 2b6478e4b6..3f992bb743 100644
--- a/lib/diameter/test/diameter_codec_SUITE_data/send.dia
+++ b/lib/diameter/test/diameter_codec_SUITE_data/send.dia
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2010-2011. All Rights Reserved.
+;; Copyright Ericsson AB 2010-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_compiler_SUITE.erl b/lib/diameter/test/diameter_compiler_SUITE.erl
index 8807f19f09..7a9ac65ae3 100644
--- a/lib/diameter/test/diameter_compiler_SUITE.erl
+++ b/lib/diameter/test/diameter_compiler_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_ct.hrl b/lib/diameter/test/diameter_ct.hrl
index 0b5a999de6..fdf8782456 100644
--- a/lib/diameter/test/diameter_ct.hrl
+++ b/lib/diameter/test/diameter_ct.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_dict_SUITE.erl b/lib/diameter/test/diameter_dict_SUITE.erl
index f1d69be33e..4c1349f4eb 100644
--- a/lib/diameter/test/diameter_dict_SUITE.erl
+++ b/lib/diameter/test/diameter_dict_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_distribution_SUITE.erl b/lib/diameter/test/diameter_distribution_SUITE.erl
index d32d5bbd49..5146f68ff1 100644
--- a/lib/diameter/test/diameter_distribution_SUITE.erl
+++ b/lib/diameter/test/diameter_distribution_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_enum.erl b/lib/diameter/test/diameter_enum.erl
index ab1b76e5fe..3f1fa7563f 100644
--- a/lib/diameter/test/diameter_enum.erl
+++ b/lib/diameter/test/diameter_enum.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_event_SUITE.erl b/lib/diameter/test/diameter_event_SUITE.erl
index b450c9ea59..57d3427037 100644
--- a/lib/diameter/test/diameter_event_SUITE.erl
+++ b/lib/diameter/test/diameter_event_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-15. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_failover_SUITE.erl b/lib/diameter/test/diameter_failover_SUITE.erl
index 1f345423cf..8a3b3e8413 100644
--- a/lib/diameter/test/diameter_failover_SUITE.erl
+++ b/lib/diameter/test/diameter_failover_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_length_SUITE.erl b/lib/diameter/test/diameter_length_SUITE.erl
index 0f98b08585..daaaae6e00 100644
--- a/lib/diameter/test/diameter_length_SUITE.erl
+++ b/lib/diameter/test/diameter_length_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_reg_SUITE.erl b/lib/diameter/test/diameter_reg_SUITE.erl
index 2945235ecc..3d9ad8bfa8 100644
--- a/lib/diameter/test/diameter_reg_SUITE.erl
+++ b/lib/diameter/test/diameter_reg_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_sync_SUITE.erl b/lib/diameter/test/diameter_sync_SUITE.erl
index f913389f65..2785bd92d6 100644
--- a/lib/diameter/test/diameter_sync_SUITE.erl
+++ b/lib/diameter/test/diameter_sync_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_tls_SUITE.erl b/lib/diameter/test/diameter_tls_SUITE.erl
index 5cadbbc17e..3784bf20a6 100644
--- a/lib/diameter/test/diameter_tls_SUITE.erl
+++ b/lib/diameter/test/diameter_tls_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_tls_SUITE_data/Makefile.ca b/lib/diameter/test/diameter_tls_SUITE_data/Makefile.ca
index d9c0753d0d..12487abe61 100644
--- a/lib/diameter/test/diameter_tls_SUITE_data/Makefile.ca
+++ b/lib/diameter/test/diameter_tls_SUITE_data/Makefile.ca
@@ -1,7 +1,7 @@
# -*- makefile -*-
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2011. All Rights Reserved.
+# Copyright Ericsson AB 2011-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/diameter_traffic_SUITE.erl b/lib/diameter/test/diameter_traffic_SUITE.erl
index 967a0bf591..976abf9138 100644
--- a/lib/diameter/test/diameter_traffic_SUITE.erl
+++ b/lib/diameter/test/diameter_traffic_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/diameter/test/release.sed b/lib/diameter/test/release.sed
index c4124046bc..c84edcc6d9 100644
--- a/lib/diameter/test/release.sed
+++ b/lib/diameter/test/release.sed
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2011. All Rights Reserved.
+# Copyright Ericsson AB 2010-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/edoc/doc/src/book.xml b/lib/edoc/doc/src/book.xml
index 002bf27b94..cdd7eb6f1a 100644
--- a/lib/edoc/doc/src/book.xml
+++ b/lib/edoc/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/edoc/doc/src/notes.xml b/lib/edoc/doc/src/notes.xml
index 3f9d26796a..130a5a850e 100644
--- a/lib/edoc/doc/src/notes.xml
+++ b/lib/edoc/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2007</year><year>2013</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/edoc/doc/src/part.xml b/lib/edoc/doc/src/part.xml
index b55916823a..389efa902b 100644
--- a/lib/edoc/doc/src/part.xml
+++ b/lib/edoc/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/edoc/doc/src/part_notes.xml b/lib/edoc/doc/src/part_notes.xml
index da3d7299f4..6a79435ff0 100644
--- a/lib/edoc/doc/src/part_notes.xml
+++ b/lib/edoc/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2007</year><year>2013</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/edoc/doc/src/ref_man.xml b/lib/edoc/doc/src/ref_man.xml
index abe400d4d5..e3460345a0 100644
--- a/lib/edoc/doc/src/ref_man.xml
+++ b/lib/edoc/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/edoc/src/edoc.appup.src b/lib/edoc/src/edoc.appup.src
index 6d21891a36..4765eead70 100644
--- a/lib/edoc/src/edoc.appup.src
+++ b/lib/edoc/src/edoc.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/edoc/src/edoc.erl b/lib/edoc/src/edoc.erl
index d2494b69fe..94013bb5ac 100644
--- a/lib/edoc/src/edoc.erl
+++ b/lib/edoc/src/edoc.erl
@@ -653,20 +653,7 @@ find_invalid_unicode([]) -> none.
parse_file(Epp) ->
case scan_and_parse(Epp) of
{ok, Form} ->
- case Form of
- {attribute,La,record,{Record, Fields}} ->
- case epp:normalize_typed_record_fields(Fields) of
- {typed, NewFields} ->
- [{attribute, La, record, {Record, NewFields}},
- {attribute, La, type,
- {{record, Record}, Fields, []}}
- | parse_file(Epp)];
- not_typed ->
- [Form | parse_file(Epp)]
- end;
- _ ->
- [Form | parse_file(Epp)]
- end;
+ [Form | parse_file(Epp)];
{error, E} ->
[{error, E} | parse_file(Epp)];
{eof, Location} ->
diff --git a/lib/edoc/src/edoc_extract.erl b/lib/edoc/src/edoc_extract.erl
index 758750083d..e7a4c36ca4 100644
--- a/lib/edoc/src/edoc_extract.erl
+++ b/lib/edoc/src/edoc_extract.erl
@@ -355,6 +355,8 @@ preprocess_forms_2(F, Fs) ->
[F | preprocess_forms_1(Fs)];
text ->
[F | preprocess_forms_1(Fs)];
+ {attribute, {record, _}} ->
+ [F | preprocess_forms_1(Fs)];
{attribute, {N, _}} ->
case edoc_specs:is_tag(N) of
true ->
@@ -373,50 +375,62 @@ preprocess_forms_2(F, Fs) ->
%% in the list.
collect(Fs, Mod) ->
- collect(Fs, [], [], [], [], undefined, Mod).
+ collect(Fs, [], [], [], [], [], undefined, Mod).
-collect([F | Fs], Cs, Ss, Ts, As, Header, Mod) ->
+collect([F | Fs], Cs, Ss, Ts, Rs, As, Header, Mod) ->
case erl_syntax_lib:analyze_form(F) of
comment ->
- collect(Fs, [F | Cs], Ss, Ts, As, Header, Mod);
+ collect(Fs, [F | Cs], Ss, Ts, Rs, As, Header, Mod);
{function, Name} ->
L = erl_syntax:get_pos(F),
Export = ordsets:is_element(Name, Mod#module.exports),
Args = parameters(erl_syntax:function_clauses(F)),
- collect(Fs, [], [], [],
+ collect(Fs, [], [], [], [],
[#entry{name = Name, args = Args, line = L,
export = Export,
- data = {comment_text(Cs),Ss,Ts}} | As],
+ data = {comment_text(Cs),Ss,Ts,Rs}} | As],
Header, Mod);
{attribute, {module, _}} when Header =:= undefined ->
L = erl_syntax:get_pos(F),
- collect(Fs, [], [], [], As,
+ collect(Fs, [], [], [], [], As,
#entry{name = module, line = L,
- data = {comment_text(Cs),Ss,Ts}},
+ data = {comment_text(Cs),Ss,Ts,Rs}},
Mod);
+ {attribute, {record, {_Name, Fields}}} ->
+ case is_typed_record(Fields) of
+ true ->
+ collect(Fs, Cs, Ss, Ts, [F | Rs], As, Header, Mod);
+ false ->
+ collect(Fs, Cs, Ss, Ts, Rs, As, Header, Mod)
+ end;
{attribute, {N, _}} ->
case edoc_specs:tag(N) of
spec ->
- collect(Fs, Cs, [F | Ss], Ts, As, Header, Mod);
+ collect(Fs, Cs, [F | Ss], Ts, Rs, As, Header, Mod);
type ->
- collect(Fs, Cs, Ss, [F | Ts], As, Header, Mod);
+ collect(Fs, Cs, Ss, [F | Ts], Rs, As, Header, Mod);
unknown ->
%% Drop current seen comments.
- collect(Fs, [], [], [], As, Header, Mod)
+ collect(Fs, [], [], [], Rs, As, Header, Mod)
end;
_ ->
%% Drop current seen comments.
- collect(Fs, [], [], [], As, Header, Mod)
+ collect(Fs, [], [], [], [], As, Header, Mod)
end;
-collect([], Cs, Ss, Ts, As, Header, _Mod) ->
- Footer = #entry{name = footer, data = {comment_text(Cs),Ss,Ts}},
+collect([], Cs, Ss, Ts, Rs, As, Header, _Mod) ->
+ Footer = #entry{name = footer, data = {comment_text(Cs),Ss,Ts,Rs}},
As1 = lists:reverse(As),
if Header =:= undefined ->
- {#entry{name = module, data = {[],[],[]}}, Footer, As1};
+ {#entry{name = module, data = {[],[],[],[]}}, Footer, As1};
true ->
{Header, Footer, As1}
end.
+is_typed_record([]) ->
+ false;
+is_typed_record([{_, {_, Type}} | Fs]) ->
+ Type =/= none orelse is_typed_record(Fs).
+
%% Returns a list of simplified comment information (position and text)
%% for a list of abstract comments. The order of elements is reversed.
@@ -549,8 +563,8 @@ get_tags(Es, Env, File, TypeDocs) ->
How = dict:from_list(edoc_tags:tag_parsers()),
get_tags(Es, Tags, Env, How, File, TypeDocs).
-get_tags([#entry{name = Name, data = {Cs,Specs,Types}} = E | Es], Tags, Env,
- How, File, TypeDocs) ->
+get_tags([#entry{name = Name, data = {Cs,Specs,Types,Records}} = E | Es],
+ Tags, Env, How, File, TypeDocs) ->
Where = {File, Name},
Ts0 = scan_tags(Cs),
{Ts1,Specs1} = select_spec(Ts0, Where, Specs),
@@ -558,7 +572,7 @@ get_tags([#entry{name = Name, data = {Cs,Specs,Types}} = E | Es], Tags, Env,
Ts3 = edoc_macros:expand_tags(Ts2, Env, Where),
Ts4 = edoc_tags:parse_tags(Ts3, How, Env, Where),
Ts = selected_specs(Specs1, Ts4),
- ETypes = [edoc_specs:type(Type, TypeDocs) || Type <- Types],
+ ETypes = [edoc_specs:type(Type, TypeDocs) || Type <- Types ++ Records],
[E#entry{data = Ts++ETypes} | get_tags(Es, Tags, Env, How, File, TypeDocs)];
get_tags([], _, _, _, _, _) ->
[].
diff --git a/lib/edoc/src/edoc_specs.erl b/lib/edoc/src/edoc_specs.erl
index f2e5891c2e..faee8adf7b 100644
--- a/lib/edoc/src/edoc_specs.erl
+++ b/lib/edoc/src/edoc_specs.erl
@@ -42,14 +42,15 @@
%% TypeDocs is a dict of {Name, Doc}.
%% Note: #t_typedef.name is set to {record, R} for record types.
type(Form, TypeDocs) ->
- {Name, Data0} = erl_syntax_lib:analyze_wild_attribute(Form),
- type = tag(Name),
+ {Name, Data0} = analyze_type_attribute(Form),
{TypeName, Type, Args, Doc} =
case Data0 of
- {{record, R}, Fs, []} ->
+ {R, Fs} ->
+ record = Name,
L = erl_syntax:get_pos(Form),
{{record, R}, {type, L, record, [{atom,L,R} | Fs]}, [], ""};
{N,T,As} ->
+ type = tag(Name),
Doc0 =
case dict:find({N, length(As)}, TypeDocs) of
{ok, Doc1} ->
@@ -188,7 +189,7 @@ strip([_ | S]) ->
%% Find the type name and the greatest line number of a type spec.
%% Should use syntax_tools but this has to do for now.
get_name_and_last_line(F) ->
- {Name, Data} = erl_syntax_lib:analyze_wild_attribute(F),
+ {Name, Data} = analyze_type_attribute(F),
type = edoc_specs:tag(Name),
Attr = {attribute, erl_syntax:get_pos(F), Name, Data},
Fun = fun(A) ->
@@ -229,6 +230,7 @@ get_all_tags(Es) ->
%% Turns an opaque type into an abstract datatype.
%% Note: top level annotation is ignored.
opaque2abstr(opaque, _T) -> undefined;
+opaque2abstr(record, T) -> T;
opaque2abstr(type, T) -> T.
%% Replaces the parameters extracted from the source (by
@@ -608,6 +610,16 @@ type_name(#tag{name = type,
data = {#t_typedef{name = Name, args = As},_}}) ->
{Name, length(As)}.
+analyze_type_attribute(Form) ->
+ Name = erl_syntax:atom_value(erl_syntax:attribute_name(Form)),
+ case tag(Name) of
+ type ->
+ erl_syntax_lib:analyze_wild_attribute(Form);
+ _ when Name =:= record ->
+ {attribute, _, record, {N, Fields}} = erl_syntax:revert(Form),
+ {record, {N, Fields}}
+ end.
+
%% @doc Return `true' if `Tag' is one of the specification and type
%% attribute tags recognized by the Erlang compiler.
diff --git a/lib/eldap/Makefile b/lib/eldap/Makefile
index 4b12717692..28f995e068 100644
--- a/lib/eldap/Makefile
+++ b/lib/eldap/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2012. All Rights Reserved.
+# Copyright Ericsson AB 2012-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/eldap/doc/src/book.xml b/lib/eldap/doc/src/book.xml
index 2d938fb074..56bd6e580c 100644
--- a/lib/eldap/doc/src/book.xml
+++ b/lib/eldap/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2012</year><year>2013</year>
+ <year>2012</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/eldap/doc/src/notes.xml b/lib/eldap/doc/src/notes.xml
index 04b75f9e31..aa3e3137ae 100644
--- a/lib/eldap/doc/src/notes.xml
+++ b/lib/eldap/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2012</year><year>2013</year>
+ <year>2012</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/eldap/doc/src/ref_man.xml b/lib/eldap/doc/src/ref_man.xml
index b70529635f..8b18d5089b 100644
--- a/lib/eldap/doc/src/ref_man.xml
+++ b/lib/eldap/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2012</year><year>2013</year>
+ <year>2012</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/eldap/doc/src/release_notes.xml b/lib/eldap/doc/src/release_notes.xml
index 65a277b657..dc78d2743c 100644
--- a/lib/eldap/doc/src/release_notes.xml
+++ b/lib/eldap/doc/src/release_notes.xml
@@ -4,7 +4,7 @@
<part>
<header>
<copyright>
- <year>2012</year><year>2013</year>
+ <year>2012</year><year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/eldap/doc/src/usersguide.xml b/lib/eldap/doc/src/usersguide.xml
index 38190c5a7b..0aea773457 100644
--- a/lib/eldap/doc/src/usersguide.xml
+++ b/lib/eldap/doc/src/usersguide.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2012</year><year>2013</year>
+ <year>2012</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/eldap/src/Makefile b/lib/eldap/src/Makefile
index cd3c102f55..b79a537424 100644
--- a/lib/eldap/src/Makefile
+++ b/lib/eldap/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2012-2013. All Rights Reserved.
+# Copyright Ericsson AB 2012-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -98,7 +98,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/ebin"
- $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(ASN1_HRL) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
$(INSTALL_DIR) "$(RELSYSDIR)/src"
$(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)/src"
$(INSTALL_DIR) "$(RELSYSDIR)/asn1"
diff --git a/lib/eldap/src/eldap.appup.src b/lib/eldap/src/eldap.appup.src
index f2a57fa945..06f8e15a71 100644
--- a/lib/eldap/src/eldap.appup.src
+++ b/lib/eldap/src/eldap.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/eldap/test/Makefile b/lib/eldap/test/Makefile
index b8598546c4..21a0da926f 100644
--- a/lib/eldap/test/Makefile
+++ b/lib/eldap/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2012. All Rights Reserved.
+# Copyright Ericsson AB 2012-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/eldap/test/eldap_basic_SUITE.erl b/lib/eldap/test/eldap_basic_SUITE.erl
index 4c1c2f8144..9a23f74e22 100644
--- a/lib/eldap/test/eldap_basic_SUITE.erl
+++ b/lib/eldap/test/eldap_basic_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/eldap/test/make_certs.erl b/lib/eldap/test/make_certs.erl
index 74ee04a361..cfa43289e1 100644
--- a/lib/eldap/test/make_certs.erl
+++ b/lib/eldap/test/make_certs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/eldap/vsn.mk b/lib/eldap/vsn.mk
index 99c474d588..721387d97d 100644
--- a/lib/eldap/vsn.mk
+++ b/lib/eldap/vsn.mk
@@ -1 +1 @@
-ELDAP_VSN = 1.2.1
+ELDAP_VSN = 1.2.2
diff --git a/lib/erl_docgen/Makefile b/lib/erl_docgen/Makefile
index 2f62db3442..30ff2bf16e 100644
--- a/lib/erl_docgen/Makefile
+++ b/lib/erl_docgen/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/doc/src/Makefile b/lib/erl_docgen/doc/src/Makefile
index 3a6d3d04c6..a9110e4635 100644
--- a/lib/erl_docgen/doc/src/Makefile
+++ b/lib/erl_docgen/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2011-2012. All Rights Reserved.
+# Copyright Ericsson AB 2011-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/doc/src/block_tags.xml b/lib/erl_docgen/doc/src/block_tags.xml
index cf8c425bc2..ceed9305f4 100644
--- a/lib/erl_docgen/doc/src/block_tags.xml
+++ b/lib/erl_docgen/doc/src/block_tags.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_docgen/doc/src/book.xml b/lib/erl_docgen/doc/src/book.xml
index 2fa02e359a..b32ae42673 100644
--- a/lib/erl_docgen/doc/src/book.xml
+++ b/lib/erl_docgen/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_docgen/doc/src/character_entities.xml b/lib/erl_docgen/doc/src/character_entities.xml
index e189d7cb6c..65cb07cf7c 100644
--- a/lib/erl_docgen/doc/src/character_entities.xml
+++ b/lib/erl_docgen/doc/src/character_entities.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_docgen/doc/src/doc-build.xml b/lib/erl_docgen/doc/src/doc-build.xml
index 76129128eb..3ea8798639 100644
--- a/lib/erl_docgen/doc/src/doc-build.xml
+++ b/lib/erl_docgen/doc/src/doc-build.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_docgen/doc/src/docgen_xml_check.xml b/lib/erl_docgen/doc/src/docgen_xml_check.xml
index 2351463770..68253edef7 100644
--- a/lib/erl_docgen/doc/src/docgen_xml_check.xml
+++ b/lib/erl_docgen/doc/src/docgen_xml_check.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2007</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_docgen/doc/src/erl_docgen_app.xml b/lib/erl_docgen/doc/src/erl_docgen_app.xml
index 58c2a24f4b..8b36fd5a0a 100644
--- a/lib/erl_docgen/doc/src/erl_docgen_app.xml
+++ b/lib/erl_docgen/doc/src/erl_docgen_app.xml
@@ -4,7 +4,7 @@
<appref>
<header>
<copyright>
- <year>2011</year><year>2013</year>
+ <year>2011</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_docgen/doc/src/fasc_dtds.xml b/lib/erl_docgen/doc/src/fasc_dtds.xml
index a212d58ef5..390ae6c5d1 100644
--- a/lib/erl_docgen/doc/src/fasc_dtds.xml
+++ b/lib/erl_docgen/doc/src/fasc_dtds.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2007</year><year>2013</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_docgen/doc/src/header_tags.xml b/lib/erl_docgen/doc/src/header_tags.xml
index 76472b5cce..a34ae2d562 100644
--- a/lib/erl_docgen/doc/src/header_tags.xml
+++ b/lib/erl_docgen/doc/src/header_tags.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_docgen/doc/src/inline_tags.xml b/lib/erl_docgen/doc/src/inline_tags.xml
index 187c6c308a..25b0cd4d87 100644
--- a/lib/erl_docgen/doc/src/inline_tags.xml
+++ b/lib/erl_docgen/doc/src/inline_tags.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_docgen/doc/src/notes.xml b/lib/erl_docgen/doc/src/notes.xml
index f70b3c8404..be94c0a7a0 100644
--- a/lib/erl_docgen/doc/src/notes.xml
+++ b/lib/erl_docgen/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_docgen/doc/src/overview.xml b/lib/erl_docgen/doc/src/overview.xml
index 860eb02028..5c4576000c 100644
--- a/lib/erl_docgen/doc/src/overview.xml
+++ b/lib/erl_docgen/doc/src/overview.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_docgen/doc/src/part.xml b/lib/erl_docgen/doc/src/part.xml
index aeed47b8c7..0e97af7169 100644
--- a/lib/erl_docgen/doc/src/part.xml
+++ b/lib/erl_docgen/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2011</year><year>2013</year>
+ <year>2011</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_docgen/doc/src/ref_man.xml b/lib/erl_docgen/doc/src/ref_man.xml
index da05f3f1d2..5c7976f12b 100644
--- a/lib/erl_docgen/doc/src/ref_man.xml
+++ b/lib/erl_docgen/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2011</year><year>2013</year>
+ <year>2011</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_docgen/doc/src/refman_dtds.xml b/lib/erl_docgen/doc/src/refman_dtds.xml
index e92539d301..ee3e2f09ad 100644
--- a/lib/erl_docgen/doc/src/refman_dtds.xml
+++ b/lib/erl_docgen/doc/src/refman_dtds.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_docgen/doc/src/user_guide_dtds.xml b/lib/erl_docgen/doc/src/user_guide_dtds.xml
index 01df6b62cb..fdbaba2d92 100644
--- a/lib/erl_docgen/doc/src/user_guide_dtds.xml
+++ b/lib/erl_docgen/doc/src/user_guide_dtds.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_docgen/priv/bin/Makefile b/lib/erl_docgen/priv/bin/Makefile
index 20c2dac936..9ccb84b9c6 100644
--- a/lib/erl_docgen/priv/bin/Makefile
+++ b/lib/erl_docgen/priv/bin/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/bin/codeline_preprocessing.escript b/lib/erl_docgen/priv/bin/codeline_preprocessing.escript
index 129c5c287a..8e1e35bcdd 100755
--- a/lib/erl_docgen/priv/bin/codeline_preprocessing.escript
+++ b/lib/erl_docgen/priv/bin/codeline_preprocessing.escript
@@ -2,7 +2,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/bin/specs_gen.escript b/lib/erl_docgen/priv/bin/specs_gen.escript
index 988262e7a1..859f3c21f5 100644
--- a/lib/erl_docgen/priv/bin/specs_gen.escript
+++ b/lib/erl_docgen/priv/bin/specs_gen.escript
@@ -2,7 +2,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/bin/xml_from_edoc.escript b/lib/erl_docgen/priv/bin/xml_from_edoc.escript
index c09bf0f91c..b930ae3818 100755
--- a/lib/erl_docgen/priv/bin/xml_from_edoc.escript
+++ b/lib/erl_docgen/priv/bin/xml_from_edoc.escript
@@ -2,7 +2,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/bin/xref_mod_app.escript b/lib/erl_docgen/priv/bin/xref_mod_app.escript
index f754d4f2e0..ac4278bf22 100755
--- a/lib/erl_docgen/priv/bin/xref_mod_app.escript
+++ b/lib/erl_docgen/priv/bin/xref_mod_app.escript
@@ -2,7 +2,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/css/Makefile b/lib/erl_docgen/priv/css/Makefile
index 4dde562337..c317411d32 100644
--- a/lib/erl_docgen/priv/css/Makefile
+++ b/lib/erl_docgen/priv/css/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/dtd/Makefile b/lib/erl_docgen/priv/dtd/Makefile
index 6ea7d6bec0..e35e5f8826 100644
--- a/lib/erl_docgen/priv/dtd/Makefile
+++ b/lib/erl_docgen/priv/dtd/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/dtd_html_entities/Makefile b/lib/erl_docgen/priv/dtd_html_entities/Makefile
index 8a853ba279..c0026bd04d 100644
--- a/lib/erl_docgen/priv/dtd_html_entities/Makefile
+++ b/lib/erl_docgen/priv/dtd_html_entities/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/dtd_man_entities/Makefile b/lib/erl_docgen/priv/dtd_man_entities/Makefile
index 991a1a20c7..c634417e8c 100644
--- a/lib/erl_docgen/priv/dtd_man_entities/Makefile
+++ b/lib/erl_docgen/priv/dtd_man_entities/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/fop.xconf b/lib/erl_docgen/priv/fop.xconf
index 1a07af5c64..ee48255a93 100644
--- a/lib/erl_docgen/priv/fop.xconf
+++ b/lib/erl_docgen/priv/fop.xconf
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
- # Copyright Ericsson AB 2009-2012. All Rights Reserved.
+ # Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/images/Makefile b/lib/erl_docgen/priv/images/Makefile
index 664505fa9a..cd98399b6a 100644
--- a/lib/erl_docgen/priv/images/Makefile
+++ b/lib/erl_docgen/priv/images/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/js/flipmenu/Makefile b/lib/erl_docgen/priv/js/flipmenu/Makefile
index 287aeb3dd2..06a13defca 100644
--- a/lib/erl_docgen/priv/js/flipmenu/Makefile
+++ b/lib/erl_docgen/priv/js/flipmenu/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/xsl/Makefile b/lib/erl_docgen/priv/xsl/Makefile
index 80b3a59592..d0dd227169 100644
--- a/lib/erl_docgen/priv/xsl/Makefile
+++ b/lib/erl_docgen/priv/xsl/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/xsl/db_eix.xsl b/lib/erl_docgen/priv/xsl/db_eix.xsl
index 3ca6f73bd6..b496614854 100644
--- a/lib/erl_docgen/priv/xsl/db_eix.xsl
+++ b/lib/erl_docgen/priv/xsl/db_eix.xsl
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
- # Copyright Ericsson AB 2009-2011. All Rights Reserved.
+ # Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/xsl/db_html.xsl b/lib/erl_docgen/priv/xsl/db_html.xsl
index c2325fbee9..a3c71fea15 100644
--- a/lib/erl_docgen/priv/xsl/db_html.xsl
+++ b/lib/erl_docgen/priv/xsl/db_html.xsl
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
- # Copyright Ericsson AB 2009-2012. All Rights Reserved.
+ # Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/xsl/db_html_params.xsl b/lib/erl_docgen/priv/xsl/db_html_params.xsl
index 2949dbfef0..41ca26af21 100644
--- a/lib/erl_docgen/priv/xsl/db_html_params.xsl
+++ b/lib/erl_docgen/priv/xsl/db_html_params.xsl
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
- # Copyright Ericsson AB 2009. All Rights Reserved.
+ # Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/xsl/db_man.xsl b/lib/erl_docgen/priv/xsl/db_man.xsl
index 5201465e42..f75615c105 100644
--- a/lib/erl_docgen/priv/xsl/db_man.xsl
+++ b/lib/erl_docgen/priv/xsl/db_man.xsl
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
- # Copyright Ericsson AB 2009-2012. All Rights Reserved.
+ # Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/xsl/db_pdf.xsl b/lib/erl_docgen/priv/xsl/db_pdf.xsl
index 37a2d55274..e5e624ac4c 100644
--- a/lib/erl_docgen/priv/xsl/db_pdf.xsl
+++ b/lib/erl_docgen/priv/xsl/db_pdf.xsl
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
- # Copyright Ericsson AB 2009-2013. All Rights Reserved.
+ # Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/priv/xsl/db_pdf_params.xsl b/lib/erl_docgen/priv/xsl/db_pdf_params.xsl
index 61c8ff75aa..d9a150d2d9 100644
--- a/lib/erl_docgen/priv/xsl/db_pdf_params.xsl
+++ b/lib/erl_docgen/priv/xsl/db_pdf_params.xsl
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
- # Copyright Ericsson AB 2009-2012. All Rights Reserved.
+ # Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/src/Makefile b/lib/erl_docgen/src/Makefile
index 7d41506dbd..82d051e9bb 100644
--- a/lib/erl_docgen/src/Makefile
+++ b/lib/erl_docgen/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2012. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/src/docgen_xmerl_xml_cb.erl b/lib/erl_docgen/src/docgen_xmerl_xml_cb.erl
index f6e003aa14..59d4dccfb7 100644
--- a/lib/erl_docgen/src/docgen_xmerl_xml_cb.erl
+++ b/lib/erl_docgen/src/docgen_xmerl_xml_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/erl_docgen/src/erl_docgen.appup.src b/lib/erl_docgen/src/erl_docgen.appup.src
index 58cde75395..0d874acf7a 100644
--- a/lib/erl_docgen/src/erl_docgen.appup.src
+++ b/lib/erl_docgen/src/erl_docgen.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/Makefile b/lib/erl_interface/Makefile
index 56edcdfabc..9471b0df18 100644
--- a/lib/erl_interface/Makefile
+++ b/lib/erl_interface/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/configure.in b/lib/erl_interface/configure.in
index 7a3b5ce378..9e52a2adcf 100644
--- a/lib/erl_interface/configure.in
+++ b/lib/erl_interface/configure.in
@@ -1,7 +1,7 @@
# -*- Autoconf -*-
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/doc/src/Makefile b/lib/erl_interface/doc/src/Makefile
index 53dadec5a3..204a6051b2 100644
--- a/lib/erl_interface/doc/src/Makefile
+++ b/lib/erl_interface/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2012. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/doc/src/book.xml b/lib/erl_interface/doc/src/book.xml
index cf7323f3a2..c9194d96ff 100644
--- a/lib/erl_interface/doc/src/book.xml
+++ b/lib/erl_interface/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/ei.xml b/lib/erl_interface/doc/src/ei.xml
index 8ef433d10f..1177954eb9 100644
--- a/lib/erl_interface/doc/src/ei.xml
+++ b/lib/erl_interface/doc/src/ei.xml
@@ -4,7 +4,7 @@
<cref>
<header>
<copyright>
- <year>2001</year><year>2014</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/ei_connect.xml b/lib/erl_interface/doc/src/ei_connect.xml
index a06013ed6a..516357b6a3 100644
--- a/lib/erl_interface/doc/src/ei_connect.xml
+++ b/lib/erl_interface/doc/src/ei_connect.xml
@@ -4,7 +4,7 @@
<cref>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/ei_users_guide.xml b/lib/erl_interface/doc/src/ei_users_guide.xml
index cdf3a912bb..4b9809aee4 100644
--- a/lib/erl_interface/doc/src/ei_users_guide.xml
+++ b/lib/erl_interface/doc/src/ei_users_guide.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/erl_call.xml b/lib/erl_interface/doc/src/erl_call.xml
index e982bf89e1..46015621ac 100644
--- a/lib/erl_interface/doc/src/erl_call.xml
+++ b/lib/erl_interface/doc/src/erl_call.xml
@@ -4,7 +4,7 @@
<comref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/erl_connect.xml b/lib/erl_interface/doc/src/erl_connect.xml
index 86b2648918..0fad98cd17 100644
--- a/lib/erl_interface/doc/src/erl_connect.xml
+++ b/lib/erl_interface/doc/src/erl_connect.xml
@@ -4,7 +4,7 @@
<cref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/erl_error.xml b/lib/erl_interface/doc/src/erl_error.xml
index 8b8c2e95d8..abe84780e1 100644
--- a/lib/erl_interface/doc/src/erl_error.xml
+++ b/lib/erl_interface/doc/src/erl_error.xml
@@ -4,7 +4,7 @@
<cref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/erl_eterm.xml b/lib/erl_interface/doc/src/erl_eterm.xml
index 713a90a390..800f8a3207 100644
--- a/lib/erl_interface/doc/src/erl_eterm.xml
+++ b/lib/erl_interface/doc/src/erl_eterm.xml
@@ -4,7 +4,7 @@
<cref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/erl_format.xml b/lib/erl_interface/doc/src/erl_format.xml
index 2918cb8b84..6e3ac4f0c9 100644
--- a/lib/erl_interface/doc/src/erl_format.xml
+++ b/lib/erl_interface/doc/src/erl_format.xml
@@ -4,7 +4,7 @@
<cref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/erl_global.xml b/lib/erl_interface/doc/src/erl_global.xml
index ec5e51a0b6..d6bfffc69d 100644
--- a/lib/erl_interface/doc/src/erl_global.xml
+++ b/lib/erl_interface/doc/src/erl_global.xml
@@ -4,7 +4,7 @@
<cref>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/erl_interface.xml b/lib/erl_interface/doc/src/erl_interface.xml
index 3a01cba74e..a9d421bbeb 100644
--- a/lib/erl_interface/doc/src/erl_interface.xml
+++ b/lib/erl_interface/doc/src/erl_interface.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/erl_malloc.xml b/lib/erl_interface/doc/src/erl_malloc.xml
index 0a9830f612..799c903b1a 100644
--- a/lib/erl_interface/doc/src/erl_malloc.xml
+++ b/lib/erl_interface/doc/src/erl_malloc.xml
@@ -4,7 +4,7 @@
<cref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/erl_marshal.xml b/lib/erl_interface/doc/src/erl_marshal.xml
index 9b9622dcc2..7c56089016 100644
--- a/lib/erl_interface/doc/src/erl_marshal.xml
+++ b/lib/erl_interface/doc/src/erl_marshal.xml
@@ -4,7 +4,7 @@
<cref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/notes.xml b/lib/erl_interface/doc/src/notes.xml
index 37266d9354..9420beaf43 100644
--- a/lib/erl_interface/doc/src/notes.xml
+++ b/lib/erl_interface/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/notes_history.xml b/lib/erl_interface/doc/src/notes_history.xml
index f3cf8d01ae..c8cdc8832d 100644
--- a/lib/erl_interface/doc/src/notes_history.xml
+++ b/lib/erl_interface/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/part.xml b/lib/erl_interface/doc/src/part.xml
index ec598f0339..d044e2b981 100644
--- a/lib/erl_interface/doc/src/part.xml
+++ b/lib/erl_interface/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/part_erl_interface.xml b/lib/erl_interface/doc/src/part_erl_interface.xml
index 08225133e0..2abe7ecd60 100644
--- a/lib/erl_interface/doc/src/part_erl_interface.xml
+++ b/lib/erl_interface/doc/src/part_erl_interface.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/part_notes.xml b/lib/erl_interface/doc/src/part_notes.xml
index f2d5bd962b..facdf821ee 100644
--- a/lib/erl_interface/doc/src/part_notes.xml
+++ b/lib/erl_interface/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/part_notes_history.xml b/lib/erl_interface/doc/src/part_notes_history.xml
index 7cf1b25f54..401fea4dd4 100644
--- a/lib/erl_interface/doc/src/part_notes_history.xml
+++ b/lib/erl_interface/doc/src/part_notes_history.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/ref_man.xml b/lib/erl_interface/doc/src/ref_man.xml
index 2e115dba5b..0cf060829b 100644
--- a/lib/erl_interface/doc/src/ref_man.xml
+++ b/lib/erl_interface/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/ref_man_ei.xml b/lib/erl_interface/doc/src/ref_man_ei.xml
index bbb2b402cd..d24828c394 100644
--- a/lib/erl_interface/doc/src/ref_man_ei.xml
+++ b/lib/erl_interface/doc/src/ref_man_ei.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/ref_man_erl_interface.xml b/lib/erl_interface/doc/src/ref_man_erl_interface.xml
index c5836c11c3..fb39c5a7e4 100644
--- a/lib/erl_interface/doc/src/ref_man_erl_interface.xml
+++ b/lib/erl_interface/doc/src/ref_man_erl_interface.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/doc/src/registry.xml b/lib/erl_interface/doc/src/registry.xml
index cd7e5d976d..285a2402b8 100644
--- a/lib/erl_interface/doc/src/registry.xml
+++ b/lib/erl_interface/doc/src/registry.xml
@@ -4,7 +4,7 @@
<cref>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/erl_interface/include/ei.h b/lib/erl_interface/include/ei.h
index c1dbc8470d..948f89be85 100644
--- a/lib/erl_interface/include/ei.h
+++ b/lib/erl_interface/include/ei.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -121,8 +121,11 @@
#define ERL_SMALL_ATOM_UTF8_EXT 'w'
#define ERL_REFERENCE_EXT 'e'
#define ERL_NEW_REFERENCE_EXT 'r'
+#define ERL_NEWER_REFERENCE_EXT 'Z'
#define ERL_PORT_EXT 'f'
+#define ERL_NEW_PORT_EXT 'Y'
#define ERL_PID_EXT 'g'
+#define ERL_NEW_PID_EXT 'X'
#define ERL_SMALL_TUPLE_EXT 'h'
#define ERL_LARGE_TUPLE_EXT 'i'
#define ERL_NIL_EXT 'j'
diff --git a/lib/erl_interface/include/ei_connect.h b/lib/erl_interface/include/ei_connect.h
index c8eeba7ae0..825fee0165 100644
--- a/lib/erl_interface/include/ei_connect.h
+++ b/lib/erl_interface/include/ei_connect.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/include/eicode.h b/lib/erl_interface/include/eicode.h
index 1077528d3c..efba630d13 100644
--- a/lib/erl_interface/include/eicode.h
+++ b/lib/erl_interface/include/eicode.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/include/erl_interface.h b/lib/erl_interface/include/erl_interface.h
index 3f9804da7d..c22f21af2b 100644
--- a/lib/erl_interface/include/erl_interface.h
+++ b/lib/erl_interface/include/erl_interface.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -211,14 +211,14 @@ typedef struct {
Erl_Atom_data node;
unsigned int number;
unsigned int serial;
- unsigned char creation;
+ unsigned int creation;
} Erl_Pid;
typedef struct {
Erl_Header h;
Erl_Atom_data node;
unsigned int number;
- unsigned char creation;
+ unsigned int creation;
} Erl_Port;
typedef struct {
@@ -226,7 +226,7 @@ typedef struct {
Erl_Atom_data node;
int len;
unsigned int n[3];
- unsigned char creation;
+ unsigned int creation;
} Erl_Ref;
typedef struct {
diff --git a/lib/erl_interface/src/Makefile b/lib/erl_interface/src/Makefile
index 868407a23f..31f34d4bba 100644
--- a/lib/erl_interface/src/Makefile
+++ b/lib/erl_interface/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2013. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/Makefile.in b/lib/erl_interface/src/Makefile.in
index d6176ec053..4f393e952c 100644
--- a/lib/erl_interface/src/Makefile.in
+++ b/lib/erl_interface/src/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/connect/ei_connect.c b/lib/erl_interface/src/connect/ei_connect.c
index 7b1b2810bb..6dc51adee1 100644
--- a/lib/erl_interface/src/connect/ei_connect.c
+++ b/lib/erl_interface/src/connect/ei_connect.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1342,7 +1342,8 @@ static int send_name_or_challenge(int fd, char *nodename,
| DFLAG_NEW_FLOATS
| DFLAG_SMALL_ATOM_TAGS
| DFLAG_UTF8_ATOMS
- | DFLAG_MAP_TAG));
+ | DFLAG_MAP_TAG
+ | DFLAG_BIG_CREATION));
if (f_chall)
put32be(s, challenge);
memcpy(s, nodename, strlen(nodename));
diff --git a/lib/erl_interface/src/connect/ei_connect_int.h b/lib/erl_interface/src/connect/ei_connect_int.h
index efb6719a1d..0bcccaa84b 100644
--- a/lib/erl_interface/src/connect/ei_connect_int.h
+++ b/lib/erl_interface/src/connect/ei_connect_int.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -106,6 +106,7 @@ extern int h_errno;
#define DFLAG_SMALL_ATOM_TAGS 0x4000
#define DFLAG_UTF8_ATOMS 0x10000
#define DFLAG_MAP_TAG 0x20000
+#define DFLAG_BIG_CREATION 0x40000
ei_cnode *ei_fd_to_cnode(int fd);
int ei_distversion(int fd);
diff --git a/lib/erl_interface/src/connect/ei_resolve.c b/lib/erl_interface/src/connect/ei_resolve.c
index 414cb8be3e..fd0c659373 100644
--- a/lib/erl_interface/src/connect/ei_resolve.c
+++ b/lib/erl_interface/src/connect/ei_resolve.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/connect/ei_resolve.h b/lib/erl_interface/src/connect/ei_resolve.h
index 71ebeab20b..10a49ffbc6 100644
--- a/lib/erl_interface/src/connect/ei_resolve.h
+++ b/lib/erl_interface/src/connect/ei_resolve.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/connect/eirecv.c b/lib/erl_interface/src/connect/eirecv.c
index b036c8969e..7b9dbfc387 100644
--- a/lib/erl_interface/src/connect/eirecv.c
+++ b/lib/erl_interface/src/connect/eirecv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/connect/eirecv.h b/lib/erl_interface/src/connect/eirecv.h
index d56f36b286..bd40061c07 100644
--- a/lib/erl_interface/src/connect/eirecv.h
+++ b/lib/erl_interface/src/connect/eirecv.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/connect/eisend.h b/lib/erl_interface/src/connect/eisend.h
index 6762c4cf40..d555208ed0 100644
--- a/lib/erl_interface/src/connect/eisend.h
+++ b/lib/erl_interface/src/connect/eisend.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/connect/send.c b/lib/erl_interface/src/connect/send.c
index 826bc1f22a..37d7db6d68 100644
--- a/lib/erl_interface/src/connect/send.c
+++ b/lib/erl_interface/src/connect/send.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/connect/send_exit.c b/lib/erl_interface/src/connect/send_exit.c
index f71acfa155..2e298e3221 100644
--- a/lib/erl_interface/src/connect/send_exit.c
+++ b/lib/erl_interface/src/connect/send_exit.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/connect/send_reg.c b/lib/erl_interface/src/connect/send_reg.c
index dac3877d2a..62478f042d 100644
--- a/lib/erl_interface/src/connect/send_reg.c
+++ b/lib/erl_interface/src/connect/send_reg.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_atom.c b/lib/erl_interface/src/decode/decode_atom.c
index df1e5b9350..b3bba82434 100644
--- a/lib/erl_interface/src/decode/decode_atom.c
+++ b/lib/erl_interface/src/decode/decode_atom.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_big.c b/lib/erl_interface/src/decode/decode_big.c
index 5739d159bf..cbbbd3f0b7 100644
--- a/lib/erl_interface/src/decode/decode_big.c
+++ b/lib/erl_interface/src/decode/decode_big.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_bignum.c b/lib/erl_interface/src/decode/decode_bignum.c
index 9d09aefd76..70a86e29c9 100644
--- a/lib/erl_interface/src/decode/decode_bignum.c
+++ b/lib/erl_interface/src/decode/decode_bignum.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_binary.c b/lib/erl_interface/src/decode/decode_binary.c
index 66014181b5..5b8d234984 100644
--- a/lib/erl_interface/src/decode/decode_binary.c
+++ b/lib/erl_interface/src/decode/decode_binary.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_boolean.c b/lib/erl_interface/src/decode/decode_boolean.c
index edaf1486d4..23cfd16f77 100644
--- a/lib/erl_interface/src/decode/decode_boolean.c
+++ b/lib/erl_interface/src/decode/decode_boolean.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_char.c b/lib/erl_interface/src/decode/decode_char.c
index 0290c71988..babf34c90c 100644
--- a/lib/erl_interface/src/decode/decode_char.c
+++ b/lib/erl_interface/src/decode/decode_char.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_double.c b/lib/erl_interface/src/decode/decode_double.c
index 413d575b1a..1ce8b2a417 100644
--- a/lib/erl_interface/src/decode/decode_double.c
+++ b/lib/erl_interface/src/decode/decode_double.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2010. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_fun.c b/lib/erl_interface/src/decode/decode_fun.c
index c2e321c067..f944c028af 100644
--- a/lib/erl_interface/src/decode/decode_fun.c
+++ b/lib/erl_interface/src/decode/decode_fun.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_intlist.c b/lib/erl_interface/src/decode/decode_intlist.c
index 68f38075e2..494371d778 100644
--- a/lib/erl_interface/src/decode/decode_intlist.c
+++ b/lib/erl_interface/src/decode/decode_intlist.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_list_header.c b/lib/erl_interface/src/decode/decode_list_header.c
index e198f52d52..4c6ce3859e 100644
--- a/lib/erl_interface/src/decode/decode_list_header.c
+++ b/lib/erl_interface/src/decode/decode_list_header.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_long.c b/lib/erl_interface/src/decode/decode_long.c
index 15bfb28cf0..b5f36adbb6 100644
--- a/lib/erl_interface/src/decode/decode_long.c
+++ b/lib/erl_interface/src/decode/decode_long.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_longlong.c b/lib/erl_interface/src/decode/decode_longlong.c
index 22f2a63d2e..e052cb7164 100644
--- a/lib/erl_interface/src/decode/decode_longlong.c
+++ b/lib/erl_interface/src/decode/decode_longlong.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_pid.c b/lib/erl_interface/src/decode/decode_pid.c
index 7fbb818b31..e1055aa5c9 100644
--- a/lib/erl_interface/src/decode/decode_pid.c
+++ b/lib/erl_interface/src/decode/decode_pid.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,18 +27,22 @@ int ei_decode_pid(const char *buf, int *index, erlang_pid *p)
{
const char *s = buf + *index;
const char *s0 = s;
+ const char tag = get8(s);
- if (get8(s) != ERL_PID_EXT) return -1;
+ if (tag != ERL_PID_EXT && tag != ERL_NEW_PID_EXT) return -1;
if (p) {
if (get_atom(&s, p->node, NULL) < 0) return -1;
p->num = get32be(s) & 0x7fff; /* 15 bits */
p->serial = get32be(s) & 0x1fff; /* 13 bits */
- p->creation = get8(s) & 0x03; /* 2 bits */
+ if (tag == ERL_PID_EXT)
+ p->creation = get8(s) & 0x03; /* 2 bits */
+ else
+ p->creation = get32be(s); /* 32 bits */
}
else {
if (get_atom(&s, NULL, NULL) < 0) return -1;
- s+= 9;
+ s+= (tag == ERL_PID_EXT ? 9 : 12);
}
*index += s-s0;
diff --git a/lib/erl_interface/src/decode/decode_port.c b/lib/erl_interface/src/decode/decode_port.c
index e039b5b845..337648d803 100644
--- a/lib/erl_interface/src/decode/decode_port.c
+++ b/lib/erl_interface/src/decode/decode_port.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,17 +26,21 @@ int ei_decode_port(const char *buf, int *index, erlang_port *p)
{
const char *s = buf + *index;
const char *s0 = s;
+ const char tag = get8(s);
- if (get8(s) != ERL_PORT_EXT) return -1;
+ if (tag != ERL_PORT_EXT && tag != ERL_NEW_PORT_EXT) return -1;
if (p) {
if (get_atom(&s, p->node, NULL) < 0) return -1;
p->id = get32be(s) & 0x0fffffff /* 28 bits */;
- p->creation = get8(s) & 0x03;
+ if (tag == ERL_PORT_EXT)
+ p->creation = get8(s) & 0x03;
+ else
+ p->creation = get32be(s);
}
else {
if (get_atom(&s, NULL, NULL) < 0) return -1;
- s += 5;
+ s += (tag == ERL_PORT_EXT ? 5 : 8);
}
*index += s-s0;
diff --git a/lib/erl_interface/src/decode/decode_ref.c b/lib/erl_interface/src/decode/decode_ref.c
index a6b87e5a21..c9b38c1c3b 100644
--- a/lib/erl_interface/src/decode/decode_ref.c
+++ b/lib/erl_interface/src/decode/decode_ref.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,8 +28,9 @@ int ei_decode_ref(const char *buf, int *index, erlang_ref *p)
const char *s = buf + *index;
const char *s0 = s;
int count, i;
+ const char tag = get8(s);
- switch (get8(s)) {
+ switch (tag) {
case ERL_REFERENCE_EXT:
if (p) {
if (get_atom(&s, p->node, NULL) < 0) return -1;
@@ -47,18 +48,23 @@ int ei_decode_ref(const char *buf, int *index, erlang_ref *p)
return 0;
break;
- case ERL_NEW_REFERENCE_EXT:
+ case ERL_NEW_REFERENCE_EXT:
+ case ERL_NEWER_REFERENCE_EXT:
+
/* first the integer count */
count = get16be(s);
if (p) {
p->len = count;
if (get_atom(&s, p->node, NULL) < 0) return -1;
- p->creation = get8(s) & 0x03;
+ if (tag == ERL_NEW_REFERENCE_EXT)
+ p->creation = get8(s) & 0x03;
+ else
+ p->creation = get32be(s);
}
else {
if (get_atom(&s, NULL, NULL) < 0) return -1;
- s += 1;
+ s += (tag == ERL_NEW_REFERENCE_EXT ? 1 : 4);
}
/* finally the id integers */
diff --git a/lib/erl_interface/src/decode/decode_skip.c b/lib/erl_interface/src/decode/decode_skip.c
index d49ae0007f..0db315f09b 100644
--- a/lib/erl_interface/src/decode/decode_skip.c
+++ b/lib/erl_interface/src/decode/decode_skip.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,12 +35,15 @@ int ei_skip_term(const char* buf, int* index)
NULL, NULL) < 0) return -1;
break;
case ERL_PID_EXT:
+ case ERL_NEW_PID_EXT:
if (ei_decode_pid(buf, index, NULL) < 0) return -1;
break;
case ERL_PORT_EXT:
+ case ERL_NEW_PORT_EXT:
if (ei_decode_port(buf, index, NULL) < 0) return -1;
break;
case ERL_NEW_REFERENCE_EXT:
+ case ERL_NEWER_REFERENCE_EXT:
case ERL_REFERENCE_EXT:
if (ei_decode_ref(buf, index, NULL) < 0) return -1;
break;
diff --git a/lib/erl_interface/src/decode/decode_skip.h b/lib/erl_interface/src/decode/decode_skip.h
index a0934fdf35..be497e8601 100644
--- a/lib/erl_interface/src/decode/decode_skip.h
+++ b/lib/erl_interface/src/decode/decode_skip.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_string.c b/lib/erl_interface/src/decode/decode_string.c
index 98b7384dc5..3fe4fdd02d 100644
--- a/lib/erl_interface/src/decode/decode_string.c
+++ b/lib/erl_interface/src/decode/decode_string.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_trace.c b/lib/erl_interface/src/decode/decode_trace.c
index bcc53bce96..738d6f0885 100644
--- a/lib/erl_interface/src/decode/decode_trace.c
+++ b/lib/erl_interface/src/decode/decode_trace.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_tuple_header.c b/lib/erl_interface/src/decode/decode_tuple_header.c
index ea60a03ddc..4507edbc8e 100644
--- a/lib/erl_interface/src/decode/decode_tuple_header.c
+++ b/lib/erl_interface/src/decode/decode_tuple_header.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_ulong.c b/lib/erl_interface/src/decode/decode_ulong.c
index dbd86f5022..8675ae257f 100644
--- a/lib/erl_interface/src/decode/decode_ulong.c
+++ b/lib/erl_interface/src/decode/decode_ulong.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_ulonglong.c b/lib/erl_interface/src/decode/decode_ulonglong.c
index e579df41aa..0f0eaeb5da 100644
--- a/lib/erl_interface/src/decode/decode_ulonglong.c
+++ b/lib/erl_interface/src/decode/decode_ulonglong.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/decode/decode_version.c b/lib/erl_interface/src/decode/decode_version.c
index b2146d3280..00a85bea35 100644
--- a/lib/erl_interface/src/decode/decode_version.c
+++ b/lib/erl_interface/src/decode/decode_version.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/eidefs.mk.in b/lib/erl_interface/src/eidefs.mk.in
index 4f6c4e5a3c..dc34ad478a 100644
--- a/lib/erl_interface/src/eidefs.mk.in
+++ b/lib/erl_interface/src/eidefs.mk.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/eicode.h b/lib/erl_interface/src/encode/eicode.h
index 351e88cf2b..1db9a0b65a 100644
--- a/lib/erl_interface/src/encode/eicode.h
+++ b/lib/erl_interface/src/encode/eicode.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/encode_atom.c b/lib/erl_interface/src/encode/encode_atom.c
index 372122f3eb..c1817628e5 100644
--- a/lib/erl_interface/src/encode/encode_atom.c
+++ b/lib/erl_interface/src/encode/encode_atom.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/encode_big.c b/lib/erl_interface/src/encode/encode_big.c
index f758070d8c..cf542a5557 100644
--- a/lib/erl_interface/src/encode/encode_big.c
+++ b/lib/erl_interface/src/encode/encode_big.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/encode_bignum.c b/lib/erl_interface/src/encode/encode_bignum.c
index ebd1853b21..6e418df0c7 100644
--- a/lib/erl_interface/src/encode/encode_bignum.c
+++ b/lib/erl_interface/src/encode/encode_bignum.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/encode_binary.c b/lib/erl_interface/src/encode/encode_binary.c
index 91dab32c29..4471c51769 100644
--- a/lib/erl_interface/src/encode/encode_binary.c
+++ b/lib/erl_interface/src/encode/encode_binary.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/encode_boolean.c b/lib/erl_interface/src/encode/encode_boolean.c
index d98cb5ad09..61e7e5e6e7 100644
--- a/lib/erl_interface/src/encode/encode_boolean.c
+++ b/lib/erl_interface/src/encode/encode_boolean.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/encode_char.c b/lib/erl_interface/src/encode/encode_char.c
index 87fdef7bdd..fab56469aa 100644
--- a/lib/erl_interface/src/encode/encode_char.c
+++ b/lib/erl_interface/src/encode/encode_char.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/encode_double.c b/lib/erl_interface/src/encode/encode_double.c
index 8943cefa11..cff220639a 100644
--- a/lib/erl_interface/src/encode/encode_double.c
+++ b/lib/erl_interface/src/encode/encode_double.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2010. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/encode_fun.c b/lib/erl_interface/src/encode/encode_fun.c
index 14f66dcde1..3bfc7530d1 100644
--- a/lib/erl_interface/src/encode/encode_fun.c
+++ b/lib/erl_interface/src/encode/encode_fun.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/encode_list_header.c b/lib/erl_interface/src/encode/encode_list_header.c
index 0ddca107d7..409bd98ea0 100644
--- a/lib/erl_interface/src/encode/encode_list_header.c
+++ b/lib/erl_interface/src/encode/encode_list_header.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/encode_long.c b/lib/erl_interface/src/encode/encode_long.c
index cf99a7488c..ef3b92cd9e 100644
--- a/lib/erl_interface/src/encode/encode_long.c
+++ b/lib/erl_interface/src/encode/encode_long.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/encode_longlong.c b/lib/erl_interface/src/encode/encode_longlong.c
index fff170c32d..2a1cbedce1 100644
--- a/lib/erl_interface/src/encode/encode_longlong.c
+++ b/lib/erl_interface/src/encode/encode_longlong.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/encode_pid.c b/lib/erl_interface/src/encode/encode_pid.c
index 7b01b7045f..d14746b40f 100644
--- a/lib/erl_interface/src/encode/encode_pid.c
+++ b/lib/erl_interface/src/encode/encode_pid.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,8 @@
int ei_encode_pid(char *buf, int *index, const erlang_pid *p)
{
- char *s = buf + *index;
+ char* s = buf + *index;
+ const char tag = (p->creation > 3) ? ERL_NEW_PID_EXT : ERL_PID_EXT;
++(*index); /* skip ERL_PID_EXT */
if (ei_encode_atom_len_as(buf, index, p->node, strlen(p->node),
@@ -32,17 +33,21 @@ int ei_encode_pid(char *buf, int *index, const erlang_pid *p)
return -1;
if (buf) {
- put8(s,ERL_PID_EXT);
+ put8(s, tag);
s = buf + *index;
/* now the integers */
put32be(s,p->num & 0x7fff); /* 15 bits */
put32be(s,p->serial & 0x1fff); /* 13 bits */
- put8(s,(p->creation & 0x03)); /* 2 bits */
+ if (tag == ERL_PID_EXT) {
+ put8(s,(p->creation & 0x03)); /* 2 bits */
+ } else {
+ put32be(s, p->creation); /* 32 bits */
+ }
}
- *index += 4 + 4 + 1;
+ *index += 4 + 4 + (tag == ERL_PID_EXT ? 1 : 4);
return 0;
}
diff --git a/lib/erl_interface/src/encode/encode_port.c b/lib/erl_interface/src/encode/encode_port.c
index a7468e5917..eb464380c0 100644
--- a/lib/erl_interface/src/encode/encode_port.c
+++ b/lib/erl_interface/src/encode/encode_port.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
int ei_encode_port(char *buf, int *index, const erlang_port *p)
{
char *s = buf + *index;
+ const char tag = p->creation > 3 ? ERL_NEW_PORT_EXT : ERL_PORT_EXT;
++(*index); /* skip ERL_PORT_EXT */
if (ei_encode_atom_len_as(buf, index, p->node, strlen(p->node), ERLANG_UTF8,
@@ -32,16 +33,19 @@ int ei_encode_port(char *buf, int *index, const erlang_port *p)
return -1;
}
if (buf) {
- put8(s,ERL_PORT_EXT);
+ put8(s, tag);
s = buf + *index;
/* now the integers */
put32be(s,p->id & 0x0fffffff /* 28 bits */);
- put8(s,(p->creation & 0x03));
+ if (tag == ERL_PORT_EXT) {
+ put8(s,(p->creation & 0x03));
+ } else {
+ put32be(s, p->creation);
+ }
}
-
- *index += 4 + 1;
+ *index += 4 + (tag == ERL_PORT_EXT ? 1 : 4);
return 0;
}
diff --git a/lib/erl_interface/src/encode/encode_ref.c b/lib/erl_interface/src/encode/encode_ref.c
index 0f27a086f0..5ccfc32c6d 100644
--- a/lib/erl_interface/src/encode/encode_ref.c
+++ b/lib/erl_interface/src/encode/encode_ref.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@
int ei_encode_ref(char *buf, int *index, const erlang_ref *p)
{
+ const char tag = (p->creation > 3) ? ERL_NEWER_REFERENCE_EXT : ERL_NEW_REFERENCE_EXT;
char *s = buf + *index;
int i;
@@ -36,7 +37,7 @@ int ei_encode_ref(char *buf, int *index, const erlang_ref *p)
/* Always encode as an extended reference; all participating parties
are now expected to be able to decode extended references. */
if (buf) {
- put8(s,ERL_NEW_REFERENCE_EXT);
+ put8(s, tag);
/* first, number of integers */
put16be(s, p->len);
@@ -45,12 +46,15 @@ int ei_encode_ref(char *buf, int *index, const erlang_ref *p)
s = buf + *index;
/* now the integers */
- put8(s,(p->creation & 0x03));
+ if (tag == ERL_NEW_REFERENCE_EXT)
+ put8(s,(p->creation & 0x03));
+ else
+ put32be(s, p->creation);
for (i = 0; i < p->len; i++)
put32be(s,p->n[i]);
}
- *index += p->len*4 + 1;
+ *index += p->len*4 + (tag == ERL_NEW_REFERENCE_EXT ? 1 : 4);
return 0;
}
diff --git a/lib/erl_interface/src/encode/encode_string.c b/lib/erl_interface/src/encode/encode_string.c
index 180fe3f1da..a45eae934d 100644
--- a/lib/erl_interface/src/encode/encode_string.c
+++ b/lib/erl_interface/src/encode/encode_string.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/encode_trace.c b/lib/erl_interface/src/encode/encode_trace.c
index 95b49a04e6..d0e6aec474 100644
--- a/lib/erl_interface/src/encode/encode_trace.c
+++ b/lib/erl_interface/src/encode/encode_trace.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/encode_tuple_header.c b/lib/erl_interface/src/encode/encode_tuple_header.c
index 254840a3d1..e75df57bed 100644
--- a/lib/erl_interface/src/encode/encode_tuple_header.c
+++ b/lib/erl_interface/src/encode/encode_tuple_header.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2014. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/encode_ulong.c b/lib/erl_interface/src/encode/encode_ulong.c
index 98b26fed40..94b45b2dd4 100644
--- a/lib/erl_interface/src/encode/encode_ulong.c
+++ b/lib/erl_interface/src/encode/encode_ulong.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/encode_ulonglong.c b/lib/erl_interface/src/encode/encode_ulonglong.c
index 069138a458..e16acc10ef 100644
--- a/lib/erl_interface/src/encode/encode_ulonglong.c
+++ b/lib/erl_interface/src/encode/encode_ulonglong.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/encode/encode_version.c b/lib/erl_interface/src/encode/encode_version.c
index 1694697260..41a2deda12 100644
--- a/lib/erl_interface/src/encode/encode_version.c
+++ b/lib/erl_interface/src/encode/encode_version.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/epmd/ei_epmd.h b/lib/erl_interface/src/epmd/ei_epmd.h
index 50974b89c5..ac153b6e66 100644
--- a/lib/erl_interface/src/epmd/ei_epmd.h
+++ b/lib/erl_interface/src/epmd/ei_epmd.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2010. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/epmd/epmd_port.c b/lib/erl_interface/src/epmd/epmd_port.c
index dedc21e679..2ec418b24a 100644
--- a/lib/erl_interface/src/epmd/epmd_port.c
+++ b/lib/erl_interface/src/epmd/epmd_port.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/epmd/epmd_publish.c b/lib/erl_interface/src/epmd/epmd_publish.c
index 6370a5ab37..47d68a6db0 100644
--- a/lib/erl_interface/src/epmd/epmd_publish.c
+++ b/lib/erl_interface/src/epmd/epmd_publish.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2010. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/epmd/epmd_unpublish.c b/lib/erl_interface/src/epmd/epmd_unpublish.c
index ef84938e5b..255d0ffb59 100644
--- a/lib/erl_interface/src/epmd/epmd_unpublish.c
+++ b/lib/erl_interface/src/epmd/epmd_unpublish.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/erl_interface.app.src b/lib/erl_interface/src/erl_interface.app.src
index 8ab3e1012f..f00cdfba88 100644
--- a/lib/erl_interface/src/erl_interface.app.src
+++ b/lib/erl_interface/src/erl_interface.app.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/erl_interface.appup.src b/lib/erl_interface/src/erl_interface.appup.src
index eee7be1540..eb9854d22d 100644
--- a/lib/erl_interface/src/erl_interface.appup.src
+++ b/lib/erl_interface/src/erl_interface.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/decode_term.c b/lib/erl_interface/src/legacy/decode_term.c
index fabbee19a9..72bacc3123 100644
--- a/lib/erl_interface/src/legacy/decode_term.c
+++ b/lib/erl_interface/src/legacy/decode_term.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2010. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/encode_term.c b/lib/erl_interface/src/legacy/encode_term.c
index 47837214e8..df740ab487 100644
--- a/lib/erl_interface/src/legacy/encode_term.c
+++ b/lib/erl_interface/src/legacy/encode_term.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/erl_config.h b/lib/erl_interface/src/legacy/erl_config.h
index 1da150bdbd..fb72169f23 100644
--- a/lib/erl_interface/src/legacy/erl_config.h
+++ b/lib/erl_interface/src/legacy/erl_config.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/erl_connect.c b/lib/erl_interface/src/legacy/erl_connect.c
index 4b1004ae2b..7ffd545d3e 100644
--- a/lib/erl_interface/src/legacy/erl_connect.c
+++ b/lib/erl_interface/src/legacy/erl_connect.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/erl_connect.h b/lib/erl_interface/src/legacy/erl_connect.h
index eb3292b679..6cb5d5cd1b 100644
--- a/lib/erl_interface/src/legacy/erl_connect.h
+++ b/lib/erl_interface/src/legacy/erl_connect.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/erl_error.c b/lib/erl_interface/src/legacy/erl_error.c
index d3309d2863..a3bbfbc58f 100644
--- a/lib/erl_interface/src/legacy/erl_error.c
+++ b/lib/erl_interface/src/legacy/erl_error.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/erl_error.h b/lib/erl_interface/src/legacy/erl_error.h
index 27a8d13d0f..0cce083ae7 100644
--- a/lib/erl_interface/src/legacy/erl_error.h
+++ b/lib/erl_interface/src/legacy/erl_error.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/erl_eterm.c b/lib/erl_interface/src/legacy/erl_eterm.c
index f2f35ab693..e4b3b49c7d 100644
--- a/lib/erl_interface/src/legacy/erl_eterm.c
+++ b/lib/erl_interface/src/legacy/erl_eterm.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -285,12 +285,12 @@ ETERM *erl_mk_pid(const char *node,
erl_errno = ENOMEM;
return NULL;
}
- erl_mk_pid_helper(ep, number, serial, creation);
+ erl_mk_pid_helper(ep, number, serial, creation & 0x03);
return ep;
}
void erl_mk_pid_helper(ETERM *ep, unsigned int number,
- unsigned int serial, unsigned char creation)
+ unsigned int serial, unsigned int creation)
{
ERL_PID_NUMBER(ep) = number & 0x7fff; /* 15 bits */
if (ei_internal_use_r9_pids_ports()) {
@@ -299,7 +299,7 @@ void erl_mk_pid_helper(ETERM *ep, unsigned int number,
else {
ERL_PID_SERIAL(ep) = serial & 0x1fff; /* 13 bits */
}
- ERL_PID_CREATION(ep) = creation & 0x03; /* 2 bits */
+ ERL_PID_CREATION(ep) = creation; /* 32 bits */
}
/*
@@ -326,7 +326,7 @@ ETERM *erl_mk_port(const char *node,
return ep;
}
-void erl_mk_port_helper(ETERM* ep, unsigned number, unsigned char creation)
+void erl_mk_port_helper(ETERM* ep, unsigned number, unsigned int creation)
{
if (ei_internal_use_r9_pids_ports()) {
ERL_PORT_NUMBER(ep) = number & 0x3ffff; /* 18 bits */
@@ -334,7 +334,7 @@ void erl_mk_port_helper(ETERM* ep, unsigned number, unsigned char creation)
else {
ERL_PORT_NUMBER(ep) = number & 0x0fffffff; /* 18 bits */
}
- ERL_PORT_CREATION(ep) = creation & 0x03; /* 2 bits */
+ ERL_PORT_CREATION(ep) = creation; /* 32 bits */
}
/*
@@ -344,7 +344,7 @@ ETERM *__erl_mk_reference (ETERM* t,
const char *node,
size_t len,
unsigned int n[],
- unsigned char creation)
+ unsigned int creation)
{
if (t == NULL) {
if (node == NULL) return NULL;
@@ -363,7 +363,7 @@ ETERM *__erl_mk_reference (ETERM* t,
ERL_REF_NUMBERS(t)[0] = n[0] & 0x3ffff; /* 18 bits */
ERL_REF_NUMBERS(t)[1] = n[1];
ERL_REF_NUMBERS(t)[2] = n[2];
- ERL_REF_CREATION(t) = creation & 0x03; /* 2 bits */
+ ERL_REF_CREATION(t) = creation; /* 32 bits */
return t;
}
diff --git a/lib/erl_interface/src/legacy/erl_eterm.h b/lib/erl_interface/src/legacy/erl_eterm.h
index d9a26b2541..e2f3a90531 100644
--- a/lib/erl_interface/src/legacy/erl_eterm.h
+++ b/lib/erl_interface/src/legacy/erl_eterm.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -56,9 +56,9 @@ typedef struct _heapmark {
} Erl_HeapMark;
-void erl_mk_port_helper(ETERM* ep, unsigned number, unsigned char creation);
-void erl_mk_pid_helper(ETERM*, unsigned,unsigned, unsigned char);
-ETERM * __erl_mk_reference(ETERM*, const char *, size_t, unsigned int n[], unsigned char);
+void erl_mk_port_helper(ETERM* ep, unsigned number, unsigned int creation);
+void erl_mk_pid_helper(ETERM*, unsigned,unsigned, unsigned int);
+ETERM * __erl_mk_reference(ETERM*, const char *, size_t, unsigned int n[], unsigned int);
int erl_current_fix_desc(void);
#endif /* _ERL_ETERM_H */
diff --git a/lib/erl_interface/src/legacy/erl_fix_alloc.c b/lib/erl_interface/src/legacy/erl_fix_alloc.c
index 70d592bfe1..890a9ce291 100644
--- a/lib/erl_interface/src/legacy/erl_fix_alloc.c
+++ b/lib/erl_interface/src/legacy/erl_fix_alloc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/erl_fix_alloc.h b/lib/erl_interface/src/legacy/erl_fix_alloc.h
index af86202ae7..50d1368e34 100644
--- a/lib/erl_interface/src/legacy/erl_fix_alloc.h
+++ b/lib/erl_interface/src/legacy/erl_fix_alloc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/erl_format.c b/lib/erl_interface/src/legacy/erl_format.c
index c5ef47236d..45f5489e54 100644
--- a/lib/erl_interface/src/legacy/erl_format.c
+++ b/lib/erl_interface/src/legacy/erl_format.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/erl_format.h b/lib/erl_interface/src/legacy/erl_format.h
index 388267f859..92fa068206 100644
--- a/lib/erl_interface/src/legacy/erl_format.h
+++ b/lib/erl_interface/src/legacy/erl_format.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/erl_global.h b/lib/erl_interface/src/legacy/erl_global.h
index 3c99b2fe40..d2eec08b35 100644
--- a/lib/erl_interface/src/legacy/erl_global.h
+++ b/lib/erl_interface/src/legacy/erl_global.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/erl_internal.h b/lib/erl_interface/src/legacy/erl_internal.h
index 22160d8911..25cf3e4f42 100644
--- a/lib/erl_interface/src/legacy/erl_internal.h
+++ b/lib/erl_interface/src/legacy/erl_internal.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/erl_malloc.c b/lib/erl_interface/src/legacy/erl_malloc.c
index cad7f75261..27ef8c4b32 100644
--- a/lib/erl_interface/src/legacy/erl_malloc.c
+++ b/lib/erl_interface/src/legacy/erl_malloc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/erl_malloc.h b/lib/erl_interface/src/legacy/erl_malloc.h
index cfbd190b61..6cbc01faba 100644
--- a/lib/erl_interface/src/legacy/erl_malloc.h
+++ b/lib/erl_interface/src/legacy/erl_malloc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/erl_marshal.c b/lib/erl_interface/src/legacy/erl_marshal.c
index a4216c9541..3c212bf177 100644
--- a/lib/erl_interface/src/legacy/erl_marshal.c
+++ b/lib/erl_interface/src/legacy/erl_marshal.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -120,10 +120,13 @@ void erl_init_marshal(void)
cmp_array[ERL_SMALL_ATOM_UTF8_EXT] = ERL_ATOM_CMP;
cmp_array[ERL_REFERENCE_EXT] = ERL_REF_CMP;
cmp_array[ERL_NEW_REFERENCE_EXT] = ERL_REF_CMP;
+ cmp_array[ERL_NEWER_REFERENCE_EXT]=ERL_REF_CMP;
cmp_array[ERL_FUN_EXT] = ERL_FUN_CMP;
cmp_array[ERL_NEW_FUN_EXT] = ERL_FUN_CMP;
cmp_array[ERL_PORT_EXT] = ERL_PORT_CMP;
+ cmp_array[ERL_NEW_PORT_EXT] = ERL_PORT_CMP;
cmp_array[ERL_PID_EXT] = ERL_PID_CMP;
+ cmp_array[ERL_NEW_PID_EXT] = ERL_PID_CMP;
cmp_array[ERL_SMALL_TUPLE_EXT] = ERL_TUPLE_CMP;
cmp_array[ERL_LARGE_TUPLE_EXT] = ERL_TUPLE_CMP;
cmp_array[ERL_NIL_EXT] = ERL_NIL_CMP;
@@ -304,8 +307,8 @@ int erl_encode_it(ETERM *ep, unsigned char **ext, int dist)
*(*ext)++ = ul & 0xff;
return 0;
- case ERL_PID:
- *(*ext)++ = ERL_PID_EXT;
+ case ERL_PID: {
+ unsigned char* tagp = (*ext)++;
/* First poke in node as an atom */
encode_atom(&ep->uval.pidval.node, ext);
/* And then fill in the integer fields */
@@ -319,17 +322,29 @@ int erl_encode_it(ETERM *ep, unsigned char **ext, int dist)
*(*ext)++ = (i >> 16) &0xff;
*(*ext)++ = (i >> 8) &0xff;
*(*ext)++ = i &0xff;
- *(*ext)++ = ERL_PID_CREATION(ep);
+
+ i = ERL_PID_CREATION(ep);
+ if ((unsigned int)i <= 3) {
+ *tagp = ERL_PID_EXT;
+ *(*ext)++ = i;
+ } else {
+ *tagp = ERL_NEW_PID_EXT;
+ *(*ext)++ = (i >> 24) &0xff;
+ *(*ext)++ = (i >> 16) &0xff;
+ *(*ext)++ = (i >> 8) &0xff;
+ *(*ext)++ = i &0xff;
+ }
return 0;
+ }
case ERL_REF: {
+ unsigned char* tagp = (*ext)++;
+
int len, j;
/* Always encode as an extended reference; all
participating parties are now expected to be
able to decode extended references. */
- *(*ext)++ = ERL_NEW_REFERENCE_EXT;
-
i = strlen((char *)ERL_REF_NODE(ep));
len = ERL_REF_LEN(ep);
*(*ext)++ = (len >> 8) &0xff;
@@ -337,7 +352,18 @@ int erl_encode_it(ETERM *ep, unsigned char **ext, int dist)
encode_atom(&ep->uval.refval.node, ext);
- *(*ext)++ = ERL_REF_CREATION(ep);
+ i = ERL_REF_CREATION(ep);
+ if ((unsigned int)i <= 3) {
+ *tagp = ERL_NEW_REFERENCE_EXT;
+ *(*ext)++ = i;
+ } else {
+ *tagp = ERL_NEWER_REFERENCE_EXT;
+ *(*ext)++ = (i >> 24) &0xff;
+ *(*ext)++ = (i >> 16) &0xff;
+ *(*ext)++ = (i >> 8) &0xff;
+ *(*ext)++ = i &0xff;
+ }
+
/* Then the integer fields */
for (j = 0; j < ERL_REF_LEN(ep); j++) {
i = ERL_REF_NUMBERS(ep)[j];
@@ -348,8 +374,8 @@ int erl_encode_it(ETERM *ep, unsigned char **ext, int dist)
}
}
return 0;
- case ERL_PORT:
- *(*ext)++ = ERL_PORT_EXT;
+ case ERL_PORT: {
+ unsigned char* tagp = (*ext)++;
/* First poke in node as an atom */
encode_atom(&ep->uval.portval.node, ext);
/* Then the integer fields */
@@ -358,8 +384,20 @@ int erl_encode_it(ETERM *ep, unsigned char **ext, int dist)
*(*ext)++ = (i >> 16) &0xff;
*(*ext)++ = (i >> 8) &0xff;
*(*ext)++ = i &0xff;
- *(*ext)++ = ERL_PORT_CREATION(ep);
+
+ i = ERL_PORT_CREATION(ep);
+ if ((unsigned int)i <= 3) {
+ *tagp = ERL_PORT_EXT;
+ *(*ext)++ = i;
+ } else {
+ *tagp = ERL_NEW_PORT_EXT;
+ *(*ext)++ = (i >> 24) &0xff;
+ *(*ext)++ = (i >> 16) &0xff;
+ *(*ext)++ = (i >> 8) &0xff;
+ *(*ext)++ = i &0xff;
+ }
return 0;
+ }
case ERL_EMPTY_LIST:
*(*ext)++ = ERL_NIL_EXT;
break;
@@ -698,12 +736,14 @@ static ETERM *erl_decode_it(unsigned char **ext)
unsigned int u,sign;
int i,j,arity;
double ff;
+ unsigned char tag;
/* Assume we are going to decode an integer */
ep = erl_alloc_eterm(ERL_INTEGER);
ERL_COUNT(ep) = 1;
- switch (*(*ext)++)
+ tag = *(*ext)++;
+ switch (tag)
{
case ERL_INTEGER_EXT:
i = (int) (**ext << 24) | ((*ext)[1] << 16) |
@@ -801,9 +841,10 @@ static ETERM *erl_decode_it(unsigned char **ext)
return ep;
case ERL_PID_EXT:
+ case ERL_NEW_PID_EXT:
{
unsigned int number, serial;
- unsigned char creation;
+ unsigned int creation;
ERL_TYPE(ep) = ERL_PID;
if (read_atom(ext, &ep->uval.pidval.node) < 0) return NULL;
@@ -815,7 +856,13 @@ static ETERM *erl_decode_it(unsigned char **ext)
serial = ((*ext)[0] << 24) | ((*ext)[1]) << 16 |
((*ext)[2]) << 8 | ((*ext)[3]);
*ext += 4;
- creation = *(*ext)++;
+ if (tag == ERL_PID_EXT)
+ creation = *(*ext)++;
+ else {
+ creation = ((*ext)[0] << 24) | ((*ext)[1]) << 16 |
+ ((*ext)[2]) << 8 | ((*ext)[3]);
+ *ext += 4;
+ }
erl_mk_pid_helper(ep, number, serial, creation);
return ep;
}
@@ -836,11 +883,12 @@ static ETERM *erl_decode_it(unsigned char **ext)
return ep;
}
- case ERL_NEW_REFERENCE_EXT:
+ case ERL_NEW_REFERENCE_EXT:
+ case ERL_NEWER_REFERENCE_EXT:
{
size_t cnt, i;
unsigned int n[3];
- unsigned char creation;
+ unsigned int creation;
ERL_TYPE(ep) = ERL_REF;
cnt = ((*ext)[0] << 8) | (*ext)[1];
@@ -849,7 +897,13 @@ static ETERM *erl_decode_it(unsigned char **ext)
if (read_atom(ext, &ep->uval.refval.node) < 0) return NULL;
/* get the integers */
- creation = *(*ext)++;
+ if (tag == ERL_NEW_REFERENCE_EXT)
+ creation = *(*ext)++;
+ else {
+ creation = ((*ext)[0] << 24) | ((*ext)[1]) << 16 |
+ ((*ext)[2]) << 8 | ((*ext)[3]);
+ *ext += 4;
+ }
for(i = 0; i < cnt; i++)
{
n[i] = ((*ext)[0] << 24) | ((*ext)[1]) << 16 |
@@ -861,9 +915,10 @@ static ETERM *erl_decode_it(unsigned char **ext)
}
case ERL_PORT_EXT:
+ case ERL_NEW_PORT_EXT:
{
unsigned int number;
- unsigned char creation;
+ unsigned int creation;
ERL_TYPE(ep) = ERL_PORT;
if (read_atom(ext, &ep->uval.portval.node) < 0) return NULL;
@@ -872,7 +927,13 @@ static ETERM *erl_decode_it(unsigned char **ext)
number = ((*ext)[0] << 24) | ((*ext)[1]) << 16 |
((*ext)[2]) << 8 | ((*ext)[3]);
*ext += 4;
- creation = *(*ext)++;
+ if (tag == ERL_PORT_EXT)
+ creation = *(*ext)++;
+ else {
+ creation = (((*ext)[0] << 24) | ((*ext)[1]) << 16 |
+ ((*ext)[2]) << 8 | ((*ext)[3]));
+ *ext += 4;
+ }
erl_mk_port_helper(ep, number, creation);
return ep;
}
@@ -1114,11 +1175,14 @@ unsigned char erl_ext_type(unsigned char *ext)
case ERL_SMALL_ATOM_UTF8_EXT:
return ERL_ATOM;
case ERL_PID_EXT:
+ case ERL_NEW_PID_EXT:
return ERL_PID;
case ERL_PORT_EXT:
+ case ERL_NEW_PORT_EXT:
return ERL_PORT;
case ERL_REFERENCE_EXT:
case ERL_NEW_REFERENCE_EXT:
+ case ERL_NEWER_REFERENCE_EXT:
return ERL_REF;
case ERL_NIL_EXT:
return ERL_EMPTY_LIST;
@@ -1167,9 +1231,12 @@ int erl_ext_size(unsigned char *t)
case ERL_SMALL_ATOM_EXT:
case ERL_SMALL_ATOM_UTF8_EXT:
case ERL_PID_EXT:
+ case ERL_NEW_PID_EXT:
case ERL_PORT_EXT:
+ case ERL_NEW_PORT_EXT:
case ERL_REFERENCE_EXT:
case ERL_NEW_REFERENCE_EXT:
+ case ERL_NEWER_REFERENCE_EXT:
case ERL_NIL_EXT:
case ERL_BINARY_EXT:
case ERL_STRING_EXT:
@@ -1240,8 +1307,9 @@ static int jump(unsigned char **ext)
{
int j,k,i=0;
int n;
+ const int tag = *(*ext)++;
- switch (*(*ext)++) {
+ switch (tag) {
case ERL_VERSION_MAGIC:
return jump(ext);
case ERL_INTEGER_EXT:
@@ -1257,22 +1325,29 @@ static int jump(unsigned char **ext)
jump_atom(ext);
break;
case ERL_PID_EXT:
- /* eat first atom */
if (!jump_atom(ext)) return 0;
- *ext += 9; /* Two int's and the creation field */
+ *ext += 4 + 4 + 1;
break;
+ case ERL_NEW_PID_EXT:
+ if (!jump_atom(ext)) return 0;
+ *ext += 4 + 4 + 4;
+ break;
case ERL_REFERENCE_EXT:
case ERL_PORT_EXT:
- /* first field is an atom */
if (!jump_atom(ext)) return 0;
- *ext += 5; /* One int and the creation field */
+ *ext += 4 + 1;
break;
+ case ERL_NEW_PORT_EXT:
+ if (!jump_atom(ext)) return 0;
+ *ext += 4 + 4;
+ break;
case ERL_NEW_REFERENCE_EXT:
+ case ERL_NEWER_REFERENCE_EXT:
n = (**ext << 8) | (*ext)[1];
*ext += 2;
/* first field is an atom */
if (!jump_atom(ext)) return 0;
- *ext += 4*n+1;
+ *ext += 4*n + (tag == ERL_NEW_REFERENCE_EXT ? 1 : 4);
break;
case ERL_NIL_EXT:
/* We just passed it... */
@@ -1605,7 +1680,6 @@ static int cmp_exe2(unsigned char **e1, unsigned char **e2)
{
int min, ret,i,j,k;
double ff1, ff2;
- unsigned char *tmp1, *tmp2;
unsigned char tag1, tag2;
if ( ((*e1)[0] == ERL_STRING_EXT) && ((*e2)[0] == ERL_LIST_EXT) ) {
@@ -1649,47 +1723,68 @@ static int cmp_exe2(unsigned char **e1, unsigned char **e2)
*e1 += i;
*e2 += j;
return ret;
- case ERL_PID_EXT: {
- unsigned char *n1 = *e1;
- unsigned char *n2 = *e2;
- CMP_EXT_SKIP_ATOM(*e1); CMP_EXT_SKIP_ATOM(*e2);
- *e1 += 9; *e2 += 9;
+ case ERL_PID_EXT:
+ case ERL_NEW_PID_EXT: {
+ erlang_pid pid1, pid2;
+ unsigned char* buf1 = *e1 - 1;
+ unsigned char* buf2 = *e2 - 1;
+ int ix1 = 0, ix2 = 0;
+
+ if (ei_decode_pid((char*)buf1, &ix1, &pid1) ||
+ ei_decode_pid((char*)buf2, &ix2, &pid2))
+ return CMP_EXT_ERROR_CODE;
+
+ *e1 = buf1 + ix1;
+ *e2 = buf2 + ix2;
/* First compare serials ... */
- tmp1 = *e1 - 5; tmp2 = *e2 - 5;
- CMP_EXT_INT32_BE(tmp1, tmp2);
+ if (pid1.serial < pid2.serial) return -1;
+ else if (pid1.serial > pid2.serial) return 1;
/* ... then ids ... */
- tmp1 -= 4; tmp2 -= 4;
- CMP_EXT_INT32_BE(tmp1, tmp2);
+ if (pid1.num < pid2.num) return -1;
+ else if (pid1.num > pid2.num) return 1;
/* ... then node names ... */
- ret = cmp_exe2(&n1, &n2);
- if (ret != 0)
- return ret;
+ j = strcmp(pid1.node, pid2.node);
+ if (j < 0) return -1;
+ else if (j > 0) return 1;
/* ... and then finaly creations. */
- tmp1 += 8; tmp2 += 8;
- if (*tmp1 != *tmp2)
- return *tmp1 < *tmp2 ? -1 : 1;
+ if (pid1.creation < pid2.creation) return -1;
+ else if (pid1.creation > pid2.creation) return 1;
+
return 0;
}
case ERL_PORT_EXT:
- /* First compare node names ... */
- if (!IS_ERL_ATOM(**e1) || !IS_ERL_ATOM(**e2))
- return CMP_EXT_ERROR_CODE;
- ret = cmp_exe2(e1, e2);
- *e1 += 5; *e2 += 5;
- if (ret != 0)
- return ret;
+ case ERL_NEW_PORT_EXT: {
+ erlang_port port1, port2;
+ unsigned char* buf1 = *e1 - 1;
+ unsigned char* buf2 = *e2 - 1;
+ int ix1 = 0, ix2 = 0;
+
+ if (ei_decode_port((char*)buf1, &ix1, &port1) ||
+ ei_decode_port((char*)buf2, &ix2, &port2))
+ return CMP_EXT_ERROR_CODE;
+
+ *e1 = buf1 + ix1;
+ *e2 = buf2 + ix2;
+
+ /* First compare node names ... */
+ j = strcmp(port1.node, port2.node);
+ if (j < 0) return -1;
+ else if (j > 0) return 1;
+
/* ... then creations ... */
- tmp1 = *e1 - 1; tmp2 = *e2 - 1;
- if (*tmp1 != *tmp2)
- return *tmp1 < *tmp2 ? -1 : 1;
+ if (port1.creation < port2.creation) return -1;
+ else if (port1.creation > port2.creation) return 1;
+
/* ... and then finaly ids. */
- tmp1 -= 4; tmp2 -= 4;
- CMP_EXT_INT32_BE(tmp1, tmp2);
- return 0;
+ if (port1.id < port2.id) return -1;
+ else if (port1.id > port2.id) return 1;
+
+ return 0;
+ }
case ERL_NIL_EXT: return 0;
case ERL_LIST_EXT:
i = (**e1 << 24) | ((*e1)[1] << 16) |((*e1)[2] << 8) | (*e1)[3];
diff --git a/lib/erl_interface/src/legacy/erl_marshal.h b/lib/erl_interface/src/legacy/erl_marshal.h
index c7fe2139a6..c1963b832d 100644
--- a/lib/erl_interface/src/legacy/erl_marshal.h
+++ b/lib/erl_interface/src/legacy/erl_marshal.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/erl_resolve.c b/lib/erl_interface/src/legacy/erl_resolve.c
index cc6558471a..bb09caec85 100644
--- a/lib/erl_interface/src/legacy/erl_resolve.c
+++ b/lib/erl_interface/src/legacy/erl_resolve.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/erl_timeout.c b/lib/erl_interface/src/legacy/erl_timeout.c
index 1651131dff..e36ea0e250 100644
--- a/lib/erl_interface/src/legacy/erl_timeout.c
+++ b/lib/erl_interface/src/legacy/erl_timeout.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/erl_timeout.h b/lib/erl_interface/src/legacy/erl_timeout.h
index 17d45915f5..6bcfa5ecbb 100644
--- a/lib/erl_interface/src/legacy/erl_timeout.h
+++ b/lib/erl_interface/src/legacy/erl_timeout.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/global_names.c b/lib/erl_interface/src/legacy/global_names.c
index bf717bb32b..ee808620fb 100644
--- a/lib/erl_interface/src/legacy/global_names.c
+++ b/lib/erl_interface/src/legacy/global_names.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/global_register.c b/lib/erl_interface/src/legacy/global_register.c
index 9905977514..4cb6d8071f 100644
--- a/lib/erl_interface/src/legacy/global_register.c
+++ b/lib/erl_interface/src/legacy/global_register.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/global_unregister.c b/lib/erl_interface/src/legacy/global_unregister.c
index ace7343503..27f68670ca 100644
--- a/lib/erl_interface/src/legacy/global_unregister.c
+++ b/lib/erl_interface/src/legacy/global_unregister.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/global_whereis.c b/lib/erl_interface/src/legacy/global_whereis.c
index 23be4a1055..13c4c93ca7 100644
--- a/lib/erl_interface/src/legacy/global_whereis.c
+++ b/lib/erl_interface/src/legacy/global_whereis.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/legacy/portability.h b/lib/erl_interface/src/legacy/portability.h
index d544c63c99..42a78662d5 100644
--- a/lib/erl_interface/src/legacy/portability.h
+++ b/lib/erl_interface/src/legacy/portability.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/ei_compat.c b/lib/erl_interface/src/misc/ei_compat.c
index ceb597e970..93d7dbfb83 100644
--- a/lib/erl_interface/src/misc/ei_compat.c
+++ b/lib/erl_interface/src/misc/ei_compat.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/ei_decode_term.c b/lib/erl_interface/src/misc/ei_decode_term.c
index 0ec67dde09..63a7034508 100644
--- a/lib/erl_interface/src/misc/ei_decode_term.c
+++ b/lib/erl_interface/src/misc/ei_decode_term.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@
int ei_decode_ei_term(const char* buf, int* index, ei_term* term)
{
const char* s = buf + *index, * s0 = s;
- int i, n, sign;
+ int n, sign;
char c;
if (term == NULL) return -1;
@@ -47,47 +47,27 @@ int ei_decode_ei_term(const char* buf, int* index, ei_term* term)
break;
case ERL_FLOAT_EXT:
case NEW_FLOAT_EXT:
- return ei_decode_double(buf, index, &term->value.d_val);
+ return (ei_decode_double(buf, index, &term->value.d_val) < 0
+ ? -1 : 1);
case ERL_ATOM_EXT:
case ERL_ATOM_UTF8_EXT:
case ERL_SMALL_ATOM_EXT:
case ERL_SMALL_ATOM_UTF8_EXT:
- return ei_decode_atom(buf, index, term->value.atom_name);
+ return (ei_decode_atom(buf, index, term->value.atom_name) < 0
+ ? -1 : 1);
case ERL_REFERENCE_EXT:
- /* first the nodename */
- if (get_atom(&s, term->value.ref.node, NULL) < 0) return -1;
- /* now the numbers: num (4), creation (1) */
- term->value.ref.n[0] = get32be(s);
- term->value.ref.len = 1;
- term->value.ref.creation = get8(s) & 0x03;
- break;
case ERL_NEW_REFERENCE_EXT:
- /* first the integer count */
- term->value.ref.len = get16be(s);
- /* then the nodename */
- if (get_atom(&s, term->value.ref.node, NULL) < 0) return -1;
- /* creation */
- term->value.ref.creation = get8(s) & 0x03;
- /* finally the id integers */
- for (i = 0; (i<term->value.ref.len) && (i<3); i++) {
- term->value.ref.n[i] = get32be(s);
- }
- if (term->value.ref.len > 3) {
- s += 4 * (term->value.ref.len - 3);
- }
- break;
+ case ERL_NEWER_REFERENCE_EXT:
+ return (ei_decode_ref(buf, index, &term->value.ref) < 0
+ ? -1 : 1);
case ERL_PORT_EXT:
- if (get_atom(&s, term->value.port.node, NULL) < 0) return -1;
- term->value.port.id = get32be(s) & 0x0fffffff; /* 28 bits */;
- term->value.port.creation = get8(s) & 0x03;
- break;
+ case ERL_NEW_PORT_EXT:
+ return (ei_decode_port(buf, index, &term->value.port) < 0
+ ? -1 : 1);
case ERL_PID_EXT:
- if (get_atom(&s, term->value.pid.node, NULL) < 0) return -1;
- /* now the numbers: num (4), serial (4), creation (1) */
- term->value.pid.num = get32be(s) & 0x7fff; /* 15 bits */
- term->value.pid.serial = get32be(s) & 0x1fff; /* 13 bits */
- term->value.pid.creation = get8(s) & 0x03; /* 2 bits */
- break;
+ case ERL_NEW_PID_EXT:
+ return (ei_decode_pid(buf, index, &term->value.pid) < 0
+ ? -1 : 1);
case ERL_SMALL_TUPLE_EXT:
term->arity = get8(s);
break;
diff --git a/lib/erl_interface/src/misc/ei_decode_term.h b/lib/erl_interface/src/misc/ei_decode_term.h
index 1f7cedff02..cf2b8f7e86 100644
--- a/lib/erl_interface/src/misc/ei_decode_term.h
+++ b/lib/erl_interface/src/misc/ei_decode_term.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/ei_format.c b/lib/erl_interface/src/misc/ei_format.c
index 191f4ec7b5..a188171f40 100644
--- a/lib/erl_interface/src/misc/ei_format.c
+++ b/lib/erl_interface/src/misc/ei_format.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/ei_format.h b/lib/erl_interface/src/misc/ei_format.h
index 5fa3247d60..7a418008a1 100644
--- a/lib/erl_interface/src/misc/ei_format.h
+++ b/lib/erl_interface/src/misc/ei_format.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/ei_internal.h b/lib/erl_interface/src/misc/ei_internal.h
index 56cdb53fbf..aa6aacd703 100644
--- a/lib/erl_interface/src/misc/ei_internal.h
+++ b/lib/erl_interface/src/misc/ei_internal.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/ei_locking.c b/lib/erl_interface/src/misc/ei_locking.c
index c4c4a8e735..85b2a5fd8b 100644
--- a/lib/erl_interface/src/misc/ei_locking.c
+++ b/lib/erl_interface/src/misc/ei_locking.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/ei_locking.h b/lib/erl_interface/src/misc/ei_locking.h
index 99b88ead3b..1bbee2d499 100644
--- a/lib/erl_interface/src/misc/ei_locking.h
+++ b/lib/erl_interface/src/misc/ei_locking.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/ei_malloc.c b/lib/erl_interface/src/misc/ei_malloc.c
index 347973bbd6..a8921bc5b5 100644
--- a/lib/erl_interface/src/misc/ei_malloc.c
+++ b/lib/erl_interface/src/misc/ei_malloc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/ei_malloc.h b/lib/erl_interface/src/misc/ei_malloc.h
index b02811101b..b62a3cf4d7 100644
--- a/lib/erl_interface/src/misc/ei_malloc.h
+++ b/lib/erl_interface/src/misc/ei_malloc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/ei_portio.c b/lib/erl_interface/src/misc/ei_portio.c
index d4fa2c30e7..8cd35bf2e5 100644
--- a/lib/erl_interface/src/misc/ei_portio.c
+++ b/lib/erl_interface/src/misc/ei_portio.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/ei_portio.h b/lib/erl_interface/src/misc/ei_portio.h
index 24dcee4780..a14fdbd7d1 100644
--- a/lib/erl_interface/src/misc/ei_portio.h
+++ b/lib/erl_interface/src/misc/ei_portio.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/ei_printterm.c b/lib/erl_interface/src/misc/ei_printterm.c
index 702ee9566d..058de00de5 100644
--- a/lib/erl_interface/src/misc/ei_printterm.c
+++ b/lib/erl_interface/src/misc/ei_printterm.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -151,15 +151,18 @@ static int print_term(FILE* fp, ei_x_buff* x,
}
break;
case ERL_PID_EXT:
+ case ERL_NEW_PID_EXT:
if (ei_decode_pid(buf, index, &pid) < 0) goto err;
ch_written += xprintf(fp, x, "<%s.%d.%d>", pid.node,
pid.num, pid.serial);
break;
case ERL_PORT_EXT:
+ case ERL_NEW_PORT_EXT:
if (ei_decode_port(buf, index, &port) < 0) goto err;
ch_written += xprintf(fp, x, "#Port<%d.%d>", port.id, port.creation);
break;
case ERL_NEW_REFERENCE_EXT:
+ case ERL_NEWER_REFERENCE_EXT:
case ERL_REFERENCE_EXT:
if (ei_decode_ref(buf, index, &ref) < 0) goto err;
ch_written += xprintf(fp, x, "#Ref<");
diff --git a/lib/erl_interface/src/misc/ei_printterm.h b/lib/erl_interface/src/misc/ei_printterm.h
index cb9e12c2dd..953ea00744 100644
--- a/lib/erl_interface/src/misc/ei_printterm.h
+++ b/lib/erl_interface/src/misc/ei_printterm.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/ei_pthreads.c b/lib/erl_interface/src/misc/ei_pthreads.c
index 1d86fdb736..25608edeec 100644
--- a/lib/erl_interface/src/misc/ei_pthreads.c
+++ b/lib/erl_interface/src/misc/ei_pthreads.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/ei_trace.c b/lib/erl_interface/src/misc/ei_trace.c
index b341f38105..53d90a9c51 100644
--- a/lib/erl_interface/src/misc/ei_trace.c
+++ b/lib/erl_interface/src/misc/ei_trace.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/ei_trace.h b/lib/erl_interface/src/misc/ei_trace.h
index 0105a0c1f1..a0988ca8ae 100644
--- a/lib/erl_interface/src/misc/ei_trace.h
+++ b/lib/erl_interface/src/misc/ei_trace.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/ei_x_encode.c b/lib/erl_interface/src/misc/ei_x_encode.c
index 4cd882235f..4ff5974663 100644
--- a/lib/erl_interface/src/misc/ei_x_encode.c
+++ b/lib/erl_interface/src/misc/ei_x_encode.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/ei_x_encode.h b/lib/erl_interface/src/misc/ei_x_encode.h
index f11d750b28..2c8e362caa 100644
--- a/lib/erl_interface/src/misc/ei_x_encode.h
+++ b/lib/erl_interface/src/misc/ei_x_encode.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/eidef.h b/lib/erl_interface/src/misc/eidef.h
index 9ac49434e6..f38824d826 100644
--- a/lib/erl_interface/src/misc/eidef.h
+++ b/lib/erl_interface/src/misc/eidef.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/eiext.h b/lib/erl_interface/src/misc/eiext.h
index caf98c8e70..ac60d73821 100644
--- a/lib/erl_interface/src/misc/eiext.h
+++ b/lib/erl_interface/src/misc/eiext.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/get_type.c b/lib/erl_interface/src/misc/get_type.c
index 6b95c1f470..aa69cd4d60 100644
--- a/lib/erl_interface/src/misc/get_type.c
+++ b/lib/erl_interface/src/misc/get_type.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -76,6 +76,15 @@ int ei_get_type_internal(const char *buf, const int *index,
*len = get32be(s); /* #digit_bytes */
break;
+ case ERL_NEW_PID_EXT:
+ *type = ERL_PID_EXT;
+ break;
+ case ERL_NEW_PORT_EXT:
+ *type = ERL_PORT_EXT;
+ break;
+ case ERL_NEWER_REFERENCE_EXT:
+ *type = ERL_NEW_REFERENCE_EXT;
+ break;
default:
*len = 0;
break;
diff --git a/lib/erl_interface/src/misc/putget.h b/lib/erl_interface/src/misc/putget.h
index f7b42b6efa..afc04e32f9 100644
--- a/lib/erl_interface/src/misc/putget.h
+++ b/lib/erl_interface/src/misc/putget.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/misc/show_msg.c b/lib/erl_interface/src/misc/show_msg.c
index b08b17aea4..81accab4b6 100644
--- a/lib/erl_interface/src/misc/show_msg.c
+++ b/lib/erl_interface/src/misc/show_msg.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -398,6 +398,7 @@ static void show_term(const char *termbuf, int *index, FILE *stream)
break;
case ERL_PID_EXT:
+ case ERL_NEW_PID_EXT:
ei_decode_pid(termbuf,index,&pid);
show_pid(stream,&pid);
break;
@@ -432,6 +433,7 @@ static void show_term(const char *termbuf, int *index, FILE *stream)
case ERL_REFERENCE_EXT:
case ERL_NEW_REFERENCE_EXT:
+ case ERL_NEWER_REFERENCE_EXT:
ei_decode_ref(termbuf,index,&ref);
fprintf(stream,"#Ref<%s",ref.node);
for (i = 0; i < ref.len; i++) {
@@ -441,6 +443,7 @@ static void show_term(const char *termbuf, int *index, FILE *stream)
break;
case ERL_PORT_EXT:
+ case ERL_NEW_PORT_EXT:
ei_decode_port(termbuf,index,&port);
fprintf(stream,"#Port<%s.%u.%u>",port.node,port.id,port.creation);
break;
diff --git a/lib/erl_interface/src/misc/show_msg.h b/lib/erl_interface/src/misc/show_msg.h
index 1f1bd9cb17..de0f8fcdcd 100644
--- a/lib/erl_interface/src/misc/show_msg.h
+++ b/lib/erl_interface/src/misc/show_msg.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/not_used/ei_send.c b/lib/erl_interface/src/not_used/ei_send.c
index 437b62cc5d..8071876677 100644
--- a/lib/erl_interface/src/not_used/ei_send.c
+++ b/lib/erl_interface/src/not_used/ei_send.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/not_used/ei_send_reg.c b/lib/erl_interface/src/not_used/ei_send_reg.c
index f6b66e155c..ba9c7348f9 100644
--- a/lib/erl_interface/src/not_used/ei_send_reg.c
+++ b/lib/erl_interface/src/not_used/ei_send_reg.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/not_used/send_link.c b/lib/erl_interface/src/not_used/send_link.c
index 3c907897e0..7be476fd93 100644
--- a/lib/erl_interface/src/not_used/send_link.c
+++ b/lib/erl_interface/src/not_used/send_link.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/not_used/whereis.c b/lib/erl_interface/src/not_used/whereis.c
index 3b7cfb0ee7..4072fa7b33 100644
--- a/lib/erl_interface/src/not_used/whereis.c
+++ b/lib/erl_interface/src/not_used/whereis.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/prog/ei_fake_prog.c b/lib/erl_interface/src/prog/ei_fake_prog.c
index 2d149aec0c..c7a16dc7c4 100644
--- a/lib/erl_interface/src/prog/ei_fake_prog.c
+++ b/lib/erl_interface/src/prog/ei_fake_prog.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/prog/erl_call.c b/lib/erl_interface/src/prog/erl_call.c
index d36742c4f6..d233ed26a2 100644
--- a/lib/erl_interface/src/prog/erl_call.c
+++ b/lib/erl_interface/src/prog/erl_call.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/prog/erl_fake_prog.c b/lib/erl_interface/src/prog/erl_fake_prog.c
index 80d72eb933..093bad8d7c 100644
--- a/lib/erl_interface/src/prog/erl_fake_prog.c
+++ b/lib/erl_interface/src/prog/erl_fake_prog.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/prog/erl_start.c b/lib/erl_interface/src/prog/erl_start.c
index b7816f3ad4..d8f0632341 100644
--- a/lib/erl_interface/src/prog/erl_start.c
+++ b/lib/erl_interface/src/prog/erl_start.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/prog/erl_start.h b/lib/erl_interface/src/prog/erl_start.h
index a78dd16edb..1d0d584c45 100644
--- a/lib/erl_interface/src/prog/erl_start.h
+++ b/lib/erl_interface/src/prog/erl_start.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/hash.h b/lib/erl_interface/src/registry/hash.h
index 69882a79d9..7fcaced319 100644
--- a/lib/erl_interface/src/registry/hash.h
+++ b/lib/erl_interface/src/registry/hash.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/hash_dohash.c b/lib/erl_interface/src/registry/hash_dohash.c
index 0be54e0d3d..6f859cef2e 100644
--- a/lib/erl_interface/src/registry/hash_dohash.c
+++ b/lib/erl_interface/src/registry/hash_dohash.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/hash_foreach.c b/lib/erl_interface/src/registry/hash_foreach.c
index 2fe8eebfbc..b58df27e8e 100644
--- a/lib/erl_interface/src/registry/hash_foreach.c
+++ b/lib/erl_interface/src/registry/hash_foreach.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/hash_freetab.c b/lib/erl_interface/src/registry/hash_freetab.c
index e509af4a69..0a2c0dcfe6 100644
--- a/lib/erl_interface/src/registry/hash_freetab.c
+++ b/lib/erl_interface/src/registry/hash_freetab.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/hash_insert.c b/lib/erl_interface/src/registry/hash_insert.c
index d1b27ee6fe..0002cb64df 100644
--- a/lib/erl_interface/src/registry/hash_insert.c
+++ b/lib/erl_interface/src/registry/hash_insert.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/hash_isprime.c b/lib/erl_interface/src/registry/hash_isprime.c
index 18fd74fbc7..58166c6957 100644
--- a/lib/erl_interface/src/registry/hash_isprime.c
+++ b/lib/erl_interface/src/registry/hash_isprime.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/hash_lookup.c b/lib/erl_interface/src/registry/hash_lookup.c
index 3a6643ad69..31c30179df 100644
--- a/lib/erl_interface/src/registry/hash_lookup.c
+++ b/lib/erl_interface/src/registry/hash_lookup.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/hash_newtab.c b/lib/erl_interface/src/registry/hash_newtab.c
index 08ecc60f8a..4baa5a7b41 100644
--- a/lib/erl_interface/src/registry/hash_newtab.c
+++ b/lib/erl_interface/src/registry/hash_newtab.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/hash_remove.c b/lib/erl_interface/src/registry/hash_remove.c
index 63484daff6..080f15889e 100644
--- a/lib/erl_interface/src/registry/hash_remove.c
+++ b/lib/erl_interface/src/registry/hash_remove.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/hash_resize.c b/lib/erl_interface/src/registry/hash_resize.c
index c556ab7b68..031d8bfbf6 100644
--- a/lib/erl_interface/src/registry/hash_resize.c
+++ b/lib/erl_interface/src/registry/hash_resize.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/hash_rlookup.c b/lib/erl_interface/src/registry/hash_rlookup.c
index d774089e36..b0a948673a 100644
--- a/lib/erl_interface/src/registry/hash_rlookup.c
+++ b/lib/erl_interface/src/registry/hash_rlookup.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg.h b/lib/erl_interface/src/registry/reg.h
index 92798f02c8..261e36ac06 100644
--- a/lib/erl_interface/src/registry/reg.h
+++ b/lib/erl_interface/src/registry/reg.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_close.c b/lib/erl_interface/src/registry/reg_close.c
index 1ac9e623a7..c1475383e1 100644
--- a/lib/erl_interface/src/registry/reg_close.c
+++ b/lib/erl_interface/src/registry/reg_close.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_delete.c b/lib/erl_interface/src/registry/reg_delete.c
index b1fb7a1fac..8882f611bc 100644
--- a/lib/erl_interface/src/registry/reg_delete.c
+++ b/lib/erl_interface/src/registry/reg_delete.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_dirty.c b/lib/erl_interface/src/registry/reg_dirty.c
index a128136054..00f19482c2 100644
--- a/lib/erl_interface/src/registry/reg_dirty.c
+++ b/lib/erl_interface/src/registry/reg_dirty.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_dump.c b/lib/erl_interface/src/registry/reg_dump.c
index d1347491e5..43c9824433 100644
--- a/lib/erl_interface/src/registry/reg_dump.c
+++ b/lib/erl_interface/src/registry/reg_dump.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_free.c b/lib/erl_interface/src/registry/reg_free.c
index aff6782925..d835520e76 100644
--- a/lib/erl_interface/src/registry/reg_free.c
+++ b/lib/erl_interface/src/registry/reg_free.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_get.c b/lib/erl_interface/src/registry/reg_get.c
index e3f111e746..67d99e231e 100644
--- a/lib/erl_interface/src/registry/reg_get.c
+++ b/lib/erl_interface/src/registry/reg_get.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_getf.c b/lib/erl_interface/src/registry/reg_getf.c
index 20071d6d95..35956c3d79 100644
--- a/lib/erl_interface/src/registry/reg_getf.c
+++ b/lib/erl_interface/src/registry/reg_getf.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_geti.c b/lib/erl_interface/src/registry/reg_geti.c
index 14c8a17b51..09709fdf3d 100644
--- a/lib/erl_interface/src/registry/reg_geti.c
+++ b/lib/erl_interface/src/registry/reg_geti.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_getp.c b/lib/erl_interface/src/registry/reg_getp.c
index b60aa9d37f..faff00bcb0 100644
--- a/lib/erl_interface/src/registry/reg_getp.c
+++ b/lib/erl_interface/src/registry/reg_getp.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_gets.c b/lib/erl_interface/src/registry/reg_gets.c
index 32d34197c2..27fd83ac03 100644
--- a/lib/erl_interface/src/registry/reg_gets.c
+++ b/lib/erl_interface/src/registry/reg_gets.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_make.c b/lib/erl_interface/src/registry/reg_make.c
index 11373afab9..ed77a740b6 100644
--- a/lib/erl_interface/src/registry/reg_make.c
+++ b/lib/erl_interface/src/registry/reg_make.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_open.c b/lib/erl_interface/src/registry/reg_open.c
index 9965416599..73c2140145 100644
--- a/lib/erl_interface/src/registry/reg_open.c
+++ b/lib/erl_interface/src/registry/reg_open.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_purge.c b/lib/erl_interface/src/registry/reg_purge.c
index b585a43a64..08483e32f5 100644
--- a/lib/erl_interface/src/registry/reg_purge.c
+++ b/lib/erl_interface/src/registry/reg_purge.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_resize.c b/lib/erl_interface/src/registry/reg_resize.c
index 18a2c2670e..b451a28348 100644
--- a/lib/erl_interface/src/registry/reg_resize.c
+++ b/lib/erl_interface/src/registry/reg_resize.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_restore.c b/lib/erl_interface/src/registry/reg_restore.c
index 49e8f2740d..75d073303f 100644
--- a/lib/erl_interface/src/registry/reg_restore.c
+++ b/lib/erl_interface/src/registry/reg_restore.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_set.c b/lib/erl_interface/src/registry/reg_set.c
index 0519246a7f..95b90adb87 100644
--- a/lib/erl_interface/src/registry/reg_set.c
+++ b/lib/erl_interface/src/registry/reg_set.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_setf.c b/lib/erl_interface/src/registry/reg_setf.c
index abbe409f10..e0879cb3d5 100644
--- a/lib/erl_interface/src/registry/reg_setf.c
+++ b/lib/erl_interface/src/registry/reg_setf.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_seti.c b/lib/erl_interface/src/registry/reg_seti.c
index afb3b1fee7..507ed9907e 100644
--- a/lib/erl_interface/src/registry/reg_seti.c
+++ b/lib/erl_interface/src/registry/reg_seti.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_setp.c b/lib/erl_interface/src/registry/reg_setp.c
index dd8038a811..1dd158778a 100644
--- a/lib/erl_interface/src/registry/reg_setp.c
+++ b/lib/erl_interface/src/registry/reg_setp.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_sets.c b/lib/erl_interface/src/registry/reg_sets.c
index 7f0e64162f..d281d732b7 100644
--- a/lib/erl_interface/src/registry/reg_sets.c
+++ b/lib/erl_interface/src/registry/reg_sets.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_stat.c b/lib/erl_interface/src/registry/reg_stat.c
index e876aa566c..e946199f4a 100644
--- a/lib/erl_interface/src/registry/reg_stat.c
+++ b/lib/erl_interface/src/registry/reg_stat.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/src/registry/reg_tabstat.c b/lib/erl_interface/src/registry/reg_tabstat.c
index 2c5d185ec1..1a3e654090 100644
--- a/lib/erl_interface/src/registry/reg_tabstat.c
+++ b/lib/erl_interface/src/registry/reg_tabstat.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/Makefile b/lib/erl_interface/test/Makefile
index 800573e8e4..94f4b422d6 100644
--- a/lib/erl_interface/test/Makefile
+++ b/lib/erl_interface/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/Makefile.src b/lib/erl_interface/test/Makefile.src
index f105a1a3d1..8cf2ea0933 100644
--- a/lib/erl_interface/test/Makefile.src
+++ b/lib/erl_interface/test/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/all_SUITE_data/Makefile.first b/lib/erl_interface/test/all_SUITE_data/Makefile.first
index fe295b5e5c..b83fa6ff5c 100644
--- a/lib/erl_interface/test/all_SUITE_data/Makefile.first
+++ b/lib/erl_interface/test/all_SUITE_data/Makefile.first
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2009. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/all_SUITE_data/Makefile.src b/lib/erl_interface/test/all_SUITE_data/Makefile.src
index 476784230b..4f27b097c8 100644
--- a/lib/erl_interface/test/all_SUITE_data/Makefile.src
+++ b/lib/erl_interface/test/all_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2012. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/all_SUITE_data/ei_runner.c b/lib/erl_interface/test/all_SUITE_data/ei_runner.c
index 3a0de22df4..cd7a67c57c 100644
--- a/lib/erl_interface/test/all_SUITE_data/ei_runner.c
+++ b/lib/erl_interface/test/all_SUITE_data/ei_runner.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -198,8 +198,8 @@ void free_packet(char* packet)
* ----- ----------------------------
* [$b|Bytes] {bytes, Bytes}
* [$e] eot
- * [$f] test_server:fail()
- * [$f|Reason] test_server:fail(Reason)
+ * [$f] ct:fail()
+ * [$f|Reason] ct:fail(Reason)
* [$t|EncodedTerm] {term, Term}
* [$N] 'NULL'
* [$m|Message] io:format("~s", [Message]) (otherwise ignored)
@@ -211,7 +211,7 @@ void free_packet(char* packet)
* you implement a test case entirely in C code.
*
* If the ok argument is zero, a [$f] reply will be sent to the
- * Erlang side (causing test_server:fail() to be called); otherwise,
+ * Erlang side (causing ct:fail() to be called); otherwise,
* the atom 'eot' will be sent to Erlang.
*
* If you need to provide more details on a failure, use the fail() function.
@@ -251,16 +251,21 @@ do_report(file, line, ok)
/*
- * This function causes a call to test_server:fail(Reason) on the
+ * This function causes a call to ct:fail(Reason) on the
* Erlang side.
*/
-void do_fail(char* file, int line, char* reason)
+void do_fail(const char* file, int line, const char* reason, ...)
{
+ va_list ap;
char sbuf[2048];
+ char* sp = sbuf;
- sbuf[0] = 'f';
- sprintf(sbuf+1, "%s, line %d: %s", file, line, reason);
+ *sp++ = 'f';
+ sp += sprintf(sp, "%s, line %d: ", file, line);
+ va_start(ap, reason);
+ sp += vsprintf(sp, reason, ap);
+ va_end(ap);
reply(sbuf, 1+strlen(sbuf+1));
}
diff --git a/lib/erl_interface/test/all_SUITE_data/ei_runner.h b/lib/erl_interface/test/all_SUITE_data/ei_runner.h
index 62997d00a0..2608661303 100644
--- a/lib/erl_interface/test/all_SUITE_data/ei_runner.h
+++ b/lib/erl_interface/test/all_SUITE_data/ei_runner.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,10 +52,11 @@ void free_packet(char*);
*/
#define fail(reason) do_fail(__FILE__, __LINE__, reason)
+#define fail1(reason, a1) do_fail(__FILE__, __LINE__, reason, a1)
#define report(ok) do_report(__FILE__, __LINE__, ok)
void do_report(char* file, int line, int ok);
-void do_fail(char* file, int line, char* reason);
+void do_fail(const char* file, int line, const char* reason, ...);
void send_buffer(char* buf, int size);
void message(char* format, ...);
diff --git a/lib/erl_interface/test/all_SUITE_data/gccifier.c b/lib/erl_interface/test/all_SUITE_data/gccifier.c
index ca022eb390..0c3ef915fb 100644
--- a/lib/erl_interface/test/all_SUITE_data/gccifier.c
+++ b/lib/erl_interface/test/all_SUITE_data/gccifier.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/all_SUITE_data/gccifier.sh b/lib/erl_interface/test/all_SUITE_data/gccifier.sh
index 594608df9f..179394bb4e 100755
--- a/lib/erl_interface/test/all_SUITE_data/gccifier.sh
+++ b/lib/erl_interface/test/all_SUITE_data/gccifier.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2009. All Rights Reserved.
+# Copyright Ericsson AB 2005-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/all_SUITE_data/init_tc.erl b/lib/erl_interface/test/all_SUITE_data/init_tc.erl
index 74d32d9ea4..d9ad291f3d 100644
--- a/lib/erl_interface/test/all_SUITE_data/init_tc.erl
+++ b/lib/erl_interface/test/all_SUITE_data/init_tc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/all_SUITE_data/reclaim.h b/lib/erl_interface/test/all_SUITE_data/reclaim.h
index eb0f7ce9fa..fe99bb0afc 100644
--- a/lib/erl_interface/test/all_SUITE_data/reclaim.h
+++ b/lib/erl_interface/test/all_SUITE_data/reclaim.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/all_SUITE_data/runner.c b/lib/erl_interface/test/all_SUITE_data/runner.c
index 47d918308d..42e8bb03e5 100644
--- a/lib/erl_interface/test/all_SUITE_data/runner.c
+++ b/lib/erl_interface/test/all_SUITE_data/runner.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -200,8 +200,8 @@ char *read_packet(int *len)
* ----- ----------------------------
* [$b|Bytes] {bytes, Bytes}
* [$e] eot
- * [$f] test_server:fail()
- * [$f|Reason] test_server:fail(Reason)
+ * [$f] ct:fail()
+ * [$f|Reason] ct:fail(Reason)
* [$t|EncodedTerm] {term, Term}
* [$N] 'NULL'
* [$m|Message] io:format("~s", [Message]) (otherwise ignored)
@@ -213,7 +213,7 @@ char *read_packet(int *len)
* you implement a test case entirely in C code.
*
* If the ok argument is zero, a [$f] reply will be sent to the
- * Erlang side (causing test_server:fail() to be called); otherwise,
+ * Erlang side (causing ct:fail() to be called); otherwise,
* the atom 'eot' will be sent to Erlang.
*
* If you need to provide more details on a failure, use the fail() function.
@@ -253,7 +253,7 @@ do_report(file, line, ok)
/*
- * This function causes a call to test_server:fail(Reason) on the
+ * This function causes a call to ct:fail(Reason) on the
* Erlang side.
*/
diff --git a/lib/erl_interface/test/all_SUITE_data/runner.h b/lib/erl_interface/test/all_SUITE_data/runner.h
index 2af267ecb9..493602869f 100644
--- a/lib/erl_interface/test/all_SUITE_data/runner.h
+++ b/lib/erl_interface/test/all_SUITE_data/runner.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_accept_SUITE.erl b/lib/erl_interface/test/ei_accept_SUITE.erl
index db3587339e..e06ee762d7 100644
--- a/lib/erl_interface/test/ei_accept_SUITE.erl
+++ b/lib/erl_interface/test/ei_accept_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,94 +24,67 @@
-include_lib("common_test/include/ct.hrl").
-include("ei_accept_SUITE_data/ei_accept_test_cases.hrl").
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- init_per_testcase/2, end_per_testcase/2,
- ei_accept/1, ei_threaded_accept/1]).
+-export([all/0, suite/0,
+ ei_accept/1, ei_threaded_accept/1]).
-import(runner, [get_term/1,send_term/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {seconds, 30}}].
all() ->
[ei_accept, ei_threaded_accept].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
-init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?t:seconds(30)),
- [{watchdog, Dog}|Config].
-
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
- ok.
-
ei_accept(Config) when is_list(Config) ->
- ?line P = runner:start(?interpret),
- ?line 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
-
- ?line Myname= hd(tl(string:tokens(atom_to_list(node()), "@"))),
- ?line io:format("Myname ~p ~n", [Myname]),
- ?line EINode= list_to_atom("c42@"++Myname),
- ?line io:format("EINode ~p ~n", [EINode]),
- ?line Self= self(),
- ?line TermToSend= {call, Self, "Test"},
- ?line F= fun() ->
- case waitfornode("c42",20) of
- true ->
- {any, EINode} ! TermToSend,
- Self ! sent_ok;
- false ->
- Self ! never_published
- end,
- ok
- end,
-
- ?line spawn(F),
- ?line Port = 6543,
- ?line {ok, Fd, _Node} = ei_accept(P, Port),
- ?line TermReceived= ei_receive(P, Fd),
- ?line io:format("Sent ~p received ~p ~n", [TermToSend, TermReceived]),
- ?line TermToSend= TermReceived,
- ?line receive
- sent_ok ->
- ok;
- Unknown ->
- io:format("~p ~n", [Unknown])
- after 1000 ->
- io:format("timeout ~n")
- end,
- ?line runner:finish(P),
+ P = runner:start(?interpret),
+ 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
+
+ Myname = hd(tl(string:tokens(atom_to_list(node()), "@"))),
+ io:format("Myname ~p ~n", [Myname]),
+ EINode = list_to_atom("c42@"++Myname),
+ io:format("EINode ~p ~n", [EINode]),
+ Self = self(),
+ TermToSend= {call, Self, "Test"},
+ F= fun() ->
+ case waitfornode("c42",20) of
+ true ->
+ {any, EINode} ! TermToSend,
+ Self ! sent_ok;
+ false ->
+ Self ! never_published
+ end,
+ ok
+ end,
+
+ spawn(F),
+ Port = 6543,
+ {ok, Fd, _Node} = ei_accept(P, Port),
+ TermReceived= ei_receive(P, Fd),
+ io:format("Sent ~p received ~p ~n", [TermToSend, TermReceived]),
+ TermToSend= TermReceived,
+ receive
+ sent_ok ->
+ ok;
+ Unknown ->
+ io:format("~p ~n", [Unknown])
+ after 1000 ->
+ io:format("timeout ~n")
+ end,
+ runner:finish(P),
ok.
ei_threaded_accept(Config) when is_list(Config) ->
- ?line Einode = filename:join(?config(data_dir, Config), "eiaccnode"),
- ?line N = 1, % 3,
- ?line Host = atom_to_list(node()),
- ?line Port = 6767,
- ?line start_einode(Einode, N, Host, Port),
- ?line io:format("started eiaccnode"),
- %%?line spawn_link(fun() -> start_einode(Einode, N, Host, Port) end),
- ?line TestServerPid = self(),
- ?line [ spawn_link(fun() -> send_rec_einode(I, TestServerPid) end)
- || I <- lists:seq(0, N-1) ],
- ?line [ receive I -> ok end
- || I <- lists:seq(0, N-1) ],
+ Einode = filename:join(proplists:get_value(data_dir, Config), "eiaccnode"),
+ N = 1, % 3,
+ Host = atom_to_list(node()),
+ Port = 6767,
+ start_einode(Einode, N, Host, Port),
+ io:format("started eiaccnode"),
+ %%spawn_link(fun() -> start_einode(Einode, N, Host, Port) end),
+ TestServerPid = self(),
+ [spawn_link(fun() -> send_rec_einode(I, TestServerPid) end) || I <- lists:seq(0, N-1)],
+ [receive I -> ok end || I <- lists:seq(0, N-1) ],
ok.
waitfornode(String,0) ->
@@ -120,66 +93,61 @@ waitfornode(String,0) ->
waitfornode(String,N) ->
Registered = [X || {X,_} <- element(2,erl_epmd:names())],
case lists:member(String,Registered) of
- true ->
- true;
- false ->
- timer:sleep(1000),
- waitfornode(String,N-1)
+ true ->
+ true;
+ false ->
+ timer:sleep(1000),
+ waitfornode(String,N-1)
end.
send_rec_einode(N, TestServerPid) ->
- ?line Myname= hd(tl(string:tokens(atom_to_list(node()), "@"))),
- ?line FirstPart = "eiacc" ++ integer_to_list(N),
- ?line EINode= list_to_atom(FirstPart ++ "@" ++ Myname),
- ?line io:format("EINode ~p ~n", [EINode]),
- ?line Self= self(),
- ?line case waitfornode(FirstPart,20) of
- true -> ok;
- false -> test_server:fail({never_published,EINode})
- end,
- ?line {any, EINode} ! Self,
- ?line receive
- {N,_}=X ->
- ?line io:format("Received by ~s ~p~n", [EINode, X]),
- ?line TestServerPid ! N,
- ?line X
- after 10000 ->
- ?line test_server:fail(EINode)
- end.
+ Myname= hd(tl(string:tokens(atom_to_list(node()), "@"))),
+ FirstPart = "eiacc" ++ integer_to_list(N),
+ EINode= list_to_atom(FirstPart ++ "@" ++ Myname),
+ io:format("EINode ~p ~n", [EINode]),
+ Self= self(),
+ case waitfornode(FirstPart,20) of
+ true -> ok;
+ false -> ct:fail({never_published,EINode})
+ end,
+ {any, EINode} ! Self,
+ receive
+ {N,_}=X ->
+ io:format("Received by ~s ~p~n", [EINode, X]),
+ TestServerPid ! N,
+ X
+ after 10000 ->
+ ct:fail(EINode)
+ end.
start_einode(Einode, N, Host, Port) ->
Einodecmd = Einode ++ " " ++ atom_to_list(erlang:get_cookie())
- ++ " " ++ integer_to_list(N) ++ " " ++ Host ++ " "
- ++ integer_to_list(Port) ++ " nothreads",
+ ++ " " ++ integer_to_list(N) ++ " " ++ Host ++ " "
+ ++ integer_to_list(Port) ++ " nothreads",
io:format("Einodecmd ~p ~n", [Einodecmd]),
- ?line open_port({spawn, Einodecmd}, []),
+ open_port({spawn, Einodecmd}, []),
ok.
-
%%% Interface functions for ei (erl_interface) functions.
ei_connect_init(P, Num, Cookie, Creation) ->
send_command(P, ei_connect_init, [Num,Cookie,Creation]),
case get_term(P) of
- {term,Int} when is_integer(Int) -> Int
+ {term,Int} when is_integer(Int) -> Int
end.
ei_accept(P, PortNo) ->
send_command(P, ei_accept, [PortNo]),
case get_term(P) of
- {term,{Fd, _, Node}} when Fd >= 0 -> {ok, Fd, Node};
- {term,{_Fd, Errno, _Node}} -> {error,Errno}
+ {term,{Fd, _, Node}} when Fd >= 0 -> {ok, Fd, Node};
+ {term,{_Fd, Errno, _Node}} -> {error,Errno}
end.
ei_receive(P, Fd) ->
send_command(P, ei_receive, [Fd]),
- {term, T}= get_term(P),
+ {term, T} = get_term(P),
T.
send_command(P, Name, Args) ->
runner:send_term(P, {Name,list_to_tuple(Args)}).
-
-
-
-
diff --git a/lib/erl_interface/test/ei_accept_SUITE_data/Makefile.first b/lib/erl_interface/test/ei_accept_SUITE_data/Makefile.first
index 8153368870..6e89cc5a78 100644
--- a/lib/erl_interface/test/ei_accept_SUITE_data/Makefile.first
+++ b/lib/erl_interface/test/ei_accept_SUITE_data/Makefile.first
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_accept_SUITE_data/Makefile.src b/lib/erl_interface/test/ei_accept_SUITE_data/Makefile.src
index d900b4aa8f..10ef437f8b 100644
--- a/lib/erl_interface/test/ei_accept_SUITE_data/Makefile.src
+++ b/lib/erl_interface/test/ei_accept_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_accept_SUITE_data/ei_accept_test.c b/lib/erl_interface/test/ei_accept_SUITE_data/ei_accept_test.c
index ad68ba9bb5..7b81ee5491 100644
--- a/lib/erl_interface/test/ei_accept_SUITE_data/ei_accept_test.c
+++ b/lib/erl_interface/test/ei_accept_SUITE_data/ei_accept_test.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_accept_SUITE_data/eiaccnode.c b/lib/erl_interface/test/ei_accept_SUITE_data/eiaccnode.c
index 6a3d2bc157..308f843530 100644
--- a/lib/erl_interface/test/ei_accept_SUITE_data/eiaccnode.c
+++ b/lib/erl_interface/test/ei_accept_SUITE_data/eiaccnode.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_connect_SUITE.erl b/lib/erl_interface/test/ei_connect_SUITE.erl
index c94ac37af4..66498deadc 100644
--- a/lib/erl_interface/test/ei_connect_SUITE.erl
+++ b/lib/erl_interface/test/ei_connect_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,173 +24,145 @@
-include_lib("common_test/include/ct.hrl").
-include("ei_connect_SUITE_data/ei_connect_test_cases.hrl").
--export([
- all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- init_per_testcase/2,
- end_per_testcase/2,
-
- ei_send/1,
- ei_reg_send/1,
- ei_format_pid/1,
- ei_rpc/1,
- rpc_test/1,
- ei_send_funs/1,
- ei_threaded_send/1,
- ei_set_get_tracelevel/1
- ]).
+-export([all/0, suite/0,
+ ei_send/1,
+ ei_reg_send/1,
+ ei_format_pid/1,
+ ei_rpc/1,
+ rpc_test/1,
+ ei_send_funs/1,
+ ei_threaded_send/1,
+ ei_set_get_tracelevel/1]).
-import(runner, [get_term/1,send_term/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {seconds, 30}}].
all() ->
[ei_send, ei_reg_send, ei_rpc, ei_format_pid, ei_send_funs,
ei_threaded_send, ei_set_get_tracelevel].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?t:minutes(0.25)),
- [{watchdog, Dog}|Config].
-
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
- ok.
-
ei_send(Config) when is_list(Config) ->
- ?line P = runner:start(?interpret),
- ?line 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
- ?line {ok,Fd} = ei_connect(P, node()),
+ P = runner:start(?interpret),
+ 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
+ {ok,Fd} = ei_connect(P, node()),
- ?line ok = ei_send(P, Fd, self(), AMsg={a,message}),
- ?line receive AMsg -> ok end,
+ ok = ei_send(P, Fd, self(), AMsg={a,message}),
+ receive AMsg -> ok end,
- ?line runner:send_eot(P),
- ?line runner:recv_eot(P),
+ runner:send_eot(P),
+ runner:recv_eot(P),
ok.
ei_format_pid(Config) when is_list(Config) ->
- ?line S = self(),
- ?line P = runner:start(?interpret),
- ?line 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
- ?line {ok,Fd} = ei_connect(P, node()),
+ S = self(),
+ P = runner:start(?interpret),
+ 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
+ {ok,Fd} = ei_connect(P, node()),
- ?line ok = ei_format_pid(P, Fd, S),
- ?line receive S -> ok end,
+ ok = ei_format_pid(P, Fd, S),
+ receive S -> ok end,
- ?line runner:send_eot(P),
- ?line runner:recv_eot(P),
+ runner:send_eot(P),
+ runner:recv_eot(P),
ok.
ei_send_funs(Config) when is_list(Config) ->
- ?line P = runner:start(?interpret),
- ?line 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
- ?line {ok,Fd} = ei_connect(P, node()),
-
- ?line Fun1 = fun ei_send/1,
- ?line Fun2 = fun(X) -> P, X, Fd, Fun1 end,
-
- ?line AMsg={Fun1,Fun2},
+ P = runner:start(?interpret),
+ 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
+ {ok,Fd} = ei_connect(P, node()),
+
+ Fun1 = fun ei_send/1,
+ Fun2 = fun(X) -> P, X, Fd, Fun1 end,
+
+ AMsg={Fun1,Fun2},
%%AMsg={wait_with_funs, new_dist_format},
- ?line ok = ei_send_funs(P, Fd, self(), AMsg),
- ?line EIMsg = receive M -> M end,
- ?line EIMsg = AMsg,
+ ok = ei_send_funs(P, Fd, self(), AMsg),
+ EIMsg = receive M -> M end,
+ EIMsg = AMsg,
- ?line runner:send_eot(P),
- ?line runner:recv_eot(P),
+ runner:send_eot(P),
+ runner:recv_eot(P),
ok.
ei_reg_send(Config) when is_list(Config) ->
- ?line P = runner:start(?interpret),
- ?line 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
- ?line {ok,Fd} = ei_connect(P, node()),
+ P = runner:start(?interpret),
+ 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
+ {ok,Fd} = ei_connect(P, node()),
ARegName = a_strange_registred_name,
- ?line register(ARegName, self()),
- ?line ok = ei_reg_send(P, Fd, ARegName, AMsg={another,[strange],message}),
- ?line receive AMsg -> ok end,
+ register(ARegName, self()),
+ ok = ei_reg_send(P, Fd, ARegName, AMsg={another,[strange],message}),
+ receive AMsg -> ok end,
- ?line runner:send_eot(P),
- ?line runner:recv_eot(P),
+ runner:send_eot(P),
+ runner:recv_eot(P),
ok.
ei_threaded_send(Config) when is_list(Config) ->
- ?line Einode = filename:join(?config(data_dir, Config), "einode"),
- ?line N = 15,
- ?line Host = atom_to_list(node()),
- ?line TestServerPid = self(),
- ?line [ spawn_link(fun() -> rec_einode(I, TestServerPid) end)
- || I <- lists:seq(0, N-1) ],
- ?line [ receive {I,registered} -> ok end
- || I <- lists:seq(0, N-1) ],
- ?line spawn_link(fun() -> start_einode(Einode, N, Host) end),
- ?line [ receive I -> ok end
- || I <- lists:seq(0, N-1) ],
+ Einode = filename:join(proplists:get_value(data_dir, Config), "einode"),
+ N = 15,
+ Host = atom_to_list(node()),
+ TestServerPid = self(),
+ [ spawn_link(fun() -> rec_einode(I, TestServerPid) end)
+ || I <- lists:seq(0, N-1) ],
+ [ receive {I,registered} -> ok end
+ || I <- lists:seq(0, N-1) ],
+ spawn_link(fun() -> start_einode(Einode, N, Host) end),
+ [ receive I -> ok end
+ || I <- lists:seq(0, N-1) ],
ok.
rec_einode(N, TestServerPid) ->
- ?line Regname = list_to_atom("mth"++integer_to_list(N)),
- ?line register(Regname, self()),
- ?line TestServerPid ! {N, registered},
- ?line io:format("~p waiting~n", [Regname]),
- ?line receive
- X ->
- ?line io:format("Received by ~s ~p~n", [Regname, X]),
- ?line TestServerPid ! N,
- ?line X
- after 10000 ->
- ?line test_server:fail(Regname)
- end.
+ Regname = list_to_atom("mth"++integer_to_list(N)),
+ register(Regname, self()),
+ TestServerPid ! {N, registered},
+ io:format("~p waiting~n", [Regname]),
+ receive
+ X ->
+ io:format("Received by ~s ~p~n", [Regname, X]),
+ TestServerPid ! N,
+ X
+ after 10000 ->
+ ct:fail(Regname)
+ end.
start_einode(Einode, N, Host) ->
Einodecmd = Einode ++ " " ++ atom_to_list(erlang:get_cookie())
- ++ " " ++ integer_to_list(N) ++ " " ++ Host,
+ ++ " " ++ integer_to_list(N) ++ " " ++ Host,
io:format("Einodecmd ~p ~n", [Einodecmd]),
- ?line open_port({spawn, Einodecmd}, []),
+ open_port({spawn, Einodecmd}, []),
ok.
ei_rpc(Config) when is_list(Config) ->
- ?line P = runner:start(?interpret),
- ?line 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
- ?line {ok,Fd} = ei_connect(P, node()),
+ P = runner:start(?interpret),
+ 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
+ {ok,Fd} = ei_connect(P, node()),
- ?line S= "Hej du glade!", SRev = lists:reverse(S),
- ?line X = ei_rpc(P, Fd, self(), {?MODULE, rpc_test}, [SRev]),
- ?line {term, S}= X,
+ S= "Hej du glade!", SRev = lists:reverse(S),
+ X = ei_rpc(P, Fd, self(), {?MODULE, rpc_test}, [SRev]),
+ {term, S}= X,
- ?line runner:send_eot(P),
- ?line runner:recv_eot(P),
+ runner:send_eot(P),
+ runner:recv_eot(P),
ok.
ei_set_get_tracelevel(Config) when is_list(Config) ->
- ?line P = runner:start(?interpret),
- ?line 5 = ei_set_get_tracelevel(P, 5),
- ?line 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
- ?line {ok,Fd} = ei_connect(P, node()),
+ P = runner:start(?interpret),
+ 5 = ei_set_get_tracelevel(P, 5),
+ 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
+ {ok,Fd} = ei_connect(P, node()),
- ?line S= "Hej du glade!", SRev = lists:reverse(S),
- ?line X = ei_rpc(P, Fd, self(), {?MODULE, rpc_test}, [SRev]),
- ?line {term, S}= X,
+ S= "Hej du glade!", SRev = lists:reverse(S),
+ X = ei_rpc(P, Fd, self(), {?MODULE, rpc_test}, [SRev]),
+ {term, S}= X,
- ?line 0 = ei_set_get_tracelevel(P, 0),
+ 0 = ei_set_get_tracelevel(P, 0),
- ?line runner:send_eot(P),
- ?line runner:recv_eot(P),
+ runner:send_eot(P),
+ runner:recv_eot(P),
ok.
@@ -199,20 +171,20 @@ ei_set_get_tracelevel(Config) when is_list(Config) ->
ei_connect_init(P, Num, Cookie, Creation) ->
send_command(P, ei_connect_init, [Num,Cookie,Creation]),
case get_term(P) of
- {term,Int} when is_integer(Int) -> Int
+ {term,Int} when is_integer(Int) -> Int
end.
ei_connect(P, Node) ->
send_command(P, ei_connect, [Node]),
case get_term(P) of
- {term,{Fd,_}} when Fd >= 0 -> {ok,Fd};
- {term,{-1,Errno}} -> {error,Errno}
+ {term,{Fd,_}} when Fd >= 0 -> {ok,Fd};
+ {term,{-1,Errno}} -> {error,Errno}
end.
ei_set_get_tracelevel(P, Tracelevel) ->
send_command(P, ei_set_get_tracelevel, [Tracelevel]),
case get_term(P) of
- {term,{tracelevel, Level}} when is_integer(Level) -> Level
+ {term,{tracelevel, Level}} when is_integer(Level) -> Level
end.
ei_send(P, Fd, To, Msg) ->
@@ -238,12 +210,12 @@ ei_rpc(P, Fd, To, Func, Msg) ->
get_send_result(P) ->
case get_term(P) of
- {term,{0,_}} -> ok;
- {term,{1,_}} -> ok;
- {term,{-1,Errno}} -> {error,Errno};
- {term,{Res,Errno}}->
- io:format("Return value: ~p\nerl_errno: ~p", [Res,Errno]),
- ?t:fail(bad_return_value)
+ {term,{0,_}} -> ok;
+ {term,{1,_}} -> ok;
+ {term,{-1,Errno}} -> {error,Errno};
+ {term,{Res,Errno}}->
+ io:format("Return value: ~p\nerl_errno: ~p", [Res,Errno]),
+ ct:fail(bad_return_value)
end.
send_command(P, Name, Args) ->
diff --git a/lib/erl_interface/test/ei_connect_SUITE_data/Makefile.first b/lib/erl_interface/test/ei_connect_SUITE_data/Makefile.first
index feee049795..1a9b4dbcea 100644
--- a/lib/erl_interface/test/ei_connect_SUITE_data/Makefile.first
+++ b/lib/erl_interface/test/ei_connect_SUITE_data/Makefile.first
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_connect_SUITE_data/Makefile.src b/lib/erl_interface/test/ei_connect_SUITE_data/Makefile.src
index 49e5e8f8e2..5b82f0bfcf 100644
--- a/lib/erl_interface/test/ei_connect_SUITE_data/Makefile.src
+++ b/lib/erl_interface/test/ei_connect_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_connect_SUITE_data/ei_connect_test.c b/lib/erl_interface/test/ei_connect_SUITE_data/ei_connect_test.c
index cfad73fd07..6a3796dd24 100644
--- a/lib/erl_interface/test/ei_connect_SUITE_data/ei_connect_test.c
+++ b/lib/erl_interface/test/ei_connect_SUITE_data/ei_connect_test.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_connect_SUITE_data/einode.c b/lib/erl_interface/test/ei_connect_SUITE_data/einode.c
index f151f6d2d6..e1d46ae59a 100644
--- a/lib/erl_interface/test/ei_connect_SUITE_data/einode.c
+++ b/lib/erl_interface/test/ei_connect_SUITE_data/einode.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_decode_SUITE.erl b/lib/erl_interface/test/ei_decode_SUITE.erl
index 91357c99f2..1495a0d5d9 100644
--- a/lib/erl_interface/test/ei_decode_SUITE.erl
+++ b/lib/erl_interface/test/ei_decode_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,20 +24,15 @@
-include_lib("common_test/include/ct.hrl").
-include("ei_decode_SUITE_data/ei_decode_test_cases.hrl").
--export(
- [
- all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2, init_per_testcase/2,
- end_per_testcase/2,
- test_ei_decode_long/1,
- test_ei_decode_ulong/1,
- test_ei_decode_longlong/1,
- test_ei_decode_ulonglong/1,
- test_ei_decode_char/1,
- test_ei_decode_nonoptimal/1,
- test_ei_decode_misc/1,
- test_ei_decode_utf8_atom/1
- ]).
+-export([all/0, suite/0,
+ test_ei_decode_long/1,
+ test_ei_decode_ulong/1,
+ test_ei_decode_longlong/1,
+ test_ei_decode_ulonglong/1,
+ test_ei_decode_char/1,
+ test_ei_decode_nonoptimal/1,
+ test_ei_decode_misc/1,
+ test_ei_decode_utf8_atom/1]).
suite() -> [{ct_hooks,[ts_install_cth]}].
@@ -47,27 +42,6 @@ all() ->
test_ei_decode_char, test_ei_decode_nonoptimal,
test_ei_decode_misc, test_ei_decode_utf8_atom].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-init_per_testcase(_TC, Config) ->
- Config.
-
-end_per_testcase(_RC, Config) ->
- Config.
-
%% ---------------------------------------------------------------------------
% NOTE: for historical reasons we don't pach as tight as we can,
@@ -76,55 +50,51 @@ end_per_testcase(_RC, Config) ->
%% ######################################################################## %%
-test_ei_decode_long(suite) -> [];
test_ei_decode_long(Config) when is_list(Config) ->
- ?line P = runner:start(?test_ei_decode_long),
+ P = runner:start(?test_ei_decode_long),
send_integers(P),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% ######################################################################## %%
-test_ei_decode_ulong(suite) -> [];
test_ei_decode_ulong(Config) when is_list(Config) ->
- ?line P = runner:start(?test_ei_decode_ulong),
+ P = runner:start(?test_ei_decode_ulong),
send_integers(P),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
% (*) In practical terms, other values may fit into the ext format
% i32 is signed 32 bit on C side
% u32 is unsigned 32 bit on C side
-
+
%% ######################################################################## %%
-test_ei_decode_longlong(suite) -> [];
test_ei_decode_longlong(Config) when is_list(Config) ->
case os:type() of
- vxworks ->
- {skip,"Skipped on VxWorks"};
- _ ->
- ?line P = runner:start(?test_ei_decode_longlong),
- send_integers2(P),
- ?line runner:recv_eot(P),
- ok
+ vxworks ->
+ {skip,"Skipped on VxWorks"};
+ _ ->
+ P = runner:start(?test_ei_decode_longlong),
+ send_integers2(P),
+ runner:recv_eot(P),
+ ok
end.
%% ######################################################################## %%
-test_ei_decode_ulonglong(suite) -> [];
test_ei_decode_ulonglong(Config) when is_list(Config) ->
case os:type() of
- vxworks ->
- {skip,"Skipped on VxWorks"};
- _ ->
- ?line P = runner:start(?test_ei_decode_ulonglong),
- send_integers2(P),
- ?line runner:recv_eot(P),
- ok
+ vxworks ->
+ {skip,"Skipped on VxWorks"};
+ _ ->
+ P = runner:start(?test_ei_decode_ulonglong),
+ send_integers2(P),
+ runner:recv_eot(P),
+ ok
end.
@@ -133,38 +103,36 @@ test_ei_decode_ulonglong(Config) when is_list(Config) ->
%% it is unsigned.
%% FIXME maybe the API should change to use "unsigned char" to be clear?!
-test_ei_decode_char(suite) -> [];
test_ei_decode_char(Config) when is_list(Config) ->
- ?line P = runner:start(?test_ei_decode_char),
+ P = runner:start(?test_ei_decode_char),
- ?line send_term_as_binary(P,0),
- ?line send_term_as_binary(P,16#7f),
- ?line send_term_as_binary(P,16#ff),
+ send_term_as_binary(P,0),
+ send_term_as_binary(P,16#7f),
+ send_term_as_binary(P,16#ff),
- ?line send_term_as_binary(P, []), % illegal type
+ send_term_as_binary(P, []), % illegal type
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% ######################################################################## %%
-test_ei_decode_nonoptimal(suite) -> [];
test_ei_decode_nonoptimal(Config) when is_list(Config) ->
- ?line P = runner:start(?test_ei_decode_nonoptimal),
+ P = runner:start(?test_ei_decode_nonoptimal),
send_non_optimal_pos(P), % decode_char
send_non_optimal(P), % decode_long
send_non_optimal_pos(P), % decode_ulong
case os:type() of
- vxworks ->
- ok;
- _ ->
- send_non_optimal(P), % decode_longlong
- send_non_optimal_pos(P) % decode_ulonglong
+ vxworks ->
+ ok;
+ _ ->
+ send_non_optimal(P), % decode_longlong
+ send_non_optimal_pos(P) % decode_ulonglong
end,
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
@@ -173,82 +141,81 @@ send_non_optimal(P) ->
send_non_optimal_neg(P).
send_non_optimal_pos(P) ->
- ?line send_raw(P, <<131,97,42>>),
- ?line send_raw(P, <<131,98,42:32>>),
- ?line send_raw(P, <<131,110,1,0,42>>),
- ?line send_raw(P, <<131,110,2,0,42,0>>),
- ?line send_raw(P, <<131,110,4,0,42,0,0,0>>),
- ?line send_raw(P, <<131,111,0,0,0,1,0,42>>),
- ?line send_raw(P, <<131,111,0,0,0,2,0,42,0>>),
- ?line send_raw(P, <<131,111,0,0,0,3,0,42,0,0>>),
- ?line send_raw(P, <<131,111,0,0,0,6,0,42,0,0,0,0,0>>),
+ send_raw(P, <<131,97,42>>),
+ send_raw(P, <<131,98,42:32>>),
+ send_raw(P, <<131,110,1,0,42>>),
+ send_raw(P, <<131,110,2,0,42,0>>),
+ send_raw(P, <<131,110,4,0,42,0,0,0>>),
+ send_raw(P, <<131,111,0,0,0,1,0,42>>),
+ send_raw(P, <<131,111,0,0,0,2,0,42,0>>),
+ send_raw(P, <<131,111,0,0,0,3,0,42,0,0>>),
+ send_raw(P, <<131,111,0,0,0,6,0,42,0,0,0,0,0>>),
ok.
send_non_optimal_neg(P) ->
-% ?line send_raw(P, <<131,97,-42>>),
- ?line send_raw(P, <<131,98,-42:32>>),
- ?line send_raw(P, <<131,110,1,1,42>>),
- ?line send_raw(P, <<131,110,2,1,42,0>>),
- ?line send_raw(P, <<131,110,4,1,42,0,0,0>>),
- ?line send_raw(P, <<131,111,0,0,0,1,1,42>>),
- ?line send_raw(P, <<131,111,0,0,0,2,1,42,0>>),
- ?line send_raw(P, <<131,111,0,0,0,3,1,42,0,0>>),
- ?line send_raw(P, <<131,111,0,0,0,6,1,42,0,0,0,0,0>>),
+ % send_raw(P, <<131,97,-42>>),
+ send_raw(P, <<131,98,-42:32>>),
+ send_raw(P, <<131,110,1,1,42>>),
+ send_raw(P, <<131,110,2,1,42,0>>),
+ send_raw(P, <<131,110,4,1,42,0,0,0>>),
+ send_raw(P, <<131,111,0,0,0,1,1,42>>),
+ send_raw(P, <<131,111,0,0,0,2,1,42,0>>),
+ send_raw(P, <<131,111,0,0,0,3,1,42,0,0>>),
+ send_raw(P, <<131,111,0,0,0,6,1,42,0,0,0,0,0>>),
ok.
%% ######################################################################## %%
-test_ei_decode_misc(suite) -> [];
test_ei_decode_misc(Config) when is_list(Config) ->
- ?line P = runner:start(?test_ei_decode_misc),
+ P = runner:start(?test_ei_decode_misc),
- ?line send_term_as_binary(P,0.0),
- ?line send_term_as_binary(P,-1.0),
- ?line send_term_as_binary(P,1.0),
+ send_term_as_binary(P,0.0),
+ send_term_as_binary(P,-1.0),
+ send_term_as_binary(P,1.0),
- ?line send_term_as_binary(P,false),
- ?line send_term_as_binary(P,true),
+ send_term_as_binary(P,false),
+ send_term_as_binary(P,true),
- ?line send_term_as_binary(P,foo),
- ?line send_term_as_binary(P,''),
- ?line send_term_as_binary(P,'ÅÄÖåäö'),
+ send_term_as_binary(P,foo),
+ send_term_as_binary(P,''),
+ send_term_as_binary(P,'ÅÄÖåäö'),
- ?line send_term_as_binary(P,"foo"),
- ?line send_term_as_binary(P,""),
- ?line send_term_as_binary(P,"ÅÄÖåäö"),
+ send_term_as_binary(P,"foo"),
+ send_term_as_binary(P,""),
+ send_term_as_binary(P,"ÅÄÖåäö"),
- ?line send_term_as_binary(P,<<"foo">>),
- ?line send_term_as_binary(P,<<>>),
- ?line send_term_as_binary(P,<<"ÅÄÖåäö">>),
+ send_term_as_binary(P,<<"foo">>),
+ send_term_as_binary(P,<<>>),
+ send_term_as_binary(P,<<"ÅÄÖåäö">>),
-% ?line send_term_as_binary(P,{}),
-% ?line send_term_as_binary(P,[]),
+ % send_term_as_binary(P,{}),
+ % send_term_as_binary(P,[]),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% ######################################################################## %%
test_ei_decode_utf8_atom(Config) ->
- ?line P = runner:start(?test_ei_decode_utf8_atom),
+ P = runner:start(?test_ei_decode_utf8_atom),
send_utf8_atom_as_binary(P,"Ã¥"),
send_utf8_atom_as_binary(P,"ä"),
send_term_as_binary(P,'ö'),
send_term_as_binary(P,'õ'),
-
- ?line send_utf8_atom_as_binary(P,[1758]),
- ?line send_utf8_atom_as_binary(P,[1758,1758]),
- ?line send_utf8_atom_as_binary(P,[1758,1758,1758]),
- ?line send_utf8_atom_as_binary(P,[1758,1758,1758,1758]),
+
+ send_utf8_atom_as_binary(P,[1758]),
+ send_utf8_atom_as_binary(P,[1758,1758]),
+ send_utf8_atom_as_binary(P,[1758,1758,1758]),
+ send_utf8_atom_as_binary(P,[1758,1758,1758,1758]),
send_utf8_atom_as_binary(P,"a"),
send_utf8_atom_as_binary(P,"b"),
send_term_as_binary(P,'c'),
send_term_as_binary(P,'d'),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
@@ -264,77 +231,77 @@ send_utf8_atom_as_binary(Port, String) ->
Port ! {self(), {command, term_to_binary(uc_atup(String))}}.
send_integers(P) ->
- ?line send_term_as_binary(P,0), % SMALL_INTEGER_EXT smallest
- ?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#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 (*)
-
+ send_term_as_binary(P,0), % SMALL_INTEGER_EXT smallest
+ send_term_as_binary(P,255), % SMALL_INTEGER_EXT largest
+ send_term_as_binary(P,256), % INTEGER_EXT smallest pos (*)
+ send_term_as_binary(P,-1), % INTEGER_EXT largest neg
+
+ send_term_as_binary(P, 16#07ffffff), % INTEGER_EXT old largest (28 bits)
+ send_term_as_binary(P,-16#08000000), % INTEGER_EXT old smallest
+ send_term_as_binary(P, 16#08000000), % SMALL_BIG_EXT old smallest pos(*)
+ send_term_as_binary(P,-16#08000001), % SMALL_BIG_EXT old largest neg (*)
+
+ send_term_as_binary(P, 16#7fffffff), % INTEGER_EXT new largest (32 bits)
+ send_term_as_binary(P,-16#80000000), % INTEGER_EXT new smallest (32 bis)
+ send_term_as_binary(P, 16#80000000), % SMALL_BIG_EXT new smallest pos(*)
+ send_term_as_binary(P,-16#80000001), % SMALL_BIG_EXT new largest neg (*)
+
case erlang:system_info({wordsize,external}) of
- 4 ->
- ?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
- ?line send_term_as_binary(P,-16#800000000000), % smallest i48
- ?line send_term_as_binary(P, 16#ffffffffffff), % largest u48
- ?line send_term_as_binary(P, 16#7fffffffffffffff), % largest i64
- ?line send_term_as_binary(P,-16#8000000000000000), % smallest i64
- ?line send_term_as_binary(P, 16#ffffffffffffffff); % largest u64
- 8 ->
- ?line send_term_as_binary(P, 16#8000000000000000),% SMALL_BIG_EXT u64
- % SMALL_BIG_EXT largest u64
- ?line send_term_as_binary(P, 16#ffffffffffffffff),
- % largest i96
- ?line send_term_as_binary(P, 16#7fffffffffffffffffffffff),
- % smallest i96
- ?line send_term_as_binary(P,-16#800000000000000000000000),
- % largest u96
- ?line send_term_as_binary(P, 16#ffffffffffffffffffffffff),
- % largest i128
- ?line send_term_as_binary(P, 16#7fffffffffffffffffffffffffffffff),
- % smallest i128
- ?line send_term_as_binary(P,-16#80000000000000000000000000000000),
- % largest u128
- ?line send_term_as_binary(P, 16#ffffffffffffffffffffffffffffffff)
+ 4 ->
+ send_term_as_binary(P, 16#80000000),% SMALL_BIG_EXT u32
+ send_term_as_binary(P, 16#ffffffff),% SMALL_BIG_EXT largest u32
+
+ send_term_as_binary(P, 16#7fffffffffff), % largest i48
+ send_term_as_binary(P,-16#800000000000), % smallest i48
+ send_term_as_binary(P, 16#ffffffffffff), % largest u48
+ send_term_as_binary(P, 16#7fffffffffffffff), % largest i64
+ send_term_as_binary(P,-16#8000000000000000), % smallest i64
+ send_term_as_binary(P, 16#ffffffffffffffff); % largest u64
+ 8 ->
+ send_term_as_binary(P, 16#8000000000000000),% SMALL_BIG_EXT u64
+ % SMALL_BIG_EXT largest u64
+ send_term_as_binary(P, 16#ffffffffffffffff),
+ % largest i96
+ send_term_as_binary(P, 16#7fffffffffffffffffffffff),
+ % smallest i96
+ send_term_as_binary(P,-16#800000000000000000000000),
+ % largest u96
+ send_term_as_binary(P, 16#ffffffffffffffffffffffff),
+ % largest i128
+ send_term_as_binary(P, 16#7fffffffffffffffffffffffffffffff),
+ % smallest i128
+ send_term_as_binary(P,-16#80000000000000000000000000000000),
+ % largest u128
+ send_term_as_binary(P, 16#ffffffffffffffffffffffffffffffff)
end,
- ?line send_term_as_binary(P, []), % illegal type
+ send_term_as_binary(P, []), % illegal type
ok.
send_integers2(P) ->
- ?line send_term_as_binary(P,0), % SMALL_INTEGER_EXT smallest
- ?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#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#ffffffff),% SMALL_BIG_EXT largest u32
-
- ?line send_term_as_binary(P, 16#7fffffffffff), % largest i48
- ?line send_term_as_binary(P,-16#800000000000), % smallest i48
- ?line send_term_as_binary(P, 16#ffffffffffff), % largest u48
- ?line send_term_as_binary(P, 16#7fffffffffffffff), % largest i64
- ?line send_term_as_binary(P,-16#8000000000000000), % smallest i64
- ?line send_term_as_binary(P, 16#ffffffffffffffff), % largest u64
- ?line send_term_as_binary(P, []), % illegal type
+ send_term_as_binary(P,0), % SMALL_INTEGER_EXT smallest
+ send_term_as_binary(P,255), % SMALL_INTEGER_EXT largest
+ send_term_as_binary(P,256), % INTEGER_EXT smallest pos (*)
+ send_term_as_binary(P,-1), % INTEGER_EXT largest neg
+
+ send_term_as_binary(P, 16#07ffffff), % INTEGER_EXT old largest (28 bits)
+ send_term_as_binary(P,-16#08000000), % INTEGER_EXT old smallest
+ send_term_as_binary(P, 16#08000000), % SMALL_BIG_EXT old smallest pos(*)
+ send_term_as_binary(P,-16#08000001), % SMALL_BIG_EXT old largest neg (*)
+
+ send_term_as_binary(P, 16#7fffffff), % INTEGER_EXT new largest (32 bits)
+ send_term_as_binary(P,-16#80000000), % INTEGER_EXT new smallest
+ send_term_as_binary(P, 16#80000000), % SMALL_BIG_EXT new smallest pos(*)
+ send_term_as_binary(P,-16#80000001), % SMALL_BIG_EXT new largest neg (*)
+
+ send_term_as_binary(P, 16#ffffffff), % SMALL_BIG_EXT largest u32
+
+ send_term_as_binary(P, 16#7fffffffffff), % largest i48
+ send_term_as_binary(P,-16#800000000000), % smallest i48
+ send_term_as_binary(P, 16#ffffffffffff), % largest u48
+ send_term_as_binary(P, 16#7fffffffffffffff), % largest i64
+ send_term_as_binary(P,-16#8000000000000000), % smallest i64
+ send_term_as_binary(P, 16#ffffffffffffffff), % largest u64
+ send_term_as_binary(P, []), % illegal type
ok.
uc_atup(ATxt) ->
@@ -344,35 +311,32 @@ string_to_atom(String) ->
Utf8List = string_to_utf8_list(String),
Len = length(Utf8List),
TagLen = case Len < 256 of
- true -> [119, Len];
- false -> [118, Len bsr 8, Len band 16#ff]
- end,
+ true -> [119, Len];
+ false -> [118, Len bsr 8, Len band 16#ff]
+ end,
binary_to_term(list_to_binary([131, TagLen, Utf8List])).
string_to_utf8_list([]) ->
[];
string_to_utf8_list([CP|CPs]) when is_integer(CP),
- 0 =< CP,
- CP =< 16#7F ->
+ 0 =< CP,
+ CP =< 16#7F ->
[CP | string_to_utf8_list(CPs)];
string_to_utf8_list([CP|CPs]) when is_integer(CP),
- 16#80 =< CP,
- CP =< 16#7FF ->
+ 16#80 =< CP,
+ CP =< 16#7FF ->
[16#C0 bor (CP bsr 6),
- 16#80 bor (16#3F band CP)
- | string_to_utf8_list(CPs)];
+ 16#80 bor (16#3F band CP) | string_to_utf8_list(CPs)];
string_to_utf8_list([CP|CPs]) when is_integer(CP),
- 16#800 =< CP,
- CP =< 16#FFFF ->
+ 16#800 =< CP,
+ CP =< 16#FFFF ->
[16#E0 bor (CP bsr 12),
16#80 bor (16#3F band (CP bsr 6)),
- 16#80 bor (16#3F band CP)
- | string_to_utf8_list(CPs)];
+ 16#80 bor (16#3F band CP) | string_to_utf8_list(CPs)];
string_to_utf8_list([CP|CPs]) when is_integer(CP),
- 16#10000 =< CP,
- CP =< 16#10FFFF ->
+ 16#10000 =< CP,
+ CP =< 16#10FFFF ->
[16#F0 bor (CP bsr 18),
16#80 bor (16#3F band (CP bsr 12)),
16#80 bor (16#3F band (CP bsr 6)),
- 16#80 bor (16#3F band CP)
- | string_to_utf8_list(CPs)].
+ 16#80 bor (16#3F band CP) | string_to_utf8_list(CPs)].
diff --git a/lib/erl_interface/test/ei_decode_SUITE_data/Makefile.first b/lib/erl_interface/test/ei_decode_SUITE_data/Makefile.first
index 74a49dbdab..6e4f0bc37e 100644
--- a/lib/erl_interface/test/ei_decode_SUITE_data/Makefile.first
+++ b/lib/erl_interface/test/ei_decode_SUITE_data/Makefile.first
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_decode_SUITE_data/Makefile.src b/lib/erl_interface/test/ei_decode_SUITE_data/Makefile.src
index 54c40e52a4..e678914a40 100644
--- a/lib/erl_interface/test/ei_decode_SUITE_data/Makefile.src
+++ b/lib/erl_interface/test/ei_decode_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
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 a0bafe543d..30f5fe33a0 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
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_decode_encode_SUITE.erl b/lib/erl_interface/test/ei_decode_encode_SUITE.erl
index 6a25b98209..570a91e2da 100644
--- a/lib/erl_interface/test/ei_decode_encode_SUITE.erl
+++ b/lib/erl_interface/test/ei_decode_encode_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,34 +24,15 @@
-include_lib("common_test/include/ct.hrl").
-include("ei_decode_encode_SUITE_data/ei_decode_encode_test_cases.hrl").
--export(
- [
- all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- test_ei_decode_encode/1
- ]).
+-export([all/0, suite/0,
+ test_ei_decode_encode/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]}].
all() ->
[test_ei_decode_encode].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
%% ---------------------------------------------------------------------------
% NOTE: these types have no meaning on the C side so we pass them
@@ -60,20 +41,19 @@ end_per_group(_GroupName, Config) ->
%% ######################################################################## %%
-test_ei_decode_encode(suite) -> [];
test_ei_decode_encode(Config) when is_list(Config) ->
- ?line P = runner:start(?test_ei_decode_encode),
+ P = runner:start(?test_ei_decode_encode),
Fun = fun (X) -> {X,true} end,
Pid = self(),
Port = case os:type() of
- {win32,_} ->
- open_port({spawn,"sort"},[]);
- {unix, darwin} ->
- open_port({spawn,"/usr/bin/true"},[]);
- _ ->
- open_port({spawn,"/bin/true"},[])
- end,
+ {win32,_} ->
+ open_port({spawn,"sort"},[]);
+ {unix, darwin} ->
+ open_port({spawn,"/usr/bin/true"},[]);
+ _ ->
+ open_port({spawn,"/bin/true"},[])
+ end,
Ref = make_ref(),
Trace = {1,2,3,self(),4}, % FIXME how to construct?!
@@ -86,47 +66,46 @@ test_ei_decode_encode(Config) when is_list(Config) ->
BigLargeB = 1 bsl 11112 + BigSmallB,
BigLargeC = BigSmallA * BigSmallB * BigSmallC * BigSmallA,
- ?line send_rec(P, Fun),
- ?line send_rec(P, Pid),
- ?line send_rec(P, Port),
- ?line send_rec(P, Ref),
- ?line send_rec(P, Trace),
+ send_rec(P, Fun),
+ send_rec(P, Pid),
+ send_rec(P, Port),
+ send_rec(P, Ref),
+ send_rec(P, Trace),
% bigs
- ?line send_rec(P, BigSmallA),
- ?line send_rec(P, BigSmallB),
- ?line send_rec(P, BigSmallC),
-
- ?line send_rec(P, BigLargeA),
- ?line send_rec(P, BigLargeB),
- ?line send_rec(P, BigLargeC),
+ send_rec(P, BigSmallA),
+ send_rec(P, BigSmallB),
+ send_rec(P, BigSmallC),
+
+ send_rec(P, BigLargeA),
+ send_rec(P, BigLargeB),
+ send_rec(P, BigLargeC),
%% Test large node containers...
- ?line ThisNode = {node(), erlang:system_info(creation)},
- ?line TXPid = mk_pid(ThisNode, 32767, 8191),
- ?line TXPort = mk_port(ThisNode, 268435455),
- ?line TXRef = mk_ref(ThisNode, [262143, 4294967295, 4294967295]),
+ ThisNode = {node(), erlang:system_info(creation)},
+ TXPid = mk_pid(ThisNode, 32767, 8191),
+ TXPort = mk_port(ThisNode, 268435455),
+ TXRef = mk_ref(ThisNode, [262143, 4294967295, 4294967295]),
- ?line OtherNode = {gurka@sallad, 2},
- ?line OXPid = mk_pid(OtherNode, 32767, 8191),
- ?line OXPort = mk_port(OtherNode, 268435455),
- ?line OXRef = mk_ref(OtherNode, [262143, 4294967295, 4294967295]),
+ send_rec(P, TXPid),
+ send_rec(P, TXPort),
+ send_rec(P, TXRef),
- ?line send_rec(P, TXPid),
- ?line send_rec(P, TXPort),
- ?line send_rec(P, TXRef),
- ?line send_rec(P, OXPid),
- ?line send_rec(P, OXPort),
- ?line send_rec(P, OXRef),
+ [begin OtherNode = {gurka@sallad, Creation},
+ send_rec(P, mk_pid(OtherNode, 32767, 8191)),
+ send_rec(P, mk_port(OtherNode, 268435455)),
+ send_rec(P, mk_ref(OtherNode, [262143, 4294967295, 4294967295])),
+ void
+ end || Creation <- [1, 2, 3, 4, 16#adec0ded]],
%% Unicode atoms
[begin send_rec(P, Atom),
- send_rec(P, mk_pid({Atom,1}, 23434, 3434)),
- send_rec(P, mk_port({Atom,1}, 2343434)),
- send_rec(P, mk_ref({Atom,1}, [262143, 8723648, 24097245])),
- void
+ send_rec(P, mk_pid({Atom,1}, 23434, 3434)),
+ send_rec(P, mk_port({Atom,1}, 2343434)),
+ send_rec(P, mk_ref({Atom,1}, [262143, 8723648, 24097245])),
+ void
end || Atom <- unicode_atom_data()],
send_rec(P, {}),
@@ -137,7 +116,7 @@ test_ei_decode_encode(Config) when is_list(Config) ->
send_rec(P, #{key => value}),
send_rec(P, maps:put(Port, Ref, #{key => value, key2 => Pid})),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
@@ -146,29 +125,27 @@ test_ei_decode_encode(Config) when is_list(Config) ->
% We read two packets for each test, the ei_decode_encode and ei_x_decode_encode version....
send_rec(P, Term) when is_port(P) ->
- %%?t:format("Testing: ~p~n", [Term]),
P ! {self(), {command, term_to_binary(Term)}},
{_B,Term} = get_buf_and_term(P).
-
get_buf_and_term(P) ->
B = get_binaries(P),
case B of
- <<131>> ->
- io:format("(got single magic, no content)\n",[]),
- {B,'$$magic$$'};
- <<131,_>> ->
- T = binary_to_term(B),
- io:format("~w\n~w\n(got magic)\n",[B,T]),
- {B,T};
- _ ->
- B1 = list_to_binary([131,B]), % No magic, add
- T = binary_to_term(B1),
- %io:format("~w\n~w\n(got no magic)\n",[B,T]),
- {B,T}
+ <<131>> ->
+ io:format("(got single magic, no content)\n",[]),
+ {B,'$$magic$$'};
+ <<131,_>> ->
+ T = binary_to_term(B),
+ io:format("~w\n~w\n(got magic)\n",[B,T]),
+ {B,T};
+ _ ->
+ B1 = list_to_binary([131,B]), % No magic, add
+ T = binary_to_term(B1),
+ %io:format("~w\n~w\n(got no magic)\n",[B,T]),
+ {B,T}
end.
-
+
get_binaries(P) ->
B1 = get_binary(P),
@@ -177,40 +154,17 @@ get_binaries(P) ->
get_binary(P) ->
case runner:get_term(P) of
- {bytes,L} ->
- B = list_to_binary(L),
- %%io:format("~w\n",[L]),
-% For strange reasons <<131>> show up as <>....
-% io:format("~w\n",[B]),
- B;
- Other ->
- Other
+ {bytes,L} ->
+ B = list_to_binary(L),
+ %%io:format("~w\n",[L]),
+ % For strange reasons <<131>> show up as <>....
+ % io:format("~w\n",[B]),
+ B;
+ Other ->
+ Other
end.
%%
-
-% We use our own get_term()
-
-get_term(P) ->
- case runner:get_term(P) of
- {bytes,[131]} ->
- io:format("(got single magic, no content)\n",[]),
- '$$magic$$';
- {bytes,[131,L]} ->
- B = list_to_binary(L),
- T = binary_to_term(B),
- io:format("~w\n~w\n(got magic)\n",[L,T]),
- T;
- {bytes,L} ->
- B = list_to_binary([131,L]),
- T = binary_to_term(B),
- io:format("~w\n~w\n(got no magic)\n",[L,T]),
- T;
- Other ->
- Other
- end.
-
-%%
%% Node container constructor functions
%%
@@ -221,6 +175,9 @@ get_term(P) ->
-define(PORT_EXT, 102).
-define(PID_EXT, 103).
-define(NEW_REFERENCE_EXT, 114).
+-define(NEW_PID_EXT, $X).
+-define(NEW_PORT_EXT, $Y).
+-define(NEWER_REFERENCE_EXT, $Z).
uint32_be(Uint) when is_integer(Uint), 0 =< Uint, Uint < 1 bsl 32 ->
[(Uint bsr 24) band 16#ff,
@@ -242,18 +199,22 @@ uint8(Uint) when is_integer(Uint), 0 =< Uint, Uint < 1 bsl 8 ->
uint8(Uint) ->
exit({badarg, uint8, [Uint]}).
+pid_tag(Creation) when Creation =< 3 -> ?PID_EXT;
+pid_tag(_Creation) -> ?NEW_PID_EXT.
+enc_creation(Creation) when Creation =< 3 -> uint8(Creation);
+enc_creation(Creation) -> uint32_be(Creation).
mk_pid({NodeName, Creation}, Number, Serial) when is_atom(NodeName) ->
<<?VERSION_MAGIC, NodeNameExt/binary>> = term_to_binary(NodeName),
mk_pid({NodeNameExt, Creation}, Number, Serial);
mk_pid({NodeNameExt, Creation}, Number, Serial) ->
case catch binary_to_term(list_to_binary([?VERSION_MAGIC,
- ?PID_EXT,
- NodeNameExt,
- uint32_be(Number),
- uint32_be(Serial),
- uint8(Creation)])) of
+ pid_tag(Creation),
+ NodeNameExt,
+ uint32_be(Number),
+ uint32_be(Serial),
+ enc_creation(Creation)])) of
Pid when is_pid(Pid) ->
Pid;
{'EXIT', {badarg, _}} ->
@@ -262,15 +223,18 @@ mk_pid({NodeNameExt, Creation}, Number, Serial) ->
exit({unexpected_binary_to_term_result, Other})
end.
+port_tag(Creation) when Creation =< 3 -> ?PORT_EXT;
+port_tag(_Creation) -> ?NEW_PORT_EXT.
+
mk_port({NodeName, Creation}, Number) when is_atom(NodeName) ->
<<?VERSION_MAGIC, NodeNameExt/binary>> = term_to_binary(NodeName),
mk_port({NodeNameExt, Creation}, Number);
mk_port({NodeNameExt, Creation}, Number) ->
case catch binary_to_term(list_to_binary([?VERSION_MAGIC,
- ?PORT_EXT,
+ port_tag(Creation),
NodeNameExt,
uint32_be(Number),
- uint8(Creation)])) of
+ enc_creation(Creation)])) of
Port when is_port(Port) ->
Port;
{'EXIT', {badarg, _}} ->
@@ -279,34 +243,38 @@ mk_port({NodeNameExt, Creation}, Number) ->
exit({unexpected_binary_to_term_result, Other})
end.
+ref_tag(Creation) when Creation =< 3 -> ?NEW_REFERENCE_EXT;
+ref_tag(_Creation) -> ?NEWER_REFERENCE_EXT.
+
mk_ref({NodeName, Creation}, Numbers) when is_atom(NodeName),
- is_integer(Creation),
- is_list(Numbers) ->
+ is_integer(Creation),
+ is_list(Numbers) ->
<<?VERSION_MAGIC, NodeNameExt/binary>> = term_to_binary(NodeName),
mk_ref({NodeNameExt, Creation}, Numbers);
mk_ref({NodeNameExt, Creation}, [Number]) when is_binary(NodeNameExt),
is_integer(Creation),
+ Creation =< 3,
is_integer(Number) ->
case catch binary_to_term(list_to_binary([?VERSION_MAGIC,
- ?REFERENCE_EXT,
- NodeNameExt,
- uint32_be(Number),
- uint8(Creation)])) of
- Ref when is_reference(Ref) ->
- Ref;
- {'EXIT', {badarg, _}} ->
- exit({badarg, mk_ref, [{NodeNameExt, Creation}, [Number]]});
- Other ->
- exit({unexpected_binary_to_term_result, Other})
+ ?REFERENCE_EXT,
+ NodeNameExt,
+ uint32_be(Number),
+ uint8(Creation)])) of
+ Ref when is_reference(Ref) ->
+ Ref;
+ {'EXIT', {badarg, _}} ->
+ exit({badarg, mk_ref, [{NodeNameExt, Creation}, [Number]]});
+ Other ->
+ exit({unexpected_binary_to_term_result, Other})
end;
mk_ref({NodeNameExt, Creation}, Numbers) when is_binary(NodeNameExt),
- is_integer(Creation),
- is_list(Numbers) ->
+ is_integer(Creation),
+ is_list(Numbers) ->
case catch binary_to_term(list_to_binary([?VERSION_MAGIC,
- ?NEW_REFERENCE_EXT,
+ ref_tag(Creation),
uint16_be(length(Numbers)),
NodeNameExt,
- uint8(Creation),
+ enc_creation(Creation),
lists:map(fun (N) ->
uint32_be(N)
end,
@@ -333,10 +301,10 @@ unicode_atom_data() ->
uc_atup(lists:seq(65500, 65754)),
uc_atup(lists:seq(65500, 65563))
| lists:map(fun (N) ->
- Pow2 = (1 bsl N),
- uc_atup(lists:seq(Pow2 - 127, Pow2 + 127))
- end,
- lists:seq(7, 20))
+ Pow2 = (1 bsl N),
+ uc_atup(lists:seq(Pow2 - 127, Pow2 + 127))
+ end,
+ lists:seq(7, 20))
].
uc_atup(ATxt) ->
@@ -346,33 +314,33 @@ string_to_atom(String) ->
Utf8List = string_to_utf8_list(String),
Len = length(Utf8List),
TagLen = case Len < 256 of
- true -> [119, Len];
- false -> [118, Len bsr 8, Len band 16#ff]
- end,
+ true -> [119, Len];
+ false -> [118, Len bsr 8, Len band 16#ff]
+ end,
binary_to_term(list_to_binary([131, TagLen, Utf8List])).
string_to_utf8_list([]) ->
[];
string_to_utf8_list([CP|CPs]) when is_integer(CP),
- 0 =< CP,
- CP =< 16#7F ->
+ 0 =< CP,
+ CP =< 16#7F ->
[CP | string_to_utf8_list(CPs)];
string_to_utf8_list([CP|CPs]) when is_integer(CP),
- 16#80 =< CP,
- CP =< 16#7FF ->
+ 16#80 =< CP,
+ CP =< 16#7FF ->
[16#C0 bor (CP bsr 6),
16#80 bor (16#3F band CP)
| string_to_utf8_list(CPs)];
string_to_utf8_list([CP|CPs]) when is_integer(CP),
- 16#800 =< CP,
- CP =< 16#FFFF ->
+ 16#800 =< CP,
+ CP =< 16#FFFF ->
[16#E0 bor (CP bsr 12),
16#80 bor (16#3F band (CP bsr 6)),
16#80 bor (16#3F band CP)
| string_to_utf8_list(CPs)];
string_to_utf8_list([CP|CPs]) when is_integer(CP),
- 16#10000 =< CP,
- CP =< 16#10FFFF ->
+ 16#10000 =< CP,
+ CP =< 16#10FFFF ->
[16#F0 bor (CP bsr 18),
16#80 bor (16#3F band (CP bsr 12)),
16#80 bor (16#3F band (CP bsr 6)),
diff --git a/lib/erl_interface/test/ei_decode_encode_SUITE_data/Makefile.first b/lib/erl_interface/test/ei_decode_encode_SUITE_data/Makefile.first
index 6edcc0c5ed..ee9e25adbc 100644
--- a/lib/erl_interface/test/ei_decode_encode_SUITE_data/Makefile.first
+++ b/lib/erl_interface/test/ei_decode_encode_SUITE_data/Makefile.first
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_decode_encode_SUITE_data/Makefile.src b/lib/erl_interface/test/ei_decode_encode_SUITE_data/Makefile.src
index 03db2ae9f2..853fe9ddeb 100644
--- a/lib/erl_interface/test/ei_decode_encode_SUITE_data/Makefile.src
+++ b/lib/erl_interface/test/ei_decode_encode_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c b/lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c
index 4b0201ca0b..467f789fdb 100644
--- a/lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c
+++ b/lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -240,7 +240,7 @@ void decode_encode(struct Type** tv, int nobj)
if (err != -1) {
fail("decode returned non zero but not -1");
} else {
- fail("decode returned non zero");
+ fail1("decode '%s' returned non zero", t->name);
}
return;
}
@@ -491,12 +491,11 @@ TESTCASE(test_ei_decode_encode)
decode_encode_big(&big_type);
/* Test large node containers... */
- decode_encode_one(&pid_type);
- decode_encode_one(&port_type);
- decode_encode_one(&ref_type);
- decode_encode_one(&pid_type);
- decode_encode_one(&port_type);
- decode_encode_one(&ref_type);
+ for (i=0; i<6; i++) {
+ decode_encode_one(&pid_type);
+ decode_encode_one(&port_type);
+ decode_encode_one(&ref_type);
+ }
/* Unicode atoms */
for (i=0; i<24; i++) {
diff --git a/lib/erl_interface/test/ei_encode_SUITE.erl b/lib/erl_interface/test/ei_encode_SUITE.erl
index d94f3adf42..ac6ec9cf4e 100644
--- a/lib/erl_interface/test/ei_encode_SUITE.erl
+++ b/lib/erl_interface/test/ei_encode_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,22 +24,19 @@
-include_lib("common_test/include/ct.hrl").
-include("ei_encode_SUITE_data/ei_encode_test_cases.hrl").
--export(
- [
- all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- test_ei_encode_long/1,
- test_ei_encode_ulong/1,
- test_ei_encode_longlong/1,
- test_ei_encode_ulonglong/1,
- test_ei_encode_char/1,
- test_ei_encode_misc/1,
- test_ei_encode_fails/1,
- test_ei_encode_utf8_atom/1,
- test_ei_encode_utf8_atom_len/1
- ]).
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+-export([all/0, suite/0,
+ test_ei_encode_long/1,
+ test_ei_encode_ulong/1,
+ test_ei_encode_longlong/1,
+ test_ei_encode_ulonglong/1,
+ test_ei_encode_char/1,
+ test_ei_encode_misc/1,
+ test_ei_encode_fails/1,
+ test_ei_encode_utf8_atom/1,
+ test_ei_encode_utf8_atom_len/1]).
+
+suite() ->
+ [{ct_hooks,[ts_install_cth]}].
all() ->
[test_ei_encode_long, test_ei_encode_ulong,
@@ -48,21 +45,6 @@ all() ->
test_ei_encode_fails, test_ei_encode_utf8_atom,
test_ei_encode_utf8_atom_len].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
%% ---------------------------------------------------------------------------
@@ -72,105 +54,101 @@ end_per_group(_GroupName, Config) ->
%% ######################################################################## %%
-test_ei_encode_long(suite) -> [];
test_ei_encode_long(Config) when is_list(Config) ->
- ?line P = runner:start(?test_ei_encode_long),
+ P = runner:start(?test_ei_encode_long),
- ?line {<<97,0>> ,0} = get_buf_and_term(P),
- ?line {<<97,255>> ,255} = get_buf_and_term(P),
- ?line {<<98,256:32/big-signed-integer>>,256} = get_buf_and_term(P),
- ?line {<<98,-1:32/big-signed-integer>> ,-1} = get_buf_and_term(P),
+ {<<97,0>> ,0} = get_buf_and_term(P),
+ {<<97,255>> ,255} = get_buf_and_term(P),
+ {<<98,256:32/big-signed-integer>>,256} = get_buf_and_term(P),
+ {<<98,-1:32/big-signed-integer>> ,-1} = get_buf_and_term(P),
- ?line {<<98, 16#07ffffff:32/big-signed-integer>>, 16#07ffffff} = get_buf_and_term(P),
- ?line {<<98,-16#08000000:32/big-signed-integer>>,-16#08000000} = get_buf_and_term(P),
- ?line {<<110,4,0, 0,0,0,8>> , 16#08000000} = get_buf_and_term(P),
- ?line {<<110,4,1, 1,0,0,8>> ,-16#08000001} = get_buf_and_term(P),
+ {<<98, 16#07ffffff:32/big-signed-integer>>, 16#07ffffff} = get_buf_and_term(P),
+ {<<98,-16#08000000:32/big-signed-integer>>,-16#08000000} = get_buf_and_term(P),
+ {<<110,4,0, 0,0,0,8>> , 16#08000000} = get_buf_and_term(P),
+ {<<110,4,1, 1,0,0,8>> ,-16#08000001} = get_buf_and_term(P),
- ?line {<<110,4,0, 255,255,255,127>> , 16#7fffffff} = get_buf_and_term(P),
- ?line {<<110,4,1, 0,0,0,128>> ,-16#80000000} = get_buf_and_term(P),
+ {<<110,4,0, 255,255,255,127>> , 16#7fffffff} = get_buf_and_term(P),
+ {<<110,4,1, 0,0,0,128>> ,-16#80000000} = get_buf_and_term(P),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% ######################################################################## %%
-test_ei_encode_ulong(suite) -> [];
test_ei_encode_ulong(Config) when is_list(Config) ->
- ?line P = runner:start(?test_ei_encode_ulong),
+ P = runner:start(?test_ei_encode_ulong),
- ?line {<<97,0>> ,0} = get_buf_and_term(P),
- ?line {<<97,255>> ,255} = get_buf_and_term(P),
- ?line {<<98,256:32/big-unsigned-integer>>,256} = get_buf_and_term(P),
+ {<<97,0>> ,0} = get_buf_and_term(P),
+ {<<97,255>> ,255} = get_buf_and_term(P),
+ {<<98,256:32/big-unsigned-integer>>,256} = get_buf_and_term(P),
- ?line {<<98, 16#07ffffff:32/big-signed-integer>>,16#07ffffff} = get_buf_and_term(P),
- ?line {<<110,4,0, 0,0,0,8>> ,16#08000000} = get_buf_and_term(P),
+ {<<98, 16#07ffffff:32/big-signed-integer>>,16#07ffffff} = get_buf_and_term(P),
+ {<<110,4,0, 0,0,0,8>> ,16#08000000} = get_buf_and_term(P),
- ?line {<<110,4,0, 255,255,255,127>> ,16#7fffffff} = get_buf_and_term(P),
- ?line {<<110,4,0, 0,0,0,128>> ,16#80000000} = get_buf_and_term(P),
- ?line {<<110,4,0, 255,255,255,255>> ,16#ffffffff} = get_buf_and_term(P),
+ {<<110,4,0, 255,255,255,127>> ,16#7fffffff} = get_buf_and_term(P),
+ {<<110,4,0, 0,0,0,128>> ,16#80000000} = get_buf_and_term(P),
+ {<<110,4,0, 255,255,255,255>> ,16#ffffffff} = get_buf_and_term(P),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% ######################################################################## %%
-test_ei_encode_longlong(suite) -> [];
test_ei_encode_longlong(Config) when is_list(Config) ->
case os:type() of
- vxworks ->
- {skip,"Skipped on VxWorks"};
- _ ->
- ?line P = runner:start(?test_ei_encode_longlong),
-
- ?line {<<97,0>> ,0} = get_buf_and_term(P),
- ?line {<<97,255>> ,255} = get_buf_and_term(P),
- ?line {<<98,256:32/big-signed-integer>>,256} = get_buf_and_term(P),
- ?line {<<98,-1:32/big-signed-integer>> ,-1} = get_buf_and_term(P),
-
- ?line {<<98, 16#07ffffff:32/big-signed-integer>>, 16#07ffffff} = get_buf_and_term(P),
- ?line {<<98,-16#08000000:32/big-signed-integer>>,-16#08000000} = get_buf_and_term(P),
- ?line {<<110,4,0, 0,0,0,8>> , 16#08000000} = get_buf_and_term(P),
- ?line {<<110,4,1, 1,0,0,8>> ,-16#08000001} = get_buf_and_term(P),
-
- ?line {<<110,4,0, 255,255,255,127>> , 16#7fffffff} = get_buf_and_term(P),
- ?line {<<110,4,1, 0,0,0,128>> ,-16#80000000} = get_buf_and_term(P),
- ?line {<<110,6,0, 255,255,255,255,255,127>> , 16#7fffffffffff} = get_buf_and_term(P),
- ?line {<<110,6,1, 0,0,0,0,0,128>> ,-16#800000000000} = get_buf_and_term(P),
- ?line {<<110,8,0, 255,255,255,255,255,255,255,127>>,16#7fffffffffffffff} = get_buf_and_term(P),
- ?line {<<110,8,1, 0,0,0,0,0,0,0,128>> ,-16#8000000000000000} = get_buf_and_term(P),
-
- ?line runner:recv_eot(P),
- ok
+ vxworks ->
+ {skip,"Skipped on VxWorks"};
+ _ ->
+ P = runner:start(?test_ei_encode_longlong),
+
+ {<<97,0>> ,0} = get_buf_and_term(P),
+ {<<97,255>> ,255} = get_buf_and_term(P),
+ {<<98,256:32/big-signed-integer>>,256} = get_buf_and_term(P),
+ {<<98,-1:32/big-signed-integer>> ,-1} = get_buf_and_term(P),
+
+ {<<98, 16#07ffffff:32/big-signed-integer>>, 16#07ffffff} = get_buf_and_term(P),
+ {<<98,-16#08000000:32/big-signed-integer>>,-16#08000000} = get_buf_and_term(P),
+ {<<110,4,0, 0,0,0,8>> , 16#08000000} = get_buf_and_term(P),
+ {<<110,4,1, 1,0,0,8>> ,-16#08000001} = get_buf_and_term(P),
+
+ {<<110,4,0, 255,255,255,127>> , 16#7fffffff} = get_buf_and_term(P),
+ {<<110,4,1, 0,0,0,128>> ,-16#80000000} = get_buf_and_term(P),
+ {<<110,6,0, 255,255,255,255,255,127>> , 16#7fffffffffff} = get_buf_and_term(P),
+ {<<110,6,1, 0,0,0,0,0,128>> ,-16#800000000000} = get_buf_and_term(P),
+ {<<110,8,0, 255,255,255,255,255,255,255,127>>,16#7fffffffffffffff} = get_buf_and_term(P),
+ {<<110,8,1, 0,0,0,0,0,0,0,128>> ,-16#8000000000000000} = get_buf_and_term(P),
+
+ runner:recv_eot(P),
+ ok
end.
%% ######################################################################## %%
-test_ei_encode_ulonglong(suite) -> [];
test_ei_encode_ulonglong(Config) when is_list(Config) ->
case os:type() of
- vxworks ->
- {skip,"Skipped on VxWorks"};
- _ ->
- ?line P = runner:start(?test_ei_encode_ulonglong),
-
- ?line {<<97,0>> ,0} = get_buf_and_term(P),
- ?line {<<97,255>> ,255} = get_buf_and_term(P),
- ?line {<<98,256:32/big-unsigned-integer>>,256} = get_buf_and_term(P),
-
- ?line {<<98, 16#07ffffff:32/big-signed-integer>>,16#07ffffff} = get_buf_and_term(P),
- ?line {<<110,4,0, 0,0,0,8>> ,16#08000000} = get_buf_and_term(P),
-
- ?line {<<110,4,0, 255,255,255,127>> ,16#7fffffff} = get_buf_and_term(P),
- ?line {<<110,4,0, 0,0,0,128>> ,16#80000000} = get_buf_and_term(P),
- ?line {<<110,4,0, 255,255,255,255>> ,16#ffffffff} = get_buf_and_term(P),
- ?line {<<110,6,0, 255,255,255,255,255,255>>,16#ffffffffffff} = get_buf_and_term(P),
- ?line {<<110,8,0, 255,255,255,255,255,255,255,255>>,16#ffffffffffffffff} = get_buf_and_term(P),
-
- ?line runner:recv_eot(P),
- ok
+ vxworks ->
+ {skip,"Skipped on VxWorks"};
+ _ ->
+ P = runner:start(?test_ei_encode_ulonglong),
+
+ {<<97,0>> ,0} = get_buf_and_term(P),
+ {<<97,255>> ,255} = get_buf_and_term(P),
+ {<<98,256:32/big-unsigned-integer>>,256} = get_buf_and_term(P),
+
+ {<<98, 16#07ffffff:32/big-signed-integer>>,16#07ffffff} = get_buf_and_term(P),
+ {<<110,4,0, 0,0,0,8>> ,16#08000000} = get_buf_and_term(P),
+
+ {<<110,4,0, 255,255,255,127>> ,16#7fffffff} = get_buf_and_term(P),
+ {<<110,4,0, 0,0,0,128>> ,16#80000000} = get_buf_and_term(P),
+ {<<110,4,0, 255,255,255,255>> ,16#ffffffff} = get_buf_and_term(P),
+ {<<110,6,0, 255,255,255,255,255,255>>,16#ffffffffffff} = get_buf_and_term(P),
+ {<<110,8,0, 255,255,255,255,255,255,255,255>>,16#ffffffffffffffff} = get_buf_and_term(P),
+
+ runner:recv_eot(P),
+ ok
end.
@@ -179,115 +157,112 @@ test_ei_encode_ulonglong(Config) when is_list(Config) ->
%% it is unsigned.
%% FIXME maybe the API should change to use "unsigned char" to be clear?!
-test_ei_encode_char(suite) -> [];
test_ei_encode_char(Config) when is_list(Config) ->
- ?line P = runner:start(?test_ei_encode_char),
+ P = runner:start(?test_ei_encode_char),
- ?line {<<97, 0>>,0} = get_buf_and_term(P),
- ?line {<<97,127>>,16#7f} = get_buf_and_term(P),
- ?line {<<97,255>>,16#ff} = get_buf_and_term(P),
+ {<<97, 0>>,0} = get_buf_and_term(P),
+ {<<97,127>>,16#7f} = get_buf_and_term(P),
+ {<<97,255>>,16#ff} = get_buf_and_term(P),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% ######################################################################## %%
-test_ei_encode_misc(suite) -> [];
test_ei_encode_misc(Config) when is_list(Config) ->
- ?line P = runner:start(?test_ei_encode_misc),
+ P = runner:start(?test_ei_encode_misc),
- ?line <<131>> = get_binaries(P),
+ <<131>> = get_binaries(P),
- ?line {<<70,_:8/binary>>,F0} = get_buf_and_term(P),
- ?line true = match_float(F0, 0.0),
+ {<<70,_:8/binary>>,F0} = get_buf_and_term(P),
+ true = match_float(F0, 0.0),
- ?line {<<70,_:8/binary>>,Fn1} = get_buf_and_term(P),
- ?line true = match_float(Fn1, -1.0),
+ {<<70,_:8/binary>>,Fn1} = get_buf_and_term(P),
+ true = match_float(Fn1, -1.0),
- ?line {<<70,_:8/binary>>,Fp1} = get_buf_and_term(P),
- ?line true = match_float(Fp1, 1.0),
+ {<<70,_:8/binary>>,Fp1} = get_buf_and_term(P),
+ true = match_float(Fp1, 1.0),
- ?line {<<100,0,5,"false">>,false} = get_buf_and_term(P),
- ?line {<<100,0,4,"true">> ,true} = get_buf_and_term(P),
- ?line {<<100,0,4,"true">> ,true} = get_buf_and_term(P),
- ?line {<<100,0,4,"true">> ,true} = get_buf_and_term(P),
+ {<<100,0,5,"false">>,false} = get_buf_and_term(P),
+ {<<100,0,4,"true">> ,true} = get_buf_and_term(P),
+ {<<100,0,4,"true">> ,true} = get_buf_and_term(P),
+ {<<100,0,4,"true">> ,true} = get_buf_and_term(P),
- ?line {<<100,0,3,"foo">>,foo} = get_buf_and_term(P),
- ?line {<<100,0,3,"foo">>,foo} = get_buf_and_term(P),
- ?line {<<100,0,0,"">>,''} = get_buf_and_term(P),
- ?line {<<100,0,0,"">>,''} = get_buf_and_term(P),
- ?line {<<100,0,6,"ÅÄÖåäö">>,'ÅÄÖåäö'} = get_buf_and_term(P),
- ?line {<<100,0,6,"ÅÄÖåäö">>,'ÅÄÖåäö'} = get_buf_and_term(P),
+ {<<100,0,3,"foo">>,foo} = get_buf_and_term(P),
+ {<<100,0,3,"foo">>,foo} = get_buf_and_term(P),
+ {<<100,0,0,"">>,''} = get_buf_and_term(P),
+ {<<100,0,0,"">>,''} = get_buf_and_term(P),
+ {<<100,0,6,"ÅÄÖåäö">>,'ÅÄÖåäö'} = get_buf_and_term(P),
+ {<<100,0,6,"ÅÄÖåäö">>,'ÅÄÖåäö'} = get_buf_and_term(P),
- ?line {<<107,0,3,"foo">>,"foo"} = get_buf_and_term(P),
- ?line {<<107,0,3,"foo">>,"foo"} = get_buf_and_term(P),
- ?line {<<106>>,""} = get_buf_and_term(P),
- ?line {<<106>>,""} = get_buf_and_term(P),
- ?line {<<107,0,6,"ÅÄÖåäö">>,"ÅÄÖåäö"} = get_buf_and_term(P),
- ?line {<<107,0,6,"ÅÄÖåäö">>,"ÅÄÖåäö"} = get_buf_and_term(P),
+ {<<107,0,3,"foo">>,"foo"} = get_buf_and_term(P),
+ {<<107,0,3,"foo">>,"foo"} = get_buf_and_term(P),
+ {<<106>>,""} = get_buf_and_term(P),
+ {<<106>>,""} = get_buf_and_term(P),
+ {<<107,0,6,"ÅÄÖåäö">>,"ÅÄÖåäö"} = get_buf_and_term(P),
+ {<<107,0,6,"ÅÄÖåäö">>,"ÅÄÖåäö"} = get_buf_and_term(P),
- ?line {<<109,0,0,0,3,"foo">>,<<"foo">>} = get_buf_and_term(P),
- ?line {<<109,0,0,0,0,"">>,<<>>} = get_buf_and_term(P),
- ?line {<<109,0,0,0,6,"ÅÄÖåäö">>,<<"ÅÄÖåäö">>} = get_buf_and_term(P),
+ {<<109,0,0,0,3,"foo">>,<<"foo">>} = get_buf_and_term(P),
+ {<<109,0,0,0,0,"">>,<<>>} = get_buf_and_term(P),
+ {<<109,0,0,0,6,"ÅÄÖåäö">>,<<"ÅÄÖåäö">>} = get_buf_and_term(P),
- ?line {<<104,0>>,{}} = get_buf_and_term(P), % Tuple header for {}
- ?line {<<106>>,[]} = get_buf_and_term(P), % Empty list []
+ {<<104,0>>,{}} = get_buf_and_term(P), % Tuple header for {}
+ {<<106>>,[]} = get_buf_and_term(P), % Empty list []
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% ######################################################################## %%
-test_ei_encode_fails(suite) -> [];
test_ei_encode_fails(Config) when is_list(Config) ->
- ?line P = runner:start(?test_ei_encode_fails),
+ P = runner:start(?test_ei_encode_fails),
- ?line XAtom = list_to_atom(lists:duplicate(255, $x)),
- ?line YAtom = list_to_atom(lists:duplicate(255, $y)),
+ XAtom = list_to_atom(lists:duplicate(255, $x)),
+ YAtom = list_to_atom(lists:duplicate(255, $y)),
- ?line XAtom = get_term(P),
- ?line XAtom = get_term(P),
- ?line YAtom = get_term(P),
- ?line YAtom = get_term(P),
+ XAtom = get_term(P),
+ XAtom = get_term(P),
+ YAtom = get_term(P),
+ YAtom = get_term(P),
- ?line {{{{}}}} = get_term(P),
+ {{{{}}}} = get_term(P),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% ######################################################################## %%
test_ei_encode_utf8_atom(Config) ->
- ?line P = runner:start(?test_ei_encode_utf8_atom),
-
- ?line {<<119,2,195,133>>,'Ã…'} = get_buf_and_term(P),
- ?line {<<100,0,1,197>>,'Ã…'} = get_buf_and_term(P),
- ?line {<<100,0,1,197>>,'Ã…'} = get_buf_and_term(P),
- ?line {<<119,2,195,133>>,'Ã…'} = get_buf_and_term(P),
+ P = runner:start(?test_ei_encode_utf8_atom),
- ?line {<<119,1,$A>>,'A'} = get_buf_and_term(P),
- ?line {<<100,0,1,$A>>,'A'} = get_buf_and_term(P),
+ {<<119,2,195,133>>,'Ã…'} = get_buf_and_term(P),
+ {<<100,0,1,197>>,'Ã…'} = get_buf_and_term(P),
+ {<<100,0,1,197>>,'Ã…'} = get_buf_and_term(P),
+ {<<119,2,195,133>>,'Ã…'} = get_buf_and_term(P),
- ?line runner:recv_eot(P),
+ {<<119,1,$A>>,'A'} = get_buf_and_term(P),
+ {<<100,0,1,$A>>,'A'} = get_buf_and_term(P),
+
+ runner:recv_eot(P),
ok.
%% ######################################################################## %%
test_ei_encode_utf8_atom_len(Config) ->
- ?line P = runner:start(?test_ei_encode_utf8_atom_len),
-
- ?line {<<119,2,195,133>>,'Ã…'} = get_buf_and_term(P),
- ?line {<<100,0,2,197,196>>,'ÅÄ'} = get_buf_and_term(P),
- ?line {<<100,0,1,197>>,'Ã…'} = get_buf_and_term(P),
- ?line {<<119,4,195,133,195,132>>,'ÅÄ'} = get_buf_and_term(P),
-
- ?line {<<119,1,$A>>,'A'} = get_buf_and_term(P),
- ?line {<<100,0,2,$A,$B>>,'AB'} = get_buf_and_term(P),
- ?line {<<100,0,255,_:(255*8)>>,_} = get_buf_and_term(P),
-
- ?line runner:recv_eot(P),
+ P = runner:start(?test_ei_encode_utf8_atom_len),
+
+ {<<119,2,195,133>>,'Ã…'} = get_buf_and_term(P),
+ {<<100,0,2,197,196>>,'ÅÄ'} = get_buf_and_term(P),
+ {<<100,0,1,197>>,'Ã…'} = get_buf_and_term(P),
+ {<<119,4,195,133,195,132>>,'ÅÄ'} = get_buf_and_term(P),
+
+ {<<119,1,$A>>,'A'} = get_buf_and_term(P),
+ {<<100,0,2,$A,$B>>,'AB'} = get_buf_and_term(P),
+ {<<100,0,255,_:(255*8)>>,_} = get_buf_and_term(P),
+
+ runner:recv_eot(P),
ok.
%% ######################################################################## %%
@@ -297,20 +272,20 @@ test_ei_encode_utf8_atom_len(Config) ->
get_buf_and_term(P) ->
B = get_binaries(P),
case B of
- <<131>> ->
- io:format("(got single magic, no content)\n",[]),
- {B,'$$magic$$'};
- <<131,_>> ->
- T = binary_to_term(B),
- io:format("~w\n~w\n(got magic)\n",[B,T]),
- {B,T};
- _ ->
- B1 = list_to_binary([131,B]), % No magic, add
- T = binary_to_term(B1),
- io:format("~w\n~w\n(got no magic)\n",[B,T]),
- {B,T}
+ <<131>> ->
+ io:format("(got single magic, no content)\n",[]),
+ {B,'$$magic$$'};
+ <<131,_>> ->
+ T = binary_to_term(B),
+ io:format("~w\n~w\n(got magic)\n",[B,T]),
+ {B,T};
+ _ ->
+ B1 = list_to_binary([131,B]), % No magic, add
+ T = binary_to_term(B1),
+ io:format("~w\n~w\n(got no magic)\n",[B,T]),
+ {B,T}
end.
-
+
get_binaries(P) ->
B1 = get_binary(P),
@@ -319,14 +294,14 @@ get_binaries(P) ->
get_binary(P) ->
case runner:get_term(P) of
- {bytes,L} ->
- B = list_to_binary(L),
- io:format("~w\n",[L]),
-% For strange reasons <<131>> show up as <>....
-% io:format("~w\n",[B]),
- B;
- Other ->
- Other
+ {bytes,L} ->
+ B = list_to_binary(L),
+ io:format("~w\n",[L]),
+ % For strange reasons <<131>> show up as <>....
+ % io:format("~w\n",[B]),
+ B;
+ Other ->
+ Other
end.
%%
@@ -335,27 +310,26 @@ get_binary(P) ->
get_term(P) ->
case runner:get_term(P) of
- {bytes,[131]} ->
- io:format("(got single magic, no content)\n",[]),
- '$$magic$$';
- {bytes,[131,L]} ->
- B = list_to_binary(L),
- T = binary_to_term(B),
- io:format("~w\n~w\n(got magic)\n",[L,T]),
- T;
- {bytes,L} ->
- B = list_to_binary([131,L]),
- T = binary_to_term(B),
- io:format("~w\n~w\n(got no magic)\n",[L,T]),
- T;
- Other ->
- Other
+ {bytes,[131]} ->
+ io:format("(got single magic, no content)\n",[]),
+ '$$magic$$';
+ {bytes,[131,L]} ->
+ B = list_to_binary(L),
+ T = binary_to_term(B),
+ io:format("~w\n~w\n(got magic)\n",[L,T]),
+ T;
+ {bytes,L} ->
+ B = list_to_binary([131,L]),
+ T = binary_to_term(B),
+ io:format("~w\n~w\n(got no magic)\n",[L,T]),
+ T;
+ Other ->
+ Other
end.
-
+
%%
match_float(F, Match) when is_float(F), is_float(Match), F == Match ->
true;
match_float(F, Match) when is_float(F), F > Match*0.99, F < Match*1.01 ->
true.
-
diff --git a/lib/erl_interface/test/ei_encode_SUITE_data/Makefile.first b/lib/erl_interface/test/ei_encode_SUITE_data/Makefile.first
index 26ba7f475e..0d2d3510a7 100644
--- a/lib/erl_interface/test/ei_encode_SUITE_data/Makefile.first
+++ b/lib/erl_interface/test/ei_encode_SUITE_data/Makefile.first
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_encode_SUITE_data/Makefile.src b/lib/erl_interface/test/ei_encode_SUITE_data/Makefile.src
index 753700d7e2..3b2cab7af4 100644
--- a/lib/erl_interface/test/ei_encode_SUITE_data/Makefile.src
+++ b/lib/erl_interface/test/ei_encode_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_encode_SUITE_data/ei_encode_test.c b/lib/erl_interface/test/ei_encode_SUITE_data/ei_encode_test.c
index ace368f8e6..32811fdf22 100644
--- a/lib/erl_interface/test/ei_encode_SUITE_data/ei_encode_test.c
+++ b/lib/erl_interface/test/ei_encode_SUITE_data/ei_encode_test.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_format_SUITE.erl b/lib/erl_interface/test/ei_format_SUITE.erl
index ed6a755f9b..07ee479b1f 100644
--- a/lib/erl_interface/test/ei_format_SUITE.erl
+++ b/lib/erl_interface/test/ei_format_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,155 +24,131 @@
-include_lib("common_test/include/ct.hrl").
-include("ei_format_SUITE_data/ei_format_test_cases.hrl").
--export([
- format_wo_ver/1,
- all/0, suite/0,groups/0,
- init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- atoms/1,
- tuples/1,
- lists/1
- ]).
+-export([format_wo_ver/1,
+ all/0, suite/0,
+ atoms/1,
+ tuples/1,
+ lists/1]).
-import(runner, [get_term/1]).
%% This test suite test the erl_format() function.
%% It uses the port program "ei_format_test".
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]}].
all() ->
[format_wo_ver, atoms, tuples, lists].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
%% Tests formatting various atoms.
-atoms(suite) -> [];
atoms(Config) when is_list(Config) ->
- ?line P = runner:start(?atoms),
-
- ?line {term, ''} = get_term(P),
- ?line {term, 'a'} = get_term(P),
- ?line {term, 'A'} = get_term(P),
- ?line {term, 'abc'} = get_term(P),
- ?line {term, 'Abc'} = get_term(P),
- ?line {term, 'ab@c'} = get_term(P),
- ?line {term, 'The rain in Spain stays mainly in the plains'} =
- get_term(P),
-
- ?line {term, a} = get_term(P),
- ?line {term, ab} = get_term(P),
- ?line {term, abc} = get_term(P),
- ?line {term, ab@c} = get_term(P),
- ?line {term, abcdefghijklmnopq} = get_term(P),
-
- ?line {term, ''} = get_term(P),
- ?line {term, 'a'} = get_term(P),
- ?line {term, 'A'} = get_term(P),
- ?line {term, 'abc'} = get_term(P),
- ?line {term, 'Abc'} = get_term(P),
- ?line {term, 'ab@c'} = get_term(P),
- ?line {term, 'The rain in Spain stays mainly in the plains'} =
- get_term(P),
-
- ?line {term, a} = get_term(P),
- ?line {term, ab} = get_term(P),
- ?line {term, abc} = get_term(P),
- ?line {term, ab@c} = get_term(P),
- ?line {term, ' abcdefghijklmnopq '} = get_term(P),
-
- ?line runner:recv_eot(P),
+ P = runner:start(?atoms),
+
+ {term, ''} = get_term(P),
+ {term, 'a'} = get_term(P),
+ {term, 'A'} = get_term(P),
+ {term, 'abc'} = get_term(P),
+ {term, 'Abc'} = get_term(P),
+ {term, 'ab@c'} = get_term(P),
+ {term, 'The rain in Spain stays mainly in the plains'} =
+ get_term(P),
+
+ {term, a} = get_term(P),
+ {term, ab} = get_term(P),
+ {term, abc} = get_term(P),
+ {term, ab@c} = get_term(P),
+ {term, abcdefghijklmnopq} = get_term(P),
+
+ {term, ''} = get_term(P),
+ {term, 'a'} = get_term(P),
+ {term, 'A'} = get_term(P),
+ {term, 'abc'} = get_term(P),
+ {term, 'Abc'} = get_term(P),
+ {term, 'ab@c'} = get_term(P),
+ {term, 'The rain in Spain stays mainly in the plains'} =
+ get_term(P),
+
+ {term, a} = get_term(P),
+ {term, ab} = get_term(P),
+ {term, abc} = get_term(P),
+ {term, ab@c} = get_term(P),
+ {term, ' abcdefghijklmnopq '} = get_term(P),
+
+ runner:recv_eot(P),
ok.
%% Tests formatting various tuples
-tuples(suite) -> [];
tuples(Config) when is_list(Config) ->
- ?line P = runner:start(?tuples),
-
- ?line {term, {}} = get_term(P),
- ?line {term, {a}} = get_term(P),
- ?line {term, {a, b}} = get_term(P),
- ?line {term, {a, b, c}} = get_term(P),
- ?line {term, {1}} = get_term(P),
- ?line {term, {[]}} = get_term(P),
- ?line {term, {[], []}} = get_term(P),
- ?line {term, {[], a, b, c}} = get_term(P),
- ?line {term, {[], a, [], b, c}} = get_term(P),
- ?line {term, {[], a, '', b, c}} = get_term(P),
-
- ?line runner:recv_eot(P),
+ P = runner:start(?tuples),
+
+ {term, {}} = get_term(P),
+ {term, {a}} = get_term(P),
+ {term, {a, b}} = get_term(P),
+ {term, {a, b, c}} = get_term(P),
+ {term, {1}} = get_term(P),
+ {term, {[]}} = get_term(P),
+ {term, {[], []}} = get_term(P),
+ {term, {[], a, b, c}} = get_term(P),
+ {term, {[], a, [], b, c}} = get_term(P),
+ {term, {[], a, '', b, c}} = get_term(P),
+
+ runner:recv_eot(P),
ok.
%% Tests formatting various lists
-lists(suite) -> [];
lists(Config) when is_list(Config) ->
- ?line P = runner:start(?lists),
-
- ?line {term, []} = get_term(P),
- ?line {term, [a]} = get_term(P),
- ?line {term, [a, b]} = get_term(P),
- ?line {term, [a, b, c]} = get_term(P),
- ?line {term, [1]} = get_term(P),
- ?line {term, [[]]} = get_term(P),
- ?line {term, [[], []]} = get_term(P),
- ?line {term, [[], a, b, c]} = get_term(P),
- ?line {term, [[], a, [], b, c]} = get_term(P),
- ?line {term, [[], a, '', b, c]} = get_term(P),
- ?line {term, [[x, 2], [y, 3], [z, 4]]}= get_term(P),
- ?line {term, [{a,b},{c,d}]}= get_term(P),
-%% ?line {term, [{name, 'Madonna'}, {age, 21}, {data, [{addr, "E-street", 42}]}]} =
-%% get_term(P),
-
- ?line {term, [{pi, F1}, {'cos(70)', F2}]} = get_term(P),
+ P = runner:start(?lists),
+
+ {term, []} = get_term(P),
+ {term, [a]} = get_term(P),
+ {term, [a, b]} = get_term(P),
+ {term, [a, b, c]} = get_term(P),
+ {term, [1]} = get_term(P),
+ {term, [[]]} = get_term(P),
+ {term, [[], []]} = get_term(P),
+ {term, [[], a, b, c]} = get_term(P),
+ {term, [[], a, [], b, c]} = get_term(P),
+ {term, [[], a, '', b, c]} = get_term(P),
+ {term, [[x, 2], [y, 3], [z, 4]]}= get_term(P),
+ {term, [{a,b},{c,d}]} = get_term(P),
+ %% {term, [{name, 'Madonna'}, {age, 21}, {data, [{addr, "E-street", 42}]}]} = get_term(P),
+
+ {term, [{pi, F1}, {'cos(70)', F2}]} = get_term(P),
%% don't match floats directly
true= abs(3.1415-F1) < 0.01,
true= abs(0.34202-F2) < 0.01,
- ?line {term, [[pi, F3], ['cos(70)', F4]]} = get_term(P),
+ {term, [[pi, F3], ['cos(70)', F4]]} = get_term(P),
true= abs(3.1415-F3) < 0.01,
true= abs(0.34202-F4) < 0.01,
-%% ?line {term, [[pi, 3.1415], [], ["cos(70)", 0.34202]]} = get_term(P),
- ?line {term, [-1]} = get_term(P),
- ?line {term, "hejsan"} = get_term(P),
+ %% {term, [[pi, 3.1415], [], ["cos(70)", 0.34202]]} = get_term(P),
+ {term, [-1]} = get_term(P),
+ {term, "hejsan"} = get_term(P),
- ?line Str1 = lists:duplicate(65535,$A),
- ?line Str2 = lists:duplicate(65536,$A),
- ?line {term,Str1} = get_term(P),
- ?line {term,Str2} = get_term(P),
+ Str1 = lists:duplicate(65535,$A),
+ Str2 = lists:duplicate(65536,$A),
+ {term,Str1} = get_term(P),
+ {term,Str2} = get_term(P),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
-format_wo_ver(suite) -> [];
format_wo_ver(Config) when is_list(Config) ->
- ?line P = runner:start(?format_wo_ver),
+ P = runner:start(?format_wo_ver),
- ?line {term, [-1, 2, $c, {a, "b"}, {c, 10}]} = get_term(P),
+ {term, [-1, 2, $c, {a, "b"}, {c, 10}]} = get_term(P),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
diff --git a/lib/erl_interface/test/ei_format_SUITE_data/Makefile.first b/lib/erl_interface/test/ei_format_SUITE_data/Makefile.first
index d655cd13e6..7bf2d761ac 100644
--- a/lib/erl_interface/test/ei_format_SUITE_data/Makefile.first
+++ b/lib/erl_interface/test/ei_format_SUITE_data/Makefile.first
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_format_SUITE_data/Makefile.src b/lib/erl_interface/test/ei_format_SUITE_data/Makefile.src
index bfcb8ae840..b89dcae45a 100644
--- a/lib/erl_interface/test/ei_format_SUITE_data/Makefile.src
+++ b/lib/erl_interface/test/ei_format_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_format_SUITE_data/ei_format_test.c b/lib/erl_interface/test/ei_format_SUITE_data/ei_format_test.c
index d3ca91db5a..8450332b28 100644
--- a/lib/erl_interface/test/ei_format_SUITE_data/ei_format_test.c
+++ b/lib/erl_interface/test/ei_format_SUITE_data/ei_format_test.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_print_SUITE.erl b/lib/erl_interface/test/ei_print_SUITE.erl
index 36ee90c7ee..6d5c341eae 100644
--- a/lib/erl_interface/test/ei_print_SUITE.erl
+++ b/lib/erl_interface/test/ei_print_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,141 +24,117 @@
-include_lib("common_test/include/ct.hrl").
-include("ei_print_SUITE_data/ei_print_test_cases.hrl").
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- atoms/1, tuples/1, lists/1, strings/1]).
+-export([all/0, suite/0,
+ atoms/1, tuples/1, lists/1, strings/1]).
-import(runner, [get_term/1]).
%% This test suite test the ei_print() function.
%% It uses the port program "ei_format_test".
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]}].
all() ->
[atoms, tuples, lists, strings].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
%% Tests formatting various atoms.
-atoms(suite) -> [];
atoms(Config) when is_list(Config) ->
- ?line P = runner:start(?atoms),
-
- ?line {term, "''"} = get_term(P),
- ?line {term, "a"} = get_term(P),
- ?line {term, "'A'"} = get_term(P),
- ?line {term, "abc"} = get_term(P),
- ?line {term, "'Abc'"} = get_term(P),
- ?line {term, "ab@c"} = get_term(P),
- ?line {term, "'The rain in Spain stays mainly in the plains'"} =
- get_term(P),
-
- ?line {term, "a"} = get_term(P),
- ?line {term, "ab"} = get_term(P),
- ?line {term, "abc"} = get_term(P),
- ?line {term, "ab@c"} = get_term(P),
- ?line {term, "abcdefghijklmnopq"} = get_term(P),
-
- ?line {term, "''"} = get_term(P),
- ?line {term, "a"} = get_term(P),
- ?line {term, "'A'"} = get_term(P),
- ?line {term, "abc"} = get_term(P),
- ?line {term, "'Abc'"} = get_term(P),
- ?line {term, "ab@c"} = get_term(P),
- ?line {term, "'The rain in Spain stays mainly in the plains'"} =
- get_term(P),
-
- ?line {term, "a"} = get_term(P),
- ?line {term, "ab"} = get_term(P),
- ?line {term, "abc"} = get_term(P),
- ?line {term, "ab@c"} = get_term(P),
- ?line {term, "' abcdefghijklmnopq '"} = get_term(P),
-
- ?line runner:recv_eot(P),
+ P = runner:start(?atoms),
+
+ {term, "''"} = get_term(P),
+ {term, "a"} = get_term(P),
+ {term, "'A'"} = get_term(P),
+ {term, "abc"} = get_term(P),
+ {term, "'Abc'"} = get_term(P),
+ {term, "ab@c"} = get_term(P),
+ {term, "'The rain in Spain stays mainly in the plains'"} = get_term(P),
+
+ {term, "a"} = get_term(P),
+ {term, "ab"} = get_term(P),
+ {term, "abc"} = get_term(P),
+ {term, "ab@c"} = get_term(P),
+ {term, "abcdefghijklmnopq"} = get_term(P),
+
+ {term, "''"} = get_term(P),
+ {term, "a"} = get_term(P),
+ {term, "'A'"} = get_term(P),
+ {term, "abc"} = get_term(P),
+ {term, "'Abc'"} = get_term(P),
+ {term, "ab@c"} = get_term(P),
+ {term, "'The rain in Spain stays mainly in the plains'"} = get_term(P),
+
+ {term, "a"} = get_term(P),
+ {term, "ab"} = get_term(P),
+ {term, "abc"} = get_term(P),
+ {term, "ab@c"} = get_term(P),
+ {term, "' abcdefghijklmnopq '"} = get_term(P),
+
+ runner:recv_eot(P),
ok.
%% Tests formatting various tuples
-tuples(suite) -> [];
tuples(Config) when is_list(Config) ->
- ?line P = runner:start(?tuples),
-
- ?line {term, "{}"} = get_term(P),
- ?line {term, "{a}"} = get_term(P),
- ?line {term, "{a, b}"} = get_term(P),
- ?line {term, "{a, b, c}"} = get_term(P),
- ?line {term, "{1}"} = get_term(P),
- ?line {term, "{[]}"} = get_term(P),
- ?line {term, "{[], []}"} = get_term(P),
- ?line {term, "{[], a, b, c}"} = get_term(P),
- ?line {term, "{[], a, [], b, c}"} = get_term(P),
- ?line {term, "{[], a, '', b, c}"} = get_term(P),
-
- ?line runner:recv_eot(P),
+ P = runner:start(?tuples),
+
+ {term, "{}"} = get_term(P),
+ {term, "{a}"} = get_term(P),
+ {term, "{a, b}"} = get_term(P),
+ {term, "{a, b, c}"} = get_term(P),
+ {term, "{1}"} = get_term(P),
+ {term, "{[]}"} = get_term(P),
+ {term, "{[], []}"} = get_term(P),
+ {term, "{[], a, b, c}"} = get_term(P),
+ {term, "{[], a, [], b, c}"} = get_term(P),
+ {term, "{[], a, '', b, c}"} = get_term(P),
+
+ runner:recv_eot(P),
ok.
%% Tests formatting various lists
-lists(suite) -> [];
lists(Config) when is_list(Config) ->
- ?line P = runner:start(?lists),
-
- ?line {term, "[]"} = get_term(P),
- ?line {term, "[a]"} = get_term(P),
- ?line {term, "[a, b]"} = get_term(P),
- ?line {term, "[a, b, c]"} = get_term(P),
- ?line {term, "[1]"} = get_term(P),
- ?line {term, "[[]]"} = get_term(P),
- ?line {term, "[[], []]"} = get_term(P),
- ?line {term, "[[], a, b, c]"} = get_term(P),
- ?line {term, "[[], a, [], b, c]"} = get_term(P),
- ?line {term, "[[], a, '', b, c]"} = get_term(P),
- ?line {term, "[[x, 2], [y, 3], [z, 4]]"}= get_term(P),
-
-%% ?line {term, "[{name, 'Madonna'}, {age, 21}, {data, [{addr, "E-street", 42}]}]"} =
-%% get_term(P),
+ P = runner:start(?lists),
+
+ {term, "[]"} = get_term(P),
+ {term, "[a]"} = get_term(P),
+ {term, "[a, b]"} = get_term(P),
+ {term, "[a, b, c]"} = get_term(P),
+ {term, "[1]"} = get_term(P),
+ {term, "[[]]"} = get_term(P),
+ {term, "[[], []]"} = get_term(P),
+ {term, "[[], a, b, c]"} = get_term(P),
+ {term, "[[], a, [], b, c]"} = get_term(P),
+ {term, "[[], a, '', b, c]"} = get_term(P),
+ {term, "[[x, 2], [y, 3], [z, 4]]"}= get_term(P),
+
+ %% {term, "[{name, 'Madonna'}, {age, 21}, {data, [{addr, "E-street", 42}]}]"} = get_term(P),
%% maybe regexp instead?
- ?line {term, "[{pi, 3.141500}, {'cos(70)', 0.342020}]"} = get_term(P),
- ?line {term, "[[pi, 3.141500], ['cos(70)', 0.342020]]"} = get_term(P),
+ {term, "[{pi, 3.141500}, {'cos(70)', 0.342020}]"} = get_term(P),
+ {term, "[[pi, 3.141500], ['cos(70)', 0.342020]]"} = get_term(P),
- ?line {term, "[-1]"} = get_term(P),
+ {term, "[-1]"} = get_term(P),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
-strings(suite) -> [];
strings(Config) when is_list(Config) ->
- ?line P = runner:start(?strings),
-
- ?line {term, "\"\\n\""} = get_term(P),
- ?line {term, "\"\\r\\n\""} = get_term(P),
- ?line {term, "\"a\""} = get_term(P),
- ?line {term, "\"A\""} = get_term(P),
- ?line {term, "\"0\""} = get_term(P),
- ?line {term, "\"9\""} = get_term(P),
- ?line {term, "\"The rain in Spain stays mainly in the plains\""} = get_term(P),
- ?line {term, "\" abcdefghijklmnopq \""} = get_term(P),
-
- ?line runner:recv_eot(P),
+ P = runner:start(?strings),
+
+ {term, "\"\\n\""} = get_term(P),
+ {term, "\"\\r\\n\""} = get_term(P),
+ {term, "\"a\""} = get_term(P),
+ {term, "\"A\""} = get_term(P),
+ {term, "\"0\""} = get_term(P),
+ {term, "\"9\""} = get_term(P),
+ {term, "\"The rain in Spain stays mainly in the plains\""} = get_term(P),
+ {term, "\" abcdefghijklmnopq \""} = get_term(P),
+
+ runner:recv_eot(P),
ok.
-
diff --git a/lib/erl_interface/test/ei_print_SUITE_data/Makefile.first b/lib/erl_interface/test/ei_print_SUITE_data/Makefile.first
index 987dbc27a9..3d2395a2c2 100644
--- a/lib/erl_interface/test/ei_print_SUITE_data/Makefile.first
+++ b/lib/erl_interface/test/ei_print_SUITE_data/Makefile.first
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_print_SUITE_data/Makefile.src b/lib/erl_interface/test/ei_print_SUITE_data/Makefile.src
index 266fcfcb10..150c11b99c 100644
--- a/lib/erl_interface/test/ei_print_SUITE_data/Makefile.src
+++ b/lib/erl_interface/test/ei_print_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_print_SUITE_data/ei_print_test.c b/lib/erl_interface/test/ei_print_SUITE_data/ei_print_test.c
index 2db5450b77..15cfbcae34 100644
--- a/lib/erl_interface/test/ei_print_SUITE_data/ei_print_test.c
+++ b/lib/erl_interface/test/ei_print_SUITE_data/ei_print_test.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_tmo_SUITE.erl b/lib/erl_interface/test/ei_tmo_SUITE.erl
index f506b3dbb0..003fe20594 100644
--- a/lib/erl_interface/test/ei_tmo_SUITE.erl
+++ b/lib/erl_interface/test/ei_tmo_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -25,333 +25,300 @@
-include_lib("kernel/include/inet.hrl").
-include("ei_tmo_SUITE_data/ei_tmo_test_cases.hrl").
--define(dummy_host,test01).
+-export([all/0, suite/0,
+ init_per_testcase/2, end_per_testcase/2,
+ framework_check/1, ei_accept_tmo/1, ei_connect_tmo/1, ei_send_tmo/1,
+ ei_connect_tmo/0,
+ ei_recv_tmo/1]).
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- init_per_testcase/2, end_per_testcase/2,
- framework_check/1, ei_accept_tmo/1, ei_connect_tmo/1, ei_send_tmo/1,
- ei_recv_tmo/1]).
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {minutes, 1}}].
all() ->
[framework_check, ei_accept_tmo, ei_connect_tmo,
ei_send_tmo, ei_recv_tmo].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?t:minutes(1)),
% test if platform is vxworks_simso
- ?line {_,Host} = split(node()),
+ {_,Host} = split(node()),
Bool = case atom_to_list(Host) of
- [$v,$x,$s,$i,$m | _] -> true;
- _ -> false
- end,
- [{vxsim,Bool},{watchdog, Dog}|Config].
-
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ [$v,$x,$s,$i,$m | _] -> true;
+ _ -> false
+ end,
+ [{vxsim,Bool}|Config].
+
+end_per_testcase(_Case, _Config) ->
ok.
-framework_check(doc) ->
- ["Check the framework."];
-framework_check(suite) ->
- [];
+%% Check the framework.
framework_check(Config) when is_list(Config) ->
%%dbg:tracer(),
%%dbg:p(self()),
- ?line P = runner:start(?framework_check),
- ?line runner:send_term(P,{hello,world}),
- ?line {term, {hello,world}} = runner:get_term(P),
- ?line runner:recv_eot(P),
+ P = runner:start(?framework_check),
+ runner:send_term(P,{hello,world}),
+ {term, {hello,world}} = runner:get_term(P),
+ runner:recv_eot(P),
ok.
-ei_recv_tmo(doc) ->
- ["Check recv with timeouts."];
-ei_recv_tmo(suite) ->
- [];
+%% Check recv with timeouts.
ei_recv_tmo(Config) when is_list(Config) ->
- ?line do_one_recv(Config,c_node_recv_tmo_1),
- ?line do_one_recv_failure(Config,c_node_recv_tmo_2),
+ do_one_recv(Config,c_node_recv_tmo_1),
+ do_one_recv_failure(Config,c_node_recv_tmo_2),
ok.
do_one_recv(Config,CNode) ->
- ?line {_,Host} = split(node()),
- ?line P1 = runner:start(?recv_tmo),
- ?line runner:send_term(P1,{CNode,
- erlang:get_cookie(),
- node()}),
- ?line {term, X} = runner:get_term(P1, 10000),
- ?line true = is_integer(X),
- ?line CNode1 = join(CNode,Host),
- ?line Term1 = {hej,[hopp,{i,[lingon,"skogen"]}]},
- ?line {test,CNode1} ! Term1,
- ?line {term, Term1} = runner:get_term(P1, 10000),
- ?line runner:recv_eot(P1).
-
+ {_,Host} = split(node()),
+ P1 = runner:start(?recv_tmo),
+ runner:send_term(P1,{CNode,
+ erlang:get_cookie(),
+ node()}),
+ {term, X} = runner:get_term(P1, 10000),
+ true = is_integer(X),
+ CNode1 = join(CNode,Host),
+ Term1 = {hej,[hopp,{i,[lingon,"skogen"]}]},
+ {test,CNode1} ! Term1,
+ {term, Term1} = runner:get_term(P1, 10000),
+ runner:recv_eot(P1).
+
do_one_recv_failure(Config,CNode) ->
- ?line P1 = runner:start(?recv_tmo),
- ?line runner:send_term(P1,{CNode,
- erlang:get_cookie(),
- node()}),
- ?line {term, X} = runner:get_term(P1, 10000),
- ?line true = is_integer(X),
- ?line {term, {Ret,ETimedout,ETimedout}} = runner:get_term(P1, 10000),
- ?line true = (Ret < 0),
- ?line runner:recv_eot(P1).
-
-
-ei_send_tmo(doc) ->
- ["Check send with timeouts."];
-ei_send_tmo(suite) ->
- [];
+ P1 = runner:start(?recv_tmo),
+ runner:send_term(P1,{CNode,
+ erlang:get_cookie(),
+ node()}),
+ {term, X} = runner:get_term(P1, 10000),
+ true = is_integer(X),
+ {term, {Ret,ETimedout,ETimedout}} = runner:get_term(P1, 10000),
+ true = (Ret < 0),
+ runner:recv_eot(P1).
+
+
+%% Check send with timeouts.
ei_send_tmo(Config) when is_list(Config) ->
%dbg:tracer(),
%dbg:p(self()),
- VxSim = ?config(vxsim, Config),
- ?line register(ei_send_tmo_1,self()),
- ?line do_one_send(Config,self(),c_node_send_tmo_1),
- ?line do_one_send(Config,ei_send_tmo_1,c_node_send_tmo_2),
- ?line do_one_send_failure(Config,self(),cccc1,c_nod_send_tmo_3,VxSim),
- ?line do_one_send_failure(Config,ei_send_tmo_1,cccc2,c_nod_send_tmo_4,VxSim),
+ VxSim = proplists:get_value(vxsim, Config),
+ register(ei_send_tmo_1,self()),
+ do_one_send(Config,self(),c_node_send_tmo_1),
+ do_one_send(Config,ei_send_tmo_1,c_node_send_tmo_2),
+ do_one_send_failure(Config,self(),cccc1,c_nod_send_tmo_3,VxSim),
+ do_one_send_failure(Config,ei_send_tmo_1,cccc2,c_nod_send_tmo_4,VxSim),
ok.
-
+
do_one_send(Config,From,CNode) ->
- ?line {_,Host} = split(node()),
- ?line P1 = runner:start(?send_tmo),
- ?line runner:send_term(P1,{CNode,
- erlang:get_cookie(),
- node()}),
- ?line {term, X} = runner:get_term(P1, 10000),
- ?line true = is_integer(X),
- ?line CNode1 = join(CNode,Host),
- ?line Term1 = {hej,[hopp,{i,[lingon,"skogen"]}]},
- ?line {test,CNode1} ! {From,1,Term1},
- ?line ok = receive
- Term1 ->
- ok
- after 2000 ->
- error
- end,
- ?line {term, 0} = runner:get_term(P1, 10000),
- ?line runner:recv_eot(P1).
+ {_,Host} = split(node()),
+ P1 = runner:start(?send_tmo),
+ runner:send_term(P1,{CNode,
+ erlang:get_cookie(),
+ node()}),
+ {term, X} = runner:get_term(P1, 10000),
+ true = is_integer(X),
+ CNode1 = join(CNode,Host),
+ Term1 = {hej,[hopp,{i,[lingon,"skogen"]}]},
+ {test,CNode1} ! {From,1,Term1},
+ ok = receive
+ Term1 ->
+ ok
+ after 2000 ->
+ error
+ end,
+ {term, 0} = runner:get_term(P1, 10000),
+ runner:recv_eot(P1).
do_one_send_failure(Config,From,FakeName,CName,VxSim) ->
- ?line {_,Host} = split(node()),
- ?line OurName = join(FakeName,Host),
- ?line Node = join(CName,Host),
- ?line LSocket = case gen_tcp:listen(0, [{active, false}, {packet,2}]) of
- {ok, Socket} ->
- ?line Socket;
- Else ->
- ?line exit(Else)
- end,
- ?line EpmdSocket = register(OurName, LSocket, 1, 5),
- ?line P3 = runner:start(?send_tmo),
- ?line Cookie = kaksmula_som_ingen_bryr_sig_om,
- ?line runner:send_term(P3,{CName,
- Cookie,
- OurName}),
- ?line SocketB = case gen_tcp:accept(LSocket) of
- {ok, Socket1} ->
- ?line Socket1;
- Else2 ->
- ?line exit(Else2)
- end,
- ?line {hidden,Node,5} = recv_name(SocketB), % See 1)
- ?line send_status(SocketB, ok),
- ?line MyChallengeB = gen_challenge(),
- ?line send_challenge(SocketB, OurName, MyChallengeB, 5),
- ?line HisChallengeB = recv_challenge_reply(
- SocketB,
- MyChallengeB,
- Cookie),
- ?line DigestB = gen_digest(HisChallengeB,Cookie),
- ?line send_challenge_ack(SocketB, DigestB),
- ?line inet:setopts(SocketB, [{active, false},
- {packet, 4}]),
- ?line {term, X} = runner:get_term(P3, 10000),
- ?line true = is_integer(X),
- ?line Message = [112,term_to_binary({6,self(),'',test}),
- term_to_binary({From,10000,
- {app,["lapp",{sa,["att",du,{slapp,
- sitta}]}]}})],
- ?line gen_tcp:send(SocketB,Message),
-
- %% At this point the test program starts sending messages (max 10000). Since
+ {_,Host} = split(node()),
+ OurName = join(FakeName,Host),
+ Node = join(CName,Host),
+ LSocket = case gen_tcp:listen(0, [{active, false}, {packet,2}]) of
+ {ok, Socket} ->
+ Socket;
+ Else ->
+ exit(Else)
+ end,
+ EpmdSocket = register(OurName, LSocket, 1, 5),
+ P3 = runner:start(?send_tmo),
+ Cookie = kaksmula_som_ingen_bryr_sig_om,
+ runner:send_term(P3,{CName,
+ Cookie,
+ OurName}),
+ SocketB = case gen_tcp:accept(LSocket) of
+ {ok, Socket1} ->
+ Socket1;
+ Else2 ->
+ exit(Else2)
+ end,
+ {hidden,Node,5} = recv_name(SocketB), % See 1)
+ send_status(SocketB, ok),
+ MyChallengeB = gen_challenge(),
+ send_challenge(SocketB, OurName, MyChallengeB, 5),
+ HisChallengeB = recv_challenge_reply(SocketB,
+ MyChallengeB,
+ Cookie),
+ DigestB = gen_digest(HisChallengeB,Cookie),
+ send_challenge_ack(SocketB, DigestB),
+ inet:setopts(SocketB, [{active, false},
+ {packet, 4}]),
+ {term, X} = runner:get_term(P3, 10000),
+ true = is_integer(X),
+ Message = [112,term_to_binary({6,self(),'',test}),
+ term_to_binary({From,50000,
+ {app,["lapp",{sa,["att",du,{slapp,
+ sitta}]}]}})],
+ gen_tcp:send(SocketB,Message),
+
+ %% At this point the test program starts sending messages (max 50000). Since
%% we're not receiving, eventually the send buffer fills up. Then no more
%% sending is possible and select() times out. The number of messages sent
%% before this happens is returned in Iters. The timeout value for get_term/2
%% must be large enough so there's time for the select() to time out and
%% the test program to return the error tuple (below).
- Res0 =
- if VxSim == false ->
- ?line {term,{Res,ETO,Iters,ETO}} = runner:get_term(P3, 20000),
- Res;
- true -> % relax the test for vxsim
- ?line case runner:get_term(P3, 20000) of
- {term,{Res,ETO,Iters,ETO}} ->
- Res;
- {term,{Res,_,Iters,ETO}} -> % EIO?
- Res
- end
- end,
- ?line runner:recv_eot(P3),
- ?line true = ((Res0 < 0) and (Iters > 0)),
- ?line gen_tcp:close(SocketB),
- ?line gen_tcp:close(EpmdSocket),
+
+ Res0 = if VxSim == false ->
+ {term,{Res,ETO,Iters,ETO}} = runner:get_term(P3, 20000),
+ Res;
+ true -> % relax the test for vxsim
+ case runner:get_term(P3, 20000) of
+ {term,{Res,ETO,Iters,ETO}} ->
+ Res;
+ {term,{Res,_,Iters,_ETO}} -> % EIO?
+ Res
+ end
+ end,
+ runner:recv_eot(P3),
+ true = ((Res0 < 0) and (Iters > 0)),
+ gen_tcp:close(SocketB),
+ gen_tcp:close(EpmdSocket),
ok.
-
-ei_connect_tmo(doc) ->
- ["Check accept with timeouts."];
-ei_connect_tmo(suite) ->
- [];
+
+%% Check accept with timeouts.
+ei_connect_tmo() -> [{require, test_host_not_reachable}].
+
ei_connect_tmo(Config) when is_list(Config) ->
%dbg:tracer(),
%dbg:p(self()),
- VxSim = ?config(vxsim, Config),
+ VxSim = proplists:get_value(vxsim, Config),
DummyNode = make_and_check_dummy(),
- ?line P = runner:start(?connect_tmo),
- ?line runner:send_term(P,{c_nod_connect_tmo_1,
- kaksmula_som_ingen_bryr_sig_om,
- DummyNode}),
+ P = runner:start(?connect_tmo),
+ runner:send_term(P,{c_nod_connect_tmo_1,
+ kaksmula_som_ingen_bryr_sig_om,
+ DummyNode}),
ETimedout =
- if VxSim == false ->
- ?line {term,{-3,ETO,ETO}} = runner:get_term(P, 10000),
- ?line ETO;
- true -> % relax the test for vxsim
- ?line case runner:get_term(P, 10000) of
- {term,{-3,ETO,ETO}} ->
- ?line ETO;
- {term,{-1,_,ETO}} -> % EHOSTUNREACH = ok
- ?line ETO
- end
- end,
- ?line runner:recv_eot(P),
- ?line P2 = runner:start(?connect_tmo),
- ?line runner:send_term(P2,{c_nod_connect_tmo_2,
- erlang:get_cookie(),
- node()}),
- ?line {term, X} = runner:get_term(P2, 10000),
- ?line runner:recv_eot(P2),
- ?line true = is_integer(X),
+ if VxSim == false ->
+ {term,{-3,ETO,ETO}} = runner:get_term(P, 10000),
+ ETO;
+ true -> % relax the test for vxsim
+ case runner:get_term(P, 10000) of
+ {term,{-3,ETO,ETO}} ->
+ ETO;
+ {term,{-1,_,ETO}} -> % EHOSTUNREACH = ok
+ ETO
+ end
+ end,
+ runner:recv_eot(P),
+ P2 = runner:start(?connect_tmo),
+ runner:send_term(P2,{c_nod_connect_tmo_2,
+ erlang:get_cookie(),
+ node()}),
+ {term, X} = runner:get_term(P2, 10000),
+ runner:recv_eot(P2),
+ true = is_integer(X),
%% Aborted handshake test...
- ?line {_,Host} = split(node()),
- ?line OurName = join(cccc,Host),
- ?line Node = join(c_nod_connect_tmo_3,Host),
- ?line LSocket = case gen_tcp:listen(0, [{active, false}, {packet,2}]) of
- {ok, Socket} ->
- ?line Socket;
- Else ->
- ?line exit(Else)
- end,
- ?line EpmdSocket = register(OurName, LSocket, 1, 5),
- ?line P3 = runner:start(?connect_tmo),
- ?line Cookie = kaksmula_som_ingen_bryr_sig_om,
- ?line runner:send_term(P3,{c_nod_connect_tmo_3,
- Cookie,
- OurName}),
- ?line SocketB = case gen_tcp:accept(LSocket) of
- {ok, Socket1} ->
- ?line Socket1;
- Else2 ->
- ?line exit(Else2)
- end,
- ?line {hidden,Node,5} = recv_name(SocketB), % See 1)
- ?line send_status(SocketB, ok),
- ?line MyChallengeB = gen_challenge(),
- ?line send_challenge(SocketB, OurName, MyChallengeB, 5),
- ?line HisChallengeB = recv_challenge_reply(
- SocketB,
- MyChallengeB,
- Cookie),
- ?line {term,{-1,ETimedout,ETimedout}} = runner:get_term(P3, 10000),
- ?line runner:recv_eot(P3),
- ?line gen_tcp:close(SocketB),
- ?line gen_tcp:close(EpmdSocket),
+ {_,Host} = split(node()),
+ OurName = join(cccc,Host),
+ Node = join(c_nod_connect_tmo_3,Host),
+ LSocket = case gen_tcp:listen(0, [{active, false}, {packet,2}]) of
+ {ok, Socket} ->
+ Socket;
+ Else ->
+ exit(Else)
+ end,
+ EpmdSocket = register(OurName, LSocket, 1, 5),
+ P3 = runner:start(?connect_tmo),
+ Cookie = kaksmula_som_ingen_bryr_sig_om,
+ runner:send_term(P3,{c_nod_connect_tmo_3,
+ Cookie,
+ OurName}),
+ SocketB = case gen_tcp:accept(LSocket) of
+ {ok, Socket1} ->
+ Socket1;
+ Else2 ->
+ exit(Else2)
+ end,
+ {hidden,Node,5} = recv_name(SocketB), % See 1)
+ send_status(SocketB, ok),
+ MyChallengeB = gen_challenge(),
+ send_challenge(SocketB, OurName, MyChallengeB, 5),
+ _HisChallengeB = recv_challenge_reply(SocketB,
+ MyChallengeB,
+ Cookie),
+ {term,{-1,ETimedout,ETimedout}} = runner:get_term(P3, 10000),
+ runner:recv_eot(P3),
+ gen_tcp:close(SocketB),
+ gen_tcp:close(EpmdSocket),
ok.
-
-ei_accept_tmo(doc) ->
- ["Check accept with timeouts."];
-ei_accept_tmo(suite) ->
- [];
+
+%% Check accept with timeouts.
ei_accept_tmo(Config) when is_list(Config) ->
%%dbg:tracer(),
%%dbg:p(self()),
- ?line P = runner:start(?accept_tmo),
- ?line runner:send_term(P,{c_nod_som_ingen_kontaktar_1,
- kaksmula_som_ingen_bryr_sig_om}),
- ?line {term,{-1,ETimedout,ETimedout}} = runner:get_term(P, 10000),
- ?line runner:recv_eot(P),
- ?line P2 = runner:start(?accept_tmo),
- ?line runner:send_term(P2,{c_nod_som_vi_kontaktar_1,
- erlang:get_cookie()}),
- ?line receive after 1000 -> ok end,
- ?line CNode1 = make_node(c_nod_som_vi_kontaktar_1),
- ?line {ignored,CNode1} ! tjenare,
- ?line {term, X} = runner:get_term(P2, 10000),
- ?line runner:recv_eot(P2),
- ?line true = is_integer(X),
- ?line P3 = runner:start(?accept_tmo),
- ?line runner:send_term(P3,{c_nod_som_vi_kontaktar_2,
- erlang:get_cookie()}),
- ?line receive after 1000 -> ok end,
- ?line CNode2 = make_node(c_nod_som_vi_kontaktar_2),
- ?line {NA,NB} = split(CNode2),
- ?line {_,Host} = split(node()),
- ?line OurName = join(ccc,Host),
- ?line {port,PortNo,_} = erl_epmd:port_please(NA,NB),
- ?line {ok, SocketA} = gen_tcp:connect(atom_to_list(NB),PortNo,
- [{active,false},
- {packet,2}]),
- ?line send_name(SocketA,OurName,5),
- ?line ok = recv_status(SocketA),
- ?line {hidden,Node,5,HisChallengeA} = recv_challenge(SocketA), % See 1)
- ?line OurChallengeA = gen_challenge(),
- ?line OurDigestA = gen_digest(HisChallengeA, erlang:get_cookie()),
+ P = runner:start(?accept_tmo),
+ runner:send_term(P,{c_nod_som_ingen_kontaktar_1,
+ kaksmula_som_ingen_bryr_sig_om}),
+ {term,{-1,ETimedout,ETimedout}} = runner:get_term(P, 10000),
+ runner:recv_eot(P),
+ P2 = runner:start(?accept_tmo),
+ runner:send_term(P2,{c_nod_som_vi_kontaktar_1,
+ erlang:get_cookie()}),
+ receive after 1000 -> ok end,
+ CNode1 = make_node(c_nod_som_vi_kontaktar_1),
+ {ignored,CNode1} ! tjenare,
+ {term, X} = runner:get_term(P2, 10000),
+ runner:recv_eot(P2),
+ true = is_integer(X),
+ P3 = runner:start(?accept_tmo),
+ runner:send_term(P3,{c_nod_som_vi_kontaktar_2,
+ erlang:get_cookie()}),
+ receive after 1000 -> ok end,
+ CNode2 = make_node(c_nod_som_vi_kontaktar_2),
+ {NA,NB} = split(CNode2),
+ {_,Host} = split(node()),
+ OurName = join(ccc,Host),
+ {port,PortNo,_} = erl_epmd:port_please(NA,NB),
+ {ok, SocketA} = gen_tcp:connect(atom_to_list(NB),PortNo,
+ [{active,false},
+ {packet,2}]),
+ send_name(SocketA,OurName,5),
+ ok = recv_status(SocketA),
+ {hidden,_Node,5,HisChallengeA} = recv_challenge(SocketA), % See 1)
+ _OurChallengeA = gen_challenge(),
+ _OurDigestA = gen_digest(HisChallengeA, erlang:get_cookie()),
%% Dont do the last two steps of the connection setup...
%% send_challenge_reply(SocketA, OurChallengeA, OurDigestA),
%% ok = recv_challenge_ack(SocketA, OurChallengeA, erlang:get_cookie()),
- ?line {term, {-1,ETimedout,ETimedout}} = runner:get_term(P3, 10000),
- ?line runner:recv_eot(P3),
- ?line gen_tcp:close(SocketA),
+ {term, {-1,ETimedout,ETimedout}} = runner:get_term(P3, 10000),
+ runner:recv_eot(P3),
+ gen_tcp:close(SocketA),
ok.
make_node(X) ->
list_to_atom(atom_to_list(X) ++ "@" ++
- hd(tl(string:tokens(atom_to_list(node()),"@")))).
+ hd(tl(string:tokens(atom_to_list(node()),"@")))).
make_and_check_dummy() ->
% First check that the host has an ip and is *not* reachable
- ?line case gen_tcp:connect(?dummy_host,23,[{active,false}],5000) of
- {error,timeout} -> ok;
- {error,ehostunreach} -> ok
- end,
+ HostNotReachable = ct:get_config(test_host_not_reachable),
+ case gen_tcp:connect(HostNotReachable, 23, [{active,false}],5000) of
+ {error,timeout} -> ok;
+ {error,ehostunreach} -> ok
+ end,
- list_to_atom("dummy@"++atom_to_list(?dummy_host)).
+ list_to_atom("dummy@"++HostNotReachable).
%%
%% Stolen from the erl_distribution_wb_test in kernel
@@ -359,12 +326,12 @@ make_and_check_dummy() ->
%%
-define(to_port(Socket, Data),
- case inet_tcp:send(Socket, Data) of
- {error, closed} ->
- self() ! {tcp_closed, Socket},
- {error, closed};
- R ->
- R
+ case inet_tcp:send(Socket, Data) of
+ {error, closed} ->
+ self() ! {tcp_closed, Socket},
+ {error, closed};
+ R ->
+ R
end).
-define(DFLAG_PUBLISHED,1).
@@ -382,8 +349,8 @@ make_and_check_dummy() ->
-define(int16(X), [((X) bsr 8) band 16#ff, (X) band 16#ff]).
-define(int32(X),
- [((X) bsr 24) band 16#ff, ((X) bsr 16) band 16#ff,
- ((X) bsr 8) band 16#ff, (X) band 16#ff]).
+ [((X) bsr 24) band 16#ff, ((X) bsr 16) band 16#ff,
+ ((X) bsr 8) band 16#ff, (X) band 16#ff]).
-define(i16(X1,X0),
(?u16(X1,X0) -
@@ -406,9 +373,9 @@ make_and_check_dummy() ->
%% This is no proper random number, but that is not really important in
%% this test
gen_challenge() ->
- {_,_,N} = erlang:now(),
+ {_,_,N} = os:timestamp(),
N.
-
+
%% Generate a message digest from Challenge number and Cookie
gen_digest(Challenge, Cookie) when is_integer(Challenge), is_atom(Cookie) ->
C0 = erlang:md5_init(),
@@ -423,95 +390,93 @@ gen_digest(Challenge, Cookie) when is_integer(Challenge), is_atom(Cookie) ->
send_status(Socket, Stat) ->
case gen_tcp:send(Socket, [$s | atom_to_list(Stat)]) of
- {error, _} ->
- ?shutdown(could_not_send_status);
- _ ->
- true
+ {error, _} -> ?shutdown(could_not_send_status);
+ _ -> true
end.
recv_status(Socket) ->
case gen_tcp:recv(Socket, 0) of
- {ok, [$s|StrStat]} ->
- list_to_atom(StrStat);
- Bad ->
- exit(Bad)
+ {ok, [$s|StrStat]} ->
+ list_to_atom(StrStat);
+ Bad ->
+ exit(Bad)
end.
send_challenge(Socket, Node, Challenge, Version) ->
send_challenge(Socket, Node, Challenge, Version, ?COMPULSORY_DFLAGS).
send_challenge(Socket, Node, Challenge, Version, Flags) ->
- {ok, {{Ip1,Ip2,Ip3,Ip4}, _}} = inet:sockname(Socket),
+ {ok, {{_Ip1,_Ip2,_Ip3,_Ip4}, _}} = inet:sockname(Socket),
?to_port(Socket, [$n,?int16(Version),?int32(Flags),
- ?int32(Challenge), atom_to_list(Node)]).
+ ?int32(Challenge), atom_to_list(Node)]).
recv_challenge(Socket) ->
case gen_tcp:recv(Socket, 0) of
- {ok,[$n,V1,V0,Fl1,Fl2,Fl3,Fl4,CA3,CA2,CA1,CA0 | Ns]} ->
- Flags = ?u32(Fl1,Fl2,Fl3,Fl4),
- Type = case Flags band ?DFLAG_PUBLISHED of
- 0 ->
- hidden;
- _ ->
- normal
- end,
- Node =list_to_atom(Ns),
- Version = ?u16(V1,V0),
- Challenge = ?u32(CA3,CA2,CA1,CA0),
- {Type,Node,Version,Challenge};
- _ ->
- ?shutdown(no_node)
+ {ok,[$n,V1,V0,Fl1,Fl2,Fl3,Fl4,CA3,CA2,CA1,CA0 | Ns]} ->
+ Flags = ?u32(Fl1,Fl2,Fl3,Fl4),
+ Type = case Flags band ?DFLAG_PUBLISHED of
+ 0 ->
+ hidden;
+ _ ->
+ normal
+ end,
+ Node =list_to_atom(Ns),
+ Version = ?u16(V1,V0),
+ Challenge = ?u32(CA3,CA2,CA1,CA0),
+ {Type,Node,Version,Challenge};
+ _ ->
+ ?shutdown(no_node)
end.
-send_challenge_reply(Socket, Challenge, Digest) ->
- ?to_port(Socket, [$r,?int32(Challenge),Digest]).
+%send_challenge_reply(Socket, Challenge, Digest) ->
+% ?to_port(Socket, [$r,?int32(Challenge),Digest]).
recv_challenge_reply(Socket, ChallengeA, Cookie) ->
case gen_tcp:recv(Socket, 0) of
- {ok,[$r,CB3,CB2,CB1,CB0 | SumB]} when length(SumB) == 16 ->
- SumA = gen_digest(ChallengeA, Cookie),
- ChallengeB = ?u32(CB3,CB2,CB1,CB0),
- if SumB == SumA ->
- ChallengeB;
- true ->
- ?shutdown(bad_challenge_reply)
- end;
- _ ->
- ?shutdown(no_node)
+ {ok,[$r,CB3,CB2,CB1,CB0 | SumB]} when length(SumB) == 16 ->
+ SumA = gen_digest(ChallengeA, Cookie),
+ ChallengeB = ?u32(CB3,CB2,CB1,CB0),
+ if SumB == SumA ->
+ ChallengeB;
+ true ->
+ ?shutdown(bad_challenge_reply)
+ end;
+ _ ->
+ ?shutdown(no_node)
end.
send_challenge_ack(Socket, Digest) ->
?to_port(Socket, [$a,Digest]).
-recv_challenge_ack(Socket, ChallengeB, CookieA) ->
- case gen_tcp:recv(Socket, 0) of
- {ok,[$a | SumB]} when length(SumB) == 16 ->
- SumA = gen_digest(ChallengeB, CookieA),
- if SumB == SumA ->
- ok;
- true ->
- ?shutdown(bad_challenge_ack)
- end;
- _ ->
- ?shutdown(bad_challenge_ack)
- end.
+%recv_challenge_ack(Socket, ChallengeB, CookieA) ->
+% case gen_tcp:recv(Socket, 0) of
+% {ok,[$a | SumB]} when length(SumB) == 16 ->
+% SumA = gen_digest(ChallengeB, CookieA),
+% if SumB == SumA ->
+% ok;
+% true ->
+% ?shutdown(bad_challenge_ack)
+% end;
+% _ ->
+% ?shutdown(bad_challenge_ack)
+% end.
send_name(Socket, MyNode0, Version) ->
send_name(Socket, MyNode0, Version, ?COMPULSORY_DFLAGS).
send_name(Socket, MyNode0, Version, Flags) ->
MyNode = atom_to_list(MyNode0),
?to_port(Socket, [$n,?int16(Version),?int32(Flags)] ++
- MyNode).
+ MyNode).
%%
%% recv_name is common for both old and new handshake.
%%
recv_name(Socket) ->
case gen_tcp:recv(Socket, 0) of
- {ok,Data} ->
- get_name(Data);
- Res ->
- ?shutdown({no_node,Res})
+ {ok,Data} ->
+ get_name(Data);
+ Res ->
+ ?shutdown({no_node,Res})
end.
get_name([$m,VersionA,VersionB,_Ip1,_Ip2,_Ip3,_Ip4|OtherNode]) ->
@@ -520,11 +485,9 @@ get_name([$h,VersionA,VersionB,_Ip1,_Ip2,_Ip3,_Ip4|OtherNode]) ->
{hidden, list_to_atom(OtherNode), ?u16(VersionA,VersionB)};
get_name([$n,VersionA, VersionB, Flag1, Flag2, Flag3, Flag4 | OtherNode]) ->
Type = case ?u32(Flag1, Flag2, Flag3, Flag4) band ?DFLAG_PUBLISHED of
- 0 ->
- hidden;
- _ ->
- normal
- end,
+ 0 -> hidden;
+ _ -> normal
+ end,
{Type, list_to_atom(OtherNode),
?u16(VersionA,VersionB)};
get_name(Data) ->
@@ -533,74 +496,73 @@ get_name(Data) ->
%%
%% tell_name is for old handshake
%%
-tell_name(Socket, MyNode0, Version) ->
- MyNode = atom_to_list(MyNode0),
- {ok, {{Ip1,Ip2,Ip3,Ip4}, _}} = inet:sockname(Socket),
- ?to_port(Socket, [$h,?int16(Version),Ip1,Ip2,Ip3,Ip4] ++
- MyNode).
+%tell_name(Socket, MyNode0, Version) ->
+% MyNode = atom_to_list(MyNode0),
+% {ok, {{Ip1,Ip2,Ip3,Ip4}, _}} = inet:sockname(Socket),
+% ?to_port(Socket, [$h,?int16(Version),Ip1,Ip2,Ip3,Ip4] ++ MyNode).
%%
%% The communication with EPMD follows
%%
do_register_node(NodeName, TcpPort, VLow, VHigh) ->
case gen_tcp:connect({127,0,0,1}, get_epmd_port(), []) of
- {ok, Socket} ->
- {N0,_} = split(NodeName),
- Name = atom_to_list(N0),
- Extra = "",
- Elen = length(Extra),
- Len = 1+2+1+1+2+2+2+length(Name)+2+Elen,
- gen_tcp:send(Socket, [?int16(Len), $x,
- ?int16(TcpPort),
- $M,
- 0,
- ?int16(VHigh),
- ?int16(VLow),
- ?int16(length(Name)),
- Name,
- ?int16(Elen),
- Extra]),
- case wait_for_reg_reply(Socket, []) of
- {error, epmd_close} ->
- exit(epmd_broken);
- Other ->
- Other
- end;
- Error ->
- Error
+ {ok, Socket} ->
+ {N0,_} = split(NodeName),
+ Name = atom_to_list(N0),
+ Extra = "",
+ Elen = length(Extra),
+ Len = 1+2+1+1+2+2+2+length(Name)+2+Elen,
+ gen_tcp:send(Socket, [?int16(Len), $x,
+ ?int16(TcpPort),
+ $M,
+ 0,
+ ?int16(VHigh),
+ ?int16(VLow),
+ ?int16(length(Name)),
+ Name,
+ ?int16(Elen),
+ Extra]),
+ case wait_for_reg_reply(Socket, []) of
+ {error, epmd_close} ->
+ exit(epmd_broken);
+ Other ->
+ Other
+ end;
+ Error ->
+ Error
end.
wait_for_reg_reply(Socket, SoFar) ->
receive
- {tcp, Socket, Data0} ->
- case SoFar ++ Data0 of
- [$y, Result, A, B] ->
- case Result of
- 0 ->
- {alive, Socket, ?u16(A, B)};
- _ ->
- {error, duplicate_name}
- end;
- Data when length(Data) < 4 ->
- wait_for_reg_reply(Socket, Data);
- Garbage ->
- {error, {garbage_from_epmd, Garbage}}
- end;
- {tcp_closed, Socket} ->
- {error, epmd_close}
+ {tcp, Socket, Data0} ->
+ case SoFar ++ Data0 of
+ [$y, Result, A, B] ->
+ case Result of
+ 0 ->
+ {alive, Socket, ?u16(A, B)};
+ _ ->
+ {error, duplicate_name}
+ end;
+ Data when length(Data) < 4 ->
+ wait_for_reg_reply(Socket, Data);
+ Garbage ->
+ {error, {garbage_from_epmd, Garbage}}
+ end;
+ {tcp_closed, Socket} ->
+ {error, epmd_close}
after 10000 ->
- gen_tcp:close(Socket),
- {error, no_reg_reply_from_epmd}
+ gen_tcp:close(Socket),
+ {error, no_reg_reply_from_epmd}
end.
register(NodeName, ListenSocket, VLow, VHigh) ->
{ok,{_,TcpPort}} = inet:sockname(ListenSocket),
case do_register_node(NodeName, TcpPort, VLow, VHigh) of
- {alive, Socket, Creation} ->
- Socket;
- Other ->
- exit(Other)
+ {alive, Socket, _Creation} ->
+ Socket;
+ Other ->
+ exit(Other)
end.
@@ -618,69 +580,10 @@ split(Atom) ->
{A,B} = split(atom_to_list(Atom),[]),
{list_to_atom(A),list_to_atom(B)}.
-%% Build a simple distribution message
-build_message(Cookie) ->
- [$?,term_to_binary({6,self(),Cookie,rex}),term_to_binary(plupp)].
-
-%% Build a distribution message that will make rex answer
-build_rex_message(Cookie,OurName) ->
- [$?,term_to_binary({6,self(),Cookie,rex}),
- term_to_binary({'$gen_cast',
- {cast,
- rpc,
- cast,
- [OurName, hello, world, []],
- self()} })].
-
-%% Receive a distribution message
-recv_message(Socket) ->
- case gen_tcp:recv(Socket, 0) of
- {ok,Data} ->
- B0 = list_to_binary(Data),
- {_,B1} = erlang:split_binary(B0,1),
- Header = erlang:binary_to_term(B1),
- Siz = size(term_to_binary(Header)),
- {_,B2} = erlang:split_binary(B1,Siz),
- Message = case (catch erlang:binary_to_term(B2)) of
- {'EXIT', _} ->
- could_not_digest_message;
- Other ->
- Other
- end,
- {Header, Message};
- Res ->
- exit({no_message,Res})
- end.
-
%% Build a nodename
join(Name,Host) ->
list_to_atom(atom_to_list(Name) ++ "@" ++ atom_to_list(Host)).
-%% start/stop slave.
-start_node(Name, Param) ->
- ?t:start_node(Name, slave, [{args, Param}]).
-
-stop_node(Node) ->
- ?t:stop_node(Node).
-
-
-get_nodenames(N, T) ->
- get_nodenames(N, T, []).
-
-get_nodenames(0, _, Acc) ->
- Acc;
-get_nodenames(N, T, Acc) ->
- {A, B, C} = now(),
- get_nodenames(N-1, T, [list_to_atom(atom_to_list(?MODULE)
- ++ "-"
- ++ atom_to_list(T)
- ++ "-"
- ++ integer_to_list(A)
- ++ "-"
- ++ integer_to_list(B)
- ++ "-"
- ++ integer_to_list(C)) | Acc]).
-
get_epmd_port() ->
case init:get_argument(epmd_port) of
{ok, [[PortStr|_]|_]} when is_list(PortStr) ->
diff --git a/lib/erl_interface/test/ei_tmo_SUITE_data/Makefile.first b/lib/erl_interface/test/ei_tmo_SUITE_data/Makefile.first
index a19eabb64a..884221d9d7 100644
--- a/lib/erl_interface/test/ei_tmo_SUITE_data/Makefile.first
+++ b/lib/erl_interface/test/ei_tmo_SUITE_data/Makefile.first
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2009. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_tmo_SUITE_data/Makefile.src b/lib/erl_interface/test/ei_tmo_SUITE_data/Makefile.src
index c6798a6644..b4ee361939 100644
--- a/lib/erl_interface/test/ei_tmo_SUITE_data/Makefile.src
+++ b/lib/erl_interface/test/ei_tmo_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2009. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/ei_tmo_SUITE_data/ei_tmo_test.c b/lib/erl_interface/test/ei_tmo_SUITE_data/ei_tmo_test.c
index 1104f642a2..0079ef8c86 100644
--- a/lib/erl_interface/test/ei_tmo_SUITE_data/ei_tmo_test.c
+++ b/lib/erl_interface/test/ei_tmo_SUITE_data/ei_tmo_test.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -512,18 +512,21 @@ TESTCASE(send_tmo)
for (i=0;i < iterations; ++i) {
res = ei_send_tmo(com_sock, &pid, send_buffer.buff,
send_buffer.index, 5000);
- DEBUGF(("Sent bindata (%d):\n",res));
+ if (res < 0) {
+ DEBUGF(("Sent bindata failed (%d) after %d iterations:\n", res, i));
+ break;
+ }
#ifdef DEBUG
+ if (i < 10 || (i % 100 == 0)) /* don't flood the log */
{
int ndx = 0;
int v;
+ DEBUGF(("%d: Sent bindata (%d): ", i, res));
ei_decode_version(send_buffer.buff,&ndx,&v);
ei_print_term(debugfile, send_buffer.buff, &ndx);
+ DEBUGF(("\n"));
}
#endif
- DEBUGF(("\n"));
- if (res < 0)
- break;
}
if (res < 0) {
DEBUGF(("ei_send_tmo failure at line %d\n",__LINE__));
diff --git a/lib/erl_interface/test/erl_connect_SUITE.erl b/lib/erl_interface/test/erl_connect_SUITE.erl
index d3fe020bce..cd73f07b8f 100644
--- a/lib/erl_interface/test/erl_connect_SUITE.erl
+++ b/lib/erl_interface/test/erl_connect_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,87 +24,64 @@
-include_lib("common_test/include/ct.hrl").
-include("erl_connect_SUITE_data/erl_connect_test_cases.hrl").
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- init_per_testcase/2,end_per_testcase/2,
- erl_send/1,erl_reg_send/1, erl_send_cookie_file/1]).
+-export([all/0, suite/0,
+ erl_send/1, erl_reg_send/1,
+ erl_send_cookie_file/1]).
-import(runner, [get_term/1,send_term/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {seconds, 30}}].
all() ->
[erl_send, erl_reg_send, erl_send_cookie_file].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
-init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?t:minutes(0.25)),
- [{watchdog, Dog}|Config].
-
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
- ok.
erl_send(Config) when is_list(Config) ->
- ?line P = runner:start(?interpret),
- ?line 1 = erl_connect_init(P, 42, erlang:get_cookie(), 0),
- ?line {ok,Fd} = erl_connect(P, node()),
+ P = runner:start(?interpret),
+ 1 = erl_connect_init(P, 42, erlang:get_cookie(), 0),
+ {ok,Fd} = erl_connect(P, node()),
- ?line ok = erl_send(P, Fd, self(), AMsg={a,message}),
- ?line receive AMsg -> ok end,
+ ok = erl_send(P, Fd, self(), AMsg={a,message}),
+ receive AMsg -> ok end,
- ?line 0 = erl_close_connection(P,Fd),
- ?line runner:send_eot(P),
- ?line runner:recv_eot(P),
+ 0 = erl_close_connection(P,Fd),
+ runner:send_eot(P),
+ runner:recv_eot(P),
ok.
erl_send_cookie_file(Config) when is_list(Config) ->
case os:type() of
- vxworks ->
- {skip,"Skipped on VxWorks"};
- _ ->
- ?line P = runner:start(?interpret),
- ?line 1 = erl_connect_init(P, 42, '', 0),
- ?line {ok,Fd} = erl_connect(P, node()),
-
- ?line ok = erl_send(P, Fd, self(), AMsg={a,message}),
- ?line receive AMsg -> ok end,
-
- ?line 0 = erl_close_connection(P,Fd),
- ?line runner:send_eot(P),
- ?line runner:recv_eot(P),
- ok
+ vxworks ->
+ {skip,"Skipped on VxWorks"};
+ _ ->
+ P = runner:start(?interpret),
+ 1 = erl_connect_init(P, 42, '', 0),
+ {ok,Fd} = erl_connect(P, node()),
+
+ ok = erl_send(P, Fd, self(), AMsg={a,message}),
+ receive AMsg -> ok end,
+
+ 0 = erl_close_connection(P,Fd),
+ runner:send_eot(P),
+ runner:recv_eot(P),
+ ok
end.
erl_reg_send(Config) when is_list(Config) ->
- ?line P = runner:start(?interpret),
- ?line 1 = erl_connect_init(P, 42, erlang:get_cookie(), 0),
- ?line {ok,Fd} = erl_connect(P, node()),
+ P = runner:start(?interpret),
+ 1 = erl_connect_init(P, 42, erlang:get_cookie(), 0),
+ {ok,Fd} = erl_connect(P, node()),
ARegName = a_strange_registred_name,
- ?line register(ARegName, self()),
- ?line ok = erl_reg_send(P, Fd, ARegName, AMsg={another,[strange],message}),
- ?line receive AMsg -> ok end,
+ register(ARegName, self()),
+ ok = erl_reg_send(P, Fd, ARegName, AMsg={another,[strange],message}),
+ receive AMsg -> ok end,
- ?line 0 = erl_close_connection(P,Fd),
- ?line runner:send_eot(P),
- ?line runner:recv_eot(P),
+ 0 = erl_close_connection(P,Fd),
+ runner:send_eot(P),
+ runner:recv_eot(P),
ok.
@@ -113,20 +90,20 @@ erl_reg_send(Config) when is_list(Config) ->
erl_connect_init(P, Num, Cookie, Creation) ->
send_command(P, erl_connect_init, [Num,Cookie,Creation]),
case get_term(P) of
- {term,Int} when is_integer(Int) -> Int
+ {term,Int} when is_integer(Int) -> Int
end.
erl_connect(P, Node) ->
send_command(P, erl_connect, [Node]),
case get_term(P) of
- {term,{Fd,_}} when Fd >= 0 -> {ok,Fd};
- {term,{-1,Errno}} -> {error,Errno}
+ {term,{Fd,_}} when Fd >= 0 -> {ok,Fd};
+ {term,{-1,Errno}} -> {error,Errno}
end.
erl_close_connection(P, FD) ->
send_command(P, erl_close_connection, [FD]),
case get_term(P) of
- {term,Int} when is_integer(Int) -> Int
+ {term,Int} when is_integer(Int) -> Int
end.
erl_send(P, Fd, To, Msg) ->
@@ -139,17 +116,12 @@ erl_reg_send(P, Fd, To, Msg) ->
get_send_result(P) ->
case get_term(P) of
- {term,{1,_}} -> ok;
- {term,{-1,Errno}} -> {error,Errno};
- {term,{Res,Errno}}->
- io:format("Return value: ~p\nerl_errno: ~p", [Res,Errno]),
- ?t:fail(bad_return_value)
+ {term,{1,_}} -> ok;
+ {term,{-1,Errno}} -> {error,Errno};
+ {term,{Res,Errno}}->
+ io:format("Return value: ~p\nerl_errno: ~p", [Res,Errno]),
+ ct:fail(bad_return_value)
end.
send_command(P, Name, Args) ->
runner:send_term(P, {Name,list_to_tuple(Args)}).
-
-
-
-
-
diff --git a/lib/erl_interface/test/erl_connect_SUITE_data/Makefile.first b/lib/erl_interface/test/erl_connect_SUITE_data/Makefile.first
index f0b8eef6bd..21a7aac0b0 100644
--- a/lib/erl_interface/test/erl_connect_SUITE_data/Makefile.first
+++ b/lib/erl_interface/test/erl_connect_SUITE_data/Makefile.first
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_connect_SUITE_data/Makefile.src b/lib/erl_interface/test/erl_connect_SUITE_data/Makefile.src
index 57db6f6024..ff4c382c97 100644
--- a/lib/erl_interface/test/erl_connect_SUITE_data/Makefile.src
+++ b/lib/erl_interface/test/erl_connect_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2009. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_connect_SUITE_data/erl_connect_test.c b/lib/erl_interface/test/erl_connect_SUITE_data/erl_connect_test.c
index 11c0daa4c5..0adaa79a33 100644
--- a/lib/erl_interface/test/erl_connect_SUITE_data/erl_connect_test.c
+++ b/lib/erl_interface/test/erl_connect_SUITE_data/erl_connect_test.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_eterm_SUITE.erl b/lib/erl_interface/test/erl_eterm_SUITE.erl
index 230310f63b..0e51a50c19 100644
--- a/lib/erl_interface/test/erl_eterm_SUITE.erl
+++ b/lib/erl_interface/test/erl_eterm_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,40 +34,39 @@
%%% 5. Miscellanous functions.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- build_terms/1, round_trip_conversion/1,
- decode_terms/1, decode_float/1,
- t_erl_mk_int/1, t_erl_mk_list/1,
- basic_copy/1,
- t_erl_cons/1,
- t_erl_mk_atom/1,
- t_erl_mk_binary/1,
- t_erl_mk_empty_list/1,
- t_erl_mk_float/1,
- t_erl_mk_pid/1,
- t_erl_mk_xpid/1,
- t_erl_mk_port/1,
- t_erl_mk_xport/1,
- t_erl_mk_ref/1,
- t_erl_mk_long_ref/1,
- t_erl_mk_string/1,
- t_erl_mk_estring/1,
- t_erl_mk_tuple/1,
- t_erl_mk_uint/1,
- t_erl_mk_var/1,
- t_erl_size/1,
- t_erl_var_content/1,
- t_erl_element/1,
- t_erl_length/1, t_erl_hd/1, t_erl_tl/1,
- type_checks/1, extractor_macros/1,
- t_erl_iolist_length/1, t_erl_iolist_to_binary/1,
- t_erl_iolist_to_string/1,
- erl_print_term/1, print_string/1,
- t_erl_free_compound/1,
- high_chaparal/1,
- broken_data/1,
- cnode_1/1]).
+-export([all/0, suite/0,
+ build_terms/1, round_trip_conversion/1,
+ decode_terms/1, decode_float/1,
+ t_erl_mk_int/1, t_erl_mk_list/1,
+ basic_copy/1,
+ t_erl_cons/1,
+ t_erl_mk_atom/1,
+ t_erl_mk_binary/1,
+ t_erl_mk_empty_list/1,
+ t_erl_mk_float/1,
+ t_erl_mk_pid/1,
+ t_erl_mk_xpid/1,
+ t_erl_mk_port/1,
+ t_erl_mk_xport/1,
+ t_erl_mk_ref/1,
+ t_erl_mk_long_ref/1,
+ t_erl_mk_string/1,
+ t_erl_mk_estring/1,
+ t_erl_mk_tuple/1,
+ t_erl_mk_uint/1,
+ t_erl_mk_var/1,
+ t_erl_size/1,
+ t_erl_var_content/1,
+ t_erl_element/1,
+ t_erl_length/1, t_erl_hd/1, t_erl_tl/1,
+ type_checks/1, extractor_macros/1,
+ t_erl_iolist_length/1, t_erl_iolist_to_binary/1,
+ t_erl_iolist_to_string/1,
+ erl_print_term/1, print_string/1,
+ t_erl_free_compound/1,
+ high_chaparal/1,
+ broken_data/1,
+ cnode_1/1]).
-export([start_cnode/1]).
@@ -76,7 +75,8 @@
%% This test suite controls the running of the C language functions
%% in eterm_test.c and print_term.c.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]}].
all() ->
[build_terms, round_trip_conversion, decode_terms,
@@ -93,22 +93,6 @@ all() ->
erl_print_term, print_string, t_erl_free_compound,
high_chaparal, broken_data, cnode_1].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
@@ -119,82 +103,77 @@ end_per_group(_GroupName, Config) ->
%% This test asks the C function to construct all data types in
%% a list and verifies that the result is as expected.
-build_terms(suite) -> [];
build_terms(Config) when is_list(Config) ->
- ?line P = runner:start(?build_terms),
- ?line {term, Term} = get_term(P),
- ?line io:format("Received: ~p", [Term]),
- ?line [ARefLN, ARef, APortLN, APort, APidLN, APid,
- {element1, 42, 767}, "A string",
- 1, -1, 0, 3.0, ABin, 'I am an atom'] = Term,
- ?line "A binary" = binary_to_list(ABin),
- ?line case ARef of
- R when is_reference(R), node(R) == kalle@localhost -> ok
- end,
- ?line case ARefLN of
- R1 when is_reference(R1), node(R1) == abcdefghijabcdefghij@localhost -> ok
- end,
- ?line case APort of
- Port when is_port(Port), node(Port) == kalle@localhost -> ok
- end,
- ?line case APortLN of
- Port1 when is_port(Port1), node(Port1) == abcdefghijabcdefghij@localhost -> ok
- end,
- ?line case APid of
- Pid when is_pid(Pid), node(Pid) == kalle@localhost -> ok
- end,
- ?line case APidLN of
- Pid1 when is_pid(Pid1), node(Pid1) == abcdefghijabcdefghij@localhost -> ok
- end,
-
- ?line runner:recv_eot(P),
+ P = runner:start(?build_terms),
+ {term, Term} = get_term(P),
+ io:format("Received: ~p", [Term]),
+ [ARefLN, ARef, APortLN, APort, APidLN, APid,
+ {element1, 42, 767}, "A string",
+ 1, -1, 0, 3.0, ABin, 'I am an atom'] = Term,
+ "A binary" = binary_to_list(ABin),
+ case ARef of
+ R when is_reference(R), node(R) == kalle@localhost -> ok
+ end,
+ case ARefLN of
+ R1 when is_reference(R1), node(R1) == abcdefghijabcdefghij@localhost -> ok
+ end,
+ case APort of
+ Port when is_port(Port), node(Port) == kalle@localhost -> ok
+ end,
+ case APortLN of
+ Port1 when is_port(Port1), node(Port1) == abcdefghijabcdefghij@localhost -> ok
+ end,
+ case APid of
+ Pid when is_pid(Pid), node(Pid) == kalle@localhost -> ok
+ end,
+ case APidLN of
+ Pid1 when is_pid(Pid1), node(Pid1) == abcdefghijabcdefghij@localhost -> ok
+ end,
+
+ runner:recv_eot(P),
ok.
%% This test is run entirely in C code.
-round_trip_conversion(suite) -> [];
round_trip_conversion(Config) when is_list(Config) ->
- ?line runner:test(?round_trip_conversion),
+ runner:test(?round_trip_conversion),
ok.
%% This test sends a list of all data types to the C code function,
%% which decodes it and verifies it.
-decode_terms(suite) -> [];
decode_terms(Config) when is_list(Config) ->
- ?line Dummy1 = list_to_atom(filename:join(?config(priv_dir, Config),
- dummy_file1)),
- ?line Dummy2 = list_to_atom(filename:join(?config(priv_dir, Config),
- dummy_file2)),
- ?line Port1 = open_port(Dummy1, [out]),
- ?line Port2 = open_port(Dummy2, [out]),
- ?line ABinary = list_to_binary("A binary"),
- ?line Terms = [make_ref(), make_ref(),
- Port1, Port2,
- self(), self(),
- {element1, 42, 767}, "A string",
- 1, -1, 0, 3.0, ABinary, 'I am an atom'],
-
- ?line P = runner:start(?decode_terms),
- ?line runner:send_term(P, Terms),
- ?line runner:recv_eot(P),
+ Dummy1 = list_to_atom(filename:join(proplists:get_value(priv_dir, Config),
+ dummy_file1)),
+ Dummy2 = list_to_atom(filename:join(proplists:get_value(priv_dir, Config),
+ dummy_file2)),
+ Port1 = open_port(Dummy1, [out]),
+ Port2 = open_port(Dummy2, [out]),
+ ABinary = list_to_binary("A binary"),
+ Terms = [make_ref(), make_ref(),
+ Port1, Port2,
+ self(), self(),
+ {element1, 42, 767}, "A string",
+ 1, -1, 0, 3.0, ABinary, 'I am an atom'],
+
+ P = runner:start(?decode_terms),
+ runner:send_term(P, Terms),
+ runner:recv_eot(P),
ok.
%% Decodes the floating point number 3.1415.
-decode_float(suite) -> [];
decode_float(Config) when is_list(Config) ->
- ?line P = runner:start(?decode_float),
- ?line runner:send_term(P, 3.1415),
- ?line runner:recv_eot(P),
+ P = runner:start(?decode_float),
+ runner:send_term(P, 3.1415),
+ runner:recv_eot(P),
ok.
%% Tests the erl_free_compound() function.
-t_erl_free_compound(suite) -> [];
t_erl_free_compound(Config) when is_list(Config) ->
- ?line runner:test(?t_erl_free_compound),
+ runner:test(?t_erl_free_compound),
ok.
@@ -206,317 +185,296 @@ t_erl_free_compound(Config) when is_list(Config) ->
%% This tests the erl_mk_list() function.
-t_erl_mk_list(suite) -> [];
t_erl_mk_list(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_mk_list),
+ P = runner:start(?t_erl_mk_list),
- ?line {term, []} = get_term(P),
- ?line {term, [abc]} = get_term(P),
- ?line {term, [abcdef, 42]} = get_term(P),
- ?line {term, [0.0, 23, [], 3.1415]} = get_term(P),
+ {term, []} = get_term(P),
+ {term, [abc]} = get_term(P),
+ {term, [abcdef, 42]} = get_term(P),
+ {term, [0.0, 23, [], 3.1415]} = get_term(P),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% This tests the erl_mk_int() function.
-t_erl_mk_int(suite) -> [];
t_erl_mk_int(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_mk_int),
-
- ?line {term, 0} = get_term(P),
- ?line {term, 127} = get_term(P),
- ?line {term, 128} = get_term(P),
- ?line {term, 255} = get_term(P),
- ?line {term, 256} = get_term(P),
-
- ?line {term, 16#FFFF} = get_term(P),
- ?line {term, 16#10000} = get_term(P),
-
- ?line {term, 16#07FFFFFF} = get_term(P),
- ?line {term, 16#0FFFFFFF} = get_term(P),
- ?line {term, 16#1FFFFFFF} = get_term(P),
- ?line {term, 16#3FFFFFFF} = get_term(P),
- ?line {term, 16#7FFFFFFF} = get_term(P),
-
- ?line {term, 16#08000000} = get_term(P),
- ?line {term, 16#10000000} = get_term(P),
- ?line {term, 16#20000000} = get_term(P),
- ?line {term, 16#40000000} = get_term(P),
-
-
- ?line {term, -16#07FFFFFF} = get_term(P),
- ?line {term, -16#0FFFFFFF} = get_term(P),
- ?line {term, -16#1FFFFFFF} = get_term(P),
- ?line {term, -16#3FFFFFFF} = get_term(P),
- ?line {term, -16#7FFFFFFF} = get_term(P),
-
- ?line {term, -16#08000000} = get_term(P),
- ?line {term, -16#10000000} = get_term(P),
- ?line {term, -16#20000000} = get_term(P),
- ?line {term, -16#40000000} = get_term(P),
-
- ?line {term, -16#08000001} = get_term(P),
- ?line {term, -16#10000001} = get_term(P),
- ?line {term, -16#20000001} = get_term(P),
- ?line {term, -16#40000001} = get_term(P),
-
- ?line {term, -16#08000002} = get_term(P),
- ?line {term, -16#10000002} = get_term(P),
- ?line {term, -16#20000002} = get_term(P),
- ?line {term, -16#40000002} = get_term(P),
-
- ?line {term, -1999999999} = get_term(P),
- ?line {term, -2000000000} = get_term(P),
- ?line {term, -2000000001} = get_term(P),
-
- ?line runner:recv_eot(P),
+ P = runner:start(?t_erl_mk_int),
+
+ {term, 0} = get_term(P),
+ {term, 127} = get_term(P),
+ {term, 128} = get_term(P),
+ {term, 255} = get_term(P),
+ {term, 256} = get_term(P),
+
+ {term, 16#FFFF} = get_term(P),
+ {term, 16#10000} = get_term(P),
+
+ {term, 16#07FFFFFF} = get_term(P),
+ {term, 16#0FFFFFFF} = get_term(P),
+ {term, 16#1FFFFFFF} = get_term(P),
+ {term, 16#3FFFFFFF} = get_term(P),
+ {term, 16#7FFFFFFF} = get_term(P),
+
+ {term, 16#08000000} = get_term(P),
+ {term, 16#10000000} = get_term(P),
+ {term, 16#20000000} = get_term(P),
+ {term, 16#40000000} = get_term(P),
+
+
+ {term, -16#07FFFFFF} = get_term(P),
+ {term, -16#0FFFFFFF} = get_term(P),
+ {term, -16#1FFFFFFF} = get_term(P),
+ {term, -16#3FFFFFFF} = get_term(P),
+ {term, -16#7FFFFFFF} = get_term(P),
+
+ {term, -16#08000000} = get_term(P),
+ {term, -16#10000000} = get_term(P),
+ {term, -16#20000000} = get_term(P),
+ {term, -16#40000000} = get_term(P),
+
+ {term, -16#08000001} = get_term(P),
+ {term, -16#10000001} = get_term(P),
+ {term, -16#20000001} = get_term(P),
+ {term, -16#40000001} = get_term(P),
+
+ {term, -16#08000002} = get_term(P),
+ {term, -16#10000002} = get_term(P),
+ {term, -16#20000002} = get_term(P),
+ {term, -16#40000002} = get_term(P),
+
+ {term, -1999999999} = get_term(P),
+ {term, -2000000000} = get_term(P),
+ {term, -2000000001} = get_term(P),
+
+ runner:recv_eot(P),
ok.
%% Basic test of erl_copy_term().
-basic_copy(suite) -> [];
basic_copy(Config) when is_list(Config) ->
- ?line runner:test(?basic_copy),
+ runner:test(?basic_copy),
ok.
%% This tests the erl_mk_tuple() function.
-t_erl_mk_tuple(suite) -> [];
t_erl_mk_tuple(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_mk_tuple),
+ P = runner:start(?t_erl_mk_tuple),
- ?line {term, {madonna, 21, 'mad donna', 12}} = get_term(P),
- ?line {term, {'Madonna',21,{children,{"Isabella",2}},
- {'home page',"http://www.madonna.com/"}}} = get_term(P),
+ {term, {madonna, 21, 'mad donna', 12}} = get_term(P),
+ {term, {'Madonna',21,{children,{"Isabella",2}},
+ {'home page',"http://www.madonna.com/"}}} = get_term(P),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% This tests the erl_mk_atom() function.
-t_erl_mk_atom(suite) -> [];
t_erl_mk_atom(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_mk_atom),
-
- ?line {term, madonna} = (get_term(P)),
- ?line {term, 'Madonna'} = (get_term(P)),
- ?line {term, 'mad donna'} = (get_term(P)),
- ?line {term, '_madonna_'} = (get_term(P)),
- ?line {term, '/home/madonna/tour_plan'} = (get_term(P)),
- ?line {term, 'http://www.madonna.com/tour_plan'} = (get_term(P)),
- ?line {term, '\'madonna\''} = (get_term(P)),
- ?line {term, '\"madonna\"'} = (get_term(P)),
- ?line {term, '\\madonna\\'} = (get_term(P)),
- ?line {term, '{madonna,21,\'mad donna\',12}'} = (get_term(P)),
-
- ?line runner:recv_eot(P),
+ P = runner:start(?t_erl_mk_atom),
+
+ {term, madonna} = (get_term(P)),
+ {term, 'Madonna'} = (get_term(P)),
+ {term, 'mad donna'} = (get_term(P)),
+ {term, '_madonna_'} = (get_term(P)),
+ {term, '/home/madonna/tour_plan'} = (get_term(P)),
+ {term, 'http://www.madonna.com/tour_plan'} = (get_term(P)),
+ {term, '\'madonna\''} = (get_term(P)),
+ {term, '\"madonna\"'} = (get_term(P)),
+ {term, '\\madonna\\'} = (get_term(P)),
+ {term, '{madonna,21,\'mad donna\',12}'} = (get_term(P)),
+
+ runner:recv_eot(P),
ok.
%% This tests the erl_mk_binary() function.
-t_erl_mk_binary(suite) -> [];
t_erl_mk_binary(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_mk_binary),
+ P = runner:start(?t_erl_mk_binary),
- ?line {term, Bin} = (get_term(P)),
- ?line "{madonna,21,'mad donna',1234.567.890, !#$%&/()=?+-@, \" \\}" =
- binary_to_list(Bin),
+ {term, Bin} = (get_term(P)),
+ "{madonna,21,'mad donna',1234.567.890, !#$%&/()=?+-@, \" \\}" = binary_to_list(Bin),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% This tests the erl_mk_empty_list() function.
-t_erl_mk_empty_list(suite) -> [];
t_erl_mk_empty_list(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_mk_empty_list),
+ P = runner:start(?t_erl_mk_empty_list),
- ?line {term, []} = get_term(P),
+ {term, []} = get_term(P),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% This tests the erl_mk_float() function.
-t_erl_mk_float(suite) -> [];
t_erl_mk_float(Config) when is_list(Config) ->
case os:type() of
- vxworks ->
- {skipped, "Floating point numbers never compare equal on PPC"};
- _ ->
- ?line P = runner:start(?t_erl_mk_float),
- ?line {term, {3.1415, 1.999999, 2.000000, 2.000001,
- 2.000002, 12345.67890}} =
- get_term(P),
- ?line runner:recv_eot(P),
- ok
+ vxworks ->
+ {skipped, "Floating point numbers never compare equal on PPC"};
+ _ ->
+ P = runner:start(?t_erl_mk_float),
+ {term, {3.1415, 1.999999, 2.000000, 2.000001,
+ 2.000002, 12345.67890}} = get_term(P),
+ runner:recv_eot(P),
+ ok
end.
%% This tests the erl_mk_pid() function.
-t_erl_mk_pid(suite) -> [];
t_erl_mk_pid(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_mk_pid),
+ P = runner:start(?t_erl_mk_pid),
- ?line {term, A_pid} = (get_term(P)),
- ?line {pid, kalle@localhost, 3, 2} = nc2vinfo(A_pid),
+ {term, A_pid} = (get_term(P)),
+ {pid, kalle@localhost, 3, 2} = nc2vinfo(A_pid),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
-t_erl_mk_xpid(suite) -> [];
t_erl_mk_xpid(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_mk_xpid),
+ P = runner:start(?t_erl_mk_xpid),
- ?line {term, A_pid} = (get_term(P)),
- ?line {pid, kalle@localhost, 32767, 8191} = nc2vinfo(A_pid),
+ {term, A_pid} = (get_term(P)),
+ {pid, kalle@localhost, 32767, 8191} = nc2vinfo(A_pid),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% This tests the erl_mk_port() function.
-t_erl_mk_port(suite) -> [];
t_erl_mk_port(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_mk_port),
+ P = runner:start(?t_erl_mk_port),
- ?line {term, A_port} = (get_term(P)),
- ?line {port, kalle@localhost, 4} = nc2vinfo(A_port),
+ {term, A_port} = (get_term(P)),
+ {port, kalle@localhost, 4} = nc2vinfo(A_port),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
-t_erl_mk_xport(suite) -> [];
t_erl_mk_xport(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_mk_xport),
+ P = runner:start(?t_erl_mk_xport),
- ?line {term, A_port} = (get_term(P)),
- ?line {port, kalle@localhost, 268435455} = nc2vinfo(A_port),
+ {term, A_port} = (get_term(P)),
+ {port, kalle@localhost, 268435455} = nc2vinfo(A_port),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% This tests the erl_mk_ref() function.
-t_erl_mk_ref(suite) -> [];
t_erl_mk_ref(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_mk_ref),
+ P = runner:start(?t_erl_mk_ref),
- ?line {term, A_ref} = (get_term(P)),
- ?line {ref, kalle@localhost, _Length, [6]} = nc2vinfo(A_ref),
+ {term, A_ref} = (get_term(P)),
+ {ref, kalle@localhost, _Length, [6]} = nc2vinfo(A_ref),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
-t_erl_mk_long_ref(suite) -> [];
t_erl_mk_long_ref(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_mk_long_ref),
+ P = runner:start(?t_erl_mk_long_ref),
- ?line {term, A_ref} = (get_term(P)),
- ?line {ref, kalle@localhost, _Length, [4294967295,4294967295,262143]}
- = nc2vinfo(A_ref),
+ {term, A_ref} = (get_term(P)),
+ {ref, kalle@localhost, _Length, [4294967295,4294967295,262143]}
+ = nc2vinfo(A_ref),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% This tests the erl_mk_string() function.
-t_erl_mk_string(suite) -> [];
t_erl_mk_string(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_mk_string),
-
- ?line {term, "madonna"} = (get_term(P)),
- ?line {term, "Madonna"} = (get_term(P)),
- ?line {term, "mad donna"} = (get_term(P)),
- ?line {term, "_madonna_"} = (get_term(P)),
- ?line {term, "/home/madonna/tour_plan"} = (get_term(P)),
- ?line {term, "http://www.madonna.com/tour_plan"} = (get_term(P)),
- ?line {term, "\'madonna\'"} = (get_term(P)),
- ?line {term, "\"madonna\""} = (get_term(P)),
- ?line {term, "\\madonna\\"} = (get_term(P)),
- ?line {term, "{madonna,21,'mad donna',12}"} = (get_term(P)),
-
- ?line runner:recv_eot(P),
+ P = runner:start(?t_erl_mk_string),
+
+ {term, "madonna"} = (get_term(P)),
+ {term, "Madonna"} = (get_term(P)),
+ {term, "mad donna"} = (get_term(P)),
+ {term, "_madonna_"} = (get_term(P)),
+ {term, "/home/madonna/tour_plan"} = (get_term(P)),
+ {term, "http://www.madonna.com/tour_plan"} = (get_term(P)),
+ {term, "\'madonna\'"} = (get_term(P)),
+ {term, "\"madonna\""} = (get_term(P)),
+ {term, "\\madonna\\"} = (get_term(P)),
+ {term, "{madonna,21,'mad donna',12}"} = (get_term(P)),
+
+ runner:recv_eot(P),
ok.
%% This tests the erl_mk_estring() function.
-t_erl_mk_estring(suite) -> [];
t_erl_mk_estring(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_mk_estring),
-
- ?line {term, "madonna"} = (get_term(P)),
- ?line {term, "Madonna"} = (get_term(P)),
- ?line {term, "mad donna"} = (get_term(P)),
- ?line {term, "_madonna_"} = (get_term(P)),
- ?line {term, "/home/madonna/tour_plan"} = (get_term(P)),
- ?line {term, "http://www.madonna.com/tour_plan"} = (get_term(P)),
- ?line {term, "\'madonna\'"} = (get_term(P)),
- ?line {term, "\"madonna\""} = (get_term(P)),
- ?line {term, "\\madonna\\"} = (get_term(P)),
- ?line {term, "{madonna,21,'mad donna',12}"} = (get_term(P)),
-
- ?line runner:recv_eot(P),
+ P = runner:start(?t_erl_mk_estring),
+
+ {term, "madonna"} = (get_term(P)),
+ {term, "Madonna"} = (get_term(P)),
+ {term, "mad donna"} = (get_term(P)),
+ {term, "_madonna_"} = (get_term(P)),
+ {term, "/home/madonna/tour_plan"} = (get_term(P)),
+ {term, "http://www.madonna.com/tour_plan"} = (get_term(P)),
+ {term, "\'madonna\'"} = (get_term(P)),
+ {term, "\"madonna\""} = (get_term(P)),
+ {term, "\\madonna\\"} = (get_term(P)),
+ {term, "{madonna,21,'mad donna',12}"} = (get_term(P)),
+
+ runner:recv_eot(P),
ok.
%% This tests the erl_mk_uint() function.
-t_erl_mk_uint(suite) -> [];
t_erl_mk_uint(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_mk_uint),
+ P = runner:start(?t_erl_mk_uint),
- ?line {term, 54321} = (get_term(P)),
- ?line {term, 2147483647} = (get_term(P)),
- ?line {term, 2147483648} = (get_term(P)),
- ?line {term, 2147483649} = (get_term(P)),
- ?line {term, 2147483650} = (get_term(P)),
- ?line {term, 4294967295} = (get_term(P)),
+ {term, 54321} = (get_term(P)),
+ {term, 2147483647} = (get_term(P)),
+ {term, 2147483648} = (get_term(P)),
+ {term, 2147483649} = (get_term(P)),
+ {term, 2147483650} = (get_term(P)),
+ {term, 4294967295} = (get_term(P)),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% This tests the erl_mk_var() function.
-t_erl_mk_var(suite) -> [];
t_erl_mk_var(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_mk_var),
+ P = runner:start(?t_erl_mk_var),
- ?line {term, 1} = (get_term(P)),
- ?line {term, 0} = (get_term(P)),
- ?line {term, 1} = (get_term(P)),
- ?line {term, 0} = (get_term(P)),
- ?line {term, 1} = (get_term(P)),
- ?line {term, 0} = (get_term(P)),
- ?line {term, 1} = (get_term(P)),
+ {term, 1} = (get_term(P)),
+ {term, 0} = (get_term(P)),
+ {term, 1} = (get_term(P)),
+ {term, 0} = (get_term(P)),
+ {term, 1} = (get_term(P)),
+ {term, 0} = (get_term(P)),
+ {term, 1} = (get_term(P)),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% This tests the erl_cons() function.
-t_erl_cons(suite) -> [];
t_erl_cons(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_cons),
+ P = runner:start(?t_erl_cons),
- ?line {term, [madonna, 21]} = get_term(P),
+ {term, [madonna, 21]} = get_term(P),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
@@ -531,21 +489,20 @@ t_erl_cons(Config) when is_list(Config) ->
%% Tests the erl_length() function.
-t_erl_length(suite) -> [];
t_erl_length(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_length),
+ P = runner:start(?t_erl_length),
- ?line 0 = erl_length(P, []),
- ?line 1 = erl_length(P, [a]),
- ?line 2 = erl_length(P, [a, b]),
- ?line 3 = erl_length(P, [a, b, c]),
+ 0 = erl_length(P, []),
+ 1 = erl_length(P, [a]),
+ 2 = erl_length(P, [a, b]),
+ 3 = erl_length(P, [a, b, c]),
- ?line 4 = erl_length(P, [a, [x, y], c, []]),
+ 4 = erl_length(P, [a, [x, y], c, []]),
- ?line -1 = erl_length(P, [a|b]),
- ?line -1 = erl_length(P, a),
+ -1 = erl_length(P, [a|b]),
+ -1 = erl_length(P, a),
- ?line runner:finish(P),
+ runner:finish(P),
ok.
%% Invokes the erl_length() function.
@@ -555,22 +512,21 @@ erl_length(Port, List) ->
%% Tests the erl_hd() function.
-t_erl_hd(suite) -> [];
t_erl_hd(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_hd),
-
- ?line 'NULL' = erl_hd(P, 42),
- ?line 'NULL' = erl_hd(P, abc),
- ?line 'NULL' = erl_hd(P, []),
-
- ?line [] = erl_hd(P, [[], a]),
- ?line a = erl_hd(P, [a]),
- ?line a = erl_hd(P, [a, b]),
- ?line a = erl_hd(P, [a, b, c]),
- ?line a = erl_hd(P, [a|b]),
-
- ?line runner:send_eot(P),
- ?line runner:recv_eot(P),
+ P = runner:start(?t_erl_hd),
+
+ 'NULL' = erl_hd(P, 42),
+ 'NULL' = erl_hd(P, abc),
+ 'NULL' = erl_hd(P, []),
+
+ [] = erl_hd(P, [[], a]),
+ a = erl_hd(P, [a]),
+ a = erl_hd(P, [a, b]),
+ a = erl_hd(P, [a, b, c]),
+ a = erl_hd(P, [a|b]),
+
+ runner:send_eot(P),
+ runner:recv_eot(P),
ok.
%% Invokes the erl_hd() function.
@@ -580,22 +536,21 @@ erl_hd(Port, List) ->
%% Tests the erl_tail() function.
-t_erl_tl(suite) -> [];
t_erl_tl(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_tl),
+ P = runner:start(?t_erl_tl),
- ?line 'NULL' = erl_tl(P, 42),
- ?line 'NULL' = erl_tl(P, abc),
- ?line 'NULL' = erl_tl(P, []),
+ 'NULL' = erl_tl(P, 42),
+ 'NULL' = erl_tl(P, abc),
+ 'NULL' = erl_tl(P, []),
- ?line [] = erl_tl(P, [a]),
- ?line [b] = erl_tl(P, [a, b]),
- ?line [b, c] = erl_tl(P, [a, b, c]),
+ [] = erl_tl(P, [a]),
+ [b] = erl_tl(P, [a, b]),
+ [b, c] = erl_tl(P, [a, b, c]),
- ?line b = erl_tl(P, [a|b]),
+ b = erl_tl(P, [a|b]),
- ?line runner:send_eot(P),
- ?line runner:recv_eot(P),
+ runner:send_eot(P),
+ runner:recv_eot(P),
ok.
%% Invokes the erl_tail() function in erl_interface.
@@ -605,68 +560,63 @@ erl_tl(Port, List) ->
%% Tests the type checking macros (done in the C program).
-type_checks(suite) -> [];
type_checks(Config) when is_list(Config) ->
- ?line runner:test(?type_checks),
+ runner:test(?type_checks),
ok.
%% Tests the extractor macros (done in the C program).
-extractor_macros(suite) -> [];
extractor_macros(Config) when is_list(Config) ->
- ?line runner:test(?extractor_macros),
+ runner:test(?extractor_macros),
ok.
%% This tests the erl_size() function.
-t_erl_size(suite) -> [];
t_erl_size(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_size),
+ P = runner:start(?t_erl_size),
- ?line {term, 0} = (get_term(P)),
- ?line {term, 4} = (get_term(P)),
+ {term, 0} = (get_term(P)),
+ {term, 4} = (get_term(P)),
- ?line {term, 0} = (get_term(P)),
- ?line {term, 27} = (get_term(P)),
+ {term, 0} = (get_term(P)),
+ {term, 27} = (get_term(P)),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% This tests the erl_var_content() function.
-t_erl_var_content(suite) -> [];
t_erl_var_content(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_var_content),
+ P = runner:start(?t_erl_var_content),
- ?line {term, 17} = (get_term(P)),
- ?line {term, "http://www.madonna.com"} = (get_term(P)),
- ?line {term, 2} = (get_term(P)),
- ?line {term, "http://www.madonna.com"} = (get_term(P)),
- ?line {term, 2} = (get_term(P)),
+ {term, 17} = (get_term(P)),
+ {term, "http://www.madonna.com"} = (get_term(P)),
+ {term, 2} = (get_term(P)),
+ {term, "http://www.madonna.com"} = (get_term(P)),
+ {term, 2} = (get_term(P)),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
%% This tests the erl_element() function.
-t_erl_element(suite) -> [];
t_erl_element(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_element),
+ P = runner:start(?t_erl_element),
- ?line {term, madonna} = get_term(P),
- ?line {term, 21} = get_term(P),
- ?line {term, 'mad donna'} = get_term(P),
- ?line {term, 12} = get_term(P),
+ {term, madonna} = get_term(P),
+ {term, 21} = get_term(P),
+ {term, 'mad donna'} = get_term(P),
+ {term, 12} = get_term(P),
- ?line {term, 'Madonna'} = get_term(P),
- ?line {term, 21} = get_term(P),
- ?line {term, {children,{"Isabella",2}}} = get_term(P),
- ?line {term, {'home page',"http://www.madonna.com/"}} = get_term(P),
+ {term, 'Madonna'} = get_term(P),
+ {term, 21} = get_term(P),
+ {term, {children,{"Isabella",2}}} = get_term(P),
+ {term, {'home page',"http://www.madonna.com/"}} = get_term(P),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
@@ -679,65 +629,64 @@ t_erl_element(Config) when is_list(Config) ->
%% Tests the erl_iolist_length() function.
-t_erl_iolist_length(suite) -> [];
t_erl_iolist_length(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_iolist_length),
+ P = runner:start(?t_erl_iolist_length),
%% Flat lists.
- ?line 0 = erl_iolist_length(P, []),
- ?line 1 = erl_iolist_length(P, [10]),
- ?line 2 = erl_iolist_length(P, [10, 20]),
- ?line 3 = erl_iolist_length(P, [10, 20, 30]),
- ?line 256 = erl_iolist_length(P, lists:seq(0, 255)),
+ 0 = erl_iolist_length(P, []),
+ 1 = erl_iolist_length(P, [10]),
+ 2 = erl_iolist_length(P, [10, 20]),
+ 3 = erl_iolist_length(P, [10, 20, 30]),
+ 256 = erl_iolist_length(P, lists:seq(0, 255)),
%% Deep lists.
- ?line 0 = erl_iolist_length(P, [[]]),
- ?line 1 = erl_iolist_length(P, [[], 42]),
- ?line 1 = erl_iolist_length(P, [42, []]),
- ?line 2 = erl_iolist_length(P, [42, [], 45]),
+ 0 = erl_iolist_length(P, [[]]),
+ 1 = erl_iolist_length(P, [[], 42]),
+ 1 = erl_iolist_length(P, [42, []]),
+ 2 = erl_iolist_length(P, [42, [], 45]),
- ?line 3 = erl_iolist_length(P, [42, [90], 45]),
- ?line 3 = erl_iolist_length(P, [[42, [90]], 45]),
- ?line 3 = erl_iolist_length(P, [[42, [90]], 45]),
+ 3 = erl_iolist_length(P, [42, [90], 45]),
+ 3 = erl_iolist_length(P, [[42, [90]], 45]),
+ 3 = erl_iolist_length(P, [[42, [90]], 45]),
%% List with binaries.
- ?line 0 = erl_iolist_length(P, [list_to_binary([])]),
- ?line 0 = erl_iolist_length(P, [[], list_to_binary([])]),
- ?line 1 = erl_iolist_length(P, [[1], list_to_binary([])]),
- ?line 1 = erl_iolist_length(P, [[], list_to_binary([2])]),
- ?line 2 = erl_iolist_length(P, [[42], list_to_binary([2])]),
- ?line 4 = erl_iolist_length(P, [[42], list_to_binary([2, 3, 4])]),
+ 0 = erl_iolist_length(P, [list_to_binary([])]),
+ 0 = erl_iolist_length(P, [[], list_to_binary([])]),
+ 1 = erl_iolist_length(P, [[1], list_to_binary([])]),
+ 1 = erl_iolist_length(P, [[], list_to_binary([2])]),
+ 2 = erl_iolist_length(P, [[42], list_to_binary([2])]),
+ 4 = erl_iolist_length(P, [[42], list_to_binary([2, 3, 4])]),
%% Binaries as tail.
- ?line 0 = erl_iolist_length(P, [[]| list_to_binary([])]),
- ?line 1 = erl_iolist_length(P, [[1]| list_to_binary([])]),
- ?line 1 = erl_iolist_length(P, [[]| list_to_binary([2])]),
- ?line 2 = erl_iolist_length(P, [[42]| list_to_binary([2])]),
+ 0 = erl_iolist_length(P, [[]| list_to_binary([])]),
+ 1 = erl_iolist_length(P, [[1]| list_to_binary([])]),
+ 1 = erl_iolist_length(P, [[]| list_to_binary([2])]),
+ 2 = erl_iolist_length(P, [[42]| list_to_binary([2])]),
%% Binaries only.
- ?line 0 = erl_iolist_length(P, list_to_binary("")),
- ?line 1 = erl_iolist_length(P, list_to_binary([1])),
- ?line 2 = erl_iolist_length(P, list_to_binary([1, 2])),
+ 0 = erl_iolist_length(P, list_to_binary("")),
+ 1 = erl_iolist_length(P, list_to_binary([1])),
+ 2 = erl_iolist_length(P, list_to_binary([1, 2])),
%% Illegal cases.
- ?line -1 = erl_iolist_length(P, [42|43]),
- ?line -1 = erl_iolist_length(P, a),
+ -1 = erl_iolist_length(P, [42|43]),
+ -1 = erl_iolist_length(P, a),
- ?line -1 = erl_iolist_length(P, [a]),
- ?line -1 = erl_iolist_length(P, [256]),
- ?line -1 = erl_iolist_length(P, [257]),
- ?line -1 = erl_iolist_length(P, [-1]),
- ?line -1 = erl_iolist_length(P, [-2]),
- ?line -1 = erl_iolist_length(P, [-127]),
- ?line -1 = erl_iolist_length(P, [-128]),
+ -1 = erl_iolist_length(P, [a]),
+ -1 = erl_iolist_length(P, [256]),
+ -1 = erl_iolist_length(P, [257]),
+ -1 = erl_iolist_length(P, [-1]),
+ -1 = erl_iolist_length(P, [-2]),
+ -1 = erl_iolist_length(P, [-127]),
+ -1 = erl_iolist_length(P, [-128]),
- ?line runner:finish(P),
+ runner:finish(P),
ok.
%% Invokes the erl_iolist_length() function.
@@ -747,143 +696,141 @@ erl_iolist_length(Port, List) ->
%% Tests the erl_iolist_to_binary() function.
-t_erl_iolist_to_binary(suite) -> [];
t_erl_iolist_to_binary(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_iolist_to_binary),
+ P = runner:start(?t_erl_iolist_to_binary),
%% Flat lists.
- ?line [] = iolist_to_list(P, []),
- ?line [10] = iolist_to_list(P, [10]),
- ?line [10, 20] = iolist_to_list(P, [10, 20]),
- ?line [10, 20, 30] = iolist_to_list(P, [10, 20, 30]),
- ?line AllBytes = lists:seq(0, 255),
- ?line AllBytes = iolist_to_list(P, AllBytes),
+ [] = iolist_to_list(P, []),
+ [10] = iolist_to_list(P, [10]),
+ [10, 20] = iolist_to_list(P, [10, 20]),
+ [10, 20, 30] = iolist_to_list(P, [10, 20, 30]),
+ AllBytes = lists:seq(0, 255),
+ AllBytes = iolist_to_list(P, AllBytes),
%% Deep lists.
- ?line [] = iolist_to_list(P, [[]]),
- ?line [42] = iolist_to_list(P, [[], 42]),
- ?line [42] = iolist_to_list(P, [42, []]),
- ?line [42, 45] = iolist_to_list(P, [42, [], 45]),
+ [] = iolist_to_list(P, [[]]),
+ [42] = iolist_to_list(P, [[], 42]),
+ [42] = iolist_to_list(P, [42, []]),
+ [42, 45] = iolist_to_list(P, [42, [], 45]),
- ?line [42, 90, 45] = iolist_to_list(P, [42, [90], 45]),
- ?line [42, 90, 45] = iolist_to_list(P, [[42, [90]], 45]),
- ?line [42, 90, 45] = iolist_to_list(P, [[42, [90]], 45]),
+ [42, 90, 45] = iolist_to_list(P, [42, [90], 45]),
+ [42, 90, 45] = iolist_to_list(P, [[42, [90]], 45]),
+ [42, 90, 45] = iolist_to_list(P, [[42, [90]], 45]),
%% List with binaries.
- ?line [] = iolist_to_list(P, [list_to_binary([])]),
- ?line [] = iolist_to_list(P, [[], list_to_binary([])]),
- ?line [1] = iolist_to_list(P, [[1], list_to_binary([])]),
- ?line [2] = iolist_to_list(P, [[], list_to_binary([2])]),
- ?line [42, 2] = iolist_to_list(P, [[42], list_to_binary([2])]),
- ?line [42, 2, 3, 4] = iolist_to_list(P, [[42], list_to_binary([2, 3, 4])]),
+ [] = iolist_to_list(P, [list_to_binary([])]),
+ [] = iolist_to_list(P, [[], list_to_binary([])]),
+ [1] = iolist_to_list(P, [[1], list_to_binary([])]),
+ [2] = iolist_to_list(P, [[], list_to_binary([2])]),
+ [42, 2] = iolist_to_list(P, [[42], list_to_binary([2])]),
+ [42, 2, 3, 4] = iolist_to_list(P, [[42], list_to_binary([2, 3, 4])]),
%% Binaries as tail.
- ?line [] = iolist_to_list(P, [[]| list_to_binary([])]),
- ?line [1] = iolist_to_list(P, [[1]| list_to_binary([])]),
- ?line [2] = iolist_to_list(P, [[]| list_to_binary([2])]),
- ?line [42, 2] = iolist_to_list(P, [[42]| list_to_binary([2])]),
+ [] = iolist_to_list(P, [[]| list_to_binary([])]),
+ [1] = iolist_to_list(P, [[1]| list_to_binary([])]),
+ [2] = iolist_to_list(P, [[]| list_to_binary([2])]),
+ [42, 2] = iolist_to_list(P, [[42]| list_to_binary([2])]),
%% Binaries only.
- ?line [] = iolist_to_list(P, list_to_binary("")),
- ?line [1] = iolist_to_list(P, list_to_binary([1])),
- ?line [1, 2] = iolist_to_list(P, list_to_binary([1, 2])),
+ [] = iolist_to_list(P, list_to_binary("")),
+ [1] = iolist_to_list(P, list_to_binary([1])),
+ [1, 2] = iolist_to_list(P, list_to_binary([1, 2])),
%% Illegal cases.
- ?line 'NULL' = iolist_to_list(P, [42|43]),
- ?line 'NULL' = iolist_to_list(P, a),
+ 'NULL' = iolist_to_list(P, [42|43]),
+ 'NULL' = iolist_to_list(P, a),
- ?line 'NULL' = iolist_to_list(P, [a]),
- ?line 'NULL' = iolist_to_list(P, [256]),
- ?line 'NULL' = iolist_to_list(P, [257]),
- ?line 'NULL' = iolist_to_list(P, [-1]),
- ?line 'NULL' = iolist_to_list(P, [-2]),
- ?line 'NULL' = iolist_to_list(P, [-127]),
- ?line 'NULL' = iolist_to_list(P, [-128]),
+ 'NULL' = iolist_to_list(P, [a]),
+ 'NULL' = iolist_to_list(P, [256]),
+ 'NULL' = iolist_to_list(P, [257]),
+ 'NULL' = iolist_to_list(P, [-1]),
+ 'NULL' = iolist_to_list(P, [-2]),
+ 'NULL' = iolist_to_list(P, [-127]),
+ 'NULL' = iolist_to_list(P, [-128]),
- ?line runner:finish(P),
+ runner:finish(P),
ok.
iolist_to_list(Port, Term) ->
case call_erl_function(Port, Term) of
- 'NULL' ->
- 'NULL';
- Bin when is_binary(Bin) ->
- binary_to_list(Bin)
+ 'NULL' ->
+ 'NULL';
+ Bin when is_binary(Bin) ->
+ binary_to_list(Bin)
end.
%% Tests the erl_iolist_to_string() function.
-t_erl_iolist_to_string(suite) -> [];
t_erl_iolist_to_string(Config) when is_list(Config) ->
- ?line P = runner:start(?t_erl_iolist_to_string),
+ P = runner:start(?t_erl_iolist_to_string),
%% Flat lists.
- ?line [0] = iolist_to_string(P, []),
- ?line [10, 0] = iolist_to_string(P, [10]),
- ?line [10, 20, 0] = iolist_to_string(P, [10, 20]),
- ?line [10, 20, 30, 0] = iolist_to_string(P, [10, 20, 30]),
- ?line AllBytes = lists:seq(1, 255)++[0],
- ?line AllBytes = iolist_to_string(P, lists:seq(1, 255)),
+ [0] = iolist_to_string(P, []),
+ [10, 0] = iolist_to_string(P, [10]),
+ [10, 20, 0] = iolist_to_string(P, [10, 20]),
+ [10, 20, 30, 0] = iolist_to_string(P, [10, 20, 30]),
+ AllBytes = lists:seq(1, 255)++[0],
+ AllBytes = iolist_to_string(P, lists:seq(1, 255)),
%% Deep lists.
- ?line [0] = iolist_to_string(P, [[]]),
- ?line [42, 0] = iolist_to_string(P, [[], 42]),
- ?line [42, 0] = iolist_to_string(P, [42, []]),
- ?line [42, 45, 0] = iolist_to_string(P, [42, [], 45]),
+ [0] = iolist_to_string(P, [[]]),
+ [42, 0] = iolist_to_string(P, [[], 42]),
+ [42, 0] = iolist_to_string(P, [42, []]),
+ [42, 45, 0] = iolist_to_string(P, [42, [], 45]),
- ?line [42, 90, 45, 0] = iolist_to_string(P, [42, [90], 45]),
- ?line [42, 90, 45, 0] = iolist_to_string(P, [[42, [90]], 45]),
- ?line [42, 90, 45, 0] = iolist_to_string(P, [[42, [90]], 45]),
+ [42, 90, 45, 0] = iolist_to_string(P, [42, [90], 45]),
+ [42, 90, 45, 0] = iolist_to_string(P, [[42, [90]], 45]),
+ [42, 90, 45, 0] = iolist_to_string(P, [[42, [90]], 45]),
%% List with binaries.
- ?line [0] = iolist_to_string(P, [list_to_binary([])]),
- ?line [0] = iolist_to_string(P, [[], list_to_binary([])]),
- ?line [1, 0] = iolist_to_string(P, [[1], list_to_binary([])]),
- ?line [2, 0] = iolist_to_string(P, [[], list_to_binary([2])]),
- ?line [42, 2, 0] = iolist_to_string(P, [[42], list_to_binary([2])]),
- ?line [42, 2, 3, 4, 0] = iolist_to_string(P, [[42],
- list_to_binary([2, 3, 4])]),
+ [0] = iolist_to_string(P, [list_to_binary([])]),
+ [0] = iolist_to_string(P, [[], list_to_binary([])]),
+ [1, 0] = iolist_to_string(P, [[1], list_to_binary([])]),
+ [2, 0] = iolist_to_string(P, [[], list_to_binary([2])]),
+ [42, 2, 0] = iolist_to_string(P, [[42], list_to_binary([2])]),
+ [42, 2, 3, 4, 0] = iolist_to_string(P, [[42],
+ list_to_binary([2, 3, 4])]),
%% Binaries as tail.
- ?line [0] = iolist_to_string(P, [[]| list_to_binary([])]),
- ?line [1, 0] = iolist_to_string(P, [[1]| list_to_binary([])]),
- ?line [2, 0] = iolist_to_string(P, [[]| list_to_binary([2])]),
- ?line [42, 2, 0] = iolist_to_string(P, [[42]| list_to_binary([2])]),
+ [0] = iolist_to_string(P, [[]| list_to_binary([])]),
+ [1, 0] = iolist_to_string(P, [[1]| list_to_binary([])]),
+ [2, 0] = iolist_to_string(P, [[]| list_to_binary([2])]),
+ [42, 2, 0] = iolist_to_string(P, [[42]| list_to_binary([2])]),
%% Binaries only.
- ?line [0] = iolist_to_string(P, list_to_binary("")),
- ?line [1, 0] = iolist_to_string(P, list_to_binary([1])),
- ?line [1, 2, 0] = iolist_to_string(P, list_to_binary([1, 2])),
+ [0] = iolist_to_string(P, list_to_binary("")),
+ [1, 0] = iolist_to_string(P, list_to_binary([1])),
+ [1, 2, 0] = iolist_to_string(P, list_to_binary([1, 2])),
%% Illegal cases.
- ?line 'NULL' = iolist_to_string(P, [0]),
- ?line 'NULL' = iolist_to_string(P, [65, 0, 66]),
- ?line 'NULL' = iolist_to_string(P, [65, 66, 67, 0]),
+ 'NULL' = iolist_to_string(P, [0]),
+ 'NULL' = iolist_to_string(P, [65, 0, 66]),
+ 'NULL' = iolist_to_string(P, [65, 66, 67, 0]),
- ?line 'NULL' = iolist_to_string(P, [42|43]),
- ?line 'NULL' = iolist_to_string(P, a),
+ 'NULL' = iolist_to_string(P, [42|43]),
+ 'NULL' = iolist_to_string(P, a),
- ?line 'NULL' = iolist_to_string(P, [a]),
- ?line 'NULL' = iolist_to_string(P, [256]),
- ?line 'NULL' = iolist_to_string(P, [257]),
- ?line 'NULL' = iolist_to_string(P, [-1]),
- ?line 'NULL' = iolist_to_string(P, [-2]),
- ?line 'NULL' = iolist_to_string(P, [-127]),
- ?line 'NULL' = iolist_to_string(P, [-128]),
+ 'NULL' = iolist_to_string(P, [a]),
+ 'NULL' = iolist_to_string(P, [256]),
+ 'NULL' = iolist_to_string(P, [257]),
+ 'NULL' = iolist_to_string(P, [-1]),
+ 'NULL' = iolist_to_string(P, [-2]),
+ 'NULL' = iolist_to_string(P, [-127]),
+ 'NULL' = iolist_to_string(P, [-128]),
- ?line runner:finish(P),
+ runner:finish(P),
ok.
%% Invokes the erl_iolist_to_string() function.
@@ -891,8 +838,8 @@ t_erl_iolist_to_string(Config) when is_list(Config) ->
iolist_to_string(Port, Term) ->
runner:send_term(Port, Term),
case get_term(Port) of
- {bytes, Result} -> Result;
- 'NULL' -> 'NULL'
+ {bytes, Result} -> Result;
+ 'NULL' -> 'NULL'
end.
@@ -902,38 +849,37 @@ iolist_to_string(Port, Term) ->
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-erl_print_term(suite) -> [];
-erl_print_term(doc) -> "Tests the erl_print_term() function";
+%% Tests the erl_print_term() function
erl_print_term(Config) when is_list(Config) ->
- ?line PrintTerm = print_term(Config),
- ?line P = open_port({spawn, PrintTerm}, [stream]),
+ PrintTerm = print_term(Config),
+ P = open_port({spawn, PrintTerm}, [stream]),
%% Lists.
- ?line print(P, "[]", []),
- ?line print(P, "[a]", [a]),
- ?line print(P, "[[a]]", [[a]]),
- ?line print(P, "[[]]", [[]]),
- ?line print(P, "[a,b,c]", [a,b,c]),
- ?line print(P, "[a,b|c]", [a,b|c]),
- ?line print(P, "[a,[],c]", [a,[],c]),
- ?line print(P, "[a,[1000,1],c]", [a,[1000,1],c]),
+ print(P, "[]", []),
+ print(P, "[a]", [a]),
+ print(P, "[[a]]", [[a]]),
+ print(P, "[[]]", [[]]),
+ print(P, "[a,b,c]", [a,b,c]),
+ print(P, "[a,b|c]", [a,b|c]),
+ print(P, "[a,[],c]", [a,[],c]),
+ print(P, "[a,[1000,1],c]", [a,[1000,1],c]),
%% Tuples.
- ?line print(P, "{}", {}),
- ?line print(P, "{ok}", {ok}),
- ?line print(P, "{1,2,3}", {1, 2, 3}),
+ print(P, "{}", {}),
+ print(P, "{ok}", {ok}),
+ print(P, "{1,2,3}", {1, 2, 3}),
%% Pids.
- ?line {_X, Y, Z} = split_pid(self()),
- ?line PidString = lists:flatten(io_lib:format("<~s.~w.~w>",
- [node(), Y, Z])),
- ?line print(P, PidString, self()),
+ {_X, Y, Z} = split_pid(self()),
+ PidString = lists:flatten(io_lib:format("<~s.~w.~w>",
+ [node(), Y, Z])),
+ print(P, PidString, self()),
- ?line unlink(P),
- ?line exit(P, die),
+ unlink(P),
+ exit(P, die),
ok.
split_pid(Pid) when is_pid(Pid) ->
@@ -948,23 +894,22 @@ split_pid([$.|Rest], Cur, Result) ->
split_pid([$>], Cur, Result) ->
list_to_tuple(Result++[Cur]).
-print_string(suite) -> [];
-print_string(doc) -> "Test printing a string with erl_print_term()";
+%% Test printing a string with erl_print_term()
print_string(Config) when is_list(Config) ->
- ?line PrintTerm = print_term(Config),
- ?line P = open_port({spawn, PrintTerm}, [stream]),
+ PrintTerm = print_term(Config),
+ P = open_port({spawn, PrintTerm}, [stream]),
%% Strings.
- ?line print(P, "\"ABC\"", "ABC"),
- ?line {11, "\"\\tABC\\r\\n\""} = print(P, "\tABC\r\n"),
+ print(P, "\"ABC\"", "ABC"),
+ {11, "\"\\tABC\\r\\n\""} = print(P, "\tABC\r\n"),
%% Not strings.
- ?line print(P, "[65,66,67,0]", "ABC\000"),
+ print(P, "[65,66,67,0]", "ABC\000"),
- ?line unlink(P),
- ?line exit(P, die),
+ unlink(P),
+ exit(P, die),
ok.
print(Port, TermString, Term) ->
@@ -983,15 +928,15 @@ print(Port, Term) ->
collect_line(Port, Result) ->
receive
- {Port, {data, Data}} ->
- case lists:reverse(Data) of
- [$\n|Rest] ->
- collect_line1(Rest++Result, []);
- Chars ->
- collect_line(Port, Chars++Result)
- end
- after test_server:seconds(5) ->
- test_server:fail("No response from C program")
+ {Port, {data, Data}} ->
+ case lists:reverse(Data) of
+ [$\n|Rest] ->
+ collect_line1(Rest++Result, []);
+ Chars ->
+ collect_line(Port, Chars++Result)
+ end
+ after 5000 ->
+ ct:fail("No response from C program")
end.
collect_line1([$\r|Rest], Result) ->
@@ -1001,18 +946,16 @@ collect_line1([C|Rest], Result) ->
%% Test case submitted by Per Lundgren, ERV.
-high_chaparal(suite) -> [];
high_chaparal(Config) when is_list(Config) ->
- ?line P = runner:start(?high_chaparal),
- ?line {term, [hello, world]} = get_term(P),
- ?line runner:recv_eot(P),
+ P = runner:start(?high_chaparal),
+ {term, [hello, world]} = get_term(P),
+ runner:recv_eot(P),
ok.
%% OTP-7448
-broken_data(suite) -> [];
broken_data(Config) when is_list(Config) ->
- ?line P = runner:start(?broken_data),
- ?line runner:recv_eot(P),
+ P = runner:start(?broken_data),
+ runner:recv_eot(P),
ok.
%% This calls a C function with one parameter and returns the result.
@@ -1020,12 +963,12 @@ broken_data(Config) when is_list(Config) ->
call_erl_function(Port, Term) ->
runner:send_term(Port, Term),
case get_term(Port) of
- {term, Result} -> Result;
- 'NULL' -> 'NULL'
+ {term, Result} -> Result;
+ 'NULL' -> 'NULL'
end.
print_term(Config) when is_list(Config) ->
- filename:join(?config(data_dir, Config), "print_term").
+ filename:join(proplists:get_value(data_dir, Config), "print_term").
@@ -1034,57 +977,57 @@ print_term(Config) when is_list(Config) ->
%%% back, without having been mutated into short form. We must take
%%% care then to check the actual returned ref, and not the original
%%% one, which is equal to it.
-cnode_1(suite) -> [];
-cnode_1(doc) -> "Tests involving cnode: sends a long ref from a cnode to us";
+
+%% Tests involving cnode: sends a long ref from a cnode to us
cnode_1(Config) when is_list(Config) ->
- ?line Cnode = filename:join(?config(data_dir, Config), "cnode"),
- ?line register(mip, self()),
- ?line spawn_link(?MODULE, start_cnode, [Cnode]),
- ?line Ref1 = get_ref(),
+ Cnode = filename:join(proplists:get_value(data_dir, Config), "cnode"),
+ register(mip, self()),
+ spawn_link(?MODULE, start_cnode, [Cnode]),
+ Ref1 = get_ref(),
io:format("Ref1 ~p~n", [Ref1]),
- ?line check_ref(Ref1),
- ?line Ref2 = make_ref(),
- ?line receive
- Pid -> Pid
- end,
- ?line Fun1 = fun(X) -> {Pid, X} end, % sneak in a fun test here
- %?line Fun1 = {wait_with_funs, new_dist_format},
- ?line Term = {Ref2, Fun1, {1,2,3,4,5,6,7,8,9,10}},
+ check_ref(Ref1),
+ Ref2 = make_ref(),
+ Pid = receive
+ Msg -> Msg %% pid
+ end,
+ Fun1 = fun(X) -> {Pid, X} end, % sneak in a fun test here
+ %Fun1 = {wait_with_funs, new_dist_format},
+ Term = {Ref2, Fun1, {1,2,3,4,5,6,7,8,9,10}},
%% A term which will overflow the original buffer used in 'cnode'.
- ?line Pid ! Term,
- ?line receive
- Term2 ->
- io:format("received ~p~n", [Term2]),
- case Term2 of
- Term ->
- {Ref22,_,_} = Term2,
- ?line check_ref(Ref22);
- X ->
- test_server:fail({receive1,X})
- end
- after 5000 ->
- test_server:fail(receive1)
- end,
- ?line receive
- Pid ->
- ok;
- Y ->
- test_server:fail({receive1,Y})
- after 5000 ->
- test_server:fail(receive2)
- end,
- ?line io:format("ref = ~p~n", [Ref1]),
- ?line check_ref(Ref1),
+ Pid ! Term,
+ receive
+ Term2 ->
+ io:format("received ~p~n", [Term2]),
+ case Term2 of
+ Term ->
+ {Ref22,_,_} = Term2,
+ check_ref(Ref22);
+ X ->
+ ct:fail({receive1,X})
+ end
+ after 5000 ->
+ ct:fail(receive1)
+ end,
+ receive
+ Pid ->
+ ok;
+ Y ->
+ ct:fail({receive1,Y})
+ after 5000 ->
+ ct:fail(receive2)
+ end,
+ io:format("ref = ~p~n", [Ref1]),
+ check_ref(Ref1),
ok.
check_ref(Ref) ->
case bin_ext_type(Ref) of
- 101 ->
- test_server:fail(oldref);
- 114 ->
- ok;
- Type ->
- test_server:fail({type, Type})
+ 101 ->
+ ct:fail(oldref);
+ 114 ->
+ ok;
+ Type ->
+ ct:fail({type, Type})
end.
bin_ext_type(T) ->
@@ -1093,10 +1036,10 @@ bin_ext_type(T) ->
get_ref() ->
receive
- X when is_reference(X) ->
- X
+ X when is_reference(X) ->
+ X
after 5000 ->
- test_server:fail({cnode, timeout})
+ ct:fail({cnode, timeout})
end.
start_cnode(Cnode) ->
@@ -1105,35 +1048,33 @@ start_cnode(Cnode) ->
rec_cnode() ->
receive
- X ->
- io:format("from cnode: ~p~n", [X]),
- rec_cnode()
+ X ->
+ io:format("from cnode: ~p~n", [X]),
+ rec_cnode()
end.
nc2vinfo(Pid) when is_pid(Pid) ->
- ?line [_NodeStr, NumberStr, SerialStr]
- = string:tokens(pid_to_list(Pid), "<.>"),
- ?line Number = list_to_integer(NumberStr),
- ?line Serial = list_to_integer(SerialStr),
- ?line {pid, node(Pid), Number, Serial};
+ [_NodeStr, NumberStr, SerialStr]
+ = string:tokens(pid_to_list(Pid), "<.>"),
+ Number = list_to_integer(NumberStr),
+ Serial = list_to_integer(SerialStr),
+ {pid, node(Pid), Number, Serial};
nc2vinfo(Port) when is_port(Port) ->
- ?line ["#Port", _NodeStr, NumberStr]
- = string:tokens(erlang:port_to_list(Port), "<.>"),
- ?line Number = list_to_integer(NumberStr),
- ?line {port, node(Port), Number};
+ ["#Port", _NodeStr, NumberStr]
+ = string:tokens(erlang:port_to_list(Port), "<.>"),
+ Number = list_to_integer(NumberStr),
+ {port, node(Port), Number};
nc2vinfo(Ref) when is_reference(Ref) ->
- ?line ["#Ref", _NodeStr | NumStrList]
- = string:tokens(erlang:ref_to_list(Ref), "<.>"),
- ?line {Len, RevNumList} = lists:foldl(fun ("0", {N, []}) ->
- {N+1, []};
- (IStr, {N, Is}) ->
- {N+1,
- [list_to_integer(IStr)|Is]}
- end,
- {0, []},
- NumStrList),
- ?line {ref, node(Ref), Len, lists:reverse(RevNumList)};
+ ["#Ref", _NodeStr | NumStrList]
+ = string:tokens(erlang:ref_to_list(Ref), "<.>"),
+ {Len, RevNumList} = lists:foldl(fun ("0", {N, []}) ->
+ {N+1, []};
+ (IStr, {N, Is}) ->
+ {N+1,
+ [list_to_integer(IStr)|Is]}
+ end,
+ {0, []},
+ NumStrList),
+ {ref, node(Ref), Len, lists:reverse(RevNumList)};
nc2vinfo(Other) ->
- ?line {badarg, Other}.
-
-
+ {badarg, Other}.
diff --git a/lib/erl_interface/test/erl_eterm_SUITE_data/Makefile.first b/lib/erl_interface/test/erl_eterm_SUITE_data/Makefile.first
index 4a8664429e..0ea872ef49 100644
--- a/lib/erl_interface/test/erl_eterm_SUITE_data/Makefile.first
+++ b/lib/erl_interface/test/erl_eterm_SUITE_data/Makefile.first
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2009. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_eterm_SUITE_data/Makefile.src b/lib/erl_interface/test/erl_eterm_SUITE_data/Makefile.src
index 31584ff686..4b1ddf77b6 100644
--- a/lib/erl_interface/test/erl_eterm_SUITE_data/Makefile.src
+++ b/lib/erl_interface/test/erl_eterm_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_eterm_SUITE_data/cnode.c b/lib/erl_interface/test/erl_eterm_SUITE_data/cnode.c
index df40a4414e..bead0f8413 100644
--- a/lib/erl_interface/test/erl_eterm_SUITE_data/cnode.c
+++ b/lib/erl_interface/test/erl_eterm_SUITE_data/cnode.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
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 0a2ecf9dcc..687a45bbab 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
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2010. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_eterm_SUITE_data/print_term.c b/lib/erl_interface/test/erl_eterm_SUITE_data/print_term.c
index e474e8f7ab..5b7cb1aec8 100644
--- a/lib/erl_interface/test/erl_eterm_SUITE_data/print_term.c
+++ b/lib/erl_interface/test/erl_eterm_SUITE_data/print_term.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_ext_SUITE.erl b/lib/erl_interface/test/erl_ext_SUITE.erl
index cbc93b4cfb..afaba1fd93 100644
--- a/lib/erl_interface/test/erl_ext_SUITE.erl
+++ b/lib/erl_interface/test/erl_ext_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,74 +24,44 @@
-include_lib("common_test/include/ct.hrl").
-include("erl_ext_SUITE_data/ext_test_cases.hrl").
--export([
- all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- compare_tuple/1,
- compare_list/1,
- compare_string/1,
- compare_list_string/1,
- compare_nc_ext/1
- ]).
+-export([all/0, suite/0,
+ compare_tuple/1,
+ compare_list/1,
+ compare_string/1,
+ compare_list_string/1,
+ compare_nc_ext/1]).
-import(runner, [get_term/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]}].
all() ->
[compare_tuple, compare_list, compare_string,
compare_list_string, compare_nc_ext].
-groups() ->
- [].
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
-compare_tuple(suite) -> [];
-compare_tuple(doc) -> [];
compare_tuple(Config) when is_list(Config) ->
- ?line P = runner:start(?compare_tuple),
- ?line runner:recv_eot(P),
+ P = runner:start(?compare_tuple),
+ runner:recv_eot(P),
ok.
-compare_list(suite) -> [];
-compare_list(doc) -> [];
compare_list(Config) when is_list(Config) ->
- ?line P = runner:start(?compare_list),
- ?line runner:recv_eot(P),
+ P = runner:start(?compare_list),
+ runner:recv_eot(P),
ok.
-compare_string(suite) -> [];
-compare_string(doc) -> [];
compare_string(Config) when is_list(Config) ->
- ?line P = runner:start(?compare_string),
- ?line runner:recv_eot(P),
+ P = runner:start(?compare_string),
+ runner:recv_eot(P),
ok.
-compare_list_string(suite) -> [];
-compare_list_string(doc) -> [];
compare_list_string(Config) when is_list(Config) ->
- ?line P = runner:start(?compare_list_string),
- ?line runner:recv_eot(P),
+ P = runner:start(?compare_list_string),
+ runner:recv_eot(P),
ok.
-compare_nc_ext(suite) -> [];
-compare_nc_ext(doc) -> [];
compare_nc_ext(Config) when is_list(Config) ->
- ?line P = runner:start(?compare_nc_ext),
- ?line runner:recv_eot(P),
+ P = runner:start(?compare_nc_ext),
+ runner:recv_eot(P),
ok.
-
-
-
diff --git a/lib/erl_interface/test/erl_ext_SUITE_data/Makefile.first b/lib/erl_interface/test/erl_ext_SUITE_data/Makefile.first
index ddff1ba13f..9ca8f7f8a3 100644
--- a/lib/erl_interface/test/erl_ext_SUITE_data/Makefile.first
+++ b/lib/erl_interface/test/erl_ext_SUITE_data/Makefile.first
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2009. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_ext_SUITE_data/Makefile.src b/lib/erl_interface/test/erl_ext_SUITE_data/Makefile.src
index 6f3fdec8a4..fe8caebbd6 100644
--- a/lib/erl_interface/test/erl_ext_SUITE_data/Makefile.src
+++ b/lib/erl_interface/test/erl_ext_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2009. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_ext_SUITE_data/ext_test.c b/lib/erl_interface/test/erl_ext_SUITE_data/ext_test.c
index 65d5f0d2e0..36cf086ed2 100644
--- a/lib/erl_interface/test/erl_ext_SUITE_data/ext_test.c
+++ b/lib/erl_interface/test/erl_ext_SUITE_data/ext_test.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_format_SUITE.erl b/lib/erl_interface/test/erl_format_SUITE.erl
index afbbe6a241..c1a7d8377e 100644
--- a/lib/erl_interface/test/erl_format_SUITE.erl
+++ b/lib/erl_interface/test/erl_format_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,134 +24,108 @@
-include_lib("common_test/include/ct.hrl").
-include("erl_format_SUITE_data/format_test_cases.hrl").
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2, atoms/1, tuples/1, lists/1]).
+-export([all/0, suite/0,
+ atoms/1, tuples/1, lists/1]).
-import(runner, [get_term/1]).
%% This test suite test the erl_format() function.
%% It uses the port program "format_test".
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]}].
all() ->
[atoms, tuples, lists].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
%% Tests formatting various atoms.
-atoms(suite) -> [];
atoms(Config) when is_list(Config) ->
- ?line P = runner:start(?atoms),
-
- ?line {term, ''} = get_term(P),
- ?line {term, 'a'} = get_term(P),
- ?line {term, 'A'} = get_term(P),
- ?line {term, 'abc'} = get_term(P),
- ?line {term, 'Abc'} = get_term(P),
- ?line {term, 'ab@c'} = get_term(P),
- ?line {term, 'The rain in Spain stays mainly in the plains'} =
- get_term(P),
-
- ?line {term, a} = get_term(P),
- ?line {term, ab} = get_term(P),
- ?line {term, abc} = get_term(P),
- ?line {term, ab@c} = get_term(P),
- ?line {term, abcdefghijklmnopq} = get_term(P),
-
- ?line {term, ''} = get_term(P),
- ?line {term, 'a'} = get_term(P),
- ?line {term, 'A'} = get_term(P),
- ?line {term, 'abc'} = get_term(P),
- ?line {term, 'Abc'} = get_term(P),
- ?line {term, 'ab@c'} = get_term(P),
- ?line {term, 'The rain in Spain stays mainly in the plains'} =
- get_term(P),
-
- ?line {term, a} = get_term(P),
- ?line {term, ab} = get_term(P),
- ?line {term, abc} = get_term(P),
- ?line {term, ab@c} = get_term(P),
- ?line {term, ' abcdefghijklmnopq '} = get_term(P),
-
- ?line runner:recv_eot(P),
+ P = runner:start(?atoms),
+
+ {term, ''} = get_term(P),
+ {term, 'a'} = get_term(P),
+ {term, 'A'} = get_term(P),
+ {term, 'abc'} = get_term(P),
+ {term, 'Abc'} = get_term(P),
+ {term, 'ab@c'} = get_term(P),
+ {term, 'The rain in Spain stays mainly in the plains'} = get_term(P),
+
+ {term, a} = get_term(P),
+ {term, ab} = get_term(P),
+ {term, abc} = get_term(P),
+ {term, ab@c} = get_term(P),
+ {term, abcdefghijklmnopq} = get_term(P),
+
+ {term, ''} = get_term(P),
+ {term, 'a'} = get_term(P),
+ {term, 'A'} = get_term(P),
+ {term, 'abc'} = get_term(P),
+ {term, 'Abc'} = get_term(P),
+ {term, 'ab@c'} = get_term(P),
+ {term, 'The rain in Spain stays mainly in the plains'} = get_term(P),
+
+ {term, a} = get_term(P),
+ {term, ab} = get_term(P),
+ {term, abc} = get_term(P),
+ {term, ab@c} = get_term(P),
+ {term, ' abcdefghijklmnopq '} = get_term(P),
+
+ runner:recv_eot(P),
ok.
%% Tests formatting various tuples
-tuples(suite) -> [];
tuples(Config) when is_list(Config) ->
- ?line P = runner:start(?tuples),
-
- ?line {term, {}} = get_term(P),
- ?line {term, {a}} = get_term(P),
- ?line {term, {a, b}} = get_term(P),
- ?line {term, {a, b, c}} = get_term(P),
- ?line {term, {1}} = get_term(P),
- ?line {term, {[]}} = get_term(P),
- ?line {term, {[], []}} = get_term(P),
- ?line {term, {[], a, b, c}} = get_term(P),
- ?line {term, {[], a, [], b, c}} = get_term(P),
- ?line {term, {[], a, '', b, c}} = get_term(P),
-
- ?line runner:recv_eot(P),
+ P = runner:start(?tuples),
+
+ {term, {}} = get_term(P),
+ {term, {a}} = get_term(P),
+ {term, {a, b}} = get_term(P),
+ {term, {a, b, c}} = get_term(P),
+ {term, {1}} = get_term(P),
+ {term, {[]}} = get_term(P),
+ {term, {[], []}} = get_term(P),
+ {term, {[], a, b, c}} = get_term(P),
+ {term, {[], a, [], b, c}} = get_term(P),
+ {term, {[], a, '', b, c}} = get_term(P),
+
+ runner:recv_eot(P),
ok.
%% Tests formatting various lists
-lists(suite) -> [];
lists(Config) when is_list(Config) ->
- ?line P = runner:start(?lists),
-
- ?line {term, []} = get_term(P),
- ?line {term, [a]} = get_term(P),
- ?line {term, [a, b]} = get_term(P),
- ?line {term, [a, b, c]} = get_term(P),
- ?line {term, [1]} = get_term(P),
- ?line {term, [[]]} = get_term(P),
- ?line {term, [[], []]} = get_term(P),
- ?line {term, [[], a, b, c]} = get_term(P),
- ?line {term, [[], a, [], b, c]} = get_term(P),
- ?line {term, [[], a, '', b, c]} = get_term(P),
-
- ?line {term, [{name, 'Madonna'}, {age, 21}, {data, [{addr, "E-street", 42}]}]} =
- get_term(P),
+ P = runner:start(?lists),
+
+ {term, []} = get_term(P),
+ {term, [a]} = get_term(P),
+ {term, [a, b]} = get_term(P),
+ {term, [a, b, c]} = get_term(P),
+ {term, [1]} = get_term(P),
+ {term, [[]]} = get_term(P),
+ {term, [[], []]} = get_term(P),
+ {term, [[], a, b, c]} = get_term(P),
+ {term, [[], a, [], b, c]} = get_term(P),
+ {term, [[], a, '', b, c]} = get_term(P),
+
+ {term, [{name, 'Madonna'}, {age, 21}, {data, [{addr, "E-street", 42}]}]} = get_term(P),
case os:type() of
- vxworks ->
- ?line {term, [{pi, _}, {'cos(70)', _}]} = get_term(P),
- ?line {term, [[pi, _], ['cos(70)', _]]} = get_term(P),
- ?line {term, [[pi, _], [], ["cos(70)", _]]} =
- get_term(P);
- _ ->
- ?line {term, [{pi, 3.1415}, {'cos(70)', 0.34202}]} = get_term(P),
- ?line {term, [[pi, 3.1415], ['cos(70)', 0.34202]]} = get_term(P),
- ?line {term, [[pi, 3.1415], [], ["cos(70)", 0.34202]]} =
- get_term(P)
+ vxworks ->
+ {term, [{pi, _}, {'cos(70)', _}]} = get_term(P),
+ {term, [[pi, _], ['cos(70)', _]]} = get_term(P),
+ {term, [[pi, _], [], ["cos(70)", _]]} = get_term(P);
+ _ ->
+ {term, [{pi, 3.1415}, {'cos(70)', 0.34202}]} = get_term(P),
+ {term, [[pi, 3.1415], ['cos(70)', 0.34202]]} = get_term(P),
+ {term, [[pi, 3.1415], [], ["cos(70)", 0.34202]]} = get_term(P)
end,
- ?line {term, [-1]} = get_term(P),
+ {term, [-1]} = get_term(P),
- ?line runner:recv_eot(P),
+ runner:recv_eot(P),
ok.
-
-
-
diff --git a/lib/erl_interface/test/erl_format_SUITE_data/Makefile.first b/lib/erl_interface/test/erl_format_SUITE_data/Makefile.first
index 9fc4e742bd..acbb8c98bb 100644
--- a/lib/erl_interface/test/erl_format_SUITE_data/Makefile.first
+++ b/lib/erl_interface/test/erl_format_SUITE_data/Makefile.first
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2009. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_format_SUITE_data/Makefile.src b/lib/erl_interface/test/erl_format_SUITE_data/Makefile.src
index 4f5f780f31..2ba59ab651 100644
--- a/lib/erl_interface/test/erl_format_SUITE_data/Makefile.src
+++ b/lib/erl_interface/test/erl_format_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_format_SUITE_data/format_test.c b/lib/erl_interface/test/erl_format_SUITE_data/format_test.c
index 179327ede0..258ae92e0f 100644
--- a/lib/erl_interface/test/erl_format_SUITE_data/format_test.c
+++ b/lib/erl_interface/test/erl_format_SUITE_data/format_test.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_global_SUITE.erl b/lib/erl_interface/test/erl_global_SUITE.erl
index 493ad576c9..ecc6753c7f 100644
--- a/lib/erl_interface/test/erl_global_SUITE.erl
+++ b/lib/erl_interface/test/erl_global_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,9 +24,9 @@
-include_lib("common_test/include/ct.hrl").
-include("erl_global_SUITE_data/erl_global_test_cases.hrl").
--export([all/0,suite/0,init_per_suite/1,end_per_suite/1,
- init_per_testcase/2,end_per_testcase/2,
- erl_global_registration/1, erl_global_whereis/1, erl_global_names/1]).
+-export([all/0,suite/0,
+ erl_global_registration/1,
+ erl_global_whereis/1, erl_global_names/1]).
-import(runner, [get_term/1,send_term/2]).
@@ -35,62 +35,50 @@
all() ->
[erl_global_registration, erl_global_whereis, erl_global_names].
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {seconds, 30}}].
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?t:minutes(0.25)),
- [{watchdog, Dog}|Config].
-
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
- ok.
erl_global_registration(Config) when is_list(Config) ->
- ?line P = runner:start(?interpret),
- ?line {ok, Fd} = erl_connect(P, node(), 42, erlang:get_cookie(), 0),
+ P = runner:start(?interpret),
+ {ok, Fd} = erl_connect(P, node(), 42, erlang:get_cookie(), 0),
- ?line ok = erl_global_register(P, Fd, ?GLOBAL_NAME),
- ?line ok = erl_global_unregister(P, Fd, ?GLOBAL_NAME),
+ ok = erl_global_register(P, Fd, ?GLOBAL_NAME),
+ ok = erl_global_unregister(P, Fd, ?GLOBAL_NAME),
- ?line 0 = erl_close_connection(P,Fd),
- ?line runner:send_eot(P),
- ?line runner:recv_eot(P),
+ 0 = erl_close_connection(P,Fd),
+ runner:send_eot(P),
+ runner:recv_eot(P),
ok.
erl_global_whereis(Config) when is_list(Config) ->
- ?line P = runner:start(?interpret),
- ?line {ok, Fd} = erl_connect(P, node(), 42, erlang:get_cookie(), 0),
-
- ?line Self = self(),
- ?line yes = global:register_name(?GLOBAL_NAME, Self),
- ?line Self = erl_global_whereis(P, Fd, ?GLOBAL_NAME),
- ?line global:unregister_name(?GLOBAL_NAME),
- ?line 0 = erl_close_connection(P, Fd),
- ?line runner:send_eot(P),
- ?line runner:recv_eot(P),
+ P = runner:start(?interpret),
+ {ok, Fd} = erl_connect(P, node(), 42, erlang:get_cookie(), 0),
+
+ Self = self(),
+ yes = global:register_name(?GLOBAL_NAME, Self),
+ Self = erl_global_whereis(P, Fd, ?GLOBAL_NAME),
+ global:unregister_name(?GLOBAL_NAME),
+ 0 = erl_close_connection(P, Fd),
+ runner:send_eot(P),
+ runner:recv_eot(P),
ok.
erl_global_names(Config) when is_list(Config) ->
- ?line P = runner:start(?interpret),
- ?line {ok, Fd} = erl_connect(P, node(), 42, erlang:get_cookie(), 0),
-
- ?line Self = self(),
- ?line global:register_name(?GLOBAL_NAME, Self),
- ?line {Names1, _N1} = erl_global_names(P, Fd),
- ?line true = lists:member(atom_to_list(?GLOBAL_NAME), Names1),
- ?line global:unregister_name(?GLOBAL_NAME),
- ?line {Names2, _N2} = erl_global_names(P, Fd),
- ?line false = lists:member(atom_to_list(?GLOBAL_NAME), Names2),
- ?line 0 = erl_close_connection(P, Fd),
- ?line runner:send_eot(P),
- ?line runner:recv_eot(P),
+ P = runner:start(?interpret),
+ {ok, Fd} = erl_connect(P, node(), 42, erlang:get_cookie(), 0),
+
+ Self = self(),
+ global:register_name(?GLOBAL_NAME, Self),
+ {Names1, _N1} = erl_global_names(P, Fd),
+ true = lists:member(atom_to_list(?GLOBAL_NAME), Names1),
+ global:unregister_name(?GLOBAL_NAME),
+ {Names2, _N2} = erl_global_names(P, Fd),
+ false = lists:member(atom_to_list(?GLOBAL_NAME), Names2),
+ 0 = erl_close_connection(P, Fd),
+ runner:send_eot(P),
+ runner:recv_eot(P),
ok.
%%% Interface functions for erl_interface functions.
@@ -98,14 +86,14 @@ erl_global_names(Config) when is_list(Config) ->
erl_connect(P, Node, Num, Cookie, Creation) ->
send_command(P, erl_connect, [Num, Node, Cookie, Creation]),
case get_term(P) of
- {term,{Fd,_}} when Fd >= 0 -> {ok,Fd};
- {term,{-1,Errno}} -> {error,Errno}
+ {term,{Fd,_}} when Fd >= 0 -> {ok,Fd};
+ {term,{-1,Errno}} -> {error,Errno}
end.
erl_close_connection(P, FD) ->
send_command(P, erl_close_connection, [FD]),
case get_term(P) of
- {term,Int} when is_integer(Int) -> Int
+ {term,Int} when is_integer(Int) -> Int
end.
erl_global_register(P, Fd, Name) ->
@@ -115,15 +103,15 @@ erl_global_register(P, Fd, Name) ->
erl_global_whereis(P, Fd, Name) ->
send_command(P, erl_global_whereis, [Fd,Name]),
case get_term(P) of
- {term, What} ->
- What
+ {term, What} ->
+ What
end.
erl_global_names(P, Fd) ->
send_command(P, erl_global_names, [Fd]),
case get_term(P) of
- {term, What} ->
- What
+ {term, What} ->
+ What
end.
erl_global_unregister(P, Fd, Name) ->
@@ -132,11 +120,11 @@ erl_global_unregister(P, Fd, Name) ->
get_send_result(P) ->
case get_term(P) of
- {term,{1,_}} -> ok;
- {term,{0, 0}} -> ok;
- {term,{-1, Errno}} -> {error,Errno};
- {term,{_,_}}->
- ?t:fail(bad_return_value)
+ {term,{1,_}} -> ok;
+ {term,{0, 0}} -> ok;
+ {term,{-1, Errno}} -> {error,Errno};
+ {term,{_,_}}->
+ ct:fail(bad_return_value)
end.
send_command(P, Name, Args) ->
diff --git a/lib/erl_interface/test/erl_global_SUITE_data/Makefile.first b/lib/erl_interface/test/erl_global_SUITE_data/Makefile.first
index ec77ef3dc2..b2c62be1f2 100644
--- a/lib/erl_interface/test/erl_global_SUITE_data/Makefile.first
+++ b/lib/erl_interface/test/erl_global_SUITE_data/Makefile.first
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2010. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_global_SUITE_data/Makefile.src b/lib/erl_interface/test/erl_global_SUITE_data/Makefile.src
index 4cbf51713b..1c1530d1b6 100644
--- a/lib/erl_interface/test/erl_global_SUITE_data/Makefile.src
+++ b/lib/erl_interface/test/erl_global_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2010. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_global_SUITE_data/erl_global_test.c b/lib/erl_interface/test/erl_global_SUITE_data/erl_global_test.c
index 5a17069751..0f08727225 100644
--- a/lib/erl_interface/test/erl_global_SUITE_data/erl_global_test.c
+++ b/lib/erl_interface/test/erl_global_SUITE_data/erl_global_test.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_match_SUITE.erl b/lib/erl_interface/test/erl_match_SUITE.erl
index ecdebad212..5566714092 100644
--- a/lib/erl_interface/test/erl_match_SUITE.erl
+++ b/lib/erl_interface/test/erl_match_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,246 +24,218 @@
-include_lib("common_test/include/ct.hrl").
-include("erl_match_SUITE_data/match_test_cases.hrl").
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- atoms/1, lists/1, tuples/1, references/1, pids/1, ports/1,
- bind/1, integers/1, floats/1, binaries/1, strings/1]).
+-export([all/0, suite/0,
+ atoms/1, lists/1, tuples/1, references/1, pids/1, ports/1,
+ bind/1, integers/1, floats/1, binaries/1, strings/1]).
%% For interactive running of matcher.
-export([start_matcher/1, erl_match/3]).
%% This test suite tests the erl_match() function.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]}].
all() ->
[atoms, lists, tuples, references, pids, ports, bind,
integers, floats, binaries, strings].
-groups() ->
- [].
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
-atoms(suite) -> [];
atoms(Config) when is_list(Config) ->
- ?line P = start_matcher(Config),
+ P = start_matcher(Config),
- ?line eq(P, '', ''),
- ?line eq(P, a, a),
- ?line ne(P, a, b),
- ?line ne(P, a, aa),
- ?line eq(P, kalle, kalle),
- ?line ne(P, kalle, arne),
+ eq(P, '', ''),
+ eq(P, a, a),
+ ne(P, a, b),
+ ne(P, a, aa),
+ eq(P, kalle, kalle),
+ ne(P, kalle, arne),
- ?line ne(P, kalle, 42),
- ?line ne(P, 42, kalle),
+ ne(P, kalle, 42),
+ ne(P, 42, kalle),
- ?line runner:finish(P),
+ runner:finish(P),
ok.
-lists(suite) -> [];
lists(Config) when is_list(Config) ->
- ?line P = start_matcher(Config),
- ?line eq(P, [], []),
+ P = start_matcher(Config),
+ eq(P, [], []),
- ?line ne(P, [], [a]),
- ?line ne(P, [a], []),
+ ne(P, [], [a]),
+ ne(P, [a], []),
- ?line eq(P, [a], [a]),
- ?line ne(P, [a], [b]),
+ eq(P, [a], [a]),
+ ne(P, [a], [b]),
- ?line eq(P, [a|b], [a|b]),
- ?line ne(P, [a|b], [a|x]),
+ eq(P, [a|b], [a|b]),
+ ne(P, [a|b], [a|x]),
- ?line eq(P, [a, b], [a, b]),
- ?line ne(P, [a, b], [a, x]),
+ eq(P, [a, b], [a, b]),
+ ne(P, [a, b], [a, x]),
- ?line eq(P, [a, b, c], [a, b, c]),
- ?line ne(P, [a, b|c], [a, b|x]),
- ?line ne(P, [a, b, c], [a, b, x]),
- ?line ne(P, [a, b|c], [a, b|x]),
- ?line ne(P, [a, x|c], [a, b|c]),
- ?line ne(P, [a, b, c], [a, x, c]),
+ eq(P, [a, b, c], [a, b, c]),
+ ne(P, [a, b|c], [a, b|x]),
+ ne(P, [a, b, c], [a, b, x]),
+ ne(P, [a, b|c], [a, b|x]),
+ ne(P, [a, x|c], [a, b|c]),
+ ne(P, [a, b, c], [a, x, c]),
- ?line runner:finish(P),
+ runner:finish(P),
ok.
-tuples(suite) -> [];
tuples(Config) when is_list(Config) ->
- ?line P = start_matcher(Config),
+ P = start_matcher(Config),
- ?line ne(P, {}, {a, b}),
- ?line ne(P, {a, b}, {}),
- ?line ne(P, {a}, {a, b}),
- ?line ne(P, {a, b}, {a}),
+ ne(P, {}, {a, b}),
+ ne(P, {a, b}, {}),
+ ne(P, {a}, {a, b}),
+ ne(P, {a, b}, {a}),
- ?line eq(P, {}, {}),
+ eq(P, {}, {}),
- ?line eq(P, {a}, {a}),
- ?line ne(P, {a}, {b}),
+ eq(P, {a}, {a}),
+ ne(P, {a}, {b}),
- ?line eq(P, {1}, {1}),
- ?line ne(P, {1}, {2}),
+ eq(P, {1}, {1}),
+ ne(P, {1}, {2}),
- ?line eq(P, {a, b}, {a, b}),
- ?line ne(P, {x, b}, {a, b}),
+ eq(P, {a, b}, {a, b}),
+ ne(P, {x, b}, {a, b}),
- ?line ne(P, {error, x}, {error, y}),
- ?line ne(P, {error, {undefined, {subscriber, last}}},
- {error, {undefined, {subscriber, name}}}),
+ ne(P, {error, x}, {error, y}),
+ ne(P, {error, {undefined, {subscriber, last}}},
+ {error, {undefined, {subscriber, name}}}),
- ?line runner:finish(P),
+ runner:finish(P),
ok.
-references(suite) -> [];
references(Config) when is_list(Config) ->
- ?line P = start_matcher(Config),
- ?line Ref1 = make_ref(),
- ?line Ref2 = make_ref(),
-
- ?line eq(P, Ref1, Ref1),
- ?line eq(P, Ref2, Ref2),
- ?line ne(P, Ref1, Ref2),
- ?line ne(P, Ref2, Ref1),
-
- ?line runner:finish(P),
+ P = start_matcher(Config),
+ Ref1 = make_ref(),
+ Ref2 = make_ref(),
+
+ eq(P, Ref1, Ref1),
+ eq(P, Ref2, Ref2),
+ ne(P, Ref1, Ref2),
+ ne(P, Ref2, Ref1),
+
+ runner:finish(P),
ok.
-pids(suite) -> [];
pids(Config) when is_list(Config) ->
- ?line P = start_matcher(Config),
- ?line Pid1 = c:pid(0,1,2),
- ?line Pid2 = c:pid(0,1,3),
-
- ?line eq(P, self(), self()),
- ?line eq(P, Pid1, Pid1),
- ?line ne(P, Pid1, self()),
- ?line ne(P, Pid2, Pid1),
-
- ?line runner:finish(P),
+ P = start_matcher(Config),
+ Pid1 = c:pid(0,1,2),
+ Pid2 = c:pid(0,1,3),
+
+ eq(P, self(), self()),
+ eq(P, Pid1, Pid1),
+ ne(P, Pid1, self()),
+ ne(P, Pid2, Pid1),
+
+ runner:finish(P),
ok.
-ports(suite) -> [];
ports(Config) when is_list(Config) ->
case os:type() of
- vxworks ->
- {skipped,"not on vxworks, pucko"};
- _ ->
- ?line P = start_matcher(Config),
- ?line P2 = start_matcher(Config),
-
- ?line eq(P, P, P),
- ?line ne(P, P, P2),
-
- ?line runner:finish(P),
- ?line runner:finish(P2),
- ok
+ vxworks ->
+ {skipped,"not on vxworks, pucko"};
+ _ ->
+ P = start_matcher(Config),
+ P2 = start_matcher(Config),
+
+ eq(P, P, P),
+ ne(P, P, P2),
+
+ runner:finish(P),
+ runner:finish(P2),
+ ok
end.
-integers(suite) -> [];
integers(Config) when is_list(Config) ->
- ?line P = start_matcher(Config),
- ?line I1 = 123,
- ?line I2 = 12345,
- ?line I3 = -123,
- ?line I4 = 2234,
-
- ?line eq(P, I1, I1),
- ?line eq(P, I2, I2),
- ?line ne(P, I1, I2),
- ?line ne(P, I1, I3),
- ?line eq(P, I4, I4),
-
- ?line runner:finish(P),
+ P = start_matcher(Config),
+ I1 = 123,
+ I2 = 12345,
+ I3 = -123,
+ I4 = 2234,
+
+ eq(P, I1, I1),
+ eq(P, I2, I2),
+ ne(P, I1, I2),
+ ne(P, I1, I3),
+ eq(P, I4, I4),
+
+ runner:finish(P),
ok.
-floats(suite) -> [];
floats(Config) when is_list(Config) ->
- ?line P = start_matcher(Config),
- ?line F1 = 3.1414,
- ?line F2 = 3.1415,
- ?line F3 = 3.1416,
-
- ?line S1 = "string",
- ?line S2 = "string2",
-
- ?line eq(P, F1, F1),
- ?line eq(P, F2, F2),
- ?line ne(P, F1, F2),
- ?line ne(P, F3, F2),
-
- ?line eq(P, S2, S2),
- ?line ne(P, S1, S2),
-
- ?line runner:finish(P),
+ P = start_matcher(Config),
+ F1 = 3.1414,
+ F2 = 3.1415,
+ F3 = 3.1416,
+
+ S1 = "string",
+ S2 = "string2",
+
+ eq(P, F1, F1),
+ eq(P, F2, F2),
+ ne(P, F1, F2),
+ ne(P, F3, F2),
+
+ eq(P, S2, S2),
+ ne(P, S1, S2),
+
+ runner:finish(P),
ok.
-binaries(suite) -> [];
binaries(Config) when is_list(Config) ->
- ?line P = start_matcher(Config),
- ?line Bin1 = term_to_binary({kalle, 146015, {kungsgatan, 23}}),
- ?line Bin2 = term_to_binary(sune),
- ?line Bin3 = list_to_binary("sune"),
-
- ?line eq(P, Bin1, Bin1),
- ?line eq(P, Bin2, Bin2),
- ?line eq(P, Bin3, Bin3),
- ?line ne(P, Bin1, Bin2),
- ?line ne(P, Bin1, Bin3),
- ?line ne(P, Bin2, Bin3),
-
- ?line runner:finish(P),
+ P = start_matcher(Config),
+ Bin1 = term_to_binary({kalle, 146015, {kungsgatan, 23}}),
+ Bin2 = term_to_binary(sune),
+ Bin3 = list_to_binary("sune"),
+
+ eq(P, Bin1, Bin1),
+ eq(P, Bin2, Bin2),
+ eq(P, Bin3, Bin3),
+ ne(P, Bin1, Bin2),
+ ne(P, Bin1, Bin3),
+ ne(P, Bin2, Bin3),
+
+ runner:finish(P),
ok.
-
-strings(suite) -> [];
strings(Config) when is_list(Config) ->
- ?line P = start_matcher(Config),
+ P = start_matcher(Config),
- ?line S1 = "string",
- ?line S2 = "streng",
- ?line S3 = "String",
-
- ?line eq(P, S1, S1),
- ?line ne(P, S1, S2),
- ?line ne(P, S1, S3),
+ S1 = "string",
+ S2 = "streng",
+ S3 = "String",
- ?line runner:finish(P),
- ok.
+ eq(P, S1, S1),
+ ne(P, S1, S2),
+ ne(P, S1, S3),
+ runner:finish(P),
+ ok.
-bind(suite) -> [];
bind(Config) when is_list(Config) ->
- ?line P = start_bind(Config),
- ?line S = "[X,Y,Z]",
- ?line L1 = [301,302,302],
- ?line L2 = [65,66,67],
-
- ?line bind_ok(P, S, L1),
- ?line bind_ok(P, S, L2),
-
- ?line runner:finish(P),
+ P = start_bind(Config),
+ S = "[X,Y,Z]",
+ L1 = [301,302,302],
+ L2 = [65,66,67],
+
+ bind_ok(P, S, L1),
+ bind_ok(P, S, L2),
+
+ runner:finish(P),
ok.
start_bind(Config) ->
@@ -279,15 +251,12 @@ erl_bind(Port, Pattern, Term) ->
Port ! {self(), {command, [$b, Pattern, 0]}},
runner:send_term(Port, Term),
case runner:get_term(Port) of
- {term, 0} -> false;
- {term, 1} -> true
+ {term, 0} -> false;
+ {term, 1} -> true
end.
-
-
-
start_matcher(Config) ->
runner:start(?erl_match_server).
@@ -303,8 +272,6 @@ erl_match(Port, Pattern, Term) ->
runner:send_term(Port, Pattern),
runner:send_term(Port, Term),
case runner:get_term(Port) of
- {term, 0} -> false;
- {term, 1} -> true
+ {term, 0} -> false;
+ {term, 1} -> true
end.
-
-
diff --git a/lib/erl_interface/test/erl_match_SUITE_data/Makefile.first b/lib/erl_interface/test/erl_match_SUITE_data/Makefile.first
index 867c59802f..459b5c14c2 100644
--- a/lib/erl_interface/test/erl_match_SUITE_data/Makefile.first
+++ b/lib/erl_interface/test/erl_match_SUITE_data/Makefile.first
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2009. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_match_SUITE_data/Makefile.src b/lib/erl_interface/test/erl_match_SUITE_data/Makefile.src
index 5753a417fb..156214a269 100644
--- a/lib/erl_interface/test/erl_match_SUITE_data/Makefile.src
+++ b/lib/erl_interface/test/erl_match_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/erl_match_SUITE_data/match_test.c b/lib/erl_interface/test/erl_match_SUITE_data/match_test.c
index c508786ba8..d577417f5b 100644
--- a/lib/erl_interface/test/erl_match_SUITE_data/match_test.c
+++ b/lib/erl_interface/test/erl_match_SUITE_data/match_test.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/port_call_SUITE.erl b/lib/erl_interface/test/port_call_SUITE.erl
index 3bc1a03eab..fb10bd895f 100644
--- a/lib/erl_interface/test/port_call_SUITE.erl
+++ b/lib/erl_interface/test/port_call_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -32,96 +32,78 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, basic/1]).
+-export([all/0, suite/0, basic/1]).
+
% Private exports
-include_lib("common_test/include/ct.hrl").
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {seconds, 10}}].
all() ->
-[basic].
-
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
+ [basic].
-basic(suite) -> [];
basic(Config) when is_list(Config) ->
case os:type() of
- {unix, linux} ->
- do_basic(Config);
- {unix, sunos} ->
- do_basic(Config);
- {win32,_} ->
- do_basic(Config);
- _ ->
- {skipped, "Dynamic linking and erl_interface not fully examined"
- " on this platform..."}
+ {unix, linux} ->
+ do_basic(Config);
+ {unix, sunos} ->
+ do_basic(Config);
+ {win32,_} ->
+ do_basic(Config);
+ _ ->
+ {skipped, "Dynamic linking and erl_interface not fully examined"
+ " on this platform..."}
end.
do_basic(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line Path = ?config(data_dir, Config),
+ Path = proplists:get_value(data_dir, Config),
- ?line erl_ddll:start(),
+ erl_ddll:start(),
%% Load the echo driver and verify that it was loaded.
{ok,L1,L2}=load_port_call_driver(Path),
%% Verify that the driver works.
- ?line Port = open_port({spawn, port_call_drv}, [eof]),
- ?line {hej, "hopp",4711,123445567436543653} =
- erlang:port_call(Port,{hej, "hopp",4711,123445567436543653}),
- ?line {hej, "hopp",4711,123445567436543653} =
- erlang:port_call(Port,0,{hej, "hopp",4711,123445567436543653}),
- ?line {[], a, [], b, c} =
- erlang:port_call(Port,1,{hej, "hopp",4711,123445567436543653}),
- ?line {return, {[], a, [], b, c}} =
- erlang:port_call(Port,2,{[], a, [], b, c}),
- ?line List = lists:duplicate(200,5),
- ?line {return, List} = erlang:port_call(Port,2,List),
- ?line {'EXIT',{badarg,_}} = (catch erlang:port_call(Port,4711,[])),
- ?line {'EXIT',{badarg,_}} = (catch erlang:port_call(sune,2,[])),
- ?line register(gunnar,Port),
- ?line {return, List} = erlang:port_call(gunnar,2,List),
- ?line {return, a} = erlang:port_call(gunnar,2,a),
- ?line erlang:port_close(Port),
+ Port = open_port({spawn, port_call_drv}, [eof]),
+ {hej, "hopp",4711,123445567436543653} =
+ erlang:port_call(Port,{hej, "hopp",4711,123445567436543653}),
+ {hej, "hopp",4711,123445567436543653} =
+ erlang:port_call(Port,0,{hej, "hopp",4711,123445567436543653}),
+ {[], a, [], b, c} =
+ erlang:port_call(Port,1,{hej, "hopp",4711,123445567436543653}),
+ {return, {[], a, [], b, c}} =
+ erlang:port_call(Port,2,{[], a, [], b, c}),
+ List = lists:duplicate(200,5),
+ {return, List} = erlang:port_call(Port,2,List),
+ {'EXIT',{badarg,_}} = (catch erlang:port_call(Port,4711,[])),
+ {'EXIT',{badarg,_}} = (catch erlang:port_call(sune,2,[])),
+ register(gunnar,Port),
+ {return, List} = erlang:port_call(gunnar,2,List),
+ {return, a} = erlang:port_call(gunnar,2,a),
+ erlang:port_close(Port),
%% Unload the driver and verify that it was unloaded.
ok=unload_port_call_driver(L1,L2),
- ?line {error, {already_started, _}} = erl_ddll:start(),
- ?line ok = erl_ddll:stop(),
-
- ?line test_server:timetrap_cancel(Dog),
+ {error, {already_started, _}} = erl_ddll:start(),
+ ok = erl_ddll:stop(),
ok.
load_port_call_driver(Path) ->
- ?line {ok, L1} = erl_ddll:loaded_drivers(),
- ?line ok = erl_ddll:load_driver(Path, port_call_drv),
- ?line {ok, L2} = erl_ddll:loaded_drivers(),
- ?line ["port_call_drv"] = ordsets:to_list(ordsets:subtract(ordsets:from_list(L2),
- ordsets:from_list(L1))),
+ {ok, L1} = erl_ddll:loaded_drivers(),
+ ok = erl_ddll:load_driver(Path, port_call_drv),
+ {ok, L2} = erl_ddll:loaded_drivers(),
+ ["port_call_drv"] = ordsets:to_list(ordsets:subtract(ordsets:from_list(L2),
+ ordsets:from_list(L1))),
{ok,L1,L2}.
unload_port_call_driver(L1,L2) ->
- ?line {ok, L2} = erl_ddll:loaded_drivers(),
- ?line ok = erl_ddll:unload_driver(port_call_drv),
- ?line {ok, L3} = erl_ddll:loaded_drivers(),
- ?line [] = ordsets:to_list(ordsets:subtract(ordsets:from_list(L3),
- ordsets:from_list(L1))),
+ {ok, L2} = erl_ddll:loaded_drivers(),
+ ok = erl_ddll:unload_driver(port_call_drv),
+ {ok, L3} = erl_ddll:loaded_drivers(),
+ [] = ordsets:to_list(ordsets:subtract(ordsets:from_list(L3),
+ ordsets:from_list(L1))),
ok.
-
diff --git a/lib/erl_interface/test/port_call_SUITE_data/Makefile.src b/lib/erl_interface/test/port_call_SUITE_data/Makefile.src
index 12b9fcae76..0f97ce9f70 100644
--- a/lib/erl_interface/test/port_call_SUITE_data/Makefile.src
+++ b/lib/erl_interface/test/port_call_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2011. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/port_call_SUITE_data/port_call_drv.c b/lib/erl_interface/test/port_call_SUITE_data/port_call_drv.c
index ac23a650c1..4617cb0316 100644
--- a/lib/erl_interface/test/port_call_SUITE_data/port_call_drv.c
+++ b/lib/erl_interface/test/port_call_SUITE_data/port_call_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/erl_interface/test/runner.erl b/lib/erl_interface/test/runner.erl
index ae2598abf8..9a27eda038 100644
--- a/lib/erl_interface/test/runner.erl
+++ b/lib/erl_interface/test/runner.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
start/1, send_term/2, finish/1, send_eot/1, recv_eot/1,
get_term/1, get_term/2]).
--define(default_timeout, test_server:seconds(5)).
+-define(default_timeout, 5000).
%% Executes a test case in a C program.
%%
@@ -45,7 +45,7 @@ test(Tc, Timeout) ->
io:format("In this test case, a success/failure result was"),
io:format("expected from the C program.\n"),
io:format("Received: ~p", [Other]),
- test_server:fail()
+ ct:fail(badresult)
end.
%% Executes a test case in a C program. Returns the port.
@@ -80,7 +80,7 @@ send_eot(Port) when is_port(Port) ->
Port ! {self(), {command, [$e]}}.
%% Waits for an 'eot' indication from the C program.
-%% Either returns 'ok' or invokes test_server:fail().
+%% Either returns 'ok' or invokes ct:fail(badresult).
recv_eot(Port) when is_port(Port) ->
case get_term(Port) of
@@ -90,12 +90,12 @@ recv_eot(Port) when is_port(Port) ->
io:format("Error finishing test case. Expected eof from"),
io:format("C program, but got:"),
io:format("~p", [Other]),
- test_server:fail()
+ ct:fail(badresult)
end.
%% Reads a term from the C program.
%%
-%% Returns: {term, Term}|eot|'NULL' or calls test_server:fail/1,2.
+%% Returns: {term, Term}|eot|'NULL' or calls ct:fail/1,2.
get_term(Port) ->
get_term(Port, ?default_timeout).
@@ -105,9 +105,9 @@ get_term(Port, Timeout) ->
[$b|Bytes] ->
{bytes, Bytes};
[$f] ->
- test_server:fail();
+ ct:fail(failure);
[$f|Reason] ->
- test_server:fail(Reason);
+ ct:fail(Reason);
[$t|Term] ->
{term, binary_to_term(list_to_binary(Term))};
[$N] ->
@@ -119,7 +119,7 @@ get_term(Port, Timeout) ->
get_term(Port, Timeout);
Other ->
io:format("Garbage received from C program: ~p", [Other]),
- test_server:fail("Illegal response from C program")
+ ct:fail("Illegal response from C program")
end.
get_reply(Port, Timeout) when is_port(Port) ->
@@ -127,5 +127,5 @@ get_reply(Port, Timeout) when is_port(Port) ->
{Port, {data, Reply}} ->
Reply
after Timeout ->
- test_server:fail("No response from C program")
+ ct:fail("No response from C program")
end.
diff --git a/lib/et/Makefile b/lib/et/Makefile
index b93ebef902..f0bb7be211 100644
--- a/lib/et/Makefile
+++ b/lib/et/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2009. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/et/doc/src/Makefile b/lib/et/doc/src/Makefile
index 532e28f5d3..0257a8f817 100644
--- a/lib/et/doc/src/Makefile
+++ b/lib/et/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2012. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/et/doc/src/book.xml b/lib/et/doc/src/book.xml
index d3fef1752c..5dddb44454 100644
--- a/lib/et/doc/src/book.xml
+++ b/lib/et/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/et/doc/src/et.xml b/lib/et/doc/src/et.xml
index 0ba858cc08..3009b559e1 100644
--- a/lib/et/doc/src/et.xml
+++ b/lib/et/doc/src/et.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/et/doc/src/et_collector.xml b/lib/et/doc/src/et_collector.xml
index e879a119a5..6a85b81ec2 100644
--- a/lib/et/doc/src/et_collector.xml
+++ b/lib/et/doc/src/et_collector.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/et/doc/src/et_desc.xmlsrc b/lib/et/doc/src/et_desc.xmlsrc
index cbb41f700c..96a4a9df31 100644
--- a/lib/et/doc/src/et_desc.xmlsrc
+++ b/lib/et/doc/src/et_desc.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/et/doc/src/et_examples.xmlsrc b/lib/et/doc/src/et_examples.xmlsrc
index 42e484a241..6f143a397e 100644
--- a/lib/et/doc/src/et_examples.xmlsrc
+++ b/lib/et/doc/src/et_examples.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/et/doc/src/et_intro.xml b/lib/et/doc/src/et_intro.xml
index cfc879e43d..729f95647d 100644
--- a/lib/et/doc/src/et_intro.xml
+++ b/lib/et/doc/src/et_intro.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/et/doc/src/et_selector.xml b/lib/et/doc/src/et_selector.xml
index af62401287..441a4dd278 100644
--- a/lib/et/doc/src/et_selector.xml
+++ b/lib/et/doc/src/et_selector.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/et/doc/src/et_tutorial.xmlsrc b/lib/et/doc/src/et_tutorial.xmlsrc
index 6e3b327ee7..b5d1b815be 100644
--- a/lib/et/doc/src/et_tutorial.xmlsrc
+++ b/lib/et/doc/src/et_tutorial.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2009</year><year>2013</year>
+ <year>2009</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/et/doc/src/et_viewer.xml b/lib/et/doc/src/et_viewer.xml
index c7917b41ce..e0b39636e9 100644
--- a/lib/et/doc/src/et_viewer.xml
+++ b/lib/et/doc/src/et_viewer.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/et/doc/src/files.mk b/lib/et/doc/src/files.mk
index c8721c61fe..e0ea9b0b76 100644
--- a/lib/et/doc/src/files.mk
+++ b/lib/et/doc/src/files.mk
@@ -1,7 +1,7 @@
#-*-makefile-*- ; force emacs to enter makefile-mode
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2010. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/et/doc/src/notes.xml b/lib/et/doc/src/notes.xml
index 6599025d52..ee9e34d14d 100644
--- a/lib/et/doc/src/notes.xml
+++ b/lib/et/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/et/doc/src/part.xml b/lib/et/doc/src/part.xml
index d8e5e76685..a282dc2c16 100644
--- a/lib/et/doc/src/part.xml
+++ b/lib/et/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/et/doc/src/ref_man.xml b/lib/et/doc/src/ref_man.xml
index 68ed5a8756..bf131bef85 100644
--- a/lib/et/doc/src/ref_man.xml
+++ b/lib/et/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/et/examples/Makefile b/lib/et/examples/Makefile
index 215ce6e4cd..fe6811e45d 100644
--- a/lib/et/examples/Makefile
+++ b/lib/et/examples/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2012. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/et/examples/et_demo.erl b/lib/et/examples/et_demo.erl
index e2a604b451..b0fb29e7c6 100644
--- a/lib/et/examples/et_demo.erl
+++ b/lib/et/examples/et_demo.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/et/include/et.hrl b/lib/et/include/et.hrl
index 450044df42..75e82a5c85 100644
--- a/lib/et/include/et.hrl
+++ b/lib/et/include/et.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/et/src/Makefile b/lib/et/src/Makefile
index 461a52d480..b6347d8b6d 100644
--- a/lib/et/src/Makefile
+++ b/lib/et/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2013. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/et/src/et.app.src b/lib/et/src/et.app.src
index ddf86beea3..7a5928d6ab 100644
--- a/lib/et/src/et.app.src
+++ b/lib/et/src/et.app.src
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -33,6 +33,6 @@
{registered, [et_collector]},
{applications, [stdlib, kernel]},
{env, []},
- {runtime_dependencies, ["wx-1.2","stdlib-2.0","runtime_tools-1.8.14",
- "kernel-3.0","erts-6.0"]}
+ {runtime_dependencies, ["wx-1.2","stdlib-2.0","runtime_tools-1.10",
+ "kernel-3.0","erts-8.0"]}
]}.
diff --git a/lib/et/src/et.appup.src b/lib/et/src/et.appup.src
index 0fbde99762..491c039ffe 100644
--- a/lib/et/src/et.appup.src
+++ b/lib/et/src/et.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/et/src/et.erl b/lib/et/src/et.erl
index d38fe917c8..91c17ffdc9 100644
--- a/lib/et/src/et.erl
+++ b/lib/et/src/et.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/et/src/et_collector.erl b/lib/et/src/et_collector.erl
index 56e59461b2..b8916c0eb9 100644
--- a/lib/et/src/et_collector.erl
+++ b/lib/et/src/et_collector.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/et/src/et_internal.hrl b/lib/et/src/et_internal.hrl
index 01c7303d0b..fdcd6f3dcc 100644
--- a/lib/et/src/et_internal.hrl
+++ b/lib/et/src/et_internal.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/et/src/et_selector.erl b/lib/et/src/et_selector.erl
index 708a0b4cd8..a0297c21d1 100644
--- a/lib/et/src/et_selector.erl
+++ b/lib/et/src/et_selector.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -23,11 +23,9 @@
-module(et_selector).
--export([
- make_pattern/1,
+-export([make_pattern/1,
change_pattern/1,
- parse_event/2
- ]).
+ parse_event/2]).
-compile([{nowarn_deprecated_function,[{erlang,now,0}]}]).
@@ -535,7 +533,7 @@ parse_event(Mod, Trace, ParsedTS, ReportedTS, From, Label, Contents) ->
{from, From},
{to, From},
{mfa, MFA}]}}; % MFA | 0
- gc_start ->
+ gc_minor_start ->
DetailLevel = 80,
[GcKeyValueList] = Contents,
{true, #event{detail_level = DetailLevel,
@@ -549,7 +547,7 @@ parse_event(Mod, Trace, ParsedTS, ReportedTS, From, Label, Contents) ->
{from, From},
{to, From},
{gc_items, GcKeyValueList}]}};
- gc_end ->
+ gc_minor_end ->
DetailLevel = 85,
[GcKeyValueList] = Contents,
{true, #event{detail_level = DetailLevel,
@@ -559,10 +557,38 @@ parse_event(Mod, Trace, ParsedTS, ReportedTS, From, Label, Contents) ->
to = From,
label = Label,
contents = [{label, Label},
- {detail_level, DetailLevel},
- {from, From},
- {to, From},
- {gc_items, GcKeyValueList}]}};
+ {detail_level, DetailLevel},
+ {from, From},
+ {to, From},
+ {gc_items, GcKeyValueList}]}};
+ gc_major_start ->
+ DetailLevel = 80,
+ [GcKeyValueList] = Contents,
+ {true, #event{detail_level = DetailLevel,
+ trace_ts = ReportedTS,
+ event_ts = ParsedTS,
+ from = From,
+ to = From,
+ label = Label,
+ contents = [{label, Label},
+ {detail_level, DetailLevel},
+ {from, From},
+ {to, From},
+ {gc_items, GcKeyValueList}]}};
+ gc_major_end ->
+ DetailLevel = 85,
+ [GcKeyValueList] = Contents,
+ {true, #event{detail_level = DetailLevel,
+ trace_ts = ReportedTS,
+ event_ts = ParsedTS,
+ from = From,
+ to = From,
+ label = Label,
+ contents = [{label, Label},
+ {detail_level, DetailLevel},
+ {from, From},
+ {to, From},
+ {gc_items, GcKeyValueList}]}};
_ ->
error_logger:format("~p(~p): Ignoring unknown trace type -> ~p~n~n",
[?MODULE, ?LINE, Trace]),
diff --git a/lib/et/src/et_viewer.erl b/lib/et/src/et_viewer.erl
index 1a962df147..3928764c7f 100644
--- a/lib/et/src/et_viewer.erl
+++ b/lib/et/src/et_viewer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/et/src/et_wx_contents_viewer.erl b/lib/et/src/et_wx_contents_viewer.erl
index 46898c6fbf..d5347a43db 100644
--- a/lib/et/src/et_wx_contents_viewer.erl
+++ b/lib/et/src/et_wx_contents_viewer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/et/src/et_wx_viewer.erl b/lib/et/src/et_wx_viewer.erl
index 1e71880b79..0fc10cb37b 100644
--- a/lib/et/src/et_wx_viewer.erl
+++ b/lib/et/src/et_wx_viewer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/et/src/modules.mk b/lib/et/src/modules.mk
index 0568306b65..4d538fae44 100644
--- a/lib/et/src/modules.mk
+++ b/lib/et/src/modules.mk
@@ -1,7 +1,7 @@
#-*-makefile-*- ; force emacs to enter makefile-mode
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2013. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/et/subdirs.mk b/lib/et/subdirs.mk
index 6568459be1..fb7fb8dbc9 100644
--- a/lib/et/subdirs.mk
+++ b/lib/et/subdirs.mk
@@ -1,7 +1,7 @@
#-*-makefile-*- ; force emacs to enter makefile-mode
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2009. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/et/test/Makefile b/lib/et/test/Makefile
index 0434d4ebfd..45ea2c2ce0 100644
--- a/lib/et/test/Makefile
+++ b/lib/et/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/et/test/et_SUITE.erl b/lib/et/test/et_SUITE.erl
index 4a26b46439..199aff43a8 100644
--- a/lib/et/test/et_SUITE.erl
+++ b/lib/et/test/et_SUITE.erl
@@ -16,7 +16,8 @@
%%
-module(et_SUITE).
--compile([export_all]).
+-export([suite/0, all/0]).
+-export([app/1, appup/1]).
-include_lib("common_test/include/ct.hrl").
suite() ->
@@ -25,27 +26,10 @@ suite() ->
all() ->
[app, appup].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-app() ->
- [{doc, "Test that the et app file is ok"}].
+%% Test that the et app file is ok
app(Config) when is_list(Config) ->
ok = ?t:app_test(et).
-appup() ->
- [{doc, "Test that the et appup file is ok"}].
+%% Test that the et appup file is ok
appup(Config) when is_list(Config) ->
ok = ?t:appup_test(et).
diff --git a/lib/et/test/et_test_lib.erl b/lib/et/test/et_test_lib.erl
index 6e252de4e5..df2c308b28 100644
--- a/lib/et/test/et_test_lib.erl
+++ b/lib/et/test/et_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/et/test/et_test_lib.hrl b/lib/et/test/et_test_lib.hrl
index 9f2a432e04..ee1a72d991 100644
--- a/lib/et/test/et_test_lib.hrl
+++ b/lib/et/test/et_test_lib.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/et/test/et_wx_SUITE.erl b/lib/et/test/et_wx_SUITE.erl
index 165a2bca49..6475b6706b 100644
--- a/lib/et/test/et_wx_SUITE.erl
+++ b/lib/et/test/et_wx_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -19,11 +19,10 @@
-module(et_wx_SUITE).
--export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,
- init_per_suite/1, end_per_suite/1,
- init_per_testcase/2, end_per_testcase/2]).
-
--compile(export_all).
+-export([all/0, suite/0,
+ init_per_testcase/2, end_per_testcase/2,
+ init_per_suite/1, end_per_suite/1]).
+-export([start_all_windows/1]).
-include("et_test_lib.hrl").
@@ -40,21 +39,13 @@ end_per_testcase(Func,Config) ->
et_test_lib:end_per_testcase(Func,Config).
%% SUITE specification
-suite() -> [{ct_hooks,[ts_install_cth]}].
+
+suite() ->
+ [{ct_hooks,[ts_install_cth]}].
all() ->
[start_all_windows].
-groups() ->
- [].
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
%% The test cases
%% Display all windows and see if something crashes
diff --git a/lib/et/test/ett b/lib/et/test/ett
index 53aaeada55..c5b89ea367 100755
--- a/lib/et/test/ett
+++ b/lib/et/test/ett
@@ -1,7 +1,7 @@
#! /bin/sh -f
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2010. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/et/test/ett.erl b/lib/et/test/ett.erl
index e78f6c392e..b1b769b7ac 100644
--- a/lib/et/test/ett.erl
+++ b/lib/et/test/ett.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/eunit/doc/src/book.xml b/lib/eunit/doc/src/book.xml
index 6cd2b93c68..795fce2239 100644
--- a/lib/eunit/doc/src/book.xml
+++ b/lib/eunit/doc/src/book.xml
@@ -5,7 +5,7 @@
<header titlestyle="normal">
<copyright>
<year>2008</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/eunit/doc/src/notes.xml b/lib/eunit/doc/src/notes.xml
index 398729217b..b513caf95b 100644
--- a/lib/eunit/doc/src/notes.xml
+++ b/lib/eunit/doc/src/notes.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2008</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/eunit/doc/src/part.xml b/lib/eunit/doc/src/part.xml
index a4484c2c23..ac5db0e8d7 100644
--- a/lib/eunit/doc/src/part.xml
+++ b/lib/eunit/doc/src/part.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2008</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/eunit/doc/src/part_notes.xml b/lib/eunit/doc/src/part_notes.xml
index fbecfe3f11..7db65083e0 100644
--- a/lib/eunit/doc/src/part_notes.xml
+++ b/lib/eunit/doc/src/part_notes.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2008</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/eunit/doc/src/ref_man.xml b/lib/eunit/doc/src/ref_man.xml
index c573df2a4f..a02ccc69b7 100644
--- a/lib/eunit/doc/src/ref_man.xml
+++ b/lib/eunit/doc/src/ref_man.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2008</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/eunit/src/eunit.appup.src b/lib/eunit/src/eunit.appup.src
index 12dff80521..4f212084a2 100644
--- a/lib/eunit/src/eunit.appup.src
+++ b/lib/eunit/src/eunit.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/eunit/src/eunit_lib.erl b/lib/eunit/src/eunit_lib.erl
index 4dbe023257..9dbb4835f8 100644
--- a/lib/eunit/src/eunit_lib.erl
+++ b/lib/eunit/src/eunit_lib.erl
@@ -192,7 +192,6 @@ error_msg(Title, Fmt, Args) ->
io_lib:fwrite("*** ~ts ***\n~ts\n\n", [Title, Msg]).
-ifdef(TEST).
--dialyzer({no_match, format_exception_test_/0}).
format_exception_test_() ->
[?_assertMatch(
"\nymmud:rorre"++_,
@@ -274,7 +273,6 @@ dlist_next([], Xs) ->
-ifdef(TEST).
--dialyzer({no_match, dlist_test_/0}).
dlist_test_() ->
{"deep list traversal",
[{"non-list term -> singleton list",
@@ -340,7 +338,6 @@ is_nonempty_string([]) -> false;
is_nonempty_string(Cs) -> is_string(Cs).
-ifdef(TEST).
--dialyzer({no_match, is_string_test_/0}).
is_string_test_() ->
{"is_string",
[{"no non-lists", ?_assert(not is_string($A))},
@@ -402,7 +399,7 @@ uniq([X | Xs]) -> [X | uniq(Xs)];
uniq([]) -> [].
-ifdef(TEST).
--dialyzer({[no_match, no_fail_call, no_improper_lists], uniq_test_/0}).
+-dialyzer({[no_fail_call, no_improper_lists], uniq_test_/0}).
uniq_test_() ->
{"uniq",
[?_assertError(function_clause, uniq(ok)),
@@ -581,7 +578,6 @@ trie_match([], _T) ->
-ifdef(TEST).
--dialyzer({no_match, trie_test_/0}).
trie_test_() ->
[{"basic representation",
[?_assert(trie_new() =:= gb_trees:empty()),
diff --git a/lib/eunit/test/Makefile b/lib/eunit/test/Makefile
index 6f166f99aa..b6ece61b43 100644
--- a/lib/eunit/test/Makefile
+++ b/lib/eunit/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/eunit/test/eunit_SUITE.erl b/lib/eunit/test/eunit_SUITE.erl
index 9897d5ae2b..63bdc6c334 100644
--- a/lib/eunit/test/eunit_SUITE.erl
+++ b/lib/eunit/test/eunit_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/Makefile b/lib/gs/Makefile
index b95d435461..22f935fd38 100644
--- a/lib/gs/Makefile
+++ b/lib/gs/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/gs/doc/src/Makefile b/lib/gs/doc/src/Makefile
index 3f8c7cdc95..b270bc84fe 100644
--- a/lib/gs/doc/src/Makefile
+++ b/lib/gs/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/gs/doc/src/book.xml b/lib/gs/doc/src/book.xml
index 2e83697bdd..15d911072e 100644
--- a/lib/gs/doc/src/book.xml
+++ b/lib/gs/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/gs/doc/src/gs.xml b/lib/gs/doc/src/gs.xml
index 0927902f75..3cbb6dca62 100644
--- a/lib/gs/doc/src/gs.xml
+++ b/lib/gs/doc/src/gs.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2014</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/gs/doc/src/gs_chapter1.xml b/lib/gs/doc/src/gs_chapter1.xml
index fea29dccbc..65e0ee208a 100644
--- a/lib/gs/doc/src/gs_chapter1.xml
+++ b/lib/gs/doc/src/gs_chapter1.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/gs/doc/src/gs_chapter2.xmlsrc b/lib/gs/doc/src/gs_chapter2.xmlsrc
index 20c8a8bd81..f3ec878bc6 100644
--- a/lib/gs/doc/src/gs_chapter2.xmlsrc
+++ b/lib/gs/doc/src/gs_chapter2.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/gs/doc/src/gs_chapter3.xml b/lib/gs/doc/src/gs_chapter3.xml
index 47967d466a..f21e75d970 100644
--- a/lib/gs/doc/src/gs_chapter3.xml
+++ b/lib/gs/doc/src/gs_chapter3.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/gs/doc/src/gs_chapter4.xmlsrc b/lib/gs/doc/src/gs_chapter4.xmlsrc
index 99d4fcd124..9085bdbe24 100644
--- a/lib/gs/doc/src/gs_chapter4.xmlsrc
+++ b/lib/gs/doc/src/gs_chapter4.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/gs/doc/src/gs_chapter5.xmlsrc b/lib/gs/doc/src/gs_chapter5.xmlsrc
index 56e69bfb2e..1cad8d56bb 100644
--- a/lib/gs/doc/src/gs_chapter5.xmlsrc
+++ b/lib/gs/doc/src/gs_chapter5.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/gs/doc/src/gs_chapter6.xmlsrc b/lib/gs/doc/src/gs_chapter6.xmlsrc
index 74790ae6a3..ecb891ad6f 100644
--- a/lib/gs/doc/src/gs_chapter6.xmlsrc
+++ b/lib/gs/doc/src/gs_chapter6.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/gs/doc/src/gs_chapter7.xmlsrc b/lib/gs/doc/src/gs_chapter7.xmlsrc
index d27bd67673..d0b0859a8f 100644
--- a/lib/gs/doc/src/gs_chapter7.xmlsrc
+++ b/lib/gs/doc/src/gs_chapter7.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/gs/doc/src/gs_chapter8.xmlsrc b/lib/gs/doc/src/gs_chapter8.xmlsrc
index b5959d972b..5c74c63aef 100644
--- a/lib/gs/doc/src/gs_chapter8.xmlsrc
+++ b/lib/gs/doc/src/gs_chapter8.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/gs/doc/src/notes.xml b/lib/gs/doc/src/notes.xml
index 02d4f1cec3..3ceae98bc5 100644
--- a/lib/gs/doc/src/notes.xml
+++ b/lib/gs/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/gs/doc/src/part.xml b/lib/gs/doc/src/part.xml
index 6ae945a9db..99c3f20243 100644
--- a/lib/gs/doc/src/part.xml
+++ b/lib/gs/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/gs/doc/src/part_notes.xml b/lib/gs/doc/src/part_notes.xml
index a829534bfb..c8876a14d4 100644
--- a/lib/gs/doc/src/part_notes.xml
+++ b/lib/gs/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/gs/doc/src/ref_man.xml b/lib/gs/doc/src/ref_man.xml
index 1c48ee1f31..1e701ab71b 100644
--- a/lib/gs/doc/src/ref_man.xml
+++ b/lib/gs/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/gs/examples/Makefile b/lib/gs/examples/Makefile
index eab10d125b..2612e67f88 100644
--- a/lib/gs/examples/Makefile
+++ b/lib/gs/examples/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2012. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/gs/examples/ball.erl b/lib/gs/examples/ball.erl
index ccd76619a9..c5d1e10db5 100644
--- a/lib/gs/examples/ball.erl
+++ b/lib/gs/examples/ball.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/examples/browser.erl b/lib/gs/examples/browser.erl
index 2037b1bf0d..14aca11662 100644
--- a/lib/gs/examples/browser.erl
+++ b/lib/gs/examples/browser.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/examples/calc.erl b/lib/gs/examples/calc.erl
index d3bcda4732..6a58475f13 100644
--- a/lib/gs/examples/calc.erl
+++ b/lib/gs/examples/calc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/examples/calc2.erl b/lib/gs/examples/calc2.erl
index 89d1c00527..bf9f9b7bbd 100644
--- a/lib/gs/examples/calc2.erl
+++ b/lib/gs/examples/calc2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/examples/color_demo.erl b/lib/gs/examples/color_demo.erl
index 8c9fd98753..5d2170a394 100644
--- a/lib/gs/examples/color_demo.erl
+++ b/lib/gs/examples/color_demo.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/examples/color_demo2.erl b/lib/gs/examples/color_demo2.erl
index 918d451f5d..3e0115c831 100644
--- a/lib/gs/examples/color_demo2.erl
+++ b/lib/gs/examples/color_demo2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/examples/distrib_draw.erl b/lib/gs/examples/distrib_draw.erl
index 94177946a1..f704e2479e 100644
--- a/lib/gs/examples/distrib_draw.erl
+++ b/lib/gs/examples/distrib_draw.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/examples/entry_demo.erl b/lib/gs/examples/entry_demo.erl
index 923784658c..f37780f352 100644
--- a/lib/gs/examples/entry_demo.erl
+++ b/lib/gs/examples/entry_demo.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/examples/event_test.erl b/lib/gs/examples/event_test.erl
index 03408a3ef6..ff2029ca01 100644
--- a/lib/gs/examples/event_test.erl
+++ b/lib/gs/examples/event_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/examples/file_dialog.erl b/lib/gs/examples/file_dialog.erl
index b47c525592..1dffc5b009 100644
--- a/lib/gs/examples/file_dialog.erl
+++ b/lib/gs/examples/file_dialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/examples/focus_demo.erl b/lib/gs/examples/focus_demo.erl
index ea4700e63b..1a69241a38 100644
--- a/lib/gs/examples/focus_demo.erl
+++ b/lib/gs/examples/focus_demo.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/examples/frac.erl b/lib/gs/examples/frac.erl
index 748837b6ce..33d25d34ec 100644
--- a/lib/gs/examples/frac.erl
+++ b/lib/gs/examples/frac.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/examples/line_demo.erl b/lib/gs/examples/line_demo.erl
index da759a9684..25390d09b5 100644
--- a/lib/gs/examples/line_demo.erl
+++ b/lib/gs/examples/line_demo.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/examples/man.erl b/lib/gs/examples/man.erl
index 35c70838b6..97d897e191 100644
--- a/lib/gs/examples/man.erl
+++ b/lib/gs/examples/man.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/examples/menu_demo.erl b/lib/gs/examples/menu_demo.erl
index 2fe96de132..c739e1dc87 100644
--- a/lib/gs/examples/menu_demo.erl
+++ b/lib/gs/examples/menu_demo.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/examples/rubber.erl b/lib/gs/examples/rubber.erl
index 12622e5d94..129359dd03 100644
--- a/lib/gs/examples/rubber.erl
+++ b/lib/gs/examples/rubber.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/Makefile b/lib/gs/src/Makefile
index ff3080e20e..e19ce822b9 100644
--- a/lib/gs/src/Makefile
+++ b/lib/gs/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2012. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gs.appup.src b/lib/gs/src/gs.appup.src
index a2e87ee777..6cc21676e8 100644
--- a/lib/gs/src/gs.appup.src
+++ b/lib/gs/src/gs.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gs.erl b/lib/gs/src/gs.erl
index 7dd7eb60e3..23012da75d 100644
--- a/lib/gs/src/gs.erl
+++ b/lib/gs/src/gs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gs_frontend.erl b/lib/gs/src/gs_frontend.erl
index 2ebeb6c592..f46fdb36bb 100644
--- a/lib/gs/src/gs_frontend.erl
+++ b/lib/gs/src/gs_frontend.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gs_make.erl b/lib/gs/src/gs_make.erl
index 029bfc09ce..061b1944d1 100644
--- a/lib/gs/src/gs_make.erl
+++ b/lib/gs/src/gs_make.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gs_packer.erl b/lib/gs/src/gs_packer.erl
index cbbc003e7e..d16849e4e9 100644
--- a/lib/gs/src/gs_packer.erl
+++ b/lib/gs/src/gs_packer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gs_widgets.erl b/lib/gs/src/gs_widgets.erl
index 23cece9997..f0351049f9 100644
--- a/lib/gs/src/gs_widgets.erl
+++ b/lib/gs/src/gs_widgets.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gse.erl b/lib/gs/src/gse.erl
index 03d7f4d81a..10fb341894 100644
--- a/lib/gs/src/gse.erl
+++ b/lib/gs/src/gse.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk.erl b/lib/gs/src/gstk.erl
index 3a3f3fa536..3119245db7 100644
--- a/lib/gs/src/gstk.erl
+++ b/lib/gs/src/gstk.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk.hrl b/lib/gs/src/gstk.hrl
index c3649867ce..931057573f 100644
--- a/lib/gs/src/gstk.hrl
+++ b/lib/gs/src/gstk.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_arc.erl b/lib/gs/src/gstk_arc.erl
index 91ca4353ef..c38bbf4756 100644
--- a/lib/gs/src/gstk_arc.erl
+++ b/lib/gs/src/gstk_arc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_button.erl b/lib/gs/src/gstk_button.erl
index 4885ee8a1c..2b466c30c3 100644
--- a/lib/gs/src/gstk_button.erl
+++ b/lib/gs/src/gstk_button.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_canvas.erl b/lib/gs/src/gstk_canvas.erl
index 90239455cd..102b81df7a 100644
--- a/lib/gs/src/gstk_canvas.erl
+++ b/lib/gs/src/gstk_canvas.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_checkbutton.erl b/lib/gs/src/gstk_checkbutton.erl
index 34246d67f8..ac8abaedf3 100644
--- a/lib/gs/src/gstk_checkbutton.erl
+++ b/lib/gs/src/gstk_checkbutton.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_db.erl b/lib/gs/src/gstk_db.erl
index f0eb6f55d4..d9379cb3c8 100644
--- a/lib/gs/src/gstk_db.erl
+++ b/lib/gs/src/gstk_db.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_editor.erl b/lib/gs/src/gstk_editor.erl
index 959e17a365..6376efc851 100644
--- a/lib/gs/src/gstk_editor.erl
+++ b/lib/gs/src/gstk_editor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_entry.erl b/lib/gs/src/gstk_entry.erl
index be72c6a1f2..a83bf2f896 100644
--- a/lib/gs/src/gstk_entry.erl
+++ b/lib/gs/src/gstk_entry.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_font.erl b/lib/gs/src/gstk_font.erl
index f108b2f765..80cc46d493 100644
--- a/lib/gs/src/gstk_font.erl
+++ b/lib/gs/src/gstk_font.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_frame.erl b/lib/gs/src/gstk_frame.erl
index a1ebb94407..2e9d160eef 100644
--- a/lib/gs/src/gstk_frame.erl
+++ b/lib/gs/src/gstk_frame.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_generic.erl b/lib/gs/src/gstk_generic.erl
index eb9adbdc05..db4e2fdff4 100644
--- a/lib/gs/src/gstk_generic.erl
+++ b/lib/gs/src/gstk_generic.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_grid.erl b/lib/gs/src/gstk_grid.erl
index 155aa071e4..4e8cffc018 100644
--- a/lib/gs/src/gstk_grid.erl
+++ b/lib/gs/src/gstk_grid.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_gridline.erl b/lib/gs/src/gstk_gridline.erl
index 6b22980835..d504ed5319 100644
--- a/lib/gs/src/gstk_gridline.erl
+++ b/lib/gs/src/gstk_gridline.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_gs.erl b/lib/gs/src/gstk_gs.erl
index 0f07c1da04..80be066626 100644
--- a/lib/gs/src/gstk_gs.erl
+++ b/lib/gs/src/gstk_gs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_image.erl b/lib/gs/src/gstk_image.erl
index 797489bcf8..124bda77a2 100644
--- a/lib/gs/src/gstk_image.erl
+++ b/lib/gs/src/gstk_image.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_label.erl b/lib/gs/src/gstk_label.erl
index 99c817aed8..2cdd36f331 100644
--- a/lib/gs/src/gstk_label.erl
+++ b/lib/gs/src/gstk_label.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_line.erl b/lib/gs/src/gstk_line.erl
index 4a9c02c53a..18c87b2011 100644
--- a/lib/gs/src/gstk_line.erl
+++ b/lib/gs/src/gstk_line.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_listbox.erl b/lib/gs/src/gstk_listbox.erl
index 351c1a12b2..50d0503629 100644
--- a/lib/gs/src/gstk_listbox.erl
+++ b/lib/gs/src/gstk_listbox.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_menu.erl b/lib/gs/src/gstk_menu.erl
index 4e372bda2a..2f12a20a7d 100644
--- a/lib/gs/src/gstk_menu.erl
+++ b/lib/gs/src/gstk_menu.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_menubar.erl b/lib/gs/src/gstk_menubar.erl
index 27c472e218..9916f64e00 100644
--- a/lib/gs/src/gstk_menubar.erl
+++ b/lib/gs/src/gstk_menubar.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_menubutton.erl b/lib/gs/src/gstk_menubutton.erl
index 7025d6b179..3f51a9df99 100644
--- a/lib/gs/src/gstk_menubutton.erl
+++ b/lib/gs/src/gstk_menubutton.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_menuitem.erl b/lib/gs/src/gstk_menuitem.erl
index ddc8dd64f7..968568a9a7 100644
--- a/lib/gs/src/gstk_menuitem.erl
+++ b/lib/gs/src/gstk_menuitem.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_oval.erl b/lib/gs/src/gstk_oval.erl
index 31174354e6..8e06378c0b 100644
--- a/lib/gs/src/gstk_oval.erl
+++ b/lib/gs/src/gstk_oval.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_polygon.erl b/lib/gs/src/gstk_polygon.erl
index 92ec18198e..013682d353 100644
--- a/lib/gs/src/gstk_polygon.erl
+++ b/lib/gs/src/gstk_polygon.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_port_handler.erl b/lib/gs/src/gstk_port_handler.erl
index 72297032c7..fee3dc7dac 100644
--- a/lib/gs/src/gstk_port_handler.erl
+++ b/lib/gs/src/gstk_port_handler.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_radiobutton.erl b/lib/gs/src/gstk_radiobutton.erl
index d24c5a81ae..a778f46038 100644
--- a/lib/gs/src/gstk_radiobutton.erl
+++ b/lib/gs/src/gstk_radiobutton.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_rectangle.erl b/lib/gs/src/gstk_rectangle.erl
index fe16fa7c67..21e2a06cb4 100644
--- a/lib/gs/src/gstk_rectangle.erl
+++ b/lib/gs/src/gstk_rectangle.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_scale.erl b/lib/gs/src/gstk_scale.erl
index 4afd8f61ff..3512304867 100644
--- a/lib/gs/src/gstk_scale.erl
+++ b/lib/gs/src/gstk_scale.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_text.erl b/lib/gs/src/gstk_text.erl
index b8e6f53f00..b931030a3f 100644
--- a/lib/gs/src/gstk_text.erl
+++ b/lib/gs/src/gstk_text.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_widgets.erl b/lib/gs/src/gstk_widgets.erl
index b4e4b970d3..52c955af50 100644
--- a/lib/gs/src/gstk_widgets.erl
+++ b/lib/gs/src/gstk_widgets.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/gstk_window.erl b/lib/gs/src/gstk_window.erl
index 8a9ef47100..c14cf2fd81 100644
--- a/lib/gs/src/gstk_window.erl
+++ b/lib/gs/src/gstk_window.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/tcl2erl.erl b/lib/gs/src/tcl2erl.erl
index f10d5b46b9..04229ccf49 100644
--- a/lib/gs/src/tcl2erl.erl
+++ b/lib/gs/src/tcl2erl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/tool_file_dialog.erl b/lib/gs/src/tool_file_dialog.erl
index c42f6af17c..a6d6f55f1f 100644
--- a/lib/gs/src/tool_file_dialog.erl
+++ b/lib/gs/src/tool_file_dialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/src/tool_utils.erl b/lib/gs/src/tool_utils.erl
index 9f2caa3eac..841aa926da 100644
--- a/lib/gs/src/tool_utils.erl
+++ b/lib/gs/src/tool_utils.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/gs/tcl/Makefile b/lib/gs/tcl/Makefile
index 9a8a00905d..2eb06cec61 100644
--- a/lib/gs/tcl/Makefile
+++ b/lib/gs/tcl/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2009. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/gs/tcl/Makefile.in b/lib/gs/tcl/Makefile.in
index f9e5a5db16..762973bd72 100644
--- a/lib/gs/tcl/Makefile.in
+++ b/lib/gs/tcl/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2012. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/Makefile b/lib/hipe/Makefile
index f32faa9086..0676484fca 100644
--- a/lib/hipe/Makefile
+++ b/lib/hipe/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/Makefile b/lib/hipe/amd64/Makefile
index 29aabea17c..0d81ff4d72 100644
--- a/lib/hipe/amd64/Makefile
+++ b/lib/hipe/amd64/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_amd64_assemble.erl b/lib/hipe/amd64/hipe_amd64_assemble.erl
index 1bc2fd0c1f..a7b11f7c72 100644
--- a/lib/hipe/amd64/hipe_amd64_assemble.erl
+++ b/lib/hipe/amd64/hipe_amd64_assemble.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_amd64_defuse.erl b/lib/hipe/amd64/hipe_amd64_defuse.erl
index 7f3ba6a466..907f078f3f 100644
--- a/lib/hipe/amd64/hipe_amd64_defuse.erl
+++ b/lib/hipe/amd64/hipe_amd64_defuse.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_amd64_encode.erl b/lib/hipe/amd64/hipe_amd64_encode.erl
index c10e6b68a7..df15732cea 100644
--- a/lib/hipe/amd64/hipe_amd64_encode.erl
+++ b/lib/hipe/amd64/hipe_amd64_encode.erl
@@ -1,7 +1,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_amd64_frame.erl b/lib/hipe/amd64/hipe_amd64_frame.erl
index 412c021fec..f3bcdf302a 100644
--- a/lib/hipe/amd64/hipe_amd64_frame.erl
+++ b/lib/hipe/amd64/hipe_amd64_frame.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_amd64_liveness.erl b/lib/hipe/amd64/hipe_amd64_liveness.erl
index 9d8b80f337..5cfdbb0f3e 100644
--- a/lib/hipe/amd64/hipe_amd64_liveness.erl
+++ b/lib/hipe/amd64/hipe_amd64_liveness.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_amd64_main.erl b/lib/hipe/amd64/hipe_amd64_main.erl
index e95d6fec00..c22c6cd73b 100644
--- a/lib/hipe/amd64/hipe_amd64_main.erl
+++ b/lib/hipe/amd64/hipe_amd64_main.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_amd64_pp.erl b/lib/hipe/amd64/hipe_amd64_pp.erl
index bb10086865..7c3ee8458a 100644
--- a/lib/hipe/amd64/hipe_amd64_pp.erl
+++ b/lib/hipe/amd64/hipe_amd64_pp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_amd64_ra.erl b/lib/hipe/amd64/hipe_amd64_ra.erl
index 79e915fbe2..1d8453d54d 100644
--- a/lib/hipe/amd64/hipe_amd64_ra.erl
+++ b/lib/hipe/amd64/hipe_amd64_ra.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_amd64_ra_finalise.erl b/lib/hipe/amd64/hipe_amd64_ra_finalise.erl
index 721fe20a26..d835c3ec14 100644
--- a/lib/hipe/amd64/hipe_amd64_ra_finalise.erl
+++ b/lib/hipe/amd64/hipe_amd64_ra_finalise.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_amd64_ra_ls.erl b/lib/hipe/amd64/hipe_amd64_ra_ls.erl
index 6a8034305b..9361b91f04 100644
--- a/lib/hipe/amd64/hipe_amd64_ra_ls.erl
+++ b/lib/hipe/amd64/hipe_amd64_ra_ls.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_amd64_ra_naive.erl b/lib/hipe/amd64/hipe_amd64_ra_naive.erl
index f73c67f5c7..38218a65dc 100644
--- a/lib/hipe/amd64/hipe_amd64_ra_naive.erl
+++ b/lib/hipe/amd64/hipe_amd64_ra_naive.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_amd64_ra_postconditions.erl b/lib/hipe/amd64/hipe_amd64_ra_postconditions.erl
index 35244aa484..2d03239ea6 100644
--- a/lib/hipe/amd64/hipe_amd64_ra_postconditions.erl
+++ b/lib/hipe/amd64/hipe_amd64_ra_postconditions.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_amd64_ra_sse2_postconditions.erl b/lib/hipe/amd64/hipe_amd64_ra_sse2_postconditions.erl
index 0568a46942..5451f1fe7d 100644
--- a/lib/hipe/amd64/hipe_amd64_ra_sse2_postconditions.erl
+++ b/lib/hipe/amd64/hipe_amd64_ra_sse2_postconditions.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_amd64_ra_x87_ls.erl b/lib/hipe/amd64/hipe_amd64_ra_x87_ls.erl
index 89852ed3d8..6da3f44cd3 100644
--- a/lib/hipe/amd64/hipe_amd64_ra_x87_ls.erl
+++ b/lib/hipe/amd64/hipe_amd64_ra_x87_ls.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_amd64_registers.erl b/lib/hipe/amd64/hipe_amd64_registers.erl
index c2af44982c..780c2cc547 100644
--- a/lib/hipe/amd64/hipe_amd64_registers.erl
+++ b/lib/hipe/amd64/hipe_amd64_registers.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_amd64_spill_restore.erl b/lib/hipe/amd64/hipe_amd64_spill_restore.erl
index b5c4de2613..61e2dfa26d 100644
--- a/lib/hipe/amd64/hipe_amd64_spill_restore.erl
+++ b/lib/hipe/amd64/hipe_amd64_spill_restore.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_amd64_x87.erl b/lib/hipe/amd64/hipe_amd64_x87.erl
index f206205307..1f42e4749d 100644
--- a/lib/hipe/amd64/hipe_amd64_x87.erl
+++ b/lib/hipe/amd64/hipe_amd64_x87.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/amd64/hipe_rtl_to_amd64.erl b/lib/hipe/amd64/hipe_rtl_to_amd64.erl
index 5d09bdb877..d55b5b2c22 100644
--- a/lib/hipe/amd64/hipe_rtl_to_amd64.erl
+++ b/lib/hipe/amd64/hipe_rtl_to_amd64.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/Makefile b/lib/hipe/arm/Makefile
index 889c6a13e4..6622680ee1 100644
--- a/lib/hipe/arm/Makefile
+++ b/lib/hipe/arm/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2012. All Rights Reserved.
+# Copyright Ericsson AB 2005-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_arm.erl b/lib/hipe/arm/hipe_arm.erl
index 2ac3ca81b4..f34525fa3b 100644
--- a/lib/hipe/arm/hipe_arm.erl
+++ b/lib/hipe/arm/hipe_arm.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_arm.hrl b/lib/hipe/arm/hipe_arm.hrl
index a15c366065..558174e3fc 100644
--- a/lib/hipe/arm/hipe_arm.hrl
+++ b/lib/hipe/arm/hipe_arm.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_arm_assemble.erl b/lib/hipe/arm/hipe_arm_assemble.erl
index 5f98c6593e..4a245cd853 100644
--- a/lib/hipe/arm/hipe_arm_assemble.erl
+++ b/lib/hipe/arm/hipe_arm_assemble.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_arm_cfg.erl b/lib/hipe/arm/hipe_arm_cfg.erl
index f30fa5a0b6..f2fa0a5164 100644
--- a/lib/hipe/arm/hipe_arm_cfg.erl
+++ b/lib/hipe/arm/hipe_arm_cfg.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_arm_defuse.erl b/lib/hipe/arm/hipe_arm_defuse.erl
index 8f194c4b48..f57b0e601c 100644
--- a/lib/hipe/arm/hipe_arm_defuse.erl
+++ b/lib/hipe/arm/hipe_arm_defuse.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_arm_encode.erl b/lib/hipe/arm/hipe_arm_encode.erl
index 05ded31657..9368cbf628 100644
--- a/lib/hipe/arm/hipe_arm_encode.erl
+++ b/lib/hipe/arm/hipe_arm_encode.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_arm_finalise.erl b/lib/hipe/arm/hipe_arm_finalise.erl
index f4c8f8cfbc..a4b2f9c73c 100644
--- a/lib/hipe/arm/hipe_arm_finalise.erl
+++ b/lib/hipe/arm/hipe_arm_finalise.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_arm_frame.erl b/lib/hipe/arm/hipe_arm_frame.erl
index 2f0d4c3c50..e1e441a967 100644
--- a/lib/hipe/arm/hipe_arm_frame.erl
+++ b/lib/hipe/arm/hipe_arm_frame.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_arm_liveness_gpr.erl b/lib/hipe/arm/hipe_arm_liveness_gpr.erl
index 25265b25ea..82cc5a7a67 100644
--- a/lib/hipe/arm/hipe_arm_liveness_gpr.erl
+++ b/lib/hipe/arm/hipe_arm_liveness_gpr.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_arm_main.erl b/lib/hipe/arm/hipe_arm_main.erl
index 46cd71d89f..dce1193b24 100644
--- a/lib/hipe/arm/hipe_arm_main.erl
+++ b/lib/hipe/arm/hipe_arm_main.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_arm_pp.erl b/lib/hipe/arm/hipe_arm_pp.erl
index 744d06d16d..18aca1fc6b 100644
--- a/lib/hipe/arm/hipe_arm_pp.erl
+++ b/lib/hipe/arm/hipe_arm_pp.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_arm_ra.erl b/lib/hipe/arm/hipe_arm_ra.erl
index 5824fcb8d8..2f65e864fd 100644
--- a/lib/hipe/arm/hipe_arm_ra.erl
+++ b/lib/hipe/arm/hipe_arm_ra.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_arm_ra_finalise.erl b/lib/hipe/arm/hipe_arm_ra_finalise.erl
index b67c7407a2..4faeadcd7f 100644
--- a/lib/hipe/arm/hipe_arm_ra_finalise.erl
+++ b/lib/hipe/arm/hipe_arm_ra_finalise.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_arm_ra_ls.erl b/lib/hipe/arm/hipe_arm_ra_ls.erl
index 500256e0e3..d9a360d00c 100644
--- a/lib/hipe/arm/hipe_arm_ra_ls.erl
+++ b/lib/hipe/arm/hipe_arm_ra_ls.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_arm_ra_naive.erl b/lib/hipe/arm/hipe_arm_ra_naive.erl
index b244acd3fe..6201269f44 100644
--- a/lib/hipe/arm/hipe_arm_ra_naive.erl
+++ b/lib/hipe/arm/hipe_arm_ra_naive.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_arm_ra_postconditions.erl b/lib/hipe/arm/hipe_arm_ra_postconditions.erl
index 1ac2521928..40978e65f6 100644
--- a/lib/hipe/arm/hipe_arm_ra_postconditions.erl
+++ b/lib/hipe/arm/hipe_arm_ra_postconditions.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_arm_registers.erl b/lib/hipe/arm/hipe_arm_registers.erl
index 31579c4ecb..24cd929d41 100644
--- a/lib/hipe/arm/hipe_arm_registers.erl
+++ b/lib/hipe/arm/hipe_arm_registers.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/arm/hipe_rtl_to_arm.erl b/lib/hipe/arm/hipe_rtl_to_arm.erl
index 3455c753d6..ad5a559995 100644
--- a/lib/hipe/arm/hipe_rtl_to_arm.erl
+++ b/lib/hipe/arm/hipe_rtl_to_arm.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/cerl/Makefile b/lib/hipe/cerl/Makefile
index 0938010577..78930154a9 100644
--- a/lib/hipe/cerl/Makefile
+++ b/lib/hipe/cerl/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2012. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/cerl/cerl_closurean.erl b/lib/hipe/cerl/cerl_closurean.erl
index 7080ff4f3b..d37c91e5c6 100644
--- a/lib/hipe/cerl/cerl_closurean.erl
+++ b/lib/hipe/cerl/cerl_closurean.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/cerl/cerl_hipe_primops.hrl b/lib/hipe/cerl/cerl_hipe_primops.hrl
index 361227540a..3efb9a3bdd 100644
--- a/lib/hipe/cerl/cerl_hipe_primops.hrl
+++ b/lib/hipe/cerl/cerl_hipe_primops.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/cerl/cerl_lib.erl b/lib/hipe/cerl/cerl_lib.erl
index 52a5c987e0..0bc77909d9 100644
--- a/lib/hipe/cerl/cerl_lib.erl
+++ b/lib/hipe/cerl/cerl_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/cerl/cerl_messagean.erl b/lib/hipe/cerl/cerl_messagean.erl
index 5e23015cbc..7df0a245fb 100644
--- a/lib/hipe/cerl/cerl_messagean.erl
+++ b/lib/hipe/cerl/cerl_messagean.erl
@@ -1,7 +1,7 @@
%% =====================================================================
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/cerl/cerl_pmatch.erl b/lib/hipe/cerl/cerl_pmatch.erl
index ce76d244b6..594f2bf81c 100644
--- a/lib/hipe/cerl/cerl_pmatch.erl
+++ b/lib/hipe/cerl/cerl_pmatch.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/cerl/cerl_prettypr.erl b/lib/hipe/cerl/cerl_prettypr.erl
index 1a6e6999fe..f0acab99e3 100644
--- a/lib/hipe/cerl/cerl_prettypr.erl
+++ b/lib/hipe/cerl/cerl_prettypr.erl
@@ -1,7 +1,7 @@
%% =====================================================================
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/cerl/cerl_typean.erl b/lib/hipe/cerl/cerl_typean.erl
index 13ee19c82a..ddc48c7915 100644
--- a/lib/hipe/cerl/cerl_typean.erl
+++ b/lib/hipe/cerl/cerl_typean.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl
index 7684dc4a81..9453ca6c6f 100644
--- a/lib/hipe/cerl/erl_bif_types.erl
+++ b/lib/hipe/cerl/erl_bif_types.erl
@@ -115,7 +115,16 @@
t_tuple_size/2,
t_tuple_subtypes/2,
t_is_map/2,
- t_map/0
+ t_map/0,
+ t_map/3,
+ t_map_def_key/2,
+ t_map_def_val/2,
+ t_map_get/3,
+ t_map_is_key/3,
+ t_map_entries/2,
+ t_map_put/3,
+ t_map_update/3,
+ map_pairwise_merge/3
]).
-ifdef(DO_ERL_BIF_TYPES_TEST).
@@ -755,7 +764,7 @@ type(erlang, length, 1, Xs, Opaques) ->
strict(erlang, length, 1, Xs, fun (_) -> t_non_neg_fixnum() end, Opaques);
%% Guard bif, needs to be here.
type(erlang, map_size, 1, Xs, Opaques) ->
- strict(erlang, map_size, 1, Xs, fun (_) -> t_non_neg_integer() end, Opaques);
+ type(maps, size, 1, Xs, Opaques);
type(erlang, make_fun, 3, Xs, Opaques) ->
strict(erlang, make_fun, 3, Xs,
fun ([_, _, Arity]) ->
@@ -1645,6 +1654,89 @@ type(lists, zipwith3, 4, Xs, Opaques) ->
fun ([F,_As,_Bs,_Cs]) -> t_sup(t_list(t_fun_range(F, Opaques)),
t_nil()) end, Opaques);
+%%-- maps ---------------------------------------------------------------------
+type(maps, from_list, 1, Xs, Opaques) ->
+ strict(maps, from_list, 1, Xs,
+ fun ([List]) ->
+ case t_is_nil(List, Opaques) of
+ true -> t_from_term(#{});
+ false ->
+ T = t_list_elements(List, Opaques),
+ case t_tuple_subtypes(T, Opaques) of
+ unknown -> t_map();
+ Stypes when length(Stypes) >= 1 ->
+ t_sup([begin
+ [K, V] = t_tuple_args(Args, Opaques),
+ t_map([], K, V)
+ end || Args <- Stypes])
+ end
+ end
+ end, Opaques);
+type(maps, get, 2, Xs, Opaques) ->
+ strict(maps, get, 2, Xs,
+ fun ([Key, Map]) ->
+ t_map_get(Key, Map, Opaques)
+ end, Opaques);
+type(maps, is_key, 2, Xs, Opaques) ->
+ strict(maps, is_key, 2, Xs,
+ fun ([Key, Map]) ->
+ t_map_is_key(Key, Map, Opaques)
+ end, Opaques);
+type(maps, merge, 2, Xs, Opaques) ->
+ strict(maps, merge, 2, Xs,
+ fun ([MapA, MapB]) ->
+ ADefK = t_map_def_key(MapA, Opaques),
+ BDefK = t_map_def_key(MapB, Opaques),
+ ADefV = t_map_def_val(MapA, Opaques),
+ BDefV = t_map_def_val(MapB, Opaques),
+ t_map(map_pairwise_merge(
+ fun(K, _, _, mandatory, V) -> {K, mandatory, V};
+ (K, MNess, VA, optional, VB) -> {K, MNess, t_sup(VA,VB)}
+ end, MapA, MapB),
+ t_sup(ADefK, BDefK), t_sup(ADefV, BDefV))
+ end, Opaques);
+type(maps, put, 3, Xs, Opaques) ->
+ strict(maps, put, 3, Xs,
+ fun ([Key, Value, Map]) ->
+ t_map_put({Key, Value}, Map, Opaques)
+ end, Opaques);
+type(maps, size, 1, Xs, Opaques) ->
+ strict(maps, size, 1, Xs,
+ fun ([Map]) ->
+ Mand = [E || E={_,mandatory,_} <- t_map_entries(Map, Opaques)],
+ LowerBound = length(Mand),
+ case t_is_none(t_map_def_key(Map, Opaques)) of
+ false -> t_from_range(LowerBound, pos_inf);
+ true ->
+ Opt = [E || E={_,optional,_} <- t_map_entries(Map, Opaques)],
+ UpperBound = LowerBound + length(Opt),
+ t_from_range(LowerBound, UpperBound)
+ end
+ end, Opaques);
+type(maps, to_list, 1, Xs, Opaques) ->
+ strict(maps, to_list, 1, Xs,
+ fun ([Map]) ->
+ DefK = t_map_def_key(Map, Opaques),
+ DefV = t_map_def_val(Map, Opaques),
+ Pairs = t_map_entries(Map, Opaques),
+ EType = lists:foldl(
+ fun({K,_,V},EType0) ->
+ case t_is_none(V) of
+ true -> t_subtract(EType0, t_tuple([K,t_any()]));
+ false -> t_sup(EType0, t_tuple([K,V]))
+ end
+ end, t_tuple([DefK, DefV]), Pairs),
+ case t_is_none(EType) of
+ true -> t_nil();
+ false -> t_list(EType)
+ end
+ end, Opaques);
+type(maps, update, 3, Xs, Opaques) ->
+ strict(maps, update, 3, Xs,
+ fun ([Key, Value, Map]) ->
+ t_map_update({Key, Value}, Map, Opaques)
+ end, Opaques);
+
%%-----------------------------------------------------------------------------
type(M, F, A, Xs, _O) when is_atom(M), is_atom(F),
is_integer(A), 0 =< A, A =< 255 ->
@@ -2556,6 +2648,23 @@ arg_types(lists, zipwith, 3) ->
[t_fun([t_any(), t_any()], t_any()), t_list(), t_list()];
arg_types(lists, zipwith3, 4) ->
[t_fun([t_any(), t_any(), t_any()], t_any()), t_list(), t_list(), t_list()];
+%%------- maps ----------------------------------------------------------------
+arg_types(maps, from_list, 1) ->
+ [t_list(t_tuple(2))];
+arg_types(maps, get, 2) ->
+ [t_any(), t_map()];
+arg_types(maps, is_key, 2) ->
+ [t_any(), t_map()];
+arg_types(maps, merge, 2) ->
+ [t_map(), t_map()];
+arg_types(maps, put, 3) ->
+ [t_any(), t_any(), t_map()];
+arg_types(maps, size, 1) ->
+ [t_map()];
+arg_types(maps, to_list, 1) ->
+ [t_map()];
+arg_types(maps, update, 3) ->
+ [t_any(), t_any(), t_map()];
arg_types(M, F, A) when is_atom(M), is_atom(F),
is_integer(A), 0 =< A, A =< 255 ->
unknown. % safe approximation for all functions.
diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl
index fae12d7421..84addcc105 100644
--- a/lib/hipe/cerl/erl_types.erl
+++ b/lib/hipe/cerl/erl_types.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -140,6 +140,8 @@
t_is_port/1, t_is_port/2,
t_is_maybe_improper_list/1, t_is_maybe_improper_list/2,
t_is_reference/1, t_is_reference/2,
+ t_is_singleton/1,
+ t_is_singleton/2,
t_is_string/1,
t_is_subtype/2,
t_is_tuple/1, t_is_tuple/2,
@@ -152,6 +154,14 @@
t_list_termination/1, t_list_termination/2,
t_map/0,
t_map/1,
+ t_map/3,
+ t_map_entries/2, t_map_entries/1,
+ t_map_def_key/2, t_map_def_key/1,
+ t_map_def_val/2, t_map_def_val/1,
+ t_map_get/2, t_map_get/3,
+ t_map_is_key/2, t_map_is_key/3,
+ t_map_update/2, t_map_update/3,
+ t_map_put/2, t_map_put/3,
t_matchstate/0,
t_matchstate/2,
t_matchstate_present/1,
@@ -178,6 +188,7 @@
%% t_maybe_improper_list/2,
t_product/1,
t_reference/0,
+ t_singleton_to_term/2,
t_string/0,
t_struct_from_opaque/2,
t_subst/2,
@@ -208,7 +219,8 @@
lift_list_to_pos_empty/1, lift_list_to_pos_empty/2,
is_opaque_type/2,
is_erl_type/1,
- atom_to_string/1
+ atom_to_string/1,
+ map_pairwise_merge/3
]).
%%-define(DO_ERL_TYPES_TEST, true).
@@ -224,7 +236,7 @@
-export([t_is_identifier/1]).
-endif.
--export_type([erl_type/0, opaques/0, type_table/0, var_table/0]).
+-export_type([erl_type/0, opaques/0, type_table/0]).
%%-define(DEBUG, true).
@@ -341,7 +353,8 @@
-define(nonempty_list(Types, Term),?list(Types, Term, ?nonempty_qual)).
-define(number(Set, Qualifier), #c{tag=?number_tag, elements=Set,
qualifier=Qualifier}).
--define(map(Pairs), #c{tag=?map_tag, elements=Pairs}).
+-define(map(Pairs,DefKey,DefVal),
+ #c{tag=?map_tag, elements={Pairs,DefKey,DefVal}}).
-define(opaque(Optypes), #c{tag=?opaque_tag, elements=Optypes}).
-define(product(Types), #c{tag=?product_tag, elements=Types}).
-define(tuple(Types, Arity, Qual), #c{tag=?tuple_tag, elements=Types,
@@ -367,7 +380,7 @@
-type type_table() :: dict:dict(record_key() | type_key(),
record_value() | type_value()).
--type var_table() :: dict:dict(atom(), erl_type()).
+-type var_table() :: #{atom() => erl_type()}.
%%-----------------------------------------------------------------------------
%% Unions
@@ -484,9 +497,8 @@ t_contains_opaque(?int_range(_From, _To), _Opaques) -> false;
t_contains_opaque(?int_set(_Set), _Opaques) -> false;
t_contains_opaque(?list(Type, Tail, _), Opaques) ->
t_contains_opaque(Type, Opaques) orelse t_contains_opaque(Tail, Opaques);
-t_contains_opaque(?map(_) = Map, Opaques) ->
- list_contains_opaque(map_values(Map), Opaques) orelse
- list_contains_opaque(map_keys(Map), Opaques);
+t_contains_opaque(?map(_, _, _) = Map, Opaques) ->
+ list_contains_opaque(map_all_types(Map), Opaques);
t_contains_opaque(?matchstate(_P, _Slots), _Opaques) -> false;
t_contains_opaque(?nil, _Opaques) -> false;
t_contains_opaque(?number(_Set, _Tag), _Opaques) -> false;
@@ -1581,16 +1593,107 @@ lift_list_to_pos_empty(?list(Content, Termination, _)) ->
%%-----------------------------------------------------------------------------
%% Maps
%%
+%% Representation:
+%% ?map(Pairs, DefaultKey, DefaultValue)
+%%
+%% Pairs is a sorted dictionary of types with a mandatoriness tag on each pair
+%% (t_map_dict()). DefaultKey and DefaultValue are plain types.
+%%
+%% A map M belongs to this type iff
+%% For each pair {KT, mandatory, VT} in Pairs, there exists a pair {K, V} in M
+%% such that K \in KT and V \in VT.
+%% For each pair {KT, optional, VT} in Pairs, either there exists no key K in
+%% M s.t. K in KT, or there exists a pair {K, V} in M such that K \in KT and
+%% V \in VT.
+%% For each remaining pair {K, V} in M (where remaining means that there is no
+%% key KT in Pairs s.t. K \in KT), K \in DefaultKey and V \in DefaultValue.
+%%
+%% Invariants:
+%% * The keys in Pairs are singleton types.
+%% * The values of Pairs must not be unit, and may only be none if the
+%% mandatoriness tag is 'optional'.
+%% * Optional must contain no pair {K,V} s.t. K is a subtype of DefaultKey and
+%% V is equal to DefaultKey.
+%% * DefaultKey must be the empty type iff DefaultValue is the empty type.
+%% * DefaultKey must not be a singleton type.
+%% * For every key K in Pairs, DefaultKey - K must not be representable; i.e.
+%% t_subtract(DefaultKey, K) must return DefaultKey.
+%% * For every pair {K, 'optional', ?none} in Pairs, K must be a subtype of
+%% DefaultKey.
+%% * Pairs must be sorted and not contain any duplicate keys.
+%%
+%% These invariants ensure that equal map types are represented by equal terms.
+
+-define(mand, mandatory).
+-define(opt, optional).
+
+-type t_map_mandatoriness() :: ?mand | ?opt.
+-type t_map_pair() :: {erl_type(), t_map_mandatoriness(), erl_type()}.
+-type t_map_dict() :: [t_map_pair()].
-spec t_map() -> erl_type().
t_map() ->
- ?map([]).
+ t_map([], t_any(), t_any()).
-spec t_map([{erl_type(), erl_type()}]) -> erl_type().
-t_map(_) ->
- ?map([]).
+t_map(L) ->
+ lists:foldl(fun t_map_put/2, t_map(), L).
+
+-spec t_map(t_map_dict(), erl_type(), erl_type()) -> erl_type().
+
+t_map(Pairs0, DefK0, DefV0) ->
+ DefK1 = lists:foldl(fun({K,_,_},Acc)->t_subtract(Acc,K)end, DefK0, Pairs0),
+ {DefK2, DefV1} =
+ case t_is_none_or_unit(DefK1) orelse t_is_none_or_unit(DefV0) of
+ true -> {?none, ?none};
+ false -> {DefK1, DefV0}
+ end,
+ {Pairs1, DefK, DefV}
+ = case is_singleton_type(DefK2) of
+ true -> {mapdict_insert({DefK2, ?opt, DefV1}, Pairs0), ?none, ?none};
+ false -> {Pairs0, DefK2, DefV1}
+ end,
+ Pairs = normalise_map_optionals(Pairs1, DefK, DefV),
+ %% Validate invariants of the map representation.
+ %% Since we needed to iterate over the arguments in order to normalise anyway,
+ %% we might as well save us some future pain and do this even without
+ %% define(DEBUG, true).
+ try
+ validate_map_elements(Pairs)
+ catch error:badarg -> error(badarg, [Pairs0,DefK0,DefV0]);
+ error:{badarg, E} -> error({badarg, E}, [Pairs0,DefK0,DefV0])
+ end,
+ ?map(Pairs, DefK, DefV).
+
+normalise_map_optionals([], _, _) -> [];
+normalise_map_optionals([E={K,?opt,?none}|T], DefK, DefV) ->
+ Diff = t_subtract(DefK, K),
+ case t_is_subtype(K, DefK) andalso DefK =:= Diff of
+ true -> [E|normalise_map_optionals(T, DefK, DefV)];
+ false -> normalise_map_optionals(T, Diff, DefV)
+ end;
+normalise_map_optionals([E={K,?opt,V}|T], DefK, DefV) ->
+ case t_is_equal(V, DefV) andalso t_is_subtype(K, DefK) of
+ true -> normalise_map_optionals(T, DefK, DefV);
+ false -> [E|normalise_map_optionals(T, DefK, DefV)]
+ end;
+normalise_map_optionals([E|T], DefK, DefV) ->
+ [E|normalise_map_optionals(T, DefK, DefV)].
+
+validate_map_elements([{_,?mand,?none}|_]) -> error({badarg, none_in_mand});
+validate_map_elements([{K1,_,_}|Rest=[{K2,_,_}|_]]) ->
+ case is_singleton_type(K1) andalso K1 < K2 of
+ false -> error(badarg);
+ true -> validate_map_elements(Rest)
+ end;
+validate_map_elements([{K,_,_}]) ->
+ case is_singleton_type(K) of
+ false -> error(badarg);
+ true -> true
+ end;
+validate_map_elements([]) -> true.
-spec t_is_map(erl_type()) -> boolean().
@@ -1602,9 +1705,242 @@ t_is_map(Type) ->
t_is_map(Type, Opaques) ->
do_opaque(Type, Opaques, fun is_map1/1).
-is_map1(?map(_)) -> true;
+is_map1(?map(_, _, _)) -> true;
is_map1(_) -> false.
+-spec t_map_entries(erl_type()) -> t_map_dict().
+
+t_map_entries(M) ->
+ t_map_entries(M, 'universe').
+
+-spec t_map_entries(erl_type(), opaques()) -> t_map_dict().
+
+t_map_entries(M, Opaques) ->
+ do_opaque(M, Opaques, fun map_entries/1).
+
+map_entries(?map(Pairs,_,_)) ->
+ Pairs.
+
+-spec t_map_def_key(erl_type()) -> erl_type().
+
+t_map_def_key(M) ->
+ t_map_def_key(M, 'universe').
+
+-spec t_map_def_key(erl_type(), opaques()) -> erl_type().
+
+t_map_def_key(M, Opaques) ->
+ do_opaque(M, Opaques, fun map_def_key/1).
+
+map_def_key(?map(_,DefK,_)) ->
+ DefK.
+
+-spec t_map_def_val(erl_type()) -> erl_type().
+
+t_map_def_val(M) ->
+ t_map_def_val(M, 'universe').
+
+-spec t_map_def_val(erl_type(), opaques()) -> erl_type().
+
+t_map_def_val(M, Opaques) ->
+ do_opaque(M, Opaques, fun map_def_val/1).
+
+map_def_val(?map(_,_,DefV)) ->
+ DefV.
+
+-spec mapdict_store(t_map_pair(), t_map_dict()) -> t_map_dict().
+
+mapdict_store(E={K,_,_}, [{K,_,_}|T]) -> [E|T];
+mapdict_store(E1={K1,_,_}, [E2={K2,_,_}|T]) when K1 > K2->
+ [E2|mapdict_store(E1, T)];
+mapdict_store(E={_,_,_}, T) -> [E|T].
+
+-spec mapdict_insert(t_map_pair(), t_map_dict()) -> t_map_dict().
+
+mapdict_insert(E={K,_,_}, D=[{K,_,_}|_]) -> error(badarg, [E, D]);
+mapdict_insert(E1={K1,_,_}, [E2={K2,_,_}|T]) when K1 > K2->
+ [E2|mapdict_insert(E1, T)];
+mapdict_insert(E={_,_,_}, T) -> [E|T].
+
+%% Merges the pairs of two maps together. Missing pairs become (?opt, DefV) or
+%% (?opt, ?none), depending on whether K \in DefK.
+-spec map_pairwise_merge(fun((erl_type(),
+ t_map_mandatoriness(), erl_type(),
+ t_map_mandatoriness(), erl_type())
+ -> t_map_pair() | false),
+ erl_type(), erl_type()) -> t_map_dict().
+map_pairwise_merge(F, ?map(APairs, ADefK, ADefV),
+ ?map(BPairs, BDefK, BDefV)) ->
+ map_pairwise_merge(F, APairs, ADefK, ADefV, BPairs, BDefK, BDefV).
+
+map_pairwise_merge(_, [], _, _, [], _, _) -> [];
+map_pairwise_merge(F, As0, ADefK, ADefV, Bs0, BDefK, BDefV) ->
+ case {As0, Bs0} of
+ {[{K,AMNess,AV}|As], [{K, BMNess,BV}|Bs]} -> ok;
+ {[{K,AMNess,AV}|As], [{BK,_, _ }|_]=Bs} when K < BK ->
+ {BMNess, BV} = {?opt, mapmerge_otherv(K, BDefK, BDefV)};
+ {As, [{K, BMNess,BV}|Bs]} ->
+ {AMNess, AV} = {?opt, mapmerge_otherv(K, ADefK, ADefV)};
+ {[{K,AMNess,AV}|As], []=Bs} ->
+ {BMNess, BV} = {?opt, mapmerge_otherv(K, BDefK, BDefV)}
+ end,
+ MK = K, %% Rename to make clear that we are matching below
+ case F(K, AMNess, AV, BMNess, BV) of
+ false -> map_pairwise_merge(F,As,ADefK,ADefV,Bs,BDefK,BDefV);
+ M={MK,_,_} -> [M|map_pairwise_merge(F,As,ADefK,ADefV,Bs,BDefK,BDefV)]
+ end.
+
+%% Folds over the pairs in two maps simultaneously in reverse key order. Missing
+%% pairs become (?opt, DefV) or (?opt, ?none), depending on whether K \in DefK.
+-spec map_pairwise_merge_foldr(fun((erl_type(),
+ t_map_mandatoriness(), erl_type(),
+ t_map_mandatoriness(), erl_type(),
+ Acc) -> Acc),
+ Acc, erl_type(), erl_type()) -> Acc.
+
+map_pairwise_merge_foldr(F, AccIn, ?map(APairs, ADefK, ADefV),
+ ?map(BPairs, BDefK, BDefV)) ->
+ map_pairwise_merge_foldr(F, AccIn, APairs, ADefK, ADefV, BPairs, BDefK, BDefV).
+
+map_pairwise_merge_foldr(_, Acc, [], _, _, [], _, _) -> Acc;
+map_pairwise_merge_foldr(F, AccIn, As0, ADefK, ADefV, Bs0, BDefK, BDefV) ->
+ case {As0, Bs0} of
+ {[{K,AMNess,AV}|As], [{K, BMNess,BV}|Bs]} -> ok;
+ {[{K,AMNess,AV}|As], [{BK,_, _ }|_]=Bs} when K < BK ->
+ {BMNess, BV} = {?opt, mapmerge_otherv(K, BDefK, BDefV)};
+ {As, [{K, BMNess,BV}|Bs]} ->
+ {AMNess, AV} = {?opt, mapmerge_otherv(K, ADefK, ADefV)};
+ {[{K,AMNess,AV}|As], []=Bs} ->
+ {BMNess, BV} = {?opt, mapmerge_otherv(K, BDefK, BDefV)}
+ end,
+ F(K, AMNess, AV, BMNess, BV,
+ map_pairwise_merge_foldr(F,AccIn,As,ADefK,ADefV,Bs,BDefK,BDefV)).
+
+%% By observing that a missing pair in a map is equivalent to an optional pair,
+%% with ?none or DefV value, depending on whether K \in DefK, we can simplify
+%% merging by denormalising the map pairs temporarily, removing all 'false'
+%% cases, at the cost of the creation of more tuples:
+mapmerge_otherv(K, ODefK, ODefV) ->
+ case t_inf(K, ODefK) of
+ ?none -> ?none;
+ _KOrOpaque -> ODefV
+ end.
+
+-spec t_map_put({erl_type(), erl_type()}, erl_type()) -> erl_type().
+
+t_map_put(KV, Map) ->
+ t_map_put(KV, Map, 'universe').
+
+-spec t_map_put({erl_type(), erl_type()}, erl_type(), opaques()) -> erl_type().
+
+t_map_put(KV, Map, Opaques) ->
+ do_opaque(Map, Opaques, fun(UM) -> map_put(KV, UM, Opaques) end).
+
+%% Key and Value are *not* unopaqued, but the map is
+map_put(_, ?none, _) -> ?none;
+map_put({Key, Value}, ?map(Pairs,DefK,DefV), Opaques) ->
+ case t_is_none_or_unit(Key) orelse t_is_none_or_unit(Value) of
+ true -> ?none;
+ false ->
+ case is_singleton_type(Key) of
+ true ->
+ t_map(mapdict_store({Key, ?mand, Value}, Pairs), DefK, DefV);
+ false ->
+ t_map([{K, MNess, case t_is_none(t_inf(K, Key, Opaques)) of
+ true -> V;
+ false -> t_sup(V, Value)
+ end} || {K, MNess, V} <- Pairs],
+ t_sup(DefK, Key),
+ t_sup(DefV, Value))
+ end
+ end.
+
+-spec t_map_update({erl_type(), erl_type()}, erl_type()) -> erl_type().
+
+t_map_update(KV, Map) ->
+ t_map_update(KV, Map, 'universe').
+
+-spec t_map_update({erl_type(), erl_type()}, erl_type(), opaques()) -> erl_type().
+
+t_map_update(_, ?none, _) -> ?none;
+t_map_update(KV={Key, _}, M, Opaques) ->
+ case t_is_subtype(t_atom('true'), t_map_is_key(Key, M, Opaques)) of
+ false -> ?none;
+ true -> t_map_put(KV, M, Opaques)
+ end.
+
+-spec t_map_get(erl_type(), erl_type()) -> erl_type().
+
+t_map_get(Key, Map) ->
+ t_map_get(Key, Map, 'universe').
+
+-spec t_map_get(erl_type(), erl_type(), opaques()) -> erl_type().
+
+t_map_get(Key, Map, Opaques) ->
+ do_opaque(Map, Opaques,
+ fun(UM) ->
+ do_opaque(Key, Opaques, fun(UK) -> map_get(UK, UM) end)
+ end).
+
+map_get(_, ?none) -> ?none;
+map_get(Key, ?map(Pairs, DefK, DefV)) ->
+ DefRes =
+ case t_do_overlap(DefK, Key) of
+ false -> t_none();
+ true -> DefV
+ end,
+ case is_singleton_type(Key) of
+ false ->
+ lists:foldl(fun({K, _, V}, Res) ->
+ case t_do_overlap(K, Key) of
+ false -> Res;
+ true -> t_sup(Res, V)
+ end
+ end, DefRes, Pairs);
+ true ->
+ case lists:keyfind(Key, 1, Pairs) of
+ false -> DefRes;
+ {_, _, ValType} -> ValType
+ end
+ end.
+
+-spec t_map_is_key(erl_type(), erl_type()) -> erl_type().
+
+t_map_is_key(Key, Map) ->
+ t_map_is_key(Key, Map, 'universe').
+
+-spec t_map_is_key(erl_type(), erl_type(), opaques()) -> erl_type().
+
+t_map_is_key(Key, Map, Opaques) ->
+ do_opaque(Map, Opaques,
+ fun(UM) ->
+ do_opaque(Key, Opaques, fun(UK) -> map_is_key(UK, UM) end)
+ end).
+
+map_is_key(_, ?none) -> ?none;
+map_is_key(Key, ?map(Pairs, DefK, _DefV)) ->
+ case is_singleton_type(Key) of
+ true ->
+ case lists:keyfind(Key, 1, Pairs) of
+ {Key, ?mand, _} -> t_atom(true);
+ {Key, ?opt, ?none} -> t_atom(false);
+ {Key, ?opt, _} -> t_boolean();
+ false ->
+ case t_do_overlap(DefK, Key) of
+ false -> t_atom(false);
+ true -> t_boolean()
+ end
+ end;
+ false ->
+ case t_do_overlap(DefK, Key)
+ orelse lists:any(fun({_,_,?none}) -> false;
+ ({K,_,_}) -> t_do_overlap(K, Key)
+ end, Pairs)
+ of
+ true -> t_boolean();
+ false -> t_atom(false)
+ end
+ end.
+
%%-----------------------------------------------------------------------------
%% Tuples
%%
@@ -1862,8 +2198,9 @@ t_has_var(?tuple(Elements, _, _)) ->
t_has_var_list(Elements);
t_has_var(?tuple_set(_) = T) ->
t_has_var_list(t_tuple_subtypes(T));
-t_has_var(?map(_)= Map) ->
- t_has_var_list(map_keys(Map)) orelse t_has_var_list(map_values(Map));
+t_has_var(?map(_, DefK, _)= Map) ->
+ t_has_var_list(map_all_values(Map)) orelse
+ t_has_var(DefK);
t_has_var(?opaque(Set)) ->
%% Assume variables in 'args' are also present i 'struct'
t_has_var_list([O#opaque.struct || O <- set_to_list(Set)]);
@@ -1898,9 +2235,9 @@ t_collect_vars(?tuple(Types, _, _), Acc) ->
t_collect_vars_list(Types, Acc);
t_collect_vars(?tuple_set(_) = TS, Acc) ->
t_collect_vars_list(t_tuple_subtypes(TS), Acc);
-t_collect_vars(?map(_) = Map, Acc0) ->
- Acc = t_collect_vars_list(map_keys(Map), Acc0),
- t_collect_vars_list(map_values(Map), Acc);
+t_collect_vars(?map(_, DefK, _) = Map, Acc0) ->
+ Acc = t_collect_vars_list(map_all_values(Map), Acc0),
+ t_collect_vars(DefK, Acc);
t_collect_vars(?opaque(Set), Acc) ->
%% Assume variables in 'args' are also present i 'struct'
t_collect_vars_list([O#opaque.struct || O <- set_to_list(Set)], Acc);
@@ -1935,7 +2272,15 @@ t_from_term(T) when is_function(T) ->
{arity, Arity} = erlang:fun_info(T, arity),
t_fun(Arity, t_any());
t_from_term(T) when is_integer(T) -> t_integer(T);
-t_from_term(T) when is_map(T) -> t_map();
+t_from_term(T) when is_map(T) ->
+ Pairs = [{t_from_term(K), ?mand, t_from_term(V)}
+ || {K, V} <- maps:to_list(T)],
+ {Stons, Rest} = lists:partition(fun({K,_,_}) -> is_singleton_type(K) end,
+ Pairs),
+ {DefK, DefV}
+ = lists:foldl(fun({K,_,V},{AK,AV}) -> {t_sup(K,AK), t_sup(V,AV)} end,
+ {t_none(), t_none()}, Rest),
+ t_map(lists:keysort(1, Stons), DefK, DefV);
t_from_term(T) when is_pid(T) -> t_pid();
t_from_term(T) when is_port(T) -> t_port();
t_from_term(T) when is_reference(T) -> t_reference();
@@ -2225,6 +2570,13 @@ t_sup(?tuple_set(List1), T2 = ?tuple(_, Arity, _)) ->
sup_tuple_sets(List1, [{Arity, [T2]}]);
t_sup(?tuple(_, Arity, _) = T1, ?tuple_set(List2)) ->
sup_tuple_sets([{Arity, [T1]}], List2);
+t_sup(?map(_, ADefK, ADefV) = A, ?map(_, BDefK, BDefV) = B) ->
+ Pairs =
+ map_pairwise_merge(
+ fun(K, MNess, V1, MNess, V2) -> {K, MNess, t_sup(V1, V2)};
+ (K, _, V1, _, V2) -> {K, ?opt, t_sup(V1, V2)}
+ end, A, B),
+ t_map(Pairs, t_sup(ADefK, BDefK), t_sup(ADefV, BDefV));
t_sup(T1, T2) ->
?union(U1) = force_union(T1),
?union(U2) = force_union(T2),
@@ -2343,7 +2695,7 @@ force_union(T = ?list(_, _, _)) -> ?list_union(T);
force_union(T = ?nil) -> ?list_union(T);
force_union(T = ?number(_, _)) -> ?number_union(T);
force_union(T = ?opaque(_)) -> ?opaque_union(T);
-force_union(T = ?map(_)) -> ?map_union(T);
+force_union(T = ?map(_,_,_)) -> ?map_union(T);
force_union(T = ?tuple(_, _, _)) -> ?tuple_union(T);
force_union(T = ?tuple_set(_)) -> ?tuple_union(T);
force_union(T = ?matchstate(_, _)) -> ?matchstate_union(T);
@@ -2380,7 +2732,7 @@ t_elements(?number(_, _) = T) ->
end;
t_elements(?opaque(_) = T) ->
do_elements(T);
-t_elements(?map(_) = T) -> [T];
+t_elements(?map(_,_,_) = T) -> [T];
t_elements(?tuple(_, _, _) = T) -> [T];
t_elements(?tuple_set(_) = TS) ->
case t_tuple_subtypes(TS) of
@@ -2462,6 +2814,25 @@ t_inf(?identifier(Set1), ?identifier(Set2), _Opaques) ->
?none -> ?none;
Set -> ?identifier(Set)
end;
+t_inf(?map(_, ADefK, ADefV) = A, ?map(_, BDefK, BDefV) = B, _Opaques) ->
+ %% Because it simplifies the anonymous function, we allow Pairs to temporarily
+ %% contain mandatory pairs with none values, since all such cases should
+ %% result in a none result.
+ Pairs =
+ map_pairwise_merge(
+ %% For optional keys in both maps, when the infinimum is none, we have
+ %% essentially concluded that K must not be a key in the map.
+ fun(K, ?opt, V1, ?opt, V2) -> {K, ?opt, t_inf(V1, V2)};
+ %% When a key is optional in one map, but mandatory in another, it
+ %% becomes mandatory in the infinumum
+ (K, _, V1, _, V2) -> {K, ?mand, t_inf(V1, V2)}
+ end, A, B),
+ %% If the infinimum of any mandatory values is ?none, the entire map infinimum
+ %% is ?none.
+ case lists:any(fun({_,?mand,?none})->true; ({_,_,_}) -> false end, Pairs) of
+ true -> t_none();
+ false -> t_map(Pairs, t_inf(ADefK, BDefK), t_inf(ADefV, BDefV))
+ end;
t_inf(?matchstate(Pres1, Slots1), ?matchstate(Pres2, Slots2), _Opaques) ->
?matchstate(t_inf(Pres1, Pres2), t_inf(Slots1, Slots2));
t_inf(?nil, ?nil, _Opaques) -> ?nil;
@@ -2924,87 +3295,33 @@ findfirst(N1, N2, U1, B1, U2, B2) ->
%%-----------------------------------------------------------------------------
%% Substitution of variables
%%
-%% Dialyzer versions prior to R15B used a dict data structure to map variables
-%% to types. Hans Bolinder suggested the use of lists of Key-Value pairs for
-%% this data structure and measurements showed a non-trivial speedup when using
-%% them for operations within this module (e.g. in t_unify/2). However, there
-%% is code outside erl_types that still passes a dict:dict() in the 2nd argument.
-%% So, for the time being, this module provides a t_subst/2 function for these
-%% external calls and a clone of it (t_subst_kv/2) which is used from all calls
-%% from within this module. This code duplication needs to be eliminated at
-%% some point.
-
--spec t_subst(erl_type(), dict:dict(atom(), erl_type())) -> erl_type().
-
-t_subst(T, Dict) ->
+
+-type subst_table() :: #{any() => erl_type()}.
+
+-spec t_subst(erl_type(), subst_table()) -> erl_type().
+
+t_subst(T, Map) ->
case t_has_var(T) of
- true -> t_subst_dict(T, Dict);
+ true -> t_subst_aux(T, Map);
false -> T
end.
-t_subst_dict(?var(Id), Dict) ->
- case dict:find(Id, Dict) of
- error -> ?any;
- {ok, Type} -> Type
- end;
-t_subst_dict(?list(Contents, Termination, Size), Dict) ->
- case t_subst_dict(Contents, Dict) of
- ?none -> ?none;
- NewContents ->
- %% Be careful here to make the termination collapse if necessary.
- case t_subst_dict(Termination, Dict) of
- ?nil -> ?list(NewContents, ?nil, Size);
- ?any -> ?list(NewContents, ?any, Size);
- Other ->
- ?list(NewContents2, NewTermination, _) = t_cons(NewContents, Other),
- ?list(NewContents2, NewTermination, Size)
- end
- end;
-t_subst_dict(?function(Domain, Range), Dict) ->
- ?function(t_subst_dict(Domain, Dict), t_subst_dict(Range, Dict));
-t_subst_dict(?product(Types), Dict) ->
- ?product([t_subst_dict(T, Dict) || T <- Types]);
-t_subst_dict(?tuple(?any, ?any, ?any) = T, _Dict) ->
- T;
-t_subst_dict(?tuple(Elements, _Arity, _Tag), Dict) ->
- t_tuple([t_subst_dict(E, Dict) || E <- Elements]);
-t_subst_dict(?tuple_set(_) = TS, Dict) ->
- t_sup([t_subst_dict(T, Dict) || T <- t_tuple_subtypes(TS)]);
-t_subst_dict(?map(Pairs), Dict) ->
- ?map([{t_subst_dict(K, Dict), t_subst_dict(V, Dict)} ||
- {K, V} <- Pairs]);
-t_subst_dict(?opaque(Es), Dict) ->
- List = [Opaque#opaque{args = [t_subst_dict(Arg, Dict) || Arg <- Args],
- struct = t_subst_dict(S, Dict)} ||
- Opaque = #opaque{args = Args, struct = S} <- set_to_list(Es)],
- ?opaque(ordsets:from_list(List));
-t_subst_dict(?union(List), Dict) ->
- ?union([t_subst_dict(E, Dict) || E <- List]);
-t_subst_dict(T, _Dict) ->
- T.
-
-spec subst_all_vars_to_any(erl_type()) -> erl_type().
subst_all_vars_to_any(T) ->
- t_subst_kv(T, []).
-
-t_subst_kv(T, KVMap) ->
- case t_has_var(T) of
- true -> t_subst_aux(T, KVMap);
- false -> T
- end.
+ t_subst(T, #{}).
-t_subst_aux(?var(Id), VarMap) ->
- case lists:keyfind(Id, 1, VarMap) of
- false -> ?any;
- {Id, Type} -> Type
+t_subst_aux(?var(Id), Map) ->
+ case maps:find(Id, Map) of
+ error -> ?any;
+ {ok, Type} -> Type
end;
-t_subst_aux(?list(Contents, Termination, Size), VarMap) ->
- case t_subst_aux(Contents, VarMap) of
+t_subst_aux(?list(Contents, Termination, Size), Map) ->
+ case t_subst_aux(Contents, Map) of
?none -> ?none;
NewContents ->
%% Be careful here to make the termination collapse if necessary.
- case t_subst_aux(Termination, VarMap) of
+ case t_subst_aux(Termination, Map) of
?nil -> ?list(NewContents, ?nil, Size);
?any -> ?list(NewContents, ?any, Size);
Other ->
@@ -3012,27 +3329,27 @@ t_subst_aux(?list(Contents, Termination, Size), VarMap) ->
?list(NewContents2, NewTermination, Size)
end
end;
-t_subst_aux(?function(Domain, Range), VarMap) ->
- ?function(t_subst_aux(Domain, VarMap), t_subst_aux(Range, VarMap));
-t_subst_aux(?product(Types), VarMap) ->
- ?product([t_subst_aux(T, VarMap) || T <- Types]);
-t_subst_aux(?tuple(?any, ?any, ?any) = T, _VarMap) ->
+t_subst_aux(?function(Domain, Range), Map) ->
+ ?function(t_subst_aux(Domain, Map), t_subst_aux(Range, Map));
+t_subst_aux(?product(Types), Map) ->
+ ?product([t_subst_aux(T, Map) || T <- Types]);
+t_subst_aux(?tuple(?any, ?any, ?any) = T, _Map) ->
T;
-t_subst_aux(?tuple(Elements, _Arity, _Tag), VarMap) ->
- t_tuple([t_subst_aux(E, VarMap) || E <- Elements]);
-t_subst_aux(?tuple_set(_) = TS, VarMap) ->
- t_sup([t_subst_aux(T, VarMap) || T <- t_tuple_subtypes(TS)]);
-t_subst_aux(?map(Pairs), VarMap) ->
- ?map([{t_subst_aux(K, VarMap), t_subst_aux(V, VarMap)} ||
- {K, V} <- Pairs]);
-t_subst_aux(?opaque(Es), VarMap) ->
- List = [Opaque#opaque{args = [t_subst_aux(Arg, VarMap) || Arg <- Args],
- struct = t_subst_aux(S, VarMap)} ||
- Opaque = #opaque{args = Args, struct = S} <- set_to_list(Es)],
- ?opaque(ordsets:from_list(List));
-t_subst_aux(?union(List), VarMap) ->
- ?union([t_subst_aux(E, VarMap) || E <- List]);
-t_subst_aux(T, _VarMap) ->
+t_subst_aux(?tuple(Elements, _Arity, _Tag), Map) ->
+ t_tuple([t_subst_aux(E, Map) || E <- Elements]);
+t_subst_aux(?tuple_set(_) = TS, Map) ->
+ t_sup([t_subst_aux(T, Map) || T <- t_tuple_subtypes(TS)]);
+t_subst_aux(?map(Pairs, DefK, DefV), Map) ->
+ t_map([{K, MNess, t_subst_aux(V, Map)} || {K, MNess, V} <- Pairs],
+ t_subst_aux(DefK, Map), t_subst_aux(DefV, Map));
+t_subst_aux(?opaque(Es), Map) ->
+ List = [Opaque#opaque{args = [t_subst_aux(Arg, Map) || Arg <- Args],
+ struct = t_subst_aux(S, Map)} ||
+ Opaque = #opaque{args = Args, struct = S} <- set_to_list(Es)],
+ ?opaque(ordsets:from_list(List));
+t_subst_aux(?union(List), Map) ->
+ ?union([t_subst_aux(E, Map) || E <- List]);
+t_subst_aux(T, _Map) ->
T.
%%-----------------------------------------------------------------------------
@@ -3044,33 +3361,33 @@ t_subst_aux(T, _VarMap) ->
-spec t_unify(erl_type(), erl_type()) -> t_unify_ret().
t_unify(T1, T2) ->
- {T, VarMap} = t_unify(T1, T2, []),
- {t_subst_kv(T, VarMap), lists:keysort(1, VarMap)}.
+ {T, VarMap} = t_unify(T1, T2, #{}),
+ {t_subst(T, VarMap), lists:keysort(1, maps:to_list(VarMap))}.
t_unify(?var(Id) = T, ?var(Id), VarMap) ->
{T, VarMap};
t_unify(?var(Id1) = T, ?var(Id2), VarMap) ->
- case lists:keyfind(Id1, 1, VarMap) of
- false ->
- case lists:keyfind(Id2, 1, VarMap) of
- false -> {T, [{Id2, T} | VarMap]};
- {Id2, Type} -> t_unify(T, Type, VarMap)
+ case maps:find(Id1, VarMap) of
+ error ->
+ case maps:find(Id2, VarMap) of
+ error -> {T, VarMap#{Id2 => T}};
+ {ok, Type} -> t_unify(T, Type, VarMap)
end;
- {Id1, Type1} ->
- case lists:keyfind(Id2, 1, VarMap) of
- false -> {Type1, [{Id2, T} | VarMap]};
- {Id2, Type2} -> t_unify(Type1, Type2, VarMap)
+ {ok, Type1} ->
+ case maps:find(Id2, VarMap) of
+ error -> {Type1, VarMap#{Id2 => T}};
+ {ok, Type2} -> t_unify(Type1, Type2, VarMap)
end
end;
t_unify(?var(Id), Type, VarMap) ->
- case lists:keyfind(Id, 1, VarMap) of
- false -> {Type, [{Id, Type} | VarMap]};
- {Id, VarType} -> t_unify(VarType, Type, VarMap)
+ case maps:find(Id, VarMap) of
+ error -> {Type, VarMap#{Id => Type}};
+ {ok, VarType} -> t_unify(VarType, Type, VarMap)
end;
t_unify(Type, ?var(Id), VarMap) ->
- case lists:keyfind(Id, 1, VarMap) of
- false -> {Type, [{Id, Type} | VarMap]};
- {Id, VarType} -> t_unify(VarType, Type, VarMap)
+ case maps:find(Id, VarMap) of
+ error -> {Type, VarMap#{Id => Type}};
+ {ok, VarType} -> t_unify(VarType, Type, VarMap)
end;
t_unify(?function(Domain1, Range1), ?function(Domain2, Range2), VarMap) ->
{Domain, VarMap1} = t_unify(Domain1, Domain2, VarMap),
@@ -3104,6 +3421,23 @@ t_unify(?tuple_set(List1) = T1, ?tuple_set(List2) = T2, VarMap) ->
{Tuples, NewVarMap} -> {t_sup(Tuples), NewVarMap}
catch _:_ -> throw({mismatch, T1, T2})
end;
+t_unify(?map(_, ADefK, ADefV) = A, ?map(_, BDefK, BDefV) = B, VarMap0) ->
+ {DefK, VarMap1} = t_unify(ADefK, BDefK, VarMap0),
+ {DefV, VarMap2} = t_unify(ADefV, BDefV, VarMap1),
+ {Pairs, VarMap} =
+ map_pairwise_merge_foldr(
+ fun(K, MNess, V1, MNess, V2, {Pairs0, VarMap3}) ->
+ %% We know that the keys unify and do not contain variables, or they
+ %% would not be singletons
+ %% TODO: Should V=?none (known missing keys) be handled special?
+ {V, VarMap4} = t_unify(V1, V2, VarMap3),
+ {[{K,MNess,V}|Pairs0], VarMap4};
+ (K, _, V1, _, V2, {Pairs0, VarMap3}) ->
+ %% One mandatory and one optional; what should be done in this case?
+ {V, VarMap4} = t_unify(V1, V2, VarMap3),
+ {[{K,?mand,V}|Pairs0], VarMap4}
+ end, {[], VarMap2}, A, B),
+ {t_map(Pairs, DefK, DefV), VarMap};
t_unify(?opaque(_) = T1, ?opaque(_) = T2, VarMap) ->
t_unify(t_opaque_structure(T1), t_opaque_structure(T2), VarMap);
t_unify(T1, ?opaque(_) = T2, VarMap) ->
@@ -3307,7 +3641,7 @@ t_subtract_list(T, []) ->
-spec t_subtract(erl_type(), erl_type()) -> erl_type().
t_subtract(_, ?any) -> ?none;
-t_subtract(_, ?var(_)) -> ?none;
+t_subtract(T, ?var(_)) -> T;
t_subtract(?any, _) -> ?any;
t_subtract(?var(_) = T, _) -> T;
t_subtract(T, ?unit) -> T;
@@ -3460,8 +3794,50 @@ t_subtract(?product(Elements1) = T1, ?product(Elements2)) ->
_ -> T1
end
end;
-t_subtract(?map(_) = T, _) -> % XXX: very crude; will probably need refinement
- T;
+t_subtract(?map(APairs, ADefK, ADefV) = A, ?map(_, BDefK, BDefV) = B) ->
+ case t_is_subtype(ADefK, BDefK) andalso t_is_subtype(ADefV, BDefV) of
+ false -> A;
+ true ->
+ %% We fold over the maps to produce a list of constraints, where
+ %% constraints are additional key-value pairs to put in Pairs. Only one
+ %% constraint need to be applied to produce a type that excludes the
+ %% right-hand-side type, so if more than one constraint is produced, we
+ %% just return the left-hand-side argument.
+ %%
+ %% Each case of the fold may either conclude that
+ %% * The arguments constrain A at least as much as B, i.e. that A so far
+ %% is a subtype of B. In that case they return false
+ %% * That for the particular arguments, A being a subtype of B does not
+ %% hold, but the infinimum of A and B is nonempty, and by narrowing a
+ %% pair in A, we can create a type that excludes some elements in the
+ %% infinumum. In that case, they will return that pair.
+ %% * That for the particular arguments, A being a subtype of B does not
+ %% hold, and either the infinumum of A and B is empty, or it is not
+ %% possible with the current representation to create a type that
+ %% excludes elements from B without also excluding elements that are
+ %% only in A. In that case, it will return the pair from A unchanged.
+ case
+ map_pairwise_merge(
+ %% If V1 is a subtype of V2, the case that K does not exist in A
+ %% remain.
+ fun(K, ?opt, V1, ?mand, V2) -> {K, ?opt, t_subtract(V1, V2)};
+ (K, _, V1, _, V2) ->
+ %% If we subtract an optional key, that leaves a mandatory key
+ case t_subtract(V1, V2) of
+ ?none -> false;
+ Partial -> {K, ?mand, Partial}
+ end
+ end, A, B)
+ of
+ %% We produce a list of keys that are constrained. As only one of
+ %% these should apply at a time, we can't represent the difference if
+ %% more than one constraint is produced. If we applied all of them,
+ %% that would make an underapproximation, which we must not do.
+ [] -> ?none; %% A is a subtype of B
+ [E] -> t_map(mapdict_store(E, APairs), ADefK, ADefV);
+ _ -> A
+ end
+ end;
t_subtract(?product(P1), _) ->
?product(P1);
t_subtract(T, ?product(_)) ->
@@ -3592,6 +3968,11 @@ subtype_is_equal(T1, T2) ->
t_is_instance(ConcreteType, Type) ->
t_is_subtype(ConcreteType, t_unopaque(Type)).
+-spec t_do_overlap(erl_type(), erl_type()) -> boolean().
+
+t_do_overlap(TypeA, TypeB) ->
+ not (t_is_none_or_unit(t_inf(TypeA, TypeB))).
+
-spec t_unopaque(erl_type()) -> erl_type().
t_unopaque(T) ->
@@ -3622,12 +4003,17 @@ t_unopaque(?union([A,B,F,I,L,N,T,M,O,Map]), Opaques) ->
UL = t_unopaque(L, Opaques),
UT = t_unopaque(T, Opaques),
UF = t_unopaque(F, Opaques),
+ UM = t_unopaque(M, Opaques),
UMap = t_unopaque(Map, Opaques),
{OF,UO} = case t_unopaque(O, Opaques) of
?opaque(_) = O1 -> {O1, []};
Type -> {?none, [Type]}
end,
- t_sup([?union([A,B,UF,I,UL,N,UT,M,OF,UMap])|UO]);
+ t_sup([?union([A,B,UF,I,UL,N,UT,UM,OF,UMap])|UO]);
+t_unopaque(?map(Pairs,DefK,DefV), Opaques) ->
+ t_map([{K, MNess, t_unopaque(V, Opaques)} || {K, MNess, V} <- Pairs],
+ t_unopaque(DefK, Opaques),
+ t_unopaque(DefV, Opaques));
t_unopaque(T, _) ->
T.
@@ -3679,6 +4065,16 @@ t_limit_k(?opaque(Es), K) ->
Opaque#opaque{struct = NewS}
end || #opaque{struct = S} = Opaque <- set_to_list(Es)],
?opaque(ordsets:from_list(List));
+t_limit_k(?map(Pairs0, DefK0, DefV0), K) ->
+ Fun = fun({EK, MNess, EV}, {Exact, DefK1, DefV1}) ->
+ LV = t_limit_k(EV, K - 1),
+ case t_limit_k(EK, K - 1) of
+ EK -> {[{EK,MNess,LV}|Exact], DefK1, DefV1};
+ LK -> {Exact, t_sup(LK, DefK1), t_sup(LV, DefV1)}
+ end
+ end,
+ {Pairs, DefK2, DefV2} = lists:foldr(Fun, {[], DefK0, DefV0}, Pairs0),
+ t_map(Pairs, t_limit_k(DefK2, K - 1), t_limit_k(DefV2, K - 1));
t_limit_k(T, _K) -> T.
%%============================================================================
@@ -3753,6 +4149,9 @@ t_map(Fun, ?opaque(Set)) ->
[] -> ?none;
_ -> ?opaque(ordsets:from_list(L))
end);
+t_map(Fun, ?map(Pairs,DefK,DefV)) ->
+ %% TODO:
+ Fun(t_map(Pairs, Fun(DefK), Fun(DefV)));
t_map(Fun, T) ->
Fun(T).
@@ -3894,8 +4293,23 @@ t_to_string(?float, _RecDict) -> "float()";
t_to_string(?number(?any, ?unknown_qual), _RecDict) -> "number()";
t_to_string(?product(List), RecDict) ->
"<" ++ comma_sequence(List, RecDict) ++ ">";
-t_to_string(?map(Pairs), RecDict) ->
- "#{" ++ map_pairs_to_string(Pairs,RecDict) ++ "}";
+t_to_string(?map([],?any,?any), _RecDict) -> "map()";
+t_to_string(?map(Pairs0,DefK,DefV), RecDict) ->
+ {Pairs, ExtraEl} =
+ case {DefK, DefV} of
+ {?none, ?none} -> {Pairs0, []};
+ {?any, ?any} -> {Pairs0, ["..."]};
+ _ -> {Pairs0 ++ [{DefK,?opt,DefV}], []}
+ end,
+ Tos = fun(T) -> case T of
+ ?any -> "_";
+ _ -> t_to_string(T, RecDict)
+ end end,
+ StrMand = [{Tos(K),Tos(V)}||{K,?mand,V}<-Pairs],
+ StrOpt = [{Tos(K),Tos(V)}||{K,?opt,V}<-Pairs],
+ "#{" ++ string:join([K ++ ":=" ++ V||{K,V}<-StrMand]
+ ++ [K ++ "=>" ++ V||{K,V}<-StrOpt]
+ ++ ExtraEl, ", ") ++ "}";
t_to_string(?tuple(?any, ?any, ?any), _RecDict) -> "tuple()";
t_to_string(?tuple(Elements, _Arity, ?any), RecDict) ->
"{" ++ comma_sequence(Elements, RecDict) ++ "}";
@@ -3916,12 +4330,6 @@ t_to_string(?var(Id), _RecDict) when is_integer(Id) ->
flat_format("var(~w)", [Id]).
-map_pairs_to_string([],_) -> [];
-map_pairs_to_string(Pairs,RecDict) ->
- StrPairs = [{t_to_string(K,RecDict),t_to_string(V,RecDict)}||{K,V}<-Pairs],
- string:join([K ++ "=>" ++ V||{K,V}<-StrPairs], ", ").
-
-
record_to_string(Tag, [_|Fields], FieldNames, RecDict) ->
FieldStrings = record_fields_to_string(Fields, FieldNames, RecDict, []),
"#" ++ atom_to_string(Tag) ++ "{" ++ string:join(FieldStrings, ",") ++ "}".
@@ -4010,7 +4418,7 @@ mod_name(Mod, Name) ->
site(), mod_records()) -> erl_type().
t_from_form(Form, ExpTypes, Site, RecDict) ->
- t_from_form(Form, ExpTypes, Site, RecDict, dict:new()).
+ t_from_form(Form, ExpTypes, Site, RecDict, maps:new()).
-spec t_from_form(parse_form(), sets:set(mfa()),
site(), mod_records(), var_table()) -> erl_type().
@@ -4027,7 +4435,7 @@ t_from_form_without_remote(Form, Site, TypeTable) ->
Module = site_module(Site),
RecDict = dict:from_list([{Module, TypeTable}]),
ExpTypes = replace_by_none,
- {T, _} = t_from_form1(Form, ExpTypes, Site, RecDict, dict:new()),
+ {T, _} = t_from_form1(Form, ExpTypes, Site, RecDict, maps:new()),
T.
%% REC_TYPE_LIMIT is used for limiting the depth of recursive types.
@@ -4083,7 +4491,7 @@ t_from_form(_, _TypeNames, _ET, _S, _MR, _V, D, L) when D =< 0 ; L =< 0 ->
t_from_form({var, _L, '_'}, _TypeNames, _ET, _S, _MR, _V, _D, L) ->
{t_any(), L};
t_from_form({var, _L, Name}, _TypeNames, _ET, _S, _MR, V, _D, L) ->
- case dict:find(Name, V) of
+ case maps:find(Name, V) of
error -> {t_var(Name), L};
{ok, Val} -> {Val, L}
end;
@@ -4149,7 +4557,7 @@ t_from_form({type, _L, 'fun', [{type, _, any}, Range]}, TypeNames,
t_from_form({type, _L, 'fun', [{type, _, product, Domain}, Range]},
TypeNames, ET, S, MR, V, D, L) ->
{Dom1, L1} = list_from_form(Domain, TypeNames, ET, S, MR, V, D, L),
- {Ran1, L2} = t_from_form(Range, TypeNames, ET, S, MR, V, D - 1, L1),
+ {Ran1, L2} = t_from_form(Range, TypeNames, ET, S, MR, V, D, L1),
{t_fun(Dom1, Ran1), L2};
t_from_form({type, _L, identifier, []}, _TypeNames, _ET, _S, _MR, _V, _D, L) ->
{t_identifier(), L};
@@ -4164,8 +4572,26 @@ t_from_form({type, _L, list, []}, _TypeNames, _ET, _S, _MR, _V, _D, L) ->
t_from_form({type, _L, list, [Type]}, TypeNames, ET, S, MR, V, D, L) ->
{T, L1} = t_from_form(Type, TypeNames, ET, S, MR, V, D - 1, L - 1),
{t_list(T), L1};
-t_from_form({type, _L, map, _}, TypeNames, ET, S, MR, V, D, L) ->
- builtin_type(map, t_map([]), TypeNames, ET, S, MR, V, D, L);
+t_from_form({type, _L, map, any}, TypeNames, ET, S, MR, V, D, L) ->
+ builtin_type(map, t_map(), TypeNames, ET, S, MR, V, D, L);
+t_from_form({type, _L, map, List}, TypeNames, ET, S, MR, V, D, L) ->
+ {Pairs1, L5} =
+ fun PairsFromForm(_, L1) when L1 =< 0 -> {[{?any,?opt,?any}], L1};
+ PairsFromForm([], L1) -> {[], L1};
+ PairsFromForm([{type, _, Oper, [KF, VF]}|T], L1) ->
+ {Key, L2} = t_from_form(KF, TypeNames, ET, S, MR, V, D - 1, L1),
+ {Val, L3} = t_from_form(VF, TypeNames, ET, S, MR, V, D - 1, L2),
+ {Pairs0, L4} = PairsFromForm(T, L3 - 1),
+ case Oper of
+ map_field_assoc -> {[{Key,?opt, Val}|Pairs0], L4};
+ map_field_exact -> {[{Key,?mand,Val}|Pairs0], L4}
+ end
+ end(List, L),
+ try
+ {Pairs, DefK, DefV} = map_from_form(Pairs1, [], [], [], ?none, ?none),
+ {t_map(Pairs, DefK, DefV), L5}
+ catch none -> {t_none(), L5}
+ end;
t_from_form({type, _L, mfa, []}, _TypeNames, _ET, _S, _MR, _V, _D, L) ->
{t_mfa(), L};
t_from_form({type, _L, module, []}, _TypeNames, _ET, _S, _MR, _V, _D, L) ->
@@ -4284,7 +4710,7 @@ type_from_form(Name, Args, TypeNames, ET, Site0, MR, V, D, L) ->
{ArgTypes, L1} =
list_from_form(Args, TypeNames, ET, Site0, MR, V, D, L),
List = lists:zip(ArgNames, ArgTypes),
- TmpV = dict:from_list(List),
+ TmpV = maps:from_list(List),
Site = TypeName,
t_from_form(Form, NewTypeNames, ET, Site, MR, TmpV, D, L1);
false ->
@@ -4297,7 +4723,7 @@ type_from_form(Name, Args, TypeNames, ET, Site0, MR, V, D, L) ->
{ArgTypes, L1} =
list_from_form(Args, NewTypeNames, ET, Site0, MR, V, D, L),
List = lists:zip(ArgNames, ArgTypes),
- TmpV = dict:from_list(List),
+ TmpV = maps:from_list(List),
Site = TypeName,
{Rep, L2} =
t_from_form(Form, NewTypeNames, ET, Site, MR, TmpV, D, L1),
@@ -4339,7 +4765,7 @@ remote_from_form(RemMod, Name, Args, TypeNames, ET, S, MR, V, D, L) ->
{ArgTypes, L1} = list_from_form(Args, TypeNames,
ET, S, MR, V, D, L),
List = lists:zip(ArgNames, ArgTypes),
- TmpVarDict = dict:from_list(List),
+ TmpVarDict = maps:from_list(List),
Site = RemType,
t_from_form(Form, NewTypeNames, ET,
Site, MR, TmpVarDict, D, L1);
@@ -4353,7 +4779,7 @@ remote_from_form(RemMod, Name, Args, TypeNames, ET, S, MR, V, D, L) ->
{ArgTypes, L1} = list_from_form(Args, NewTypeNames,
ET, S, MR, V, D, L),
List = lists:zip(ArgNames, ArgTypes),
- TmpVarDict = dict:from_list(List),
+ TmpVarDict = maps:from_list(List),
Site = RemType,
{NewRep, L2} =
t_from_form(Form, NewTypeNames, ET, Site, MR,
@@ -4424,7 +4850,7 @@ record_from_form({atom, _, Name}, ModFields, TypeNames, ET, S, MR, V, D, L) ->
{ok, NewFields} ->
{NewFields1, L2} =
fields_from_form(NewFields, NewTypeNames, ET, S1, MR,
- dict:new(), D, L1),
+ maps:new(), D, L1),
Rec = t_tuple(
[t_atom(Name)|[Type
|| {_FieldName, Type} <- NewFields1]]),
@@ -4495,11 +4921,55 @@ list_from_form([H|Tail], TypeNames, ET, S, MR, V, D, L) ->
{T1, L2} = list_from_form(Tail, TypeNames, ET, S, MR, V, D, L1),
{[H1|T1], L2}.
+%% Sorts, combines non-singleton pairs, and applies precendence and
+%% mandatoriness rules.
+map_from_form([], ShdwPs, MKs, Pairs, DefK, DefV) ->
+ verify_possible(MKs, ShdwPs),
+ {promote_to_mand(MKs, Pairs), DefK, DefV};
+map_from_form([{SKey,MNess,Val}|SPairs], ShdwPs0, MKs0, Pairs0, DefK0, DefV0) ->
+ Key = lists:foldl(fun({K,_},S)->t_subtract(S,K)end, SKey, ShdwPs0),
+ ShdwPs = case Key of ?none -> ShdwPs0; _ -> [{Key,Val}|ShdwPs0] end,
+ MKs = case MNess of ?mand -> [SKey|MKs0]; ?opt -> MKs0 end,
+ if MNess =:= ?mand, SKey =:= ?none -> throw(none);
+ true -> ok
+ end,
+ {Pairs, DefK, DefV} =
+ case is_singleton_type(Key) of
+ true ->
+ MNess1 = case Val =:= ?none of true -> ?opt; false -> MNess end,
+ {mapdict_insert({Key,MNess1,Val}, Pairs0), DefK0, DefV0};
+ false ->
+ case Key =:= ?none orelse Val =:= ?none of
+ true -> {Pairs0, DefK0, DefV0};
+ false -> {Pairs0, t_sup(DefK0, Key), t_sup(DefV0, Val)}
+ end
+ end,
+ map_from_form(SPairs, ShdwPs, MKs, Pairs, DefK, DefV).
+
+%% Verifies that all mandatory keys are possible, throws 'none' otherwise
+verify_possible(MKs, ShdwPs) ->
+ lists:foreach(fun(M) -> verify_possible_1(M, ShdwPs) end, MKs).
+
+verify_possible_1(M, ShdwPs) ->
+ case lists:any(fun({K,_}) -> t_inf(M, K) =/= ?none end, ShdwPs) of
+ true -> ok;
+ false -> throw(none)
+ end.
+
+-spec promote_to_mand([erl_type()], t_map_dict()) -> t_map_dict().
+
+promote_to_mand(_, []) -> [];
+promote_to_mand(MKs, [E={K,_,V}|T]) ->
+ [case lists:any(fun(M) -> t_is_equal(K,M) end, MKs) of
+ true -> {K, ?mand, V};
+ false -> E
+ end|promote_to_mand(MKs, T)].
+
-spec t_check_record_fields(parse_form(), sets:set(mfa()), site(),
mod_records()) -> ok.
t_check_record_fields(Form, ExpTypes, Site, RecDict) ->
- t_check_record_fields(Form, ExpTypes, Site, RecDict, dict:new()).
+ t_check_record_fields(Form, ExpTypes, Site, RecDict, maps:new()).
-spec t_check_record_fields(parse_form(), sets:set(mfa()), site(),
mod_records(), var_table()) -> ok.
@@ -4627,8 +5097,13 @@ t_form_to_string({type, _L, iodata, []}) -> "iodata()";
t_form_to_string({type, _L, iolist, []}) -> "iolist()";
t_form_to_string({type, _L, list, [Type]}) ->
"[" ++ t_form_to_string(Type) ++ "]";
-t_form_to_string({type, _L, map, _}) ->
- "#{}";
+t_form_to_string({type, _L, map, any}) -> "map()";
+t_form_to_string({type, _L, map, Args}) ->
+ "#{" ++ string:join(t_form_to_string_list(Args), ",") ++ "}";
+t_form_to_string({type, _L, map_field_assoc, [Key, Val]}) ->
+ t_form_to_string(Key) ++ "=>" ++ t_form_to_string(Val);
+t_form_to_string({type, _L, map_field_exact, [Key, Val]}) ->
+ t_form_to_string(Key) ++ ":=" ++ t_form_to_string(Val);
t_form_to_string({type, _L, mfa, []}) -> "mfa()";
t_form_to_string({type, _L, module, []}) -> "module()";
t_form_to_string({type, _L, node, []}) -> "node()";
@@ -4663,8 +5138,9 @@ t_form_to_string({type, _L, Name, []} = T) ->
D0 = dict:new(),
MR = dict:from_list([{M, D0}]),
S = {type, {M,Name,0}},
+ V = #{},
{T1, _} =
- t_from_form(T, [], sets:new(), S, MR, D0, _Deep=1000, _ALot=100000),
+ t_from_form(T, [], sets:new(), S, MR, V, _Deep=1000, _ALot=100000),
t_to_string(T1)
catch throw:{error, _} -> atom_to_string(Name) ++ "()"
end;
@@ -4789,11 +5265,70 @@ do_opaque(?union(List) = Type, Opaques, Pred) ->
do_opaque(Type, _Opaques, Pred) ->
Pred(Type).
-map_keys(?map(Pairs)) ->
- [K || {K, _} <- Pairs].
+map_all_values(?map(Pairs,_,DefV)) ->
+ [DefV|[V || {V, _, _} <- Pairs]].
+
+map_all_keys(?map(Pairs,DefK,_)) ->
+ [DefK|[K || {_, _, K} <- Pairs]].
+
+map_all_types(M) ->
+ map_all_keys(M) ++ map_all_values(M).
+
+%% Tests if a type has exactly one possible value.
+-spec t_is_singleton(erl_type()) -> boolean().
+
+t_is_singleton(Type) ->
+ t_is_singleton(Type, 'universe').
+
+-spec t_is_singleton(erl_type(), opaques()) -> boolean().
+
+t_is_singleton(Type, Opaques) ->
+ do_opaque(Type, Opaques, fun is_singleton_type/1).
+
+%% Incomplete; not all representable singleton types are included.
+is_singleton_type(?nil) -> true;
+is_singleton_type(?atom(?any)) -> false;
+is_singleton_type(?atom(Set)) ->
+ ordsets:size(Set) =:= 1;
+is_singleton_type(?int_range(V, V)) -> true;
+is_singleton_type(?int_set(Set)) ->
+ ordsets:size(Set) =:= 1;
+is_singleton_type(?tuple(Types, Arity, _)) when is_integer(Arity) ->
+ lists:all(fun is_singleton_type/1, Types);
+is_singleton_type(?tuple_set([{Arity, [OnlyTuple]}])) when is_integer(Arity) ->
+ is_singleton_type(OnlyTuple);
+is_singleton_type(?map(Pairs, ?none, ?none)) ->
+ lists:all(fun({_,MNess,V}) -> MNess =:= ?mand andalso is_singleton_type(V)
+ end, Pairs);
+is_singleton_type(_) ->
+ false.
+
+%% Returns the only possible value of a singleton type.
+-spec t_singleton_to_term(erl_type(), opaques()) -> term().
+
+t_singleton_to_term(Type, Opaques) ->
+ do_opaque(Type, Opaques, fun singleton_type_to_term/1).
-map_values(?map(Pairs)) ->
- [V || {_, V} <- Pairs].
+singleton_type_to_term(?nil) -> [];
+singleton_type_to_term(?atom(Set)) when Set =/= ?any ->
+ case ordsets:size(Set) of
+ 1 -> hd(ordsets:to_list(Set));
+ _ -> error(badarg)
+ end;
+singleton_type_to_term(?int_range(V, V)) -> V;
+singleton_type_to_term(?int_set(Set)) ->
+ case ordsets:size(Set) of
+ 1 -> hd(ordsets:to_list(Set));
+ _ -> error(badarg)
+ end;
+singleton_type_to_term(?tuple(Types, Arity, _)) when is_integer(Arity) ->
+ lists:map(fun singleton_type_to_term/1, Types);
+singleton_type_to_term(?tuple_set([{Arity, [OnlyTuple]}]))
+ when is_integer(Arity) ->
+ singleton_type_to_term(OnlyTuple);
+singleton_type_to_term(?map(Pairs, ?none, ?none)) ->
+ maps:from_list([{singleton_type_to_term(K), singleton_type_to_term(V)}
+ || {K,?mand,V} <- Pairs]).
%% -----------------------------------
%% Set
diff --git a/lib/hipe/doc/Makefile b/lib/hipe/doc/Makefile
index 822f8f5d03..1015ca78eb 100644
--- a/lib/hipe/doc/Makefile
+++ b/lib/hipe/doc/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2012. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/doc/src/Makefile b/lib/hipe/doc/src/Makefile
index 25f80ebafb..a5edb80381 100644
--- a/lib/hipe/doc/src/Makefile
+++ b/lib/hipe/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2012. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/doc/src/book.xml b/lib/hipe/doc/src/book.xml
index bd912dd760..7c594f12ad 100644
--- a/lib/hipe/doc/src/book.xml
+++ b/lib/hipe/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/hipe/doc/src/hipe_app.xml b/lib/hipe/doc/src/hipe_app.xml
index bf4bdbb3b3..e489d155c3 100644
--- a/lib/hipe/doc/src/hipe_app.xml
+++ b/lib/hipe/doc/src/hipe_app.xml
@@ -4,7 +4,7 @@
<appref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/hipe/doc/src/notes.xml b/lib/hipe/doc/src/notes.xml
index 761b4d9f90..4ebd4b817c 100644
--- a/lib/hipe/doc/src/notes.xml
+++ b/lib/hipe/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/hipe/doc/src/part_notes.xml b/lib/hipe/doc/src/part_notes.xml
index f745a2dd42..828c304fb5 100644
--- a/lib/hipe/doc/src/part_notes.xml
+++ b/lib/hipe/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/hipe/doc/src/ref_man.xml b/lib/hipe/doc/src/ref_man.xml
index 76d5f0a22a..7938729227 100644
--- a/lib/hipe/doc/src/ref_man.xml
+++ b/lib/hipe/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/hipe/flow/Makefile b/lib/hipe/flow/Makefile
index f0af6ac166..fe1675b7dd 100644
--- a/lib/hipe/flow/Makefile
+++ b/lib/hipe/flow/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/flow/cfg.inc b/lib/hipe/flow/cfg.inc
index b39a89dbd4..0bad2a8dd7 100644
--- a/lib/hipe/flow/cfg.inc
+++ b/lib/hipe/flow/cfg.inc
@@ -4,7 +4,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/flow/ebb.inc b/lib/hipe/flow/ebb.inc
index a08528154a..529be72dc8 100644
--- a/lib/hipe/flow/ebb.inc
+++ b/lib/hipe/flow/ebb.inc
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/flow/hipe_bb.erl b/lib/hipe/flow/hipe_bb.erl
index 7a39d99e71..2da3a6dc99 100644
--- a/lib/hipe/flow/hipe_bb.erl
+++ b/lib/hipe/flow/hipe_bb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/flow/hipe_bb.hrl b/lib/hipe/flow/hipe_bb.hrl
index 13cad16174..cd4d788aef 100644
--- a/lib/hipe/flow/hipe_bb.hrl
+++ b/lib/hipe/flow/hipe_bb.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/flow/hipe_dominators.erl b/lib/hipe/flow/hipe_dominators.erl
index 2fb277b914..1b147607c7 100644
--- a/lib/hipe/flow/hipe_dominators.erl
+++ b/lib/hipe/flow/hipe_dominators.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/flow/hipe_gen_cfg.erl b/lib/hipe/flow/hipe_gen_cfg.erl
index 99f33699bd..a6d053f505 100644
--- a/lib/hipe/flow/hipe_gen_cfg.erl
+++ b/lib/hipe/flow/hipe_gen_cfg.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/flow/liveness.inc b/lib/hipe/flow/liveness.inc
index d420495f5a..a1caa3e0ad 100644
--- a/lib/hipe/flow/liveness.inc
+++ b/lib/hipe/flow/liveness.inc
@@ -3,7 +3,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/Makefile b/lib/hipe/icode/Makefile
index a82e28c7d9..a5edb10d90 100644
--- a/lib/hipe/icode/Makefile
+++ b/lib/hipe/icode/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2013. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_beam_to_icode.erl b/lib/hipe/icode/hipe_beam_to_icode.erl
index 37c6ba9c60..224aacd8d7 100644
--- a/lib/hipe/icode/hipe_beam_to_icode.erl
+++ b/lib/hipe/icode/hipe_beam_to_icode.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode.hrl b/lib/hipe/icode/hipe_icode.hrl
index 3bb7bae019..999c54732b 100644
--- a/lib/hipe/icode/hipe_icode.hrl
+++ b/lib/hipe/icode/hipe_icode.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_bincomp.erl b/lib/hipe/icode/hipe_icode_bincomp.erl
index c765f1926b..5a27519141 100644
--- a/lib/hipe/icode/hipe_icode_bincomp.erl
+++ b/lib/hipe/icode/hipe_icode_bincomp.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_callgraph.erl b/lib/hipe/icode/hipe_icode_callgraph.erl
index 27dc49a178..12c2cd2b44 100644
--- a/lib/hipe/icode/hipe_icode_callgraph.erl
+++ b/lib/hipe/icode/hipe_icode_callgraph.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_cfg.erl b/lib/hipe/icode/hipe_icode_cfg.erl
index dfc3f316b3..b9969fa69d 100644
--- a/lib/hipe/icode/hipe_icode_cfg.erl
+++ b/lib/hipe/icode/hipe_icode_cfg.erl
@@ -3,7 +3,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_coordinator.erl b/lib/hipe/icode/hipe_icode_coordinator.erl
index 1150f31abf..d2f8748535 100644
--- a/lib/hipe/icode/hipe_icode_coordinator.erl
+++ b/lib/hipe/icode/hipe_icode_coordinator.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_ebb.erl b/lib/hipe/icode/hipe_icode_ebb.erl
index 8d0ea94d92..2aac9d2f42 100644
--- a/lib/hipe/icode/hipe_icode_ebb.erl
+++ b/lib/hipe/icode/hipe_icode_ebb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_fp.erl b/lib/hipe/icode/hipe_icode_fp.erl
index 5ae0395b72..4a5877074c 100644
--- a/lib/hipe/icode/hipe_icode_fp.erl
+++ b/lib/hipe/icode/hipe_icode_fp.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,13 +34,37 @@
-include("hipe_icode.hrl").
-include("../flow/cfg.hrl").
--record(state, {edge_map = gb_trees:empty() :: gb_trees:tree(),
- fp_ebb_map = gb_trees:empty() :: gb_trees:tree(),
- cfg :: #cfg{}}).
+-type mapped_fvar() :: icode_fvar() | {assigned, icode_fvar()} .
+-type incoming_fvars() :: [{icode_lbl(), mapped_fvar()}].
+-type initial_var_map() :: #{icode_var() => incoming_fvars()}.
+-type bb_phi_list() :: [{icode_fvar(), [{icode_lbl(), icode_fvar()}]}].
+-type var_map_phi() :: #{phi => bb_phi_list(),
+ icode_var() => mapped_fvar()}.
+-type var_map() :: #{icode_var() => mapped_fvar()}.
+
+-type edge() :: {icode_lbl(), icode_lbl()}.
+-type edge_map() :: #{edge() => var_map()}.
+
+-type worklist(Item) :: {[Item], [Item], gb_sets:set(Item)}.
+-type worklist() :: worklist(icode_lbl()).
+
+-type fail_lbl() :: [] | icode_lbl().
+-type in_block() :: {true, fail_lbl()} | false.
+-type fp_ebb_map() :: #{{inblock_in | inblock_out, icode_lbl()} | edge()
+ => in_block()}.
+
+-record(state, {edge_map = #{} :: edge_map(),
+ fp_ebb_map = #{} :: fp_ebb_map(),
+ cfg :: cfg()}).
+-type state() :: #state{}.
+
+-type icode_phi() :: #icode_phi{}.
+-type icode_variable() :: #icode_variable{}.
+-type icode_const() :: #icode_const{}.
%%--------------------------------------------------------------------
--spec cfg(#cfg{}) -> #cfg{}.
+-spec cfg(cfg()) -> cfg().
cfg(Cfg) ->
%%hipe_icode_cfg:pp(Cfg),
@@ -59,10 +83,14 @@ cfg(Cfg) ->
%% corresponding fcheckerror.
%%--------------------------------------------------------------------
+-spec annotate_fclearerror(cfg()) -> cfg().
+
annotate_fclearerror(Cfg) ->
Labels = hipe_icode_cfg:reverse_postorder(Cfg),
annotate_fclearerror(Labels, Cfg).
+-spec annotate_fclearerror([icode_lbl()], cfg()) -> cfg().
+
annotate_fclearerror([Label|Left], Cfg) ->
BB = hipe_icode_cfg:bb(Cfg, Label),
Code = hipe_bb:code(BB),
@@ -73,6 +101,9 @@ annotate_fclearerror([Label|Left], Cfg) ->
annotate_fclearerror([], Cfg) ->
Cfg.
+-spec annotate_fclearerror1(icode_instrs(), icode_lbl(), cfg(), icode_instrs())
+ -> icode_instrs().
+
annotate_fclearerror1([I|Left], Label, Cfg, Acc) ->
case I of
#icode_call{} ->
@@ -90,6 +121,9 @@ annotate_fclearerror1([I|Left], Label, Cfg, Acc) ->
annotate_fclearerror1([], _Label, _Cfg, Acc) ->
lists:reverse(Acc).
+-spec lookahead_for_fcheckerror(icode_instrs(), icode_lbl(), cfg()) ->
+ fail_lbl().
+
lookahead_for_fcheckerror([I|Left], Label, Cfg) ->
case I of
#icode_call{} ->
@@ -111,10 +145,14 @@ lookahead_for_fcheckerror([], Label, Cfg) ->
lookahead_for_fcheckerror(Code, Succ, Cfg)
end.
+-spec unannotate_fclearerror(cfg()) -> cfg().
+
unannotate_fclearerror(Cfg) ->
Labels = hipe_icode_cfg:reverse_postorder(Cfg),
unannotate_fclearerror(Labels, Cfg).
+-spec unannotate_fclearerror([icode_lbl()], cfg()) -> cfg().
+
unannotate_fclearerror([Label|Left], Cfg) ->
BB = hipe_icode_cfg:bb(Cfg, Label),
Code = hipe_bb:code(BB),
@@ -125,6 +163,9 @@ unannotate_fclearerror([Label|Left], Cfg) ->
unannotate_fclearerror([], Cfg) ->
Cfg.
+-spec unannotate_fclearerror1(icode_instrs(), icode_instrs()) ->
+ icode_instrs().
+
unannotate_fclearerror1([I|Left], Acc) ->
case I of
#icode_call{} ->
@@ -145,10 +186,14 @@ unannotate_fclearerror1([], Acc) ->
%% Make float EBBs
%%--------------------------------------------------------------------
+-spec place_fp_blocks(state()) -> state().
+
place_fp_blocks(State) ->
WorkList = new_worklist(State),
transform_block(WorkList, State).
+-spec transform_block(worklist(), state()) -> state().
+
transform_block(WorkList, State) ->
case get_work(WorkList) of
none ->
@@ -182,6 +227,10 @@ transform_block(WorkList, State) ->
end
end.
+-spec update_maps(state(), icode_lbl(), ordsets:ordset(icode_lbl()),
+ var_map(), ordsets:ordset(icode_lbl()), var_map())
+ -> fixpoint | {state(), [icode_lbl()]}.
+
update_maps(State, Label, SuccSet, SuccMap, FailSet, FailMap) ->
{NewState, Add1} = update_maps(State, Label, SuccSet, SuccMap, []),
case update_maps(NewState, Label, FailSet, FailMap, Add1) of
@@ -189,6 +238,10 @@ update_maps(State, Label, SuccSet, SuccMap, FailSet, FailMap) ->
{_NewState1, _Add} = Ret -> Ret
end.
+-spec update_maps(state(), icode_lbl(), ordsets:ordset(icode_lbl()),
+ var_map(), [icode_lbl()])
+ -> {state(), [icode_lbl()]}.
+
update_maps(State, From, [To|Left], Map, Acc) ->
case state__map_update(State, From, To, Map) of
fixpoint ->
@@ -199,10 +252,13 @@ update_maps(State, From, [To|Left], Map, Acc) ->
update_maps(State, _From, [], _Map, Acc) ->
{State, Acc}.
+-spec transform_instrs(icode_instrs(), edge_map(), var_map(), icode_instrs())
+ -> {var_map(), icode_instrs()}.
+
transform_instrs([I|Left], PhiMap, Map, Acc) ->
Defines = hipe_icode:defines(I),
- NewMap = delete_all(Defines, Map),
- NewPhiMap = delete_all(Defines, PhiMap),
+ NewMap = maps:without(Defines, Map),
+ NewPhiMap = maps:without(Defines, PhiMap),
case I of
#icode_phi{} ->
Uses = hipe_icode:uses(I),
@@ -214,7 +270,7 @@ transform_instrs([I|Left], PhiMap, Map, Acc) ->
%% All arguments are untagged. Let's untag the destination.
Dst = hipe_icode:phi_dst(I),
NewDst = hipe_icode:mk_new_fvar(),
- NewMap1 = gb_trees:enter(Dst, NewDst, NewMap),
+ NewMap1 = NewMap#{Dst => NewDst},
NewI = subst_phi_uncond(I, NewDst, PhiMap),
transform_instrs(Left, NewPhiMap, NewMap1, [NewI|Acc]);
_ ->
@@ -233,7 +289,7 @@ transform_instrs([I|Left], PhiMap, Map, Acc) ->
[Src] ->
case lookup(Src, Map) of
none ->
- NewMap1 = gb_trees:enter(Src, {assigned, Dst}, NewMap),
+ NewMap1 = NewMap#{Src => {assigned, Dst}},
transform_instrs(Left, NewPhiMap, NewMap1, [I|Acc]);
Dst ->
%% This is the instruction that untagged the variable.
@@ -256,7 +312,7 @@ transform_instrs([I|Left], PhiMap, Map, Acc) ->
unsafe_tag_float ->
[Dst] = hipe_icode:defines(I),
[Src] = hipe_icode:uses(I),
- NewMap1 = gb_trees:enter(Dst, {assigned, Src}, NewMap),
+ NewMap1 = NewMap#{Dst => {assigned, Src}},
transform_instrs(Left, NewPhiMap, NewMap1,[I|Acc]);
_ ->
{NewMap1, NewAcc} = check_for_fop_candidates(I, NewMap, Acc),
@@ -269,6 +325,9 @@ transform_instrs([I|Left], PhiMap, Map, Acc) ->
transform_instrs([], _PhiMap, Map, Acc) ->
{Map, lists:reverse(Acc)}.
+-spec check_for_fop_candidates(icode_instr(), var_map(), icode_instrs())
+ -> {var_map(), icode_instrs()}.
+
check_for_fop_candidates(I, Map, Acc) ->
case is_fop_cand(I) of
false ->
@@ -311,6 +370,8 @@ check_for_fop_candidates(I, Map, Acc) ->
end.
+-spec handle_untagged_arguments(icode_instr(), var_map()) -> icode_instrs().
+
%% If this is an instruction that needs to operate on tagged values,
%% which currently are untagged, we must tag the values and perhaps
%% end the fp ebb.
@@ -322,23 +383,24 @@ handle_untagged_arguments(I, Map) ->
Tag ->
TagIntrs =
[hipe_icode:mk_primop([Dst], unsafe_tag_float,
- [gb_trees:get(Dst, Map)]) || Dst <- Tag],
+ [maps:get(Dst, Map)]) || Dst <- Tag],
[I|TagIntrs]
end.
+-spec do_prelude(var_map_phi()) -> {[icode_phi()], var_map()}.
+
%% Add phi nodes for untagged fp values.
-do_prelude(Map) ->
- case gb_trees:lookup(phi, Map) of
- none ->
- {[], Map};
- {value, List} ->
- %%io:format("Adding phi: ~w\n", [List]),
- Fun = fun ({FVar, Bindings}, Acc) ->
- [hipe_icode:mk_phi(FVar, Bindings)|Acc]
- end,
- {lists:foldl(Fun, [], List), gb_trees:delete(phi, Map)}
- end.
+do_prelude(Map = #{phi := List}) ->
+ %%io:format("Adding phi: ~w\n", [List]),
+ Fun = fun ({FVar, Bindings}, Acc) ->
+ [hipe_icode:mk_phi(FVar, Bindings)|Acc]
+ end,
+ {lists:foldl(Fun, [], List), maps:remove(phi, Map)};
+do_prelude(Map) -> {[], Map}.
+
+-spec split_code([I]) -> {[I], I} when
+ I :: icode_instr().
split_code(Code) ->
split_code(Code, []).
@@ -349,6 +411,8 @@ split_code([I|Left], Acc) ->
split_code(Left, [I|Acc]).
+-spec finalize(state()) -> state().
+
%% When all code is mapped to fp instructions we must make sure that
%% the fp ebb information going into each block is the same as the
%% information coming out of each predecessor. Otherwise, we must add
@@ -360,17 +424,25 @@ finalize(State) ->
Edges = needs_fcheckerror(NewState),
finalize(Edges, NewState).
+-spec finalize([edge()], state()) -> state().
+
finalize([{From, To}|Left], State) ->
NewState = add_fp_ebb_fixup(From, To, State),
finalize(Left, NewState);
finalize([], State) ->
State.
+-spec needs_fcheckerror(state()) -> [{none | icode_lbl(), icode_lbl()}].
+
needs_fcheckerror(State) ->
Cfg = state__cfg(State),
Labels = hipe_icode_cfg:labels(Cfg),
needs_fcheckerror(Labels, State, []).
+-spec needs_fcheckerror([icode_lbl()], state(),
+ [{none | icode_lbl(), icode_lbl()}])
+ -> [{none | icode_lbl(), icode_lbl()}].
+
needs_fcheckerror([Label|Left], State, Acc) ->
case state__get_in_block_in(State, Label) of
{true, _} ->
@@ -395,6 +467,8 @@ needs_fcheckerror([Label|Left], State, Acc) ->
needs_fcheckerror([], _State, Acc) ->
Acc.
+-spec add_fp_ebb_fixup(none | icode_lbl(), icode_lbl(), state()) -> state().
+
add_fp_ebb_fixup('none', To, State) ->
%% Add the fcheckerror to the start of the block.
BB = state__bb(State, To),
@@ -416,9 +490,15 @@ add_fp_ebb_fixup(From, To, State) ->
NewToBB = hipe_bb:code_update(ToBB, NewToCode),
state__bb_add(NewState1, To, NewToBB).
+-spec redirect_phis(icode_instrs(), icode_lbl(), icode_lbl())
+ -> icode_instrs().
+
redirect_phis(Code, OldFrom, NewFrom) ->
redirect_phis(Code, OldFrom, NewFrom, []).
+-spec redirect_phis(icode_instrs(), icode_lbl(), icode_lbl(), icode_instrs())
+ -> icode_instrs().
+
redirect_phis([I|Is] = Code, OldFrom, NewFrom, Acc) ->
case I of
#icode_phi{} ->
@@ -430,13 +510,20 @@ redirect_phis([I|Is] = Code, OldFrom, NewFrom, Acc) ->
redirect_phis([], _OldFrom, _NewFrom, Acc) ->
lists:reverse(Acc).
+-spec subst_phi(icode_phi(), icode_variable(), edge_map())
+ -> icode_phi().
+
subst_phi(I, Dst, Map) ->
ArgList = subst_phi_uses0(hipe_icode:phi_arglist(I), Map, []),
hipe_icode:mk_phi(Dst, ArgList).
+-spec subst_phi_uses0([{icode_lbl(), icode_variable()}], edge_map(),
+ [{icode_lbl(), icode_variable()}])
+ -> [{icode_lbl(), icode_variable()}].
+
subst_phi_uses0([{Pred, Var}|Left], Map, Acc) ->
- case gb_trees:lookup(Var, Map) of
- {value, List} ->
+ case Map of
+ #{Var := List} ->
case lists:keyfind(Pred, 1, List) of
{Pred, {assigned, _NewVar}} ->
%% The variable is untagged, but it has been assigned. Keep it!
@@ -448,20 +535,27 @@ subst_phi_uses0([{Pred, Var}|Left], Map, Acc) ->
%% The variable is not untagged.
subst_phi_uses0(Left, Map, [{Pred, Var} | Acc])
end;
- none ->
+ #{} ->
%% The variable is not untagged.
subst_phi_uses0(Left, Map, [{Pred, Var} | Acc])
end;
subst_phi_uses0([], _Map, Acc) ->
Acc.
+-spec subst_phi_uncond(icode_phi(), icode_variable(), edge_map())
+ -> icode_phi().
+
subst_phi_uncond(I, Dst, Map) ->
ArgList = subst_phi_uses_uncond0(hipe_icode:phi_arglist(I), Map, []),
hipe_icode:mk_phi(Dst, ArgList).
+-spec subst_phi_uses_uncond0([{icode_lbl(), icode_variable()}], edge_map(),
+ [{icode_lbl(), icode_variable()}])
+ -> [{icode_lbl(), icode_variable()}].
+
subst_phi_uses_uncond0([{Pred, Var}|Left], Map, Acc) ->
- case gb_trees:lookup(Var, Map) of
- {value, List} ->
+ case Map of
+ #{Var := List} ->
case lists:keyfind(Pred, 1, List) of
{Pred, {assigned, NewVar}} ->
%% The variable is untagged!
@@ -473,13 +567,15 @@ subst_phi_uses_uncond0([{Pred, Var}|Left], Map, Acc) ->
%% The variable is not untagged.
subst_phi_uses_uncond0(Left, Map, [{Pred, Var} | Acc])
end;
- none ->
+ #{} ->
%% The variable is not untagged.
subst_phi_uses_uncond0(Left, Map, [{Pred, Var} | Acc])
end;
subst_phi_uses_uncond0([], _Map, Acc) ->
Acc.
+-spec place_error_handling(worklist(), state()) -> state().
+
place_error_handling(WorkList, State) ->
case get_work(WorkList) of
none ->
@@ -502,6 +598,9 @@ place_error_handling(WorkList, State) ->
end
end.
+-spec place_error(icode_instrs(), in_block(), icode_instrs())
+ -> {icode_instrs(), in_block()}.
+
place_error([I|Left], InBlock, Acc) ->
case I of
#icode_call{} ->
@@ -638,12 +737,10 @@ instr_allowed_in_fp_ebb(Instr) ->
%%=============================================================
%% ------------------------------------------------------------
-%% Handling the gb_tree
+%% Handling the variable map
-delete_all([Key|Left], Tree) ->
- delete_all(Left, gb_trees:delete_any(Key, Tree));
-delete_all([], Tree) ->
- Tree.
+-spec lookup_list([icode_var() | icode_const()], var_map())
+ -> [none | icode_fvar()].
lookup_list(List, Info) ->
lookup_list(List, fun lookup/2, Info, []).
@@ -653,33 +750,43 @@ lookup_list([H|T], Fun, Info, Acc) ->
lookup_list([], _, _, Acc) ->
lists:reverse(Acc).
+-spec lookup(icode_var() | icode_const(), var_map()) -> none | icode_fvar().
+
lookup(Key, Tree) ->
case hipe_icode:is_const(Key) of
%% This can be true if the same constant has been
%% untagged more than once
true -> none;
false ->
- case gb_trees:lookup(Key, Tree) of
- none -> none;
- {value, {assigned, Val}} -> Val;
- {value, Val} -> Val
+ case Tree of
+ #{Key := {assigned, Val}} -> Val;
+ #{Key := Val} -> Val;
+ #{} -> none
end
end.
+-spec lookup_list_keep_consts([icode_var() | icode_const()], var_map())
+ -> [none | icode_fvar() | icode_const()].
+
lookup_list_keep_consts(List, Info) ->
lookup_list(List, fun lookup_keep_consts/2, Info, []).
+-spec lookup_keep_consts(icode_var() | icode_const(), var_map())
+ -> none | icode_fvar() | icode_const().
+
lookup_keep_consts(Key, Tree) ->
case hipe_icode:is_const(Key) of
true -> Key;
false ->
- case gb_trees:lookup(Key, Tree) of
- none -> none;
- {value, {assigned, Val}} -> Val;
- {value, Val} -> Val
+ case Tree of
+ #{Key := {assigned, Val}} -> Val;
+ #{Key := Val} -> Val;
+ #{} -> none
end
end.
+-spec get_type(icode_argument()) -> erl_types:erl_type().
+
get_type(Var) ->
case hipe_icode:is_const(Var) of
true -> erl_types:t_from_term(hipe_icode:const_value(Var));
@@ -695,98 +802,108 @@ get_type(Var) ->
%% ------------------------------------------------------------
%% Handling the map from variables to fp-variables
+-spec join_maps([edge()], edge_map()) -> initial_var_map().
+
join_maps(Edges, EdgeMap) ->
- join_maps(Edges, EdgeMap, gb_trees:empty()).
+ join_maps(Edges, EdgeMap, #{}).
join_maps([Edge = {Pred, _}|Left], EdgeMap, Map) ->
- case gb_trees:lookup(Edge, EdgeMap) of
- none ->
+ case EdgeMap of
+ #{Edge := OldMap} ->
+ NewMap = join_maps0(maps:to_list(OldMap), Pred, Map),
+ join_maps(Left, EdgeMap, NewMap);
+ #{} ->
%% All predecessors have not been handled. Use empty map.
- gb_trees:empty();
- {value, OldMap} ->
- NewMap = join_maps0(gb_trees:to_list(OldMap), Pred, Map),
- join_maps(Left, EdgeMap, NewMap)
+ #{}
end;
join_maps([], _, Map) ->
Map.
-join_maps0([{phi, _}|Tail], Pred, Map) ->
- join_maps0(Tail, Pred, Map);
-join_maps0([{Var, FVar}|Tail], Pred, Map) ->
- case gb_trees:lookup(Var, Map) of
- none ->
- join_maps0(Tail, Pred, gb_trees:enter(Var, [{Pred, FVar}], Map));
- {value, List} ->
+-spec join_maps0(list(), icode_lbl(), initial_var_map()) -> initial_var_map().
+
+join_maps0([{Var=#icode_variable{kind=var}, FVar}|Tail], Pred, Map) ->
+ case Map of
+ #{Var := List} ->
case lists:keyfind(Pred, 1, List) of
false ->
- join_maps0(Tail, Pred, gb_trees:update(Var, [{Pred, FVar}|List], Map));
+ join_maps0(Tail, Pred, Map#{Var := [{Pred, FVar}|List]});
{Pred, FVar} ->
%% No problem.
join_maps0(Tail, Pred, Map);
_ ->
exit('New binding to same variable')
- end
+ end;
+ #{} ->
+ join_maps0(Tail, Pred, Map#{Var => [{Pred, FVar}]})
end;
join_maps0([], _, Map) ->
Map.
+-spec filter_map(initial_var_map(), pos_integer()) -> var_map_phi().
+
filter_map(Map, NofPreds) ->
- filter_map(gb_trees:to_list(Map), NofPreds, Map).
+ filter_map(maps:to_list(Map), NofPreds, Map).
+
+-spec filter_map([{icode_var(), incoming_fvars()}], pos_integer(),
+ var_map_phi()) -> var_map_phi().
filter_map([{Var, Bindings}|Left], NofPreds, Map) ->
case length(Bindings) =:= NofPreds of
true ->
+ BindingsAllAssigned = lists:all(fun({_, {assigned, _}}) -> true;
+ ({_, _}) -> false
+ end, Bindings),
case all_args_equal(Bindings) of
true ->
- {_, FVar} = hd(Bindings),
- filter_map(Left, NofPreds, gb_trees:update(Var, FVar, Map));
+ NewBinding =
+ case hd(Bindings) of
+ {Pred, {assigned, FVar0}} when is_integer(Pred) ->
+ case BindingsAllAssigned of
+ true -> {assigned, FVar0};
+ false -> FVar0
+ end;
+ {Pred, FVar0} when is_integer(Pred) -> FVar0
+ end,
+ filter_map(Left, NofPreds, Map#{Var := NewBinding});
false ->
PhiDst = hipe_icode:mk_new_fvar(),
PhiArgs = strip_of_assigned(Bindings),
NewMap =
- case gb_trees:lookup(phi, Map) of
- none ->
- gb_trees:insert(phi, [{PhiDst, PhiArgs}], Map);
- {value, Val} ->
- gb_trees:update(phi, [{PhiDst, PhiArgs}|Val], Map)
+ case Map of
+ #{phi := Val} ->
+ Map#{phi := [{PhiDst, PhiArgs}|Val]};
+ #{} ->
+ Map#{phi => [{PhiDst, PhiArgs}]}
end,
NewBinding =
- case bindings_are_assigned(Bindings) of
+ case BindingsAllAssigned of
true -> {assigned, PhiDst};
false -> PhiDst
end,
- filter_map(Left, NofPreds, gb_trees:update(Var, NewBinding, NewMap))
+ filter_map(Left, NofPreds, NewMap#{Var := NewBinding})
end;
false ->
- filter_map(Left, NofPreds, gb_trees:delete(Var, Map))
+ filter_map(Left, NofPreds, maps:remove(Var, Map))
end;
filter_map([], _NofPreds, Map) ->
Map.
-bindings_are_assigned([{_, {assigned, _}}|Left]) ->
- assert_assigned(Left),
- true;
-bindings_are_assigned(Bindings) ->
- assert_not_assigned(Bindings),
- false.
-
-assert_assigned([{_, {assigned, _}}|Left]) ->
- assert_assigned(Left);
-assert_assigned([]) ->
- ok.
-
-assert_not_assigned([{_, FVar}|Left]) ->
- true = hipe_icode:is_fvar(FVar),
- assert_not_assigned(Left);
-assert_not_assigned([]) ->
- ok.
+-spec all_args_equal(incoming_fvars()) -> boolean().
%% all_args_equal returns true if the mapping for a variable is the
%% same from all predecessors, i.e., we do not need a phi-node.
+%% During the fixpoint loop, a mapping might become assigned, without that
+%% information having propagated into all predecessors. We take care to answer
+%% true even if FVar is only assigned in some predecessors.
+
+all_args_equal([{_, {assigned, FVar}}|Left]) ->
+ all_args_equal(Left, FVar);
all_args_equal([{_, FVar}|Left]) ->
all_args_equal(Left, FVar).
+all_args_equal([{_, {assigned, FVar1}}|Left], FVar1) ->
+ all_args_equal(Left, FVar1);
all_args_equal([{_, FVar1}|Left], FVar1) ->
all_args_equal(Left, FVar1);
all_args_equal([], _) ->
@@ -795,20 +912,24 @@ all_args_equal(_, _) ->
false.
+-spec add_new_bindings_unassigned([icode_var()], var_map()) -> var_map().
+
%% We differentiate between values that have been assigned as
%% tagged variables and those that got a 'virtual' binding.
add_new_bindings_unassigned([Var|Left], Map) ->
FVar = hipe_icode:mk_new_fvar(),
- add_new_bindings_unassigned(Left, gb_trees:insert(Var, FVar, Map));
+ add_new_bindings_unassigned(Left, Map#{Var => FVar});
add_new_bindings_unassigned([], Map) ->
Map.
+-spec add_new_bindings_assigned([icode_var()], var_map()) -> var_map().
+
add_new_bindings_assigned([Var|Left], Map) ->
case lookup(Var, Map) of
none ->
FVar = hipe_icode:mk_new_fvar(),
- NewMap = gb_trees:insert(Var, {assigned, FVar}, Map),
+ NewMap = Map#{Var => {assigned, FVar}},
add_new_bindings_assigned(Left, NewMap);
_ ->
add_new_bindings_assigned(Left, Map)
@@ -816,6 +937,8 @@ add_new_bindings_assigned([Var|Left], Map) ->
add_new_bindings_assigned([], Map) ->
Map.
+-spec strip_of_assigned(incoming_fvars()) -> [{icode_lbl(), icode_fvar()}].
+
strip_of_assigned(List) ->
strip_of_assigned(List, []).
@@ -830,6 +953,8 @@ strip_of_assigned([], Acc) ->
%% Help functions for the transformation from ordinary instruction to
%% fp-instruction
+-spec is_fop_cand(icode_instr()) -> boolean().
+
is_fop_cand(I) ->
case hipe_icode:call_fun(I) of
'/' -> true;
@@ -840,6 +965,8 @@ is_fop_cand(I) ->
end
end.
+-spec any_is_float([icode_argument()]) -> boolean().
+
any_is_float(Vars) ->
lists:any(fun (V) -> erl_types:t_is_float(get_type(V)) end, Vars).
@@ -866,25 +993,32 @@ fun_to_fop(Fun) ->
end.
+-spec must_be_tagged(icode_var(), var_map()) -> boolean().
+
%% If there is a tagged version of this variable available we don't
%% have to tag the untagged version.
must_be_tagged(Var, Map) ->
- case gb_trees:lookup(Var, Map) of
- none -> false;
- {value, {assigned, _}} -> false;
- {value, Val} -> hipe_icode:is_fvar(Val)
+ case Map of
+ #{Var := {assigned, _}} -> false;
+ #{Var := Val} -> hipe_icode:is_fvar(Val);
+ #{} -> false
end.
+-spec get_conv_instrs([icode_argument()], var_map()) -> icode_instrs().
+
%% Converting to floating point variables
get_conv_instrs(Vars, Map) ->
get_conv_instrs(Vars, Map, []).
+-spec get_conv_instrs([icode_argument()], var_map(), icode_instrs())
+ -> icode_instrs().
+
get_conv_instrs([Var|Left], Map, Acc) ->
- {_, Dst} = gb_trees:get(Var, Map),
- NewI =
+ #{Var := {_, Dst}} = Map,
+ NewI =
case erl_types:t_is_float(get_type(Var)) of
true ->
[hipe_icode:mk_primop([Dst], unsafe_untag_float, [Var])];
@@ -896,6 +1030,8 @@ get_conv_instrs([], _, Acc) ->
Acc.
+-spec conv_consts([icode_const()], icode_instr()) -> icode_instr().
+
conv_consts(ConstArgs, I) ->
conv_consts(ConstArgs, I, []).
@@ -934,63 +1070,79 @@ state__bb_add(S = #state{cfg = Cfg}, Label, BB) ->
NewCfg = hipe_icode_cfg:bb_add(Cfg, Label, BB),
S#state{cfg = NewCfg}.
+-spec state__map(state(), icode_lbl()) -> initial_var_map().
+
state__map(S = #state{edge_map = EM}, To) ->
join_maps([{From, To} || From <- state__pred(S, To)], EM).
+-spec state__map_update(state(), icode_lbl(), icode_lbl(), var_map()) ->
+ fixpoint | state().
+
state__map_update(S = #state{edge_map = EM}, From, To, Map) ->
FromTo = {From, To},
MapChanged =
- case gb_trees:lookup(FromTo, EM) of
- {value, Map1} -> not match(Map1, Map);
- none -> true
+ case EM of
+ #{FromTo := Map1} -> not match(Map1, Map);
+ #{} -> true
end,
case MapChanged of
true ->
- NewEM = gb_trees:enter(FromTo, Map, EM),
+ NewEM = EM#{FromTo => Map},
S#state{edge_map = NewEM};
false ->
fixpoint
end.
+-spec state__join_in_block(state(), icode_lbl())
+ -> fixpoint | {state(), in_block()}.
+
state__join_in_block(S = #state{fp_ebb_map = Map}, Label) ->
Pred = state__pred(S, Label),
Edges = [{X, Label} || X <- Pred],
- NewInBlock = join_in_block([gb_trees:lookup(X, Map) || X <- Edges]),
+ NewInBlock = join_in_block([maps:find(X, Map) || X <- Edges]),
InBlockLabel = {inblock_in, Label},
- case gb_trees:lookup(InBlockLabel, Map) of
- none ->
- NewMap = gb_trees:insert(InBlockLabel, NewInBlock, Map),
- {S#state{fp_ebb_map = NewMap}, NewInBlock};
- {value, NewInBlock} ->
+ case Map of
+ #{InBlockLabel := NewInBlock} ->
fixpoint;
- _Other ->
- NewMap = gb_trees:update(InBlockLabel, NewInBlock, Map),
+ _ ->
+ NewMap = Map#{InBlockLabel => NewInBlock},
{S#state{fp_ebb_map = NewMap}, NewInBlock}
end.
+-spec state__in_block_out_update(state(), icode_lbl(), in_block())
+ -> state().
+
state__in_block_out_update(S = #state{fp_ebb_map = Map}, Label, NewInBlock) ->
Succ = state__succ(S, Label),
Edges = [{Label, X} || X <- Succ],
NewMap = update_edges(Edges, NewInBlock, Map),
- NewMap1 = gb_trees:enter({inblock_out, Label}, NewInBlock, NewMap),
+ NewMap1 = NewMap#{{inblock_out, Label} => NewInBlock},
S#state{fp_ebb_map = NewMap1}.
+-spec update_edges([edge()], in_block(), fp_ebb_map()) -> fp_ebb_map().
+
update_edges([Edge|Left], NewInBlock, Map) ->
- NewMap = gb_trees:enter(Edge, NewInBlock, Map),
+ NewMap = Map#{Edge => NewInBlock},
update_edges(Left, NewInBlock, NewMap);
update_edges([], _NewInBlock, NewMap) ->
NewMap.
+-spec join_in_block([error | {ok, in_block()}]) -> in_block().
+
join_in_block([]) ->
false;
-join_in_block([none|_]) ->
+join_in_block([error|_]) ->
false;
-join_in_block([{value, InBlock}|Left]) ->
+join_in_block([{ok, InBlock}|Left]) ->
join_in_block(Left, InBlock).
-join_in_block([none|_], _Current) ->
+-spec join_in_block([error | {ok, in_block()}], Current)
+ -> false | Current when
+ Current :: in_block().
+
+join_in_block([error|_], _Current) ->
false;
-join_in_block([{value, InBlock}|Left], Current) ->
+join_in_block([{ok, InBlock}|Left], Current) ->
if Current =:= InBlock -> join_in_block(Left, Current);
Current =:= false -> false;
InBlock =:= false -> false;
@@ -998,19 +1150,25 @@ join_in_block([{value, InBlock}|Left], Current) ->
end;
join_in_block([], Current) ->
Current.
-
+
+
+-spec state__get_in_block_in(state(), icode_lbl()) -> in_block().
state__get_in_block_in(#state{fp_ebb_map = Map}, Label) ->
- gb_trees:get({inblock_in, Label}, Map).
+ maps:get({inblock_in, Label}, Map).
state__get_in_block_out(#state{fp_ebb_map = Map}, Label) ->
- gb_trees:get({inblock_out, Label}, Map).
+ maps:get({inblock_out, Label}, Map).
+-spec new_worklist(state()) -> worklist().
+
new_worklist(#state{cfg = Cfg}) ->
Start = hipe_icode_cfg:start_label(Cfg),
{[Start], [], gb_sets:insert(Start, gb_sets:empty())}.
+-spec get_work(worklist()) -> none | {icode_lbl(), worklist()}.
+
get_work({[Label|Left], List, Set}) ->
{Label, {Left, List, gb_sets:delete(Label, Set)}};
get_work({[], [], _Set}) ->
@@ -1018,6 +1176,8 @@ get_work({[], [], _Set}) ->
get_work({[], List, Set}) ->
get_work({lists:reverse(List), [], Set}).
+-spec add_work(worklist(), [icode_lbl()]) -> worklist().
+
add_work({List1, List2, Set} = Work, [Label|Left]) ->
case gb_sets:is_member(Label, Set) of
true ->
@@ -1030,15 +1190,7 @@ add_work({List1, List2, Set} = Work, [Label|Left]) ->
add_work(WorkList, []) ->
WorkList.
-match(Tree1, Tree2) ->
- match_1(gb_trees:to_list(Tree1), Tree2) andalso
- match_1(gb_trees:to_list(Tree2), Tree1).
+-spec match(var_map(), var_map()) -> boolean().
-match_1([{Key, Val}|Left], Tree2) ->
- case gb_trees:lookup(Key, Tree2) of
- {value, Val} ->
- match_1(Left, Tree2);
- _ -> false
- end;
-match_1([], _) ->
- true.
+match(Tree1, Tree2) when is_map(Tree1), is_map(Tree2) ->
+ Tree1 =:= Tree2.
diff --git a/lib/hipe/icode/hipe_icode_heap_test.erl b/lib/hipe/icode/hipe_icode_heap_test.erl
index 72d3574122..ec754d5ee9 100644
--- a/lib/hipe/icode/hipe_icode_heap_test.erl
+++ b/lib/hipe/icode/hipe_icode_heap_test.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_inline_bifs.erl b/lib/hipe/icode/hipe_icode_inline_bifs.erl
index 4841b56f41..79f67c2db6 100644
--- a/lib/hipe/icode/hipe_icode_inline_bifs.erl
+++ b/lib/hipe/icode/hipe_icode_inline_bifs.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_instruction_counter.erl b/lib/hipe/icode/hipe_icode_instruction_counter.erl
index 183198e5eb..afa70e495b 100644
--- a/lib/hipe/icode/hipe_icode_instruction_counter.erl
+++ b/lib/hipe/icode/hipe_icode_instruction_counter.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_liveness.erl b/lib/hipe/icode/hipe_icode_liveness.erl
index 2d12bacc36..317d2e54c2 100644
--- a/lib/hipe/icode/hipe_icode_liveness.erl
+++ b/lib/hipe/icode/hipe_icode_liveness.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_mulret.erl b/lib/hipe/icode/hipe_icode_mulret.erl
index d0a0530ef5..d927a46222 100644
--- a/lib/hipe/icode/hipe_icode_mulret.erl
+++ b/lib/hipe/icode/hipe_icode_mulret.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_pp.erl b/lib/hipe/icode/hipe_icode_pp.erl
index 749f32e87c..a736b54c38 100644
--- a/lib/hipe/icode/hipe_icode_pp.erl
+++ b/lib/hipe/icode/hipe_icode_pp.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_primops.erl b/lib/hipe/icode/hipe_icode_primops.erl
index a0deb31c42..cee37b6a57 100644
--- a/lib/hipe/icode/hipe_icode_primops.erl
+++ b/lib/hipe/icode/hipe_icode_primops.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_primops.hrl b/lib/hipe/icode/hipe_icode_primops.hrl
index 7cfc8389ff..a0aee165ba 100644
--- a/lib/hipe/icode/hipe_icode_primops.hrl
+++ b/lib/hipe/icode/hipe_icode_primops.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_range.erl b/lib/hipe/icode/hipe_icode_range.erl
index 9a20527a83..24ffc71237 100644
--- a/lib/hipe/icode/hipe_icode_range.erl
+++ b/lib/hipe/icode/hipe_icode_range.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_split_arith.erl b/lib/hipe/icode/hipe_icode_split_arith.erl
index 4f6a79411b..e00a13f82e 100644
--- a/lib/hipe/icode/hipe_icode_split_arith.erl
+++ b/lib/hipe/icode/hipe_icode_split_arith.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_ssa.erl b/lib/hipe/icode/hipe_icode_ssa.erl
index 3d8f18867d..b222fbc7d2 100644
--- a/lib/hipe/icode/hipe_icode_ssa.erl
+++ b/lib/hipe/icode/hipe_icode_ssa.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_ssa_const_prop.erl b/lib/hipe/icode/hipe_icode_ssa_const_prop.erl
index bfa4c0fc61..4ab4d7e95d 100644
--- a/lib/hipe/icode/hipe_icode_ssa_const_prop.erl
+++ b/lib/hipe/icode/hipe_icode_ssa_const_prop.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_ssa_copy_prop.erl b/lib/hipe/icode/hipe_icode_ssa_copy_prop.erl
index ae2f32fd2c..5e5bd2a178 100644
--- a/lib/hipe/icode/hipe_icode_ssa_copy_prop.erl
+++ b/lib/hipe/icode/hipe_icode_ssa_copy_prop.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_type.erl b/lib/hipe/icode/hipe_icode_type.erl
index fd81915f9f..e3ba00c5e9 100644
--- a/lib/hipe/icode/hipe_icode_type.erl
+++ b/lib/hipe/icode/hipe_icode_type.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/icode/hipe_icode_type.hrl b/lib/hipe/icode/hipe_icode_type.hrl
index ba2b51e4f5..466e157646 100644
--- a/lib/hipe/icode/hipe_icode_type.hrl
+++ b/lib/hipe/icode/hipe_icode_type.hrl
@@ -1,7 +1,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/llvm/Makefile b/lib/hipe/llvm/Makefile
index f6f6f6be1c..d2d39fb9e3 100644
--- a/lib/hipe/llvm/Makefile
+++ b/lib/hipe/llvm/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2014. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/main/Makefile b/lib/hipe/main/Makefile
index d44be2d9fa..6b6cad3ed3 100644
--- a/lib/hipe/main/Makefile
+++ b/lib/hipe/main/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/main/hipe.appup.src b/lib/hipe/main/hipe.appup.src
index 599fd3179e..b297ba10db 100644
--- a/lib/hipe/main/hipe.appup.src
+++ b/lib/hipe/main/hipe.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/misc/Makefile b/lib/hipe/misc/Makefile
index be5c9bc2b6..60d2861c62 100644
--- a/lib/hipe/misc/Makefile
+++ b/lib/hipe/misc/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/misc/hipe_consttab.erl b/lib/hipe/misc/hipe_consttab.erl
index fd4c2e2f27..f361edc79c 100644
--- a/lib/hipe/misc/hipe_consttab.erl
+++ b/lib/hipe/misc/hipe_consttab.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/misc/hipe_consttab.hrl b/lib/hipe/misc/hipe_consttab.hrl
index 8f3bc8e337..d2dbbe509c 100644
--- a/lib/hipe/misc/hipe_consttab.hrl
+++ b/lib/hipe/misc/hipe_consttab.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/misc/hipe_data_pp.erl b/lib/hipe/misc/hipe_data_pp.erl
index fbb247fd96..6cdc6c5ad2 100644
--- a/lib/hipe/misc/hipe_data_pp.erl
+++ b/lib/hipe/misc/hipe_data_pp.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/misc/hipe_gensym.erl b/lib/hipe/misc/hipe_gensym.erl
index aea53b137b..da7c4f9a5d 100644
--- a/lib/hipe/misc/hipe_gensym.erl
+++ b/lib/hipe/misc/hipe_gensym.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/misc/hipe_pack_constants.erl b/lib/hipe/misc/hipe_pack_constants.erl
index 6706b4b023..b54830dd57 100644
--- a/lib/hipe/misc/hipe_pack_constants.erl
+++ b/lib/hipe/misc/hipe_pack_constants.erl
@@ -3,7 +3,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/misc/hipe_sdi.erl b/lib/hipe/misc/hipe_sdi.erl
index 00d30e553b..fbb4b105f6 100644
--- a/lib/hipe/misc/hipe_sdi.erl
+++ b/lib/hipe/misc/hipe_sdi.erl
@@ -3,7 +3,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/misc/hipe_sdi.hrl b/lib/hipe/misc/hipe_sdi.hrl
index f697f9d9dd..a1e12f9df2 100644
--- a/lib/hipe/misc/hipe_sdi.hrl
+++ b/lib/hipe/misc/hipe_sdi.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/opt/Makefile b/lib/hipe/opt/Makefile
index 76191bc48d..ec0d01b42e 100644
--- a/lib/hipe/opt/Makefile
+++ b/lib/hipe/opt/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/opt/hipe_schedule.erl b/lib/hipe/opt/hipe_schedule.erl
index 59b3e4e5e9..00ad487620 100644
--- a/lib/hipe/opt/hipe_schedule.erl
+++ b/lib/hipe/opt/hipe_schedule.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/opt/hipe_schedule_prio.erl b/lib/hipe/opt/hipe_schedule_prio.erl
index 34e2c03950..3dcc0845e0 100644
--- a/lib/hipe/opt/hipe_schedule_prio.erl
+++ b/lib/hipe/opt/hipe_schedule_prio.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/opt/hipe_spillmin.erl b/lib/hipe/opt/hipe_spillmin.erl
index d338ea1b34..4eeb1d71db 100644
--- a/lib/hipe/opt/hipe_spillmin.erl
+++ b/lib/hipe/opt/hipe_spillmin.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/opt/hipe_spillmin_color.erl b/lib/hipe/opt/hipe_spillmin_color.erl
index 6c87bad142..7c23de44b4 100644
--- a/lib/hipe/opt/hipe_spillmin_color.erl
+++ b/lib/hipe/opt/hipe_spillmin_color.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/opt/hipe_spillmin_scan.erl b/lib/hipe/opt/hipe_spillmin_scan.erl
index c24dd6d394..06b68e1934 100644
--- a/lib/hipe/opt/hipe_spillmin_scan.erl
+++ b/lib/hipe/opt/hipe_spillmin_scan.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/opt/hipe_target_machine.erl b/lib/hipe/opt/hipe_target_machine.erl
index 6f5befb5e2..f64bb8b518 100644
--- a/lib/hipe/opt/hipe_target_machine.erl
+++ b/lib/hipe/opt/hipe_target_machine.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/opt/hipe_ultra_mod2.erl b/lib/hipe/opt/hipe_ultra_mod2.erl
index 5720e56bcb..f28c4e6939 100644
--- a/lib/hipe/opt/hipe_ultra_mod2.erl
+++ b/lib/hipe/opt/hipe_ultra_mod2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/opt/hipe_ultra_prio.erl b/lib/hipe/opt/hipe_ultra_prio.erl
index 67612a66f0..423dc0d6bf 100644
--- a/lib/hipe/opt/hipe_ultra_prio.erl
+++ b/lib/hipe/opt/hipe_ultra_prio.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/Makefile b/lib/hipe/ppc/Makefile
index 1687308bd2..576c089f15 100644
--- a/lib/hipe/ppc/Makefile
+++ b/lib/hipe/ppc/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc.erl b/lib/hipe/ppc/hipe_ppc.erl
index c7902b0688..0fa96162f6 100644
--- a/lib/hipe/ppc/hipe_ppc.erl
+++ b/lib/hipe/ppc/hipe_ppc.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc.hrl b/lib/hipe/ppc/hipe_ppc.hrl
index 343b90ea7f..aa8ff4a3f7 100644
--- a/lib/hipe/ppc/hipe_ppc.hrl
+++ b/lib/hipe/ppc/hipe_ppc.hrl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_assemble.erl b/lib/hipe/ppc/hipe_ppc_assemble.erl
index 00f28d60e4..ff9da01b11 100644
--- a/lib/hipe/ppc/hipe_ppc_assemble.erl
+++ b/lib/hipe/ppc/hipe_ppc_assemble.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_cfg.erl b/lib/hipe/ppc/hipe_ppc_cfg.erl
index 7e96654817..34d4bf54c5 100644
--- a/lib/hipe/ppc/hipe_ppc_cfg.erl
+++ b/lib/hipe/ppc/hipe_ppc_cfg.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_defuse.erl b/lib/hipe/ppc/hipe_ppc_defuse.erl
index 7cea60450a..77b84dc574 100644
--- a/lib/hipe/ppc/hipe_ppc_defuse.erl
+++ b/lib/hipe/ppc/hipe_ppc_defuse.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_encode.erl b/lib/hipe/ppc/hipe_ppc_encode.erl
index 52ad53f66c..793f6ccc02 100644
--- a/lib/hipe/ppc/hipe_ppc_encode.erl
+++ b/lib/hipe/ppc/hipe_ppc_encode.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_finalise.erl b/lib/hipe/ppc/hipe_ppc_finalise.erl
index cc83282e31..8bb9520f89 100644
--- a/lib/hipe/ppc/hipe_ppc_finalise.erl
+++ b/lib/hipe/ppc/hipe_ppc_finalise.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_frame.erl b/lib/hipe/ppc/hipe_ppc_frame.erl
index 2c2a09e3f6..ff0450270f 100644
--- a/lib/hipe/ppc/hipe_ppc_frame.erl
+++ b/lib/hipe/ppc/hipe_ppc_frame.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_liveness_all.erl b/lib/hipe/ppc/hipe_ppc_liveness_all.erl
index 6a86dd3433..cab7605967 100644
--- a/lib/hipe/ppc/hipe_ppc_liveness_all.erl
+++ b/lib/hipe/ppc/hipe_ppc_liveness_all.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_liveness_fpr.erl b/lib/hipe/ppc/hipe_ppc_liveness_fpr.erl
index 1b10227be9..1437e27508 100644
--- a/lib/hipe/ppc/hipe_ppc_liveness_fpr.erl
+++ b/lib/hipe/ppc/hipe_ppc_liveness_fpr.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_liveness_gpr.erl b/lib/hipe/ppc/hipe_ppc_liveness_gpr.erl
index ca420b9f12..074fada918 100644
--- a/lib/hipe/ppc/hipe_ppc_liveness_gpr.erl
+++ b/lib/hipe/ppc/hipe_ppc_liveness_gpr.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_main.erl b/lib/hipe/ppc/hipe_ppc_main.erl
index 2336fdeaef..fd5cc2befb 100644
--- a/lib/hipe/ppc/hipe_ppc_main.erl
+++ b/lib/hipe/ppc/hipe_ppc_main.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_pp.erl b/lib/hipe/ppc/hipe_ppc_pp.erl
index 9233c666e3..e69e6b64a2 100644
--- a/lib/hipe/ppc/hipe_ppc_pp.erl
+++ b/lib/hipe/ppc/hipe_ppc_pp.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_ra.erl b/lib/hipe/ppc/hipe_ppc_ra.erl
index e3b9617d82..87c776f5d1 100644
--- a/lib/hipe/ppc/hipe_ppc_ra.erl
+++ b/lib/hipe/ppc/hipe_ppc_ra.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_ra_finalise.erl b/lib/hipe/ppc/hipe_ppc_ra_finalise.erl
index 168723d8a6..ea163221c2 100644
--- a/lib/hipe/ppc/hipe_ppc_ra_finalise.erl
+++ b/lib/hipe/ppc/hipe_ppc_ra_finalise.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_ra_ls.erl b/lib/hipe/ppc/hipe_ppc_ra_ls.erl
index f99c063655..6e8304467e 100644
--- a/lib/hipe/ppc/hipe_ppc_ra_ls.erl
+++ b/lib/hipe/ppc/hipe_ppc_ra_ls.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_ra_naive.erl b/lib/hipe/ppc/hipe_ppc_ra_naive.erl
index 7f66862d30..24995be252 100644
--- a/lib/hipe/ppc/hipe_ppc_ra_naive.erl
+++ b/lib/hipe/ppc/hipe_ppc_ra_naive.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_ra_postconditions.erl b/lib/hipe/ppc/hipe_ppc_ra_postconditions.erl
index 26e0bba682..0b16ec3891 100644
--- a/lib/hipe/ppc/hipe_ppc_ra_postconditions.erl
+++ b/lib/hipe/ppc/hipe_ppc_ra_postconditions.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_ra_postconditions_fp.erl b/lib/hipe/ppc/hipe_ppc_ra_postconditions_fp.erl
index ad8a5320fb..821aa66c11 100644
--- a/lib/hipe/ppc/hipe_ppc_ra_postconditions_fp.erl
+++ b/lib/hipe/ppc/hipe_ppc_ra_postconditions_fp.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_ppc_registers.erl b/lib/hipe/ppc/hipe_ppc_registers.erl
index e8301cb244..f4781d5ed7 100644
--- a/lib/hipe/ppc/hipe_ppc_registers.erl
+++ b/lib/hipe/ppc/hipe_ppc_registers.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ppc/hipe_rtl_to_ppc.erl b/lib/hipe/ppc/hipe_rtl_to_ppc.erl
index 998eefc922..a994659616 100644
--- a/lib/hipe/ppc/hipe_rtl_to_ppc.erl
+++ b/lib/hipe/ppc/hipe_rtl_to_ppc.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/Makefile b/lib/hipe/regalloc/Makefile
index 0442d1e07e..2b94f5ecfe 100644
--- a/lib/hipe/regalloc/Makefile
+++ b/lib/hipe/regalloc/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_adj_list.erl b/lib/hipe/regalloc/hipe_adj_list.erl
index c6c41f370f..de59da2410 100644
--- a/lib/hipe/regalloc/hipe_adj_list.erl
+++ b/lib/hipe/regalloc/hipe_adj_list.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_amd64_specific.erl b/lib/hipe/regalloc/hipe_amd64_specific.erl
index 5a3b52191a..6937e71ac7 100644
--- a/lib/hipe/regalloc/hipe_amd64_specific.erl
+++ b/lib/hipe/regalloc/hipe_amd64_specific.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_amd64_specific_sse2.erl b/lib/hipe/regalloc/hipe_amd64_specific_sse2.erl
index 656fc23a72..50e5869d45 100644
--- a/lib/hipe/regalloc/hipe_amd64_specific_sse2.erl
+++ b/lib/hipe/regalloc/hipe_amd64_specific_sse2.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_amd64_specific_x87.erl b/lib/hipe/regalloc/hipe_amd64_specific_x87.erl
index 0a06199909..2160e93d24 100644
--- a/lib/hipe/regalloc/hipe_amd64_specific_x87.erl
+++ b/lib/hipe/regalloc/hipe_amd64_specific_x87.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_arm_specific.erl b/lib/hipe/regalloc/hipe_arm_specific.erl
index f24171deab..4e34cb1d99 100644
--- a/lib/hipe/regalloc/hipe_arm_specific.erl
+++ b/lib/hipe/regalloc/hipe_arm_specific.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_coalescing_regalloc.erl b/lib/hipe/regalloc/hipe_coalescing_regalloc.erl
index dd4960f255..e2f817d369 100644
--- a/lib/hipe/regalloc/hipe_coalescing_regalloc.erl
+++ b/lib/hipe/regalloc/hipe_coalescing_regalloc.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_graph_coloring_regalloc.erl b/lib/hipe/regalloc/hipe_graph_coloring_regalloc.erl
index ddd4ab431d..bc6e442236 100644
--- a/lib/hipe/regalloc/hipe_graph_coloring_regalloc.erl
+++ b/lib/hipe/regalloc/hipe_graph_coloring_regalloc.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_ig.erl b/lib/hipe/regalloc/hipe_ig.erl
index 25d4cb0441..8fd5d0df1f 100644
--- a/lib/hipe/regalloc/hipe_ig.erl
+++ b/lib/hipe/regalloc/hipe_ig.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_ig_moves.erl b/lib/hipe/regalloc/hipe_ig_moves.erl
index c18eedbd16..b679453de0 100644
--- a/lib/hipe/regalloc/hipe_ig_moves.erl
+++ b/lib/hipe/regalloc/hipe_ig_moves.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_ls_regalloc.erl b/lib/hipe/regalloc/hipe_ls_regalloc.erl
index b3a2668a09..d24b803524 100644
--- a/lib/hipe/regalloc/hipe_ls_regalloc.erl
+++ b/lib/hipe/regalloc/hipe_ls_regalloc.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_moves.erl b/lib/hipe/regalloc/hipe_moves.erl
index 644d731861..39ccfb4a2f 100644
--- a/lib/hipe/regalloc/hipe_moves.erl
+++ b/lib/hipe/regalloc/hipe_moves.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_node_sets.erl b/lib/hipe/regalloc/hipe_node_sets.erl
index ca36f2d591..01922a34d4 100644
--- a/lib/hipe/regalloc/hipe_node_sets.erl
+++ b/lib/hipe/regalloc/hipe_node_sets.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_optimistic_regalloc.erl b/lib/hipe/regalloc/hipe_optimistic_regalloc.erl
index c996d9c285..2ed9ec3b45 100644
--- a/lib/hipe/regalloc/hipe_optimistic_regalloc.erl
+++ b/lib/hipe/regalloc/hipe_optimistic_regalloc.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_ppc_specific.erl b/lib/hipe/regalloc/hipe_ppc_specific.erl
index 9e9be64fb4..c49b1e510f 100644
--- a/lib/hipe/regalloc/hipe_ppc_specific.erl
+++ b/lib/hipe/regalloc/hipe_ppc_specific.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_ppc_specific_fp.erl b/lib/hipe/regalloc/hipe_ppc_specific_fp.erl
index b1e3440fb0..454aa4c686 100644
--- a/lib/hipe/regalloc/hipe_ppc_specific_fp.erl
+++ b/lib/hipe/regalloc/hipe_ppc_specific_fp.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_reg_worklists.erl b/lib/hipe/regalloc/hipe_reg_worklists.erl
index 6e0770caa7..88585f9f38 100644
--- a/lib/hipe/regalloc/hipe_reg_worklists.erl
+++ b/lib/hipe/regalloc/hipe_reg_worklists.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_regalloc_loop.erl b/lib/hipe/regalloc/hipe_regalloc_loop.erl
index 4b01d714c3..d29615a3a0 100644
--- a/lib/hipe/regalloc/hipe_regalloc_loop.erl
+++ b/lib/hipe/regalloc/hipe_regalloc_loop.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_sparc_specific.erl b/lib/hipe/regalloc/hipe_sparc_specific.erl
index 460d89c342..8d34604f84 100644
--- a/lib/hipe/regalloc/hipe_sparc_specific.erl
+++ b/lib/hipe/regalloc/hipe_sparc_specific.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_sparc_specific_fp.erl b/lib/hipe/regalloc/hipe_sparc_specific_fp.erl
index df10b2ee73..2edd3cb47e 100644
--- a/lib/hipe/regalloc/hipe_sparc_specific_fp.erl
+++ b/lib/hipe/regalloc/hipe_sparc_specific_fp.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_spillcost.erl b/lib/hipe/regalloc/hipe_spillcost.erl
index 27ce6515ef..b241e637d9 100644
--- a/lib/hipe/regalloc/hipe_spillcost.erl
+++ b/lib/hipe/regalloc/hipe_spillcost.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_spillcost.hrl b/lib/hipe/regalloc/hipe_spillcost.hrl
index c1a3cbb550..3cadcbe432 100644
--- a/lib/hipe/regalloc/hipe_spillcost.hrl
+++ b/lib/hipe/regalloc/hipe_spillcost.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_temp_map.erl b/lib/hipe/regalloc/hipe_temp_map.erl
index d9b9162e48..4085a0e1a7 100644
--- a/lib/hipe/regalloc/hipe_temp_map.erl
+++ b/lib/hipe/regalloc/hipe_temp_map.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_x86_specific.erl b/lib/hipe/regalloc/hipe_x86_specific.erl
index 7c76fcc796..4edf8674b7 100644
--- a/lib/hipe/regalloc/hipe_x86_specific.erl
+++ b/lib/hipe/regalloc/hipe_x86_specific.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/regalloc/hipe_x86_specific_x87.erl b/lib/hipe/regalloc/hipe_x86_specific_x87.erl
index c4ab1ecef0..ece07cb2f9 100644
--- a/lib/hipe/regalloc/hipe_x86_specific_x87.erl
+++ b/lib/hipe/regalloc/hipe_x86_specific_x87.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/Makefile b/lib/hipe/rtl/Makefile
index 1bf52fe312..e0ff225a25 100644
--- a/lib/hipe/rtl/Makefile
+++ b/lib/hipe/rtl/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2013. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_icode2rtl.erl b/lib/hipe/rtl/hipe_icode2rtl.erl
index d809f9ac20..22feca47cc 100644
--- a/lib/hipe/rtl/hipe_icode2rtl.erl
+++ b/lib/hipe/rtl/hipe_icode2rtl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl.erl b/lib/hipe/rtl/hipe_rtl.erl
index 6e27daeedf..1d627ed024 100644
--- a/lib/hipe/rtl/hipe_rtl.erl
+++ b/lib/hipe/rtl/hipe_rtl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl.hrl b/lib/hipe/rtl/hipe_rtl.hrl
index eaa2d20ac8..cc76e7e5c4 100644
--- a/lib/hipe/rtl/hipe_rtl.hrl
+++ b/lib/hipe/rtl/hipe_rtl.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_arch.erl b/lib/hipe/rtl/hipe_rtl_arch.erl
index 4b4ce396c4..397b96120e 100644
--- a/lib/hipe/rtl/hipe_rtl_arch.erl
+++ b/lib/hipe/rtl/hipe_rtl_arch.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_arith.inc b/lib/hipe/rtl/hipe_rtl_arith.inc
index 1dff56b074..645bc83f9f 100644
--- a/lib/hipe/rtl/hipe_rtl_arith.inc
+++ b/lib/hipe/rtl/hipe_rtl_arith.inc
@@ -3,7 +3,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_arith_32.erl b/lib/hipe/rtl/hipe_rtl_arith_32.erl
index d790a8b981..12075ed609 100644
--- a/lib/hipe/rtl/hipe_rtl_arith_32.erl
+++ b/lib/hipe/rtl/hipe_rtl_arith_32.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_arith_64.erl b/lib/hipe/rtl/hipe_rtl_arith_64.erl
index d1566973ff..6dac8fb145 100644
--- a/lib/hipe/rtl/hipe_rtl_arith_64.erl
+++ b/lib/hipe/rtl/hipe_rtl_arith_64.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_binary.erl b/lib/hipe/rtl/hipe_rtl_binary.erl
index 9cbab08ee2..fb9c0c196d 100644
--- a/lib/hipe/rtl/hipe_rtl_binary.erl
+++ b/lib/hipe/rtl/hipe_rtl_binary.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_binary_match.erl b/lib/hipe/rtl/hipe_rtl_binary_match.erl
index be4c35dae0..528672b893 100644
--- a/lib/hipe/rtl/hipe_rtl_binary_match.erl
+++ b/lib/hipe/rtl/hipe_rtl_binary_match.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2007-2015. All Rights Reserved.
+%%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_cfg.erl b/lib/hipe/rtl/hipe_rtl_cfg.erl
index 8b2bc93bc5..f49e8f815f 100644
--- a/lib/hipe/rtl/hipe_rtl_cfg.erl
+++ b/lib/hipe/rtl/hipe_rtl_cfg.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_cleanup_const.erl b/lib/hipe/rtl/hipe_rtl_cleanup_const.erl
index 579ba11f7d..0a1cdbacb8 100644
--- a/lib/hipe/rtl/hipe_rtl_cleanup_const.erl
+++ b/lib/hipe/rtl/hipe_rtl_cleanup_const.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_exceptions.erl b/lib/hipe/rtl/hipe_rtl_exceptions.erl
index 243e06c196..331719f344 100644
--- a/lib/hipe/rtl/hipe_rtl_exceptions.erl
+++ b/lib/hipe/rtl/hipe_rtl_exceptions.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_lcm.erl b/lib/hipe/rtl/hipe_rtl_lcm.erl
index 1f65d870e4..ef866d0843 100644
--- a/lib/hipe/rtl/hipe_rtl_lcm.erl
+++ b/lib/hipe/rtl/hipe_rtl_lcm.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_liveness.erl b/lib/hipe/rtl/hipe_rtl_liveness.erl
index 46c02506a2..674043ec3c 100644
--- a/lib/hipe/rtl/hipe_rtl_liveness.erl
+++ b/lib/hipe/rtl/hipe_rtl_liveness.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_mk_switch.erl b/lib/hipe/rtl/hipe_rtl_mk_switch.erl
index 0c13b9ffcb..5f9dffa8cf 100644
--- a/lib/hipe/rtl/hipe_rtl_mk_switch.erl
+++ b/lib/hipe/rtl/hipe_rtl_mk_switch.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_primops.erl b/lib/hipe/rtl/hipe_rtl_primops.erl
index b5a43b6b7e..062fab842f 100644
--- a/lib/hipe/rtl/hipe_rtl_primops.erl
+++ b/lib/hipe/rtl/hipe_rtl_primops.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_ssa.erl b/lib/hipe/rtl/hipe_rtl_ssa.erl
index b9be73d6ac..1e3b21d6be 100644
--- a/lib/hipe/rtl/hipe_rtl_ssa.erl
+++ b/lib/hipe/rtl/hipe_rtl_ssa.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_ssa_avail_expr.erl b/lib/hipe/rtl/hipe_rtl_ssa_avail_expr.erl
index ffb63c48e2..f08ff22ed9 100644
--- a/lib/hipe/rtl/hipe_rtl_ssa_avail_expr.erl
+++ b/lib/hipe/rtl/hipe_rtl_ssa_avail_expr.erl
@@ -1,7 +1,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_ssa_const_prop.erl b/lib/hipe/rtl/hipe_rtl_ssa_const_prop.erl
index f80f9bc7d2..7158383010 100644
--- a/lib/hipe/rtl/hipe_rtl_ssa_const_prop.erl
+++ b/lib/hipe/rtl/hipe_rtl_ssa_const_prop.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_ssapre.erl b/lib/hipe/rtl/hipe_rtl_ssapre.erl
index 94533e5bdd..e248457806 100644
--- a/lib/hipe/rtl/hipe_rtl_ssapre.erl
+++ b/lib/hipe/rtl/hipe_rtl_ssapre.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_symbolic.erl b/lib/hipe/rtl/hipe_rtl_symbolic.erl
index d0055faece..1d7e0ec55e 100644
--- a/lib/hipe/rtl/hipe_rtl_symbolic.erl
+++ b/lib/hipe/rtl/hipe_rtl_symbolic.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/rtl/hipe_rtl_varmap.erl b/lib/hipe/rtl/hipe_rtl_varmap.erl
index cb6327af1a..31165d91a4 100644
--- a/lib/hipe/rtl/hipe_rtl_varmap.erl
+++ b/lib/hipe/rtl/hipe_rtl_varmap.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/Makefile b/lib/hipe/sparc/Makefile
index a193e6a853..9fea887ebd 100644
--- a/lib/hipe/sparc/Makefile
+++ b/lib/hipe/sparc/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_rtl_to_sparc.erl b/lib/hipe/sparc/hipe_rtl_to_sparc.erl
index 297b693b42..eef5ba8d96 100644
--- a/lib/hipe/sparc/hipe_rtl_to_sparc.erl
+++ b/lib/hipe/sparc/hipe_rtl_to_sparc.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc.erl b/lib/hipe/sparc/hipe_sparc.erl
index b376a6da53..5ecb6aa8b9 100644
--- a/lib/hipe/sparc/hipe_sparc.erl
+++ b/lib/hipe/sparc/hipe_sparc.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc.hrl b/lib/hipe/sparc/hipe_sparc.hrl
index 5fb9dfc23f..01c8d07f22 100644
--- a/lib/hipe/sparc/hipe_sparc.hrl
+++ b/lib/hipe/sparc/hipe_sparc.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_assemble.erl b/lib/hipe/sparc/hipe_sparc_assemble.erl
index 0e27c78416..e92f024968 100644
--- a/lib/hipe/sparc/hipe_sparc_assemble.erl
+++ b/lib/hipe/sparc/hipe_sparc_assemble.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_cfg.erl b/lib/hipe/sparc/hipe_sparc_cfg.erl
index 65f7ce310c..0b2c77f27b 100644
--- a/lib/hipe/sparc/hipe_sparc_cfg.erl
+++ b/lib/hipe/sparc/hipe_sparc_cfg.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_defuse.erl b/lib/hipe/sparc/hipe_sparc_defuse.erl
index ae529bed31..4f66299f1d 100644
--- a/lib/hipe/sparc/hipe_sparc_defuse.erl
+++ b/lib/hipe/sparc/hipe_sparc_defuse.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_encode.erl b/lib/hipe/sparc/hipe_sparc_encode.erl
index 07d5d67fd5..6a7d502fd3 100644
--- a/lib/hipe/sparc/hipe_sparc_encode.erl
+++ b/lib/hipe/sparc/hipe_sparc_encode.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_finalise.erl b/lib/hipe/sparc/hipe_sparc_finalise.erl
index af234993b1..2b7125fb73 100644
--- a/lib/hipe/sparc/hipe_sparc_finalise.erl
+++ b/lib/hipe/sparc/hipe_sparc_finalise.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_frame.erl b/lib/hipe/sparc/hipe_sparc_frame.erl
index c86dfcc7a8..a42c1983f4 100644
--- a/lib/hipe/sparc/hipe_sparc_frame.erl
+++ b/lib/hipe/sparc/hipe_sparc_frame.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_liveness_all.erl b/lib/hipe/sparc/hipe_sparc_liveness_all.erl
index 0b1cb7d5ae..b7c3e1962a 100644
--- a/lib/hipe/sparc/hipe_sparc_liveness_all.erl
+++ b/lib/hipe/sparc/hipe_sparc_liveness_all.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_liveness_fpr.erl b/lib/hipe/sparc/hipe_sparc_liveness_fpr.erl
index 699a311f8c..497c554c3e 100644
--- a/lib/hipe/sparc/hipe_sparc_liveness_fpr.erl
+++ b/lib/hipe/sparc/hipe_sparc_liveness_fpr.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_liveness_gpr.erl b/lib/hipe/sparc/hipe_sparc_liveness_gpr.erl
index 8f2edd7239..55d639e3a2 100644
--- a/lib/hipe/sparc/hipe_sparc_liveness_gpr.erl
+++ b/lib/hipe/sparc/hipe_sparc_liveness_gpr.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_main.erl b/lib/hipe/sparc/hipe_sparc_main.erl
index e09a0bf661..c16751c7bd 100644
--- a/lib/hipe/sparc/hipe_sparc_main.erl
+++ b/lib/hipe/sparc/hipe_sparc_main.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_pp.erl b/lib/hipe/sparc/hipe_sparc_pp.erl
index bdc868a518..8fa0a9c788 100644
--- a/lib/hipe/sparc/hipe_sparc_pp.erl
+++ b/lib/hipe/sparc/hipe_sparc_pp.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_ra.erl b/lib/hipe/sparc/hipe_sparc_ra.erl
index 7551b3b7bc..afea8c9b4c 100644
--- a/lib/hipe/sparc/hipe_sparc_ra.erl
+++ b/lib/hipe/sparc/hipe_sparc_ra.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_ra_finalise.erl b/lib/hipe/sparc/hipe_sparc_ra_finalise.erl
index 02e86794f6..dc1e69c101 100644
--- a/lib/hipe/sparc/hipe_sparc_ra_finalise.erl
+++ b/lib/hipe/sparc/hipe_sparc_ra_finalise.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_ra_ls.erl b/lib/hipe/sparc/hipe_sparc_ra_ls.erl
index c44fd495bf..19e7c92d2f 100644
--- a/lib/hipe/sparc/hipe_sparc_ra_ls.erl
+++ b/lib/hipe/sparc/hipe_sparc_ra_ls.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_ra_naive.erl b/lib/hipe/sparc/hipe_sparc_ra_naive.erl
index 0fcd8b0f0b..b6c33dec6c 100644
--- a/lib/hipe/sparc/hipe_sparc_ra_naive.erl
+++ b/lib/hipe/sparc/hipe_sparc_ra_naive.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_ra_postconditions.erl b/lib/hipe/sparc/hipe_sparc_ra_postconditions.erl
index d79d63eb2a..ab31b3c8d9 100644
--- a/lib/hipe/sparc/hipe_sparc_ra_postconditions.erl
+++ b/lib/hipe/sparc/hipe_sparc_ra_postconditions.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_ra_postconditions_fp.erl b/lib/hipe/sparc/hipe_sparc_ra_postconditions_fp.erl
index a474e0ec6a..d893ac26e9 100644
--- a/lib/hipe/sparc/hipe_sparc_ra_postconditions_fp.erl
+++ b/lib/hipe/sparc/hipe_sparc_ra_postconditions_fp.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/sparc/hipe_sparc_registers.erl b/lib/hipe/sparc/hipe_sparc_registers.erl
index 59aef46bff..884215702b 100644
--- a/lib/hipe/sparc/hipe_sparc_registers.erl
+++ b/lib/hipe/sparc/hipe_sparc_registers.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ssa/hipe_ssa.inc b/lib/hipe/ssa/hipe_ssa.inc
index 86c036cd10..83ab320306 100644
--- a/lib/hipe/ssa/hipe_ssa.inc
+++ b/lib/hipe/ssa/hipe_ssa.inc
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ssa/hipe_ssa_const_prop.inc b/lib/hipe/ssa/hipe_ssa_const_prop.inc
index 664faf9737..648490f9a3 100644
--- a/lib/hipe/ssa/hipe_ssa_const_prop.inc
+++ b/lib/hipe/ssa/hipe_ssa_const_prop.inc
@@ -3,7 +3,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ssa/hipe_ssa_copy_prop.inc b/lib/hipe/ssa/hipe_ssa_copy_prop.inc
index f14abd869a..fd80d97b02 100644
--- a/lib/hipe/ssa/hipe_ssa_copy_prop.inc
+++ b/lib/hipe/ssa/hipe_ssa_copy_prop.inc
@@ -3,7 +3,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/ssa/hipe_ssa_liveness.inc b/lib/hipe/ssa/hipe_ssa_liveness.inc
index e454b71798..78488c65fc 100644
--- a/lib/hipe/ssa/hipe_ssa_liveness.inc
+++ b/lib/hipe/ssa/hipe_ssa_liveness.inc
@@ -3,7 +3,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/test/basic_SUITE_data/basic_floats.erl b/lib/hipe/test/basic_SUITE_data/basic_floats.erl
index eec175075a..ce28f6e156 100644
--- a/lib/hipe/test/basic_SUITE_data/basic_floats.erl
+++ b/lib/hipe/test/basic_SUITE_data/basic_floats.erl
@@ -18,6 +18,8 @@ test() ->
ok = test_catch_fp_conv(),
ok = test_fp_with_fp_exceptions(),
%% ok = test_fmt_double_fpe_leak(), % this requires printing
+ ok = test_icode_type_crash(),
+ ok = test_icode_type_crash_2(),
ok.
%%--------------------------------------------------------------------
@@ -178,3 +180,71 @@ test_fmt_double_fpe_leak(X, Y) ->
math:log10(Y).
int_two() -> 2.
+
+%%--------------------------------------------------------------------
+%% Contains code which confuses the icode_type analysis and results
+%% in a compiler crash. Stipped down from code sent by Paul Guyot.
+%% Compiles alright with the option 'no_icode_type' but that defeats
+%% the purpose of the test.
+
+test_icode_type_crash() ->
+ Fun = f(1, 2, 3),
+ 42.0 = Fun(),
+ ok.
+
+f(A, B, C) ->
+ fun () ->
+ X = case A of
+ 0 -> 1 / B;
+ _ -> A / C
+ end,
+ Y = case B of
+ a -> 1.0;
+ b -> 2.0;
+ _ -> 6.0
+ end,
+ Z = case C of
+ c -> 0.1 * X;
+ _ -> 7.0
+ end,
+ Y * Z
+ end.
+
+%%--------------------------------------------------------------------
+%% Contains another case that crashed hipe_icode_fp. This sample was
+%% sent by Mattias Jansson (25 Nov 2015). It compiled alright with the
+%% option 'no_icode_type' but that defeats the purpose of the test.
+%% Unfortunately, the execution of this code goes into an infinite
+%% loop, even if the map in the second argument of eat_what/2 gets the
+%% appropriate key-value pairs. Still, it is retained as a test
+%% because it exposed a different crash than test_icode_type_crash/0.
+
+test_icode_type_crash_2() ->
+ {'EXIT', {function_clause, _}} = (catch eat()),
+ ok.
+
+eat() ->
+ eat_what(1.0, #{}).
+
+eat_what(Factor, #{rat_type := LT} = Rat) ->
+ #{cheese := Cheese} = Rat,
+ UnitCheese = Cheese / 2,
+ RetA = case eat() of
+ {full, RetA1} ->
+ CheeseB2 = min(RetA1, UnitCheese) * Factor,
+ case eat() of
+ full -> {win, RetA1};
+ hungry -> {partial, RetA1 - CheeseB2}
+ end;
+ AOther -> AOther
+ end,
+ RetB = case eat() of
+ {full, RetB1} ->
+ CheeseA2 = min(RetB1, UnitCheese) * Factor,
+ rat:init(single, LT, CheeseA2),
+ case eat() of
+ full -> {full, RetB1};
+ hungry -> {hungry, RetB1 - CheeseA2}
+ end
+ end,
+ {RetA, RetB}.
diff --git a/lib/hipe/test/bs_SUITE_data/bs_match_compiler.erl b/lib/hipe/test/bs_SUITE_data/bs_match_compiler.erl
new file mode 100644
index 0000000000..4cb48ff57e
--- /dev/null
+++ b/lib/hipe/test/bs_SUITE_data/bs_match_compiler.erl
@@ -0,0 +1,1235 @@
+%%% -*- erlang-indent-level: 2 -*-
+%%%-------------------------------------------------------------------
+%%% File : bs_match_compiler.erl
+%%%
+%%%-------------------------------------------------------------------
+-module(bs_match_compiler).
+-compile(nowarn_shadow_vars).
+
+-export([test/0]).
+-export([exported_id/1, exported_id/2]). %% needed by a test
+
+test() ->
+ Funs = [fun fun_shadow/0, fun int_float/0, fun otp_5269/0, fun null_fields/0,
+ fun wiger/0, fun bin_tail/0, fun save_restore/0,
+ fun partitioned_bs_match/0, fun function_clause/0, fun unit/0,
+ fun shared_sub_bins/0, fun bin_and_float/0, fun dec_subidentifiers/0,
+ fun skip_optional_tag/0, fun wfbm/0, fun degenerated_match/0,
+ fun bs_sum/0, fun coverage/0, fun multiple_uses/0, fun zero_label/0,
+ fun followed_by_catch/0, fun matching_meets_construction/0,
+ fun simon/0, fun matching_and_andalso/0,
+ fun otp_7188/0, fun otp_7233/0, fun otp_7240/0, fun otp_7498/0,
+ fun match_string/0, fun zero_width/0, fun bad_size/0, fun haystack/0,
+ fun cover_beam_bool/0, fun matched_out_size/0, fun follow_fail_br/0,
+ fun no_partition/0, fun calling_a_binary/0, fun binary_in_map/0,
+ fun match_string_opt/0, fun map_and_binary/0,
+ fun unsafe_branch_caching/0],
+ lists:foreach(fun (F) -> ok = F() end, Funs).
+
+
+%%--------------------------------------------------------------------
+%% OTP-5270
+
+fun_shadow() ->
+ 7 = fun_shadow_1(),
+ 7 = fun_shadow_2(8),
+ 7 = fun_shadow_3(),
+ no = fun_shadow_4(8),
+ ok.
+
+fun_shadow_1() ->
+ L = 8,
+ F = fun(<<L:L,B:L>>) -> B end,
+ F(<<16:8, 7:16>>).
+
+fun_shadow_2(L) ->
+ F = fun(<<L:L,B:L>>) -> B end,
+ F(<<16:8, 7:16>>).
+
+fun_shadow_3() ->
+ L = 8,
+ F = fun(<<L:L,B:L,L:L>>) -> B end,
+ F(<<16:8, 7:16,16:16>>).
+
+fun_shadow_4(L) ->
+ F = fun(<<L:L,B:L,L:L>>) -> B;
+ (_) -> no end,
+ F(<<16:8, 7:16,15:16>>).
+
+%%--------------------------------------------------------------------
+%% OTP-5323
+
+int_float() ->
+ <<103133.0:64/float>> = <<103133:64/float>>,
+ <<103133:64/float>> = <<103133:64/float>>,
+ ok.
+
+%%--------------------------------------------------------------------
+%% Stolen from erl_eval_SUITE and modified.
+%% OTP-5269. Bugs in the bit syntax.
+
+otp_5269() ->
+ check(fun() -> L = 8, F = fun(<<A:L,B:A>>) -> B end, F(<<16:8, 7:16>>) end, 7),
+ check(fun() -> L = 8, <<A:L,B:A>> = <<16:8, 7:16>>, B end, 7),
+ check(fun() -> U = 8, (fun(<<U:U>>) -> U end)(<<32:8>>) end, 32),
+ check(fun() -> U = 8, [U || <<U:U>> <- [<<32:8>>]] end, [32]),
+ check(fun() -> [X || <<A:8, B:A>> <- [<<16:8,19:16>>],
+ <<X:8>> <- [<<B:8>>]] end,
+ [19]),
+ check(fun() -> A = 4, B = 28, _ = bit_size(<<13:(A+(X=B))>>), X end, 28),
+ check(fun() ->
+ <<Size,B:Size/binary,Rest/binary>> = <<2,"AB","CD">>,
+ {Size,B,Rest}
+ end, {2,<<"AB">>,<<"CD">>}),
+ check(fun() -> X = 32, [X || <<X:X>> <- [<<1:32>>,<<2:32>>,<<3:8>>]] end,
+ %% "binsize variable" ^
+ [1,2]),
+ check(fun() ->
+ (fun (<<A:1/binary, B:8/integer, _C:B/binary>>) ->
+ case A of
+ B -> wrong;
+ _ -> ok
+ end
+ end)(<<1,2,3,4>>) end,
+ ok),
+ ok.
+
+%%--------------------------------------------------------------------
+
+null_fields() ->
+ check(fun() ->
+ W = id(0),
+ F = fun(<<_:W>>) -> tail;
+ (<<>>) -> empty
+ end,
+ F(<<>>)
+ end, tail),
+ check(fun() ->
+ F = fun(<<_/binary>>) -> tail;
+ (<<>>) -> empty
+ end,
+ F(<<>>)
+ end, tail),
+ ok.
+
+%%--------------------------------------------------------------------
+
+wiger() ->
+ ok1 = wcheck(<<3>>),
+ ok2 = wcheck(<<1,2,3>>),
+ ok3 = wcheck(<<4>>),
+ {error,<<1,2,3,4>>} = wcheck(<<1,2,3,4>>),
+ {error,<<>>} = wcheck(<<>>),
+ ok.
+
+wcheck(<<A>>) when A==3->
+ ok1;
+wcheck(<<_,_:2/binary>>) ->
+ ok2;
+wcheck(<<_>>) ->
+ ok3;
+wcheck(Other) ->
+ {error,Other}.
+
+%%--------------------------------------------------------------------
+
+bin_tail() ->
+ S = <<"abcde">>,
+ $a = bin_tail_c(S, 0),
+ $c = bin_tail_c(S, 2),
+ $e = bin_tail_c(S, 4),
+ {'EXIT',_} = (catch bin_tail_c(S, 5)),
+ {'EXIT',_} = (catch bin_tail_c_var(S, 5)),
+
+ $a = bin_tail_d(S, 0),
+ $b = bin_tail_d(S, 8),
+ $d = bin_tail_d(S, 3*8),
+ {'EXIT',_} = (catch bin_tail_d_dead(S, 1)),
+ {'EXIT',_} = (catch bin_tail_d_dead(S, 9)),
+ {'EXIT',_} = (catch bin_tail_d_dead(S, 5*8)),
+ {'EXIT',_} = (catch bin_tail_d_var(S, 1)),
+
+ ok = bin_tail_e(<<2:2,0:1,1:5>>),
+ ok = bin_tail_e(<<2:2,1:1,1:5,42:64>>),
+ error = bin_tail_e(<<3:2,1:1,1:5,42:64>>),
+ error = bin_tail_e(<<>>),
+ ok.
+
+bin_tail_c(Bin, Offset) ->
+ Res = bin_tail_c_dead(Bin, Offset),
+ <<_:Offset/binary,_,Tail/binary>> = Bin,
+ {Res,Tail} = bin_tail_c_var(Bin, Offset),
+ Res.
+
+bin_tail_c_dead(Bin, Offset) ->
+ <<_:Offset/binary,C,_/binary>> = Bin,
+ C.
+
+bin_tail_c_var(Bin, Offset) ->
+ <<_:Offset/binary,C,Tail/binary>> = Bin,
+ {C,Tail}.
+
+bin_tail_d(Bin, BitOffset) ->
+ Res = bin_tail_d_dead(Bin, BitOffset),
+ <<_:BitOffset,_:8,Tail/binary>> = Bin,
+ {Res,Tail} = bin_tail_d_var(Bin, BitOffset),
+ Res.
+
+bin_tail_d_dead(Bin, BitOffset) ->
+ <<_:BitOffset,C,_/binary>> = Bin,
+ C.
+
+bin_tail_d_var(Bin, BitOffset) ->
+ <<_:BitOffset,C,Tail/binary>> = Bin,
+ {C,Tail}.
+
+bin_tail_e(Bin) ->
+ case bin_tail_e_dead(Bin) of
+ ok ->
+ <<_,Tail/binary>> = Bin,
+ Tail = bin_tail_e_var(Bin),
+ ok;
+ error ->
+ bin_tail_e_var(Bin)
+ end.
+
+bin_tail_e_dead(Bin) ->
+ case Bin of
+ %% The binary is aligned at the end; neither the bs_skip_bits2 nor
+ %% bs_test_tail2 instructions are needed.
+ <<2:2,_:1,1:5,_/binary>> -> ok;
+ _ -> error
+ end.
+
+bin_tail_e_var(Bin) ->
+ case Bin of
+ %% The binary is aligned at the end; neither the bs_skip_bits2 nor
+ %% bs_test_tail2 instructions are needed.
+ <<2:2,_:1,1:5,Tail/binary>> -> Tail;
+ _ -> error
+ end.
+
+%%--------------------------------------------------------------------
+
+save_restore() ->
+ 0 = save_restore_1(<<0:2,42:6>>),
+ {1,3456} = save_restore_1(<<1:2,3456:14>>),
+ {2,7981234} = save_restore_1(<<2:2,7981234:30>>),
+ {3,763967493838} = save_restore_1(<<0:2,763967493838:62>>),
+
+ A = <<" x">>,
+ B = <<".x">>,
+ C = <<"-x">>,
+
+ {" ",<<"x">>} = lll(A),
+ {" ",<<"x">>} = mmm(A),
+ {" ",<<"x">>} = nnn(A),
+ {" ",<<"x">>} = ooo(A),
+
+ {".",<<"x">>} = lll(B),
+ {".",<<"x">>} = mmm(B),
+ {".",<<"x">>} = nnn(B),
+ {".",<<"x">>} = ooo(B),
+
+ {"-",<<"x">>} = lll(C),
+ {"-",<<"x">>} = mmm(C),
+ {"-",<<"x">>} = nnn(C),
+ {"-",<<"x">>} = ooo(C),
+
+ Bin = <<-1:64>>,
+ case bad_float_unpack_match(Bin) of
+ -1 -> ok;
+ _Other -> bad_return_value_probably_NaN
+ end.
+
+save_restore_1(Bin) ->
+ case Bin of
+ <<0:2,_:6>> -> 0;
+ <<1:2,A:14>> -> {1,A};
+ <<2:2,A:30>> -> {2,A};
+ <<A:64>> -> {3,A}
+ end.
+
+lll(<<Char, Tail/binary>>) -> {[Char],Tail}.
+
+mmm(<<$.,$.,$., Tail/binary>>) -> Tail;
+mmm(<<$\s,$-,$\s, Tail/binary>>) -> Tail;
+mmm(<<Char, Tail/binary>>) -> {[Char],Tail}. %% Buggy Tail!
+
+nnn(<<"...", Tail/binary>>) -> Tail;
+nnn(<<" - ", Tail/binary>>) -> Tail;
+nnn(<<Char, Tail/binary>>) -> {[Char],Tail}. %% Buggy Tail!
+
+ooo(<<" - ", Tail/binary>>) -> Tail;
+ooo(<<Char, Tail/binary>>) -> {[Char],Tail}.
+
+bad_float_unpack_match(<<F:64/float>>) -> F;
+bad_float_unpack_match(<<I:64/integer-signed>>) -> I.
+
+%%--------------------------------------------------------------------
+
+partitioned_bs_match() ->
+ <<1,2,3>> = partitioned_bs_match(blurf, <<42,1,2,3>>),
+ error = partitioned_bs_match(10, <<7,8,15,13>>),
+ error = partitioned_bs_match(100, {a,tuple,is,'not',a,binary}),
+ ok = partitioned_bs_match(0, <<>>),
+ fc(partitioned_bs_match, [-1,blurf],
+ catch partitioned_bs_match(-1, blurf)),
+ fc(partitioned_bs_match, [-1,<<1,2,3>>],
+ catch partitioned_bs_match(-1, <<1,2,3>>)),
+ {17,<<1,2,3>>} = partitioned_bs_match_2(1, <<17,1,2,3>>),
+ {7,<<1,2,3>>} = partitioned_bs_match_2(7, <<17,1,2,3>>),
+
+ fc(partitioned_bs_match_2, [4,<<0:17>>],
+ catch partitioned_bs_match_2(4, <<0:17>>)),
+
+ anything = partitioned_bs_match_3(anything, <<42>>),
+ ok = partitioned_bs_match_3(1, 2),
+ ok.
+
+partitioned_bs_match(_, <<42:8,T/binary>>) -> T;
+partitioned_bs_match(N, _) when N > 0 -> error;
+partitioned_bs_match(_, <<>>) -> ok.
+
+partitioned_bs_match_2(1, <<B:8,T/binary>>) -> {B,T};
+partitioned_bs_match_2(Len, <<_:8,T/binary>>) -> {Len,T}.
+
+partitioned_bs_match_3(Var, <<_>>) -> Var;
+partitioned_bs_match_3(1, 2) -> ok.
+
+%%--------------------------------------------------------------------
+
+function_clause() ->
+ ok = function_clause_1(<<0,7,0,7,42>>),
+ fc(function_clause_1, [<<0,1,2,3>>],
+ catch function_clause_1(<<0,1,2,3>>)),
+ fc(function_clause_1, [<<0,1,2,3>>],
+ catch function_clause_1(<<0,7,0,1,2,3>>)),
+
+ ok = function_clause_2(<<0,7,0,7,42>>),
+ ok = function_clause_2(<<255>>),
+ ok = function_clause_2(<<13:4>>),
+ fc(function_clause_2, [<<0,1,2,3>>],
+ catch function_clause_2(<<0,1,2,3>>)),
+ fc(function_clause_2, [<<0,1,2,3>>],
+ catch function_clause_2(<<0,7,0,1,2,3>>)),
+ ok.
+
+function_clause_1(<<0:8,7:8,T/binary>>) ->
+ function_clause_1(T);
+function_clause_1(<<_:8>>) ->
+ ok.
+
+function_clause_2(<<0:8,7:8,T/binary>>) ->
+ function_clause_2(T);
+function_clause_2(<<_:8>>) ->
+ ok;
+function_clause_2(<<_:4>>) ->
+ ok.
+
+%%--------------------------------------------------------------------
+
+unit() ->
+ 42 = peek1(<<42>>),
+ 43 = peek1(<<43,1,2>>),
+ 43 = peek1(<<43,1,2,(-1):1>>),
+ 43 = peek1(<<43,1,2,(-1):2>>),
+ 43 = peek1(<<43,1,2,(-1):7>>),
+
+ 99 = peek8(<<99>>),
+ 100 = peek8(<<100,101>>),
+ fc(peek8, [<<100,101,0:1>>], catch peek8(<<100,101,0:1>>)),
+
+ 37484 = peek16(<<37484:16>>),
+ 37489 = peek16(<<37489:16,5566:16>>),
+ fc(peek16, [<<8>>], catch peek16(<<8>>)),
+ fc(peek16, [<<42:15>>], catch peek16(<<42:15>>)),
+ fc(peek16, [<<1,2,3,4,5>>], catch peek16(<<1,2,3,4,5>>)),
+
+ 127 = peek7(<<127:7>>),
+ 100 = peek7(<<100:7,19:7>>),
+ fc(peek7, [<<1,2>>], catch peek7(<<1,2>>)),
+ ok.
+
+peek1(<<B:8,_/bitstring>>) -> B.
+
+peek7(<<B:7,_/binary-unit:7>>) -> B.
+
+peek8(<<B:8,_/binary>>) -> B.
+
+peek16(<<B:16,_/binary-unit:16>>) -> B.
+
+%%--------------------------------------------------------------------
+
+shared_sub_bins() ->
+ {15,[<<>>,<<5>>,<<4,5>>,<<3,4,5>>,<<2,3,4,5>>]} = sum(<<1,2,3,4,5>>, [], 0),
+ ok.
+
+sum(<<B,T/binary>>, Acc, Sum) ->
+ sum(T, [T|Acc], Sum+B);
+sum(<<>>, Last, Sum) -> {Sum,Last}.
+
+%%--------------------------------------------------------------------
+
+bin_and_float() ->
+ 14.0 = bin_and_float(<<1.0/float,2.0/float,3.0/float>>, 0.0),
+ ok.
+
+bin_and_float(<<X/float,Y/float,Z/float,T/binary>>, Sum) when is_float(X),
+ is_float(Y),
+ is_float(Z) ->
+ bin_and_float(T, Sum+X*X+Y*Y+Z*Z);
+bin_and_float(<<>>, Sum) -> Sum.
+
+%%--------------------------------------------------------------------
+
+dec_subidentifiers() ->
+ {[],<<1,2,3>>} =
+ do_dec_subidentifiers(<<1:1,42:7,1:1,99:7,1,2,3>>, 0, [], 2),
+ {[5389],<<1,2,3>>} =
+ do_dec_subidentifiers(<<1:1,42:7,0:1,13:7,1,2,3>>, 0, [], 2),
+ {[3,2,1],not_a_binary} = dec_subidentifiers(not_a_binary, any, [1,2,3], 0),
+ ok.
+
+do_dec_subidentifiers(Buffer, Av, Al, Len) ->
+ Res = dec_subidentifiers(Buffer, Av, Al, Len),
+ Res = dec_subidentifiers2(Buffer, Av, Al, Len),
+ Res = dec_subidentifiers4(Buffer, Av, Al, Len),
+ Res = dec_subidentifiers3(Buffer, Av, Al, Len).
+
+dec_subidentifiers(Buffer, _Av, Al, 0) ->
+ {lists:reverse(Al),Buffer};
+dec_subidentifiers(<<1:1,H:7,T/binary>>, Av, Al, Len) ->
+ dec_subidentifiers(T, (Av bsl 7) bor H, Al, Len-1);
+dec_subidentifiers(<<H,T/binary>>, Av, Al, Len) ->
+ dec_subidentifiers(T, 0, [((Av bsl 7) bor H)|Al], Len-1).
+
+dec_subidentifiers2(<<Buffer/binary>>, _Av, Al, 0) ->
+ {lists:reverse(Al),Buffer};
+dec_subidentifiers2(<<1:1,H:7,T/binary>>, Av, Al, Len) ->
+ dec_subidentifiers2(T, (Av bsl 7) bor H, Al, Len-1);
+dec_subidentifiers2(<<H,T/binary>>, Av, Al, Len) ->
+ dec_subidentifiers2(T, 0, [((Av bsl 7) bor H)|Al], Len-1).
+
+dec_subidentifiers3(Buffer, _Av, Al, 0) when is_binary(Buffer) ->
+ {lists:reverse(Al),Buffer};
+dec_subidentifiers3(<<1:1,H:7,T/binary>>, Av, Al, Len) ->
+ dec_subidentifiers3(T, (Av bsl 7) bor H, Al, Len-1);
+dec_subidentifiers3(<<H,T/binary>>, Av, Al, Len) ->
+ dec_subidentifiers3(T, 0, [((Av bsl 7) bor H)|Al], Len-1).
+
+dec_subidentifiers4(<<1:1,H:7,T/binary>>, Av, Al, Len) when Len =/= 0 ->
+ dec_subidentifiers4(T, (Av bsl 7) bor H, Al, Len-1);
+dec_subidentifiers4(<<H,T/binary>>, Av, Al, Len) when Len =/= 0 ->
+ dec_subidentifiers4(T, 0, [((Av bsl 7) bor H)|Al], Len-1);
+dec_subidentifiers4(Buffer, _Av, Al, 0) ->
+ {lists:reverse(Al),Buffer}.
+
+%%--------------------------------------------------------------------
+
+skip_optional_tag() ->
+ {ok,<<>>} = skip_optional_tag(<<42>>, <<42>>),
+ {ok,<<>>} = skip_optional_tag(<<42,1>>, <<42,1>>),
+ {ok,<<1,2,3>>} = skip_optional_tag(<<42>>, <<42,1,2,3>>),
+ missing = skip_optional_tag(<<2:3>>, blurf),
+ ok.
+
+skip_optional_tag(<<>>, Binary) ->
+ {ok,Binary};
+skip_optional_tag(<<Tag,RestTag/binary>>, <<Tag,Rest/binary>>) ->
+ skip_optional_tag(RestTag, Rest);
+skip_optional_tag(_, _) -> missing.
+
+%%--------------------------------------------------------------------
+
+-define(DATELEN, 16).
+
+wfbm() ->
+ %% check_for_dot_or_space and get_tail is from wfbm4 by Steve Vinoski,
+ %% with modifications.
+ {nomatch,0} = check_for_dot_or_space(<<" ">>),
+ {nomatch,0} = check_for_dot_or_space(<<" abc">>),
+ {ok,<<"abcde">>} = check_for_dot_or_space(<<"abcde 34555">>),
+ {nomatch,0} = check_for_dot_or_space(<<".gurka">>),
+ {nomatch,1} = check_for_dot_or_space(<<"g.urka">>),
+ nomatch = get_tail(<<>>),
+ {ok,<<"2007/10/23/blurf">>} = get_tail(<<"200x/2007/10/23/blurf ">>),
+ {skip,?DATELEN+5} = get_tail(<<"200x/2007/10/23/blurf.">>),
+ nomatch = get_tail(<<"200y.2007.10.23.blurf ">>),
+ {'EXIT',_} = (catch get_tail({no,binary,at,all})),
+ {'EXIT',_} = (catch get_tail(no_binary)),
+ ok.
+
+check_for_dot_or_space(Bin) ->
+ check_for_dot_or_space(Bin, 0).
+
+check_for_dot_or_space(<<$\s, _/binary>>, 0) ->
+ {nomatch,0};
+check_for_dot_or_space(Bin, Len) ->
+ case Bin of
+ <<Front:Len/binary, $\s, _/binary>> ->
+ {ok,Front};
+ <<_:Len/binary, $., _/binary>> ->
+ {nomatch,Len};
+ _ ->
+ check_for_dot_or_space(Bin, Len+1)
+ end.
+
+get_tail(<<>>) ->
+ nomatch;
+get_tail(Bin) ->
+ <<Front:?DATELEN/binary, Tail/binary>> = Bin,
+ case Front of
+ <<_:3/binary,"x/",Y:4/binary,$/,M:2/binary,$/,D:2/binary,$/>> ->
+ case check_for_dot_or_space(Tail) of
+ {ok,Match} ->
+ {ok,<<Y/binary,$/,M/binary,$/,D/binary,$/, Match/binary>>};
+ {nomatch,Skip} -> {skip,?DATELEN + Skip}
+ end;
+ _ -> nomatch
+ end.
+
+%%--------------------------------------------------------------------
+
+degenerated_match() ->
+ error = degenerated_match_1(<<>>),
+ 1 = degenerated_match_1(<<1:1>>),
+ 2 = degenerated_match_1(<<42,43>>),
+
+ error = degenerated_match_2(<<>>),
+ no_split = degenerated_match_2(<<1,2>>),
+ {<<1,2,3,4>>,<<5>>} = degenerated_match_2(<<1,2,3,4,5>>),
+ ok.
+
+degenerated_match_1(<<>>) -> error;
+degenerated_match_1(Bin) -> byte_size(Bin).
+
+degenerated_match_2(<<>>) -> error;
+degenerated_match_2(Bin) ->
+ case byte_size(Bin) > 4 of
+ true -> split_binary(Bin, 4);
+ false -> no_split
+ end.
+
+%%--------------------------------------------------------------------
+
+bs_sum() ->
+ 0 = bs_sum_1([]),
+ 0 = bs_sum_1(<<>>),
+ 42 = bs_sum_1([42]),
+ 1 = bs_sum_1(<<1>>),
+ 10 = bs_sum_1([1,2,3,4]),
+ 15 = bs_sum_1(<<1,2,3,4,5>>),
+ 21 = bs_sum_1([1,2,3|<<4,5,6>>]),
+ 15 = bs_sum_1([1,2,3|{4,5}]),
+ 6 = bs_sum_1([1,2,3|zero]),
+ 6 = bs_sum_1([1,2,3|0]),
+ 7 = bs_sum_1([1,2,3|one]),
+
+ fc(catch bs_sum_1({too,big,tuple})),
+ fc(catch bs_sum_1([1,2,3|{too,big,tuple}])),
+
+ [] = sneaky_alias(<<>>),
+ [559,387655] = sneaky_alias(id(<<559:32,387655:32>>)),
+ fc(sneaky_alias, [<<1>>], catch sneaky_alias(id(<<1>>))),
+ fc(sneaky_alias, [[1,2,3,4]], catch sneaky_alias(lists:seq(1, 4))),
+ ok.
+
+bs_sum_1(<<H,T/binary>>) -> H+bs_sum_1(T);
+bs_sum_1([H|T]) -> H+bs_sum_1(T);
+bs_sum_1({A,B}=_Tuple=_AliasForNoGoodReason) -> A+B;
+bs_sum_1(0) -> 0;
+bs_sum_1(zero=_Zero) -> 0;
+bs_sum_1(one) -> 1;
+bs_sum_1([]) -> 0;
+bs_sum_1(<<>>) -> 0.
+
+sneaky_alias(<<>>=L) -> binary_to_list(L);
+sneaky_alias(<<From:32,L/binary>>) -> [From|sneaky_alias(L)].
+
+%%--------------------------------------------------------------------
+
+coverage() ->
+ 0 = coverage_fold(fun(B, A) -> A+B end, 0, <<>>),
+ 6 = coverage_fold(fun(B, A) -> A+B end, 0, <<1,2,3>>),
+ fc(catch coverage_fold(fun(B, A) -> A+B end, 0, [a,b,c])),
+
+ {<<42.0:64/float>>,float} = coverage_build(<<>>, <<42>>, float),
+ {<<>>,not_a_tuple} = coverage_build(<<>>, <<>>, not_a_tuple),
+ {<<16#76,"abc",16#A9,"abc">>,{x,42,43}} =
+ coverage_build(<<>>, <<16#7,16#A>>, {x,y,z}),
+
+ [<<2>>,<<1>>] = coverage_bc(<<1,2>>, []),
+
+ {x,<<"abc">>,z} = coverage_setelement(<<2,"abc">>, {x,y,z}),
+
+ [42] = coverage_apply(<<42>>, [exported_id]),
+ 42 = coverage_external(<<42>>),
+
+ do_coverage_bin_to_term_list([]),
+ do_coverage_bin_to_term_list([lists:seq(0, 10),{a,b,c},<<23:42>>]),
+ fc(coverage_bin_to_term_list, [<<0,0,0,7>>],
+ catch do_coverage_bin_to_term_list_1(<<7:32>>)),
+
+ <<>> = coverage_per_key(<<4:32>>),
+ <<$a,$b,$c>> = coverage_per_key(<<7:32,"abc">>),
+
+ ok.
+
+coverage_fold(Fun, Acc, <<H,T/binary>>) ->
+ IdFun = fun id/1,
+ coverage_fold(Fun, Fun(IdFun(H), IdFun(Acc)), T);
+coverage_fold(Fun, Acc, <<>>) when is_function(Fun, 2) -> Acc.
+
+coverage_build(Acc0, <<H,T/binary>>, float) ->
+ Float = id(<<H:64/float>>),
+ Acc = <<Acc0/binary,Float/binary>>,
+ coverage_build(Acc, T, float);
+coverage_build(Acc0, <<H,T/binary>>, Tuple0) ->
+ Str = id(<<H:(id(4)),(H-1):4,"abc">>),
+ Acc = id(<<Acc0/bitstring,Str/bitstring>>),
+ Tuple = setelement(2, setelement(3, Tuple0, 43), 42),
+ if
+ byte_size(Acc) > 0 ->
+ coverage_build(Acc, T, Tuple)
+ end;
+coverage_build(Acc, <<>>, Tuple) -> {Acc,Tuple}.
+
+coverage_bc(<<H,T/binary>>, Acc) ->
+ B = << <<C:8>> || C <- [H] >>,
+ coverage_bc(T, [B|Acc]);
+coverage_bc(<<>>, Acc) -> Acc.
+
+coverage_setelement(<<H,T1/binary>>, Tuple) when element(1, Tuple) =:= x ->
+ setelement(H, Tuple, T1).
+
+coverage_apply(<<H,T/binary>>, [F|Fs]) ->
+ [?MODULE:F(H)|coverage_apply(T, Fs)];
+coverage_apply(<<>>, []) -> [].
+
+coverage_external(<<H,T/binary>>) ->
+ ?MODULE:exported_id(T, T),
+ H.
+
+exported_id(I) -> id(I).
+
+exported_id(_, _) -> ok.
+
+do_coverage_bin_to_term_list(L) ->
+ Bin = << <<(begin BinTerm = term_to_binary(Term),
+ <<(byte_size(BinTerm)):32,BinTerm/binary>> end)/binary>> ||
+ Term <- L >>,
+ L = do_coverage_bin_to_term_list_1(Bin),
+ L = do_coverage_bin_to_term_list_1(<<Bin/binary,7:32,"garbage">>),
+ L = do_coverage_bin_to_term_list_1(<<7:32,"garbage",Bin/binary>>).
+
+do_coverage_bin_to_term_list_1(Bin) ->
+ Res = coverage_bin_to_term_list(Bin),
+ Res = coverage_bin_to_term_list(Bin, []),
+ Res = coverage_bin_to_term_list_catch(Bin),
+ Res = coverage_bin_to_term_list_catch(Bin, []).
+
+coverage_bin_to_term_list(<<Sz:32,BinTerm:Sz/binary,T/binary>>) ->
+ try binary_to_term(BinTerm) of
+ Term -> [Term|coverage_bin_to_term_list(T)]
+ catch
+ error:badarg -> coverage_bin_to_term_list(T)
+ end;
+coverage_bin_to_term_list(<<>>) -> [].
+
+coverage_bin_to_term_list(<<Sz:32,BinTerm:Sz/binary,T/binary>>, Acc) ->
+ try binary_to_term(BinTerm) of
+ Term -> coverage_bin_to_term_list(T, [Term|Acc])
+ catch
+ error:badarg -> coverage_bin_to_term_list(T, Acc)
+ end;
+coverage_bin_to_term_list(<<>>, Acc) -> lists:reverse(Acc).
+
+coverage_bin_to_term_list_catch(<<Sz:32,BinTerm:Sz/binary,T/binary>>) ->
+ case catch binary_to_term(BinTerm) of
+ {'EXIT',_} -> coverage_bin_to_term_list_catch(T);
+ Term -> [Term|coverage_bin_to_term_list_catch(T)]
+ end;
+coverage_bin_to_term_list_catch(<<>>) -> [].
+
+coverage_bin_to_term_list_catch(<<Sz:32,BinTerm:Sz/binary,T/binary>>, Acc) ->
+ case catch binary_to_term(BinTerm) of
+ {'EXIT',_} -> coverage_bin_to_term_list_catch(T, Acc);
+ Term -> coverage_bin_to_term_list_catch(T, [Term|Acc])
+ end;
+coverage_bin_to_term_list_catch(<<>>, Acc) -> lists:reverse(Acc).
+
+coverage_per_key(<<BinSize:32,Bin/binary>> = B) ->
+ true = (byte_size(B) =:= BinSize),
+ Bin.
+
+%%--------------------------------------------------------------------
+
+multiple_uses() ->
+ {344,62879,345,<<245,159,1,89>>} = multiple_uses_1(<<1,88,245,159,1,89>>),
+ true = multiple_uses_2(<<0,0,197,18>>),
+ <<42,43>> = multiple_uses_3(<<0,0,42,43>>, fun id/1),
+ ok.
+
+multiple_uses_1(<<X:16,Tail/binary>>) ->
+ %% NOT OPTIMIZED: sub binary is matched or used in more than one place
+ {Y,Z} = multiple_uses_match(Tail),
+ {X,Y,Z,Tail}.
+
+multiple_uses_2(<<_:16,Tail/binary>>) ->
+ %% NOT OPTIMIZED: sub binary is matched or used in more than one place
+ multiple_uses_cmp(Tail, Tail).
+
+multiple_uses_3(<<_:16,Tail/binary>>, Fun) ->
+ %% NOT OPTIMIZED: sub binary is used or returned
+ Fun(Tail).
+
+multiple_uses_match(<<Y:16,Z:16>>) -> {Y,Z}.
+
+multiple_uses_cmp(<<Y:16>>, <<Y:16>>) -> true;
+multiple_uses_cmp(<<_:16>>, <<_:16>>) -> false.
+
+%%--------------------------------------------------------------------
+
+zero_label() ->
+ <<"nosemouth">> = read_pols(<<"FACE","nose","mouth">>),
+ <<"CE">> = read_pols(<<"noFACE">>),
+ ok.
+
+read_pols(Data) ->
+ <<PolygonType:4/binary,Rest/binary>> = Data,
+ %% Intentional warning.
+ _ = (PolygonType == <<"FACE">>) or (PolygonType == <<"PTCH">>),
+ Rest.
+
+%%--------------------------------------------------------------------
+
+followed_by_catch() ->
+ ok = handle(<<0,1,2,3,4,5>>).
+
+-record(rec,{field}).
+handle(<<>>) -> ok;
+handle(Msg) ->
+ <<_DataLen:16, Rest/binary>> = Msg,
+ case catch fooX:func() of
+ [X] ->
+ X#rec.field;
+ _ ->
+ ok
+ end,
+ handle(Rest).
+
+%%--------------------------------------------------------------------
+
+matching_meets_construction() ->
+ Bin = id(<<"abc">>),
+ Len = id(2),
+ Tail0 = id(<<1,2,3,4,5>>),
+ <<_:Len/binary,Tail/binary>> = Tail0,
+ Res = <<Tail/binary,Bin/binary>>,
+ <<3,4,5,"abc">> = Res,
+ {'EXIT',{badarg,_}} = (catch matching_meets_construction_1(<<"Abc">>)),
+ {'EXIT',{badarg,_}} = (catch matching_meets_construction_2(<<"Abc">>)),
+ <<"Bbc">> = matching_meets_construction_3(<<"Abc">>),
+ <<1,2>> = encode_octet_string(<<1,2,3>>, 2),
+ ok.
+
+matching_meets_construction_1(<<"A",H/binary>>) -> <<"B",H>>.
+
+matching_meets_construction_2(<<"A",H/binary>>) -> <<"B",H/float>>.
+
+matching_meets_construction_3(<<"A",H/binary>>) -> <<"B",H/binary>>.
+
+encode_octet_string(<<OctetString/binary>>, Len) ->
+ <<OctetString:Len/binary-unit:8>>.
+
+%%--------------------------------------------------------------------
+
+simon() ->
+ one = simon(blurf, <<>>),
+ two = simon(0, <<42>>),
+ fc(simon, [17,<<1>>], catch simon(17, <<1>>)),
+ fc(simon, [0,<<1,2,3>>], catch simon(0, <<1,2,3>>)),
+
+ one = simon2(blurf, <<9>>),
+ two = simon2(0, <<9,1>>),
+ fc(simon2, [0,<<9,10,11>>], catch simon2(0, <<9,10,11>>)),
+ ok.
+
+simon(_, <<>>) -> one;
+simon(0, <<_>>) -> two.
+
+simon2(_, <<9>>) -> one;
+simon2(0, <<_:16>>) -> two.
+
+%%--------------------------------------------------------------------
+%% OTP-7113: Crash in v3_codegen.
+
+matching_and_andalso() ->
+ ok = matching_and_andalso_1(<<1,2,3>>, 3),
+ {'EXIT',{function_clause,_}} = (catch matching_and_andalso_1(<<1,2,3>>, -8)),
+ {'EXIT',{function_clause,_}} = (catch matching_and_andalso_1(<<1,2,3>>, blurf)),
+ {'EXIT',{function_clause,_}} = (catch matching_and_andalso_1(<<1,2,3>>, 19)),
+
+ {"abc",<<"xyz">>} = matching_and_andalso_2("abc", <<"-xyz">>),
+ {"abc",<<"">>} = matching_and_andalso_2("abc", <<($a-1)>>),
+ {"abc",<<"">>} = matching_and_andalso_2("abc", <<($z+1)>>),
+ {"abc",<<"">>} = matching_and_andalso_2("abc", <<($A-1)>>),
+ {"abc",<<"">>} = matching_and_andalso_2("abc", <<($Z+1)>>),
+ error = matching_and_andalso_2([], <<>>),
+ error = matching_and_andalso_2([], <<$A>>),
+ error = matching_and_andalso_2([], <<$Z>>),
+ error = matching_and_andalso_2([], <<$a>>),
+ error = matching_and_andalso_2([], <<$z>>),
+ ok.
+
+matching_and_andalso_1(<<Bitmap/binary>>, K)
+ when is_integer(K) andalso size(Bitmap) >= K andalso 0 < K -> ok.
+
+matching_and_andalso_2(Datetime, <<H,T/binary>>)
+ when not ((H >= $a) andalso (H =< $z)) andalso
+ not ((H >= $A) andalso (H =< $Z)) ->
+ {Datetime,T};
+matching_and_andalso_2(_, _) -> error.
+
+%%--------------------------------------------------------------------
+%% Thanks to Tomas Stejskal.
+
+otp_7188() ->
+ MP3 = <<84,65,71,68,117,154,105,232,107,121,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,68,97,110,105,101,108,32,76,
+ 97,110,100,97,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,
+ 101,115,116,32,79,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,50,48,48,48,50,48,48,48,32,45,32,66,101,115,
+ 116,32,79,102,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
+ 32,32,12>>,
+ {ok,{"ID3v1",
+ [{title,<<68,117,154,105,232,107,121>>},
+ {artist,<<"Daniel Landa">>},
+ {album,<<"Best Of">>}]}} = parse_v1_or_v11_tag(MP3),
+ ok.
+
+parse_v1_or_v11_tag(<<"TAG", Title:30/binary,
+ Artist:30/binary, Album:30/binary,
+ _Year:4/binary, _Comment:28/binary,
+ 0:8, Track:8, _Genre:8>>) ->
+ {ok,
+ {"ID3v1.1",
+ [{track, Track}, {title, trim(Title)},
+ {artist, trim(Artist)}, {album, trim(Album)}]}};
+parse_v1_or_v11_tag(<<"TAG", Title:30/binary,
+ Artist:30/binary, Album:30/binary,
+ _Year:4/binary, _Comment:30/binary,
+ _Genre:8>>) ->
+ {ok,
+ {"ID3v1",
+ [{title, trim(Title)},
+ {artist, trim(Artist)},
+ {album, trim(Album)}]}};
+parse_v1_or_v11_tag(_) ->
+ error.
+
+trim(Bin) ->
+ list_to_binary(trim_blanks(binary_to_list(Bin))).
+
+trim_blanks(L) ->
+ lists:reverse(skip_blanks_and_zero(lists:reverse(L))).
+
+skip_blanks_and_zero([$\s|T]) ->
+ skip_blanks_and_zero(T);
+skip_blanks_and_zero([0|T]) ->
+ skip_blanks_and_zero(T);
+skip_blanks_and_zero(L) ->
+ L.
+
+%%--------------------------------------------------------------------
+%% OTP-7233. Record and binary matching optimizations clashed.
+%% Thanks to Vladimir Klebansky.
+
+-record(rec_otp_7233, {key, val}).
+
+otp_7233() ->
+ otp_7233_1(#rec_otp_7233{key = <<"XXabcde">>,val=[{"xxxxxxxx",42}]}),
+ [<<"XXabcde">>,{"xxxxxxxx",42}] = get(io_format),
+ erase(io_format),
+ otp_7233_1(#rec_otp_7233{key = <<"XXabcde">>,val=[]}),
+ undefined = get(io_format),
+ ok.
+
+otp_7233_1(Rec) ->
+ <<K:2/binary,_Rest:5/binary>> = Rec#rec_otp_7233.key,
+ case K of
+ <<"XX">> ->
+ Value = Rec#rec_otp_7233.val,
+ case lists:keysearch("xxxxxxxx", 1, Value) of
+ {value,T} -> put(io_format, [Rec#rec_otp_7233.key,T]);
+ false -> ok
+ end;
+ _ -> ok
+ end.
+
+%%--------------------------------------------------------------------
+
+otp_7240() ->
+ a = otp_7240_a(0, <<>>),
+ b = otp_7240_a(1, 2),
+
+ a = otp_7240_b(anything, <<>>),
+ b = otp_7240_b(1, {x,y}),
+
+ a = otp_7240_c(anything, <<>>),
+ b = otp_7240_c(1, <<2>>),
+
+ a = otp_7240_d(anything, <<>>),
+ b = otp_7240_d(again, <<2>>),
+
+ a = otp_7240_e(anything, <<>>),
+ b = otp_7240_e(1, 41),
+
+ a = otp_7240_f(anything, <<>>),
+ b = otp_7240_f(1, {}),
+
+ ok.
+
+otp_7240_a(_, <<>>) -> a;
+otp_7240_a(1, 2) -> b.
+
+otp_7240_b(_, <<>>) -> a;
+otp_7240_b(1, {_,_}) -> b.
+
+otp_7240_c(_, <<>>) -> a;
+otp_7240_c(1, <<2>>) -> b.
+
+otp_7240_d(_, <<>>) -> a;
+otp_7240_d(_, <<2>>) -> b.
+
+otp_7240_e(_, <<>>) -> a;
+otp_7240_e(1, B) when B < 42 -> b.
+
+otp_7240_f(_, <<>>) -> a;
+otp_7240_f(1, B) when is_tuple(B) -> b.
+
+%%--------------------------------------------------------------------
+
+otp_7498() ->
+ <<1,2,3>> = otp_7498_foo(<<1,2,3>>, 0),
+ <<2,3>> = otp_7498_foo(<<1,2,3>>, 1),
+ <<1,2,3>> = otp_7498_foo(<<1,2,3>>, 2),
+
+ <<1,2,3>> = otp_7498_bar(<<1,2,3>>, 0),
+ <<2,3>> = otp_7498_bar(<<1,2,3>>, 1),
+ <<1,2,3>> = otp_7498_bar(<<1,2,3>>, 2),
+ <<>> = otp_7498_bar(<<>>, 2),
+ <<1,2,3>> = otp_7498_bar(<<1,2,3>>, 3),
+ ok.
+
+otp_7498_foo(Bin, 0) ->
+ otp_7498_foo(Bin, 42);
+otp_7498_foo(<<_A, Rest/bitstring>>, 1) ->
+ otp_7498_foo(Rest, 43);
+otp_7498_foo(Bin, _I) ->
+ Bin.
+
+otp_7498_bar(Bin, 0) ->
+ otp_7498_bar(Bin, 42);
+otp_7498_bar(<<_A, Rest/bitstring>>, 1) ->
+ otp_7498_bar(Rest, 43);
+otp_7498_bar(<<>>, 2) ->
+ otp_7498_bar(<<>>, 44);
+otp_7498_bar(Bin, _I) ->
+ Bin.
+
+%%--------------------------------------------------------------------
+
+match_string() ->
+ %% To make sure that native endian really is handled correctly
+ %% (i.e. that the compiler does not attempt to use bs_match_string/4
+ %% instructions for native segments), running this test is not enough.
+ %% Either examine the generated for do_match_string_native/1 or
+ %% check the coverage for the v3_kernel module.
+ case erlang:system_info(endian) of
+ little ->
+ do_match_string_native(<<$a,0,$b,0>>);
+ big ->
+ do_match_string_native(<<0,$a,0,$b>>)
+ end,
+ do_match_string_big(<<0,$a,0,$b>>),
+ do_match_string_little(<<$a,0,$b,0>>),
+
+ do_match_string_big_signed(<<255,255>>),
+ do_match_string_little_signed(<<255,255>>),
+
+ plain = no_match_string_opt(<<"abc">>),
+ strange = no_match_string_opt(<<$a:9,$b:9,$c:9>>),
+ ok.
+
+do_match_string_native(<<$a:16/native,$b:16/native>>) -> ok.
+
+do_match_string_big(<<$a:16/big,$b:16/big>>) -> ok.
+
+do_match_string_little(<<$a:16/little,$b:16/little>>) -> ok.
+
+do_match_string_big_signed(<<(-1):16/signed>>) -> ok.
+
+do_match_string_little_signed(<<(-1):16/little-signed>>) -> ok.
+
+no_match_string_opt(<<"abc">>) -> plain;
+no_match_string_opt(<<$a:9,$b:9,$c:9>>) -> strange.
+
+%%--------------------------------------------------------------------
+%% OTP-7591: A zero-width segment in matching would crash the compiler.
+
+zero_width() ->
+ <<Len:16/little, Str:Len/binary, 0:0>> = <<2, 0, $h, $i, 0:0>>,
+ 2 = Len,
+ Str = <<"hi">>,
+ %% Match sure that values that cannot fit in a segment will not match.
+ case id(<<0:8>>) of
+ <<256:8>> -> error;
+ _ -> ok
+ end.
+
+%%--------------------------------------------------------------------
+%% OTP_7650: A invalid size for binary segments could crash the compiler.
+
+bad_size() ->
+ Tuple = {a,b,c},
+ {'EXIT',{{badmatch,<<>>},_}} = (catch <<32:Tuple>> = id(<<>>)),
+ Binary = <<1,2,3>>,
+ {'EXIT',{{badmatch,<<>>},_}} = (catch <<32:Binary>> = id(<<>>)),
+ ok.
+
+%%--------------------------------------------------------------------
+
+haystack() ->
+ <<0:10/unit:8>> = haystack_1(<<0:10/unit:8>>),
+ [<<0:10/unit:8>>,
+ <<0:20/unit:8>>] = haystack_2(<<1:8192>>),
+ ok.
+
+%% Used to crash the compiler.
+haystack_1(Haystack) ->
+ Subs = [10],
+ [begin
+ <<B:Y/binary>> = Haystack,
+ B
+ end || Y <- Subs],
+ Haystack.
+
+%% There would be an incorrect badmatch exception.
+haystack_2(Haystack) ->
+ Subs = [{687,10},{369,20}],
+ [begin
+ <<_:X/binary,B:Y/binary,_/binary>> = Haystack,
+ B
+ end || {X,Y} <- Subs].
+
+fc({'EXIT',{function_clause,_}}) -> ok.
+
+fc(Name, Args, {'EXIT',{function_clause,[{?MODULE,Name,Args,_}|_]}}) -> ok;
+fc(Name, Args, {'EXIT',{function_clause,[{?MODULE,Name,Arity,_}|_]}})
+ when length(Args) =:= Arity ->
+ true = test_server:is_native(?MODULE).
+
+%%--------------------------------------------------------------------
+%% Cover the clause handling bs_context to binary in
+%% beam_block:initialized_regs/2.
+cover_beam_bool() ->
+ ok = do_cover_beam_bool(<<>>, 3),
+ <<19>> = do_cover_beam_bool(<<19>>, 2),
+ <<42>> = do_cover_beam_bool(<<42>>, 1),
+ <<17>> = do_cover_beam_bool(<<13,17>>, 0),
+ ok.
+
+do_cover_beam_bool(Bin, X) when X > 0 ->
+ if
+ X =:= 1; X =:= 2 ->
+ Bin;
+ true ->
+ ok
+ end;
+do_cover_beam_bool(<<_,Bin/binary>>, X) ->
+ do_cover_beam_bool(Bin, X+1).
+
+%%--------------------------------------------------------------------
+
+matched_out_size() ->
+ {253,16#DEADBEEF} = mos_int(<<8,253,16#DEADBEEF:32>>),
+ {6,16#BEEFDEAD} = mos_int(<<3,6:3,16#BEEFDEAD:32>>),
+ {53,16#CAFEDEADBEEFCAFE} = mos_int(<<16,53:16,16#CAFEDEADBEEFCAFE:64>>),
+ {23,16#CAFEDEADBEEFCAFE} = mos_int(<<5,23:5,16#CAFEDEADBEEFCAFE:64>>),
+
+ {<<1,2,3>>,4} = mos_bin(<<3,1,2,3,4,3>>),
+ {<<1,2,3,7>>,19,42} = mos_bin(<<4,1,2,3,7,19,4,42>>),
+ <<1,2,3,7>> = mos_bin(<<4,1,2,3,7,"abcdefghij">>),
+ ok.
+
+mos_int(<<L,I:L,X:32>>) ->
+ {I,X};
+mos_int(<<L,I:L,X:64>>) ->
+ {I,X}.
+
+mos_bin(<<L,Bin:L/binary,X:8,L>>) ->
+ L = byte_size(Bin),
+ {Bin,X};
+mos_bin(<<L,Bin:L/binary,X:8,L,Y:8>>) ->
+ L = byte_size(Bin),
+ {Bin,X,Y};
+mos_bin(<<L,Bin:L/binary,"abcdefghij">>) ->
+ L = byte_size(Bin),
+ Bin.
+
+%%--------------------------------------------------------------------
+
+follow_fail_br() ->
+ 42 = ffb_1(<<0,1>>, <<0>>),
+ 8 = ffb_1(<<0,1>>, [a]),
+ 42 = ffb_2(<<0,1>>, <<0>>, 17),
+ 8 = ffb_2(<<0,1>>, [a], 0),
+ ok.
+
+ffb_1(<<_,T/bitstring>>, List) ->
+ case List of
+ <<_>> ->
+ 42;
+ [_|_] ->
+ %% The fail branch of the bs_start_match2 instruction pointing
+ %% to here would be ignored, making the compiler incorrectly
+ %% assume that the delayed sub-binary optimization was safe.
+ bit_size(T)
+ end.
+
+ffb_2(<<_,T/bitstring>>, List, A) ->
+ case List of
+ <<_>> when A =:= 17 -> 42;
+ [_|_] -> bit_size(T)
+ end.
+
+%%--------------------------------------------------------------------
+
+no_partition() ->
+ one = no_partition_1(<<"string">>, a1),
+ {two,<<"string">>} = no_partition_1(<<"string">>, a2),
+ {two,<<>>} = no_partition_1(<<>>, a2),
+ {two,a} = no_partition_1(a, a2),
+ three = no_partition_1(undefined, a3),
+ {four,a,[]} = no_partition_1([a], a4),
+ {five,a,b} = no_partition_1({a,b}, a5),
+
+ one = no_partition_2(<<"string">>, a1),
+ two = no_partition_2(<<"string">>, a2),
+ two = no_partition_2(<<>>, a2),
+ two = no_partition_2(a, a2),
+ three = no_partition_2(undefined, a3),
+ four = no_partition_2(42, a4),
+ five = no_partition_2([], a5),
+ six = no_partition_2(42.0, a6),
+ ok.
+
+no_partition_1(<<"string">>, a1) -> one;
+no_partition_1(V, a2) -> {two,V};
+no_partition_1(undefined, a3) -> three;
+no_partition_1([H|T], a4) -> {four,H,T};
+no_partition_1({A,B}, a5) -> {five,A,B}.
+
+no_partition_2(<<"string">>, a1) -> one;
+no_partition_2(_, a2) -> two;
+no_partition_2(undefined, a3) -> three;
+no_partition_2(42, a4) -> four;
+no_partition_2([], a5) -> five;
+no_partition_2(42.0, a6) -> six.
+
+%%--------------------------------------------------------------------
+
+calling_a_binary() ->
+ [] = call_binary(<<>>, []),
+ {'EXIT',{badarg,_}} = (catch call_binary(<<1>>, [])),
+ {'EXIT',{badarg,_}} = (catch call_binary(<<1,2,3>>, [])),
+ ok.
+
+call_binary(<<>>, Acc) ->
+ Acc;
+call_binary(<<H,T/bits>>, Acc) ->
+ T(<<Acc/binary,H>>).
+
+%%--------------------------------------------------------------------
+
+binary_in_map() ->
+ ok = match_binary_in_map(#{key => <<42:8>>}),
+ {'EXIT',{{badmatch,#{key := 1}},_}} =
+ (catch match_binary_in_map(#{key => 1})),
+ {'EXIT',{{badmatch,#{key := <<1023:16>>}},_}} =
+ (catch match_binary_in_map(#{key => <<1023:16>>})),
+ {'EXIT',{{badmatch,#{key := <<1:8>>}},_}} =
+ (catch match_binary_in_map(#{key => <<1:8>>})),
+ {'EXIT',{{badmatch,not_a_map},_}} =
+ (catch match_binary_in_map(not_a_map)),
+ ok.
+
+match_binary_in_map(Map) ->
+ case 8 of
+ N ->
+ #{key := <<42:N>>} = Map,
+ ok
+ end.
+
+%%--------------------------------------------------------------------
+
+match_string_opt() ->
+ {x,<<1,2,3>>,{<<1>>,{v,<<1,2,3>>}}} = match_string_opt({<<1>>,{v,<<1,2,3>>}}),
+ ok.
+
+match_string_opt({<<1>>,{v,V}}=T) ->
+ {x,V,T}.
+
+%%--------------------------------------------------------------------
+%% If 'bin_opt_info' was given the warning would lack filename and
+%% line number.
+
+map_and_binary() ->
+ {<<"10">>,<<"37">>,<<"am">>} = do_map_and_binary(<<"10:37am">>),
+ Map1 = #{time => "noon"},
+ {ok,Map1} = do_map_and_binary(Map1),
+ Map2 = #{hour => 8, min => 42},
+ {8,42,Map2} = do_map_and_binary(Map2),
+ ok.
+
+do_map_and_binary(<<Hour:2/bytes, $:, Min:2/bytes, Rest/binary>>) ->
+ {Hour, Min, Rest};
+do_map_and_binary(#{time := _} = T) ->
+ {ok, T};
+do_map_and_binary(#{hour := Hour, min := Min} = T) ->
+ {Hour, Min, T}.
+
+%%--------------------------------------------------------------------
+%% Unsafe caching of branch outcomes in beam_bsm would cause the
+%% delayed creation of sub-binaries optimization to be applied even
+%% when it was unsafe.
+
+unsafe_branch_caching() ->
+ <<>> = do_unsafe_branch_caching(<<42,1>>),
+ <<>> = do_unsafe_branch_caching(<<42,2>>),
+ <<>> = do_unsafe_branch_caching(<<42,3>>),
+ <<17,18>> = do_unsafe_branch_caching(<<42,3,17,18>>),
+ <<>> = do_unsafe_branch_caching(<<1,3,42,2>>),
+ ok.
+
+do_unsafe_branch_caching(<<Code/integer, Bin/binary>>) ->
+ <<C1/integer, B1/binary>> = Bin,
+ case C1 of
+ X when X =:= 1 orelse X =:= 2 ->
+ Bin2 = <<>>;
+ _ ->
+ Bin2 = B1
+ end,
+ case Code of
+ 1 -> do_unsafe_branch_caching(Bin2);
+ _ -> Bin2
+ end.
+
+%%--------------------------------------------------------------------
+
+check(F, R) ->
+ R = F().
+
+id(I) -> I.
diff --git a/lib/hipe/test/hipe_SUITE.erl b/lib/hipe/test/hipe_SUITE.erl
index 9319b710d9..a5b3924aa8 100644
--- a/lib/hipe/test/hipe_SUITE.erl
+++ b/lib/hipe/test/hipe_SUITE.erl
@@ -19,9 +19,6 @@
-compile([export_all]).
-include_lib("common_test/include/ct.hrl").
-suite() ->
- [{ct_hooks, [ts_install_cth]}].
-
all() ->
[app, appup].
diff --git a/lib/hipe/test/hipe_testsuite_driver.erl b/lib/hipe/test/hipe_testsuite_driver.erl
index 9f5d7421b4..64c5c0a7c9 100644
--- a/lib/hipe/test/hipe_testsuite_driver.erl
+++ b/lib/hipe/test/hipe_testsuite_driver.erl
@@ -107,7 +107,7 @@ write_suite(Suite) ->
write_header(#suite{suitename = SuiteName, outputfile = OutputFile,
testcases = TestCases}) ->
Exports = format_export(TestCases),
- TimeLimit = 2, %% with 1 it fails on some slow machines...
+ TimeLimit = 3, %% with 1 or 2 it fails on some slow machines...
io:format(OutputFile,
"%% ATTENTION!\n"
"%% This is an automatically generated file. Do not edit.\n\n"
diff --git a/lib/hipe/tools/Makefile b/lib/hipe/tools/Makefile
index 095a210529..4e3b93d464 100644
--- a/lib/hipe/tools/Makefile
+++ b/lib/hipe/tools/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2012. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/tools/hipe_jit.erl b/lib/hipe/tools/hipe_jit.erl
index 20118cd523..ffe0e440e9 100644
--- a/lib/hipe/tools/hipe_jit.erl
+++ b/lib/hipe/tools/hipe_jit.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/tools/hipe_profile.erl b/lib/hipe/tools/hipe_profile.erl
index fea2d46101..9b9c0d6aad 100644
--- a/lib/hipe/tools/hipe_profile.erl
+++ b/lib/hipe/tools/hipe_profile.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/tools/hipe_timer.erl b/lib/hipe/tools/hipe_timer.erl
index 179060c149..72aa25d440 100644
--- a/lib/hipe/tools/hipe_timer.erl
+++ b/lib/hipe/tools/hipe_timer.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/util/Makefile b/lib/hipe/util/Makefile
index 4a78ad7a1b..32135d60dd 100644
--- a/lib/hipe/util/Makefile
+++ b/lib/hipe/util/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/util/hipe_digraph.erl b/lib/hipe/util/hipe_digraph.erl
index c5f7d482e4..7446836926 100644
--- a/lib/hipe/util/hipe_digraph.erl
+++ b/lib/hipe/util/hipe_digraph.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/util/hipe_dot.erl b/lib/hipe/util/hipe_dot.erl
index 76af78d6a2..53e474db42 100644
--- a/lib/hipe/util/hipe_dot.erl
+++ b/lib/hipe/util/hipe_dot.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/util/hipe_timing.erl b/lib/hipe/util/hipe_timing.erl
index 9f423f29f1..bf8a08dee5 100644
--- a/lib/hipe/util/hipe_timing.erl
+++ b/lib/hipe/util/hipe_timing.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/util/hipe_vectors.erl b/lib/hipe/util/hipe_vectors.erl
index ceab52a7dc..7f6c8e91c2 100644
--- a/lib/hipe/util/hipe_vectors.erl
+++ b/lib/hipe/util/hipe_vectors.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/util/hipe_vectors.hrl b/lib/hipe/util/hipe_vectors.hrl
index 825074e2cf..d4556e9dc4 100644
--- a/lib/hipe/util/hipe_vectors.hrl
+++ b/lib/hipe/util/hipe_vectors.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/Makefile b/lib/hipe/x86/Makefile
index ddd704d054..e8a73bbc42 100644
--- a/lib/hipe/x86/Makefile
+++ b/lib/hipe/x86/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_rtl_to_x86.erl b/lib/hipe/x86/hipe_rtl_to_x86.erl
index 54ecc468f8..d13f63b1d9 100644
--- a/lib/hipe/x86/hipe_rtl_to_x86.erl
+++ b/lib/hipe/x86/hipe_rtl_to_x86.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86.erl b/lib/hipe/x86/hipe_x86.erl
index 9348d88d25..33d7f77cf1 100644
--- a/lib/hipe/x86/hipe_x86.erl
+++ b/lib/hipe/x86/hipe_x86.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86.hrl b/lib/hipe/x86/hipe_x86.hrl
index 8a62480530..ef99bf90d9 100644
--- a/lib/hipe/x86/hipe_x86.hrl
+++ b/lib/hipe/x86/hipe_x86.hrl
@@ -1,7 +1,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_assemble.erl b/lib/hipe/x86/hipe_x86_assemble.erl
index 695ce16887..e21223a5b1 100644
--- a/lib/hipe/x86/hipe_x86_assemble.erl
+++ b/lib/hipe/x86/hipe_x86_assemble.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
+%%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_cfg.erl b/lib/hipe/x86/hipe_x86_cfg.erl
index 374a0868b9..ab40b68580 100644
--- a/lib/hipe/x86/hipe_x86_cfg.erl
+++ b/lib/hipe/x86/hipe_x86_cfg.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_defuse.erl b/lib/hipe/x86/hipe_x86_defuse.erl
index 68e6a55942..9cba6cbe4b 100644
--- a/lib/hipe/x86/hipe_x86_defuse.erl
+++ b/lib/hipe/x86/hipe_x86_defuse.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_encode.erl b/lib/hipe/x86/hipe_x86_encode.erl
index 3b209dfe52..3b7be86608 100644
--- a/lib/hipe/x86/hipe_x86_encode.erl
+++ b/lib/hipe/x86/hipe_x86_encode.erl
@@ -1,7 +1,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_frame.erl b/lib/hipe/x86/hipe_x86_frame.erl
index 1b23f90809..8851ead250 100644
--- a/lib/hipe/x86/hipe_x86_frame.erl
+++ b/lib/hipe/x86/hipe_x86_frame.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_liveness.erl b/lib/hipe/x86/hipe_x86_liveness.erl
index e93faf64a8..ce46ec920e 100644
--- a/lib/hipe/x86/hipe_x86_liveness.erl
+++ b/lib/hipe/x86/hipe_x86_liveness.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_main.erl b/lib/hipe/x86/hipe_x86_main.erl
index 2b3ebf6f1b..13b0bb6b28 100644
--- a/lib/hipe/x86/hipe_x86_main.erl
+++ b/lib/hipe/x86/hipe_x86_main.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_postpass.erl b/lib/hipe/x86/hipe_x86_postpass.erl
index a0bbf29510..939baeccec 100644
--- a/lib/hipe/x86/hipe_x86_postpass.erl
+++ b/lib/hipe/x86/hipe_x86_postpass.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_pp.erl b/lib/hipe/x86/hipe_x86_pp.erl
index ab7ae5b703..9352cf5dbf 100644
--- a/lib/hipe/x86/hipe_x86_pp.erl
+++ b/lib/hipe/x86/hipe_x86_pp.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_ra.erl b/lib/hipe/x86/hipe_x86_ra.erl
index 117bd06ab7..f66961a7a7 100644
--- a/lib/hipe/x86/hipe_x86_ra.erl
+++ b/lib/hipe/x86/hipe_x86_ra.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_ra_finalise.erl b/lib/hipe/x86/hipe_x86_ra_finalise.erl
index bac3dab867..5dd75cb7ae 100644
--- a/lib/hipe/x86/hipe_x86_ra_finalise.erl
+++ b/lib/hipe/x86/hipe_x86_ra_finalise.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_ra_ls.erl b/lib/hipe/x86/hipe_x86_ra_ls.erl
index 09fce1f33b..3e34433111 100644
--- a/lib/hipe/x86/hipe_x86_ra_ls.erl
+++ b/lib/hipe/x86/hipe_x86_ra_ls.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_ra_naive.erl b/lib/hipe/x86/hipe_x86_ra_naive.erl
index 14eaf00860..0ef4ef0a04 100644
--- a/lib/hipe/x86/hipe_x86_ra_naive.erl
+++ b/lib/hipe/x86/hipe_x86_ra_naive.erl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_ra_postconditions.erl b/lib/hipe/x86/hipe_x86_ra_postconditions.erl
index de5a4f6a4d..0a70bd1d22 100644
--- a/lib/hipe/x86/hipe_x86_ra_postconditions.erl
+++ b/lib/hipe/x86/hipe_x86_ra_postconditions.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_ra_x87_ls.erl b/lib/hipe/x86/hipe_x86_ra_x87_ls.erl
index e412ed262d..1ee76e5948 100644
--- a/lib/hipe/x86/hipe_x86_ra_x87_ls.erl
+++ b/lib/hipe/x86/hipe_x86_ra_x87_ls.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_registers.erl b/lib/hipe/x86/hipe_x86_registers.erl
index db9497b569..179d734501 100644
--- a/lib/hipe/x86/hipe_x86_registers.erl
+++ b/lib/hipe/x86/hipe_x86_registers.erl
@@ -1,7 +1,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_spill_restore.erl b/lib/hipe/x86/hipe_x86_spill_restore.erl
index 590ec43d23..f17b91f33b 100644
--- a/lib/hipe/x86/hipe_x86_spill_restore.erl
+++ b/lib/hipe/x86/hipe_x86_spill_restore.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/hipe/x86/hipe_x86_x87.erl b/lib/hipe/x86/hipe_x86_x87.erl
index dcab396483..e874490252 100644
--- a/lib/hipe/x86/hipe_x86_x87.erl
+++ b/lib/hipe/x86/hipe_x86_x87.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/Makefile b/lib/ic/Makefile
index 99207d3e57..624aa62a6e 100644
--- a/lib/ic/Makefile
+++ b/lib/ic/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2009. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/Makefile b/lib/ic/c_src/Makefile
index 89443e4327..35d6013279 100644
--- a/lib/ic/c_src/Makefile
+++ b/lib/ic/c_src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2009. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/Makefile.in b/lib/ic/c_src/Makefile.in
index b9f92a0925..c0dad59557 100644
--- a/lib/ic/c_src/Makefile.in
+++ b/lib/ic/c_src/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2012. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/Makefile.win32 b/lib/ic/c_src/Makefile.win32
index abd676ffb1..670a17f958 100644
--- a/lib/ic/c_src/Makefile.win32
+++ b/lib/ic/c_src/Makefile.win32
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/ic.c b/lib/ic/c_src/ic.c
index 0c8bb3479d..6e55a13f4f 100644
--- a/lib/ic/c_src/ic.c
+++ b/lib/ic/c_src/ic.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/ic_tmo.c b/lib/ic/c_src/ic_tmo.c
index d1a81210af..ef66f67d55 100644
--- a/lib/ic/c_src/ic_tmo.c
+++ b/lib/ic/c_src/ic_tmo.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_code_erlang_binary.c b/lib/ic/c_src/oe_ei_code_erlang_binary.c
index e1842b8dee..81610facbc 100644
--- a/lib/ic/c_src/oe_ei_code_erlang_binary.c
+++ b/lib/ic/c_src/oe_ei_code_erlang_binary.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_decode_longlong.c b/lib/ic/c_src/oe_ei_decode_longlong.c
index d685bc420b..7d872ce94f 100644
--- a/lib/ic/c_src/oe_ei_decode_longlong.c
+++ b/lib/ic/c_src/oe_ei_decode_longlong.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_decode_ulonglong.c b/lib/ic/c_src/oe_ei_decode_ulonglong.c
index b1e022011b..d071d09a43 100644
--- a/lib/ic/c_src/oe_ei_decode_ulonglong.c
+++ b/lib/ic/c_src/oe_ei_decode_ulonglong.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_decode_wchar.c b/lib/ic/c_src/oe_ei_decode_wchar.c
index adc99dfabc..bb6899b7b3 100644
--- a/lib/ic/c_src/oe_ei_decode_wchar.c
+++ b/lib/ic/c_src/oe_ei_decode_wchar.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_decode_wstring.c b/lib/ic/c_src/oe_ei_decode_wstring.c
index 32ab96ecf1..5b676fd579 100644
--- a/lib/ic/c_src/oe_ei_decode_wstring.c
+++ b/lib/ic/c_src/oe_ei_decode_wstring.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_encode_atom.c b/lib/ic/c_src/oe_ei_encode_atom.c
index 09126e841c..758586d1d4 100644
--- a/lib/ic/c_src/oe_ei_encode_atom.c
+++ b/lib/ic/c_src/oe_ei_encode_atom.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_encode_char.c b/lib/ic/c_src/oe_ei_encode_char.c
index 96b8d04170..9079cb4ecc 100644
--- a/lib/ic/c_src/oe_ei_encode_char.c
+++ b/lib/ic/c_src/oe_ei_encode_char.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_encode_double.c b/lib/ic/c_src/oe_ei_encode_double.c
index c8db4d0771..95fed6ff25 100644
--- a/lib/ic/c_src/oe_ei_encode_double.c
+++ b/lib/ic/c_src/oe_ei_encode_double.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_encode_list_header.c b/lib/ic/c_src/oe_ei_encode_list_header.c
index b7a362705a..57a0fc0d0f 100644
--- a/lib/ic/c_src/oe_ei_encode_list_header.c
+++ b/lib/ic/c_src/oe_ei_encode_list_header.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_encode_long.c b/lib/ic/c_src/oe_ei_encode_long.c
index 67c6cbd3db..c0d8599b95 100644
--- a/lib/ic/c_src/oe_ei_encode_long.c
+++ b/lib/ic/c_src/oe_ei_encode_long.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_encode_longlong.c b/lib/ic/c_src/oe_ei_encode_longlong.c
index f741e1872a..ac208f1982 100644
--- a/lib/ic/c_src/oe_ei_encode_longlong.c
+++ b/lib/ic/c_src/oe_ei_encode_longlong.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_encode_pid.c b/lib/ic/c_src/oe_ei_encode_pid.c
index d46d658fcb..ebd0d0b6ef 100644
--- a/lib/ic/c_src/oe_ei_encode_pid.c
+++ b/lib/ic/c_src/oe_ei_encode_pid.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_encode_port.c b/lib/ic/c_src/oe_ei_encode_port.c
index 8de53fff1c..a4ecf846b7 100644
--- a/lib/ic/c_src/oe_ei_encode_port.c
+++ b/lib/ic/c_src/oe_ei_encode_port.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_encode_ref.c b/lib/ic/c_src/oe_ei_encode_ref.c
index c28b507af7..8dcbc3aeb7 100644
--- a/lib/ic/c_src/oe_ei_encode_ref.c
+++ b/lib/ic/c_src/oe_ei_encode_ref.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_encode_string.c b/lib/ic/c_src/oe_ei_encode_string.c
index 17e1a975a6..8612835e2b 100644
--- a/lib/ic/c_src/oe_ei_encode_string.c
+++ b/lib/ic/c_src/oe_ei_encode_string.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_encode_term.c b/lib/ic/c_src/oe_ei_encode_term.c
index f4946ae875..c36edbf493 100644
--- a/lib/ic/c_src/oe_ei_encode_term.c
+++ b/lib/ic/c_src/oe_ei_encode_term.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_encode_tuple_header.c b/lib/ic/c_src/oe_ei_encode_tuple_header.c
index 8ef6111f58..64f8b4b873 100644
--- a/lib/ic/c_src/oe_ei_encode_tuple_header.c
+++ b/lib/ic/c_src/oe_ei_encode_tuple_header.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_encode_ulong.c b/lib/ic/c_src/oe_ei_encode_ulong.c
index eb47f96d0b..249235935e 100644
--- a/lib/ic/c_src/oe_ei_encode_ulong.c
+++ b/lib/ic/c_src/oe_ei_encode_ulong.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_encode_ulonglong.c b/lib/ic/c_src/oe_ei_encode_ulonglong.c
index d552d64b31..7997f4ea39 100644
--- a/lib/ic/c_src/oe_ei_encode_ulonglong.c
+++ b/lib/ic/c_src/oe_ei_encode_ulonglong.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_encode_version.c b/lib/ic/c_src/oe_ei_encode_version.c
index 4d07777c67..4bc6256c32 100644
--- a/lib/ic/c_src/oe_ei_encode_version.c
+++ b/lib/ic/c_src/oe_ei_encode_version.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_encode_wchar.c b/lib/ic/c_src/oe_ei_encode_wchar.c
index 3cc46bc1aa..0fd4027886 100644
--- a/lib/ic/c_src/oe_ei_encode_wchar.c
+++ b/lib/ic/c_src/oe_ei_encode_wchar.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/c_src/oe_ei_encode_wstring.c b/lib/ic/c_src/oe_ei_encode_wstring.c
index 4bf8fe7121..a799d475e7 100644
--- a/lib/ic/c_src/oe_ei_encode_wstring.c
+++ b/lib/ic/c_src/oe_ei_encode_wstring.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/doc/src/CORBA_Environment_alloc.xml b/lib/ic/doc/src/CORBA_Environment_alloc.xml
index b4778d5ae2..357d9c2e8a 100644
--- a/lib/ic/doc/src/CORBA_Environment_alloc.xml
+++ b/lib/ic/doc/src/CORBA_Environment_alloc.xml
@@ -4,7 +4,7 @@
<cref>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/Makefile b/lib/ic/doc/src/Makefile
index e3ccbffbad..c9691df7af 100644
--- a/lib/ic/doc/src/Makefile
+++ b/lib/ic/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2012. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/doc/src/book.xml b/lib/ic/doc/src/book.xml
index 7508368b42..f6ef824f63 100644
--- a/lib/ic/doc/src/book.xml
+++ b/lib/ic/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/c-part.xml b/lib/ic/doc/src/c-part.xml
index 230ba5faa8..968dd3135f 100644
--- a/lib/ic/doc/src/c-part.xml
+++ b/lib/ic/doc/src/c-part.xml
@@ -4,7 +4,7 @@
<part>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/ch_basic_idl.xml b/lib/ic/doc/src/ch_basic_idl.xml
index 433cc40224..485a0c44e5 100644
--- a/lib/ic/doc/src/ch_basic_idl.xml
+++ b/lib/ic/doc/src/ch_basic_idl.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/ch_c_client.xml b/lib/ic/doc/src/ch_c_client.xml
index d6282d614c..e304c8acf4 100644
--- a/lib/ic/doc/src/ch_c_client.xml
+++ b/lib/ic/doc/src/ch_c_client.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/ch_c_corba_env.xml b/lib/ic/doc/src/ch_c_corba_env.xml
index 3efe0645ab..1bd829307e 100644
--- a/lib/ic/doc/src/ch_c_corba_env.xml
+++ b/lib/ic/doc/src/ch_c_corba_env.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/ch_c_mapping.xml b/lib/ic/doc/src/ch_c_mapping.xml
index bc18e62dfc..1ea0ace91f 100644
--- a/lib/ic/doc/src/ch_c_mapping.xml
+++ b/lib/ic/doc/src/ch_c_mapping.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/ch_c_server.xml b/lib/ic/doc/src/ch_c_server.xml
index f58db0c071..df25927c90 100644
--- a/lib/ic/doc/src/ch_c_server.xml
+++ b/lib/ic/doc/src/ch_c_server.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/ch_erl_genserv.xml b/lib/ic/doc/src/ch_erl_genserv.xml
index 228636bcd0..aa162b3652 100644
--- a/lib/ic/doc/src/ch_erl_genserv.xml
+++ b/lib/ic/doc/src/ch_erl_genserv.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/ch_erl_plain.xml b/lib/ic/doc/src/ch_erl_plain.xml
index 4b36fde143..27387d1624 100644
--- a/lib/ic/doc/src/ch_erl_plain.xml
+++ b/lib/ic/doc/src/ch_erl_plain.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/ch_ic_protocol.xml b/lib/ic/doc/src/ch_ic_protocol.xml
index e483cec298..cb64500f6e 100644
--- a/lib/ic/doc/src/ch_ic_protocol.xml
+++ b/lib/ic/doc/src/ch_ic_protocol.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/ch_introduction.xml b/lib/ic/doc/src/ch_introduction.xml
index 595758d25f..9ac2f96a95 100644
--- a/lib/ic/doc/src/ch_introduction.xml
+++ b/lib/ic/doc/src/ch_introduction.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/ch_java.xml b/lib/ic/doc/src/ch_java.xml
index a1e9f7a968..a733adaf65 100644
--- a/lib/ic/doc/src/ch_java.xml
+++ b/lib/ic/doc/src/ch_java.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/erl-part.xml b/lib/ic/doc/src/erl-part.xml
index f7a6ca68a3..9c9cb6a574 100644
--- a/lib/ic/doc/src/erl-part.xml
+++ b/lib/ic/doc/src/erl-part.xml
@@ -4,7 +4,7 @@
<part>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/ic.xml b/lib/ic/doc/src/ic.xml
index 704a70595c..98e8414a4e 100644
--- a/lib/ic/doc/src/ic.xml
+++ b/lib/ic/doc/src/ic.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/ic_c_protocol.xml b/lib/ic/doc/src/ic_c_protocol.xml
index 6107767fd4..ed4f21d661 100644
--- a/lib/ic/doc/src/ic_c_protocol.xml
+++ b/lib/ic/doc/src/ic_c_protocol.xml
@@ -4,7 +4,7 @@
<cref>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/ic_clib.xml b/lib/ic/doc/src/ic_clib.xml
index 2fbe766c9f..50b20d2ca8 100644
--- a/lib/ic/doc/src/ic_clib.xml
+++ b/lib/ic/doc/src/ic_clib.xml
@@ -4,7 +4,7 @@
<cref>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/java-part.xml b/lib/ic/doc/src/java-part.xml
index b67b136ffd..14b58a1df5 100644
--- a/lib/ic/doc/src/java-part.xml
+++ b/lib/ic/doc/src/java-part.xml
@@ -4,7 +4,7 @@
<part>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/notes.xml b/lib/ic/doc/src/notes.xml
index 367f6397fc..4b73aa5509 100644
--- a/lib/ic/doc/src/notes.xml
+++ b/lib/ic/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/part.xml b/lib/ic/doc/src/part.xml
index 90673fd2b0..0bb7858745 100644
--- a/lib/ic/doc/src/part.xml
+++ b/lib/ic/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/part_notes.xml b/lib/ic/doc/src/part_notes.xml
index 881740f62c..305b2c558d 100644
--- a/lib/ic/doc/src/part_notes.xml
+++ b/lib/ic/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/doc/src/ref_man.xml b/lib/ic/doc/src/ref_man.xml
index a0fbd70e24..a6a4f187b3 100644
--- a/lib/ic/doc/src/ref_man.xml
+++ b/lib/ic/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ic/examples/all-against-all/Makefile b/lib/ic/examples/all-against-all/Makefile
index 8ce182c3e3..e772cab94e 100644
--- a/lib/ic/examples/all-against-all/Makefile
+++ b/lib/ic/examples/all-against-all/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/all-against-all/Makefile.win32 b/lib/ic/examples/all-against-all/Makefile.win32
index 6d79c8a094..a8e480fd1f 100644
--- a/lib/ic/examples/all-against-all/Makefile.win32
+++ b/lib/ic/examples/all-against-all/Makefile.win32
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2009. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/all-against-all/callbacks.c b/lib/ic/examples/all-against-all/callbacks.c
index 9ebba3422f..4e6edeb5e0 100644
--- a/lib/ic/examples/all-against-all/callbacks.c
+++ b/lib/ic/examples/all-against-all/callbacks.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/all-against-all/client.c b/lib/ic/examples/all-against-all/client.c
index 492651af99..4f2f7e3eff 100644
--- a/lib/ic/examples/all-against-all/client.c
+++ b/lib/ic/examples/all-against-all/client.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/all-against-all/client.erl b/lib/ic/examples/all-against-all/client.erl
index 656a84d56d..3c147037a0 100644
--- a/lib/ic/examples/all-against-all/client.erl
+++ b/lib/ic/examples/all-against-all/client.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/all-against-all/client.java b/lib/ic/examples/all-against-all/client.java
index f11b0388dc..48b5bc4f60 100644
--- a/lib/ic/examples/all-against-all/client.java
+++ b/lib/ic/examples/all-against-all/client.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/all-against-all/rmod_random_impl.erl b/lib/ic/examples/all-against-all/rmod_random_impl.erl
index b0171715b9..36b280c0b2 100644
--- a/lib/ic/examples/all-against-all/rmod_random_impl.erl
+++ b/lib/ic/examples/all-against-all/rmod_random_impl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/all-against-all/server.c b/lib/ic/examples/all-against-all/server.c
index 6e74d32ca9..6d46ea7673 100644
--- a/lib/ic/examples/all-against-all/server.c
+++ b/lib/ic/examples/all-against-all/server.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/all-against-all/server.erl b/lib/ic/examples/all-against-all/server.erl
index c086b53df4..c5fa2589ae 100644
--- a/lib/ic/examples/all-against-all/server.erl
+++ b/lib/ic/examples/all-against-all/server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/all-against-all/server.java b/lib/ic/examples/all-against-all/server.java
index 2b5355fff7..79618ba8be 100644
--- a/lib/ic/examples/all-against-all/server.java
+++ b/lib/ic/examples/all-against-all/server.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/all-against-all/serverImpl.java b/lib/ic/examples/all-against-all/serverImpl.java
index f5f345e93e..336bc7e327 100644
--- a/lib/ic/examples/all-against-all/serverImpl.java
+++ b/lib/ic/examples/all-against-all/serverImpl.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/c-client/Makefile b/lib/ic/examples/c-client/Makefile
index e31a36e6d2..1bfaaed477 100644
--- a/lib/ic/examples/c-client/Makefile
+++ b/lib/ic/examples/c-client/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2009. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/c-client/client.c b/lib/ic/examples/c-client/client.c
index d8502a638a..652d8376fd 100644
--- a/lib/ic/examples/c-client/client.c
+++ b/lib/ic/examples/c-client/client.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/c-client/rmod_random_impl.erl b/lib/ic/examples/c-client/rmod_random_impl.erl
index fb97fd0007..2948115f8d 100644
--- a/lib/ic/examples/c-client/rmod_random_impl.erl
+++ b/lib/ic/examples/c-client/rmod_random_impl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/c-client/test.erl b/lib/ic/examples/c-client/test.erl
index 2eda04234e..d1fa40ff44 100644
--- a/lib/ic/examples/c-client/test.erl
+++ b/lib/ic/examples/c-client/test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/c-server/Makefile b/lib/ic/examples/c-server/Makefile
index 205ede2d0c..be23d3ddf9 100644
--- a/lib/ic/examples/c-server/Makefile
+++ b/lib/ic/examples/c-server/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2009. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/c-server/callbacks.c b/lib/ic/examples/c-server/callbacks.c
index 630456b214..2deca145f4 100644
--- a/lib/ic/examples/c-server/callbacks.c
+++ b/lib/ic/examples/c-server/callbacks.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/c-server/client.c b/lib/ic/examples/c-server/client.c
index a729e2beb5..c1d7a1c5a7 100644
--- a/lib/ic/examples/c-server/client.c
+++ b/lib/ic/examples/c-server/client.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/c-server/client.erl b/lib/ic/examples/c-server/client.erl
index 7ff2c6de52..da28cd504b 100644
--- a/lib/ic/examples/c-server/client.erl
+++ b/lib/ic/examples/c-server/client.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/c-server/server.c b/lib/ic/examples/c-server/server.c
index b0a534fcbf..a04d60e9b1 100644
--- a/lib/ic/examples/c-server/server.c
+++ b/lib/ic/examples/c-server/server.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/erl-genserv/rmod_random_impl.erl b/lib/ic/examples/erl-genserv/rmod_random_impl.erl
index 83c1dad61f..9d9ca8afd4 100644
--- a/lib/ic/examples/erl-genserv/rmod_random_impl.erl
+++ b/lib/ic/examples/erl-genserv/rmod_random_impl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/erl-plain/rmod_random_impl.erl b/lib/ic/examples/erl-plain/rmod_random_impl.erl
index ebed98c327..ee8623f82d 100644
--- a/lib/ic/examples/erl-plain/rmod_random_impl.erl
+++ b/lib/ic/examples/erl-plain/rmod_random_impl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/java-client-server/client.java b/lib/ic/examples/java-client-server/client.java
index f11b0388dc..48b5bc4f60 100644
--- a/lib/ic/examples/java-client-server/client.java
+++ b/lib/ic/examples/java-client-server/client.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/java-client-server/server.java b/lib/ic/examples/java-client-server/server.java
index 2b5355fff7..79618ba8be 100644
--- a/lib/ic/examples/java-client-server/server.java
+++ b/lib/ic/examples/java-client-server/server.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/java-client-server/serverImpl.java b/lib/ic/examples/java-client-server/serverImpl.java
index f5f345e93e..336bc7e327 100644
--- a/lib/ic/examples/java-client-server/serverImpl.java
+++ b/lib/ic/examples/java-client-server/serverImpl.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/pre_post_condition/Makefile b/lib/ic/examples/pre_post_condition/Makefile
index e300c933c3..cd7e630724 100644
--- a/lib/ic/examples/pre_post_condition/Makefile
+++ b/lib/ic/examples/pre_post_condition/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/pre_post_condition/m_i_impl.erl b/lib/ic/examples/pre_post_condition/m_i_impl.erl
index 71ddb5fb41..fa6d9675a2 100644
--- a/lib/ic/examples/pre_post_condition/m_i_impl.erl
+++ b/lib/ic/examples/pre_post_condition/m_i_impl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/examples/pre_post_condition/tracer.erl b/lib/ic/examples/pre_post_condition/tracer.erl
index f51c9de28b..c64459f4fd 100644
--- a/lib/ic/examples/pre_post_condition/tracer.erl
+++ b/lib/ic/examples/pre_post_condition/tracer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/include/ic.h b/lib/ic/include/ic.h
index 8344f51226..3dc5dbd4b5 100644
--- a/lib/ic/include/ic.h
+++ b/lib/ic/include/ic.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/Makefile b/lib/ic/java_src/Makefile
index 6f965a5533..86d1e54fff 100644
--- a/lib/ic/java_src/Makefile
+++ b/lib/ic/java_src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/Any.java b/lib/ic/java_src/com/ericsson/otp/ic/Any.java
index b0e717bc59..d90b942877 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/Any.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/Any.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/AnyHelper.java b/lib/ic/java_src/com/ericsson/otp/ic/AnyHelper.java
index abcf9ef204..518087a1ed 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/AnyHelper.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/AnyHelper.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/AnyHolder.java b/lib/ic/java_src/com/ericsson/otp/ic/AnyHolder.java
index 03c48061af..e22876f51e 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/AnyHolder.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/AnyHolder.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/BooleanHolder.java b/lib/ic/java_src/com/ericsson/otp/ic/BooleanHolder.java
index b6ee1418dc..b71da196de 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/BooleanHolder.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/BooleanHolder.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/ByteHolder.java b/lib/ic/java_src/com/ericsson/otp/ic/ByteHolder.java
index cc2f25579a..7c79e8f90d 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/ByteHolder.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/ByteHolder.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/CharHolder.java b/lib/ic/java_src/com/ericsson/otp/ic/CharHolder.java
index 6d49e7fbbb..81d8c6ac73 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/CharHolder.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/CharHolder.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/DoubleHolder.java b/lib/ic/java_src/com/ericsson/otp/ic/DoubleHolder.java
index bf52fb4d9c..6daaa25aa8 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/DoubleHolder.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/DoubleHolder.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/Environment.java b/lib/ic/java_src/com/ericsson/otp/ic/Environment.java
index 9393d61e40..bffa0e27e6 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/Environment.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/Environment.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/FloatHolder.java b/lib/ic/java_src/com/ericsson/otp/ic/FloatHolder.java
index 6ee2a25305..c804973ad6 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/FloatHolder.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/FloatHolder.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/Holder.java b/lib/ic/java_src/com/ericsson/otp/ic/Holder.java
index 74515c262d..a2888539a9 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/Holder.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/Holder.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/IntHolder.java b/lib/ic/java_src/com/ericsson/otp/ic/IntHolder.java
index c47f0ae01d..7327d03843 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/IntHolder.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/IntHolder.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/LongHolder.java b/lib/ic/java_src/com/ericsson/otp/ic/LongHolder.java
index 8a4481be98..34af201b42 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/LongHolder.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/LongHolder.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/Makefile b/lib/ic/java_src/com/ericsson/otp/ic/Makefile
index d9100cf267..21c38e54b5 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/Makefile
+++ b/lib/ic/java_src/com/ericsson/otp/ic/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/Pid.java b/lib/ic/java_src/com/ericsson/otp/ic/Pid.java
index f2c8dafa0f..0f26c32aef 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/Pid.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/Pid.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/PidHelper.java b/lib/ic/java_src/com/ericsson/otp/ic/PidHelper.java
index 1d0a108233..4c51035738 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/PidHelper.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/PidHelper.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/PidHolder.java b/lib/ic/java_src/com/ericsson/otp/ic/PidHolder.java
index afd42c8b91..f5dfd81576 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/PidHolder.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/PidHolder.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/Port.java b/lib/ic/java_src/com/ericsson/otp/ic/Port.java
index 5c36aee257..34edbea362 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/Port.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/Port.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/PortHelper.java b/lib/ic/java_src/com/ericsson/otp/ic/PortHelper.java
index 22dde64530..3e74758739 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/PortHelper.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/PortHelper.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/PortHolder.java b/lib/ic/java_src/com/ericsson/otp/ic/PortHolder.java
index 0a0a7eadad..da0df3bbc7 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/PortHolder.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/PortHolder.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/Ref.java b/lib/ic/java_src/com/ericsson/otp/ic/Ref.java
index ff01bd7162..a55da87d0d 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/Ref.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/Ref.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/RefHelper.java b/lib/ic/java_src/com/ericsson/otp/ic/RefHelper.java
index a1b19b5fcb..cb145bbbb2 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/RefHelper.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/RefHelper.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/RefHolder.java b/lib/ic/java_src/com/ericsson/otp/ic/RefHolder.java
index f853076339..9ef2eacea1 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/RefHolder.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/RefHolder.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/ShortHolder.java b/lib/ic/java_src/com/ericsson/otp/ic/ShortHolder.java
index cc1f09be89..3b191dd633 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/ShortHolder.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/ShortHolder.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/StringHolder.java b/lib/ic/java_src/com/ericsson/otp/ic/StringHolder.java
index 5c6ccbab5b..f4cd069148 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/StringHolder.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/StringHolder.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/TCKind.java b/lib/ic/java_src/com/ericsson/otp/ic/TCKind.java
index a6a3abace9..e6265ae586 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/TCKind.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/TCKind.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/Term.java b/lib/ic/java_src/com/ericsson/otp/ic/Term.java
index cb0c6ea78a..7a27905fcd 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/Term.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/Term.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/TermHelper.java b/lib/ic/java_src/com/ericsson/otp/ic/TermHelper.java
index 0739d41877..1a6271d9c0 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/TermHelper.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/TermHelper.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/TermHolder.java b/lib/ic/java_src/com/ericsson/otp/ic/TermHolder.java
index 414447bfa2..6a30bad5ea 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/TermHolder.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/TermHolder.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/TypeCode.java b/lib/ic/java_src/com/ericsson/otp/ic/TypeCode.java
index b8508562b8..da036fea54 100644
--- a/lib/ic/java_src/com/ericsson/otp/ic/TypeCode.java
+++ b/lib/ic/java_src/com/ericsson/otp/ic/TypeCode.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/Makefile b/lib/ic/src/Makefile
index a6da81a03b..6ad2fbeeb7 100644
--- a/lib/ic/src/Makefile
+++ b/lib/ic/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2012. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic.erl b/lib/ic/src/ic.erl
index 6e64781785..062fbef435 100644
--- a/lib/ic/src/ic.erl
+++ b/lib/ic/src/ic.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic.hrl b/lib/ic/src/ic.hrl
index c38b7395b0..cf4b6a50d6 100644
--- a/lib/ic/src/ic.hrl
+++ b/lib/ic/src/ic.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_array_java.erl b/lib/ic/src/ic_array_java.erl
index 211815b171..64d1b8a9ba 100644
--- a/lib/ic/src/ic_array_java.erl
+++ b/lib/ic/src/ic_array_java.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_attribute_java.erl b/lib/ic/src/ic_attribute_java.erl
index 6663c62212..ddbc6d24f5 100644
--- a/lib/ic/src/ic_attribute_java.erl
+++ b/lib/ic/src/ic_attribute_java.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_cbe.erl b/lib/ic/src/ic_cbe.erl
index 63fffe49ee..f6e64d23a0 100644
--- a/lib/ic/src/ic_cbe.erl
+++ b/lib/ic/src/ic_cbe.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_cclient.erl b/lib/ic/src/ic_cclient.erl
index 919c8e6571..8591acf33f 100644
--- a/lib/ic/src/ic_cclient.erl
+++ b/lib/ic/src/ic_cclient.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_code.erl b/lib/ic/src/ic_code.erl
index 76b06396e5..98d57db93b 100644
--- a/lib/ic/src/ic_code.erl
+++ b/lib/ic/src/ic_code.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_codegen.erl b/lib/ic/src/ic_codegen.erl
index 993391f638..adad021da1 100644
--- a/lib/ic/src/ic_codegen.erl
+++ b/lib/ic/src/ic_codegen.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_constant_java.erl b/lib/ic/src/ic_constant_java.erl
index 0bfd708ba5..49150f96ac 100644
--- a/lib/ic/src/ic_constant_java.erl
+++ b/lib/ic/src/ic_constant_java.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_cserver.erl b/lib/ic/src/ic_cserver.erl
index 4aabf2cd92..7c7506367e 100644
--- a/lib/ic/src/ic_cserver.erl
+++ b/lib/ic/src/ic_cserver.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_debug.hrl b/lib/ic/src/ic_debug.hrl
index 72524c573d..97a56743d8 100644
--- a/lib/ic/src/ic_debug.hrl
+++ b/lib/ic/src/ic_debug.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_enum_java.erl b/lib/ic/src/ic_enum_java.erl
index 22cd006e96..dbfa110089 100644
--- a/lib/ic/src/ic_enum_java.erl
+++ b/lib/ic/src/ic_enum_java.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_erl_template.erl b/lib/ic/src/ic_erl_template.erl
index 7a874e312e..0839577701 100644
--- a/lib/ic/src/ic_erl_template.erl
+++ b/lib/ic/src/ic_erl_template.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_erlbe.erl b/lib/ic/src/ic_erlbe.erl
index 2b618b63cf..d315a17e7c 100644
--- a/lib/ic/src/ic_erlbe.erl
+++ b/lib/ic/src/ic_erlbe.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_error.erl b/lib/ic/src/ic_error.erl
index c781400a80..790e1f0539 100644
--- a/lib/ic/src/ic_error.erl
+++ b/lib/ic/src/ic_error.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_fetch.erl b/lib/ic/src/ic_fetch.erl
index 208037aae9..59f21711ec 100644
--- a/lib/ic/src/ic_fetch.erl
+++ b/lib/ic/src/ic_fetch.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_file.erl b/lib/ic/src/ic_file.erl
index d8f21abf5c..688a777400 100644
--- a/lib/ic/src/ic_file.erl
+++ b/lib/ic/src/ic_file.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_forms.erl b/lib/ic/src/ic_forms.erl
index 10f9b8cea3..ed4b3e9a22 100644
--- a/lib/ic/src/ic_forms.erl
+++ b/lib/ic/src/ic_forms.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_genobj.erl b/lib/ic/src/ic_genobj.erl
index 250b883f7b..eb2c24c000 100644
--- a/lib/ic/src/ic_genobj.erl
+++ b/lib/ic/src/ic_genobj.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_java_type.erl b/lib/ic/src/ic_java_type.erl
index 2ea71817e5..931aa92a8e 100644
--- a/lib/ic/src/ic_java_type.erl
+++ b/lib/ic/src/ic_java_type.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_jbe.erl b/lib/ic/src/ic_jbe.erl
index 8227f5559d..56518a681b 100644
--- a/lib/ic/src/ic_jbe.erl
+++ b/lib/ic/src/ic_jbe.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_noc.erl b/lib/ic/src/ic_noc.erl
index e53c4a48ff..0e387b5e70 100644
--- a/lib/ic/src/ic_noc.erl
+++ b/lib/ic/src/ic_noc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_options.erl b/lib/ic/src/ic_options.erl
index 2f7e9e7ab2..d7f56c0d46 100644
--- a/lib/ic/src/ic_options.erl
+++ b/lib/ic/src/ic_options.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_plainbe.erl b/lib/ic/src/ic_plainbe.erl
index dc993224ed..6875c1314e 100644
--- a/lib/ic/src/ic_plainbe.erl
+++ b/lib/ic/src/ic_plainbe.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_pp.erl b/lib/ic/src/ic_pp.erl
index 8e6b5f3810..8c2e3a0ffe 100644
--- a/lib/ic/src/ic_pp.erl
+++ b/lib/ic/src/ic_pp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_pragma.erl b/lib/ic/src/ic_pragma.erl
index 01cf47265c..13c02cfcba 100644
--- a/lib/ic/src/ic_pragma.erl
+++ b/lib/ic/src/ic_pragma.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_sequence_java.erl b/lib/ic/src/ic_sequence_java.erl
index 537992c3e2..f4873a0691 100644
--- a/lib/ic/src/ic_sequence_java.erl
+++ b/lib/ic/src/ic_sequence_java.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_struct_java.erl b/lib/ic/src/ic_struct_java.erl
index 4efc976d62..94b98f6c52 100644
--- a/lib/ic/src/ic_struct_java.erl
+++ b/lib/ic/src/ic_struct_java.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_symtab.erl b/lib/ic/src/ic_symtab.erl
index 098932f9cd..037d004049 100644
--- a/lib/ic/src/ic_symtab.erl
+++ b/lib/ic/src/ic_symtab.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_union_java.erl b/lib/ic/src/ic_union_java.erl
index 168c2ffdae..14d585b0a4 100644
--- a/lib/ic/src/ic_union_java.erl
+++ b/lib/ic/src/ic_union_java.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ic_util.erl b/lib/ic/src/ic_util.erl
index e44ff3d4dd..b1263ae63d 100644
--- a/lib/ic/src/ic_util.erl
+++ b/lib/ic/src/ic_util.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/icenum.erl b/lib/ic/src/icenum.erl
index 0ed3e0dfa7..cab68d17fa 100644
--- a/lib/ic/src/icenum.erl
+++ b/lib/ic/src/icenum.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/iceval.erl b/lib/ic/src/iceval.erl
index 3921d66559..a93e60124c 100644
--- a/lib/ic/src/iceval.erl
+++ b/lib/ic/src/iceval.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/icforms.hrl b/lib/ic/src/icforms.hrl
index afa74b21ce..f71aee3664 100644
--- a/lib/ic/src/icforms.hrl
+++ b/lib/ic/src/icforms.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/icparse.yrl b/lib/ic/src/icparse.yrl
index fcea0383ef..27e949729c 100644
--- a/lib/ic/src/icparse.yrl
+++ b/lib/ic/src/icparse.yrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/icpreproc.erl b/lib/ic/src/icpreproc.erl
index 1f9b5d89f1..fc936c4bf3 100644
--- a/lib/ic/src/icpreproc.erl
+++ b/lib/ic/src/icpreproc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/icscan.erl b/lib/ic/src/icscan.erl
index 8df00432f3..123041495e 100644
--- a/lib/ic/src/icscan.erl
+++ b/lib/ic/src/icscan.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/icstruct.erl b/lib/ic/src/icstruct.erl
index 7828b8d8d7..713ac87287 100644
--- a/lib/ic/src/icstruct.erl
+++ b/lib/ic/src/icstruct.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ictk.erl b/lib/ic/src/ictk.erl
index a6e543ad7a..701d662776 100644
--- a/lib/ic/src/ictk.erl
+++ b/lib/ic/src/ictk.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/ictype.erl b/lib/ic/src/ictype.erl
index a00f50dbad..eb6f2088d7 100644
--- a/lib/ic/src/ictype.erl
+++ b/lib/ic/src/ictype.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/icunion.erl b/lib/ic/src/icunion.erl
index d4b7eb7134..c39a5177e7 100644
--- a/lib/ic/src/icunion.erl
+++ b/lib/ic/src/icunion.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/src/icyeccpre.hrl b/lib/ic/src/icyeccpre.hrl
index 2d793dd724..3a2fad185f 100644
--- a/lib/ic/src/icyeccpre.hrl
+++ b/lib/ic/src/icyeccpre.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/Makefile b/lib/ic/test/Makefile
index 93cbaf4dfe..55b8915875 100644
--- a/lib/ic/test/Makefile
+++ b/lib/ic/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2012. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_SUITE.erl b/lib/ic/test/c_client_erl_server_SUITE.erl
index 90e5808c0a..7668300b58 100644
--- a/lib/ic/test/c_client_erl_server_SUITE.erl
+++ b/lib/ic/test/c_client_erl_server_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_SUITE_data/Makefile.src b/lib/ic/test/c_client_erl_server_SUITE_data/Makefile.src
index d662c50f90..60ea8ea598 100644
--- a/lib/ic/test/c_client_erl_server_SUITE_data/Makefile.src
+++ b/lib/ic/test/c_client_erl_server_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_SUITE_data/c_client.c b/lib/ic/test/c_client_erl_server_SUITE_data/c_client.c
index 61274d161b..6953227824 100644
--- a/lib/ic/test/c_client_erl_server_SUITE_data/c_client.c
+++ b/lib/ic/test/c_client_erl_server_SUITE_data/c_client.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_SUITE_data/c_erl_test.idl b/lib/ic/test/c_client_erl_server_SUITE_data/c_erl_test.idl
index cd06c6cbb1..126389b01d 100644
--- a/lib/ic/test/c_client_erl_server_SUITE_data/c_erl_test.idl
+++ b/lib/ic/test/c_client_erl_server_SUITE_data/c_erl_test.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 2001-2010. All Rights Reserved.
+// Copyright Ericsson AB 2001-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_SUITE_data/erl_server.erl b/lib/ic/test/c_client_erl_server_SUITE_data/erl_server.erl
index 98693e3546..159d3b9b89 100644
--- a/lib/ic/test/c_client_erl_server_SUITE_data/erl_server.erl
+++ b/lib/ic/test/c_client_erl_server_SUITE_data/erl_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_SUITE_data/m_i_impl.erl b/lib/ic/test/c_client_erl_server_SUITE_data/m_i_impl.erl
index 179aaba944..c530991058 100644
--- a/lib/ic/test/c_client_erl_server_SUITE_data/m_i_impl.erl
+++ b/lib/ic/test/c_client_erl_server_SUITE_data/m_i_impl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_proto_SUITE.erl b/lib/ic/test/c_client_erl_server_proto_SUITE.erl
index ab08a5d082..2336a8417c 100644
--- a/lib/ic/test/c_client_erl_server_proto_SUITE.erl
+++ b/lib/ic/test/c_client_erl_server_proto_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_proto_SUITE_data/Makefile.src b/lib/ic/test/c_client_erl_server_proto_SUITE_data/Makefile.src
index b5e892dd19..fc6d416316 100644
--- a/lib/ic/test/c_client_erl_server_proto_SUITE_data/Makefile.src
+++ b/lib/ic/test/c_client_erl_server_proto_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2012. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_proto_SUITE_data/c_client.c b/lib/ic/test/c_client_erl_server_proto_SUITE_data/c_client.c
index 2fe44342ea..b7609d63e5 100644
--- a/lib/ic/test/c_client_erl_server_proto_SUITE_data/c_client.c
+++ b/lib/ic/test/c_client_erl_server_proto_SUITE_data/c_client.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_proto_SUITE_data/c_erl_test.idl b/lib/ic/test/c_client_erl_server_proto_SUITE_data/c_erl_test.idl
index 0d5f6c3302..b6ba1583f3 100644
--- a/lib/ic/test/c_client_erl_server_proto_SUITE_data/c_erl_test.idl
+++ b/lib/ic/test/c_client_erl_server_proto_SUITE_data/c_erl_test.idl
@@ -1,7 +1,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 2003-2010. All Rights Reserved.
+// Copyright Ericsson AB 2003-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_proto_SUITE_data/erl_server.erl b/lib/ic/test/c_client_erl_server_proto_SUITE_data/erl_server.erl
index 317303fb93..2fe1dc2f79 100644
--- a/lib/ic/test/c_client_erl_server_proto_SUITE_data/erl_server.erl
+++ b/lib/ic/test/c_client_erl_server_proto_SUITE_data/erl_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_proto_SUITE_data/m_i_impl.erl b/lib/ic/test/c_client_erl_server_proto_SUITE_data/m_i_impl.erl
index b0c1e60b06..92420eaeb4 100644
--- a/lib/ic/test/c_client_erl_server_proto_SUITE_data/m_i_impl.erl
+++ b/lib/ic/test/c_client_erl_server_proto_SUITE_data/m_i_impl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_proto_SUITE_data/my.c b/lib/ic/test/c_client_erl_server_proto_SUITE_data/my.c
index 5c9355f4b5..46920ce05f 100644
--- a/lib/ic/test/c_client_erl_server_proto_SUITE_data/my.c
+++ b/lib/ic/test/c_client_erl_server_proto_SUITE_data/my.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl
index caac3c0a03..ed45b7fd82 100644
--- a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl
+++ b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/Makefile.src b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/Makefile.src
index 68c7ec5a51..6d6bd9baab 100644
--- a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/Makefile.src
+++ b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/c_client.c b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/c_client.c
index 33459d5917..23dc089555 100644
--- a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/c_client.c
+++ b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/c_client.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/c_erl_test.idl b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/c_erl_test.idl
index 2b791b4b87..ec74d36cea 100644
--- a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/c_erl_test.idl
+++ b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/c_erl_test.idl
@@ -1,7 +1,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 2004-2010. All Rights Reserved.
+// Copyright Ericsson AB 2004-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/erl_server.erl b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/erl_server.erl
index 5f51d7263d..f2a6ed83fa 100644
--- a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/erl_server.erl
+++ b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/erl_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/m_i_impl.erl b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/m_i_impl.erl
index eeb3766605..ab62ee40c0 100644
--- a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/m_i_impl.erl
+++ b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/m_i_impl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/my.c b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/my.c
index 0bf0c7d304..6045034052 100644
--- a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/my.c
+++ b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/my.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/erl_client_c_server_SUITE.erl b/lib/ic/test/erl_client_c_server_SUITE.erl
index eccf9d1868..cc0dbfda74 100644
--- a/lib/ic/test/erl_client_c_server_SUITE.erl
+++ b/lib/ic/test/erl_client_c_server_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/erl_client_c_server_SUITE_data/Makefile.src b/lib/ic/test/erl_client_c_server_SUITE_data/Makefile.src
index e66f6080f4..11eee8b7ac 100644
--- a/lib/ic/test/erl_client_c_server_SUITE_data/Makefile.src
+++ b/lib/ic/test/erl_client_c_server_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2012. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/erl_client_c_server_SUITE_data/c_server.c b/lib/ic/test/erl_client_c_server_SUITE_data/c_server.c
index 362df0e3f3..53345d561b 100644
--- a/lib/ic/test/erl_client_c_server_SUITE_data/c_server.c
+++ b/lib/ic/test/erl_client_c_server_SUITE_data/c_server.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/erl_client_c_server_SUITE_data/callbacks.c b/lib/ic/test/erl_client_c_server_SUITE_data/callbacks.c
index 84eb0f43db..2611e15f5a 100644
--- a/lib/ic/test/erl_client_c_server_SUITE_data/callbacks.c
+++ b/lib/ic/test/erl_client_c_server_SUITE_data/callbacks.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/erl_client_c_server_SUITE_data/erl_c_test.idl b/lib/ic/test/erl_client_c_server_SUITE_data/erl_c_test.idl
index 02fcbc75ca..6ed28f0822 100644
--- a/lib/ic/test/erl_client_c_server_SUITE_data/erl_c_test.idl
+++ b/lib/ic/test/erl_client_c_server_SUITE_data/erl_c_test.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 2002-2010. All Rights Reserved.
+// Copyright Ericsson AB 2002-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/erl_client_c_server_SUITE_data/erl_client.erl b/lib/ic/test/erl_client_c_server_SUITE_data/erl_client.erl
index 61f2e843db..139e2d7661 100644
--- a/lib/ic/test/erl_client_c_server_SUITE_data/erl_client.erl
+++ b/lib/ic/test/erl_client_c_server_SUITE_data/erl_client.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/erl_client_c_server_proto_SUITE.erl b/lib/ic/test/erl_client_c_server_proto_SUITE.erl
index a252089c69..48330b95a8 100644
--- a/lib/ic/test/erl_client_c_server_proto_SUITE.erl
+++ b/lib/ic/test/erl_client_c_server_proto_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/erl_client_c_server_proto_SUITE_data/Makefile.src b/lib/ic/test/erl_client_c_server_proto_SUITE_data/Makefile.src
index 42c4fda295..4ef7a74cde 100644
--- a/lib/ic/test/erl_client_c_server_proto_SUITE_data/Makefile.src
+++ b/lib/ic/test/erl_client_c_server_proto_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/erl_client_c_server_proto_SUITE_data/c_server.c b/lib/ic/test/erl_client_c_server_proto_SUITE_data/c_server.c
index a7de4dd07a..a18f0e7ba9 100644
--- a/lib/ic/test/erl_client_c_server_proto_SUITE_data/c_server.c
+++ b/lib/ic/test/erl_client_c_server_proto_SUITE_data/c_server.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/erl_client_c_server_proto_SUITE_data/callbacks.c b/lib/ic/test/erl_client_c_server_proto_SUITE_data/callbacks.c
index d559feed95..bed1dc2dd3 100644
--- a/lib/ic/test/erl_client_c_server_proto_SUITE_data/callbacks.c
+++ b/lib/ic/test/erl_client_c_server_proto_SUITE_data/callbacks.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/erl_client_c_server_proto_SUITE_data/erl_c_test.idl b/lib/ic/test/erl_client_c_server_proto_SUITE_data/erl_c_test.idl
index 46c78c5d45..ef9556dd42 100644
--- a/lib/ic/test/erl_client_c_server_proto_SUITE_data/erl_c_test.idl
+++ b/lib/ic/test/erl_client_c_server_proto_SUITE_data/erl_c_test.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 2004-2010. All Rights Reserved.
+// Copyright Ericsson AB 2004-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/erl_client_c_server_proto_SUITE_data/erl_client.erl b/lib/ic/test/erl_client_c_server_proto_SUITE_data/erl_client.erl
index 2c233ce52b..5fe80cdd7a 100644
--- a/lib/ic/test/erl_client_c_server_proto_SUITE_data/erl_client.erl
+++ b/lib/ic/test/erl_client_c_server_proto_SUITE_data/erl_client.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/erl_client_c_server_proto_SUITE_data/my.c b/lib/ic/test/erl_client_c_server_proto_SUITE_data/my.c
index da88d940f3..aff03253d6 100644
--- a/lib/ic/test/erl_client_c_server_proto_SUITE_data/my.c
+++ b/lib/ic/test/erl_client_c_server_proto_SUITE_data/my.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE.erl b/lib/ic/test/ic_SUITE.erl
index c9fbf49a55..1d436eda2b 100644
--- a/lib/ic/test/ic_SUITE.erl
+++ b/lib/ic/test/ic_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/attr.idl b/lib/ic/test/ic_SUITE_data/attr.idl
index fb3914d1cc..0a1edc787c 100644
--- a/lib/ic/test/ic_SUITE_data/attr.idl
+++ b/lib/ic/test/ic_SUITE_data/attr.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/c_err1.idl b/lib/ic/test/ic_SUITE_data/c_err1.idl
index 8332bab825..d50c51c807 100644
--- a/lib/ic/test/ic_SUITE_data/c_err1.idl
+++ b/lib/ic/test/ic_SUITE_data/c_err1.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/c_err2.idl b/lib/ic/test/ic_SUITE_data/c_err2.idl
index c385a2e703..84c12421ef 100644
--- a/lib/ic/test/ic_SUITE_data/c_err2.idl
+++ b/lib/ic/test/ic_SUITE_data/c_err2.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/c_err3.idl b/lib/ic/test/ic_SUITE_data/c_err3.idl
index 83946eceae..910f7abcf1 100644
--- a/lib/ic/test/ic_SUITE_data/c_err3.idl
+++ b/lib/ic/test/ic_SUITE_data/c_err3.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/c_norm.idl b/lib/ic/test/ic_SUITE_data/c_norm.idl
index b340b6090a..b573ac3f3d 100644
--- a/lib/ic/test/ic_SUITE_data/c_norm.idl
+++ b/lib/ic/test/ic_SUITE_data/c_norm.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/enum.idl b/lib/ic/test/ic_SUITE_data/enum.idl
index 484647781a..397212baf8 100644
--- a/lib/ic/test/ic_SUITE_data/enum.idl
+++ b/lib/ic/test/ic_SUITE_data/enum.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/forward.idl b/lib/ic/test/ic_SUITE_data/forward.idl
index c55b00b992..e9e8edb89e 100644
--- a/lib/ic/test/ic_SUITE_data/forward.idl
+++ b/lib/ic/test/ic_SUITE_data/forward.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/include.idl b/lib/ic/test/ic_SUITE_data/include.idl
index 1f5185089d..292de177c2 100644
--- a/lib/ic/test/ic_SUITE_data/include.idl
+++ b/lib/ic/test/ic_SUITE_data/include.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/include2.idl b/lib/ic/test/ic_SUITE_data/include2.idl
index 4487663ca0..37caa0bf54 100644
--- a/lib/ic/test/ic_SUITE_data/include2.idl
+++ b/lib/ic/test/ic_SUITE_data/include2.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/include3.idl b/lib/ic/test/ic_SUITE_data/include3.idl
index 5cacc4aadd..18424b3318 100644
--- a/lib/ic/test/ic_SUITE_data/include3.idl
+++ b/lib/ic/test/ic_SUITE_data/include3.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/inherit.idl b/lib/ic/test/ic_SUITE_data/inherit.idl
index 1ce8b2b3b6..93fd4b42ba 100644
--- a/lib/ic/test/ic_SUITE_data/inherit.idl
+++ b/lib/ic/test/ic_SUITE_data/inherit.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/inherit_err.idl b/lib/ic/test/ic_SUITE_data/inherit_err.idl
index c3eac38d0f..3b4989dd8b 100644
--- a/lib/ic/test/ic_SUITE_data/inherit_err.idl
+++ b/lib/ic/test/ic_SUITE_data/inherit_err.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/inherit_warn.idl b/lib/ic/test/ic_SUITE_data/inherit_warn.idl
index 9a8f9039e5..07f57f1a7d 100644
--- a/lib/ic/test/ic_SUITE_data/inherit_warn.idl
+++ b/lib/ic/test/ic_SUITE_data/inherit_warn.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/mult_ids.idl b/lib/ic/test/ic_SUITE_data/mult_ids.idl
index 234383fcfd..577e1031fb 100644
--- a/lib/ic/test/ic_SUITE_data/mult_ids.idl
+++ b/lib/ic/test/ic_SUITE_data/mult_ids.idl
@@ -1,7 +1,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/nasty.idl b/lib/ic/test/ic_SUITE_data/nasty.idl
index d29674ab44..e55060f762 100644
--- a/lib/ic/test/ic_SUITE_data/nasty.idl
+++ b/lib/ic/test/ic_SUITE_data/nasty.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/one.idl b/lib/ic/test/ic_SUITE_data/one.idl
index 8b1f212989..7fb9808767 100644
--- a/lib/ic/test/ic_SUITE_data/one.idl
+++ b/lib/ic/test/ic_SUITE_data/one.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/one_followed.idl b/lib/ic/test/ic_SUITE_data/one_followed.idl
index fe92a78760..17074f7e55 100644
--- a/lib/ic/test/ic_SUITE_data/one_followed.idl
+++ b/lib/ic/test/ic_SUITE_data/one_followed.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/one_out.idl b/lib/ic/test/ic_SUITE_data/one_out.idl
index 51d0394485..1e75c2d962 100644
--- a/lib/ic/test/ic_SUITE_data/one_out.idl
+++ b/lib/ic/test/ic_SUITE_data/one_out.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/one_raises.idl b/lib/ic/test/ic_SUITE_data/one_raises.idl
index df8343ac8f..4cd7ae00bb 100644
--- a/lib/ic/test/ic_SUITE_data/one_raises.idl
+++ b/lib/ic/test/ic_SUITE_data/one_raises.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/one_void.idl b/lib/ic/test/ic_SUITE_data/one_void.idl
index d4f5ce6e16..6e8c39197c 100644
--- a/lib/ic/test/ic_SUITE_data/one_void.idl
+++ b/lib/ic/test/ic_SUITE_data/one_void.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/raises_reg.idl b/lib/ic/test/ic_SUITE_data/raises_reg.idl
index 342f20a116..52aba10b8d 100644
--- a/lib/ic/test/ic_SUITE_data/raises_reg.idl
+++ b/lib/ic/test/ic_SUITE_data/raises_reg.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/struct.idl b/lib/ic/test/ic_SUITE_data/struct.idl
index 22b2a16aaf..011c2404d9 100644
--- a/lib/ic/test/ic_SUITE_data/struct.idl
+++ b/lib/ic/test/ic_SUITE_data/struct.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/syntax1.idl b/lib/ic/test/ic_SUITE_data/syntax1.idl
index a805c846db..2de35a6ddf 100644
--- a/lib/ic/test/ic_SUITE_data/syntax1.idl
+++ b/lib/ic/test/ic_SUITE_data/syntax1.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/syntax2.idl b/lib/ic/test/ic_SUITE_data/syntax2.idl
index 9da0c51a1b..39f28392e6 100644
--- a/lib/ic/test/ic_SUITE_data/syntax2.idl
+++ b/lib/ic/test/ic_SUITE_data/syntax2.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/syntax3.idl b/lib/ic/test/ic_SUITE_data/syntax3.idl
index 7911ed4ecf..2bb9ac7229 100644
--- a/lib/ic/test/ic_SUITE_data/syntax3.idl
+++ b/lib/ic/test/ic_SUITE_data/syntax3.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/syntax4.idl b/lib/ic/test/ic_SUITE_data/syntax4.idl
index 0f09847449..e41ad60ed6 100644
--- a/lib/ic/test/ic_SUITE_data/syntax4.idl
+++ b/lib/ic/test/ic_SUITE_data/syntax4.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/syntax5.idl b/lib/ic/test/ic_SUITE_data/syntax5.idl
index 7c9b26f7b1..6468f0adc0 100644
--- a/lib/ic/test/ic_SUITE_data/syntax5.idl
+++ b/lib/ic/test/ic_SUITE_data/syntax5.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/syntax6.idl b/lib/ic/test/ic_SUITE_data/syntax6.idl
index 9ceac7729b..6012cc868c 100644
--- a/lib/ic/test/ic_SUITE_data/syntax6.idl
+++ b/lib/ic/test/ic_SUITE_data/syntax6.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/type.idl b/lib/ic/test/ic_SUITE_data/type.idl
index 65322bf78d..6109661c4f 100644
--- a/lib/ic/test/ic_SUITE_data/type.idl
+++ b/lib/ic/test/ic_SUITE_data/type.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/typeid.idl b/lib/ic/test/ic_SUITE_data/typeid.idl
index 0878283ed1..9a5ce28bdf 100644
--- a/lib/ic/test/ic_SUITE_data/typeid.idl
+++ b/lib/ic/test/ic_SUITE_data/typeid.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/u_case_mult.idl b/lib/ic/test/ic_SUITE_data/u_case_mult.idl
index 37d99f0e9b..3d1523b5f5 100644
--- a/lib/ic/test/ic_SUITE_data/u_case_mult.idl
+++ b/lib/ic/test/ic_SUITE_data/u_case_mult.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/u_default.idl b/lib/ic/test/ic_SUITE_data/u_default.idl
index 80a59b9bee..050b876aad 100644
--- a/lib/ic/test/ic_SUITE_data/u_default.idl
+++ b/lib/ic/test/ic_SUITE_data/u_default.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/u_mult.idl b/lib/ic/test/ic_SUITE_data/u_mult.idl
index 0bc6b64f08..3ab47c40a5 100644
--- a/lib/ic/test/ic_SUITE_data/u_mult.idl
+++ b/lib/ic/test/ic_SUITE_data/u_mult.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/u_norm.idl b/lib/ic/test/ic_SUITE_data/u_norm.idl
index 11ab4aeca5..b2f146f45a 100644
--- a/lib/ic/test/ic_SUITE_data/u_norm.idl
+++ b/lib/ic/test/ic_SUITE_data/u_norm.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/u_type.idl b/lib/ic/test/ic_SUITE_data/u_type.idl
index 49a59bfd57..8a46b9375f 100644
--- a/lib/ic/test/ic_SUITE_data/u_type.idl
+++ b/lib/ic/test/ic_SUITE_data/u_type.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_SUITE_data/undef_id.idl b/lib/ic/test/ic_SUITE_data/undef_id.idl
index 094a59637f..a09598f0a7 100644
--- a/lib/ic/test/ic_SUITE_data/undef_id.idl
+++ b/lib/ic/test/ic_SUITE_data/undef_id.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_be_SUITE.erl b/lib/ic/test/ic_be_SUITE.erl
index 49dd9953cb..2fa28fc103 100644
--- a/lib/ic/test/ic_be_SUITE.erl
+++ b/lib/ic/test/ic_be_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_be_SUITE_data/plain.idl b/lib/ic/test/ic_be_SUITE_data/plain.idl
index ab55ba4987..1ee20eeb1f 100644
--- a/lib/ic/test/ic_be_SUITE_data/plain.idl
+++ b/lib/ic/test/ic_be_SUITE_data/plain.idl
@@ -1,7 +1,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE.erl b/lib/ic/test/ic_pp_SUITE.erl
index e85ce788e3..38e936f9bc 100644
--- a/lib/ic/test/ic_pp_SUITE.erl
+++ b/lib/ic/test/ic_pp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/arg.idl b/lib/ic/test/ic_pp_SUITE_data/arg.idl
index f3b0c3a7d7..42d8457f2c 100644
--- a/lib/ic/test/ic_pp_SUITE_data/arg.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/arg.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/cascade.idl b/lib/ic/test/ic_pp_SUITE_data/cascade.idl
index 09608f4197..f96f2a0bd7 100644
--- a/lib/ic/test/ic_pp_SUITE_data/cascade.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/cascade.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/comment.idl b/lib/ic/test/ic_pp_SUITE_data/comment.idl
index e2005694fe..9b5e310e6c 100644
--- a/lib/ic/test/ic_pp_SUITE_data/comment.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/comment.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/concat.idl b/lib/ic/test/ic_pp_SUITE_data/concat.idl
index df7c408d2e..eb1f6aa1ad 100644
--- a/lib/ic/test/ic_pp_SUITE_data/concat.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/concat.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/define.idl b/lib/ic/test/ic_pp_SUITE_data/define.idl
index a398125d72..76a3b5ec22 100644
--- a/lib/ic/test/ic_pp_SUITE_data/define.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/define.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/if.idl b/lib/ic/test/ic_pp_SUITE_data/if.idl
index 6b6b101546..437ea7c2e1 100644
--- a/lib/ic/test/ic_pp_SUITE_data/if.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/if.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/if_zero.idl b/lib/ic/test/ic_pp_SUITE_data/if_zero.idl
index 50a9e85b4b..a0184f8bff 100644
--- a/lib/ic/test/ic_pp_SUITE_data/if_zero.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/if_zero.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/improp_nest_constr.idl b/lib/ic/test/ic_pp_SUITE_data/improp_nest_constr.idl
index 66e6be930f..b658811277 100644
--- a/lib/ic/test/ic_pp_SUITE_data/improp_nest_constr.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/improp_nest_constr.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/inc.idl b/lib/ic/test/ic_pp_SUITE_data/inc.idl
index 4b51591835..e13875b10c 100644
--- a/lib/ic/test/ic_pp_SUITE_data/inc.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/inc.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/included1.idl b/lib/ic/test/ic_pp_SUITE_data/included1.idl
index 57e8bc1b72..f3cc40f549 100644
--- a/lib/ic/test/ic_pp_SUITE_data/included1.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/included1.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 2000-2010. All Rights Reserved.
+// Copyright Ericsson AB 2000-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/included2.idl b/lib/ic/test/ic_pp_SUITE_data/included2.idl
index 3f5bc32198..6a718ce021 100644
--- a/lib/ic/test/ic_pp_SUITE_data/included2.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/included2.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 2000-2010. All Rights Reserved.
+// Copyright Ericsson AB 2000-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/includer.idl b/lib/ic/test/ic_pp_SUITE_data/includer.idl
index 3c6aab8114..d4fabd024a 100644
--- a/lib/ic/test/ic_pp_SUITE_data/includer.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/includer.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 2000-2010. All Rights Reserved.
+// Copyright Ericsson AB 2000-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/line.idl b/lib/ic/test/ic_pp_SUITE_data/line.idl
index 679cbaa30e..83783dff03 100644
--- a/lib/ic/test/ic_pp_SUITE_data/line.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/line.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/misc.idl b/lib/ic/test/ic_pp_SUITE_data/misc.idl
index 5febf4b038..512ccb16b1 100644
--- a/lib/ic/test/ic_pp_SUITE_data/misc.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/misc.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/nopara.idl b/lib/ic/test/ic_pp_SUITE_data/nopara.idl
index 473be6a900..9d5253bf38 100644
--- a/lib/ic/test/ic_pp_SUITE_data/nopara.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/nopara.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/predef.idl b/lib/ic/test/ic_pp_SUITE_data/predef.idl
index f412583181..8805501d66 100644
--- a/lib/ic/test/ic_pp_SUITE_data/predef.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/predef.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/predef_time.idl b/lib/ic/test/ic_pp_SUITE_data/predef_time.idl
index 74d63a5c17..7ce8d2a313 100644
--- a/lib/ic/test/ic_pp_SUITE_data/predef_time.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/predef_time.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/self_ref.idl b/lib/ic/test/ic_pp_SUITE_data/self_ref.idl
index c3003ce325..50f8a04e69 100644
--- a/lib/ic/test/ic_pp_SUITE_data/self_ref.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/self_ref.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/separate.idl b/lib/ic/test/ic_pp_SUITE_data/separate.idl
index 8df955cb70..6151a41709 100644
--- a/lib/ic/test/ic_pp_SUITE_data/separate.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/separate.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/swallow_sc.idl b/lib/ic/test/ic_pp_SUITE_data/swallow_sc.idl
index d74c9d8e62..a42fcc6295 100644
--- a/lib/ic/test/ic_pp_SUITE_data/swallow_sc.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/swallow_sc.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pp_SUITE_data/unintended_grp.idl b/lib/ic/test/ic_pp_SUITE_data/unintended_grp.idl
index 0f563c2cc5..ba744ac938 100644
--- a/lib/ic/test/ic_pp_SUITE_data/unintended_grp.idl
+++ b/lib/ic/test/ic_pp_SUITE_data/unintended_grp.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pragma_SUITE.erl b/lib/ic/test/ic_pragma_SUITE.erl
index c6e23a1f8c..61becf74bf 100644
--- a/lib/ic/test/ic_pragma_SUITE.erl
+++ b/lib/ic/test/ic_pragma_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pragma_SUITE_data/reg_m0.idl b/lib/ic/test/ic_pragma_SUITE_data/reg_m0.idl
index 6c5fbeb435..a7a90edc92 100644
--- a/lib/ic/test/ic_pragma_SUITE_data/reg_m0.idl
+++ b/lib/ic/test/ic_pragma_SUITE_data/reg_m0.idl
@@ -1,7 +1,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pragma_SUITE_data/reg_m1.idl b/lib/ic/test/ic_pragma_SUITE_data/reg_m1.idl
index efec9c4371..e222dcddc7 100644
--- a/lib/ic/test/ic_pragma_SUITE_data/reg_m1.idl
+++ b/lib/ic/test/ic_pragma_SUITE_data/reg_m1.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pragma_SUITE_data/reg_m2.idl b/lib/ic/test/ic_pragma_SUITE_data/reg_m2.idl
index 7154af7a90..351e662ac7 100644
--- a/lib/ic/test/ic_pragma_SUITE_data/reg_m2.idl
+++ b/lib/ic/test/ic_pragma_SUITE_data/reg_m2.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pragma_SUITE_data/reg_m3.idl b/lib/ic/test/ic_pragma_SUITE_data/reg_m3.idl
index 4e806180c9..4f876da8bc 100644
--- a/lib/ic/test/ic_pragma_SUITE_data/reg_m3.idl
+++ b/lib/ic/test/ic_pragma_SUITE_data/reg_m3.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pragma_SUITE_data/reg_m4.idl b/lib/ic/test/ic_pragma_SUITE_data/reg_m4.idl
index fd29d8bc81..9de19b645b 100644
--- a/lib/ic/test/ic_pragma_SUITE_data/reg_m4.idl
+++ b/lib/ic/test/ic_pragma_SUITE_data/reg_m4.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pragma_SUITE_data/reg_m5.idl b/lib/ic/test/ic_pragma_SUITE_data/reg_m5.idl
index 54f738e797..85ff419689 100644
--- a/lib/ic/test/ic_pragma_SUITE_data/reg_m5.idl
+++ b/lib/ic/test/ic_pragma_SUITE_data/reg_m5.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pragma_SUITE_data/reg_m6.idl b/lib/ic/test/ic_pragma_SUITE_data/reg_m6.idl
index 4e806180c9..4f876da8bc 100644
--- a/lib/ic/test/ic_pragma_SUITE_data/reg_m6.idl
+++ b/lib/ic/test/ic_pragma_SUITE_data/reg_m6.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pragma_SUITE_data/reg_m7.idl b/lib/ic/test/ic_pragma_SUITE_data/reg_m7.idl
index 02f75216c6..038b670dd9 100644
--- a/lib/ic/test/ic_pragma_SUITE_data/reg_m7.idl
+++ b/lib/ic/test/ic_pragma_SUITE_data/reg_m7.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_pragma_SUITE_data/uggly.idl b/lib/ic/test/ic_pragma_SUITE_data/uggly.idl
index 6c6b612309..d12909c00e 100644
--- a/lib/ic/test/ic_pragma_SUITE_data/uggly.idl
+++ b/lib/ic/test/ic_pragma_SUITE_data/uggly.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_register_SUITE.erl b/lib/ic/test/ic_register_SUITE.erl
index 86d89e72d5..5eb50202d7 100644
--- a/lib/ic/test/ic_register_SUITE.erl
+++ b/lib/ic/test/ic_register_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_register_SUITE_data/reg_m10.idl b/lib/ic/test/ic_register_SUITE_data/reg_m10.idl
index d673d8eba9..cc9156ae0c 100644
--- a/lib/ic/test/ic_register_SUITE_data/reg_m10.idl
+++ b/lib/ic/test/ic_register_SUITE_data/reg_m10.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_register_SUITE_data/reg_m11.idl b/lib/ic/test/ic_register_SUITE_data/reg_m11.idl
index 14ddaa9be1..6a6c49a48e 100644
--- a/lib/ic/test/ic_register_SUITE_data/reg_m11.idl
+++ b/lib/ic/test/ic_register_SUITE_data/reg_m11.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_register_SUITE_data/reg_m12.idl b/lib/ic/test/ic_register_SUITE_data/reg_m12.idl
index 7d81c18c25..0c5f8083b5 100644
--- a/lib/ic/test/ic_register_SUITE_data/reg_m12.idl
+++ b/lib/ic/test/ic_register_SUITE_data/reg_m12.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_register_SUITE_data/reg_m8.idl b/lib/ic/test/ic_register_SUITE_data/reg_m8.idl
index dc6d499cd0..5129b6b636 100644
--- a/lib/ic/test/ic_register_SUITE_data/reg_m8.idl
+++ b/lib/ic/test/ic_register_SUITE_data/reg_m8.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/ic_register_SUITE_data/reg_m9.idl b/lib/ic/test/ic_register_SUITE_data/reg_m9.idl
index 38fe06afcb..c077d289b6 100644
--- a/lib/ic/test/ic_register_SUITE_data/reg_m9.idl
+++ b/lib/ic/test/ic_register_SUITE_data/reg_m9.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1998-2010. All Rights Reserved.
+// Copyright Ericsson AB 1998-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/java_client_erl_server_SUITE.erl b/lib/ic/test/java_client_erl_server_SUITE.erl
index a670c5546e..50ea3f43ca 100644
--- a/lib/ic/test/java_client_erl_server_SUITE.erl
+++ b/lib/ic/test/java_client_erl_server_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/java_client_erl_server_SUITE_data/JavaClient.java b/lib/ic/test/java_client_erl_server_SUITE_data/JavaClient.java
index 586551dca8..8092d7c627 100644
--- a/lib/ic/test/java_client_erl_server_SUITE_data/JavaClient.java
+++ b/lib/ic/test/java_client_erl_server_SUITE_data/JavaClient.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/java_client_erl_server_SUITE_data/Makefile.src b/lib/ic/test/java_client_erl_server_SUITE_data/Makefile.src
index 7d68e6c3ef..bcc59e87db 100644
--- a/lib/ic/test/java_client_erl_server_SUITE_data/Makefile.src
+++ b/lib/ic/test/java_client_erl_server_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2013. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/java_client_erl_server_SUITE_data/java_erl_test.idl b/lib/ic/test/java_client_erl_server_SUITE_data/java_erl_test.idl
index 57586d3735..55194cf911 100644
--- a/lib/ic/test/java_client_erl_server_SUITE_data/java_erl_test.idl
+++ b/lib/ic/test/java_client_erl_server_SUITE_data/java_erl_test.idl
@@ -2,7 +2,7 @@
// %CopyrightBegin%
//
-// Copyright Ericsson AB 2003-2010. All Rights Reserved.
+// Copyright Ericsson AB 2003-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/ic/test/java_client_erl_server_SUITE_data/m_i_impl.erl b/lib/ic/test/java_client_erl_server_SUITE_data/m_i_impl.erl
index 299f4f0a0f..31b4c1dd7a 100644
--- a/lib/ic/test/java_client_erl_server_SUITE_data/m_i_impl.erl
+++ b/lib/ic/test/java_client_erl_server_SUITE_data/m_i_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/Makefile b/lib/inets/Makefile
index 3fff719cf3..872df9d055 100644
--- a/lib/inets/Makefile
+++ b/lib/inets/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/inets/doc/src/book.xml b/lib/inets/doc/src/book.xml
index 80db82ee45..29f0c6a6d8 100644
--- a/lib/inets/doc/src/book.xml
+++ b/lib/inets/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/ftp.xml b/lib/inets/doc/src/ftp.xml
index f64bc0e18b..42bece4d38 100644
--- a/lib/inets/doc/src/ftp.xml
+++ b/lib/inets/doc/src/ftp.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/ftp_client.xml b/lib/inets/doc/src/ftp_client.xml
index 89e66db814..990dd68604 100644
--- a/lib/inets/doc/src/ftp_client.xml
+++ b/lib/inets/doc/src/ftp_client.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/http_client.xml b/lib/inets/doc/src/http_client.xml
index f4d7b751ac..212958f17f 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>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/httpd_socket.xml b/lib/inets/doc/src/httpd_socket.xml
index f71dac90b2..d3aa82a540 100644
--- a/lib/inets/doc/src/httpd_socket.xml
+++ b/lib/inets/doc/src/httpd_socket.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/httpd_util.xml b/lib/inets/doc/src/httpd_util.xml
index 0f498ba2fc..220a2ede35 100644
--- a/lib/inets/doc/src/httpd_util.xml
+++ b/lib/inets/doc/src/httpd_util.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/inets.xml b/lib/inets/doc/src/inets.xml
index 5d071c9a48..137381cbe9 100644
--- a/lib/inets/doc/src/inets.xml
+++ b/lib/inets/doc/src/inets.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2007</year><year>2013</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/inets_services.xml b/lib/inets/doc/src/inets_services.xml
index d100216ebb..da60c01aa2 100644
--- a/lib/inets/doc/src/inets_services.xml
+++ b/lib/inets/doc/src/inets_services.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/introduction.xml b/lib/inets/doc/src/introduction.xml
index 491835f852..1af2ef5dae 100644
--- a/lib/inets/doc/src/introduction.xml
+++ b/lib/inets/doc/src/introduction.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/mod_alias.xml b/lib/inets/doc/src/mod_alias.xml
index 87c950cc6b..6ae19700a5 100644
--- a/lib/inets/doc/src/mod_alias.xml
+++ b/lib/inets/doc/src/mod_alias.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/mod_auth.xml b/lib/inets/doc/src/mod_auth.xml
index 2da2be37ed..4b7088b2c5 100644
--- a/lib/inets/doc/src/mod_auth.xml
+++ b/lib/inets/doc/src/mod_auth.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/mod_esi.xml b/lib/inets/doc/src/mod_esi.xml
index 66c59a0c60..deef010e54 100644
--- a/lib/inets/doc/src/mod_esi.xml
+++ b/lib/inets/doc/src/mod_esi.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -23,10 +23,6 @@
</legalnotice>
<title>mod_esi</title>
- <prepared>Joakim Greben&ouml;</prepared>
- <docno></docno>
- <date>1997-10-14</date>
- <rev>2.2</rev>
<file>mod_esi.sgml</file>
</header>
<module>mod_esi</module>
@@ -39,6 +35,56 @@
<marker id="deliver"></marker>
</description>
+ <section>
+ <title>DATA TYPES</title>
+ <p>The following data types are used in the functions for mod_esi:</p>
+
+ <taglist>
+ <tag><c>env() = </c></tag>
+ <item> <p><c>{EnvKey()::atom(), Value::term()}</c></p>
+ </item>
+
+ <p>Currently supported key value pairs</p>
+ <taglist>
+
+ <tag><c>{server_software, string()}</c></tag>
+ <item><p>Indicates the inets version.</p></item>
+
+ <tag><c>{server_name, string()}</c></tag>
+ <item><p>The local hostname. </p></item>
+
+ <tag><c>{gateway_interface, string()}</c></tag>
+ <item><p>Legacy string used in CGI, just ignore.</p> </item>
+
+ <tag><c>{server_protocol, string()}</c></tag>
+ <item><p> HTTP version, currently "HTTP/1.1"</p></item>
+
+ <tag>{server_port, integer()}</tag>
+ <item><p>Servers port number.</p></item>
+
+ <tag><c>{request_method, "GET | "PUT" | "DELETE | "POST" | "PATCH"}</c></tag>
+
+ <tag><c>{remote_adress, inet:ip_address()} </c></tag>
+ <item><p>The clients ip address.</p></item>
+
+ <tag><c>{peer_cert, undefined | no_peercert | DER:binary()</c></tag>
+ <item>
+ <p>For TLS connections where client certificates are used this will
+ be an ASN.1 DER-encoded X509-certificate as an Erlang binary.
+ If client certificates are not used the value will be <c>no_peercert</c>,
+ and if TLS is not used (HTTP or connection is lost due to network failure)
+ the value will be <c>undefined</c>.
+ </p></item>
+
+ <tag><c>{script_name, string()}</c></tag>
+ <item><p>Request URI</p></item>
+
+ <tag><c>{http_LowerCaseHTTPHeaderName, string()}</c></tag>
+ <item><p>example: {http_content_type, "text/html"}</p></item>
+ </taglist>
+
+ </taglist>
+
<funcs>
<func>
<name>deliver(SessionID, Data) -> ok | {error, Reason}</name>
@@ -63,11 +109,11 @@
overhead. Do not assume anything about the data type of
<c>SessionID</c>. <c>SessionID</c> must be the value given
as input to the ESI callback function that you implemented.</p>
- </note>
+ </note>
</desc>
</func>
</funcs>
-
+ </section>
<section>
<title>ESI Callback Functions</title>
</section>
@@ -78,9 +124,7 @@
to the server process by calling <c>mod_esi:deliver/2</c>.</fsummary>
<type>
<v>SessionID = term()</v>
- <v>Env = [EnvironmentDirectives] ++ ParsedHeader</v>
- <v>EnvironmentDirectives = {Key,Value}</v>
- <v>Key = query_string | content_length | server_software | gateway_interface | server_protocol | server_port | request_method | remote_addr | script_name</v>
+ <v>Env = env()</v>
<v>Input = string()</v>
</type>
<desc>
@@ -111,9 +155,7 @@
<fsummary>Creates a dynamic web page and returns it as a list.
This function is deprecated and is only kept for backwards compatibility.</fsummary>
<type>
- <v>Env = [EnvironmentDirectives] ++ ParsedHeader</v>
- <v>EnvironmentDirectives = {Key,Value}</v>
- <v>Key = query_string | content_length | server_software | gateway_interface | server_protocol | server_port | request_method | remote_addr | script_name.</v>
+ <v>Env = env()</v>
<v>Input = string()</v>
<v>Response = string()</v>
</type>
diff --git a/lib/inets/doc/src/mod_security.xml b/lib/inets/doc/src/mod_security.xml
index 9dc32b971b..ec8d6ec42c 100644
--- a/lib/inets/doc/src/mod_security.xml
+++ b/lib/inets/doc/src/mod_security.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml
index 25b427a036..5cebce18a9 100644
--- a/lib/inets/doc/src/notes.xml
+++ b/lib/inets/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2015</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -33,7 +33,55 @@
<file>notes.xml</file>
</header>
- <section><title>Inets 6.2</title>
+ <section><title>Inets 6.2.3</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Put back unused module inets_regexp and remove it in OTP
+ 19 instead as it is an incompatibility, although it is an
+ undocumented module and should not affect other
+ applications.</p>
+ <p>
+ Own Id: OTP-13533</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Inets 6.2.2</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Add environment information item peer_cert to mod_esi</p>
+ <p>
+ Own Id: OTP-13510</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Inets 6.2.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Mend ipv6_host_with_brackets option in httpc</p>
+ <p>
+ Own Id: OTP-13417</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Inets 6.2</title>
<section><title>Fixed Bugs and Malfunctions</title>
<list>
diff --git a/lib/inets/doc/src/notes_history.xml b/lib/inets/doc/src/notes_history.xml
index 411c62b7f1..c12899e614 100644
--- a/lib/inets/doc/src/notes_history.xml
+++ b/lib/inets/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/part.xml b/lib/inets/doc/src/part.xml
index 3b817eecf2..f777481b5c 100644
--- a/lib/inets/doc/src/part.xml
+++ b/lib/inets/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/part_notes.xml b/lib/inets/doc/src/part_notes.xml
index 702e3dc09c..d10c829f4a 100644
--- a/lib/inets/doc/src/part_notes.xml
+++ b/lib/inets/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/part_notes_history.xml b/lib/inets/doc/src/part_notes_history.xml
index 56c44c9e9e..66e3307f69 100644
--- a/lib/inets/doc/src/part_notes_history.xml
+++ b/lib/inets/doc/src/part_notes_history.xml
@@ -4,7 +4,7 @@
<part>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/examples/Makefile b/lib/inets/examples/Makefile
index 9a852cf023..7892185bd4 100644
--- a/lib/inets/examples/Makefile
+++ b/lib/inets/examples/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010. All Rights Reserved.
+# Copyright Ericsson AB 2010-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/inets/examples/httpd_load_test/Makefile b/lib/inets/examples/httpd_load_test/Makefile
index aab62e7305..8b1b654593 100644
--- a/lib/inets/examples/httpd_load_test/Makefile
+++ b/lib/inets/examples/httpd_load_test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2012. All Rights Reserved.
+# Copyright Ericsson AB 2010-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/inets/examples/httpd_load_test/hdlt.erl b/lib/inets/examples/httpd_load_test/hdlt.erl
index ae12606bb2..f4b81c8102 100644
--- a/lib/inets/examples/httpd_load_test/hdlt.erl
+++ b/lib/inets/examples/httpd_load_test/hdlt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/examples/httpd_load_test/hdlt.sh.skel b/lib/inets/examples/httpd_load_test/hdlt.sh.skel
index 537a555e50..1797a53d1d 100644
--- a/lib/inets/examples/httpd_load_test/hdlt.sh.skel
+++ b/lib/inets/examples/httpd_load_test/hdlt.sh.skel
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010. All Rights Reserved.
+# Copyright Ericsson AB 2010-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/inets/examples/httpd_load_test/hdlt_client.erl b/lib/inets/examples/httpd_load_test/hdlt_client.erl
index a6273a11b8..8e929fbf2b 100644
--- a/lib/inets/examples/httpd_load_test/hdlt_client.erl
+++ b/lib/inets/examples/httpd_load_test/hdlt_client.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/examples/httpd_load_test/hdlt_ctrl.erl b/lib/inets/examples/httpd_load_test/hdlt_ctrl.erl
index 880ce99e72..fcf5b4505f 100644
--- a/lib/inets/examples/httpd_load_test/hdlt_ctrl.erl
+++ b/lib/inets/examples/httpd_load_test/hdlt_ctrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/examples/httpd_load_test/hdlt_logger.erl b/lib/inets/examples/httpd_load_test/hdlt_logger.erl
index e444030d7f..29fbaab3ae 100644
--- a/lib/inets/examples/httpd_load_test/hdlt_logger.erl
+++ b/lib/inets/examples/httpd_load_test/hdlt_logger.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/examples/httpd_load_test/hdlt_logger.hrl b/lib/inets/examples/httpd_load_test/hdlt_logger.hrl
index 240add0147..ac03df2e22 100644
--- a/lib/inets/examples/httpd_load_test/hdlt_logger.hrl
+++ b/lib/inets/examples/httpd_load_test/hdlt_logger.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/examples/httpd_load_test/hdlt_server.erl b/lib/inets/examples/httpd_load_test/hdlt_server.erl
index dde09a46df..cd454c82cd 100644
--- a/lib/inets/examples/httpd_load_test/hdlt_server.erl
+++ b/lib/inets/examples/httpd_load_test/hdlt_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/examples/httpd_load_test/hdlt_slave.erl b/lib/inets/examples/httpd_load_test/hdlt_slave.erl
index f05a1046d3..5ee005629d 100644
--- a/lib/inets/examples/httpd_load_test/hdlt_slave.erl
+++ b/lib/inets/examples/httpd_load_test/hdlt_slave.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/examples/httpd_load_test/modules.mk b/lib/inets/examples/httpd_load_test/modules.mk
index 3349664230..80974819e9 100644
--- a/lib/inets/examples/httpd_load_test/modules.mk
+++ b/lib/inets/examples/httpd_load_test/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010. All Rights Reserved.
+# Copyright Ericsson AB 2010-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/inets/examples/server_root/Makefile b/lib/inets/examples/server_root/Makefile
index 45118aeae0..d11389f0a7 100644
--- a/lib/inets/examples/server_root/Makefile
+++ b/lib/inets/examples/server_root/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/inets/examples/server_root/conf/8080.conf b/lib/inets/examples/server_root/conf/8080.conf
index 48e66f0114..7b1b4a15b2 100644
--- a/lib/inets/examples/server_root/conf/8080.conf
+++ b/lib/inets/examples/server_root/conf/8080.conf
@@ -1,7 +1,7 @@
Port 8080
#ServerName your.server.net
SocketType ip_comm
-Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_include mod_dir mod_get mod_head mod_log mod_disk_log
+Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_dir mod_get mod_head mod_log mod_disk_log
ServerAdmin [email protected]
ServerRoot /var/tmp/server_root
ErrorLog logs/error_log_8080
diff --git a/lib/inets/examples/server_root/conf/8888.conf b/lib/inets/examples/server_root/conf/8888.conf
index 79bb7fcca4..042779fcd0 100644
--- a/lib/inets/examples/server_root/conf/8888.conf
+++ b/lib/inets/examples/server_root/conf/8888.conf
@@ -1,7 +1,7 @@
Port 8888
#ServerName your.server.net
SocketType ip_comm
-Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_include mod_dir mod_get mod_head mod_log mod_disk_log
+Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_dir mod_get mod_head mod_log mod_disk_log
ServerAdmin [email protected]
ServerRoot /var/tmp/server_root
ErrorLog logs/error_log_8888
diff --git a/lib/inets/examples/server_root/conf/httpd.conf b/lib/inets/examples/server_root/conf/httpd.conf
index f99563d14b..3f9fde03b5 100644
--- a/lib/inets/examples/server_root/conf/httpd.conf
+++ b/lib/inets/examples/server_root/conf/httpd.conf
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -64,7 +64,7 @@ SocketType ip_comm
# WARNING! Do not tamper with this directive unless you are familiar with
# EWSAPI.
-Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_responsecontrol mod_trace mod_range mod_head mod_include mod_dir mod_get mod_log mod_disk_log
+Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_responsecontrol mod_trace mod_range mod_head mod_dir mod_get mod_log mod_disk_log
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.
diff --git a/lib/inets/examples/server_root/conf/ssl.conf b/lib/inets/examples/server_root/conf/ssl.conf
index 8b8c57a98b..de49ceafd0 100644
--- a/lib/inets/examples/server_root/conf/ssl.conf
+++ b/lib/inets/examples/server_root/conf/ssl.conf
@@ -1,7 +1,7 @@
Port 8088
#ServerName your.server.net
SocketType ssl
-Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_include mod_dir mod_get mod_head mod_log mod_disk_log
+Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_dir mod_get mod_head mod_log mod_disk_log
ServerAdmin [email protected]
ServerRoot /var/tmp/server_root
ErrorLog logs/error_log_8088
diff --git a/lib/inets/include/httpd.hrl b/lib/inets/include/httpd.hrl
index 8d2803ad3b..fb338d5c68 100644
--- a/lib/inets/include/httpd.hrl
+++ b/lib/inets/include/httpd.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/include/mod_auth.hrl b/lib/inets/include/mod_auth.hrl
index bd3577b9ee..224b2edb5e 100644
--- a/lib/inets/include/mod_auth.hrl
+++ b/lib/inets/include/mod_auth.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/priv/Makefile b/lib/inets/priv/Makefile
index b0e65f8f9c..ddd35e8625 100644
--- a/lib/inets/priv/Makefile
+++ b/lib/inets/priv/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/Makefile b/lib/inets/src/Makefile
index a2a70a7b8f..281dd388cb 100644
--- a/lib/inets/src/Makefile
+++ b/lib/inets/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/ftp/Makefile b/lib/inets/src/ftp/Makefile
index f8daa2b894..6b99694ea7 100644
--- a/lib/inets/src/ftp/Makefile
+++ b/lib/inets/src/ftp/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2012. All Rights Reserved.
+# Copyright Ericsson AB 2005-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/ftp/ftp_internal.hrl b/lib/inets/src/ftp/ftp_internal.hrl
index a6c9fa098a..f29bb4a099 100644
--- a/lib/inets/src/ftp/ftp_internal.hrl
+++ b/lib/inets/src/ftp/ftp_internal.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/ftp/ftp_progress.erl b/lib/inets/src/ftp/ftp_progress.erl
index 9c42723a07..68185a222d 100644
--- a/lib/inets/src/ftp/ftp_progress.erl
+++ b/lib/inets/src/ftp/ftp_progress.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/ftp/ftp_response.erl b/lib/inets/src/ftp/ftp_response.erl
index 0aac15ef6c..32db2dfe66 100644
--- a/lib/inets/src/ftp/ftp_response.erl
+++ b/lib/inets/src/ftp/ftp_response.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/ftp/ftp_sup.erl b/lib/inets/src/ftp/ftp_sup.erl
index b5b3f6a105..21dcfb6ab2 100644
--- a/lib/inets/src/ftp/ftp_sup.erl
+++ b/lib/inets/src/ftp/ftp_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_client/Makefile b/lib/inets/src/http_client/Makefile
index cb97b525f6..a1c1f36b70 100644
--- a/lib/inets/src/http_client/Makefile
+++ b/lib/inets/src/http_client/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2012. All Rights Reserved.
+# Copyright Ericsson AB 2005-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl
index 85663b5ded..91d87289a2 100644
--- a/lib/inets/src/http_client/httpc.erl
+++ b/lib/inets/src/http_client/httpc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -556,7 +556,7 @@ handle_request(Method, Url,
Request = #request{from = Receiver,
scheme = Scheme,
- address = {Host, Port},
+ address = {host_address(Host, BracketedHost), Port},
path = MaybeEscPath,
pquery = MaybeEscQuery,
method = Method,
@@ -1268,3 +1268,7 @@ child_name(Pid, [_ | Children]) ->
%% d(_, _, _) ->
%% ok.
+host_address(Host, false) ->
+ Host;
+host_address(Host, true) ->
+ string:strip(string:strip(Host, right, $]), left, $[).
diff --git a/lib/inets/src/http_client/httpc_cookie.erl b/lib/inets/src/http_client/httpc_cookie.erl
index 0c4f44a575..cbf428ab3e 100644
--- a/lib/inets/src/http_client/httpc_cookie.erl
+++ b/lib/inets/src/http_client/httpc_cookie.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_client/httpc_handler_sup.erl b/lib/inets/src/http_client/httpc_handler_sup.erl
index 403512fc25..ad70afe2ae 100644
--- a/lib/inets/src/http_client/httpc_handler_sup.erl
+++ b/lib/inets/src/http_client/httpc_handler_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_client/httpc_internal.hrl b/lib/inets/src/http_client/httpc_internal.hrl
index bb8c0e20fa..f4e69cc1fa 100644
--- a/lib/inets/src/http_client/httpc_internal.hrl
+++ b/lib/inets/src/http_client/httpc_internal.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_client/httpc_manager.erl b/lib/inets/src/http_client/httpc_manager.erl
index c7974836c2..4cb6f005ad 100644
--- a/lib/inets/src/http_client/httpc_manager.erl
+++ b/lib/inets/src/http_client/httpc_manager.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_client/httpc_profile_sup.erl b/lib/inets/src/http_client/httpc_profile_sup.erl
index b83aeaa4e0..334f2eb1c7 100644
--- a/lib/inets/src/http_client/httpc_profile_sup.erl
+++ b/lib/inets/src/http_client/httpc_profile_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_client/httpc_request.erl b/lib/inets/src/http_client/httpc_request.erl
index af4c3f75f2..e8d020c165 100644
--- a/lib/inets/src/http_client/httpc_request.erl
+++ b/lib/inets/src/http_client/httpc_request.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -186,16 +186,19 @@ is_client_closing(Headers) ->
%%%========================================================================
%%% Internal functions
%%%========================================================================
-post_data(Method, Headers, {ContentType, Body}, HeadersAsIs)
- when (Method =:= post) orelse (Method =:= put)
- orelse (Method =:= patch) ->
+post_data(Method, Headers, {ContentType, Body}, HeadersAsIs)
+ when (Method =:= post)
+ orelse (Method =:= put)
+ orelse (Method =:= patch)
+ orelse (Method =:= delete) ->
+
NewBody = case Headers#http_request_h.expect of
- "100-continue" ->
- "";
- _ ->
- Body
- end,
-
+ "100-continue" ->
+ "";
+ _ ->
+ Body
+ end,
+
NewHeaders = case HeadersAsIs of
[] ->
Headers#http_request_h{
@@ -213,7 +216,7 @@ post_data(Method, Headers, {ContentType, Body}, HeadersAsIs)
_ ->
HeadersAsIs
end,
-
+
{NewHeaders, NewBody};
post_data(_, Headers, _, []) ->
diff --git a/lib/inets/src/http_client/httpc_response.erl b/lib/inets/src/http_client/httpc_response.erl
index 4bf2ba2b9b..91256fa6a2 100644
--- a/lib/inets/src/http_client/httpc_response.erl
+++ b/lib/inets/src/http_client/httpc_response.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_client/httpc_sup.erl b/lib/inets/src/http_client/httpc_sup.erl
index 2b2ee0f34a..b2d944c834 100644
--- a/lib/inets/src/http_client/httpc_sup.erl
+++ b/lib/inets/src/http_client/httpc_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_lib/Makefile b/lib/inets/src/http_lib/Makefile
index 4a4eef9f24..8248e37c44 100644
--- a/lib/inets/src/http_lib/Makefile
+++ b/lib/inets/src/http_lib/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2012. All Rights Reserved.
+# Copyright Ericsson AB 2005-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_lib/http_chunk.erl b/lib/inets/src/http_lib/http_chunk.erl
index 7325f24809..742d634577 100644
--- a/lib/inets/src/http_lib/http_chunk.erl
+++ b/lib/inets/src/http_lib/http_chunk.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_lib/http_response.erl b/lib/inets/src/http_lib/http_response.erl
index 42e5dd263d..cbdea82523 100644
--- a/lib/inets/src/http_lib/http_response.erl
+++ b/lib/inets/src/http_lib/http_response.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_lib/http_transport.erl b/lib/inets/src/http_lib/http_transport.erl
index ab6afe9c6c..2e3e099e5b 100644
--- a/lib/inets/src/http_lib/http_transport.erl
+++ b/lib/inets/src/http_lib/http_transport.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_lib/http_uri.erl b/lib/inets/src/http_lib/http_uri.erl
index 9940136f5a..cb3e107ccf 100644
--- a/lib/inets/src/http_lib/http_uri.erl
+++ b/lib/inets/src/http_lib/http_uri.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_lib/http_util.erl b/lib/inets/src/http_lib/http_util.erl
index aafa97afee..20c342dd66 100644
--- a/lib/inets/src/http_lib/http_util.erl
+++ b/lib/inets/src/http_lib/http_util.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd.erl b/lib/inets/src/http_server/httpd.erl
index e6377b4882..0b632d24e3 100644
--- a/lib/inets/src/http_server/httpd.erl
+++ b/lib/inets/src/http_server/httpd.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd.hrl b/lib/inets/src/http_server/httpd.hrl
index 29dc45f93a..751264ae0a 100644
--- a/lib/inets/src/http_server/httpd.hrl
+++ b/lib/inets/src/http_server/httpd.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd_acceptor.erl b/lib/inets/src/http_server/httpd_acceptor.erl
index adccaf3b69..447faec12f 100644
--- a/lib/inets/src/http_server/httpd_acceptor.erl
+++ b/lib/inets/src/http_server/httpd_acceptor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd_acceptor_sup.erl b/lib/inets/src/http_server/httpd_acceptor_sup.erl
index 172498df8b..09d81a66d0 100644
--- a/lib/inets/src/http_server/httpd_acceptor_sup.erl
+++ b/lib/inets/src/http_server/httpd_acceptor_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd_cgi.erl b/lib/inets/src/http_server/httpd_cgi.erl
index fb5feb5fbe..583c0be985 100644
--- a/lib/inets/src/http_server/httpd_cgi.erl
+++ b/lib/inets/src/http_server/httpd_cgi.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd_conf.erl b/lib/inets/src/http_server/httpd_conf.erl
index a7783bc1e9..6a801c973d 100644
--- a/lib/inets/src/http_server/httpd_conf.erl
+++ b/lib/inets/src/http_server/httpd_conf.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd_connection_sup.erl b/lib/inets/src/http_server/httpd_connection_sup.erl
index 939aa5366b..f7b3bef245 100644
--- a/lib/inets/src/http_server/httpd_connection_sup.erl
+++ b/lib/inets/src/http_server/httpd_connection_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd_esi.erl b/lib/inets/src/http_server/httpd_esi.erl
index a925fac217..9406b47802 100644
--- a/lib/inets/src/http_server/httpd_esi.erl
+++ b/lib/inets/src/http_server/httpd_esi.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd_example.erl b/lib/inets/src/http_server/httpd_example.erl
index 0222487a4b..424d269859 100644
--- a/lib/inets/src/http_server/httpd_example.erl
+++ b/lib/inets/src/http_server/httpd_example.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
%%
-module(httpd_example).
-export([print/1]).
--export([get/2, post/2, yahoo/2, test1/2, get_bin/2]).
+-export([get/2, post/2, yahoo/2, test1/2, get_bin/2, peer/2]).
-export([newformat/3]).
%% These are used by the inets test-suite
@@ -94,10 +94,26 @@ default(Env,Input) ->
io_lib:format("~p",[httpd:parse_query(Input)]),"\n",
footer()].
+peer(Env, Input) ->
+ Header =
+ case proplists:get_value(peer_cert, Env) of
+ undefined ->
+ header("text/html", "Peer-Cert-Exist:false");
+ _ ->
+ header("text/html", "Peer-Cert-Exist:true")
+ end,
+ [Header,
+ top("Test peer_cert environment option"),
+ "<B>Peer cert:</B> ",
+ io_lib:format("~p",[proplists:get_value(peer_cert, Env)]),"\n",
+ footer()].
+
header() ->
header("text/html").
header(MimeType) ->
"Content-type: " ++ MimeType ++ "\r\n\r\n".
+header(MimeType, Other) ->
+ "Content-type: " ++ MimeType ++ "\r\n" ++ Other ++ "\r\n\r\n".
top(Title) ->
"<HTML>
diff --git a/lib/inets/src/http_server/httpd_file.erl b/lib/inets/src/http_server/httpd_file.erl
index 5ada71ad76..4d419172d0 100644
--- a/lib/inets/src/http_server/httpd_file.erl
+++ b/lib/inets/src/http_server/httpd_file.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd_instance_sup.erl b/lib/inets/src/http_server/httpd_instance_sup.erl
index 079cc464ba..b77aa174ca 100644
--- a/lib/inets/src/http_server/httpd_instance_sup.erl
+++ b/lib/inets/src/http_server/httpd_instance_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd_internal.hrl b/lib/inets/src/http_server/httpd_internal.hrl
index 79b53668ad..09d720ee85 100644
--- a/lib/inets/src/http_server/httpd_internal.hrl
+++ b/lib/inets/src/http_server/httpd_internal.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd_log.erl b/lib/inets/src/http_server/httpd_log.erl
index 0bad759774..56a08cd502 100644
--- a/lib/inets/src/http_server/httpd_log.erl
+++ b/lib/inets/src/http_server/httpd_log.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd_manager.erl b/lib/inets/src/http_server/httpd_manager.erl
index 763ddae524..7cb39937e8 100644
--- a/lib/inets/src/http_server/httpd_manager.erl
+++ b/lib/inets/src/http_server/httpd_manager.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd_misc_sup.erl b/lib/inets/src/http_server/httpd_misc_sup.erl
index 114a3c746f..cac9315c27 100644
--- a/lib/inets/src/http_server/httpd_misc_sup.erl
+++ b/lib/inets/src/http_server/httpd_misc_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd_request_handler.erl b/lib/inets/src/http_server/httpd_request_handler.erl
index 8fae9ac46e..071fa94ef6 100644
--- a/lib/inets/src/http_server/httpd_request_handler.erl
+++ b/lib/inets/src/http_server/httpd_request_handler.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd_script_env.erl b/lib/inets/src/http_server/httpd_script_env.erl
index 232bf96bd4..e15613273e 100644
--- a/lib/inets/src/http_server/httpd_script_env.erl
+++ b/lib/inets/src/http_server/httpd_script_env.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -61,6 +61,19 @@ which_port(#mod{config_db = ConfigDb}) ->
which_peername(#mod{init_data = #init_data{peername = {_, RemoteAddr}}}) ->
RemoteAddr.
+which_peercert(#mod{socket_type = {Type, _}, socket = Socket}) when Type == essl;
+ Type == ssl ->
+ case ssl:peercert(Socket) of
+ {ok, Cert} ->
+ Cert;
+ {error, no_peercert} ->
+ no_peercert;
+ _ ->
+ undefined
+ end;
+which_peercert(_) -> %% Not an ssl connection
+ undefined.
+
which_resolve(#mod{init_data = #init_data{resolve = Resolve}}) ->
Resolve.
@@ -78,6 +91,7 @@ create_basic_elements(esi, ModData) ->
{server_port, which_port(ModData)},
{request_method, which_method(ModData)},
{remote_addr, which_peername(ModData)},
+ {peer_cert, which_peercert(ModData)},
{script_name, which_request_uri(ModData)}];
create_basic_elements(cgi, ModData) ->
diff --git a/lib/inets/src/http_server/httpd_socket.erl b/lib/inets/src/http_server/httpd_socket.erl
index b7b232a686..aa67c13621 100644
--- a/lib/inets/src/http_server/httpd_socket.erl
+++ b/lib/inets/src/http_server/httpd_socket.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd_sup.erl b/lib/inets/src/http_server/httpd_sup.erl
index bf40cedd5c..d1216e01b0 100644
--- a/lib/inets/src/http_server/httpd_sup.erl
+++ b/lib/inets/src/http_server/httpd_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/httpd_util.erl b/lib/inets/src/http_server/httpd_util.erl
index 6dd6db6a0c..a647f04ddc 100644
--- a/lib/inets/src/http_server/httpd_util.erl
+++ b/lib/inets/src/http_server/httpd_util.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_actions.erl b/lib/inets/src/http_server/mod_actions.erl
index 154fde294e..b5449f20ee 100644
--- a/lib/inets/src/http_server/mod_actions.erl
+++ b/lib/inets/src/http_server/mod_actions.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_alias.erl b/lib/inets/src/http_server/mod_alias.erl
index 727f6e0ce3..0333076546 100644
--- a/lib/inets/src/http_server/mod_alias.erl
+++ b/lib/inets/src/http_server/mod_alias.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_auth.erl b/lib/inets/src/http_server/mod_auth.erl
index b03629cabe..fba94df176 100644
--- a/lib/inets/src/http_server/mod_auth.erl
+++ b/lib/inets/src/http_server/mod_auth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_auth.hrl b/lib/inets/src/http_server/mod_auth.hrl
index 88554a64ed..dd7794c78c 100644
--- a/lib/inets/src/http_server/mod_auth.hrl
+++ b/lib/inets/src/http_server/mod_auth.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_auth_dets.erl b/lib/inets/src/http_server/mod_auth_dets.erl
index 95a2cdd669..9f95b2ca2d 100644
--- a/lib/inets/src/http_server/mod_auth_dets.erl
+++ b/lib/inets/src/http_server/mod_auth_dets.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_auth_mnesia.erl b/lib/inets/src/http_server/mod_auth_mnesia.erl
index 994f25a462..62acc554d4 100644
--- a/lib/inets/src/http_server/mod_auth_mnesia.erl
+++ b/lib/inets/src/http_server/mod_auth_mnesia.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_auth_plain.erl b/lib/inets/src/http_server/mod_auth_plain.erl
index 1a3120e03c..f2b0dfd71f 100644
--- a/lib/inets/src/http_server/mod_auth_plain.erl
+++ b/lib/inets/src/http_server/mod_auth_plain.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_auth_server.erl b/lib/inets/src/http_server/mod_auth_server.erl
index 7d1e1a3431..93d8145821 100644
--- a/lib/inets/src/http_server/mod_auth_server.erl
+++ b/lib/inets/src/http_server/mod_auth_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_browser.erl b/lib/inets/src/http_server/mod_browser.erl
index e3c41793ae..1e8f860746 100644
--- a/lib/inets/src/http_server/mod_browser.erl
+++ b/lib/inets/src/http_server/mod_browser.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_cgi.erl b/lib/inets/src/http_server/mod_cgi.erl
index ec8b9be32e..1454332895 100644
--- a/lib/inets/src/http_server/mod_cgi.erl
+++ b/lib/inets/src/http_server/mod_cgi.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_dir.erl b/lib/inets/src/http_server/mod_dir.erl
index 2d8f27af3c..ba93d0b271 100644
--- a/lib/inets/src/http_server/mod_dir.erl
+++ b/lib/inets/src/http_server/mod_dir.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_disk_log.erl b/lib/inets/src/http_server/mod_disk_log.erl
index 5e395a2118..3be5f2dd74 100644
--- a/lib/inets/src/http_server/mod_disk_log.erl
+++ b/lib/inets/src/http_server/mod_disk_log.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_esi.erl b/lib/inets/src/http_server/mod_esi.erl
index 2978ac9095..2800250727 100644
--- a/lib/inets/src/http_server/mod_esi.erl
+++ b/lib/inets/src/http_server/mod_esi.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_get.erl b/lib/inets/src/http_server/mod_get.erl
index e8b3896f89..58600f5e3e 100644
--- a/lib/inets/src/http_server/mod_get.erl
+++ b/lib/inets/src/http_server/mod_get.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_head.erl b/lib/inets/src/http_server/mod_head.erl
index 1b68c1c66b..25c11360eb 100644
--- a/lib/inets/src/http_server/mod_head.erl
+++ b/lib/inets/src/http_server/mod_head.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_htaccess.erl b/lib/inets/src/http_server/mod_htaccess.erl
index f229c96f2d..2bc0d79218 100644
--- a/lib/inets/src/http_server/mod_htaccess.erl
+++ b/lib/inets/src/http_server/mod_htaccess.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_log.erl b/lib/inets/src/http_server/mod_log.erl
index 4161f7059c..ad7e9713d9 100644
--- a/lib/inets/src/http_server/mod_log.erl
+++ b/lib/inets/src/http_server/mod_log.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_range.erl b/lib/inets/src/http_server/mod_range.erl
index 66d66c2809..1c6c6d927d 100644
--- a/lib/inets/src/http_server/mod_range.erl
+++ b/lib/inets/src/http_server/mod_range.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_responsecontrol.erl b/lib/inets/src/http_server/mod_responsecontrol.erl
index 9b410952f0..07129940a5 100644
--- a/lib/inets/src/http_server/mod_responsecontrol.erl
+++ b/lib/inets/src/http_server/mod_responsecontrol.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_security.erl b/lib/inets/src/http_server/mod_security.erl
index 1f936d598a..e7fc043217 100644
--- a/lib/inets/src/http_server/mod_security.erl
+++ b/lib/inets/src/http_server/mod_security.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_security_server.erl b/lib/inets/src/http_server/mod_security_server.erl
index f9281b0fdc..4f52357af3 100644
--- a/lib/inets/src/http_server/mod_security_server.erl
+++ b/lib/inets/src/http_server/mod_security_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/http_server/mod_trace.erl b/lib/inets/src/http_server/mod_trace.erl
index e1cb428264..f007426ae3 100644
--- a/lib/inets/src/http_server/mod_trace.erl
+++ b/lib/inets/src/http_server/mod_trace.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/inets_app/Makefile b/lib/inets/src/inets_app/Makefile
index 0a4b625b6a..a294381f67 100644
--- a/lib/inets/src/inets_app/Makefile
+++ b/lib/inets/src/inets_app/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2015. All Rights Reserved.
+# Copyright Ericsson AB 2005-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -49,7 +49,8 @@ MODULES = \
inets_sup \
inets_trace \
inets_lib \
- inets_time_compat
+ inets_time_compat \
+ inets_regexp
INTERNAL_HRL_FILES = inets_internal.hrl
EXTERNAL_HRL_FILES = ../../include/httpd.hrl \
diff --git a/lib/inets/src/inets_app/inets.app.src b/lib/inets/src/inets_app/inets.app.src
index 2f213794a3..abf8c0cdea 100644
--- a/lib/inets/src/inets_app/inets.app.src
+++ b/lib/inets/src/inets_app/inets.app.src
@@ -1,7 +1,7 @@
%% This is an -*- erlang -*- file.
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -29,6 +29,7 @@
inets_trace,
inets_lib,
inets_time_compat,
+ inets_regexp,
%% FTP
ftp,
diff --git a/lib/inets/src/inets_app/inets.appup.src b/lib/inets/src/inets_app/inets.appup.src
index a9fbb1c3f7..3a31daeb20 100644
--- a/lib/inets/src/inets_app/inets.appup.src
+++ b/lib/inets/src/inets_app/inets.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/inets_app/inets.erl b/lib/inets/src/inets_app/inets.erl
index 2a40f73889..2d380012d7 100644
--- a/lib/inets/src/inets_app/inets.erl
+++ b/lib/inets/src/inets_app/inets.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/inets_app/inets.mk b/lib/inets/src/inets_app/inets.mk
index 2c85173c68..1228514661 100644
--- a/lib/inets/src/inets_app/inets.mk
+++ b/lib/inets/src/inets_app/inets.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2012. All Rights Reserved.
+# Copyright Ericsson AB 2010-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/inets_app/inets_app.erl b/lib/inets/src/inets_app/inets_app.erl
index 3e4718070c..da4e9ead25 100644
--- a/lib/inets/src/inets_app/inets_app.erl
+++ b/lib/inets/src/inets_app/inets_app.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/inets_app/inets_internal.hrl b/lib/inets/src/inets_app/inets_internal.hrl
index cc794d27c0..079b415b56 100644
--- a/lib/inets/src/inets_app/inets_internal.hrl
+++ b/lib/inets/src/inets_app/inets_internal.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/inets_app/inets_regexp.erl b/lib/inets/src/inets_app/inets_regexp.erl
new file mode 100644
index 0000000000..fc1608bc5a
--- /dev/null
+++ b/lib/inets/src/inets_app/inets_regexp.erl
@@ -0,0 +1,414 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2009. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(inets_regexp).
+
+-export([parse/1, match/2, first_match/2, split/2, sub/3, gsub/3]).
+
+
+%%%=========================================================================
+%%% API
+%%%=========================================================================
+
+%% parse(RegExp) -> {ok, RE} | {error, E}.
+%% Parse the regexp described in the string RegExp.
+
+parse(S) ->
+ case (catch reg(S)) of
+ {R, []} ->
+ {ok, R};
+ {_R, [C|_]} ->
+ {error, {illegal, [C]}};
+ {error, E} ->
+ {error, E}
+ end.
+
+
+%% Find the longest match of RegExp in String.
+
+match(S, RegExp) when is_list(RegExp) ->
+ case parse(RegExp) of
+ {ok,RE} -> match(S, RE);
+ {error,E} -> {error,E}
+ end;
+match(S, RE) ->
+ case match(RE, S, 1, 0, -1) of
+ {Start,Len} when Len >= 0 ->
+ {match, Start, Len};
+ {_Start,_Len} ->
+ nomatch
+ end.
+
+%% Find the first match of RegExp in String.
+
+first_match(S, RegExp) when is_list(RegExp) ->
+ case parse(RegExp) of
+ {ok, RE} ->
+ first_match(S, RE);
+ {error, E} ->
+ {error, E}
+ end;
+first_match(S, RE) ->
+ case first_match(RE, S, 1) of
+ {Start,Len} when Len >= 0 ->
+ {match, Start,Len};
+ nomatch ->
+ nomatch
+ end.
+
+first_match(RE, S, St) when S =/= [] ->
+ case re_apply(S, St, RE) of
+ {match, P, _Rest} ->
+ {St, P-St};
+ nomatch ->
+ first_match(RE, tl(S), St+1)
+ end;
+first_match(_RE, [], _St) ->
+ nomatch.
+
+
+match(RE, S, St, Pos, L) ->
+ case first_match(RE, S, St) of
+ {St1, L1} ->
+ Nst = St1 + 1,
+ if L1 > L ->
+ match(RE, lists:nthtail(Nst-St, S), Nst, St1, L1);
+ true ->
+ match(RE, lists:nthtail(Nst-St, S), Nst, Pos, L)
+ end;
+ nomatch ->
+ {Pos, L}
+ end.
+
+
+%% Split a string into substrings where the RegExp describes the
+%% field seperator. The RegExp " " is specially treated.
+
+split(String, " ") -> %This is really special
+ {ok, RE} = parse("[ \t]+"),
+ case split_apply(String, RE, true) of
+ [[]|Ss] ->
+ {ok,Ss};
+ Ss ->
+ {ok,Ss}
+ end;
+split(String, RegExp) when is_list(RegExp) ->
+ case parse(RegExp) of
+ {ok, RE} ->
+ {ok, split_apply(String, RE, false)};
+ {error, E} ->
+ {error,E}
+ end;
+split(String, RE) ->
+ {ok, split_apply(String, RE, false)}.
+
+
+%% Substitute the first match of the regular expression RegExp
+%% with the string Replace in String. Accept pre-parsed regular
+%% expressions.
+
+sub(String, RegExp, Rep) when is_list(RegExp) ->
+ case parse(RegExp) of
+ {ok, RE} ->
+ sub(String, RE, Rep);
+ {error, E} ->
+ {error, E}
+ end;
+sub(String, RE, Rep) ->
+ Ss = sub_match(String, RE, 1),
+ {ok, sub_repl(Ss, Rep, String, 1), length(Ss)}.
+
+
+%% Substitute every match of the regular expression RegExp with
+%% the string New in String. Accept pre-parsed regular expressions.
+
+gsub(String, RegExp, Rep) when is_list(RegExp) ->
+ case parse(RegExp) of
+ {ok, RE} ->
+ gsub(String, RE, Rep);
+ {error, E} ->
+ {error, E}
+ end;
+gsub(String, RE, Rep) ->
+ Ss = matches(String, RE, 1),
+ {ok, sub_repl(Ss, Rep, String, 1), length(Ss)}.
+
+
+%%%========================================================================
+%%% Internal functions
+%%%========================================================================
+
+%% This is the regular expression grammar used. It is equivalent to the
+%% one used in AWK, except that we allow ^ $ to be used anywhere and fail
+%% in the matching.
+%%
+%% reg -> reg1 : '$1'.
+%% reg1 -> reg1 "|" reg2 : {'or','$1','$2'}.
+%% reg1 -> reg2 : '$1'.
+%% reg2 -> reg2 reg3 : {concat,'$1','$2'}.
+%% reg2 -> reg3 : '$1'.
+%% reg3 -> reg3 "*" : {kclosure,'$1'}.
+%% reg3 -> reg3 "+" : {pclosure,'$1'}.
+%% reg3 -> reg3 "?" : {optional,'$1'}.
+%% reg3 -> reg4 : '$1'.
+%% reg4 -> "(" reg ")" : '$2'.
+%% reg4 -> "\\" char : '$2'.
+%% reg4 -> "^" : bos.
+%% reg4 -> "$" : eos.
+%% reg4 -> "." : char.
+%% reg4 -> "[" class "]" : {char_class,char_class('$2')}
+%% reg4 -> "[" "^" class "]" : {comp_class,char_class('$3')}
+%% reg4 -> "\"" chars "\"" : char_string('$2')
+%% reg4 -> char : '$1'.
+%% reg4 -> empty : epsilon.
+%% The grammar of the current regular expressions. The actual parser
+%% is a recursive descent implementation of the grammar.
+
+reg(S) -> reg1(S).
+
+%% reg1 -> reg2 reg1'
+%% reg1' -> "|" reg2
+%% reg1' -> empty
+
+reg1(S0) ->
+ {L,S1} = reg2(S0),
+ reg1p(S1, L).
+
+reg1p([$||S0], L) ->
+ {R,S1} = reg2(S0),
+ reg1p(S1, {'or',L,R});
+reg1p(S, L) -> {L,S}.
+
+%% reg2 -> reg3 reg2'
+%% reg2' -> reg3
+%% reg2' -> empty
+
+reg2(S0) ->
+ {L,S1} = reg3(S0),
+ reg2p(S1, L).
+
+reg2p([C|S0], L) when (C =/= $|) andalso (C =/= $)) ->
+ {R,S1} = reg3([C|S0]),
+ reg2p(S1, {concat,L,R});
+reg2p(S, L) -> {L,S}.
+
+%% reg3 -> reg4 reg3'
+%% reg3' -> "*" reg3'
+%% reg3' -> "+" reg3'
+%% reg3' -> "?" reg3'
+%% reg3' -> empty
+
+reg3(S0) ->
+ {L,S1} = reg4(S0),
+ reg3p(S1, L).
+
+reg3p([$*|S], L) -> reg3p(S, {kclosure,L});
+reg3p([$+|S], L) -> reg3p(S, {pclosure,L});
+reg3p([$?|S], L) -> reg3p(S, {optional,L});
+reg3p(S, L) -> {L,S}.
+
+reg4([$(|S0]) ->
+ case reg(S0) of
+ {R,[$)|S1]} -> {R,S1};
+ {_R,_S} -> throw({error,{unterminated,"("}})
+ end;
+reg4([$\\,O1,O2,O3|S])
+ when ((O1 >= $0) andalso
+ (O1 =< $7) andalso
+ (O2 >= $0) andalso
+ (O2 =< $7) andalso
+ (O3 >= $0) andalso
+ (O3 =< $7)) ->
+ {(O1*8 + O2)*8 + O3 - 73*$0,S};
+reg4([$\\,C|S]) ->
+ {escape_char(C),S};
+reg4([$\\]) ->
+ throw({error, {unterminated,"\\"}});
+reg4([$^|S]) ->
+ {bos,S};
+reg4([$$|S]) ->
+ {eos,S};
+reg4([$.|S]) ->
+ {{comp_class,"\n"},S};
+reg4("[^" ++ S0) ->
+ case char_class(S0) of
+ {Cc,[$]|S1]} -> {{comp_class,Cc},S1};
+ {_Cc,_S} -> throw({error,{unterminated,"["}})
+ end;
+reg4([$[|S0]) ->
+ case char_class(S0) of
+ {Cc,[$]|S1]} -> {{char_class,Cc},S1};
+ {_Cc,_S1} -> throw({error,{unterminated,"["}})
+ end;
+reg4([C|S])
+ when (C =/= $*) andalso (C =/= $+) andalso (C =/= $?) andalso (C =/= $]) ->
+ {C, S};
+reg4([C|_S]) ->
+ throw({error,{illegal,[C]}});
+reg4([]) ->
+ {epsilon,[]}.
+
+escape_char($n) -> $\n; %\n = LF
+escape_char($r) -> $\r; %\r = CR
+escape_char($t) -> $\t; %\t = TAB
+escape_char($v) -> $\v; %\v = VT
+escape_char($b) -> $\b; %\b = BS
+escape_char($f) -> $\f; %\f = FF
+escape_char($e) -> $\e; %\e = ESC
+escape_char($s) -> $\s; %\s = SPACE
+escape_char($d) -> $\d; %\d = DEL
+escape_char(C) -> C.
+
+char_class([$]|S]) -> char_class(S, [$]]);
+char_class(S) -> char_class(S, []).
+
+char($\\, [O1,O2,O3|S]) when
+ O1 >= $0, O1 =< $7, O2 >= $0, O2 =< $7, O3 >= $0, O3 =< $7 ->
+ {(O1*8 + O2)*8 + O3 - 73*$0,S};
+char($\\, [C|S]) -> {escape_char(C),S};
+char(C, S) -> {C,S}.
+
+char_class([C1|S0], Cc) when C1 =/= $] ->
+ case char(C1, S0) of
+ {Cf,[$-,C2|S1]} when C2 =/= $] ->
+ case char(C2, S1) of
+ {Cl,S2} when Cf < Cl -> char_class(S2, [{Cf,Cl}|Cc]);
+ {Cl,_S2} -> throw({error,{char_class,[Cf,$-,Cl]}})
+ end;
+ {C,S1} -> char_class(S1, [C|Cc])
+ end;
+char_class(S, Cc) -> {Cc,S}.
+
+
+%% re_apply(String, StartPos, RegExp) -> re_app_res().
+%%
+%% Apply the (parse of the) regular expression RegExp to String. If
+%% there is a match return the position of the remaining string and
+%% the string if else return 'nomatch'. BestMatch specifies if we want
+%% the longest match, or just a match.
+%%
+%% StartPos should be the real start position as it is used to decide
+%% if we ae at the beginning of the string.
+%%
+%% Pass two functions to re_apply_or so it can decide, on the basis
+%% of BestMatch, whether to just any take any match or try both to
+%% find the longest. This is slower but saves duplicatng code.
+
+re_apply(S, St, RE) -> re_apply(RE, [], S, St).
+
+re_apply(epsilon, More, S, P) -> %This always matches
+ re_apply_more(More, S, P);
+re_apply({'or',RE1,RE2}, More, S, P) ->
+ re_apply_or(re_apply(RE1, More, S, P),
+ re_apply(RE2, More, S, P));
+re_apply({concat,RE1,RE2}, More, S0, P) ->
+ re_apply(RE1, [RE2|More], S0, P);
+re_apply({kclosure,CE}, More, S, P) ->
+ %% Be careful with the recursion, explicitly do one call before
+ %% looping.
+ re_apply_or(re_apply_more(More, S, P),
+ re_apply(CE, [{kclosure,CE}|More], S, P));
+re_apply({pclosure,CE}, More, S, P) ->
+ re_apply(CE, [{kclosure,CE}|More], S, P);
+re_apply({optional,CE}, More, S, P) ->
+ re_apply_or(re_apply_more(More, S, P),
+ re_apply(CE, More, S, P));
+re_apply(bos, More, S, 1) -> re_apply_more(More, S, 1);
+re_apply(eos, More, [$\n|S], P) -> re_apply_more(More, S, P);
+re_apply(eos, More, [], P) -> re_apply_more(More, [], P);
+re_apply({char_class,Cc}, More, [C|S], P) ->
+ case in_char_class(C, Cc) of
+ true -> re_apply_more(More, S, P+1);
+ false -> nomatch
+ end;
+re_apply({comp_class,Cc}, More, [C|S], P) ->
+ case in_char_class(C, Cc) of
+ true -> nomatch;
+ false -> re_apply_more(More, S, P+1)
+ end;
+re_apply(C, More, [C|S], P) when is_integer(C) ->
+ re_apply_more(More, S, P+1);
+re_apply(_RE, _More, _S, _P) -> nomatch.
+
+%% re_apply_more([RegExp], String, Length) -> re_app_res().
+
+re_apply_more([RE|More], S, P) -> re_apply(RE, More, S, P);
+re_apply_more([], S, P) -> {match,P,S}.
+
+%% in_char_class(Char, Class) -> bool().
+
+in_char_class(C, [{C1,C2}|_Cc]) when C >= C1, C =< C2 -> true;
+in_char_class(C, [C|_Cc]) -> true;
+in_char_class(C, [_|Cc]) -> in_char_class(C, Cc);
+in_char_class(_C, []) -> false.
+
+%% re_apply_or(Match1, Match2) -> re_app_res().
+%% If we want the best match then choose the longest match, else just
+%% choose one by trying sequentially.
+
+re_apply_or({match,P1,S1}, {match,P2,_S2}) when P1 >= P2 -> {match,P1,S1};
+re_apply_or({match,_P1,_S1}, {match,P2,S2}) -> {match,P2,S2};
+re_apply_or(nomatch, R2) -> R2;
+re_apply_or(R1, nomatch) -> R1.
+
+
+matches(S, RE, St) ->
+ case first_match(RE, S, St) of
+ {St1,0} ->
+ [{St1,0}|matches(string:substr(S, St1+2-St), RE, St1+1)];
+ {St1,L1} ->
+ [{St1,L1}|matches(string:substr(S, St1+L1+1-St), RE, St1+L1)];
+ nomatch ->
+ []
+ end.
+
+sub_match(S, RE, St) ->
+ case first_match(RE, S, St) of
+ {St1,L1} -> [{St1,L1}];
+ nomatch -> []
+ end.
+
+sub_repl([{St,L}|Ss], Rep, S, Pos) ->
+ Rs = sub_repl(Ss, Rep, S, St+L),
+ string:substr(S, Pos, St-Pos) ++
+ sub_repl(Rep, string:substr(S, St, L), Rs);
+sub_repl([], _Rep, S, Pos) ->
+ string:substr(S, Pos).
+
+sub_repl([$&|Rep], M, Rest) -> M ++ sub_repl(Rep, M, Rest);
+sub_repl("\\&" ++ Rep, M, Rest) -> [$&|sub_repl(Rep, M, Rest)];
+sub_repl([C|Rep], M, Rest) -> [C|sub_repl(Rep, M, Rest)];
+sub_repl([], _M, Rest) -> Rest.
+
+split_apply(S, RE, Trim) -> split_apply(S, 1, RE, Trim, []).
+
+split_apply([], _P, _RE, true, []) ->
+ [];
+split_apply([], _P, _RE, _T, Sub) ->
+ [lists:reverse(Sub)];
+split_apply(S, P, RE, T, Sub) ->
+ case re_apply(S, P, RE) of
+ {match,P,_Rest} ->
+ split_apply(tl(S), P+1, RE, T, [hd(S)|Sub]);
+ {match,P1,Rest} ->
+ [lists:reverse(Sub)|split_apply(Rest, P1, RE, T, [])];
+ nomatch ->
+ split_apply(tl(S), P+1, RE, T, [hd(S)|Sub])
+ end.
diff --git a/lib/inets/src/inets_app/inets_service.erl b/lib/inets/src/inets_app/inets_service.erl
index 706915de92..3441d2a2e4 100644
--- a/lib/inets/src/inets_app/inets_service.erl
+++ b/lib/inets/src/inets_app/inets_service.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/inets_app/inets_sup.erl b/lib/inets/src/inets_app/inets_sup.erl
index a48a8db190..d8ae7eff26 100644
--- a/lib/inets/src/inets_app/inets_sup.erl
+++ b/lib/inets/src/inets_app/inets_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/tftp/Makefile b/lib/inets/src/tftp/Makefile
index d5d94e1b78..4eaa959cce 100644
--- a/lib/inets/src/tftp/Makefile
+++ b/lib/inets/src/tftp/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2012. All Rights Reserved.
+# Copyright Ericsson AB 2005-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/tftp/tftp.erl b/lib/inets/src/tftp/tftp.erl
index 45d7852863..c8804ea55f 100644
--- a/lib/inets/src/tftp/tftp.erl
+++ b/lib/inets/src/tftp/tftp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/tftp/tftp.hrl b/lib/inets/src/tftp/tftp.hrl
index 2cea18a7ea..25543e0b9e 100644
--- a/lib/inets/src/tftp/tftp.hrl
+++ b/lib/inets/src/tftp/tftp.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/tftp/tftp_binary.erl b/lib/inets/src/tftp/tftp_binary.erl
index 6981d741c6..09adcfc41f 100644
--- a/lib/inets/src/tftp/tftp_binary.erl
+++ b/lib/inets/src/tftp/tftp_binary.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/tftp/tftp_engine.erl b/lib/inets/src/tftp/tftp_engine.erl
index 22dd2f3336..fb2c9749e5 100644
--- a/lib/inets/src/tftp/tftp_engine.erl
+++ b/lib/inets/src/tftp/tftp_engine.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/tftp/tftp_file.erl b/lib/inets/src/tftp/tftp_file.erl
index 39382d6fd0..7664324808 100644
--- a/lib/inets/src/tftp/tftp_file.erl
+++ b/lib/inets/src/tftp/tftp_file.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/src/tftp/tftp_lib.erl b/lib/inets/src/tftp/tftp_lib.erl
index 01dea97d07..454754f0a3 100644
--- a/lib/inets/src/tftp/tftp_lib.erl
+++ b/lib/inets/src/tftp/tftp_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/Makefile b/lib/inets/test/Makefile
index 67c979bd59..65983c528d 100644
--- a/lib/inets/test/Makefile
+++ b/lib/inets/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2014. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/erl_make_certs.erl b/lib/inets/test/erl_make_certs.erl
index f7666864ff..2db95825bc 100644
--- a/lib/inets/test/erl_make_certs.erl
+++ b/lib/inets/test/erl_make_certs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/ftp_SUITE.erl b/lib/inets/test/ftp_SUITE.erl
index 12c8185187..cc40377ebf 100644
--- a/lib/inets/test/ftp_SUITE.erl
+++ b/lib/inets/test/ftp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/ftp_format_SUITE.erl b/lib/inets/test/ftp_format_SUITE.erl
index 9b71d2944b..cbe12e566b 100644
--- a/lib/inets/test/ftp_format_SUITE.erl
+++ b/lib/inets/test/ftp_format_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/ftp_property_test_SUITE.erl b/lib/inets/test/ftp_property_test_SUITE.erl
index 984fb58f16..b314882296 100644
--- a/lib/inets/test/ftp_property_test_SUITE.erl
+++ b/lib/inets/test/ftp_property_test_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/ftp_suite_lib.erl b/lib/inets/test/ftp_suite_lib.erl
index f15fa2fa8d..71985df877 100644
--- a/lib/inets/test/ftp_suite_lib.erl
+++ b/lib/inets/test/ftp_suite_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl
index 93b96e101f..f9b3aa5b59 100644
--- a/lib/inets/test/httpc_SUITE.erl
+++ b/lib/inets/test/httpc_SUITE.erl
@@ -67,6 +67,7 @@ real_requests()->
head,
get,
post,
+ delete,
post_stream,
patch,
async,
@@ -256,6 +257,29 @@ post(Config) when is_list(Config) ->
{ok, {{_,504,_}, [_ | _], []}} =
httpc:request(post, {URL, [{"expect","100-continue"}],
"text/plain", "foobar"}, [], []).
+%%--------------------------------------------------------------------
+delete() ->
+ [{"Test http delete request against local server. We do in this case "
+ "only care about the client side of the the delete. The server "
+ "script will not actually use the delete data."}].
+delete(Config) when is_list(Config) ->
+ CGI = case test_server:os_type() of
+ {win32, _} ->
+ "/cgi-bin/cgi_echo.exe";
+ _ ->
+ "/cgi-bin/cgi_echo"
+ end,
+
+ URL = url(group_name(Config), CGI, Config),
+ Body = lists:duplicate(100, "1"),
+
+ {ok, {{_,200,_}, [_ | _], [_ | _]}} =
+ httpc:request(delete, {URL, [{"expect","100-continue"}],
+ "text/plain", Body}, [], []),
+
+ {ok, {{_,504,_}, [_ | _], []}} =
+ httpc:request(delete, {URL, [{"expect","100-continue"}],
+ "text/plain", "foobar"}, [], []).
%%--------------------------------------------------------------------
patch() ->
diff --git a/lib/inets/test/httpc_cookie_SUITE.erl b/lib/inets/test/httpc_cookie_SUITE.erl
index 2efca9a5c8..0eca3edae2 100644
--- a/lib/inets/test/httpc_cookie_SUITE.erl
+++ b/lib/inets/test/httpc_cookie_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/httpc_proxy_SUITE.erl b/lib/inets/test/httpc_proxy_SUITE.erl
index 6d7af4ea5d..2f6f0bc26f 100644
--- a/lib/inets/test/httpc_proxy_SUITE.erl
+++ b/lib/inets/test/httpc_proxy_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/httpc_proxy_SUITE_data/apache2/apache2.conf b/lib/inets/test/httpc_proxy_SUITE_data/apache2/apache2.conf
index 03f80aaf6d..b139c4ca51 100644
--- a/lib/inets/test/httpc_proxy_SUITE_data/apache2/apache2.conf
+++ b/lib/inets/test/httpc_proxy_SUITE_data/apache2/apache2.conf
@@ -2,7 +2,7 @@
##
## %CopyrightBegin%
##
-## Copyright Ericsson AB 2012. All Rights Reserved.
+## Copyright Ericsson AB 2012-2016. All Rights Reserved.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/httpc_proxy_SUITE_data/server_proxy.sh b/lib/inets/test/httpc_proxy_SUITE_data/server_proxy.sh
index 473024ae63..e8b690a4a1 100755
--- a/lib/inets/test/httpc_proxy_SUITE_data/server_proxy.sh
+++ b/lib/inets/test/httpc_proxy_SUITE_data/server_proxy.sh
@@ -5,7 +5,7 @@
##
## %CopyrightBegin%
##
-## Copyright Ericsson AB 2012. All Rights Reserved.
+## Copyright Ericsson AB 2012-2016. All Rights Reserved.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/httpd_1_0.erl b/lib/inets/test/httpd_1_0.erl
index 7535b148ae..f61dc3c3fd 100644
--- a/lib/inets/test/httpd_1_0.erl
+++ b/lib/inets/test/httpd_1_0.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/httpd_1_1.erl b/lib/inets/test/httpd_1_1.erl
index d3a1e3672a..3755ed117b 100644
--- a/lib/inets/test/httpd_1_1.erl
+++ b/lib/inets/test/httpd_1_1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -233,14 +233,6 @@ trace(Type, Port, Host, Node)->
"Max-Forwards:2\r\n\r\n",
[{statuscode, 200}]).
head(Type, Port, Host, Node)->
- %% mod_include
- ok = httpd_test_lib:verify_request(Type, Host, Port, Node,
- "HEAD /fsize.shtml HTTP/1.0\r\n\r\n",
- [{statuscode, 200},
- {version, "HTTP/1.0"}]),
- ok = httpd_test_lib:verify_request(Type, Host, Port, Node,
- "HEAD /fsize.shtml HTTP/1.1\r\nhost:" ++
- Host ++ "\r\n\r\n", [{statuscode, 200}]),
%% mod_esi
ok = httpd_test_lib:verify_request(Type, Host, Port, Node,
"HEAD /cgi-bin/erl/httpd_example/newformat"
diff --git a/lib/inets/test/httpd_SUITE.erl b/lib/inets/test/httpd_SUITE.erl
index 1d8a603981..93520c1cb4 100644
--- a/lib/inets/test/httpd_SUITE.erl
+++ b/lib/inets/test/httpd_SUITE.erl
@@ -755,7 +755,11 @@ esi(Config) when is_list(Config) ->
%% Check "ErlScriptNoCache" directive (default: false)
ok = http_status("GET /cgi-bin/erl/httpd_example:get ",
Config, [{statuscode, 200},
- {no_header, "cache-control"}]).
+ {no_header, "cache-control"}]),
+ ok = http_status("GET /cgi-bin/erl/httpd_example:peer ",
+ Config, [{statuscode, 200},
+ {header, "peer-cert-exist", peer(Config)}]).
+
%%-------------------------------------------------------------------------
mod_esi_chunk_timeout(Config) when is_list(Config) ->
ok = httpd_1_1:mod_esi_chunk_timeout(?config(type, Config),
@@ -2065,3 +2069,11 @@ response_default_headers() ->
{"X-Frame-Options", "SAMEORIGIN"},
%% Override built-in default
{"Date", "Override-date"}].
+
+peer(Config) ->
+ case proplists:get_value(type, Config) of
+ ssl ->
+ "true";
+ _ ->
+ "false"
+ end. \ No newline at end of file
diff --git a/lib/inets/test/httpd_basic_SUITE.erl b/lib/inets/test/httpd_basic_SUITE.erl
index db7f3c525d..352ff3b1ae 100644
--- a/lib/inets/test/httpd_basic_SUITE.erl
+++ b/lib/inets/test/httpd_basic_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/httpd_block.erl b/lib/inets/test/httpd_block.erl
index ca2ab517fb..44f6f644ad 100644
--- a/lib/inets/test/httpd_block.erl
+++ b/lib/inets/test/httpd_block.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/httpd_load.erl b/lib/inets/test/httpd_load.erl
index fef693d818..37ebc4fc90 100644
--- a/lib/inets/test/httpd_load.erl
+++ b/lib/inets/test/httpd_load.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/httpd_mod.erl b/lib/inets/test/httpd_mod.erl
index 016989a22e..7a1250cb29 100644
--- a/lib/inets/test/httpd_mod.erl
+++ b/lib/inets/test/httpd_mod.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/httpd_mod_SUITE.erl b/lib/inets/test/httpd_mod_SUITE.erl
index 89b9e0a303..5ec4e0856d 100644
--- a/lib/inets/test/httpd_mod_SUITE.erl
+++ b/lib/inets/test/httpd_mod_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/httpd_poll.erl b/lib/inets/test/httpd_poll.erl
index 4a570fb512..f86e3a979b 100644
--- a/lib/inets/test/httpd_poll.erl
+++ b/lib/inets/test/httpd_poll.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/httpd_test_data/server_root/Makefile b/lib/inets/test/httpd_test_data/server_root/Makefile
index 4f23295401..ed4d63a3bb 100644
--- a/lib/inets/test/httpd_test_data/server_root/Makefile
+++ b/lib/inets/test/httpd_test_data/server_root/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2010. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/httpd_test_data/server_root/conf/8080.conf b/lib/inets/test/httpd_test_data/server_root/conf/8080.conf
index 48e66f0114..7b1b4a15b2 100644
--- a/lib/inets/test/httpd_test_data/server_root/conf/8080.conf
+++ b/lib/inets/test/httpd_test_data/server_root/conf/8080.conf
@@ -1,7 +1,7 @@
Port 8080
#ServerName your.server.net
SocketType ip_comm
-Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_include mod_dir mod_get mod_head mod_log mod_disk_log
+Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_dir mod_get mod_head mod_log mod_disk_log
ServerAdmin [email protected]
ServerRoot /var/tmp/server_root
ErrorLog logs/error_log_8080
diff --git a/lib/inets/test/httpd_test_data/server_root/conf/8888.conf b/lib/inets/test/httpd_test_data/server_root/conf/8888.conf
index 79bb7fcca4..042779fcd0 100644
--- a/lib/inets/test/httpd_test_data/server_root/conf/8888.conf
+++ b/lib/inets/test/httpd_test_data/server_root/conf/8888.conf
@@ -1,7 +1,7 @@
Port 8888
#ServerName your.server.net
SocketType ip_comm
-Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_include mod_dir mod_get mod_head mod_log mod_disk_log
+Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_dir mod_get mod_head mod_log mod_disk_log
ServerAdmin [email protected]
ServerRoot /var/tmp/server_root
ErrorLog logs/error_log_8888
diff --git a/lib/inets/test/httpd_test_data/server_root/conf/httpd.conf b/lib/inets/test/httpd_test_data/server_root/conf/httpd.conf
index 87c2973e5a..3f9fde03b5 100644
--- a/lib/inets/test/httpd_test_data/server_root/conf/httpd.conf
+++ b/lib/inets/test/httpd_test_data/server_root/conf/httpd.conf
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -64,7 +64,7 @@ SocketType ip_comm
# WARNING! Do not tamper with this directive unless you are familiar with
# EWSAPI.
-Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_responsecontrol mod_trace mod_range mod_head mod_include mod_dir mod_get mod_log mod_disk_log
+Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_responsecontrol mod_trace mod_range mod_head mod_dir mod_get mod_log mod_disk_log
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.
diff --git a/lib/inets/test/httpd_test_data/server_root/conf/ssl.conf b/lib/inets/test/httpd_test_data/server_root/conf/ssl.conf
index 8b8c57a98b..de49ceafd0 100644
--- a/lib/inets/test/httpd_test_data/server_root/conf/ssl.conf
+++ b/lib/inets/test/httpd_test_data/server_root/conf/ssl.conf
@@ -1,7 +1,7 @@
Port 8088
#ServerName your.server.net
SocketType ssl
-Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_include mod_dir mod_get mod_head mod_log mod_disk_log
+Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_dir mod_get mod_head mod_log mod_disk_log
ServerAdmin [email protected]
ServerRoot /var/tmp/server_root
ErrorLog logs/error_log_8088
diff --git a/lib/inets/test/httpd_test_lib.erl b/lib/inets/test/httpd_test_lib.erl
index 71e201f826..1cecd2642c 100644
--- a/lib/inets/test/httpd_test_lib.erl
+++ b/lib/inets/test/httpd_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/httpd_time_test.erl b/lib/inets/test/httpd_time_test.erl
index 1b4d74b28e..fddc0003cd 100644
--- a/lib/inets/test/httpd_time_test.erl
+++ b/lib/inets/test/httpd_time_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/inets_appup_test.erl b/lib/inets/test/inets_appup_test.erl
index 999989b8b4..b76cd59141 100644
--- a/lib/inets/test/inets_appup_test.erl
+++ b/lib/inets/test/inets_appup_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/inets_socketwrap_SUITE_data/setuid_socket_wrap.c b/lib/inets/test/inets_socketwrap_SUITE_data/setuid_socket_wrap.c
index b28f6b1c08..018d398956 100644
--- a/lib/inets/test/inets_socketwrap_SUITE_data/setuid_socket_wrap.c
+++ b/lib/inets/test/inets_socketwrap_SUITE_data/setuid_socket_wrap.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/inets_sup_SUITE.erl b/lib/inets/test/inets_sup_SUITE.erl
index 33ae3bd3f2..9836cd76e0 100644
--- a/lib/inets/test/inets_sup_SUITE.erl
+++ b/lib/inets/test/inets_sup_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/inets_test_lib.hrl b/lib/inets/test/inets_test_lib.hrl
index b2989be08d..a36ab0b1cf 100644
--- a/lib/inets/test/inets_test_lib.hrl
+++ b/lib/inets/test/inets_test_lib.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/old_httpd_SUITE.erl b/lib/inets/test/old_httpd_SUITE.erl
index f972f0f435..9902c1459e 100644
--- a/lib/inets/test/old_httpd_SUITE.erl
+++ b/lib/inets/test/old_httpd_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/old_httpd_SUITE_data/server_root/Makefile b/lib/inets/test/old_httpd_SUITE_data/server_root/Makefile
index 4f23295401..ed4d63a3bb 100644
--- a/lib/inets/test/old_httpd_SUITE_data/server_root/Makefile
+++ b/lib/inets/test/old_httpd_SUITE_data/server_root/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2010. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/old_httpd_SUITE_data/server_root/conf/8080.conf b/lib/inets/test/old_httpd_SUITE_data/server_root/conf/8080.conf
index 48e66f0114..7b1b4a15b2 100644
--- a/lib/inets/test/old_httpd_SUITE_data/server_root/conf/8080.conf
+++ b/lib/inets/test/old_httpd_SUITE_data/server_root/conf/8080.conf
@@ -1,7 +1,7 @@
Port 8080
#ServerName your.server.net
SocketType ip_comm
-Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_include mod_dir mod_get mod_head mod_log mod_disk_log
+Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_dir mod_get mod_head mod_log mod_disk_log
ServerAdmin [email protected]
ServerRoot /var/tmp/server_root
ErrorLog logs/error_log_8080
diff --git a/lib/inets/test/old_httpd_SUITE_data/server_root/conf/8888.conf b/lib/inets/test/old_httpd_SUITE_data/server_root/conf/8888.conf
index 79bb7fcca4..042779fcd0 100644
--- a/lib/inets/test/old_httpd_SUITE_data/server_root/conf/8888.conf
+++ b/lib/inets/test/old_httpd_SUITE_data/server_root/conf/8888.conf
@@ -1,7 +1,7 @@
Port 8888
#ServerName your.server.net
SocketType ip_comm
-Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_include mod_dir mod_get mod_head mod_log mod_disk_log
+Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_dir mod_get mod_head mod_log mod_disk_log
ServerAdmin [email protected]
ServerRoot /var/tmp/server_root
ErrorLog logs/error_log_8888
diff --git a/lib/inets/test/old_httpd_SUITE_data/server_root/conf/httpd.conf b/lib/inets/test/old_httpd_SUITE_data/server_root/conf/httpd.conf
index 87c2973e5a..3f9fde03b5 100644
--- a/lib/inets/test/old_httpd_SUITE_data/server_root/conf/httpd.conf
+++ b/lib/inets/test/old_httpd_SUITE_data/server_root/conf/httpd.conf
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -64,7 +64,7 @@ SocketType ip_comm
# WARNING! Do not tamper with this directive unless you are familiar with
# EWSAPI.
-Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_responsecontrol mod_trace mod_range mod_head mod_include mod_dir mod_get mod_log mod_disk_log
+Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_responsecontrol mod_trace mod_range mod_head mod_dir mod_get mod_log mod_disk_log
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.
diff --git a/lib/inets/test/old_httpd_SUITE_data/server_root/conf/ssl.conf b/lib/inets/test/old_httpd_SUITE_data/server_root/conf/ssl.conf
index 8b8c57a98b..de49ceafd0 100644
--- a/lib/inets/test/old_httpd_SUITE_data/server_root/conf/ssl.conf
+++ b/lib/inets/test/old_httpd_SUITE_data/server_root/conf/ssl.conf
@@ -1,7 +1,7 @@
Port 8088
#ServerName your.server.net
SocketType ssl
-Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_include mod_dir mod_get mod_head mod_log mod_disk_log
+Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_dir mod_get mod_head mod_log mod_disk_log
ServerAdmin [email protected]
ServerRoot /var/tmp/server_root
ErrorLog logs/error_log_8088
diff --git a/lib/inets/test/property_test/ftp_simple_client_server.erl b/lib/inets/test/property_test/ftp_simple_client_server.erl
index 8b6aff3c56..c98d87b514 100644
--- a/lib/inets/test/property_test/ftp_simple_client_server.erl
+++ b/lib/inets/test/property_test/ftp_simple_client_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/tftp_SUITE.erl b/lib/inets/test/tftp_SUITE.erl
index 497a50e654..09049e36af 100644
--- a/lib/inets/test/tftp_SUITE.erl
+++ b/lib/inets/test/tftp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/tftp_test_lib.erl b/lib/inets/test/tftp_test_lib.erl
index 406a49e863..f07795324f 100644
--- a/lib/inets/test/tftp_test_lib.erl
+++ b/lib/inets/test/tftp_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/tftp_test_lib.hrl b/lib/inets/test/tftp_test_lib.hrl
index 4e50f05d04..e7a5a37d2c 100644
--- a/lib/inets/test/tftp_test_lib.hrl
+++ b/lib/inets/test/tftp_test_lib.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/test/uri_SUITE.erl b/lib/inets/test/uri_SUITE.erl
index 2642b8fd4e..b26c645821 100644
--- a/lib/inets/test/uri_SUITE.erl
+++ b/lib/inets/test/uri_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/inets/vsn.mk b/lib/inets/vsn.mk
index 3d25b328af..ef985f7c4e 100644
--- a/lib/inets/vsn.mk
+++ b/lib/inets/vsn.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2015. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,7 +18,6 @@
#
# %CopyrightEnd%
-APPLICATION = inets
-INETS_VSN = 6.2
+INETS_VSN = 6.3
PRE_VSN =
APP_VSN = "$(APPLICATION)-$(INETS_VSN)$(PRE_VSN)"
diff --git a/lib/jinterface/Makefile b/lib/jinterface/Makefile
index 9cb993c87e..9cf5f3e94c 100644
--- a/lib/jinterface/Makefile
+++ b/lib/jinterface/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2009. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/doc/src/Makefile b/lib/jinterface/doc/src/Makefile
index ef5a5fa657..cd1e61a795 100644
--- a/lib/jinterface/doc/src/Makefile
+++ b/lib/jinterface/doc/src/Makefile
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/doc/src/book.xml b/lib/jinterface/doc/src/book.xml
index 954ff3944b..4809995453 100644
--- a/lib/jinterface/doc/src/book.xml
+++ b/lib/jinterface/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/jinterface/doc/src/index.html.src b/lib/jinterface/doc/src/index.html.src
index b9b4555636..9276c5f89a 100644
--- a/lib/jinterface/doc/src/index.html.src
+++ b/lib/jinterface/doc/src/index.html.src
@@ -4,7 +4,7 @@
<!--
%CopyrightBegin%
- Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ Copyright Ericsson AB 2000-2016. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/doc/src/jinterface.xml b/lib/jinterface/doc/src/jinterface.xml
index 513ce36248..32de29eaee 100644
--- a/lib/jinterface/doc/src/jinterface.xml
+++ b/lib/jinterface/doc/src/jinterface.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/jinterface/doc/src/jinterface_users_guide.xml b/lib/jinterface/doc/src/jinterface_users_guide.xml
index 0be0f87b92..56f88124bf 100644
--- a/lib/jinterface/doc/src/jinterface_users_guide.xml
+++ b/lib/jinterface/doc/src/jinterface_users_guide.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/jinterface/doc/src/notes.xml b/lib/jinterface/doc/src/notes.xml
index e66bcda0c1..c1b7c027ed 100644
--- a/lib/jinterface/doc/src/notes.xml
+++ b/lib/jinterface/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/jinterface/doc/src/notes_history.xml b/lib/jinterface/doc/src/notes_history.xml
index 31313e2e34..00fb5047c9 100644
--- a/lib/jinterface/doc/src/notes_history.xml
+++ b/lib/jinterface/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/jinterface/doc/src/part.xml b/lib/jinterface/doc/src/part.xml
index 8459bf5131..3b8eca297d 100644
--- a/lib/jinterface/doc/src/part.xml
+++ b/lib/jinterface/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/jinterface/doc/src/part_notes.xml b/lib/jinterface/doc/src/part_notes.xml
index 19047603c7..de6dd7d162 100644
--- a/lib/jinterface/doc/src/part_notes.xml
+++ b/lib/jinterface/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/jinterface/doc/src/part_notes_history.xml b/lib/jinterface/doc/src/part_notes_history.xml
index 2d058ff3ba..94bb996db5 100644
--- a/lib/jinterface/doc/src/part_notes_history.xml
+++ b/lib/jinterface/doc/src/part_notes_history.xml
@@ -4,7 +4,7 @@
<part>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/jinterface/doc/src/ref_man.xml b/lib/jinterface/doc/src/ref_man.xml
index 738eb1943d..f482466a8b 100644
--- a/lib/jinterface/doc/src/ref_man.xml
+++ b/lib/jinterface/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/jinterface/java_src/Makefile b/lib/jinterface/java_src/Makefile
index bb6844ead8..ab44ca2804 100644
--- a/lib/jinterface/java_src/Makefile
+++ b/lib/jinterface/java_src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2013. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java
index e84a4296b5..7891871e76 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractNode.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractNode.java
index d7ba88288f..222330654a 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractNode.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractNode.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -95,6 +95,7 @@ public class AbstractNode implements OtpTransportFactory {
static final int dFlagUnicodeIo = 0x1000;
static final int dFlagUtf8Atoms = 0x10000;
static final int dFlagMapTag = 0x20000;
+ static final int dFlagBigCreation = 0x40000;
int ntype = NTYPE_R6;
int proto = 0; // tcp/ip
@@ -103,7 +104,8 @@ public class AbstractNode implements OtpTransportFactory {
int creation = 0;
int flags = dFlagExtendedReferences | dFlagExtendedPidsPorts
| dFlagBitBinaries | dFlagNewFloats | dFlagFunTags
- | dflagNewFunTags | dFlagUtf8Atoms | dFlagMapTag;
+ | dflagNewFunTags | dFlagUtf8Atoms | dFlagMapTag
+ | dFlagBigCreation;
/* initialize hostname and default cookie */
static {
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/GenericQueue.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/GenericQueue.java
index 193df527d5..e5004daa88 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/GenericQueue.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/GenericQueue.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/Link.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/Link.java
index a5ac2bb663..18aa825759 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/Link.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/Link.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/Links.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/Links.java
index 3117b11149..5f1bd40e76 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/Links.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/Links.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/Makefile b/lib/jinterface/java_src/com/ericsson/otp/erlang/Makefile
index 1c8364e951..e55cfa62ea 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/Makefile
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/Makefile
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpAuthException.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpAuthException.java
index d0fdd9569e..008d749da2 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpAuthException.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpAuthException.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpConnection.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpConnection.java
index 1a4627c62b..eb3eaa1f15 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpConnection.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpConnection.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpCookedConnection.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpCookedConnection.java
index de9569aa27..011709beab 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpCookedConnection.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpCookedConnection.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpEpmd.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpEpmd.java
index 82a701559d..363fdb950a 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpEpmd.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpEpmd.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangAtom.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangAtom.java
index 4fbd580ff5..d73bad5e4f 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangAtom.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangAtom.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangBinary.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangBinary.java
index fa460d7f9a..4b32352e50 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangBinary.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangBinary.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangBitstr.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangBitstr.java
index ecf07c3cf0..5952e72c5a 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangBitstr.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangBitstr.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2007-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangBoolean.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangBoolean.java
index 50ada048c2..0ae0995f00 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangBoolean.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangBoolean.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangByte.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangByte.java
index ae4ecfae23..0ebc837989 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangByte.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangByte.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangChar.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangChar.java
index 7f22918978..599726ee69 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangChar.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangChar.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangDecodeException.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangDecodeException.java
index 850d43b35a..38a4101864 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangDecodeException.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangDecodeException.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangDouble.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangDouble.java
index 3087ae1dbb..5084848562 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangDouble.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangDouble.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangException.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangException.java
index 7e80385308..094acb731f 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangException.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangException.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangExit.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangExit.java
index 6f31cc8ebd..87e1e64a48 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangExit.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangExit.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangExternalFun.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangExternalFun.java
index d4564293c6..24fee305b1 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangExternalFun.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangExternalFun.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangFloat.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangFloat.java
index d552d51cd7..8a93905a1f 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangFloat.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangFloat.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangFun.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangFun.java
index c8c8d2221a..78929fab66 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangFun.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangFun.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangInt.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangInt.java
index 48d8640a73..2a5e5b9bc3 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangInt.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangInt.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java
index 8afb118ff2..91d222aa84 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangLong.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangLong.java
index 4bcae63519..a2b4e30e18 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangLong.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangLong.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangMap.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangMap.java
index 30126db3fd..caac8c953a 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangMap.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangMap.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangObject.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangObject.java
index 68e438cd27..981a7f8729 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangObject.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangObject.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangPid.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangPid.java
index 20b7ff6a7f..9cbd735751 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangPid.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangPid.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@ public class OtpErlangPid extends OtpErlangObject implements Comparable<Object>
// don't change this!
private static final long serialVersionUID = 1664394142301803659L;
+ private final int tag;
private final String node;
private final int id;
private final int serial;
@@ -44,6 +45,7 @@ public class OtpErlangPid extends OtpErlangObject implements Comparable<Object>
public OtpErlangPid(final OtpLocalNode self) {
final OtpErlangPid p = self.createPid();
+ tag = p.tag;
id = p.id;
serial = p.serial;
creation = p.creation;
@@ -65,6 +67,7 @@ public class OtpErlangPid extends OtpErlangObject implements Comparable<Object>
throws OtpErlangDecodeException {
final OtpErlangPid p = buf.read_pid();
+ tag = p.tag;
node = p.node();
id = p.id();
serial = p.serial();
@@ -85,15 +88,52 @@ public class OtpErlangPid extends OtpErlangObject implements Comparable<Object>
* used.
*
* @param creation
- * yet another arbitrary number. Only the low order 2 bits will
+ * yet another arbitrary number. Ony the low order 2 bits will
* be used.
*/
public OtpErlangPid(final String node, final int id, final int serial,
- final int creation) {
- this.node = node;
- this.id = id & 0x7fff; // 15 bits
- this.serial = serial & 0x1fff; // 13 bits
- this.creation = creation & 0x03; // 2 bits
+ final int creation) {
+ this(OtpExternal.pidTag, node, id, serial, creation);
+ }
+
+ /**
+ * Create an Erlang pid from its components.
+ *
+ * @param tag
+ * the external format to be compliant with
+ * OtpExternal.pidTag where only a subset of the bits are significant (see other constructor).
+ * OtpExternal.newPidTag where all 32 bits of id,serial and creation are significant.
+ * newPidTag can only be decoded by OTP-19 and newer.
+ * @param node
+ * the nodename.
+ *
+ * @param id
+ * an arbitrary number.
+ *
+ * @param serial
+ * another arbitrary number.
+ *
+ * @param creation
+ * yet another arbitrary number.
+ */
+ protected OtpErlangPid(final int tag, final String node, final int id,
+ final int serial, final int creation) {
+ this.tag = tag;
+ this.node = node;
+ if (tag == OtpExternal.pidTag) {
+ this.id = id & 0x7fff; // 15 bits
+ this.serial = serial & 0x1fff; // 13 bits
+ this.creation = creation & 0x03; // 2 bits
+ }
+ else { // allow all 32 bits for newPidTag
+ this.id = id;
+ this.serial = serial;
+ this.creation = creation;
+ }
+ }
+
+ protected int tag() {
+ return tag;
}
/**
@@ -151,7 +191,7 @@ public class OtpErlangPid extends OtpErlangObject implements Comparable<Object>
*/
@Override
public void encode(final OtpOutputStream buf) {
- buf.write_pid(node, id, serial, creation);
+ buf.write_pid(this);
}
/**
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangPort.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangPort.java
index a6198d56cc..79b5d2736c 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangPort.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangPort.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@ public class OtpErlangPort extends OtpErlangObject {
// don't change this!
private static final long serialVersionUID = 4037115468007644704L;
+ private final int tag;
private final String node;
private final int id;
private final int creation;
@@ -42,6 +43,7 @@ public class OtpErlangPort extends OtpErlangObject {
private OtpErlangPort(final OtpSelf self) {
final OtpErlangPort p = self.createPort();
+ tag = p.tag;
id = p.id;
creation = p.creation;
node = p.node;
@@ -62,6 +64,7 @@ public class OtpErlangPort extends OtpErlangObject {
throws OtpErlangDecodeException {
final OtpErlangPort p = buf.read_port();
+ tag = p.tag;
node = p.node();
id = p.id();
creation = p.creation();
@@ -77,13 +80,45 @@ public class OtpErlangPort extends OtpErlangObject {
* an arbitrary number. Only the low order 28 bits will be used.
*
* @param creation
- * another arbitrary number. Only the low order 2 bits will be
- * used.
+ * another arbitrary number. Only the low order 2 bits will be used.
*/
public OtpErlangPort(final String node, final int id, final int creation) {
- this.node = node;
- this.id = id & 0xfffffff; // 28 bits
- this.creation = creation & 0x03; // 2 bits
+ this(OtpExternal.portTag, node, id, creation);
+ }
+
+ /**
+ * Create an Erlang port from its components.
+ *
+ * @param tag
+ * the external format to be compliant with.
+ * OtpExternal.portTag where only a subset of the bits are used (see other constructor)
+ * OtpExternal.newPortTag where all 32 bits of id and creation are significant.
+ * newPortTag can only be decoded by OTP-19 and newer.
+ * @param node
+ * the nodename.
+ *
+ * @param id
+ * an arbitrary number. Only the low order 28 bits will be used.
+ *
+ * @param creation
+ * another arbitrary number.
+ */
+ public OtpErlangPort(final int tag, final String node, final int id,
+ final int creation) {
+ this.tag = tag;
+ this.node = node;
+ if (tag == OtpExternal.portTag) {
+ this.id = id & 0xfffffff; // 28 bits
+ this.creation = creation & 0x3; // 2 bits
+ }
+ else {
+ this.id = id;
+ this.creation = creation;
+ }
+ }
+
+ protected int tag() {
+ return tag;
}
/**
@@ -132,7 +167,7 @@ public class OtpErlangPort extends OtpErlangObject {
*/
@Override
public void encode(final OtpOutputStream buf) {
- buf.write_port(node, id, creation);
+ buf.write_port(this);
}
/**
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangRangeException.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangRangeException.java
index cbddea9f24..ce92c927d0 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangRangeException.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangRangeException.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangRef.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangRef.java
index 8b57e7265b..2165397013 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangRef.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangRef.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,11 +28,13 @@ public class OtpErlangRef extends OtpErlangObject {
// don't change this!
private static final long serialVersionUID = -7022666480768586521L;
+ private final int tag;
private final String node;
private final int creation;
// old style refs have one 18-bit id
// r6 "new" refs have array of ids, first one is only 18 bits however
+ // 19 "newer" refs have full 32-bits for creation and for ids[0]
private int ids[] = null;
/**
@@ -47,6 +49,7 @@ public class OtpErlangRef extends OtpErlangObject {
public OtpErlangRef(final OtpLocalNode self) {
final OtpErlangRef r = self.createRef();
+ tag = r.tag;
ids = r.ids;
creation = r.creation;
node = r.node;
@@ -67,6 +70,7 @@ public class OtpErlangRef extends OtpErlangObject {
throws OtpErlangDecodeException {
final OtpErlangRef r = buf.read_ref();
+ tag = r.tag;
node = r.node();
creation = r.creation();
@@ -83,10 +87,10 @@ public class OtpErlangRef extends OtpErlangObject {
* an arbitrary number. Only the low order 18 bits will be used.
*
* @param creation
- * another arbitrary number. Only the low order 2 bits will be
- * used.
+ * another arbitrary number.
*/
public OtpErlangRef(final String node, final int id, final int creation) {
+ this.tag = OtpExternal.newRefTag;
this.node = node;
ids = new int[1];
ids[0] = id & 0x3ffff; // 18 bits
@@ -110,10 +114,34 @@ public class OtpErlangRef extends OtpErlangObject {
* used.
*/
public OtpErlangRef(final String node, final int[] ids, final int creation) {
+ this(OtpExternal.newRefTag, node, ids, creation);
+ }
+
+ /**
+ * Create a new(er) style Erlang ref from its components.
+ *
+ * @param tag
+ * the external format to be compliant with.
+ * OtpExternal.newRefTag where only a subset of the bits are used (see other constructor)
+ * OtpExternal.newerRefTag where all bits of ids and creation are used.
+ * newerPortTag can only be decoded by OTP-19 and newer.
+ *
+ * @param node
+ * the nodename.
+ *
+ * @param ids
+ * an array of arbitrary numbers. At most three numbers
+ * will be read from the array.
+ *
+ * @param creation
+ * another arbitrary number.
+ */
+ public OtpErlangRef(final int tag, final String node, final int[] ids,
+ final int creation) {
+ this.tag = tag;
this.node = node;
- this.creation = creation & 0x03; // 2 bits
- // use at most 82 bits (18 + 32 + 32)
+ // use at most 3 words
int len = ids.length;
this.ids = new int[3];
this.ids[0] = 0;
@@ -124,7 +152,17 @@ public class OtpErlangRef extends OtpErlangObject {
len = 3;
}
System.arraycopy(ids, 0, this.ids, 0, len);
- this.ids[0] &= 0x3ffff; // only 18 significant bits in first number
+ if (tag == OtpExternal.newRefTag) {
+ this.creation = creation & 0x3;
+ this.ids[0] &= 0x3ffff; // only 18 significant bits in first number
+ }
+ else {
+ this.creation = creation;
+ }
+ }
+
+ protected int tag() {
+ return tag;
}
/**
@@ -202,7 +240,7 @@ public class OtpErlangRef extends OtpErlangObject {
*/
@Override
public void encode(final OtpOutputStream buf) {
- buf.write_ref(node, ids, creation);
+ buf.write_ref(this);
}
/**
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangShort.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangShort.java
index fcd417b4a7..9450605690 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangShort.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangShort.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangString.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangString.java
index dab83f98a2..63307bb2eb 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangString.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangString.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangTuple.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangTuple.java
index 477f5dff83..5d88cfa4dc 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangTuple.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangTuple.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangUInt.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangUInt.java
index ea1060121a..93d4e475ed 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangUInt.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangUInt.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangUShort.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangUShort.java
index b1391fddf9..337ed409d4 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangUShort.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangUShort.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpException.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpException.java
index 6f44cecd32..660af1c874 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpException.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpException.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpExternal.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpExternal.java
index 4645f25590..da8ac3612f 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpExternal.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpExternal.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -46,9 +46,11 @@ public class OtpExternal {
/** The tag used for ports */
public static final int portTag = 102;
+ public static final int newPortTag = 89;
/** The tag used for PIDs */
public static final int pidTag = 103;
+ public static final int newPidTag = 88;
/** The tag used for small tuples */
public static final int smallTupleTag = 104;
@@ -85,6 +87,7 @@ public class OtpExternal {
/** The tag used for new style references */
public static final int newRefTag = 114;
+ public static final int newerRefTag = 90;
/** The tag used for maps */
public static final int mapTag = 116;
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java
index fa0815fbf0..ded8f6e1e5 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -954,18 +954,23 @@ public class OtpInputStream extends ByteArrayInputStream {
tag = read1skip_version();
- if (tag != OtpExternal.pidTag) {
+ if (tag != OtpExternal.pidTag &&
+ tag != OtpExternal.newPidTag) {
throw new OtpErlangDecodeException(
"Wrong tag encountered, expected " + OtpExternal.pidTag
+ + " or " + OtpExternal.newPidTag
+ ", got " + tag);
}
node = read_atom();
- id = read4BE() & 0x7fff; // 15 bits
- serial = read4BE() & 0x1fff; // 13 bits
- creation = read1() & 0x03; // 2 bits
-
- return new OtpErlangPid(node, id, serial, creation);
+ id = read4BE();
+ serial = read4BE();
+ if (tag == OtpExternal.pidTag)
+ creation = read1();
+ else
+ creation = read4BE();
+
+ return new OtpErlangPid(tag, node, id, serial, creation);
}
/**
@@ -984,17 +989,22 @@ public class OtpInputStream extends ByteArrayInputStream {
tag = read1skip_version();
- if (tag != OtpExternal.portTag) {
+ if (tag != OtpExternal.portTag &&
+ tag != OtpExternal.newPortTag) {
throw new OtpErlangDecodeException(
"Wrong tag encountered, expected " + OtpExternal.portTag
+ + " or " + OtpExternal.newPortTag
+ ", got " + tag);
}
node = read_atom();
- id = read4BE() & 0xfffffff; // 28 bits
- creation = read1() & 0x03; // 2 bits
+ id = read4BE();
+ if (tag == OtpExternal.portTag)
+ creation = read1();
+ else
+ creation = read4BE();
- return new OtpErlangPort(node, id, creation);
+ return new OtpErlangPort(tag, node, id, creation);
}
/**
@@ -1021,16 +1031,23 @@ public class OtpInputStream extends ByteArrayInputStream {
return new OtpErlangRef(node, id, creation);
case OtpExternal.newRefTag:
+ case OtpExternal.newerRefTag:
final int arity = read2BE();
+ if (arity > 3) {
+ throw new OtpErlangDecodeException(
+ "Ref arity " + arity + " too large ");
+ }
node = read_atom();
- creation = read1() & 0x03; // 2 bits
+ if (tag == OtpExternal.newRefTag)
+ creation = read1();
+ else
+ creation = read4BE();
final int[] ids = new int[arity];
for (int i = 0; i < arity; i++) {
ids[i] = read4BE();
}
- ids[0] &= 0x3ffff; // first id gets truncated to 18 bits
- return new OtpErlangRef(node, ids, creation);
+ return new OtpErlangRef(tag, node, ids, creation);
default:
throw new OtpErlangDecodeException(
@@ -1200,15 +1217,18 @@ public class OtpInputStream extends ByteArrayInputStream {
case OtpExternal.refTag:
case OtpExternal.newRefTag:
+ case OtpExternal.newerRefTag:
return new OtpErlangRef(this);
case OtpExternal.mapTag:
return new OtpErlangMap(this);
case OtpExternal.portTag:
+ case OtpExternal.newPortTag:
return new OtpErlangPort(this);
case OtpExternal.pidTag:
+ case OtpExternal.newPidTag:
return new OtpErlangPid(this);
case OtpExternal.stringTag:
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpLocalNode.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpLocalNode.java
index 3d6b15ad64..6f896aab9f 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpLocalNode.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpLocalNode.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMD5.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMD5.java
index 6d1a04d9f0..45f856f7cb 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMD5.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMD5.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMbox.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMbox.java
index 29119dec5c..70c9e6db4a 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMbox.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMbox.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMsg.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMsg.java
index 9597f2abd6..5bbcf2ab9e 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMsg.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMsg.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpNode.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpNode.java
index b2598924e9..e48e6e8633 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpNode.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpNode.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpNodeStatus.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpNodeStatus.java
index 4c0cb257fe..f3f7bc9511 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpNodeStatus.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpNodeStatus.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java
index 4faae2a157..dca2eb7c51 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -728,14 +728,38 @@ public class OtpOutputStream extends ByteArrayOutputStream {
*/
public void write_pid(final String node, final int id, final int serial,
final int creation) {
- write1(OtpExternal.pidTag);
- write_atom(node);
- write4BE(id & 0x7fff); // 15 bits
- write4BE(serial & 0x1fff); // 13 bits
- write1(creation & 0x3); // 2 bits
+ write1(OtpExternal.pidTag);
+ write_atom(node);
+ write4BE(id & 0x7fff); // 15 bits
+ write4BE(serial & 0x1fff); // 13 bits
+ write1(creation & 0x3); // 2 bits
}
/**
+ * Write an Erlang PID to the stream.
+ *
+ * @param pid
+ * the pid
+ */
+ public void write_pid(OtpErlangPid pid) {
+ write1(pid.tag());
+ write_atom(pid.node());
+ write4BE(pid.id());
+ write4BE(pid.serial());
+ switch (pid.tag()) {
+ case OtpExternal.pidTag:
+ write1(pid.creation());
+ break;
+ case OtpExternal.newPidTag:
+ write4BE(pid.creation());
+ break;
+ default:
+ throw new AssertionError("Invalid pid tag " + pid.tag());
+ }
+ }
+
+
+ /**
* Write an Erlang port to the stream.
*
* @param node
@@ -745,15 +769,36 @@ public class OtpOutputStream extends ByteArrayOutputStream {
* an arbitrary number. Only the low order 28 bits will be used.
*
* @param creation
- * another arbitrary number. Only the low order 2 bits will be
- * used.
- *
+ * another arbitrary number. Only the low order 2 bits will
+ * be used.
*/
public void write_port(final String node, final int id, final int creation) {
- write1(OtpExternal.portTag);
- write_atom(node);
- write4BE(id & 0xfffffff); // 28 bits
- write1(creation & 0x3); // 2 bits
+ write1(OtpExternal.portTag);
+ write_atom(node);
+ write4BE(id & 0xfffffff); // 28 bits
+ write1(creation & 0x3); // 2 bits
+ }
+
+ /**
+ * Write an Erlang port to the stream.
+ *
+ * @param port
+ * the port.
+ */
+ public void write_port(OtpErlangPort port) {
+ write1(port.tag());
+ write_atom(port.node());
+ write4BE(port.id());
+ switch (port.tag()) {
+ case OtpExternal.portTag:
+ write1(port.creation());
+ break;
+ case OtpExternal.newPortTag:
+ write4BE(port.creation());
+ break;
+ default:
+ throw new AssertionError("Invalid port tag " + port.tag());
+ }
}
/**
@@ -766,32 +811,31 @@ public class OtpOutputStream extends ByteArrayOutputStream {
* an arbitrary number. Only the low order 18 bits will be used.
*
* @param creation
- * another arbitrary number. Only the low order 2 bits will be
- * used.
+ * another arbitrary number.
*
*/
public void write_ref(final String node, final int id, final int creation) {
- write1(OtpExternal.refTag);
- write_atom(node);
- write4BE(id & 0x3ffff); // 18 bits
- write1(creation & 0x3); // 2 bits
+ /* Always encode as an extended reference; all
+ participating parties are now expected to be
+ able to decode extended references. */
+ int ids[] = new int[1];
+ ids[0] = id;
+ write_ref(node, ids, creation);
}
/**
- * Write a new style (R6 and later) Erlang ref to the stream.
+ * Write an Erlang ref to the stream.
*
* @param node
* the nodename.
*
* @param ids
* an array of arbitrary numbers. Only the low order 18 bits of
- * the first number will be used. If the array contains only one
- * number, an old style ref will be written instead. At most
- * three numbers will be read from the array.
+ * the first number will be used. At most three numbers
+ * will be read from the array.
*
* @param creation
- * another arbitrary number. Only the low order 2 bits will be
- * used.
+ * another arbitrary number. Only the low order 2 bits will be used.
*
*/
public void write_ref(final String node, final int[] ids, final int creation) {
@@ -800,29 +844,54 @@ public class OtpOutputStream extends ByteArrayOutputStream {
arity = 3; // max 3 words in ref
}
- if (arity == 1) {
- // use old method
- this.write_ref(node, ids[0], creation);
- } else {
- // r6 ref
- write1(OtpExternal.newRefTag);
+ write1(OtpExternal.newRefTag);
- // how many id values
- write2BE(arity);
+ // how many id values
+ write2BE(arity);
- write_atom(node);
+ write_atom(node);
- // note: creation BEFORE id in r6 ref
- write1(creation & 0x3); // 2 bits
+ write1(creation & 0x3); // 2 bits
- // first int gets truncated to 18 bits
- write4BE(ids[0] & 0x3ffff);
+ // first int gets truncated to 18 bits
+ write4BE(ids[0] & 0x3ffff);
- // remaining ones are left as is
- for (int i = 1; i < arity; i++) {
- write4BE(ids[i]);
- }
- }
+ // remaining ones are left as is
+ for (int i = 1; i < arity; i++) {
+ write4BE(ids[i]);
+ }
+ }
+
+ /**
+ * Write an Erlang ref to the stream.
+ *
+ * @param ref
+ * the reference
+ */
+ public void write_ref(OtpErlangRef ref) {
+ int[] ids = ref.ids();
+ int arity = ids.length;
+
+ write1(ref.tag());
+ write2BE(arity);
+ write_atom(ref.node());
+
+ switch (ref.tag()) {
+ case OtpExternal.newRefTag:
+ write1(ref.creation());
+ write4BE(ids[0] & 0x3ffff); // first word gets truncated to 18 bits
+ break;
+ case OtpExternal.newerRefTag:
+ write4BE(ref.creation());
+ write4BE(ids[0]); // full first word
+ break;
+ default:
+ throw new AssertionError("Invalid ref tag " + ref.tag());
+ }
+
+ for (int i = 1; i < arity; i++) {
+ write4BE(ids[i]);
+ }
}
/**
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpPeer.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpPeer.java
index 1f06e2eb9f..e614b03a69 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpPeer.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpPeer.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpSelf.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpSelf.java
index 03154aa785..97f7f037e7 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpSelf.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpSelf.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpServer.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpServer.java
index d4831b948d..d6a143ca6a 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpServer.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpServer.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpSystem.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpSystem.java
index 0ff38d7026..3598423afa 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpSystem.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpSystem.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/java_files b/lib/jinterface/java_src/com/ericsson/otp/erlang/java_files
index a039a75f34..cfabbe6271 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/java_files
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/java_files
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2009. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/jinterface.app.src b/lib/jinterface/java_src/com/ericsson/otp/erlang/jinterface.app.src
index bc8b99f2a1..dea62c3ae1 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/jinterface.app.src
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/jinterface.app.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/jinterface.appup.src b/lib/jinterface/java_src/com/ericsson/otp/erlang/jinterface.appup.src
index eee7be1540..eb9854d22d 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/jinterface.appup.src
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/jinterface.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/package.html b/lib/jinterface/java_src/com/ericsson/otp/erlang/package.html
index 70af29c041..f7b4884851 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/package.html
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/package.html
@@ -3,7 +3,7 @@
%CopyrightBegin%
- Copyright Ericsson AB 2000-2009. All Rights Reserved.
+ Copyright Ericsson AB 2000-2016. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/java_src/pom.xml.src b/lib/jinterface/java_src/pom.xml.src
index cef49b735a..98232db78c 100644
--- a/lib/jinterface/java_src/pom.xml.src
+++ b/lib/jinterface/java_src/pom.xml.src
@@ -7,14 +7,14 @@
<version>%VSN%</version>
<name>jinterface</name>
<description>
- Jinterface Java package contains java classes, which help you integrate programs written in Java with Erlang.
+ 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>
+ </description>
<url>http://erlang.org/</url>
<licenses>
<license>
- <name>ERLANG PUBLIC LICENSE 1.1</name>
- <url>http://www.erlang.org/EPLICENSE</url>
+ <name>Apache License 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
@@ -37,14 +37,16 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
+ <version>3.5.1</version>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.6</source>
+ <target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.10</version>
<executions>
<execution>
<phase>generate-sources</phase>
@@ -59,6 +61,32 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>3.0.0</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.10.3</version>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
<distributionManagement>
@@ -85,7 +113,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
- <version>1.0-alpha-4</version>
+ <version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
diff --git a/lib/jinterface/test/Makefile b/lib/jinterface/test/Makefile
index 40abcd18a0..3eff11e4f7 100644
--- a/lib/jinterface/test/Makefile
+++ b/lib/jinterface/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/jinterface.spec b/lib/jinterface/test/jinterface.spec
index b0d0fa9d8d..7c815d2b5b 100644
--- a/lib/jinterface/test/jinterface.spec
+++ b/lib/jinterface/test/jinterface.spec
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/jinterface_SUITE.erl b/lib/jinterface/test/jinterface_SUITE.erl
index 5c4618dcde..73851f47e0 100644
--- a/lib/jinterface/test/jinterface_SUITE.erl
+++ b/lib/jinterface/test/jinterface_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/jinterface_SUITE_data/BooleanAtom.java b/lib/jinterface/test/jinterface_SUITE_data/BooleanAtom.java
index 0d482f3fd2..849cfb1c72 100644
--- a/lib/jinterface/test/jinterface_SUITE_data/BooleanAtom.java
+++ b/lib/jinterface/test/jinterface_SUITE_data/BooleanAtom.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/jinterface_SUITE_data/FunEquals.java b/lib/jinterface/test/jinterface_SUITE_data/FunEquals.java
index e15ba30a52..3cb408994f 100644
--- a/lib/jinterface/test/jinterface_SUITE_data/FunEquals.java
+++ b/lib/jinterface/test/jinterface_SUITE_data/FunEquals.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/jinterface_SUITE_data/GetNames.java b/lib/jinterface/test/jinterface_SUITE_data/GetNames.java
index 87a27f71ab..a0b396947d 100644
--- a/lib/jinterface/test/jinterface_SUITE_data/GetNames.java
+++ b/lib/jinterface/test/jinterface_SUITE_data/GetNames.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/jinterface_SUITE_data/Makefile.src b/lib/jinterface/test/jinterface_SUITE_data/Makefile.src
index 94625da188..19c2157f7a 100644
--- a/lib/jinterface/test/jinterface_SUITE_data/Makefile.src
+++ b/lib/jinterface/test/jinterface_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2010. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/jinterface_SUITE_data/Maps.java b/lib/jinterface/test/jinterface_SUITE_data/Maps.java
index e31b476e02..e8a05245da 100644
--- a/lib/jinterface/test/jinterface_SUITE_data/Maps.java
+++ b/lib/jinterface/test/jinterface_SUITE_data/Maps.java
@@ -11,7 +11,7 @@ import com.ericsson.otp.erlang.OtpOutputStream;
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/jinterface_SUITE_data/MboxLinkUnlink.java b/lib/jinterface/test/jinterface_SUITE_data/MboxLinkUnlink.java
index 7042b6297d..8cb4aa2ed6 100644
--- a/lib/jinterface/test/jinterface_SUITE_data/MboxLinkUnlink.java
+++ b/lib/jinterface/test/jinterface_SUITE_data/MboxLinkUnlink.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/jinterface_SUITE_data/MboxPing.java b/lib/jinterface/test/jinterface_SUITE_data/MboxPing.java
index 13e2c8edc4..629fd49c93 100644
--- a/lib/jinterface/test/jinterface_SUITE_data/MboxPing.java
+++ b/lib/jinterface/test/jinterface_SUITE_data/MboxPing.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/jinterface_SUITE_data/MboxSendReceive.java b/lib/jinterface/test/jinterface_SUITE_data/MboxSendReceive.java
index 67ab6b13aa..8e25e0f8b5 100644
--- a/lib/jinterface/test/jinterface_SUITE_data/MboxSendReceive.java
+++ b/lib/jinterface/test/jinterface_SUITE_data/MboxSendReceive.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/jinterface_SUITE_data/NodePing.java b/lib/jinterface/test/jinterface_SUITE_data/NodePing.java
index 5938f2b335..fe5592ef7e 100644
--- a/lib/jinterface/test/jinterface_SUITE_data/NodePing.java
+++ b/lib/jinterface/test/jinterface_SUITE_data/NodePing.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/jinterface_SUITE_data/NodeStatusHandler.java b/lib/jinterface/test/jinterface_SUITE_data/NodeStatusHandler.java
index bb21fa85ad..f27a49ce81 100644
--- a/lib/jinterface/test/jinterface_SUITE_data/NodeStatusHandler.java
+++ b/lib/jinterface/test/jinterface_SUITE_data/NodeStatusHandler.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/jinterface_SUITE_data/Nodename.java b/lib/jinterface/test/jinterface_SUITE_data/Nodename.java
index 770431a414..2a236b4bad 100644
--- a/lib/jinterface/test/jinterface_SUITE_data/Nodename.java
+++ b/lib/jinterface/test/jinterface_SUITE_data/Nodename.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/jinterface_SUITE_data/RegisterAndWhereis.java b/lib/jinterface/test/jinterface_SUITE_data/RegisterAndWhereis.java
index 3612460cce..18c865fada 100644
--- a/lib/jinterface/test/jinterface_SUITE_data/RegisterAndWhereis.java
+++ b/lib/jinterface/test/jinterface_SUITE_data/RegisterAndWhereis.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/jitu.erl b/lib/jinterface/test/jitu.erl
index adcadac85e..961130585a 100644
--- a/lib/jinterface/test/jitu.erl
+++ b/lib/jinterface/test/jitu.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/nc_SUITE.erl b/lib/jinterface/test/nc_SUITE.erl
index 9910334749..81944f71d4 100644
--- a/lib/jinterface/test/nc_SUITE.erl
+++ b/lib/jinterface/test/nc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -31,6 +31,10 @@
-define(NEW_REFERENCE_EXT, 114).
-define(ATOM_UTF8_EXT, 118).
-define(SMALL_ATOM_UTF8_EXT, 119).
+-define(NEW_PID_EXT, $X).
+-define(NEW_PORT_EXT, $Y).
+-define(NEWER_REFERENCE_EXT, $Z).
+
-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,
init_per_suite/1,
@@ -123,12 +127,13 @@ pid_roundtrip(doc) -> [];
pid_roundtrip(suite) -> [];
pid_roundtrip(Config) when is_list(Config)->
ThisNode = {node(), erlang:system_info(creation)},
- RemNode = {gurka@sallad, 2},
+ RemPids = [mk_pid({gurka@sallad, Cr}, Num, Ser)
+ || Cr <- [1,2,3,4,16#adec0ded],
+ {Num, Ser} <- [{4711,4711},{32767, 8191}]],
do_echo([self(),
mk_pid(ThisNode, 4711, 4711),
- mk_pid(ThisNode, 32767, 8191),
- mk_pid(RemNode, 4711, 4711),
- mk_pid(RemNode, 32767, 8191)],
+ mk_pid(ThisNode, 32767, 8191)
+ | RemPids],
Config).
fun_roundtrip(doc) -> [];
@@ -144,26 +149,29 @@ port_roundtrip(doc) -> [];
port_roundtrip(suite) -> [];
port_roundtrip(Config) when is_list(Config)->
ThisNode = {node(), erlang:system_info(creation)},
- RemNode = {gurka@sallad, 2},
+ RemPorts = [mk_port({gurka@sallad, Cr}, Num)
+ || Cr <- [1,2,3,4,16#adec0ded],
+ Num <- [4711, 268435455]],
do_echo([hd(erlang:ports()),
mk_port(ThisNode, 4711),
- mk_port(ThisNode, 268435455),
- mk_port(RemNode, 4711),
- mk_port(RemNode, 268435455)],
+ mk_port(ThisNode, 268435455)
+ | RemPorts],
Config).
ref_roundtrip(doc) -> [];
ref_roundtrip(suite) -> [];
ref_roundtrip(Config) when is_list(Config)->
ThisNode = {node(), erlang:system_info(creation)},
- RemNode = {gurka@sallad, 2},
+ RemRefs = [mk_ref({gurka@sallad, Cr}, Words)
+ || Cr <- [1,2,3,4,16#adec0ded],
+ Words <- [[4711],
+ [4711, 4711, 4711],
+ [262143, 4294967295, 4294967295]]],
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])],
+ mk_ref(ThisNode, [262143, 4294967295, 4294967295])
+ | RemRefs],
Config).
new_float(doc) -> [];
@@ -759,17 +767,22 @@ uint8(Uint) ->
exit({badarg, uint8, [Uint]}).
+pid_tag(Creation) when Creation =< 3 -> ?PID_EXT;
+pid_tag(_Creation) -> ?NEW_PID_EXT.
+
+enc_creation(Creation) when Creation =< 3 -> uint8(Creation);
+enc_creation(Creation) -> uint32_be(Creation).
mk_pid({NodeName, Creation}, Number, Serial) when is_atom(NodeName) ->
<<?VERSION_MAGIC, NodeNameExt/binary>> = term_to_binary(NodeName),
mk_pid({NodeNameExt, Creation}, Number, Serial);
mk_pid({NodeNameExt, Creation}, Number, Serial) ->
case catch binary_to_term(list_to_binary([?VERSION_MAGIC,
- ?PID_EXT,
+ pid_tag(Creation),
NodeNameExt,
uint32_be(Number),
uint32_be(Serial),
- uint8(Creation)])) of
+ enc_creation(Creation)])) of
Pid when is_pid(Pid) ->
Pid;
{'EXIT', {badarg, _}} ->
@@ -778,15 +791,18 @@ mk_pid({NodeNameExt, Creation}, Number, Serial) ->
exit({unexpected_binary_to_term_result, Other})
end.
+port_tag(Creation) when Creation =< 3 -> ?PORT_EXT;
+port_tag(_Creation) -> ?NEW_PORT_EXT.
+
mk_port({NodeName, Creation}, Number) when is_atom(NodeName) ->
<<?VERSION_MAGIC, NodeNameExt/binary>> = term_to_binary(NodeName),
mk_port({NodeNameExt, Creation}, Number);
mk_port({NodeNameExt, Creation}, Number) ->
case catch binary_to_term(list_to_binary([?VERSION_MAGIC,
- ?PORT_EXT,
+ port_tag(Creation),
NodeNameExt,
uint32_be(Number),
- uint8(Creation)])) of
+ enc_creation(Creation)])) of
Port when is_port(Port) ->
Port;
{'EXIT', {badarg, _}} ->
@@ -795,12 +811,16 @@ mk_port({NodeNameExt, Creation}, Number) ->
exit({unexpected_binary_to_term_result, Other})
end.
+ref_tag(Creation) when Creation =< 3 -> ?NEW_REFERENCE_EXT;
+ref_tag(_Creation) -> ?NEWER_REFERENCE_EXT.
+
mk_ref({NodeName, Creation}, [Number] = NL) when is_atom(NodeName),
is_integer(Creation),
is_integer(Number) ->
<<?VERSION_MAGIC, NodeNameExt/binary>> = term_to_binary(NodeName),
mk_ref({NodeNameExt, Creation}, NL);
mk_ref({NodeNameExt, Creation}, [Number]) when is_integer(Creation),
+ Creation =< 3,
is_integer(Number) ->
case catch binary_to_term(list_to_binary([?VERSION_MAGIC,
?REFERENCE_EXT,
@@ -822,10 +842,10 @@ mk_ref({NodeName, Creation}, Numbers) when is_atom(NodeName),
mk_ref({NodeNameExt, Creation}, Numbers) when is_integer(Creation),
is_list(Numbers) ->
case catch binary_to_term(list_to_binary([?VERSION_MAGIC,
- ?NEW_REFERENCE_EXT,
+ ref_tag(Creation),
uint16_be(length(Numbers)),
NodeNameExt,
- uint8(Creation),
+ enc_creation(Creation),
lists:map(fun (N) ->
uint32_be(N)
end,
diff --git a/lib/jinterface/test/nc_SUITE_data/Makefile.src b/lib/jinterface/test/nc_SUITE_data/Makefile.src
index 3d02389df8..94e2c1fa47 100644
--- a/lib/jinterface/test/nc_SUITE_data/Makefile.src
+++ b/lib/jinterface/test/nc_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2010. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/nc_SUITE_data/connection_server.java b/lib/jinterface/test/nc_SUITE_data/connection_server.java
index 36c5074031..97273f5306 100644
--- a/lib/jinterface/test/nc_SUITE_data/connection_server.java
+++ b/lib/jinterface/test/nc_SUITE_data/connection_server.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/jinterface/test/nc_SUITE_data/echo_server.java b/lib/jinterface/test/nc_SUITE_data/echo_server.java
index 4caf0dedde..49846a6972 100644
--- a/lib/jinterface/test/nc_SUITE_data/echo_server.java
+++ b/lib/jinterface/test/nc_SUITE_data/echo_server.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/kernel/Makefile b/lib/kernel/Makefile
index 74f942b027..b956f5eaf5 100644
--- a/lib/kernel/Makefile
+++ b/lib/kernel/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/kernel/doc/src/Makefile b/lib/kernel/doc/src/Makefile
index 3c6414a620..8976a3b800 100644
--- a/lib/kernel/doc/src/Makefile
+++ b/lib/kernel/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/kernel/doc/src/app.xml b/lib/kernel/doc/src/app.xml
index 35feec144e..5e0da409a3 100644
--- a/lib/kernel/doc/src/app.xml
+++ b/lib/kernel/doc/src/app.xml
@@ -4,7 +4,7 @@
<fileref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -42,12 +42,12 @@
</description>
<section>
- <title>FILE SYNTAX</title>
- <p>The application resource file should be called
- <c>Application.app</c> where <c>Application</c> is the name of
- the application. The file should be located in the <c>ebin</c>
- directory for the application.</p>
- <p>It must contain one single Erlang term, which is called an
+ <title>File Syntax</title>
+ <p>The application resource file is to be called
+ <c>Application.app</c>, where <c>Application</c> is the
+ application name. The file is to be located in directory <c>ebin</c>
+ for the application.</p>
+ <p>The file must contain a single Erlang term, which is called an
<em>application specification</em>:</p>
<code type="none">
{application, Application,
@@ -80,19 +80,26 @@ Env [{Par,Val}] []
Start {Module,StartArgs} []
Phases [{Phase,PhaseArgs}] undefined
RTDeps [ApplicationVersion] []
- Module = Name = App = Par = Phase = atom()
- Val = StartArgs = PhaseArgs = term()
- ApplicationVersion = string()</code>
- <p><c>Application</c> is the name of the application.</p>
+
+Module = Name = App = Par = Phase = atom()
+Val = StartArgs = PhaseArgs = term()
+ApplicationVersion = string()</code>
+ <taglist>
+ <tag><c>Application</c></tag>
+ <item>Application name.</item>
+ </taglist>
<p>For the application controller, all keys are optional.
The respective default values are used for any omitted keys.</p>
<p>The functions in <c>systools</c> require more information. If
- they are used, the following keys are mandatory:
- <c>description</c>, <c>vsn</c>, <c>modules</c>, <c>registered</c>
- and <c>applications</c>. The other keys are ignored by
- <c>systools</c>.</p>
- <warning><p>The <c>RTDeps</c> type was introduced in OTP 17.0 and
- might be subject to changes during the OTP 17 release.</p></warning>
+ they are used, the following keys are mandatory:</p>
+ <list type="bulleted">
+ <item><c>description</c></item>
+ <item><c>vsn</c></item>
+ <item><c>modules</c></item>
+ <item><c>registered</c></item>
+ <item><c>applications</c></item>
+ </list>
+ <p>The other keys are ignored by <c>systools</c>.</p>
<taglist>
<tag><c>description</c></tag>
<item>
@@ -104,7 +111,7 @@ RTDeps [ApplicationVersion] []
</item>
<tag><c>vsn</c></tag>
<item>
- <p>The version of the application.</p>
+ <p>Version of the application.</p>
</item>
<tag><c>modules</c></tag>
<item>
@@ -114,15 +121,14 @@ RTDeps [ApplicationVersion] []
</item>
<tag><c>maxP</c></tag>
<item>
- <p><em>Deprecated - will be ignored</em> <br></br>
-
- The maximum number of processes allowed in the application.</p>
+ <p><em>Deprecated - is ignored</em></p>
+ <p>Maximum number of processes allowed in the application.</p>
</item>
<tag><c>maxT</c></tag>
<item>
- <p>The maximum time in milliseconds that the application is
- allowed to run. After the specified time the application will
- automatically terminate.</p>
+ <p>Maximum time, in milliseconds, that the application is
+ allowed to run. After the specified time, the application
+ terminates automatically.</p>
</item>
<tag><c>registered</c></tag>
<item>
@@ -132,20 +138,20 @@ RTDeps [ApplicationVersion] []
</item>
<tag><c>included_applications</c></tag>
<item>
- <p>All applications which are included by this application.
- When this application is started, all included application
- will automatically be loaded, but not started, by
- the application controller. It is assumed that the topmost
+ <p>All applications included by this application.
+ When this application is started, all included applications
+ are loaded automatically, but not started, by
+ the application controller. It is assumed that the top-most
supervisor of the included application is started by a
supervisor of this application.</p>
</item>
<tag><c>applications</c></tag>
<item>
- <p>All applications which must be started before this
+ <p>All applications that must be started before this
application is allowed to be started. <c>systools</c> uses
this list to generate correct start scripts. Defaults to
- the empty list, but note that all applications have
- dependencies to (at least) <c>kernel</c> and <c>stdlib</c>.</p>
+ the empty list, but notice that all applications have
+ dependencies to (at least) <c>Kernel</c> and <c>STDLIB</c>.</p>
</item>
<tag><c>env</c></tag>
<item>
@@ -153,78 +159,84 @@ RTDeps [ApplicationVersion] []
of a configuration parameter is retrieved by calling
<c>application:get_env/1,2</c>. The values in the application
resource file can be overridden by values in a configuration
- file (see <c>config(4)</c>) or by command line flags (see
- <c>erl(1)</c>).</p>
+ file (see <seealso marker="config"><c>config(4)</c></seealso>)
+ or by command-line flags (see
+ <seealso marker="erts:erl"><c>erts:erl(1)</c></seealso>).</p>
</item>
<tag><c>mod</c></tag>
<item>
- <p>Specifies the application callback module and a start
- argument, see <c>application(3)</c>.</p>
- <p>The <c>mod</c> key is necessary for an application
- implemented as a supervision tree, or the application
- controller will not know how to start it. The <c>mod</c> key
+ <p>Specifies the application callback module and a start argument, see
+ <seealso marker="application"><c>application(3)</c></seealso>.</p>
+ <p>Key <c>mod</c> is necessary for an application
+ implemented as a supervision tree, otherwise the application
+ controller does not know how to start it. <c>mod</c>
can be omitted for applications without processes, typically
- code libraries such as the application STDLIB.</p>
+ code libraries, for example, <c>STDLIB</c>.</p>
</item>
<tag><c>start_phases</c></tag>
<item>
<p>A list of start phases and corresponding start arguments for
the application. If this key is present, the application
- master will - in addition to the usual call to
- <c>Module:start/2</c> - also call
+ master, in addition to the usual call to
+ <c>Module:start/2</c>, also calls
<c>Module:start_phase(Phase,Type,PhaseArgs)</c> for each
- start phase defined by the <c>start_phases</c> key, and only
- after this extended start procedure will
- <c>application:start(Application)</c> return.</p>
- <p>Start phases may be used to synchronize startup of an
+ start phase defined by key <c>start_phases</c>. Only
+ after this extended start procedure,
+ <c>application:start(Application)</c> returns.</p>
+ <p>Start phases can be used to synchronize startup of an
application and its included applications. In this case,
- the <c>mod</c> key must be specified as:</p>
+ key <c>mod</c> must be specified as follows:</p>
<code type="none">
{mod, {application_starter,[Module,StartArgs]}}</code>
- <p>The application master will then call <c>Module:start/2</c>
+ <p>The application master then calls <c>Module:start/2</c>
for the primary application, followed by calls to
<c>Module:start_phase/3</c> for each start phase (as defined
- for the primary application) both for the primary application
- and for each of its included application, for which the start
+ for the primary application), both for the primary application
+ and for each of its included applications, for which the start
phase is defined.</p>
<p>This implies that for an included application, the set of
start phases must be a subset of the set of phases defined
- for the primary application. Refer to <em>OTP Design Principles</em> for more information.</p>
+ for the primary application. For more information, see
+ <seealso marker="doc/design_principles:applications">OTP Design Principles</seealso>.
+ </p>
</item>
- <tag><marker id="runtime_dependencies"></marker><c>runtime_dependencies</c></tag>
- <item><p>A list of application versions that the application
- depends on. An example of such an application version is
- <c>"kernel-3.0"</c>. Application versions specified as runtime
- dependencies are minimum requirements. That is, a larger
- application version than the one specified in the
- dependency satisfies the requirement. For information on
- how to compare application versions see
- <seealso marker="doc/system_principles:versions">the
- documentation of versions in the system principles
- guide</seealso>. Note that the application version
- specifies a source code version. An additional indirect
- requirement is that installed binary application of
- the specified version has been built so that it is
- compatible with the rest of the system.</p>
- <p>Some dependencies might only be required in specific runtime
- scenarios. In the case such optional dependencies exist, these are
- specified and documented in the corresponding "App" documentation
- of the specific application.</p>
- <warning><p>The <c>runtime_dependencies</c> key was introduced in
- OTP 17.0. The type of its value might be subject to changes during
- the OTP 17 release.</p></warning>
- <warning><p>All runtime dependencies specified in OTP applications
- during the OTP 17 release may not be completely correct. This
- is actively being worked on. Declared runtime dependencies in OTP
- applications are expected to be correct in OTP 18.</p></warning>
+ <tag>
+ <marker id="runtime_dependencies"></marker>
+ <c>runtime_dependencies</c></tag>
+ <item>
+ <p>A list of application versions that the application
+ depends on. An example of such an application version is
+ <c>"kernel-3.0"</c>. Application versions specified as runtime
+ dependencies are minimum requirements. That is, a larger
+ application version than the one specified in the
+ dependency satisfies the requirement. For information about
+ how to compare application versions, see section
+ <seealso marker="doc/system_principles:versions">Versions</seealso>
+ in the System Principles User's Guide.</p>
+ <p>Notice that the application version
+ specifies a source code version. One more, indirect,
+ requirement is that the installed binary application of
+ the specified version is built so that it is
+ compatible with the rest of the system.</p>
+ <p>Some dependencies can only be required in specific runtime
+ scenarios. When such optional dependencies exist, these are
+ specified and documented in the corresponding "App" documentation
+ of the specific application.</p>
+ <warning><p>The <c>runtime_dependencies</c> key was introduced in
+ OTP 17.0. The type of its value might be subject to changes during
+ the OTP 17 release.</p></warning>
+ <warning><p>All runtime dependencies specified in OTP applications
+ during the OTP 17 release may not be completely correct. This
+ is actively being worked on. Declared runtime dependencies in OTP
+ applications are expected to be correct in OTP 18.</p></warning>
</item>
</taglist>
</section>
<section>
- <title>SEE ALSO</title>
- <p><seealso marker="application">application(3)</seealso>,
- systools(3)</p>
+ <title>See Also</title>
+ <p><seealso marker="application"><c>application(3)</c></seealso>,
+ <seealso marker="sasl:systools"><c>sasl:systools(3)</c></seealso></p>
</section>
</fileref>
diff --git a/lib/kernel/doc/src/application.xml b/lib/kernel/doc/src/application.xml
index 4d8e6ce94b..3928078932 100644
--- a/lib/kernel/doc/src/application.xml
+++ b/lib/kernel/doc/src/application.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -33,23 +33,25 @@
<description>
<p>In OTP, <em>application</em> denotes a component implementing
some specific functionality, that can be started and stopped as a
- unit, and which can be re-used in other systems as well. This
- module interfaces the <em>application controller</em>, a process
- started at every Erlang runtime system, and contains functions
- for controlling applications (for example starting and stopping
+ unit, and that can be reused in other systems. This
+ module interacts with <em>application controller</em>, a process
+ started at every Erlang runtime system. This module contains functions
+ for controlling applications (for example, starting and stopping
applications), and functions to access information about
- applications (for example configuration parameters).</p>
- <p>An application is defined by an <em>application specification</em>. The specification is normally located in an
- <em>application resource file</em> called <c>Application.app</c>,
- where <c>Application</c> is the name of the application. Refer to
- <seealso marker="app">app(4)</seealso> for more information about
- the application specification.</p>
+ applications (for example, configuration parameters).</p>
+ <p>An application is defined by an <em>application specification</em>.
+ The specification is normally located in an
+ <em>application resource file</em> named <c>Application.app</c>,
+ where <c>Application</c> is the application name. For details
+ about the application specification, see
+ <seealso marker="app"><c>app(4)</c></seealso>.</p>
<p>This module can also be viewed as a behaviour for an application
implemented according to the OTP design principles as a
supervision tree. The definition of how to start and stop
- the tree should be located in an <em>application callback module</em> exporting a pre-defined set of functions.</p>
- <p>Refer to <seealso marker="doc/design_principles:des_princ">OTP Design Principles</seealso> for more information about
- applications and behaviours.</p>
+ the tree is to be located in an <em>application callback module</em>,
+ exporting a predefined set of functions.</p>
+ <p>For details about applications and behaviours, see
+ <seealso marker="doc/design_principles:des_princ">OTP Design Principles</seealso>.</p>
</description>
<datatypes>
<datatype>
@@ -59,7 +61,6 @@
<name name="restart_type"/>
</datatype>
<datatype>
- <!-- Parameterized opaque types are NYI: -->
<name>tuple_of(T)</name>
<desc><p><marker id="type-tuple_of"/>
A tuple where the elements are of type <c>T</c>.</p></desc>
@@ -67,9 +68,37 @@
</datatypes>
<funcs>
<func>
+ <name name="ensure_all_started" arity="1"/>
+ <name name="ensure_all_started" arity="2"/>
+ <fsummary>Load and start an application and its dependencies, recursively.</fsummary>
+ <desc>
+ <p>Equivalent to calling
+ <seealso marker="#start/1"><c>start/1,2</c></seealso>
+ repeatedly on all dependencies that are not yet started for an application.</p>
+ <p>Returns <c>{ok, AppNames}</c> for a successful start or for an already started
+ application (which is, however, omitted from the <c>AppNames</c> list).</p>
+ <p>The function reports <c>{error, {AppName,Reason}}</c> for errors, where
+ <c>Reason</c> is any possible reason returned by
+ <seealso marker="#start/1"><c>start/1,2</c></seealso>
+ when starting a specific dependency.</p>
+ <p>If an error occurs, the applications started by the function are stopped
+ to bring the set of running applications back to its initial state.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="ensure_started" arity="1"/>
+ <name name="ensure_started" arity="2"/>
+ <fsummary>Load and start an application.</fsummary>
+ <desc>
+ <p>Equivalent to
+ <seealso marker="#start/1"><c>start/1,2</c></seealso>
+ except it returns <c>ok</c> for already started applications.</p>
+ </desc>
+ </func>
+ <func>
<name name="get_all_env" arity="0"/>
<name name="get_all_env" arity="1"/>
- <fsummary>Get the configuration parameters for an application</fsummary>
+ <fsummary>Get the configuration parameters for an application.</fsummary>
<desc>
<p>Returns the configuration parameters and their values for
<c><anno>Application</anno></c>. If the argument is omitted, it defaults to
@@ -82,7 +111,7 @@
<func>
<name name="get_all_key" arity="0"/>
<name name="get_all_key" arity="1"/>
- <fsummary>Get the application specification keys</fsummary>
+ <fsummary>Get the application specification keys.</fsummary>
<desc>
<p>Returns the application specification keys and their values
for <c><anno>Application</anno></c>. If the argument is omitted, it
@@ -96,7 +125,7 @@
<func>
<name name="get_application" arity="0"/>
<name name="get_application" arity="1"/>
- <fsummary>Get the name of an application containing a certain process or module</fsummary>
+ <fsummary>Get the name of an application containing a certain process or module.</fsummary>
<desc>
<p>Returns the name of the application to which the process
<c><anno>Pid</anno></c> or the module <c><anno>Module</anno></c> belongs. Providing no
@@ -110,222 +139,212 @@
<func>
<name name="get_env" arity="1"/>
<name name="get_env" arity="2"/>
- <fsummary>Get the value of a configuration parameter</fsummary>
+ <fsummary>Get the value of a configuration parameter.</fsummary>
<desc>
- <p>Returns the value of the configuration parameter <c><anno>Par</anno></c>
+ <p>Returns the value of configuration parameter <c><anno>Par</anno></c>
for <c><anno>Application</anno></c>. If the application argument is
omitted, it defaults to the application of the calling
process.</p>
- <p>If the specified application is not loaded, or
- the configuration parameter does not exist, or if the process
- executing the call does not belong to any application,
- the function returns <c>undefined</c>.</p>
+ <p>Returns <c>undefined</c> if any of the following applies:</p>
+ <list type="bulleted">
+ <item>The specified application is not loaded.</item>
+ <item>The configuration parameter does not exist.</item>
+ <item>The process executing the call does not belong to any application.</item>
+ </list>
</desc>
</func>
<func>
<name name="get_env" arity="3"/>
- <fsummary>Get the value of a configuration parameter using a default</fsummary>
+ <fsummary>Get the value of a configuration parameter using a default.</fsummary>
<desc>
- <p>Works like <seealso marker="#get_env/2">get_env/2</seealso> but returns
- <c><anno>Def</anno></c> value when configuration parameter
+ <p>Works like <seealso marker="#get_env/2"><c>get_env/2</c></seealso> but returns
+ value <c><anno>Def</anno></c> when configuration parameter
<c><anno>Par</anno></c> does not exist.</p>
</desc>
</func>
<func>
<name name="get_key" arity="1"/>
<name name="get_key" arity="2"/>
- <fsummary>Get the value of an application specification key</fsummary>
+ <fsummary>Get the value of an application specification key.</fsummary>
<desc>
<p>Returns the value of the application specification key
<c><anno>Key</anno></c> for <c><anno>Application</anno></c>. If the application
argument is omitted, it defaults to the application of
the calling process.</p>
- <p>If the specified application is not loaded, or
- the specification key does not exist, or if the process
- executing the call does not belong to any application,
- the function returns <c>undefined</c>.</p>
+ <p>Returns <c>undefined</c> if any of the following applies:</p>
+ <list type="bulleted">
+ <item>The specified application is not loaded.</item>
+ <item>The specification key does not exist.</item>
+ <item>The process executing the call does not belong to any application.</item>
+ </list>
+
</desc>
</func>
<func>
<name name="load" arity="1"/>
<name name="load" arity="2"/>
- <fsummary>Load an application</fsummary>
+ <fsummary>Load an application.</fsummary>
<type name="application_spec"/>
<type name="application_opt"/>
<desc>
<p>Loads the application specification for an application into
- the application controller. It will also load the application
- specifications for any included applications. Note that
- the function does not load the actual Erlang object code.</p>
- <p>The application can be given by its name <c><anno>Application</anno></c>.
- In this case the application controller will search the code
+ the application controller. It also loads the application
+ specifications for any included applications. Notice that
+ the function does not load the Erlang object code.</p>
+ <p>The application can be specified by its name <c><anno>Application</anno></c>.
+ In this case, the application controller searches the code
path for the application resource file <c><anno>Application</anno>.app</c>
- and load the specification it contains.</p>
- <p>The application specification can also be given directly as a
- tuple <c><anno>AppSpec</anno></c>. This tuple should have the format and
- contents as described in <c>app(4)</c>.</p>
+ and loads the specification it contains.</p>
+ <p>The application specification can also be specified directly as a
+ tuple <c><anno>AppSpec</anno></c>, having the format and
+ contents as described in
+ <seealso marker="app"><c>app(4)</c></seealso>.</p>
<p>If <c><anno>Distributed</anno> == {<anno>Application</anno>,[<anno>Time</anno>,]<anno>Nodes</anno>}</c>,
- the application will be distributed. The argument overrides
- the value for the application in the Kernel configuration
+ the application becomes distributed. The argument overrides
+ the value for the application in the <c>Kernel</c> configuration
parameter <c>distributed</c>. <c><anno>Application</anno></c> must be
- the name of the application (same as in the first argument).
- If a node crashes and <c><anno>Time</anno></c> has been specified, then
- the application controller will wait for <c><anno>Time</anno></c>
+ the application name (same as in the first argument).
+ If a node crashes and <c><anno>Time</anno></c> is specified,
+ the application controller waits for <c><anno>Time</anno></c>
milliseconds before attempting to restart the application on
- another node. If <c><anno>Time</anno></c> is not specified, it will
- default to 0 and the application will be restarted
+ another node. If <c><anno>Time</anno></c> is not specified, it
+ defaults to <c>0</c> and the application is restarted
immediately.</p>
<p><c><anno>Nodes</anno></c> is a list of node names where the application
- may run, in priority from left to right. Node names can be
+ can run, in priority from left to right. Node names can be
grouped using tuples to indicate that they have the same
- priority. Example:</p>
+ priority.</p>
+ <p><em>Example:</em></p>
<code type="none">
Nodes = [cp1@cave, {cp2@cave, cp3@cave}]</code>
- <p>This means that the application should preferably be started
+ <p>This means that the application is preferably to be started
at <c>cp1@cave</c>. If <c>cp1@cave</c> is down,
- the application should be started at either <c>cp2@cave</c>
+ the application is to be started at <c>cp2@cave</c>
or <c>cp3@cave</c>.</p>
<p>If <c>Distributed == default</c>, the value for
- the application in the Kernel configuration parameter
- <c>distributed</c> will be used.</p>
+ the application in the <c>Kernel</c> configuration parameter
+ <c>distributed</c> is used.</p>
</desc>
</func>
<func>
<name name="loaded_applications" arity="0"/>
- <fsummary>Get the currently loaded applications</fsummary>
+ <fsummary>Get the currently loaded applications.</fsummary>
<desc>
- <p>Returns a list with information about the applications which
- have been loaded using <c>load/1,2</c>, also included
- applications. <c><anno>Application</anno></c> is the application name.
- <c><anno>Description</anno></c> and <c><anno>Vsn</anno></c> are the values of its
- <c>description</c> and <c>vsn</c> application specification
+ <p>Returns a list with information about the applications, and included
+ applications, which are loaded using <c>load/1,2</c>.
+ <c><anno>Application</anno></c> is the application name.
+ <c><anno>Description</anno></c> and <c><anno>Vsn</anno></c> are the values
+ of their <c>description</c> and <c>vsn</c> application specification
keys, respectively.</p>
</desc>
</func>
<func>
<name name="permit" arity="2"/>
- <fsummary>Change an application's permission to run on a node.</fsummary>
+ <fsummary>Change the permission for an application to run at a node.</fsummary>
<desc>
<p>Changes the permission for <c><anno>Application</anno></c> to run at
- the current node. The application must have been loaded using
+ the current node. The application must be loaded using
<c>load/1,2</c> for the function to have effect.</p>
<p>If the permission of a loaded, but not started, application
- is set to <c>false</c>, <c>start</c> will return <c>ok</c> but
- the application will not be started until the permission is
+ is set to <c>false</c>, <c>start</c> returns <c>ok</c> but
+ the application is not started until the permission is
set to <c>true</c>.</p>
<p>If the permission of a running application is set to
- <c>false</c>, the application will be stopped. If
- the permission later is set to <c>true</c>, it will be
+ <c>false</c>, the application is stopped. If
+ the permission later is set to <c>true</c>, it is
restarted.</p>
<p>If the application is distributed, setting the permission to
<c>false</c> means that the application will be started at, or
moved to, another node according to how its distribution is
- configured (see <c>load/2</c> above).</p>
+ configured
+ (see <seealso marker="#load/2"><c>load/2</c></seealso>).</p>
<p>The function does not return until the application is
- started, stopped or successfully moved to another node.
- However, in some cases where permission is set to <c>true</c>
- the function may return <c>ok</c> even though the application
- itself has not started. This is true when an application
- cannot start because it has dependencies to other
- applications which have not yet been started. When they have
- been started, <c>Application</c> will be started as well.</p>
+ started, stopped, or successfully moved to another node.
+ However, in some cases where permission is set to <c>true</c>,
+ the function returns <c>ok</c> even though the application
+ is not started. This is true when an application
+ cannot start because of dependencies to other
+ applications that are not yet started. When they are
+ started, <c>Application</c> is started as well.</p>
<p>By default, all applications are loaded with permission
- <c>true</c> on all nodes. The permission is configurable by
- using the Kernel configuration parameter <c>permissions</c>.</p>
+ <c>true</c> on all nodes. The permission can be configured
+ using the <c>Kernel</c> configuration parameter <c>permissions</c>.</p>
</desc>
</func>
<func>
<name name="set_env" arity="3"/>
<name name="set_env" arity="4"/>
- <fsummary>Set the value of a configuration parameter</fsummary>
+ <fsummary>Set the value of a configuration parameter.</fsummary>
<desc>
- <p>Sets the value of the configuration parameter <c><anno>Par</anno></c> for
+ <p>Sets the value of configuration parameter <c><anno>Par</anno></c> for
<c><anno>Application</anno></c>.</p>
- <p><c>set_env/4</c> uses the standard <c>gen_server</c> timeout
- value (5000 ms). The <c>timeout</c> option can be provided
- if another timeout value is useful, for example, in situations
+ <p><c>set_env/4</c> uses the standard <c>gen_server</c> time-out
+ value (5000 ms). Option <c>timeout</c> can be specified
+ if another time-out value is useful, for example, in situations
where the application controller is heavily loaded.</p>
<p>If <c>set_env/4</c> is called before the application is loaded,
- the application environment values specified in the <c>Application.app</c>
- file will override the ones previously set. This is also true for application
+ the application environment values specified in file <c>Application.app</c>
+ override the ones previously set. This is also true for application
reloads.</p>
- <p>The <c>persistent</c> option can be set to <c>true</c>
- when there is a need to guarantee parameters set with <c>set_env/4</c>
- will not be overridden by the ones defined in the application resource
- file on load. This means persistent values will stick after the application
+ <p>Option <c>persistent</c> can be set to <c>true</c>
+ to guarantee that parameters set with <c>set_env/4</c>
+ are not overridden by those defined in the application resource
+ file on load. This means that persistent values will stick after the application
is loaded and also on application reload.</p>
<warning>
- <p>Use this function only if you know what you are doing,
- that is, on your own applications. It is very application
- and configuration parameter dependent when and how often
- the value is read by the application, and careless use
- of this function may put the application in a
- weird, inconsistent, and malfunctioning state. </p>
+ <p>Use this function only if you know what you are doing,
+ that is, on your own applications. It is very
+ application-dependent and
+ configuration parameter-dependent when and how often
+ the value is read by the application. Careless use
+ of this function can put the application in a
+ weird, inconsistent, and malfunctioning state.</p>
</warning>
</desc>
</func>
<func>
- <name name="ensure_started" arity="1"/>
- <name name="ensure_started" arity="2"/>
- <fsummary>Load and start an application</fsummary>
- <desc>
- <p>Equivalent to <seealso marker="#start/2"><c>application:start/1,2</c></seealso> except
- it returns <c>ok</c> for already started applications.</p>
- </desc>
- </func>
- <func>
- <name name="ensure_all_started" arity="1"/>
- <name name="ensure_all_started" arity="2"/>
- <fsummary>Load and start an application and its dependencies, recursively</fsummary>
- <desc>
- <p>Equivalent to calling <seealso marker="#start/2"><c>application:start/1,2</c></seealso>
- repeatedly on all dependencies that have not yet been started for an application.
- The function returns <c>{ok, AppNames}</c> for a successful start or for an already started
- application (which are however omitted from the <c>AppNames</c> list), and reports
- <c>{error, {AppName,Reason}}</c> for errors, where <c>Reason</c> is any possible reason
- returned by <seealso marker="#start/2"><c>application:start/1,2</c></seealso> when starting a
- specific dependency. In case of an error, the applications that were started by the
- function are stopped to bring the set of running applications back to its initial state.</p>
- </desc>
- </func>
- <func>
<name name="start" arity="1"/>
<name name="start" arity="2"/>
- <fsummary>Load and start an application</fsummary>
- <desc>
+ <fsummary>Load and start an application.</fsummary>
+ <desc>
<p>Starts <c><anno>Application</anno></c>. If it is not loaded,
- the application controller will first load it using
- <c>load/1</c>. It will make sure any included applications
- are loaded, but will not start them. That is assumed to be
+ the application controller first loads it using
+ <c>load/1</c>. It ensures that any included applications
+ are loaded, but does not start them. That is assumed to be
taken care of in the code for <c><anno>Application</anno></c>.</p>
<p>The application controller checks the value of
the application specification key <c>applications</c>, to
- ensure that all applications that should be started before
- this application are running. If not,
+ ensure that all applications needed to be started before
+ this application are running. Otherwise,
<c>{error,{not_started,App}}</c> is returned, where <c>App</c>
is the name of the missing application.</p>
- <p>The application controller then creates an <em>application master</em> for the application. The application master is
+ <p>The application controller then creates an <em>application master</em>
+ for the application. The application master is
the group leader of all the processes in the application.
The application master starts the application by calling
the application callback function <c>Module:start/2</c> as
defined by the application specification key <c>mod</c>.</p>
- <p>The <c><anno>Type</anno></c> argument specifies the type of
+ <p>Argument <c><anno>Type</anno></c> specifies the type of
the application. If omitted, it defaults to <c>temporary</c>.</p>
<list type="bulleted">
<item>If a permanent application terminates, all other
applications and the entire Erlang node are also terminated.</item>
- <item>If a transient application terminates with <c>Reason == normal</c>, this is reported but no other applications are
- terminated. If a transient application terminates
- abnormally, all other applications and the entire Erlang
- node are also terminated.</item>
+ <item>
+ <list type="bulleted">
+ <item>If a transient application terminates with <c>Reason == normal</c>,
+ this is reported but no other applications are terminated.</item>
+ <item>If a transient application terminates abnormally, all other
+ applications and the entire Erlang node are also terminated.</item>
+ </list>
+ </item>
<item>If a temporary application terminates, this is reported
but no other applications are terminated.</item>
</list>
- <p>Note that it is always possible to stop an application
+ <p>Notice that an application can always be stopped
explicitly by calling <c>stop/1</c>. Regardless of the type of
- the application, no other applications will be affected.</p>
- <p>Note also that the transient type is of little practical use,
- since when a supervision tree terminates, the reason is set to
+ the application, no other applications are affected.</p>
+ <p>Notice also that the transient type is of little practical use,
+ because when a supervision tree terminates, the reason is set to
<c>shutdown</c>, not <c>normal</c>.</p>
</desc>
</func>
@@ -334,13 +353,13 @@ Nodes = [cp1@cave, {cp2@cave, cp3@cave}]</code>
<fsummary>Get the start type of an ongoing application startup.</fsummary>
<desc>
<p>This function is intended to be called by a process belonging
- to an application, when the application is being started, to
- determine the start type which is either <c><anno>StartType</anno></c> or
+ to an application, when the application is started, to
+ determine the start type, which is <c><anno>StartType</anno></c> or
<c>local</c>.</p>
- <p>See <seealso marker="#start_type"><c>Module:start/2</c></seealso> for a description of
- <c><anno>StartType</anno></c>.</p>
- <p><c>local</c> is returned if only parts of the application is
- being restarted (by a supervisor), or if the function is
+ <p>For a description of <c><anno>StartType</anno></c>, see
+ <seealso marker="#start_type"><c>Module:start/2</c></seealso>.</p>
+ <p><c>local</c> is returned if only parts of the application are
+ restarted (by a supervisor), or if the function is
called outside a startup.</p>
<p>If the process executing the call does not belong to any
application, the function returns <c>undefined</c>.</p>
@@ -348,103 +367,106 @@ Nodes = [cp1@cave, {cp2@cave, cp3@cave}]</code>
</func>
<func>
<name name="stop" arity="1"/>
- <fsummary>Stop an application</fsummary>
+ <fsummary>Stop an application.</fsummary>
<desc>
<p>Stops <c><anno>Application</anno></c>. The application master calls
<c>Module:prep_stop/1</c>, if such a function is defined, and
- then tells the top supervisor of the application to shutdown
- (see <c>supervisor(3)</c>). This means that the entire
+ then tells the top supervisor of the application to shut down
+ (see <seealso marker="stdlib:supervisor"><c>supervisor(3)</c></seealso>).
+ This means that the entire
supervision tree, including included applications, is
terminated in reversed start order. After the shutdown,
the application master calls <c>Module:stop/1</c>.
<c>Module</c> is the callback module as defined by
the application specification key <c>mod</c>.</p>
- <p>Last, the application master itself terminates. Note that all
- processes with the application master as group leader, i.e.
+ <p>Last, the application master terminates. Notice that all
+ processes with the application master as group leader, that is,
processes spawned from a process belonging to the application,
- thus are terminated as well.</p>
+ are also terminated.</p>
<p>When stopped, the application is still loaded.</p>
- <p>In order to stop a distributed application, <c>stop/1</c>
- has to be called on all nodes where it can execute (that is,
+ <p>To stop a distributed application, <c>stop/1</c>
+ must be called on all nodes where it can execute (that is,
on all nodes where it has been started). The call to
<c>stop/1</c> on the node where the application currently
- executes will stop its execution. The application will not be
- moved between nodes due to <c>stop/1</c> being called on
+ executes stops its execution. The application is not
+ moved between nodes, as <c>stop/1</c> is called on
the node where the application currently executes before
<c>stop/1</c> is called on the other nodes.</p>
</desc>
</func>
<func>
<name name="takeover" arity="2"/>
- <fsummary>Take over a distributed application</fsummary>
+ <fsummary>Take over a distributed application.</fsummary>
<desc>
- <p>Performs a takeover of the distributed application
+ <p>Takes over the distributed application
<c><anno>Application</anno></c>, which executes at another node
<c>Node</c>. At the current node, the application is
restarted by calling
<c>Module:start({takeover,Node},StartArgs)</c>. <c>Module</c>
and <c>StartArgs</c> are retrieved from the loaded application
specification. The application at the other node is not
- stopped until the startup is completed, i.e. when
+ stopped until the startup is completed, that is, when
<c>Module:start/2</c> and any calls to
<c>Module:start_phase/3</c> have returned.</p>
- <p>Thus two instances of the application will run simultaneously
- during the takeover, which makes it possible to transfer data
- from the old to the new instance. If this is not acceptable
- behavior, parts of the old instance may be shut down when
- the new instance is started. Note that the application may
- not be stopped entirely however, at least the top supervisor
+ <p>Thus, two instances of the application run simultaneously
+ during the takeover, so that data can be transferred
+ from the old to the new instance. If this is not an acceptable
+ behavior, parts of the old instance can be shut down when
+ the new instance is started. However, the application cannot
+ be stopped entirely, at least the top supervisor
must remain alive.</p>
- <p>See <c>start/1,2</c> for a description of <c>Type</c>.</p>
+ <p>For a description of <c>Type</c>, see
+ <seealso marker="#start/1"><c>start/1,2</c></seealso>.</p>
</desc>
</func>
<func>
<name name="unload" arity="1"/>
- <fsummary>Unload an application</fsummary>
+ <fsummary>Unload an application.</fsummary>
<desc>
<p>Unloads the application specification for <c><anno>Application</anno></c>
- from the application controller. It will also unload
+ from the application controller. It also unloads
the application specifications for any included applications.
- Note that the function does not purge the actual Erlang
+ Notice that the function does not purge the Erlang
object code.</p>
</desc>
</func>
<func>
<name name="unset_env" arity="2"/>
<name name="unset_env" arity="3"/>
- <fsummary>Unset the value of a configuration parameter</fsummary>
+ <fsummary>Unset the value of a configuration parameter.</fsummary>
<desc>
<p>Removes the configuration parameter <c><anno>Par</anno></c> and its value
for <c><anno>Application</anno></c>.</p>
<p><c>unset_env/2</c> uses the standard <c>gen_server</c>
- timeout value (5000 ms). The <c>timeout</c> option can be
- provided if another timeout value is useful, for example, in
+ time-out value (5000 ms). Option <c>timeout</c> can be
+ specified if another time-out value is useful, for example, in
situations where the application controller is heavily loaded.</p>
<p><c>unset_env/3</c> also allows the persistent option to be passed
- (see <c>set_env/4</c> above).</p>
- <warning>
- <p>Use this function only if you know what you are doing,
- that is, on your own applications. It is very application
- and configuration parameter dependent when and how often
- the value is read by the application, and careless use
- of this function may put the application in a
- weird, inconsistent, and malfunctioning state. </p>
+ (see <seealso marker="#set_env/4"><c>set_env/4</c></seealso>).</p>
+ <warning>
+ <p>Use this function only if you know what you are doing,
+ that is, on your own applications. It is very
+ application-dependent and configuration
+ parameter-dependent when and how often
+ the value is read by the application. Careless use
+ of this function can put the application in a
+ weird, inconsistent, and malfunctioning state.</p>
</warning>
</desc>
</func>
<func>
<name name="which_applications" arity="0"/>
<name name="which_applications" arity="1"/>
- <fsummary>Get the currently running applications</fsummary>
+ <fsummary>Get the currently running applications.</fsummary>
<desc>
- <p>Returns a list with information about the applications which
+ <p>Returns a list with information about the applications that
are currently running. <c><anno>Application</anno></c> is the application
- name. <c><anno>Description</anno></c> and <c><anno>Vsn</anno></c> are the values of its
- <c>description</c> and <c>vsn</c> application specification
+ name. <c><anno>Description</anno></c> and <c><anno>Vsn</anno></c> are the
+ values of their <c>description</c> and <c>vsn</c> application specification
keys, respectively.</p>
<p><c>which_applications/0</c> uses the standard
- <c>gen_server</c> timeout value (5000 ms). A <c><anno>Timeout</anno></c>
- argument can be provided if another timeout value is useful,
+ <c>gen_server</c> time-out value (5000 ms). A <c><anno>Timeout</anno></c>
+ argument can be specified if another time-out value is useful,
for example, in situations where the application controller
is heavily loaded.</p>
</desc>
@@ -452,81 +474,81 @@ Nodes = [cp1@cave, {cp2@cave, cp3@cave}]</code>
</funcs>
<section>
- <title>CALLBACK MODULE</title>
- <p>The following functions should be exported from an
+ <title>Callback Module</title>
+ <p>The following functions are to be exported from an
<c>application</c> callback module.</p>
</section>
<funcs>
<func>
<name>Module:start(StartType, StartArgs) -> {ok, Pid} | {ok, Pid, State} | {error, Reason}</name>
- <fsummary>Start an application</fsummary>
+ <fsummary>Start an application.</fsummary>
<type>
- <v>StartType = <seealso marker="#type-start_type">start_type()</seealso></v>
+ <v>StartType = <seealso marker="#type-start_type"><c>start_type()</c></seealso></v>
<v>StartArgs = term()</v>
<v>Pid = pid()</v>
<v>State = term()</v>
</type>
<desc>
<p>This function is called whenever an application is started
- using <c>application:start/1,2</c>, and should start
+ using <c>start/1,2</c>, and is to start
the processes of the application. If the application is
structured according to the OTP design principles as a
supervision tree, this means starting the top supervisor of
the tree.</p>
<p><marker id="start_type"/><c>StartType</c> defines the type of start:</p>
<list type="bulleted">
- <item><c>normal</c> if it's a normal startup.</item>
+ <item><c>normal</c> if it is a normal startup.</item>
<item><c>normal</c> also if the application is distributed and
- started at the current node due to a failover from another
+ started at the current node because of a failover from another
node, and the application specification key <c>start_phases == undefined</c>.</item>
<item><c>{takeover,Node}</c> if the application is
- distributed and started at the current node due to a
+ distributed and started at the current node because of a
takeover from <c>Node</c>, either because
- <c>application:takeover/2</c> has been called or because
+ <c>takeover/2</c> has been called or because
the current node has higher priority than <c>Node</c>.</item>
<item><c>{failover,Node}</c> if the application is
- distributed and started at the current node due to a
+ distributed and started at the current node because of a
failover from <c>Node</c>, and the application
specification key <c>start_phases /= undefined</c>.</item>
</list>
<p><c>StartArgs</c> is the <c>StartArgs</c> argument defined by
the application specification key <c>mod</c>.</p>
- <p>The function should return <c>{ok,Pid}</c> or
- <c>{ok,Pid,State}</c> where <c>Pid</c> is the pid of the top
+ <p>The function is to return <c>{ok,Pid}</c> or
+ <c>{ok,Pid,State}</c>, where <c>Pid</c> is the pid of the top
supervisor and <c>State</c> is any term. If omitted,
- <c>State</c> defaults to <c>[]</c>. If later the application
- is stopped, <c>State</c> is passed to
+ <c>State</c> defaults to <c>[]</c>. If the application
+ is stopped later, <c>State</c> is passed to
<c>Module:prep_stop/1</c>.</p>
</desc>
</func>
<func>
<name>Module:start_phase(Phase, StartType, PhaseArgs) -> ok | {error, Reason}</name>
- <fsummary>Extended start of an application</fsummary>
+ <fsummary>Extended start of an application.</fsummary>
<type>
<v>Phase = atom()</v>
- <v>StartType = <seealso marker="#type-start_type">start_type()</seealso></v>
+ <v>StartType = <seealso marker="#type-start_type"><c>start_type()</c></seealso></v>
<v>PhaseArgs = term()</v>
<v>Pid = pid()</v>
<v>State = state()</v>
</type>
<desc>
- <p>This function is used to start an application with included
- applications, when there is a need for synchronization between
+ <p>Starts an application with included
+ applications, when synchronization is needed between
processes in the different applications during startup.</p>
- <p>The start phases is defined by the application specification
+ <p>The start phases are defined by the application specification
key <c>start_phases == [{Phase,PhaseArgs}]</c>. For included
applications, the set of phases must be a subset of the set of
phases defined for the including application.</p>
<p>The function is called for each start phase (as defined for
the primary application) for the primary application and all
included applications, for which the start phase is defined.</p>
- <p>See <c>Module:start/2</c> for a description of
- <c>StartType</c>.</p>
+ <p>For a description of <c>StartType</c>, see
+ <seealso marker="Module:start/2"><c>Module:start/2</c></seealso>.</p>
</desc>
</func>
<func>
<name>Module:prep_stop(State) -> NewState</name>
- <fsummary>Prepare an application for termination</fsummary>
+ <fsummary>Prepare an application for termination.</fsummary>
<type>
<v>State = NewState = term()</v>
</type>
@@ -536,28 +558,26 @@ Nodes = [cp1@cave, {cp2@cave, cp3@cave}]</code>
the application.</p>
<p><c>State</c> is the state returned from
<c>Module:start/2</c>, or <c>[]</c> if no state was returned.
- <c>NewState</c> is any term and will be passed to
+ <c>NewState</c> is any term and is passed to
<c>Module:stop/1</c>.</p>
<p>The function is optional. If it is not defined, the processes
- will be terminated and then <c>Module:stop(State)</c> is
- called.</p>
+ are terminated and then <c>Module:stop(State)</c> is called.</p>
</desc>
</func>
<func>
<name>Module:stop(State)</name>
- <fsummary>Clean up after termination of an application</fsummary>
+ <fsummary>Clean up after termination of an application.</fsummary>
<type>
<v>State = term()</v>
</type>
<desc>
<p>This function is called whenever an application has stopped.
It is intended to be the opposite of <c>Module:start/2</c>
- and should do any necessary cleaning up. The return value is
+ and is to do any necessary cleaning up. The return value is
ignored.</p>
- <p><c>State</c> is the return value of
- <c>Module:prep_stop/1</c>, if such a function exists.
- Otherwise <c>State</c> is taken from the return value of
- <c>Module:start/2</c>.</p>
+ <p><c>State</c> is the return value of <c>Module:prep_stop/1</c>,
+ if such a function exists. Otherwise <c>State</c> is taken from
+ the return value of <c>Module:start/2</c>.</p>
</desc>
</func>
<func>
@@ -572,19 +592,18 @@ Nodes = [cp1@cave, {cp2@cave, cp3@cave}]</code>
</type>
<desc>
<p>This function is called by an application after a code
- replacement, if there are any changes to the configuration
- parameters.</p>
- <p><c>Changed</c> is a list of parameter-value tuples with all
- configuration parameters with changed values, <c>New</c> is
- a list of parameter-value tuples with all configuration
- parameters that have been added, and <c>Removed</c> is a list
- of all parameters that have been removed.</p>
+ replacement, if the configuration parameters have changed.</p>
+ <p><c>Changed</c> is a list of parameter-value tuples including all
+ configuration parameters with changed values.</p>
+ <p><c>New</c> is a list of parameter-value tuples including all
+ added configuration parameters.</p>
+ <p><c>Removed</c> is a list of all removed parameters.</p>
</desc>
</func>
</funcs>
<section>
- <title>SEE ALSO</title>
+ <title>See Also</title>
<p><seealso marker="doc/design_principles:des_princ">OTP Design Principles</seealso>,
<seealso marker="kernel_app">kernel(6)</seealso>,
<seealso marker="app">app(4)</seealso></p>
diff --git a/lib/kernel/doc/src/auth.xml b/lib/kernel/doc/src/auth.xml
index 71b1863e96..03f983b96d 100644
--- a/lib/kernel/doc/src/auth.xml
+++ b/lib/kernel/doc/src/auth.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,7 +29,7 @@
<rev></rev>
</header>
<module>auth</module>
- <modulesummary>Erlang Network Authentication Server</modulesummary>
+ <modulesummary>Erlang network authentication server.</modulesummary>
<description>
<p>This module is deprecated. For a description of the Magic
Cookie system, refer to
@@ -42,60 +42,60 @@
</datatypes>
<funcs>
<func>
- <name name="is_auth" arity="1"/>
- <fsummary>Status of communication authorization (deprecated)</fsummary>
- <desc>
- <p>Returns <c>yes</c> if communication with <c><anno>Node</anno></c> is
- authorized. Note that a connection to <c><anno>Node</anno></c> will
- be established in this case. Returns <c>no</c> if <c><anno>Node</anno></c>
- does not exist or communication is not authorized (it has
- another cookie than <c>auth</c> thinks it has).</p>
- <p>Use <seealso marker="net_adm#ping/1">net_adm:ping(<c><anno>Node</anno></c>)</seealso>
- instead.</p>
- </desc>
- </func>
- <func>
<name name="cookie" arity="0"/>
- <fsummary>Magic cookie for local node (deprecated)</fsummary>
+ <fsummary>Magic cookie for local node (deprecated).</fsummary>
<desc>
<p>Use
- <seealso marker="erts:erlang#erlang:get_cookie/0">erlang:get_cookie()</seealso>
- instead.</p>
+ <seealso marker="erts:erlang#erlang:get_cookie/0"><c>erlang:get_cookie()</c></seealso>
+ in <c>ERTS</c> instead.</p>
</desc>
</func>
<func>
<name name="cookie" arity="1"/>
- <fsummary>Set the magic for the local node (deprecated)</fsummary>
+ <fsummary>Set the magic for the local node (deprecated).</fsummary>
<type_desc variable="TheCookie">
- The cookie may also be given as a list with a single atom element.
+ The cookie can also be specified as a list with a single atom element.
</type_desc>
<desc>
<p>Use
- <seealso marker="erts:erlang#erlang:set_cookie/2">erlang:set_cookie(node(), <c><anno>Cookie</anno></c>)</seealso>
+ <seealso marker="erts:erlang#erlang:set_cookie/2"><c>erlang:set_cookie(node(), <anno>Cookie</anno>)</c>
+ in <c>ERTS</c></seealso> instead.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="is_auth" arity="1"/>
+ <fsummary>Status of communication authorization (deprecated).</fsummary>
+ <desc>
+ <p>Returns <c>yes</c> if communication with <c><anno>Node</anno></c> is
+ authorized. Notice that a connection to <c><anno>Node</anno></c>
+ is established in this case. Returns <c>no</c> if <c><anno>Node</anno></c>
+ does not exist or communication is not authorized (it has
+ another cookie than <c>auth</c> thinks it has).</p>
+ <p>Use <seealso marker="net_adm#ping/1"><c>net_adm:ping(<anno>Node</anno>)</c></seealso>
instead.</p>
</desc>
</func>
<func>
<name>node_cookie([Node, Cookie]) -> yes | no</name>
- <fsummary>Set the magic cookie for a node and verify authorization (deprecated)</fsummary>
+ <fsummary>Set the magic cookie for a node and verify authorization (deprecated).</fsummary>
<type>
<v>Node = node()</v>
- <v>Cookie = <seealso marker="#type-cookie">cookie()</seealso></v>
+ <v>Cookie = <seealso marker="#type-cookie"><c>cookie()</c></seealso></v>
</type>
<desc>
<p>Equivalent to
- <seealso marker="#node_cookie/2">node_cookie(Node, Cookie)</seealso>.</p>
+ <seealso marker="#node_cookie/2"><c>node_cookie(Node, Cookie)</c></seealso>.</p>
</desc>
</func>
<func>
<name name="node_cookie" arity="2"/>
- <fsummary>Set the magic cookie for a node and verify authorization (deprecated)</fsummary>
+ <fsummary>Set the magic cookie for a node and verify authorization (deprecated).</fsummary>
<desc>
- <p>Sets the magic cookie of <c><anno>Node</anno></c> to <c><anno>Cookie</anno></c>, and
- verifies the status of the authorization.
+ <p>Sets the magic cookie of <c><anno>Node</anno></c> to
+ <c><anno>Cookie</anno></c> and verifies the status of the authorization.
Equivalent to calling
- <seealso marker="erts:erlang#erlang:set_cookie/2">erlang:set_cookie(<c><anno>Node</anno></c>, <c><anno>Cookie</anno>)</c></seealso>, followed by
- <seealso marker="#is_auth/1">auth:is_auth(<c><anno>Node</anno></c>)</seealso>.</p>
+ <seealso marker="erts:erlang#erlang:set_cookie/2"><c>erlang:set_cookie(<anno>Node</anno>, <anno>Cookie</anno>)</c></seealso>, followed by
+ <seealso marker="#is_auth/1"><c>auth:is_auth(<anno>Node</anno>)</c></seealso>.</p>
</desc>
</func>
</funcs>
diff --git a/lib/kernel/doc/src/book.xml b/lib/kernel/doc/src/book.xml
index 8eaff39dc5..81a87d126d 100644
--- a/lib/kernel/doc/src/book.xml
+++ b/lib/kernel/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/kernel/doc/src/code.xml b/lib/kernel/doc/src/code.xml
index 819da544c3..d3611d6a03 100644
--- a/lib/kernel/doc/src/code.xml
+++ b/lib/kernel/doc/src/code.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,238 +29,240 @@
<rev></rev>
</header>
<module>code</module>
- <modulesummary>Erlang Code Server</modulesummary>
+ <modulesummary>Erlang code server.</modulesummary>
<description>
<p>This module contains the interface to the Erlang
<em>code server</em>, which deals with the loading of compiled
code into a running Erlang runtime system.</p>
- <p>The runtime system can be started in either <em>embedded</em> or
- <em>interactive</em> mode. Which one is decided by the command
- line flag <c>-mode</c>.</p>
+ <p>The runtime system can be started in <em>embedded</em> or
+ <em>interactive</em> mode. Which one is decided by command-line
+ flag <c>-mode</c>:</p>
<pre>
% <input>erl -mode interactive</input></pre>
- <p>Default mode is <c>interactive</c>.</p>
+ <p>The modes are as follows:</p>
<list type="bulleted">
<item>
- <p>In embedded mode, all code is loaded during system start-up
+ <p>In embedded mode, all code is loaded during system startup
according to the boot script. (Code can also be loaded later
by explicitly ordering the code server to do so).</p>
</item>
<item>
- <p>In interactive mode, only some code is loaded during system
- startup-up, basically the modules needed by the runtime
- system itself. Other code is dynamically loaded when first
+ <p>In interactive mode, which is default, only some code is loaded
+ during system startup, basically the modules needed by the runtime
+ system. Other code is dynamically loaded when first
referenced. When a call to a function in a certain module is
made, and the module is not loaded, the code server searches
for and tries to load the module.</p>
</item>
</list>
- <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
+ <p>To prevent accidentally reloading of modules affecting the Erlang
+ runtime system, directories <c>kernel</c>, <c>stdlib</c>,
+ and <c>compiler</c> are considered <em>sticky</em>. This
means that the system issues a warning and rejects the request if
a user tries to reload a module residing in any of them.
- The feature can be disabled by using the command line flag
+ The feature can be disabled by using command-line flag
<c>-nostick</c>.</p>
</description>
<section>
<title>Code Path</title>
- <p>In interactive mode, the code server maintains a search path --
- usually called the <em>code path</em> -- consisting of a list of
+ <p>In interactive mode, the code server maintains a search path,
+ usually called the <em>code path</em>, consisting of a list of
directories, which it searches sequentially when trying to load a
module.</p>
<p>Initially, the code path consists of the current working
- directory and all Erlang object code directories under the library
+ directory and all Erlang object code directories under library
directory <c>$OTPROOT/lib</c>, where <c>$OTPROOT</c> is
the installation directory of Erlang/OTP, <c>code:root_dir()</c>.
Directories can be named <c>Name[-Vsn]</c> and the code server,
by default, chooses the directory with the highest version number
- among those which have the same <c>Name</c>. The <c>-Vsn</c>
- suffix is optional. If an <c>ebin</c> directory exists under
- <c>Name[-Vsn]</c>, it is this directory which is added to
- the code path.</p>
- <p>The environment variable <c>ERL_LIBS</c> (defined in the operating
- system) can be used to define additional library directories that
- will be handled in the same way as the standard OTP library
- directory described above, except that directories that do not
- have an <c>ebin</c> directory will be ignored.</p>
+ among those having the same <c>Name</c>. Suffix <c>-Vsn</c>
+ is optional. If an <c>ebin</c> directory exists under
+ <c>Name[-Vsn]</c>, this directory is added to the code path.</p>
+ <p>Environment variable <c>ERL_LIBS</c> (defined in the operating
+ system) can be used to define more library directories to
+ be handled in the same way as the standard OTP library
+ directory described above, except that directories without
+ an <c>ebin</c> directory are ignored.</p>
<p>All application directories found in the additional directories
- will appear before the standard OTP applications, except for the
- Kernel and STDLIB applications, which will be placed before any
- additional applications. In other words, modules found in any
- of the additional library directories will override modules with
- the same name in OTP, except for modules in Kernel and
- STDLIB.</p>
- <p>The environment variable <c>ERL_LIBS</c> (if defined) should contain
+ appears before the standard OTP applications, except for the
+ <c>Kernel</c> and <c>STDLIB</c> applications, which are placed before
+ any additional applications. In other words, modules found in any
+ of the additional library directories override modules with
+ the same name in OTP, except for modules in <c>Kernel</c> and
+ <c>STDLIB</c>.</p>
+ <p>Environment variable <c>ERL_LIBS</c> (if defined) is to contain
a colon-separated (for Unix-like systems) or semicolon-separated
(for Windows) list of additional libraries.</p>
- <p>Example: On an Unix-like system, <c>ERL_LIBS</c> could be set to
- <c>/usr/local/jungerl:/home/some_user/my_erlang_lib</c>. (On Windows,
- use semi-colon as separator.)</p>
+ <p><em>Example:</em></p>
+ <p>On a Unix-like system, <c>ERL_LIBS</c> can be set to the following</p>
+ <code>
+/usr/local/jungerl:/home/some_user/my_erlang_lib</code>
+ <p>On Windows, use semi-colon as separator.</p>
</section>
<section>
<title>Loading of Code From Archive Files</title>
- <warning><p>The support for loading of code from archive files is
- experimental. The sole purpose of releasing it before it is ready
+ <warning><p>The support for loading code from archive files is
+ experimental. The purpose of releasing it before it is ready
is to obtain early feedback. The file format, semantics,
- interfaces etc. may be changed in a future release. The function
- <c>lib_dir/2</c> and the flag <c>-code_path_choice</c> are also
+ interfaces, and so on, can be changed in a future release. The function
+ <seealso marker="#lib_dir/2"><c>lib_dir/2</c></seealso>
+ and flag <c>-code_path_choice</c> are also
experimental.</p></warning>
- <p>In the current implementation, Erlang archives are <c>ZIP</c>
- files with <c>.ez</c> extension. Erlang archives may also be
+ <p>The Erlang archives are <c>ZIP</c>
+ files with extension <c>.ez</c>. Erlang archives can also be
enclosed in <c>escript</c> files whose file extension is arbitrary.</p>
- <p>Erlang archive files may contain entire Erlang applications or
+ <p>Erlang archive files can contain entire Erlang applications or
parts of applications. The structure in an archive file is the
- same as the directory structure for an application. If you for
- example would create an archive of <c>mnesia-4.4.7</c>, the
+ same as the directory structure for an application. If you, for
+ example, create an archive of <c>mnesia-4.4.7</c>, the
archive file must be named <c>mnesia-4.4.7.ez</c> and it must
- contain a top directory with the name <c>mnesia-4.4.7</c>. If the
+ contain a top directory named <c>mnesia-4.4.7</c>. If the
version part of the name is omitted, it must also be omitted in
the archive. That is, a <c>mnesia.ez</c> archive must contain a
<c>mnesia</c> top directory.</p>
- <p>An archive file for an application may for example be
+ <p>An archive file for an application can, for example, be
created like this:</p>
<pre>
- zip:create("mnesia-4.4.7.ez",
- ["mnesia-4.4.7"],
- [{cwd, code:lib_dir()},
- {compress, all},
- {uncompress,[".beam",".app"]}]).</pre>
-
- <p>Any file in the archive may be compressed, but in order to
- speed up the access of frequently read files, it may be a good
+zip:create("mnesia-4.4.7.ez",
+ ["mnesia-4.4.7"],
+ [{cwd, code:lib_dir()},
+ {compress, all},
+ {uncompress,[".beam",".app"]}]).</pre>
+
+ <p>Any file in the archive can be compressed, but to
+ speed up the access of frequently read files, it can be a good
idea to store <c>beam</c> and <c>app</c> files uncompressed in
the archive.</p>
- <p>Normally the top directory of an application is located either
- in the library directory <c>$OTPROOT/lib</c> or in a directory
- referred to by the environment variable <c>ERL_LIBS</c>. At
- startup when the initial code path is computed, the code server
- will also look for archive files in these directories and
- possibly add <c>ebin</c> directories in archives to the code path. The
- code path will then contain paths to directories that looks like
+ <p>Normally the top directory of an application is located
+ in library directory <c>$OTPROOT/lib</c> or in a directory
+ referred to by environment variable <c>ERL_LIBS</c>. At
+ startup, when the initial code path is computed, the code server
+ also looks for archive files in these directories and
+ possibly adds <c>ebin</c> directories in archives to the code path. The
+ code path then contains paths to directories that look like
<c>$OTPROOT/lib/mnesia.ez/mnesia/ebin</c> or
<c>$OTPROOT/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin</c>.</p>
- <p>The code server uses the module <c>erl_prim_loader</c>
- (possibly via the <c>erl_boot_server</c>) to read code files from
- archives. But the functions in <c>erl_prim_loader</c> may also be
+ <p>The code server uses module <c>erl_prim_loader</c> in <c>ERTS</c>
+ (possibly through <c>erl_boot_server</c>) to read code files from
+ archives. However, the functions in <c>erl_prim_loader</c> can also be
used by other applications to read files from archives. For
example, the call
<c>erl_prim_loader:list_dir( "/otp/root/lib/mnesia-4.4.7.ez/mnesia-4.4.7/examples/bench)"</c>
would list the contents of a directory inside an archive.
- See <seealso marker="erts:erl_prim_loader">erl_prim_loader(3)</seealso>.</p>
+ See <seealso marker="erts:erl_prim_loader"><c>erl_prim_loader(3)</c></seealso>.</p>
<p>An application archive file and a regular application directory
- may coexist. This may be useful when there is a need of having
+ can coexist. This can be useful when it is needed to have
parts of the application as regular files. A typical case is the
- <c>priv</c> directory which must reside as a regular directory in
- order to be able to dynamically link in drivers and start port
- programs. For other applications that do not have this need, the
- <c>priv</c> directory may reside in the archive and the files
- under the <c>priv</c> directory may be read via the
+ <c>priv</c> directory, which must reside as a regular directory
+ to link in drivers dynamically and start port programs.
+ For other applications that do not need this, directory
+ <c>priv</c> can reside in the archive and the files
+ under the directory <c>priv</c> can be read through
<c>erl_prim_loader</c>.</p>
- <p>At the time point when a directory is added to the code path as
- well as when the entire code path is (re)set, the code server
- will decide which subdirectories in an application that shall be
- read from the archive and which that shall be read as regular
+ <p>When a directory is added to the code path and
+ when the entire code path is (re)set, the code server
+ decides which subdirectories in an application that are to be
+ read from the archive and which that are to be read as regular
files. If directories are added or removed afterwards, the file
- access may fail if the code path is not updated (possibly to the
- same path as before in order to trigger the directory resolution
- update). For each directory on the second level (ebin, priv, src
- etc.) in the application archive, the code server will firstly
- choose the regular directory if it exists and secondly from the
- archive. The function
- <c>code:lib_dir/2</c> returns the path to the subdirectory. For
- example <c>code:lib_dir(megaco,ebin)</c> may return
+ access can fail if the code path is not updated (possibly to the
+ same path as before, to trigger the directory resolution
+ update).</p>
+
+ <p>For each directory on the second level in the application archive
+ (<c>ebin</c>, <c>priv</c>, <c>src</c>, and so on), the code server first
+ chooses the regular directory if it exists and second from the
+ archive. Function <c>code:lib_dir/2</c> returns the path to the
+ subdirectory. For example, <c>code:lib_dir(megaco,ebin)</c> can return
<c>/otp/root/lib/megaco-3.9.1.1.ez/megaco-3.9.1.1/ebin</c> while
- <c>code:lib_dir(megaco,priv)</c> may return
+ <c>code:lib_dir(megaco,priv)</c> can return
<c>/otp/root/lib/megaco-3.9.1.1/priv</c>.</p>
<p>When an <c>escript</c> file contains an archive, there are
- neither restrictions on the name of the <c>escript</c> nor on how
- many applications that may be stored in the embedded
- archive. Single <c>beam</c> files may also reside on the top
- level in the archive. At startup, both the top directory in the
- embedded archive as well as all (second level) <c>ebin</c>
+ no restrictions on the name of the <c>escript</c> and no restrictions
+ on how many applications that can be stored in the embedded
+ archive. Single Beam files can also reside on the top
+ level in the archive. At startup, the top directory in the
+ embedded archive and all (second level) <c>ebin</c>
directories in the embedded archive are added to the code path.
- See <seealso marker="erts:escript">escript(1)</seealso></p>
+ See <seealso marker="erts:escript"><c>erts:escript(1)</c></seealso>.</p>
<p>When the choice of directories in the code path is
- <c>strict</c>, the directory that ends up in the code path will
- be exactly the stated one. This means that if for example the
+ <c>strict</c>, the directory that ends up in the code path is
+ exactly the stated one. This means that if, for example, the
directory <c>$OTPROOT/lib/mnesia-4.4.7/ebin</c> is explicitly
- added to the code path, the code server will not load files from
- <c>$OTPROOT/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin</c> and vice
- versa. </p>
+ added to the code path, the code server does not load files from
+ <c>$OTPROOT/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin</c>.</p>
- <p>This behavior can be controlled via the command line flag
+ <p>This behavior can be controlled through command-line flag
<c>-code_path_choice Choice</c>. If the flag is set to <c>relaxed</c>,
- the code server will instead choose a suitable directory
- depending on the actual file structure. If there exists a regular
- application ebin directory, it will be chosen. But if it does
- not exist, the ebin directory in the archive is chosen if it
- exists. If neither of them exists the original directory will be
+ the code server instead chooses a suitable directory
+ depending on the actual file structure. If a regular
+ application <c>ebin</c> directory exists, it is chosen. Otherwise,
+ the directory <c>ebin</c> in the archive is chosen if it
+ exists. If neither of them exists, the original directory is
chosen.</p>
- <p>The command line flag <c>-code_path_choice Choice</c> does also
- affect how <c>init</c> interprets the <c>boot script</c>. The
- interpretation of the explicit code paths in the <c>boot
- script</c> may be <c>strict</c> or <c>relaxed</c>. It is
- particular useful to set the flag to <c>relaxed</c> when you want
- to elaborate with code loading from archives without editing the
+ <p>Command-line flag <c>-code_path_choice Choice</c> also
+ affects how module <c>init</c> interprets the <c>boot script</c>.
+ The interpretation of the explicit code paths in the <c>boot
+ script</c> can be <c>strict</c> or <c>relaxed</c>. It is
+ particularly useful to set the flag to <c>relaxed</c> when
+ elaborating with code loading from archives without editing the
<c>boot script</c>. The default is <c>relaxed</c>. See <seealso
- marker="erts:init">init(3)</seealso></p></section>
+ marker="erts:init"><c>erts:init(3)</c></seealso>.</p></section>
<section>
<title>Current and Old Code</title>
- <p>The code of a module can exists in two variants in a system:
+ <p>The code for a module can exist in two variants in a system:
<em>current code</em> and <em>old code</em>. When a module is
- loaded into the system for the first time, the code of the module
+ loaded into the system for the first time, the module code
becomes 'current' and the global <em>export table</em> is updated
with references to all functions exported from the module.</p>
- <p>If then a new instance of the module is loaded (perhaps because
- of the correction of an error), then the code of the previous
+ <p>If then a new instance of the module is loaded (for example, because of
+ error correction), the code of the previous
instance becomes 'old', and all export entries referring to
- the previous instance are removed. After that the new instance is
- loaded as if it was loaded for the first time, as described above,
- and becomes 'current'.</p>
- <p>Both old and current code for a module are valid, and may even be
+ the previous instance are removed. After that, the new instance is
+ loaded as for the first time, and becomes 'current'.</p>
+ <p>Both old and current code for a module are valid, and can even be
evaluated concurrently. The difference is that exported functions
- in old code are unavailable. Hence there is no way to make a
- global call to an exported function in old code, but old code may
+ in old code are unavailable. Hence, a global call cannot be made
+ to an exported function in old code, but old code can
still be evaluated because of processes lingering in it.</p>
- <p>If a third instance of the module is loaded, the code server will
- remove (purge) the old code and any processes lingering in it will
- be terminated. Then the third instance becomes 'current' and
+ <p>If a third instance of the module is loaded, the code server
+ removes (purges) the old code and any processes lingering in it
+ are terminated. Then the third instance becomes 'current' and
the previously current code becomes 'old'.</p>
<p>For more information about old and current code, and how to
- make a process switch from old to current code, refer to
+ make a process switch from old to current code, see section
+ Compilation and Code Loading in the
<seealso marker="doc/reference_manual:code_loading">Erlang Reference Manual</seealso>.</p>
</section>
<section>
<title>Argument Types and Invalid Arguments</title>
- <p>Generally, module and application names are atoms, while file and directory
+ <p>Module and application names are atoms, while file and directory
names are strings. For backward compatibility reasons, some functions accept
both strings and atoms, but a future release will probably only allow
the arguments that are documented.</p>
- <p>From the R12B release, functions in this module will generally fail with an
- exception if they are passed an incorrect type (for instance, an integer or a tuple
- where an atom was expected). An error tuple will be returned if the type of the argument
- was correct, but there was some other error (for instance, a non-existing directory
- was given to <c>set_path/1</c>).</p>
+ <p>As from Erlang/OTP R12B, functions in this module generally fail with an
+ exception if they are passed an incorrect type (for example, an integer or a tuple
+ where an atom is expected). An error tuple is returned if the argument type
+ is correct, but there are some other errors (for example, a non-existing directory
+ is specified to <c>set_path/1</c>).</p>
</section>
<section>
@@ -312,33 +314,36 @@
</datatype>
<datatype>
<name name="prepared_code"/>
- <desc>An opaque term holding prepared code.</desc>
+ <desc><p>An opaque term holding prepared code.</p></desc>
</datatype>
</datatypes>
<funcs>
<func>
<name name="set_path" arity="1"/>
- <fsummary>Set the code server search path</fsummary>
+ <fsummary>Set the code server search path.</fsummary>
<desc>
<p>Sets the code path to the list of directories <c><anno>Path</anno></c>.</p>
- <p>Returns <c>true</c> if successful, or
- <c>{error, bad_directory}</c> if any <c><anno>Dir</anno></c> is not
- the name of a directory, or <c>{error, bad_path}</c> if
- the argument is invalid.</p>
+ <p>Returns:</p>
+ <taglist>
+ <tag><c>true</c></tag>
+ <item><p>If successful</p></item>
+ <tag><c>{error, bad_directory}</c></tag>
+ <item><p>If any <c><anno>Dir</anno></c> is not a directory name</p></item>
+ </taglist>
</desc>
</func>
<func>
<name name="get_path" arity="0"/>
- <fsummary>Return the code server search path</fsummary>
+ <fsummary>Return the code server search path.</fsummary>
<desc>
- <p>Returns the code path</p>
+ <p>Returns the code path.</p>
</desc>
</func>
<func>
<name name="add_path" arity="1"/>
<name name="add_pathz" arity="1"/>
- <fsummary>Add a directory to the end of the code path</fsummary>
+ <fsummary>Add a directory to the end of the code path.</fsummary>
<type name="add_path_ret"/>
<desc>
<p>Adds <c><anno>Dir</anno></c> to the code path. The directory is added as
@@ -351,11 +356,11 @@
</func>
<func>
<name name="add_patha" arity="1"/>
- <fsummary>Add a directory to the beginning of the code path</fsummary>
+ <fsummary>Add a directory to the beginning of the code path.</fsummary>
<type name="add_path_ret"/>
<desc>
<p>Adds <c><anno>Dir</anno></c> to the beginning of the code path. If
- <c><anno>Dir</anno></c> already exists, it is removed from the old
+ <c><anno>Dir</anno></c> exists, it is removed from the old
position in the code path.</p>
<p>Returns <c>true</c> if successful, or
<c>{error, bad_directory}</c> if <c><anno>Dir</anno></c> is not the name
@@ -365,69 +370,81 @@
<func>
<name name="add_paths" arity="1"/>
<name name="add_pathsz" arity="1"/>
- <fsummary>Add directories to the end of the code path</fsummary>
+ <fsummary>Add directories to the end of the code path.</fsummary>
<desc>
<p>Adds the directories in <c><anno>Dirs</anno></c> to the end of the code
- path. If a <c><anno>Dir</anno></c> already exists, it is not added. This
- function always returns <c>ok</c>, regardless of the validity
+ path. If a <c><anno>Dir</anno></c> exists, it is not added.</p>
+ <p>Always returns <c>ok</c>, regardless of the validity
of each individual <c><anno>Dir</anno></c>.</p>
</desc>
</func>
<func>
<name name="add_pathsa" arity="1"/>
- <fsummary>Add directories to the beginning of the code path</fsummary>
+ <fsummary>Add directories to the beginning of the code path.</fsummary>
<desc>
<p>Adds the directories in <c><anno>Dirs</anno></c> to the beginning of
- the code path. If a <c><anno>Dir</anno></c> already exists, it is removed
- from the old position in the code path. This function always
- returns <c>ok</c>, regardless of the validity of each
+ the code path. If a <c><anno>Dir</anno></c> exists, it is removed
+ from the old position in the code path.</p>
+ <p>Always returns <c>ok</c>, regardless of the validity of each
individual <c><anno>Dir</anno></c>.</p>
</desc>
</func>
<func>
<name name="del_path" arity="1"/>
- <fsummary>Delete a directory from the code path</fsummary>
+ <fsummary>Delete a directory from the code path.</fsummary>
<desc>
<p>Deletes a directory from the code path. The argument can be
an atom <c><anno>Name</anno></c>, in which case the directory with
the name <c>.../<anno>Name</anno>[-Vsn][/ebin]</c> is deleted from the code
- path. It is also possible to give the complete directory name
- <c><anno>Dir</anno></c> as argument.</p>
- <p>Returns <c>true</c> if successful, or <c>false</c> if
- the directory is not found, or <c>{error, bad_name}</c> if
- the argument is invalid.</p>
+ path. Also, the complete directory name <c><anno>Dir</anno></c> can be
+ specified as argument.</p>
+ <p>Returns:</p>
+ <taglist>
+ <tag><c>true</c></tag>
+ <item><p>If successful</p></item>
+ <tag><c>false</c></tag>
+ <item><p>If the directory is not found</p></item>
+ <tag><c>{error, bad_name}</c></tag>
+ <item><p>If the argument is invalid</p></item>
+ </taglist>
</desc>
</func>
<func>
<name name="replace_path" arity="2"/>
- <fsummary>Replace a directory with another in the code path</fsummary>
- <desc>
- <p>This function replaces an old occurrence of a directory
- named <c>.../<anno>Name</anno>[-Vsn][/ebin]</c>, in the code path, with
- <c><anno>Dir</anno></c>. If <c><anno>Name</anno></c> does not exist, it adds the new
- directory <c><anno>Dir</anno></c> last in the code path. The new directory
- must also be named <c>.../<anno>Name</anno>[-Vsn][/ebin]</c>. This function
- should be used if a new version of the directory (library) is
+ <fsummary>Replace a directory with another in the code path.</fsummary>
+ <desc>
+ <p>Replaces an old occurrence of a directory
+ named <c>.../<anno>Name</anno>[-Vsn][/ebin]</c> in the code path, with
+ <c><anno>Dir</anno></c>. If <c><anno>Name</anno></c> does not exist, it adds
+ the new directory <c><anno>Dir</anno></c> last in the code path. The new
+ directory must also be named <c>.../<anno>Name</anno>[-Vsn][/ebin]</c>.
+ This function is to be used if a new version of the directory (library) is
added to a running system.</p>
- <p>Returns <c>true</c> if successful, or
- <c>{error, bad_name}</c> if <c><anno>Name</anno></c> is not found, or
- <c>{error, bad_directory}</c> if <c><anno>Dir</anno></c> does not exist, or
- <c>{error, {badarg, [<anno>Name</anno>, <anno>Dir</anno>]}}</c> if <c><anno>Name</anno></c> or
- <c><anno>Dir</anno></c> is invalid.</p>
+ <p>Returns:</p>
+ <taglist>
+ <tag><c>true</c></tag>
+ <item><p>If successful</p></item>
+ <tag><c>{error, bad_name}</c></tag>
+ <item><p>If <c><anno>Name</anno></c> is not found</p></item>
+ <tag><c>{error, bad_directory}</c></tag>
+ <item><p>If <c><anno>Dir</anno></c> does not exist</p></item>
+ <tag><c>{error, {badarg, [<anno>Name</anno>, <anno>Dir</anno>]}}</c></tag>
+ <item><p>If <c><anno>Name</anno></c> or <c><anno>Dir</anno></c> is invalid</p></item>
+ </taglist>
</desc>
</func>
<func>
<name name="load_file" arity="1"/>
- <fsummary>Load a module</fsummary>
+ <fsummary>Load a module.</fsummary>
<type name="load_ret"/>
<desc>
<p>Tries to load the Erlang module <c><anno>Module</anno></c>, using
the code path. It looks for the object code file with an
- extension that corresponds to the Erlang machine used, for
- example <c><anno>Module</anno>.beam</c>. The loading fails if the module
+ extension corresponding to the Erlang machine used, for
+ example, <c><anno>Module</anno>.beam</c>. The loading fails if the module
name found in the object code differs from the name
<c><anno>Module</anno></c>.
- <seealso marker="#load_binary/3">load_binary/3</seealso> must
+ <seealso marker="#load_binary/3"><c>load_binary/3</c></seealso> must
be used to load object code with a module name that is
different from the file name.</p>
<p>Returns <c>{module, <anno>Module</anno>}</c> if successful, or
@@ -437,45 +454,45 @@
</func>
<func>
<name name="load_abs" arity="1"/>
- <fsummary>Load a module, residing in a given file</fsummary>
+ <fsummary>Load a module, residing in a specified file.</fsummary>
<type name="load_ret"/>
<type name="loaded_filename"/>
<type name="loaded_ret_atoms"/>
<desc>
- <p>Does the same as <c>load_file(<anno>Module</anno>)</c>, but
- <c><anno>Filename</anno></c> is either an absolute file name, or a
- relative file name. The code path is not searched. It returns
+ <p>Same as <c>load_file(<anno>Module</anno>)</c>, but
+ <c><anno>Filename</anno></c> is an absolute or
+ relative filename. The code path is not searched. It returns
a value in the same way as
- <seealso marker="#load_file/1">load_file/1</seealso>. Note
- that <c><anno>Filename</anno></c> should not contain the extension (for
- example <c>".beam"</c>); <c>load_abs/1</c> adds the correct
- extension itself.</p>
+ <seealso marker="#load_file/1"><c>load_file/1</c></seealso>. Notice
+ that <c><anno>Filename</anno></c> must not contain the extension (for
+ example, <c>.beam</c>) because <c>load_abs/1</c> adds the correct
+ extension.</p>
</desc>
</func>
<func>
<name name="ensure_loaded" arity="1"/>
- <fsummary>Ensure that a module is loaded</fsummary>
+ <fsummary>Ensure that a module is loaded.</fsummary>
<desc>
- <p>Tries to to load a module in the same way as
- <seealso marker="#load_file/1">load_file/1</seealso>,
+ <p>Tries to load a module in the same way as
+ <seealso marker="#load_file/1"><c>load_file/1</c></seealso>,
unless the module is already loaded.
- In embedded mode, however, it does not load a module which is not
+ However, in embedded mode it does not load a module that is not
already loaded, but returns <c>{error, embedded}</c> instead.
See <seealso marker="#error_reasons">Error Reasons for Code-Loading Functions</seealso> for a description of other possible error reasons.</p>
</desc>
</func>
<func>
<name name="load_binary" arity="3"/>
- <fsummary>Load object code for a module</fsummary>
+ <fsummary>Load object code for a module.</fsummary>
<type name="loaded_filename"/>
<type name="loaded_ret_atoms"/>
<desc>
<p>This function can be used to load object code on remote
- Erlang nodes. The argument <c><anno>Binary</anno></c> must contain
+ Erlang nodes. Argument <c><anno>Binary</anno></c> must contain
object code for <c><anno>Module</anno></c>.
<c><anno>Filename</anno></c> is only used by the code server to keep a
record of from which file the object code for <c><anno>Module</anno></c>
- comes. Accordingly, <c><anno>Filename</anno></c> is not opened and read by
+ comes. Thus, <c><anno>Filename</anno></c> is not opened and read by
the code server.</p>
<p>Returns <c>{module, <anno>Module</anno>}</c> if successful, or
<c>{error, Reason}</c> if loading fails.
@@ -616,92 +633,94 @@ ok = code:finish_loading(Prepared),
</func>
<func>
<name name="delete" arity="1"/>
- <fsummary>Removes current code for a module</fsummary>
+ <fsummary>Remove current code for a module.</fsummary>
<desc>
<p>Removes the current code for <c><anno>Module</anno></c>, that is,
the current code for <c><anno>Module</anno></c> is made old. This means
that processes can continue to execute the code in the module,
- but that no external function calls can be made to it.</p>
+ but no external function calls can be made to it.</p>
<p>Returns <c>true</c> if successful, or <c>false</c> if there
- is old code for <c><anno>Module</anno></c> which must be purged first, or
+ is old code for <c><anno>Module</anno></c> that must be purged first, or
if <c><anno>Module</anno></c> is not a (loaded) module.</p>
</desc>
</func>
<func>
<name name="purge" arity="1"/>
- <fsummary>Removes old code for a module</fsummary>
+ <fsummary>Remove old code for a module.</fsummary>
<desc>
<p>Purges the code for <c><anno>Module</anno></c>, that is, removes code
marked as old. If some processes still linger in the old code,
these processes are killed before the code is removed.</p>
- <p>Returns <c>true</c> if successful and any process needed to
+ <p>Returns <c>true</c> if successful and any process is needed to
be killed, otherwise <c>false</c>.</p>
</desc>
</func>
<func>
<name name="soft_purge" arity="1"/>
- <fsummary>Removes old code for a module, unless no process uses it</fsummary>
+ <fsummary>Remove old code for a module, unless no process uses it.</fsummary>
<desc>
<p>Purges the code for <c><anno>Module</anno></c>, that is, removes code
marked as old, but only if no processes linger in it.</p>
- <p>Returns <c>false</c> if the module could not be purged due
- to processes lingering in old code, otherwise <c>true</c>.</p>
+ <p>Returns <c>false</c> if the module cannot be purged because
+ of processes lingering in old code, otherwise <c>true</c>.</p>
</desc>
</func>
<func>
<name name="is_loaded" arity="1"/>
- <fsummary>Check if a module is loaded</fsummary>
+ <fsummary>Check if a module is loaded.</fsummary>
<type name="loaded_filename"/>
<type name="loaded_ret_atoms"/>
- <type_desc name="loaded_filename"><c><anno>Filename</anno></c> is an absolute filename</type_desc>
+ <type_desc name="loaded_filename"><c><anno>Filename</anno></c> is an absolute
+ filename.</type_desc>
<desc>
<p>Checks if <c><anno>Module</anno></c> is loaded. If it is,
<c>{file, <anno>Loaded</anno>}</c> is returned, otherwise <c>false</c>.</p>
- <p>Normally, <c><anno>Loaded</anno></c> is the absolute file name
- <c>Filename</c> from which the code was obtained. If the module
+ <p>Normally, <c><anno>Loaded</anno></c> is the absolute filename
+ <c>Filename</c> from which the code is obtained. If the module
is preloaded (see
- <seealso marker="sasl:script">script(4)</seealso>),
- <c>Loaded==preloaded</c>. If the module is Cover compiled (see
- <seealso marker="tools:cover">cover(3)</seealso>),
+ <seealso marker="sasl:script"><c>sasl:script(4)</c></seealso>),
+ <c>Loaded==preloaded</c>. If the module is Cover-compiled (see
+ <seealso marker="tools:cover"><c>tools:cover(3)</c></seealso>),
<c>Loaded==cover_compiled</c>.</p>
</desc>
</func>
<func>
<name name="all_loaded" arity="0"/>
- <fsummary>Get all loaded modules</fsummary>
+ <fsummary>Get all loaded modules.</fsummary>
<type name="loaded_filename"/>
<type name="loaded_ret_atoms"/>
- <type_desc name="loaded_filename"><c><anno>Filename</anno></c> is an absolute filename</type_desc>
+ <type_desc name="loaded_filename"><c><anno>Filename</anno></c> is an absolute
+ filename.</type_desc>
<desc>
<p>Returns a list of tuples <c>{<anno>Module</anno>, <anno>Loaded</anno>}</c> for all
- loaded modules. <c><anno>Loaded</anno></c> is normally the absolute file
- name, as described for
- <seealso marker="#is_loaded/1">is_loaded/1</seealso>.</p>
+ loaded modules. <c><anno>Loaded</anno></c> is normally the absolute filename,
+ as described for
+ <seealso marker="#is_loaded/1"><c>is_loaded/1</c></seealso>.</p>
</desc>
</func>
<func>
<name name="which" arity="1"/>
- <fsummary>The object code file of a module</fsummary>
+ <fsummary>The object code file of a module.</fsummary>
<type name="loaded_ret_atoms"/>
<desc>
<p>If the module is not loaded, this function searches the code
- path for the first file which contains object code for
- <c><anno>Module</anno></c> and returns the absolute file name. If
- the module is loaded, it returns the name of the file which
- contained the loaded object code. If the module is pre-loaded,
- <c>preloaded</c> is returned. If the module is Cover compiled,
- <c>cover_compiled</c> is returned. <c>non_existing</c> is
- returned if the module cannot be found.</p>
+ path for the first file containing object code for
+ <c><anno>Module</anno></c> and returns the absolute filename.</p>
+ <p>If the module is loaded, it returns the name of the file
+ containing the loaded object code.</p>
+ <p>If the module is preloaded, <c>preloaded</c> is returned.</p>
+ <p>If the module is Cover-compiled, <c>cover_compiled</c> is returned.</p>
+ <p>If the module cannot be found, <c>non_existing</c> is returned.</p>
</desc>
</func>
<func>
<name name="get_object_code" arity="1"/>
- <fsummary>Get the object code for a module</fsummary>
+ <fsummary>Gets the object code for a module.</fsummary>
<desc>
- <p>Searches the code path for the object code of the module
- <c><anno>Module</anno></c>. It returns <c>{<anno>Module</anno>, <anno>Binary</anno>, <anno>Filename</anno>}</c>
- if successful, and <c>error</c> if not. <c><anno>Binary</anno></c> is a
- binary data object which contains the object code for
+ <p>Searches the code path for the object code of module
+ <c><anno>Module</anno></c>. Returns <c>{<anno>Module</anno>, <anno>Binary</anno>, <anno>Filename</anno>}</c>
+ if successful, otherwise <c>error</c>. <c><anno>Binary</anno></c> is a
+ binary data object, which contains the object code for
the module. This can be useful if code is to be loaded on a
remote node in a distributed system. For example, loading
module <c><anno>Module</anno></c> on a node <c>Node</c> is done as
@@ -715,10 +734,11 @@ rpc:call(Node, code, load_binary, [Module, Filename, Binary]),
</func>
<func>
<name name="root_dir" arity="0"/>
- <fsummary>Root directory of Erlang/OTP</fsummary>
+ <fsummary>Root directory of Erlang/OTP.</fsummary>
<desc>
<p>Returns the root directory of Erlang/OTP, which is
the directory where it is installed.</p>
+ <p><em>Example:</em></p>
<pre>
> <input>code:root_dir().</input>
"/usr/local/otp"</pre>
@@ -726,10 +746,11 @@ rpc:call(Node, code, load_binary, [Module, Filename, Binary]),
</func>
<func>
<name name="lib_dir" arity="0"/>
- <fsummary>Library directory of Erlang/OTP</fsummary>
+ <fsummary>Library directory of Erlang/OTP.</fsummary>
<desc>
<p>Returns the library directory, <c>$OTPROOT/lib</c>, where
<c>$OTPROOT</c> is the root directory of Erlang/OTP.</p>
+ <p><em>Example:</em></p>
<pre>
> <input>code:lib_dir().</input>
"/usr/local/otp/lib"</pre>
@@ -737,50 +758,49 @@ rpc:call(Node, code, load_binary, [Module, Filename, Binary]),
</func>
<func>
<name name="lib_dir" arity="1"/>
- <fsummary>Library directory for an application</fsummary>
+ <fsummary>Library directory for an application.</fsummary>
<desc>
- <p>This function is mainly intended for finding out the path
+ <p>Returns the path
for the "library directory", the top directory, for an
application <c><anno>Name</anno></c> located under <c>$OTPROOT/lib</c> or
- on a directory referred to via the <c>ERL_LIBS</c>
- environment variable.</p>
- <p>If there is a regular directory called <c><anno>Name</anno></c> or
- <c><anno>Name</anno>-Vsn</c> in the code path with an <c>ebin</c>
+ on a directory referred to with environment variable <c>ERL_LIBS</c>.</p>
+ <p>If a regular directory called <c><anno>Name</anno></c> or
+ <c><anno>Name</anno>-Vsn</c> exists in the code path with an <c>ebin</c>
subdirectory, the path to this directory is returned (not
- the <c>ebin</c> directory). If the directory refers to a
- directory in an archive, the archive name is stripped away
- before the path is returned. For example, if the directory
+ the <c>ebin</c> directory).</p>
+ <p>If the directory refers to a directory in an archive, the
+ archive name is stripped away before the path is returned.
+ For example, if directory
<c>/usr/local/otp/lib/mnesia-4.2.2.ez/mnesia-4.2.2/ebin</c>
is in the path, <c>/usr/local/otp/lib/mnesia-4.2.2/ebin</c>
- will be returned. This means that the library directory for
- an application is the same, regardless of whether the
+ is returned. This means that the library directory for
+ an application is the same, regardless if the
application resides in an archive or not.</p>
-
+ <p><em>Example:</em></p>
<pre>
> <input>code:lib_dir(mnesia).</input>
"/usr/local/otp/lib/mnesia-4.2.2"</pre>
<p>Returns <c>{error, bad_name}</c> if <c><anno>Name</anno></c>
is not the name of an application under <c>$OTPROOT/lib</c> or
- on a directory referred to via the <c>ERL_LIBS</c>
- environment variable. Fails with an exception if <c>Name</c>
- has the wrong type.</p>
+ on a directory referred to through environment variable <c>ERL_LIBS</c>.
+ Fails with an exception if <c>Name</c> has the wrong type.</p>
- <warning><p>For backward compatibility, <c><anno>Name</anno></c> is also allowed to
- be a string. That will probably change in a future release.</p></warning>
+ <warning><p>For backward compatibility, <c><anno>Name</anno></c> is also
+ allowed to be a string. That will probably change in a future release.</p></warning>
</desc>
</func>
<func>
<name name="lib_dir" arity="2"/>
- <fsummary>subdirectory for an application</fsummary>
+ <fsummary>Subdirectory for an application.</fsummary>
<desc>
<p>Returns the path to a subdirectory directly under the top
directory of an application. Normally the subdirectories
- resides under the top directory for the application, but when
- applications at least partly resides in an archive the
- situation is different. Some of the subdirectories may reside
- as regular directories while other resides in an archive
- file. It is not checked if this directory really exists.</p>
-
+ reside under the top directory for the application, but when
+ applications at least partly resides in an archive, the
+ situation is different. Some of the subdirectories can reside
+ as regular directories while other reside in an archive
+ file. It is not checked whether this directory exists.</p>
+ <p><em>Example:</em></p>
<pre>
> <input>code:lib_dir(megaco, priv).</input>
"/usr/local/otp/lib/megaco-3.9.1.1/priv"</pre>
@@ -791,7 +811,7 @@ rpc:call(Node, code, load_binary, [Module, Filename, Binary]),
</func>
<func>
<name name="compiler_dir" arity="0"/>
- <fsummary>Library directory for the compiler</fsummary>
+ <fsummary>Library directory for the compiler.</fsummary>
<desc>
<p>Returns the compiler library directory. Equivalent to
<c>code:lib_dir(compiler)</c>.</p>
@@ -799,10 +819,10 @@ rpc:call(Node, code, load_binary, [Module, Filename, Binary]),
</func>
<func>
<name name="priv_dir" arity="1"/>
- <fsummary>Priv directory for an application</fsummary>
+ <fsummary>Priv directory for an application.</fsummary>
<desc>
<p>Returns the path to the <c>priv</c> directory in an
- application. Equivalent to <c>code:lib_dir(<anno>Name</anno>, priv).</c>.</p>
+ application. Equivalent to <c>code:lib_dir(<anno>Name</anno>, priv)</c>.</p>
<warning><p>For backward compatibility, <c><anno>Name</anno></c> is also allowed to
be a string. That will probably change in a future release.</p></warning>
@@ -810,43 +830,43 @@ rpc:call(Node, code, load_binary, [Module, Filename, Binary]),
</func>
<func>
<name name="objfile_extension" arity="0"/>
- <fsummary>Object code file extension</fsummary>
+ <fsummary>Object code file extension.</fsummary>
<desc>
- <p>Returns the object code file extension that corresponds to
- the Erlang machine used, namely <c>".beam"</c>.</p>
+ <p>Returns the object code file extension corresponding to
+ the Erlang machine used, namely <c>.beam</c>.</p>
</desc>
</func>
<func>
<name name="stick_dir" arity="1"/>
- <fsummary>Mark a directory as sticky</fsummary>
+ <fsummary>Mark a directory as sticky.</fsummary>
<desc>
- <p>This function marks <c><anno>Dir</anno></c> as sticky.</p>
- <p>Returns <c>ok</c> if successful or <c>error</c> if not.</p>
+ <p>Marks <c><anno>Dir</anno></c> as sticky.</p>
+ <p>Returns <c>ok</c> if successful, otherwise <c>error</c>.</p>
</desc>
</func>
<func>
<name name="unstick_dir" arity="1"/>
- <fsummary>Remove a sticky directory mark</fsummary>
+ <fsummary>Remove a sticky directory mark.</fsummary>
<desc>
- <p>This function unsticks a directory which has been marked as
+ <p>Unsticks a directory that is marked as
sticky.</p>
- <p>Returns <c>ok</c> if successful or <c>error</c> if not.</p>
+ <p>Returns <c>ok</c> if successful, otherwise <c>error</c>.</p>
</desc>
</func>
<func>
<name name="is_sticky" arity="1"/>
- <fsummary>Test whether a module is sticky</fsummary>
+ <fsummary>Test if a module is sticky.</fsummary>
<desc>
- <p>This function returns <c>true</c> if <c><anno>Module</anno></c> is the
+ <p>Returns <c>true</c> if <c><anno>Module</anno></c> is the
name of a module that has been loaded from a sticky directory
- (or in other words: an attempt to reload the module will fail),
+ (in other words: an attempt to reload the module will fail),
or <c>false</c> if <c><anno>Module</anno></c> is not a loaded module or is
not sticky.</p>
</desc>
</func>
<func>
<name name="where_is_file" arity="1"/>
- <fsummary>Full name of a file located in the code path</fsummary>
+ <fsummary>Full name of a file located in the code path.</fsummary>
<desc>
<p>Searches the code path for <c><anno>Filename</anno></c>, a file of
arbitrary type. If found, the full name is returned.
@@ -859,32 +879,39 @@ rpc:call(Node, code, load_binary, [Module, Filename, Binary]),
<name name="clash" arity="0"/>
<fsummary>Search for modules with identical names.</fsummary>
<desc>
- <p>Searches the entire code space for module names with
+ <p>Searches all directories in the code path for module names with
identical names and writes a report to <c>stdout</c>.</p>
</desc>
</func>
<func>
<name name="is_module_native" arity="1"/>
- <fsummary>Test whether a module has native code</fsummary>
+ <fsummary>Test if a module has native code.</fsummary>
<desc>
- <p>This function returns <c>true</c> if <c><anno>Module</anno></c> is
- name of a loaded module that has native code loaded, and
- <c>false</c> if <c><anno>Module</anno></c> is loaded but does not have
- native. If <c><anno>Module</anno></c> is not loaded, this function returns
- <c>undefined</c>.</p>
+ <p>Returns:</p>
+ <taglist>
+ <tag><c>true</c></tag>
+ <item><p>If <c><anno>Module</anno></c> is the
+ name of a loaded module that has native code loaded</p></item>
+ <tag><c>false</c></tag>
+ <item><p>If <c><anno>Module</anno></c> is loaded but does not have
+ native code</p></item>
+ <tag><c>undefined</c></tag>
+ <item><p>If <c><anno>Module</anno></c> is not loaded</p></item>
+ </taglist>
</desc>
</func>
<func>
<name name="get_mode" arity="0"/>
- <fsummary>The code_server's mode.</fsummary>
+ <fsummary>The mode of the code server.</fsummary>
<desc>
- <p>This function returns an atom describing the code_server's mode:
- <c>interactive</c> or <c>embedded</c>. </p>
+ <p>Returns an atom describing the mode of the code server:
+ <c>interactive</c> or <c>embedded</c>.</p>
<p>This information is useful when an external entity (for example,
- an IDE) provides additional code for a running node. If in interactive
- mode, it only needs to add to the code path. If in embedded mode,
- the code has to be loaded with <c>load_binary/3</c></p>
+ an IDE) provides additional code for a running node. If the code server is
+ in interactive mode, it only has to add the path to the code. If the code server
+ is in embedded mode, the code must be loaded with
+ <seealso marker="#load_binary/3"><c>load_binary/3</c></seealso>.</p>
</desc>
</func>
</funcs>
diff --git a/lib/kernel/doc/src/config.xml b/lib/kernel/doc/src/config.xml
index 0e34549482..c5f37fd036 100644
--- a/lib/kernel/doc/src/config.xml
+++ b/lib/kernel/doc/src/config.xml
@@ -4,14 +4,14 @@
<fileref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@@ -19,7 +19,7 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-
+
</legalnotice>
<title>config</title>
@@ -33,94 +33,93 @@
<description>
<p>A <em>configuration file</em> contains values for configuration
parameters for the applications in the system. The <c>erl</c>
- command line argument <c>-config Name</c> tells the system to use
+ command-line argument <c>-config Name</c> tells the system to use
data in the system configuration file <c>Name.config</c>.</p>
- <p>Configuration parameter values in the configuration file will
+ <p>Configuration parameter values in the configuration file
override the values in the application resource files (see
- <c>app(4)</c>). The values in the configuration file can be
- overridden by command line flags (see <c>erl(1)</c>).</p>
+ <seealso marker="app"><c>app(4)</c></seealso>.
+ The values in the configuration file can be
+ overridden by command-line flags (see
+ <seealso marker="erts:erl"><c>erts:erl(1)</c></seealso>.</p>
<p>The value of a configuration parameter is retrieved by calling
<c>application:get_env/1,2</c>.</p>
</description>
<section>
- <title>FILE SYNTAX</title>
- <p>The configuration file should be called <c>Name.config</c> where
- <c>Name</c> is an arbitrary name.</p>
- <p>The <c>.config</c> file contains one single Erlang term.
- The file has the following syntax:</p>
+ <title>File Syntax</title>
+ <p>The configuration file is to be called <c>Name.config</c>, where
+ <c>Name</c> is any name.</p>
+ <p>File <c>.config</c> contains a single Erlang term and
+ has the following syntax:</p>
<code type="none">
-[{Application1, [{Par11, Val11}, ..]},
- ..
- {ApplicationN, [{ParN1, ValN1}, ..]}].</code>
- <list type="bulleted">
- <item>
- <p><c>Application = atom()</c> is the name of the application.</p>
- </item>
- <item>
- <p><c>Par = atom()</c> is the name of a configuration parameter.</p>
- </item>
- <item>
- <p><c>Val = term()</c> is the value of a configuration
- parameter.</p>
- </item>
- </list>
+[{Application1, [{Par11, Val11}, ...]},
+ ...
+ {ApplicationN, [{ParN1, ValN1}, ...]}].</code>
+ <taglist>
+ <tag><c>Application = atom()</c></tag>
+ <item><p>Application name.</p></item>
+ <tag><c>Par = atom()</c></tag>
+ <item><p>Name of a configuration parameter.</p></item>
+ <tag><c>Val = term()</c></tag>
+ <item><p>Value of a configuration parameter.</p></item>
+ </taglist>
</section>
<section>
<title>sys.config</title>
<p>When starting Erlang in embedded mode, it is assumed that
exactly one system configuration file is used, named
- <c>sys.config</c>. This file should be located in
+ <c>sys.config</c>. This file is to be located in
<c>$ROOT/releases/Vsn</c>, where <c>$ROOT</c> is the Erlang/OTP
root installation directory and <c>Vsn</c> is the release version.</p>
<p>Release handling relies on this assumption. When installing a
new release version, the new <c>sys.config</c> is read and used
to update the application configurations.</p>
- <p>This means that specifying another, or additional, <c>.config</c>
- files would lead to inconsistent update of application
+ <p>This means that specifying another <c>.config</c> file, or more
+ <c>.config</c> files, leads to inconsistent update of application
configurations. Therefore, in Erlang 5.4/OTP R10B, the syntax of
<c>sys.config</c> was extended to allow pointing out other
<c>.config</c> files:</p>
<code type="none">
[{Application, [{Par, Val}]} | File].</code>
- <list type="bulleted">
- <item>
- <p><c>File = string()</c> is the name of another <c>.config</c>
- file. The extension <c>.config</c> may be omitted. It is
- recommended to use absolute paths. A relative path is
- relative the current working directory of the emulator.</p>
- </item>
- </list>
+ <taglist>
+ <tag><c>File = string()</c></tag>
+ <item>Name of another <c>.config</c> file.
+ Extension <c>.config</c> can be omitted. It is
+ recommended to use absolute paths. A relative path is
+ relative the current working directory of the emulator.</item>
+ </taglist>
<p>When traversing the contents of <c>sys.config</c> and a filename
is encountered, its contents are read and merged with the result
so far. When an application configuration tuple
<c>{Application, Env}</c> is found, it is merged with the result
so far. Merging means that new parameters are added and existing
- parameter values overwritten. Example:</p>
+ parameter values overwritten.</p>
+ <p><em>Example:</em></p>
<code type="none">
sys.config:
[{myapp,[{par1,val1},{par2,val2}]},
"/home/user/myconfig"].
-
myconfig.config:
[{myapp,[{par2,val3},{par3,val4}]}].</code>
- <p>This will yield the following environment for <c>myapp</c>:</p>
+ <p>This yields the following environment for <c>myapp</c>:</p>
<code type="none">
[{par1,val1},{par2,val3},{par3,val4}]</code>
- <p>The behaviour if a file specified in <c>sys.config</c> does not
- exist or is erroneous in some other way, is backwards compatible.
+ <p>The behavior if a file specified in <c>sys.config</c> does not
+ exist, or is erroneous, is backwards compatible.
Starting the runtime system will fail. Installing a new release
- version will not fail, but an error message is given and
+ version will not fail, but an error message is returned and
the erroneous file is ignored.</p>
</section>
<section>
- <title>SEE ALSO</title>
- <p><c>app(4)</c>, <c>erl(1)</c>, <em>OTP Design Principles</em></p>
+ <title>See Also</title>
+ <p><seealso marker="app"><c>app(4)</c></seealso>,
+ <seealso marker="erts:erl"><c>erts:erl(1)</c></seealso>,
+ <seealso marker="doc/design_principles:des_princ">OTP Design Principles</seealso></p>
</section>
</fileref>
diff --git a/lib/kernel/doc/src/disk_log.xml b/lib/kernel/doc/src/disk_log.xml
index 7d4a9687ea..0b6ee1e6a5 100644
--- a/lib/kernel/doc/src/disk_log.xml
+++ b/lib/kernel/doc/src/disk_log.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -35,149 +35,174 @@
<file>disk_log.sgml</file>
</header>
<module>disk_log</module>
- <modulesummary>A disk based term logging facility</modulesummary>
+ <modulesummary>A disk-based term logging facility.</modulesummary>
<description>
- <p><c>disk_log</c> is a disk based term logger which makes
- it possible to efficiently log items on files.
- Two types of logs are supported,
- <em>halt logs</em> and <em>wrap logs</em>. A halt log
- appends items to a single file, the size of which may or may
- not be limited by the disk log module, whereas a wrap log utilizes
- a sequence of wrap log files of limited size. As a wrap log file
- has been filled up, further items are logged onto to the next
- file in the sequence, starting all over with the first file when
- the last file has been filled up. For the sake of efficiency,
- items are always written to files as binaries.
- </p>
- <p>Two formats of the log files are supported, the <em>internal format</em> and the <em>external format</em>. The internal
- format supports automatic repair of log files that have not been
- properly closed, and makes it possible to efficiently read
- logged items in <em>chunks</em> using a set of functions defined
- in this module. In fact, this is the only way to read internally
- formatted logs. The external format leaves it up to the user to
- read the logged deep byte lists. The disk log module cannot
- repair externally formatted logs. An item logged to an
- internally formatted log must not occupy more than 4 GB of disk
- space (the size must fit in 4 bytes).
- </p>
- <p>For each open disk log there is one process that handles requests
- made to the disk log; the disk log process is created when <c>open/1</c>
+ <p><c>disk_log</c> is a disk-based term logger that enables
+ efficient logging of items on files.</p>
+ <p>Two types of logs are supported:</p>
+ <taglist>
+ <tag>halt logs</tag>
+ <item><p>Appends items to a single file, which size can
+ be limited by the disk log module.</p></item>
+ <tag>wrap logs</tag>
+ <item><p>Uses a sequence of wrap log files of limited size. As a
+ wrap log file is filled up, further items are logged on to the next
+ file in the sequence, starting all over with the first file when
+ the last file is filled up.</p></item>
+ </taglist>
+ <p>For efficiency reasons, items are always written to files as binaries.</p>
+
+ <p>Two formats of the log files are supported:</p>
+ <taglist>
+ <tag>internal format</tag>
+ <item><p>Supports automatic repair of log files that are not
+ properly closed and enables efficient reading of logged items in
+ <em>chunks</em> using a set of functions defined in this module.
+ This is the only way to read internally formatted logs.
+ An item logged to an internally formatted log must not occupy more
+ than 4 GB of disk space (the size must fit in 4 bytes).</p></item>
+ <tag>external format</tag>
+ <item><p>Leaves it up to the user to read the logged deep byte lists.
+ The disk log module cannot repair externally formatted logs.</p></item>
+ </taglist>
+
+ <p>For each open disk log, one process handles requests
+ made to the disk log. This process is created when
+ <seealso marker="#open/1"><c>open/1</c></seealso>
is called, provided there exists no process handling the disk log.
- A process that opens a disk log can either be an <em>owner</em>
+ A process that opens a disk log can be an <em>owner</em>
or an anonymous <em>user</em> of the disk log. Each owner is
- linked to the disk log
- process, and the disk log is closed by the owner should the
- owner terminate. Owners can subscribe to <em>notifications</em>,
- messages of the form <c>{disk_log, Node, Log, Info}</c> that are sent
+ linked to the disk log process, and an owner can close the disk log
+ either explicitly (by calling <c>close/1</c> or <c>lclose/1,2</c>)
+ or by terminating.</p>
+ <p>Owners can subscribe to <em>notifications</em>,
+ messages of the form <c>{disk_log, Node, Log, Info}</c>, which are sent
from the disk log process when certain events occur, see
- the commands below and in particular the <c>open/1</c> option
- <seealso marker="#notify">notify</seealso>.
- There can be several owners of a log, but a process cannot own a
- log more than once. One and the same process may, however,
- open the log
- as a user more than once. For a disk log process to properly close
- its file and terminate, it must be closed by its owners and once by
- some non-owner process for each time the log was used anonymously;
- the users are counted, and there must not be any users left when the
- disk log process terminates.
+ the functions and in particular the <c>open/1</c> option
+ <seealso marker="#notify"><c>notify</c></seealso>.
+ A log can have many owners, but a process cannot own a
+ log more than once. However, the same process can open the log
+ as a user more than once.</p>
+ <p>For a disk log process to close its file properly and terminate,
+ it must be closed by its owners and once by some non-owner process
+ for each time the log was used anonymously. The users are counted
+ and there must not be any users left when the disk log process terminates.
</p>
- <p>Items can be logged <em>synchronously</em> by using the functions
- <c>log/2</c>, <c>blog/2</c>, <c>log_terms/2</c> and
- <c>blog_terms/2</c>. For each of these functions, the caller is put
- on hold until the items have been logged (but not necessarily
+ <p>Items can be logged <em>synchronously</em> by using functions
+ <seealso marker="#log/2"><c>log/2</c></seealso>,
+ <seealso marker="#blog/2"><c>blog/2</c></seealso>,
+ <seealso marker="#log_terms/2"><c>log_terms/2</c></seealso>, and
+ <seealso marker="#blog_terms/2"><c>blog_terms/2</c></seealso>.
+ For each of these functions, the caller is put
+ on hold until the items are logged (but not necessarily
written, use <c>sync/1</c> to ensure that). By adding an <c>a</c>
- to each of the mentioned function names we get functions that log
+ to each of the mentioned function names, we get functions that log
items <em>asynchronously</em>. Asynchronous functions do not wait for
- the disk log process to actually write the items to the file, but
+ the disk log process to write the items to the file, but
return the control to the caller more or less immediately.
</p>
- <p>When using the internal format for logs, the functions
- <c>log/2</c>, <c>log_terms/2</c>, <c>alog/2</c>, and
- <c>alog_terms/2</c> should be used. These functions log one or
- more Erlang terms. By prefixing each of the functions with
- a <c>b</c> (for "binary") we get the corresponding <c>blog</c>
- functions for the external format. These functions log one or
- more deep lists of bytes or, alternatively, binaries of deep lists
- of bytes.
- For example, to log the string <c>"hello"</c> in ASCII format, we
+ <p>When using the internal format for logs, use functions
+ <seealso marker="#log/2"><c>log/2</c></seealso>,
+ <seealso marker="#log_terms/2"><c>log_terms/2</c></seealso>,
+ <seealso marker="#alog/2"><c>alog/2</c></seealso>, and
+ <seealso marker="#alog_terms/2"><c>alog_terms/2</c></seealso>.
+ These functions log one or more Erlang terms.
+ By prefixing each of the functions with a <c>b</c> (for "binary"),
+ we get the corresponding <c>blog()</c> functions for the external format.
+ These functions log one or more deep lists of bytes or, alternatively,
+ binaries of deep lists of bytes.
+ For example, to log the string <c>"hello"</c> in ASCII format, you
can use <c>disk_log:blog(Log, "hello")</c>, or
<c>disk_log:blog(Log, list_to_binary("hello"))</c>. The two
- alternatives are equally efficient. The <c>blog</c> functions
- can be used for internally formatted logs as well, but in
- this case they must be called with binaries constructed with
- calls to <c>term_to_binary/1</c>. There is no check to ensure
+ alternatives are equally efficient.</p>
+ <p>The <c>blog()</c> functions can also be used for internally formatted
+ logs, but in this case they must be called with binaries constructed
+ with calls to
+ <seealso marker="erts:erlang#term_to_binary/1"><c>term_to_binary/1</c></seealso>.
+ There is no check to ensure
this, it is entirely the responsibility of the caller. If these
functions are called with binaries that do not correspond to
- Erlang terms, the <c>chunk/2,3</c> and automatic repair
- functions will fail. The corresponding terms (not the binaries)
- will be returned when <c>chunk/2,3</c> is called.
+ Erlang terms, the
+ <seealso marker="#chunk/2"><c>chunk/2,3</c></seealso>
+ and automatic repair
+ functions fail. The corresponding terms (not the binaries)
+ are returned when <c>chunk/2,3</c> is called.
</p>
<p>A collection of open disk logs with the same name running on
- different nodes is said to be a <em>a distributed disk log</em>
- if requests made to any one of the logs are automatically made to
- the other logs as well. The members of such a collection will be
+ different nodes is said to be a <em>distributed disk log</em>
+ if requests made to any of the logs are automatically made to
+ the other logs as well. The members of such a collection are
called individual distributed disk logs, or just distributed
disk logs if there is no risk of confusion. There is no order
- between the members of such a collection. For instance, logged
- terms are not necessarily written onto the node where the
- request was made before written onto the other nodes. One could
- note here that there are a few functions that do not make
- requests to all members of distributed disk logs, namely
- <c>info</c>, <c>chunk</c>, <c>bchunk</c>, <c>chunk_step</c> and
- <c>lclose</c>. An open disk log that is not a distributed disk
+ between the members of such a collection. For example, logged
+ terms are not necessarily written to the node where the
+ request was made before written to the other nodes. However,
+ a few functions do not make requests to all
+ members of distributed disk logs, namely
+ <seealso marker="#info/1"><c>info/1</c></seealso>,
+ <seealso marker="#chunk/2"><c>chunk/2,3</c></seealso>,
+ <seealso marker="#bchunk/2"><c>bchunk/2,3</c></seealso>,
+ <seealso marker="#chunk_step/3"><c>chunk_step/3</c></seealso>, and
+ <seealso marker="#lclose/1"><c>lclose/1,2</c></seealso>.</p>
+ <p>An open disk log that is not a distributed disk
log is said to be a <em>local disk log</em>. A local disk log is
- accessible only from the node where the disk log process runs,
+ only accessible from the node where the disk log process runs,
whereas a distributed disk log is accessible from all nodes in
- the Erlang system, with exception for those nodes where a local
+ the Erlang system, except for those nodes where a local
disk log with the same name as the distributed disk log exists.
All processes on nodes that have access to a local or
- distributed disk log can log items or otherwise change, inspect
+ distributed disk log can log items or otherwise change, inspect,
or close the log.
</p>
<p>It is not guaranteed that all log files of a distributed disk log
- contain the same log items; there is no attempt made to synchronize
+ contain the same log items. No attempt is made to synchronize
the contents of the files. However, as long as at least one of
- the involved nodes is alive at each time, all items will be logged.
+ the involved nodes is alive at each time, all items are logged.
When logging items to a distributed log, or otherwise trying to
change the log, the replies from individual logs are
ignored. If all nodes are down, the disk log functions
reply with a <c>nonode</c> error.
</p>
<note>
- <p>In some applications it may not be acceptable that
+ <p>In some applications, it can be unacceptable that
replies from individual logs are ignored. An alternative in such
- situations is to use several local disk logs instead of one
+ situations is to use many local disk logs instead of one
distributed disk log, and implement the distribution without use
- of the disk log module.</p>
+ of the <c>disk_log</c> module.</p>
</note>
<p>Errors are reported differently for asynchronous log attempts
- and other uses of the disk log module. When used synchronously
- the disk log module replies with an error message, but when called
- asynchronously, the disk log module does not know where to send
- the error message. Instead owners subscribing to notifications will
+ and other uses of the <c>disk_log</c> module. When used synchronously,
+ this module replies with an error message, but when called
+ asynchronously, this module does not know where to send
+ the error message. Instead, owners subscribing to notifications
receive an <c>error_status</c> message.
</p>
- <p>The disk log module itself does not report errors to the
- <c>error_logger</c> module; it is up to the caller to decide
- whether the error logger should be employed or not. The function
- <c>format_error/1</c> can be used to produce readable messages
- from error replies. Information events are however sent to the
- error logger in two situations, namely when a log is repaired,
- or when a file is missing while reading chunks.
+ <p>The <c>disk_log</c> module does not report errors to the
+ <seealso marker="error_logger"><c>error_logger</c></seealso>
+ module. It is up to the caller to decide
+ whether to employ the error logger. Function
+ <seealso marker="#format_error/1"><c>format_error/1</c></seealso>
+ can be used to produce readable messages from error replies.
+ However, information events are sent to the error logger in two
+ situations, namely when a log is repaired, or when a file is missing
+ while reading chunks.
</p>
- <p>The error message <c>no_such_log</c> means that the given
- disk log is not currently open. Nothing is said about
- whether the disk log files exist or not.
+ <p>Error message <c>no_such_log</c> means that the specified
+ disk log is not open. Nothing is said about whether the disk log
+ files exist or not.
</p>
<note>
<p>If an attempt to reopen or truncate a log fails (see
- <c>reopen</c> and <c>truncate</c>) the disk log process
- immediately terminates. Before the process terminates links to
- to owners and blocking processes (see <c>block</c>) are removed.
- The effect is that the links work in one direction only; any
- process using a disk log has to check for the error message
- <c>no_such_log</c> if some other process might truncate or
- reopen the log simultaneously.</p>
+ <seealso marker="#reopen/2"><c>reopen/2,3</c></seealso>
+ and
+ <seealso marker ="#truncate/1"><c>truncate/1,2</c></seealso>)
+ the disk log process terminates immediately. Before the process
+ terminates, links to owners and blocking processes (see
+ <seealso marker="#block/1"><c>block/1,2</c></seealso>) are removed.
+ The effect is that the links work in one direction only. Any
+ process using a disk log must check for error message
+ <c>no_such_log</c> if some other process truncates or
+ reopens the log simultaneously.</p>
</note>
</description>
<datatypes>
@@ -221,11 +246,10 @@
<funcs>
<func>
<name name="accessible_logs" arity="0"/>
- <fsummary>Return the accessible disk logs on the current node.</fsummary>
+ <fsummary>Return the accessible disk logs on the current node.</fsummary>
<desc>
- <p>The <c>accessible_logs/0</c> function returns
- the names of the disk logs accessible on the current node.
- The first list contains local disk logs, and the
+ <p>Returns the names of the disk logs accessible on the current node.
+ The first list contains local disk logs and the
second list contains distributed disk logs.
</p>
</desc>
@@ -233,55 +257,55 @@
<func>
<name name="alog" arity="2"/>
<name name="balog" arity="2"/>
- <fsummary>Asynchronously log an item onto a disk log.</fsummary>
+ <fsummary>Asynchronously log an item on to a disk log.</fsummary>
<type variable="Log"/>
<type variable="Term" name_i="1"/>
<type variable="Bytes"/>
<type name="notify_ret"/>
<desc>
- <p>The <c>alog/2</c> and <c>balog/2</c> functions asynchronously
- append an item to a disk log. The function <c>alog/2</c> is
- used for internally formatted logs, and the function <c>balog/2</c>
- for externally formatted logs. <c>balog/2</c> can be used
- for internally formatted logs as well provided the binary was
- constructed with a call to <c>term_to_binary/1</c>.
+ <p>Asynchronously append an item to a disk log. <c>alog/2</c> is
+ used for internally formatted logs and <c>balog/2</c>
+ for externally formatted logs. <c>balog/2</c> can also be used
+ for internally formatted logs if the binary is
+ constructed with a call to
+ <seealso marker="erts:erlang#term_to_binary/1"><c>term_to_binary/1</c></seealso>.
</p>
- <p>The owners that subscribe to notifications will receive the
- message <c>read_only</c>, <c>blocked_log</c>
- or <c>format_external</c> in case the item cannot be written
+ <p>Owners subscribing to notifications receive
+ message <c>read_only</c>, <c>blocked_log</c>,
+ or <c>format_external</c> if the item cannot be written
on the log, and possibly one of the messages <c>wrap</c>,
- <c>full</c> and <c>error_status</c> if an item was written
- on the log. The message <c>error_status</c> is sent if there
- is something wrong with the header function or a file error
- occurred.
+ <c>full</c>, or <c>error_status</c> if an item is written
+ on the log. Message <c>error_status</c> is sent if
+ something is wrong with the header function or if a file error
+ occurs.
</p>
</desc>
</func>
<func>
<name name="alog_terms" arity="2"/>
<name name="balog_terms" arity="2"/>
- <fsummary>Asynchronously log several items onto a disk log.</fsummary>
+ <fsummary>Asynchronously log many items on to a disk log.</fsummary>
<type variable="Log"/>
<type variable="TermList" name_i="1"/>
<type variable="ByteList"/>
<type name="notify_ret"/>
<desc>
- <p>The <c>alog_terms/2</c> and <c>balog_terms/2</c> functions
- asynchronously append a list of items to a disk log.
- The function <c>alog_terms/2</c> is used for internally
- formatted logs, and the function <c>balog_terms/2</c>
- for externally formatted logs. <c>balog_terms/2</c> can be used
- for internally formatted logs as well provided the binaries were
- constructed with calls to <c>term_to_binary/1</c>.
+ <p>Asynchronously append a list of items to a disk log.
+ <c>alog_terms/2</c> is used for internally
+ formatted logs and <c>balog_terms/2</c>
+ for externally formatted logs. <c>balog_terms/2</c> can also be used
+ for internally formatted logs if the binaries are
+ constructed with calls to
+ <seealso marker="erts:erlang#term_to_binary/1"><c>term_to_binary/1</c></seealso>.
</p>
- <p>The owners that subscribe to notifications will receive the
- message <c>read_only</c>, <c>blocked_log</c>
- or <c>format_external</c> in case the items cannot be written
+ <p>Owners subscribing to notifications receive
+ message <c>read_only</c>, <c>blocked_log</c>,
+ or <c>format_external</c> if the items cannot be written
on the log, and possibly one or more of the messages <c>wrap</c>,
- <c>full</c> and <c>error_status</c> if items were written
- on the log. The message <c>error_status</c> is sent if there
- is something wrong with the header function or a file error
- occurred.
+ <c>full</c>, and <c>error_status</c> if items are written
+ on the log. Message <c>error_status</c> is sent if
+ something is wrong with the header function or if a file error
+ occurs.
</p>
</desc>
</func>
@@ -294,76 +318,75 @@
<p>With a call to <c>block/1,2</c> a process can block a log.
If the blocking process is not an owner of the log, a temporary
link is created between the disk log process and the blocking
- process. The link is used to ensure that the disk log is
- unblocked should the blocking process terminate without
+ process. The link ensures that the disk log is
+ unblocked if the blocking process terminates without
first closing or unblocking the log.
</p>
<p>Any process can probe a blocked log with <c>info/1</c> or
close it with <c>close/1</c>. The blocking process can also
- use the functions <c>chunk/2,3</c>, <c>bchunk/2,3</c>,
+ use functions <c>chunk/2,3</c>, <c>bchunk/2,3</c>,
<c>chunk_step/3</c>, and <c>unblock/1</c> without being
- affected by the block. Any other attempt than those hitherto
- mentioned to update or read a blocked log suspends the
- calling process until the log is unblocked or returns an
+ affected by the block. Any other attempt than those
+ mentioned so far to update or read a blocked log suspends the
+ calling process until the log is unblocked or returns
error message <c>{blocked_log, <anno>Log</anno>}</c>, depending on
whether the value of <c><anno>QueueLogRecords</anno></c> is <c>true</c>
- or <c>false</c>. The default value of <c><anno>QueueLogRecords</anno></c>
- is <c>true</c>, which is used by <c>block/1</c>.
+ or <c>false</c>. <c><anno>QueueLogRecords</anno></c> defaults to
+ <c>true</c>, which is used by <c>block/1</c>.
</p>
</desc>
</func>
<func>
<name name="change_header" arity="2"/>
- <fsummary>Change the head or head_func option for an owner of a disk log.</fsummary>
+ <fsummary>Change option head or head_func for an owner of a disk log.</fsummary>
<desc>
- <p>The <c>change_header/2</c> function changes the value of
- the <c>head</c> or <c>head_func</c> option of a disk log.</p>
+ <p>Changes the value of option <c>head</c> or <c>head_func</c> for an owner of a disk log.</p>
</desc>
</func>
<func>
<name name="change_notify" arity="3"/>
- <fsummary>Change the notify option for an owner of a disk log.</fsummary>
+ <fsummary>Change option notify for an owner of a disk log.</fsummary>
<desc>
- <p>The <c>change_notify/3</c> function changes the value of the
- <c>notify</c> option for an owner of a disk log. </p>
+ <p>Changes the value of option <c>notify</c> for an owner of a disk log. </p>
</desc>
</func>
<func>
<name name="change_size" arity="2"/>
<fsummary>Change the size of an open disk log.</fsummary>
<desc>
- <p>The <c>change_size/2</c> function changes the size of an open log.
- For a halt log it is always possible to increase the size,
- but it is not possible to decrease the size to something less than
- the current size of the file.
+ <p>Changes the size of an open log.
+ For a halt log, the size can always be increased,
+ but it cannot be decreased to something less than
+ the current file size.
</p>
- <p>For a wrap log it is always possible to increase both the
- size and number of files, as long as the number of files does not
+ <p>For a wrap log, both the size and the number of files can always
+ be increased, as long as the number of files does not
exceed 65000. If the maximum number of files is decreased, the
- change will not be valid until the current file is full and the
+ change is not valid until the current file is full and the
log wraps to the next file.
- The redundant files will be removed next time the log wraps around,
- i.e. starts to log to file number 1.
+ The redundant files are removed the next time the log wraps around,
+ that is, starts to log to file number 1.
</p>
<p>As an example, assume that the old maximum number of files
is 10 and that the new maximum number of files is 6. If
the current file number is not greater than the new maximum number
- of files, the files 7 to 10 will be removed when file number 6
+ of files, files 7-10 are removed when file 6
is full and the log starts to write to file number 1 again.
- Otherwise the files greater than the current
- file will be removed when the current file is full (e.g. if
- the current file is 8, the files 9 and 10); the files between
- new maximum number of files and the current
- file (i.e. files 7 and 8) will be removed next time file number 6
+ Otherwise, the files greater than the current
+ file are removed when the current file is full (for example, if
+ the current file is 8, files 9 and 10 are removed). The files between
+ the new maximum number of files and the current
+ file (that is, files 7 and 8) are removed the next time file 6
is full.
</p>
- <p>If the size of the files is decreased the change will immediately
- affect the current log. It will not of course change the
- size of log files already full until next time they are used.
+ <p>If the size of the files is decreased, the change immediately
+ affects the current log. It does not change the
+ size of log files already full until the next time they are used.
</p>
- <p>If the log size is decreased for instance to save space,
- the function <c>inc_wrap_file/1</c> can be used to force the log
- to wrap.
+ <p>If the log size is decreased, for example, to save space,
+ function
+ <seealso marker="#inc_wrap_file/1"><c>inc_wrap_file/1</c></seealso>
+ can be used to force the log to wrap.
</p>
</desc>
</func>
@@ -380,93 +403,85 @@
<type name="bchunk_ret"/>
<type name="chunk_error_rsn"/>
<desc>
- <p>The <c>chunk/2,3</c> and <c>bchunk/2,3</c> functions make
- it possible to efficiently read the terms which have been
- appended to an internally formatted log. It minimizes disk
- I/O by reading 64 kilobyte chunks from the file. The
- <c>bchunk/2,3</c> functions return the binaries read from
- the file; they do not call <c>binary_to_term</c>. Otherwise
- the work just like <c>chunk/2,3</c>.
+ <p>Efficiently reads the terms that are appended
+ to an internally formatted log. It minimizes disk
+ I/O by reading 64 kilobyte chunks from the file. Functions
+ <c>bchunk/2,3</c> return the binaries read from
+ the file, they do not call <c>binary_to_term()</c>. Apart from that,
+ they work just like <c>chunk/2,3</c>.
</p>
- <p>The first time <c>chunk</c> (or <c>bchunk</c>) is called,
+ <p>The first time <c>chunk()</c> (or <c>bchunk()</c>) is called,
an initial continuation, the atom <c>start</c>, must be
- provided. If there is a disk log process running on the
- current node, terms are read from that log, otherwise an
+ provided. If a disk log process is running on the
+ current node, terms are read from that log. Otherwise, an
individual distributed log on some other node is chosen, if
such a log exists.
</p>
<p>When <c>chunk/3</c> is called, <c><anno>N</anno></c> controls the
maximum number of terms that are read from the log in each
- chunk. Default is <c>infinity</c>, which means that all the
+ chunk. Defaults to <c>infinity</c>, which means that all the
terms contained in the 64 kilobyte chunk are read. If less than
<c><anno>N</anno></c> terms are returned, this does not necessarily mean
- that the end of the file has been reached.
+ that the end of the file is reached.
</p>
- <p>The <c>chunk</c> function returns a tuple
- <c>{<anno>Continuation2</anno>, <anno>Terms</anno>}</c>, where <c><anno>Terms</anno></c> is a list
+ <p><c>chunk()</c> returns a tuple
+ <c>{<anno>Continuation2</anno>, <anno>Terms</anno>}</c>, where
+ <c><anno>Terms</anno></c> is a list
of terms found in the log. <c><anno>Continuation2</anno></c> is yet
- another continuation which must be passed on to any
- subsequent calls to <c>chunk</c>. With a series of calls to
- <c>chunk</c> it is possible to extract all terms from a log.
+ another continuation, which must be passed on to any
+ subsequent calls to <c>chunk()</c>. With a series of calls to
+ <c>chunk()</c>, all terms from a log can be extracted.
</p>
- <p>The <c>chunk</c> function returns a tuple
- <c>{<anno>Continuation2</anno>, <anno>Terms</anno>, <anno>Badbytes</anno>}</c> if the log is opened
- in read-only mode and the read chunk is corrupt. <c><anno>Badbytes</anno></c>
- is the number of bytes in the file which were found not to be
- Erlang terms in the chunk. Note also that the log is not repaired.
+ <p><c>chunk()</c> returns a tuple
+ <c>{<anno>Continuation2</anno>, <anno>Terms</anno>, <anno>Badbytes</anno>}</c>
+ if the log is opened in read-only mode and the read chunk is corrupt.
+ <c><anno>Badbytes</anno></c> is the number of bytes in the file found not to be
+ Erlang terms in the chunk. Notice that the log is not repaired.
When trying to read chunks from a log opened in read-write mode,
- the tuple <c>{corrupt_log_file, <anno>FileName</anno>}</c> is returned if the
+ tuple <c>{corrupt_log_file, <anno>FileName</anno>}</c> is returned if the
read chunk is corrupt.
</p>
- <p><c>chunk</c> returns <c>eof</c> when the end of the log is
- reached, or <c>{error, <anno>Reason</anno>}</c> if an error occurs. Should
- a wrap log file be missing, a message is output on the error log.
+ <p><c>chunk()</c> returns <c>eof</c> when the end of the log is
+ reached, or <c>{error, <anno>Reason</anno>}</c> if an error occurs. If
+ a wrap log file is missing, a message is output on the error log.
</p>
<p>When <c>chunk/2,3</c> is used with wrap logs, the returned
- continuation may or may not be valid in the next call to
- <c>chunk</c>. This is because the log may wrap and delete
- the file into which the continuation points. To make sure
- this does not happen, the log can be blocked during the
- search.
+ continuation might not be valid in the next call to
+ <c>chunk()</c>. This is because the log can wrap and delete
+ the file into which the continuation points. To prevent this,
+ the log can be blocked during the search.
</p>
</desc>
</func>
<func>
<name name="chunk_info" arity="1"/>
- <fsummary>Return information about a chunk continuation of a disk log.</fsummary>
+ <fsummary>Return information about a chunk continuation of a disk log.</fsummary>
<desc>
- <p>The <c>chunk_info/1</c> function returns the following pair
+ <p>Returns the pair <c>{node, <anno>Node</anno>}</c>,
describing the chunk continuation returned by
- <c>chunk/2,3</c>, <c>bchunk/2,3</c>, or <c>chunk_step/3</c>:
- </p>
- <list type="bulleted">
- <item>
- <p><c>{node, <anno>Node</anno>}</c>. Terms are read from
- the disk log running on <c><anno>Node</anno></c>.</p>
- </item>
- </list>
+ <c>chunk/2,3</c>, <c>bchunk/2,3</c>, or <c>chunk_step/3</c>.</p>
+ <p>Terms are read from the disk log running on <c><anno>Node</anno></c>.</p>
</desc>
</func>
<func>
<name name="chunk_step" arity="3"/>
- <fsummary>Step forward or backward among the wrap log files of a disk log.</fsummary>
+ <fsummary>Step forward or backward among the wrap log files of a disk log.</fsummary>
<desc>
- <p>The function <c>chunk_step</c> can be used in conjunction
- with <c>chunk/2,3</c> and <c>bchunk/2,3</c> to search
- through an internally formatted wrap log. It takes as
+ <p>Can be used with <c>chunk/2,3</c> and <c>bchunk/2,3</c>
+ to search through an internally formatted wrap log. It takes as
argument a continuation as returned by <c>chunk/2,3</c>,
<c>bchunk/2,3</c>, or <c>chunk_step/3</c>, and steps forward
(or backward) <c><anno>Step</anno></c> files in the wrap log. The
- continuation returned points to the first log item in the
+ continuation returned, points to the first log item in the
new current file.
</p>
- <p>If the atom <c>start</c> is given as continuation, a disk log
+ <p>If atom <c>start</c> is specified as continuation, a disk log
to read terms from is chosen. A local or distributed disk log
on the current node is preferred to an
individual distributed log on some other node.
</p>
- <p>If the wrap log is not full because all files have not been
- used yet, <c>{error, end_of_log}</c> is returned if trying to
+ <p>If the wrap log is not full because all files are not yet
+ used, <c>{error, end_of_log}</c> is returned if trying to
step outside the log.
</p>
</desc>
@@ -476,21 +491,20 @@
<fsummary>Close a disk log.</fsummary>
<type name="close_error_rsn"/>
<desc>
- <p><marker id="close_1"></marker>The function <c>close/1</c> closes a
+ <p><marker id="close_1"></marker>Closes a
local or distributed disk log properly. An internally
formatted log must be closed before the Erlang system is
- stopped, otherwise the log is regarded as unclosed and the
- automatic repair procedure will be activated next time the
+ stopped. Otherwise, the log is regarded as unclosed and the
+ automatic repair procedure is activated next time the
log is opened.
</p>
- <p>The disk log process in not terminated as long as there are
- owners or users of the log. It should be stressed that each
- and every owner must close the log, possibly by terminating,
- and that any other process - not only the processes that have
- opened the log anonymously - can decrement the <c>users</c>
+ <p>The disk log process is not terminated as long as there are
+ owners or users of the log. All owners must close the log,
+ possibly by terminating. Also, any other process, not only the processes
+ that have opened the log anonymously, can decrement the <c>users</c>
counter by closing the log.
Attempts to close a log by a process that is
- not an owner are simply ignored if there are no users.
+ not an owner are ignored if there are no users.
</p>
<p>If the log is blocked by the closing process, the log is also
unblocked.
@@ -499,12 +513,14 @@
</func>
<func>
<name name="format_error" arity="1"/>
- <fsummary>Return an English description of a disk log error reply.</fsummary>
+ <fsummary>Return an English description of a disk log error reply.</fsummary>
<desc>
<p>Given the error returned by any function in this module,
- the function <c>format_error</c> returns a descriptive string
- of the error in English. For file errors, the function
- <c>format_error/1</c> in the <c>file</c> module is called.</p>
+ this function returns a descriptive string
+ of the error in English. For file errors, function
+ <c>format_error/1</c> in module
+ <seealso marker="file#format_error/1"><c>file</c></seealso>
+ is called.</p>
</desc>
</func>
<func>
@@ -513,16 +529,15 @@
<type name="inc_wrap_error_rsn"/>
<type name="invalid_header"/>
<desc>
- <p>The <c>inc_wrap_file/1</c> function forces the internally formatted
- disk log to start logging to the
- next log file. It can be used, for instance, in conjunction with
+ <p>Forces the internally formatted disk log to start logging to the
+ next log file. It can be used, for example, with
<c>change_size/2</c> to reduce the amount of disk space allocated
by the disk log.
</p>
- <p>The owners that subscribe to notifications will normally
- receive a <c>wrap</c> message, but in case of
- an error with a reason tag of <c>invalid_header</c> or
- <c>file_error</c> an <c>error_status</c> message will be sent.</p>
+ <p>Owners subscribing to notifications normally
+ receive a <c>wrap</c> message, but if
+ an error occurs with a reason tag of <c>invalid_header</c> or
+ <c>file_error</c>, an <c>error_status</c> message is sent.</p>
</desc>
</func>
<func>
@@ -530,132 +545,148 @@
<fsummary>Return information about a disk log.</fsummary>
<type name="dlog_info"/>
<desc>
- <p>The <c>info/1</c> function returns a list of <c>{Tag, Value}</c>
- pairs describing the log. If there is a disk log process running
- on the current node, that log is used as source of information,
- otherwise an individual distributed log on
- some other node is chosen, if such a log exists.
+ <p>Returns a list of <c>{Tag, Value}</c> pairs describing the log.
+ If a disk log process is running on the current node,
+ that log is used as source of information, otherwise an individual
+ distributed log on some other node is chosen, if such a log exists.
</p>
<p>The following pairs are returned for all logs:
</p>
- <list type="bulleted">
+ <taglist>
+ <tag><c>{name, <anno>Log</anno>}</c></tag>
<item>
- <p><c>{name, <anno>Log</anno>}</c>, where <c><anno>Log</anno></c> is the name of
- the log as given by the <c>open/1</c> option <c>name</c>.</p>
+ <p><c><anno>Log</anno></c> is the log name
+ as specified by the <c>open/1</c> option <c>name</c>.</p>
</item>
+ <tag><c>{file, <anno>File</anno>}</c></tag>
<item>
- <p><c>{file, <anno>File</anno>}</c>. For halt logs <c><anno>File</anno></c> is the
+ <p>For halt logs <c><anno>File</anno></c> is the
filename, and for wrap logs <c><anno>File</anno></c> is the base name.</p>
</item>
+ <tag><c>{type, <anno>Type</anno>}</c></tag>
<item>
- <p><c>{type, <anno>Type</anno>}</c>, where <c><anno>Type</anno></c> is the type of
- the log as given by the <c>open/1</c> option <c>type</c>.</p>
+ <p><c><anno>Type</anno></c> is the log type
+ as specified by the <c>open/1</c> option <c>type</c>.</p>
</item>
+ <tag><c>{format, <anno>Format</anno>}</c></tag>
<item>
- <p><c>{format, <anno>Format</anno>}</c>, where <c><anno>Format</anno></c> is the format
- of the log as given by the <c>open/1</c> option <c>format</c>.</p>
+ <p><c><anno>Format</anno></c> is the log format
+ as specified by the <c>open/1</c> option <c>format</c>.</p>
</item>
+ <tag><c>{size, <anno>Size</anno>}</c></tag>
<item>
- <p><c>{size, <anno>Size</anno>}</c>, where <c><anno>Size</anno></c> is the size
- of the log as given by the <c>open/1</c> option <c>size</c>,
+ <p><c><anno>Size</anno></c> is the log size
+ as specified by the <c>open/1</c> option <c>size</c>,
or the size set by <c>change_size/2</c>. The value set by
<c>change_size/2</c> is reflected immediately.</p>
</item>
+ <tag><c>{mode, <anno>Mode</anno>}</c></tag>
<item>
- <p><c>{mode, <anno>Mode</anno>}</c>, where <c><anno>Mode</anno></c> is the mode
- of the log as given by the <c>open/1</c> option <c>mode</c>.</p>
+ <p><c><anno>Mode</anno></c> is the log mode
+ as specified by the <c>open/1</c> option <c>mode</c>.</p>
</item>
+ <tag><c>{owners, [{pid(), <anno>Notify</anno>}]}</c></tag>
<item>
- <p><c>{owners, [{pid(), <anno>Notify</anno>}]}</c> where <c><anno>Notify</anno></c>
+ <p><c><anno>Notify</anno></c>
is the value set by the <c>open/1</c> option <c>notify</c>
- or the function <c>change_notify/3</c> for the owners of
+ or function <c>change_notify/3</c> for the owners of
the log.</p>
</item>
+ <tag><c>{users, <anno>Users</anno>}</c></tag>
<item>
- <p><c>{users, <anno>Users</anno>}</c> where <c><anno>Users</anno></c> is the number
+ <p><c><anno>Users</anno></c> is the number
of anonymous users of the log, see the <c>open/1</c> option
- <seealso marker="#linkto">linkto</seealso>.</p>
+ <seealso marker="#linkto"><c>linkto</c></seealso>.</p>
</item>
+ <tag><c>{status, <anno>Status</anno>}</c></tag>
<item>
- <p><c>{status, <anno>Status</anno>}</c>, where <c><anno>Status</anno></c> is <c>ok</c>
- or <c>{blocked, <anno>QueueLogRecords</anno>}</c> as set by the functions
+ <p><c><anno>Status</anno></c> is <c>ok</c>
+ or <c>{blocked, <anno>QueueLogRecords</anno>}</c> as set by functions
<c>block/1,2</c> and <c>unblock/1</c>.</p>
</item>
+ <tag><c>{node, <anno>Node</anno>}</c></tag>
<item>
- <p><c>{node, <anno>Node</anno>}</c>. The information returned by the
- current invocation of the <c>info/1</c> function has been
+ <p>The information returned by the
+ current invocation of function <c>info/1</c> is
gathered from the disk log process running on <c><anno>Node</anno></c>.</p>
</item>
+ <tag><c>{distributed, <anno>Dist</anno>}</c></tag>
<item>
- <p><c>{distributed, <anno>Dist</anno>}</c>. If the log is local on
- the current node, then <c><anno>Dist</anno></c> has the value <c>local</c>,
+ <p>If the log is local on
+ the current node, <c><anno>Dist</anno></c> has the value <c>local</c>,
otherwise all nodes where the log is distributed
are returned as a list.</p>
</item>
- </list>
+ </taglist>
<p>The following pairs are returned for all logs opened in
<c>read_write</c> mode:
</p>
- <list type="bulleted">
+ <taglist>
+ <tag><c>{head, <anno>Head</anno>}</c></tag>
<item>
- <p><c>{head, <anno>Head</anno>}</c>. Depending of the value of
- the <c>open/1</c> options <c>head</c> and <c>head_func</c>
- or set by the function <c>change_header/2</c>, the value
+ <p>Depending on the value of
+ the <c>open/1</c> options <c>head</c> and <c>head_func</c>,
+ or set by function <c>change_header/2</c>, the value
of <c><anno>Head</anno></c> is <c>none</c> (default),
- <c>{head, H}</c> (<c>head</c> option) or <c>{M,F,A}</c>
+ <c>{head, H}</c> (<c>head</c> option), or <c>{M,F,A}</c>
(<c>head_func</c> option).</p>
</item>
+ <tag><c>{no_written_items, <anno>NoWrittenItems</anno>}</c></tag>
<item>
- <p><c>{no_written_items, <anno>NoWrittenItems</anno>}</c>, where
- <c><anno>NoWrittenItems</anno></c> is the number of items
+ <p><c><anno>NoWrittenItems</anno></c> is the number of items
written to the log since the disk log process was created.</p>
</item>
- </list>
+ </taglist>
<p>The following pair is returned for halt logs opened in
<c>read_write</c> mode:
</p>
- <list type="bulleted">
+ <taglist>
+ <tag><c>{full, <anno>Full</anno>}</c></tag>
<item>
- <p><c>{full, <anno>Full</anno>}</c>, where <c><anno>Full</anno></c> is <c>true</c> or
+ <p><c><anno>Full</anno></c> is <c>true</c> or
<c>false</c> depending on whether the halt log is full or not.</p>
</item>
- </list>
+ </taglist>
<p>The following pairs are returned for wrap logs opened in
<c>read_write</c> mode:
</p>
- <list type="bulleted">
+ <taglist>
+ <tag><c>{no_current_bytes, integer() >= 0}</c></tag>
<item>
- <p><c>{no_current_bytes, integer() >= 0}</c> is the number
+ <p>The number
of bytes written to the current wrap log file.</p>
</item>
+ <tag><c>{no_current_items, integer() >= 0}</c></tag>
<item>
- <p><c>{no_current_items, integer() >= 0}</c> is the number
+ <p>The number
of items written to the current wrap log file, header
inclusive.</p>
</item>
+ <tag><c>{no_items, integer() >= 0}</c></tag>
<item>
- <p><c>{no_items, integer() >= 0}</c> is the total number
+ <p>The total number
of items in all wrap log files.</p>
</item>
+ <tag><c>{current_file, integer()}</c></tag>
<item>
- <p><c>{current_file, integer()}</c> is the ordinal for
+ <p>The ordinal for
the current wrap log file in the range <c>1..MaxNoFiles</c>,
- where <c>MaxNoFiles</c> is given by the <c>open/1</c> option
+ where <c>MaxNoFiles</c> is specified by the <c>open/1</c> option
<c>size</c> or set by <c>change_size/2</c>.</p>
</item>
+ <tag><c>{no_overflows, {<anno>SinceLogWasOpened</anno>, <anno>SinceLastInfo</anno>}}</c></tag>
<item>
- <p><c>{no_overflows, {<anno>SinceLogWasOpened</anno>, <anno>SinceLastInfo</anno>}}</c>,
- where <c><anno>SinceLogWasOpened</anno></c> (<c><anno>SinceLastInfo</anno></c>) is
- the number of times a wrap log file has been filled up and a
- new one opened or <c>inc_wrap_file/1</c> has been called since
+ <p><c><anno>SinceLogWasOpened</anno></c> (<c><anno>SinceLastInfo</anno></c>)
+ is the number of times a wrap log file has been filled up and a
+ new one is opened or <c>inc_wrap_file/1</c> has been called since
the disk log was last opened (<c>info/1</c>
was last called). The first time <c>info/2</c> is called
after a log was (re)opened or truncated, the two values
are equal.</p>
</item>
- </list>
- <p>Note that the <c>chunk/2,3</c>, <c>bchunk/2,3</c>, and
- <c>chunk_step/3</c> functions do not affect any value
+ </taglist>
+ <p>Notice that functions <c>chunk/2,3</c>, <c>bchunk/2,3</c>, and
+ <c>chunk_step/3</c> do not affect any value
returned by <c>info/1</c>.
</p>
</desc>
@@ -666,17 +697,16 @@
<fsummary>Close a disk log on one node.</fsummary>
<type name="lclose_error_rsn"/>
<desc>
- <p>The function <c>lclose/1</c> closes a local log or an
- individual distributed log on the current node.
- The function <c>lclose/2</c> closes an individual
- distributed log on the specified node if the node
- is not the current one.
- <c>lclose(<anno>Log</anno>)</c> is equivalent to
+ <p><c>lclose/1</c> closes a local log or an individual distributed
+ log on the current node.</p>
+ <p><c>lclose/2</c> closes an individual distributed log on the
+ specified node if the node is not the current one.</p>
+ <p><c>lclose(<anno>Log</anno>)</c> is equivalent to
<c>lclose(<anno>Log</anno>,&nbsp;node())</c>.
- See also <seealso marker="#close_1">close/1</seealso>.
+ See also <seealso marker="#close_1"><c>close/1</c></seealso>.
</p>
- <p>If there is no log with the given name
- on the specified node, <c>no_such_log</c> is returned.
+ <p>If no log with the specified name exist on the specified node,
+ <c>no_such_log</c> is returned.
</p>
</desc>
</func>
@@ -689,25 +719,27 @@
<type variable="Bytes"/>
<type name="log_error_rsn"/>
<desc>
- <p>The <c>log/2</c> and <c>blog/2</c> functions synchronously
- append a term to a disk log. They return <c>ok</c> or
- <c>{error, <anno>Reason</anno>}</c> when the term has been written to
- disk. If the log is distributed, <c>ok</c> is always
- returned, unless all nodes are down. Terms are written by
- means of the ordinary <c>write()</c> function of the
- operating system. Hence, there is no guarantee that the term
- has actually been written to the disk, it might linger in
- the operating system kernel for a while. To make sure the
- item is actually written to disk, the <c>sync/1</c> function
+ <p>Synchronously
+ appends a term to a disk log. Returns <c>ok</c> or
+ <c>{error, <anno>Reason</anno>}</c> when the term is written to
+ disk. If the log is distributed, <c>ok</c> is returned,
+ unless all nodes are down. Terms are written by
+ the ordinary <c>write()</c> function of the
+ operating system. Hence, it is not guaranteed that the term
+ is written to disk, it can linger in
+ the operating system kernel for a while. To ensure that the
+ item is written to disk, function
+ <seealso marker="#sync/1"><c>sync/1</c></seealso>
must be called.
</p>
- <p>The <c>log/2</c> function is used for internally formatted logs,
+ <p><c>log/2</c> is used for internally formatted logs,
and <c>blog/2</c> for externally formatted logs.
- <c>blog/2</c> can be used
- for internally formatted logs as well provided the binary was
- constructed with a call to <c>term_to_binary/1</c>.
- </p>
- <p>The owners that subscribe to notifications will be notified
+ <c>blog/2</c> can also be used
+ for internally formatted logs if the binary is
+ constructed with a call to
+ <seealso marker="erts:erlang#term_to_binary/1">
+ <c>term_to_binary/1</c></seealso>.</p>
+ <p>Owners subscribing to notifications are notified
of an error with an <c>error_status</c> message if the error
reason tag is <c>invalid_header</c> or <c>file_error</c>.
</p>
@@ -716,27 +748,27 @@
<func>
<name name="log_terms" arity="2"/>
<name name="blog_terms" arity="2"/>
- <fsummary>Log several items onto a disk log.</fsummary>
+ <fsummary>Log many items onto a disk log.</fsummary>
<type variable="Log"/>
<type variable="TermList" name_i="1"/>
<type variable="BytesList"/>
<type name="log_error_rsn"/>
<desc>
- <p>The <c>log_terms/2</c> and <c>blog_terms/2</c> functions
- synchronously append a list of items to the log. The benefit
- of using these functions rather than the <c>log/2</c> and
- <c>blog/2</c> functions is that of efficiency: the given
- list is split into as large sublists as possible (limited by
- the size of wrap log files), and each sublist is logged as
- one single item, which reduces the overhead.
+ <p>Synchronously appends a list of items to the log. It is more
+ efficient to use these functions instead of functions <c>log/2</c>
+ and <c>blog/2</c>. The specified list is split into as large
+ sublists as possible (limited by the size of wrap log files),
+ and each sublist is logged as one single item, which reduces
+ the overhead.
</p>
- <p>The <c>log_terms/2</c> function is used for internally formatted
+ <p><c>log_terms/2</c> is used for internally formatted
logs, and <c>blog_terms/2</c> for externally formatted logs.
- <c>blog_terms/2</c> can be used
- for internally formatted logs as well provided the binaries were
- constructed with calls to <c>term_to_binary/1</c>.
- </p>
- <p>The owners that subscribe to notifications will be notified
+ <c>blog_terms/2</c> can also be used
+ for internally formatted logs if the binaries are
+ constructed with calls to
+ <seealso marker="erts:erlang#term_to_binary/1">
+ <c>term_to_binary/1</c></seealso>.</p>
+ <p>Owners subscribing to notifications are notified
of an error with an <c>error_status</c> message if the error
reason tag is <c>invalid_header</c> or <c>file_error</c>.
</p>
@@ -755,110 +787,119 @@
<type name="dlog_optattr"/>
<type name="dlog_size"/>
<desc>
- <p>The <c><anno>ArgL</anno></c> parameter is a list of options which have
- the following meanings:</p>
- <list type="bulleted">
+ <p>Parameter <c><anno>ArgL</anno></c> is a list of the following
+ options:</p>
+ <taglist>
+ <tag><c>{name, <anno>Log</anno>}</c></tag>
<item>
- <p><c>{name, <anno>Log</anno>}</c> specifies the name of the log.
- This is the name which must be passed on as a parameter in
+ <p>Specifies the log name.
+ This name must be passed on as a parameter in
all subsequent logging operations. A name must always
be supplied.
</p>
</item>
+ <tag><c>{file, <anno>FileName</anno>}</c></tag>
<item>
- <p><c>{file, <anno>FileName</anno>}</c> specifies the name of the
- file which will be used for logged terms. If this value is
- omitted and the name of the log is either an atom or a string,
- the file name will default to <c>lists:concat([<anno>Log</anno>, ".LOG"])</c> for halt logs. For wrap logs, this will be
- the base name of the files. Each file in a wrap log
- will be called <c><![CDATA[<base_name>.N]]></c>, where <c>N</c> is an
- integer. Each wrap log will also have two files called
+ <p>Specifies the name of the
+ file to be used for logged terms. If this value is
+ omitted and the log name is an atom or a string,
+ the filename defaults to <c>lists:concat([<anno>Log</anno>, ".LOG"])</c>
+ for halt logs.</p>
+ <p>For wrap logs, this is the base name of the files. Each file in
+ a wrap log is called <c><![CDATA[<base_name>.N]]></c>, where <c>N</c>
+ is an integer. Each wrap log also has two files called
<c><![CDATA[<base_name>.idx]]></c> and <c><![CDATA[<base_name>.siz]]></c>.
</p>
</item>
+ <tag><c>{linkto, <anno>LinkTo</anno>}</c><marker id="linkto"></marker></tag>
<item>
- <p><c>{linkto, <anno>LinkTo</anno>}</c>. <marker id="linkto"></marker>
-If
- <c><anno>LinkTo</anno></c> is a pid, that pid becomes an owner of the
- log. If <c><anno>LinkTo</anno></c> is <c>none</c> the log records
+ <p>If <c><anno>LinkTo</anno></c> is a pid, it becomes an owner of the
+ log. If <c><anno>LinkTo</anno></c> is <c>none</c>, the log records
that it is used anonymously by some process by
incrementing the <c>users</c> counter. By default, the
- process which calls <c>open/1</c> owns the log.
+ process that calls <c>open/1</c> owns the log.
</p>
</item>
+ <tag><c>{repair, <anno>Repair</anno>}</c></tag>
<item>
- <p><c>{repair, <anno>Repair</anno>}</c>. If <c><anno>Repair</anno></c> is <c>true</c>,
- the current log file will be repaired, if needed. As the
+ <p>If <c><anno>Repair</anno></c> is <c>true</c>,
+ the current log file is repaired, if needed. As the
restoration is initiated, a message is output on the error log.
- If <c>false</c> is given,
- no automatic repair will be attempted. Instead, the
+ If <c>false</c> is specified,
+ no automatic repair is attempted. Instead, the
tuple <c>{error, {need_repair, <anno>Log</anno>}}</c> is returned if an
attempt is made to open a corrupt log file.
- If <c>truncate</c> is given, the log file will
- be truncated, creating an empty log. Default is
+ If <c>truncate</c> is specified, the log file becomes
+ truncated, creating an empty log. Defaults to
<c>true</c>, which has no effect on logs opened in
read-only mode.
</p>
</item>
+ <tag><c>{type, <anno>Type</anno>}</c></tag>
<item>
- <p><c>{type, <anno>Type</anno>}</c> is the type of the log. Default
- is <c>halt</c>.
+ <p>The log type. Defaults to <c>halt</c>.
</p>
</item>
+ <tag><c>{format, <anno>Format</anno>}</c></tag>
<item>
- <p><c>{format, <anno>Format</anno>}</c> specifies the format of the
- disk log. Default is <c>internal</c>.
+ <p>Disk log format. Defaults to <c>internal</c>.
</p>
</item>
+ <tag><c>{size, <anno>Size</anno>}</c></tag>
<item>
- <p><c>{size, <anno>Size</anno>}</c> specifies the size of the log.
- When a halt log has reached its maximum size, all attempts to
- log more items are rejected. The default size is
+ <p>Log size.</p>
+ <p>When a halt log has reached its maximum size, all attempts to
+ log more items are rejected. Defaults to
<c>infinity</c>, which for halt implies that there is no
- maximum size. For wrap logs, the <c><anno>Size</anno></c> parameter
- may be either a pair
- <c>{<anno>MaxNoBytes</anno>, <anno>MaxNoFiles</anno>}</c> or <c>infinity</c>. In the
- latter case, if the files of an already existing wrap log
+ maximum size.</p>
+ <p>For wrap logs, parameter <c><anno>Size</anno></c>
+ can be a pair
+ <c>{<anno>MaxNoBytes</anno>, <anno>MaxNoFiles</anno>}</c> or
+ <c>infinity</c>.
+ In the latter case, if the files of an existing wrap log
with the same name can be found, the size is read
- from the existing wrap log, otherwise an error is returned.
- Wrap logs write at most <c><anno>MaxNoBytes</anno></c> bytes on each file
- and use <c><anno>MaxNoFiles</anno></c> files before starting all over with
- the first wrap log file. Regardless of <c><anno>MaxNoBytes</anno></c>,
+ from the existing wrap log, otherwise an error is returned.</p>
+ <p>Wrap logs write at most <c><anno>MaxNoBytes</anno></c>
+ bytes on each file and use <c><anno>MaxNoFiles</anno></c>
+ files before starting all over with the first wrap log
+ file. Regardless of <c><anno>MaxNoBytes</anno></c>,
at least the header (if there is one) and one
- item is written on each wrap log file before
- wrapping to the next file.
- When opening an existing wrap log, it is not
- necessary to supply a value for the option <c>Size</c>, but any
- supplied value must equal the current size of the log, otherwise
- the tuple <c>{error, {size_mismatch, <anno>CurrentSize</anno>, <anno>NewSize</anno>}}</c>
- is returned.
- </p>
+ item are written on each wrap log file before
+ wrapping to the next file.</p>
+ <p>When opening an existing wrap log, it is not
+ necessary to supply a value for option <c>Size</c>, but any
+ supplied value must equal the current log size, otherwise
+ the tuple <c>{error, {size_mismatch, <anno>CurrentSize</anno>,
+ <anno>NewSize</anno>}}</c> is returned.</p>
</item>
+ <tag><c>{distributed, <anno>Nodes</anno>}</c></tag>
<item>
- <p><c>{distributed, <anno>Nodes</anno>}</c>. This option can be used for
- adding members to a distributed disk log. The
- default value is <c>[]</c>, which means that
+ <p>This option can be used for
+ adding members to a distributed disk log.
+ Defaults to <c>[]</c>, which means that
the log is local on the current node.
</p>
</item>
+ <tag><c>{notify, boolean()}</c><marker id="notify"></marker></tag>
<item>
- <marker id="notify"></marker>
- <p><c>{notify, bool()}</c>. If <c>true</c>, the owners of the
- log are notified when certain events occur in the log.
- Default is <c>false</c>. The owners are sent one of the
+ <p>If <c>true</c>, the log owners
+ are notified when certain log events occur.
+ Defaults to <c>false</c>. The owners are sent one of the
following messages when an event occurs:
</p>
- <list type="bulleted">
+ <taglist>
+ <tag><c>{disk_log, Node, Log, {wrap, NoLostItems}}</c></tag>
<item>
- <p><c>{disk_log, Node, Log, {wrap, NoLostItems}}</c> is sent when a wrap log has
+ <p>Sent when a wrap log has
filled up one of its files and a new file is
opened. <c>NoLostItems</c> is the number of
- previously logged items that have been lost when
+ previously logged items that were lost when
truncating existing files.
</p>
</item>
+ <tag><c>{disk_log, Node, Log, {truncated, NoLostItems}}</c></tag>
<item>
- <p><c>{disk_log, Node, Log, {truncated, NoLostItems}}</c> is sent when a log has been
+ <p>Sent when a log is
truncated or reopened. For halt logs <c>NoLostItems</c>
is the number of items written on the log since the
disk log process was created. For wrap logs
@@ -866,127 +907,132 @@ If
wrap log files.
</p>
</item>
+ <tag><c>{disk_log, Node, Log, {read_only, Items}}</c></tag>
<item>
- <p><c>{disk_log, Node, Log, {read_only, Items}}</c>
- is sent when an asynchronous log attempt is made to
+ <p>Sent when an asynchronous log attempt is made to
a log file opened in read-only mode.
<c>Items</c> is the items from the log attempt.
</p>
</item>
+ <tag><c>{disk_log, Node, Log, {blocked_log, Items}}</c></tag>
<item>
- <p><c>{disk_log, Node, Log, {blocked_log, Items}}</c>
- is sent when an asynchronous log attempt is made to
+ <p>Sent when an asynchronous log attempt is made to
a blocked log that does not queue log attempts.
<c>Items</c> is the items from the log attempt.
</p>
</item>
+ <tag><c>{disk_log, Node, Log, {format_external, Items}}</c></tag>
<item>
- <p><c>{disk_log, Node, Log, {format_external, Items}}</c>
- is sent when <c>alog/2</c> or <c>alog_terms/2</c> is
+ <p>Sent when function <c>alog/2</c> or <c>alog_terms/2</c> is
used for internally formatted logs. <c>Items</c> is the
items from the log attempt.
</p>
</item>
+ <tag><c>{disk_log, Node, Log, full}</c></tag>
<item>
- <p><c>{disk_log, Node, Log, full}</c> is sent when
+ <p>Sent when
an attempt to log items to a wrap log would write more
- bytes than the limit set by the <c>size</c> option.
+ bytes than the limit set by option <c>size</c>.
</p>
</item>
+ <tag><c>{disk_log, Node, Log, {error_status, Status}}</c></tag>
<item>
- <p><c>{disk_log, Node, Log, {error_status, Status}}</c>
- is sent when the error status changes. The error status
+ <p>Sent when the error status changes. The error status
is defined by the outcome of the last attempt to log
- items to a the log or to truncate the log or the last
- use of <c>sync/1</c>, <c>inc_wrap_file/1</c> or
- <c>change_size/2</c>. <c>Status</c> is one of <c>ok</c> and
- <c>{error, Error}</c>, the former being the initial value.
+ items to the log, or to truncate the log, or the last
+ use of function <c>sync/1</c>, <c>inc_wrap_file/1</c>, or
+ <c>change_size/2</c>. <c>Status</c> is either <c>ok</c> or
+ <c>{error, Error}</c>, the former is the initial value.
</p>
</item>
- </list>
+ </taglist>
</item>
+ <tag><c>{head, <anno>Head</anno>}</c></tag>
<item>
- <p><c>{head, <anno>Head</anno>}</c> specifies a header to be
+ <p>Specifies a header to be
written first on the log file. If the log is a wrap
log, the item <c><anno>Head</anno></c> is written first in each new file.
- <c><anno>Head</anno></c> should be a term if the format is
- <c>internal</c>, and a deep list of bytes (or a binary)
- otherwise. Default is <c>none</c>, which means that
+ <c><anno>Head</anno></c> is to be a term if the format is
+ <c>internal</c>, otherwise a deep list of bytes (or a binary).
+ Defaults to <c>none</c>, which means that
no header is written first on the file.
</p>
</item>
+ <tag><c>{head_func, {M,F,A}}</c></tag>
<item>
- <p><c>{head_func, {M,F,A}}</c> specifies a function
+ <p>Specifies a function
to be called each time a new log file is opened.
The call <c>M:F(A)</c> is assumed to return <c>{ok, Head}</c>.
The item <c>Head</c> is written first in each file.
- <c>Head</c> should be a term if the format is
- <c>internal</c>, and a deep list of bytes (or a binary)
- otherwise.
+ <c>Head</c> is to be a term if the format is
+ <c>internal</c>, otherwise a deep list of bytes (or a binary).
</p>
</item>
+ <tag><c>{mode, <anno>Mode</anno>}</c></tag>
<item>
- <p><c>{mode, <anno>Mode</anno>}</c> specifies if the log is to be
- opened in read-only or read-write mode. It defaults to
+ <p>Specifies if the log is to be
+ opened in read-only or read-write mode. Defaults to
<c>read_write</c>.
</p>
</item>
- </list>
- <p>The <c>open/1</c> function returns <c>{ok, <anno>Log</anno>}</c> if the
- log file was successfully opened. If the file was
- successfully repaired, the tuple <c>{repaired, <anno>Log</anno>, {recovered, <anno>Rec</anno>}, {badbytes, <anno>Bad</anno>}}</c> is returned, where
- <c><anno>Rec</anno></c> is the number of whole Erlang terms found in the
- file and <c><anno>Bad</anno></c> is the number of bytes in the file which
- were non-Erlang terms. If the <c>distributed</c> parameter
- was given, <c>open/1</c> returns a list of
+ </taglist>
+ <p><c>open/1</c> returns <c>{ok, <anno>Log</anno>}</c> if the
+ log file is successfully opened. If the file is
+ successfully repaired, the tuple <c>{repaired, <anno>Log</anno>,
+ {recovered, <anno>Rec</anno>}, {badbytes, <anno>Bad</anno>}}</c>
+ is returned, where <c><anno>Rec</anno></c> is the number of
+ whole Erlang terms found in the file and <c><anno>Bad</anno></c>
+ is the number of bytes in the file that
+ are non-Erlang terms. If the parameter <c>distributed</c>
+ is specified, <c>open/1</c> returns a list of
successful replies and a list of erroneous replies. Each
reply is tagged with the node name.
</p>
<p>When a disk log is opened in read-write mode, any existing
- log file is checked for. If there is none a new empty
+ log file is checked for. If there is none, a new empty
log is created, otherwise the existing file is opened at the
position after the last logged item, and the logging of items
- will commence from there. If the format is <c>internal</c>
+ starts from there. If the format is <c>internal</c>
and the existing file is not recognized as an internally
- formatted log, a tuple <c>{error, {not_a_log_file, <anno>FileName</anno>}}</c>
+ formatted log, a tuple
+ <c>{error, {not_a_log_file, <anno>FileName</anno>}}</c>
is returned.
</p>
- <p>The <c>open/1</c> function cannot be used for changing the
- values of options of an already open log; when there are prior
+ <p><c>open/1</c> cannot be used for changing the
+ values of options of an open log. When there are prior
owners or users of a log, all option values except <c>name</c>,
- <c>linkto</c> and <c>notify</c> are just checked against
- the values that have been supplied before as option values
- to <c>open/1</c>, <c>change_header/2</c>, <c>change_notify/3</c>
- or <c>change_size/2</c>. As a consequence,
+ <c>linkto</c>, and <c>notify</c> are only checked against
+ the values supplied before as option values
+ to function <c>open/1</c>, <c>change_header/2</c>, <c>change_notify/3</c>,
+ or <c>change_size/2</c>. Thus,
none of the options except <c>name</c> is mandatory. If some
- given value differs from the current value, a tuple
+ specified value differs from the current value, a tuple
<c>{error, {arg_mismatch, <anno>OptionName</anno>, <anno>CurrentValue</anno>, <anno>Value</anno>}}</c>
- is returned. Caution: an owner's attempt to open a log
- as owner once again is acknowledged with the return value
+ is returned.</p>
+ <note><p>If an owner attempts to open a log
+ as owner once again, it is acknowledged with the return value
<c>{ok, <anno>Log</anno>}</c>, but the state of the disk log is not
- affected in any way.
- </p>
- <p>If a log with a given name is local on some node,
+ affected.</p></note>
+ <p>If a log with a specified name is local on some node,
and one tries to open the log distributed on the same node,
- then the tuple <c>{error, {node_already_open, <anno>Log</anno>}}</c> is
+ the tuple <c>{error, {node_already_open, <anno>Log</anno>}}</c> is
returned. The same tuple is returned if the log is distributed on
some node, and one tries to open the log locally on the same node.
Opening individual distributed disk logs for the first time
adds those logs to a (possibly empty) distributed disk log.
- The option values supplied are used
- on all nodes mentioned by the <c>distributed</c> option.
+ The supplied option values are used
+ on all nodes mentioned by option <c>distributed</c>.
Individual distributed logs know nothing
about each other's option values, so each node can be
given unique option values by creating a distributed
- log with several calls to <c>open/1</c>.
+ log with many calls to <c>open/1</c>.
</p>
- <p>It is possible to open a log file more than once by giving
- different values to the option <c>name</c> or by using the
+ <p>A log file can be opened more than once by giving
+ different values to option <c>name</c> or by using the
same file when distributing a log on different nodes.
- It is up to the user of the <c>disk_log</c>
- module to ensure that no more than one
- disk log process has write access to any file, or the
- the file may be corrupted.
+ It is up to the user of module <c>disk_log</c>
+ to ensure that not more than one disk log process has write
+ access to any file, otherwise the file can be corrupted.
</p>
<p>If an attempt to open a log file for the first time fails,
the disk log process terminates with the EXIT message
@@ -999,9 +1045,9 @@ If
<name name="pid2name" arity="1"/>
<fsummary>Return the name of the disk log handled by a pid.</fsummary>
<desc>
- <p>The <c>pid2name/1</c> function returns the name of the log
+ <p>Returns the log name
given the pid of a disk log process on the current node, or
- <c>undefined</c> if the given pid is not a disk log process.
+ <c>undefined</c> if the specified pid is not a disk log process.
</p>
<p>This function is meant to be used for debugging only.
</p>
@@ -1018,25 +1064,25 @@ If
<type variable="BHead"/>
<type name="reopen_error_rsn"/>
<desc>
- <p>The <c>reopen</c> functions first rename the log file
- to <c><anno>File</anno></c> and then re-create a new log file.
- In case of a wrap log, <c><anno>File</anno></c> is used as the base name
+ <p>Renames the log file
+ to <c><anno>File</anno></c> and then recreates a new log file.
+ If a wrap log exists, <c><anno>File</anno></c> is used as the base name
of the renamed files.
By default the header given to <c>open/1</c> is written first in
- the newly opened log file, but if the <c><anno>Head</anno></c> or the
- <c><anno>BHead</anno></c> argument is given, this item is used instead.
- The header argument is used once only; next time a wrap log file
+ the newly opened log file, but if argument <c><anno>Head</anno></c> or
+ <c><anno>BHead</anno></c> is specified, this item is used instead.
+ The header argument is used only once. Next time a wrap log file
is opened, the header given to <c>open/1</c> is used.
</p>
- <p>The <c>reopen/2,3</c> functions are used for internally formatted
+ <p><c>reopen/2,3</c> are used for internally formatted
logs, and <c>breopen/3</c> for externally formatted logs.
</p>
- <p>The owners that subscribe to notifications will receive
+ <p>Owners subscribing to notifications receive
a <c>truncate</c> message.
</p>
<p>Upon failure to reopen the log, the disk log process terminates
- with the EXIT message <c>{{failed,Error},[{disk_log,Fun,Arity}]}</c>,
- and other processes that have requests queued receive the message
+ with the EXIT message <c>{{failed,Error},[{disk_log,Fun,Arity}]}</c>.
+ Other processes having requests queued receive the message
<c>{disk_log, Node, {error, disk_log_stopped}}</c>.
</p>
</desc>
@@ -1046,8 +1092,7 @@ If
<fsummary>Flush the contents of a disk log to the disk.</fsummary>
<type name="sync_error_rsn"/>
<desc>
- <p>The <c>sync/1</c> function ensures that the contents of the
- log are actually written to the disk.
+ <p>Ensures that the contents of the log are written to the disk.
This is usually a rather expensive operation.
</p>
</desc>
@@ -1062,24 +1107,24 @@ If
<type variable="BHead"/>
<type name="trunc_error_rsn"/>
<desc>
- <p>The <c>truncate</c> functions remove all items from a disk log.
- If the <c><anno>Head</anno></c> or the <c><anno>BHead</anno></c> argument is
- given, this item is written first in the newly truncated
+ <p>Removes all items from a disk log.
+ If argument <c><anno>Head</anno></c> or <c><anno>BHead</anno></c> is
+ specified, this item is written first in the newly truncated
log, otherwise the header given to <c>open/1</c> is used.
- The header argument is only used once; next time a wrap log file
+ The header argument is used only once. Next time a wrap log file
is opened, the header given to <c>open/1</c> is used.
</p>
- <p>The <c>truncate/1,2</c> functions are used for internally
+ <p><c>truncate/1,2</c> are used for internally
formatted logs, and <c>btruncate/2</c> for externally formatted
logs.
</p>
- <p>The owners that subscribe to notifications will receive
+ <p>Owners subscribing to notifications receive
a <c>truncate</c> message.
</p>
<p>If the attempt to truncate the log fails, the disk log process
terminates with the EXIT message
- <c>{{failed,Reason},[{disk_log,Fun,Arity}]}</c>, and
- other processes that have requests queued receive the message
+ <c>{{failed,Reason},[{disk_log,Fun,Arity}]}</c>.
+ Other processes having requests queued receive the message
<c>{disk_log, Node, {error, disk_log_stopped}}</c>.
</p>
</desc>
@@ -1089,7 +1134,7 @@ If
<fsummary>Unblock a disk log.</fsummary>
<type name="unblock_error_rsn"/>
<desc>
- <p>The <c>unblock/1</c> function unblocks a log.
+ <p>Unblocks a log.
A log can only be unblocked by the blocking process.
</p>
</desc>
@@ -1098,8 +1143,8 @@ If
<section>
<title>See Also</title>
- <p><seealso marker="file">file(3)</seealso>,
- <seealso marker="pg2">pg2(3)</seealso>,
- <seealso marker="wrap_log_reader">wrap_log_reader(3)</seealso></p>
+ <p><seealso marker="file"><c>file(3)</c></seealso>,
+ <seealso marker="pg2"><c>pg2(3)</c></seealso>,
+ <seealso marker="wrap_log_reader"><c>wrap_log_reader(3)</c></seealso></p>
</section>
</erlref>
diff --git a/lib/kernel/doc/src/erl_boot_server.xml b/lib/kernel/doc/src/erl_boot_server.xml
index a8015fa453..897365f9b9 100644
--- a/lib/kernel/doc/src/erl_boot_server.xml
+++ b/lib/kernel/doc/src/erl_boot_server.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,72 +29,73 @@
<rev></rev>
</header>
<module>erl_boot_server</module>
- <modulesummary>Boot Server for Other Erlang Machines</modulesummary>
+ <modulesummary>Boot server for other Erlang machines.</modulesummary>
<description>
- <p>This server is used to assist diskless Erlang nodes which fetch
+ <p>This server is used to assist diskless Erlang nodes that fetch
all Erlang code from another machine.</p>
<p>This server is used to fetch all code, including the start
script, if an Erlang runtime system is started with
- the <c>-loader inet</c> command line flag. All hosts specified
- with the <c>-hosts Host</c> command line flag must have one
+ command-line flag <c>-loader inet</c>. All hosts specified
+ with command-line flag <c>-hosts Host</c> must have one
instance of this server running.</p>
- <p>This server can be started with the <c>kernel</c> configuration
+ <p>This server can be started with the <c>Kernel</c> configuration
parameter <c>start_boot_server</c>.</p>
- <p>The <c>erl_boot_server</c> can both read regular files as well as
- files in archives. See <seealso marker="code">code(3)</seealso>
- and <seealso marker="erts:erl_prim_loader">erl_prim_loader(3)</seealso>.</p>
- <warning><p>The support for loading of code from archive files is
- experimental. The sole purpose of releasing it before it is ready
- is to obtain early feedback. The file format, semantics,
- interfaces etc. may be changed in a future release.</p></warning>
+ <p>The <c>erl_boot_server</c> can read regular files and
+ files in archives. See <seealso marker="code"><c>code(3)</c></seealso>
+ and
+ <seealso marker="erts:erl_prim_loader"><c>erl_prim_loader(3)</c></seealso>
+ in <c>ERTS</c>.</p>
+ <warning><p>The support for loading code from archive files is
+ experimental. It is released before it is ready
+ to obtain early feedback. The file format, semantics,
+ interfaces, and so on, can be changed in a future release.</p></warning>
</description>
<funcs>
<func>
- <name name="start" arity="1"/>
- <fsummary>Start the boot server</fsummary>
+ <name name="add_slave" arity="1"/>
+ <fsummary>Add a slave to the list of allowed slaves.</fsummary>
<desc>
- <p>Starts the boot server. <c><anno>Slaves</anno></c> is a list of IP
- addresses for hosts which are allowed to use this server as a
- boot server.</p>
+ <p>Adds a <c><anno>Slave</anno></c> node to the list of allowed slave hosts.</p>
</desc>
</func>
<func>
- <name name="start_link" arity="1"/>
- <fsummary>Start the boot server and links the caller</fsummary>
+ <name name="delete_slave" arity="1"/>
+ <fsummary>Delete a slave from the list of allowed slaves.</fsummary>
<desc>
- <p>Starts the boot server and links to the caller. This function
- is used to start the server if it is included in a supervision
- tree.</p>
+ <p>Deletes a <c><anno>Slave</anno></c> node from the list of allowed slave
+ hosts.</p>
</desc>
</func>
<func>
- <name name="add_slave" arity="1"/>
- <fsummary>Add a slave to the list of allowed slaves</fsummary>
+ <name name="start" arity="1"/>
+ <fsummary>Start the boot server.</fsummary>
<desc>
- <p>Adds a <c><anno>Slave</anno></c> node to the list of allowed slave hosts.</p>
+ <p>Starts the boot server. <c><anno>Slaves</anno></c> is a list of
+ IP addresses for hosts, which are allowed to use this server as a
+ boot server.</p>
</desc>
</func>
<func>
- <name name="delete_slave" arity="1"/>
- <fsummary>Delete a slave from the list of allowed slaves</fsummary>
+ <name name="start_link" arity="1"/>
+ <fsummary>Start the boot server and link to the the caller.</fsummary>
<desc>
- <p>Deletes a <c><anno>Slave</anno></c> node from the list of allowed slave
- hosts.</p>
+ <p>Starts the boot server and links to the caller. This function
+ is used to start the server if it is included in a supervision
+ tree.</p>
</desc>
</func>
<func>
<name name="which_slaves" arity="0"/>
- <fsummary>Return the current list of allowed slave hosts</fsummary>
+ <fsummary>Return the current list of allowed slave hosts.</fsummary>
<desc>
<p>Returns the current list of allowed slave hosts.</p>
</desc>
</func>
</funcs>
-
<section>
<title>SEE ALSO</title>
- <p><seealso marker="erts:init">init(3)</seealso>,
- <seealso marker="erts:erl_prim_loader">erl_prim_loader(3)</seealso></p>
+ <p><seealso marker="erts:init"><c>erts:init(3)</c></seealso>,
+ <seealso marker="erts:erl_prim_loader"><c>erts:erl_prim_loader(3)</c></seealso></p>
</section>
</erlref>
diff --git a/lib/kernel/doc/src/erl_ddll.xml b/lib/kernel/doc/src/erl_ddll.xml
index 8d71883cf4..a5ce58ef3e 100644
--- a/lib/kernel/doc/src/erl_ddll.xml
+++ b/lib/kernel/doc/src/erl_ddll.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,84 +29,91 @@
<rev></rev>
</header>
<module>erl_ddll</module>
- <modulesummary>Dynamic Driver Loader and Linker</modulesummary>
+ <modulesummary>Dynamic driver loader and linker.</modulesummary>
<description>
- <p>The <c>erl_ddll</c> module provides an interface for loading
- and unloading <em>erlang linked in drivers</em> in runtime.</p>
+ <p>This module provides an interface for loading
+ and unloading <em>Erlang linked-in drivers</em> in runtime.</p>
<note>
- <p>This is a large reference document. For casual use of the
- module, as well as for most real world applications, the
- descriptions of the functions <seealso marker="#load/2">load/2</seealso> and <seealso marker="#unload/1">unload/1</seealso> are enough to get
- going. </p>
+ <p>This is a large reference document. For casual use of this
+ module, and for most real world applications, the
+ descriptions of functions
+ <seealso marker="#load/2"><c>load/2</c></seealso> and
+ <seealso marker="#unload/1"><c>unload/1</c></seealso>
+ are enough to getting started.</p>
</note>
- <p>The driver should be provided as a dynamically linked library
- in a object code format specific for the platform in use,
- i. e. <c>.so</c> files on most Unix systems and <c>.ddl</c>
- files on windows. An erlang linked in driver has to provide
+ <p>The driver is to be provided as a dynamically linked library
+ in an object code format specific for the platform in use,
+ that is, <c>.so</c> files on most Unix systems and <c>.ddl</c>
+ files on Windows. An Erlang linked-in driver must provide
specific interfaces to the emulator, so this module is not
- designed for loading arbitrary dynamic libraries. For further
- information about erlang drivers, refer to the ERTS reference
- manual section <seealso marker="erts:erl_driver">erl_driver</seealso>.</p>
+ designed for loading arbitrary dynamic libraries. For more
+ information about Erlang drivers, see
+ <seealso marker="erts:erl_driver"><c>erts:erl_driver</c></seealso>
+ .</p>
<marker id="users"></marker>
- <p>When describing a set of functions, (i.e. a module, a part of a
- module or an application) executing in a process and wanting to
- use a ddll-driver, we use the term <em>user</em>. There can be
- several users in one process (different modules needing the same
- driver) and several processes running the same code, making up
- several <em>users</em> of a driver. In the basic scenario, each
- user loads the driver before starting to use it and unloads the
- driver when done. The reference counting keeps track of
- processes as well as the number of loads by each process, so that
- the driver will only be unloaded when no one wants it
- (it has no user). The driver also keeps track of ports that are
- opened towards it, so that one can delay unloading until all
- ports are closed or kill all ports using the driver when it is
- unloaded. </p>
+ <p>When describing a set of functions (that is, a module, a part of a
+ module, or an application), executing in a process and wanting to
+ use a ddll-driver, we use the term <em>user</em>. A process can
+ have many users (different modules needing the same
+ driver) and many processes running the same code, making up
+ many <em>users</em> of a driver.</p>
+ <p>In the basic scenario, each user loads the driver before
+ starting to use it and unloads the driver when done.
+ The reference counting keeps track of
+ processes and the number of loads by each process. This way
+ the driver is only unloaded when no one wants it (it has no user).
+ The driver also keeps track of ports that are
+ opened to it. This enables delay of unloading until all
+ ports are closed, or killing of all ports that use the driver when
+ it is unloaded.</p>
<marker id="scenarios"></marker>
<p>The interface supports two basic scenarios of loading and
unloading. Each scenario can also have the option of either
killing ports when the driver is unloading, or waiting for the
- ports to close themselves. The scenarios are:</p>
+ ports to close themselves. The scenarios are as follows:</p>
<taglist>
- <tag><em>Load and unload on a "when needed basis"</em></tag>
+ <tag><em>Load and Unload on a "When Needed Basis"</em></tag>
<item>
<p>This (most common) scenario simply supports that each
<seealso marker="#users">user</seealso> of the driver loads
- it when it is needed and unloads it when the <seealso marker="#users">user</seealso> no longer have any use for
- it. The driver is always reference counted and as long as a
+ it when needed and unloads it when no longer needed.
+ The driver is always reference counted and as long as a
process keeping the driver loaded is still alive, the driver
is present in the system.</p>
<p>Each <seealso marker="#users">user</seealso> of the driver
use <em>literally</em> the same pathname for the driver when
- demanding load, but the <seealso marker="#users">users</seealso> are not really concerned
- with if the driver is already loaded from the filesystem or
- if the object code has to be loaded from filesystem.</p>
- <p>Two pairs of functions support this scenario:</p>
+ demanding load, but the
+ <seealso marker="#users">users</seealso> are not concerned
+ with if the driver is already loaded from the file system or
+ if the object code must be loaded from file system.</p>
+ <p>The following two pairs of functions support this scenario:</p>
<taglist>
<tag><em>load/2 and unload/1</em></tag>
<item>
<p>When using the <c>load/unload</c> interfaces, the
- driver will not <em>actually</em> get unloaded until the
- <em>last port</em> using the driver is closed. The function
- <c>unload/1</c> can return immediately, as the <seealso marker="#users">users</seealso> are not really concerned
- with when the actual unloading occurs. The
- driver will actually get unloaded when no one needs it any longer.</p>
- <p>If a process having the driver loaded dies, it will have
- the same effect as if unloading was done. </p>
- <p>When loading, the function <c>load/2</c> returns
- <c>ok</c> as soon as there is any instance of the driver
- present, so that if a driver is waiting to get unloaded
- (due to open ports), it will simply change state to no
+ driver is not unloaded until the
+ <em>last port</em> using the driver is closed. Function
+ <c>unload/1</c> can return immediately, as the
+ <seealso marker="#users">users</seealso>
+ have no interrest in when the unloading occurs. The
+ driver is unloaded when no one needs it any longer.</p>
+ <p>If a process having the driver loaded dies, it has
+ the same effect as if unloading is done.</p>
+ <p>When loading, function <c>load/2</c> returns
+ <c>ok</c> when any instance of the driver is
+ present. Thus, if a driver is waiting to get unloaded
+ (because of open ports), it simply changes state to no
longer need unloading.</p>
</item>
<tag><em>load_driver/2 and unload_driver/1</em></tag>
<item>
- <p>These interfaces is intended to be used when it is considered an
- error that ports are open towards a driver that no <seealso marker="#users">user</seealso>
- has loaded. The ports still open when the
+ <p>These interfaces are intended to be used when it is considered an
+ error that ports are open to a driver that no
+ <seealso marker="#users">user</seealso>
+ has loaded. The ports that are still open when the
last <seealso marker="#users">user</seealso> calls
<c>unload_driver/1</c> or when the last process having the
- driver loaded dies, will get killed with reason
+ driver loaded dies, are killed with reason
<c>driver_unloaded</c>.</p>
<p>The function names <c>load_driver</c> and
<c>unload_driver</c> are kept for backward
@@ -114,60 +121,66 @@
</item>
</taglist>
</item>
- <tag><em>Loading and reloading for code replacement</em></tag>
+ <tag><em>Loading and Reloading for Code Replacement</em></tag>
<item>
- <p>This scenario occurs when the driver code might need
+ <p>This scenario can occur if the driver code needs
replacement during operation of the Erlang
- emulator. Implementing driver code replacement is somewhat
- more tedious than beam code replacement, as one driver
- cannot be loaded as both "old" and "new" code. All <seealso marker="#users">users</seealso> of a driver must have it
+ emulator. Implementing driver code replacement is a little
+ more tedious than Beam code replacement, as one driver
+ cannot be loaded as both "old" and "new" code. All
+ <seealso marker="#users">users</seealso> of a driver must have it
closed (no open ports) before the old code can be unloaded
and the new code can be loaded.</p>
- <p>The actual unloading/loading is done as one atomic
+ <p>The unloading/loading is done as one atomic
operation, blocking all processes in the system from using
- the driver concerned while in progress.</p>
+ the driver in question while in progress.</p>
<p>The preferred way to do driver code replacement is to let
<em>one single process</em> keep track of the driver. When
- the process start, the driver is loaded. When replacement
+ the process starts, the driver is loaded. When replacement
is required, the driver is reloaded. Unload is probably never
- done, or done when the process exits. If more than one <seealso marker="#users">user</seealso> has a driver loaded when code
- replacement is demanded, the replacement cannot occur until
- the last "other" <seealso marker="#users">user</seealso> has
+ done, or done when the process exits. If more than one
+ <seealso marker="#users">user</seealso> has a driver
+ loaded when code replacement is demanded, the replacement cannot
+ occur until the last "other"
+ <seealso marker="#users">user</seealso> has
unloaded the driver.</p>
<p>Demanding reload when a reload is already in progress is
- always an error. Using the high level functions, it is also
- an error to demand reloading when more than one <seealso marker="#users">user</seealso> has the driver loaded. To
- simplify driver replacement, avoid designing your system so
- that more than than one <seealso marker="#users">user</seealso> has the driver loaded.</p>
- <p>The two functions for reloading drivers should be used
- together with corresponding load functions, to support the two
+ always an error. Using the high-level functions, it is also
+ an error to demand reloading when more than one
+ <seealso marker="#users">user</seealso> has the driver loaded.</p>
+ <p>To simplify driver replacement, avoid designing your system so
+ that more than one
+ <seealso marker="#users">user</seealso> has the driver loaded.</p>
+ <p>The two functions for reloading drivers are to be used
+ together with corresponding load functions to support the two
different behaviors concerning open ports:</p>
<taglist>
<tag><em>load/2 and reload/2</em></tag>
<item>
- <p>This pair of functions is used when reloading should be
- done after the last open port towards the driver is
+ <p>This pair of functions is used when reloading is to be
+ done after the last open port to the driver is
closed.</p>
- <p>As <c>reload/2</c> actually waits for the reloading to
- occur, a misbehaving process keeping open ports towards
- the driver (or keeping the driver loaded) might cause
- infinite waiting for reload. Timeouts has to be provided
+ <p>As <c>reload/2</c> waits for the reloading to
+ occur, a misbehaving process keeping open ports to
+ the driver (or keeping the driver loaded) can cause
+ infinite waiting for reload. Time-outs must be provided
outside of the process demanding the reload or by using
- the low-level interface <seealso marker="#try_load/3">try_load/3</seealso> in combination
- with driver monitors (see below).</p>
+ the low-level interface
+ <seealso marker="#try_load/3"><c>try_load/3</c></seealso>
+ in combination with driver monitors.</p>
</item>
<tag><em>load_driver/2 and reload_driver/2</em></tag>
<item>
- <p>This pair of functions are used when open ports towards
- the driver should be killed with reason
+ <p>This pair of functions are used when open ports to
+ the driver are to be killed with reason
<c>driver_unloaded</c> to allow for new driver code to
get loaded.</p>
- <p>If, however, another process has the driver loaded,
- calling <c>reload_driver</c> returns the error code
+ <p>However, if another process has the driver loaded,
+ calling <c>reload_driver</c> returns error code
<c>pending_process</c>. As stated earlier,
- the recommended design is to not allow other <seealso marker="#users">users</seealso> than the "driver
- reloader" to actually demand loading of the concerned
- driver.</p>
+ the recommended design is to not allow other
+ <seealso marker="#users">users</seealso> than the "driver
+ reloader" to demand loading of the driver in question.</p>
</item>
</taglist>
</item>
@@ -184,903 +197,982 @@
<funcs>
<func>
<name name="demonitor" arity="1"/>
- <fsummary>Remove a monitor for a driver</fsummary>
+ <fsummary>Remove a monitor for a driver.</fsummary>
<desc>
<p>Removes a driver monitor in much the same way as
- <seealso marker="erts:erlang#erlang:demonitor/1">erlang:demonitor/1</seealso> does with process
- 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>
+ <seealso marker="erts:erlang#erlang:demonitor/1"><c>erlang:demonitor/1</c></seealso>
+ in <c>ERTS</c>
+ does with process monitors. For details about how to create
+ driver monitors, see
+ <seealso marker="#monitor/2"><c>monitor/2</c></seealso>,
+ <seealso marker="#try_load/3"><c>try_load/3</c></seealso>, and
+ <seealso marker="#try_unload/2"><c>try_unload/2</c></seealso>.</p>
<p>The function throws a <c>badarg</c> exception if the
- parameter is not a reference(). </p>
+ parameter is not a <c>reference()</c>.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="format_error" arity="1"/>
+ <fsummary>Format an error descriptor.</fsummary>
+ <desc>
+ <p>Takes an <c><anno>ErrorDesc</anno></c> returned by load, unload, or
+ reload functions and returns a string that
+ describes the error or warning.</p>
+ <note>
+ <p>Because of peculiarities in the dynamic loading interfaces on
+ different platforms, the returned string is only guaranteed
+ to describe the correct error <em>if format_error/1 is called
+ in the same instance of the Erlang virtual machine as the error
+ appeared in</em> (meaning the same operating
+ system process).</p>
+ </note>
</desc>
</func>
<func>
<name name="info" arity="0"/>
- <fsummary>Retrieve information about all drivers</fsummary>
+ <fsummary>Retrieve information about all drivers.</fsummary>
<desc>
- <p>Returns a list of tuples <c>{<anno>DriverName</anno>, <anno>InfoList</anno>}</c>, where
- <c><anno>InfoList</anno></c> is the result of calling <seealso marker="#info/1">info/1</seealso> for that
- <c><anno>DriverName</anno></c>. Only dynamically linked in drivers are
+ <p>Returns a list of tuples <c>{<anno>DriverName</anno>, <anno>InfoList</anno>}</c>,
+ where <c><anno>InfoList</anno></c> is the result of calling
+ <seealso marker="#info/1"><c>info/1</c></seealso> for that
+ <c><anno>DriverName</anno></c>. Only dynamically linked-in drivers are
included in the list.</p>
</desc>
</func>
<func>
<name name="info" arity="1"/>
- <fsummary>Retrieve information about one driver</fsummary>
+ <fsummary>Retrieve information about one driver.</fsummary>
<desc>
- <p>Returns a list of tuples <c>{<anno>Tag</anno>, <anno>Value</anno>}</c>, where
- <c><anno>Tag</anno></c> is the information item and <c><anno>Value</anno></c> is the result
- of calling <seealso marker="#info/2">info/2</seealso> with this driver name and
- this tag. The result being a tuple list containing all
- information available about a driver. </p>
- <p>The different tags that will appear in the list are:</p>
+ <p>Returns a list of tuples <c>{<anno>Tag</anno>, <anno>Value</anno>}</c>,
+ where <c><anno>Tag</anno></c> is the information item and
+ <c><anno>Value</anno></c> is the result of calling
+ <seealso marker="#info/2"><c>info/2</c></seealso> with this driver
+ name and this tag. The result is a tuple list containing all information
+ available about a driver.</p>
+ <p>The following tags appears in the list:</p>
<list type="bulleted">
- <item>processes</item>
- <item>driver_options</item>
- <item>port_count</item>
- <item>linked_in_driver</item>
- <item>permanent</item>
- <item>awaiting_load</item>
- <item>awaiting_unload</item>
+ <item><c>processes</c></item>
+ <item><c>driver_options</c></item>
+ <item><c>port_count</c></item>
+ <item><c>linked_in_driver</c></item>
+ <item><c>permanent</c></item>
+ <item><c>awaiting_load</c></item>
+ <item><c>awaiting_unload</c></item>
</list>
- <p>For a detailed description of each value, please read the
- description of <seealso marker="#info/2">info/2</seealso> below.</p>
+ <p>For a detailed description of each value, see
+ <seealso marker="#info/2"><c>info/2</c></seealso>.</p>
<p>The function throws a <c>badarg</c> exception if the driver
is not present in the system.</p>
</desc>
</func>
<func>
<name name="info" arity="2"/>
- <fsummary>Retrieve specific information about one driver</fsummary>
+ <fsummary>Retrieve specific information about one driver.</fsummary>
<desc>
- <p>This function returns specific information about one aspect
- of a driver. The <c><anno>Tag</anno></c> parameter specifies which aspect
- to get information about. The <c><anno>Value</anno></c> return differs
+ <p>Returns specific information about one aspect of a driver.
+ Parameter <c><anno>Tag</anno></c> specifies which aspect
+ to get information about. The return <c><anno>Value</anno></c> differs
between different tags:</p>
<taglist>
- <tag><em>processes</em></tag>
+ <tag><c>processes</c></tag>
<item>
- <p>Return all processes containing <seealso marker="#users">users</seealso> of the specific drivers
- as a list of tuples <c>{pid(),integer() >= 0}</c>, where the
- <c>integer()</c> denotes the number of users in the process
+ <p>Returns all processes containing
+ <seealso marker="#users">users</seealso> of the specific drivers
+ as a list of tuples <c>{pid(),integer() >= 0}</c>, where
+ <c>integer()</c> denotes the number of users in process
<c>pid()</c>.</p>
</item>
- <tag><em>driver_options</em></tag>
+ <tag><c>driver_options</c></tag>
<item>
- <p>Return a list of the driver options provided when
- loading, as well as any options set by the driver itself
- during initialization. The currently only valid option
- being <c>kill_ports</c>.</p>
+ <p>Returns a list of the driver options provided when
+ loading, and any options set by the driver
+ during initialization. The only valid option
+ is <c>kill_ports</c>.</p>
</item>
- <tag><em>port_count</em></tag>
+ <tag><c>port_count</c></tag>
<item>
- <p>Return the number of ports (an <c>integer >= 0()</c>) using the driver.</p>
+ <p>Returns the number of ports (an <c>integer() >= 0</c>)
+ using the driver.</p>
</item>
- <tag><em>linked_in_driver</em></tag>
+ <tag><c>linked_in_driver</c></tag>
<item>
- <p>Return a <c>boolean()</c>, being <c>true</c> if the driver is a
- statically linked in one and <c>false</c> otherwise.</p>
+ <p>Returns a <c>boolean()</c>, which is <c>true</c> if the driver is a
+ statically linked-in one, otherwise <c>false</c>.</p>
</item>
- <tag><em>permanent</em></tag>
+ <tag><c>permanent</c></tag>
<item>
- <p>Return a <c>boolean()</c>, being <c>true</c> if the driver has made
- itself permanent (and is <em>not</em> a statically
- linked in driver). <c>false</c> otherwise.</p>
+ <p>Returns a <c>boolean()</c>, which is <c>true</c> if the driver has
+ made itself permanent (and is <em>not</em> a statically
+ linked-in driver), otherwise <c>false</c>.</p>
</item>
- <tag><em>awaiting_load</em></tag>
+ <tag><c>awaiting_load</c></tag>
<item>
- <p>Return a list of all processes having monitors for
- <c>loading</c> active, each process returned as
- <c>{pid(),integer() >= 0}</c>, where the <c>integer()</c> is the
- number of monitors held by the process <c>pid()</c>.</p>
+ <p>Returns a list of all processes having monitors for
+ <c>loading</c> active. Each process is returned as
+ <c>{pid(),integer() >= 0}</c>, where <c>integer()</c> is the
+ number of monitors held by process <c>pid()</c>.</p>
</item>
- <tag><em>awaiting_unload</em></tag>
+ <tag><c>awaiting_unload</c></tag>
<item>
- <p>Return a list of all processes having monitors for
- <c>unloading</c> active, each process returned as
- <c>{pid(),integer() >= 0}</c>, where the <c>integer()</c> is the
- number of monitors held by the process <c>pid()</c>.</p>
+ <p>Returns a list of all processes having monitors for
+ <c>unloading</c> active. Each process is returned as
+ <c>{pid(),integer() >= 0}</c>, where <c>integer()</c> is the
+ number of monitors held by process <c>pid()</c>.</p>
</item>
</taglist>
- <p>If the options <c>linked_in_driver</c> or <c>permanent</c>
- return true, all other options will return the value
- <c>linked_in_driver</c> or <c>permanent</c> respectively.</p>
+ <p>If option <c>linked_in_driver</c> or <c>permanent</c>
+ returns <c>true</c>, all other options return
+ <c>linked_in_driver</c> or <c>permanent</c>, respectively.</p>
<p>The function throws a <c>badarg</c> exception if the driver
- is not present in the system or the tag is not supported.</p>
+ is not present in the system or if the tag is not supported.</p>
</desc>
</func>
<func>
<name name="load" arity="2"/>
- <fsummary>Load a driver</fsummary>
+ <fsummary>Load a driver.</fsummary>
<desc>
- <p>Loads and links the dynamic driver <c><anno>Name</anno></c>. <c><anno>Path</anno></c>
+ <p>Loads and links the dynamic driver <c><anno>Name</anno></c>.
+ <c><anno>Path</anno></c>
is a file path to the directory containing the driver.
<c><anno>Name</anno></c> must be a sharable object/dynamic library. Two
drivers with different <c><anno>Path</anno></c> parameters cannot be
- loaded under the same name. The <c><anno>Name</anno></c> is a string or
+ loaded under the same name. <c><anno>Name</anno></c> is a string or
atom containing at least one character.</p>
- <p>The <c><anno>Name</anno></c> given should correspond to the filename
- of the actual dynamically loadable object file residing in
- the directory given as <c><anno>Path</anno></c>, but <em>without</em> the
- extension (i.e. <c>.so</c>). The driver name provided in
+ <p>The <c><anno>Name</anno></c> specified is to correspond to the filename
+ of the dynamically loadable object file residing in
+ the directory specified as <c><anno>Path</anno></c>, but <em>without</em> the
+ extension (that is, <c>.so</c>). The driver name provided in
the driver initialization routine must correspond with the
- filename, in much the same way as erlang module names
+ filename, in much the same way as Erlang module names
correspond to the names of the <c>.beam</c> files.</p>
- <p>If the driver has been previously unloaded, but is still
- present due to open ports against it, a call to
- <c>load/2</c> will stop the unloading and keep the driver
- (as long as the <c><anno>Path</anno></c> is the same) and <c>ok</c> is
- returned. If one actually wants the object code to be
- reloaded, one uses <seealso marker="#reload/2">reload/2</seealso> or the low-level
- interface <seealso marker="#try_load/3">try_load/3</seealso>
- instead. Please refer to the description of <seealso marker="#scenarios">different scenarios</seealso> for
+ <p>If the driver was previously unloaded, but is still
+ present because of open ports to it, a call to
+ <c>load/2</c> stops the unloading and keeps the driver
+ (as long as <c><anno>Path</anno></c> is the same), and <c>ok</c> is
+ returned. If you really want the object code to be
+ reloaded, use <seealso marker="#reload/2"><c>reload/2</c></seealso>
+ or the low-level interface
+ <seealso marker="#try_load/3"><c>try_load/3</c></seealso> instead.
+ See also the description of
+ <seealso marker="#scenarios"><c>different scenarios</c></seealso> for
loading/unloading in the introduction.</p>
<p>If more than one process tries to load an already loaded
- driver withe the same <c><anno>Path</anno></c>, or if the same process
- tries to load it several times, the function will return
- <c>ok</c>. The emulator will keep track of the
+ driver with the same <c><anno>Path</anno></c>, or if the same process
+ tries to load it many times, the function returns
+ <c>ok</c>. The emulator keeps track of the
<c>load/2</c> calls, so that a corresponding number of
- <c>unload/2</c> calls will have to be done from the same
- process before the driver will actually get unloaded. It is
+ <c>unload/2</c> calls must be done from the same
+ process before the driver gets unloaded. It is
therefore safe for an application to load a driver that is
shared between processes or applications when needed. It can
safely be unloaded without causing trouble for other
- parts of the system. </p>
- <p>It is not allowed to load
- several drivers with the same name but with different
- <c>Path</c> parameters.</p>
+ parts of the system.</p>
+ <p>It is not allowed to load multiple drivers with
+ the same name but with different <c>Path</c> parameters.</p>
<note>
- <p>Note especially that the <c><anno>Path</anno></c> is interpreted
- literally, so that all loaders of the same driver needs to
- give the same <em>literal</em><c><anno>Path</anno></c> string, even
- though different paths might point out the same directory
- in the filesystem (due to use of relative paths and
+ <p><c><anno>Path</anno></c> is interpreted
+ literally, so that all loaders of the same driver must
+ specify the same <em>literal</em> <c><anno>Path</anno></c> string,
+ although different paths can point out the same directory
+ in the file system (because of use of relative paths and
links).</p>
</note>
<p>On success, the function returns <c>ok</c>. On
failure, the return value is <c>{error,<anno>ErrorDesc</anno>}</c>,
where <c><anno>ErrorDesc</anno></c> is an opaque term to be
- translated into human readable form by the <seealso marker="#format_error/1">format_error/1</seealso>
- function.</p>
- <p>For more control over the error handling, again use the
- <seealso marker="#try_load/3">try_load/3</seealso>
+ translated into human readable form by function
+ <seealso marker="#format_error/1"><c>format_error/1</c></seealso>.</p>
+ <p>For more control over the error handling, use the
+ <seealso marker="#try_load/3"><c>try_load/3</c></seealso>
interface instead.</p>
<p>The function throws a <c>badarg</c> exception if the
- parameters are not given as described above. </p>
+ parameters are not specified as described here.</p>
</desc>
</func>
<func>
<name name="load_driver" arity="2"/>
- <fsummary>Load a driver</fsummary>
+ <fsummary>Load a driver.</fsummary>
<desc>
- <p>Works essentially as <c>load/2</c>, but will load the driver
- with other options. All ports that are using the
- driver will get killed with the reason
- <c>driver_unloaded</c> when the driver is to be unloaded.</p>
- <p>The number of loads and unloads by different <seealso marker="#users">users</seealso> influence the actual loading
- and unloading of a driver file. The port killing will
- therefore only happen when the <em>last</em> <seealso marker="#users">user</seealso> unloads the driver, or the
- last process having loaded the driver exits.</p>
+ <p>Works essentially as <c>load/2</c>, but loads the driver
+ with other options. All ports using the
+ driver are killed with reason <c>driver_unloaded</c>
+ when the driver is to be unloaded.</p>
+ <p>The number of loads and unloads by different
+ <seealso marker="#users">users</seealso> influences the loading
+ and unloading of a driver file. The port killing
+ therefore only occurs when the <em>last</em>
+ <seealso marker="#users">user</seealso> unloads the driver,
+ or when the last process having loaded the driver exits.</p>
<p>This interface (or at least the name of the functions) is
- kept for backward compatibility. Using <seealso marker="#try_load/3">try_load/3</seealso> with
- <c>{driver_options,[kill_ports]} </c> in the option list will
- give the same effect regarding the port killing.</p>
+ kept for backward compatibility.
+ Using <seealso marker="#try_load/3"><c>try_load/3</c></seealso> with
+ <c>{driver_options,[kill_ports]}</c> in the option list
+ gives the same effect regarding the port killing.</p>
<p>The function throws a <c>badarg</c> exception if the
- parameters are not given as described above. </p>
+ parameters are not specified as described here.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="loaded_drivers" arity="0"/>
+ <fsummary>List loaded drivers.</fsummary>
+ <desc>
+ <p>Returns a list of all the available drivers, both
+ (statically) linked-in and dynamically loaded ones.</p>
+ <p>The driver names are returned as a list of strings rather
+ than a list of atoms for historical reasons.</p>
+ <p>For more information about drivers, see
+ <seealso marker="#info/0"><c>info</c></seealso>.</p>
</desc>
</func>
<func>
<name name="monitor" arity="2"/>
- <fsummary>Create a monitor for a driver</fsummary>
+ <fsummary>Create a monitor for a driver.</fsummary>
<desc>
- <p>This function creates a driver monitor and works in many
- ways as the function <seealso marker="erts:erlang#erlang:monitor/2">erlang:monitor/2</seealso>,
+ <p>Creates a driver monitor and works in many
+ ways as
+ <seealso marker="erts:erlang#erlang:monitor/2"><c>erlang:monitor/2</c></seealso>
+ in <c>ERTS</c>,
does for processes. When a driver changes state, the monitor
- results in a monitor-message being sent to the calling
- process. The <c><anno>MonitorRef</anno></c> returned by this function is
+ results in a monitor message that is sent to the calling
+ process. <c><anno>MonitorRef</anno></c> returned by this function is
included in the message sent.</p>
- <p>As with process monitors, each driver monitor set will only
- generate <em>one single message</em>. The monitor is
- "destroyed" after the message is sent and there is then no
- need to call <seealso marker="#demonitor/1">demonitor/1</seealso>.</p>
- <p>The <c><anno>MonitorRef</anno></c> can also be used in subsequent calls
- to <seealso marker="#demonitor/1">demonitor/1</seealso> to
+ <p>As with process monitors, each driver monitor set only
+ generates <em>one single message</em>. The monitor is
+ "destroyed" after the message is sent, so it is then not
+ needed to call
+ <seealso marker="#demonitor/1"><c>demonitor/1</c></seealso>.</p>
+ <p><c><anno>MonitorRef</anno></c> can also be used in subsequent calls
+ to <seealso marker="#demonitor/1"><c>demonitor/1</c></seealso> to
remove a monitor.</p>
<p>The function accepts the following parameters:</p>
<taglist>
- <tag><em><c><anno>Tag</anno></c></em></tag>
+ <tag><c><anno>Tag</anno></c></tag>
<item>
- <p>The monitor tag is always <c>driver</c> as this function
+ <p>The monitor tag is always <c>driver</c>, as this function
can only be used to create driver monitors. In the future,
driver monitors will be integrated with process monitors,
- why this parameter has to be given for consistence.</p>
+ why this parameter has to be specified for consistence.</p>
</item>
- <tag><em><c><anno>Item</anno></c></em></tag>
+ <tag><c><anno>Item</anno></c></tag>
<item>
- <p>The <c><anno>Item</anno></c> parameter specifies which driver one
- wants to monitor (the name of the driver) as well as
- which state change one wants to monitor. The parameter
+ <p>Parameter <c><anno>Item</anno></c> specifies
+ which driver to monitor (the driver name) and
+ which state change to monitor. The parameter
is a tuple of arity two whose first element is the
- driver name and second element is either of:</p>
+ driver name and second element is one of the following:</p>
<taglist>
- <tag><em>loaded</em></tag>
+ <tag><c>loaded</c></tag>
<item>
- <p>Notify me when the driver is reloaded (or loaded if
+ <p>Notifies when the driver is reloaded (or loaded if
loading is underway). It only makes sense to monitor
drivers that are in the process of being loaded or
- reloaded. One cannot monitor a future-to-be driver
- name for loading, that will only result in a
- <c>'DOWN'</c> message being immediately sent.
+ reloaded. A future driver name for loading cannot be
+ monitored. That only results in a
+ <c>DOWN</c> message sent immediately.
Monitoring for loading is therefore most useful when
- triggered by the <seealso marker="#try_load/3">try_load/3</seealso> function,
+ triggered by function
+ <seealso marker="#try_load/3"><c>try_load/3</c></seealso>,
where the monitor is created <em>because</em> the
driver is in such a pending state.</p>
- <p>Setting a driver monitor for <c>loading</c> will
- eventually lead to one of the following messages
+ <p>Setting a driver monitor for <c>loading</c>
+ eventually leads to one of the following messages
being sent:</p>
<taglist>
- <tag><em>{'UP', reference(), driver, Name, loaded}</em></tag>
+ <tag><c>{'UP', reference(), driver, Name, loaded}</c></tag>
<item>
- <p>This message is sent, either immediately if the
+ <p>This message is sent either immediately if the
driver is already loaded and no reloading is
pending, or when reloading is executed if
reloading is pending. </p>
<p>The <seealso marker="#users">user</seealso> is
- expected to know if reloading is demanded prior
- to creating a monitor for loading.</p>
+ expected to know if reloading is demanded before
+ creating a monitor for loading.</p>
</item>
- <tag><em>{'UP', reference(), driver, Name, permanent}</em></tag>
+ <tag><c>{'UP', reference(), driver, Name, permanent}</c></tag>
<item>
- <p>This message will be sent if reloading was
+ <p>This message is sent if reloading was
expected, but the (old) driver made itself
- permanent prior to reloading. It will also be
+ permanent before reloading. It is also
sent if the driver was permanent or statically
- linked in when trying to create the monitor.</p>
+ linked-in when trying to create the monitor.</p>
</item>
- <tag><em>{'DOWN', reference(), driver, Name, load_cancelled}</em></tag>
+ <tag><c>{'DOWN', reference(), driver, Name, load_cancelled}</c></tag>
<item>
- <p>This message will arrive if reloading was
- underway, but the <seealso marker="#users">user</seealso> having requested
- reload cancelled it by either dying or calling
- <seealso marker="#try_unload/2">try_unload/2</seealso>
+ <p>This message arrives if reloading was
+ underway, but the requesting
+ <seealso marker="#users">user</seealso>
+ cancelled it by dying or calling
+ <seealso marker="#try_unload/2"><c>try_unload/2</c></seealso>
(or <c>unload/1</c>/<c>unload_driver/1</c>)
again before it was reloaded.</p>
</item>
- <tag><em>{'DOWN', reference(), driver, Name, {load_failure, Failure}}</em></tag>
+ <tag><c>{'DOWN', reference(), driver, Name, {load_failure, Failure}}</c></tag>
<item>
- <p>This message will arrive if reloading was
+ <p>This message arrives if reloading was
underway but the loading for some reason
failed. The <c>Failure</c> term is one of the
- errors that can be returned from <seealso marker="#try_load/3">try_load/3</seealso>. The
- error term can be passed to <seealso marker="#format_error/1">format_error/1</seealso>
- for translation into human readable form. Note
- that the translation has to be done in the same
- running erlang virtual machine as the error
+ errors that can be returned from
+ <seealso marker="#try_load/3"><c>try_load/3</c></seealso>.
+ The error term can be passed to
+ <seealso marker="#format_error/1"><c>format_error/1</c></seealso>
+ for translation into human readable form. Notice
+ that the translation must be done in the same
+ running Erlang virtual machine as the error
was detected in.</p>
</item>
</taglist>
</item>
- <tag><em>unloaded</em></tag>
+ <tag><c>unloaded</c></tag>
<item>
- <p>Monitor when a driver gets unloaded. If one
+ <p>Monitors when a driver gets unloaded. If one
monitors a driver that is not present in the system,
- one will immediately get notified that the driver got
+ one immediately gets notified that the driver got
unloaded. There is no guarantee that the driver was
- actually ever loaded.</p>
- <p>A driver monitor for unload will eventually result
+ ever loaded.</p>
+ <p>A driver monitor for unload eventually results
in one of the following messages being sent:</p>
<taglist>
- <tag><em>{'DOWN', reference(), driver, Name, unloaded}</em></tag>
+ <tag><c>{'DOWN', reference(), driver, Name, unloaded}</c></tag>
<item>
- <p>The driver instance monitored is now
- unloaded. As the unload might have been due to a
- <c>reload/2</c> request, the driver might once
+ <p>The monitored driver instance is now
+ unloaded. As the unload can be a result of a
+ <c>reload/2</c> request, the driver can once
again have been loaded when this message
arrives.</p>
</item>
- <tag><em>{'UP', reference(), driver, Name, unload_cancelled}</em></tag>
+ <tag><c>{'UP', reference(), driver, Name, unload_cancelled}</c></tag>
<item>
- <p>This message will be sent if unloading was
+ <p>This message is sent if unloading was
expected, but while the driver was waiting for
- all ports to get closed, a new <seealso marker="#users">user</seealso> of the driver
- appeared and the unloading was cancelled.</p>
- <p>This message appears when an <c>{ok, pending_driver}</c>) was returned from <seealso marker="#try_unload/2">try_unload/2</seealso>)
- for the last <seealso marker="#users">user</seealso> of the driver and
- then a <c>{ok, already_loaded}</c> is returned
- from a call to <seealso marker="#try_load/3">try_load/3</seealso>.</p>
- <p>If one wants to <em>really</em> monitor when the
- driver gets unloaded, this message will distort
- the picture, no unloading was really done.
- The <c>unloaded_only</c> option creates a monitor
- similar to an <c>unloaded</c> monitor, but does
- never result in this message.</p>
+ all ports to get closed, a new
+ <seealso marker="#users">user</seealso> of the driver
+ appeared, and the unloading was cancelled.</p>
+ <p>This message appears if <c>{ok, pending_driver}</c>
+ was returned from
+ <seealso marker="#try_unload/2"><c>try_unload/2</c></seealso>
+ for the last <seealso marker="#users">user</seealso>
+ of the driver, and then <c>{ok, already_loaded}</c> is returned
+ from a call to
+ <seealso marker="#try_load/3"><c>try_load/3</c></seealso>.</p>
+ <p>If one <em>really</em> wants to monitor when the
+ driver gets unloaded, this message distorts
+ the picture, because no unloading was done.
+ Option <c>unloaded_only</c> creates a monitor
+ similar to an <c>unloaded</c> monitor, but
+ never results in this message.</p>
</item>
- <tag><em>{'UP', reference(), driver, Name, permanent}</em></tag>
+ <tag><c>{'UP', reference(), driver, Name, permanent}</c></tag>
<item>
- <p>This message will be sent if unloading was
+ <p>This message is sent if unloading was
expected, but the driver made itself
- permanent prior to unloading. It will also be
+ permanent before unloading. It is also
sent if trying to monitor a permanent or
- statically linked in driver.</p>
+ statically linked-in driver.</p>
</item>
</taglist>
</item>
- <tag><em>unloaded_only</em></tag>
+ <tag><c>unloaded_only</c></tag>
<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', 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>
+ exactly as one created as <c>unloaded</c>
+ except that the
+ <c>{'UP', reference(), driver, Name, unload_cancelled}</c>
+ message is never sent, but the monitor instead persists until
+ the driver <em>really</em> gets unloaded.</p>
</item>
</taglist>
</item>
</taglist>
<p>The function throws a <c>badarg</c> exception if the
- parameters are not given as described above. </p>
+ parameters are not specified as described here.</p>
</desc>
</func>
<func>
<name name="reload" arity="2"/>
- <fsummary>Replace a driver</fsummary>
+ <fsummary>Replace a driver.</fsummary>
<desc>
<p>Reloads the driver named <c><anno>Name</anno></c> from a possibly
- different <c><anno>Path</anno></c> than was previously used. This
- function is used in the code change <seealso marker="#scenarios">scenario</seealso> described in the
+ different <c><anno>Path</anno></c> than previously used. This
+ function is used in the code change
+ <seealso marker="#scenarios"><c>scenario</c></seealso> described in the
introduction.</p>
<p>If there are other <seealso marker="#users">users</seealso>
- of this driver, the function will return <c>{error, pending_process}</c>, but if there are no more users, the
- function call will hang until all open ports are closed.</p>
+ of this driver, the function returns <c>{error, pending_process}</c>,
+ but if there are no other users, the function call hangs until all
+ open ports are closed.</p>
<note>
- <p>Avoid mixing
- several <seealso marker="#users">users</seealso>
- with driver reload requests.</p>
- </note>
- <p>If one wants to avoid hanging on open ports, one should use
- the <seealso marker="#try_load/3">try_load/3</seealso>
- function instead.</p>
- <p>The <c><anno>Name</anno></c> and <c><anno>Path</anno></c> parameters have exactly the
- same meaning as when calling the plain <seealso marker="#load/2">load/2</seealso> function.</p>
- <note>
- <p>Avoid mixing
- several <seealso marker="#users">users</seealso>
- with driver reload requests.</p>
+ <p>Avoid mixing multiple
+ <seealso marker="#users">users</seealso>
+ with driver reload requests.</p>
</note>
+ <p>To avoid hanging on open ports, use function
+ <seealso marker="#try_load/3"><c>try_load/3</c></seealso>
+ instead.</p>
+ <p>The <c><anno>Name</anno></c> and <c><anno>Path</anno></c> parameters
+ have exactly the same meaning as when calling the plain function
+ <seealso marker="#load/2"><c>load/2</c></seealso>.</p>
+
<p>On success, the function returns <c>ok</c>. On
- failure, the function returns an opaque error, with the
- exception of the <c>pending_process</c> error described
- above. The opaque errors are to be translated into human
- readable form by the <seealso marker="#format_error/1">format_error/1</seealso> function.</p>
- <p>For more control over the error handling, again use the
- <seealso marker="#try_load/3">try_load/3</seealso>
+ failure, the function returns an opaque error,
+ except the <c>pending_process</c> error described
+ earlier. The opaque errors are to be translated into human
+ readable form by function
+ <seealso marker="#format_error/1"><c>format_error/1</c></seealso>.</p>
+ <p>For more control over the error handling, use the
+ <seealso marker="#try_load/3"><c>try_load/3</c></seealso>
interface instead.</p>
<p>The function throws a <c>badarg</c> exception if the
- parameters are not given as described above. </p>
+ parameters are not specified as described here.</p>
</desc>
</func>
<func>
<name name="reload_driver" arity="2"/>
- <fsummary>Replace a driver</fsummary>
+ <fsummary>Replace a driver.</fsummary>
<desc>
- <p>Works exactly as <seealso marker="#reload/2">reload/2</seealso>, but for drivers
- loaded with the <seealso marker="#load_driver/2">load_driver/2</seealso> interface. </p>
- <p>As this interface implies that ports are being killed when
- the last user disappears, the function wont hang waiting for
+ <p>Works exactly as <seealso marker="#reload/2"><c>reload/2</c></seealso>,
+ but for drivers loaded with the
+ <seealso marker="#load_driver/2"><c>load_driver/2</c></seealso> interface.</p>
+ <p>As this interface implies that ports are killed when
+ the last user disappears, the function does not hang waiting for
ports to get closed.</p>
- <p>For further details, see the <seealso marker="#scenarios">scenarios</seealso> in the module
- description and refer to the <seealso marker="#reload/2">reload/2</seealso> function description.</p>
+ <p>For more details, see
+ <seealso marker="#scenarios"><c>scenarios</c></seealso> in this module
+ description and the function description for
+ <seealso marker="#reload/2"><c>reload/2</c></seealso>.</p>
<p>The function throws a <c>badarg</c> exception if the
- parameters are not given as described above. </p>
+ parameters are not specified as described here.</p>
</desc>
</func>
<func>
<name name="try_load" arity="3"/>
- <fsummary>Load a driver</fsummary>
+ <fsummary>Load a driver.</fsummary>
<desc>
- <p>This function provides more control than the
+ <p>Provides more control than the
<c>load/2</c>/<c>reload/2</c> and
<c>load_driver/2</c>/<c>reload_driver/2</c> interfaces. It
- will never wait for completion of other operations related
- to the driver, but immediately return the status of the
- driver as either:</p>
+ never waits for completion of other operations related
+ to the driver, but immediately returns the status of the
+ driver as one of the following:</p>
<taglist>
- <tag><em>{ok, loaded}</em></tag>
+ <tag><c>{ok, loaded}</c></tag>
<item>
- <p>The driver was actually loaded and is immediately
- usable.</p>
+ <p>The driver was loaded and is immediately usable.</p>
</item>
- <tag><em>{ok, already_loaded}</em></tag>
+ <tag><c>{ok, already_loaded}</c></tag>
<item>
<p>The driver was already loaded by another process
- and/or is in use by a living port. The load by you is
+ or is in use by a living port, or both. The load by you is
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, reference()}</em></tag>
+ <tag><c>{ok, pending_driver}</c>or <c>{ok, pending_driver, reference()}</c></tag>
<item>
<p>The load request is registered, but the loading is
- delayed due to the fact that an earlier instance of the
- driver is still waiting to get unloaded (there are open
- ports using it). Still, unload is expected when you are
- done with the driver. This return value will
- <em>mostly</em> happen when the
+ delayed because an earlier instance of the
+ driver is still waiting to get unloaded (open
+ ports use it). Still, unload is expected when you are
+ done with the driver. This return value
+ <em>mostly</em> occurs when options
<c>{reload,pending_driver}</c> or
- <c>{reload,pending}</c> options are used, but
- <em>can</em> happen when another <seealso marker="#users">user</seealso> is unloading a driver in
- parallel and the <c>kill_ports</c> driver option is
- set. In other words, this return value will always need
- to be handled!</p>
+ <c>{reload,pending}</c> are used, but
+ <em>can</em> occur when another
+ <seealso marker="#users">user</seealso> is unloading a
+ driver in parallel and driver option <c>kill_ports</c> is set.
+ In other words, this return value always needs
+ to be handled.</p>
</item>
- <tag><em>{ok, pending_process}</em>or <em>{ok, pending_process, reference()}</em></tag>
+ <tag><c>{ok, pending_process}</c>or <c>{ok, pending_process, reference()}</c></tag>
<item>
<p>The load request is registered, but the loading is
- delayed due to the fact that an earlier instance of the
+ delayed because an earlier instance of the
driver is still waiting to get unloaded by another
<seealso marker="#users">user</seealso> (not only by a
port, in which case <c>{ok,pending_driver}</c> would
have been returned). Still, unload is expected when you
- are done with the driver. This return value will
- <em>only</em> happen when the <c>{reload,pending}</c>
- option is used.</p>
+ are done with the driver. This return value
+ <em>only</em> occurs when option <c>{reload,pending}</c>
+ is used.</p>
</item>
</taglist>
<p>When the function returns <c>{ok, pending_driver}</c> or
- <c>{ok, pending_process}</c>, one might want to get information
- about when the driver is <em>actually</em> loaded. This can
- be achieved by using the <c>{monitor, <anno>MonitorOption</anno>}</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, <anno>PendingStatus</anno>, 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>
- function description. </p>
+ <c>{ok, pending_process}</c>, one can get information
+ about when the driver is <em>actually</em> loaded by using
+ option <c>{monitor, <anno>MonitorOption</anno>}</c>.</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 instead returns a tuple
+ <c>{ok, <anno>PendingStatus</anno>, reference()}</c>
+ and the process then gets a monitor message later, when the
+ driver gets loaded. The monitor message to expect is described in
+ the function description of
+ <seealso marker="#monitor/2"><c>monitor/2</c></seealso>.</p>
<note>
- <p>Note that in case of loading, monitoring can
- <em>not</em> only get triggered by using the <c>{reload, <anno>ReloadOption</anno>}</c> option, but also in special cases where
- the load-error is transient, why <c>{monitor, pending_driver}</c> should be used under basically
- <em>all</em> real world circumstances!</p>
+ <p>In case of loading, monitoring can <em>not</em> only get
+ triggered by using option <c>{reload, <anno>ReloadOption</anno>}</c>,
+ but also in special cases where the load error is transient. Thus,
+ <c>{monitor, pending_driver}</c> is to be used under basically
+ <em>all</em> real world circumstances.</p>
</note>
<p>The function accepts the following parameters:</p>
<taglist>
- <tag><em><c><anno>Path</anno></c></em></tag>
+ <tag><c><anno>Path</anno></c></tag>
<item>
- <p>The filesystem path to the directory where the driver
- object file is situated. The filename of the object file
+ <p>The file system path to the directory where the driver
+ object file is located. The filename of the object file
(minus extension) must correspond to the driver name
- (used in the name parameter) and the driver must
- identify itself with the very same name. The
- <c><anno>Path</anno></c> might be provided as an <em>iolist()</em>,
+ (used in parameter <c><anno>Name</anno></c>) and the driver must
+ identify itself with the same name.
+ <c><anno>Path</anno></c> can be provided as an <em>iolist()</em>,
meaning it can be a list of other <c>iolist()</c>s, characters
- (eight bit integers) or binaries, all to be flattened
+ (8-bit integers), or binaries, all to be flattened
into a sequence of characters.</p>
<p>The (possibly flattened) <c><anno>Path</anno></c> parameter must be
- consistent throughout the system, a driver should, by
+ consistent throughout the system. A driver is to, by
all <seealso marker="#users">users</seealso>, be loaded
- using the same <em>literal</em><c><anno>Path</anno></c>. The
- exception is when <em>reloading</em> is requested, in
- which case the <c><anno>Path</anno></c> may be specified
- differently. Note that all <seealso marker="#users">users</seealso> trying to load the
- driver at a later time will need to use the <em>new</em><c><anno>Path</anno></c> if the <c><anno>Path</anno></c> is changed using a
- <c>reload</c> option. This is yet another reason
+ using the same <em>literal</em> <c><anno>Path</anno></c>.
+ The exception is when <em>reloading</em> is requested,
+ in which case <c><anno>Path</anno></c> can be specified
+ differently. Notice that all
+ <seealso marker="#users">users</seealso> trying to load the
+ driver later need to use the
+ <em>new</em> <c><anno>Path</anno></c> if <c><anno>Path</anno></c>
+ is changed using a <c>reload</c> option. This is yet another reason
to have <em>only one loader</em> of a driver one wants to
- upgrade in a running system! </p>
+ upgrade in a running system.</p>
</item>
- <tag><em><c><anno>Name</anno></c></em></tag>
+ <tag><c><anno>Name</anno></c></tag>
<item>
- <p>The name parameter is the name of the driver to be used
- in subsequent calls to <seealso marker="erts:erlang#open_port/2">open_port</seealso>. The
- name can be specified either as an <c>iolist()</c> or
- as an <c>atom()</c>. The name given when loading is used
- to find the actual object file (with the
- help of the <c><anno>Path</anno></c> and the system implied
- extension suffix, i.e. <c>.so</c>). The name by which
- the driver identifies itself must also be consistent
- with this <c><anno>Name</anno></c> parameter, much as a beam-file's
- module name much correspond to its filename.</p>
+ <p>This parameter is the name of the driver
+ to be used in subsequent calls to function
+ <seealso marker="erts:erlang#open_port/2"><c>erlang:open_port</c></seealso>
+ in <c>ERTS</c>.
+ The name can be specified as an <c>iolist()</c> or
+ an <c>atom()</c>. The name specified when loading is used
+ to find the object file (with the help of <c><anno>Path</anno></c>
+ and the system-implied extension suffix, that is, <c>.so</c>).
+ The name by which the driver identifies itself must also be consistent
+ with this <c><anno>Name</anno></c> parameter, much as
+ the module name of a Beam file much corresponds to its filename.</p>
</item>
- <tag><em><c><anno>OptionList</anno></c></em></tag>
+ <tag><c><anno>OptionList</anno></c></tag>
<item>
- <p>A number of options can be specified to control the
- loading operation. The options are given as a list of
- two-tuples, the tuples having the following values and
+ <p>Some options can be specified to control the
+ loading operation. The options are specified as a list of
+ two-tuples. The tuples have the following values and
meanings:</p>
<taglist>
- <tag><em>{driver_options, <c><anno>DriverOptionList</anno></c>}</em></tag>
+ <tag><c>{driver_options, <anno>DriverOptionList</anno>}</c></tag>
<item>
- <p>This option is to provide options that will change
- its general behavior and will "stick" to the driver
+ <p>This is to provide options that changes
+ its general behavior and "sticks" to the driver
throughout its lifespan.</p>
- <p>The driver options for a given driver name need
- always to be consistent, <em>even when the driver is reloaded</em>, meaning that they are as much a part
- of the driver as the actual name.</p>
- <p>Currently the only allowed driver option is
+ <p>The driver options for a specified driver name need
+ always to be consistent, <em>even when the driver is reloaded</em>,
+ meaning that they are as much a part of the driver as the name.</p>
+ <p>The only allowed driver option is
<c>kill_ports</c>, which means that all ports opened
- towards the driver are killed with the exit-reason
+ to the driver are killed with exit reason
<c>driver_unloaded</c> when no process any longer
has the driver loaded. This situation arises either
- when the last <seealso marker="#users">user</seealso> calls <seealso marker="#try_unload/2">try_unload/2</seealso>, or
- the last process having loaded the driver exits.</p>
+ when the last <seealso marker="#users">user</seealso> calls
+ <seealso marker="#try_unload/2"><c>try_unload/2</c></seealso>, or
+ when the last process having loaded the driver exits.</p>
</item>
- <tag><em>{monitor, <c><anno>MonitorOption</anno></c>}</em></tag>
+ <tag><c>{monitor, <anno>MonitorOption</anno>}</c></tag>
<item>
<p>A <c><anno>MonitorOption</anno></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, <anno>PendingStatus</anno>, reference()}</c>, where the <c>reference()</c> is
- the monitor ref for the driver monitor.</p>
- <p>Only one <c><anno>MonitorOption</anno></c> can be specified and
- it is either the atom <c>pending</c>, which means
- that a monitor should be created whenever a load
- operation is delayed, and the atom
- <c>pending_driver</c>, in which a monitor is
- created whenever the operation is delayed due to
- open ports towards an otherwise unused driver. The
- <c>pending_driver</c> option is of little use, but
- is present for completeness, it is very well defined
- which reload-options might give rise to which
- delays. It might, however, be a good idea to use the
- same <c><anno>MonitorOption</anno></c> as the <c><anno>ReloadOption</anno></c>
- if present.</p>
- <p>If reloading is not requested, it might still be
- useful to specify the <c>monitor</c> option, as
- forced unloads (<c>kill_ports</c> driver option or
- the <c>kill_ports</c> option to <seealso marker="#try_unload/2">try_unload/2</seealso>) will
- trigger a transient state where driver loading
+ function returns a three-tuple
+ <c>{ok, <anno>PendingStatus</anno>, reference()}</c>, where
+ <c>reference()</c> is the monitor reference for the driver monitor.</p>
+ <p>Only one <c><anno>MonitorOption</anno></c> can be specified.
+ It is one of the following:</p>
+ <list type="bulleted">
+ <item>
+ <p>The atom <c>pending</c>, which means
+ that a monitor is to be created whenever a load
+ operation is delayed,</p>
+ </item>
+ <item>
+ <p>The atom <c>pending_driver</c>, in which a monitor
+ is created whenever the operation is delayed because
+ of open ports to an otherwise unused driver.</p>
+ </item>
+ </list>
+ <p>Option <c>pending_driver</c> is of little use, but
+ is present for completeness, as it is well defined which
+ reload options that can give rise to which delays.
+ However, it can be a good idea to use the same
+ <c><anno>MonitorOption</anno></c> as the
+ <c><anno>ReloadOption</anno></c>, if present.</p>
+ <p>If reloading is not requested, it can still be
+ useful to specify option <c>monitor</c>, as
+ forced unloads (driver option <c>kill_ports</c> or
+ option <c>kill_ports</c> to
+ <seealso marker="#try_unload/2"><c>try_unload/2</c></seealso>)
+ trigger a transient state where driver loading
cannot be performed until all closing ports are
- actually closed. So, as <c>try_unload</c> can, in
- almost all situations, return <c>{ok, pending_driver}</c>, one should always specify at least
- <c>{monitor, pending_driver}</c> in production
- code (see the monitor discussion above). </p>
+ closed. Thus, as <c>try_unload</c> can, in
+ almost all situations, return <c>{ok, pending_driver}</c>,
+ always specify at least <c>{monitor, pending_driver}</c>
+ in production code (see the monitor discussion earlier).</p>
</item>
- <tag><em>{reload, <c><anno>ReloadOption</anno></c>}</em></tag>
+ <tag><c>{reload, <anno>ReloadOption</anno>}</c></tag>
<item>
- <p>This option is used when one wants to
+ <p>This option is used to
<em>reload</em> a driver from disk, most often in a
code upgrade scenario. Having a <c>reload</c> option
- also implies that the <c><anno>Path</anno></c> parameter need
- <em>not</em> be consistent with earlier loads of
+ also implies that parameter <c><anno>Path</anno></c> does
+ <em>not</em> need to be consistent with earlier loads of
the driver.</p>
- <p>To reload a driver, the process needs to have previously
- loaded the driver, i.e there has to be an active <seealso marker="#users">user</seealso> of the driver in the process. </p>
- <p>The <c>reload</c> option can be either the atom
- <c>pending</c>, in which reloading is requested for
- any driver and will be effectuated when <em>all</em>
- ports opened against the driver are closed. The
- replacement of the driver will in this case take
- place regardless of if there are still
- pending <seealso marker="#users">users</seealso>
- having the driver loaded!
- The option also triggers port-killing (if the
- <c>kill_ports</c> driver option is used) even though
- there are pending users, making it usable for forced
- driver replacement, but laying a lot of
- responsibility on the driver <seealso marker="#users">users</seealso>. The pending option is
- seldom used as one does not want other <seealso marker="#users">users</seealso> to have loaded the
- driver when code change is underway. </p>
- <p>The more useful option is <c>pending_driver</c>,
- which means that reloading will be queued if the
- driver is <em>not</em> loaded by any other <seealso marker="#users">users</seealso>, but the driver has
- opened ports, in which case <c>{ok, pending_driver}</c> will be returned (a
- <c>monitor</c> option is of course recommended).</p>
- <p>If the driver is unloaded (not present in the
- system), the error code
- <c>not_loaded</c> will be returned. The
- <c>reload</c> option is intended for when the user
+ <p>To reload a driver, the process must have loaded the driver
+ before, that is, there must be an active
+ <seealso marker="#users">user</seealso> of the driver
+ in the process.</p>
+ <p>The <c>reload</c> option can be either of the following:</p>
+ <taglist>
+ <tag><c>pending</c></tag>
+ <item>
+ <p>With the atom <c>pending</c>, reloading is requested
+ for any driver and is effectuated when <em>all</em>
+ ports opened to the driver are closed. The driver
+ replacement in this case takes
+ place regardless if there are still
+ pending <seealso marker="#users">users</seealso>
+ having the driver loaded.</p>
+ <p>The option also triggers port-killing (if driver
+ option <c>kill_ports</c> is used) although
+ there are pending users, making it usable for forced
+ driver replacement, but laying much
+ responsibility on the driver
+ <seealso marker="#users">users</seealso>.
+ The pending option is seldom used as one does not want other
+ <seealso marker="#users">users</seealso> to have loaded
+ the driver when code change is underway.</p></item>
+ <tag><c>pending_driver</c></tag>
+ <item>
+ <p>This option is more useful. Here, reloading is queued
+ if the driver is <em>not</em> loaded by any other
+ <seealso marker="#users">users</seealso>, but the
+ driver has opened ports, in which case
+ <c>{ok, pending_driver}</c> is returned
+ (a <c>monitor</c> option is recommended).</p></item>
+ </taglist>
+ <p>If the driver is unloaded (not present in the system),
+ error code <c>not_loaded</c> is returned. Option
+ <c>reload</c> is intended for when the user
has already loaded the driver in advance.</p>
</item>
</taglist>
</item>
</taglist>
- <p>The function might return numerous errors, of which some
- only can be returned given a certain combination of options.</p>
- <p>A number of errors are opaque and can only be interpreted by
- passing them to the <seealso marker="#format_error/1">format_error/1</seealso> function,
+ <p>The function can return numerous errors, some
+ can only be returned given a certain combination of options.</p>
+ <p>Some errors are opaque and can only be interpreted by
+ passing them to function
+ <seealso marker="#format_error/1"><c>format_error/1</c></seealso>,
but some can be interpreted directly:</p>
<taglist>
- <tag><em>{error,linked_in_driver}</em></tag>
+ <tag><c>{error,linked_in_driver}</c></tag>
<item>
- <p>The driver with the specified name is an erlang
- statically linked in driver, which cannot be manipulated
+ <p>The driver with the specified name is an Erlang
+ statically linked-in driver, which cannot be manipulated
with this API.</p>
</item>
- <tag><em>{error,inconsistent}</em></tag>
+ <tag><c>{error,inconsistent}</c></tag>
<item>
- <p>The driver has already been loaded with either other
- <c><anno>DriverOptionList</anno></c> or a different <em>literal</em><c>Path</c> argument.</p>
- <p>This can happen even if a <c>reload</c> option is given,
- if the <c>DriverOptionList</c> differ from the current.</p>
+ <p>The driver is already loaded with other
+ <c><anno>DriverOptionList</anno></c> or a different
+ <em>literal</em> <c>Path</c> argument.</p>
+ <p>This can occur even if a <c>reload</c> option is specified,
+ if <c>DriverOptionList</c> differs from the current.</p>
</item>
- <tag><em>{error, permanent}</em></tag>
+ <tag><c>{error, permanent}</c></tag>
<item>
<p>The driver has requested itself to be permanent, making
- it behave like an erlang linked in driver and it can no
+ it behave like an Erlang linked-in driver and can no
longer be manipulated with this API.</p>
</item>
- <tag><em>{error, pending_process}</em></tag>
+ <tag><c>{error, pending_process}</c></tag>
<item>
- <p>The driver is loaded by other <seealso marker="#users">users</seealso> when the <c>{reload, pending_driver}</c> option was given.</p>
+ <p>The driver is loaded by other
+ <seealso marker="#users">users</seealso> when
+ option <c>{reload, pending_driver}</c> was specified.</p>
</item>
- <tag><em>{error, pending_reload}</em></tag>
+ <tag><c>{error, pending_reload}</c></tag>
<item>
- <p>Driver reload is already requested by another <seealso marker="#users">user</seealso> when the <c>{reload, <anno>ReloadOption</anno>}</c> option was given.</p>
+ <p>Driver reload is already requested by another
+ <seealso marker="#users">user</seealso> when option
+ <c>{reload, <anno>ReloadOption</anno>}</c> was specified.</p>
</item>
- <tag><em>{error, not_loaded_by_this_process}</em></tag>
+ <tag><c>{error, not_loaded_by_this_process}</c></tag>
<item>
- <p>Appears when the <c>reload</c> option is given. The
- driver <c><anno>Name</anno></c> is present in the system, but there is no
- <seealso marker="#users">user</seealso> of it in this
+ <p>Appears when option <c>reload</c> is specified. The
+ driver <c><anno>Name</anno></c> is present in the system, but there
+ is no <seealso marker="#users">user</seealso> of it in this
process.</p>
</item>
- <tag><em>{error, not_loaded}</em></tag>
+ <tag><c>{error, not_loaded}</c></tag>
<item>
- <p>Appears when the <c>reload</c> option is given. The
+ <p>Appears when option <c>reload</c> is specified. The
driver <c><anno>Name</anno></c> is not in the system. Only drivers
loaded by this process can be reloaded.</p>
</item>
</taglist>
- <p>All other error codes are to be translated by the <seealso marker="#format_error/1">format_error/1</seealso>
- function. Note that calls to <c>format_error</c> should be
- performed from the same running instance of the erlang
- virtual machine as the error was detected in, due to system
- dependent behavior concerning error values.</p>
- <p>If the arguments or options are malformed, the function will
- throw a <c>badarg</c> exception.</p>
+ <p>All other error codes are to be translated by function
+ <seealso marker="#format_error/1"><c>format_error/1</c></seealso>.
+ Notice that calls to <c>format_error</c> are to be
+ performed from the same running instance of the Erlang
+ virtual machine as the error is detected in, because of
+ system-dependent behavior concerning error values.</p>
+ <p>If the arguments or options are malformed, the function
+ throws a <c>badarg</c> exception.</p>
</desc>
</func>
<func>
<name name="try_unload" arity="2"/>
- <fsummary>Unload a driver</fsummary>
+ <fsummary>Unload a driver.</fsummary>
<desc>
- <p>This is the low level function to unload (or decrement
+ <p>This is the low-level function to unload (or decrement
reference counts of) a driver. It can be used to force port
killing, in much the same way as the driver option
- <c>kill_ports</c> implicitly does, and it can trigger a
- monitor either due to other <seealso marker="#users">users</seealso> still having the driver
- loaded or that there are open ports using the driver.</p>
+ <c>kill_ports</c> implicitly does. Also, it can trigger a
+ monitor either because other
+ <seealso marker="#users">users</seealso> still have the driver
+ loaded or because open ports use the driver.</p>
<p>Unloading can be described as the process of telling the
emulator that this particular part of the code in this
- particular process (i.e. this <seealso marker="#users">user</seealso>) no longer needs the
- driver. That can, if there are no other users, trigger
- actual unloading of the driver, in which case the driver
- name disappears from the system and (if possible) the memory
- occupied by the driver executable code is reclaimed. If the
- driver has the <c>kill_ports</c> option set, or if
- <c>kill_ports</c> was specified as an option to this
- function, all pending ports using this driver will get
- killed when unloading is done by the last <seealso marker="#users">user</seealso>. If no port-killing is
- involved and there are open ports, the actual unloading
- is delayed until there are no more open ports using the
- driver. If, in this case, another <seealso marker="#users">user</seealso> (or even this user) loads the
- driver again before the driver is actually unloaded, the
- unloading will never take place.</p>
- <p>To allow the <seealso marker="#users">user</seealso> that
- <em>requests unloading</em> to wait for <em>actual unloading</em> to
- take place, <c>monitor</c> triggers can be specified in much
- the same way as when loading. As <seealso marker="#users">users</seealso> of this function however
- seldom are interested in more than decrementing the
- reference counts, monitoring is more seldom needed. If the
- <c>kill_ports</c> option is used however, monitor trigging is
- crucial, as the ports are not guaranteed to have been killed
- until the driver is unloaded, why a monitor should be
- triggered for at least the <c>pending_driver</c> case.</p>
- <p>The possible monitor messages that can be expected are the
- same as when using the <c>unloaded</c> option to the
- <seealso marker="#monitor/2">monitor/2</seealso> function.</p>
- <p>The function will return one of the following statuses upon
+ particular process (that is, this
+ <seealso marker="#users">user</seealso>) no longer needs
+ the driver. That can, if there are no other users, trigger
+ unloading of the driver, in which case the driver name
+ disappears from the system and (if possible) the memory
+ occupied by the driver executable code is reclaimed.</p>
+ <p>If the driver has option <c>kill_ports</c> set, or if
+ <c>kill_ports</c> is specified as an option to this
+ function, all pending ports using this driver are
+ killed when unloading is done by the last
+ <seealso marker="#users">user</seealso>. If no port-killing
+ is involved and there are open ports, the unloading
+ is delayed until no more open ports use the
+ driver. If, in this case, another
+ <seealso marker="#users">user</seealso> (or even this user)
+ loads the driver again before the driver is unloaded, the
+ unloading never takes place.</p>
+ <p>To allow the <seealso marker="#users">user</seealso> to
+ <em>request unloading</em> to wait for <em>actual unloading</em>,
+ <c>monitor</c> triggers can be specified in much the same way as
+ when loading. However, as <seealso marker="#users">users</seealso>
+ of this function seldom are interested in more than decrementing the
+ reference counts, monitoring is seldom needed.</p>
+ <note><p> If option <c>kill_ports</c> is used, monitor trigging is crucial,
+ as the ports are not guaranteed to be killed until the driver is unloaded.
+ Thus, a monitor must be triggered for at least the <c>pending_driver</c>
+ case.</p></note>
+ <p>The possible monitor messages to expect are the
+ same as when using option <c>unloaded</c> to function
+ <seealso marker="#monitor/2"><c>monitor/2</c></seealso>.</p>
+ <p>The function returns one of the following statuses upon
success:</p>
<taglist>
- <tag><em>{ok, unloaded}</em></tag>
+ <tag><c>{ok, unloaded}</c></tag>
<item>
<p>The driver was immediately unloaded, meaning that the
driver name is now free to use by other drivers and, if
the underlying OS permits it, the memory occupied by the
driver object code is now reclaimed.</p>
<p>The driver can only be unloaded when there are no open
- ports using it and there are no more <seealso marker="#users">users</seealso> requiring it to be
+ ports using it and no more
+ <seealso marker="#users">users</seealso> require it to be
loaded.</p>
</item>
- <tag><em>{ok, pending_driver}</em>or <em>{ok, pending_driver, reference()}</em></tag>
+ <tag><c>{ok, pending_driver}</c>or
+ <c>{ok, pending_driver, reference()}</c></tag>
<item>
- <p>This return value indicates that this call removed the
- last <seealso marker="#users">user</seealso> from the
+ <p>Indicates that this call removed the last
+ <seealso marker="#users">user</seealso> from the
driver, but there are still open ports using it.
- When all ports are closed and no new <seealso marker="#users">users</seealso> have arrived, the driver
- will actually be reloaded and the name and memory
+ When all ports are closed and no new
+ <seealso marker="#users">users</seealso> have arrived,
+ the driver is reloaded and the name and memory
reclaimed.</p>
- <p>This return value is valid even when the option
- <c>kill_ports</c> was used, as killing ports may not be
- a process that completes immediately. The condition is,
- in that case, however transient. Monitors are as always
- useful to detect when the driver is really unloaded.</p>
+ <p>This return value is valid even if option <c>kill_ports</c>
+ was used, as killing ports can be a process that does not
+ complete immediately. However, the condition is in that case
+ transient. Monitors are always useful to detect when the driver
+ is really unloaded.</p>
</item>
- <tag><em>{ok, pending_process}</em>or <em>{ok, pending_process, reference()}</em></tag>
+ <tag><c>{ok, pending_process}</c>or
+ <c>{ok, pending_process, reference()}</c></tag>
<item>
- <p>The unload request is registered, but there are still
- other <seealso marker="#users">users</seealso> holding
- the driver. Note that the term <c>pending_process</c>
- might refer to the running process, there might be more
+ <p>The unload request is registered, but
+ other <seealso marker="#users">users</seealso> still hold
+ the driver. Notice that the term <c>pending_process</c>
+ can refer to the running process; there can be more
than one <seealso marker="#users">user</seealso> in the
same process.</p>
- <p>This is a normal, healthy return value if the call was
+ <p>This is a normal, healthy, return value if the call was
just placed to inform the emulator that you have no
- further use of the driver. It is actually the most
- common return value in the most common <seealso marker="#scenarios">scenario</seealso>
+ further use of the driver. It is the most
+ common return value in the most common
+ <seealso marker="#scenarios"><c>scenario</c></seealso>
described in the introduction.</p>
</item>
</taglist>
<p>The function accepts the following parameters:</p>
<taglist>
- <tag><em><c><anno>Name</anno></c></em></tag>
+ <tag><c><anno>Name</anno></c></tag>
<item>
- <p>The name parameter is the name of the driver to be
- unloaded. The name can be specified either as an
- <c>iolist()</c> or as an <c>atom()</c>. </p>
+ <p><c><anno>Name</anno></c> is the name of the
+ driver to be unloaded. The name can be specified as an
+ <c>iolist()</c> or as an <c>atom()</c>.</p>
</item>
- <tag><em><c><anno>OptionList</anno></c></em></tag>
+ <tag><c><anno>OptionList</anno></c></tag>
<item>
- <p>The <c><anno>OptionList</anno></c> argument can be used to specify
- certain behavior regarding ports as well as triggering
+ <p>Argument <c><anno>OptionList</anno></c> can be used to specify
+ certain behavior regarding ports and triggering
monitors under certain conditions:</p>
<taglist>
- <tag><em>kill_ports</em></tag>
+ <tag><c>kill_ports</c></tag>
<item>
- <p>Force killing of all ports opened using this driver,
- with the exit reason <c>driver_unloaded</c>, if you are
- the <em>last</em><seealso marker="#users">user</seealso> of the driver.</p>
- <p>If there are other <seealso marker="#users">users</seealso> having the driver
- loaded, this option will have no effect.</p>
- <p>If one wants the consistent behavior of killing ports
+ <p>Forces killing of all ports opened using this driver,
+ with exit reason <c>driver_unloaded</c>, if you are
+ the <em>last</em> <seealso marker="#users">user</seealso>
+ of the driver.</p>
+ <p>If other <seealso marker="#users">users</seealso>
+ have the driver loaded, this option has no effect.</p>
+ <p>To get the consistent behavior of killing ports
when the last <seealso marker="#users">user</seealso>
- unloads, one should use the driver option
+ unloads, use driver option
<c>kill_ports</c> when loading the driver instead.</p>
</item>
- <tag><em>{monitor, <c><anno>MonitorOption</anno></c>}</em></tag>
+ <tag><c>{monitor, <anno>MonitorOption</anno>}</c></tag>
<item>
- <p>This option creates a driver monitor if the condition
- given in <c><anno>MonitorOption</anno></c> is true. The valid
+ <p>Creates a driver monitor if the condition
+ specified in <c><anno>MonitorOption</anno></c> is true. The valid
options are:</p>
<taglist>
- <tag><em>pending_driver</em></tag>
+ <tag><c>pending_driver</c></tag>
<item>
- <p>Create a driver monitor if the return value is to
+ <p>Creates a driver monitor if the return value is to
be <c>{ok, pending_driver}</c>.</p>
</item>
- <tag><em>pending</em></tag>
+ <tag><c>pending</c></tag>
<item>
- <p>Create a monitor if the return value will be either
+ <p>Creates a monitor if the return value is
<c>{ok, pending_driver}</c> or <c>{ok, pending_process}</c>.</p>
</item>
</taglist>
- <p>The <c>pending_driver</c> <c><anno>MonitorOption</anno></c> is by far
- the most useful and it has to be used to ensure that the
- driver has really been unloaded and the ports closed
- whenever the <c>kill_ports</c> option is used or the
- driver may have been loaded with the <c>kill_ports</c>
- driver option.</p>
- <p>By using the monitor-triggers in the call to
- <c>try_unload</c> one can be sure that the monitor is
- actually added before the unloading is executed, meaning
- that the monitor will always get properly triggered,
- which would not be the case if one called
- <c>erl_ddll:monitor/2</c> separately.</p>
+ <p>The <c>pending_driver</c> <c><anno>MonitorOption</anno></c> is
+ by far the most useful. It must be used to ensure that the
+ driver really is unloaded and the ports closed
+ whenever option <c>kill_ports</c> is used, or the
+ driver can have been loaded with driver option
+ <c>kill_ports</c>.</p>
+ <p>Using the monitor triggers in the call to
+ <c>try_unload</c> ensures that the monitor is
+ added before the unloading is executed, meaning
+ that the monitor is always properly triggered,
+ which is not the case if <c>monitor/2</c> is called
+ separately.</p>
</item>
</taglist>
</item>
</taglist>
- <p>The function may return several error conditions, of which
- all are well specified (no opaque values):</p>
+ <p>The function can return the following error conditions,
+ all well specified (no opaque values):</p>
<taglist>
- <tag><em>{error, linked_in_driver}</em></tag>
+ <tag><c>{error, linked_in_driver}</c></tag>
<item>
- <p>You were trying to unload an erlang statically linked in
+ <p>You were trying to unload an Erlang statically linked-in
driver, which cannot be manipulated with this interface
(and cannot be unloaded at all).</p>
</item>
- <tag><em>{error, not_loaded}</em></tag>
+ <tag><c>{error, not_loaded}</c></tag>
<item>
<p>The driver <c><anno>Name</anno></c> is not present in the system.</p>
</item>
- <tag><em>{error, not_loaded_by_this_process}</em></tag>
+ <tag><c>{error, not_loaded_by_this_process}</c></tag>
<item>
<p>The driver <c><anno>Name</anno></c> is present in the system, but
there is no <seealso marker="#users">user</seealso> of
it in this process. </p>
<p>As a special case, drivers can be unloaded from
- processes that has done no corresponding call to
- <c>try_load/3</c> if, and only if, there are <em>no users of the driver at all</em>, which may happen if the
+ processes that have done no corresponding call to
+ <c>try_load/3</c> if, and only if, there are
+ <em>no users of the driver at all</em>, which can occur if the
process containing the last user dies.</p>
</item>
- <tag><em>{error, permanent}</em></tag>
+ <tag><c>{error, permanent}</c></tag>
<item>
<p>The driver has made itself permanent, in which case it
can no longer be manipulated by this interface (much
- like a statically linked in driver).</p>
+ like a statically linked-in driver).</p>
</item>
</taglist>
<p>The function throws a <c>badarg</c> exception if the
- parameters are not given as described above. </p>
+ parameters are not specified as described here.</p>
</desc>
</func>
<func>
<name name="unload" arity="1"/>
- <fsummary>Unload a driver</fsummary>
+ <fsummary>Unload a driver.</fsummary>
<desc>
<p>Unloads, or at least dereferences the driver named
- <c><anno>Name</anno></c>. If the caller is the last <seealso marker="#users">user</seealso> of the driver, and there
- are no more open ports using the driver, the driver will
- actually get unloaded. In all other cases, actual unloading
- will be delayed until all ports are closed and there are no
- remaining <seealso marker="#users">users</seealso>.</p>
- <p>If there are other <seealso marker="#users">users</seealso> of the driver, the reference
- counts of the driver is merely decreased, so that the caller
- is no longer considered a user of the driver. For usage
- scenarios, see the <seealso marker="#scenarios">description</seealso> in the beginning
- of this document. </p>
+ <c><anno>Name</anno></c>. If the caller is the last
+ <seealso marker="#users">user</seealso> of the driver,
+ and no more open ports use the driver, the driver
+ gets unloaded. Otherwise, unloading
+ is delayed until all ports are closed and no
+ <seealso marker="#users">users</seealso> remain.</p>
+ <p>If there are other <seealso marker="#users">users</seealso>
+ of the driver, the reference counts of the driver is merely decreased,
+ so that the caller is no longer considered a
+ <seealso marker="#users">user</seealso> of the driver. For use
+ scenarios, see the <seealso marker="#scenarios"><c>description</c></seealso>
+ in the beginning of this module.</p>
<p>The <c><anno>ErrorDesc</anno></c> returned is an opaque value to be
- passed further on to the <seealso marker="#format_error/1">format_error/1</seealso>
- function. For more control over the operation, use the
- <seealso marker="#try_unload/2">try_unload/2</seealso>
+ passed further on to function
+ <seealso marker="#format_error/1"><c>format_error/1</c></seealso>.
+ For more control over the operation, use the
+ <seealso marker="#try_unload/2"><c>try_unload/2</c></seealso>
interface.</p>
<p>The function throws a <c>badarg</c> exception if the
- parameters are not given as described above. </p>
+ parameters are not specified as described here.</p>
</desc>
</func>
<func>
<name name="unload_driver" arity="1"/>
- <fsummary>Unload a driver</fsummary>
+ <fsummary>Unload a driver.</fsummary>
<desc>
<p>Unloads, or at least dereferences the driver named
- <c><anno>Name</anno></c>. If the caller is the last <seealso marker="#users">user</seealso> of the driver, all
- remaining open ports using the driver will get killed with
- the reason <c>driver_unloaded</c> and the driver will
- eventually get unloaded.</p>
+ <c><anno>Name</anno></c>. If the caller is the last
+ <seealso marker="#users">user</seealso> of the driver, all
+ remaining open ports using the driver are killed with
+ reason <c>driver_unloaded</c> and the driver
+ eventually gets unloaded.</p>
<p>If there are other <seealso marker="#users">users</seealso>
of the driver, the reference counts of the driver is merely
decreased, so that the caller is no longer considered a
<seealso marker="#users">user</seealso>. For
- usage scenarios, see the <seealso marker="#scenarios">description</seealso> in the beginning
- of this document.</p>
+ use scenarios, see the
+ <seealso marker="#scenarios"><c>description</c></seealso> in the
+ beginning of this module.</p>
<p>The <c><anno>ErrorDesc</anno></c> returned is an opaque value to be
- passed further on to the <seealso marker="#format_error/1">format_error/1</seealso>
- function. For more control over the operation, use the
- <seealso marker="#try_unload/2">try_unload/2</seealso>
+ passed further on to function
+ <seealso marker="#format_error/1"><c>format_error/1</c></seealso>.
+ For more control over the operation, use the
+ <seealso marker="#try_unload/2"><c>try_unload/2</c></seealso>
interface.</p>
<p>The function throws a <c>badarg</c> exception if the
- parameters are not given as described above. </p>
- </desc>
- </func>
- <func>
- <name name="loaded_drivers" arity="0"/>
- <fsummary>List loaded drivers</fsummary>
- <desc>
- <p>Returns a list of all the available drivers, both
- (statically) linked-in and dynamically loaded ones.</p>
- <p>The driver names are returned as a list of strings rather
- than a list of atoms for historical reasons.</p>
- <p>More information about drivers can be obtained using one of
- the <seealso marker="#info/0">info</seealso> functions.</p>
- </desc>
- </func>
- <func>
- <name name="format_error" arity="1"/>
- <fsummary>Format an error descriptor</fsummary>
- <desc>
- <p>Takes an <c><anno>ErrorDesc</anno></c> returned by load, unload or
- reload functions and returns a string which
- describes the error or warning.</p>
- <note>
- <p>Due to peculiarities in the dynamic loading interfaces on
- different platform, the returned string is only guaranteed
- to describe the correct error <em>if format_error/1 is called in the same instance of the erlang virtual machine as the error appeared in</em> (meaning the same operating
- system process)!</p>
- </note>
+ parameters are not specified as described here.</p>
</desc>
</func>
</funcs>
-
<section>
- <title>SEE ALSO</title>
- <p>erl_driver(4), driver_entry(4)</p>
+ <title>See Also</title>
+ <p><seealso marker="erts:erl_driver"><c>erts:erl_driver(4)</c></seealso>,
+ <seealso marker="erts:driver_entry"><c>erts:driver_entry(4)</c></seealso></p>
</section>
</erlref>
-
diff --git a/lib/kernel/doc/src/erl_prim_loader_stub.xml b/lib/kernel/doc/src/erl_prim_loader_stub.xml
index 8d5f58dc3a..f3189e2a66 100644
--- a/lib/kernel/doc/src/erl_prim_loader_stub.xml
+++ b/lib/kernel/doc/src/erl_prim_loader_stub.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -37,7 +37,7 @@
The module erl_prim_loader is moved to the runtime system
application. Please see <seealso
marker="erts:erl_prim_loader">erl_prim_loader(3)</seealso> in the
- erts reference manual instead.
+ ERTS reference manual instead.
</p></description>
</erlref>
diff --git a/lib/kernel/doc/src/erlang_stub.xml b/lib/kernel/doc/src/erlang_stub.xml
index b9867806bd..afd353e438 100644
--- a/lib/kernel/doc/src/erlang_stub.xml
+++ b/lib/kernel/doc/src/erlang_stub.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -37,7 +37,7 @@
The module erlang is moved to the runtime system
application. Please see <seealso
marker="erts:erlang">erlang(3)</seealso> in the
- erts reference manual instead.
+ ERTS reference manual instead.
</p></description>
</erlref>
diff --git a/lib/kernel/doc/src/error_handler.xml b/lib/kernel/doc/src/error_handler.xml
index 6aec5c77d5..e5639487dc 100644
--- a/lib/kernel/doc/src/error_handler.xml
+++ b/lib/kernel/doc/src/error_handler.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1996</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -31,35 +31,48 @@
<rev></rev>
</header>
<module>error_handler</module>
- <modulesummary>Default System Error Handler</modulesummary>
+ <modulesummary>Default system error handler.</modulesummary>
<description>
- <p>The error handler module defines what happens when certain types
+ <p>This module defines what happens when certain types
of errors occur.</p>
</description>
<funcs>
<func>
+ <name name="raise_undef_exception" arity="3"/>
+ <fsummary>Raise an undef exception.</fsummary>
+ <type_desc variable="Args">
+ A (possibly empty) list of arguments <c>Arg1,..,ArgN</c>
+ </type_desc>
+ <desc>
+ <p>Raises an <c>undef</c> exception with a stacktrace, indicating
+ that <c><anno>Module</anno>:<anno>Function</anno>/N</c> is
+ undefined.
+ </p>
+ </desc>
+ </func>
+ <func>
<name name="undefined_function" arity="3"/>
- <fsummary>Called when an undefined function is encountered</fsummary>
+ <fsummary>Called when an undefined function is encountered.</fsummary>
<type_desc variable="Args">
A (possibly empty) list of arguments <c>Arg1,..,ArgN</c>
</type_desc>
<desc>
- <p>This function is called by the run-time system if a call is made to
+ <p>This function is called by the runtime system if a call is made to
<c><anno>Module</anno>:<anno>Function</anno>(Arg1,.., ArgN)</c> and
- <c><anno>Module</anno>:<anno>Function</anno>/N</c> is undefined. Note that
- <c>undefined_function/3</c> is evaluated inside the process
+ <c><anno>Module</anno>:<anno>Function</anno>/N</c> is undefined.
+ Notice that this function is evaluated inside the process
making the original call.</p>
- <p>This function will first attempt to autoload
+ <p>This function first attempts to autoload
<c><anno>Module</anno></c>. If that is not possible,
- an <c>undef</c> exception will be raised.</p>
+ an <c>undef</c> exception is raised.</p>
- <p>If it was possible to load <c><anno>Module</anno></c>
- and the function <c><anno>Function</anno>/N</c> is exported,
- it will be called.</p>
+ <p>If it is possible to load <c><anno>Module</anno></c>
+ and function <c><anno>Function</anno>/N</c> is exported,
+ it is called.</p>
- <p>Otherwise, if the function <c>'$handle_undefined_function'/2</c>
- is exported, it will be called as
+ <p>Otherwise, if function <c>'$handle_undefined_function'/2</c>
+ is exported, it is called as
<c>'$handle_undefined_function'(</c><anno>Function</anno>,
<anno>Args</anno>).
</p>
@@ -67,61 +80,48 @@
<p>Defining <c>'$handle_undefined_function'/2</c> in
ordinary application code is highly discouraged. It is very
easy to make subtle errors that can take a long time to
- debug. Furthermore, none of the tools for static code
+ debug. Furthermore, none of the tools for static code
analysis (such as Dialyzer and Xref) supports the use of
<c>'$handle_undefined_function'/2</c> and no such support
will be added. Only use this function after having carefully
- considered other, less dangerous, solutions. One example of
+ considered other, less dangerous, solutions. One example of
potential legitimate use is creating stubs for other
sub-systems during testing and debugging.
</p>
</warning>
- <p>Otherwise an <c>undef</c> exception will be raised.</p>
- </desc>
- </func>
- <func>
- <name name="raise_undef_exception" arity="3"/>
- <fsummary>Raise an undef exception</fsummary>
- <type_desc variable="Args">
- A (possibly empty) list of arguments <c>Arg1,..,ArgN</c>
- </type_desc>
- <desc>
- <p>Raise an <c>undef</c> exception with a stacktrace indicating
- that <c><anno>Module</anno>:<anno>Function</anno>/N</c> is
- undefined.
- </p>
+ <p>Otherwise an <c>undef</c> exception is raised.</p>
</desc>
</func>
<func>
<name name="undefined_lambda" arity="3"/>
- <fsummary>Called when an undefined lambda (fun) is encountered</fsummary>
+ <fsummary>Called when an undefined lambda (fun) is encountered.</fsummary>
<type_desc variable="Args">
A (possibly empty) list of arguments <c>Arg1,..,ArgN</c>
</type_desc>
<desc>
<p>This function is evaluated if a call is made to
- <c><anno>Fun</anno>(Arg1,.., ArgN)</c> when the module defining the fun is
- not loaded. The function is evaluated inside the process
+ <c><anno>Fun</anno>(Arg1,.., ArgN)</c> when the module defining
+ the fun is not loaded. The function is evaluated inside the process
making the original call.</p>
<p>If <c><anno>Module</anno></c> is interpreted, the interpreter is invoked
and the return value of the interpreted
<c><anno>Fun</anno>(Arg1,.., ArgN)</c> call is returned.</p>
<p>Otherwise, it returns, if possible, the value of
- <c>apply(<anno>Fun</anno>, <anno>Args</anno>)</c> after an attempt has been made to
- autoload <c><anno>Module</anno></c>. If this is not possible, the call
- fails with exit reason <c>undef</c>.</p>
+ <c>apply(<anno>Fun</anno>, <anno>Args</anno>)</c> after an attempt
+ is made to autoload <c><anno>Module</anno></c>. If this is not possible,
+ the call fails with exit reason <c>undef</c>.</p>
</desc>
</func>
</funcs>
<section>
<title>Notes</title>
- <p>The code in <c>error_handler</c> is complex and should not be
- changed without fully understanding the interaction between
+ <p>The code in <c>error_handler</c> is complex. Do not
+ change it without fully understanding the interaction between
the error handler, the <c>init</c> process of the code server,
and the I/O mechanism of the code.</p>
- <p>Changes in the code which may seem small can cause a deadlock
- as unforeseen consequences may occur. The use of <c>input</c> is
+ <p>Code changes that seem small can cause a deadlock,
+ as unforeseen consequences can occur. The use of <c>input</c> is
dangerous in this type of code.</p>
</section>
</erlref>
diff --git a/lib/kernel/doc/src/error_logger.xml b/lib/kernel/doc/src/error_logger.xml
index 92e14c2bef..a8273e59e2 100644
--- a/lib/kernel/doc/src/error_logger.xml
+++ b/lib/kernel/doc/src/error_logger.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,41 +29,44 @@
<rev></rev>
</header>
<module>error_logger</module>
- <modulesummary>Erlang Error Logger</modulesummary>
+ <modulesummary>Erlang error logger.</modulesummary>
<description>
<p>The Erlang <em>error logger</em> is an event manager (see
<seealso marker="doc/design_principles:des_princ">OTP Design Principles</seealso> and
- <seealso marker="stdlib:gen_event">gen_event(3)</seealso>),
- registered as <c>error_logger</c>. Error, warning and info events
+ <seealso marker="stdlib:gen_event"><c>stdlib:gen_event(3)</c></seealso>),
+ registered as <c>error_logger</c>. Errors, warnings, and info events
are sent to the error logger from the Erlang runtime system and
the different Erlang/OTP applications. The events are, by default,
- logged to tty. Note that an event from a process <c>P</c> is
+ logged to the terminal. Notice that an event from a process <c>P</c> is
logged at the node of the group leader of <c>P</c>. This means
that log output is directed to the node from which a process was
created, which not necessarily is the same node as where it is
executing.</p>
- <p>Initially, <c>error_logger</c> only has a primitive event
+ <p>Initially, <c>error_logger</c> has only a primitive event
handler, which buffers and prints the raw event messages. During
- system startup, the application Kernel replaces this with a
- <em>standard event handler</em>, by default one which writes
- nicely formatted output to tty. Kernel can also be configured so
- that events are logged to file instead, or not logged at all, see
- <seealso marker="kernel_app">kernel(6)</seealso>.</p>
- <p>Also the SASL application, if started, adds its own event
- handler, which by default writes supervisor, crash and progress
- reports to tty. See
- <seealso marker="sasl:sasl_app">sasl(6)</seealso>.</p>
- <p>It is recommended that user defined applications should report
- errors through the error logger, in order to get uniform reports.
- User defined event handlers can be added to handle application
- specific events. (<c>add_report_handler/1,2</c>). Also, there is
- a useful event handler in STDLIB for multi-file logging of events,
- see <c>log_mf_h(3)</c>.</p>
+ system startup, the <c>Kernel</c> application replaces this with a
+ <em>standard event handler</em>, by default one that writes
+ nicely formatted output to the terminal. <c>Kernel</c> can also be
+ configured so that events are logged to a file instead, or not logged at all,
+ see <seealso marker="kernel_app"><c>kernel(6)</c></seealso>.</p>
+ <p>Also the <c>SASL</c> application, if started, adds its own event
+ handler, which by default writes supervisor, crash, and progress
+ reports to the terminal. See
+ <seealso marker="sasl:sasl_app"><c>sasl(6)</c></seealso>.</p>
+ <p>It is recommended that user-defined applications report
+ errors through the error logger to get uniform reports.
+ User-defined event handlers can be added to handle application-specific
+ events, see
+ <seealso marker="#add_report_handler/1"><c>add_report_handler/1,2</c></seealso>.
+ Also, a useful event handler is provided in <c>STDLIB</c> for multi-file
+ logging of events, see
+ <seealso marker="stdlib:log_mf_h"><c>stdlib:log_mf_h(3)</c></seealso>.</p>
<p>Warning events were introduced in Erlang/OTP R9C and are enabled
- by default as of 18.0. To retain backwards compatibility with existing
- user defined event handlers, these may be tagged as errors or info
- using the command line flag <c><![CDATA[+W <e | i | w>]]></c>, thus
- showing up as error or info reports in the logs.</p>
+ by default as from Erlang/OTP 18.0. To retain backwards compatibility
+ with existing user-defined event handlers, the warning events can be
+ tagged as <c>errors</c> or <c>info</c> using command-line flag
+ <c><![CDATA[+W <e | i | w>]]></c>, thus showing up as
+ <c>ERROR REPORT</c> or <c>INFO REPORT</c> in the logs.</p>
</description>
<datatypes>
<datatype>
@@ -72,15 +75,44 @@
</datatypes>
<funcs>
<func>
+ <name name="add_report_handler" arity="1"/>
+ <name name="add_report_handler" arity="2"/>
+ <fsummary>Add an event handler to the error logger.</fsummary>
+ <desc>
+ <p>Adds a new event handler to the error logger. The event
+ handler must be implemented as a <c>gen_event</c> callback
+ module, see
+ <seealso marker="stdlib:gen_event"><c>stdlib:gen_event(3)</c></seealso>.</p>
+ <p><c><anno>Handler</anno></c> is typically the name of the callback module
+ and <c><anno>Args</anno></c> is an optional term (defaults to []) passed
+ to the initialization callback function <c><anno>Handler</anno>:init/1</c>.
+ The function returns <c>ok</c> if successful.</p>
+ <p>The event handler must be able to handle the events in this module, see
+ section <seealso marker="#events">Events</seealso>.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="delete_report_handler" arity="1"/>
+ <fsummary>Delete an event handler from the error logger.</fsummary>
+ <desc>
+ <p>Deletes an event handler from the error logger by calling
+ <c>gen_event:delete_handler(error_logger, <anno>Handler</anno>, [])</c>,
+ see <seealso marker="stdlib:gen_event"><c>stdlib:gen_event(3)</c></seealso>.</p>
+ </desc>
+ </func>
+ <func>
<name name="error_msg" arity="1"/>
<name name="error_msg" arity="2"/>
<name name="format" arity="2"/>
- <fsummary>Send an standard error event to the error logger</fsummary>
+ <fsummary>Send a standard error event to the error logger.</fsummary>
<desc>
<p>Sends a standard error event to the error logger.
- The <c><anno>Format</anno></c> and <c><anno>Data</anno></c> arguments are the same as
- the arguments of <c>io:format/2</c>. The event is handled by
- the standard event handler.</p>
+ The <c><anno>Format</anno></c> and <c><anno>Data</anno></c> arguments
+ are the same as the arguments of
+ <seealso marker="stdlib:io#format/2"><c>io:format/2</c></seealso>
+ in <c>STDLIB</c>.
+ The event is handled by the standard event handler.</p>
+ <p><em>Example:</em></p>
<pre>
1> <input>error_logger:error_msg("An error occurred in ~p~n", [a_module]).</input>
@@ -90,16 +122,19 @@ ok</pre>
<warning>
<p>If called with bad arguments, this function can crash
the standard event handler, meaning no further events are
- logged. When in doubt, use <c>error_report/1</c> instead.</p>
+ logged. When in doubt, use
+ <seealso marker="#error_report/1"><c>error_report/1</c></seealso>
+ instead.</p>
</warning>
</desc>
</func>
<func>
<name name="error_report" arity="1"/>
- <fsummary>Send a standard error report event to the error logger</fsummary>
+ <fsummary>Send a standard error report event to the error logger.</fsummary>
<desc>
<p>Sends a standard error report event to the error logger.
The event is handled by the standard event handler.</p>
+ <p><em>Example:</em></p>
<pre>
2> <input>error_logger:error_report([{tag1,data1},a_term,{tag2,data}]).</input>
@@ -117,100 +152,27 @@ ok</pre>
</func>
<func>
<name name="error_report" arity="2"/>
- <fsummary>Send a user defined error report event to the error logger</fsummary>
+ <fsummary>Send a user-defined error report event to the error logger.</fsummary>
<desc>
- <p>Sends a user defined error report event to the error logger.
+ <p>Sends a user-defined error report event to the error logger.
An event handler to handle the event is supposed to have been
added. The event is ignored by the standard event handler.</p>
<p>It is recommended that <c><anno>Report</anno></c> follows the same
- structure as for <c>error_report/1</c>.</p>
- </desc>
- </func>
- <func>
- <name name="warning_map" arity="0"/>
- <fsummary>Return the current mapping for warning events</fsummary>
- <desc>
- <p>Returns the current mapping for warning events. Events sent
- using <c>warning_msg/1,2</c> or <c>warning_report/1,2</c>
- are tagged as errors, warnings (default) or info, depending
- on the value of the command line flag <c>+W</c>.</p>
- <pre>
-os$ <input>erl</input>
-Erlang (BEAM) emulator version 5.4.8 [hipe] [threads:0] [kernel-poll]
-
-Eshell V5.4.8 (abort with ^G)
-1> <input>error_logger:warning_map().</input>
-warning
-2> <input>error_logger:warning_msg("Warnings tagged as: ~p~n", [warning]).</input>
-
-=WARNING REPORT==== 11-Aug-2005::15:31:55 ===
-Warnings tagged as: warning
-ok
-3>
-User switch command
- --> q
-os$ <input>erl +W e</input>
-Erlang (BEAM) emulator version 5.4.8 [hipe] [threads:0] [kernel-poll]
-
-Eshell V5.4.8 (abort with ^G)
-1> <input>error_logger:warning_map().</input>
-error
-2> <input>error_logger:warning_msg("Warnings tagged as: ~p~n", [error]).</input>
-
-=ERROR REPORT==== 11-Aug-2005::15:31:23 ===
-Warnings tagged as: error
-ok</pre>
- </desc>
- </func>
- <func>
- <name name="warning_msg" arity="1"/>
- <name name="warning_msg" arity="2"/>
- <fsummary>Send a standard warning event to the error logger</fsummary>
- <desc>
- <p>Sends a standard warning event to the error logger.
- The <c><anno>Format</anno></c> and <c><anno>Data</anno></c> arguments are the same as
- the arguments of <c>io:format/2</c>. The event is handled by
- the standard event handler. It is tagged either as an error,
- warning or info, see
- <seealso marker="#warning_map/0">warning_map/0</seealso>.</p>
- <warning>
- <p>If called with bad arguments, this function can crash
- the standard event handler, meaning no further events are
- logged. When in doubt, use <c>warning_report/1</c> instead.</p>
- </warning>
- </desc>
- </func>
- <func>
- <name name="warning_report" arity="1"/>
- <fsummary>Send a standard warning report event to the error logger</fsummary>
- <desc>
- <p>Sends a standard warning report event to the error logger.
- The event is handled by the standard event handler. It is
- tagged either as an error, warning or info, see
- <seealso marker="#warning_map/0">warning_map/0</seealso>.</p>
- </desc>
- </func>
- <func>
- <name name="warning_report" arity="2"/>
- <fsummary>Send a user defined warning report event to the error logger</fsummary>
- <desc>
- <p>Sends a user defined warning report event to the error
- logger. An event handler to handle the event is supposed to
- have been added. The event is ignored by the standard event
- handler. It is tagged either as an error, warning or info,
- depending on the value of
- <seealso marker="#warning_map/0">warning_map/0</seealso>.</p>
+ structure as for
+ <seealso marker="#error_report/1"><c>error_report/1</c></seealso>.</p>
</desc>
</func>
<func>
<name name="info_msg" arity="1"/>
<name name="info_msg" arity="2"/>
- <fsummary>Send a standard information event to the error logger</fsummary>
+ <fsummary>Send a standard information event to the error logger.</fsummary>
<desc>
<p>Sends a standard information event to the error logger.
- The <c><anno>Format</anno></c> and <c><anno>Data</anno></c> arguments are the same as
- the arguments of <c>io:format/2</c>. The event is handled by
- the standard event handler.</p>
+ The <c><anno>Format</anno></c> and <c><anno>Data</anno></c> arguments
+ are the same as the arguments of
+ <seealso marker="stdlib:io#format/2"><c>io:format/2</c></seealso>
+ in <c>STDLIB</c>. The event is handled by the standard event handler.</p>
+ <p><em>Example:</em></p>
<pre>
1> <input>error_logger:info_msg("Something happened in ~p~n", [a_module]).</input>
@@ -226,10 +188,11 @@ ok</pre>
</func>
<func>
<name name="info_report" arity="1"/>
- <fsummary>Send a standard information report event to the error logger</fsummary>
+ <fsummary>Send a standard information report event to the error logger.</fsummary>
<desc>
<p>Sends a standard information report event to the error
logger. The event is handled by the standard event handler.</p>
+ <p><em>Example:</em></p>
<pre>
2> <input>error_logger:info_report([{tag1,data1},a_term,{tag2,data}]).</input>
@@ -247,59 +210,22 @@ ok</pre>
</func>
<func>
<name name="info_report" arity="2"/>
- <fsummary>Send a user defined information report event to the error logger</fsummary>
+ <fsummary>Send a user-defined information report event to the error logger.</fsummary>
<desc>
- <p>Sends a user defined information report event to the error
+ <p>Sends a user-defined information report event to the error
logger. An event handler to handle the event is supposed to
have been added. The event is ignored by the standard event
handler.</p>
<p>It is recommended that <c><anno>Report</anno></c> follows the same
- structure as for <c>info_report/1</c>.</p>
- </desc>
- </func>
- <func>
- <name name="add_report_handler" arity="1"/>
- <name name="add_report_handler" arity="2"/>
- <fsummary>Add an event handler to the error logger</fsummary>
- <desc>
- <p>Adds a new event handler to the error logger. The event
- handler must be implemented as a <c>gen_event</c> callback
- module, see
- <seealso marker="stdlib:gen_event">gen_event(3)</seealso>.</p>
- <p><c><anno>Handler</anno></c> is typically the name of the callback module
- and <c><anno>Args</anno></c> is an optional term (defaults to []) passed
- to the initialization callback function <c><anno>Handler</anno>:init/1</c>.
- The function returns <c>ok</c> if successful.</p>
- <p>The event handler must be able to handle the
- <seealso marker="#events">events</seealso> described below.</p>
- </desc>
- </func>
- <func>
- <name name="delete_report_handler" arity="1"/>
- <fsummary>Delete an event handler from the error logger</fsummary>
- <desc>
- <p>Deletes an event handler from the error logger by calling
- <c>gen_event:delete_handler(error_logger, <anno>Handler</anno>, [])</c>,
- see <seealso marker="stdlib:gen_event">gen_event(3)</seealso>.</p>
- </desc>
- </func>
- <func>
- <name name="tty" arity="1"/>
- <fsummary>Enable or disable printouts to the tty</fsummary>
- <desc>
- <p>Enables (<c><anno>Flag</anno> == true</c>) or disables
- (<c><anno>Flag</anno> == false</c>) printout of standard events to the tty.</p>
- <p>This is done by adding or deleting the standard event handler
- for output to tty, thus calling this function overrides
- the value of the Kernel <c>error_logger</c> configuration
- parameter.</p>
+ structure as for
+ <seealso marker="#info_report/1"><c>info_report/1</c></seealso>.</p>
</desc>
</func>
<func>
<name name="logfile" arity="1" clause_i="1"/>
<name name="logfile" arity="1" clause_i="2"/>
<name name="logfile" arity="1" clause_i="3"/>
- <fsummary>Enable or disable error printouts to a file</fsummary>
+ <fsummary>Enable or disable error printouts to a file.</fsummary>
<type variable="Filename"/>
<type variable="OpenReason" name_i="1"/>
<type variable="CloseReason" name_i="2"/>
@@ -308,22 +234,22 @@ ok</pre>
<desc>
<p>Enables or disables printout of standard events to a file.</p>
<p>This is done by adding or deleting the standard event handler
- for output to file, thus calling this function overrides
- the value of the Kernel <c>error_logger</c> configuration
+ for output to file. Thus, calling this function overrides
+ the value of the <c>Kernel</c> <c>error_logger</c> configuration
parameter.</p>
- <p>Enabling file logging can be used in combination with calling
- <c>tty(false)</c>, in order to have a silent system, where
+ <p>Enabling file logging can be used together with calling
+ <c>tty(false)</c>, to have a silent system where
all standard events are logged to a file only.
- There can only be one active log file at a time.</p>
- <p><c>Request</c> is one of:</p>
+ Only one log file can be active at a time.</p>
+ <p><c>Request</c> is one of the following:</p>
<taglist>
<tag><c>{open, <anno>Filename</anno>}</c></tag>
<item>
- <p>Opens the log file <c><anno>Filename</anno></c>. Returns <c>ok</c> if
+ <p>Opens log file <c><anno>Filename</anno></c>. Returns <c>ok</c> if
successful, or <c>{error, allready_have_logfile}</c> if
logging to file is already enabled, or an error tuple if
- another error occurred. For example, if <c><anno>Filename</anno></c>
- could not be opened.</p>
+ another error occurred (for example, if <c><anno>Filename</anno></c>
+ cannot be opened).</p>
</item>
<tag><c>close</c></tag>
<item>
@@ -339,6 +265,97 @@ ok</pre>
</taglist>
</desc>
</func>
+ <func>
+ <name name="tty" arity="1"/>
+ <fsummary>Enable or disable printouts to the terminal.</fsummary>
+ <desc>
+ <p>Enables (<c><anno>Flag</anno> == true</c>) or disables
+ (<c><anno>Flag</anno> == false</c>) printout of standard events
+ to the terminal.</p>
+ <p>This is done by adding or deleting the standard event handler
+ for output to the terminal. Thus, calling this function overrides
+ the value of the <c>Kernel</c> <c>error_logger</c> configuration parameter.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="warning_map" arity="0"/>
+ <fsummary>Return the current mapping for warning events.</fsummary>
+ <desc>
+ <p>Returns the current mapping for warning events. Events sent
+ using <c>warning_msg/1,2</c> or <c>warning_report/1,2</c>
+ are tagged as errors, warnings (default), or info, depending
+ on the value of command-line flag <c>+W</c>.</p>
+ <p><em>Example:</em></p>
+ <pre>
+os$ <input>erl</input>
+Erlang (BEAM) emulator version 5.4.8 [hipe] [threads:0] [kernel-poll]
+
+Eshell V5.4.8 (abort with ^G)
+1> <input>error_logger:warning_map().</input>
+warning
+2> <input>error_logger:warning_msg("Warnings tagged as: ~p~n", [warning]).</input>
+
+=WARNING REPORT==== 11-Aug-2005::15:31:55 ===
+Warnings tagged as: warning
+ok
+3>
+User switch command
+ --> q
+os$ <input>erl +W e</input>
+Erlang (BEAM) emulator version 5.4.8 [hipe] [threads:0] [kernel-poll]
+
+Eshell V5.4.8 (abort with ^G)
+1> <input>error_logger:warning_map().</input>
+error
+2> <input>error_logger:warning_msg("Warnings tagged as: ~p~n", [error]).</input>
+
+=ERROR REPORT==== 11-Aug-2005::15:31:23 ===
+Warnings tagged as: error
+ok</pre>
+ </desc>
+ </func>
+ <func>
+ <name name="warning_msg" arity="1"/>
+ <name name="warning_msg" arity="2"/>
+ <fsummary>Send a standard warning event to the error logger.</fsummary>
+ <desc>
+ <p>Sends a standard warning event to the error logger.
+ The <c><anno>Format</anno></c> and <c><anno>Data</anno></c> arguments
+ are the same as the arguments of
+ <seealso marker="stdlib:io#format/2"><c>io:format/2</c></seealso>
+ in <c>STDLIB</c>.
+ The event is handled by the standard event handler. It is tagged
+ as an error, warning, or info, see
+ <seealso marker="#warning_map/0"><c>warning_map/0</c></seealso>.</p>
+ <warning>
+ <p>If called with bad arguments, this function can crash
+ the standard event handler, meaning no further events are
+ logged. When in doubt, use <c>warning_report/1</c> instead.</p>
+ </warning>
+ </desc>
+ </func>
+ <func>
+ <name name="warning_report" arity="1"/>
+ <fsummary>Send a standard warning report event to the error logger.</fsummary>
+ <desc>
+ <p>Sends a standard warning report event to the error logger.
+ The event is handled by the standard event handler. It is
+ tagged as an error, warning, or info, see
+ <seealso marker="#warning_map/0"><c>warning_map/0</c></seealso>.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="warning_report" arity="2"/>
+ <fsummary>Send a user-defined warning report event to the error logger.</fsummary>
+ <desc>
+ <p>Sends a user-defined warning report event to the error
+ logger. An event handler to handle the event is supposed to
+ have been added. The event is ignored by the standard event
+ handler. It is tagged as an error, warning, or info,
+ depending on the value of
+ <seealso marker="#warning_map/0"><c>warning_map/0</c></seealso>.</p>
+ </desc>
+ </func>
</funcs>
<section>
@@ -346,8 +363,8 @@ ok</pre>
<title>Events</title>
<p>All event handlers added to the error logger must handle
the following events. <c>Gleader</c> is the group leader pid of
- the process which sent the event, and <c>Pid</c> is the process
- which sent the event.</p>
+ the process that sent the event, and <c>Pid</c> is the process
+ that sent the event.</p>
<taglist>
<tag><c>{error, Gleader, {Pid, Format, Data}}</c></tag>
<item>
@@ -364,18 +381,18 @@ ok</pre>
</item>
<tag><c>{warning_msg, Gleader, {Pid, Format, Data}}</c></tag>
<item>
- <p>Generated when <c>warning_msg/1,2</c> is called, provided
- that warnings are set to be tagged as warnings.</p>
+ <p>Generated when <c>warning_msg/1,2</c> is called
+ if warnings are set to be tagged as warnings.</p>
</item>
<tag><c>{warning_report, Gleader, {Pid, std_warning, Report}}</c></tag>
<item>
- <p>Generated when <c>warning_report/1</c> is called, provided
- that warnings are set to be tagged as warnings.</p>
+ <p>Generated when <c>warning_report/1</c> is called
+ if warnings are set to be tagged as warnings.</p>
</item>
<tag><c>{warning_report, Gleader, {Pid, Type, Report}}</c></tag>
<item>
- <p>Generated when <c>warning_report/2</c> is called, provided
- that warnings are set to be tagged as warnings.</p>
+ <p>Generated when <c>warning_report/2</c> is called
+ if warnings are set to be tagged as warnings.</p>
</item>
<tag><c>{info_msg, Gleader, {Pid, Format, Data}}</c></tag>
<item>
@@ -390,17 +407,19 @@ ok</pre>
<p>Generated when <c>info_report/2</c> is called.</p>
</item>
</taglist>
- <p>Note that also a number of system internal events may be
- received, a catch-all clause last in the definition of
+ <p>Notice that some system-internal events can also be
+ received. Therefore a catch-all clause last in the definition of
the event handler callback function <c>Module:handle_event/2</c>
- is necessary. This also holds true for
- <c>Module:handle_info/2</c>, as there are a number of system
- internal messages the event handler must take care of as well.</p>
+ is necessary. This also applies for
+ <c>Module:handle_info/2</c>, as the event handler must also take care of
+ some system-internal messages.</p>
</section>
-
<section>
- <title>SEE ALSO</title>
- <p>gen_event(3), log_mf_h(3), kernel(6), sasl(6)</p>
+ <title>See Also</title>
+ <p><seealso marker="stdlib:gen_event"><c>stdlib:gen_event(3)</c></seealso>,
+ <seealso marker="stdlib:log_mf_h"><c>stdlib:log_mf_h(3)</c></seealso>
+ <seealso marker="kernel_app"><c>kernel(6)</c></seealso>
+ <seealso marker="sasl:sasl_app"><c>sasl(6)</c></seealso></p>
</section>
</erlref>
diff --git a/lib/kernel/doc/src/file.xml b/lib/kernel/doc/src/file.xml
index 831ef1c22a..a73038ac58 100644
--- a/lib/kernel/doc/src/file.xml
+++ b/lib/kernel/doc/src/file.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,56 +29,57 @@
<rev></rev>
</header>
<module>file</module>
- <modulesummary>File Interface Module</modulesummary>
+ <modulesummary>File interface module.</modulesummary>
<description>
- <p>The module <c>file</c> provides an interface to the file system.</p>
- <p>On operating systems with thread support, it is possible to let
- file operations be performed in threads of their own, allowing
+ <p>This module provides an interface to the file system.</p>
+
+ <p>On operating systems with thread support,
+ file operations can be performed in threads of their own, allowing
other Erlang processes to continue executing in parallel with
- the file operations. See the command line flag
- <c>+A</c> in <seealso marker="erts:erl">erl(1)</seealso>.</p>
+ the file operations. See command-line flag
+ <c>+A</c> in <seealso marker="erts:erl"><c>erl(1)</c></seealso>.</p>
- <p>With regard to file name encoding, the Erlang VM can operate in
- two modes. The current mode can be queried using the <seealso
- marker="#native_name_encoding">native_name_encoding/0</seealso>
- function. It returns either <c>latin1</c> or <c>utf8</c>.</p>
+ <p>Regarding filename encoding, the Erlang VM can operate in
+ two modes. The current mode can be queried using function
+ <seealso marker="#native_name_encoding"><c>native_name_encoding/0</c></seealso>.
+ It returns <c>latin1</c> or <c>utf8</c>.</p>
- <p>In the <c>latin1</c> mode, the Erlang VM does not change the
- encoding of file names. In the <c>utf8</c> mode, file names can
- contain Unicode characters greater than 255 and the VM will
- convert file names back and forth to the native file name encoding
+ <p>In <c>latin1</c> mode, the Erlang VM does not change the
+ encoding of filenames. In <c>utf8</c> mode, filenames can
+ contain Unicode characters greater than 255 and the VM
+ converts filenames back and forth to the native filename encoding
(usually UTF-8, but UTF-16 on Windows).</p>
<p>The default mode depends on the operating system. Windows and
- MacOS X enforce consistent file name encoding and therefore the
- VM uses the <c>utf8</c> mode.</p>
+ MacOS X enforce consistent filename encoding and therefore the
+ VM uses <c>utf8</c> mode.</p>
- <p>On operating systems with transparent naming (i.e. all Unix
- systems except MacOS X), the default will be <c>utf8</c> if the
- terminal supports UTF-8, otherwise <c>latin1</c>. The default may
- be overridden using the <c>+fnl</c> (to force <c>latin1</c> mode)
- or <c>+fnu</c> (to force <c>utf8</c> mode) when starting <seealso
- marker="erts:erl">erl</seealso>.</p>
+ <p>On operating systems with transparent naming (for example, all Unix
+ systems except MacOS X), default is <c>utf8</c> if the
+ terminal supports UTF-8, otherwise <c>latin1</c>. The default can
+ be overridden using <c>+fnl</c> (to force <c>latin1</c> mode)
+ or <c>+fnu</c> (to force <c>utf8</c> mode) when starting
+ <seealso marker="erts:erl"><c>erts:erl</c></seealso>.</p>
- <p>On operating systems with transparent naming, files could be
- inconsistently named, i.e. some files are encoded in UTF-8 while
- others are encoded in (for example) iso-latin1. To be able to
- handle file systems with inconsistent naming when running in the
- <c>utf8</c> mode, the concept of "raw file names" has been
- introduced.</p>
+ <p>On operating systems with transparent naming, files can be
+ inconsistently named, for example, some files are encoded in UTF-8 while
+ others are encoded in ISO Latin-1. The concept of <em>raw filenames</em> is
+ introduced to handle file systems with inconsistent naming when running in
+ <c>utf8</c> mode.</p>
- <p>A raw file name is a file name given as a binary. The Erlang VM
- will perform no translation of a file name given as a binary on
+ <p>A <em>raw filename</em> is a filename specified as a binary. The Erlang VM
+ does not translate a filename specified as a binary on
systems with transparent naming.</p>
- <p>When running in the <c>utf8</c> mode, the
- <c>file:list_dir/1</c> and <c>file:read_link/1</c> functions will
- never return raw file names. Use the <seealso
- marker="#list_dir_all">list_dir_all/1</seealso> and <seealso
- marker="#read_link_all">read_link_all/1</seealso> functions to
- return all file names including raw file names.</p>
+ <p>When running in <c>utf8</c> mode, functions
+ <seealso marker="#list_dir/1"><c>list_dir/1</c></seealso> and
+ <seealso marker="#read_link/1"><c>read_link/1</c></seealso>
+ never return raw filenames. To return all filenames including raw filenames,
+ use functions
+ <seealso marker="#list_dir_all"><c>list_dir_all/1</c></seealso> and
+ <seealso marker="#read_link_all"><c>read_link_all/1</c></seealso>.</p>
- <p>Also see <seealso marker="stdlib:unicode_usage#notes-about-raw-filenames">Notes about raw file names</seealso>.</p>
+ <p>See also section <seealso marker="stdlib:unicode_usage#notes-about-raw-filenames">Notes About Raw Filenames</seealso> in the <c>STDLIB</c> User´s Giude.</p>
</description>
@@ -90,8 +91,8 @@
<name>fd()</name>
<desc>
<p><marker id="type-fd"/>
- A file descriptor representing a file opened in <seealso
- marker="#raw">raw</seealso> mode.</p>
+ A file descriptor representing a file opened in
+ <seealso marker="#raw"><c>raw</c></seealso> mode.</p>
</desc>
</datatype>
<datatype>
@@ -104,7 +105,7 @@
<name name="io_device"/>
<desc>
<p>As returned by
- <seealso marker="#open/2">file:open/2</seealso>;
+ <seealso marker="#open/2"><c>open/2</c></seealso>;
<c>pid()</c> is a process handling I/O-protocols.</p>
</desc>
</datatype>
@@ -112,7 +113,7 @@
<name name="name"/>
<desc>
<p>If VM is in Unicode filename mode, <c>string()</c> and <c>char()</c>
- are allowed to be > 255.
+ are allowed to be &gt; 255.
</p>
</desc>
</datatype>
@@ -120,12 +121,12 @@
<name name="name_all"/>
<desc>
<p>If VM is in Unicode filename mode, <c>string()</c> and <c>char()</c>
- are allowed to be > 255.
+ are allowed to be &gt; 255.
<c><anno>RawFilename</anno></c> is a filename not subject to
Unicode translation,
meaning that it can contain characters not conforming to
- the Unicode encoding expected from the filesystem
- (i.e. non-UTF-8 characters although the VM is started
+ the Unicode encoding expected from the file system
+ (that is, non-UTF-8 characters although the VM is started
in Unicode filename mode).
</p>
</desc>
@@ -133,7 +134,7 @@
<datatype>
<name name="posix"/>
<desc>
- <p>An atom which is named from the POSIX error codes used in
+ <p>An atom that is named from the POSIX error codes used in
Unix, and in the runtime libraries of most C compilers.</p>
</desc>
</datatype>
@@ -160,7 +161,7 @@
<funcs>
<func>
<name name="advise" arity="4"/>
- <fsummary>Predeclare an access pattern for file data</fsummary>
+ <fsummary>Predeclare an access pattern for file data.</fsummary>
<type name="posix_file_advise"/>
<desc>
<p><c>advise/4</c> can be used to announce an intention to access file
@@ -171,80 +172,80 @@
</func>
<func>
<name name="allocate" arity="3"/>
- <fsummary>Allocate file space</fsummary>
+ <fsummary>Allocate file space.</fsummary>
<desc>
<p><c>allocate/3</c> can be used to preallocate space for a file.</p>
- <p>This function only succeeds in platforms that implement this
+ <p>This function only succeeds in platforms that provide this
feature. When it succeeds, space is preallocated for the file but
the file size might not be updated. This behaviour depends on the
- preallocation implementation. To guarantee the file size is updated
- one must truncate the file to the new size.</p>
+ preallocation implementation. To guarantee that the file size is updated,
+ truncate the file to the new size.</p>
</desc>
</func>
<func>
<name name="change_group" arity="2"/>
- <fsummary>Change group of a file</fsummary>
+ <fsummary>Change group of a file.</fsummary>
<desc>
<p>Changes group of a file. See
- <seealso marker="#write_file_info/2">write_file_info/2</seealso>.</p>
+ <seealso marker="#write_file_info/2"><c>write_file_info/2</c></seealso>.</p>
</desc>
</func>
<func>
<name name="change_mode" arity="2"/>
- <fsummary>Change permissions of a file</fsummary>
+ <fsummary>Change permissions of a file.</fsummary>
<desc>
<p>Changes permissions of a file. See
- <seealso marker="#write_file_info/2">write_file_info/2</seealso>.</p>
+ <seealso marker="#write_file_info/2"><c>write_file_info/2</c></seealso>.</p>
</desc>
</func>
<func>
<name name="change_owner" arity="2"/>
- <fsummary>Change owner of a file</fsummary>
+ <fsummary>Change owner of a file.</fsummary>
<desc>
<p>Changes owner of a file. See
- <seealso marker="#write_file_info/2">write_file_info/2</seealso>.</p>
+ <seealso marker="#write_file_info/2"><c>write_file_info/2</c></seealso>.</p>
</desc>
</func>
<func>
<name name="change_owner" arity="3"/>
- <fsummary>Change owner and group of a file</fsummary>
+ <fsummary>Change owner and group of a file.</fsummary>
<desc>
<p>Changes owner and group of a file. See
- <seealso marker="#write_file_info/2">write_file_info/2</seealso>.</p>
+ <seealso marker="#write_file_info/2"><c>write_file_info/2</c></seealso>.</p>
</desc>
</func>
<func>
<name name="change_time" arity="2"/>
- <fsummary>Change the modification time of a file</fsummary>
+ <fsummary>Change the modification time of a file.</fsummary>
<desc>
<p>Changes the modification and access times of a file. See
- <seealso marker="#write_file_info/2">write_file_info/2</seealso>.</p>
+ <seealso marker="#write_file_info/2"><c>write_file_info/2</c></seealso>.</p>
</desc>
</func>
<func>
<name name="change_time" arity="3"/>
- <fsummary>Change the modification and last access time of a file</fsummary>
+ <fsummary>Change the modification and last access time of a file.</fsummary>
<desc>
<p>Changes the modification and last access times of a file. See
- <seealso marker="#write_file_info/2">write_file_info/2</seealso>.</p>
+ <seealso marker="#write_file_info/2"><c>write_file_info/2</c></seealso>.</p>
</desc>
</func>
<func>
<name name="close" arity="1"/>
- <fsummary>Close a file</fsummary>
+ <fsummary>Close a file.</fsummary>
<desc>
<p>Closes the file referenced by <c><anno>IoDevice</anno></c>. It mostly
- returns <c>ok</c>, expect for some severe errors such as out
+ returns <c>ok</c>, except for some severe errors such as out
of memory.</p>
- <p>Note that if the option <c>delayed_write</c> was
- used when opening the file, <c>close/1</c> might return an
+ <p>Notice that if option <c>delayed_write</c> was
+ used when opening the file, <c>close/1</c> can return an
old write error and not even try to close the file. See
- <seealso marker="#open/2">open/2</seealso>.</p>
+ <seealso marker="#open/2"><c>open/2</c></seealso>.</p>
</desc>
</func>
<func>
<name name="consult" arity="1"/>
- <fsummary>Read Erlang terms from a file</fsummary>
+ <fsummary>Read Erlang terms from a file.</fsummary>
<desc>
<p>Reads Erlang terms, separated by '.', from
<c><anno>Filename</anno></c>. Returns one of the following:</p>
@@ -256,42 +257,44 @@
<tag><c>{error, atom()}</c></tag>
<item>
<p>An error occurred when opening the file or reading it.
- See <seealso marker="#open/2">open/2</seealso> for a list
- of typical error codes.</p>
+ For a list of typical error codes, see
+ <seealso marker="#open/2"><c>open/2</c></seealso>.</p>
</item>
<tag><c>{error, {<anno>Line</anno>, <anno>Mod</anno>,
<anno>Term</anno>}}</c></tag>
<item>
<p>An error occurred when interpreting the Erlang terms in
- the file. Use <c>format_error/1</c> to convert
- the three-element tuple to an English description of
- the error.</p>
+ the file. To convert the three-element tuple to an English
+ description of the error, use
+ <seealso marker="#format_error/1"><c>format_error/1</c></seealso>.</p>
</item>
</taglist>
- <p>Example:</p>
-<code type="none">f.txt: {person, "kalle", 25}.
+ <p><em>Example:</em></p>
+<code type="none">
+f.txt: {person, "kalle", 25}.
{person, "pelle", 30}.</code>
-<pre>1> <input>file:consult("f.txt").</input>
+<pre>
+1> <input>file:consult("f.txt").</input>
{ok,[{person,"kalle",25},{person,"pelle",30}]}</pre>
- <p>The encoding of of <c><anno>Filename</anno></c> can be set
- by a comment as described in <seealso
- marker="stdlib:epp#encoding">epp(3)</seealso>.</p>
+ <p>The encoding of <c><anno>Filename</anno></c> can be set
+ by a comment, as described in
+ <seealso marker="stdlib:epp#encoding"><c>stdlib:epp(3)</c></seealso>.</p>
</desc>
</func>
<func>
<name name="copy" arity="2"/>
<name name="copy" arity="3"/>
- <fsummary>Copy file contents</fsummary>
+ <fsummary>Copy file contents.</fsummary>
<desc>
<p>Copies <c><anno>ByteCount</anno></c> bytes from
<c><anno>Source</anno></c> to <c><anno>Destination</anno></c>.
<c><anno>Source</anno></c> and <c><anno>Destination</anno></c> refer
- to either filenames or IO devices from e.g. <c>open/2</c>.
+ to either filenames or IO devices from, for example, <c>open/2</c>.
<c><anno>ByteCount</anno></c> defaults to <c>infinity</c>, denoting an
infinite number of bytes.</p>
- <p>The argument <c><anno>Modes</anno></c> is a list of possible modes,
- see <seealso marker="#open/2">open/2</seealso>, and defaults to
- [].</p>
+ <p>Argument <c><anno>Modes</anno></c> is a list of possible modes,
+ see <seealso marker="#open/2"><c>open/2</c></seealso>, and defaults to
+ <c>[]</c>.</p>
<p>If both <c><anno>Source</anno></c> and
<c><anno>Destination</anno></c> refer to
filenames, the files are opened with <c>[read, binary]</c>
@@ -303,25 +306,51 @@
<p>If <c><anno>Destination</anno></c> refers to a filename, it is opened
with <c>write</c> mode prepended to the mode list before
the copy, and closed when done.</p>
- <p>Returns <c>{ok, <anno>BytesCopied</anno>}</c> where
+ <p>Returns <c>{ok, <anno>BytesCopied</anno>}</c>, where
<c><anno>BytesCopied</anno></c> is
- the number of bytes that actually was copied, which may be
+ the number of bytes that was copied, which can be
less than <c><anno>ByteCount</anno></c> if end of file was
encountered on the source. If the operation fails,
<c>{error, <anno>Reason</anno>}</c> is returned.</p>
- <p>Typical error reasons: As for <c>open/2</c> if a file had to
- be opened, and as for <c>read/2</c> and <c>write/2</c>.</p>
+ <p>Typical error reasons: as for
+ <seealso marker="#open/2"><c>open/2</c></seealso> if a file
+ had to be opened, and as for
+ <seealso marker="#read/2"><c>read/2</c></seealso> and
+ <seealso marker="#write/2"><c>write/2</c></seealso>.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="datasync" arity="1"/>
+ <fsummary>Synchronize the in-memory data of a file, ignoring most of its metadata, with that on the physical medium.</fsummary>
+ <desc>
+ <p>Ensures that any buffers kept by the operating system
+ (not by the Erlang runtime system) are written to disk. In
+ many ways it resembles <c>fsync</c> but it does not update
+ some of the metadata of the file, such as the access time. On
+ some platforms this function has no effect.</p>
+ <p>Applications that access databases or log files often write
+ a tiny data fragment (for example, one line in a log file) and then
+ call <c>fsync()</c> immediately to ensure that the written
+ data is physically stored on the hard disk. Unfortunately, <c>fsync()</c>
+ always initiates two write operations: one for the newly
+ written data and another one to update the modification
+ time stored in the <c>inode</c>. If the modification time is not a part
+ of the transaction concept, <c>fdatasync()</c> can be used to avoid
+ unnecessary <c>inode</c> disk write operations.</p>
+ <p>Available only in some POSIX systems, this call results in a
+ call to <c>fsync()</c>, or has no effect in systems not providing
+ the <c>fdatasync()</c> syscall.</p>
</desc>
</func>
<func>
<name name="del_dir" arity="1"/>
- <fsummary>Delete a directory</fsummary>
+ <fsummary>Delete a directory.</fsummary>
<desc>
- <p>Tries to delete the directory <c><anno>Dir</anno></c>.
+ <p>Tries to delete directory <c><anno>Dir</anno></c>.
The directory must
be empty before it can be deleted. Returns <c>ok</c> if
successful.</p>
- <p>Typical error reasons are:</p>
+ <p>Typical error reasons:</p>
<taglist>
<tag><c>eacces</c></tag>
<item>
@@ -351,11 +380,11 @@
</func>
<func>
<name name="delete" arity="1"/>
- <fsummary>Delete a file</fsummary>
+ <fsummary>Delete a file.</fsummary>
<desc>
- <p>Tries to delete the file <c><anno>Filename</anno></c>.
+ <p>Tries to delete file <c><anno>Filename</anno></c>.
Returns <c>ok</c> if successful.</p>
- <p>Typical error reasons are:</p>
+ <p>Typical error reasons:</p>
<taglist>
<tag><c>enoent</c></tag>
<item>
@@ -367,32 +396,32 @@
</item>
<tag><c>eperm</c></tag>
<item>
- <p>The file is a directory and the user is not super-user.</p>
+ <p>The file is a directory and the user is not superuser.</p>
</item>
<tag><c>enotdir</c></tag>
<item>
- <p>A component of the file name is not a directory. On some
+ <p>A component of the filename is not a directory. On some
platforms, <c>enoent</c> is returned instead.</p>
</item>
<tag><c>einval</c></tag>
<item>
- <p><c><anno>Filename</anno></c> had an improper type, such as tuple.</p>
+ <p><c><anno>Filename</anno></c> has an improper type, such as tuple.</p>
</item>
</taglist>
<warning>
- <p>In a future release, a bad type for the
- <c><anno>Filename</anno></c> argument will probably generate
+ <p>In a future release, a bad type for argument
+ <c><anno>Filename</anno></c> will probably generate
an exception.</p>
</warning>
</desc>
</func>
<func>
<name name="eval" arity="1"/>
- <fsummary>Evaluate Erlang expressions in a file</fsummary>
+ <fsummary>Evaluate Erlang expressions in a file.</fsummary>
<desc>
<p>Reads and evaluates Erlang expressions, separated by '.' (or
- ',', a sequence of expressions is also an expression), from
- <c><anno>Filename</anno></c>. The actual result of the evaluation
+ ',', a sequence of expressions is also an expression) from
+ <c><anno>Filename</anno></c>. The result of the evaluation
is not returned; any expression sequence in the file must be there
for its side effect. Returns one of the following:</p>
<taglist>
@@ -403,35 +432,36 @@
<tag><c>{error, atom()}</c></tag>
<item>
<p>An error occurred when opening the file or reading it.
- See <c>open/2</c> for a list of typical error codes.</p>
+ For a list of typical error codes, see
+ <seealso marker="#open/2"><c>open/2</c></seealso>.</p>
</item>
<tag><c>{error, {<anno>Line</anno>, <anno>Mod</anno>,
<anno>Term</anno>}}</c></tag>
<item>
<p>An error occurred when interpreting the Erlang
- expressions in the file. Use <c>format_error/1</c> to
- convert the three-element tuple to an English description
- of the error.</p>
+ expressions in the file. To convert the three-element tuple
+ to an English description of the error, use
+ <seealso marker="#format_error/1"><c>format_error/1</c></seealso>.</p>
</item>
</taglist>
- <p>The encoding of of <c><anno>Filename</anno></c> can be set
- by a comment as described in <seealso
- marker="stdlib:epp#encoding">epp(3)</seealso>.</p>
+ <p>The encoding of <c><anno>Filename</anno></c> can be set
+ by a comment, as described in
+ <seealso marker="stdlib:epp#encoding"><c>stdlib:epp(3)</c></seealso>.</p>
</desc>
</func>
<func>
<name name="eval" arity="2"/>
- <fsummary>Evaluate Erlang expressions in a file</fsummary>
+ <fsummary>Evaluate Erlang expressions in a file.</fsummary>
<desc>
- <p>The same as <c>eval/1</c> but the variable bindings
- <c><anno>Bindings</anno></c> are used in the evaluation. See
- <seealso marker="stdlib:erl_eval">erl_eval(3)</seealso> about
- variable bindings.</p>
+ <p>The same as <c>eval/1</c>, but the variable bindings
+ <c><anno>Bindings</anno></c> are used in the evaluation. For information
+ about the variable bindings, see
+ <seealso marker="stdlib:erl_eval"><c>stdlib:erl_eval(3)</c></seealso>.</p>
</desc>
</func>
<func>
<name name="format_error" arity="1"/>
- <fsummary>Return a descriptive string for an error reason</fsummary>
+ <fsummary>Return a descriptive string for an error reason.</fsummary>
<desc>
<p>Given the error reason returned by any function in this
module, returns a descriptive string of the error in English.</p>
@@ -439,17 +469,17 @@
</func>
<func>
<name name="get_cwd" arity="0"/>
- <fsummary>Get the current working directory</fsummary>
+ <fsummary>Get the current working directory.</fsummary>
<desc>
<p>Returns <c>{ok, <anno>Dir</anno>}</c>, where <c><anno>Dir</anno></c>
is the current
working directory of the file server.</p>
<note>
<p>In rare circumstances, this function can fail on Unix.
- It may happen if read permission does not exist for
+ It can occur if read permission does not exist for
the parent directories of the current directory.</p>
</note>
- <p>Typical error reasons are:</p>
+ <p>A typical error reason:</p>
<taglist>
<tag><c>eacces</c></tag>
<item>
@@ -461,17 +491,19 @@
</func>
<func>
<name name="get_cwd" arity="1"/>
- <fsummary>Get the current working directory for the drive specified</fsummary>
+ <fsummary>Get the current working directory for the specified drive.</fsummary>
<desc>
- <p><c><anno>Drive</anno></c> should be of the form
- "<c>Letter</c><c>:</c>",
- for example "c:". Returns <c>{ok, <anno>Dir</anno>}</c> or
+ <p>Returns <c>{ok, <anno>Dir</anno>}</c> or
<c>{error, <anno>Reason</anno>}</c>, where <c><anno>Dir</anno></c>
- is the current
- working directory of the drive specified.</p>
- <p>This function returns <c>{error, enotsup}</c> on platforms
- which have no concept of current drive (Unix, for example).</p>
- <p>Typical error reasons are:</p>
+ is the current working directory of the specified drive.</p>
+
+ <p><c><anno>Drive</anno></c> is to be of the form
+ "<c>Letter</c><c>:</c>", for example, "c:".</p>
+
+ <p>Returns <c>{error, enotsup}</c> on platforms
+ that have no concept of current drive (Unix, for example).</p>
+
+ <p>Typical error reasons:</p>
<taglist>
<tag><c>enotsup</c></tag>
<item>
@@ -490,16 +522,16 @@
</func>
<func>
<name name="list_dir" arity="1"/>
- <fsummary>List files in a directory</fsummary>
+ <fsummary>List files in a directory.</fsummary>
<desc>
<p>Lists all files in a directory, <em>except</em> files
- with "raw" names. Returns
- <c>{ok, <anno>Filenames</anno>}</c> if successful.
- Otherwise, it returns <c>{error, <anno>Reason</anno>}</c>.
+ with raw filenames. Returns
+ <c>{ok, <anno>Filenames</anno>}</c> if successful,
+ otherwise <c>{error, <anno>Reason</anno>}</c>.
<c><anno>Filenames</anno></c> is a list of
the names of all the files in the directory. The names are
not sorted.</p>
- <p>Typical error reasons are:</p>
+ <p>Typical error reasons:</p>
<taglist>
<tag><c>eacces</c></tag>
<item>
@@ -513,24 +545,24 @@
<tag><c>{no_translation, <anno>Filename</anno>}</c></tag>
<item>
<p><c><anno>Filename</anno></c> is a <c>binary()</c> with
- characters coded in ISO-latin-1 and the VM was started
- with the parameter <c>+fnue</c>.</p>
+ characters coded in ISO Latin-1 and the VM was started
+ with parameter <c>+fnue</c>.</p>
</item>
</taglist>
</desc>
</func>
<func>
<name name="list_dir_all" arity="1"/>
- <fsummary>List all files in a directory</fsummary>
+ <fsummary>List all files in a directory.</fsummary>
<desc>
<p><marker id="list_dir_all"/>Lists all the files in a directory,
- including files with "raw" names.
- Returns <c>{ok, <anno>Filenames</anno>}</c> if successful.
- Otherwise, it returns <c>{error, <anno>Reason</anno>}</c>.
+ including files with raw filenames.
+ Returns <c>{ok, <anno>Filenames</anno>}</c> if successful,
+ otherwise <c>{error, <anno>Reason</anno>}</c>.
<c><anno>Filenames</anno></c> is a list of
the names of all the files in the directory. The names are
not sorted.</p>
- <p>Typical error reasons are:</p>
+ <p>Typical error reasons:</p>
<taglist>
<tag><c>eacces</c></tag>
<item>
@@ -546,12 +578,12 @@
</func>
<func>
<name name="make_dir" arity="1"/>
- <fsummary>Make a directory</fsummary>
+ <fsummary>Make a directory.</fsummary>
<desc>
- <p>Tries to create the directory <c><anno>Dir</anno></c>. Missing parent
+ <p>Tries to create directory <c><anno>Dir</anno></c>. Missing parent
directories are <em>not</em> created. Returns <c>ok</c> if
successful.</p>
- <p>Typical error reasons are:</p>
+ <p>Typical error reasons:</p>
<taglist>
<tag><c>eacces</c></tag>
<item>
@@ -560,7 +592,7 @@
</item>
<tag><c>eexist</c></tag>
<item>
- <p>There is already a file or directory named <c><anno>Dir</anno></c>.</p>
+ <p>A file or directory named <c><anno>Dir</anno></c> exists already.</p>
</item>
<tag><c>enoent</c></tag>
<item>
@@ -568,7 +600,7 @@
</item>
<tag><c>enospc</c></tag>
<item>
- <p>There is a no space left on the device.</p>
+ <p>No space is left on the device.</p>
</item>
<tag><c>enotdir</c></tag>
<item>
@@ -580,13 +612,13 @@
</func>
<func>
<name name="make_link" arity="2"/>
- <fsummary>Make a hard link to a file</fsummary>
+ <fsummary>Make a hard link to a file.</fsummary>
<desc>
<p>Makes a hard link from <c><anno>Existing</anno></c> to
- <c><anno>New</anno></c>, on
- platforms that support links (Unix and Windows). This function returns
- <c>ok</c> if the link was successfully created, or
- <c>{error, <anno>Reason</anno>}</c>. On platforms that do not support
+ <c><anno>New</anno></c> on
+ platforms supporting links (Unix and Windows). This function returns
+ <c>ok</c> if the link was successfully created, otherwise
+ <c>{error, <anno>Reason</anno>}</c>. On platforms not supporting
links, <c>{error,enotsup}</c> is returned.</p>
<p>Typical error reasons:</p>
<taglist>
@@ -609,17 +641,16 @@
</func>
<func>
<name name="make_symlink" arity="2"/>
- <fsummary>Make a symbolic link to a file or directory</fsummary>
+ <fsummary>Make a symbolic link to a file or directory.</fsummary>
<desc>
- <p>This function creates a symbolic link <c><anno>New</anno></c> to
- the file or directory <c><anno>Existing</anno></c>, on platforms that
- support symbolic links (most Unix systems and Windows beginning with
+ <p>Creates a symbolic link <c><anno>New</anno></c> to
+ the file or directory <c><anno>Existing</anno></c> on platforms
+ supporting symbolic links (most Unix systems and Windows, beginning with
Vista).
- <c><anno>Existing</anno></c> need not exist.
- This function returns <c>ok</c> if the link was
- successfully created, or <c>{error, <anno>Reason</anno>}</c>.
- On platforms
- that do not support symbolic links, <c>{error, enotsup}</c>
+ <c><anno>Existing</anno></c> does not need to exist.
+ Returns <c>ok</c> if the link is
+ successfully created, otherwise <c>{error, <anno>Reason</anno>}</c>.
+ On platforms not supporting symbolic links, <c>{error, enotsup}</c>
is returned.</p>
<p>Typical error reasons:</p>
<taglist>
@@ -646,23 +677,23 @@
</func>
<func>
<name name="native_name_encoding" arity="0"/>
- <fsummary>Return the VM's configured filename encoding</fsummary>
+ <fsummary>Return the configured filename encoding of the VM.</fsummary>
<desc>
- <p><marker id="native_name_encoding"/>This function returns
- the file name encoding mode. If it is <c>latin1</c>, the
- system does no translation of file names. If it is
- <c>utf8</c>, file names will be converted back and forth to
- the native file name encoding (usually UTF-8, but UTF-16 on
+ <p><marker id="native_name_encoding"/>Returns
+ the filename encoding mode. If it is <c>latin1</c>, the
+ system translates no filenames. If it is
+ <c>utf8</c>, filenames are converted back and forth to
+ the native filename encoding (usually UTF-8, but UTF-16 on
Windows).</p>
</desc>
</func>
<func>
<name name="open" arity="2"/>
- <fsummary>Open a file</fsummary>
+ <fsummary>Open a file.</fsummary>
<desc>
- <p>Opens the file <c><anno>File</anno></c> in the mode determined
- by <c><anno>Modes</anno></c>, which may contain one or more of the
- following items:</p>
+ <p>Opens file <c><anno>File</anno></c> in the mode determined
+ by <c><anno>Modes</anno></c>, which can contain one or more of the
+ following options:</p>
<taglist>
<tag><c>read</c></tag>
<item>
@@ -671,98 +702,100 @@
<tag><c>write</c></tag>
<item>
<p>The file is opened for writing. It is created if it does
- not exist. If the file exists, and if <c>write</c> is not
- combined with <c>read</c>, the file will be truncated.</p>
+ not exist. If the file exists and <c>write</c> is not
+ combined with <c>read</c>, the file is truncated.</p>
</item>
<tag><c>append</c></tag>
<item>
- <p>The file will be opened for writing, and it will be
- created if it does not exist. Every write operation to a
- file opened with <c>append</c> will take place at
- the end of the file.</p>
+ <p>The file is opened for writing. It is created if it does
+ not exist. Every write operation to a file opened with
+ <c>append</c> takes place at the end of the file.</p>
</item>
<tag><c>exclusive</c></tag>
<item>
- <p>The file, when opened for writing, is created if it
- does not exist. If the file exists, open will return
- <c>{error, eexist}</c>.</p>
+ <p>The file is opened for writing. It is created if it does
+ not exist. If the file exists, <c>{error, eexist}</c>
+ is returned.</p>
<warning><p>This option does not guarantee exclusiveness on
- file systems that do not support O_EXCL properly,
+ file systems not supporting <c>O_EXCL</c> properly,
such as NFS. Do not depend on this option unless you
know that the file system supports it (in general, local
- file systems should be safe).</p></warning>
+ file systems are safe).</p></warning>
</item>
<tag><c>raw</c></tag>
<item>
<p><marker id="raw"/>
- The <c>raw</c> option allows faster access to a file,
- because no Erlang process is needed to handle the file.
+ Allows faster access to a file,
+ as no Erlang process is needed to handle the file.
However, a file opened in this way has the following
limitations:</p>
<list type="bulleted">
- <item>The functions in the <c>io</c> module cannot be used,
- because they can only talk to an Erlang process.
- Instead, use the <c>read/2</c>, <c>read_line/1</c> and
- <c>write/2</c>
- functions.</item>
- <item>Especially if <c>read_line/1</c> is to be used on a <c>raw</c> file, it is recommended to combine this option with the <c>{read_ahead, Size}</c> option as line oriented I/O is inefficient without buffering.</item>
- <item>Only the Erlang process which opened the file can use
- it.</item>
- <item>A remote Erlang file server cannot be used;
- the computer on which the Erlang node is running must
+ <item><p>The functions in the <c>io</c> module cannot be used,
+ as they can only talk to an Erlang process.
+ Instead, use functions
+ <seealso marker="#read/2"><c>read/2</c></seealso>,
+ <seealso marker="#read_line/1"><c>read_line/1</c></seealso>, and
+ <seealso marker="#write/2"><c>write/2</c></seealso>.</p></item>
+ <item><p>Especially if <c>read_line/1</c> is to be used on a <c>raw</c>
+ file, it is recommended to combine this option with option
+ <c>{read_ahead, Size}</c> as line-oriented I/O is inefficient
+ without buffering.</p></item>
+ <item><p>Only the Erlang process that opened the file can use
+ it.</p></item>
+ <item><p>A remote Erlang file server cannot be used.
+ The computer on which the Erlang node is running must
have access to the file system (directly or through
- NFS).</item>
+ NFS).</p></item>
</list>
</item>
<tag><c>binary</c></tag>
<item>
- <p>When this option has been given, read operations on the file
- will return binaries rather than lists.</p>
+ <p>Read operations on the file return binaries rather than lists.</p>
</item>
<tag><c>{delayed_write, Size, Delay}</c></tag>
<item>
- <p>If this option is used, the data in subsequent
- <c>write/2</c> calls is buffered until there are at least
- <c>Size</c> bytes buffered, or until the oldest buffered
+ <p>Data in subsequent
+ <c>write/2</c> calls is buffered until at least
+ <c>Size</c> bytes are buffered, or until the oldest buffered
data is <c>Delay</c> milliseconds old. Then all buffered
data is written in one operating system call.
The buffered data is also flushed before some other file
operation than <c>write/2</c> is executed.</p>
<p>The purpose of this option is to increase performance
- by reducing the number of operating system calls, so the
- <c>write/2</c> calls should be for sizes significantly
- less than <c>Size</c>, and not interspersed by to many
- other file operations, for this to happen.</p>
+ by reducing the number of operating system calls. Thus, the
+ <c>write/2</c> calls must be for sizes significantly
+ less than <c>Size</c>, and not interspersed by too many
+ other file operations.</p>
<p>When this option is used, the result of <c>write/2</c>
- calls may prematurely be reported as successful, and if
- a write error should actually occur the error is
- reported as the result of the next file operation, which
- is not executed.</p>
+ calls can prematurely be reported as successful, and if
+ a write error occurs, the error is reported as the result
+ of the next file operation, which is not executed.</p>
<p>For example, when <c>delayed_write</c> is used, after a
- number of <c>write/2</c> calls, <c>close/1</c> might
- return <c>{error, enospc}</c> because there was not enough
- space on the disc for previously written data, and
- <c>close/1</c> should probably be called again since the
+ number of <c>write/2</c> calls, <c>close/1</c> can
+ return <c>{error, enospc}</c>, as there is not enough
+ space on the disc for previously written data.
+ <c>close/1</c> must probably be called again, as the
file is still open.</p>
</item>
<tag><c>delayed_write</c></tag>
<item>
<p>The same as <c>{delayed_write, Size, Delay}</c> with
reasonable default values for <c>Size</c> and
- <c>Delay</c>. (Roughly some 64 KBytes, 2 seconds)</p>
+ <c>Delay</c> (roughly some 64 KB, 2 seconds).</p>
</item>
<tag><c>{read_ahead, Size}</c></tag>
<item>
- <p>This option activates read data buffering. If
+ <p>Activates read data buffering. If
<c>read/2</c> calls are for significantly less than
- <c>Size</c> bytes, read operations towards the operating
+ <c>Size</c> bytes, read operations to the operating
system are still performed for blocks of <c>Size</c>
bytes. The extra data is buffered and returned in
subsequent <c>read/2</c> calls, giving a performance gain
- since the number of operating system calls is reduced.</p>
- <p>The <c>read_ahead</c> buffer is also highly utilized
- by the <c>read_line/1</c> function in <c>raw</c> mode,
- why this option is recommended (for performance reasons)
+ as the number of operating system calls is reduced.</p>
+ <p>The <c>read_ahead</c> buffer is also highly used
+ by function <c>read_line/1</c> in <c>raw</c> mode,
+ therefore this option is recommended
+ (for performance reasons)
when accessing raw files using that function.</p>
<p>If <c>read/2</c> calls are for sizes not significantly
less than, or even greater than <c>Size</c> bytes, no
@@ -771,93 +804,141 @@
<tag><c>read_ahead</c></tag>
<item>
<p>The same as <c>{read_ahead, Size}</c> with a reasonable
- default value for <c>Size</c>. (Roughly some 64 KBytes)</p>
+ default value for <c>Size</c> (roughly some 64 KB).</p>
</item>
<tag><c>compressed</c></tag>
<item>
<p>Makes it possible to read or write gzip compressed
- files. The <c>compressed</c> option must be combined
- with either <c>read</c> or <c>write</c>, but not both.
- Note that the file size obtained with
- <c>read_file_info/1</c> will most probably not match the
- number of bytes that can be read from a compressed file.</p>
+ files. Option <c>compressed</c> must be combined
+ with <c>read</c> or <c>write</c>, but not both.
+ Notice that the file size obtained with
+ <seealso marker="#read_file_info/1"><c>read_file_info/1</c></seealso>
+ does probably not match the number of bytes that can be
+ read from a compressed file.</p>
</item>
<tag><c>{encoding, Encoding}</c></tag>
<item>
- <p>Makes the file perform automatic translation of characters to and from a specific (Unicode) encoding. Note that the data supplied to file:write or returned by file:read still is byte oriented, this option only denotes how data is actually stored in the disk file.</p>
- <p>Depending on the encoding, different methods of reading and writing data is preferred. The default encoding of <c>latin1</c> implies using this (the file) module for reading and writing data, as the interfaces provided here work with byte-oriented data, while using other (Unicode) encodings makes the <seealso marker="stdlib:io">io(3)</seealso> module's <c>get_chars</c>, <c>get_line</c> and <c>put_chars</c> functions more suitable, as they can work with the full Unicode range.</p>
- <p>If data is sent to an <c>io_device()</c> in a format that cannot be converted to the specified encoding, or if data is read by a function that returns data in a format that cannot cope with the character range of the data, an error occurs and the file will be closed.</p>
- <p>The allowed values for <c>Encoding</c> are:</p>
+ <p>Makes the file perform automatic translation of characters to
+ and from a specific (Unicode) encoding. Notice that the data supplied
+ to
+ <seealso marker="#write/2"><c>write/2</c></seealso>
+ or returned by
+ <seealso marker="#read/2"><c>read/2</c></seealso>
+ still is byte-oriented; this option
+ denotes only how data is stored in the disk file.</p>
+ <p>Depending on the encoding, different methods of reading and writing
+ data is preferred. The default encoding of <c>latin1</c> implies using
+ this module (<c>file</c>) for reading and writing data as the interfaces
+ provided here work with byte-oriented data. Using other (Unicode)
+ encodings makes the
+ <seealso marker="stdlib:io"><c>stdlib:io(3)</c></seealso> functions
+ <c>get_chars</c>, <c>get_line</c>, and <c>put_chars</c> more suitable,
+ as they can work with the full Unicode range.</p>
+ <p>If data is sent to an <c>io_device()</c> in a format that cannot be
+ converted to the specified encoding, or if data is read by a function
+ that returns data in a format that cannot cope with the character range
+ of the data, an error occurs and the file is closed.</p>
+ <p>Allowed values for <c>Encoding</c>:</p>
<taglist>
<tag><c>latin1</c></tag>
<item>
- <p>The default encoding. Bytes supplied to i.e. file:write are written as is on the file, likewise bytes read from the file are returned to i.e. file:read as is. If the <seealso marker="stdlib:io">io(3)</seealso> module is used for writing, the file can only cope with Unicode characters up to codepoint 255 (the ISO-latin-1 range).</p>
+ <p>The default encoding. Bytes supplied to the file, that is,
+ <seealso marker="#write/2"><c>write/2</c></seealso>
+ are written "as is" on the file. Likewise, bytes read from the file,
+ that is,
+ <seealso marker="#read/2"><c>read/2</c></seealso> are
+ returned "as is". If module
+ <seealso marker="stdlib:io"><c>stdlib:io(3)</c></seealso> is used for
+ writing, the file can only cope with Unicode characters up to code point
+ 255 (the ISO Latin-1 range).</p>
</item>
- <tag><c>unicode</c> or <c>utf8</c></tag>
+ <tag><c>unicode or utf8</c></tag>
<item>
- <p>Characters are translated to and from the UTF-8 encoding before being written to or read from the file. A file opened in this way might be readable using the file:read function, as long as no data stored on the file lies beyond the ISO-latin-1 range (0..255), but failure will occur if the data contains Unicode codepoints beyond that range. The file is best read with the functions in the Unicode aware <seealso marker="stdlib:io">io(3)</seealso> module.</p>
- <p>Bytes written to the file by any means are translated to UTF-8 encoding before actually being stored on the disk file.</p>
+ <p>Characters are translated to and from UTF-8 encoding before they are
+ written to or read from the file. A file opened in this way can be
+ readable using function
+ <seealso marker="#read/2"><c>read/2</c></seealso>,
+ as long as no data stored on
+ the file lies beyond the ISO Latin-1 range (0..255), but failure occurs
+ if the data contains Unicode code points beyond that range. The file is
+ best read with the functions in the Unicode aware module
+ <seealso marker="stdlib:io"><c>stdlib:io(3)</c></seealso>.</p>
+ <p>Bytes written to the file by any means are translated to UTF-8 encoding
+ before being stored on the disk file.</p>
</item>
- <tag><c>utf16</c> or <c>{utf16,big}</c></tag>
+ <tag><c>utf16 or {utf16,big}</c></tag>
<item>
- <p>Works like <c>unicode</c>, but translation is done to and from big endian UTF-16 instead of UTF-8.</p>
+ <p>Works like <c>unicode</c>, but translation is done to and from big
+ endian UTF-16 instead of UTF-8.</p>
</item>
<tag><c>{utf16,little}</c></tag>
<item>
- <p>Works like <c>unicode</c>, but translation is done to and from little endian UTF-16 instead of UTF-8.</p>
+ <p>Works like <c>unicode</c>, but translation is done to and from little
+ endian UTF-16 instead of UTF-8.</p>
</item>
- <tag><c>utf32</c> or <c>{utf32,big}</c></tag>
+ <tag><c>utf32 or {utf32,big}</c></tag>
<item>
- <p>Works like <c>unicode</c>, but translation is done to and from big endian UTF-32 instead of UTF-8.</p>
+ <p>Works like <c>unicode</c>, but translation is done to and from big
+ endian UTF-32 instead of UTF-8.</p>
</item>
<tag><c>{utf32,little}</c></tag>
<item>
- <p>Works like <c>unicode</c>, but translation is done to and from little endian UTF-32 instead of UTF-8.</p>
+ <p>Works like <c>unicode</c>, but translation is done to and from little
+ endian UTF-32 instead of UTF-8.</p>
</item>
</taglist>
- <p>The Encoding can be changed for a file "on the fly" by using the <seealso marker="stdlib:io#setopts/2">io:setopts/2</seealso> function, why a file can be analyzed in latin1 encoding for i.e. a BOM, positioned beyond the BOM and then be set for the right encoding before further reading.See the <seealso marker="stdlib:unicode">unicode(3)</seealso> module for functions identifying BOM's.</p>
+ <p>The Encoding can be changed for a file "on the fly" by using function
+ <seealso marker="stdlib:io#setopts/2"><c>io:setopts/2</c></seealso>.
+ So a file can be analyzed in latin1 encoding for, for example, a BOM,
+ positioned beyond the BOM and then be set for the right encoding before
+ further reading. For functions identifying BOMs, see module
+ <seealso marker="stdlib:unicode"><c>stdlib:unicode(3)</c></seealso>. </p>
<p>This option is not allowed on <c>raw</c> files.</p>
</item>
<tag><c>ram</c></tag>
<item>
- <p><c>File</c> must be <c>iodata()</c>. Returns an <c>fd()</c> which lets the <c>file</c> module operate on the data in-memory as if it is a file.</p>
+ <p><c>File</c> must be <c>iodata()</c>. Returns an <c>fd()</c>, which lets
+ module <c>file</c> operate on the data in-memory as if it is a file.</p>
</item>
<tag><c>sync</c></tag>
<item>
- <p>On platforms that support it, enables the POSIX <c>O_SYNC</c> synchronous I/O flag or its platform-dependent
- equivalent (e.g., <c>FILE_FLAG_WRITE_THROUGH</c> on Windows) so that writes to the file block until the data has
- been physically written to disk. Be aware, though, that the exact semantics of this flag differ from platform to
- platform; for example, neither Linux nor Windows guarantees that all file metadata are also written before the call
- returns. For precise semantics, check the details of your platform's documentation. On platforms with no
- support for POSIX <c>O_SYNC</c> or equivalent, use of the <c>sync</c> flag causes <c>open</c> to return
- <c>{error, enotsup}</c>.</p>
+ <p>On platforms supporting it, enables the POSIX <c>O_SYNC</c> synchronous
+ I/O flag or its platform-dependent equivalent (for example,
+ <c>FILE_FLAG_WRITE_THROUGH</c> on Windows) so that writes to the file
+ block until the data is physically written to disk. However, be aware
+ that the exact semantics of this flag differ from platform to
+ platform. For example, none of Linux or Windows guarantees that all file
+ metadata are also written before the call returns. For precise semantics,
+ check the details of your platform documentation. On platforms with no
+ support for POSIX <c>O_SYNC</c> or equivalent, use of the <c>sync</c>
+ flag causes <c>open</c> to return <c>{error, enotsup}</c>.</p>
</item>
</taglist>
<p>Returns:</p>
<taglist>
<tag><c>{ok, <anno>IoDevice</anno>}</c></tag>
<item>
- <p>The file has been opened in the requested mode.
+ <p>The file is opened in the requested mode.
<c><anno>IoDevice</anno></c> is a reference to the file.</p>
</item>
<tag><c>{error, <anno>Reason</anno>}</c></tag>
<item>
- <p>The file could not be opened.</p>
+ <p>The file cannot be opened.</p>
</item>
</taglist>
- <p><c><anno>IoDevice</anno></c> is really the pid of the process which
+ <p><c><anno>IoDevice</anno></c> is really the pid of the process that
handles the file. This process is linked to the process
- which originally opened the file. If any process to which
- the <c><anno>IoDevice</anno></c> is linked terminates, the file will
- be closed and the process itself will be terminated.
+ that originally opened the file. If any process to which
+ the <c><anno>IoDevice</anno></c> is linked terminates, the file is
+ closed and the process itself is terminated.
An <c><anno>IoDevice</anno></c> returned from this call can be used
- as an argument to the IO functions (see
- <seealso marker="stdlib:io">io(3)</seealso>).</p>
+ as an argument to the I/O functions (see
+ <seealso marker="stdlib:io"><c>stdlib:io(3)</c></seealso>).</p>
<note>
- <p>In previous versions of <c>file</c>, modes were given
+ <p>In previous versions of <c>file</c>, modes were specified
as one of the atoms <c>read</c>, <c>write</c>, or
<c>read_write</c> instead of a list. This is still allowed
- for reasons of backwards compatibility, but should not be
+ for reasons of backwards compatibility, but is not to be
used for new code. Also note that <c>read_write</c> is not
allowed in a mode list.</p>
</note>
@@ -874,17 +955,17 @@
</item>
<tag><c>eisdir</c></tag>
<item>
- <p>The named file is not a regular file. It may be a
- directory, a fifo, or a device.</p>
+ <p>The named file is not a regular file. It can be a
+ directory, a FIFO, or a device.</p>
</item>
<tag><c>enotdir</c></tag>
<item>
- <p>A component of the file name is not a directory. On some
+ <p>A component of the filename is not a directory. On some
platforms, <c>enoent</c> is returned instead.</p>
</item>
<tag><c>enospc</c></tag>
<item>
- <p>There is a no space left on the device (if <c>write</c>
+ <p>There is no space left on the device (if <c>write</c>
access was specified).</p>
</item>
</taglist>
@@ -892,182 +973,186 @@
</func>
<func>
<name name="path_consult" arity="2"/>
- <fsummary>Read Erlang terms from a file</fsummary>
+ <fsummary>Read Erlang terms from a file.</fsummary>
<desc>
<p>Searches the path <c><anno>Path</anno></c> (a list of directory
names) until the file <c><anno>Filename</anno></c> is found.
If <c><anno>Filename</anno></c>
is an absolute filename, <c><anno>Path</anno></c> is ignored.
- Then reads Erlang terms, separated by '.', from the file.
- Returns one of the following:</p>
+ Then reads Erlang terms, separated by '.', from the file.</p>
+ <p>Returns one of the following:</p>
<taglist>
<tag><c>{ok, <anno>Terms</anno>, <anno>FullName</anno>}</c></tag>
<item>
- <p>The file was successfully read. <c><anno>FullName</anno></c> is
+ <p>The file is successfully read. <c><anno>FullName</anno></c> is
the full name of the file.</p>
</item>
<tag><c>{error, enoent}</c></tag>
<item>
- <p>The file could not be found in any of the directories in
+ <p>The file cannot be found in any of the directories in
<c><anno>Path</anno></c>.</p>
</item>
<tag><c>{error, atom()}</c></tag>
<item>
<p>An error occurred when opening the file or reading it.
- See <seealso marker="#open/2">open/2</seealso> for a list
- of typical error codes.</p>
+ For a list of typical error codes, see
+ <seealso marker="#open/2"><c>open/2</c></seealso>.</p>
</item>
<tag><c>{error, {<anno>Line</anno>, <anno>Mod</anno>,
<anno>Term</anno>}}</c></tag>
<item>
<p>An error occurred when interpreting the Erlang terms in
- the file. Use <c>format_error/1</c> to convert
- the three-element tuple to an English description of
+ the file. Use
+ <seealso marker="#format_error/1"><c>format_error/1</c></seealso>
+ to convert the three-element tuple to an English description of
the error.</p>
</item>
</taglist>
- <p>The encoding of of <c><anno>Filename</anno></c> can be set
- by a comment as described in <seealso
- marker="stdlib:epp#encoding">epp(3)</seealso>.</p>
+ <p>The encoding of <c><anno>Filename</anno></c> can be set
+ by a comment as described in
+ <seealso marker="stdlib:epp#encoding"><c>epp(3)</c></seealso>.</p>
</desc>
</func>
<func>
<name name="path_eval" arity="2"/>
- <fsummary>Evaluate Erlang expressions in a file</fsummary>
+ <fsummary>Evaluate Erlang expressions in a file.</fsummary>
<desc>
<p>Searches the path <c><anno>Path</anno></c> (a list of directory
names) until the file <c><anno>Filename</anno></c> is found.
- If <c><anno>Filename</anno></c> is an absolute file name,
+ If <c><anno>Filename</anno></c> is an absolute filename,
<c><anno>Path</anno></c> is ignored. Then reads
and evaluates Erlang expressions, separated by '.' (or ',', a
sequence of expressions is also an expression), from the file.
- The actual result of evaluation is not returned; any
+ The result of evaluation is not returned; any
expression sequence in the file must be there for its side
- effect. Returns one of the following:</p>
+ effect.</p>
+ <p>Returns one of the following:</p>
<taglist>
<tag><c>{ok, <anno>FullName</anno>}</c></tag>
<item>
- <p>The file was read and evaluated. <c><anno>FullName</anno></c> is
+ <p>The file is read and evaluated. <c><anno>FullName</anno></c> is
the full name of the file.</p>
</item>
<tag><c>{error, enoent}</c></tag>
<item>
- <p>The file could not be found in any of the directories in
+ <p>The file cannot be found in any of the directories in
<c><anno>Path</anno></c>.</p>
</item>
<tag><c>{error, atom()}</c></tag>
<item>
<p>An error occurred when opening the file or reading it.
- See <seealso marker="#open/2">open/2</seealso> for a list
- of typical error codes.</p>
+ For a list of typical error codes, see
+ <seealso marker="#open/2"><c>open/2</c></seealso>.</p>
</item>
<tag><c>{error, {<anno>Line</anno>, <anno>Mod</anno>,
<anno>Term</anno>}}</c></tag>
<item>
<p>An error occurred when interpreting the Erlang
- expressions in the file. Use <c>format_error/1</c> to
- convert the three-element tuple to an English description
+ expressions in the file. Use
+ <seealso marker="#format_error/1"><c>format_error/1</c></seealso>
+ to convert the three-element tuple to an English description
of the error.</p>
</item>
</taglist>
- <p>The encoding of of <c><anno>Filename</anno></c> can be set
- by a comment as described in <seealso
- marker="stdlib:epp#encoding">epp(3)</seealso>.</p>
+ <p>The encoding of <c><anno>Filename</anno></c> can be set
+ by a comment as described in
+ <seealso marker="stdlib:epp#encoding"><c>stdlib:epp(3)</c></seealso>.</p>
</desc>
</func>
<func>
<name name="path_open" arity="3"/>
- <fsummary>Open a file</fsummary>
+ <fsummary>Open a file.</fsummary>
<desc>
<p>Searches the path <c><anno>Path</anno></c> (a list of directory
names) until the file <c><anno>Filename</anno></c> is found.
If <c><anno>Filename</anno></c>
- is an absolute file name, <c><anno>Path</anno></c> is ignored.
- Then opens the file in the mode determined by <c><anno>Modes</anno></c>.
- Returns one of the following:</p>
+ is an absolute filename, <c><anno>Path</anno></c> is ignored.
+ Then opens the file in the mode determined by <c><anno>Modes</anno></c>.</p>
+ <p>Returns one of the following:</p>
<taglist>
<tag><c>{ok, <anno>IoDevice</anno>, <anno>FullName</anno>}</c></tag>
<item>
- <p>The file has been opened in the requested mode.
+ <p>The file is opened in the requested mode.
<c><anno>IoDevice</anno></c> is a reference to the file and
<c><anno>FullName</anno></c> is the full name of the file.</p>
</item>
<tag><c>{error, enoent}</c></tag>
<item>
- <p>The file could not be found in any of the directories in
+ <p>The file cannot be found in any of the directories in
<c><anno>Path</anno></c>.</p>
</item>
<tag><c>{error, atom()}</c></tag>
<item>
- <p>The file could not be opened.</p>
+ <p>The file cannot be opened.</p>
</item>
</taglist>
</desc>
</func>
<func>
<name name="path_script" arity="2"/>
- <fsummary>Evaluate and return the value of Erlang expressions in a file</fsummary>
+ <fsummary>Evaluate and return the value of Erlang expressions in a file.</fsummary>
<desc>
<p>Searches the path <c><anno>Path</anno></c> (a list of directory
names) until the file <c><anno>Filename</anno></c> is found.
- If <c><anno>Filename</anno></c> is an absolute file name,
+ If <c><anno>Filename</anno></c> is an absolute filename,
<c><anno>Path</anno></c> is ignored. Then reads
and evaluates Erlang expressions, separated by '.' (or ',', a
- sequence of expressions is also an expression), from the file.
- Returns one of the following:</p>
+ sequence of expressions is also an expression), from the file.</p>
+ <p>Returns one of the following:</p>
<taglist>
<tag><c>{ok, <anno>Value</anno>, <anno>FullName</anno>}</c></tag>
<item>
- <p>The file was read and evaluated. <c><anno>FullName</anno></c> is
+ <p>The file is read and evaluated. <c><anno>FullName</anno></c> is
the full name of the file and <c><anno>Value</anno></c> the value of
the last expression.</p>
</item>
<tag><c>{error, enoent}</c></tag>
<item>
- <p>The file could not be found in any of the directories in
+ <p>The file cannot be found in any of the directories in
<c><anno>Path</anno></c>.</p>
</item>
<tag><c>{error, atom()}</c></tag>
<item>
<p>An error occurred when opening the file or reading it.
- See <seealso marker="#open/2">open/2</seealso> for a list
- of typical error codes.</p>
+ For a list of typical error codes, see
+ <seealso marker="#open/2"><c>open/2</c></seealso>.</p>
</item>
<tag><c>{error, {<anno>Line</anno>, <anno>Mod</anno>,
<anno>Term</anno>}}</c></tag>
<item>
<p>An error occurred when interpreting the Erlang
- expressions in the file. Use <c>format_error/1</c> to
- convert the three-element tuple to an English description
+ expressions in the file. Use
+ <seealso marker="#format_error/1"><c>format_error/1</c></seealso>
+ to convert the three-element tuple to an English description
of the error.</p>
</item>
</taglist>
- <p>The encoding of of <c><anno>Filename</anno></c> can be set
- by a comment as described in <seealso
- marker="stdlib:epp#encoding">epp(3)</seealso>.</p>
+ <p>The encoding of <c><anno>Filename</anno></c> can be set
+ by a comment as described in
+ <seealso marker="stdlib:epp#encoding"><c>stdlib:epp(3)</c></seealso>.</p>
</desc>
</func>
<func>
<name name="path_script" arity="3"/>
- <fsummary>Evaluate and return the value of Erlang expressions in a file</fsummary>
+ <fsummary>Evaluate and return the value of Erlang expressions in a file.</fsummary>
<desc>
<p>The same as <c>path_script/2</c> but the variable bindings
<c><anno>Bindings</anno></c> are used in the evaluation. See
- <seealso marker="stdlib:erl_eval">erl_eval(3)</seealso> about
+ <seealso marker="stdlib:erl_eval"><c>erl_eval(3)</c></seealso> about
variable bindings.</p>
</desc>
</func>
<func>
<name name="pid2name" arity="1"/>
- <fsummary>Return the name of the file handled by a pid</fsummary>
+ <fsummary>Return the name of the file handled by a pid.</fsummary>
<desc>
- <p>If <c><anno>Pid</anno></c> is an IO device, that is, a pid returned from
+ <p>If <c><anno>Pid</anno></c> is an I/O device, that is, a pid returned from
<c>open/2</c>, this function returns the filename, or rather:</p>
<taglist>
<tag><c>{ok, <anno>Filename</anno>}</c></tag>
<item>
- <p>If this node's file server is not a slave, the file was
- opened by this node's file server, (this implies that
+ <p>If the file server of this node is not a slave, the file was
+ opened by the file server of this node (this implies that
<c><anno>Pid</anno></c> must be a local pid) and the file is not
closed. <c><anno>Filename</anno></c> is the filename in flat string
format.</p>
@@ -1084,13 +1169,12 @@
</func>
<func>
<name name="position" arity="2"/>
- <fsummary>Set position in a file</fsummary>
+ <fsummary>Set position in a file.</fsummary>
<desc>
<p>Sets the position of the file referenced by <c><anno>IoDevice</anno></c>
- to <c><anno>Location</anno></c>. Returns
- <c>{ok, <anno>NewPosition</anno>}</c> (as
- absolute offset) if successful, otherwise
- <c>{error, <anno>Reason</anno>}</c>. <c><anno>Location</anno></c> is
+ to <c><anno>Location</anno></c>. Returns <c>{ok, <anno>NewPosition</anno>}</c>
+ (as absolute offset) if successful, otherwise
+ <c>{error, <anno>Reason</anno>}</c>. <c><anno>Location</anno></c> is
one of the following:</p>
<taglist>
<tag><c>Offset</c></tag>
@@ -1114,14 +1198,21 @@
<p>The same as above with <c>Offset</c> 0.</p>
</item>
</taglist>
- <p>Note that offsets are counted in bytes, not in characters. If the file is opened using some other <c>encoding</c> than <c>latin1</c>, one byte does not correspond to one character. Positioning in such a file can only be done to known character boundaries, i.e. to a position earlier retrieved by getting a current position, to the beginning/end of the file or to some other position <em>known</em> to be on a correct character boundary by some other means (typically beyond a byte order mark in the file, which has a known byte-size).</p>
- <p>Typical error reasons are:</p>
+ <p>Notice that offsets are counted in bytes, not in characters. If the file
+ is opened using some other <c>encoding</c> than <c>latin1</c>, one byte
+ does not correspond to one character. Positioning in such a file can only
+ be done to known character boundaries. That is, to a position earlier retrieved
+ by getting a current position, to the beginning/end of the file or to some
+ other position <em>known</em> to be on a correct character boundary by some
+ other means (typically beyond a byte order mark in the file, which has a
+ known byte-size).</p>
+ <p>A typical error reason is:</p>
<taglist>
<tag><c>einval</c></tag>
<item>
- <p>Either <c><anno>Location</anno></c> was illegal, or it
+ <p>Either <c><anno>Location</anno></c> is illegal, or it is
evaluated to a
- negative offset in the file. Note that if the resulting
+ negative offset in the file. Notice that if the resulting
position is a negative value, the result is an error, and
after the call the file position is undefined.</p>
</item>
@@ -1130,7 +1221,7 @@
</func>
<func>
<name name="pread" arity="2"/>
- <fsummary>Read from a file at certain positions</fsummary>
+ <fsummary>Read from a file at certain positions.</fsummary>
<desc>
<p>Performs a sequence of <c>pread/3</c> in one operation,
which is more efficient than calling them one at a time.
@@ -1139,70 +1230,94 @@
where each <c><anno>Data</anno></c>, the result of the corresponding
<c>pread</c>, is either a list or a binary depending on
the mode of the file, or <c>eof</c> if the requested position
- was beyond end of file.</p>
- <p>As the position is given as a byte-offset, special caution has to be taken when working with files where <c>encoding</c> is set to something else than <c>latin1</c>, as not every byte position will be a valid character boundary on such a file.</p>
+ is beyond end of file.</p>
+ <p>As the position is specified as a byte-offset, take special caution
+ when working with files where <c>encoding</c> is set to something else
+ than <c>latin1</c>, as not every byte position is a valid character
+ boundary on such a file.</p>
</desc>
</func>
<func>
<name name="pread" arity="3"/>
- <fsummary>Read from a file at a certain position</fsummary>
+ <fsummary>Read from a file at a certain position.</fsummary>
<desc>
<p>Combines <c>position/2</c> and <c>read/2</c> in one
operation, which is more efficient than calling them one at a
- time. If <c><anno>IoDevice</anno></c> has been opened in raw mode,
- some restrictions apply: <c><anno>Location</anno></c> is only allowed
- to be an
- integer; and the current position of the file is undefined
- after the operation.</p>
- <p>As the position is given as a byte-offset, special caution has to be taken when working with files where <c>encoding</c> is set to something else than <c>latin1</c>, as not every byte position will be a valid character boundary on such a file.</p>
+ time. If <c><anno>IoDevice</anno></c> is opened in <c>raw</c> mode,
+ some restrictions apply:</p>
+ <list type="bulleted">
+ <item><c><anno>Location</anno></c> is only allowed to be an
+ integer.</item>
+ <item>The current position of the file is undefined after the
+ operation.</item>
+ </list>
+ <p>As the position is specified as a byte-offset, take special caution
+ when working with files where <c>encoding</c> is set to something else
+ than <c>latin1</c>, as not every byte position is a valid character
+ boundary on such a file.</p>
</desc>
</func>
<func>
<name name="pwrite" arity="2"/>
- <fsummary>Write to a file at certain positions</fsummary>
+ <fsummary>Write to a file at certain positions.</fsummary>
<desc>
<p>Performs a sequence of <c>pwrite/3</c> in one operation,
which is more efficient than calling them one at a time.
Returns <c>ok</c> or <c>{error, {<anno>N</anno>,
<anno>Reason</anno>}}</c>, where
- <c><anno>N</anno></c> is the number of successful writes that was done
+ <c><anno>N</anno></c> is the number of successful writes done
before the failure.</p>
- <p>When positioning in a file with other <c>encoding</c> than <c>latin1</c>, caution must be taken to set the position on a correct character boundary, see <seealso marker="#position/2">position/2</seealso> for details.</p>
+ <p>When positioning in a file with other <c>encoding</c> than <c>latin1</c>,
+ caution must be taken to set the position on a correct character boundary.
+ For details, see <seealso marker="#position/2"><c>position/2</c></seealso>.</p>
</desc>
</func>
<func>
<name name="pwrite" arity="3"/>
- <fsummary>Write to a file at a certain position</fsummary>
+ <fsummary>Write to a file at a certain position.</fsummary>
<desc>
<p>Combines <c>position/2</c> and <c>write/2</c> in one
operation, which is more efficient than calling them one at a
- time. If <c><anno>IoDevice</anno></c> has been opened in raw mode,
- some restrictions apply: <c><anno>Location</anno></c> is only allowed
- to be an
- integer; and the current position of the file is undefined
- after the operation.</p>
- <p>When positioning in a file with other <c>encoding</c> than <c>latin1</c>, caution must be taken to set the position on a correct character boundary, see <seealso marker="#position/2">position/2</seealso> for details.</p>
+ time. If <c><anno>IoDevice</anno></c> has been opened in <c>raw</c> mode,
+ some restrictions apply:</p>
+ <list type="bulleted">
+ <item><c><anno>Location</anno></c> is only allowed to be an
+ integer.</item>
+ <item>The current position of the file is undefined after the
+ operation.</item>
+ </list>
+ <p>When positioning in a file with other <c>encoding</c> than <c>latin1</c>,
+ caution must be taken to set the position on a correct character boundary.
+ For details, see <seealso marker="#position/2"><c>position/2</c></seealso>.</p>
</desc>
</func>
<func>
<name name="read" arity="2"/>
- <fsummary>Read from a file</fsummary>
+ <fsummary>Read from a file.</fsummary>
<desc>
<p>Reads <c><anno>Number</anno></c> bytes/characters from the file
referenced by <c><anno>IoDevice</anno></c>. The functions
- <c>read/2</c>, <c>pread/3</c>
- and <c>read_line/1</c> are the only ways to read from a file
- opened in raw mode (although they work for normally opened
- files, too).</p>
- <p>For files where <c>encoding</c> is set to something else than <c>latin1</c>, one character might be represented by more than one byte on the file. The parameter <c>Number</c> always denotes the number of <em>characters</em> read from the file, while the position in the file might be moved much more than this number when reading a Unicode file.</p>
- <p>Also, if <c>encoding</c> is set to something else than <c>latin1</c>, the <c>read/3</c> call will fail if the data contains characters larger than 255, which is why the <seealso marker="stdlib:io">io(3)</seealso> module is to be preferred when reading such a file.</p>
+ <seealso marker="#read/2"><c>read/2</c></seealso>,
+ <seealso marker="#pread/3"><c>pread/3</c></seealso>, and
+ <seealso marker="#read_line/1"><c>read_line/1</c></seealso>
+ are the only ways to read from a file opened in <c>raw</c> mode
+ (although they work for normally opened files, too).</p>
+ <p>For files where <c>encoding</c> is set to something else than <c>latin1</c>,
+ one character can be represented by more than one byte on the file.
+ The parameter <c>Number</c> always denotes the number of <em>characters</em>
+ read from the file, while the position in the file can be moved much more than
+ this number when reading a Unicode file.</p>
+ <p>Also, if <c>encoding</c> is set to something else than <c>latin1</c>,
+ the <c>read/3</c> call fails if the data contains characters larger than 255,
+ which is why module <seealso marker="stdlib:io"><c>io(3)</c></seealso>
+ is to be preferred when reading such a file.</p>
<p>The function returns:</p>
<taglist>
<tag><c>{ok, <anno>Data</anno>}</c></tag>
<item>
<p>If the file was opened in binary mode, the read bytes are
returned in a binary, otherwise in a list. The list or
- binary will be shorter than the number of bytes requested
+ binary is shorter than the number of bytes requested
if end of file was reached.</p>
</item>
<tag><c>eof</c></tag>
@@ -1223,14 +1338,16 @@
</item>
<tag><c>{no_translation, unicode, latin1}</c></tag>
<item>
- <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>
+ <p>The file is opened with another <c>encoding</c> than <c>latin1</c> and
+ the data in the file cannot be translated to the byte-oriented data that
+ this function returns.</p>
</item>
</taglist>
</desc>
</func>
<func>
<name name="read_file" arity="1"/>
- <fsummary>Read a file</fsummary>
+ <fsummary>Read a file.</fsummary>
<desc>
<p>Returns <c>{ok, <anno>Binary</anno>}</c>, where
<c><anno>Binary</anno></c> is a binary
@@ -1254,7 +1371,7 @@
</item>
<tag><c>enotdir</c></tag>
<item>
- <p>A component of the file name is not a directory. On some
+ <p>A component of the filename is not a directory. On some
platforms, <c>enoent</c> is returned instead.</p>
</item>
<tag><c>enomem</c></tag>
@@ -1267,34 +1384,38 @@
<func>
<name name="read_file_info" arity="1"/>
<name name="read_file_info" arity="2"/>
- <fsummary>Get information about a file</fsummary>
+ <fsummary>Retrieve information about a file.</fsummary>
<desc>
<p>Retrieves information about a file. Returns
<c>{ok, <anno>FileInfo</anno>}</c> if successful, otherwise
<c>{error, <anno>Reason</anno>}</c>. <c><anno>FileInfo</anno></c>
is a record
- <c>file_info</c>, defined in the Kernel include file
+ <c>file_info</c>, defined in the <c>Kernel</c> include file
<c>file.hrl</c>. Include the following directive in the module
from which the function is called:</p>
<code type="none">
--include_lib("kernel/include/file.hrl").</code>
- <p>The time type returned in <c>atime</c>, <c>mtime</c> and <c>ctime</c>
- is dependent on the time type set in <c>Opts :: {time, Type}</c>.
- Type <c>local</c> will return local time, <c>universal</c> will
- return universal time and <c>posix</c> will return seconds since
- or before unix time epoch which is 1970-01-01 00:00 UTC.
- Default is <c>{time, local}</c>.
- </p>
- <p>If the <c>raw</c> option is set, the file server will not be called
- and only informations about local files will be returned.</p>
- <note>
- <p>
- Since file times is stored in posix time on most OS it is
- faster to query file information with the <c>posix</c> option.
- </p>
- </note>
+ -include_lib("kernel/include/file.hrl").</code>
+ <p>The time type returned in <c>atime</c>, <c>mtime</c>, and <c>ctime</c>
+ is dependent on the time type set in <c>Opts :: {time, Type}</c> as
+ follows:</p>
+ <taglist>
+ <tag><c>local</c></tag>
+ <item><p>Returns local time.</p></item>
+ <tag><c>universal</c></tag>
+ <item><p>Returns universal time.</p></item>
+ <tag><c>posix</c></tag>
+ <item><p>Returns seconds since or before Unix time epoch,
+ which is 1970-01-01 00:00 UTC.</p></item>
+ </taglist>
+ <p>Default is <c>{time, local}</c>.</p>
+ <p>If the option <c>raw</c> is set, the file server is not called
+ and only information about local files is returned.</p>
+ <note>
+ <p>As file times are stored in POSIX time on most OS, it is faster to
+ query file information with option <c>posix</c>.</p>
+ </note>
- <p>The record <c>file_info</c> contains the following fields.</p>
+ <p>The record <c>file_info</c> contains the following fields:</p>
<taglist>
<tag><c>size = integer() >= 0</c></tag>
<item>
@@ -1308,19 +1429,25 @@
<item>
<p>The current system access to the file.</p>
</item>
- <tag><c>atime = </c><seealso marker="#type-date_time">date_time()</seealso><c> | integer() >= 0</c></tag>
+ <tag><c>atime = </c>
+ <seealso marker="#type-date_time"><c>date_time()</c></seealso><c> |
+ integer() >= 0</c></tag>
<item>
<p>The last time the file was read.</p>
</item>
- <tag><c>mtime = </c><seealso marker="#type-date_time">date_time()</seealso><c> | integer() >= 0</c></tag>
+ <tag><c>mtime = </c>
+ <seealso marker="#type-date_time"><c>date_time()</c></seealso><c> |
+ integer() >= 0</c></tag>
<item>
<p>The last time the file was written.</p>
</item>
- <tag><c>ctime = </c><seealso marker="#type-date_time">date_time()</seealso><c> | integer() >=0</c></tag>
+ <tag><c>ctime = </c>
+ <seealso marker="#type-date_time"><c>date_time()</c></seealso><c> |
+ integer() >=0</c></tag>
<item>
<p>The interpretation of this time field depends on
the operating system. On Unix, it is the last time
- the file or the inode was changed. In Windows, it is
+ the file or the <c>inode</c> was changed. In Windows, it is
the create time.</p>
</item>
<tag><c>mode = integer() >= 0</c></tag>
@@ -1328,36 +1455,36 @@
<p>The file permissions as the sum of the following bit
values:</p>
<taglist>
- <tag>8#00400</tag>
- <item>read permission: owner</item>
- <tag>8#00200</tag>
- <item>write permission: owner</item>
- <tag>8#00100</tag>
- <item>execute permission: owner</item>
- <tag>8#00040</tag>
- <item>read permission: group</item>
- <tag>8#00020</tag>
- <item>write permission: group</item>
- <tag>8#00010</tag>
- <item>execute permission: group</item>
- <tag>8#00004</tag>
- <item>read permission: other</item>
- <tag>8#00002</tag>
- <item>write permission: other</item>
- <tag>8#00001</tag>
- <item>execute permission: other</item>
- <tag>16#800</tag>
- <item>set user id on execution</item>
- <tag>16#400</tag>
- <item>set group id on execution</item>
+ <tag><c>8#00400</c></tag>
+ <item><p>read permission: owner</p></item>
+ <tag><c>8#00200</c></tag>
+ <item><p>write permission: owner</p></item>
+ <tag><c>8#00100</c></tag>
+ <item><p>execute permission: owner</p></item>
+ <tag><c>8#00040</c></tag>
+ <item><p>read permission: group</p></item>
+ <tag><c>8#00020</c></tag>
+ <item><p>write permission: group</p></item>
+ <tag><c>8#00010</c></tag>
+ <item><p>execute permission: group</p></item>
+ <tag><c>8#00004</c></tag>
+ <item><p>read permission: other</p></item>
+ <tag><c>8#00002</c></tag>
+ <item><p>write permission: other</p></item>
+ <tag><c>8#00001</c></tag>
+ <item><p>execute permission: other</p></item>
+ <tag><c>16#800</c></tag>
+ <item><p>set user id on execution</p></item>
+ <tag><c>16#400</c></tag>
+ <item><p>set group id on execution</p></item>
</taglist>
- <p>On Unix platforms, other bits than those listed above
- may be set.</p>
+ <p>On Unix platforms, the following bits
+ can also be set:</p>
</item>
<tag><c>links = integer() >= 0</c></tag>
<item>
- <p>Number of links to the file (this will always be 1 for
- file systems which have no concept of links).</p>
+ <p>Number of links to the file (this is always 1 for
+ file systems that have no concept of links).</p>
</item>
<tag><c>major_device = integer() >= 0</c></tag>
<item>
@@ -1373,17 +1500,17 @@
<tag><c>inode = integer() >= 0</c></tag>
<item>
<p>Gives the <c>inode</c> number. On non-Unix file systems,
- this field will be zero.</p>
+ this field is zero.</p>
</item>
<tag><c>uid = integer() >= 0</c></tag>
<item>
- <p>Indicates the owner of the file. Will be zero for
- non-Unix file systems.</p>
+ <p>Indicates the owner of the file. On non-Unix file systems,
+ this field is zero.</p>
</item>
<tag><c>gid = integer() >= 0</c></tag>
<item>
<p>Gives the group that the owner of the file belongs to.
- Will be zero for non-Unix file systems.</p>
+ On non-Unix file systems, this field is zero.</p>
</item>
</taglist>
<p>Typical error reasons:</p>
@@ -1399,7 +1526,7 @@
</item>
<tag><c>enotdir</c></tag>
<item>
- <p>A component of the file name is not a directory. On some
+ <p>A component of the filename is not a directory. On some
platforms, <c>enoent</c> is returned instead.</p>
</item>
</taglist>
@@ -1407,18 +1534,34 @@
</func>
<func>
<name name="read_line" arity="1"/>
- <fsummary>Read a line from a file</fsummary>
+ <fsummary>Read a line from a file.</fsummary>
<desc>
<p>Reads a line of bytes/characters from the file referenced by
- <c><anno>IoDevice</anno></c>. Lines are defined to be delimited by the linefeed (LF, <c>\n</c>) character, but any carriage return (CR, <c>\r</c>) followed by a newline is also treated as a single LF character (the carriage return is silently ignored). The line is returned <em>including</em> the LF, but excluding any CR immediately followed by a LF. This behaviour is consistent with the behaviour of <seealso marker="stdlib:io#get_line/2">io:get_line/2</seealso>. If end of file is reached without any LF ending the last line, a line with no trailing LF is returned.</p>
- <p>The function can be used on files opened in <c>raw</c> mode. It is however inefficient to use it on <c>raw</c> files if the file is not opened with the option <c>{read_ahead, Size}</c> specified, why combining <c>raw</c> and <c>{read_ahead, Size}</c> is highly recommended when opening a text file for raw line oriented reading.</p>
- <p>If <c>encoding</c> is set to something else than <c>latin1</c>, the <c>read_line/1</c> call will fail if the data contains characters larger than 255, why the <seealso marker="stdlib:io">io(3)</seealso> module is to be preferred when reading such a file.</p>
+ <c><anno>IoDevice</anno></c>. Lines are defined to be delimited by the
+ linefeed (LF, <c>\n</c>) character, but any carriage return (CR, <c>\r</c>)
+ followed by a newline is also treated as a single LF character (the carriage
+ return is silently ignored). The line is returned <em>including</em> the LF,
+ but excluding any CR immediately followed by an LF. This behaviour is
+ consistent with the behaviour of
+ <seealso marker="stdlib:io#get_line/2"><c>io:get_line/2</c></seealso>.
+ If end of file is reached without any LF ending the last line, a line with no
+ trailing LF is returned.</p>
+ <p>The function can be used on files opened in <c>raw</c> mode. However, it is
+ inefficient to use it on <c>raw</c> files if the file is not opened with
+ option <c>{read_ahead, Size}</c> specified. Thus, combining <c>raw</c> and
+ <c>{read_ahead, Size}</c> is highly recommended when opening a text file for
+ raw line-oriented reading.</p>
+ <p>If <c>encoding</c> is set to something else than <c>latin1</c>, the
+ <c>read_line/1</c> call fails if the data contains characters larger than 255,
+ why module <seealso marker="stdlib:io"><c>stdlib:io(3)</c></seealso> is to be
+ preferred when reading such a file.</p>
<p>The function returns:</p>
<taglist>
<tag><c>{ok, <anno>Data</anno>}</c></tag>
<item>
- <p>One line from the file is returned, including the trailing LF, but with CRLF sequences replaced by a single LF (see above).</p>
- <p>If the file was opened in binary mode, the read bytes are
+ <p>One line from the file is returned, including the trailing LF,
+ but with CRLF sequences replaced by a single LF (see above).</p>
+ <p>If the file is opened in binary mode, the read bytes are
returned in a binary, otherwise in a list.</p>
</item>
<tag><c>eof</c></tag>
@@ -1439,22 +1582,24 @@
</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 is opened with another <c>encoding</c> than <c>latin1</c> and
+ the data on the file cannot be translated to the byte-oriented data that
+ this function returns.</p>
</item>
</taglist>
</desc>
</func>
<func>
<name name="read_link" arity="1"/>
- <fsummary>See what a link is pointing to</fsummary>
+ <fsummary>See what a link is pointing to.</fsummary>
<desc>
- <p><marker id="read_link_all"/>This function returns
+ <p><marker id="read_link_all"/>Returns
<c>{ok, <anno>Filename</anno>}</c> if
<c><anno>Name</anno></c> refers to a symbolic link that is
- not a "raw" file name, or <c>{error, <anno>Reason</anno>}</c>
+ not a raw filename, or <c>{error, <anno>Reason</anno>}</c>
otherwise.
On platforms that do not support symbolic links, the return
- value will be <c>{error,enotsup}</c>.</p>
+ value is <c>{error,enotsup}</c>.</p>
<p>Typical error reasons:</p>
<taglist>
<tag><c>einval</c></tag>
@@ -1476,14 +1621,14 @@
</func>
<func>
<name name="read_link_all" arity="1"/>
- <fsummary>See what a link is pointing to</fsummary>
+ <fsummary>See what a link is pointing to.</fsummary>
<desc>
- <p>This function returns <c>{ok, <anno>Filename</anno>}</c> if
+ <p>Returns <c>{ok, <anno>Filename</anno>}</c> if
<c><anno>Name</anno></c> refers to a symbolic link or
<c>{error, <anno>Reason</anno>}</c> otherwise.
On platforms that do not support symbolic links, the return
- value will be <c>{error,enotsup}</c>.</p>
- <p>Note that <c><anno>Filename</anno></c> can be either a list
+ value is <c>{error,enotsup}</c>.</p>
+ <p>Notice that <c><anno>Filename</anno></c> can be either a list
or a binary.</p>
<p>Typical error reasons:</p>
<taglist>
@@ -1505,31 +1650,30 @@
<func>
<name name="read_link_info" arity="1"/>
<name name="read_link_info" arity="2"/>
- <fsummary>Get information about a link or file</fsummary>
+ <fsummary>Retrieve information about a link or file.</fsummary>
<desc>
- <p>This function works like
- <seealso marker="#read_file_info/2">read_file_info/1,2</seealso> except that
- if <c><anno>Name</anno></c> is a symbolic link, information about
- the link will be returned in the <c>file_info</c> record and
- the <c>type</c> field of the record will be set to
- <c>symlink</c>.</p>
- <p>If the <c>raw</c> option is set, the file server will not be called
- and only informations about local files will be returned.</p>
+ <p>Works like
+ <seealso marker="#read_file_info/2"><c>read_file_info/1,2</c></seealso>
+ except that if <c><anno>Name</anno></c> is a symbolic link, information
+ about the link is returned in the <c>file_info</c> record and
+ the <c>type</c> field of the record is set to <c>symlink</c>.</p>
+ <p>If the option <c>raw</c> is set, the file server is not called
+ and only information about local files is returned.</p>
<p>If <c><anno>Name</anno></c> is not a symbolic link, this function returns
- exactly the same result as <c>read_file_info/1</c>.
+ the same result as <c>read_file_info/1</c>.
On platforms that do not support symbolic links, this function
is always equivalent to <c>read_file_info/1</c>.</p>
</desc>
</func>
<func>
<name name="rename" arity="2"/>
- <fsummary>Rename a file</fsummary>
+ <fsummary>Rename a file.</fsummary>
<desc>
<p>Tries to rename the file <c><anno>Source</anno></c> to
<c><anno>Destination</anno></c>.
It can be used to move files (and directories) between
directories, but it is not sufficient to specify
- the destination only. The destination file name must also be
+ the destination only. The destination filename must also be
specified. For example, if <c>bar</c> is a normal file and
<c>foo</c> and <c>baz</c> are directories,
<c>rename("foo/bar", "baz")</c> returns an error, but
@@ -1560,7 +1704,7 @@
<item>
<p><c><anno>Source</anno></c> is a root directory, or
<c><anno>Destination</anno></c>
- is a sub-directory of <c><anno>Source</anno></c>.</p>
+ is a subdirectory of <c><anno>Source</anno></c>.</p>
</item>
<tag><c>eisdir</c></tag>
<item>
@@ -1586,58 +1730,105 @@
</func>
<func>
<name name="script" arity="1"/>
- <fsummary>Evaluate and return the value of Erlang expressions in a file</fsummary>
+ <fsummary>Evaluate and return the value of Erlang expressions in a file.</fsummary>
<desc>
<p>Reads and evaluates Erlang expressions, separated by '.' (or
',', a sequence of expressions is also an expression), from
- the file. Returns one of the following:</p>
+ the file.</p>
+ <p>Returns one of the following:</p>
<taglist>
<tag><c>{ok, <anno>Value</anno>}</c></tag>
<item>
- <p>The file was read and evaluated. <c><anno>Value</anno></c> is
+ <p>The file is read and evaluated. <c><anno>Value</anno></c> is
the value of the last expression.</p>
</item>
<tag><c>{error, atom()}</c></tag>
<item>
<p>An error occurred when opening the file or reading it.
- See <seealso marker="#open/2">open/2</seealso> for a list
- of typical error codes.</p>
+ For a list of typical error codes, see
+ <seealso marker="#open/2"><c>open/2</c></seealso>.</p>
</item>
<tag><c>{error, {<anno>Line</anno>, <anno>Mod</anno>,
<anno>Term</anno>}}</c></tag>
<item>
<p>An error occurred when interpreting the Erlang
- expressions in the file. Use <c>format_error/1</c> to
- convert the three-element tuple to an English description
+ expressions in the file. Use
+ <seealso marker="#format_error/1"><c>format_error/1</c></seealso>
+ to convert the three-element tuple to an English description
of the error.</p>
</item>
</taglist>
- <p>The encoding of of <c><anno>Filename</anno></c> can be set
- by a comment as described in <seealso
- marker="stdlib:epp#encoding">epp(3)</seealso>.</p>
+ <p>The encoding of <c><anno>Filename</anno></c> can be set
+ by a comment as described in
+ <seealso marker="stdlib:epp#encoding"><c>epp(3)</c></seealso>.</p>
</desc>
</func>
<func>
<name name="script" arity="2"/>
- <fsummary>Evaluate and return the value of Erlang expressions in a file</fsummary>
+ <fsummary>Evaluate and return the value of Erlang expressions in a file.</fsummary>
<desc>
<p>The same as <c>script/1</c> but the variable bindings
<c><anno>Bindings</anno></c> are used in the evaluation. See
- <seealso marker="stdlib:erl_eval">erl_eval(3)</seealso> about
+ <seealso marker="stdlib:erl_eval"><c>erl_eval(3)</c></seealso> about
variable bindings.</p>
</desc>
</func>
<func>
+ <name name="sendfile" arity="2"/>
+ <fsummary>Send a file to a socket.</fsummary>
+ <desc>
+ <p>Sends the file <c>Filename</c> to <c>Socket</c>.
+ Returns <c>{ok, BytesSent}</c> if successful,
+ otherwise <c>{error, Reason}</c>.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="sendfile" arity="5"/>
+ <fsummary>Send a file to a socket.</fsummary>
+ <type name="sendfile_option"/>
+ <desc>
+ <p>Sends <c>Bytes</c> from the file
+ referenced by <c>RawFile</c> beginning at <c>Offset</c> to
+ <c>Socket</c>.
+ Returns <c>{ok, BytesSent}</c> if successful,
+ otherwise <c>{error, Reason}</c>. If <c>Bytes</c> is set to
+ <c>0</c> all data after the specified <c>Offset</c> is sent.</p>
+ <p>The file used must be opened using the <c>raw</c> flag, and the process
+ calling <c>sendfile</c> must be the controlling process of the socket.
+ See <seealso marker="gen_tcp#controlling_process-2"><c>gen_tcp:controlling_process/2</c></seealso>.</p>
+ <p>If the OS used does not support <c>sendfile</c>, an Erlang fallback
+ using
+ <seealso marker="#read/2"><c>read/2</c></seealso> and
+ <seealso marker="gen_tcp#send/2"><c>gen_tcp:send/2</c></seealso> is used.</p>
+ <p>The option list can contain the following options:</p>
+ <taglist>
+ <tag><c>chunk_size</c></tag>
+ <item><p>The chunk size used by the Erlang fallback to send
+ data. If using the fallback, set this to a value
+ that comfortably fits in the systems memory. Default is 20 MB.</p></item>
+ <tag><c>use_threads</c></tag>
+ <item><p>Instructs the emulator to use the <c>async</c> thread pool for the
+ <c>sendfile</c> system call. This can be useful if the OS you are running
+ on does not properly support non-blocking <c>sendfile</c> calls. Notice that
+ using <c>async</c> threads potentially makes your system vulnerable to slow
+ client attacks. If set to <c>true</c> and no <c>async</c> threads are available,
+ the <c>sendfile</c> call returns <c>{error,einval}</c>.
+ Introduced in Erlang/OTP 17.0. Default is <c>false</c>.</p></item>
+ </taglist>
+ </desc>
+ </func>
+ <func>
<name name="set_cwd" arity="1"/>
- <fsummary>Set the current working directory</fsummary>
+ <fsummary>Set the current working directory.</fsummary>
<desc>
<p>Sets the current working directory of the file server to
<c><anno>Dir</anno></c>. Returns <c>ok</c> if successful.</p>
- <p>The functions in the <c>file</c> module usually treat binaries
- as raw filenames, i.e. they are passed as is even when the encoding
- of the binary does not agree with <c>file:native_name_encoding()</c>.
- This function however expects binaries to be encoded according to the
- value returned by <c>file:native_name_encoding()</c>.</p>
+ <p>The functions in the module <c>file</c> usually treat binaries
+ as raw filenames, that is, they are passed "as is" even when the
+ encoding of the binary does not agree with
+ <seealso marker="#native_name_encoding"><c>native_name_encoding()</c></seealso>.
+ However, this function expects binaries to be encoded according to the
+ value returned by <c>native_name_encoding()</c>.</p>
<p>Typical error reasons are:</p>
<taglist>
<tag><c>enoent</c></tag>
@@ -1656,31 +1847,31 @@
</item>
<tag><c>badarg</c></tag>
<item>
- <p><c><anno>Dir</anno></c> had an improper type,
+ <p><c><anno>Dir</anno></c> has an improper type,
such as tuple.</p>
</item>
<tag><c>no_translation</c></tag>
<item>
<p><c><anno>Dir</anno></c> is a <c>binary()</c> with
characters coded in ISO-latin-1 and the VM is operating
- with unicode file name encoding.</p>
+ with unicode filename encoding.</p>
</item>
</taglist>
<warning>
- <p>In a future release, a bad type for the
+ <p>In a future release, a bad type for argument
<c><anno>Dir</anno></c>
- argument will probably generate an exception.</p>
+ will probably generate an exception.</p>
</warning>
</desc>
</func>
<func>
<name name="sync" arity="1"/>
- <fsummary>Synchronizes the in-memory state of a file with that on the physical medium</fsummary>
+ <fsummary>Synchronize the in-memory state of a file with that on the physical medium.</fsummary>
<desc>
- <p>Makes sure that any buffers kept by the operating system
+ <p>Ensures that any buffers kept by the operating system
(not by the Erlang runtime system) are written to disk. On
some platforms, this function might have no effect.</p>
- <p>Typical error reasons are:</p>
+ <p>A typical error reason is:</p>
<taglist>
<tag><c>enospc</c></tag>
<item>
@@ -1690,90 +1881,28 @@
</desc>
</func>
<func>
- <name name="datasync" arity="1"/>
- <fsummary>Synchronizes the in-memory data of a file, ignoring most of its metadata, with that on the physical medium</fsummary>
- <desc>
- <p>Makes sure that any buffers kept by the operating system
- (not by the Erlang runtime system) are written to disk. In
- many ways it resembles fsync but it does not update
- some of the file's metadata such as the access time. On
- some platforms this function has no effect.</p>
- <p>Applications that access databases or log files often write
- a tiny data fragment (e.g., one line in a log file) and then
- call fsync() immediately in order to ensure that the written
- data is physically stored on the harddisk. Unfortunately, fsync()
- will always initiate two write operations: one for the newly
- written data and another one in order to update the modification
- time stored in the inode. If the modification time is not a part
- of the transaction concept, fdatasync() can be used to avoid
- unnecessary inode disk write operations.</p>
- <p>Available only in some POSIX systems, this call results in a
- call to fsync(), or has no effect in systems not implementing
- the fdatasync() syscall.</p>
- </desc>
- </func>
- <func>
<name name="truncate" arity="1"/>
- <fsummary>Truncate a file</fsummary>
+ <fsummary>Truncate a file.</fsummary>
<desc>
<p>Truncates the file referenced by <c><anno>IoDevice</anno></c> at
- the current position. Returns <c>ok</c> if successful,
+ the current position. Returns <c>ok</c> if successful,
otherwise <c>{error, <anno>Reason</anno>}</c>.</p>
</desc>
</func>
<func>
- <name name="sendfile" arity="2"/>
- <fsummary>send a file to a socket</fsummary>
- <desc>
- <p>Sends the file <c>Filename</c> to <c>Socket</c>.
- Returns <c>{ok, BytesSent}</c> if successful,
- otherwise <c>{error, Reason}</c>.</p>
- </desc>
- </func>
- <func>
- <name name="sendfile" arity="5"/>
- <fsummary>send a file to a socket</fsummary>
- <type name="sendfile_option"/>
- <desc>
- <p>Sends <c>Bytes</c> from the file
- referenced by <c>RawFile</c> beginning at <c>Offset</c> to
- <c>Socket</c>.
- Returns <c>{ok, BytesSent}</c> if successful,
- otherwise <c>{error, Reason}</c>. If <c>Bytes</c> is set to
- 0 all data after the given <c>Offset</c> is sent.</p>
- <p>The file used must be opened using the raw flag, and the process
- calling sendfile must be the controlling process of the socket.
- See <seealso marker="gen_tcp#controlling_process-2">gen_tcp:controlling_process/2</seealso></p>
- <p>If the OS used does not support sendfile, an Erlang fallback
- using file:read and gen_tcp:send is used.</p>
- <p>The option list can contain the following options:</p>
- <taglist>
- <tag><c>chunk_size</c></tag>
- <item>The chunk size used by the erlang fallback to send
- data. If using the fallback, this should be set to a value
- which comfortably fits in the systems memory. Default is 20 MB.</item>
- <tag><c>use_threads</c></tag>
- <item>Instruct the emulator to use the async thread pool for the
- sendfile system call. This could be usefull if the OS you are running
- on does not properly support non-blocking sendfile calls. Do note that
- using async threads potentially makes your system volnerable to slow
- client attacks. If set to true and no async threads are available,
- the sendfile call will return <c>{error,einval}</c>.
- Introduced in Erlang/OTP 17.0. Default is false.</item>
- </taglist>
- </desc>
- </func>
- <func>
<name name="write" arity="2"/>
- <fsummary>Write to a file</fsummary>
+ <fsummary>Write to a file.</fsummary>
<desc>
<p>Writes <c><anno>Bytes</anno></c> to the file referenced by
<c><anno>IoDevice</anno></c>. This function is the only way to write to a
- file opened in raw mode (although it works for normally
- opened files, too). Returns <c>ok</c> if successful, and
+ file opened in <c>raw</c> mode (although it works for normally opened
+ files too). Returns <c>ok</c> if successful, and
<c>{error, <anno>Reason</anno>}</c> otherwise.</p>
- <p>If the file is opened with <c>encoding</c> set to something else than <c>latin1</c>, each byte written might result in several bytes actually being written to the file, as the byte range 0..255 might represent anything between one and four bytes depending on value and UTF encoding type.</p>
- <p>Typical error reasons are:</p>
+ <p>If the file is opened with <c>encoding</c> set to something else than
+ <c>latin1</c>, each byte written can result in many bytes being written to
+ the file, as the byte range 0..255 can represent anything between one and
+ four bytes depending on value and UTF encoding type.</p>
+ <p>Typical error reasons:</p>
<taglist>
<tag><c>ebadf</c></tag>
<item>
@@ -1781,34 +1910,35 @@
</item>
<tag><c>enospc</c></tag>
<item>
- <p>There is a no space left on the device.</p>
+ <p>No space is left on the device.</p>
</item>
</taglist>
</desc>
</func>
<func>
<name name="write_file" arity="2"/>
- <fsummary>Write a file</fsummary>
+ <fsummary>Write a file.</fsummary>
<desc>
- <p>Writes the contents of the iodata term <c><anno>Bytes</anno></c>
- to the file <c><anno>Filename</anno></c>.
- The file is created if it does not
- exist. If it exists, the previous contents are
- overwritten. Returns <c>ok</c>, or <c>{error, <anno>Reason</anno>}</c>.</p>
- <p>Typical error reasons are:</p>
+ <p>Writes the contents of the <c>iodata</c> term <c><anno>Bytes</anno></c>
+ to file <c><anno>Filename</anno></c>.
+ The file is created if it does not exist.
+ If it exists, the previous contents are overwritten.
+ Returns <c>ok</c> if successful, otherwise
+ <c>{error, <anno>Reason</anno>}</c>.</p>
+ <p>Typical error reasons:</p>
<taglist>
<tag><c>enoent</c></tag>
<item>
- <p>A component of the file name does not exist.</p>
+ <p>A component of the filename does not exist.</p>
</item>
<tag><c>enotdir</c></tag>
<item>
- <p>A component of the file name is not a directory. On some
+ <p>A component of the filename is not a directory. On some
platforms, <c>enoent</c> is returned instead.</p>
</item>
<tag><c>enospc</c></tag>
<item>
- <p>There is a no space left on the device.</p>
+ <p>No space is left on the device.</p>
</item>
<tag><c>eacces</c></tag>
<item>
@@ -1824,51 +1954,64 @@
</func>
<func>
<name name="write_file" arity="3"/>
- <fsummary>Write a file</fsummary>
+ <fsummary>Write a file.</fsummary>
<desc>
<p>Same as <c>write_file/2</c>, but takes a third argument
<c><anno>Modes</anno></c>, a list of possible modes, see
- <seealso marker="#open/2">open/2</seealso>. The mode flags
- <c>binary</c> and <c>write</c> are implicit, so they should
- not be used.</p>
+ <seealso marker="#open/2"><c>open/2</c></seealso>. The mode flags
+ <c>binary</c> and <c>write</c> are implicit, so they are
+ not to be used.</p>
</desc>
</func>
<func>
<name name="write_file_info" arity="2"/>
<name name="write_file_info" arity="3"/>
- <fsummary>Change information about a file</fsummary>
+ <fsummary>Change file information.</fsummary>
<desc>
- <p>Change file information. Returns <c>ok</c> if successful,
+ <p>Changes file information. Returns <c>ok</c> if successful,
otherwise <c>{error, <anno>Reason</anno>}</c>.
<c><anno>FileInfo</anno></c> is a record
- <c>file_info</c>, defined in the Kernel include file
+ <c>file_info</c>, defined in the <c>Kernel</c> include file
<c>file.hrl</c>. Include the following directive in the module
from which the function is called:</p>
<code type="none">
--include_lib("kernel/include/file.hrl").</code>
- <p>The time type set in <c>atime</c>, <c>mtime</c> and <c>ctime</c>
- is dependent on the time type set in <c>Opts :: {time, Type}</c>.
- Type <c>local</c> will interpret the time set as local, <c>universal</c> will
- interpret it as universal time and <c>posix</c> must be seconds since
- or before unix time epoch which is 1970-01-01 00:00 UTC.
- Default is <c>{time, local}</c>.</p>
- <p>If the <c>raw</c> option is set, the file server will not be called
- and only informations about local files will be returned.</p>
+ -include_lib("kernel/include/file.hrl").</code>
+ <p>The time type set in <c>atime</c>, <c>mtime</c>, and <c>ctime</c>
+ depends on the time type set in <c>Opts :: {time, Type}</c> as
+ follows:</p>
+ <taglist>
+ <tag><c>local</c></tag>
+ <item><p>Interprets the time set as local.</p></item>
+ <tag><c>universal</c></tag>
+ <item><p>Interprets it as universal time.</p></item>
+ <tag><c>posix</c></tag>
+ <item><p>Must be seconds since or before Unix time epoch,
+ which is 1970-01-01 00:00 UTC.</p></item>
+ </taglist>
+ <p>Default is <c>{time, local}</c>.</p>
+ <p>If the option <c>raw</c> is set, the file server is not called
+ and only information about local files is returned.</p>
<p>The following fields are used from the record, if they are
- given.</p>
+ specified:</p>
<taglist>
- <tag><c>atime = </c><seealso marker="#type-date_time">date_time()</seealso><c> | integer() >= 0</c></tag>
+ <tag><c>atime = </c>
+ <seealso marker="#type-date_time"><c>date_time()</c></seealso><c> |
+ integer() >= 0</c></tag>
<item>
<p>The last time the file was read.</p>
</item>
- <tag><c>mtime = </c><seealso marker="#type-date_time">date_time()</seealso><c> | integer() >= 0</c></tag>
+ <tag><c>mtime = </c>
+ <seealso marker="#type-date_time"><c>date_time()</c></seealso><c> |
+ integer() >= 0</c></tag>
<item>
<p>The last time the file was written.</p>
</item>
- <tag><c>ctime = </c><seealso marker="#type-date_time">date_time()</seealso><c> | integer() >= 0</c></tag>
+ <tag><c>ctime = </c>
+ <seealso marker="#type-date_time"><c>date_time()</c></seealso><c> |
+ integer() >= 0</c></tag>
<item>
- <p>On Unix, any value give for this field will be ignored
- (the "ctime" for the file will be set to the current
+ <p>On Unix, any value specified for this field is ignored
+ (the "ctime" for the file is set to the current
time). On Windows, this field is the new creation time to
set for the file.</p>
</item>
@@ -1877,40 +2020,40 @@
<p>The file permissions as the sum of the following bit
values:</p>
<taglist>
- <tag>8#00400</tag>
- <item>read permission: owner</item>
- <tag>8#00200</tag>
- <item>write permission: owner</item>
- <tag>8#00100</tag>
- <item>execute permission: owner</item>
- <tag>8#00040</tag>
- <item>read permission: group</item>
- <tag>8#00020</tag>
- <item>write permission: group</item>
- <tag>8#00010</tag>
- <item>execute permission: group</item>
- <tag>8#00004</tag>
- <item>read permission: other</item>
- <tag>8#00002</tag>
- <item>write permission: other</item>
- <tag>8#00001</tag>
- <item>execute permission: other</item>
- <tag>16#800</tag>
- <item>set user id on execution</item>
- <tag>16#400</tag>
- <item>set group id on execution</item>
+ <tag><c>8#00400</c></tag>
+ <item><p>Read permission: owner</p></item>
+ <tag><c>8#00200</c></tag>
+ <item><p>Write permission: owner</p></item>
+ <tag><c>8#00100</c></tag>
+ <item><p>Execute permission: owner</p></item>
+ <tag><c>8#00040</c></tag>
+ <item><p>Read permission: group</p></item>
+ <tag><c>8#00020</c></tag>
+ <item><p>Write permission: group</p></item>
+ <tag><c>8#00010</c></tag>
+ <item><p>Execute permission: group</p></item>
+ <tag><c>8#00004</c></tag>
+ <item><p>Read permission: other</p></item>
+ <tag><c>8#00002</c></tag>
+ <item><p>Write permission: other</p></item>
+ <tag><c>8#00001</c></tag>
+ <item><p>Execute permission: other</p></item>
+ <tag><c>16#800</c></tag>
+ <item><p>Set user id on execution</p></item>
+ <tag><c>16#400</c></tag>
+ <item><p>Set group id on execution</p></item>
</taglist>
- <p>On Unix platforms, other bits than those listed above
- may be set.</p>
+ <p>On Unix platforms, the following bits
+ can also be set.</p>
</item>
<tag><c>uid = integer() >= 0</c></tag>
<item>
- <p>Indicates the owner of the file. Ignored for non-Unix
+ <p>Indicates the file owner. Ignored for non-Unix
file systems.</p>
</item>
<tag><c>gid = integer() >= 0</c></tag>
<item>
- <p>Gives the group that the owner of the file belongs to.
+ <p>Gives the group that the file owner belongs to.
Ignored for non-Unix file systems.</p>
</item>
</taglist>
@@ -1927,7 +2070,7 @@
</item>
<tag><c>enotdir</c></tag>
<item>
- <p>A component of the file name is not a directory. On some
+ <p>A component of the filename is not a directory. On some
platforms, <c>enoent</c> is returned instead.</p>
</item>
</taglist>
@@ -1938,77 +2081,82 @@
<section>
<title>POSIX Error Codes</title>
<list type="bulleted">
- <item><c>eacces</c> - permission denied</item>
- <item><c>eagain</c> - resource temporarily unavailable</item>
- <item><c>ebadf</c> - bad file number</item>
- <item><c>ebusy</c> - file busy</item>
- <item><c>edquot</c> - disk quota exceeded</item>
- <item><c>eexist</c> - file already exists</item>
- <item><c>efault</c> - bad address in system call argument</item>
- <item><c>efbig</c> - file too large</item>
- <item><c>eintr</c> - interrupted system call</item>
- <item><c>einval</c> - invalid argument</item>
- <item><c>eio</c> - IO error</item>
- <item><c>eisdir</c> - illegal operation on a directory</item>
- <item><c>eloop</c> - too many levels of symbolic links</item>
- <item><c>emfile</c> - too many open files</item>
- <item><c>emlink</c> - too many links</item>
- <item><c>enametoolong</c> - file name too long</item>
- <item><c>enfile</c> - file table overflow</item>
- <item><c>enodev</c> - no such device</item>
- <item><c>enoent</c> - no such file or directory</item>
- <item><c>enomem</c> - not enough memory</item>
- <item><c>enospc</c> - no space left on device</item>
- <item><c>enotblk</c> - block device required</item>
- <item><c>enotdir</c> - not a directory</item>
- <item><c>enotsup</c> - operation not supported</item>
- <item><c>enxio</c> - no such device or address</item>
- <item><c>eperm</c> - not owner</item>
- <item><c>epipe</c> - broken pipe</item>
- <item><c>erofs</c> - read-only file system</item>
- <item><c>espipe</c> - invalid seek</item>
- <item><c>esrch</c> - no such process</item>
- <item><c>estale</c> - stale remote file handle</item>
- <item><c>exdev</c> - cross-domain link</item>
+ <item><c>eacces</c> - Permission denied</item>
+ <item><c>eagain</c> - Resource temporarily unavailable</item>
+ <item><c>ebadf</c> - Bad file number</item>
+ <item><c>ebusy</c> - File busy</item>
+ <item><c>edquot</c> - Disk quota exceeded</item>
+ <item><c>eexist</c> - File already exists</item>
+ <item><c>efault</c> - Bad address in system call argument</item>
+ <item><c>efbig</c> - File too large</item>
+ <item><c>eintr</c> - Interrupted system call</item>
+ <item><c>einval</c> - Invalid argument</item>
+ <item><c>eio</c> - I/O error</item>
+ <item><c>eisdir</c> - Illegal operation on a directory</item>
+ <item><c>eloop</c> - Too many levels of symbolic links</item>
+ <item><c>emfile</c> - Too many open files</item>
+ <item><c>emlink</c> - Too many links</item>
+ <item><c>enametoolong</c> - Filename too long</item>
+ <item><c>enfile</c> - File table overflow</item>
+ <item><c>enodev</c> - No such device</item>
+ <item><c>enoent</c> - No such file or directory</item>
+ <item><c>enomem</c> - Not enough memory</item>
+ <item><c>enospc</c> - No space left on device</item>
+ <item><c>enotblk</c> - Block device required</item>
+ <item><c>enotdir</c> - Not a directory</item>
+ <item><c>enotsup</c> - Operation not supported</item>
+ <item><c>enxio</c> - No such device or address</item>
+ <item><c>eperm</c> - Not owner</item>
+ <item><c>epipe</c> - Broken pipe</item>
+ <item><c>erofs</c> - Read-only file system</item>
+ <item><c>espipe</c> - Invalid seek</item>
+ <item><c>esrch</c> - No such process</item>
+ <item><c>estale</c> - Stale remote file handle</item>
+ <item><c>exdev</c> - Cross-domain link</item>
</list>
</section>
<section>
<title>Performance</title>
- <p>Some operating system file operations, for example a
- <c>sync/1</c> or <c>close/1</c> on a huge file, may block their
- calling thread for seconds. If this befalls the emulator main
+ <p>Some operating system file operations, for example, a
+ <c>sync/1</c> or <c>close/1</c> on a huge file, can block their
+ calling thread for seconds. If this affects the emulator main
thread, the response time is no longer in the order of
milliseconds, depending on the definition of "soft" in soft
real-time system.</p>
<p>If the device driver thread pool is active, file operations are
done through those threads instead, so the emulator can go on
executing Erlang processes. Unfortunately, the time for serving a
- file operation increases due to the extra scheduling required
+ file operation increases because of the extra scheduling required
from the operating system.</p>
<p>If the device driver thread pool is disabled or of size 0, large
- file reads and writes are segmented into several smaller, which
- enables the emulator so server other processes during the file
- operation. This gives the same effect as when using the thread
+ file reads and writes are segmented into many smaller, which
+ enable the emulator to serve other processes during the file
+ operation. This has the same effect as when using the thread
pool, but with larger overhead. Other file operations, for
- example <c>sync/1</c> or <c>close/1</c> on a huge file, still are
+ example, <c>sync/1</c> or <c>close/1</c> on a huge file, still are
a problem.</p>
<p>For increased performance, raw files are recommended. Raw files
- uses the file system of the node's host machine. For normal files
- (non-raw), the file server is used to find the files, and if
- the node is running its file server as slave to another node's,
- and the other node runs on some other host machine, they may have
- different file systems. This is seldom a problem, but you have
- now been warned.</p>
- <p>A normal file is really a process so it can be used as an IO
- device (see <c>io</c>). Therefore when data is written to a
+ use the file system of the host machine of the node.</p>
+ <note>
+ <p>
+ For normal files (non-raw), the file server is used to find the files,
+ and if the node is running its file server as slave to the file server
+ of another node, and the other node runs on some other host machine,
+ they can have different file systems.
+ However, this is seldom a problem.</p>
+ </note>
+ <p>A normal file is really a process so it can be used as an I/O
+ device (see
+ <seealso marker="stdlib:io"><c>io</c></seealso>).
+ Therefore, when data is written to a
normal file, the sending of the data to the file process, copies
all data that are not binaries. Opening the file in binary mode
and writing binaries is therefore recommended. If the file is
opened on another node, or if the file server runs as slave to
- another node's, also binaries are copied.</p>
+ the file server of another node, also binaries are copied.</p>
<p>Caching data to reduce the number of file operations, or rather
- the number of calls to the file driver, will generally increase
+ the number of calls to the file driver, generally increases
performance. The following function writes 4 MBytes in 23
seconds when tested:</p>
<code type="none"><![CDATA[
@@ -2023,10 +2171,12 @@ create_file_slow(FD, M, M) ->
create_file_slow(FD, M, N) ->
ok = file:write(FD, <<M:32/unsigned>>),
create_file_slow(FD, M+1, N).]]></code>
+
<p>The following, functionally equivalent, function collects 1024
entries into a list of 128 32-byte binaries before each call to
- <c>file:write/2</c> and so does the same work in 0.52 seconds,
- which is 44 times faster.</p>
+ <seealso marker="#write/2"><c>write/2</c></seealso> and so
+ does the same work in 0.52 seconds,
+ which is 44 times faster:</p>
<code type="none"><![CDATA[
create_file(Name, N) when integer(N), N >= 0 ->
{ok, FD} = file:open(Name, [raw, write, delayed_write, binary]),
@@ -2055,61 +2205,62 @@ create_file(FD, M, N0, R) when M + 8 =&lt; N0 ->
create_file(FD, M, N0, R) ->
N1 = N0-1,
create_file(FD, M, N1, [<<N1:32/unsigned>> | R]).]]></code>
+
<note>
<p>Trust only your own benchmarks. If the list length in
- <c>create_file/2</c> above is increased, it will run slightly
- faster, but consume more memory and cause more memory
+ <c>create_file/2</c> above is increased, it runs slightly
+ faster, but consumes more memory and causes more memory
fragmentation. How much this affects your application is
- something that this simple benchmark can not predict.</p>
- <p>If the size of each binary is increased to 64 bytes, it will
- also run slightly faster, but the code will be twice as clumsy.
- In the current implementation are binaries larger than 64 bytes
+ something that this simple benchmark cannot predict.</p>
+ <p>If the size of each binary is increased to 64 bytes, it
+ also runs slightly faster, but the code is then twice as clumsy.
+ In the current implementation, binaries larger than 64 bytes are
stored in memory common to all processes and not copied when
sent between processes, while these smaller binaries are stored
on the process heap and copied when sent like any other term.</p>
- <p>So, with a binary size of 68 bytes <c>create_file/2</c> runs
- 30 percent slower then with 64 bytes, and will cause much more
- memory fragmentation. Note that if the binaries were to be sent
- between processes (for example a non-raw file) the results
+ <p>So, with a binary size of 68 bytes, <c>create_file/2</c> runs
+ 30 percent slower than with 64 bytes, and causes much more
+ memory fragmentation. Notice that if the binaries were to be sent
+ between processes (for example, a non-raw file), the results
would probably be completely different.</p>
</note>
<p>A raw file is really a port. When writing data to a port, it is
- efficient to write a list of binaries. There is no need to
+ efficient to write a list of binaries. It is not needed to
flatten a deep list before writing. On Unix hosts, scatter output,
which writes a set of buffers in one operation, is used when
- possible. In this way <c>file:write(FD, [Bin1, Bin2 | Bin3])</c>
- will write the contents of the binaries without copying the data
- at all except for perhaps deep down in the operating system
+ possible. In this way <c>write(FD, [Bin1, Bin2 | Bin3])</c>
+ writes the contents of the binaries without copying the data
+ at all, except for perhaps deep down in the operating system
kernel.</p>
<p>For raw files, <c>pwrite/2</c> and <c>pread/2</c> are
efficiently implemented. The file driver is called only once for
the whole operation, and the list iteration is done in the file
driver.</p>
<p>The options <c>delayed_write</c> and <c>read_ahead</c> to
- <c>file:open/2</c> makes the file driver cache data to reduce
+ <seealso marker="#open/2"><c>open/2</c></seealso>
+ make the file driver cache data to reduce
the number of operating system calls. The function
- <c>create_file/2</c> in the example above takes 60 seconds
- seconds without the <c>delayed_write</c> option, which is 2.6
+ <c>create_file/2</c> in the recent example takes 60 seconds
+ without option <c>delayed_write</c>, which is 2.6
times slower.</p>
- <p>And, as a really bad example, <c>create_file_slow/2</c> above
- without the <c>raw</c>, <c>binary</c> and <c>delayed_write</c>
- options, that is it calls <c>file:open(Name, [write])</c>, needs
+ <p>As a bad example, <c>create_file_slow/2</c>
+ without options <c>raw</c>, <c>binary</c>, and <c>delayed_write</c>,
+ meaning it calls <c>open(Name, [write])</c>, needs
1 min 20 seconds for the job, which is 3.5 times slower than
the first example, and 150 times slower than the optimized
- <c>create_file/2</c>. </p>
- </section>
-
- <section>
- <title>Warnings</title>
- <p>If an error occurs when accessing an open file with the <c>io</c>
- module, the process which handles the file will exit. The dead
- file process might hang if a process tries to access it later.
+ <c>create_file/2</c>.</p>
+ <warning>
+ <p>If an error occurs when accessing an open file with module
+ <seealso marker="stdlib:io"><c>io</c></seealso>,
+ the process handling the file exits. The dead
+ file process can hang if a process tries to access it later.
This will be fixed in a future release.</p>
+ </warning>
</section>
<section>
- <title>SEE ALSO</title>
- <p><seealso marker="stdlib:filename">filename(3)</seealso></p>
+ <title>See Also</title>
+ <p><seealso marker="stdlib:filename"><c>filename(3)</c></seealso></p>
</section>
</erlref>
diff --git a/lib/kernel/doc/src/gen_sctp.xml b/lib/kernel/doc/src/gen_sctp.xml
index 456108a2fe..57307cd594 100644
--- a/lib/kernel/doc/src/gen_sctp.xml
+++ b/lib/kernel/doc/src/gen_sctp.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2007</year><year>2013</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,68 +30,60 @@
<checked></checked>
<date>2007-03-21</date>
<rev>A</rev>
- <file>gen_sctp.sgml</file>
+ <file>gen_sctp.xml</file>
</header>
<module>gen_sctp</module>
- <modulesummary>The gen_sctp module provides functions for communicating with sockets using the SCTP protocol.</modulesummary>
+ <modulesummary>Functions for communicating with sockets using the SCTP
+ protocol.</modulesummary>
<description>
- <p>The <c>gen_sctp</c> module provides functions for communicating with
+ <p>This module provides functions for communicating with
sockets using the SCTP protocol. The implementation assumes that
the OS kernel supports SCTP
- <url href="http://www.rfc-archive.org/getrfc.php?rfc=2960">(RFC2960)</url> through the user-level
- <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">Sockets API Extensions.</url>
- During development this implementation was tested on
- Linux Fedora Core 5.0 (kernel 2.6.15-2054 or later is needed),
- and on Solaris 10, 11. During OTP adaptation it was tested on
- SUSE Linux Enterprise Server 10 (x86_64) kernel 2.6.16.27-0.6-smp,
- with lksctp-tools-1.0.6, briefly on Solaris 10, and later on
- SUSE Linux Enterprise Server 10 Service Pack 1 (x86_64)
- kernel 2.6.16.54-0.2.3-smp with lksctp-tools-1.0.7,
- and later also on FreeBSD 8.2.
- </p>
- <p>
- This module was written for one-to-many style sockets
+ <url href="http://www.rfc-archive.org/getrfc.php?rfc=2960">(RFC 2960)</url>
+ through the user-level
+ <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">Sockets API Extensions</url>.</p>
+ <p>During development, this implementation was tested on:</p>
+ <list type="bulleted">
+ <item>Linux Fedora Core 5.0 (kernel 2.6.15-2054 or later is needed)</item>
+ <item>Solaris 10, 11</item>
+ </list>
+ <p>During OTP adaptation it was tested on:</p>
+ <list type="bulleted">
+ <item>SUSE Linux Enterprise Server 10 (x86_64) kernel 2.6.16.27-0.6-smp,
+ with lksctp-tools-1.0.6</item>
+ <item>Briefly on Solaris 10</item>
+ <item>SUSE Linux Enterprise Server 10 Service Pack 1 (x86_64)
+ kernel 2.6.16.54-0.2.3-smp with lksctp-tools-1.0.7</item>
+ <item>FreeBSD 8.2</item>
+ </list>
+ <p>This module was written for one-to-many style sockets
(type <c>seqpacket</c>). With the addition of
- <seealso marker="#peeloff/2">peeloff/2</seealso>, one-to-one style
- sockets (type <c>stream</c>) were introduced.
- </p>
- <p>Record definitions for the <c>gen_sctp</c> module can be found using:</p>
-<pre> -include_lib("kernel/include/inet_sctp.hrl"). </pre>
+ <seealso marker="#peeloff/2"><c>peeloff/2</c></seealso>,
+ one-to-one style sockets (type <c>stream</c>) were introduced.</p>
+ <p>Record definitions for this module can be found using:</p>
+ <pre>
+-include_lib("kernel/include/inet_sctp.hrl").</pre>
<p>These record definitions use the "new" spelling 'adaptation',
not the deprecated 'adaption', regardless of which
spelling the underlying C API uses.</p>
</description>
- <section>
- <marker id="contents"></marker>
- <title>CONTENTS</title>
- <list type="bulleted">
- <item><seealso marker="#types">DATA TYPES</seealso></item>
- <item><seealso marker="#exports">EXPORTS</seealso></item>
- <item><seealso marker="#options">SCTP SOCKET OPTIONS</seealso></item>
- <item><seealso marker="#examples">SCTP EXAMPLES</seealso></item>
- <item><seealso marker="#seealso">SEE ALSO</seealso></item>
- </list>
- <marker id="types"></marker>
- </section>
-
<datatypes>
<datatype>
<name>assoc_id()</name>
<desc>
<p><marker id="type-assoc_id"/>
- An opaque term returned in for example #sctp_paddr_change{}
- that identifies an association for an SCTP socket. The term
- is opaque except for the special value <c>0</c> that has a
- meaning such as "the whole endpoint" or "all future associations".
- </p>
+ An opaque term returned in, for example, <c>#sctp_paddr_change{}</c>,
+ which identifies an association for an SCTP socket. The term
+ is opaque except for the special value <c>0</c>, which has a
+ meaning such as "the whole endpoint" or "all future associations".</p>
</desc>
</datatype>
<datatype>
<name name="option"/>
<desc>
- <p>One of the
- <seealso marker="#options">SCTP Socket Options.</seealso></p>
+ <p>One of the
+ <seealso marker="#options">SCTP Socket Options</seealso>.</p>
</desc>
</datatype>
<datatype>
@@ -101,8 +93,8 @@
<datatype>
<name>sctp_socket()</name>
<desc>
- <p><marker id="type-sctp_socket"/>
- Socket identifier returned from <c>open/*</c>.</p>
+ <p><marker id="type-sctp_socket"/>Socket identifier returned from
+ <seealso marker="#open/0"><c>open/*</c></seealso>.</p>
<marker id="exports"></marker>
</desc>
</datatype>
@@ -111,405 +103,438 @@
<funcs>
<func>
<name name="abort" arity="2"/>
- <fsummary>Abnormally terminate the association given by Assoc, without flushing of unsent data</fsummary>
+ <fsummary>Abnormally terminate the association specified by
+ <c>Assoc</c>, without flushing of unsent data.</fsummary>
<desc>
- <p>Abnormally terminates the association given by <c><anno>Assoc</anno></c>, without
+ <p>Abnormally terminates the association specified by
+ <c><anno>Assoc</anno></c>, without
flushing of unsent data. The socket itself remains open. Other
- associations opened on this socket are still valid, and it can be
- used in new associations.</p>
+ associations opened on this socket are still valid, and the socket
+ can be used in new associations.</p>
</desc>
</func>
+
<func>
<name name="close" arity="1"/>
- <fsummary>Completely close the socket and all associations on it</fsummary>
+ <fsummary>Close the socket and all associations on it.</fsummary>
<desc>
- <p>Completely closes the socket and all associations on it. The unsent
- data is flushed as in <c>eof/2</c>. The <c>close/1</c> call
+ <p>Closes the socket and all associations on it. The unsent
+ data is flushed as in <seealso marker="#eof/2"><c>eof/2</c></seealso>.
+ The <c>close/1</c> call
is blocking or otherwise depending of the value of
- the <seealso marker="inet#option-linger">linger</seealso> socket
- <seealso marker="#options">option</seealso>.
- If <c>close</c> does not linger or linger timeout expires,
+ the <seealso marker="inet#option-linger"><c>linger</c></seealso>
+ socket <seealso marker="#options">option</seealso>.
+ If <c>close</c> does not linger or linger time-out expires,
the call returns and the data is flushed in the background.</p>
</desc>
</func>
+
<func>
<name name="connect" arity="4"/>
<fsummary>Same as <c>connect(Socket, Addr, Port, Opts, infinity)</c>.</fsummary>
<desc>
- <p>Same as <c>connect(<anno>Socket</anno>, <anno>Addr</anno>, <anno>Port</anno>, <anno>Opts</anno>, infinity)</c>.</p>
+ <p>Same as <c>connect(<anno>Socket</anno>, <anno>Addr</anno>,
+ <anno>Port</anno>, <anno>Opts</anno>, infinity)</c>.</p>
</desc>
</func>
+
<func>
<name name="connect" arity="5"/>
- <fsummary>Establish a new association for the socket <c>Socket</c>, with a peer (SCTP server socket)</fsummary>
+ <fsummary>Establish a new association for socket <c>Socket</c>, with a
+ peer (SCTP server socket).</fsummary>
<desc>
- <p>Establishes a new association for the socket <c><anno>Socket</anno></c>,
- with the peer (SCTP server socket) given by
- <c><anno>Addr</anno></c> and <c><anno>Port</anno></c>. The <c><anno>Timeout</anno></c>,
- is expressed in milliseconds. A socket can be associated with multiple peers.</p>
-
- <p><em>WARNING:</em>Using a value of <c><anno>Timeout</anno></c> less than
- the maximum time taken by the OS to establish an association (around 4.5 minutes
- if the default values from RFC 4960 are used) can result in
- inconsistent or incorrect return values. This is especially
- relevant for associations sharing the same <c><anno>Socket</anno></c>
- (i.e. source address and port) since the controlling process
- blocks until <c>connect/*</c> returns.
- <seealso marker="#connect_init/4">connect_init/*</seealso>
- provides an alternative not subject to this limitation.</p>
-
+ <p>Establishes a new association for socket <c><anno>Socket</anno></c>,
+ with the peer (SCTP server socket) specified by
+ <c><anno>Addr</anno></c> and <c><anno>Port</anno></c>.
+ <c><anno>Timeout</anno></c>, is expressed in milliseconds.
+ A socket can be associated with multiple peers.</p>
+ <warning><p>Using a value of <c><anno>Timeout</anno></c> less than
+ the maximum time taken by the OS to establish an association (around
+ 4.5 minutes if the default values from
+ <url href="https://tools.ietf.org/html/rfc4960">RFC 4960</url>
+ are used), can result
+ in inconsistent or incorrect return values. This is especially
+ relevant for associations sharing the same <c><anno>Socket</anno></c>
+ (that is, source address and port), as the controlling process
+ blocks until <c>connect/*</c> returns.
+ <seealso marker="#connect_init/4"><c>connect_init/*</c></seealso>
+ provides an alternative without this limitation.</p>
+ </warning>
<p><marker id="record-sctp_assoc_change"></marker>
The result of <c>connect/*</c> is an <c>#sctp_assoc_change{}</c>
- event which contains, in particular, the new
- <seealso marker="#type-assoc_id">Association ID</seealso>.</p>
-<pre> #sctp_assoc_change{
- state = atom(),
- error = atom(),
- outbound_streams = integer(),
- inbound_streams = integer(),
- assoc_id = assoc_id()
- } </pre>
+ event that contains, in particular, the new
+ <seealso marker="#type-assoc_id">Association ID</seealso>:</p>
+ <pre>
+#sctp_assoc_change{
+ state = atom(),
+ error = atom(),
+ outbound_streams = integer(),
+ inbound_streams = integer(),
+ assoc_id = assoc_id()
+}</pre>
<p>The number of outbound and inbound streams can be set by
- giving an <c>sctp_initmsg</c> option to <c>connect</c>
- as in:</p>
-<pre> connect(Socket, Ip, Port>,
- [{sctp_initmsg,#sctp_initmsg{num_ostreams=OutStreams,
- max_instreams=MaxInStreams}}]) </pre>
+ giving an <c>sctp_initmsg</c> option to <c>connect</c> as in:</p>
+ <pre>
+connect(Socket, Ip, Port>,
+ [{sctp_initmsg,#sctp_initmsg{num_ostreams=OutStreams,
+ max_instreams=MaxInStreams}}])</pre>
<p>All options <c><anno>Opt</anno></c> are set on the socket before the
- association is attempted. If an option record has got undefined
+ association is attempted. If an option record has undefined
field values, the options record is first read from the socket
- for those values. In effect, <c><anno>Opt</anno></c> option records only
- define field values to change before connecting.</p>
+ for those values. In effect, <c><anno>Opt</anno></c> option records
+ only define field values to change before connecting.</p>
<p>The returned <c>outbound_streams</c> and <c>inbound_streams</c>
- are the actual stream numbers on the socket, which may be different
- from the requested values (<c>OutStreams</c> and <c>MaxInStreams</c>
+ are the stream numbers on the socket. These can be different
+ from the requested values (<c>OutStreams</c> and <c>MaxInStreams</c>,
respectively) if the peer requires lower values.</p>
- <p>The following values of <c>state</c> are possible:</p>
- <list type="bulleted">
- <item>
- <p><c>comm_up</c>: association successfully established. This
- indicates a successful completion of <c>connect</c>.</p>
- </item>
- <item>
- <p><c>cant_assoc</c>: association cannot be established
- (<c>connect/*</c> failure).</p>
- </item>
- </list>
- <p>All other states do not normally occur in the output from
- <c>connect/*</c>. Rather, they may occur in
+ <p><c>state</c> can have the following values:</p>
+ <taglist>
+ <tag><c>comm_up</c></tag>
+ <item><p>Association is successfully established. This
+ indicates a successful completion of <c>connect</c>.</p></item>
+ <tag><c>cant_assoc</c></tag>
+ <item><p>The association cannot be established
+ (<c>connect/*</c> failure).</p></item>
+ </taglist>
+ <p>Other states do not normally occur in the output from
+ <c>connect/*</c>. Rather, they can occur in
<c>#sctp_assoc_change{}</c> events received instead of data in
- <seealso marker="#recv/1">recv/*</seealso> calls.
- All of them indicate losing the association due to various
- error conditions, and are listed here for the sake of completeness.
- The <c>error</c> field may provide more detailed diagnostics.</p>
- <list type="bulleted">
- <item>
- <p><c>comm_lost</c>;</p>
- </item>
- <item>
- <p><c>restart</c>;</p>
- </item>
- <item>
- <p><c>shutdown_comp</c>.</p>
- </item>
- </list>
+ <seealso marker="#recv/1"><c>recv/*</c></seealso> calls.
+ All of them indicate losing the association because of various error
+ conditions, and are listed here for the sake of completeness:</p>
+ <taglist>
+ <tag><c>comm_lost</c></tag>
+ <item></item>
+ <tag><c>restart</c></tag>
+ <item></item>
+ <tag><c>shutdown_comp</c></tag>
+ <item></item>
+ </taglist>
+ <p>Field <c>error</c> can provide more detailed diagnostics.</p>
</desc>
</func>
+
<func>
<name name="connect_init" arity="4"/>
- <fsummary>Same as <c>connect_init(Socket, Addr, Port, Opts, infinity)</c>.</fsummary>
+ <fsummary>Same as <c>connect_init(Socket, Addr, Port, Opts, infinity)</c>..</fsummary>
<desc>
- <p>Same as <c>connect_init(<anno>Socket</anno>, <anno>Addr</anno>, <anno>Port</anno>, <anno>Opts</anno>, infinity)</c>.</p>
+ <p>Same as <c>connect_init(<anno>Socket</anno>, <anno>Addr</anno>,
+ <anno>Port</anno>, <anno>Opts</anno>, infinity)</c>.</p>
</desc>
</func>
+
<func>
<name name="connect_init" arity="5"/>
- <fsummary>Initiate a new association for the socket <c>Socket</c>, with a peer (SCTP server socket)</fsummary>
+ <fsummary>Initiate a new association for socket <c>Socket</c>, with a
+ peer (SCTP server socket).</fsummary>
<desc>
- <p>Initiates a new association for the socket <c><anno>Socket</anno></c>,
- with the peer (SCTP server socket) given by
+ <p>Initiates a new association for socket <c><anno>Socket</anno></c>,
+ with the peer (SCTP server socket) specified by
<c><anno>Addr</anno></c> and <c><anno>Port</anno></c>.</p>
- <p>The fundamental difference between this API
- and <c>connect/*</c> is that the return value is that of the
- underlying OS connect(2) system call. If <c>ok</c> is returned
- then the result of the association establishement is received
- by the calling process as
- an <seealso marker="#record-sctp_assoc_change">
- #sctp_assoc_change{}</seealso>
- event. The calling process must be prepared to receive this, or
- poll for it using <c>recv/*</c> depending on the value of the
- active option.</p>
- <p>The parameters are as described
- in <seealso marker="#connect/5">connect/*</seealso>, with the
- exception of the <c><anno>Timeout</anno></c> value.</p>
- <p>The timer associated with <c><anno>Timeout</anno></c> only supervises
- IP resolution of <c><anno>Addr</anno></c></p>
+ <p>The fundamental difference between this API
+ and <c>connect/*</c> is that the return value is that of the
+ underlying OS <c>connect(2)</c> system call. If <c>ok</c> is returned,
+ the result of the association establishment is received
+ by the calling process as an
+ <seealso marker="#record-sctp_assoc_change"><c>#sctp_assoc_change{}</c></seealso>
+ event. The calling process must be prepared to receive this, or
+ poll for it using
+ <seealso marker="#recv/1"><c>recv/*</c></seealso>,
+ depending on the value of the active option.</p>
+ <p>The parameters are as described in
+ <seealso marker="#connect/5"><c>connect/*</c></seealso>,
+ except the <c><anno>Timeout</anno></c> value.</p>
+ <p>The timer associated with <c><anno>Timeout</anno></c> only supervises
+ IP resolution of <c><anno>Addr</anno></c>.</p>
</desc>
</func>
+
<func>
<name name="controlling_process" arity="2"/>
- <fsummary>Assign a new controlling process pid to the socket</fsummary>
+ <fsummary>Assign a new controlling process pid to the socket.</fsummary>
<desc>
- <p>Assigns a new controlling process <c><anno>Pid</anno></c> to <c><anno>Socket</anno></c>. Same implementation
- as <c>gen_udp:controlling_process/2</c>.</p>
+ <p>Assigns a new controlling process <c><anno>Pid</anno></c> to
+ <c><anno>Socket</anno></c>. Same implementation as
+ <seealso marker="gen_udp:controlling_process/2"><c>gen_udp:controlling_process/2</c></seealso>.
+ </p>
</desc>
</func>
+
<func>
<name name="eof" arity="2"/>
- <fsummary>Gracefully terminate the association given by Assoc, with flushing of all unsent data</fsummary>
+ <fsummary>Gracefully terminate the association specified by <c>Assoc</c>,
+ with flushing of all unsent data.</fsummary>
<desc>
- <p>Gracefully terminates the association given by <c><anno>Assoc</anno></c>, with
+ <p>Gracefully terminates the association specified by
+ <c><anno>Assoc</anno></c>, with
flushing of all unsent data. The socket itself remains open. Other
- associations opened on this socket are still valid, and it can be
- used in new associations.</p>
+ associations opened on this socket are still valid. The socket can
+ be used in new associations.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="error_string" arity="1"/>
+ <fsummary>Translate an SCTP error number into a string.</fsummary>
+ <desc>
+ <p>Translates an SCTP error number from, for example,
+ <c>#sctp_remote_error{}</c> or <c>#sctp_send_failed{}</c> into
+ an explanatory string, or one of the atoms <c>ok</c> for no
+ error or <c>undefined</c> for an unrecognized error.</p>
</desc>
</func>
+
<func>
<name name="listen" arity="2" clause_i="1"/>
<name name="listen" arity="2" clause_i="2"/>
<fsummary>Set up a socket to listen.</fsummary>
<desc>
<p>Sets up a socket to listen on the IP address and port number
- it is bound to.</p>
- <p>For type <c>seqpacket</c> sockets (the default)
- <c><anno>IsServer</anno></c> must be <c>true</c> or <c>false</c>.
- In contrast to TCP, in SCTP there is no listening queue length.
- If <c><anno>IsServer</anno></c> is <c>true</c> the socket accepts new associations, i.e.
- it will become an SCTP server socket.</p>
- <p>For type <c>stream</c> sockets <anno>Backlog</anno> defines
- the backlog queue length just like in TCP.</p>
+ it is bound to.</p>
+ <p>For type <c>seqpacket</c>, sockets (the default)
+ <c><anno>IsServer</anno></c> must be <c>true</c> or <c>false</c>.
+ In contrast to TCP, there is no listening queue length in SCTP.
+ If <c><anno>IsServer</anno></c> is <c>true</c>, the socket accepts
+ new associations, that is, it becomes an SCTP server socket.</p>
+ <p>For type <c>stream</c>, sockets <anno>Backlog</anno> define
+ the backlog queue length just like in TCP.</p>
</desc>
</func>
+
<func>
<name name="open" arity="0"/>
<name name="open" arity="1" clause_i="1"/>
<name name="open" arity="1" clause_i="2"/>
<name name="open" arity="2"/>
- <fsummary>Create an SCTP socket and bind it to local addresses</fsummary>
+ <fsummary>Create an SCTP socket and binds it to local addresses.</fsummary>
<desc>
- <p>Creates an SCTP socket and binds it to the local addresses
- specified by all <c>{ip,<anno>IP</anno>}</c> (or synonymously <c>{ifaddr,<anno>IP</anno>}</c>)
- options (this feature is called SCTP multi-homing).
- The default <c><anno>IP</anno></c> and <c><anno>Port</anno></c> are <c>any</c>
+ <p>Creates an SCTP socket and binds it to the local addresses
+ specified by all <c>{ip,<anno>IP</anno>}</c> (or synonymously
+ <c>{ifaddr,<anno>IP</anno>}</c>)
+ options (this feature is called SCTP multi-homing). The default
+ <c><anno>IP</anno></c> and <c><anno>Port</anno></c> are <c>any</c>
and <c>0</c>, meaning bind to all local addresses on any
- one free port.</p>
-
- <p>Other options are:</p>
+ free port.</p>
+ <p>Other options:</p>
<taglist>
<tag><c>inet6</c></tag>
<item>
- <p>Set up the socket for IPv6.</p>
+ <p>Sets up the socket for IPv6.</p>
</item>
<tag><c>inet</c></tag>
<item>
- <p>Set up the socket for IPv4. This is the default.</p>
+ <p>Sets up the socket for IPv4. This is the default.</p>
</item>
</taglist>
-
<p>A default set of socket <seealso marker="#options">options</seealso>
- is used. In particular, the socket is opened in
+ is used. In particular, the socket is opened in
<seealso marker="#option-binary">binary</seealso> and
<seealso marker="#option-active">passive</seealso> mode,
- with <anno>SockType</anno> <c>seqpacket</c>,
- and with reasonably large
+ with <anno>SockType</anno> <c>seqpacket</c>, and with reasonably large
<seealso marker="inet#option-sndbuf">kernel</seealso> and driver
- <seealso marker="inet#option-buffer">buffers.</seealso></p>
+ <seealso marker="inet#option-buffer">buffers</seealso>.</p>
</desc>
</func>
+
<func>
<name name="peeloff" arity="2"/>
- <fsummary>
- Peel off a type <c>stream</c> socket from a type <c>seqpacket</c> one
- </fsummary>
+ <fsummary>Peel off a type <c>stream</c> socket from a type
+ <c>seqpacket</c> one.</fsummary>
<desc>
- <p>
- Branch off an existing association <anno>Assoc</anno>
- in a socket <anno>Socket</anno> of type <c>seqpacket</c>
- (one-to-many style) into
- a new socket <anno>NewSocket</anno> of type <c>stream</c>
- (one-to-one style).
- </p>
- <p>
- The existing association argument <anno>Assoc</anno>
- can be either a
- <seealso marker="#record-sctp_assoc_change">
- #sctp_assoc_change{}
- </seealso>
- record as returned from e.g
- <seealso marker="#recv-2">recv/*</seealso>,
- <seealso marker="#connect-5">connect/*</seealso> or
- from a listening socket in active mode. Or it can be just
- the field <c>assoc_id</c> integer from such a record.
- </p>
+ <p>Branches off an existing association <c><anno>Assoc</anno></c>
+ in a socket <c><anno>Socket</anno></c> of type <c>seqpacket</c>
+ (one-to-many style) into
+ a new socket <c><anno>NewSocket</anno></c> of type <c>stream</c>
+ (one-to-one style).</p>
+ <p>The existing association argument <c><anno>Assoc</anno></c>
+ can be either a
+ <seealso marker="#record-sctp_assoc_change"><c>#sctp_assoc_change{}</c></seealso>
+ record as returned from, for example,
+ <seealso marker="#recv-2"><c>recv/*</c></seealso>,
+ <seealso marker="#connect-5"><c>connect/*</c></seealso>, or
+ from a listening socket in active mode. It can also be just
+ the field <c>assoc_id</c> integer from such a record.</p>
</desc>
</func>
+
<func>
<name name="recv" arity="1"/>
<name name="recv" arity="2"/>
- <fsummary>Receive a message from a socket</fsummary>
+ <fsummary>Receive a message from a socket.</fsummary>
<desc>
- <p>Receives the <c><anno>Data</anno></c> message from any association of the socket.
- If the receive times out <c>{error,timeout</c> is returned.
- The default timeout is <c>infinity</c>.
- <c><anno>FromIP</anno></c> and <c><anno>FromPort</anno></c> indicate the sender's address.</p>
- <p><c><anno>AncData</anno></c> is a list of Ancillary Data items which
- may be received along with the main <c><anno>Data</anno></c>.
+ <p>Receives the <c><anno>Data</anno></c> message from any association
+ of the socket.
+ If the receive times out, <c>{error,timeout}</c> is returned.
+ The default time-out is <c>infinity</c>. <c><anno>FromIP</anno></c>
+ and <c><anno>FromPort</anno></c> indicate the address of the
+ sender.</p>
+ <p><c><anno>AncData</anno></c> is a list of ancillary data items that
+ can be received along with the main <c><anno>Data</anno></c>.
This list can be empty, or contain a single
- <seealso marker="#record-sctp_sndrcvinfo">#sctp_sndrcvinfo{}</seealso>
- record, if receiving of such ancillary data is enabled
- (see option
- <seealso marker="#option-sctp_events">sctp_events</seealso>).
- It is enabled by default, since such ancillary data
- provide an easy way of determining the association and stream
- over which the message has been received.
- (An alternative way would be to get the Association ID from the
- <c><anno>FromIP</anno></c> and <c><anno>FromPort</anno></c> using the
- <seealso marker="#option-sctp_get_peer_addr_info">sctp_get_peer_addr_info</seealso> socket option,
- but this would still not produce the Stream number).</p>
- <p>The actual <c><anno>Data</anno></c> received may be a <c>binary()</c>,
- or <c>list()</c> of bytes (integers in the range 0 through 255)
- depending on the socket mode, or an SCTP Event.
- <marker id="sctp_events"></marker>
-
- The following SCTP Events are possible:</p>
+ <seealso marker="#record-sctp_sndrcvinfo"><c>#sctp_sndrcvinfo{}</c></seealso>
+ record if receiving of such ancillary data is enabled (see option
+ <seealso marker="#option-sctp_events"><c>sctp_events</c></seealso>).
+ It is enabled by default, as such ancillary data
+ provides an easy way of determining the association and stream
+ over which the message is received.
+ (An alternative way is to get the association ID from
+ <c><anno>FromIP</anno></c> and <c><anno>FromPort</anno></c> using
+ socket option
+ <seealso marker="#option-sctp_get_peer_addr_info"><c>sctp_get_peer_addr_info</c></seealso>,
+ but this does still not produce the stream number).</p>
+ <p>The <c><anno>Data</anno></c> received can be a <c>binary()</c>
+ or a <c>list()</c> of bytes (integers in the range 0 through 255)
+ depending on the socket mode, or an SCTP event.</p>
+ <marker id="sctp_events"></marker>
+ <p>Possible SCTP events:</p>
<list type="bulleted">
<item>
- <p><seealso marker="#record-sctp_sndrcvinfo">#sctp_sndrcvinfo{}</seealso></p>
+ <seealso marker="#record-sctp_sndrcvinfo"><c>#sctp_sndrcvinfo{}</c></seealso>
</item>
<item>
- <p><seealso marker="#record-sctp_assoc_change">#sctp_assoc_change{}</seealso>;</p>
+ <seealso marker="#record-sctp_assoc_change"><c>#sctp_assoc_change{}</c></seealso>
</item>
<item>
-<pre> #sctp_paddr_change{
- addr = {ip_address(),port()},
- state = atom(),
- error = integer(),
- assoc_id = assoc_id()
- } </pre>
- <p>Indicates change of the status of the peer's IP address given by
- <c>addr</c> within the association <c>assoc_id</c>.
- Possible values of <c>state</c> (mostly self-explanatory) include:</p>
- <list type="bulleted">
- <item>
- <p><c>addr_unreachable</c>;</p>
- </item>
- <item>
- <p><c>addr_available</c>;</p>
- </item>
- <item>
- <p><c>addr_removed</c>;</p>
- </item>
- <item>
- <p><c>addr_added</c>;</p>
+ <pre>
+#sctp_paddr_change{
+ addr = {ip_address(),port()},
+ state = atom(),
+ error = integer(),
+ assoc_id = assoc_id()
+}</pre>
+ <p>Indicates change of the status of the IP address of the peer
+ specified by
+ <c>addr</c> within association <c>assoc_id</c>. Possible
+ values of <c>state</c> (mostly self-explanatory) include:</p>
+ <taglist>
+ <tag><c>addr_unreachable</c></tag>
+ <item></item>
+ <tag><c>addr_available</c></tag>
+ <item></item>
+ <tag><c>addr_removed</c></tag>
+ <item></item>
+ <tag><c>addr_added</c></tag>
+ <item></item>
+ <tag><c>addr_made_prim</c></tag>
+ <item></item>
+ <tag><c>addr_confirmed</c></tag>
+ <item></item>
+ </taglist>
+ <p>In case of an error (for example, <c>addr_unreachable</c>),
+ field <c>error</c> provides more diagnostics. In such cases,
+ event <c>#sctp_paddr_change{}</c> is automatically
+ converted into an <c>error</c> term returned by
+ <seealso marker="#recv/1"><c>recv</c></seealso>.
+ The <c>error</c> field value can be converted into a string using
+ <seealso marker="#error_string/1"><c>error_string/1</c></seealso>.
+ </p>
+ </item>
+ <item>
+ <pre>
+#sctp_send_failed{
+ flags = true | false,
+ error = integer(),
+ info = #sctp_sndrcvinfo{},
+ assoc_id = assoc_id()
+ data = binary()
+}</pre>
+ <p>The sender can receive this event if a send operation fails.</p>
+ <taglist>
+ <tag><c>flags</c></tag>
+ <item><p>A Boolean specifying if the data has been transmitted
+ over the wire.</p></item>
+ <tag><c>error</c></tag>
+ <item><p>Provides extended diagnostics, use
+ <seealso marker="#error_string/1"><c>error_string/1</c>.</seealso></p>
</item>
- <item>
- <p><c>addr_made_prim</c>.</p>
+ <tag><c>info</c></tag>
+ <item><p>The original
+ <seealso marker="#record-sctp_sndrcvinfo"><c>#sctp_sndrcvinfo{}</c></seealso>
+ record used in the failed
+ <seealso marker="#send/3"><c>send/*</c>.</seealso></p>
</item>
- <item>
- <p><c>addr_confirmed</c>.</p>
+ <tag><c>data</c></tag>
+ <item><p>The whole original data chunk attempted to be sent.</p>
</item>
- </list>
- <p>In case of an error (e.g. <c>addr_unreachable</c>), the
- <c>error</c> field provides additional diagnostics. In such cases,
- the <c>#sctp_paddr_change{}</c> Event is automatically
- converted into an <c>error</c> term returned by
- <c>gen_sctp:recv</c>. The <c>error</c> field value can be
- converted into a string using <c>error_string/1</c>.</p>
- </item>
- <item>
-<pre> #sctp_send_failed{
- flags = true | false,
- error = integer(),
- info = #sctp_sndrcvinfo{},
- assoc_id = assoc_id()
- data = binary()
- } </pre>
- <p>The sender may receive this event if a send operation fails.
- The <c>flags</c> is a Boolean specifying whether the data have
- actually been transmitted over the wire; <c>error</c> provides
- extended diagnostics, use <c>error_string/1</c>;
- <c>info</c> is the original
- <seealso marker="#record-sctp_sndrcvinfo">#sctp_sndrcvinfo{}</seealso> record used in the failed
- <seealso marker="#send/3">send/*,</seealso> and <c>data</c>
- is the whole original data chunk attempted to be sent.</p>
+ </taglist>
<p>In the current implementation of the Erlang/SCTP binding,
- this Event is internally converted into an <c>error</c> term
- returned by <c>recv/*</c>.</p>
+ this event is internally converted into an <c>error</c> term
+ returned by
+ <seealso marker="#recv/1"><c>recv/*</c></seealso>.</p>
</item>
<item>
-<pre> #sctp_adaptation_event{
- adaptation_ind = integer(),
- assoc_id = assoc_id()
- } </pre>
- <p>Delivered when a peer sends an Adaptation Layer Indication
- parameter (configured through the option
- <seealso marker="#option-sctp_adaptation_layer">sctp_adaptation_layer</seealso>).
- Note that with the current implementation of
+ <pre>
+#sctp_adaptation_event{
+ adaptation_ind = integer(),
+ assoc_id = assoc_id()
+}</pre>
+ <p>Delivered when a peer sends an adaptation layer indication
+ parameter (configured through option
+ <seealso marker="#option-sctp_adaptation_layer"><c>sctp_adaptation_layer</c></seealso>).
+ Notice that with the current implementation of
the Erlang/SCTP binding, this event is disabled by default.</p>
</item>
<item>
-<pre> #sctp_pdapi_event{
- indication = sctp_partial_delivery_aborted,
- assoc_id = assoc_id()
- } </pre>
+ <pre>
+#sctp_pdapi_event{
+ indication = sctp_partial_delivery_aborted,
+ assoc_id = assoc_id()
+}</pre>
<p>A partial delivery failure. In the current implementation of
- the Erlang/SCTP binding, this Event is internally converted
- into an <c>error</c> term returned by <c>recv/*</c>.</p>
+ the Erlang/SCTP binding, this event is internally converted
+ into an <c>error</c> term returned by
+ <seealso marker="#recv/1"><c>recv/*</c></seealso>.</p>
</item>
</list>
</desc>
</func>
+
<func>
<name name="send" arity="3"/>
- <fsummary>Send a message using an <c>#sctp_sndrcvinfo{}</c>record</fsummary>
+ <fsummary>Send a message using an <c>#sctp_sndrcvinfo{}</c>record.</fsummary>
<desc>
- <p>Sends the <c><anno>Data</anno></c> message with all sending parameters from a
- <seealso marker="#record-sctp_sndrcvinfo">#sctp_sndrcvinfo{}</seealso> record.
- This way, the user can specify the PPID (passed to the remote end)
- and Context (passed to the local SCTP layer) which can be used
- for example for error identification.
+ <p>Sends the <c><anno>Data</anno></c> message with all sending
+ parameters from a
+ <seealso marker="#record-sctp_sndrcvinfo"><c>#sctp_sndrcvinfo{}</c></seealso>
+ record. This way, the user can specify the PPID (passed to the remote
+ end) and context (passed to the local SCTP layer), which can be used,
+ for example, for error identification.
However, such a fine level of user control is rarely required.
- The send/4 function is sufficient for most applications.</p>
+ The function <c>send/4</c> is sufficient for most applications.</p>
</desc>
</func>
+
<func>
<name name="send" arity="4"/>
- <fsummary>Send a message over an existing association and given stream</fsummary>
+ <fsummary>Send a message over an existing association and specified
+ stream.</fsummary>
<desc>
- <p>Sends <c><anno>Data</anno></c> message over an existing association and given
- stream.</p>
- </desc>
- </func>
- <func>
- <name name="error_string" arity="1"/>
- <fsummary>Translate an SCTP error number into a string</fsummary>
- <desc>
- <p>Translates an SCTP error number from for example
- <c>#sctp_remote_error{}</c> or <c>#sctp_send_failed{}</c> into
- an explanatory string, or one of the atoms <c>ok</c> for no
- error and <c>undefined</c> for an unrecognized error.</p>
+ <p>Sends a <c><anno>Data</anno></c> message over an existing association
+ and specified stream.</p>
</desc>
</func>
</funcs>
<section>
<marker id="options"></marker>
- <title>SCTP SOCKET OPTIONS</title>
+ <title>SCTP Socket Options</title>
<p>The set of admissible SCTP socket options is by construction
- orthogonal to the sets of TCP, UDP and generic INET options:
- only those options which are explicitly listed below are allowed
+ orthogonal to the sets of TCP, UDP, and generic <c>inet</c> options.
+ Only options listed here are allowed
for SCTP sockets. Options can be set on the socket using
- <seealso marker="#open/1"><c>gen_sctp:open/1,2</c></seealso>
- or <seealso marker="inet#setopts/2"><c>inet:setopts/2</c></seealso>,
- retrieved using <seealso marker="inet#getopts/2"><c>inet:getopts/2</c></seealso>,
- and when calling <seealso marker="#connect/4"><c>gen_sctp:connect/4,5</c></seealso>
- options can be changed.</p>
+ <seealso marker="#open/1"><c>open/1,2</c></seealso> or
+ <seealso marker="inet#setopts/2"><c>inet:setopts/2</c></seealso>,
+ retrieved using
+ <seealso marker="inet#getopts/2"><c>inet:getopts/2</c></seealso>.
+ Options can be changed when calling
+ <seealso marker="#connect/4"><c>connect/4,5</c></seealso>.</p>
<marker id="option-binary"></marker>
<marker id="option-list"></marker>
<taglist>
<tag><c>{mode, list|binary}</c> or just <c>list</c> or <c>binary</c></tag>
<item>
- <p>Determines the type of data returned from <c>gen_sctp:recv/1,2</c>.</p>
+ <p>Determines the type of data returned from
+ <seealso marker="#recv/1"><c>recv/1,2</c></seealso>.</p>
<marker id="option-active"></marker>
</item>
<tag><c>{active, true|false|once|N}</c></tag>
@@ -517,176 +542,177 @@
<list type="bulleted">
<item>
<p>If <c>false</c> (passive mode, the default),
- the caller needs to do an explicit <c>gen_sctp:recv</c> call
- in order to retrieve the available data from the socket.</p>
+ the caller must do an explicit
+ <seealso marker="#recv/1"><c>recv</c></seealso> call
+ to retrieve the available data from the socket.</p>
</item>
<item>
<p>If <c>true</c> (full active mode), the pending data or events are
sent to the owning process.</p>
- <p><em>NB:</em> This can cause the message queue to overflow,
+ <p>Notice that this can cause the message queue to overflow,
as there is no way to throttle the sender in this case
- (no flow control!).</p>
+ (no flow control).</p>
</item>
<item>
<p>If <c>once</c>, only one message is automatically placed
in the message queue, and after that the mode is automatically
- reset to passive. This provides flow control as well as
+ reset to passive. This provides flow control and
the possibility for the receiver to listen for its incoming
SCTP data interleaved with other inter-process messages.</p>
</item>
<item>
<p>If <c>active</c> is specified as an integer <c>N</c> in the
- range -32768 to 32767 (inclusive), then that number is added to
- the socket's count of the number of data messages to be
+ range -32768 to 32767 (inclusive), that number is added to
+ the socket's counting of data messages to be
delivered to the controlling process. If the result of the
- addition would be negative, the count is set to 0. Once the
- count reaches 0, either through the delivery of messages or by
- being explicitly set with <seealso
- marker="inet#setopts/2">inet:setopts/2</seealso>, the socket's
- mode is automatically reset to passive (<c>{active,
- false}</c>) mode. When a socket in this active mode transitions to
+ addition is negative, the count is set to <c>0</c>. Once the
+ count reaches <c>0</c>, either through the delivery of messages
+ or by being explicitly set with
+ <seealso marker="inet#setopts/2"><c>inet:setopts/2</c></seealso>,
+ the socket mode is automatically reset to passive (<c>{active,
+ false}</c>). When a socket in this active mode transitions to
passive mode, the message <c>{sctp_passive, Socket}</c> is sent
to the controlling process to notify it that if it wants to
receive more data messages from the socket, it must call
- <seealso marker="inet#setopts/2">inet:setopts/2</seealso> to set
- the socket back into an active mode.</p>
+ <seealso marker="inet#setopts/2"><c>inet:setopts/2</c></seealso>
+ to set the socket back into an active mode.</p>
</item>
</list>
</item>
- <tag><c>{tos, integer()}</c></tag>
+ <tag><c>{tos, integer()}</c></tag>
<item>
- <p>Sets the Type-Of-Service field on the IP datagrams being sent,
- to the given value, which effectively determines a prioritization
+ <p>Sets the Type-Of-Service field on the IP datagrams that are sent,
+ to the specified value. This effectively determines a prioritization
policy for the outbound packets. The acceptable values
- are system-dependent. TODO: we do not provide
- symbolic names for these values yet.</p>
+ are system-dependent.</p>
</item>
<tag><c>{priority, integer()}</c></tag>
<item>
<p>A protocol-independent equivalent of <c>tos</c> above. Setting
- priority implies setting tos as well.</p>
+ priority implies setting <c>tos</c> as well.</p>
</item>
<tag><c>{dontroute, true|false}</c></tag>
<item>
- <p>By default <c>false</c>. If <c>true</c>, the kernel does not
- send packets via any gateway, only sends them to directly
+ <p>Defaults to <c>false</c>. If <c>true</c>, the kernel does not
+ send packets through any gateway, only sends them to directly
connected hosts.</p>
</item>
<tag><c>{reuseaddr, true|false}</c></tag>
<item>
- <p>By default <c>false</c>. If true, the local binding address
- <c>{IP,Port}</c> of the socket can be re-used immediately:
- no waiting in the CLOSE_WAIT state is performed (may be
+ <p>Defaults to <c>false</c>. If true, the local binding address
+ <c>{IP,Port}</c> of the socket can be reused immediately.
+ No waiting in state <c>CLOSE_WAIT</c> is performed (can be
required for high-throughput servers).</p>
</item>
- <tag><c>{sndbuf, integer()}</c></tag>
+ <tag><c>{sndbuf, integer()}</c></tag>
<item>
- <p>The size, in bytes, of the *kernel* send buffer for this socket.
+ <p>The size, in bytes, of the OS kernel send buffer for this socket.
Sending errors would occur for datagrams larger than
<c>val(sndbuf)</c>. Setting this option also adjusts
the size of the driver buffer (see <c>buffer</c> above).</p>
</item>
<tag><c>{recbuf, integer()}</c></tag>
<item>
- <p>The size, in bytes, of the *kernel* recv buffer for this socket.
+ <p>The size, in bytes, of the OS kernel receive buffer for this socket.
Sending errors would occur for datagrams larger than
- <c>val(sndbuf)</c>. Setting this option also adjusts
+ <c>val(recbuf)</c>. Setting this option also adjusts
the size of the driver buffer (see <c>buffer</c> above).</p>
</item>
-
- <tag><c>{sctp_module, module()}</c></tag>
- <item> <p>
- Override which callback module is used. Defaults to
- <c>inet_sctp</c> for IPv4 and <c>inet6_sctp</c> for IPv6.
- </p>
- </item>
-
-
+ <tag><c>{sctp_module, module()}</c></tag>
+ <item>
+ <p>Overrides which callback module is used. Defaults to
+ <c>inet_sctp</c> for IPv4 and <c>inet6_sctp</c> for IPv6.</p>
+ </item>
<tag><c>{sctp_rtoinfo, #sctp_rtoinfo{}}</c></tag>
<item>
-<pre> #sctp_rtoinfo{
- assoc_id = assoc_id(),
- initial = integer(),
- max = integer(),
- min = integer()
- } </pre>
- <p>Determines re-transmission time-out parameters, in milliseconds,
- for the association(s) given by <c>assoc_id</c>.
- If <c>assoc_id = 0</c> (default) indicates the whole endpoint. See
- <url href="http://www.rfc-archive.org/getrfc.php?rfc=2960">RFC2960</url> and
- <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">Sockets API Extensions for SCTP</url> for the exact semantics of the fields values.</p>
+ <pre>
+#sctp_rtoinfo{
+ assoc_id = assoc_id(),
+ initial = integer(),
+ max = integer(),
+ min = integer()
+}</pre>
+ <p>Determines retransmission time-out parameters, in milliseconds,
+ for the association(s) specified by <c>assoc_id</c>.</p>
+ <p><c>assoc_id = 0</c> (default) indicates the whole endpoint. See
+ <url href="http://www.rfc-archive.org/getrfc.php?rfc=2960">RFC
+ 2960</url> and
+ <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">Sockets
+ API Extensions for SCTP</url>
+ for the exact semantics of the field values.</p>
</item>
<tag><c>{sctp_associnfo, #sctp_assocparams{}}</c></tag>
<item>
-<pre> #sctp_assocparams{
- assoc_id = assoc_id(),
- asocmaxrxt = integer(),
- number_peer_destinations = integer(),
- peer_rwnd = integer(),
- local_rwnd = integer(),
- cookie_life = integer()
- } </pre>
- <p>Determines association parameters for the association(s) given by
- <c>assoc_id</c>. <c>assoc_id = 0</c> (default) indicates
- the whole endpoint. See
- <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">Sockets API Extensions for SCTP</url> for the discussion of their semantics. Rarely used.</p>
+ <pre>
+#sctp_assocparams{
+ assoc_id = assoc_id(),
+ asocmaxrxt = integer(),
+ number_peer_destinations = integer(),
+ peer_rwnd = integer(),
+ local_rwnd = integer(),
+ cookie_life = integer()
+}</pre>
+ <p>Determines association parameters for the association(s) specified by
+ <c>assoc_id</c>.</p>
+ <p><c>assoc_id = 0</c> (default) indicates the whole endpoint. See
+ <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">Sockets API Extensions for SCTP</url>
+ for the discussion of their semantics. Rarely used.</p>
</item>
<tag><c>{sctp_initmsg, #sctp_initmsg{}}</c></tag>
<item>
-<pre> #sctp_initmsg{
- num_ostreams = integer(),
- max_instreams = integer(),
- max_attempts = integer(),
- max_init_timeo = integer()
- } </pre>
- <p>Determines the default parameters which this socket attempts
+ <pre>
+#sctp_initmsg{
+ num_ostreams = integer(),
+ max_instreams = integer(),
+ max_attempts = integer(),
+ max_init_timeo = integer()
+}</pre>
+ <p>Determines the default parameters that this socket tries
to negotiate with its peer while establishing an association with it.
- Should be set after <c>open/*</c> but before the first
- <c>connect/*</c>. <c>#sctp_initmsg{}</c> can also be used
- as ancillary data with the first call of <c>send/*</c> to
+ Is to be set after
+ <seealso marker="#open/1"><c>open/*</c></seealso>
+ but before the first
+ <seealso marker="#connect/4"><c>connect/*</c></seealso>.
+ <c>#sctp_initmsg{}</c> can also be used
+ as ancillary data with the first call of
+ <seealso marker="#send/3"><c>send/*</c></seealso> to
a new peer (when a new association is created).</p>
- <list type="bulleted">
- <item>
- <p><c>num_ostreams</c>: number of outbound streams;</p>
- </item>
- <item>
- <p><c>max_instreams</c>: max number of in-bound streams;</p>
- </item>
- <item>
- <p><c>max_attempts</c>: max re-transmissions while
- establishing an association;</p>
- </item>
- <item>
- <p><c>max_init_timeo</c>: time-out in milliseconds
- for establishing an association.</p>
- </item>
- </list>
+ <taglist>
+ <tag><c>num_ostreams</c></tag>
+ <item>Number of outbound streams</item>
+ <tag><c>max_instreams</c></tag>
+ <item>Maximum number of inbound streams</item>
+ <tag><c>max_attempts</c></tag>
+ <item>Maximum retransmissions while establishing an association</item>
+ <tag><c>max_init_timeo</c></tag>
+ <item>Time-out, in milliseconds, for establishing an association</item>
+ </taglist>
</item>
<tag><c>{sctp_autoclose, integer() >= 0}</c></tag>
<item>
- <p>Determines the time (in seconds) after which an idle association is
+ <p>Determines the time, in seconds, after which an idle association is
automatically closed. <c>0</c> means that the association is
never automatically closed.</p>
</item>
<tag><c>{sctp_nodelay, true|false}</c></tag>
<item>
<p>Turns on|off the Nagle algorithm for merging small packets
- into larger ones (which improves throughput at the expense
- of latency).</p>
+ into larger ones. This improves throughput at the expense
+ of latency.</p>
</item>
<tag><c>{sctp_disable_fragments, true|false}</c></tag>
<item>
<p>If <c>true</c>, induces an error on an attempt to send
- a message which is larger than the current PMTU size
- (which would require fragmentation/re-assembling).
- Note that message fragmentation does not affect
+ a message larger than the current PMTU size
+ (which would require fragmentation/reassembling).
+ Notice that message fragmentation does not affect
the logical atomicity of its delivery; this option
is provided for performance reasons only.</p>
</item>
<tag><c>{sctp_i_want_mapped_v4_addr, true|false}</c></tag>
<item>
<p>Turns on|off automatic mapping of IPv4 addresses into IPv6 ones
- (if the socket address family is AF_INET6).</p>
+ (if the socket address family is <c>AF_INET6</c>).</p>
</item>
<tag><c>{sctp_maxseg, integer()}</c></tag>
<item>
@@ -695,176 +721,171 @@
</item>
<tag><c>{sctp_primary_addr, #sctp_prim{}}</c></tag>
<item>
-<pre> #sctp_prim{
- assoc_id = assoc_id(),
- addr = {IP, Port}
- }
- IP = ip_address()
- Port = port_number() </pre>
- <p>For the association given by <c>assoc_id</c>,
- <c>{IP,Port}</c> must be one of the peer's addresses.
- This option determines that the given address is
- treated by the local SCTP stack as the peer's primary address.</p>
+ <pre>
+#sctp_prim{
+ assoc_id = assoc_id(),
+ addr = {IP, Port}
+}
+ IP = ip_address()
+ Port = port_number()</pre>
+ <p>For the association specified by <c>assoc_id</c>,
+ <c>{IP,Port}</c> must be one of the peer addresses.
+ This option determines that the specified address is treated by
+ the local SCTP stack as the primary address of the peer.</p>
</item>
<tag><c>{sctp_set_peer_primary_addr, #sctp_setpeerprim{}}</c></tag>
<item>
-<pre> #sctp_setpeerprim{
- assoc_id = assoc_id(),
- addr = {IP, Port}
- }
- IP = ip_address()
- Port = port_number() </pre>
- <p>When set, informs the peer that it should use <c>{IP, Port}</c>
+ <pre>
+#sctp_setpeerprim{
+ assoc_id = assoc_id(),
+ addr = {IP, Port}
+}
+ IP = ip_address()
+ Port = port_number()</pre>
+ <p>When set, informs the peer to use <c>{IP, Port}</c>
as the primary address of the local endpoint for the association
- given by <c>assoc_id</c>.</p>
+ specified by <c>assoc_id</c>.</p>
<marker id="option-sctp_adaptation_layer"></marker>
</item>
<tag><c>{sctp_adaptation_layer, #sctp_setadaptation{}}</c></tag>
<item>
<marker id="record-sctp_setadaptation"></marker>
-<pre> #sctp_setadaptation{
- adaptation_ind = integer()
- } </pre>
- <p>When set, requests that the local endpoint uses the value given by
- <c>adaptation_ind</c> as the Adaptation Indication parameter for
- establishing new associations. See
- <url href="http://www.rfc-archive.org/getrfc.php?rfc=2960">RFC2960</url> and
- <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">Sockets API Extenstions for SCTP</url> for more details.</p>
+ <pre>
+#sctp_setadaptation{
+ adaptation_ind = integer()
+}</pre>
+ <p>When set, requests that the local endpoint uses the value specified
+ by <c>adaptation_ind</c> as the Adaptation Indication parameter for
+ establishing new associations. For details, see
+ <url href="http://www.rfc-archive.org/getrfc.php?rfc=2960">RFC 2960</url>
+ and
+ <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">Sockets
+ API Extenstions for SCTP</url>.</p>
</item>
<tag><c>{sctp_peer_addr_params, #sctp_paddrparams{}}</c></tag>
<item>
-<pre> #sctp_paddrparams{
- assoc_id = assoc_id(),
- address = {IP, Port},
- hbinterval = integer(),
- pathmaxrxt = integer(),
- pathmtu = integer(),
- sackdelay = integer(),
- flags = list()
- }
- IP = ip_address()
- Port = port_number() </pre>
- <p>This option determines various per-address parameters for
- the association given by <c>assoc_id</c> and the peer address
- <c>address</c> (the SCTP protocol supports multi-homing,
- so more than 1 address can correspond to a given association).</p>
- <list type="bulleted">
- <item>
- <p><c>hbinterval</c>: heartbeat interval, in milliseconds;</p>
- </item>
- <item>
- <p><c>pathmaxrxt</c>: max number of retransmissions
- before this address is considered unreachable (and an
- alternative address is selected);</p>
- </item>
- <item>
- <p><c>pathmtu</c>: fixed Path MTU, if automatic discovery is
- disabled (see <c>flags</c> below);</p>
- </item>
- <item>
- <p><c>sackdelay</c>: delay in milliseconds for SAC messages
- (if the delay is enabled, see <c>flags</c> below);</p>
- </item>
- <item>
- <p><c>flags</c>: the following flags are available:</p>
- <list type="bulleted">
- <item>
- <p><c>hb_enable</c>: enable heartbeat; </p>
- </item>
- <item>
- <p><c>hb_disable</c>: disable heartbeat;</p>
- </item>
- <item>
- <p><c>hb_demand</c>: initiate heartbeat immediately;</p>
- </item>
- <item>
- <p><c>pmtud_enable</c>: enable automatic Path MTU discovery;</p>
- </item>
- <item>
- <p><c>pmtud_disable</c>: disable automatic Path MTU discovery;</p>
- </item>
- <item>
- <p><c>sackdelay_enable</c>: enable SAC delay;</p>
- </item>
- <item>
- <p><c>sackdelay_disable</c>: disable SAC delay.</p>
- </item>
- </list>
+ <pre>
+#sctp_paddrparams{
+ assoc_id = assoc_id(),
+ address = {IP, Port},
+ hbinterval = integer(),
+ pathmaxrxt = integer(),
+ pathmtu = integer(),
+ sackdelay = integer(),
+ flags = list()
+}
+IP = ip_address()
+Port = port_number()</pre>
+ <p>Determines various per-address parameters for
+ the association specified by <c>assoc_id</c> and the peer address
+ <c>address</c> (the SCTP protocol supports multi-homing, so
+ more than one address can correspond to a specified association).</p>
+ <taglist>
+ <tag><c>hbinterval</c></tag>
+ <item><p>Heartbeat interval, in milliseconds</p></item>
+ <tag><c>pathmaxrxt</c></tag>
+ <item><p>Maximum number of retransmissions before this address is
+ considered unreachable (and an alternative address is selected)</p>
</item>
- </list>
+ <tag><c>pathmtu</c></tag>
+ <item><p>Fixed Path MTU, if automatic discovery is disabled (see
+ <c>flags</c> below)</p></item>
+ <tag><c>sackdelay</c></tag>
+ <item><p>Delay, in milliseconds, for SAC messages (if the delay is
+ enabled, see <c>flags</c> below)</p></item>
+ <tag><c>flags</c></tag>
+ <item><p>The following flags are available:</p>
+ <taglist>
+ <tag><c>hb_enable</c></tag>
+ <item>Enables heartbeat</item>
+ <tag><c>hb_disable</c></tag>
+ <item>Disables heartbeat</item>
+ <tag><c>hb_demand</c></tag>
+ <item>Initiates heartbeat immediately</item>
+ <tag><c>pmtud_enable</c></tag>
+ <item>Enables automatic Path MTU discovery</item>
+ <tag><c>pmtud_disable</c></tag>
+ <item>Disables automatic Path MTU discovery</item>
+ <tag><c>sackdelay_enable</c></tag>
+ <item>Enables SAC delay</item>
+ <tag><c>sackdelay_disable</c></tag>
+ <item>Disables SAC delay</item>
+ </taglist></item>
+ </taglist>
</item>
<tag><c>{sctp_default_send_param, #sctp_sndrcvinfo{}}</c></tag>
<item>
<marker id="record-sctp_sndrcvinfo"></marker>
-<pre> #sctp_sndrcvinfo{
- stream = integer(),
- ssn = integer(),
- flags = list(),
- ppid = integer(),
- context = integer(),
- timetolive = integer(),
- tsn = integer(),
- cumtsn = integer(),
- assoc_id = assoc_id()
- } </pre>
+ <pre>
+#sctp_sndrcvinfo{
+ stream = integer(),
+ ssn = integer(),
+ flags = list(),
+ ppid = integer(),
+ context = integer(),
+ timetolive = integer(),
+ tsn = integer(),
+ cumtsn = integer(),
+ assoc_id = assoc_id()
+}</pre>
<p><c>#sctp_sndrcvinfo{}</c> is used both in this socket option, and as
ancillary data while sending or receiving SCTP messages. When
- set as an option, it provides a default values for subsequent
- <c>gen_sctp:send</c>calls on the association given by
- <c>assoc_id</c>. <c>assoc_id = 0</c> (default) indicates
- the whole endpoint. The following fields typically need
- to be specified by the sender:</p>
- <list type="bulleted">
- <item>
- <p><c>sinfo_stream</c>: stream number (0-base) within the association
- to send the messages through;</p>
- </item>
- <item>
- <p><c>sinfo_flags</c>: the following flags are recognised:</p>
- <list type="bulleted">
- <item>
- <p><c>unordered</c>: the message is to be sent unordered;</p>
- </item>
- <item>
- <p><c>addr_over</c>: the address specified in
- <c>gen_sctp:send</c> overwrites the primary peer address;</p>
- </item>
- <item>
- <p><c>abort</c>: abort the current association without
- flushing any unsent data;</p>
- </item>
- <item>
- <p><c>eof</c>: gracefully shut down the current
- association, with flushing of unsent data.</p>
- </item>
- </list>
- <p>Other fields are rarely used. See
- <url href="http://www.rfc-archive.org/getrfc.php?rfc=2960">RFC2960</url> and
- <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">Sockets API Extensions for SCTP</url> for full information.</p>
- </item>
- </list>
+ set as an option, it provides default values for subsequent
+ <seealso marker="#send/3"><c>send</c></seealso>
+ calls on the association specified by
+ <c>assoc_id</c>.</p>
+ <p><c>assoc_id = 0</c> (default) indicates
+ the whole endpoint.</p>
+ <p>The following fields typically must be specified by the sender:</p>
+ <taglist>
+ <tag><c>sinfo_stream</c></tag>
+ <item><p>Stream number (0-base) within the association
+ to send the messages through;</p></item>
+ <tag><c>sinfo_flags</c></tag>
+ <item><p>The following flags are recognised:</p>
+ <taglist>
+ <tag><c>unordered</c></tag>
+ <item>The message is to be sent unordered</item>
+ <tag><c>addr_over</c></tag>
+ <item>The address specified in
+ <seealso marker="#send/3"><c>send</c></seealso>
+ overwrites the primary peer address</item>
+ <tag><c>abort</c></tag>
+ <item>Aborts the current association without flushing any unsent
+ data</item>
+ <tag><c>eof</c></tag>
+ <item>Gracefully shuts down the current association, with
+ flushing of unsent data</item>
+ </taglist>
+ <p>Other fields are rarely used. For complete information, see
+ <url href="http://www.rfc-archive.org/getrfc.php?rfc=2960">RFC 2960</url>
+ and
+ <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">Sockets
+ API Extensions for SCTP</url>.</p></item>
+ </taglist>
<marker id="option-sctp_events"></marker>
</item>
<tag><c>{sctp_events, #sctp_event_subscribe{}}</c></tag>
<item>
<marker id="record-sctp_event_subscribe"></marker>
-<pre> #sctp_event_subscribe{
- data_io_event = true | false,
- association_event = true | false,
- address_event = true | false,
- send_failure_event = true | false,
- peer_error_event = true | false,
- shutdown_event = true | false,
- partial_delivery_event = true | false,
- adaptation_layer_event = true | false
- } </pre>
+ <pre>
+#sctp_event_subscribe{
+ data_io_event = true | false,
+ association_event = true | false,
+ address_event = true | false,
+ send_failure_event = true | false,
+ peer_error_event = true | false,
+ shutdown_event = true | false,
+ partial_delivery_event = true | false,
+ adaptation_layer_event = true | false
+}</pre>
<p>This option determines which
<seealso marker="#sctp_events">SCTP Events</seealso> are to be
- received (via <seealso marker="#recv/1">recv/*</seealso>)
- along with the data. The only
- exception is <c>data_io_event</c> which enables or disables
- receiving of
- <seealso marker="#record-sctp_sndrcvinfo">#sctp_sndrcvinfo{}</seealso>
+ received (through
+ <seealso marker="#recv/1"><c>recv/*</c></seealso>)
+ along with the data. The only exception is <c>data_io_event</c>,
+ which enables or disables receiving of
+ <seealso marker="#record-sctp_sndrcvinfo"><c>#sctp_sndrcvinfo{}</c></seealso>
ancillary data, not events.
By default, all flags except <c>adaptation_layer_event</c> are
enabled, although <c>sctp_data_io_event</c> and
@@ -873,201 +894,185 @@
</item>
<tag><c>{sctp_delayed_ack_time, #sctp_assoc_value{}}</c></tag>
<item>
-<pre> #sctp_assoc_value{
- assoc_id = assoc_id(),
- assoc_value = integer()
- } </pre>
+ <pre>
+#sctp_assoc_value{
+ assoc_id = assoc_id(),
+ assoc_value = integer()
+}</pre>
<p>Rarely used. Determines the ACK time
- (given by <c>assoc_value</c> in milliseconds) for
- the given association or the whole endpoint
+ (specified by <c>assoc_value</c>, in milliseconds) for
+ the specified association or the whole endpoint
if <c>assoc_value = 0</c> (default).</p>
</item>
<tag><c>{sctp_status, #sctp_status{}}</c></tag>
<item>
-<pre> #sctp_status{
- assoc_id = assoc_id(),
- state = atom(),
- rwnd = integer(),
- unackdata = integer(),
- penddata = integer(),
- instrms = integer(),
- outstrms = integer(),
- fragmentation_point = integer(),
- primary = #sctp_paddrinfo{}
- } </pre>
+ <pre>
+#sctp_status{
+ assoc_id = assoc_id(),
+ state = atom(),
+ rwnd = integer(),
+ unackdata = integer(),
+ penddata = integer(),
+ instrms = integer(),
+ outstrms = integer(),
+ fragmentation_point = integer(),
+ primary = #sctp_paddrinfo{}
+}</pre>
<p>This option is read-only. It determines the status of
- the SCTP association given by <c>assoc_id</c>. Possible values of
- <c>state</c> follows. The state designations are mostly
- self-explanatory. <c>state_empty</c> is the default which means
- that no other state is active:</p>
- <list type="bulleted">
- <item>
- <p><c>sctp_state_empty</c></p>
- </item>
- <item>
- <p><c>sctp_state_closed</c></p>
- </item>
- <item>
- <p><c>sctp_state_cookie_wait</c></p>
- </item>
- <item>
- <p><c>sctp_state_cookie_echoed</c></p>
- </item>
- <item>
- <p><c>sctp_state_established</c></p>
- </item>
- <item>
- <p><c>sctp_state_shutdown_pending</c></p>
- </item>
- <item>
- <p><c>sctp_state_shutdown_sent</c></p>
- </item>
- <item>
- <p><c>sctp_state_shutdown_received</c></p>
- </item>
- <item>
- <p><c>sctp_state_shutdown_ack_sent</c></p>
- </item>
- </list>
- <p>The semantics of other fields is the following:</p>
- <list type="bulleted">
- <item>
- <p><c>sstat_rwnd</c>: the association peer's current receiver
- window size;</p>
- </item>
- <item>
- <p><c>sstat_unackdata</c>: number of unacked data chunks;</p>
- </item>
- <item>
- <p><c>sstat_penddata</c>: number of data chunks pending receipt;</p>
- </item>
- <item>
- <p><c>sstat_instrms</c>: number of inbound streams;</p>
- </item>
- <item>
- <p><c>sstat_outstrms</c>: number of outbound streams;</p>
- </item>
- <item>
- <p><c>sstat_fragmentation_point</c>: message size at which SCTP
- fragmentation will occur;</p>
- </item>
- <item>
- <p><c>sstat_primary</c>: information on the current primary peer
- address (see below for the format of <c>#sctp_paddrinfo{}</c>).</p>
- </item>
- </list>
+ the SCTP association specified by <c>assoc_id</c>.
+ The following are the
+ possible values of <c>state</c> (the state designations are mostly
+ self-explanatory):</p>
+ <taglist>
+ <tag><c>sctp_state_empty</c></tag>
+ <item>Default. Means that no other state is active.</item>
+ <tag><c>sctp_state_closed</c></tag>
+ <item></item>
+ <tag><c>sctp_state_cookie_wait</c></tag>
+ <item></item>
+ <tag><c>sctp_state_cookie_echoed</c></tag>
+ <item></item>
+ <tag><c>sctp_state_established</c></tag>
+ <item></item>
+ <tag><c>sctp_state_shutdown_pending</c></tag>
+ <item></item>
+ <tag><c>sctp_state_shutdown_sent</c></tag>
+ <item></item>
+ <tag><c>sctp_state_shutdown_received</c></tag>
+ <item></item>
+ <tag><c>sctp_state_shutdown_ack_sent</c></tag>
+ <item></item>
+ </taglist>
+ <p>Semantics of the other fields:</p>
+ <taglist>
+ <tag><c>sstat_rwnd</c></tag>
+ <item>Current receiver window size of the association</item>
+ <tag><c>sstat_unackdata</c></tag>
+ <item>Number of unacked data chunks</item>
+ <tag><c>sstat_penddata</c></tag>
+ <item>Number of data chunks pending receipt</item>
+ <tag><c>sstat_instrms</c></tag>
+ <item>Number of inbound streams</item>
+ <tag><c>sstat_outstrms</c></tag>
+ <item>Number of outbound streams</item>
+ <tag><c>sstat_fragmentation_point</c></tag>
+ <item>Message size at which SCTP fragmentation occurs</item>
+ <tag><c>sstat_primary</c></tag>
+ <item>Information on the current primary peer address (see below for
+ the format of <c>#sctp_paddrinfo{}</c>)</item>
+ </taglist>
<marker id="option-sctp_get_peer_addr_info"></marker>
</item>
<tag><c>{sctp_get_peer_addr_info, #sctp_paddrinfo{}}</c></tag>
<item>
<marker id="record-sctp_paddrinfo"></marker>
-<pre> #sctp_paddrinfo{
- assoc_id = assoc_id(),
- address = {IP, Port},
- state = inactive | active | unconfirmed,
- cwnd = integer(),
- srtt = integer(),
- rto = integer(),
- mtu = integer()
- }
- IP = ip_address()
- Port = port_number() </pre>
+ <pre>
+#sctp_paddrinfo{
+ assoc_id = assoc_id(),
+ address = {IP, Port},
+ state = inactive | active | unconfirmed,
+ cwnd = integer(),
+ srtt = integer(),
+ rto = integer(),
+ mtu = integer()
+}
+IP = ip_address()
+Port = port_number()</pre>
<p>This option is read-only. It determines the parameters specific to
- the peer's address given by <c>address</c> within the association
- given by <c>assoc_id</c>. The <c>address</c> field must be set by the
+ the peer address specified by <c>address</c> within the association
+ specified by <c>assoc_id</c>. Field <c>address</c> fmust be set by the
caller; all other fields are filled in on return.
If <c>assoc_id = 0</c> (default), the <c>address</c>
is automatically translated into the corresponding
- association ID. This option is rarely used; see
- <url href="http://www.rfc-archive.org/getrfc.php?rfc=2960">RFC2960</url> and
- <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">Sockets API Extensions for SCTP</url> for the semantics of all fields.</p>
+ association ID. This option is rarely used.
+ For the semantics of all fields, see
+ <url href="http://www.rfc-archive.org/getrfc.php?rfc=2960">RFC 2960</url>
+ and
+ <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">Sockets
+ API Extensions for SCTP</url>.</p>
</item>
</taglist>
</section>
<section>
<marker id="examples"></marker>
- <title>SCTP EXAMPLES</title>
- <list type="bulleted">
- <item>
- <p>Example of an Erlang SCTP Server which receives SCTP messages and
- prints them on the standard output:</p>
-<pre> -module(sctp_server).
-
- -export([server/0,server/1,server/2]).
- -include_lib("kernel/include/inet.hrl").
- -include_lib("kernel/include/inet_sctp.hrl").
-
- server() -&gt;
- server(any, 2006).
-
- server([Host,Port]) when is_list(Host), is_list(Port) -&gt;
- {ok, #hostent{h_addr_list = [IP|_]}} = inet:gethostbyname(Host),
- io:format("~w -&gt; ~w~n", [Host, IP]),
- server([IP, list_to_integer(Port)]).
-
- server(IP, Port) when is_tuple(IP) orelse IP == any orelse IP == loopback,
- is_integer(Port) -&gt;
- {ok,S} = gen_sctp:open(Port, [{recbuf,65536}, {ip,IP}]),
- io:format("Listening on ~w:~w. ~w~n", [IP,Port,S]),
- ok = gen_sctp:listen(S, true),
- server_loop(S).
-
- server_loop(S) -&gt;
- case gen_sctp:recv(S) of
- {error, Error} -&gt;
- io:format("SCTP RECV ERROR: ~p~n", [Error]);
- Data -&gt;
- io:format("Received: ~p~n", [Data])
- end,
- server_loop(S). </pre>
- </item>
- <item>
- <p>Example of an Erlang SCTP Client which interacts with the above Server.
- Note that in this example, the Client creates an association with
- the Server with 5 outbound streams. For this reason, sending of
- "Test 0" over Stream 0 succeeds, but sending of "Test 5"
- over Stream 5 fails. The client then <c>abort</c>s the association,
- which results in the corresponding Event being received on
- the Server side.</p>
-<pre> -module(sctp_client).
-
- -export([client/0, client/1, client/2]).
- -include_lib("kernel/include/inet.hrl").
- -include_lib("kernel/include/inet_sctp.hrl").
+ <title>SCTP Examples</title>
+ <p>Example of an Erlang SCTP server that receives SCTP messages and
+ prints them on the standard output:</p>
+ <pre>
+-module(sctp_server).
+
+-export([server/0,server/1,server/2]).
+-include_lib("kernel/include/inet.hrl").
+-include_lib("kernel/include/inet_sctp.hrl").
+
+server() -&gt;
+ server(any, 2006).
+
+server([Host,Port]) when is_list(Host), is_list(Port) -&gt;
+ {ok, #hostent{h_addr_list = [IP|_]}} = inet:gethostbyname(Host),
+ io:format("~w -&gt; ~w~n", [Host, IP]),
+ server([IP, list_to_integer(Port)]).
+
+server(IP, Port) when is_tuple(IP) orelse IP == any orelse IP == loopback,
+ is_integer(Port) -&gt;
+ {ok,S} = gen_sctp:open(Port, [{recbuf,65536}, {ip,IP}]),
+ io:format("Listening on ~w:~w. ~w~n", [IP,Port,S]),
+ ok = gen_sctp:listen(S, true),
+ server_loop(S).
+
+server_loop(S) -&gt;
+ case gen_sctp:recv(S) of
+ {error, Error} -&gt;
+ io:format("SCTP RECV ERROR: ~p~n", [Error]);
+ Data -&gt;
+ io:format("Received: ~p~n", [Data])
+ end,
+ server_loop(S).</pre>
+ <p>Example of an Erlang SCTP client interacting with the above server.
+ Notice that in this example the client creates an association with
+ the server with 5 outbound streams. Therefore, sending of
+ <c>"Test 0"</c> over stream 0 succeeds, but sending of <c>"Test 5"</c>
+ over stream 5 fails. The client then <c>abort</c>s the association,
+ which results in that the corresponding event is received on
+ the server side.</p>
+ <pre>
+-module(sctp_client).
+
+-export([client/0, client/1, client/2]).
+-include_lib("kernel/include/inet.hrl").
+-include_lib("kernel/include/inet_sctp.hrl").
+
+client() -&gt;
+ client([localhost]).
+
+client([Host]) -&gt;
+ client(Host, 2006);
- client() -&gt;
- client([localhost]).
-
- client([Host]) -&gt;
- client(Host, 2006);
-
- client([Host, Port]) when is_list(Host), is_list(Port) -&gt;
- client(Host,list_to_integer(Port)),
- init:stop().
-
- client(Host, Port) when is_integer(Port) -&gt;
- {ok,S} = gen_sctp:open(),
- {ok,Assoc} = gen_sctp:connect
- (S, Host, Port, [{sctp_initmsg,#sctp_initmsg{num_ostreams=5}}]),
- io:format("Connection Successful, Assoc=~p~n", [Assoc]),
-
- io:write(gen_sctp:send(S, Assoc, 0, &lt;&lt;"Test 0"&gt;&gt;)),
- io:nl(),
- timer:sleep(10000),
- io:write(gen_sctp:send(S, Assoc, 5, &lt;&lt;"Test 5"&gt;&gt;)),
- io:nl(),
- timer:sleep(10000),
- io:write(gen_sctp:abort(S, Assoc)),
- io:nl(),
-
- timer:sleep(1000),
- gen_sctp:close(S). </pre>
- </item>
- <item>
- <p>A very simple Erlang SCTP Client which uses the
- connect_init API.</p>
-<pre>-module(ex3).
+client([Host, Port]) when is_list(Host), is_list(Port) -&gt;
+ client(Host,list_to_integer(Port)),
+ init:stop().
+
+client(Host, Port) when is_integer(Port) -&gt;
+ {ok,S} = gen_sctp:open(),
+ {ok,Assoc} = gen_sctp:connect
+ (S, Host, Port, [{sctp_initmsg,#sctp_initmsg{num_ostreams=5}}]),
+ io:format("Connection Successful, Assoc=~p~n", [Assoc]),
+
+ io:write(gen_sctp:send(S, Assoc, 0, &lt;&lt;"Test 0"&gt;&gt;)),
+ io:nl(),
+ timer:sleep(10000),
+ io:write(gen_sctp:send(S, Assoc, 5, &lt;&lt;"Test 5"&gt;&gt;)),
+ io:nl(),
+ timer:sleep(10000),
+ io:write(gen_sctp:abort(S, Assoc)),
+ io:nl(),
+
+ timer:sleep(1000),
+ gen_sctp:close(S).</pre>
+ <p>A simple Erlang SCTP client that uses the <c>connect_init</c> API:</p>
+ <pre>
+-module(ex3).
-export([client/4]).
-include_lib("kernel/include/inet.hrl").
@@ -1099,7 +1104,7 @@ client_loop(S, Peer1, Port1, AssocId1, Peer2, Port2, AssocId2) -&gt;
io:format("Association 2 connect result: ~p. AssocId: ~p~n",
[SAC#sctp_assoc_change.state, SAC#sctp_assoc_change.assoc_id]),
client_loop(S, Peer1, Port1, AssocId1, Peer2, Port2,
- SAC#sctp_assoc_change.assoc_id);
+ SAC#sctp_assoc_change.assoc_id);
{sctp, S, Peer1, Port1, Data} -&gt;
io:format("Association 1: received ~p~n", [Data]),
@@ -1118,20 +1123,19 @@ client_loop(S, Peer1, Port1, AssocId1, Peer2, Port2, AssocId2) -&gt;
after 5000 -&gt;
ok
- end.
-</pre>
- </item>
- </list>
+ end.</pre>
</section>
<section>
<marker id="seealso"></marker>
- <title>SEE ALSO</title>
- <p><seealso marker="inet">inet(3)</seealso>,
- <seealso marker="gen_tcp">gen_tcp(3)</seealso>,
- <seealso marker="gen_udp">gen_udp(3)</seealso>,
- <url href="http://www.rfc-archive.org/getrfc.php?rfc=2960">RFC2960</url> (Stream Control Transmission Protocol),
- <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">Sockets API Extensions for SCTP.</url></p>
+ <title>See Also</title>
+ <p><seealso marker="gen_tcp"><c>gen_tcp(3)</c></seealso>,
+ <seealso marker="gen_udp"><c>gen_udp(3)</c></seealso>,
+ <seealso marker="inet"><c>inet(3)</c></seealso>,
+ <url href="http://www.rfc-archive.org/getrfc.php?rfc=2960">RFC 2960</url>
+ (Stream Control Transmission Protocol),
+ <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">Sockets
+ API Extensions for SCTP</url></p>
</section>
</erlref>
diff --git a/lib/kernel/doc/src/gen_tcp.xml b/lib/kernel/doc/src/gen_tcp.xml
index 6a19e76c4f..919178195f 100644
--- a/lib/kernel/doc/src/gen_tcp.xml
+++ b/lib/kernel/doc/src/gen_tcp.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -21,7 +21,6 @@
limitations under the License.
</legalnotice>
-
<title>gen_tcp</title>
<prepared>[email protected]</prepared>
<docno></docno>
@@ -29,13 +28,13 @@
<rev>A</rev>
</header>
<module>gen_tcp</module>
- <modulesummary>Interface to TCP/IP sockets</modulesummary>
+ <modulesummary>Interface to TCP/IP sockets.</modulesummary>
<description>
- <p>The <c>gen_tcp</c> module provides functions for communicating
+ <p>This module provides functions for communicating
with sockets using the TCP/IP protocol.</p>
- <p>The following code fragment provides a simple example of
+ <p>The following code fragment is a simple example of
a client connecting to a server at port 5678, transferring a
- binary and closing the connection:</p>
+ binary, and closing the connection:</p>
<code type="none">
client() ->
SomeHostInNet = "localhost", % to make it runnable on one machine
@@ -43,8 +42,8 @@ client() ->
[binary, {packet, 0}]),
ok = gen_tcp:send(Sock, "Some Data"),
ok = gen_tcp:close(Sock).</code>
- <p>At the other end a server is listening on port 5678, accepts
- the connection and receives the binary:</p>
+ <p>At the other end, a server is listening on port 5678, accepts
+ the connection, and receives the binary:</p>
<code type="none">
server() ->
{ok, LSock} = gen_tcp:listen(5678, [binary, {packet, 0},
@@ -61,7 +60,8 @@ do_recv(Sock, Bs) ->
{error, closed} ->
{ok, list_to_binary(Bs)}
end.</code>
- <p>For more examples, see the <seealso marker="#examples">examples</seealso> section.</p>
+ <p>For more examples, see section
+ <seealso marker="#examples">Examples</seealso>.</p>
</description>
<datatypes>
@@ -79,9 +79,10 @@ do_recv(Sock, Bs) ->
</datatype>
<datatype>
<name>socket()</name>
- <desc>
- <p><marker id="type-socket"/>
- As returned by accept/1,2 and connect/3,4.</p>
+ <desc><p><marker id="type-socket"/>
+ As returned by
+ <seealso marker="#accept/1"><c>accept/1,2</c></seealso> and
+ <seealso marker="#connect/3"><c>connect/3,4</c></seealso>.</p>
<marker id="connect"></marker>
</desc>
</datatype>
@@ -89,285 +90,256 @@ do_recv(Sock, Bs) ->
<funcs>
<func>
+ <name name="accept" arity="1"/>
+ <name name="accept" arity="2"/>
+ <fsummary>Accept an incoming connection request on a listening socket.</fsummary>
+ <type_desc variable="ListenSocket">Returned by
+ <seealso marker="#listen/2"><c>listen/2</c></seealso>.
+ </type_desc>
+ <desc>
+ <p>Accepts an incoming connection request on a listening socket.
+ <c><anno>Socket</anno></c> must be a socket returned from
+ <seealso marker="#listen/2"><c>listen/2</c></seealso>.
+ <c><anno>Timeout</anno></c> specifies a time-out value in
+ milliseconds. Defaults to <c>infinity</c>.</p>
+ <p>Returns:</p>
+ <list type="bulleted">
+ <item><p><c>{ok, <anno>Socket</anno>}</c> if a connection is
+ established</p></item>
+ <item><p><c>{error, closed}</c> if <c><anno>ListenSocket</anno></c>
+ is closed</p></item>
+ <item><p><c>{error, timeout}</c> if no connection is established
+ within the specified time</p></item>
+ <item><p><c>{error, system_limit}</c> if all available ports in the
+ Erlang emulator are in use</p></item>
+ <item><p>A POSIX error value if something else goes wrong, see
+ <seealso marker="inet"><c>inet(3)</c></seealso> for possible
+ error values</p></item>
+ </list>
+ <p>Packets can be sent to the returned socket <c><anno>Socket</anno></c>
+ using
+ <seealso marker="#send/2"><c>send/2</c></seealso>.
+ Packets sent from the peer are delivered as messages (unless
+ <c>{active, false}</c> is specified in the option list for the
+ listening socket, in which case packets are retrieved by calling
+ <seealso marker="#recv/2"><c>recv/2</c></seealso>):</p>
+ <code type="none">
+{tcp, Socket, Data}</code>
+ <note>
+ <p>The <c>accept</c> call does
+ <em>not</em> have to be issued from the socket owner
+ process. Using version 5.5.3 and higher of the emulator,
+ multiple simultaneous accept calls can be issued from
+ different processes, which allows for a pool of acceptor
+ processes handling incoming connections.</p>
+ </note>
+ </desc>
+ </func>
+
+ <func>
+ <name name="close" arity="1"/>
+ <fsummary>Close a TCP socket.</fsummary>
+ <desc>
+ <p>Closes a TCP socket.</p>
+ </desc>
+ </func>
+
+ <func>
<name name="connect" arity="3"/>
<name name="connect" arity="4"/>
- <fsummary>Connect to a TCP port</fsummary>
+ <fsummary>Connect to a TCP port.</fsummary>
<desc>
<p>Connects to a server on TCP port <c><anno>Port</anno></c> on the host
- with IP address <c><anno>Address</anno></c>. The <c><anno>Address</anno></c> argument
- can be either a hostname, or an IP address.</p>
- <p>The available options are:</p>
+ with IP address <c><anno>Address</anno></c>. Argument
+ <c><anno>Address</anno></c> can be a hostname or an IP address.</p>
+ <p>The following options are available:</p>
<taglist>
- <tag><c>{ip, ip_address()}</c></tag>
- <item>
- <p>If the host has several network interfaces, this option
- specifies which one to use.</p>
+ <tag><c>{ip, ip_address()}</c></tag>
+ <item><p>If the host has many network interfaces, this option
+ specifies which one to use.</p></item>
+ <tag><c>{ifaddr, ip_address()}</c></tag>
+ <item><p>Same as <c>{ip, ip_address()}</c>. If the host has many
+ network interfaces, this option specifies which one to use.</p>
</item>
-
- <tag><c>{ifaddr, ip_address()}</c></tag>
- <item>
- <p>Same as <c>{ip, ip_address()}</c>. If the host has several network interfaces, this option
- specifies which one to use.</p>
- </item>
-
<tag><c>{fd, integer() >= 0}</c></tag>
- <item>
- <p>If a socket has somehow been connected without using
- <c>gen_tcp</c>, use this option to pass the file
- descriptor for it. If <c>{ip, ip_address()}</c>
- and/or <c>{port, port_number()}</c> is combined with
- this option the fd will be bound to the given interface
- and port before connecting. If these options are not given
- it is assumed that the fd is already bound appropriately.
- </p>
- </item>
-
+ <item><p>If a socket has somehow been connected without using
+ <c>gen_tcp</c>, use this option to pass the file descriptor
+ for it. If <c>{ip, ip_address()}</c> and/or
+ <c>{port, port_number()}</c> is combined with this option, the
+ <c>fd</c> is bound to the specified interface and port before
+ connecting. If these options are not specified, it is assumed that
+ the <c>fd</c> is already bound appropriately.</p></item>
<tag><c>inet</c></tag>
- <item>
- <p>Set up the socket for IPv4.</p>
- </item>
-
- <tag><c>inet6</c></tag>
- <item>
- <p>Set up the socket for IPv6.</p>
- </item>
-
+ <item><p>Sets up the socket for IPv4.</p></item>
+ <tag><c>inet6</c></tag>
+ <item><p>Sets up the socket for IPv6.</p></item>
<tag><c>{port, Port}</c></tag>
- <item>
- <p>Specify which local port number to use.</p>
- </item>
-
- <tag><c>{tcp_module, module()}</c></tag>
- <item> <p>
- Override which callback module is used. Defaults to
- <c>inet_tcp</c> for IPv4 and <c>inet6_tcp</c> for IPv6.
- </p>
- </item>
-
+ <item><p>Specifies which local port number to use.</p></item>
+ <tag><c>{tcp_module, module()}</c></tag>
+ <item><p>Overrides which callback module is used. Defaults to
+ <c>inet_tcp</c> for IPv4 and <c>inet6_tcp</c> for IPv6.</p></item>
<tag><c>Opt</c></tag>
- <item>
- <p>See
- <seealso marker="inet#setopts/2">inet:setopts/2</seealso>.</p>
+ <item><p>See
+ <seealso marker="inet#setopts/2"><c>inet:setopts/2</c></seealso>.</p>
</item>
</taglist>
<p>Packets can be sent to the returned socket <c><anno>Socket</anno></c>
- using <c>send/2</c>. Packets sent from the peer are delivered
- as messages:</p>
+ using <seealso marker="#send/2"><c>send/2</c></seealso>.
+ Packets sent from the peer are delivered as messages:</p>
<code type="none">
{tcp, Socket, Data}</code>
- <p>If the socket is in <c>{active, N}</c> mode (see <seealso marker="inet#setopts/2">
- inet:setopts/2</seealso> for details) and its message counter
- drops to 0, the following message is delivered to indicate that the
+ <p>If the socket is in <c>{active, N}</c> mode (see
+ <seealso marker="inet#setopts/2"><c>inet:setopts/2</c></seealso>
+ for details) and its message counter drops to <c>0</c>, the following
+ message is delivered to indicate that the
socket has transitioned to passive (<c>{active, false}</c>) mode:</p>
<code type="none">
{tcp_passive, Socket}</code>
<p>If the socket is closed, the following message is delivered:</p>
<code type="none">
{tcp_closed, Socket}</code>
- <p>If an error occurs on the socket, the following message is
- delivered:</p>
+ <p>If an error occurs on the socket, the following message is delivered
+ (unless <c>{active, false}</c> is specified in the option list for
+ the socket, in which case packets are retrieved by calling
+ <seealso marker="#recv/2"><c>recv/2</c></seealso>):</p>
<code type="none">
{tcp_error, Socket, Reason}</code>
- <p>unless <c>{active, false}</c> is specified in the option list
- for the socket, in which case packets are retrieved by
- calling <c>recv/2</c>.</p>
- <p>The optional <c><anno>Timeout</anno></c> parameter specifies a timeout in
- milliseconds. The default value is <c>infinity</c>.</p>
+ <p>The optional <c><anno>Timeout</anno></c> parameter specifies a
+ time-out in milliseconds. Defaults to <c>infinity</c>.</p>
<note>
- <p>The default values for options given to <c>connect</c> can
- be affected by the Kernel configuration parameter
- <c>inet_default_connect_options</c>. See
- <seealso marker="inet">inet(3)</seealso> for details.</p>
+ <p>The default values for options specified to <c>connect</c> can
+ be affected by the <c>Kernel</c> configuration parameter
+ <c>inet_default_connect_options</c>. For details, see
+ <seealso marker="inet"><c>inet(3)</c></seealso>.</p>
</note>
</desc>
</func>
+
+ <func>
+ <name name="controlling_process" arity="2"/>
+ <fsummary>Change controlling process of a socket.</fsummary>
+ <desc>
+ <p>Assigns a new controlling process <c><anno>Pid</anno></c> to
+ <c><anno>Socket</anno></c>. The controlling process is the process
+ that receives messages from the socket. If called by any other
+ process than the current controlling process,
+ <c>{error, not_owner}</c> is returned.</p>
+ </desc>
+ </func>
+
<func>
<name name="listen" arity="2"/>
- <fsummary>Set up a socket to listen on a port</fsummary>
+ <fsummary>Set up a socket to listen on a port.</fsummary>
<desc>
- <p>Sets up a socket to listen on the port <c><anno>Port</anno></c> on
+ <p>Sets up a socket to listen on port <c><anno>Port</anno></c> on
the local host.</p>
- <p>If <c><anno>Port</anno> == 0</c>, the underlying OS assigns an available
- port number, use <c>inet:port/1</c> to retrieve it.</p>
- <p>The available options are:</p>
+ <p>If <c><anno>Port</anno> == 0</c>, the underlying OS assigns an
+ available port number, use
+ <seealso marker="inet#port/1"><c>inet:port/1</c></seealso>
+ to retrieve it.</p>
+ <p>The following options are available:</p>
<taglist>
<tag><c>list</c></tag>
- <item>
- <p>Received <c>Packet</c> is delivered as a list.</p>
- </item>
+ <item><p>Received <c>Packet</c> is delivered as a list.</p></item>
<tag><c>binary</c></tag>
- <item>
- <p>Received <c>Packet</c> is delivered as a binary.</p>
- </item>
+ <item><p>Received <c>Packet</c> is delivered as a binary.</p></item>
<tag><c>{backlog, B}</c></tag>
- <item>
- <p><c>B</c> is an integer &gt;= 0. The backlog value defaults
- to 5. The backlog value defines the maximum length that
- the queue of pending connections may grow to.</p>
- </item>
+ <item><p><c>B</c> is an integer &gt;= <c>0</c>. The backlog value
+ defines the maximum length that the queue of pending connections
+ can grow to. Defaults to <c>5</c>.</p></item>
<tag><c>{ip, ip_address()}</c></tag>
- <item>
- <p>If the host has several network interfaces, this option
- specifies which one to listen on.</p>
- </item>
+ <item><p>If the host has many network interfaces, this option
+ specifies which one to listen on.</p></item>
<tag><c>{port, Port}</c></tag>
- <item>
- <p>Specify which local port number to use.</p>
- </item>
+ <item><p>Specifies which local port number to use.</p></item>
<tag><c>{fd, Fd}</c></tag>
- <item>
- <p>If a socket has somehow been connected without using
- <c>gen_tcp</c>, use this option to pass the file
- descriptor for it.</p>
+ <item><p>If a socket has somehow been connected without using
+ <c>gen_tcp</c>, use this option to pass the file
+ descriptor for it.</p></item>
+ <tag><c>{ifaddr, ip_address()}</c></tag>
+ <item><p>Same as <c>{ip, ip_address()}</c>. If the host has many
+ network interfaces, this option specifies which one to use.</p>
</item>
-
- <tag><c>{ifaddr, ip_address()}</c></tag>
- <item>
- <p>Same as <c>{ip, ip_address()}</c>. If the host has several network interfaces, this option
- specifies which one to use.</p>
- </item>
-
<tag><c>inet6</c></tag>
- <item>
- <p>Set up the socket for IPv6.</p>
- </item>
+ <item><p>Sets up the socket for IPv6.</p></item>
<tag><c>inet</c></tag>
- <item>
- <p>Set up the socket for IPv4.</p>
- </item>
-
- <tag><c>{tcp_module, module()}</c></tag>
- <item> <p>
- Override which callback module is used. Defaults to
- <c>inet_tcp</c> for IPv4 and <c>inet6_tcp</c> for IPv6.
- </p>
- </item>
-
+ <item><p>Sets up the socket for IPv4.</p></item>
+ <tag><c>{tcp_module, module()}</c></tag>
+ <item><p>Overrides which callback module is used. Defaults to
+ <c>inet_tcp</c> for IPv4 and <c>inet6_tcp</c> for IPv6.</p></item>
<tag><c>Opt</c></tag>
- <item>
- <p>See
- <seealso marker="inet#setopts/2">inet:setopts/2</seealso>.</p>
- </item>
+ <item><p>See
+ <seealso marker="inet#setopts/2"><c>inet:setopts/2</c></seealso>.
+ </p></item>
</taglist>
- <p>The returned socket <c><anno>ListenSocket</anno></c> can only be used in
- calls to <c>accept/1,2</c>.</p>
+ <p>The returned socket <c><anno>ListenSocket</anno></c> can only be
+ used in calls to
+ <seealso marker="#accept/1"><c>accept/1,2</c></seealso>.</p>
<note>
- <p>The default values for options given to <c>listen</c> can
- be affected by the Kernel configuration parameter
- <c>inet_default_listen_options</c>. See
- <seealso marker="inet">inet(3)</seealso> for details.</p>
+ <p>The default values for options specified to <c>listen</c> can
+ be affected by the <c>Kernel</c> configuration parameter
+ <c>inet_default_listen_options</c>. For details, see
+ <seealso marker="inet"><c>inet(3)</c></seealso>.</p>
</note>
</desc>
</func>
- <func>
- <name name="accept" arity="1"/>
- <name name="accept" arity="2"/>
- <fsummary>Accept an incoming connection request on a listen socket</fsummary>
- <type_desc variable="ListenSocket">Returned by <c>listen/2</c>.
- </type_desc>
- <desc>
- <p>Accepts an incoming connection request on a listen socket.
- <c><anno>Socket</anno></c> must be a socket returned from <c>listen/2</c>.
- <c><anno>Timeout</anno></c> specifies a timeout value in ms, defaults to
- <c>infinity</c>.</p>
- <p>Returns <c>{ok, <anno>Socket</anno>}</c> if a connection is established,
- or <c>{error, closed}</c> if <c><anno>ListenSocket</anno></c> is closed,
- or <c>{error, timeout}</c> if no connection is established
- within the specified time,
- or <c>{error, system_limit}</c> if all available ports in the
- Erlang emulator are in use. May also return a POSIX error
- value if something else goes wrong, see inet(3) for possible
- error values.</p>
- <p>Packets can be sent to the returned socket <c><anno>Socket</anno></c>
- using <c>send/2</c>. Packets sent from the peer are delivered
- as messages:</p>
- <code type="none">
-{tcp, Socket, Data}</code>
- <p>unless <c>{active, false}</c> was specified in the option
- list for the listen socket, in which case packets are
- retrieved by calling <c>recv/2</c>.</p>
- <note>
- <p>It is worth noting that the <c>accept</c> call does
- <em>not</em> have to be issued from the socket owner
- process. Using version 5.5.3 and higher of the emulator,
- multiple simultaneous accept calls can be issued from
- different processes, which allows for a pool of acceptor
- processes handling incoming connections.</p>
- </note>
- </desc>
- </func>
- <func>
- <name name="send" arity="2"/>
- <fsummary>Send a packet</fsummary>
- <desc>
- <p>Sends a packet on a socket. </p>
- <p>There is no <c>send</c> call with timeout option, you use the
- <c>send_timeout</c> socket option if timeouts are
- desired. See the <seealso marker="#examples">examples</seealso> section.</p>
- </desc>
- </func>
+
<func>
<name name="recv" arity="2"/>
<name name="recv" arity="3"/>
- <fsummary>Receive a packet from a passive socket</fsummary>
+ <fsummary>Receive a packet from a passive socket.</fsummary>
<type_desc variable="HttpPacket">See the description of
- <c>HttpPacket</c> in <seealso marker="erts:erlang#decode_packet/3">
- erlang:decode_packet/3</seealso>.
+ <c>HttpPacket</c> in
+ <seealso marker="erts:erlang#decode_packet/3"><c>erlang:decode_packet/3</c></seealso>
+ in <c>ERTS</c>.
</type_desc>
<desc>
- <p>This function receives a packet from a socket in passive
- mode. A closed socket is indicated by a return value
+ <p>Receives a packet from a socket in passive
+ mode. A closed socket is indicated by return value
<c>{error, closed}</c>.</p>
- <p>The <c><anno>Length</anno></c> argument is only meaningful when
+ <p>Argument <c><anno>Length</anno></c> is only meaningful when
the socket is in <c>raw</c> mode and denotes the number of
- bytes to read. If <c><anno>Length</anno></c> = 0, all available bytes are
- returned. If <c><anno>Length</anno></c> &gt; 0, exactly <c><anno>Length</anno></c>
- bytes are returned, or an error; possibly discarding less
- than <c><anno>Length</anno></c> bytes of data when the socket gets closed
- from the other side.</p>
- <p>The optional <c><anno>Timeout</anno></c> parameter specifies a timeout in
- milliseconds. The default value is <c>infinity</c>.</p>
- </desc>
- </func>
- <func>
- <name name="controlling_process" arity="2"/>
- <fsummary>Change controlling process of a socket</fsummary>
- <desc>
- <p>Assigns a new controlling process <c><anno>Pid</anno></c> to
- <c><anno>Socket</anno></c>. The controlling process is the process which
- receives messages from the socket. If called by any other
- process than the current controlling process,
- <c>{error, not_owner}</c> is returned.</p>
+ bytes to read. If <c><anno>Length</anno></c> is <c>0</c>, all
+ available bytes are returned.
+ If <c><anno>Length</anno></c> &gt; <c>0</c>, exactly
+ <c><anno>Length</anno></c> bytes are returned, or an error;
+ possibly discarding less than <c><anno>Length</anno></c> bytes of
+ data when the socket is closed from the other side.</p>
+ <p>The optional <c><anno>Timeout</anno></c> parameter specifies a
+ time-out in milliseconds. Defaults to <c>infinity</c>.</p>
</desc>
</func>
+
<func>
- <name name="close" arity="1"/>
- <fsummary>Close a TCP socket</fsummary>
+ <name name="send" arity="2"/>
+ <fsummary>Send a packet.</fsummary>
<desc>
- <p>Closes a TCP socket.</p>
+ <p>Sends a packet on a socket.</p>
+ <p>There is no <c>send</c> call with a time-out option, use socket
+ option <c>send_timeout</c> if time-outs are desired. See section
+ <seealso marker="#examples">Examples</seealso>.</p>
</desc>
</func>
+
<func>
<name name="shutdown" arity="2"/>
- <fsummary>Asynchronously close a socket</fsummary>
+ <fsummary>Asynchronously close a socket.</fsummary>
<desc>
- <p>Close a socket in one or two directions.</p>
- <p><c><anno>How</anno> == write</c> means closing the socket for writing,
- reading from it is still possible.</p>
- <p>If <c><anno>How</anno> == read</c>, or there is no outgoing
+ <p>Closes a socket in one or two directions.</p>
+ <p><c><anno>How</anno> == write</c> means closing the socket for
+ writing, reading from it is still possible.</p>
+ <p>If <c><anno>How</anno> == read</c> or there is no outgoing
data buffered in the <c><anno>Socket</anno></c> port,
- then the socket is shutdown immediately and any error encountered
+ the socket is shut down immediately and any error encountered
is returned in <c><anno>Reason</anno></c>.</p>
- <p>If there is data buffered in the socket port, then the attempt
+ <p>If there is data buffered in the socket port, the attempt
to shutdown the socket is postponed until that data is written to the
- kernel socket send buffer. Any errors encountered will result
- in the socket being closed and <c>{error, closed}</c> being returned
- on the next
- <seealso marker="gen_tcp#recv/2">recv/2</seealso> or
- <seealso marker="gen_tcp#send/2">send/2</seealso>.</p>
- <p>To be able to handle that the peer has done a shutdown on
- the write side, the <c>{exit_on_close, false}</c> option
- is useful.</p>
+ kernel socket send buffer. If any errors are encountered, the socket
+ is closed and <c>{error, closed}</c> is returned on the next
+ <seealso marker="#recv/2"><c>recv/2</c></seealso> or
+ <seealso marker="#send/2"><c>send/2</c></seealso>.</p>
+ <p>Option <c>{exit_on_close, false}</c> is useful if the peer has done
+ a shutdown on the write side.</p>
</desc>
</func>
</funcs>
@@ -375,14 +347,14 @@ do_recv(Sock, Bs) ->
<section>
<title>Examples</title>
<marker id="examples"></marker>
- <p>The following example illustrates usage of the {active,once}
- option and multiple accepts by implementing a server as a
- number of worker processes doing accept on one single listen
- socket. The start/2 function takes the number of worker
- processes as well as a port number to listen for incoming
- connections on. If <c>LPort</c> is specified as <c>0</c>, an
- ephemeral portnumber is used, why the start function returns
- the actual portnumber allocated:</p>
+ <p>The following example illustrates use of option
+ <c>{active,once}</c> and multiple accepts by implementing a server
+ as a number of worker processes doing accept on a single listening
+ socket. Function <c>start/2</c> takes the number of worker
+ processes and the port number on which to listen for incoming
+ connections. If <c>LPort</c> is specified as <c>0</c>, an
+ ephemeral port number is used, which is why the start function
+ returns the actual port number allocated:</p>
<code type="none">
start(Num,LPort) ->
case gen_tcp:listen(LPort,[{active, false},{packet,2}]) of
@@ -421,7 +393,7 @@ loop(S) ->
io:format("Socket ~w closed [~w]~n",[S,self()]),
ok
end.</code>
- <p>A simple client could look like this:</p>
+ <p>Example of a simple client:</p>
<code type="none">
client(PortNo,Message) ->
{ok,Sock} = gen_tcp:connect("localhost",PortNo,[{active,false},
@@ -430,30 +402,29 @@ client(PortNo,Message) ->
A = gen_tcp:recv(Sock,0),
gen_tcp:close(Sock),
A.</code>
- <p>The fact that the <c>send</c> call does not accept a timeout
- option, is because timeouts on send is handled through the socket
+ <p>The <c>send</c> call does not accept a time-out
+ option because time-outs on send is handled through socket
option <c>send_timeout</c>. The behavior of a send operation with
- no receiver is in a very high degree defined by the underlying TCP
- stack, as well as the network infrastructure. If one wants to write
- code that handles a hanging receiver that might eventually cause
- the sender to hang on a <c>send</c> call, one writes code like
- the following.</p>
- <p>Consider a process that receives data from a client process that
- is to be forwarded to a server on the network. The process has
- connected to the server via TCP/IP and does not get any acknowledge
- for each message it sends, but has to rely on the send timeout
- option to detect that the other end is unresponsive. We could use
- the <c>send_timeout</c> option when connecting:</p>
+ no receiver is mainly defined by the underlying TCP
+ stack and the network infrastructure. To write
+ code that handles a hanging receiver that can eventually cause
+ the sender to hang on a <c>send</c> do like the following.</p>
+ <p>Consider a process that receives data from a client process
+ to be forwarded to a server on the network. The process is
+ connected to the server through TCP/IP and does not get any acknowledge
+ for each message it sends, but has to rely on the send time-out
+ option to detect that the other end is unresponsive. Option
+ <c>send_timeout</c> can be used when connecting:</p>
<code type="none">
- ...
- {ok,Sock} = gen_tcp:connect(HostAddress, Port,
- [{active,false},
- {send_timeout, 5000},
- {packet,2}]),
- loop(Sock), % See below
- ... </code>
- <p>In the loop where requests are handled, we can now detect send
- timeouts:</p>
+...
+{ok,Sock} = gen_tcp:connect(HostAddress, Port,
+ [{active,false},
+ {send_timeout, 5000},
+ {packet,2}]),
+ loop(Sock), % See below
+...</code>
+ <p>In the loop where requests are handled, send time-outs can now be
+ detected:</p>
<code type="none">
loop(Sock) ->
receive
@@ -477,11 +448,11 @@ loop(Sock) ->
Client ! {self(), data_sent},
loop(Sock)
end
- end. </code>
- <p>Usually it would suffice to detect timeouts on receive, as most
+ end.</code>
+ <p>Usually it suffices to detect time-outs on receive, as most
protocols include some sort of acknowledgment from the server,
- but if the protocol is strictly one way, the <c>send_timeout</c>
- option comes in handy!</p>
+ but if the protocol is strictly one way, option <c>send_timeout</c>
+ comes in handy.</p>
</section>
</erlref>
diff --git a/lib/kernel/doc/src/gen_udp.xml b/lib/kernel/doc/src/gen_udp.xml
index 79cd87dcef..906883ed34 100644
--- a/lib/kernel/doc/src/gen_udp.xml
+++ b/lib/kernel/doc/src/gen_udp.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,9 +29,9 @@
<rev>A</rev>
</header>
<module>gen_udp</module>
- <modulesummary>Interface to UDP sockets</modulesummary>
+ <modulesummary>Interface to UDP sockets.</modulesummary>
<description>
- <p>The <c>gen_udp</c> module provides functions for communicating
+ <p>This module provides functions for communicating
with sockets using the UDP protocol.</p>
</description>
@@ -45,175 +45,140 @@
<datatype>
<name>socket()</name>
<desc>
- <p><marker id="type-socket"/>As returned by open/1,2.</p>
+ <marker id="type-socket"/>
+ <p>As returned by
+ <seealso marker="#open/1"><c>open/1,2</c></seealso>.</p>
</desc>
</datatype>
</datatypes>
<funcs>
<func>
+ <name name="close" arity="1"/>
+ <fsummary>Close a UDP socket.</fsummary>
+ <desc>
+ <p>Closes a UDP socket.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="controlling_process" arity="2"/>
+ <fsummary>Change controlling process of a socket.</fsummary>
+ <desc>
+ <p>Assigns a new controlling process <c><anno>Pid</anno></c> to
+ <c><anno>Socket</anno></c>. The controlling process is the process
+ that receives messages from the socket. If called by any other
+ process than the current controlling process,
+ <c>{error, not_owner}</c> is returned.</p>
+ </desc>
+ </func>
+
+ <func>
<name name="open" arity="1"/>
<name name="open" arity="2"/>
- <fsummary>Associate a UDP port number with the process calling it</fsummary>
+ <fsummary>Associate a UDP port number with the process calling it.</fsummary>
<desc>
- <p>Associates a UDP port number (<c><anno>Port</anno></c>) with the calling
- process.</p>
- <p>The available options are:</p>
+ <p>Associates a UDP port number (<c><anno>Port</anno></c>) with the
+ calling process.</p>
+ <p>The following options are available:</p>
<taglist>
<tag><c>list</c></tag>
- <item>
- <p>Received <c>Packet</c> is delivered as a list.</p>
- </item>
+ <item><p>Received <c>Packet</c> is delivered as a list.</p></item>
<tag><c>binary</c></tag>
- <item>
- <p>Received <c>Packet</c> is delivered as a binary.</p>
- </item>
+ <item><p>Received <c>Packet</c> is delivered as a binary.</p></item>
<tag><c>{ip, ip_address()}</c></tag>
- <item>
- <p>If the host has several network interfaces, this option
- specifies which one to use.</p>
- </item>
-
- <tag><c>{ifaddr, ip_address()}</c></tag>
- <item>
- <p>Same as <c>{ip, ip_address()}</c>. If the host has several network interfaces, this option
- specifies which one to use.</p>
- </item>
-
-
+ <item><p>If the host has many network interfaces, this option
+ specifies which one to use.</p></item>
+ <tag><c>{ifaddr, ip_address()}</c></tag>
+ <item><p>Same as <c>{ip, ip_address()}</c>. If the host has many
+ network interfaces, this option specifies which one to
+ use.</p></item>
<tag><c>{fd, integer() >= 0}</c></tag>
- <item>
- <p>If a socket has somehow been opened without using
- <c>gen_udp</c>, use this option to pass the file
- descriptor for it. If <c><anno>Port</anno></c> is not set to 0
- and/or <c>{ip, ip_address()}</c> is combined with this option
- the fd will be bound to the given interface and port after being
- opened. If these options are not given it is assumed that the fd
- is already bound appropriately.
- </p>
- </item>
+ <item><p>If a socket has somehow been opened without using
+ <c>gen_udp</c>, use this option to pass the file descriptor
+ for it. If <c><anno>Port</anno></c> is not set to <c>0</c> and/or
+ <c>{ip, ip_address()}</c> is combined with this option, the
+ <c>fd</c> is bound to the specified interface and port after it is
+ being opened. If these options are not specified, it is assumed that
+ the <c>fd</c> is already bound appropriately.</p></item>
<tag><c>inet6</c></tag>
- <item>
- <p>Set up the socket for IPv6.</p>
- </item>
+ <item><p>Sets up the socket for IPv6.</p></item>
<tag><c>inet</c></tag>
- <item>
- <p>Set up the socket for IPv4.</p>
- </item>
-
- <tag><c>{udp_module, module()}</c></tag>
- <item> <p>
- Override which callback module is used. Defaults to
- <c>inet_udp</c> for IPv4 and <c>inet6_udp</c> for IPv6.
- </p>
- </item>
-
+ <item><p>Sets up the socket for IPv4.</p></item>
+ <tag><c>{udp_module, module()}</c></tag>
+ <item><p>Overrides which callback module is used. Defaults to
+ <c>inet_udp</c> for IPv4 and <c>inet6_udp</c> for IPv6.</p></item>
<tag><c>{multicast_if, Address}</c></tag>
- <item>
- <p>Set the local device for a multicast socket.</p>
- </item>
-
+ <item><p>Sets the local device for a multicast socket.</p></item>
<tag><c>{multicast_loop, true | false}</c></tag>
- <item>
- <p>
- When <c>true</c> sent multicast packets will be looped back to the local
- sockets.
- </p>
- </item>
-
+ <item><p>When <c>true</c>, sent multicast packets are looped back to
+ the local sockets.</p></item>
<tag><c>{multicast_ttl, Integer}</c></tag>
- <item>
- <p>
- The <c>multicast_ttl</c> option changes the time-to-live (TTL) for
- outgoing multicast datagrams in order to control the scope of the
- multicasts.
- </p>
- <p>
- Datagrams with a TTL of 1 are not forwarded beyond the local
- network.
- <br />Default: 1
- </p>
- </item>
-
- <tag><c>{add_membership, {MultiAddress, InterfaceAddress}}</c></tag>
- <item>
- <p>Join a multicast group. </p>
- </item>
-
- <tag><c>{drop_membership, {MultiAddress, InterfaceAddress}}</c></tag>
- <item>
- <p>Leave multicast group.</p>
- </item>
-
+ <item><p>Option <c>multicast_ttl</c> changes the time-to-live (TTL)
+ for outgoing multicast datagrams to control the scope of the
+ multicasts.</p>
+ <p>Datagrams with a TTL of 1 are not forwarded beyond the local
+ network. Defaults to <c>1</c>.</p></item>
+ <tag><c>{add_membership, {MultiAddress, InterfaceAddress}}</c></tag>
+ <item><p>Joins a multicast group.</p></item>
+ <tag><c>{drop_membership, {MultiAddress, InterfaceAddress}}</c></tag>
+ <item><p>Leaves a multicast group.</p></item>
<tag><c>Opt</c></tag>
- <item>
- <p>See
- <seealso marker="inet#setopts/2">inet:setopts/2</seealso>.</p>
- </item>
+ <item><p>See
+ <seealso marker="inet#setopts/2"><c>inet:setopts/2</c></seealso>.
+ </p></item>
</taglist>
<p>The returned socket <c><anno>Socket</anno></c> is used to send
- packets from this port with <c>send/4</c>. When UDP packets arrive
- at the opened port, if the socket is in an active mode the packets
+ packets from this port with
+ <seealso marker="#send/4"><c>send/4</c></seealso>.
+ When UDP packets arrive
+ at the opened port, if the socket is in an active mode, the packets
are delivered as messages to the controlling process:</p>
<code type="none">
{udp, Socket, IP, InPortNo, Packet}</code>
<p>If the socket is not in an active mode, data can be
- retrieved via the <seealso marker="#recv/2">recv/2,3</seealso> calls.
- Note that arriving UDP packets that are longer than
- the receive buffer option specifies, might be truncated
+ retrieved through the
+ <seealso marker="#recv/2"><c>recv/2,3</c></seealso> calls.
+ Notice that arriving UDP packets that are longer than
+ the receive buffer option specifies can be truncated
without warning.</p>
- <p>When a socket in <c>{active, N}</c> mode (see <seealso marker="inet#setopts/2">
- inet:setopts/2</seealso> for details) transitions to passive
- (<c>{active, false}</c>) mode, the controlling process is notified by a
- message of the following form:</p>
+ <p>When a socket in <c>{active, N}</c> mode (see
+ <seealso marker="inet#setopts/2"><c>inet:setopts/2</c></seealso>
+ for details), transitions to passive (<c>{active, false}</c>) mode,
+ the controlling process is notified by a message of the following
+ form:</p>
<code type="none">
{udp_passive, Socket}</code>
<p><c>IP</c> and <c>InPortNo</c> define the address from which
- <c>Packet</c> came. <c>Packet</c> is a list of bytes if
- the option <c>list</c> was specified. <c>Packet</c> is a
- binary if the option <c>binary</c> was specified.</p>
+ <c>Packet</c> comes. <c>Packet</c> is a list of bytes if
+ option <c>list</c> is specified. <c>Packet</c> is a
+ binary if option <c>binary</c> is specified.</p>
<p>Default value for the receive buffer option is
<c>{recbuf, 8192}</c>.</p>
- <p>If <c><anno>Port</anno> == 0</c>, the underlying OS assigns a free UDP
- port, use <c>inet:port/1</c> to retrieve it.</p>
- </desc>
- </func>
- <func>
- <name name="send" arity="4"/>
- <fsummary>Send a packet</fsummary>
- <desc>
- <p>Sends a packet to the specified address and port.
- The <c><anno>Address</anno></c> argument can be either a hostname, or an
- IP address.</p>
+ <p>If <c><anno>Port</anno> == 0</c>, the underlying OS assigns a free
+ UDP port, use
+ <seealso marker="inet#port/1"><c>inet:port/1</c></seealso>
+ to retrieve it.</p>
</desc>
</func>
+
<func>
<name name="recv" arity="2"/>
<name name="recv" arity="3"/>
- <fsummary>Receive a packet from a passive socket</fsummary>
- <desc>
- <p>This function receives a packet from a socket in passive
- mode.</p>
- <p>The optional <c><anno>Timeout</anno></c> parameter specifies a timeout in
- milliseconds. The default value is <c>infinity</c>.</p>
- </desc>
- </func>
- <func>
- <name name="controlling_process" arity="2"/>
- <fsummary>Change controlling process of a socket</fsummary>
+ <fsummary>Receive a packet from a passive socket.</fsummary>
<desc>
- <p>Assigns a new controlling process <c><anno>Pid</anno></c> to
- <c><anno>Socket</anno></c>. The controlling process is the process which
- receives messages from the socket. If called by any other
- process than the current controlling process,
- <c>{error, not_owner}</c> is returned.</p>
+ <p>Receives a packet from a socket in passive mode. Optional parameter
+ <c><anno>Timeout</anno></c> specifies a time-out in milliseconds.
+ Defaults to <c>infinity</c>.</p>
</desc>
</func>
+
<func>
- <name name="close" arity="1"/>
- <fsummary>Close a UDP socket</fsummary>
+ <name name="send" arity="4"/>
+ <fsummary>Send a packet.</fsummary>
<desc>
- <p>Closes a UDP socket.</p>
+ <p>Sends a packet to the specified address and port. Argument
+ <c><anno>Address</anno></c> can be a hostname or an IP address.</p>
</desc>
</func>
</funcs>
diff --git a/lib/kernel/doc/src/global.xml b/lib/kernel/doc/src/global.xml
index bd75945115..4442741f54 100644
--- a/lib/kernel/doc/src/global.xml
+++ b/lib/kernel/doc/src/global.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,82 +29,67 @@
<rev></rev>
</header>
<module>global</module>
- <modulesummary>A Global Name Registration Facility</modulesummary>
+ <modulesummary>A global name registration facility.</modulesummary>
<description>
- <p>This documentation describes the Global module which consists
- of the following functionalities:</p>
-
+ <p>This module consists of the following services:</p>
<list type="bulleted">
- <item>registration of global names;</item>
- <item>global locks;</item>
- <item>maintenance of the fully connected network.</item>
+ <item>Registration of global names</item>
+ <item>Global locks</item>
+ <item>Maintenance of the fully connected network</item>
</list>
-
- <p>These services are controlled via the process
- <c>global_name_server</c> which exists on every node. The global
- name server is started automatically when a node is started.
+ <p>These services are controlled through the process
+ <c>global_name_server</c> that exists on every node. The global
+ name server starts automatically when a node is started.
With the term <em>global</em> is meant over a system consisting
- of several Erlang nodes.</p>
-
+ of many Erlang nodes.</p>
<p>The ability to globally register names is a central concept in
the programming of distributed Erlang systems. In this module,
the equivalent of the <c>register/2</c> and <c>whereis/1</c>
- BIFs (for local name registration) are implemented, but for a
+ BIFs (for local name registration) are provided, but for a
network of Erlang nodes. A registered name is an alias for a
process identifier (pid). The global name server monitors
- globally registered pids. If a process terminates, the name will
- also be globally unregistered.</p>
-
+ globally registered pids. If a process terminates, the name is
+ also globally unregistered.</p>
<p>The registered names are stored in replica global name tables on
every node. There is no central storage point. Thus,
the translation of a name to a pid is fast, as it is always done
- locally. When any action in taken which results in a change to
- the global name table, all tables on other nodes are automatically
- updated.</p>
-
+ locally. For any action resulting in a change to the global name table,
+ all tables on other nodes are automatically updated.</p>
<p>Global locks have lock identities and are set on a specific
- resource. For instance, the specified resource could be a pid.
+ resource. For example, the specified resource can be a pid.
When a global lock is set, access to the locked resource is
- denied for all other resources other than the lock requester.</p>
-
- <p>Both the registration and lock functionalities are atomic. All
- nodes involved in these actions will have the same view of
+ denied for all resources other than the lock requester.</p>
+ <p>Both the registration and lock services are atomic.
+ All nodes involved in these actions have the same view of
the information.</p>
-
<p>The global name server also performs the critical task of
- continuously monitoring changes in node configuration: if a node
- which runs a globally registered process goes down, the name
- will be globally unregistered. To this end the global name
+ continuously monitoring changes in node configuration. If a node
+ that runs a globally registered process goes down, the name
+ is globally unregistered. To this end, the global name
server subscribes to <c>nodeup</c> and <c>nodedown</c> messages
- sent from the <c>net_kernel</c> module. Relevant Kernel
+ sent from module <c>net_kernel</c>. Relevant Kernel
application variables in this context are <c>net_setuptime</c>,
<c>net_ticktime</c>, and <c>dist_auto_connect</c>. See also
- <seealso marker="kernel_app#net_setuptime">kernel(6)</seealso>.</p>
-
- <p>The name server will also maintain a fully connected network. For
+ <seealso marker="kernel_app#net_setuptime"><c>kernel(6)</c></seealso>.</p>
+ <p>The name server also maintains a fully connected network. For
example, if node <c>N1</c> connects to node <c>N2</c> (which is
already connected to <c>N3</c>), the global name servers on the
- nodes <c>N1</c> and <c>N3</c> will make sure that also <c>N1</c>
- and <c>N3</c> are connected. If this is not desired, the command
- line flag <c>-connect_all false</c> can be used (see also
- <seealso marker="erts:erl#connect_all">erl(1)</seealso>). In
- this case the name registration facility cannot be used, but the
- lock mechanism will still work.</p>
-
+ nodes <c>N1</c> and <c>N3</c> ensure that also <c>N1</c>
+ and <c>N3</c> are connected. If this is not desired,
+ command-line flag <c>-connect_all false</c> can be used (see also
+ <seealso marker="erts:erl#connect_all"><c>erl(1)</c></seealso>).
+ In this case, the name registration service cannot be used, but the
+ lock mechanism still works.</p>
<p>If the global name server fails to connect nodes (<c>N1</c> and
- <c>N3</c> in the example above) a warning event is sent to the
+ <c>N3</c> in the example), a warning event is sent to the
error logger. The presence of such an event does not exclude the
- possibility that the nodes will later connect--one can for
- example try the command <c>rpc:call(N1, net_adm, ping, [N2])</c> in
- the Erlang shell--but it indicates some kind of problem with
- the network.</p>
-
+ nodes to connect later (you can, for
+ example, try command <c>rpc:call(N1, net_adm, ping, [N2])</c> in
+ the Erlang shell), but it indicates a network problem.</p>
<note>
- <p>If the fully connected network is not set up properly, the
- first thing to try is to increase the value of
- <c>net_setuptime</c>.</p>
+ <p>If the fully connected network is not set up properly, try
+ first to increase the value of <c>net_setuptime</c>.</p>
</note>
-
</description>
<datatypes>
@@ -117,7 +102,7 @@
<func>
<name name="del_lock" arity="1"/>
<name name="del_lock" arity="2"/>
- <fsummary>Delete a lock</fsummary>
+ <fsummary>Delete a lock.</fsummary>
<desc>
<p>Deletes the lock <c><anno>Id</anno></c> synchronously.</p>
</desc>
@@ -125,11 +110,13 @@
<func>
<name name="notify_all_name" arity="3"/>
- <fsummary>Name resolving function that notifies both pids</fsummary>
+ <fsummary>Name resolving function that notifies both pids.</fsummary>
<desc>
- <p>This function can be used as a name resolving function for
- <c>register_name/3</c> and <c>re_register_name/3</c>. It
- unregisters both pids, and sends the message
+ <p>Can be used as a name resolving function for
+ <seealso marker="#register_name/3"><c>register_name/3</c></seealso>
+ and
+ <seealso marker="#re_register_name/3"><c>re_register_name/3</c></seealso>.</p>
+ <p>The function unregisters both pids and sends the message
<c>{global_name_conflict, <anno>Name</anno>, OtherPid}</c> to both
processes.</p>
</desc>
@@ -137,85 +124,97 @@
<func>
<name name="random_exit_name" arity="3"/>
- <fsummary>Name resolving function that kills one pid</fsummary>
+ <fsummary>Name resolving function that kills one pid.</fsummary>
<desc>
- <p>This function can be used as a name resolving function for
- <c>register_name/3</c> and <c>re_register_name/3</c>. It
- randomly chooses one of the pids for registration and kills
- the other one.</p>
+ <p>Can be used as a name resolving function for
+ <seealso marker="#register_name/3"><c>register_name/3</c></seealso>
+ and
+ <seealso marker="#re_register_name/3"><c>re_register_name/3</c></seealso>.</p>
+ <p>The function randomly selects one of the pids for registration and
+ kills the other one.</p>
</desc>
</func>
<func>
<name name="random_notify_name" arity="3"/>
- <fsummary>Name resolving function that notifies one pid</fsummary>
+ <fsummary>Name resolving function that notifies one pid.</fsummary>
<desc>
- <p>This function can be used as a name resolving function for
- <c>register_name/3</c> and <c>re_register_name/3</c>. It
- randomly chooses one of the pids for registration, and sends
- the message <c>{global_name_conflict, <anno>Name</anno>}</c> to the other
- pid.</p>
+ <p>Can be used as a name resolving function for
+ <seealso marker="#register_name/3"><c>register_name/3</c></seealso>
+ and
+ <seealso marker="#re_register_name/3"><c>re_register_name/3</c></seealso>.</p>
+ <p>The function randomly selects one of the pids for registration, and
+ sends the message <c>{global_name_conflict, <anno>Name</anno>}</c> to
+ the other pid.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="re_register_name" arity="2"/>
+ <name name="re_register_name" arity="3"/>
+ <fsummary>Atomically re-register a name.</fsummary>
+ <type name="method"/>
+ <type_desc name="method">{<c>Module</c>, <c>Function</c>}
+ is also allowed.
+ </type_desc>
+ <desc>
+ <p>Atomically changes the registered name <c><anno>Name</anno></c> on
+ all nodes to refer to <c><anno>Pid</anno></c>.</p>
+ <p>Function <c><anno>Resolve</anno></c> has the same behavior as in
+ <seealso marker="#register_name/2"><c>register_name/2,3</c></seealso>.
+ </p>
</desc>
</func>
<func>
<name name="register_name" arity="2"/>
<name name="register_name" arity="3"/>
- <fsummary>Globally register a name for a pid</fsummary>
+ <fsummary>Globally register a name for a pid.</fsummary>
<type name="method"/>
- <type_desc name="method">{<c>Module</c>, <c>Function</c>}
- is currently also allowed for backward compatibility, but its use is
- deprecated
+ <type_desc name="method">{<c>Module</c>, <c>Function</c>} is also
+ allowed for backward compatibility, but its use is deprecated.
</type_desc>
<desc>
- <p>Globally associates the name <c><anno>Name</anno></c> with a pid, that is,
- Globally notifies all nodes of a new global name in a network
+ <p>Globally associates name <c><anno>Name</anno></c> with a pid, that
+ is, globally notifies all nodes of a new global name in a network
of Erlang nodes.</p>
-
<p>When new nodes are added to the network, they are informed
of the globally registered names that already exist.
The network is also informed of any global names in newly
connected nodes. If any name clashes are discovered,
- the <c><anno>Resolve</anno></c> function is called. Its purpose is to
+ function <c><anno>Resolve</anno></c> is called. Its purpose is to
decide which pid is correct. If the function crashes, or
returns anything other than one of the pids, the name is
unregistered. This function is called once for each name
clash.</p>
-
<warning>
<p>If you plan to change code without restarting your system,
you must use an external fun (<c>fun Module:Function/Arity</c>)
- as the <c><anno>Resolve</anno></c> function; if you use a
- local fun you can never replace the code for the module that
- the fun belongs to.
- </p>
+ as function <c><anno>Resolve</anno></c>. If you use a
+ local fun, you can never replace the code for the module that
+ the fun belongs to.</p>
</warning>
-
- <p>There are three pre-defined resolve functions:
+ <p>Three predefined resolve functions exist:
<c>random_exit_name/3</c>, <c>random_notify_name/3</c>, and
- <c>notify_all_name/3</c>. If no <c><anno>Resolve</anno></c> function is
- defined, <c>random_exit_name</c> is used. This means that one
- of the two registered processes will be selected as correct
+ <c>notify_all_name/3</c>. If no <c><anno>Resolve</anno></c> function
+ is defined, <c>random_exit_name</c> is used. This means that one
+ of the two registered processes is selected as correct
while the other is killed.</p>
-
- <p>This function is completely synchronous. This means that
+ <p>This function is completely synchronous, that is,
when this function returns, the name is either registered on
all nodes or none.</p>
-
<p>The function returns <c>yes</c> if successful, <c>no</c> if
it fails. For example, <c>no</c> is returned if an attempt
is made to register an already registered process or to
register a process with a name that is already in use.</p>
-
<note>
- <p>Releases up to and including OTP R10 did not check if the
- process was already registered. As a consequence the
- global name table could become inconsistent. The old
+ <p>Releases up to and including Erlang/OTP R10 did not check if the
+ process was already registered. The global name table could
+ therefore become inconsistent. The old
(buggy) behavior can be chosen by giving the Kernel
application variable <c>global_multi_name_action</c> the
value <c>allow</c>.</p>
</note>
-
<p>If a process with a registered name dies, or the node goes
down, the name is unregistered on all nodes.</p>
</desc>
@@ -223,38 +222,20 @@
<func>
<name name="registered_names" arity="0"/>
- <fsummary>All globally registered names</fsummary>
- <desc>
- <p>Returns a lists of all globally registered names.</p>
- </desc>
- </func>
-
- <func>
- <name name="re_register_name" arity="2"/>
- <name name="re_register_name" arity="3"/>
- <fsummary>Atomically re-register a name</fsummary>
- <type name="method"/>
- <type_desc name="method">{<c>Module</c>, <c>Function</c>}
- is also allowed
- </type_desc>
+ <fsummary>All globally registered names.</fsummary>
<desc>
- <p>Atomically changes the registered name <c><anno>Name</anno></c> on all
- nodes to refer to <c><anno>Pid</anno></c>.</p>
-
- <p>The <c><anno>Resolve</anno></c> function has the same behavior as in
- <c>register_name/2,3</c>.</p>
+ <p>Returns a list of all globally registered names.</p>
</desc>
</func>
<func>
<name name="send" arity="2"/>
- <fsummary>Send a message to a globally registered pid</fsummary>
+ <fsummary>Send a message to a globally registered pid.</fsummary>
<desc>
- <p>Sends the message <c><anno>Msg</anno></c> to the pid globally registered
+ <p>Sends message <c><anno>Msg</anno></c> to the pid globally registered
as <c><anno>Name</anno></c>.</p>
-
- <p>Failure: If <c><anno>Name</anno></c> is not a globally registered
- name, the calling function will exit with reason
+ <p>If <c><anno>Name</anno></c> is not a globally registered
+ name, the calling function exits with reason
<c>{badarg, {<anno>Name</anno>, <anno>Msg</anno>}}</c>.</p>
</desc>
</func>
@@ -263,7 +244,7 @@
<name name="set_lock" arity="1"/>
<name name="set_lock" arity="2"/>
<name name="set_lock" arity="3"/>
- <fsummary>Set a lock on the specified nodes</fsummary>
+ <fsummary>Set a lock on the specified nodes.</fsummary>
<type name="id"/>
<type name="retries"/>
<desc>
@@ -271,50 +252,48 @@
are specified) on <c><anno>ResourceId</anno></c> for
<c><anno>LockRequesterId</anno></c>. If a lock already exists on
<c><anno>ResourceId</anno></c> for another requester than
- <c><anno>LockRequesterId</anno></c>, and <c><anno>Retries</anno></c> is not equal to 0,
- the process sleeps for a while and will try to execute
- the action later. When <c><anno>Retries</anno></c> attempts have been made,
- <c>false</c> is returned, otherwise <c>true</c>. If
- <c><anno>Retries</anno></c> is <c>infinity</c>, <c>true</c> is eventually
- returned (unless the lock is never released).</p>
-
- <p>If no value for <c><anno>Retries</anno></c> is given, <c>infinity</c> is
- used.</p>
-
+ <c><anno>LockRequesterId</anno></c>, and <c><anno>Retries</anno></c>
+ is not equal to <c>0</c>, the process sleeps for a while and tries
+ to execute the action later. When <c><anno>Retries</anno></c>
+ attempts have been made, <c>false</c> is returned, otherwise
+ <c>true</c>. If <c><anno>Retries</anno></c> is <c>infinity</c>,
+ <c>true</c> is eventually returned (unless the lock is never
+ released).</p>
+ <p>If no value for <c><anno>Retries</anno></c> is specified,
+ <c>infinity</c> is used.</p>
<p>This function is completely synchronous.</p>
-
- <p>If a process which holds a lock dies, or the node goes
+ <p>If a process that holds a lock dies, or the node goes
down, the locks held by the process are deleted.</p>
-
<p>The global name server keeps track of all processes sharing
the same lock, that is, if two processes set the same lock,
both processes must delete the lock.</p>
-
<p>This function does not address the problem of a deadlock. A
deadlock can never occur as long as processes only lock one
- resource at a time. But if some processes try to lock two or
- more resources, a deadlock may occur. It is up to the
+ resource at a time. A deadlock can occur if some processes
+ try to lock two or more resources. It is up to the
application to detect and rectify a deadlock.</p>
-
<note>
- <p>Some values of <c><anno>ResourceId</anno></c> should be avoided or
- Erlang/OTP will not work properly. A list of resources to
- avoid: <c>global</c>, <c>dist_ac</c>,
- <c>mnesia_table_lock</c>, <c>mnesia_adjust_log_writes</c>,
- <c>pg2</c>.</p>
+ <p>Avoid the following values of <c><anno>ResourceId</anno></c>,
+ otherwise Erlang/OTP does not work properly:</p>
+ <list type="bulleted">
+ <item><c>dist_ac</c></item>
+ <item><c>global</c></item>
+ <item><c>mnesia_adjust_log_writes</c></item>
+ <item><c>mnesia_table_lock</c></item>
+ <item><c>pg2</c></item>
+ </list>
</note>
-
</desc>
</func>
<func>
<name name="sync" arity="0"/>
- <fsummary>Synchronize the global name server</fsummary>
+ <fsummary>Synchronize the global name server.</fsummary>
<desc>
<p>Synchronizes the global name server with all nodes known to
- this node. These are the nodes which are returned from
+ this node. These are the nodes that are returned from
<c>erlang:nodes()</c>. When this function returns,
- the global name server will receive global information from
+ the global name server receives global information from
all nodes. This function can be called when new nodes are
added to the network.</p>
<p>The only possible error reason <c>Reason</c> is
@@ -326,24 +305,25 @@
<name name="trans" arity="2"/>
<name name="trans" arity="3"/>
<name name="trans" arity="4"/>
- <fsummary>Micro transaction facility</fsummary>
+ <fsummary>Micro transaction facility.</fsummary>
<type name="retries"/>
<type name="trans_fun"/>
<desc>
- <p>Sets a lock on <c><anno>Id</anno></c> (using <c>set_lock/3</c>). If this
- succeeds, <c><anno>Fun</anno>()</c> is evaluated and the result <c><anno>Res</anno></c>
- is returned. Returns <c>aborted</c> if the lock attempt
- failed. If <c><anno>Retries</anno></c> is set to <c>infinity</c>,
- the transaction will not abort.</p>
-
- <p><c>infinity</c> is the default setting and will be used if
- no value is given for <c><anno>Retries</anno></c>.</p>
+ <p>Sets a lock on <c><anno>Id</anno></c> (using
+ <seealso marker="#set_lock/3"><c>set_lock/3</c></seealso>).
+ If this succeeds, <c><anno>Fun</anno>()</c> is evaluated and the
+ result <c><anno>Res</anno></c>
+ is returned. Returns <c>aborted</c> if the lock attempt fails.
+ If <c><anno>Retries</anno></c> is set to <c>infinity</c>,
+ the transaction does not abort.</p>
+ <p><c>infinity</c> is the default setting and is used if
+ no value is specified for <c><anno>Retries</anno></c>.</p>
</desc>
</func>
<func>
<name name="unregister_name" arity="1"/>
- <fsummary>Remove a globally registered name for a pid</fsummary>
+ <fsummary>Remove a globally registered name for a pid.</fsummary>
<desc>
<p>Removes the globally registered name <c><anno>Name</anno></c> from
the network of Erlang nodes.</p>
@@ -352,7 +332,7 @@
<func>
<name name="whereis_name" arity="1"/>
- <fsummary>Get the pid with a given globally registered name</fsummary>
+ <fsummary>Get the pid with a specified globally registered name.</fsummary>
<desc>
<p>Returns the pid with the globally registered name
<c><anno>Name</anno></c>. Returns <c>undefined</c> if the name is not
@@ -363,8 +343,8 @@
<section>
<title>See Also</title>
- <p><seealso marker="global_group">global_group(3)</seealso>,
- <seealso marker="net_kernel">net_kernel(3)</seealso></p>
+ <p><seealso marker="global_group"><c>global_group(3)</c></seealso>,
+ <seealso marker="net_kernel"><c>net_kernel(3)</c></seealso></p>
</section>
</erlref>
diff --git a/lib/kernel/doc/src/global_group.xml b/lib/kernel/doc/src/global_group.xml
index 4b21b0a14a..8f947b9adf 100644
--- a/lib/kernel/doc/src/global_group.xml
+++ b/lib/kernel/doc/src/global_group.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -26,22 +26,22 @@
<prepared>Esko Vierum&auml;ki</prepared>
<docno></docno>
<date>1998-12-18</date>
- <rev>b</rev>
+ <rev>B</rev>
</header>
<module>global_group</module>
- <modulesummary>Grouping Nodes to Global Name Registration Groups</modulesummary>
+ <modulesummary>Grouping nodes to global name registration groups.</modulesummary>
<description>
- <p>The global group function makes it possible to group the nodes
- in a system into partitions, each partition having its own global
- name space, refer to <c>global(3)</c>. These partitions are
- called global groups.</p>
- <p>The main advantage of dividing systems to global groups is that
+ <p>This module makes it possible to partition the nodes of a
+ system into <em>global groups</em>. Each global group has its own
+ global namespace, see <seealso marker="global">
+ <c>global(3)</c></seealso>.</p>
+ <p>The main advantage of dividing systems into global groups is that
the background load decreases while the number of nodes to be
updated is reduced when manipulating globally registered names.</p>
<p>The Kernel configuration parameter <c>global_groups</c> defines
the global groups (see also
- <seealso marker="kernel_app">kernel(6)</seealso>,
- <seealso marker="config">config(4)</seealso>:</p>
+ <seealso marker="kernel_app#global_groups"><c>kernel(6)</c></seealso>
+ and <seealso marker="config"><c>config(4)</c></seealso>):</p>
<code type="none">
{global_groups, [GroupTuple :: group_tuple()]}</code>
<p>For the processes and nodes to run smoothly using the global
@@ -54,22 +54,24 @@
</item>
<item>
<p>All involved nodes must agree on the global group definition,
- or the behavior of the system is undefined.</p>
+ otherwise the behavior of the system is undefined.</p>
</item>
<item>
- <p><em>All</em> nodes in the system should belong to exactly
+ <p><em>All</em> nodes in the system must belong to exactly
one global group.</p>
</item>
</list>
- <p>In the following description, a <em>group node</em> is a node
+ <p>In the following descriptions, a <em>group node</em> is a node
belonging to the same global group as the local node.</p>
</description>
- <datatypes>
+
+ <datatypes>
<datatype>
<name name="group_tuple"/>
<desc>
<p>A <c>GroupTuple</c> without <c>PublishType</c> is the same as a
- <c>GroupTuple</c> with <c>PublishType == normal</c>.</p>
+ <c>GroupTuple</c> with <c>PublishType</c> equal to <c>normal</c>.
+ </p>
</desc>
</datatype>
<datatype>
@@ -78,52 +80,57 @@
<datatype>
<name name="publish_type"/>
<desc>
- <p>A node started with the command line flag <c>-hidden</c>, see
- <seealso marker="erts:erl">erl(1)</seealso>, is said to be a
- <em>hidden</em> node. A hidden node will establish hidden
+ <p>A node started with command-line flag <c>-hidden</c> (see
+ <seealso marker="erts:erl"><c>erl(1)</c></seealso>) is said
+ to be a <em>hidden</em> node. A hidden node establishes hidden
connections to nodes not part of the same global group, but
normal (visible) connections to nodes part of the same global
group.</p>
- <p>A global group defined with <c>PublishType == hidden</c>, is
- said to be a hidden global group. All nodes in a hidden global
- group are hidden nodes, regardless if they are started with
- the <c>-hidden</c> command line flag or not.</p>
+ <p>A global group defined with <c>PublishType</c> equal to
+ <c>hidden</c> is said to be a hidden global group.
+ All nodes in a hidden global
+ group are hidden nodes, whether they are started with
+ command-line flag <c>-hidden</c> or not.</p>
</desc>
</datatype>
<datatype>
<name name="name"/>
<desc><p>A registered name.</p></desc>
</datatype>
+
<datatype>
<name name="where"/>
</datatype>
</datatypes>
+
<funcs>
<func>
<name name="global_groups" arity="0"/>
- <fsummary>Return the global group names</fsummary>
+ <fsummary>Return the global group names.</fsummary>
<desc>
- <p>Returns a tuple containing the name of the global group
+ <p>Returns a tuple containing the name of the global group that
the local node belongs to, and the list of all other known
group names. Returns <c>undefined</c> if no global groups are
defined.</p>
</desc>
</func>
+
<func>
<name name="info" arity="0"/>
- <fsummary>Information about global groups</fsummary>
+ <fsummary>Information about global groups.</fsummary>
<type name="info_item"/>
<type name="sync_state"/>
<desc>
<p>Returns a list containing information about the global
- groups. Each element of the list is a tuple. The order of
- the tuples is not defined.</p>
+ groups. Each list element is a tuple. The order of
+ the tuples is undefined.</p>
<taglist>
<tag><c>{state, <anno>State</anno>}</c></tag>
<item>
<p>If the local node is part of a global group,
- <c><anno>State</anno> == synced</c>. If no global groups are defined,
- <c><anno>State</anno> == no_conf</c>.</p>
+ <c><anno>State</anno></c> is equal to <c>synced</c>.
+ If no global groups are defined,
+ <c><anno>State</anno></c> is equal to <c>no_conf</c>.</p>
</item>
<tag><c>{own_group_name, <anno>GroupName</anno>}</c></tag>
<item>
@@ -152,117 +159,131 @@
<tag><c>{other_groups, <anno>Groups</anno>}</c></tag>
<item>
<p><c><anno>Groups</anno></c> is a list of tuples
- <c>{<anno>GroupName</anno>, <anno>Nodes</anno>}</c>, specifying the name and nodes
+ <c>{<anno>GroupName</anno>, <anno>Nodes</anno>}</c>,
+ specifying the name and nodes
of the other global groups.</p>
</item>
<tag><c>{monitoring, <anno>Pids</anno>}</c></tag>
<item>
- <p>A list of pids, specifying the processes which have
+ <p>A list of pids, specifying the processes that have
subscribed to <c>nodeup</c> and <c>nodedown</c> messages.</p>
</item>
</taglist>
</desc>
</func>
+
<func>
<name name="monitor_nodes" arity="1"/>
- <fsummary>Subscribe to node status changes</fsummary>
+ <fsummary>Subscribe to node status changes.</fsummary>
<desc>
- <p>Depending on <c><anno>Flag</anno></c>, the calling process starts
- subscribing (<c><anno>Flag</anno> == true</c>) or stops subscribing
- (<c><anno>Flag</anno> == false</c>) to node status change messages.</p>
- <p>A process which has subscribed will receive the messages
+ <p>Depending on <c><anno>Flag</anno></c>, the calling process
+ starts subscribing (<c><anno>Flag</anno></c> equal to
+ <c>true</c>) or stops subscribing (<c><anno>Flag</anno></c>
+ equal to <c>false</c>) to node status change messages.</p>
+ <p>A process that has subscribed receives the messages
<c>{nodeup, Node}</c> and <c>{nodedown, Node}</c> when a
group node connects or disconnects, respectively.</p>
</desc>
</func>
+
<func>
<name name="own_nodes" arity="0"/>
- <fsummary>Return the group nodes</fsummary>
+ <fsummary>Return the group nodes.</fsummary>
<desc>
<p>Returns the names of all group nodes, regardless of their
current status.</p>
</desc>
</func>
+
<func>
<name name="registered_names" arity="1"/>
- <fsummary>Return globally registered names</fsummary>
+ <fsummary>Return globally registered names.</fsummary>
<desc>
- <p>Returns a list of all names which are globally registered
+ <p>Returns a list of all names that are globally registered
on the specified node or in the specified global group.</p>
</desc>
</func>
+
<func>
<name name="send" arity="2"/>
<name name="send" arity="3"/>
- <fsummary>Send a message to a globally registered pid</fsummary>
+ <fsummary>Send a message to a globally registered pid.</fsummary>
<desc>
<p>Searches for <c><anno>Name</anno></c>, globally registered on
- the specified node or in the specified global group, or --
- if the <c><anno>Where</anno></c> argument is not provided -- in any global
- group. The global groups are searched in the order in which
- they appear in the value of the <c>global_groups</c>
- configuration parameter.</p>
- <p>If <c><anno>Name</anno></c> is found, the message <c><anno>Msg</anno></c> is sent to
+ the specified node or in the specified global group, or
+ (if argument <c><anno>Where</anno></c> is not provided) in any
+ global group. The global groups are searched in the order that
+ they appear in the value of configuration parameter
+ <c>global_groups</c>.</p>
+ <p>If <c><anno>Name</anno></c> is found, message
+ <c><anno>Msg</anno></c> is sent to
the corresponding pid. The pid is also the return value of
the function. If the name is not found, the function returns
<c>{badarg, {<anno>Name</anno>, <anno>Msg</anno>}}</c>.</p>
</desc>
</func>
+
<func>
<name name="sync" arity="0"/>
- <fsummary>Synchronize the group nodes</fsummary>
+ <fsummary>Synchronize the group nodes.</fsummary>
<desc>
<p>Synchronizes the group nodes, that is, the global name
- servers on the group nodes. Also check the names globally
+ servers on the group nodes. Also checks the names globally
registered in the current global group and unregisters them
on any known node not part of the group.</p>
<p>If synchronization is not possible, an error report is sent
- to the error logger (see also <c>error_logger(3)</c>).</p>
- <p>Failure:
- <c>{error, {'invalid global_groups definition', Bad}}</c> if
- the <c>global_groups</c> configuration parameter has an
+ to the error logger (see also
+ <seealso marker="error_logger"><c>error_logger(3)</c></seealso>.
+ </p>
+ <p>Returns <c>{error, {'invalid global_groups definition', Bad}}</c>
+ if configuration parameter <c>global_groups</c> has an
invalid value <c>Bad</c>.</p>
</desc>
</func>
+
<func>
<name name="whereis_name" arity="1"/>
<name name="whereis_name" arity="2"/>
- <fsummary>Get the pid with a given globally registered name</fsummary>
+ <fsummary>Get the pid with a specified globally registered name.</fsummary>
<desc>
<p>Searches for <c><anno>Name</anno></c>, globally registered on
- the specified node or in the specified global group, or -- if
- the <c><anno>Where</anno></c> argument is not provided -- in any global
- group. The global groups are searched in the order in which
- they appear in the value of the <c>global_groups</c>
- configuration parameter.</p>
- <p>If <c><anno>Name</anno></c> is found, the corresponding pid is returned.
- If the name is not found, the function returns
+ the specified node or in the specified global group, or
+ (if argument <c><anno>Where</anno></c> is not provided) in any global
+ group. The global groups are searched in the order that
+ they appear in the value of configuration parameter
+ <c>global_groups</c>.</p>
+ <p>If <c><anno>Name</anno></c> is found, the corresponding pid is
+ returned. If the name is not found, the function returns
<c>undefined</c>.</p>
</desc>
</func>
</funcs>
<section>
- <title>NOTE</title>
- <p>In the situation where a node has lost its connections to other
- nodes in its global group, but has connections to nodes in other
- global groups, a request from another global group may produce an
- incorrect or misleading result. For example, the isolated node may
- not have accurate information about registered names in its
- global group.</p>
- <p>Note also that the <c>send/2,3</c> function is not secure.</p>
- <p>Distribution of applications is highly dependent of the global
- group definitions. It is not recommended that an application is
- distributed over several global groups of the obvious reason that
- the registered names may be moved to another global group at
- failover/takeover. There is nothing preventing doing this, but
- the application code must in such case handle the situation.</p>
+ <title>Notes</title>
+ <list type="bulleted">
+ <item><p>In the situation where a node has lost its connections to other
+ nodes in its global group, but has connections to nodes in other
+ global groups, a request from another global group can produce an
+ incorrect or misleading result. For example, the isolated node can
+ have inaccurate information about registered names in its
+ global group.</p></item>
+ <item><p>Function
+ <seealso marker="#send/2"><c>send/2,3</c></seealso>
+ is not secure.</p></item>
+ <item><p>Distribution of applications is highly dependent of the global
+ group definitions. It is not recommended that an application is
+ distributed over many global groups, as
+ the registered names can be moved to another global group at
+ failover/takeover. Nothing prevents this to be done, but
+ the application code must then handle the situation.</p></item>
+ </list>
</section>
<section>
- <title>SEE ALSO</title>
- <p><seealso marker="erts:erl">erl(1)</seealso>,
- <seealso marker="global">global(3)</seealso></p>
+ <title>See Also</title>
+ <p><seealso marker="global"><c>global(3)</c></seealso>,
+ <seealso marker="erts:erl"><c>erl(1)</c></seealso></p>
</section>
</erlref>
diff --git a/lib/kernel/doc/src/heart.xml b/lib/kernel/doc/src/heart.xml
index 9da4773f2d..c587e39345 100644
--- a/lib/kernel/doc/src/heart.xml
+++ b/lib/kernel/doc/src/heart.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,93 +29,80 @@
<rev>A</rev>
</header>
<module>heart</module>
- <modulesummary>Heartbeat Monitoring of an Erlang Runtime System</modulesummary>
+ <modulesummary>Heartbeat monitoring of an Erlang runtime system.</modulesummary>
<description>
<p>This modules contains the interface to the <c>heart</c> process.
<c>heart</c> sends periodic heartbeats to an external port
program, which is also named <c>heart</c>. The purpose of
- the heart port program is to check that the Erlang runtime system
+ the <c>heart</c> port program is to check that the Erlang runtime system
it is supervising is still running. If the port program has not
received any heartbeats within <c>HEART_BEAT_TIMEOUT</c> seconds
- (default is 60 seconds), the system can be rebooted. Also, if
+ (defaults to 60 seconds), the system can be rebooted. Also, if
the system is equipped with a hardware watchdog timer and is
running Solaris, the watchdog can be used to supervise the entire
system.</p>
- <p>An Erlang runtime system to be monitored by a heart program,
- should be started with the command line flag <c>-heart</c> (see
- also <seealso marker="erts:erl">erl(1)</seealso>). The <c>heart</c>
- process is then started automatically:</p>
+ <p>An Erlang runtime system to be monitored by a heart program
+ is to be started with command-line flag <c>-heart</c> (see
+ also <seealso marker="erts:erl"><c>erl(1)</c></seealso>).
+ The <c>heart</c> process is then started automatically:</p>
<pre>
% <input>erl -heart ...</input></pre>
- <p>If the system should be rebooted because of missing heart-beats,
- or a terminated Erlang runtime system, the environment variable
- <c>HEART_COMMAND</c> has to be set before the system is started.
- If this variable is not set, a warning text will be printed but
- the system will not reboot. However, if the hardware watchdog is
- used, it will trigger a reboot <c>HEART_BEAT_BOOT_DELAY</c>
- seconds later nevertheless (default is 60).</p>
- <p>To reboot on the WINDOWS platform <c>HEART_COMMAND</c> can be
+ <p>If the system is to be rebooted because of missing heartbeats,
+ or a terminated Erlang runtime system, environment variable
+ <c>HEART_COMMAND</c> must be set before the system is started.
+ If this variable is not set, a warning text is printed but
+ the system does not reboot. However, if the hardware watchdog is
+ used, it still triggers a reboot <c>HEART_BEAT_BOOT_DELAY</c>
+ seconds later (defaults to 60 seconds).</p>
+ <p>To reboot on Windows, <c>HEART_COMMAND</c> can be
set to <c>heart -shutdown</c> (included in the Erlang delivery)
- or of course to any other suitable program which can activate a
- reboot.</p>
- <p>The hardware watchdog will not be started under Solaris if
- the environment variable <c>HW_WD_DISABLE</c> is set.</p>
- <p>The <c>HEART_BEAT_TIMEOUT</c> and <c>HEART_BEAT_BOOT_DELAY</c>
- environment variables can be used to configure the heart timeouts,
- they can be set in the operating system shell before Erlang is
- started or be specified at the command line:</p>
+ or to any other suitable program that can activate a reboot.</p>
+ <p>The hardware watchdog is not started under Solaris if
+ environment variable <c>HW_WD_DISABLE</c> is set.</p>
+ <p>The environment variables <c>HEART_BEAT_TIMEOUT</c> and
+ <c>HEART_BEAT_BOOT_DELAY</c> can be used to configure the heart
+ time-outs; they can be set in the operating system shell before Erlang
+ is started or be specified at the command line:</p>
<pre>
% <input>erl -heart -env HEART_BEAT_TIMEOUT 30 ...</input></pre>
<p>The value (in seconds) must be in the range 10 &lt; X &lt;= 65535.</p>
- <p>It should be noted that if the system clock is adjusted with
- more than <c>HEART_BEAT_TIMEOUT</c> seconds, <c>heart</c> will
- timeout and try to reboot the system. This can happen, for
- example, if the system clock is adjusted automatically by use of
- NTP (Network Time Protocol).</p>
-
- <p> If a crash occurs, an <c><![CDATA[erl_crash.dump]]></c> will <em>not</em> be written
- unless the environment variable <c><![CDATA[ERL_CRASH_DUMP_SECONDS]]></c> is set.
- </p>
-
+ <p>Notice that if the system clock is adjusted with
+ more than <c>HEART_BEAT_TIMEOUT</c> seconds, <c>heart</c>
+ times out and tries to reboot the system. This can occur, for
+ example, if the system clock is adjusted automatically by use of the
+ Network Time Protocol (NTP).</p>
+ <p>If a crash occurs, an <c><![CDATA[erl_crash.dump]]></c> is <em>not</em>
+ written unless environment variable
+ <c><![CDATA[ERL_CRASH_DUMP_SECONDS]]></c> is set:</p>
<pre>
% <input>erl -heart -env ERL_CRASH_DUMP_SECONDS 10 ...</input></pre>
-
- <p> If a regular core dump is wanted, let heart know by setting the kill signal to abort
- using the environment variable <c><![CDATA[HEART_KILL_SIGNAL=SIGABRT]]></c>.
- If unset, or not set to <c><![CDATA[SIGABRT]]></c>, the default behaviour will be a kill
- signal using <c><![CDATA[SIGKILL]]></c>.
- </p>
-
+ <p>If a regular core dump is wanted, let <c>heart</c> know by setting
+ the kill signal to abort using environment variable
+ <c><![CDATA[HEART_KILL_SIGNAL=SIGABRT]]></c>. If unset, or not set to
+ <c><![CDATA[SIGABRT]]></c>, the default behavior is a kill signal using
+ <c><![CDATA[SIGKILL]]></c>:</p>
<pre>
% <input>erl -heart -env HEART_KILL_SIGNAL SIGABRT ...</input></pre>
-
- <p>
- Furthermore, <c><![CDATA[ERL_CRASH_DUMP_SECONDS]]></c> has the following behaviour on
- <c>heart</c>:
- </p>
- <taglist>
- <tag><c><![CDATA[ERL_CRASH_DUMP_SECONDS=0]]></c></tag>
- <item><p>
- Suppresses the writing a crash dump file entirely,
- thus rebooting the runtime system immediately.
- This is the same as not setting the environment variable.
- </p>
- </item>
- <tag><c><![CDATA[ERL_CRASH_DUMP_SECONDS=-1]]></c></tag>
- <item><p> Setting the environment variable to a negative value will not reboot
- the runtime system until the crash dump file has been completly written.
- </p>
- </item>
- <tag><c><![CDATA[ERL_CRASH_DUMP_SECONDS=S]]></c></tag>
- <item><p>
- Heart will wait for <c>S</c> seconds to let the crash dump file be written.
- After <c>S</c> seconds <c>heart</c> will reboot the runtime system regardless of
- the crash dump file has been written or not.
- </p>
- </item>
- </taglist>
-
- <p>In the following descriptions, all function fails with reason
+ <p>Furthermore, <c><![CDATA[ERL_CRASH_DUMP_SECONDS]]></c> has the
+ following behavior on <c>heart</c>:</p>
+ <taglist>
+ <tag><c><![CDATA[ERL_CRASH_DUMP_SECONDS=0]]></c></tag>
+ <item><p>Suppresses the writing of a crash dump file entirely,
+ thus rebooting the runtime system immediately.
+ This is the same as not setting the environment variable.</p>
+ </item>
+ <tag><c><![CDATA[ERL_CRASH_DUMP_SECONDS=-1]]></c></tag>
+ <item><p>Setting the environment variable to a negative value does not
+ reboot the runtime system until the crash dump file is completly
+ written.</p>
+ </item>
+ <tag><c><![CDATA[ERL_CRASH_DUMP_SECONDS=S]]></c></tag>
+ <item><p><c>heart</c> waits for <c>S</c> seconds to let the crash dump
+ file be written. After <c>S</c> seconds, <c>heart</c> reboots the
+ runtime system, whether the crash dump file is written or not.</p>
+ </item>
+ </taglist>
+ <p>In the following descriptions, all functions fail with reason
<c>badarg</c> if <c>heart</c> is not started.</p>
</description>
@@ -128,37 +115,36 @@
<funcs>
<func>
<name name="set_cmd" arity="1"/>
- <fsummary>Set a temporary reboot command</fsummary>
+ <fsummary>Set a temporary reboot command.</fsummary>
<desc>
- <p>Sets a temporary reboot command. This command is used if
+ <p>Sets a temporary reboot command. This command is used if
a <c>HEART_COMMAND</c> other than the one specified with
- the environment variable should be used in order to reboot
- the system. The new Erlang runtime system will (if it
- misbehaves) use the environment variable
- <c>HEART_COMMAND</c> to reboot.</p>
-
- <p>Limitations: The <c><anno>Cmd</anno></c> command string
- will be sent to the heart program as a ISO-latin-1 or UTF-8
- encoded binary depending on the file name encoding mode of the
- emulator (see
- <seealso marker="kernel:file#native_name_encoding/0"><c>file:native_name_encoding/0</c></seealso>).
- The size of the encoded binary must be less than 2047 bytes.</p>
+ the environment variable is to be used to reboot
+ the system. The new Erlang runtime system uses (if it misbehaves)
+ environment variable <c>HEART_COMMAND</c> to reboot.</p>
+ <p>Limitations: Command string <c><anno>Cmd</anno></c> is sent to the
+ <c>heart</c> program as an ISO Latin-1 or UTF-8 encoded binary,
+ depending on the filename encoding mode of the emulator (see
+ <seealso marker="kernel:file#native_name_encoding/0"><c>file:native_name_encoding/0</c></seealso>).
+ The size of the encoded binary must be less than 2047 bytes.</p>
</desc>
</func>
+
<func>
<name name="clear_cmd" arity="0"/>
- <fsummary>Clear the temporary boot command</fsummary>
+ <fsummary>Clear the temporary boot command.</fsummary>
<desc>
<p>Clears the temporary boot command. If the system terminates,
the normal <c>HEART_COMMAND</c> is used to reboot.</p>
</desc>
</func>
+
<func>
<name name="get_cmd" arity="0"/>
- <fsummary>Get the temporary reboot command</fsummary>
+ <fsummary>Get the temporary reboot command.</fsummary>
<desc>
- <p>Get the temporary reboot command. If the command is cleared,
- the empty string will be returned.</p>
+ <p>Gets the temporary reboot command. If the command is cleared,
+ the empty string is returned.</p>
</desc>
</func>
@@ -166,12 +152,12 @@
<name name="set_callback" arity="2"/>
<fsummary>Set a validation callback</fsummary>
<desc>
- <p> This validation callback will be executed before any heartbeat sent
- to the port program. For the validation to succeed it needs to return
- with the value <c>ok</c>.
+ <p> This validation callback will be executed before any
+ heartbeat is sent to the port program. For the validation to
+ succeed it needs to return with the value <c>ok</c>.
</p>
- <p> An exception within the callback will be treated as a validation failure. </p>
- <p> The callback will be removed if the system reboots. </p>
+ <p>An exception within the callback will be treated as a validation failure.</p>
+ <p>The callback will be removed if the system reboots.</p>
</desc>
</func>
<func>
diff --git a/lib/kernel/doc/src/inet.xml b/lib/kernel/doc/src/inet.xml
index 088d78c1d6..cfff393b8c 100644
--- a/lib/kernel/doc/src/inet.xml
+++ b/lib/kernel/doc/src/inet.xml
@@ -29,43 +29,47 @@
<rev>A</rev>
</header>
<module>inet</module>
- <modulesummary>Access to TCP/IP Protocols</modulesummary>
+ <modulesummary>Access to TCP/IP protocols.</modulesummary>
<description>
- <p>Provides access to TCP/IP protocols.</p>
- <p>See also <em>ERTS User's Guide, Inet configuration</em> for more
- information on how to configure an Erlang runtime system for IP
- communication.</p>
- <p>Two Kernel configuration parameters affect the behaviour of all
- sockets opened on an Erlang node:
- <c>inet_default_connect_options</c> can contain a list of default
- options used for all sockets returned when doing <c>connect</c>,
- and <c>inet_default_listen_options</c> can contain a list of
- default options used when issuing a <c>listen</c> call. When
- <c>accept</c> is issued, the values of the listensocket options
- are inherited, why no such application variable is needed for
+ <p>This module provides access to TCP/IP protocols.</p>
+ <p>See also
+ <seealso marker="erts:inet_cfg">ERTS User's Guide:
+ Inet Configuration</seealso> for more information about how to
+ configure an Erlang runtime system for IP communication.</p>
+ <p>The following two <c>Kernel</c> configuration parameters affect the
+ behavior of all sockets opened on an Erlang node:</p>
+ <list type="bulleted">
+ <item><p><c>inet_default_connect_options</c> can contain a list of
+ default options used for all sockets returned when doing
+ <c>connect</c>.</p></item>
+ <item><p><c>inet_default_listen_options</c> can contain a list of
+ default options used when issuing a <c>listen</c> call.</p></item>
+ </list>
+ <p>When <c>accept</c> is issued, the values of the listening socket options
+ are inherited. No such application variable is therefore needed for
<c>accept</c>.</p>
- <p>Using the Kernel configuration parameters mentioned above, one
- can set default options for all TCP sockets on a node. This should
- be used with care, but options like <c>{delay_send,true}</c>
- might be specified in this way. An example of starting an Erlang
- node with all sockets using delayed send could look like this:</p>
+ <p>Using the <c>Kernel</c> configuration parameters above, one
+ can set default options for all TCP sockets on a node, but use this
+ with care. Options such as <c>{delay_send,true}</c> can be
+ specified in this way. The following is an example of starting an Erlang
+ node with all sockets using delayed send:</p>
<pre>
$ <input>erl -sname test -kernel \</input>
<input>inet_default_connect_options '[{delay_send,true}]' \</input>
<input>inet_default_listen_options '[{delay_send,true}]'</input></pre>
- <p>Note that the default option <c>{active, true}</c> currently
+ <p>Notice that default option <c>{active, true}</c>
cannot be changed, for internal reasons.</p>
<p>Addresses as inputs to functions can be either a string or a
- tuple. For instance, the IP address 150.236.20.73 can be passed to
- <c>gethostbyaddr/1</c> either as the string "150.236.20.73"
- or as the tuple <c>{150, 236, 20, 73}</c>.</p>
- <p>IPv4 address examples:</p>
+ tuple. For example, the IP address 150.236.20.73 can be passed to
+ <c>gethostbyaddr/1</c>, either as string <c>"150.236.20.73"</c>
+ or as tuple <c>{150, 236, 20, 73}</c>.</p>
+ <p><em>IPv4 address examples:</em></p>
<code type="none">
Address ip_address()
------- ------------
127.0.0.1 {127,0,0,1}
192.168.42.2 {192,168,42,2}</code>
- <p>IPv6 address examples:</p>
+ <p><em>IPv6 address examples:</em></p>
<code type="none">
Address ip_address()
------- ------------
@@ -77,7 +81,9 @@ FFFF::192.168.42.2
{16#3ffe,16#b80,16#1f8d,16#2,16#204,16#acff,16#fe17,16#bf38}
fe80::204:acff:fe17:bf38
{16#fe80,0,0,0,0,16#204,16#acff,16#fe17,16#bf38}</code>
- <p>A function that may be useful is <seealso marker="#parse_address/1">parse_address/1</seealso>:</p>
+ <p>Function
+ <seealso marker="#parse_address/1"><c>parse_address/1</c></seealso>
+ can be useful:</p>
<pre>
1> <input>inet:parse_address("192.168.42.2").</input>
{ok,{192,168,42,2}}
@@ -89,9 +95,12 @@ fe80::204:acff:fe17:bf38
<datatype>
<name name="hostent"/>
<desc>
- <p>The record is defined in the Kernel include file "inet.hrl".
- Add the following directive to the module:</p>
-<code>-include_lib("kernel/include/inet.hrl").</code></desc>
+ <p>The record is defined in the <c>Kernel</c> include file
+ <c>"inet.hrl"</c>.</p>
+ <p>Add the following directive to the module:</p>
+ <code>
+-include_lib("kernel/include/inet.hrl").</code>
+ </desc>
</datatype>
<datatype>
<name name="hostname"/>
@@ -110,17 +119,20 @@ fe80::204:acff:fe17:bf38
</datatype>
<datatype>
<name name="posix"/>
- <desc><p>An atom which is named from the Posix error codes
- used in Unix, and in the runtime libraries of most
- C compilers. See
+ <desc>
+ <p>An atom that is named from the POSIX error codes used in Unix,
+ and in the runtime libraries of most C compilers. See section
<seealso marker="#error_codes">POSIX Error Codes</seealso>.</p>
</desc>
</datatype>
<datatype>
<name>socket()</name>
- <desc><p><marker id="type-socket"></marker>
- See <seealso marker="gen_tcp#type-socket">gen_tcp(3)</seealso>
- and <seealso marker="gen_udp#type-socket">gen_udp(3)</seealso>.</p>
+ <desc>
+ <p><marker id="type-socket"></marker>See
+ <seealso marker="gen_tcp#type-socket"><c>gen_tcp:type-socket</c></seealso>
+ and
+ <seealso marker="gen_udp#type-socket"><c>gen_udp:type-socket</c></seealso>.
+ </p>
</desc>
</datatype>
<datatype>
@@ -131,443 +143,415 @@ fe80::204:acff:fe17:bf38
<funcs>
<func>
<name name="close" arity="1"/>
- <fsummary>Close a socket of any type</fsummary>
+ <fsummary>Close a socket of any type.</fsummary>
<desc>
<p>Closes a socket of any type.</p>
</desc>
</func>
+
<func>
- <name name="get_rc" arity="0"/>
- <fsummary>Return a list of IP configuration parameters</fsummary>
+ <name name="format_error" arity="1"/>
+ <fsummary>Return a descriptive string for an error reason.</fsummary>
<desc>
- <p>Returns the state of the Inet configuration database in
- form of a list of recorded configuration parameters. (See the
- ERTS User's Guide, Inet configuration, for more information).
- Only parameters with other than default values are returned.</p>
+ <p>Returns a diagnostic error string. For possible POSIX values and
+ corresponding strings, see section
+ <seealso marker="#error_codes">POSIX Error Codes</seealso>.</p>
</desc>
</func>
+
<func>
- <name name="format_error" arity="1"/>
- <fsummary>Return a descriptive string for an error reason</fsummary>
+ <name name="get_rc" arity="0"/>
+ <fsummary>Return a list of IP configuration parameters.</fsummary>
<desc>
- <p>Returns a diagnostic error string. See the section below
- for possible Posix values and the corresponding
- strings.</p>
+ <p>Returns the state of the <c>Inet</c> configuration database in
+ form of a list of recorded configuration parameters. For more
+ information, see <seealso marker="erts:inet_cfg">ERTS User's Guide:
+ Inet Configuration</seealso>.
+ Only parameters with other than default values are returned.</p>
</desc>
</func>
+
<func>
<name name="getaddr" arity="2"/>
- <fsummary>Return the IP-address for a host</fsummary>
+ <fsummary>Return the IP address for a host.</fsummary>
<desc>
- <p>Returns the IP-address for <c><anno>Host</anno></c> as a tuple of
- integers. <c><anno>Host</anno></c> can be an IP-address, a single hostname
- or a fully qualified hostname.</p>
+ <p>Returns the IP address for <c><anno>Host</anno></c> as a tuple of
+ integers. <c><anno>Host</anno></c> can be an IP address, a single
+ hostname, or a fully qualified hostname.</p>
</desc>
</func>
+
<func>
<name name="getaddrs" arity="2"/>
- <fsummary>Return the IP-addresses for a host</fsummary>
+ <fsummary>Return the IP addresses for a host.</fsummary>
<desc>
- <p>Returns a list of all IP-addresses for <c><anno>Host</anno></c>.
- <c><anno>Host</anno></c> can be an IP-address, a single hostname or a fully
- qualified hostname.</p>
+ <p>Returns a list of all IP addresses for <c><anno>Host</anno></c>.
+ <c><anno>Host</anno></c> can be an IP address, a single hostname, or
+ a fully qualified hostname.</p>
</desc>
</func>
+
<func>
<name name="gethostbyaddr" arity="1"/>
- <fsummary>Return a hostent record for the host with the given address</fsummary>
+ <fsummary>Return a hostent record for the host with the specified
+ address.</fsummary>
<desc>
- <p>Returns a <c>hostent</c> record given an address.</p>
- </desc>
+ <p>Returns a <c>hostent</c> record for the host with the specified
+ address.</p></desc>
</func>
+
<func>
<name name="gethostbyname" arity="1"/>
- <fsummary>Return a hostent record for the host with the given name</fsummary>
+ <fsummary>Return a hostent record for the host with the specified name.
+ </fsummary>
<desc>
- <p>Returns a <c>hostent</c> record given a hostname.</p>
+ <p>Returns a <c>hostent</c> record for the host with the specified
+ hostname.</p>
</desc>
</func>
+
<func>
<name name="gethostbyname" arity="2"/>
- <fsummary>Return a hostent record for the host with the given name</fsummary>
+ <fsummary>Return a hostent record for the host with the specified name.
+ </fsummary>
<desc>
- <p>Returns a <c>hostent</c> record given a hostname, restricted
- to the given address family.</p>
+ <p>Returns a <c>hostent</c> record for the host with the specified
+ name, restricted to the specified address family.</p>
</desc>
</func>
+
<func>
<name name="gethostname" arity="0"/>
- <fsummary>Return the local hostname</fsummary>
+ <fsummary>Return the local hostname.</fsummary>
<desc>
- <p>Returns the local hostname. Will never fail.</p>
+ <p>Returns the local hostname. Never fails.</p>
</desc>
</func>
<func>
<name name="getifaddrs" arity="0"/>
- <fsummary>Return a list of interfaces and their addresses</fsummary>
- <desc>
- <p>
- Returns a list of 2-tuples containing interface names and the
- interface's addresses. <c><anno>Ifname</anno></c> is a Unicode string.
- <c><anno>Hwaddr</anno></c> is hardware dependent, e.g on Ethernet interfaces
- it is the 6-byte Ethernet address (MAC address (EUI-48 address)).
- </p>
- <p>
- The <c>{addr,<anno>Addr</anno>}</c>, <c>{netmask,_}</c> and <c>{broadaddr,_}</c>
- tuples are repeated in the result list iff the interface has multiple
- addresses. If you come across an interface that has
- multiple <c>{flag,_}</c> or <c>{hwaddr,_}</c> tuples you have
- a really strange interface or possibly a bug in this function.
- The <c>{flag,_}</c> tuple is mandatory, all other optional.
- </p>
- <p>
- Do not rely too much on the order of <c><anno>Flag</anno></c> atoms or
- <c><anno>Ifopt</anno></c> tuples. There are some rules, though:</p>
- <list>
- <item>
- Immediately after <c>{addr,_}</c> follows <c>{netmask,_}</c>
- </item>
- <item>
- Immediately thereafter follows <c>{broadaddr,_}</c> if
- the <c>broadcast</c> flag is <em>not</em> set and the
- <c>pointtopoint</c> flag <em>is</em> set.
- </item>
- <item>
- Any <c>{netmask,_}</c>, <c>{broadaddr,_}</c> or
- <c>{dstaddr,_}</c> tuples that follow an <c>{addr,_}</c>
- tuple concerns that address.
- </item>
- </list>
- <p>
- The <c>{hwaddr,_}</c> tuple is not returned on Solaris since the
- hardware address historically belongs to the link layer and only
- the superuser can read such addresses.
- </p>
- <p>
- On Windows, the data is fetched from quite different OS API
- functions, so the <c><anno>Netmask</anno></c> and <c><anno>Broadaddr</anno></c>
- values may be calculated, just as some <c><anno>Flag</anno></c> values.
- You have been warned. Report flagrant bugs.
- </p>
- </desc>
+ <fsummary>Return a list of interfaces and their addresses.</fsummary>
+ <desc>
+ <p>Returns a list of 2-tuples containing interface names and the
+ interface addresses. <c><anno>Ifname</anno></c> is a Unicode string.
+ <c><anno>Hwaddr</anno></c> is hardware dependent, for example, on
+ Ethernet interfaces
+ it is the 6-byte Ethernet address (MAC address (EUI-48 address)).</p>
+ <p>The tuples <c>{addr,<anno>Addr</anno>}</c>, <c>{netmask,_}</c>, and
+ <c>{broadaddr,_}</c> are repeated in the result list if the interface
+ has multiple addresses. If you come across an interface with
+ multiple <c>{flag,_}</c> or <c>{hwaddr,_}</c> tuples, you have
+ a strange interface or possibly a bug in this function. The tuple
+ <c>{flag,_}</c> is mandatory, all others are optional.</p>
+ <p>Do not rely too much on the order of <c><anno>Flag</anno></c> atoms
+ or <c><anno>Ifopt</anno></c> tuples. There are however some rules:</p>
+ <list type="bulleted">
+ <item><p>Immediately after
+ <c>{addr,_}</c> follows <c>{netmask,_}</c>.</p></item>
+ <item><p>Immediately thereafter follows <c>{broadaddr,_}</c> if flag
+ <c>broadcast</c> is <em>not</em> set and flag
+ <c>pointtopoint</c> <em>is</em> set.</p></item>
+ <item><p>Any <c>{netmask,_}</c>, <c>{broadaddr,_}</c>, or
+ <c>{dstaddr,_}</c> tuples that follow an <c>{addr,_}</c>
+ tuple concerns that address.</p></item>
+ </list>
+ <p>The tuple <c>{hwaddr,_}</c> is not returned on Solaris, as the
+ hardware address historically belongs to the link layer and only
+ the superuser can read such addresses.</p>
+ <warning>
+ <p>On Windows, the data is fetched from different OS API functions,
+ so the <c><anno>Netmask</anno></c> and <c><anno>Broadaddr</anno></c>
+ values can be calculated, just as some <c><anno>Flag</anno></c>
+ values. Report flagrant bugs.</p>
+ </warning>
+ </desc>
</func>
<func>
<name name="getopts" arity="2"/>
- <fsummary>Get one or more options for a socket</fsummary>
+ <fsummary>Get one or more options for a socket.</fsummary>
<type name="socket_getopt"/>
<type name="socket_setopt"/>
<desc>
- <p>Gets one or more options for a socket.
- See <seealso marker="#setopts/2">setopts/2</seealso>
- for a list of available options.</p>
- <p>The number of elements in the returned <c><anno>OptionValues</anno></c>
+ <p>Gets one or more options for a socket. For a list of available
+ options, see
+ <seealso marker="#setopts/2"><c>setopts/2</c></seealso>.</p>
+ <p>The number of elements in the returned
+ <c><anno>OptionValues</anno></c>
list does not necessarily correspond to the number of options
asked for. If the operating system fails to support an option,
- it is simply left out in the returned list. An error tuple is only
- returned when getting options for the socket is impossible
- (i.e. the socket is closed or the buffer size in a raw request
+ it is left out in the returned list. An error tuple is returned
+ only when getting options for the socket is impossible (that is,
+ the socket is closed or the buffer size in a raw request
is too large). This behavior is kept for backward
compatibility reasons.</p>
- <p>A raw option request <c>RawOptReq = {raw, Protocol, OptionNum, ValueSpec}</c> can be used to get information about
+ <p>A raw option request
+ <c>RawOptReq = {raw, Protocol, OptionNum, ValueSpec}</c>
+ can be used to get information about
socket options not (explicitly) supported by the emulator. The
- use of raw socket options makes the code non portable, but
+ use of raw socket options makes the code non-portable, but
allows the Erlang programmer to take advantage of unusual features
present on the current platform.</p>
- <p>The <c>RawOptReq</c> consists of the tag <c>raw</c> followed
- by the protocol level, the option number and either a binary
+ <p><c>RawOptReq</c> consists of tag <c>raw</c> followed
+ by the protocol level, the option number, and either a binary
or the size, in bytes, of the
- buffer in which the option value is to be stored. A binary
- should be used when the underlying <c>getsockopt</c> requires
- <em>input</em>
- in the argument field, in which case the size of the binary
- should correspond to the required buffer
+ buffer in which the option value is to be stored. A binary is to be
+ used when the underlying <c>getsockopt</c> requires <em>input</em>
+ in the argument field. In this case, the binary size
+ is to correspond to the required buffer
size of the return value. The supplied values in a <c>RawOptReq</c>
- correspond to the second, third and fourth/fifth parameters to the
+ correspond to the second, third, and fourth/fifth parameters to the
<c>getsockopt</c> call in the C socket API. The value stored
- in the buffer is returned as a binary <c>ValueBin</c>
+ in the buffer is returned as a binary <c>ValueBin</c>,
where all values are coded in the native endianess.</p>
- <p>Asking for and inspecting raw socket options require low
- level information about the current operating system and TCP
- stack.</p>
- <p>As an example, consider a Linux machine where the
- <c>TCP_INFO</c> option could be used to collect TCP statistics
- for a socket. Lets say we're interested in the
- <c>tcpi_sacked</c> field of the <c>struct tcp_info</c>
- filled in when asking for <c>TCP_INFO</c>. To
- be able to access this information, we need to know both the
- numeric value of the protocol level <c>IPPROTO_TCP</c>, the
- numeric value of the option <c>TCP_INFO</c>, the size of the
- <c>struct tcp_info</c> and the size and offset of
- the specific field. By inspecting the headers or writing a small C
- program, we found <c>IPPROTO_TCP</c> to be 6,
- <c>TCP_INFO</c> to be 11, the structure size to be 92 (bytes),
- the offset of <c>tcpi_sacked</c> to be 28 bytes and the actual
- value to be a 32 bit integer. We could use the following
- code to retrieve the value:</p>
+ <p>Asking for and inspecting raw socket options require low-level
+ information about the current operating system and TCP stack.</p>
+ <p><em>Example:</em></p>
+ <p>Consider a Linux machine where option
+ <c>TCP_INFO</c> can be used to collect TCP statistics
+ for a socket. Assume you are interested in field
+ <c>tcpi_sacked</c> of <c>struct tcp_info</c>
+ filled in when asking for <c>TCP_INFO</c>. To be able to access
+ this information, you need to know the following:</p>
+ <list type="bulleted">
+ <item>The numeric value of protocol level <c>IPPROTO_TCP</c></item>
+ <item>The numeric value of option <c>TCP_INFO</c></item>
+ <item>The size of <c>struct tcp_info</c></item>
+ <item>The size and offset of the specific field</item>
+ </list>
+ <p>By inspecting the headers or writing a small C program, it is found
+ that <c>IPPROTO_TCP</c> is 6, <c>TCP_INFO</c> is 11, the structure
+ size is 92 (bytes), the offset of <c>tcpi_sacked</c> is 28 bytes,
+ and the value is a 32-bit integer. The following code can be used
+ to retrieve the value:</p>
<code type="none"><![CDATA[
- get_tcpi_sacked(Sock) ->
- {ok,[{raw,_,_,Info}]} = inet:getopts(Sock,[{raw,6,11,92}]),
- <<_:28/binary,TcpiSacked:32/native,_/binary>> = Info,
- TcpiSacked.]]></code>
- <p>Preferably, you would check the machine type, the OS
- and the kernel version prior to executing anything similar to the
- code above.</p>
+get_tcpi_sacked(Sock) ->
+ {ok,[{raw,_,_,Info}]} = inet:getopts(Sock,[{raw,6,11,92}]),
+ <<_:28/binary,TcpiSacked:32/native,_/binary>> = Info,
+ TcpiSacked.]]></code>
+ <p>Preferably, you would check the machine type, the operating system,
+ and the <c>Kernel</c> version before executing anything similar to
+ this code.</p>
</desc>
</func>
<func>
<name name="getstat" arity="1"/>
<name name="getstat" arity="2"/>
- <fsummary>Get one or more statistic options for a socket</fsummary>
+ <fsummary>Get one or more statistic options for a socket.</fsummary>
<type name="stat_option"/>
<desc>
<p>Gets one or more statistic options for a socket.</p>
-
- <p><c>getstat(<anno>Socket</anno>)</c> is equivalent to
- <c>getstat(<anno>Socket</anno>, [recv_avg, recv_cnt, recv_dvi,
- recv_max, recv_oct, send_avg, send_cnt, send_dvi, send_max,
- send_oct])</c>.</p>
- <p>The following options are available:</p>
+ <p><c>getstat(<anno>Socket</anno>)</c> is equivalent to
+ <c>getstat(<anno>Socket</anno>, [recv_avg, recv_cnt, recv_dvi,
+ recv_max, recv_oct, send_avg, send_cnt, send_dvi, send_max,
+ send_oct])</c>.</p>
+ <p>The following options are available:</p>
<taglist>
- <tag><c>recv_avg</c></tag>
- <item>
- <p>Average size of packets in bytes received by the socket.</p>
- </item>
- <tag><c>recv_cnt</c></tag>
- <item>
+ <tag><c>recv_avg</c></tag>
+ <item>
+ <p>Average size of packets, in bytes, received by the socket.</p>
+ </item>
+ <tag><c>recv_cnt</c></tag>
+ <item>
<p>Number of packets received by the socket.</p>
- </item>
- <tag><c>recv_dvi</c></tag>
- <item>
- <p>Average packet size deviation in bytes received by the socket.</p>
- </item>
- <tag><c>recv_max</c></tag>
- <item>
- <p>The size of the largest packet in bytes received by the socket.</p>
- </item>
- <tag><c>recv_oct</c></tag>
- <item>
+ </item>
+ <tag><c>recv_dvi</c></tag>
+ <item>
+ <p>Average packet size deviation, in bytes, received by the socket.</p>
+ </item>
+ <tag><c>recv_max</c></tag>
+ <item>
+ <p>Size of the largest packet, in bytes, received by the socket.</p>
+ </item>
+ <tag><c>recv_oct</c></tag>
+ <item>
<p>Number of bytes received by the socket.</p>
- </item>
-
- <tag><c>send_avg</c></tag>
- <item>
- <p>Average size of packets in bytes sent from the socket.</p>
- </item>
- <tag><c>send_cnt</c></tag>
- <item>
+ </item>
+ <tag><c>send_avg</c></tag>
+ <item>
+ <p>Average size of packets, in bytes, sent from the socket.</p>
+ </item>
+ <tag><c>send_cnt</c></tag>
+ <item>
<p>Number of packets sent from the socket.</p>
- </item>
- <tag><c>send_dvi</c></tag>
- <item>
- <p>Average packet size deviation in bytes sent from the socket.</p>
- </item>
- <tag><c>send_max</c></tag>
- <item>
- <p>The size of the largest packet in bytes sent from the socket.</p>
- </item>
- <tag><c>send_oct</c></tag>
- <item>
+ </item>
+ <tag><c>send_dvi</c></tag>
+ <item>
+ <p>Average packet size deviation, in bytes, sent from the socket.</p>
+ </item>
+ <tag><c>send_max</c></tag>
+ <item>
+ <p>Size of the largest packet, in bytes, sent from the socket.</p>
+ </item>
+ <tag><c>send_oct</c></tag>
+ <item>
<p>Number of bytes sent from the socket.</p>
- </item>
+ </item>
</taglist>
</desc>
</func>
+
<func>
<name name="ntoa" arity="1" />
- <fsummary>Convert IPv6 / IPV4 adress to ascii</fsummary>
+ <fsummary>Convert IPv6/IPV4 address to ASCII.</fsummary>
+ <desc>
+ <p>Parses an
+ <seealso marker="#type-ip_address"><c>ip_address()</c></seealso>
+ and returns an IPv4 or IPv6 address string.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="parse_address" arity="1" />
+ <fsummary>Parse an IPv4 or IPv6 address.</fsummary>
<desc>
- <p>Parses an <seealso marker="#type-ip_address">ip_address()</seealso> and returns an IPv4 or IPv6 address string.</p>
+ <p>Parses an IPv4 or IPv6 address string and returns an
+ <seealso marker="#type-ip4_address"><c>ip4_address()</c></seealso> or
+ <seealso marker="#type-ip6_address"><c>ip6_address()</c></seealso>.
+ Accepts a shortened IPv4 address string.</p>
</desc>
</func>
+
<func>
<name name="parse_ipv4_address" arity="1" />
- <fsummary>Parse an IPv4 address</fsummary>
+ <fsummary>Parse an IPv4 address.</fsummary>
<desc>
- <p>Parses an IPv4 address string and returns an <seealso marker="#type-ip4_address">ip4_address()</seealso>.
- Accepts a shortened IPv4 shortened address string.</p>
+ <p>Parses an IPv4 address string and returns an
+ <seealso marker="#type-ip4_address"><c>ip4_address()</c></seealso>.
+ Accepts a shortened IPv4 address string.</p>
</desc>
</func>
+
<func>
<name name="parse_ipv4strict_address" arity="1" />
<fsummary>Parse an IPv4 address strict.</fsummary>
<desc>
- <p>Parses an IPv4 address string containing four fields, i.e <em>not</em> shortened, and returns an <seealso marker="#type-ip4_address">ip4_address()</seealso>.</p>
+ <p>Parses an IPv4 address string containing four fields, that is,
+ <em>not</em> shortened, and returns an
+ <seealso marker="#type-ip4_address"><c>ip4_address()</c></seealso>.
+ </p>
</desc>
</func>
+
<func>
<name name="parse_ipv6_address" arity="1" />
- <fsummary>Parse an IPv6 address</fsummary>
+ <fsummary>Parse an IPv6 address.</fsummary>
<desc>
- <p>Parses an IPv6 address string and returns an <seealso marker="#type-ip6_address">ip6_address()</seealso>.
- If an IPv4 address string is passed, an IPv4-mapped IPv6 address is returned.</p>
+ <p>Parses an IPv6 address string and returns an
+ <seealso marker="#type-ip6_address"><c>ip6_address()</c></seealso>.
+ If an IPv4 address string is specified, an IPv4-mapped IPv6 address
+ is returned.</p>
</desc>
</func>
+
<func>
<name name="parse_ipv6strict_address" arity="1" />
<fsummary>Parse an IPv6 address strict.</fsummary>
<desc>
- <p>Parses an IPv6 address string and returns an <seealso marker="#type-ip6_address">ip6_address()</seealso>.
- Does <em>not</em> accept IPv4 adresses.</p>
- </desc>
- </func>
- <func>
- <name name="parse_address" arity="1" />
- <fsummary>Parse an IPv4 or IPv6 address.</fsummary>
- <desc>
- <p>Parses an IPv4 or IPv6 address string and returns an <seealso marker="#type-ip4_address">ip4_address()</seealso> or <seealso marker="#type-ip6_address">ip6_address()</seealso>. Accepts a shortened IPv4 address string.</p>
+ <p>Parses an IPv6 address string and returns an
+ <seealso marker="#type-ip6_address"><c>ip6_address()</c></seealso>.
+ Does <em>not</em> accept IPv4 addresses.</p>
</desc>
</func>
+
<func>
<name name="parse_strict_address" arity="1" />
<fsummary>Parse an IPv4 or IPv6 address strict.</fsummary>
<desc>
- <p>Parses an IPv4 or IPv6 address string and returns an <seealso marker="#type-ip4_address">ip4_address()</seealso> or <seealso marker="#type-ip6_address">ip6_address()</seealso>. Does <em>not</em> accept a shortened IPv4 address string.</p>
+ <p>Parses an IPv4 or IPv6 address string and returns an
+ <seealso marker="#type-ip4_address"><c>ip4_address()</c></seealso> or
+ <seealso marker="#type-ip6_address"><c>ip6_address()</c></seealso>.
+ Does <em>not</em> accept a shortened IPv4 address string.</p>
</desc>
</func>
+
<func>
<name name="peername" arity="1"/>
- <fsummary>Return the address and port for the other end of a connection</fsummary>
+ <fsummary>Return the address and port for the other end of a connection.
+ </fsummary>
<desc>
- <p>
- Returns the address and port for the other end of a
- connection.
- </p>
- <p>
- Note that for SCTP sockets this function only returns
- one of the socket's peer addresses. The function
- <seealso marker="#peernames/1">peernames/1,2</seealso>
- returns all.
- </p>
+ <p>Returns the address and port for the other end of a connection.</p>
+ <p>Notice that for SCTP sockets, this function returns only
+ one of the peer addresses of the socket. Function
+ <seealso marker="#peernames/1"><c>peernames/1,2</c></seealso>
+ returns all.</p>
</desc>
</func>
+
<func>
<name name="peernames" arity="1"/>
- <fsummary>
- Return all address/port numbers for the other end of a connection
- </fsummary>
+ <fsummary>Return all address/port numbers for the other end of a
+ connection.</fsummary>
<desc>
- <p>
- Equivalent to
+ <p>Equivalent to
<seealso marker="#peernames/2"><c>peernames(<anno>Socket</anno>, 0)</c></seealso>.
- Note that this function's behaviour for an SCTP
+ </p>
+ <p>Notice that the behavior of this function for an SCTP
one-to-many style socket is not defined by the
- <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">SCTP Sockets API Extensions</url>.
- </p>
+ <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">SCTP Sockets API Extensions</url>.</p>
</desc>
</func>
+
<func>
<name name="peernames" arity="2"/>
- <fsummary>
- Return all address/port numbers for the other end of a connection
- </fsummary>
+ <fsummary>Return all address/port numbers for the other end of a
+ connection.</fsummary>
<desc>
- <p>
- Returns a list of all address/port number pairs for the other end
- of a socket's association <c><anno>Assoc</anno></c>.
- </p>
- <p>
- This function can return multiple addresses for multihomed
- sockets such as SCTP sockets. For other sockets it
- returns a one element list.
- </p>
- <p>
- Note that the <c><anno>Assoc</anno></c> parameter is by the
+ <p>Returns a list of all address/port number pairs for the other end
+ of an association <c><anno>Assoc</anno></c> of a socket.</p>
+ <p>This function can return multiple addresses for multihomed
+ sockets, such as SCTP sockets. For other sockets it
+ returns a one-element list.</p>
+ <p>Notice that parameter <c><anno>Assoc</anno></c> is by the
<url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">SCTP Sockets API Extensions</url>
defined to be ignored for
- one-to-one style sockets. What the special value <c>0</c>
- means hence its behaviour for one-to-many style sockets
- is unfortunately not defined.
- </p>
+ one-to-one style sockets. What the special value <c>0</c>
+ means, hence its behavior for one-to-many style sockets,
+ is unfortunately undefined.</p>
</desc>
</func>
+
<func>
<name name="port" arity="1"/>
- <fsummary>Return the local port number for a socket</fsummary>
+ <fsummary>Return the local port number for a socket.</fsummary>
<desc>
<p>Returns the local port number for a socket.</p>
</desc>
</func>
- <func>
- <name name="sockname" arity="1"/>
- <fsummary>Return the local address and port number for a socket</fsummary>
- <desc>
- <p>Returns the local address and port number for a socket.</p>
- <p>
- Note that for SCTP sockets this function only returns
- one of the socket addresses. The function
- <seealso marker="#socknames/1">socknames/1,2</seealso>
- returns all.
- </p>
- </desc>
- </func>
- <func>
- <name name="socknames" arity="1"/>
- <fsummary>Return all local address/port numbers for a socket</fsummary>
- <desc>
- <p>
- Equivalent to
- <seealso marker="#socknames/2"><c>socknames(<anno>Socket</anno>, 0)</c></seealso>.
- </p>
- </desc>
- </func>
- <func>
- <name name="socknames" arity="2"/>
- <fsummary>Return all local address/port numbers for a socket</fsummary>
- <desc>
- <p>
- Returns a list of all local address/port number pairs for a socket
- for the given association <c><anno>Assoc</anno></c>.
- </p>
- <p>
- This function can return multiple addresses for multihomed
- sockets such as SCTP sockets. For other sockets it
- returns a one element list.
- </p>
- <p>
- Note that the <c><anno>Assoc</anno></c> parameter is by the
- <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">SCTP Sockets API Extensions</url>
- defined to be ignored for one-to-one style sockets.
- For one-to-many style sockets the special value <c>0</c>
- is defined to mean that the returned addresses shall be
- without regard to any particular association.
- How different SCTP implementations interprets this varies somewhat.
- </p>
- </desc>
- </func>
+
<func>
<name name="setopts" arity="2"/>
- <fsummary>Set one or more options for a socket</fsummary>
+ <fsummary>Set one or more options for a socket.</fsummary>
<type name="socket_setopt"/>
<desc>
- <p>Sets one or more options for a socket. The following options
- are available:</p>
+ <p>Sets one or more options for a socket.</p>
+ <p>The following options are available:</p>
<taglist>
<tag><c>{active, true | false | once | N}</c></tag>
<item>
<p>If the value is <c>true</c>, which is the default,
- everything received from the socket will be sent as
- messages to the receiving process. If the value is
- <c>false</c> (passive mode), the process must explicitly
- receive incoming data by calling
+ everything received from the socket is sent as
+ messages to the receiving process.</p>
+ <p>If the value is <c>false</c> (passive mode), the process must
+ explicitly receive incoming data by calling
<seealso marker="gen_tcp#recv/2"><c>gen_tcp:recv/2,3</c></seealso>,
- <seealso marker="gen_udp#recv/2"><c>gen_udp:recv/2,3</c></seealso>
+ <seealso marker="gen_udp#recv/2"><c>gen_udp:recv/2,3</c></seealso>,
or <seealso marker="gen_sctp#recv/1"><c>gen_sctp:recv/1,2</c></seealso>
(depending on the type of socket).</p>
<p>If the value is <c>once</c> (<c>{active, once}</c>),
- <em>one</em> data message from the socket will be sent
- to the process. To receive one more message,
- <c>setopts/2</c> must be called again with the
- <c>{active, once}</c> option.</p>
+ <em>one</em> data message from the socket is sent
+ to the process. To receive one more message,
+ <c>setopts/2</c> must be called again with option
+ <c>{active, once}</c>.</p>
<p>If the value is an integer <c>N</c> in the range -32768 to 32767
(inclusive), the value is added to the socket's count of data
messages sent to the controlling process. A socket's default
- message count is 0. If a negative value is specified and its
- magnitude is equal to or greater than the socket's current
- message count, the socket's message count is set to 0. Once
- the socket's message count reaches 0, either due to sending
+ message count is <c>0</c>. If a negative value is specified, and
+ its magnitude is equal to or greater than the socket's current
+ message count, the socket's message count is set to <c>0</c>.
+ Once the socket's message count reaches <c>0</c>, either because
+ of sending
received data messages to the process or by being explicitly set,
the process is then notified by a special message, specific to
the type of socket, that the socket has entered passive
@@ -575,339 +559,298 @@ fe80::204:acff:fe17:bf38
messages <c>setopts/2</c> must be called again to set the
socket back into an active mode.</p>
<p>When using <c>{active, once}</c> or <c>{active, N}</c>, the
- socket changes behaviour automatically when data is received.
- This can sometimes be confusing in combination with
- connection-oriented sockets (i.e. <c>gen_tcp</c>) as a socket
- with <c>{active, false}</c> behaviour reports closing
+ socket changes behavior automatically when data is received.
+ This can be confusing in combination with connection-oriented
+ sockets (that is, <c>gen_tcp</c>), as a socket
+ with <c>{active, false}</c> behavior reports closing
differently than a socket with <c>{active, true}</c>
- behaviour. To make programming easier, a socket where
- the peer closed and this was detected while in
- <c>{active, false}</c> mode, will still generate the
- message
+ behavior. To simplify programming, a socket where
+ the peer closed, and this is detected while in
+ <c>{active, false}</c> mode, still generates message
<c>{tcp_closed,Socket}</c> when set to <c>{active, once}</c>,
- <c>{active, true}</c> or <c>{active, N}</c> mode. It is therefore
- safe to assume that the message
- <c>{tcp_closed,Socket}</c>, possibly followed by socket
- port termination (depending on the <c>exit_on_close</c>
- option) will eventually appear when a socket changes
+ <c>{active, true}</c>, or <c>{active, N}</c> mode.
+ It is therefore safe to assume that message
+ <c>{tcp_closed,Socket}</c>, possibly followed by socket port
+ termination (depending on option <c>exit_on_close</c>)
+ eventually appears when a socket changes
back and forth between <c>{active, true}</c> and
<c>{active, false}</c> mode. However,
- <em>when</em> peer closing is detected is all up to the
+ <em>when</em> peer closing is detected it is all up to the
underlying TCP/IP stack and protocol.</p>
- <p>Note that <c>{active, true}</c> mode provides no flow
- control; a fast sender could easily overflow the
- receiver with incoming messages. The same is true of
- <c>{active, N}</c> mode while the message count is greater
- than zero. Use active mode only if
+ <p>Notice that <c>{active, true}</c> mode provides no flow
+ control; a fast sender can easily overflow the
+ receiver with incoming messages. The same is true for
+ <c>{active, N}</c> mode, while the message count is greater
+ than zero.</p>
+ <p>Use active mode only if
your high-level protocol provides its own flow control
- (for instance, acknowledging received messages) or the
+ (for example, acknowledging received messages) or the
amount of data exchanged is small. <c>{active, false}</c>
- mode, use of the <c>{active, once}</c> mode or <c>{active, N}</c>
+ mode, use of the <c>{active, once}</c> mode, or <c>{active, N}</c>
mode with values of <c>N</c> appropriate for the application
- provides flow control; the other side will not be able send
+ provides flow control. The other side cannot send
faster than the receiver can read.</p>
</item>
-
- <tag><c>{broadcast, Boolean}</c>(UDP sockets)</tag>
+ <tag><c>{broadcast, Boolean}</c> (UDP sockets)</tag>
<item>
- <p>Enable/disable permission to send broadcasts.</p>
- <marker id="option-buffer"></marker>
+ <p>Enables/disables permission to send broadcasts.</p>
+ <marker id="option-buffer"></marker>
+ </item>
+ <tag><c>{buffer, Size}</c></tag>
+ <item>
+ <p>The size of the user-level software buffer used by
+ the driver. Not to be confused with options <c>sndbuf</c>
+ and <c>recbuf</c>, which correspond to the
+ <c>Kernel</c> socket buffers. It is recommended
+ to have <c>val(buffer) &gt;= max(val(sndbuf),val(recbuf))</c> to
+ avoid performance issues because of unnecessary copying.
+ <c>val(buffer)</c> is automatically set to the above
+ maximum when values <c>sndbuf</c> or <c>recbuf</c> are set.
+ However, as the sizes set for <c>sndbuf</c> and <c>recbuf</c>
+ usually become larger, you are encouraged to use
+ <seealso marker="#getopts/2"><c>getopts/2</c></seealso>
+ to analyze the behavior of your operating system.</p>
</item>
-
- <tag><c>{buffer, Size}</c></tag>
- <item>
- <p>The size of the user-level software buffer used by
- the driver. Not to be confused with <c>sndbuf</c>
- and <c>recbuf</c> options which correspond to
- the kernel socket buffers. It is recommended
- to have <c>val(buffer) &gt;= max(val(sndbuf),val(recbuf))</c> to
- avoid performance issues due to unnecessary copying.
- In fact, the <c>val(buffer)</c> is automatically set to
- the above maximum when <c>sndbuf</c> or <c>recbuf</c> values are set.
- However, since the actual sizes set for <c>sndbuf</c> and <c>recbuf</c>
- usually becomes larger, you are encouraged to use
- <seealso marker="inet#getopts/2"><c>inet:getopts/2</c></seealso>
- to analyze the behavior of your operating system.</p>
- </item>
-
<tag><c>{delay_send, Boolean}</c></tag>
<item>
<p>Normally, when an Erlang process sends to a socket,
- the driver will try to immediately send the data. If that
- fails, the driver will use any means available to queue
+ the driver tries to send the data immediately. If that
+ fails, the driver uses any means available to queue
up the message to be sent whenever the operating system
says it can handle it. Setting <c>{delay_send, true}</c>
- will make <em>all</em> messages queue up. This makes
- the messages actually sent onto the network be larger but
- fewer. The option actually affects the scheduling of send
+ makes <em>all</em> messages queue up. The messages sent
+ to the network are then larger but fewer.
+ The option affects the scheduling of send
requests versus Erlang processes instead of changing any
- real property of the socket. Needless to say it is an
- implementation specific option. Default is <c>false</c>.</p>
+ real property of the socket. The option is
+ implementation-specific. Defaults to <c>false</c>.</p>
+ </item>
+ <tag><c>{deliver, port | term}</c></tag>
+ <item>
+ <p>When <c>{active, true}</c>, data is delivered on the form
+ <c>port</c> : <c>{S, {data, [H1,..Hsz | Data]}}</c> or
+ <c>term</c> : <c>{tcp, S, [H1..Hsz | Data]}</c>.</p>
</item>
-
- <tag><c>{deliver, port | term}</c></tag>
- <item> <p> When <c>{active, true}</c> delivers data on the forms
- <c>port</c> : <c>{S, {data, [H1,..Hsz | Data]}}</c> or
- <c>term</c> : <c>{tcp, S, [H1..Hsz | Data]}</c>.
- </p>
- </item>
-
<tag><c>{dontroute, Boolean}</c></tag>
<item>
- <p>Enable/disable routing bypass for outgoing messages.</p>
+ <p>Enables/disables routing bypass for outgoing messages.</p>
</item>
-
<tag><c>{exit_on_close, Boolean}</c></tag>
<item>
- <p>By default this option is set to <c>true</c>.</p>
+ <p>This option is set to <c>true</c> by default.</p>
<p>The only reason to set it to <c>false</c> is if you want
- to continue sending data to the socket after a close has
- been detected, for instance if the peer has used
- <seealso marker="gen_tcp#shutdown/2">gen_tcp:shutdown/2</seealso>
- to shutdown the write side.</p>
+ to continue sending data to the socket after a close is
+ detected, for example, if the peer uses
+ <seealso marker="gen_tcp#shutdown/2"><c>gen_tcp:shutdown/2</c></seealso>
+ to shut down the write side.</p>
</item>
-
<tag><c>{header, Size}</c></tag>
<item>
- <p>This option is only meaningful if the <c>binary</c>
- option was specified when the socket was created. If
- the <c>header</c> option is specified, the first
+ <p>This option is only meaningful if option <c>binary</c>
+ was specified when the socket was created. If option
+ <c>header</c> is specified, the first
<c>Size</c> number bytes of data received from the socket
- will be elements of a list, and the rest of the data will
- be a binary given as the tail of the same list. If for
- example <c>Size == 2</c>, the data received will match
+ are elements of a list, and the remaining data is
+ a binary specified as the tail of the same list. For example,
+ if <c>Size == 2</c>, the data received matches
<c>[Byte1,Byte2|Binary]</c>.</p>
</item>
-
<tag><c>{high_msgq_watermark, Size}</c></tag>
<item>
- <p>The socket message queue will be set into a busy
- state when the amount of data queued on the message
- queue reaches this limit. Note that this limit only
- concerns data that have not yet reached the ERTS internal
- socket implementation. Default value used is 8 kB.</p>
- <p>Senders of data to the socket will be suspended if
- either the socket message queue is busy, or the socket
- itself is busy.</p>
- <p>For more information see the <c>low_msgq_watermark</c>,
- <c>high_watermark</c>, and <c>low_watermark</c> options.</p>
- <p>Note that distribution sockets will disable the use of
- <c>high_msgq_watermark</c> and <c>low_msgq_watermark</c>,
- and will instead use the
- <seealso marker="erts:erlang#system_info_dist_buf_busy_limit">distribution
- buffer busy limit</seealso> which is a similar feature.</p>
+ <p>The socket message queue is set to a busy
+ state when the amount of data on the message
+ queue reaches this limit. Notice that this limit only
+ concerns data that has not yet reached the <c>ERTS</c> internal
+ socket implementation. Defaults to 8 kB.</p>
+ <p>Senders of data to the socket are suspended if
+ either the socket message queue is busy or the socket
+ itself is busy.</p>
+ <p>For more information, see options <c>low_msgq_watermark</c>,
+ <c>high_watermark</c>, and <c>low_watermark</c>.</p>
+ <p>Notice that distribution sockets disable the use of
+ <c>high_msgq_watermark</c> and <c>low_msgq_watermark</c>.
+ Instead use the
+ <seealso marker="erts:erlang#system_info_dist_buf_busy_limit">distribution buffer busy limit</seealso>,
+ which is a similar feature.</p>
</item>
-
<tag><c>{high_watermark, Size}</c> (TCP/IP sockets)</tag>
<item>
- <p>The socket will be set into a busy state when the amount
- of data queued internally by the ERTS socket implementation
- reaches this limit. Default value used is 8 kB.</p>
- <p>Senders of data to the socket will be suspended if
- either the socket message queue is busy, or the socket
- itself is busy.</p>
- <p>For more information see the <c>low_watermark</c>,
- <c>high_msgq_watermark</c>, and <c>low_msqg_watermark</c>
- options.</p>
+ <p>The socket is set to a busy state when the amount
+ of data queued internally by the <c>ERTS</c> socket implementation
+ reaches this limit. Defaults to 8 kB.</p>
+ <p>Senders of data to the socket are suspended if
+ either the socket message queue is busy or the socket
+ itself is busy.</p>
+ <p>For more information, see options <c>low_watermark</c>,
+ <c>high_msgq_watermark</c>, and <c>low_msqg_watermark</c>.</p>
</item>
-
<tag><c>{ipv6_v6only, Boolean}</c></tag>
<item>
- <p>
- Restricts the socket to only use IPv6, prohibiting any
+ <p>Restricts the socket to use only IPv6, prohibiting any
IPv4 connections. This is only applicable for
- IPv6 sockets (option <c>inet6</c>).
- </p>
- <p>
- On most platforms this option has to be set on the socket
- before associating it to an address. Therefore it is only
- reasonable to give it when creating the socket and not
- to use it when calling the function
- (<seealso marker="#setopts/2">setopts/2</seealso>)
- containing this description.
- </p>
- <p>
- The behaviour of a socket with this socket option set to
- <c>true</c> is becoming the only portable one. The original
+ IPv6 sockets (option <c>inet6</c>).</p>
+ <p>On most platforms this option must be set on the socket
+ before associating it to an address. It is therefore only
+ reasonable to specify it when creating the socket and not
+ to use it when calling function
+ (<seealso marker="#setopts/2"><c>setopts/2</c></seealso>)
+ containing this description.</p>
+ <p>The behavior of a socket with this option set to
+ <c>true</c> is the only portable one. The original
idea when IPv6 was new of using IPv6 for all traffic
is now not recommended by FreeBSD (you can use
<c>{ipv6_v6only,false}</c> to override the recommended
system default value),
- forbidden by OpenBSD (the supported GENERIC kernel)
- and impossible on Windows (that has separate
+ forbidden by OpenBSD (the supported GENERIC kernel),
+ and impossible on Windows (which has separate
IPv4 and IPv6 protocol stacks). Most Linux distros
still have a system default value of <c>false</c>.
- This policy shift among operating systems towards
- separating IPv6 from IPv4 traffic has evolved since
+ This policy shift among operating systems to
+ separate IPv6 from IPv4 traffic has evolved, as
it gradually proved hard and complicated to get
- a dual stack implementation correct and secure.
- </p>
- <p>
- On some platforms the only allowed value for this option
- is <c>true</c>, e.g. OpenBSD and Windows. Trying to set
- this option to <c>false</c> when creating the socket
- will in this case fail.
- </p>
- <p>
- Setting this option on platforms where it does not exist
- is ignored and getting this option with
- <seealso marker="#getopts/2">getopts/2</seealso>
- returns no value i.e the returned list will not contain an
- <c>{ipv6_v6only,_}</c> tuple. On Windows the option acually
- does not exist, but it is emulated as being a
- read-only option with the value <c>true</c>.
- </p>
- <p>
- So it boils down to that setting this option to <c>true</c>
- when creating a socket will never fail except possibly
- (at the time of this writing) on a platform where you
+ a dual stack implementation correct and secure.</p>
+ <p>On some platforms, the only allowed value for this option
+ is <c>true</c>, for example, OpenBSD and Windows. Trying to set
+ this option to <c>false</c>, when creating the socket, fails
+ in this case.</p>
+ <p>Setting this option on platforms where it does not exist
+ is ignored. Getting this option with
+ <seealso marker="#getopts/2"><c>getopts/2</c></seealso>
+ returns no value, that is, the returned list does not contain an
+ <c>{ipv6_v6only,_}</c> tuple. On Windows, the option
+ does not exist, but it is emulated as a
+ read-only option with value <c>true</c>.</p>
+ <p>Therefore, setting this option to <c>true</c>
+ when creating a socket never fails, except possibly on a
+ platform where you
have customized the kernel to only allow <c>false</c>,
- which might be doable (but weird) on e.g. OpenBSD.
- </p>
- <p>
- If you read back the option value using
- <seealso marker="#getopts/2">getopts/2</seealso>
- and get no value the option does not exist in the host OS
- and all bets are off regarding the behaviour of both
- an IPv6 and an IPv4 socket listening on the same port
- as well as for an IPv6 socket getting IPv4 traffic.
- </p>
+ which can be doable (but awkward) on, for example, OpenBSD.</p>
+ <p>If you read back the option value using
+ <seealso marker="#getopts/2"><c>getopts/2</c></seealso>
+ and get no value, the option does not exist in the host
+ operating system. The behavior of both an IPv6 and an IPv4
+ socket listening on the same port, and for an IPv6 socket
+ getting IPv4 traffic is then no longer predictable.</p>
</item>
-
<tag><c>{keepalive, Boolean}</c>(TCP/IP sockets)</tag>
<item>
<p>Enables/disables periodic transmission on a connected
- socket, when no other data is being exchanged. If
+ socket when no other data is exchanged. If
the other end does not respond, the connection is
- considered broken and an error message will be sent to
- the controlling process. Default disabled.</p>
- <marker id="option-linger"></marker>
+ considered broken and an error message is sent to
+ the controlling process. Defaults to <c>disabled</c>.</p>
+ <marker id="option-linger"></marker>
+ </item>
+ <tag><c>{linger, {true|false, Seconds}}</c></tag>
+ <item>
+ <p>Determines the time-out, in seconds, for flushing unsent data
+ in the <c>close/1</c> socket call. If the first component of
+ the value tuple is <c>false</c>, the second is ignored. This
+ means that <c>close/1</c> returns immediately, not waiting
+ for data to be flushed. Otherwise, the second component is
+ the flushing time-out, in seconds.</p>
</item>
-
- <tag><c>{linger, {true|false, Seconds}}</c></tag>
- <item>
- <p>Determines the timeout in seconds for flushing unsent data in the
- <c>close/1</c> socket call. If the 1st component of the value
- tuple is <c>false</c>, the 2nd one is ignored, which means that
- <c>close/1</c> returns immediately not waiting
- for data to be flushed. Otherwise, the 2nd component is
- the flushing time-out in seconds.</p>
- </item>
-
<tag><c>{low_msgq_watermark, Size}</c></tag>
<item>
<p>If the socket message queue is in a busy state, the
- socket message queue will be set in a not busy state when
- the amount of data queued in the message queue falls
- below this limit. Note that this limit only concerns data
- that have not yet reached the ERTS internal socket
- implementation. Default value used is 4 kB.</p>
- <p>Senders that have been suspended due to either a
- busy message queue or a busy socket, will be resumed
- when neither the socket message queue, nor the socket
- are busy.</p>
- <p>For more information see the <c>high_msgq_watermark</c>,
- <c>high_watermark</c>, and <c>low_watermark</c> options.</p>
- <p>Note that distribution sockets will disable the use of
- <c>high_msgq_watermark</c> and <c>low_msgq_watermark</c>,
- and will instead use the
- <seealso marker="erts:erlang#system_info_dist_buf_busy_limit">distribution
- buffer busy limit</seealso> which is a similar feature.</p>
+ socket message queue is set in a not busy state when
+ the amount of data queued in the message queue falls
+ below this limit. Notice that this limit only concerns data
+ that has not yet reached the <c>ERTS</c> internal socket
+ implementation. Defaults to 4 kB.</p>
+ <p>Senders that are suspended because of either a
+ busy message queue or a busy socket are resumed
+ when the socket message queue and the socket
+ are not busy.</p>
+ <p>For more information, see options <c>high_msgq_watermark</c>,
+ <c>high_watermark</c>, and <c>low_watermark</c>.</p>
+ <p>Notice that distribution sockets disable the use of
+ <c>high_msgq_watermark</c> and <c>low_msgq_watermark</c>.
+ Instead they use the
+ <seealso marker="erts:erlang#system_info_dist_buf_busy_limit">distribution
+ buffer busy limit</seealso>, which is a similar feature.</p>
</item>
-
<tag><c>{low_watermark, Size}</c> (TCP/IP sockets)</tag>
<item>
- <p>If the socket is in a busy state, the socket will
- be set in a not busy state when the amount of data
- queued internally by the ERTS socket implementation
- falls below this limit. Default value used is 4 kB.</p>
- <p>Senders that have been suspended due to either a
- busy message queue or a busy socket, will be resumed
- when neither the socket message queue, nor the socket
- are busy.</p>
- <p>For more information see the <c>high_watermark</c>,
- <c>high_msgq_watermark</c>, and <c>low_msgq_watermark</c>
- options.</p>
+ <p>If the socket is in a busy state, the socket is
+ set in a not busy state when the amount of data
+ queued internally by the <c>ERTS</c> socket implementation
+ falls below this limit. Defaults to 4 kB.</p>
+ <p>Senders that are suspended because of a
+ busy message queue or a busy socket are resumed
+ when the socket message queue and the socket are not busy.</p>
+ <p>For more information, see options <c>high_watermark</c>,
+ <c>high_msgq_watermark</c>, and <c>low_msgq_watermark</c>.</p>
</item>
-
- <tag><c>{mode, Mode :: binary | list}</c></tag>
+ <tag><c>{mode, Mode :: binary | list}</c></tag>
<item>
- <p>Received <c>Packet</c> is delivered as defined by Mode.</p>
- </item>
-
+ <p>Received <c>Packet</c> is delivered as defined by <c>Mode</c>.
+ </p>
+ </item>
<tag><c>{netns, Namespace :: file:filename_all()}</c></tag>
<item>
- <p>Set a network namespace for the socket. The <c>Namespace</c>
- parameter is a filename defining the namespace for example
- <c>"/var/run/netns/example"</c> typically created by the command
- <c>ip netns add example</c>. This option must be used in a
- function call that creates a socket i.e
- <seealso marker="gen_tcp#connect/3">
- gen_tcp:connect/3,4</seealso>,
- <seealso marker="gen_tcp#listen/2">
- gen_tcp:listen/2</seealso>,
- <seealso marker="gen_udp#open/1">
- gen_udp:open/1,2</seealso> or
- <seealso marker="gen_sctp#open/0">
- gen_sctp:open/0-2</seealso>.
- </p>
- <p>This option uses the Linux specific syscall
- <c>setns()</c> such as in Linux kernel 3.0 or later
- and therefore only exists when the runtime system
- has been compiled for such an operating system.
- </p>
- <p>
- The virtual machine also needs elevated privileges either
- running as superuser or (for Linux) having the capability
- <c>CAP_SYS_ADMIN</c> according to the documentation for setns(2).
- However, during testing also <c>CAP_SYS_PTRACE</c>
- and <c>CAP_DAC_READ_SEARCH</c> has proven to be necessary.
- Example:</p><code>
-setcap cap_sys_admin,cap_sys_ptrace,cap_dac_read_search+epi beam.smp
-</code>
- <p>Note also that the filesystem containing the virtual machine
- executable (<c>beam.smp</c> in the example above) has to be local,
- mounted without the <c>nosetuid</c> flag,
- support extended attributes and that
- the kernel has to support file capabilities.
- All this runs out of the box on at least Ubuntu 12.04 LTS,
- except that SCTP sockets appears to not support
- network namespaces.
- </p>
- <p>The <c>Namespace</c> is a file name and is encoded
- and decoded as discussed in
- <seealso marker="file">file</seealso>
- except that the emulator flag <c>+fnu</c> is ignored and
- <seealso marker="#getopts/2">getopts/2</seealso>
- for this option will return a binary for the filename
- if the stored filename can not be decoded,
- which should only happen if you set the option using a binary
- that can not be decoded with the emulator's filename encoding:
- <seealso marker="file#native_name_encoding/0">
- file:native_name_encoding/0</seealso>.
- </p>
- </item>
-
- <tag><c>list</c></tag>
+ <p>Sets a network namespace for the socket. Parameter
+ <c>Namespace</c> is a filename defining the namespace, for
+ example, <c>"/var/run/netns/example"</c>, typically created by
+ command <c>ip netns add example</c>. This option must be used in
+ a function call that creates a socket, that is,
+ <seealso marker="gen_tcp#connect/3"><c>gen_tcp:connect/3,4</c></seealso>,
+ <seealso marker="gen_tcp#listen/2"><c>gen_tcp:listen/2</c></seealso>,
+ <seealso marker="gen_udp#open/1"><c>gen_udp:open/1,2</c></seealso>, or
+ <seealso marker="gen_sctp#open/0"><c>gen_sctp:open/0,1,2</c></seealso>.</p>
+ <p>This option uses the Linux-specific syscall
+ <c>setns()</c>, such as in Linux kernel 3.0 or later,
+ and therefore only exists when the runtime system
+ is compiled for such an operating system.</p>
+ <p>The virtual machine also needs elevated privileges, either
+ running as superuser or (for Linux) having capability
+ <c>CAP_SYS_ADMIN</c> according to the documentation for
+ <c>setns(2)</c>.
+ However, during testing also <c>CAP_SYS_PTRACE</c>
+ and <c>CAP_DAC_READ_SEARCH</c> have proven to be necessary.</p>
+ <p><em>Example:</em></p>
+ <code>
+setcap cap_sys_admin,cap_sys_ptrace,cap_dac_read_search+epi beam.smp</code>
+ <p>Notice that the filesystem containing the virtual machine
+ executable (<c>beam.smp</c> in the example) must be local,
+ mounted without flag <c>nosetuid</c>,
+ support extended attributes, and
+ the kernel must support file capabilities.
+ All this runs out of the box on at least Ubuntu 12.04 LTS,
+ except that SCTP sockets appear to not support
+ network namespaces.</p>
+ <p><c>Namespace</c> is a filename and is encoded
+ and decoded as discussed in module
+ <seealso marker="file">file</seealso>, with the
+ following exceptions:</p>
+ <list type="bulleted">
+ <item><p>Emulator flag <c>+fnu</c> is ignored.</p></item>
+ <item><p><seealso marker="#getopts/2"><c>getopts/2</c></seealso>
+ for this option returns a binary for the filename if the stored
+ filename cannot be decoded. This is only to occur if you set the
+ option using a binary that cannot be decoded with the emulator's
+ filename encoding:
+ <seealso marker="file#native_name_encoding/0"><c>file:native_name_encoding/0</c></seealso>.</p></item>
+ </list>
+ </item>
+ <tag><c>list</c></tag>
<item>
- <p>Received <c>Packet</c> is delivered as a list.</p>
- </item>
-
- <tag><c>binary</c></tag>
+ <p>Received <c>Packet</c> is delivered as a list.</p>
+ </item>
+ <tag><c>binary</c></tag>
<item>
- <p>Received <c>Packet</c> is delivered as a binary.</p>
- </item>
-
+ <p>Received <c>Packet</c> is delivered as a binary.</p>
+ </item>
<tag><c>{nodelay, Boolean}</c>(TCP/IP sockets)</tag>
<item>
- <p>If <c>Boolean == true</c>, the <c>TCP_NODELAY</c> option
- is turned on for the socket, which means that even small
- amounts of data will be sent immediately.</p>
+ <p>If <c>Boolean == true</c>, option <c>TCP_NODELAY</c>
+ is turned on for the socket, which means that also small
+ amounts of data are sent immediately.</p>
</item>
<tag><c>{packet, PacketType}</c>(TCP/IP sockets)</tag>
<item>
<p>Defines the type of packets to use for a socket.
- The following values are valid:</p>
+ Possible values:</p>
<taglist>
<tag><c>raw | 0</c></tag>
<item>
@@ -917,104 +860,99 @@ setcap cap_sys_admin,cap_sys_ptrace,cap_dac_read_search+epi beam.smp
<item>
<p>Packets consist of a header specifying the number of
bytes in the packet, followed by that number of bytes.
- The length of header can be one, two, or four bytes;
+ The header length can be one, two, or four bytes, and
containing an unsigned integer in big-endian byte order.
- Each send operation will generate the header, and the header
- will be stripped off on each receive operation.</p>
- <p>In current implementation the 4-byte header is limited to 2Gb.</p>
+ Each send operation generates the header, and the header
+ is stripped off on each receive operation.</p>
+ <p>The 4-byte header is limited to 2Gb.</p>
</item>
<tag><c>asn1 | cdr | sunrm | fcgi | tpkt | line</c></tag>
<item>
<p>These packet types only have effect on receiving.
When sending a packet, it is the responsibility of
the application to supply a correct header. On
- receiving, however, there will be one message sent to
+ receiving, however, one message is sent to
the controlling process for each complete packet
received, and, similarly, each call to
<c>gen_tcp:recv/2,3</c> returns one complete packet.
The header is <em>not</em> stripped off.</p>
- <p>The meanings of the packet types are as follows:
- <br></br>
-<c>asn1</c> - ASN.1 BER,
- <br></br>
-<c>sunrm</c> - Sun's RPC encoding,
- <br></br>
-<c>cdr</c> - CORBA (GIOP 1.1),
- <br></br>
-<c>fcgi</c> - Fast CGI,
- <br></br>
-<c>tpkt</c> - TPKT format [RFC1006],
- <br></br>
-<c>line</c> - Line mode, a packet is a line
- terminated with newline, lines longer than
- the receive buffer are truncated.</p>
- </item>
+ <p>The meanings of the packet types are as follows:</p>
+ <list type="bulleted">
+ <item><c>asn1</c> - ASN.1 BER</item>
+ <item><c>sunrm</c> - Sun's RPC encoding</item>
+ <item><c>cdr</c> - CORBA (GIOP 1.1)</item>
+ <item><c>fcgi</c> - Fast CGI</item>
+ <item><c>tpkt</c> - TPKT format [RFC1006]</item>
+ <item><c>line</c> - Line mode, a packet is a line-terminated
+ with newline, lines longer than the receive buffer are
+ truncated</item>
+ </list>
+ </item>
<tag><c>http | http_bin</c></tag>
<item>
<p>The Hypertext Transfer Protocol. The packets
are returned with the format according to <c>HttpPacket</c>
- described in <seealso marker="erts:erlang#decode_packet/3">
- erlang:decode_packet/3</seealso>. A socket in passive
- mode will return <c>{ok, HttpPacket}</c> from <c>gen_tcp:recv</c>
- while an active socket will send messages like <c>{http,
- Socket, HttpPacket}</c>.</p>
+ described in
+ <seealso marker="erts:erlang#decode_packet/3">
+ <c>erlang:decode_packet/3</c></seealso> in <c>ERTS</c>.
+ A socket in passive
+ mode returns <c>{ok, HttpPacket}</c> from <c>gen_tcp:recv</c>
+ while an active socket sends messages like
+ <c>{http, Socket, HttpPacket}</c>.</p>
</item>
<tag><c>httph | httph_bin</c></tag>
<item>
- <p>These two types are often not needed as the socket will
- automatically switch from <c>http</c>/<c>http_bin</c> to
+ <p>These two types are often not needed, as the socket
+ automatically switches from <c>http</c>/<c>http_bin</c> to
<c>httph</c>/<c>httph_bin</c> internally after the first line
- has been read. There might be occasions however when they are
+ is read. However, there can be occasions when they are
useful, such as parsing trailers from chunked encoding.</p>
</item>
</taglist>
</item>
<tag><c>{packet_size, Integer}</c>(TCP/IP sockets)</tag>
<item>
- <p>Sets the max allowed length of the packet body. If
+ <p>Sets the maximum allowed length of the packet body. If
the packet header indicates that the length of the packet
- is longer than the max allowed length, the packet is
- considered invalid. The same happens if the packet header
- is too big for the socket receive buffer.</p>
- <p>For line oriented protocols (<c>line</c>,<c>http*</c>),
- option <c>packet_size</c> also guarantees that lines up to the
- indicated length are accepted and not considered invalid due
- to internal buffer limitations.</p>
+ is longer than the maximum allowed length, the packet is
+ considered invalid. The same occurs if the packet header
+ is too large for the socket receive buffer.</p>
+ <p>For line-oriented protocols (<c>line</c>, <c>http*</c>),
+ option <c>packet_size</c> also guarantees that lines up to the
+ indicated length are accepted and not considered invalid
+ because of internal buffer limitations.</p>
</item>
<tag><c>{line_delimiter, Char}</c>(TCP/IP sockets)</tag>
<item>
- <p>Sets the line delimiting character for line oriented protocols
- (<c>line</c>). Default value is <c>$\n</c>.</p>
+ <p>Sets the line delimiting character for line-oriented protocols
+ (<c>line</c>). Defaults to <c>$\n</c>.</p>
+ </item>
+ <tag><c>{priority, Priority}</c></tag>
+ <item>
+ <p>Sets the protocol-defined priority for all packets to be sent
+ on this socket.</p>
+ </item>
+ <tag><c>{raw, Protocol, OptionNum, ValueBin}</c></tag>
+ <item>
+ <p>See below.</p>
</item>
-
- <tag><c>{priority, Priority}</c></tag>
- <item> <p>Set the protocol-defined priority for all packets to be sent
- on this socket.</p>
- </item>
-
- <tag><c>{raw, Protocol, OptionNum, ValueBin}</c></tag>
- <item> <p>See below.</p>
- </item>
-
<tag><c>{read_packets, Integer}</c>(UDP sockets)</tag>
<item>
- <p>Sets the max number of UDP packets to read without
+ <p>Sets the maximum number of UDP packets to read without
intervention from the socket when data is available.
When this many packets have been read and delivered
to the destination process, new packets are not read
until a new notification of available data has arrived.
- The default is 5, and if this parameter is set too
- high the system can become unresponsive due to
+ Defaults to <c>5</c>. If this parameter is set too
+ high, the system can become unresponsive because of
UDP packet flooding.</p>
</item>
<tag><c>{recbuf, Size}</c></tag>
<item>
<p>The minimum size of the receive buffer to use for
the socket. You are encouraged to use
- <seealso marker="inet#getopts/2"><c>inet:getopts/2</c></seealso>,
- to retrieve the actual size set by your operating system.
-
- </p>
+ <seealso marker="#getopts/2"><c>getopts/2</c></seealso>
+ to retrieve the size set by your operating system.</p>
</item>
<tag><c>{reuseaddr, Boolean}</c></tag>
<item>
@@ -1023,118 +961,160 @@ setcap cap_sys_admin,cap_sys_ptrace,cap_dac_read_search+epi beam.smp
</item>
<tag><c>{send_timeout, Integer}</c></tag>
<item>
- <p>Only allowed for connection oriented sockets.</p>
+ <p>Only allowed for connection-oriented sockets.</p>
<p>Specifies a longest time to wait for a send operation to
be accepted by the underlying TCP stack. When the limit is
- exceeded, the send operation will return
- <c>{error,timeout}</c>. How much of a packet that actually
- got sent is unknown, why the socket should be closed
- whenever a timeout has occurred (see <c>send_timeout_close</c>).
- Default is <c>infinity</c>.</p>
+ exceeded, the send operation returns
+ <c>{error,timeout}</c>. How much of a packet that
+ got sent is unknown; the socket is therefore to be closed
+ whenever a time-out has occurred (see <c>send_timeout_close</c>
+ below). Defaults to <c>infinity</c>.</p>
</item>
<tag><c>{send_timeout_close, Boolean}</c></tag>
<item>
- <p>Only allowed for connection oriented sockets.</p>
+ <p>Only allowed for connection-oriented sockets.</p>
<p>Used together with <c>send_timeout</c> to specify whether
- the socket will be automatically closed when the send operation
+ the socket is to be automatically closed when the send operation
returns <c>{error,timeout}</c>. The recommended setting is
- <c>true</c> which will automatically close the socket.
- Default is <c>false</c> due to backward compatibility.</p>
- <marker id="option-sndbuf"></marker>
+ <c>true</c>, which automatically closes the socket.
+ Defaults to <c>false</c> because of backward compatibility.</p>
+ <marker id="option-sndbuf"></marker>
</item>
-
<tag><c>{show_econnreset, Boolean}</c>(TCP/IP sockets)</tag>
<item>
- <p>When this option is set to <c>false</c>, as it is by
- default, an RST that is received from the TCP peer is treated
- as a normal close (as though a FIN was sent). A caller
- to <seealso marker="gen_tcp#recv/2">gen_tcp:recv/2</seealso>
- will get <c>{error, closed}</c>. In active
- mode the controlling process will receive a
+ <p>When this option is set to <c>false</c>, which is
+ default, an RST received from the TCP peer is treated
+ as a normal close (as though an FIN was sent). A caller to
+ <seealso marker="gen_tcp#recv/2"><c>gen_tcp:recv/2</c></seealso>
+ gets <c>{error, closed}</c>. In active
+ mode, the controlling process receives a
<c>{tcp_close, Socket}</c> message, indicating that the
peer has closed the connection.</p>
- <p>Setting this option to <c>true</c> will allow you to
+ <p>Setting this option to <c>true</c> allows you to
distinguish between a connection that was closed normally,
- and one which was aborted (intentionally or unintentionally)
+ and one that was aborted (intentionally or unintentionally)
by the TCP peer. A call to
- <seealso marker="gen_tcp#recv/2">gen_tcp:recv/2</seealso>
- will return <c>{error, econnreset}</c>. In
- active mode, the controlling process will receive a
+ <seealso marker="gen_tcp#recv/2"><c>gen_tcp:recv/2</c></seealso>
+ returns <c>{error, econnreset}</c>. In
+ active mode, the controlling process receives a
<c>{tcp_error, Socket, econnreset}</c> message
before the usual <c>{tcp_closed, Socket}</c>, as is
the case for any other socket error. Calls to
- <seealso marker="gen_tcp#send/2">gen_tcp:send/2</seealso>
- will also return <c>{error, econnreset}</c> when it
+ <seealso marker="gen_tcp#send/2"><c>gen_tcp:send/2</c></seealso>
+ also returns <c>{error, econnreset}</c> when it
is detected that a TCP peer has sent an RST.</p>
<p>A connected socket returned from
- <seealso marker="gen_tcp#accept/1">gen_tcp:accept/1</seealso>
- will inherit the <c>show_econnreset</c> setting from the
+ <seealso marker="gen_tcp#accept/1"><c>gen_tcp:accept/1</c></seealso>
+ inherits the <c>show_econnreset</c> setting from the
listening socket.</p>
- <marker id="option-show_econnreset"></marker>
+ <marker id="option-show_econnreset"></marker>
</item>
-
<tag><c>{sndbuf, Size}</c></tag>
<item>
<p>The minimum size of the send buffer to use for the socket.
- You are encouraged to use
- <seealso marker="inet#getopts/2"><c>inet:getopts/2</c></seealso>,
- to retrieve the actual size set by your operating system.
- </p>
+ You are encouraged to use
+ <seealso marker="#getopts/2"><c>getopts/2</c></seealso>,
+ to retrieve the size set by your operating system.</p>
</item>
<tag><c>{priority, Integer}</c></tag>
<item>
- <p>Sets the SO_PRIORITY socket level option on platforms where
- this is implemented. The behaviour and allowed range varies on
- different systems. The option is ignored on platforms where the
- option is not implemented. Use with caution.</p>
+ <p>Sets the <c>SO_PRIORITY</c> socket level option on platforms
+ where this is implemented. The behavior and allowed range varies
+ between different systems.
+ The option is ignored on platforms where it
+ is not implemented. Use with caution.</p>
</item>
<tag><c>{tos, Integer}</c></tag>
<item>
- <p>Sets IP_TOS IP level options on platforms where this is
- implemented. The behaviour and allowed range varies on different
- systems. The option is ignored on platforms where the option is
- not implemented. Use with caution.</p>
+ <p>Sets <c>IP_TOS IP</c> level options on platforms where this is
+ implemented. The behavior and allowed range varies between
+ different systems.
+ The option is ignored on platforms where it is not
+ implemented. Use with caution.</p>
</item>
</taglist>
-
- <p>In addition to the options mentioned above, <em>raw</em>
+ <p>In addition to these options, <em>raw</em>
option specifications can be used. The raw options are
- specified as a tuple of arity four, beginning with the tag
- <c>raw</c>, followed by the protocol level, the option number
- and the actual option value specified as a binary. This
- corresponds to the second, third and fourth argument to the
+ specified as a tuple of arity four, beginning with tag
+ <c>raw</c>, followed by the protocol level, the option number,
+ and the option value specified as a binary. This
+ corresponds to the second, third, and fourth arguments to the
<c>setsockopt</c> call in the C socket API. The option value
- needs to be coded in the native endianess of the platform and,
- if a structure is required, needs to follow the struct
+ must be coded in the native endianess of the platform and,
+ if a structure is required, must follow the structure
alignment conventions on the specific platform.</p>
- <p>Using raw socket options require detailed knowledge about
+ <p>Using raw socket options requires detailed knowledge about
the current operating system and TCP stack.</p>
- <p>As an example of the usage of raw options, consider a Linux
- system where you want to set the <c>TCP_LINGER2</c> option on
- the <c>IPPROTO_TCP</c> protocol level in the stack. You know
+ <p><em>Example:</em></p>
+ <p>This example concerns the use of raw options. Consider a Linux
+ system where you want to set option <c>TCP_LINGER2</c> on
+ protocol level <c>IPPROTO_TCP</c> in the stack. You know
that on this particular system it defaults to 60 (seconds),
- but you would like to lower it to 30 for a particular
- socket. The <c>TCP_LINGER2</c> option is not explicitly
- supported by inet, but you know that the protocol level
- translates to the number 6, the option number to the number 8
- and the value is to be given as a 32 bit integer. You can use
- this line of code to set the option for the socket named
+ but you want to lower it to 30 for a particular
+ socket. Option <c>TCP_LINGER2</c> is not explicitly
+ supported by <c>inet</c>, but you know that the protocol level
+ translates to number 6, the option number to number 8,
+ and the value is to be specified as a 32-bit integer. You can use
+ this code line to set the option for the socket named
<c>Sock</c>:</p>
<code type="none"><![CDATA[
- inet:setopts(Sock,[{raw,6,8,<<30:32/native>>}]),]]></code>
+inet:setopts(Sock,[{raw,6,8,<<30:32/native>>}]),]]></code>
<p>As many options are silently discarded by the stack if they
- are given out of range, it could be a good idea to check that
- a raw option really got accepted. This code places the value
- in the variable TcpLinger2:</p>
+ are specified out of range; it can be a good idea to check that
+ a raw option is accepted. The following code places the value
+ in variable <c>TcpLinger2:</c></p>
<code type="none"><![CDATA[
- {ok,[{raw,6,8,<<TcpLinger2:32/native>>}]}=inet:getopts(Sock,[{raw,6,8,4}]),]]></code>
- <p>Code such as the examples above is inherently non portable,
- even different versions of the same OS on the same platform
- may respond differently to this kind of option
+{ok,[{raw,6,8,<<TcpLinger2:32/native>>}]}=inet:getopts(Sock,[{raw,6,8,4}]),]]></code>
+ <p>Code such as these examples is inherently non-portable,
+ even different versions of the same OS on the same platform
+ can respond differently to this kind of option
manipulation. Use with care.</p>
- <p>Note that the default options for TCP/IP sockets can be
- changed with the Kernel configuration parameters mentioned in
- the beginning of this document.</p>
+ <p>Notice that the default options for TCP/IP sockets can be
+ changed with the <c>Kernel</c> configuration parameters mentioned in
+ the beginning of this manual page.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="sockname" arity="1"/>
+ <fsummary>Return the local address and port number for a socket.
+ </fsummary>
+ <desc>
+ <p>Returns the local address and port number for a socket.</p>
+ <p>Notice that for SCTP sockets this function returns only
+ one of the socket addresses. Function
+ <seealso marker="#socknames/1"><c>socknames/1,2</c></seealso>
+ returns all.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="socknames" arity="1"/>
+ <fsummary>Return all local address/port numbers for a socket.</fsummary>
+ <desc>
+ <p>Equivalent to
+ <seealso marker="#socknames/2"><c>socknames(<anno>Socket</anno>, 0)</c></seealso>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="socknames" arity="2"/>
+ <fsummary>Return all local address/port numbers for a socket.</fsummary>
+ <desc>
+ <p>Returns a list of all local address/port number pairs for a socket
+ for the specified association <c><anno>Assoc</anno></c>.</p>
+ <p>This function can return multiple addresses for multihomed
+ sockets, such as SCTP sockets. For other sockets it
+ returns a one-element list.</p>
+ <p>Notice that parameter <c><anno>Assoc</anno></c> is by the
+ <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">SCTP Sockets API Extensions</url>
+ defined to be ignored for one-to-one style sockets.
+ For one-to-many style sockets, the special value <c>0</c>
+ is defined to mean that the returned addresses must be
+ without any particular association.
+ How different SCTP implementations interprets this varies somewhat.
+ </p>
</desc>
</func>
</funcs>
@@ -1143,148 +1123,147 @@ setcap cap_sys_admin,cap_sys_ptrace,cap_dac_read_search+epi beam.smp
<marker id="error_codes"></marker>
<title>POSIX Error Codes</title>
<list type="bulleted">
- <item><c>e2big</c> - argument list too long</item>
- <item><c>eacces</c> - permission denied</item>
- <item><c>eaddrinuse</c> - address already in use</item>
- <item><c>eaddrnotavail</c> - cannot assign requested address</item>
- <item><c>eadv</c> - advertise error</item>
- <item><c>eafnosupport</c> - address family not supported by
- protocol family</item>
- <item><c>eagain</c> - resource temporarily unavailable</item>
+ <item><c>e2big</c> - Too long argument list</item>
+ <item><c>eacces</c> - Permission denied</item>
+ <item><c>eaddrinuse</c> - Address already in use</item>
+ <item><c>eaddrnotavail</c> - Cannot assign requested address</item>
+ <item><c>eadv</c> - Advertise error</item>
+ <item><c>eafnosupport</c> - Address family not supported by
+ protocol family</item>
+ <item><c>eagain</c> - Resource temporarily unavailable</item>
<item><c>ealign</c> - EALIGN</item>
- <item><c>ealready</c> - operation already in progress</item>
- <item><c>ebade</c> - bad exchange descriptor</item>
- <item><c>ebadf</c> - bad file number</item>
- <item><c>ebadfd</c> - file descriptor in bad state</item>
- <item><c>ebadmsg</c> - not a data message</item>
- <item><c>ebadr</c> - bad request descriptor</item>
- <item><c>ebadrpc</c> - RPC structure is bad</item>
- <item><c>ebadrqc</c> - bad request code</item>
- <item><c>ebadslt</c> - invalid slot</item>
- <item><c>ebfont</c> - bad font file format</item>
- <item><c>ebusy</c> - file busy</item>
- <item><c>echild</c> - no children</item>
- <item><c>echrng</c> - channel number out of range</item>
- <item><c>ecomm</c> - communication error on send</item>
- <item><c>econnaborted</c> - software caused connection abort</item>
- <item><c>econnrefused</c> - connection refused</item>
- <item><c>econnreset</c> - connection reset by peer</item>
- <item><c>edeadlk</c> - resource deadlock avoided</item>
- <item><c>edeadlock</c> - resource deadlock avoided</item>
- <item><c>edestaddrreq</c> - destination address required</item>
- <item><c>edirty</c> - mounting a dirty fs w/o force</item>
- <item><c>edom</c> - math argument out of range</item>
- <item><c>edotdot</c> - cross mount point</item>
- <item><c>edquot</c> - disk quota exceeded</item>
- <item><c>eduppkg</c> - duplicate package name</item>
- <item><c>eexist</c> - file already exists</item>
- <item><c>efault</c> - bad address in system call argument</item>
- <item><c>efbig</c> - file too large</item>
- <item><c>ehostdown</c> - host is down</item>
- <item><c>ehostunreach</c> - host is unreachable</item>
- <item><c>eidrm</c> - identifier removed</item>
- <item><c>einit</c> - initialization error</item>
- <item><c>einprogress</c> - operation now in progress</item>
- <item><c>eintr</c> - interrupted system call</item>
- <item><c>einval</c> - invalid argument</item>
+ <item><c>ealready</c> - Operation already in progress</item>
+ <item><c>ebade</c> - Bad exchange descriptor</item>
+ <item><c>ebadf</c> - Bad file number</item>
+ <item><c>ebadfd</c> - File descriptor in bad state</item>
+ <item><c>ebadmsg</c> - Not a data message</item>
+ <item><c>ebadr</c> - Bad request descriptor</item>
+ <item><c>ebadrpc</c> - Bad RPC structure</item>
+ <item><c>ebadrqc</c> - Bad request code</item>
+ <item><c>ebadslt</c> - Invalid slot</item>
+ <item><c>ebfont</c> - Bad font file format</item>
+ <item><c>ebusy</c> - File busy</item>
+ <item><c>echild</c> - No children</item>
+ <item><c>echrng</c> - Channel number out of range</item>
+ <item><c>ecomm</c> - Communication error on send</item>
+ <item><c>econnaborted</c> - Software caused connection abort</item>
+ <item><c>econnrefused</c> - Connection refused</item>
+ <item><c>econnreset</c> - Connection reset by peer</item>
+ <item><c>edeadlk</c> - Resource deadlock avoided</item>
+ <item><c>edeadlock</c> - Resource deadlock avoided</item>
+ <item><c>edestaddrreq</c> - Destination address required</item>
+ <item><c>edirty</c> - Mounting a dirty fs without force</item>
+ <item><c>edom</c> - Math argument out of range</item>
+ <item><c>edotdot</c> - Cross mount point</item>
+ <item><c>edquot</c> - Disk quota exceeded</item>
+ <item><c>eduppkg</c> - Duplicate package name</item>
+ <item><c>eexist</c> - File already exists</item>
+ <item><c>efault</c> - Bad address in system call argument</item>
+ <item><c>efbig</c> - File too large</item>
+ <item><c>ehostdown</c> - Host is down</item>
+ <item><c>ehostunreach</c> - Host is unreachable</item>
+ <item><c>eidrm</c> - Identifier removed</item>
+ <item><c>einit</c> - Initialization error</item>
+ <item><c>einprogress</c> - Operation now in progress</item>
+ <item><c>eintr</c> - Interrupted system call</item>
+ <item><c>einval</c> - Invalid argument</item>
<item><c>eio</c> - I/O error</item>
- <item><c>eisconn</c> - socket is already connected</item>
- <item><c>eisdir</c> - illegal operation on a directory</item>
- <item><c>eisnam</c> - is a named file</item>
- <item><c>el2hlt</c> - level 2 halted</item>
- <item><c>el2nsync</c> - level 2 not synchronized</item>
- <item><c>el3hlt</c> - level 3 halted</item>
- <item><c>el3rst</c> - level 3 reset</item>
+ <item><c>eisconn</c> - Socket is already connected</item>
+ <item><c>eisdir</c> - Illegal operation on a directory</item>
+ <item><c>eisnam</c> - Is a named file</item>
+ <item><c>el2hlt</c> - Level 2 halted</item>
+ <item><c>el2nsync</c> - Level 2 not synchronized</item>
+ <item><c>el3hlt</c> - Level 3 halted</item>
+ <item><c>el3rst</c> - Level 3 reset</item>
<item><c>elbin</c> - ELBIN</item>
- <item><c>elibacc</c> - cannot access a needed shared library</item>
- <item><c>elibbad</c> - accessing a corrupted shared library</item>
- <item><c>elibexec</c> - cannot exec a shared library directly</item>
- <item><c>elibmax</c> - attempting to link in more shared
- libraries than system limit</item>
- <item><c>elibscn</c> - .lib section in a.out corrupted</item>
- <item><c>elnrng</c> - link number out of range</item>
- <item><c>eloop</c> - too many levels of symbolic links</item>
- <item><c>emfile</c> - too many open files</item>
- <item><c>emlink</c> - too many links</item>
- <item><c>emsgsize</c> - message too long</item>
- <item><c>emultihop</c> - multihop attempted</item>
- <item><c>enametoolong</c> - file name too long</item>
- <item><c>enavail</c> - not available</item>
+ <item><c>elibacc</c> - Cannot access a needed shared library</item>
+ <item><c>elibbad</c> - Accessing a corrupted shared library</item>
+ <item><c>elibexec</c> - Cannot exec a shared library directly</item>
+ <item><c>elibmax</c> - Attempting to link in more shared
+ libraries than system limit</item>
+ <item><c>elibscn</c> - <c>.lib</c> section in <c>a.out</c>
+ corrupted</item>
+ <item><c>elnrng</c> - Link number out of range</item>
+ <item><c>eloop</c> - Too many levels of symbolic links</item>
+ <item><c>emfile</c> - Too many open files</item>
+ <item><c>emlink</c> - Too many links</item>
+ <item><c>emsgsize</c> - Message too long</item>
+ <item><c>emultihop</c> - Multihop attempted</item>
+ <item><c>enametoolong</c> - Filename too long</item>
+ <item><c>enavail</c> - Unavailable</item>
<item><c>enet</c> - ENET</item>
- <item><c>enetdown</c> - network is down</item>
- <item><c>enetreset</c> - network dropped connection on reset</item>
- <item><c>enetunreach</c> - network is unreachable</item>
- <item><c>enfile</c> - file table overflow</item>
- <item><c>enoano</c> - anode table overflow</item>
- <item><c>enobufs</c> - no buffer space available</item>
- <item><c>enocsi</c> - no CSI structure available</item>
- <item><c>enodata</c> - no data available</item>
- <item><c>enodev</c> - no such device</item>
- <item><c>enoent</c> - no such file or directory</item>
- <item><c>enoexec</c> - exec format error</item>
- <item><c>enolck</c> - no locks available</item>
- <item><c>enolink</c> - link has be severed</item>
- <item><c>enomem</c> - not enough memory</item>
- <item><c>enomsg</c> - no message of desired type</item>
- <item><c>enonet</c> - machine is not on the network</item>
- <item><c>enopkg</c> - package not installed</item>
- <item><c>enoprotoopt</c> - bad protocol option</item>
- <item><c>enospc</c> - no space left on device</item>
- <item><c>enosr</c> - out of stream resources or not a stream
- device</item>
- <item><c>enosym</c> - unresolved symbol name</item>
- <item><c>enosys</c> - function not implemented</item>
- <item><c>enotblk</c> - block device required</item>
- <item><c>enotconn</c> - socket is not connected</item>
- <item><c>enotdir</c> - not a directory</item>
- <item><c>enotempty</c> - directory not empty</item>
- <item><c>enotnam</c> - not a named file</item>
- <item><c>enotsock</c> - socket operation on non-socket</item>
- <item><c>enotsup</c> - operation not supported</item>
- <item><c>enotty</c> - inappropriate device for ioctl</item>
- <item><c>enotuniq</c> - name not unique on network</item>
- <item><c>enxio</c> - no such device or address</item>
- <item><c>eopnotsupp</c> - operation not supported on socket</item>
- <item><c>eperm</c> - not owner</item>
- <item><c>epfnosupport</c> - protocol family not supported</item>
- <item><c>epipe</c> - broken pipe</item>
- <item><c>eproclim</c> - too many processes</item>
- <item><c>eprocunavail</c> - bad procedure for program</item>
- <item><c>eprogmismatch</c> - program version wrong</item>
- <item><c>eprogunavail</c> - RPC program not available</item>
- <item><c>eproto</c> - protocol error</item>
- <item><c>eprotonosupport</c> - protocol not supported</item>
- <item><c>eprototype</c> - protocol wrong type for socket</item>
- <item><c>erange</c> - math result unrepresentable</item>
+ <item><c>enetdown</c> - Network is down</item>
+ <item><c>enetreset</c> - Network dropped connection on reset</item>
+ <item><c>enetunreach</c> - Network is unreachable</item>
+ <item><c>enfile</c> - File table overflow</item>
+ <item><c>enoano</c> - Anode table overflow</item>
+ <item><c>enobufs</c> - No buffer space available</item>
+ <item><c>enocsi</c> - No CSI structure available</item>
+ <item><c>enodata</c> - No data available</item>
+ <item><c>enodev</c> - No such device</item>
+ <item><c>enoent</c> - No such file or directory</item>
+ <item><c>enoexec</c> - Exec format error</item>
+ <item><c>enolck</c> - No locks available</item>
+ <item><c>enolink</c> - Link has been severed</item>
+ <item><c>enomem</c> - Not enough memory</item>
+ <item><c>enomsg</c> - No message of desired type</item>
+ <item><c>enonet</c> - Machine is not on the network</item>
+ <item><c>enopkg</c> - Package not installed</item>
+ <item><c>enoprotoopt</c> - Bad protocol option</item>
+ <item><c>enospc</c> - No space left on device</item>
+ <item><c>enosr</c> - Out of stream resources or not a stream device</item>
+ <item><c>enosym</c> - Unresolved symbol name</item>
+ <item><c>enosys</c> - Function not implemented</item>
+ <item><c>enotblk</c> - Block device required</item>
+ <item><c>enotconn</c> - Socket is not connected</item>
+ <item><c>enotdir</c> - Not a directory</item>
+ <item><c>enotempty</c> - Directory not empty</item>
+ <item><c>enotnam</c> - Not a named file</item>
+ <item><c>enotsock</c> - Socket operation on non-socket</item>
+ <item><c>enotsup</c> - Operation not supported</item>
+ <item><c>enotty</c> - Inappropriate device for <c>ioctl</c></item>
+ <item><c>enotuniq</c> - Name not unique on network</item>
+ <item><c>enxio</c> - No such device or address</item>
+ <item><c>eopnotsupp</c> - Operation not supported on socket</item>
+ <item><c>eperm</c> - Not owner</item>
+ <item><c>epfnosupport</c> - Protocol family not supported</item>
+ <item><c>epipe</c> - Broken pipe</item>
+ <item><c>eproclim</c> - Too many processes</item>
+ <item><c>eprocunavail</c> - Bad procedure for program</item>
+ <item><c>eprogmismatch</c> - Wrong program version</item>
+ <item><c>eprogunavail</c> - RPC program unavailable</item>
+ <item><c>eproto</c> - Protocol error</item>
+ <item><c>eprotonosupport</c> - Protocol not supported</item>
+ <item><c>eprototype</c> - Wrong protocol type for socket</item>
+ <item><c>erange</c> - Math result unrepresentable</item>
<item><c>erefused</c> - EREFUSED</item>
- <item><c>eremchg</c> - remote address changed</item>
- <item><c>eremdev</c> - remote device</item>
- <item><c>eremote</c> - pathname hit remote file system</item>
- <item><c>eremoteio</c> - remote i/o error</item>
+ <item><c>eremchg</c> - Remote address changed</item>
+ <item><c>eremdev</c> - Remote device</item>
+ <item><c>eremote</c> - Pathname hit remote filesystem</item>
+ <item><c>eremoteio</c> - Remote I/O error</item>
<item><c>eremoterelease</c> - EREMOTERELEASE</item>
- <item><c>erofs</c> - read-only file system</item>
- <item><c>erpcmismatch</c> - RPC version is wrong</item>
- <item><c>erremote</c> - object is remote</item>
- <item><c>eshutdown</c> - cannot send after socket shutdown</item>
- <item><c>esocktnosupport</c> - socket type not supported</item>
- <item><c>espipe</c> - invalid seek</item>
- <item><c>esrch</c> - no such process</item>
- <item><c>esrmnt</c> - srmount error</item>
- <item><c>estale</c> - stale remote file handle</item>
+ <item><c>erofs</c> - Read-only filesystem</item>
+ <item><c>erpcmismatch</c> - Wrong RPC version</item>
+ <item><c>erremote</c> - Object is remote</item>
+ <item><c>eshutdown</c> - Cannot send after socket shutdown</item>
+ <item><c>esocktnosupport</c> - Socket type not supported</item>
+ <item><c>espipe</c> - Invalid seek</item>
+ <item><c>esrch</c> - No such process</item>
+ <item><c>esrmnt</c> - Srmount error</item>
+ <item><c>estale</c> - Stale remote file handle</item>
<item><c>esuccess</c> - Error 0</item>
- <item><c>etime</c> - timer expired</item>
- <item><c>etimedout</c> - connection timed out</item>
- <item><c>etoomanyrefs</c> - too many references</item>
- <item><c>etxtbsy</c> - text file or pseudo-device busy</item>
- <item><c>euclean</c> - structure needs cleaning</item>
- <item><c>eunatch</c> - protocol driver not attached</item>
- <item><c>eusers</c> - too many users</item>
- <item><c>eversion</c> - version mismatch</item>
- <item><c>ewouldblock</c> - operation would block</item>
- <item><c>exdev</c> - cross-domain link</item>
- <item><c>exfull</c> - message tables full</item>
- <item><c>nxdomain</c> - the hostname or domain name could not be
- found</item>
+ <item><c>etime</c> - Timer expired</item>
+ <item><c>etimedout</c> - Connection timed out</item>
+ <item><c>etoomanyrefs</c> - Too many references</item>
+ <item><c>etxtbsy</c> - Text file or pseudo-device busy</item>
+ <item><c>euclean</c> - Structure needs cleaning</item>
+ <item><c>eunatch</c> - Protocol driver not attached</item>
+ <item><c>eusers</c> - Too many users</item>
+ <item><c>eversion</c> - Version mismatch</item>
+ <item><c>ewouldblock</c> - Operation would block</item>
+ <item><c>exdev</c> - Cross-domain link</item>
+ <item><c>exfull</c> - Message tables full</item>
+ <item><c>nxdomain</c> - Hostname or domain name cannot be found</item>
</list>
</section>
</erlref>
diff --git a/lib/kernel/doc/src/inet_res.xml b/lib/kernel/doc/src/inet_res.xml
index 851a36aba9..4ada4203c0 100644
--- a/lib/kernel/doc/src/inet_res.xml
+++ b/lib/kernel/doc/src/inet_res.xml
@@ -11,7 +11,7 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@@ -19,7 +19,7 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-
+
</legalnotice>
<title>inet_res</title>
@@ -29,52 +29,50 @@
<rev>A</rev>
</header>
<module>inet_res</module>
- <modulesummary>A Rudimentary DNS Client</modulesummary>
+ <modulesummary>A rudimentary DNS client.</modulesummary>
<description>
- <p>Performs DNS name resolving towards recursive name servers</p>
- <p>See also
- <seealso marker="erts:inet_cfg">
- ERTS User's Guide: Inet configuration
- </seealso> for more
- information on how to configure an Erlang runtime system for IP
- communication and how to enable this DNS client by defining
- <c><![CDATA['dns']]></c> as a lookup method. It then acts
- as a backend for the resolving functions in
- <seealso marker="kernel:inet">inet</seealso>.</p>
+ <p>This module performs DNS name resolving to recursive name servers.</p>
+ <p>See also
+ <seealso marker="erts:inet_cfg">ERTS User's Guide: Inet Configuration</seealso>
+ for more information about how to configure an Erlang runtime system
+ for IP communication, and how to enable this DNS client by defining
+ <c><![CDATA['dns']]></c> as a lookup method.
+ The DNS client then acts as a backend for the resolving functions in
+ <seealso marker="kernel:inet"><c>inet</c></seealso>.</p>
<p>This DNS client can resolve DNS records even if it
is not used for normal name resolving in the node.</p>
- <p>This is not a full-fledged resolver. It is just a
- DNS client that relies on asking trusted recursive nameservers.</p>
+ <p>This is not a full-fledged resolver, only a
+ DNS client that relies on asking trusted recursive name servers.</p>
</description>
<section>
<title>Name Resolving</title>
<p>UDP queries are used unless resolver option
<c>usevc</c> is <c>true</c>, which forces TCP queries.
- If the query is to large for UDP, TCP is used instead.
- For regular DNS queries 512 bytes is the size limit.
- When EDNS is enabled (resolver option
- <c>edns</c> is set to the EDNS version i.e <c>0</c>
+ If the query is too large for UDP, TCP is used instead.
+ For regular DNS queries, 512 bytes is the size limit.</p>
+ <p>When EDNS is enabled (resolver option
+ <c>edns</c> is set to the EDNS version (that is, <c>0</c>
instead of <c>false</c>), resolver option
- <c>udp_payload_size</c> sets the limit. If a nameserver
- replies with the TC bit set (truncation), indicating
+ <c>udp_payload_size</c> sets the limit. If a name server
+ replies with the TC bit set (truncation), indicating that
the answer is incomplete, the query is retried
- to that nameserver using TCP. The resolver option
+ to that name server using TCP. Resolver option
<c>udp_payload_size</c> also sets the advertised
- size for the max allowed reply size, if EDNS is
- enabled, otherwise the nameserver uses the limit
- 512 byte. If the reply is larger it gets truncated,
- forcing a TCP re-query.</p>
- <p>For UDP queries, the resolver options <c>timeout</c>
+ size for the maximum allowed reply size, if EDNS is
+ enabled, otherwise the name server uses the limit
+ 512 bytes. If the reply is larger, it gets truncated,
+ forcing a TCP requery.</p>
+ <p>For UDP queries, resolver options <c>timeout</c>
and <c>retry</c> control retransmission.
- Each nameserver in the <c>nameservers</c> list is
- tried with a timeout of <c>timeout</c> / <c>retry</c>.
- Then all nameservers are tried again doubling the
- timeout, for a total of <c>retry</c> times.</p>
- <p>For queries that not use the <c>search</c> list,
+ Each name server in the <c>nameservers</c> list is
+ tried with a time-out of <c>timeout</c>/<c>retry</c>.
+ Then all name servers are tried again, doubling the
+ time-out, for a total of <c>retry</c> times.</p>
+ <p>For queries not using the <c>search</c> list,
if the query to all <c>nameservers</c> results in
- <c>{error,nxdomain}</c>or an empty answer, the same
- query is tried for the <c>alt_nameservers</c>.</p>
+ <c>{error,nxdomain}</c> or an empty answer, the same
+ query is tried for <c>alt_nameservers</c>.</p>
</section>
<section>
@@ -92,11 +90,13 @@
<name name="res_error"/>
</datatype>
</datatypes>
+
<section>
<title>DNS Types</title>
<p><marker id="dns_types"/>
The following data types concern the DNS client:</p>
</section>
+
<datatypes>
<datatype>
<name name="dns_name"/>
@@ -112,10 +112,10 @@
<name name="dns_msg"/>
<desc>
<p>This is the start of a hiearchy of opaque data structures
- that can be examined with access functions in inet_dns that
- return lists of {Field,Value} tuples. The arity 2 functions
- just return the value for a given field.</p>
-<pre>
+ that can be examined with access functions in <c>inet_dns</c>, which
+ return lists of <c>{Field,Value}</c> tuples. The arity 2 functions
+ only return the value for a specified field.</p>
+ <pre>
dns_msg() = DnsMsg
inet_dns:msg(DnsMsg) ->
[ {header, dns_header()}
@@ -163,63 +163,55 @@ dns_rr() = DnsRr
| {z, integer()}
| {data, dns_data()} ]
inet_dns:rr(DnsRr, Field) -> Value</pre>
-
-<p>There is an info function for the types above:</p>
-
-<pre>
+ <p>There is an information function for the types above:</p>
+ <pre>
inet_dns:record_type(dns_msg()) -> msg;
inet_dns:record_type(dns_header()) -> header;
inet_dns:record_type(dns_query()) -> dns_query;
inet_dns:record_type(dns_rr()) -> rr;
inet_dns:record_type(_) -> undefined.</pre>
-
-<p>So; inet_dns:(inet_dns:record_type(X))(X) will convert
-any of these data structures into a {Field,Value} list.</p>
+ <p>So, <c>inet_dns:(inet_dns:record_type(X))(X)</c> converts
+ any of these data structures into a <c>{Field,Value}</c> list.</p>
</desc>
</datatype>
<datatype>
<name name="dns_data"/>
- <desc><p><c><anno>Regexp</anno></c> is a string with characters encoded in the
- UTF-8 coding standard.</p>
+ <desc>
+ <p><c><anno>Regexp</anno></c> is a string with characters encoded
+ in the UTF-8 coding standard.</p>
</desc>
</datatype>
</datatypes>
-
<funcs>
-
<func>
<name name="getbyname" arity="2"/>
<name name="getbyname" arity="3"/>
- <fsummary>Resolve a DNS record of the given type for the given host
- </fsummary>
+ <fsummary>Resolve a DNS record of the specified type for the specified
+ host.</fsummary>
<desc>
- <p>Resolve a DNS record of the given type for the given host,
- of class <c>in</c>. On success returns a <c>hostent()</c> record with
- <c>dns_data()</c> elements in the address list field.
- </p><p>
- This function uses the resolver option <c>search</c> that
+ <p>Resolves a DNS record of the specified type for the specified host,
+ of class <c>in</c>. Returns, on success, a <c>hostent()</c> record
+ with <c>dns_data()</c> elements in the address list field.</p>
+ <p>This function uses resolver option <c>search</c> that
is a list of domain names. If the name to resolve contains
no dots, it is prepended to each domain name in the
search list, and they are tried in order. If the name
contains dots, it is first tried as an absolute name
- and if that fails the search list is used. If the name
- has a trailing dot it is simply supposed to be
- an absolute name and the search list is not used.
- </p>
+ and if that fails, the search list is used. If the name
+ has a trailing dot, it is supposed to be
+ an absolute name and the search list is not used.</p>
</desc>
</func>
<func>
<name name="gethostbyaddr" arity="1"/>
<name name="gethostbyaddr" arity="2"/>
- <fsummary>Return a hostent record for the host with the given address
- </fsummary>
+ <fsummary>Return a hostent record for the host with the specified
+ address.</fsummary>
<desc>
<p>Backend functions used by
- <seealso marker="kernel:inet#gethostbyaddr/1">
- inet:gethostbyaddr/1
- </seealso>.
+ <seealso marker="kernel:inet#gethostbyaddr/1"><c>inet:gethostbyaddr/1</c></seealso>.
</p>
</desc>
</func>
@@ -228,22 +220,19 @@ any of these data structures into a {Field,Value} list.</p>
<name name="gethostbyname" arity="1"/>
<name name="gethostbyname" arity="2"/>
<name name="gethostbyname" arity="3"/>
- <fsummary>Return a hostent record for the host with the given name
+ <fsummary>Return a hostent record for the host with the specified name.
</fsummary>
<desc>
<p>Backend functions used by
- <seealso marker="kernel:inet#gethostbyname/1">
- inet:gethostbyname/1,2
- </seealso>.
- </p><p>
- This function uses the resolver option <c>search</c> just like
- <seealso marker="#getbyname/2">getbyname/2,3</seealso>.
- </p><p>
- If the resolver option <c>inet6</c> is <c>true</c>,
- an IPv6 address is looked up, and if that fails
- the IPv4 address is looked up and returned on
- IPv6 mapped IPv4 format.
+ <seealso marker="kernel:inet#gethostbyname/1"><c>inet:gethostbyname/1,2</c></seealso>.
</p>
+ <p>This function uses resolver option <c>search</c> just like
+ <seealso marker="#getbyname/2"><c>getbyname/2,3</c></seealso>.
+ </p>
+ <p>If resolver option <c>inet6</c> is <c>true</c>,
+ an IPv6 address is looked up. If that fails,
+ the IPv4 address is looked up and returned on
+ IPv6-mapped IPv4 format.</p>
</desc>
</func>
@@ -251,22 +240,21 @@ any of these data structures into a {Field,Value} list.</p>
<name name="lookup" arity="3"/>
<name name="lookup" arity="4"/>
<name name="lookup" arity="5"/>
- <fsummary>Resolve the DNS data for the record of the given type and class
- for the given name
- </fsummary>
+ <fsummary>Resolve the DNS data for the record of the specified type
+ and class for the specified name.</fsummary>
<desc>
- <p>Resolve the DNS data for the record of the given type and class
- for the given name. On success filters out the answer records
- with the correct <c><anno>Class</anno></c> and <c><anno>Type</anno></c> and returns
- a list of their data fields. So a lookup for type <c>any</c>
- will give an empty answer since the answer records have
+ <p>Resolves the DNS data for the record of the specified type and class
+ for the specified name. On success, filters out the answer records
+ with the correct <c><anno>Class</anno></c> and
+ <c><anno>Type</anno></c>, and returns
+ a list of their data fields. So, a lookup for type <c>any</c>
+ gives an empty answer, as the answer records have
specific types that are not <c>any</c>. An empty answer
- as well as a failed lookup returns an empty list.
- </p><p>
- Calls <seealso marker="#resolve/3">resolve/2..4</seealso>
+ or a failed lookup returns an empty list.</p>
+ <p>Calls
+ <seealso marker="#resolve/3"><c>resolve/*</c></seealso>
with the same arguments and filters the result, so
- <c><anno>Opts</anno></c> is explained there.
- </p>
+ <c><anno>Opts</anno></c> is described for those functions.</p>
</desc>
</func>
@@ -274,90 +262,77 @@ any of these data structures into a {Field,Value} list.</p>
<name name="resolve" arity="3"/>
<name name="resolve" arity="4"/>
<name name="resolve" arity="5"/>
- <fsummary>Resolve a DNS record of the given type and class
- for the given name
- </fsummary>
+ <fsummary>Resolve a DNS record of the specified type and class
+ for the specified name.</fsummary>
<desc>
- <p>Resolve a DNS record of the given type and class for the given name.
- The returned <c>dns_msg()</c> can be examined using
- access functions in <c>inet_db</c> as described
- in <seealso marker="#dns_types">DNS Types</seealso>.
- </p><p>
- If <c><anno>Name</anno></c> is an <c>ip_address()</c>, the domain name
- to query for is generated as the standard reverse
- ".IN-ADDR.ARPA." name for an IPv4 address, or the
- ".IP6.ARPA." name for an IPv6 address.
- In this case you most probably want to use
- <c><anno>Class</anno> = in</c> and <c><anno>Type</anno> = ptr</c> but it
- is not done automatically.
- </p><p>
- <c><anno>Opts</anno></c> override the corresponding resolver options.
- If the option <c>nameservers</c> is given, it is
- also assumed that it is the complete list of nameserves,
- so the resolver option <c>alt_nameserves</c> is ignored.
- Of course, if that option is also given to this function,
- it is used.
- </p><p>
- The <c>verbose</c> option (or rather <c>{verbose,true}</c>),
+ <p>Resolves a DNS record of the specified type and class for the
+ specified name. The returned <c>dns_msg()</c> can be examined using
+ access functions in <c>inet_db</c>, as described in section
+ in <seealso marker="#dns_types">DNS Types</seealso>.</p>
+ <p>If <c><anno>Name</anno></c> is an <c>ip_address()</c>, the domain
+ name to query for is generated as the standard reverse
+ <c>".IN-ADDR.ARPA."</c> name for an IPv4 address, or the
+ <c>".IP6.ARPA."</c> name for an IPv6 address.
+ In this case, you most probably want to use
+ <c><anno>Class</anno> = in</c> and <c><anno>Type</anno> = ptr</c>,
+ but it is not done automatically.</p>
+ <p><c><anno>Opts</anno></c> overrides the corresponding resolver
+ options. If option <c>nameservers</c> is specified, it is
+ assumed that it is the complete list of name serves,
+ so resolver option <c>alt_nameserves</c> is ignored.
+ However, if option <c>alt_nameserves</c> is also specified to this
+ function, it is used.</p>
+ <p>Option <c>verbose</c> (or rather <c>{verbose,true}</c>)
causes diagnostics printout through
- <seealso marker="stdlib:io#format/3">io:format/2</seealso>
- of queries, replies retransmissions, etc, similar
- to from utilities like <c>dig</c>, <c>nslookup</c> et.al.
- </p><p>
- If <c><anno>Opt</anno></c> is an arbitrary atom it is interpreted
+ <seealso marker="stdlib:io#format/3"><c>io:format/2</c></seealso>
+ of queries, replies retransmissions, and so on, similar
+ to from utilities, such as <c>dig</c> and <c>nslookup</c>.</p>
+ <p>If <c><anno>Opt</anno></c> is any atom, it is interpreted
as <c>{<anno>Opt</anno>,true}</c> unless the atom string starts with
- <c>"no"</c> making the interpretation <c>{<anno>Opt</anno>,false}</c>.
- For example: <c>usevc</c> is an alias for <c>{usevc,true}</c>,
- and <c>nousevc</c> an alias for <c>{usevc,false}</c>.
- </p><p>
- The <c>inet6</c> option currently has no effect on this function.
- You probably want to use <c><anno>Type</anno> = a | aaaa</c> instead.
- </p>
+ <c>"no"</c>, making the
+ interpretation <c>{<anno>Opt</anno>,false}</c>.
+ For example, <c>usevc</c> is an alias for <c>{usevc,true}</c>
+ and <c>nousevc</c> is an alias for <c>{usevc,false}</c>.</p>
+ <p>Option <c>inet6</c> has no effect on this function. You
+ probably want to use <c><anno>Type</anno> = a | aaaa</c> instead.</p>
</desc>
</func>
-
</funcs>
-
-
<section>
- <title>Examples</title>
- <p>Access functions example: how
- <seealso marker="#lookup/3">lookup/3</seealso>
- could have been implemented using
- <seealso marker="#resolve/3">resolve/3</seealso>
- from outside the module.
- </p><code type="none">
- example_lookup(Name, Class, Type) ->
- case inet_res:resolve(Name, Class, Type) of
- {ok,Msg} ->
- [inet_dns:rr(RR, data)
- || RR &lt;- inet_dns:msg(Msg, anlist),
- inet_dns:rr(RR, type) =:= Type,
- inet_dns:rr(RR, class) =:= Class];
- {error,_} ->
- []
- end.</code>
+ <title>Example</title>
+ <p>This access functions example shows how
+ <seealso marker="#lookup/3"><c>lookup/3</c></seealso>
+ can be implemented using
+ <seealso marker="#resolve/3"><c>resolve/3</c></seealso>
+ from outside the module:</p>
+ <code type="none">
+example_lookup(Name, Class, Type) ->
+ case inet_res:resolve(Name, Class, Type) of
+ {ok,Msg} ->
+ [inet_dns:rr(RR, data)
+ || RR &lt;- inet_dns:msg(Msg, anlist),
+ inet_dns:rr(RR, type) =:= Type,
+ inet_dns:rr(RR, class) =:= Class];
+ {error,_} ->
+ []
+ end.</code>
</section>
-
-
<section>
<title>Legacy Functions</title>
- <p>These have been deprecated due to the annoying double
- meaning of the nameservers/timeout argument, and
- because they had no decent place for a resolver options list.</p>
+ <p>These are deprecated because the annoying double
+ meaning of the name servers/time-out argument, and
+ because they have no decent place for a resolver options list.</p>
</section>
<funcs>
-
<func>
<name name="nslookup" arity="3"/>
<name name="nslookup" arity="4" clause_i="1"/>
<name name="nslookup" arity="4" clause_i="2"/>
- <fsummary>Resolve a DNS record of the given type and class
- for the given name
- </fsummary>
+ <fsummary>Resolve a DNS record of the specified type and class for the
+ specified name.</fsummary>
<type variable="Name"/>
<type variable="Class"/>
<type variable="Type"/>
@@ -365,23 +340,20 @@ any of these data structures into a {Field,Value} list.</p>
<type variable="Nameservers"/>
<type variable="Reason"/>
<desc>
- <p>Resolve a DNS record of the given type and class for the given name.
- </p>
+ <p>Resolves a DNS record of the specified type and class for the
+ specified name.</p>
</desc>
</func>
<func>
<name name="nnslookup" arity="4"/>
<name name="nnslookup" arity="5"/>
- <fsummary>Resolve a DNS record of the given type and class
- for the given name
- </fsummary>
+ <fsummary>Resolve a DNS record of the specified type and class
+ for the specified name.</fsummary>
<desc>
- <p>Resolve a DNS record of the given type and class for the given name.
- </p>
+ <p>Resolves a DNS record of the specified type and class for the
+ specified name.</p>
</desc>
</func>
-
</funcs>
-
</erlref>
diff --git a/lib/kernel/doc/src/init_stub.xml b/lib/kernel/doc/src/init_stub.xml
index eae2cbea95..df89b174ca 100644
--- a/lib/kernel/doc/src/init_stub.xml
+++ b/lib/kernel/doc/src/init_stub.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -31,13 +31,9 @@
<rev>A</rev>
</header>
<module>init</module>
- <modulesummary>Coordination of System Startup</modulesummary>
- <description><p>
-
- The module init is moved to the runtime system
- application. Please see <seealso
- marker="erts:init">init(3)</seealso> in the
- erts reference manual instead.
-
- </p></description>
+ <modulesummary>Coordination of system startup.</modulesummary>
+ <description>
+ <p>This module is moved to the
+ <seealso marker="erts:init"><c>ERTS</c></seealso> application.</p>
+ </description>
</erlref>
diff --git a/lib/kernel/doc/src/kernel_app.xml b/lib/kernel/doc/src/kernel_app.xml
index 956c57f7c1..9e6fb60bb7 100644
--- a/lib/kernel/doc/src/kernel_app.xml
+++ b/lib/kernel/doc/src/kernel_app.xml
@@ -4,7 +4,7 @@
<appref>
<header>
<copyright>
- <year>1996</year><year>2015</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,66 +29,59 @@
<rev></rev>
</header>
<app>kernel</app>
- <appsummary>The Kernel Application</appsummary>
+ <appsummary>The Kernel application.</appsummary>
<description>
- <p>The Kernel application is the first application started. It is
+ <p>The <c>Kernel</c> application has all the code necessary to run
+ the Erlang runtime system: file servers, code servers,
+ and so on.</p>
+ <p>The <c>Kernel</c> application is the first application started. It is
mandatory in the sense that the minimal system based on
- Erlang/OTP consists of Kernel and STDLIB. The Kernel application
- contains the following services:</p>
+ Erlang/OTP consists of <c>Kernel</c> and <c>STDLIB</c>. <c>Kernel</c>
+ contains the following functional areas:</p>
<list type="bulleted">
- <item>application controller, see <seealso marker="application">application(3)</seealso></item>
- <item><c>code</c></item>
- <item><c>disk_log</c></item>
- <item><c>dist_ac</c>, distributed application controller</item>
- <item><c>erl_boot_server</c></item>
- <item><c>erl_ddll</c></item>
- <item><c>error_logger</c></item>
- <item><c>error_logger_format_depth</c></item>
- <item><c>file</c></item>
- <item><c>global</c></item>
- <item><c>global_group</c></item>
- <item><c>heart</c></item>
- <item><c>inet</c></item>
- <item><c>net_kernel</c></item>
- <item><c>os</c></item>
- <item><c>pg2</c></item>
- <item><c>rpc</c></item>
- <item><c>seq_trace</c></item>
- <item><c>user</c></item>
+ <item>Start, stop, supervision, configuration, and distribution of applications</item>
+ <item>Code loading</item>
+ <item>Logging</item>
+ <item>Error logging</item>
+ <item>Global name service</item>
+ <item>Supervision of Erlang/OTP</item>
+ <item>Communication with sockets</item>
+ <item>Operating system interface</item>
</list>
</description>
<section>
<title>Error Logger Event Handlers</title>
<p>Two standard error logger event handlers are defined in
- the Kernel application. These are described in
- <seealso marker="error_logger">error_logger(3)</seealso>.</p>
+ the <c>Kernel</c> application. These are described in
+ <seealso marker="error_logger"><c>error_logger(3)</c></seealso>.</p>
</section>
<section>
<title>Configuration</title>
- <p>The following configuration parameters are defined for the Kernel
- application. See <seealso marker="app">app(4)</seealso> for more
- information about configuration parameters.</p>
+ <p>The following configuration parameters are defined for the <c>Kernel</c>
+ application. For more information about configuration parameters,
+ see file <seealso marker="app"><c>app(4)</c></seealso>.</p>
<taglist>
<tag><c>browser_cmd = string() | {M,F,A}</c></tag>
<item>
- <p>When pressing the Help button in a tool such as Debugger or
- TV, the help text (an HTML file <c>File</c>) is by default
- displayed in a Netscape browser which is required to be up and
- running. This parameter can be used to change the command for
+ <p>When pressing the <em>Help</em> button in a tool such as Debugger,
+ the help text (an HTML file <c>File</c>) is by default
+ displayed in a Netscape browser, which is required to be
+ operational. This parameter can be used to change the command for
how to display the help text if another browser than Netscape
- is preferred, or another platform than Unix or Windows is
+ is preferred, or if another platform than Unix or Windows is
used.</p>
<p>If set to a string <c>Command</c>, the command
- <c>"Command File"</c> will be evaluated using <c>os:cmd/1</c>.</p>
- <p>If set to a module-function-args tuple <c>{M,F,A}</c>,
- the call <c>apply(M,F,[File|A])</c> will be evaluated.</p>
+ <c>"Command File"</c> is evaluated using
+ <seealso marker="os#cmd/1"><c>os:cmd/1</c></seealso>.</p>
+ <p>If set to a module-function-args tuple, <c>{M,F,A}</c>,
+ the call <c>apply(M,F,[File|A])</c> is evaluated.</p>
</item>
<tag><c>distributed = [Distrib]</c></tag>
<item>
- <p>Specifies which applications are distributed and on which
- nodes they may execute. In this parameter:</p>
+ <p>Specifies which applications that are distributed and on which
+ nodes they are allowed to execute. In this parameter:</p>
<list type="bulleted">
<item><c>Distrib = {App,Nodes} | {App,Time,Nodes}</c></item>
<item><c>App = atom()</c></item>
@@ -96,25 +89,24 @@
<item><c>Nodes = [node() | {node(),...,node()}]</c></item>
</list>
<p>The parameter is described in
- <seealso marker="application">application(3)</seealso>, function
- <c>load/2</c>.</p>
+ <seealso marker="application#load/2"><c>application:load/2</c></seealso>.</p>
</item>
<tag><c>dist_auto_connect = Value</c></tag>
<item>
- <p>Specifies when nodes will be automatically connected. If
+ <p>Specifies when nodes are automatically connected. If
this parameter is not specified, a node is always
- automatically connected, e.g when a message is to be sent to
+ automatically connected, for example, when a message is to be sent to
that node. <c>Value</c> is one of:</p>
<taglist>
<tag><c>never</c></tag>
- <item>Connections are never automatically established, they
+ <item><p>Connections are never automatically established, they
must be explicitly connected. See
- <seealso marker="net_kernel">net_kernel(3)</seealso>.</item>
+ <seealso marker="net_kernel"><c>net_kernel(3)</c></seealso>.</p></item>
<tag><c>once</c></tag>
- <item>Connections will be established automatically, but only
+ <item><p>Connections are established automatically, but only
once per node. If a node goes down, it must thereafter be
explicitly connected. See
- <seealso marker="net_kernel">net_kernel(3)</seealso>.</item>
+ <seealso marker="net_kernel"><c>net_kernel(3)</c></seealso>.</p></item>
</taglist>
</item>
<tag><c>permissions = [Perm]</c></tag>
@@ -127,25 +119,24 @@
<item><c>Bool = boolean()</c></item>
</list>
<p>Permissions are described in
- <seealso marker="application">application(3)</seealso>, function
- <c>permit/2</c>.</p>
+ <seealso marker="application#permit/2"><c>application:permit/2</c></seealso>.</p>
</item>
<tag><c>error_logger = Value</c></tag>
<item>
<p><c>Value</c> is one of:</p>
<taglist>
<tag><c>tty</c></tag>
- <item>Installs the standard event handler which prints error
- reports to <c>stdio</c>. This is the default option.</item>
+ <item><p>Installs the standard event handler, which prints error
+ reports to <c>stdio</c>. This is the default option.</p></item>
<tag><c>{file, FileName}</c></tag>
- <item>Installs the standard event handler which prints error
- reports to the file <c>FileName</c>, where <c>FileName</c>
- is a string.</item>
+ <item><p>Installs the standard event handler, which prints error
+ reports to file <c>FileName</c>, where <c>FileName</c>
+ is a string.</p></item>
<tag><c>false</c></tag>
<item>
<p>No standard event handler is installed, but
the initial, primitive event handler is kept, printing
- raw event messages to tty.</p>
+ raw event messages to <c>tty</c>.</p>
</item>
<tag><c>silent</c></tag>
<item>
@@ -156,111 +147,110 @@
<tag><c>error_logger_format_depth = Depth</c></tag>
<item>
<marker id="error_logger_format_depth"></marker>
- <p>This parameter can be used to limit the size of the
+ <p>Can be used to limit the size of the
formatted output from the error logger event handlers.</p>
- <note><p>This configuration parameter was introduced in OTP 18.1.
- It is currently experimental. Based on user feedback it
- may be changed or improved in future releases, for example
+ <note><p>This configuration parameter was introduced in OTP 18.1
+ and is experimental. Based on user feedback, it
+ can be changed or improved in future releases, for example,
to gain better control over how to limit the size of the
- formatted output. We have no plans to entirely remove this
- new feature, unless it turns out to be completely
- useless. In OTP 19, the default may be changed to limit the
- formatted output.</p></note>
+ formatted output. We have no plans to remove this
+ new feature entirely, unless it turns out to be
+ useless.</p></note>
- <p><c>Depth</c> is a positive integer that is the maximum
+ <p><c>Depth</c> is a positive integer representing the maximum
depth to which terms are printed by the error logger event
- handlers included in OTP. Specifically, the two event handlers
+ handlers included in OTP. This
+ configuration parameter is used by the two event handlers
defined by the <c>Kernel</c> application and the two event
- handlers in the <c>SASL</c> application will use this
- configuration parameter. (If you have implemented you own
- error handlers, this configuration parameter will have no
- effect on them.)</p>
+ handlers in the <c>SASL</c> application.
+ (If you have implemented your own error handlers, this configuration
+ parameter has no effect on them.)</p>
- <p>The way <c>Depth</c> is used, is that format strings
- string passed to the event handlers will be rewritten.
- The "~p" and "~w" format controls will be replaced with
- "~P" and "~W", respectively, and <c>Depth</c> will be
- used as the depth parameter. See
- <seealso marker="stdlib:io#format/2">io:format/2</seealso>.</p>
+ <p><c>Depth</c> is used as follows: Format strings
+ passed to the event handlers are rewritten.
+ The format controls <c>~p</c> and <c>~w</c> are replaced with
+ <c>~P</c> and <c>~W</c>, respectively, and <c>Depth</c> is
+ used as the depth parameter. For details, see
+ <seealso marker="stdlib:io#format/2"><c>io:format/2</c></seealso>
+ in <c>STDLIB</c>.</p>
<note><p>A reasonable starting value for <c>Depth</c> is
- <c>30</c>. You should test crashing various processes in your
- application and examine the logs from the crashes, and then
- either increase or decrease the value.</p></note>
+ <c>30</c>. We recommend to test crashing various processes in your
+ application, examine the logs from the crashes, and then
+ increase or decrease the value.</p></note>
</item>
<tag><c>global_groups = [GroupTuple]</c></tag>
<item>
+ <marker id="global_groups"></marker>
<p>Defines global groups, see
- <seealso marker="global_group">global_group(3)</seealso>.</p>
+ <seealso marker="global_group"><c>global_group(3)</c></seealso>.
+ In this parameter:</p>
<list type="bulleted">
- <item><c>GroupTuple = {GroupName, [Node]} | {GroupName, PublishType, [Node]}</c></item>
- <item><c>GroupName = atom()</c></item>
- <item><c>PublishType = normal | hidden</c></item>
- <item><c>Node = node()</c></item>
+ <item><p><c>GroupTuple = {GroupName, [Node]} | {GroupName, PublishType, [Node]}</c></p></item>
+ <item><p><c>GroupName = atom()</c></p></item>
+ <item><p><c>PublishType = normal | hidden</c></p></item>
+ <item><p><c>Node = node()</c></p></item>
</list>
</item>
<tag><c>inet_default_connect_options = [{Opt, Val}]</c></tag>
<item>
<p>Specifies default options for <c>connect</c> sockets,
- see <seealso marker="inet">inet(3)</seealso>.</p>
+ see <seealso marker="inet"><c>inet(3)</c></seealso>.</p>
</item>
<tag><c>inet_default_listen_options = [{Opt, Val}]</c></tag>
<item>
<p>Specifies default options for <c>listen</c> (and
- <c>accept</c>) sockets, see <seealso marker="inet">inet(3)</seealso>.</p>
+ <c>accept</c>) sockets, see <seealso marker="inet"><c>inet(3)</c></seealso>.</p>
</item>
<tag><c>{inet_dist_use_interface, ip_address()}</c></tag>
<item>
- <p>If the host of an Erlang node has several network interfaces,
- this parameter specifies which one to listen on. See
- <seealso marker="inet">inet(3)</seealso> for the type definition
- of <c>ip_address()</c>.</p>
+ <p>If the host of an Erlang node has many network interfaces,
+ this parameter specifies which one to listen on. For the type definition
+ of <c>ip_address()</c>,
+ see <seealso marker="inet"><c>inet(3)</c></seealso>.</p>
</item>
- <tag><c>{inet_dist_listen_min, First}</c></tag>
+ <tag><c>{inet_dist_listen_min, First}</c> and <c>{inet_dist_listen_max, Last}</c></tag>
<item>
- <p>See below.</p>
- </item>
- <tag><c>{inet_dist_listen_max, Last}</c></tag>
- <item>
- <p>Define the <c>First..Last</c> port range for the listener
+ <p>Defines the <c>First..Last</c> port range for the listener
socket of a distributed Erlang node.</p>
</item>
<tag><c>{inet_dist_listen_options, Opts}</c></tag>
<item>
- <p>Define a list of extra socket options to be used when opening the
+ <p>Defines a list of extra socket options to be used when opening the
listening socket for a distributed Erlang node.
- See <seealso marker="gen_tcp#listen/2">gen_tcp:listen/2</seealso></p>
+ See <seealso marker="gen_tcp#listen/2"><c>gen_tcp:listen/2</c></seealso>.</p>
</item>
<tag><c>{inet_dist_connect_options, Opts}</c></tag>
<item>
- <p>Define a list of extra socket options to be used when connecting to
+ <p>Defines a list of extra socket options to be used when connecting to
other distributed Erlang nodes.
- See <seealso marker="gen_tcp#connect/4">gen_tcp:connect/4</seealso></p>
+ See <seealso marker="gen_tcp#connect/4"><c>gen_tcp:connect/4</c></seealso>.</p>
</item>
<tag><c>inet_parse_error_log = silent</c></tag>
<item>
- <p>If this configuration parameter is set, no
+ <p>If set, no
<c>error_logger</c> messages are generated when erroneous
lines are found and skipped in the various Inet configuration
files.</p>
</item>
<tag><c>inetrc = Filename</c></tag>
<item>
- <p>The name (string) of an Inet user configuration file. See
- ERTS User's Guide, Inet configuration.</p>
+ <p>The name (string) of an Inet user configuration file. For details,
+ see section
+ <seealso marker="erts:inet_cfg"><c>Inet Configuration</c></seealso>
+ in the <c>ERTS</c> User's Guide.</p>
</item>
<tag><c>net_setuptime = SetupTime</c></tag>
<item>
<marker id="net_setuptime"></marker>
<p><c>SetupTime</c> must be a positive integer or floating point
- number, and will be interpreted as the maximally allowed time
+ number, and is interpreted as the maximum allowed time
for each network operation during connection setup to another
- Erlang node. The maximum allowed value is 120; if higher values
- are given, 120 will be used. The default value if the variable
- is not given, or if the value is incorrect (e.g. not a number),
- is 7 seconds.</p>
- <p>Note that this value does not limit the total connection
+ Erlang node. The maximum allowed value is <c>120</c>. If higher values
+ are specified, <c>120</c> is used. Default is 7 seconds if the variable
+ is not specified, or if the value is incorrect (for example, not a number).</p>
+ <p>Notice that this value does not limit the total connection
setup time, but rather each individual network operation during
the connection setup and handshake.</p>
</item>
@@ -268,45 +258,44 @@
<item>
<marker id="net_ticktime"></marker>
<p>Specifies the <c>net_kernel</c> tick time. <c>TickTime</c>
- is given in seconds. Once every <c>TickTime/4</c> second, all
- connected nodes are ticked (if anything else has been written
- to a node) and if nothing has been received from another node
- within the last four (4) tick times that node is considered
- to be down. This ensures that nodes which are not responding,
+ is specified in seconds. Once every <c>TickTime/4</c> second, all
+ connected nodes are ticked (if anything else is written
+ to a node). If nothing is received from another node
+ within the last four tick times, that node is considered
+ to be down. This ensures that nodes that are not responding,
for reasons such as hardware errors, are considered to be
down.</p>
<p>The time <c>T</c>, in which a node that is not responding is
- detected, is calculated as: <c><![CDATA[MinT < T < MaxT]]></c> where:</p>
+ detected, is calculated as <c><![CDATA[MinT < T < MaxT]]></c>, where:</p>
<code type="none">
MinT = TickTime - TickTime / 4
MaxT = TickTime + TickTime / 4</code>
- <p><c>TickTime</c> is by default 60 (seconds). Thus,
+ <p><c>TickTime</c> defaults to <c>60</c> (seconds). Thus,
<c><![CDATA[45 < T < 75]]></c> seconds.</p>
- <p><em>Note:</em> All communicating nodes should have the same
+ <p>Notice that <em>all</em> communicating nodes are to have the <em>same</em>
<c>TickTime</c> value specified.</p>
- <p><em>Note:</em> Normally, a terminating node is detected
- immediately.</p>
+ <p>Normally, a terminating node is detected immediately.</p>
</item>
<tag><c>shutdown_timeout = integer() | infinity</c></tag>
<item>
- <p>Specifies the time <c>application_controller</c> will wait
+ <p>Specifies the time <c>application_controller</c> waits
for an application to terminate during node shutdown. If the
- timer expires, <c>application_controller</c> will brutally
- kill <c>application_master</c> of the hanging
+ timer expires, <c>application_controller</c> brutally
+ kills <c>application_master</c> of the hanging
application. If this parameter is undefined, it defaults
to <c>infinity</c>.</p>
</item>
<tag><c>sync_nodes_mandatory = [NodeName]</c></tag>
<item>
- <p>Specifies which other nodes <em>must</em> be alive in order
+ <p>Specifies which other nodes that <em>must</em> be alive
for this node to start properly. If some node in the list
- does not start within the specified time, this node will not
+ does not start within the specified time, this node does not
start either. If this parameter is undefined, it defaults to
- [].</p>
+ <c>[]</c>.</p>
</item>
<tag><c>sync_nodes_optional = [NodeName]</c></tag>
<item>
- <p>Specifies which other nodes <em>can</em> be alive in order
+ <p>Specifies which other nodes that <em>can</em> be alive
for this node to start properly. If some node in this list
does not start within the specified time, this node starts
anyway. If this parameter is undefined, it defaults to
@@ -314,66 +303,65 @@ MaxT = TickTime + TickTime / 4</code>
</item>
<tag><c>sync_nodes_timeout = integer() | infinity</c></tag>
<item>
- <p>Specifies the amount of time (in milliseconds) this node
- will wait for the mandatory and optional nodes to start. If
+ <p>Specifies the time (in milliseconds) that this node
+ waits for the mandatory and optional nodes to start. If
this parameter is undefined, no node synchronization is
- performed. This option also makes sure that <c>global</c> is
+ performed. This option ensures that <c>global</c> is
synchronized.</p>
</item>
<tag><c>start_dist_ac = true | false</c></tag>
<item>
<p>Starts the <c>dist_ac</c> server if the parameter is
- <c>true</c>. This parameter should be set to <c>true</c> for
- systems that use distributed applications.</p>
- <p>The default value is <c>false</c>. If this parameter is
- undefined, the server is started if the parameter
+ <c>true</c>. This parameter is to be set to <c>true</c> for
+ systems using distributed applications.</p>
+ <p>Defaults to <c>false</c>. If this parameter is
+ undefined, the server is started if parameter
<c>distributed</c> is set.</p>
</item>
<tag><c>start_boot_server = true | false</c></tag>
<item>
<p>Starts the <c>boot_server</c> if the parameter is <c>true</c>
- (see <seealso marker="erl_boot_server">erl_boot_server(3)</seealso>).
- This parameter should be
- set to <c>true</c> in an embedded system which uses this
- service.</p>
- <p>The default value is <c>false</c>.</p>
+ (see <seealso marker="erl_boot_server"><c>erl_boot_server(3)</c></seealso>).
+ This parameter is to be set to <c>true</c> in an embedded system
+ using this service.</p>
+ <p>Defaults to <c>false</c>.</p>
</item>
<tag><c>boot_server_slaves = [SlaveIP]</c></tag>
<item>
- <p>If the <c>start_boot_server</c> configuration parameter is
+ <p>If configuration parameter <c>start_boot_server</c> is
<c>true</c>, this parameter can be used to initialize
- <c>boot_server</c> with a list of slave IP addresses.
- <c>SlaveIP = string() | atom | {integer(),integer(),integer(),integer()}</c></p>
+ <c>boot_server</c> with a list of slave IP addresses:</p>
+ <p>
+ <c>SlaveIP = string() | atom | {integer(),integer(),integer(),integer()}</c>,</p>
<p>where <c><![CDATA[0 <= integer() <=255]]></c>.</p>
- <p>Examples of <c>SlaveIP</c> in atom, string and tuple form
- are: <br></br>
-<c>'150.236.16.70', "150,236,16,70", {150,236,16,70}</c>.</p>
- <p>The default value is <c>[]</c>.</p>
+ <p>Examples of <c>SlaveIP</c> in atom, string, and tuple form:</p>
+ <p><c>'150.236.16.70', "150,236,16,70", {150,236,16,70}</c>.</p>
+ <p>Defaults to <c>[]</c>.</p>
</item>
<tag><c>start_disk_log = true | false</c></tag>
<item>
<p>Starts the <c>disk_log_server</c> if the parameter is
- <c>true</c> (see <seealso marker="disk_log">disk_log(3)</seealso>).
- This parameter should be
- set to true in an embedded system which uses this service.</p>
- <p>The default value is <c>false</c>.</p>
+ <c>true</c> (see <seealso marker="disk_log"><c>disk_log(3)</c></seealso>).
+ This parameter is to be set to <c>true</c> in an embedded system
+ using this service.</p>
+ <p>Defaults to <c>false</c>.</p>
</item>
<tag><c>start_pg2 = true | false</c></tag>
<item>
+ <marker id="start_pg2"></marker>
<p>Starts the <c>pg2</c> server (see
- <seealso marker="pg2">pg2(3)</seealso>) if
- the parameter is <c>true</c>. This parameter should be set to
- <c>true</c> in an embedded system which uses this service.</p>
- <p>The default value is <c>false</c>.</p>
+ <seealso marker="pg2"><c>pg2(3)</c></seealso>) if
+ the parameter is <c>true</c>. This parameter is to be set to
+ <c>true</c> in an embedded system that uses this service.</p>
+ <p>Defaults to <c>false</c>.</p>
</item>
<tag><c>start_timer = true | false</c></tag>
<item>
<p>Starts the <c>timer_server</c> if the parameter is
- <c>true</c> (see <seealso marker="stdlib:timer">timer(3)</seealso>).
- This parameter should be
- set to <c>true</c> in an embedded system which uses this
- service.</p>
- <p>The default value is <c>false</c>.</p>
+ <c>true</c> (see <seealso marker="stdlib:timer"><c>stdlib:timer(3)</c></seealso>).
+ This parameter is to be set to <c>true</c> in an embedded system
+ using this service.</p>
+ <p>Defaults to <c>false</c>.</p>
</item>
<tag><c>shutdown_func = {Mod, Func}</c></tag>
<item>
@@ -383,7 +371,7 @@ MaxT = TickTime + TickTime / 4</code>
<item><c>Func = atom()</c></item>
</list>
<p>Sets a function that <c>application_controller</c> calls
- when it starts to terminate. The function is called as:
+ when it starts to terminate. The function is called as
<c>Mod:Func(Reason)</c>, where <c>Reason</c> is the terminate
reason for <c>application_controller</c>, and it must
return as soon as possible for <c>application_controller</c>
@@ -394,25 +382,25 @@ MaxT = TickTime + TickTime / 4</code>
<section>
<title>See Also</title>
- <p><seealso marker="app">app(4)</seealso>,
- <seealso marker="application">application(3)</seealso>,
- <seealso marker="code">code(3)</seealso>,
- <seealso marker="disk_log">disk_log(3)</seealso>,
- <seealso marker="erl_boot_server">erl_boot_server(3)</seealso>,
- <seealso marker="erl_ddll">erl_ddll(3)</seealso>,
- <seealso marker="error_logger">error_logger(3)</seealso>,
- <seealso marker="file">file(3)</seealso>,
- <seealso marker="global">global(3)</seealso>,
- <seealso marker="global_group">global_group(3)</seealso>,
- <seealso marker="heart">heart(3)</seealso>,
- <seealso marker="inet">inet(3)</seealso>,
- <seealso marker="net_kernel">net_kernel(3)</seealso>,
- <seealso marker="os">os(3)</seealso>,
- <seealso marker="pg2">pg2(3)</seealso>,
- <seealso marker="rpc">rpc(3)</seealso>,
- <seealso marker="seq_trace">seq_trace(3)</seealso>,
- <seealso marker="stdlib:timer">timer(3)</seealso>,
- <seealso marker="user">user(3)</seealso></p>
+ <p><seealso marker="app"><c>app(4)</c></seealso>,
+ <seealso marker="application"><c>application(3)</c></seealso>,
+ <seealso marker="code"><c>code(3)</c></seealso>,
+ <seealso marker="disk_log"><c>disk_log(3)</c></seealso>,
+ <seealso marker="erl_boot_server"><c>erl_boot_server(3)</c></seealso>,
+ <seealso marker="erl_ddll"><c>erl_ddll(3)</c></seealso>,
+ <seealso marker="error_logger"><c>error_logger(3)</c></seealso>,
+ <seealso marker="file"><c>file(3)</c></seealso>,
+ <seealso marker="global"><c>global(3)</c></seealso>,
+ <seealso marker="global_group"><c>global_group(3)</c></seealso>,
+ <seealso marker="heart"><c>heart(3)</c></seealso>,
+ <seealso marker="inet"><c>inet(3)</c></seealso>,
+ <seealso marker="net_kernel"><c>net_kernel(3)</c></seealso>,
+ <seealso marker="os"><c>os(3)</c></seealso>,
+ <seealso marker="pg2"><c>pg2(3)</c></seealso>,
+ <seealso marker="rpc"><c>rpc(3)</c></seealso>,
+ <seealso marker="seq_trace"><c>seq_trace(3)</c></seealso>,
+ <seealso marker="user"><c>user(3)</c></seealso>,
+ <seealso marker="stdlib:timer"><c>timer(3)</c></seealso></p>
</section>
</appref>
diff --git a/lib/kernel/doc/src/net_adm.xml b/lib/kernel/doc/src/net_adm.xml
index 4ef9d361f6..6957a3b5e4 100644
--- a/lib/kernel/doc/src/net_adm.xml
+++ b/lib/kernel/doc/src/net_adm.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -25,95 +25,105 @@
<title>net_adm</title>
<prepared>Claes Wikstrom</prepared>
<docno>1</docno>
- <date>96-09-10</date>
+ <date>1996-09-10</date>
<rev>A</rev>
</header>
<module>net_adm</module>
- <modulesummary>Various Erlang Net Administration Routines</modulesummary>
+ <modulesummary>Various Erlang net administration routines.</modulesummary>
<description>
<p>This module contains various network utility functions.</p>
</description>
+
<funcs>
<func>
<name name="dns_hostname" arity="1"/>
- <fsummary>Official name of a host</fsummary>
+ <fsummary>Official name of a host.</fsummary>
<desc>
<p>Returns the official name of <c><anno>Host</anno></c>, or
<c>{error, <anno>Host</anno>}</c> if no such name is found. See also
- <c>inet(3)</c>.</p>
+ <seealso marker="inet"><c>inet(3)</c></seealso>.</p>
</desc>
</func>
+
<func>
<name name="host_file" arity="0"/>
- <fsummary>Read the <c>.hosts.erlang</c>file</fsummary>
+ <fsummary>Read file <c>.hosts.erlang</c>.</fsummary>
<desc>
- <p>Reads the <c>.hosts.erlang</c> file, see the section
- <em>Files</em> below. Returns the hosts in this file as a
- list, or returns <c>{error, <anno>Reason</anno>}</c> if the file could not
- be read or the Erlang terms on the file could not be interpreted.</p>
+ <p>Reads file <c>.hosts.erlang</c>, see section
+ <seealso marker="#files">Files</seealso>. Returns the hosts in this
+ file as a list. Returns <c>{error, <anno>Reason</anno>}</c> if the
+ file cannot be read or the Erlang terms on the file cannot be
+ interpreted.</p>
</desc>
</func>
+
<func>
<name name="localhost" arity="0"/>
- <fsummary>Name of the local host</fsummary>
+ <fsummary>Name of the local host.</fsummary>
<desc>
<p>Returns the name of the local host. If Erlang was started
- with the <c>-name</c> command line flag, <c><anno>Name</anno></c> is
+ with command-line flag <c>-name</c>, <c><anno>Name</anno></c> is
the fully qualified name.</p>
</desc>
</func>
+
<func>
<name name="names" arity="0"/>
<name name="names" arity="1"/>
- <fsummary>Names of Erlang nodes at a host</fsummary>
+ <fsummary>Names of Erlang nodes at a host.</fsummary>
<desc>
- <p>Similar to <c>epmd -names</c>, see <c>epmd(1)</c>.
- <c><anno>Host</anno></c> defaults to the local host. Returns the names and
- associated port numbers of the Erlang nodes that <c>epmd</c>
- at the specified host has registered.</p>
- <p>Returns <c>{error, address}</c> if <c>epmd</c> is not
- running.</p>
+ <p>Similar to <c>epmd -names</c>, see
+ <seealso marker="erts:epmd"><c>erts:epmd(1)</c></seealso>.
+ <c><anno>Host</anno></c> defaults to the local host. Returns the
+ names and associated port numbers of the Erlang nodes that
+ <c>epmd</c> registered at the specified host. Returns
+ <c>{error, address}</c> if <c>epmd</c> is not operational.</p>
+ <p><em>Example:</em></p>
<pre>
(arne@dunn)1> <input>net_adm:names().</input>
{ok,[{"arne",40262}]}</pre>
</desc>
</func>
+
<func>
<name name="ping" arity="1"/>
- <fsummary>Set up a connection to a node</fsummary>
+ <fsummary>Set up a connection to a node.</fsummary>
<desc>
- <p>Tries to set up a connection to <c><anno>Node</anno></c>. Returns
- <c>pang</c> if it fails, or <c>pong</c> if it is successful.</p>
+ <p>Sets up a connection to <c><anno>Node</anno></c>. Returns
+ <c>pong</c> if it is successful, otherwise <c>pang</c>.</p>
</desc>
</func>
+
<func>
<name name="world" arity="0"/>
<name name="world" arity="1"/>
- <fsummary>Lookup and connect to all nodes at all hosts in <c>.hosts.erlang</c></fsummary>
+ <fsummary>Lookup and connect to all nodes at all hosts in
+ <c>.hosts.erlang</c>.</fsummary>
<type name="verbosity"/>
<desc>
- <p>This function calls <c>names(Host)</c> for all hosts which
+ <p>Calls <c>names(Host)</c> for all hosts that
are specified in the Erlang host file <c>.hosts.erlang</c>,
- collects the replies and then evaluates <c>ping(Node)</c> on
- all those nodes. Returns the list of all nodes that were,
- successfully pinged.</p>
+ collects the replies, and then evaluates <c>ping(Node)</c> on
+ all those nodes. Returns the list of all nodes that are
+ successfully pinged.</p>
<p><c><anno>Arg</anno></c> defaults to <c>silent</c>.
- If <c><anno>Arg</anno> == verbose</c>, the function writes information about which
- nodes it is pinging to stdout.</p>
+ If <c><anno>Arg</anno> == verbose</c>, the function writes
+ information about which nodes it is pinging to <c>stdout</c>.</p>
<p>This function can be useful when a node is started, and
- the names of the other nodes in the network are not initially
- known.</p>
- <p>Failure: <c>{error, Reason}</c> if <c>host_file()</c>
+ the names of the other network nodes are not initially known.</p>
+ <p>Returns <c>{error, Reason}</c> if <c>host_file()</c>
returns <c>{error, Reason}</c>.</p>
</desc>
</func>
+
<func>
<name name="world_list" arity="1"/>
<name name="world_list" arity="2"/>
- <fsummary>Lookup and connect to all nodes at specified hosts</fsummary>
+ <fsummary>Lookup and connect to all nodes at specified hosts.</fsummary>
<type name="verbosity"/>
<desc>
- <p>As <c>world/0,1</c>, but the hosts are given as argument
+ <p>Same as <seealso marker="#world/1"><c>world/0,1</c></seealso>,
+ but the hosts are specified as argument
instead of being read from <c>.hosts.erlang</c>.</p>
</desc>
</func>
@@ -121,13 +131,14 @@
<section>
<title>Files</title>
- <p>The <c>.hosts.erlang</c> file consists of a number of host names
+ <marker id="files"/>
+ <p>File <c>.hosts.erlang</c> consists of a number of host names
written as Erlang terms. It is looked for in the current work
directory, the user's home directory, and <c>$OTP_ROOT</c>
(the root directory of Erlang/OTP), in that order.</p>
- <p>The format of the <c>.hosts.erlang</c> file must be one host
- name per line. The host names must be within quotes as shown in
- the following example:</p>
+ <p>The format of file <c>.hosts.erlang</c> must be one host
+ name per line. The host names must be within quotes.</p>
+ <p><em>Example:</em></p>
<pre>
'super.eua.ericsson.se'.
'renat.eua.ericsson.se'.
diff --git a/lib/kernel/doc/src/net_kernel.xml b/lib/kernel/doc/src/net_kernel.xml
index 311e0d8ea4..f48a534d4f 100644
--- a/lib/kernel/doc/src/net_kernel.xml
+++ b/lib/kernel/doc/src/net_kernel.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -25,41 +25,47 @@
<title>net_kernel</title>
<prepared>Claes Wikstrom</prepared>
<docno>1</docno>
- <date>96-09-10</date>
+ <date>1996-09-10</date>
<rev>A</rev>
</header>
<module>net_kernel</module>
- <modulesummary>Erlang Networking Kernel</modulesummary>
+ <modulesummary>Erlang networking kernel.</modulesummary>
<description>
<p>The net kernel is a system process, registered as
- <c>net_kernel</c>, which must be running for distributed Erlang
+ <c>net_kernel</c>, which must be operational for distributed Erlang
to work. The purpose of this process is to implement parts of
the BIFs <c>spawn/4</c> and <c>spawn_link/4</c>, and to provide
monitoring of the network.</p>
- <p>An Erlang node is started using the command line flag
+ <p>An Erlang node is started using command-line flag
<c>-name</c> or <c>-sname</c>:</p>
-<pre>$ <input>erl -sname foobar</input></pre>
+ <pre>
+$ <input>erl -sname foobar</input></pre>
<p>It is also possible to call <c>net_kernel:start([foobar])</c>
directly from the normal Erlang shell prompt:</p>
-<pre>1> <input>net_kernel:start([foobar, shortnames]).</input>
+ <pre>
+1> <input>net_kernel:start([foobar, shortnames]).</input>
{ok,&lt;0.64.0>}
(foobar@gringotts)2></pre>
- <p>If the node is started with the command line flag <c>-sname</c>,
- the node name will be <c>foobar@Host</c>, where <c>Host</c> is
+ <p>If the node is started with command-line flag <c>-sname</c>,
+ the node name is <c>foobar@Host</c>, where <c>Host</c> is
the short name of the host (not the fully qualified domain name).
- If started with the <c>-name</c> flag, <c>Host</c> is the fully
- qualified domain name. See <c>erl(1)</c>.</p>
+ If started with flag <c>-name</c>, the node name is <c>foobar@Host</c>,
+ where <c>Host</c> is the fully qualified domain name.
+ For more information, see
+ <seealso marker="erts:erl"><c>erl</c></seealso>.</p>
<p>Normally, connections are established automatically when
another node is referenced. This functionality can be disabled
- by setting the Kernel configuration parameter
+ by setting <c>Kernel</c> configuration parameter
<c>dist_auto_connect</c> to <c>false</c>, see
- <seealso marker="kernel_app">kernel(6)</seealso>. In this case,
+ <seealso marker="kernel_app"><c>kernel(6)</c></seealso>. In this case,
connections must be established explicitly by calling
- <c>net_kernel:connect_node/1</c>.</p>
- <p>Which nodes are allowed to communicate with each other is handled
- by the magic cookie system, see
- <seealso marker="doc/reference_manual:distributed">Distributed Erlang</seealso> in the Erlang Reference Manual.</p>
+ <seealso marker="#connect_node/1"><c>connect_node/1</c></seealso>.</p>
+ <p>Which nodes that are allowed to communicate with each other is handled
+ by the magic cookie system, see section
+ <seealso marker="doc/reference_manual:distributed">Distributed Erlang</seealso>
+ in the Erlang Reference Manual.</p>
</description>
+
<funcs>
<func>
<name name="allow" arity="1"/>
@@ -77,237 +83,240 @@
an atom.</p>
</desc>
</func>
+
<func>
<name name="connect_node" arity="1"/>
- <fsummary>Establish a connection to a node</fsummary>
+ <fsummary>Establish a connection to a node.</fsummary>
<desc>
- <p>Establishes a connection to <c><anno>Node</anno></c>. Returns <c>true</c>
- if successful, <c>false</c> if not, and <c>ignored</c> if
- the local node is not alive.</p>
+ <p>Establishes a connection to <c><anno>Node</anno></c>. Returns
+ <c>true</c> if successful, <c>false</c> if not, and <c>ignored</c>
+ if the local node is not alive.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="get_net_ticktime" arity="0"/>
+ <fsummary>Get <c>net_ticktime</c>.</fsummary>
+ <desc>
+ <p>Gets <c>net_ticktime</c> (see
+ <seealso marker="kernel_app"><c>kernel(6)</c></seealso>).</p>
+ <p>Defined return values (<c><anno>Res</anno></c>):</p>
+ <taglist>
+ <tag><c><anno>NetTicktime</anno></c></tag>
+ <item><p><c>net_ticktime</c> is <c><anno>NetTicktime</anno></c>
+ seconds.</p></item>
+ <tag><c>{ongoing_change_to, <anno>NetTicktime</anno>}</c></tag>
+ <item><p><c>net_kernel</c> is currently changing
+ <c>net_ticktime</c> to <c><anno>NetTicktime</anno></c>
+ seconds.</p></item>
+ <tag><c>ignored</c></tag>
+ <item><p>The local node is not alive.</p></item>
+ </taglist>
</desc>
</func>
+
<func>
<name name="monitor_nodes" arity="1"/>
<name name="monitor_nodes" arity="2"/>
- <fsummary>Subscribe to node status change messages</fsummary>
+ <fsummary>Subscribe to node status change messages.</fsummary>
<desc>
<p>The calling process subscribes or unsubscribes to node
status change messages. A <c>nodeup</c> message is delivered
- to all subscribing process when a new node is connected, and
+ to all subscribing processes when a new node is connected, and
a <c>nodedown</c> message is delivered when a node is
disconnected.</p>
- <p>If <c><anno>Flag</anno></c> is <c>true</c>, a new subscription is started.
- If <c><anno>Flag</anno></c> is <c>false</c>, all previous subscriptions --
- started with the same <c><anno>Options</anno></c> -- are stopped. Two
+ <p>If <c><anno>Flag</anno></c> is <c>true</c>, a new subscription is
+ started. If <c><anno>Flag</anno></c> is <c>false</c>, all previous
+ subscriptions started with the same <c><anno>Options</anno></c>
+ are stopped. Two
option lists are considered the same if they contain the same
set of options.</p>
- <p>As of <c>kernel</c> version 2.11.4, and <c>erts</c> version
+ <p>As from <c>Kernel</c> version 2.11.4, and <c>ERTS</c> version
5.5.4, the following is guaranteed:</p>
<list type="bulleted">
- <item><c>nodeup</c> messages will be delivered before delivery
- of any message from the remote node passed through the
- newly established connection.</item>
- <item><c>nodedown</c> messages will not be delivered until all
- messages from the remote node that have been passed
- through the connection have been delivered.</item>
+ <item><p><c>nodeup</c> messages are delivered before delivery
+ of any message from the remote node passed through the
+ newly established connection.</p></item>
+ <item><p><c>nodedown</c> messages are not delivered until all
+ messages from the remote node that have been passed
+ through the connection have been delivered.</p></item>
</list>
- <p>Note, that this is <em>not</em> guaranteed for <c>kernel</c>
+ <p>Notice that this is <em>not</em> guaranteed for <c>Kernel</c>
versions before 2.11.4.</p>
- <p>As of <c>kernel</c> version 2.11.4 subscriptions can also be
- made before the <c>net_kernel</c> server has been started,
- i.e., <c>net_kernel:monitor_nodes/[1,2]</c> does not return
+ <p>As from <c>Kernel</c> version 2.11.4, subscriptions can also be
+ made before the <c>net_kernel</c> server is started, that is,
+ <c>net_kernel:monitor_nodes/[1,2]</c> does not return
<c>ignored</c>.</p>
- <p>As of <c>kernel</c> version 2.13, and <c>erts</c> version
+ <p>As from <c>Kernel</c> version 2.13, and <c>ERTS</c> version
5.7, the following is guaranteed:</p>
<list type="bulleted">
- <item><c>nodeup</c> messages will be delivered after the
- corresponding node appears in results from
- <c>erlang:nodes/X</c>.</item>
- <item><c>nodedown</c> messages will be delivered after the
- corresponding node has disappeared in results from
- <c>erlang:nodes/X</c>.</item>
+ <item><p><c>nodeup</c> messages are delivered after the
+ corresponding node appears in results from
+ <c>erlang:nodes/X</c>.</p></item>
+ <item><p><c>nodedown</c> messages are delivered after the
+ corresponding node has disappeared in results from
+ <c>erlang:nodes/X</c>.</p></item>
</list>
- <p>Note, that this is <em>not</em> guaranteed for <c>kernel</c>
+ <p>Notice that this is <em>not</em> guaranteed for <c>Kernel</c>
versions before 2.13.</p>
<p>The format of the node status change messages depends on
- <c><anno>Options</anno></c>. If <c><anno>Options</anno></c> is [], which is the default,
- the format is:</p>
+ <c><anno>Options</anno></c>. If <c><anno>Options</anno></c> is
+ <c>[]</c>, which is the default, the format is as follows:</p>
<code type="none">
{nodeup, Node} | {nodedown, Node}
Node = node()</code>
- <p>If <c><anno>Options</anno> /= []</c>, the format is:</p>
+ <p>If <c><anno>Options</anno></c> is not <c>[]</c>, the format is
+ as follows:</p>
<code type="none">
{nodeup, Node, InfoList} | {nodedown, Node, InfoList}
Node = node()
InfoList = [{Tag, Val}]</code>
<p><c>InfoList</c> is a list of tuples. Its contents depends on
<c><anno>Options</anno></c>, see below.</p>
- <p>Also, when <c>OptionList == []</c> only visible nodes, that
+ <p>Also, when <c>OptionList == []</c>, only visible nodes, that
is, nodes that appear in the result of
- <seealso marker="erts:erlang#nodes/0">nodes/0</seealso>, are
- monitored.</p>
+ <seealso marker="erts:erlang#nodes/0"><c>erlang:nodes/0</c></seealso>,
+ are monitored.</p>
<p><c><anno>Option</anno></c> can be any of the following:</p>
<taglist>
<tag><c>{node_type, NodeType}</c></tag>
<item>
- <p>Currently valid values for <c>NodeType</c> are:</p>
+ <p>Valid values for <c>NodeType</c>:</p>
<taglist>
<tag><c>visible</c></tag>
- <item>Subscribe to node status change messages for visible
+ <item><p>Subscribe to node status change messages for visible
nodes only. The tuple <c>{node_type, visible}</c> is
- included in <c>InfoList</c>.</item>
+ included in <c>InfoList</c>.</p></item>
<tag><c>hidden</c></tag>
- <item>Subscribe to node status change messages for hidden
+ <item><p>Subscribe to node status change messages for hidden
nodes only. The tuple <c>{node_type, hidden}</c> is
- included in <c>InfoList</c>.</item>
+ included in <c>InfoList</c>.</p></item>
<tag><c>all</c></tag>
- <item>Subscribe to node status change messages for both
+ <item><p>Subscribe to node status change messages for both
visible and hidden nodes. The tuple
- <c>{node_type, visible | hidden}</c> is included in
- <c>InfoList</c>.</item>
+ <c>{node_type, visible | hidden}</c> is included in
+ <c>InfoList</c>.</p></item>
</taglist>
</item>
<tag><c>nodedown_reason</c></tag>
<item>
<p>The tuple <c>{nodedown_reason, Reason}</c> is included in
- <c>InfoList</c> in <c>nodedown</c> messages. <c>Reason</c>
- can be:</p>
+ <c>InfoList</c> in <c>nodedown</c> messages.</p>
+ <p><c>Reason</c> can be any of the following:</p>
<taglist>
<tag><c>connection_setup_failed</c></tag>
- <item>The connection setup failed (after <c>nodeup</c>
- messages had been sent).</item>
+ <item><p>The connection setup failed (after <c>nodeup</c>
+ messages were sent).</p></item>
<tag><c>no_network</c></tag>
- <item>No network available.</item>
+ <item><p>No network is available.</p></item>
<tag><c>net_kernel_terminated</c></tag>
- <item>The <c>net_kernel</c> process terminated.</item>
+ <item><p>The <c>net_kernel</c> process terminated.</p></item>
<tag><c>shutdown</c></tag>
- <item>Unspecified connection shutdown.</item>
+ <item><p>Unspecified connection shutdown.</p></item>
<tag><c>connection_closed</c></tag>
- <item>The connection was closed.</item>
+ <item><p>The connection was closed.</p></item>
<tag><c>disconnect</c></tag>
- <item>The connection was disconnected (forced from the
- current node).</item>
+ <item><p>The connection was disconnected (forced from the
+ current node).</p></item>
<tag><c>net_tick_timeout</c></tag>
- <item>Net tick timeout.</item>
+ <item><p>Net tick time-out.</p></item>
<tag><c>send_net_tick_failed</c></tag>
- <item>Failed to send net tick over the connection.</item>
+ <item><p>Failed to send net tick over the connection.</p></item>
<tag><c>get_status_failed</c></tag>
- <item>Status information retrieval from the <c>Port</c>
- holding the connection failed.</item>
+ <item><p>Status information retrieval from the <c>Port</c>
+ holding the connection failed.</p></item>
</taglist>
</item>
</taglist>
</desc>
</func>
- <func>
- <name name="get_net_ticktime" arity="0"/>
- <fsummary>Get <c>net_ticktime</c></fsummary>
- <desc>
- <p>Gets <c>net_ticktime</c> (see
- <seealso marker="kernel_app">kernel(6)</seealso>).</p>
- <p>Currently defined return values (<c><anno>Res</anno></c>):</p>
- <taglist>
- <tag><c><anno>NetTicktime</anno></c></tag>
- <item>
- <p><c>net_ticktime</c> is <c><anno>NetTicktime</anno></c> seconds.</p>
- </item>
- <tag><c>{ongoing_change_to, <anno>NetTicktime</anno>}</c></tag>
- <item>
- <p><c>net_kernel</c> is currently changing
- <c>net_ticktime</c> to <c><anno>NetTicktime</anno></c> seconds.</p>
- </item>
- <tag><c>ignored</c></tag>
- <item>
- <p>The local node is not alive.</p>
- </item>
- </taglist>
- </desc>
- </func>
+
<func>
<name name="set_net_ticktime" arity="1"/>
<name name="set_net_ticktime" arity="2"/>
- <fsummary>Set <c>net_ticktime</c></fsummary>
+ <fsummary>Set <c>net_ticktime</c>.</fsummary>
<desc>
<p>Sets <c>net_ticktime</c> (see
- <seealso marker="kernel_app">kernel(6)</seealso>) to
- <c><anno>NetTicktime</anno></c> seconds. <c><anno>TransitionPeriod</anno></c> defaults
- to 60.</p>
+ <seealso marker="kernel_app"><c>kernel(6)</c></seealso>) to
+ <c><anno>NetTicktime</anno></c> seconds.
+ <c><anno>TransitionPeriod</anno></c> defaults to <c>60</c>.</p>
<p>Some definitions:</p>
<taglist>
- <tag>The minimum transition traffic interval (<c>MTTI</c>)</tag>
- <item>
- <p><c>minimum(<anno>NetTicktime</anno>, PreviousNetTicktime)*1000 div 4</c> milliseconds.</p>
- </item>
- <tag>The transition period</tag>
- <item>
- <p>The time of the least number of consecutive <c>MTTI</c>s
- to cover <c><anno>TransitionPeriod</anno></c> seconds following
- the call to <c>set_net_ticktime/2</c> (i.e.
- ((<c><anno>TransitionPeriod</anno>*1000 - 1) div MTTI + 1)*MTTI</c>
- milliseconds).</p>
- </item>
+ <tag>Minimum transition traffic interval (<c>MTTI</c>)</tag>
+ <item><p><c>minimum(<anno>NetTicktime</anno>,
+ PreviousNetTicktime)*1000 div 4</c> milliseconds.</p></item>
+ <tag>Transition period</tag>
+ <item><p>The time of the least number of consecutive <c>MTTI</c>s
+ to cover <c><anno>TransitionPeriod</anno></c> seconds following
+ the call to <c>set_net_ticktime/2</c> (that is,
+ ((<c><anno>TransitionPeriod</anno>*1000 - 1) div MTTI + 1)*MTTI</c>
+ milliseconds).</p></item>
</taglist>
- <p>If <c><![CDATA[<anno>NetTicktime</anno> < PreviousNetTicktime]]></c>, the actual
- <c>net_ticktime</c> change will be done at the end of
- the transition period; otherwise, at the beginning. During
- the transition period, <c>net_kernel</c> will ensure that
- there will be outgoing traffic on all connections at least
+ <p>If
+ <c><![CDATA[NetTicktime < PreviousNetTicktime]]></c>,
+ the <c>net_ticktime</c> change is done at the end of
+ the transition period; otherwise at the beginning. During
+ the transition period, <c>net_kernel</c> ensures that
+ there is outgoing traffic on all connections at least
every <c>MTTI</c> millisecond.</p>
<note>
- <p>The <c>net_ticktime</c> changes have to be initiated on all
+ <p>The <c>net_ticktime</c> changes must be initiated on all
nodes in the network (with the same <c><anno>NetTicktime</anno></c>)
before the end of any transition period on any node;
- otherwise, connections may erroneously be disconnected.</p>
+ otherwise connections can erroneously be disconnected.</p>
</note>
<p>Returns one of the following:</p>
<taglist>
<tag><c>unchanged</c></tag>
<item>
- <p><c>net_ticktime</c> already had the value of
- <c><anno>NetTicktime</anno></c> and was left unchanged.</p>
+ <p><c>net_ticktime</c> already has the value of
+ <c><anno>NetTicktime</anno></c> and is left unchanged.</p>
</item>
<tag><c>change_initiated</c></tag>
<item>
- <p><c>net_kernel</c> has initiated the change of
- <c>net_ticktime</c> to <c><anno>NetTicktime</anno></c> seconds.</p>
+ <p><c>net_kernel</c> initiated the change of
+ <c>net_ticktime</c> to <c><anno>NetTicktime</anno></c>
+ seconds.</p>
</item>
<tag><c>{ongoing_change_to, <anno>NewNetTicktime</anno>}</c></tag>
<item>
- <p>The request was <em>ignored</em>; because,
- <c>net_kernel</c> was busy changing <c>net_ticktime</c> to
+ <p>The request is <em>ignored</em> because
+ <c>net_kernel</c> is busy changing <c>net_ticktime</c> to
<c><anno>NewNetTicktime</anno></c> seconds.</p>
</item>
</taglist>
</desc>
</func>
+
<func>
<name>start([Name]) -> {ok, pid()} | {error, Reason}</name>
<name>start([Name, NameType]) -> {ok, pid()} | {error, Reason}</name>
<name>start([Name, NameType, Ticktime]) -> {ok, pid()} | {error, Reason}</name>
- <fsummary>Turn an Erlang runtime system into a distributed node</fsummary>
+ <fsummary>Turn an Erlang runtime system into a distributed node.</fsummary>
<type>
<v>Name = atom()</v>
<v>NameType = shortnames | longnames</v>
<v>Reason = {already_started, pid()} | term()</v>
</type>
<desc>
- <p>Note that the argument is a list with exactly one, two or
- three arguments. <c>NameType</c> defaults to <c>longnames</c>
- and <c>Ticktime</c> to 15000.</p>
<p>Turns a non-distributed node into a distributed node by
starting <c>net_kernel</c> and other necessary processes.</p>
+ <p>Notice that the argument is a list with exactly one, two, or
+ three arguments. <c>NameType</c> defaults to <c>longnames</c>
+ and <c>Ticktime</c> to <c>15000</c>.</p>
</desc>
</func>
+
<func>
<name name="stop" arity="0"/>
- <fsummary>Turn a node into a non-distributed Erlang runtime system</fsummary>
+ <fsummary>Turn a node into a non-distributed Erlang runtime system.</fsummary>
<desc>
<p>Turns a distributed node into a non-distributed node. For
other nodes in the network, this is the same as the node
- going down. Only possible when the net kernel was started
- using <c>start/1</c>, otherwise returns
- <c>{error, not_allowed}</c>. Returns <c>{error, not_found}</c>
- if the local node is not alive.</p>
+ going down. Only possible when the net kernel was started using
+ <seealso marker="#start/1"><c>start/1</c></seealso>,
+ otherwise <c>{error, not_allowed}</c> is returned. Returns
+ <c>{error, not_found}</c> if the local node is not alive.</p>
</desc>
</func>
</funcs>
diff --git a/lib/kernel/doc/src/notes.xml b/lib/kernel/doc/src/notes.xml
index 504f85abc2..d0540768de 100644
--- a/lib/kernel/doc/src/notes.xml
+++ b/lib/kernel/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/kernel/doc/src/notes_history.xml b/lib/kernel/doc/src/notes_history.xml
index 97ff3e7400..a6de349311 100644
--- a/lib/kernel/doc/src/notes_history.xml
+++ b/lib/kernel/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/kernel/doc/src/os.xml b/lib/kernel/doc/src/os.xml
index 165160a909..739ac35d2a 100644
--- a/lib/kernel/doc/src/os.xml
+++ b/lib/kernel/doc/src/os.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,98 +29,107 @@
<rev></rev>
</header>
<module>os</module>
- <modulesummary>Operating System Specific Functions</modulesummary>
+ <modulesummary>Operating system-specific functions.</modulesummary>
<description>
- <p>The functions in this module are operating system specific.
- Careless use of these functions will result in programs that will
+ <p>The functions in this module are operating system-specific.
+ Careless use of these functions results in programs that will
only run on a specific platform. On the other hand, with careful
- use these functions can be of help in enabling a program to run on
+ use, these functions can be of help in enabling a program to run on
most platforms.</p>
</description>
<funcs>
<func>
<name name="cmd" arity="1"/>
- <fsummary>Execute a command in a shell of the target OS</fsummary>
+ <fsummary>Execute a command in a shell of the target OS.</fsummary>
<desc>
- <p>Executes <c><anno>Command</anno></c> in a command shell of the target OS,
- captures the standard output of the command and returns this
+ <p>Executes <c><anno>Command</anno></c> in a command shell of the
+ target OS,
+ captures the standard output of the command, and returns this
result as a string. This function is a replacement of
- the previous <c>unix:cmd/1</c>; on a Unix platform they are
- equivalent.</p>
- <p>Examples:</p>
+ the previous function <c>unix:cmd/1</c>; they are equivalent on a
+ Unix platform.</p>
+ <p><em>Examples:</em></p>
<code type="none">
LsOut = os:cmd("ls"), % on unix platform
DirOut = os:cmd("dir"), % on Win32 platform</code>
- <p>Note that in some cases, standard output of a command when
+ <p>Notice that in some cases, standard output of a command when
called from another program (for example, <c>os:cmd/1</c>)
- may differ, compared to the standard output of the command
+ can differ, compared with the standard output of the command
when called directly from an OS command shell.</p>
</desc>
</func>
+
<func>
<name name="find_executable" arity="1"/>
<name name="find_executable" arity="2"/>
- <fsummary>Absolute filename of a program</fsummary>
+ <fsummary>Absolute filename of a program.</fsummary>
<desc>
- <p>These two functions look up an executable program given its
- name and a search path, in the same way as the underlying
- operating system. <c>find_executable/1</c> uses the current
- execution path (that is, the environment variable PATH on
+ <p>These two functions look up an executable program, with the
+ specified name and a search path, in the same way as the underlying
+ OS. <c>find_executable/1</c> uses the current
+ execution path (that is, the environment variable <c>PATH</c> on
Unix and Windows).</p>
- <p><c><anno>Path</anno></c>, if given, should conform to the syntax of
- execution paths on the operating system. The absolute
- filename of the executable program <c><anno>Name</anno></c> is returned,
- or <c>false</c> if the program was not found.</p>
+ <p><c><anno>Path</anno></c>, if specified, is to conform to the syntax
+ of execution paths on the OS. Returns the absolute filename of the
+ executable program <c><anno>Name</anno></c>,
+ or <c>false</c> if the program is not found.</p>
</desc>
</func>
+
<func>
<name name="getenv" arity="0"/>
- <fsummary>List all environment variables</fsummary>
+ <fsummary>List all environment variables.</fsummary>
<desc>
<p>Returns a list of all environment variables.
- Each environment variable is given as a single string on
+ Each environment variable is expressed as a single string on
the format <c>"VarName=Value"</c>, where <c>VarName</c> is
the name of the variable and <c>Value</c> its value.</p>
- <p>If Unicode file name encoding is in effect (see the <seealso
- marker="erts:erl#file_name_encoding">erl manual
- page</seealso>), the strings may contain characters with
- codepoints > 255.</p>
+ <p>If Unicode filename encoding is in effect (see the
+ <seealso marker="erts:erl#file_name_encoding"><c>erl</c> manual
+ page</seealso>), the strings can contain characters with
+ codepoints &gt; 255.</p>
</desc>
</func>
+
<func>
<name name="getenv" arity="1"/>
- <fsummary>Get the value of an environment variable</fsummary>
+ <fsummary>Get the value of an environment variable.</fsummary>
<desc>
<p>Returns the <c><anno>Value</anno></c> of the environment variable
- <c><anno>VarName</anno></c>, or <c>false</c> if the environment variable
- is undefined.</p>
- <p>If Unicode file name encoding is in effect (see the <seealso
- marker="erts:erl#file_name_encoding">erl manual
- page</seealso>), the strings (both <c><anno>VarName</anno></c> and
- <c><anno>Value</anno></c>) may contain characters with codepoints > 255.</p>
+ <c><anno>VarName</anno></c>, or <c>false</c> if the environment
+ variable is undefined.</p>
+ <p>If Unicode filename encoding is in effect (see the
+ <seealso marker="erts:erl#file_name_encoding"><c>erl</c> manual
+ page</seealso>), the strings <c><anno>VarName</anno></c> and
+ <c><anno>Value</anno></c> can contain characters with
+ codepoints &gt; 255.</p>
</desc>
</func>
+
<func>
<name name="getenv" arity="2"/>
- <fsummary>Get the value of an environment variable</fsummary>
+ <fsummary>Get the value of an environment variable.</fsummary>
<desc>
<p>Returns the <c><anno>Value</anno></c> of the environment variable
- <c><anno>VarName</anno></c>, or <c>DefaultValue</c> if the environment variable
- is undefined.</p>
- <p>If Unicode file name encoding is in effect (see the <seealso
- marker="erts:erl#file_name_encoding">erl manual
- page</seealso>), the strings (both <c><anno>VarName</anno></c> and
- <c><anno>Value</anno></c>) may contain characters with codepoints > 255.</p>
+ <c><anno>VarName</anno></c>, or <c>DefaultValue</c> if the
+ environment variable is undefined.</p>
+ <p>If Unicode filename encoding is in effect (see the
+ <seealso marker="erts:erl#file_name_encoding"><c>erl</c> manual
+ page</seealso>), the strings <c><anno>VarName</anno></c> and
+ <c><anno>Value</anno></c> can contain characters with
+ codepoints &gt; 255.</p>
</desc>
</func>
+
<func>
<name name="getpid" arity="0"/>
- <fsummary>Return the process identifier of the emulator process</fsummary>
+ <fsummary>Return the process identifier of the emulator
+ process.</fsummary>
<desc>
<p>Returns the process identifier of the current Erlang emulator
- in the format most commonly used by the operating system
- environment. <c><anno>Value</anno></c> is returned as a string containing
+ in the format most commonly used by the OS environment.
+ Returns <c><anno>Value</anno></c> as a string containing
the (usually) numerical identifier for a process. On Unix,
this is typically the return value of the <c>getpid()</c>
system call. On Windows,
@@ -128,88 +137,93 @@ DirOut = os:cmd("dir"), % on Win32 platform</code>
system call is used.</p>
</desc>
</func>
+
<func>
<name name="putenv" arity="2"/>
- <fsummary>Set a new value for an environment variable</fsummary>
+ <fsummary>Set a new value for an environment variable.</fsummary>
<desc>
- <p>Sets a new <c><anno>Value</anno></c> for the environment variable
+ <p>Sets a new <c><anno>Value</anno></c> for environment variable
<c><anno>VarName</anno></c>.</p>
- <p>If Unicode filename encoding is in effect (see the <seealso
- marker="erts:erl#file_name_encoding">erl manual
- page</seealso>), the strings (both <c><anno>VarName</anno></c> and
- <c><anno>Value</anno></c>) may contain characters with codepoints > 255.</p>
- <p>On Unix platforms, the environment will be set using UTF-8 encoding
- if Unicode file name translation is in effect. On Windows the
- environment is set using wide character interfaces.</p>
+ <p>If Unicode filename encoding is in effect (see the
+ <seealso marker="erts:erl#file_name_encoding"><c>erl</c> manual
+ page</seealso>), the strings <c><anno>VarName</anno></c> and
+ <c><anno>Value</anno></c> can contain characters with
+ codepoints &gt; 255.</p>
+ <p>On Unix platforms, the environment is set using UTF-8 encoding
+ if Unicode filename translation is in effect. On Windows, the
+ environment is set using wide character interfaces.</p>
</desc>
</func>
+
<func>
<name name="system_time" arity="0"/>
- <fsummary>Current OS system time</fsummary>
+ <fsummary>Current OS system time.</fsummary>
<desc>
- <p>Returns current
+ <p>Returns the current
<seealso marker="erts:time_correction#OS_System_Time">OS system time</seealso>
in <c>native</c>
<seealso marker="erts:erlang#type_time_unit">time unit</seealso>.</p>
-
- <note><p>This time is <em>not</em> a monotonically increasing time.</p></note>
+ <note><p>This time is <em>not</em> a monotonically increasing time.</p>
+ </note>
</desc>
</func>
+
<func>
<name name="system_time" arity="1"/>
- <fsummary>Current OS system time</fsummary>
+ <fsummary>Current OS system time.</fsummary>
<desc>
- <p>Returns current
+ <p>Returns the current
<seealso marker="erts:time_correction#OS_System_Time">OS system time</seealso>
converted into the <c><anno>Unit</anno></c> passed as argument.</p>
-
- <p>Calling <c>os:system_time(<anno>Unit</anno>)</c> is equivalent to:
- <seealso marker="erts:erlang#convert_time_unit/3"><c>erlang:convert_time_unit</c></seealso><c>(</c><seealso marker="#system_time/0"><c>os:system_time()</c></seealso><c>,
+ <p>Calling <c>os:system_time(<anno>Unit</anno>)</c> is equivalent to
+ <seealso marker="erts:erlang#convert_time_unit/3"><c>erlang:convert_time_unit</c></seealso>(<seealso marker="#system_time/0"><c>os:system_time()</c></seealso><c>,
native, <anno>Unit</anno>)</c>.</p>
-
- <note><p>This time is <em>not</em> a monotonically increasing time.</p></note>
+ <note><p>This time is <em>not</em> a monotonically increasing time.</p>
+ </note>
</desc>
</func>
+
<func>
<name name="timestamp" arity="0"/>
- <fsummary>Current OS system time on the erlang:timestamp/0 format</fsummary>
+ <fsummary>Current OS system time on the <c>erlang:timestamp/0</c> format.</fsummary>
<type_desc variable="Timestamp">Timestamp = {MegaSecs, Secs, MicroSecs}</type_desc>
<desc>
- <p>Returns current
+ <p>Returns the current
<seealso marker="erts:time_correction#OS_System_Time">OS system time</seealso>
- in the same format as <seealso marker="erts:erlang#timestamp/0">erlang:timestamp/0</seealso>.
- The tuple can be used together with the function
- <seealso marker="stdlib:calendar#now_to_universal_time/1">calendar:now_to_universal_time/1</seealso>
- or <seealso marker="stdlib:calendar#now_to_local_time/1">calendar:now_to_local_time/1</seealso> to
- get calendar time. Using the calendar time together with the <c>MicroSecs</c> part of the return
- tuple from this function allows you to log timestamps in high resolution and consistent with the
- time in the rest of the operating system.</p>
- <p>Example of code formatting a string in the format &quot;DD Mon YYYY HH:MM:SS.mmmmmm&quot;, where
- DD is the day of month, Mon is the textual month name, YYYY is the year, HH:MM:SS is the time and
- mmmmmm is the microseconds in six positions:</p>
-<code>
+ in the same format as
+ <seealso marker="erts:erlang#timestamp/0"><c>erlang:timestamp/0</c></seealso>.
+ The tuple can be used together with function
+ <seealso marker="stdlib:calendar#now_to_universal_time/1"><c>calendar:now_to_universal_time/1</c></seealso>
+ or <seealso marker="stdlib:calendar#now_to_local_time/1"><c>calendar:now_to_local_time/1</c></seealso>
+ to get calendar time. Using the calendar time, together with the
+ <c>MicroSecs</c> part of the return tuple from this function, allows
+ you to log time stamps in high resolution and consistent with the
+ time in the rest of the OS.</p>
+ <p>Example of code formatting a string in format
+ &quot;DD Mon YYYY HH:MM:SS.mmmmmm&quot;, where DD is the day of month,
+ Mon is the textual month name, YYYY is the year, HH:MM:SS is the time,
+ and mmmmmm is the microseconds in six positions:</p>
+ <code>
-module(print_time).
-export([format_utc_timestamp/0]).
format_utc_timestamp() ->
TS = {_,_,Micro} = os:timestamp(),
- {{Year,Month,Day},{Hour,Minute,Second}} =
- calendar:now_to_universal_time(TS),
+ {{Year,Month,Day},{Hour,Minute,Second}} =
+calendar:now_to_universal_time(TS),
Mstr = element(Month,{"Jan","Feb","Mar","Apr","May","Jun","Jul",
- "Aug","Sep","Oct","Nov","Dec"}),
+ "Aug","Sep","Oct","Nov","Dec"}),
io_lib:format("~2w ~s ~4w ~2w:~2..0w:~2..0w.~6..0w",
- [Day,Mstr,Year,Hour,Minute,Second,Micro]).
-</code>
-
- <p>The module above could be used in the following way:</p>
-<pre>
+ [Day,Mstr,Year,Hour,Minute,Second,Micro]).</code>
+ <p>This module can be used as follows:</p>
+ <pre>
1> <input>io:format("~s~n",[print_time:format_utc_timestamp()]).</input>
-29 Apr 2009 9:55:30.051711
-</pre>
+29 Apr 2009 9:55:30.051711</pre>
<p>OS system time can also be retreived by
- <seealso marker="#system_time/0"><c>os:system_time/0</c></seealso>,
- and <seealso marker="#system_time/1"><c>os:system_time/1</c></seealso>.</p>
+ <seealso marker="#system_time/0"><c>system_time/0</c></seealso> and
+ <seealso marker="#system_time/1"><c>system_time/1</c></seealso>.</p>
</desc>
</func>
+
<func>
<name name="perf_counter" arity="0"/>
<fsummary>Returns a performance counter</fsummary>
@@ -227,7 +241,7 @@ format_utc_timestamp() ->
high resolution timestamp. This counter is read directly from the hardware or operating
system with the same guarantees. This means that two consecutive calls
to the function are not guaranteed to be monotonic, though it most likely will be.
- The performance counter till be converted to the resolution passed as an argument.</p>
+ The performance counter will be converted to the resolution passed as an argument.</p>
<pre>1> <input>T1 = os:perf_counter(1000),receive after 10000 -> ok end,T2 = os:perf_counter(1000).</input>
176525861
2> <input>T2 - T1.</input>
@@ -236,41 +250,43 @@ format_utc_timestamp() ->
</func>
<func>
<name name="type" arity="0"/>
- <fsummary>Return the OS family and, in some cases, OS name of the current operating system</fsummary>
+ <fsummary>Return the OS family and, in some cases, the OS name of the
+ current OS.</fsummary>
<desc>
- <p>Returns the <c><anno>Osfamily</anno></c> and, in some cases, <c><anno>Osname</anno></c>
- of the current operating system.</p>
- <p>On Unix, <c><anno>Osname</anno></c> will have same value as
+ <p>Returns the <c><anno>Osfamily</anno></c> and, in some cases, the
+ <c><anno>Osname</anno></c> of the current OS.</p>
+ <p>On Unix, <c><anno>Osname</anno></c> has the same value as
<c>uname -s</c> returns, but in lower case. For example, on
- Solaris 1 and 2, it will be <c>sunos</c>.</p>
- <p>In Windows, <c><anno>Osname</anno></c> will be either <c>nt</c> (on
- Windows NT), or <c>windows</c> (on Windows 95).</p>
+ Solaris 1 and 2, it is <c>sunos</c>.</p>
+ <p>On Windows, <c><anno>Osname</anno></c> is <c>nt</c>.</p>
<note>
- <p>Think twice before using this function. Use the
- <c>filename</c> module if you want to inspect or build
- file names in a portable way.
- Avoid matching on the <c><anno>Osname</anno></c> atom.</p>
+ <p>Think twice before using this function. Use module
+ <seealso marker="stdlib:filename"><c>filename</c></seealso>
+ if you want to inspect or build filenames in a portable way.
+ Avoid matching on atom <c><anno>Osname</anno></c>.</p>
</note>
</desc>
</func>
+
<func>
<name name="unsetenv" arity="1"/>
- <fsummary>Delete an environment variable</fsummary>
+ <fsummary>Delete an environment variable.</fsummary>
<desc>
<p>Deletes the environment variable <c><anno>VarName</anno></c>.</p>
- <p>If Unicode filename encoding is in effect (see the <seealso
- marker="erts:erl#file_name_encoding">erl manual
- page</seealso>), the string (<c><anno>VarName</anno></c>) may
- contain characters with codepoints > 255.</p>
+ <p>If Unicode filename encoding is in effect (see the
+ <seealso marker="erts:erl#file_name_encoding"><c>erl</c> manual
+ page</seealso>), the string <c><anno>VarName</anno></c> can
+ contain characters with codepoints &gt; 255.</p>
</desc>
</func>
+
<func>
<name name="version" arity="0"/>
- <fsummary>Return the Operating System version</fsummary>
+ <fsummary>Return the OS versions.</fsummary>
<desc>
- <p>Returns the operating system version.
+ <p>Returns the OS version.
On most systems, this function returns a tuple, but a string
- will be returned instead if the system has versions which
+ is returned instead if the system has versions that
cannot be expressed as three numbers.</p>
<note>
<p>Think twice before using this function. If you still need
diff --git a/lib/kernel/doc/src/part_notes.xml b/lib/kernel/doc/src/part_notes.xml
index ec19cfa80d..5e849039ee 100644
--- a/lib/kernel/doc/src/part_notes.xml
+++ b/lib/kernel/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/kernel/doc/src/part_notes_history.xml b/lib/kernel/doc/src/part_notes_history.xml
index 87c32c3fba..0cf7b793da 100644
--- a/lib/kernel/doc/src/part_notes_history.xml
+++ b/lib/kernel/doc/src/part_notes_history.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2006</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/kernel/doc/src/pg2.xml b/lib/kernel/doc/src/pg2.xml
index 8c2fdb4cd3..0631b317b4 100644
--- a/lib/kernel/doc/src/pg2.xml
+++ b/lib/kernel/doc/src/pg2.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,135 +30,136 @@
<checked>[email protected]</checked>
<date>1997-08-18</date>
<rev>A2</rev>
- <file>pg2.sgml</file>
+ <file>pg2.xml</file>
</header>
<module>pg2</module>
- <modulesummary>Distributed Named Process Groups</modulesummary>
+ <modulesummary>Distributed named process groups.</modulesummary>
<description>
- <p>This module implements process groups. Each message may be sent
- to one, some, or all members of the group.
- </p>
+ <p>This module implements process groups. Each message can be sent
+ to one, some, or all group members.</p>
<p>A group of processes can be accessed by a common name. For
example, if there is a group named <c>foobar</c>, there can be a
- set of processes (which can be located on different nodes) which
+ set of processes (which can be located on different nodes) that
are all members of the group <c>foobar</c>. There are no special
functions for sending a message to the group. Instead, client
- functions should be written with the functions
- <c>get_members/1</c> and <c>get_local_members/1</c> to find out
- which processes are members of the group. Then the message can be
- sent to one or more members of the group.
- </p>
- <p>If a member terminates, it is automatically removed from the
- group.
- </p>
+ functions are to be written with the functions
+ <seealso marker="#get_members/1"><c>get_members/1</c></seealso> and
+ <seealso marker="#get_local_members/1"><c>get_local_members/1</c></seealso>
+ to determine which processes are members of the group.
+ Then the message can be sent to one or more group members.</p>
+ <p>If a member terminates, it is automatically removed from the group.</p>
<warning>
- <p>This module is used by the <c>disk_log</c> module for
+ <p>This module is used by module
+ <seealso marker="disk_log"><c>disk_log</c></seealso> for
managing distributed disk logs. The disk log names are used as
- group names, which means that some action may need to be taken
+ group names, which means that some action can be needed
to avoid name clashes.</p>
</warning>
</description>
+
<datatypes>
<datatype>
<name name="name"/>
<desc><p>The name of a process group.</p></desc>
</datatype>
</datatypes>
+
<funcs>
<func>
<name name="create" arity="1"/>
- <fsummary>Create a new, empty process group</fsummary>
+ <fsummary>Create a new, empty process group.</fsummary>
<desc>
<p>Creates a new, empty process group. The group is globally
- visible on all nodes. If the group exists, nothing happens.
- </p>
+ visible on all nodes. If the group exists, nothing happens.</p>
</desc>
</func>
+
<func>
<name name="delete" arity="1"/>
- <fsummary>Delete a process group</fsummary>
+ <fsummary>Delete a process group.</fsummary>
<desc>
- <p>Deletes a process group.
- </p>
+ <p>Deletes a process group.</p>
</desc>
</func>
+
<func>
<name name="get_closest_pid" arity="1"/>
- <fsummary>Common dispatch function</fsummary>
+ <fsummary>Common dispatch function.</fsummary>
<desc>
- <p>This is a useful dispatch function which can be used from
+ <p>A useful dispatch function that can be used from
client functions. It returns a process on the local node, if
- such a process exist. Otherwise, it chooses one randomly.
- </p>
+ such a process exists. Otherwise, it selects one randomly.</p>
</desc>
</func>
+
<func>
- <name name="get_members" arity="1"/>
- <fsummary>Return all processes in a group</fsummary>
+ <name name="get_local_members" arity="1"/>
+ <fsummary>Return all local processes in a group.</fsummary>
<desc>
- <p>Returns all processes in the group <c>Name</c>. This
- function should be used from within a client function that
- accesses the group. It is therefore optimized for speed.
- </p>
+ <p>Returns all processes running on the local node in the
+ group <c>Name</c>. This function is to be used from
+ within a client function that accesses the group. It is therefore
+ optimized for speed.</p>
</desc>
</func>
+
<func>
- <name name="get_local_members" arity="1"/>
- <fsummary>Return all local processes in a group</fsummary>
+ <name name="get_members" arity="1"/>
+ <fsummary>Return all processes in a group.</fsummary>
<desc>
- <p>Returns all processes running on the local node in the
- group <c>Name</c>. This function should to be used from
- within a client function that accesses the group. It is therefore
- optimized for speed.
- </p>
+ <p>Returns all processes in the group <c>Name</c>. This
+ function is to be used from within a client function that
+ accesses the group. It is therefore optimized for speed.</p>
</desc>
</func>
+
<func>
<name name="join" arity="2"/>
- <fsummary>Join a process to a group</fsummary>
+ <fsummary>Join a process to a group.</fsummary>
<desc>
<p>Joins the process <c>Pid</c> to the group <c>Name</c>.
- A process can join a group several times; it must then
- leave the group the same number of times.
- </p>
+ A process can join a group many times and must then
+ leave the group the same number of times.</p>
</desc>
</func>
+
<func>
<name name="leave" arity="2"/>
- <fsummary>Make a process leave a group</fsummary>
+ <fsummary>Make a process leave a group.</fsummary>
<desc>
<p>Makes the process <c>Pid</c> leave the group <c>Name</c>.
If the process is not a member of the group, <c>ok</c> is
- returned.
- </p>
- </desc>
- </func>
- <func>
- <name name="which_groups" arity="0"/>
- <fsummary>Return a list of all known groups</fsummary>
- <desc>
- <p>Returns a list of all known groups.
- </p>
+ returned.</p>
</desc>
</func>
+
<func>
<name name="start" arity="0"/>
<name name="start_link" arity="0"/>
- <fsummary>Start the pg2 server</fsummary>
+ <fsummary>Start the <c>pg2</c> server.</fsummary>
<desc>
- <p>Starts the pg2 server. Normally, the server does not need
+ <p>Starts the <c>pg2</c> server. Normally, the server does not need
to be started explicitly, as it is started dynamically if it
is needed. This is useful during development, but in a
- target system the server should be started explicitly. Use
- configuration parameters for <c>kernel</c> for this.
- </p>
+ target system the server is to be started explicitly. Use the
+ configuration parameters for
+ <seealso marker="kernel_app#start_pg2"><c>kernel(6)</c></seealso>
+ for this.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="which_groups" arity="0"/>
+ <fsummary>Return a list of all known groups.</fsummary>
+ <desc>
+ <p>Returns a list of all known groups.</p>
</desc>
</func>
</funcs>
<section>
<title>See Also</title>
- <p><seealso marker="kernel_app">kernel(6)</seealso></p>
+ <p><seealso marker="kernel_app"><c>kernel(6)</c></seealso></p>
</section>
</erlref>
diff --git a/lib/kernel/doc/src/ref_man.xml b/lib/kernel/doc/src/ref_man.xml
index 7eb48a5f1d..5cd77e0f6f 100644
--- a/lib/kernel/doc/src/ref_man.xml
+++ b/lib/kernel/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,9 +29,7 @@
<rev></rev>
</header>
<description>
- <p>The <em>Kernel</em> application has all the code necessary to run
- the Erlang runtime system itself: file servers and code servers
- and so on.</p>
+
</description>
<xi:include href="kernel_app.xml"/>
<xi:include href="application.xml"/>
@@ -45,9 +43,9 @@
<xi:include href="error_handler.xml"/>
<xi:include href="error_logger.xml"/>
<xi:include href="file.xml"/>
+ <xi:include href="gen_sctp.xml"/>
<xi:include href="gen_tcp.xml"/>
<xi:include href="gen_udp.xml"/>
- <xi:include href="gen_sctp.xml"/>
<xi:include href="global.xml"/>
<xi:include href="global_group.xml"/>
<xi:include href="heart.xml"/>
diff --git a/lib/kernel/doc/src/rpc.xml b/lib/kernel/doc/src/rpc.xml
index c323a84e50..8cad9fe4fc 100644
--- a/lib/kernel/doc/src/rpc.xml
+++ b/lib/kernel/doc/src/rpc.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -25,328 +25,388 @@
<title>rpc</title>
<prepared>Claes Wikstrom</prepared>
<docno>1</docno>
- <date>96-09-10</date>
+ <date>1996-09-10</date>
<rev>A</rev>
</header>
<module>rpc</module>
- <modulesummary>Remote Procedure Call Services</modulesummary>
+ <modulesummary>Remote Procedure Call services.</modulesummary>
<description>
- <p>This module contains services which are similar to remote
- procedure calls. It also contains broadcast facilities and
+ <p>This module contains services similar to Remote
+ Procedure Calls. It also contains broadcast facilities and
parallel evaluators. A remote procedure call is a method to call
a function on a remote node and collect the answer. It is used
for collecting information on a remote node, or for running a
function with some specific side effects on the remote node.</p>
</description>
+
<datatypes>
<datatype>
<name name="key"/>
<desc>
- <p>As returned by <seealso marker="#async_call/4">
- <c>async_call/4</c>.</seealso></p>
+ <p>As returned by
+ <seealso marker="#async_call/4"><c>async_call/4</c></seealso>.</p>
</desc>
</datatype>
</datatypes>
+
<funcs>
<func>
- <name name="call" arity="4"/>
- <fsummary>Evaluate a function call on a node</fsummary>
+ <name name="abcast" arity="2"/>
+ <fsummary>Broadcast a message asynchronously to a registered process on
+ all nodes.</fsummary>
<desc>
- <p>Evaluates <c>apply(<anno>Module</anno>, <anno>Function</anno>, <anno>Args</anno>)</c> on the node
- <c><anno>Node</anno></c> and returns the corresponding value <c><anno>Res</anno></c>, or
- <c>{badrpc, <anno>Reason</anno>}</c> if the call fails.</p>
+ <p>Equivalent to <c>abcast([node()|nodes()], <anno>Name</anno>,
+ <anno>Msg</anno>)</c>.</p>
</desc>
</func>
+
<func>
- <name name="call" arity="5"/>
- <fsummary>Evaluate a function call on a node</fsummary>
+ <name name="abcast" arity="3"/>
+ <fsummary>Broadcast a message asynchronously to a registered process on
+ specific nodes.</fsummary>
<desc>
- <p>Evaluates <c>apply(<anno>Module</anno>, <anno>Function</anno>, <anno>Args</anno>)</c> on the node
- <c><anno>Node</anno></c> and returns the corresponding value <c><anno>Res</anno></c>, or
- <c>{badrpc, <anno>Reason</anno>}</c> if the call fails. <c><anno>Timeout</anno></c> is
- a timeout value in milliseconds. If the call times out,
- <c><anno>Reason</anno></c> is <c>timeout</c>.</p>
- <p>If the reply arrives after the call times out, no message
- will contaminate the caller's message queue, since this
- function spawns off a middleman process to act as (a void)
- destination for such an orphan reply. This feature also makes
- this function more expensive than <c>call/4</c> at
- the caller's end.</p>
+ <p>Broadcasts the message <c><anno>Msg</anno></c> asynchronously to
+ the registered process <c><anno>Name</anno></c> on the specified
+ nodes.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="async_call" arity="4"/>
+ <fsummary>Evaluate a function call on a node, asynchronous
+ version.</fsummary>
+ <desc>
+ <p>Implements <em>call streams with promises</em>, a type of
+ RPC that does not suspend the caller until the result is
+ finished. Instead, a key is returned, which can be used
+ later to collect the value. The key can be viewed as a
+ promise to deliver the answer.</p>
+ <p>In this case, the key <c><anno>Key</anno></c> is returned, which
+ can be used in a subsequent call to
+ <seealso marker="#yield/1"><c>yield/1</c></seealso> or
+ <seealso marker="#nb_yield/1"><c>nb_yield/1,2</c></seealso>
+ to retrieve the value of evaluating <c>apply(<anno>Module</anno>,
+ <anno>Function</anno>, <anno>Args</anno>)</c> on node
+ <c><anno>Node</anno></c>.</p>
</desc>
</func>
+
<func>
<name name="block_call" arity="4"/>
- <fsummary>Evaluate a function call on a node in the RPC server's context</fsummary>
+ <fsummary>Evaluate a function call on a node in the RPC server's
+ context.</fsummary>
<desc>
- <p>Like <c>call/4</c>, but the RPC server at <c><anno>Node</anno></c> does
+ <p>Same as <seealso marker="#call/4"><c>call/4</c></seealso>,
+ but the RPC server at <c><anno>Node</anno></c> does
not create a separate process to handle the call. Thus,
this function can be used if the intention of the call is to
block the RPC server from any other incoming requests until
- the request has been handled. The function can also be used
+ the request has been handled. The function can also be used
for efficiency reasons when very small fast functions are
- evaluated, for example BIFs that are guaranteed not to
+ evaluated, for example, BIFs that are guaranteed not to
suspend.</p>
</desc>
</func>
+
<func>
<name name="block_call" arity="5"/>
- <fsummary>Evaluate a function call on a node in the RPC server's context</fsummary>
+ <fsummary>Evaluate a function call on a node in the RPC server's
+ context.</fsummary>
<desc>
- <p>Like <c>block_call/4</c>, but with a timeout value in
- the same manner as <c>call/5</c>.</p>
+ <p>Same as
+ <seealso marker="#block_call/4"><c>block_call/4</c></seealso>,
+ but with a time-out value in the same manner as
+ <seealso marker="#call/5"><c>call/5</c></seealso>.</p>
</desc>
</func>
+
<func>
- <name name="async_call" arity="4"/>
- <fsummary>Evaluate a function call on a node, asynchronous version</fsummary>
+ <name name="call" arity="4"/>
+ <fsummary>Evaluate a function call on a node.</fsummary>
<desc>
- <p>Implements <em>call streams with promises</em>, a type of
- RPC which does not suspend the caller until the result is
- finished. Instead, a key is returned which can be used at a
- later stage to collect the value. The key can be viewed as a
- promise to deliver the answer.</p>
- <p>In this case, the key <c><anno>Key</anno></c> is returned, which can be
- used in a subsequent call to <c>yield/1</c> or
- <c>nb_yield/1,2</c> to retrieve the value of evaluating
- <c>apply(<anno>Module</anno>, <anno>Function</anno>, <anno>Args</anno>)</c> on the node <c><anno>Node</anno></c>.</p>
+ <p>Evaluates <c>apply(<anno>Module</anno>, <anno>Function</anno>,
+ <anno>Args</anno>)</c> on node <c><anno>Node</anno></c> and returns
+ the corresponding value <c><anno>Res</anno></c>, or
+ <c>{badrpc, <anno>Reason</anno>}</c> if the call fails.</p>
</desc>
</func>
+
<func>
- <name name="yield" arity="1"/>
- <fsummary>Deliver the result of evaluating a function call on a node (blocking)</fsummary>
+ <name name="call" arity="5"/>
+ <fsummary>Evaluate a function call on a node.</fsummary>
<desc>
- <p>Returns the promised answer from a previous
- <c>async_call/4</c>. If the answer is available, it is
- returned immediately. Otherwise, the calling process is
- suspended until the answer arrives from <c>Node</c>.</p>
+ <p>Evaluates <c>apply(<anno>Module</anno>, <anno>Function</anno>,
+ <anno>Args</anno>)</c> on node <c><anno>Node</anno></c> and returns
+ the corresponding value <c><anno>Res</anno></c>, or
+ <c>{badrpc, <anno>Reason</anno>}</c> if the call fails.
+ <c><anno>Timeout</anno></c> is
+ a time-out value in milliseconds. If the call times out,
+ <c><anno>Reason</anno></c> is <c>timeout</c>.</p>
+ <p>If the reply arrives after the call times out, no message
+ contaminates the caller's message queue, as this
+ function spawns off a middleman process to act as (a void)
+ destination for such an orphan reply. This feature also makes
+ this function more expensive than <c>call/4</c> at
+ the caller's end.</p>
</desc>
</func>
+
<func>
- <name name="nb_yield" arity="1"/>
- <fsummary>Deliver the result of evaluating a function call on a node (non-blocking)</fsummary>
+ <name name="cast" arity="4"/>
+ <fsummary>Run a function on a node ignoring the result.</fsummary>
<desc>
- <p>Equivalent to <c>nb_yield(<anno>Key</anno>, 0)</c>.</p>
+ <p>Evaluates <c>apply(<anno>Module</anno>, <anno>Function</anno>,
+ <anno>Args</anno>)</c> on node
+ <c><anno>Node</anno></c>. No response is delivered and the calling
+ process is not suspended until the evaluation is complete, as
+ is the case with
+ <seealso marker="#call/4"><c>call/4,5</c></seealso>.</p>
</desc>
</func>
+
<func>
- <name name="nb_yield" arity="2"/>
- <fsummary>Deliver the result of evaluating a function call on a node (non-blocking)</fsummary>
+ <name name="eval_everywhere" arity="3"/>
+ <fsummary>Run a function on all nodes, ignoring the result.</fsummary>
<desc>
- <p>This is a non-blocking version of <c>yield/1</c>. It returns
- the tuple <c>{value, <anno>Val</anno>}</c> when the computation has
- finished, or <c>timeout</c> when <c><anno>Timeout</anno></c> milliseconds
- has elapsed.</p>
+ <p>Equivalent to <c>eval_everywhere([node()|nodes()],
+ <anno>Module</anno>, <anno>Function</anno>,
+ <anno>Args</anno>)</c>.</p>
</desc>
</func>
+
+ <func>
+ <name name="eval_everywhere" arity="4"/>
+ <fsummary>Run a function on specific nodes, ignoring the
+ result.</fsummary>
+ <desc>
+ <p>Evaluates <c>apply(<anno>Module</anno>, <anno>Function</anno>,
+ <anno>Args</anno>)</c> on
+ the specified nodes. No answers are collected.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="multi_server_call" arity="2"/>
+ <fsummary>Interact with the servers on a number of nodes.</fsummary>
+ <desc>
+ <p>Equivalent to <c>multi_server_call([node()|nodes()],
+ <anno>Name</anno>, <anno>Msg</anno>)</c>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="multi_server_call" arity="3"/>
+ <fsummary>Interact with the servers on a number of nodes.</fsummary>
+ <desc>
+ <p>Can be used when interacting with servers called
+ <c><anno>Name</anno></c> on the specified nodes. It is assumed that
+ the servers receive messages in the format
+ <c>{From, <anno>Msg</anno>}</c> and reply using
+ <c>From ! {<anno>Name</anno>, Node, <anno>Reply</anno>}</c>, where
+ <c>Node</c> is the name of the node where the server is located.
+ The function returns <c>{<anno>Replies</anno>,
+ <anno>BadNodes</anno>}</c>, where <c><anno>Replies</anno></c> is a
+ list of all <c><anno>Reply</anno></c> values, and
+ <c><anno>BadNodes</anno></c> is one of the following:</p>
+ <list type="bulleted">
+ <item>A list of the nodes that do not exist</item>
+ <item>A list of the nodes where the server does not exist</item>
+ <item>A list of the nodes where the server terminatd before sending
+ any reply.</item>
+ </list>
+ </desc>
+ </func>
+
<func>
<name name="multicall" arity="3"/>
- <fsummary>Evaluate a function call on a number of nodes</fsummary>
+ <fsummary>Evaluate a function call on a number of nodes.</fsummary>
<desc>
- <p>Equivalent to <c>multicall([node()|nodes()], <anno>Module</anno>, <anno>Function</anno>, <anno>Args</anno>, infinity)</c>.</p>
+ <p>Equivalent to <c>multicall([node()|nodes()], <anno>Module</anno>,
+ <anno>Function</anno>, <anno>Args</anno>, infinity)</c>.</p>
</desc>
</func>
+
<func>
<name name="multicall" arity="4" clause_i="1"/>
- <fsummary>Evaluate a function call on a number of nodes</fsummary>
+ <fsummary>Evaluate a function call on a number of nodes.</fsummary>
<desc>
- <p>Equivalent to <c>multicall(<anno>Nodes</anno>, <anno>Module</anno>, <anno>Function</anno>, <anno>Args</anno>, infinity)</c>.</p>
+ <p>Equivalent to <c>multicall(<anno>Nodes</anno>, <anno>Module</anno>,
+ <anno>Function</anno>, <anno>Args</anno>, infinity)</c>.</p>
</desc>
</func>
+
<func>
<name name="multicall" arity="4" clause_i="2"/>
- <fsummary>Evaluate a function call on a number of nodes</fsummary>
+ <fsummary>Evaluate a function call on a number of nodes.</fsummary>
<desc>
- <p>Equivalent to <c>multicall([node()|nodes()], <anno>Module</anno>, <anno>Function</anno>, <anno>Args</anno>, <anno>Timeout</anno>)</c>.</p>
+ <p>Equivalent to <c>multicall([node()|nodes()], <anno>Module</anno>,
+ <anno>Function</anno>, <anno>Args</anno>,
+ <anno>Timeout</anno>)</c>.</p>
</desc>
</func>
+
<func>
<name name="multicall" arity="5"/>
- <fsummary>Evaluate a function call on a number of nodes</fsummary>
+ <fsummary>Evaluate a function call on a number of nodes.</fsummary>
<desc>
- <p>In contrast to an RPC, a multicall is an RPC which is sent
+ <p>In contrast to an RPC, a multicall is an RPC that is sent
concurrently from one client to multiple servers. This is
- useful for collecting some information from a set of nodes,
+ useful for collecting information from a set of nodes,
or for calling a function on a set of nodes to achieve some
side effects. It is semantically the same as iteratively
making a series of RPCs on all the nodes, but the multicall
- is faster as all the requests are sent at the same time
+ is faster, as all the requests are sent at the same time
and are collected one by one as they come back.</p>
- <p>The function evaluates <c>apply(<anno>Module</anno>, <anno>Function</anno>, <anno>Args</anno>)</c>
- on the specified nodes and collects the answers. It returns
- <c>{<anno>ResL</anno>, <anno>BadNodes</anno>}</c>, where <c><anno>BadNodes</anno></c> is a list
+ <p>The function evaluates <c>apply(<anno>Module</anno>,
+ <anno>Function</anno>, <anno>Args</anno>)</c>
+ on the specified nodes and collects the answers. It returns
+ <c>{<anno>ResL</anno>, <anno>BadNodes</anno>}</c>, where
+ <c><anno>BadNodes</anno></c> is a list
of the nodes that terminated or timed out during computation,
and <c><anno>ResL</anno></c> is a list of the return values.
<c><anno>Timeout</anno></c> is a time (integer) in milliseconds, or
<c>infinity</c>.</p>
<p>The following example is useful when new object code is to
- be loaded on all nodes in the network, and also indicates
- some side effects RPCs may produce:</p>
+ be loaded on all nodes in the network, and indicates
+ some side effects that RPCs can produce:</p>
<code type="none">
-%% Find object code for module Mod
-{Mod, Bin, File} = code:get_object_code(Mod),
+%% Find object code for module Mod
+{Mod, Bin, File} = code:get_object_code(Mod),
-%% and load it on all nodes including this one
+%% and load it on all nodes including this one
{ResL, _} = rpc:multicall(code, load_binary, [Mod, File, Bin]),
%% and then maybe check the ResL list.</code>
</desc>
</func>
+
<func>
- <name name="cast" arity="4"/>
- <fsummary>Run a function on a node ignoring the result</fsummary>
+ <name name="nb_yield" arity="1"/>
+ <fsummary>Deliver the result of evaluating a function call on a node
+ (non-blocking).</fsummary>
<desc>
- <p>Evaluates <c>apply(<anno>Module</anno>, <anno>Function</anno>, <anno>Args</anno>)</c> on the node
- <c><anno>Node</anno></c>. No response is delivered and the calling
- process is not suspended until the evaluation is complete, as
- is the case with <c>call/4,5</c>.</p>
+ <p>Equivalent to <c>nb_yield(<anno>Key</anno>, 0)</c>.</p>
</desc>
</func>
+
<func>
- <name name="eval_everywhere" arity="3"/>
- <fsummary>Run a function on all nodes, ignoring the result</fsummary>
+ <name name="nb_yield" arity="2"/>
+ <fsummary>Deliver the result of evaluating a function call on a node
+ (non-blocking).</fsummary>
<desc>
- <p>Equivalent to <c>eval_everywhere([node()|nodes()], <anno>Module</anno>, <anno>Function</anno>, <anno>Args</anno>)</c>.</p>
+ <p>Non-blocking version of
+ <seealso marker="#yield/1"><c>yield/1</c></seealso>. It returns
+ the tuple <c>{value, <anno>Val</anno>}</c> when the computation is
+ finished, or <c>timeout</c> when <c><anno>Timeout</anno></c>
+ milliseconds has elapsed.</p>
</desc>
</func>
+
<func>
- <name name="eval_everywhere" arity="4"/>
- <fsummary>Run a function on specific nodes, ignoring the result</fsummary>
+ <name name="parallel_eval" arity="1"/>
+ <fsummary>Evaluate many function calls on all nodes in
+ parallel.</fsummary>
<desc>
- <p>Evaluates <c>apply(<anno>Module</anno>, <anno>Function</anno>, <anno>Args</anno>)</c> on
- the specified nodes. No answers are collected.</p>
+ <p>Evaluates, for every tuple in <c><anno>FuncCalls</anno></c>,
+ <c>apply(<anno>Module</anno>, <anno>Function</anno>,
+ <anno>Args</anno>)</c> on some node in
+ the network. Returns the list of return values, in the same
+ order as in <c><anno>FuncCalls</anno></c>.</p>
</desc>
</func>
+
<func>
- <name name="abcast" arity="2"/>
- <fsummary>Broadcast a message asynchronously to a registered process on all nodes</fsummary>
+ <name name="pinfo" arity="1"/>
+ <fsummary>Information about a process.</fsummary>
<desc>
- <p>Equivalent to <c>abcast([node()|nodes()], <anno>Name</anno>, <anno>Msg</anno>)</c>.</p>
+ <p>Location transparent version of the BIF
+ <seealso marker="erts:erlang#process_info/1"><c>erlang:process_info/1</c></seealso> in <c>ERTS</c>.</p>
</desc>
</func>
+
<func>
- <name name="abcast" arity="3"/>
- <fsummary>Broadcast a message asynchronously to a registered process on specific nodes</fsummary>
+ <name name="pinfo" arity="2" clause_i="1"/>
+ <name name="pinfo" arity="2" clause_i="2"/>
+ <fsummary>Information about a process.</fsummary>
<desc>
- <p>Broadcasts the message <c><anno>Msg</anno></c> asynchronously to
- the registered process <c><anno>Name</anno></c> on the specified nodes.</p>
+ <p>Location transparent version of the BIF
+ <seealso marker="erts:erlang#process_info/2"><c>erlang:process_info/2</c></seealso> in <c>ERTS</c>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="pmap" arity="3"/>
+ <fsummary>Parallell evaluation of mapping a function over a
+ list.</fsummary>
+ <desc>
+ <p>Evaluates <c>apply(<anno>Module</anno>, <anno>Function</anno>,
+ [<anno>Elem</anno>|<anno>ExtraArgs</anno>])</c> for every element
+ <c><anno>Elem</anno></c> in <c><anno>List1</anno></c>, in parallel.
+ Returns the list of return values, in the same order as in
+ <c><anno>List1</anno></c>.</p>
</desc>
</func>
+
<func>
<name name="sbcast" arity="2"/>
- <fsummary>Broadcast a message synchronously to a registered process on all nodes</fsummary>
+ <fsummary>Broadcast a message synchronously to a registered process on
+ all nodes.</fsummary>
<desc>
- <p>Equivalent to <c>sbcast([node()|nodes()], <anno>Name</anno>, <anno>Msg</anno>)</c>.</p>
+ <p>Equivalent to <c>sbcast([node()|nodes()], <anno>Name</anno>,
+ <anno>Msg</anno>)</c>.</p>
</desc>
</func>
+
<func>
<name name="sbcast" arity="3"/>
- <fsummary>Broadcast a message synchronously to a registered process on specific nodes</fsummary>
+ <fsummary>Broadcast a message synchronously to a registered process on
+ specific nodes.</fsummary>
<desc>
<p>Broadcasts the message <c><anno>Msg</anno></c> synchronously to
- the registered process <c><anno>Name</anno></c> on the specified nodes.</p>
- <p>Returns <c>{<anno>GoodNodes</anno>, <anno>BadNodes</anno>}</c>, where <c><anno>GoodNodes</anno></c>
- is the list of nodes which have <c><anno>Name</anno></c> as a registered
- process.</p>
+ the registered process <c><anno>Name</anno></c> on the specified
+ nodes.</p>
+ <p>Returns <c>{<anno>GoodNodes</anno>, <anno>BadNodes</anno>}</c>,
+ where <c><anno>GoodNodes</anno></c> is the list of nodes that have
+ <c><anno>Name</anno></c> as a registered process.</p>
<p>The function is synchronous in the sense that it is known
that all servers have received the message when the call
returns. It is not possible to know that the servers have
- actually processed the message.</p>
+ processed the message.</p>
<p>Any further messages sent to the servers, after this
- function has returned, will be received by all servers after
+ function has returned, are received by all servers after
this message.</p>
</desc>
</func>
+
<func>
<name name="server_call" arity="4"/>
- <fsummary>Interact with a server on a node</fsummary>
+ <fsummary>Interact with a server on a node.</fsummary>
<desc>
- <p>This function can be used when interacting with a server
- called <c><anno>Name</anno></c> at node <c><anno>Node</anno></c>. It is assumed that
- the server receives messages in the format
- <c>{From, <anno>Msg</anno>}</c> and replies using <c>From ! {<anno>ReplyWrapper</anno>, <anno>Node</anno>, <anno>Reply</anno>}</c>. This function makes such
+ <p>Can be used when interacting with a server called
+ <c><anno>Name</anno></c> on node <c><anno>Node</anno></c>. It is
+ assumed that the server receives messages in the format
+ <c>{From, <anno>Msg</anno>}</c> and replies using
+ <c>From ! {<anno>ReplyWrapper</anno>, <anno>Node</anno>,
+ <anno>Reply</anno>}</c>. This function makes such
a server call and ensures that the entire call is packed into
- an atomic transaction which either succeeds or fails. It
+ an atomic transaction, which either succeeds or fails. It
never hangs, unless the server itself hangs.</p>
- <p>The function returns the answer <c><anno>Reply</anno></c> as produced by
- the server <c><anno>Name</anno></c>, or <c>{error, <anno>Reason</anno>}</c>.</p>
- </desc>
- </func>
- <func>
- <name name="multi_server_call" arity="2"/>
- <fsummary>Interact with the servers on a number of nodes</fsummary>
- <desc>
- <p>Equivalent to <c>multi_server_call([node()|nodes()], <anno>Name</anno>, <anno>Msg</anno>)</c>.</p>
- </desc>
- </func>
- <func>
- <name name="multi_server_call" arity="3"/>
- <fsummary>Interact with the servers on a number of nodes</fsummary>
- <desc>
- <p>This function can be used when interacting with servers
- called <c><anno>Name</anno></c> on the specified nodes. It is assumed that
- the servers receive messages in the format <c>{From, <anno>Msg</anno>}</c>
- and reply using <c>From ! {<anno>Name</anno>, Node, <anno>Reply</anno>}</c>, where
- <c>Node</c> is the name of the node where the server is
- located. The function returns <c>{<anno>Replies</anno>, <anno>BadNodes</anno>}</c>,
- where <c><anno>Replies</anno></c> is a list of all <c><anno>Reply</anno></c> values and
- <c><anno>BadNodes</anno></c> is a list of the nodes which did not exist, or
- where the server did not exist, or where the server terminated
- before sending any reply.</p>
- </desc>
- </func>
- <func>
- <name name="safe_multi_server_call" arity="2"/>
- <name name="safe_multi_server_call" arity="3"/>
- <fsummary>Interact with the servers on a number of nodes (deprecated)</fsummary>
- <desc>
- <warning>
- <p>This function is deprecated. Use
- <c>multi_server_call/2,3</c> instead.</p>
- </warning>
- <p>In Erlang/OTP R6B and earlier releases,
- <c>multi_server_call/2,3</c> could not handle the case
- where the remote node exists, but there is no server called
- <c><anno>Name</anno></c>. Instead this function had to be used. In
- Erlang/OTP R7B and later releases, however, the functions are
- equivalent, except for this function being slightly slower.</p>
- </desc>
- </func>
- <func>
- <name name="parallel_eval" arity="1"/>
- <fsummary>Evaluate several function calls on all nodes in parallel</fsummary>
- <desc>
- <p>For every tuple in <c><anno>FuncCalls</anno></c>, evaluates
- <c>apply(<anno>Module</anno>, <anno>Function</anno>, <anno>Args</anno>)</c> on some node in
- the network. Returns the list of return values, in the same
- order as in <c><anno>FuncCalls</anno></c>.</p>
- </desc>
- </func>
- <func>
- <name name="pmap" arity="3"/>
- <fsummary>Parallell evaluation of mapping a function over a list </fsummary>
- <desc>
- <p>Evaluates <c>apply(<anno>Module</anno>, <anno>Function</anno>, [<anno>Elem</anno>|<anno>ExtraArgs</anno>])</c>,
- for every element <c><anno>Elem</anno></c> in <c><anno>List1</anno></c>, in parallel.
- Returns the list of return values, in the same order as in
- <c><anno>List1</anno></c>.</p>
- </desc>
- </func>
- <func>
- <name name="pinfo" arity="1"/>
- <fsummary>Information about a process</fsummary>
- <desc>
- <p>Location transparent version of the BIF
- <seealso marker="erts:erlang#process_info/1">
- <c>process_info/1</c></seealso>.</p>
+ <p>The function returns the answer <c><anno>Reply</anno></c> as
+ produced by the server <c><anno>Name</anno></c>, or
+ <c>{error, <anno>Reason</anno>}</c>.</p>
</desc>
</func>
+
<func>
- <name name="pinfo" arity="2"/>
- <fsummary>Information about a process</fsummary>
+ <name name="yield" arity="1"/>
+ <fsummary>Deliver the result of evaluating a function call on a node
+ (blocking).</fsummary>
<desc>
- <p>Location transparent version of the BIF
- <seealso marker="erts:erlang#process_info/2">
- <c>process_info/2</c></seealso>.</p>
+ <p>Returns the promised answer from a previous
+ <seealso marker="#async_call/4"><c>async_call/4</c></seealso>.
+ If the answer is available, it is
+ returned immediately. Otherwise, the calling process is
+ suspended until the answer arrives from <c>Node</c>.</p>
</desc>
</func>
</funcs>
diff --git a/lib/kernel/doc/src/seq_trace.xml b/lib/kernel/doc/src/seq_trace.xml
index 857444e338..5ac199b6a7 100644
--- a/lib/kernel/doc/src/seq_trace.xml
+++ b/lib/kernel/doc/src/seq_trace.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,24 +29,17 @@
<rev>A</rev>
</header>
<module>seq_trace</module>
- <modulesummary>Sequential Tracing of Messages</modulesummary>
+ <modulesummary>Sequential tracing of messages.</modulesummary>
<description>
<p>Sequential tracing makes it possible to trace all messages
resulting from one initial message. Sequential tracing is
- completely independent of the ordinary tracing in Erlang, which
- is controlled by the <c>erlang:trace/3</c> BIF. See the chapter
- <seealso marker="#whatis">What is Sequential Tracing</seealso>
- below for more information about what sequential tracing is and
- how it can be used.</p>
- <p><c>seq_trace</c> provides functions which control all aspects of
+ independent of the ordinary tracing in Erlang, which
+ is controlled by the <c>erlang:trace/3</c> BIF. For more information
+ about what sequential tracing is and how it can be used, see section
+ <seealso marker="#whatis">Sequential Tracing</seealso>.</p>
+ <p><c>seq_trace</c> provides functions that control all aspects of
sequential tracing. There are functions for activation,
- deactivation, inspection and for collection of the trace output.</p>
- <note>
- <p>The implementation of sequential tracing is in beta status.
- This means that the programming interface still might undergo
- minor adjustments (possibly incompatible) based on feedback
- from users.</p>
- </note>
+ deactivation, inspection, and for collection of the trace output.</p>
</description>
<datatypes>
<datatype>
@@ -220,9 +213,10 @@ seq_trace:set_token(OldToken), % activate the trace token again
<type name="tracer"/>
<desc>
<p>Sets the system tracer. The system tracer can be either a
- process or port denoted by <c><anno>Tracer</anno></c>. Returns the previous
- value (which can be <c>false</c> if no system tracer is
- active).</p>
+ process, port or <seealso marker="erts:erl_tracer">tracer module</seealso>
+ denoted by <c><anno>Tracer</anno></c>.
+ Returns the previous value (which can be <c>false</c> if no system
+ tracer is active).</p>
<p>Failure: <c>{badarg, Info}}</c> if <c><anno>Pid</anno></c> is not an
existing local pid.</p>
</desc>
@@ -232,27 +226,28 @@ seq_trace:set_token(OldToken), % activate the trace token again
<fsummary>Return the pid() or port() of the current system tracer.</fsummary>
<type name="tracer"/>
<desc>
- <p>Returns the pid or port identifier of the current system
+ <p>Returns the pid, port identifier or tracer module of the current system
tracer or <c>false</c> if no system tracer is activated.</p>
</desc>
</func>
</funcs>
<section>
- <title>Trace Messages Sent To the System Tracer</title>
- <p>The format of the messages are:</p>
+ <title>Trace Messages Sent to the System Tracer</title>
+ <p>The format of the messages is one of the following, depending on if
+ flag <c>timestamp</c> of the trace token is set to <c>true</c> or
+ <c>false</c>:</p>
<code type="none">
{seq_trace, Label, SeqTraceInfo, TimeStamp}</code>
<p>or</p>
<code type="none">
{seq_trace, Label, SeqTraceInfo}</code>
- <p>depending on whether the <c>timestamp</c> flag of the trace
- token is set to <c>true</c> or <c>false</c>. Where:</p>
+ <p>Where:</p>
<code type="none">
Label = int()
TimeStamp = {Seconds, Milliseconds, Microseconds}
Seconds = Milliseconds = Microseconds = int()</code>
- <p>The <c>SeqTraceInfo</c> can have the following formats:</p>
+ <p><c>SeqTraceInfo</c> can have the following formats:</p>
<taglist>
<tag><c>{send, Serial, From, To, Message}</c></tag>
<item>
@@ -262,141 +257,151 @@ TimeStamp = {Seconds, Milliseconds, Microseconds}
<tag><c>{'receive', Serial, From, To, Message}</c></tag>
<item>
<p>Used when a process <c>To</c> receives a message with a
- trace token that has the <c>'receive'</c> flag set to
- <c>true</c>.</p>
+ trace token that has flag <c>'receive'</c> set to <c>true</c>.</p>
</item>
<tag><c>{print, Serial, From, _, Info}</c></tag>
<item>
- <p>Used when a process <c>From</c> has called
+ <p>Used when a process <c>From</c> has called
<c>seq_trace:print(Label, TraceInfo)</c> and has a trace
- token with the <c>print</c> flag set to <c>true</c> and
+ token with flag <c>print</c> set to <c>true</c>, and
<c>label</c> set to <c>Label</c>.</p>
</item>
</taglist>
<p><c>Serial</c> is a tuple <c>{PreviousSerial, ThisSerial}</c>,
- where the first integer <c>PreviousSerial</c> denotes the serial
- counter passed in the last received message which carried a trace
- token. If the process is the first one in a new sequential trace,
- <c>PreviousSerial</c> is set to the value of the process internal
- "trace clock". The second integer <c>ThisSerial</c> is the serial
- counter that a process sets on outgoing messages and it is based
- on the process internal "trace clock" which is incremented by one
- before it is attached to the trace token in the message.</p>
+ where:</p>
+ <list type="bulleted">
+ <item><p>Integer <c>PreviousSerial</c> denotes the serial
+ counter passed in the last received message that carried a trace
+ token. If the process is the first in a new sequential trace,
+ <c>PreviousSerial</c> is set to the value of the process internal
+ "trace clock".</p></item>
+ <item><p>Integer <c>ThisSerial</c> is the serial
+ counter that a process sets on outgoing messages. It is based
+ on the process internal "trace clock", which is incremented by one
+ before it is attached to the trace token in the message.</p></item>
+ </list>
</section>
<section>
<marker id="whatis"></marker>
- <title>What is Sequential Tracing</title>
+ <title>Sequential Tracing</title>
<p>Sequential tracing is a way to trace a sequence of messages sent
between different local or remote processes, where the sequence
- is initiated by one single message. In short it works like this:</p>
+ is initiated by a single message. In short, it works as follows:</p>
<p>Each process has a <em>trace token</em>, which can be empty or
- not empty. When not empty the trace token can be seen as
+ not empty. When not empty, the trace token can be seen as
the tuple <c>{Label, Flags, Serial, From}</c>. The trace token is
passed invisibly with each message.</p>
- <p>In order to start a sequential trace the user must explicitly set
+ <p>To start a sequential trace, the user must explicitly set
the trace token in the process that will send the first message
in a sequence.</p>
<p>The trace token of a process is set each time the process
matches a message in a receive statement, according to the trace
token carried by the received message, empty or not.</p>
- <p>On each Erlang node a process can be set as the <em>system tracer</em>. This process will receive trace messages each time
+ <p>On each Erlang node, a process can be set as the <em>system tracer</em>.
+ This process will receive trace messages each time
a message with a trace token is sent or received (if the trace
token flag <c>send</c> or <c>'receive'</c> is set). The system
- tracer can then print each trace event, write it to a file or
+ tracer can then print each trace event, write it to a file, or
whatever suitable.</p>
<note>
- <p>The system tracer will only receive those trace events that
+ <p>The system tracer only receives those trace events that
occur locally within the Erlang node. To get the whole picture
- of a sequential trace that involves processes on several Erlang
+ of a sequential trace, involving processes on many Erlang
nodes, the output from the system tracer on each involved node
- must be merged (off line).</p>
+ must be merged (offline).</p>
</note>
- <p>In the following sections Sequential Tracing and its most
- fundamental concepts are described.</p>
+ <p>The following sections describe sequential tracing and its most
+ fundamental concepts.</p>
</section>
<section>
<title>Trace Token</title>
- <p>Each process has a current trace token. Initially the token is
+ <p>Each process has a current trace token. Initially, the token is
empty. When the process sends a message to another process, a
- copy of the current token will be sent "invisibly" along with
+ copy of the current token is sent "invisibly" along with
the message.</p>
- <p>The current token of a process is set in two ways, either</p>
- <list type="ordered">
+ <p>The current token of a process is set in one of the following two
+ ways:</p>
+ <list type="bulleted">
<item>
- <p>explicitly by the process itself, through a call to
- <c>seq_trace:set_token</c>, or</p>
+ <p>Explicitly by the process itself, through a call to
+ <c>seq_trace:set_token/1,2</c></p>
</item>
<item>
- <p>when a message is received.</p>
+ <p>When a message is received</p>
</item>
</list>
- <p>In both cases the current token will be set. In particular, if
- the token of a message received is empty, the current token of
+ <p>In both cases, the current token is set. In particular, if
+ the token of a received message is empty, the current token of
the process is set to empty.</p>
- <p>A trace token contains a label, and a set of flags. Both
- the label and the flags are set in 1 and 2 above.</p>
+ <p>A trace token contains a label and a set of flags. Both
+ the label and the flags are set in both alternatives above.</p>
</section>
<section>
<title>Serial</title>
- <p>The trace token contains a component which is called
- <c>serial</c>. It consists of two integers <c>Previous</c> and
+ <p>The trace token contains a component called
+ <c>serial</c>. It consists of two integers, <c>Previous</c> and
<c>Current</c>. The purpose is to uniquely identify each traced
- event within a trace sequence and to order the messages
- chronologically and in the different branches if any.</p>
+ event within a trace sequence, as well as to order the messages
+ chronologically and in the different branches, if any.</p>
<p>The algorithm for updating <c>Serial</c> can be described as
follows:</p>
- <p>Let each process have two counters <c>prev_cnt</c> and
- <c>curr_cnt</c> which both are set to 0 when a process is created.
+ <p>Let each process have two counters, <c>prev_cnt</c> and
+ <c>curr_cnt</c>, both are set to <c>0</c> when a process is created.
The counters are updated at the following occasions:</p>
<list type="bulleted">
<item>
- <p><em>When the process is about to send a message and the trace token is not empty.</em></p>
+ <p><em>When the process is about to send a message and the trace token
+ is not empty.</em></p>
<p>Let the serial of the trace token be <c>tprev</c> and
- <c>tcurr</c>. <br></br>
-<c>curr_cnt := curr_cnt + 1</c> <br></br>
-<c>tprev := prev_cnt</c> <br></br>
-<c>tcurr := curr_cnt</c></p>
+ <c>tcurr</c>.</p>
+ <pre>
+curr_cnt := curr_cnt + 1
+tprev := prev_cnt
+tcurr := curr_cnt</pre>
<p>The trace token with <c>tprev</c> and <c>tcurr</c> is then
passed along with the message.</p>
</item>
<item>
- <p><em>When the process calls</em><c>seq_trace:print(Label, Info)</c>, <em>Label matches the label part of the trace token and the trace token print flag is true.</em></p>
- <p>The same algorithm as for send above.</p>
+ <p><em>When the process calls</em> <c>seq_trace:print(Label, Info)</c>,
+ <c>Label</c> <em>matches the label part of the trace token and the
+ trace token print flag is <c>true</c>.</em></p>
+ <p>The algorithm is the same as for send above.</p>
</item>
<item>
- <p><em>When a message is received and contains a nonempty trace token.</em></p>
+ <p><em>When a message is received and contains a non-empty trace
+ token.</em></p>
<p>The process trace token is set to the trace token from
the message.</p>
<p>Let the serial of the trace token be <c>tprev</c> and
- <c>tcurr</c>. <br></br>
-<c><![CDATA[if (curr_cnt < tcurr )]]></c> <br></br>
-
- &nbsp; &nbsp; &nbsp; &nbsp;<c>curr_cnt := tcurr</c> <br></br>
-<c>prev_cnt := tcurr</c></p>
+ <c>tcurr</c>.</p>
+ <code>
+<![CDATA[if (curr_cnt < tcurr )]]>
+ curr_cnt := tcurr
+prev_cnt := tcurr</code>
</item>
</list>
- <p>The <c>curr_cnt</c> of a process is incremented each time
+ <p><c>curr_cnt</c> of a process is incremented each time
the process is involved in a sequential trace. The counter can
reach its limit (27 bits) if a process is very long-lived and is
- involved in much sequential tracing. If the counter overflows it
- will not be possible to use the serial for ordering of the trace
- events. To prevent the counter from overflowing in the middle of
- a sequential trace the function <c>seq_trace:reset_trace/0</c>
- can be called to reset the <c>prev_cnt</c> and <c>curr_cnt</c> of
- all processes in the Erlang node. This function will also set all
- trace tokens in processes and their message queues to empty and
- will thus stop all ongoing sequential tracing.</p>
+ involved in much sequential tracing. If the counter overflows, the
+ serial for ordering of the trace events cannot be used. To prevent
+ the counter from overflowing in the middle of
+ a sequential trace, function <c>seq_trace:reset_trace/0</c>
+ can be called to reset <c>prev_cnt</c> and <c>curr_cnt</c> of
+ all processes in the Erlang node. This function also sets all
+ trace tokens in processes and their message queues to empty, and
+ thus stops all ongoing sequential tracing.</p>
</section>
<section>
- <title>Performance considerations</title>
- <p>The performance degradation for a system which is enabled for
- Sequential Tracing is negligible as long as no tracing is
- activated. When tracing is activated there will of course be an
- extra cost for each traced message but all other messages will be
+ <title>Performance Considerations</title>
+ <p>The performance degradation for a system that is enabled for
+ sequential tracing is negligible as long as no tracing is
+ activated. When tracing is activated, there is an
+ extra cost for each traced message, but all other messages are
unaffected.</p>
</section>
@@ -404,13 +409,13 @@ TimeStamp = {Seconds, Milliseconds, Microseconds}
<title>Ports</title>
<p>Sequential tracing is not performed across ports.</p>
<p>If the user for some reason wants to pass the trace token to a
- port this has to be done manually in the code of the port
+ port, this must be done manually in the code of the port
controlling process. The port controlling processes have to check
the appropriate sequential trace settings (as obtained from
- <c>seq_trace:get_token/1</c> and include trace information in
+ <c>seq_trace:get_token/1</c>) and include trace information in
the message data sent to their respective ports.</p>
<p>Similarly, for messages received from a port, a port controller
- has to retrieve trace specific information, and set appropriate
+ has to retrieve trace-specific information, and set appropriate
sequential trace flags through calls to
<c>seq_trace:set_token/2</c>.</p>
</section>
@@ -418,23 +423,23 @@ TimeStamp = {Seconds, Milliseconds, Microseconds}
<section>
<title>Distribution</title>
<p>Sequential tracing between nodes is performed transparently.
- This applies to C-nodes built with Erl_Interface too. A C-node
- built with Erl_Interface only maintains one trace token, which
- means that the C-node will appear as one process from
+ This applies to C-nodes built with <c>Erl_Interface</c> too. A C-node
+ built with <c>Erl_Interface</c> only maintains one trace token, which
+ means that the C-node appears as one process from
the sequential tracing point of view.</p>
- <p>In order to be able to perform sequential tracing between
+ <p>To be able to perform sequential tracing between
distributed Erlang nodes, the distribution protocol has been
- extended (in a backward compatible way). An Erlang node which
- supports sequential tracing can communicate with an older
- (OTP R3B) node but messages passed within that node can of course
+ extended (in a backward compatible way). An Erlang node
+ supporting sequential tracing can communicate with an older
+ (Erlang/OTP R3B) node but messages passed within that node can
not be traced.</p>
</section>
<section>
- <title>Example of Usage</title>
- <p>The example shown here will give rough idea of how the new
- primitives can be used and what kind of output it will produce.</p>
- <p>Assume that we have an initiating process with
+ <title>Example of Use</title>
+ <p>This example gives a rough idea of how the new
+ primitives can be used and what kind of output it produces.</p>
+ <p>Assume that you have an initiating process with
<c><![CDATA[Pid == <0.30.0>]]></c> like this:</p>
<code type="none">
-module(seqex).
@@ -463,8 +468,8 @@ loop() ->
PortController ! {ack,Ack}
end,
loop().</code>
- <p>A possible output from the system's sequential_tracer (inspired
- by AXE-10 and MD-110) could look like:</p>
+ <p>A possible output from the system's <c>sequential_tracer</c> can be
+ like this:</p>
<pre>
17:&lt;0.30.0> Info {0,1} WITH
"**** Trace Started ****"
@@ -475,7 +480,7 @@ loop() ->
17:&lt;0.30.0> Received {2,4} FROM &lt;0.31.0> WITH
{ack,{received,the_message}}</pre>
<p>The implementation of a system tracer process that produces
- the printout above could look like this:</p>
+ this printout can look like this:</p>
<code type="none">
tracer() ->
receive
@@ -502,16 +507,15 @@ print_trace({'receive',Serial,From,To,Message}) ->
print_trace({send,Serial,From,To,Message}) ->
io:format("~p Sent ~p TO ~p WITH~n~p~n",
[From,Serial,To,Message]).</code>
- <p>The code that creates a process that runs the tracer function
- above and sets that process as the system tracer could look like
- this:</p>
+ <p>The code that creates a process that runs this tracer function
+ and sets that process as the system tracer can look like this:</p>
<code type="none">
start() ->
Pid = spawn(?MODULE,tracer,[]),
seq_trace:set_system_tracer(Pid), % set Pid as the system tracer
ok.</code>
- <p>With a function like <c>test/0</c> below the whole example can be
- started.</p>
+ <p>With a function like <c>test/0</c>, the whole example can be
+ started:</p>
<code type="none">
test() ->
P = spawn(?MODULE, loop, [port]),
diff --git a/lib/kernel/doc/src/user.xml b/lib/kernel/doc/src/user.xml
index 24119bea82..38eac1c221 100644
--- a/lib/kernel/doc/src/user.xml
+++ b/lib/kernel/doc/src/user.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1996</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -27,13 +27,13 @@
<title>user</title>
<prepared>Robert Virding</prepared>
<docno>1</docno>
- <date>96-10-10</date>
+ <date>1996-10-10</date>
<rev>A</rev>
</header>
<module>user</module>
- <modulesummary>Standard I/O Server</modulesummary>
+ <modulesummary>Standard I/O server.</modulesummary>
<description>
- <p><c>user</c> is a server which responds to all the messages
+ <p><c>user</c> is a server that responds to all messages
defined in the I/O interface. The code in <c>user.erl</c> can be
used as a model for building alternative I/O servers.</p>
</description>
diff --git a/lib/kernel/doc/src/wrap_log_reader.xml b/lib/kernel/doc/src/wrap_log_reader.xml
index c021f42cac..7fb9c1c023 100644
--- a/lib/kernel/doc/src/wrap_log_reader.xml
+++ b/lib/kernel/doc/src/wrap_log_reader.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -26,39 +26,43 @@
<prepared>Esko Vierum&auml;ki</prepared>
<responsible>Esko Vierum&auml;ki</responsible>
<docno></docno>
- <approved>nobody</approved>
- <checked>no</checked>
- <date>98-09-21</date>
+ <approved></approved>
+ <checked></checked>
+ <date>1998-09-21</date>
<rev>A</rev>
<file>wrap_log_reader.sgml</file>
</header>
<module>wrap_log_reader</module>
- <modulesummary>A function to read internally formatted wrap disk logs</modulesummary>
+ <modulesummary>A service to read internally formatted wrap disk logs.
+ </modulesummary>
<description>
- <p><c>wrap_log_reader</c> is a function to read internally formatted
- wrap disk logs, refer to disk_log(3). <c>wrap_log_reader</c> does not
- interfere with disk_log activities; there is however a known bug in this
- version of the <c>wrap_log_reader</c>, see chapter <c>bugs</c> below.
- </p>
- <p>A wrap disk log file consists of several files, called index files.
- A log file can be opened and closed. It is also possible to open just one index file
- separately. If an non-existent or a non-internally formatted file is opened,
- an error message is returned. If the file is corrupt, no attempt to repair it
- will be done but an error message is returned.
- </p>
- <p>If a log is configured to be distributed, there is a possibility that all items
- are not loggen on all nodes. <c>wrap_log_reader</c> does only read the log on
- the called node, it is entirely up to the user to be sure that all items are read.
- </p>
+ <p>This module makes it possible to read internally formatted
+ wrap disk logs, see
+ <seealso marker="disk_log"><c>disk_log(3)</c></seealso>.
+ <c>wrap_log_reader</c> does not
+ interfere with <c>disk_log</c> activities; there is however a bug in this
+ version of the <c>wrap_log_reader</c>, see section
+ <seealso marker="#bugs">Known Limitations</seealso>.</p>
+ <p>A wrap disk log file consists of many files, called index files. A log
+ file can be opened and closed. Also, a single index file can be opened
+ separately. If a non-existent or non-internally formatted file is opened,
+ an error message is returned. If the file is corrupt, no attempt is made
+ to repair it, but an error message is returned.</p>
+ <p>If a log is configured to be distributed, it is possible that all items
+ are not logged on all nodes. <c>wrap_log_reader</c> only reads the log on
+ the called node; it is up to the user to be sure that all items
+ are read.</p>
</description>
+
<datatypes>
<datatype>
<name name="continuation"/>
- <desc><p>Continuation returned by
- <c>open/1,2</c> or <c>chunk/1,2</c>.</p>
+ <desc>
+ <p>Continuation returned by <c>open/1,2</c> or <c>chunk/1,2</c>.</p>
</desc>
</datatype>
</datatypes>
+
<funcs>
<func>
<name name="chunk" arity="1"/>
@@ -66,87 +70,83 @@
<fsummary>Read a chunk of objects written to a wrap log.</fsummary>
<type name="chunk_ret"/>
<desc>
- <p>This function makes it possible to efficiently read the
- terms which have been appended to a log. It minimises disk
- I/O by reading large 8K chunks from the file.
- </p>
- <p>The first time <c>chunk</c> is called an initial
- continuation returned from the <c>open/1</c>, <c>open/2</c> must be provided.
- </p>
+ <p>Enables to efficiently read the
+ terms that are appended to a log. Minimises disk
+ I/O by reading 64 kilobyte chunks from the file.</p>
+ <p>The first time <c>chunk()</c> is called, an initial
+ continuation returned from <c>open/1</c> or <c>open/2</c> must be
+ provided.</p>
<p>When <c>chunk/3</c> is called, <c><anno>N</anno></c> controls the
maximum number of terms that are read from the log in each
- chunk. Default is <c>infinity</c>, which means that all the
+ chunk. Defaults to <c>infinity</c>, which means that all the
terms contained in the 8K chunk are read. If less than
- <c><anno>N</anno></c> terms are returned, this does not necessarily mean
- that end of file is reached.
- </p>
- <p>The <c>chunk</c> function returns a tuple
- <c>{<anno>Continuation2</anno>, <anno>Terms</anno>}</c>, where <c><anno>Terms</anno></c> is a list
+ <c><anno>N</anno></c> terms are returned, this does not necessarily
+ mean that end of file is reached.</p>
+ <p>Returns a tuple <c>{<anno>Continuation2</anno>,
+ <anno>Terms</anno>}</c>, where <c><anno>Terms</anno></c> is a list
of terms found in the log. <c><anno>Continuation2</anno></c> is yet
- another continuation which must be passed on into any
- subsequent calls to <c>chunk</c>. With a series of calls to
- <c>chunk</c> it is then possible to extract all terms from a
- log.
- </p>
- <p>The <c>chunk</c> function returns a tuple
- <c>{<anno>Continuation2</anno>, <anno>Terms</anno>, <anno>Badbytes</anno>}</c> if the log is opened
- in read only mode and the read chunk is corrupt. <c><anno>Badbytes</anno></c>
+ another continuation that must be passed on to any
+ subsequent calls to <c>chunk()</c>. With a series of calls to
+ <c>chunk()</c>, it is then possible to extract all terms from a log.</p>
+ <p>Returns a tuple <c>{<anno>Continuation2</anno>,
+ <anno>Terms</anno>, <anno>Badbytes</anno>}</c> if the log is opened
+ in read only mode and the read chunk is corrupt.
+ <c><anno>Badbytes</anno></c>
indicates the number of non-Erlang terms found in the chunk.
- Note also that the log is not repaired.
- </p>
- <p><c>chunk</c> returns <c>{<anno>Continuation2</anno>, eof}</c> when the end of the log is
- reached, and <c>{error, <anno>Reason</anno>}</c> if an error occurs.
- </p>
- <p>The returned continuation may or may not be valid in the next call to
- <c>chunk</c>. This is because the log may wrap and delete
- the file into which the continuation points. To make sure
- this does not happen, the log can be blocked during the
- search.
- </p>
+ Notice that the log is not repaired.</p>
+ <p>Returns <c>{<anno>Continuation2</anno>, eof}</c> when
+ the end of the log is reached, and <c>{error, <anno>Reason</anno>}</c>
+ if an error occurs.</p>
+ <p>The returned continuation either is or is not valid in the next call
+ to this function. This is because the log can wrap and delete
+ the file into which the continuation points. To ensure
+ this does not occur, the log can be blocked during the search.</p>
</desc>
</func>
+
<func>
<name name="close" arity="1"/>
- <fsummary>Close a log</fsummary>
+ <fsummary>Close a log.</fsummary>
<desc>
- <p>This function closes a log file properly.
- </p>
+ <p>Closes a log file properly.</p>
</desc>
</func>
+
<func>
<name name="open" arity="1"/>
<name name="open" arity="2"/>
- <fsummary>Open a log file</fsummary>
+ <fsummary>Open a log file.</fsummary>
<type name="open_ret"/>
<desc>
- <p><c><anno>Filename</anno></c> specifies the name of the file which is to be read. </p>
- <p><c><anno>N</anno></c> specifies the index of the file which is to be read.
- If <c><anno>N</anno></c> is omitted the whole wrap log file will be read; if it
- is specified only the specified index file will be read.
- </p>
- <p>The <c>open</c> function returns <c>{ok, <anno>Continuation</anno>}</c> if the
- log/index file was successfully opened. The <c><anno>Continuation</anno></c>
- is to be used when chunking or closing the file.
- </p>
- <p>The function returns <c>{error, <anno>Reason</anno>}</c> for all errors.
- </p>
+ <p><c><anno>Filename</anno></c> specifies the name of the file to be
+ read.</p>
+ <p><c><anno>N</anno></c> specifies the index of the file to be read.
+ If <c><anno>N</anno></c> is omitted, the whole wrap log file is read;
+ if it is specified, only the specified index file is read.</p>
+ <p>Returns <c>{ok, <anno>Continuation</anno>}</c> if the
+ log/index file is opened successfully.
+ <c><anno>Continuation</anno></c>
+ is to be used when chunking or closing the file.</p>
+ <p>Returns <c>{error, <anno>Reason</anno>}</c> for all errors.</p>
</desc>
</func>
</funcs>
<section>
- <title>Bugs</title>
- <p>This version of the <c>wrap_log_reader</c> does not detect if the <c>disk_log</c>
- wraps to a new index file between a <c>wrap_log_reader:open</c> and the first
- <c>wrap_log_reader:chunk</c>.
- In this case the chuck will actually read the last logged items in the log file,
- because the opened index file was truncated by the <c>disk_log</c>.
- </p>
+ <title>Known Limitations</title>
+ <marker id="bugs"/>
+ <p>This version of <c>wrap_log_reader</c> does not detect if
+ <c>disk_log</c> wraps to a new index file between a call to
+ <c>wrap_log_reader:open()</c> and the first call to
+ <c>wrap_log_reader:chunk()</c>.
+ If this occurs, the call to <c>chunk()</c> reads the last logged
+ items in the log file, as the opened index file was truncated by
+ <c>disk_log</c>.</p>
</section>
<section>
<title>See Also</title>
- <p><seealso marker="disk_log">disk_log(3)</seealso></p>
+ <p><seealso marker="disk_log"><c>disk_log(3)</c></seealso></p>
</section>
</erlref>
diff --git a/lib/kernel/doc/src/zlib_stub.xml b/lib/kernel/doc/src/zlib_stub.xml
index d1823b01aa..b111581b10 100644
--- a/lib/kernel/doc/src/zlib_stub.xml
+++ b/lib/kernel/doc/src/zlib_stub.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -31,13 +31,9 @@
<rev>A</rev>
</header>
<module>zlib</module>
- <modulesummary>Zlib Compression interface.</modulesummary>
- <description><p>
-
- The module zlib is moved to the runtime system
- application. Please see <seealso
- marker="erts:zlib">zlib(3)</seealso> in the
- erts reference manual instead.
-
- </p></description>
+ <modulesummary>Zlib compression interface.</modulesummary>
+ <description>
+ <p>This module is moved to the
+ <seealso marker="erts:zlib"><c>ERTS</c></seealso> application.</p>
+ </description>
</erlref>
diff --git a/lib/kernel/include/dist.hrl b/lib/kernel/include/dist.hrl
index 47d9459a19..d6bccdf474 100644
--- a/lib/kernel/include/dist.hrl
+++ b/lib/kernel/include/dist.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -39,3 +39,4 @@
-define(DFLAG_SMALL_ATOM_TAGS, 16#4000).
-define(DFLAG_UTF8_ATOMS, 16#10000).
-define(DFLAG_MAP_TAG, 16#20000).
+-define(DFLAG_BIG_CREATION, 16#40000).
diff --git a/lib/kernel/include/dist_util.hrl b/lib/kernel/include/dist_util.hrl
index d5df2be4ec..43e50d4325 100644
--- a/lib/kernel/include/dist_util.hrl
+++ b/lib/kernel/include/dist_util.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/include/inet.hrl b/lib/kernel/include/inet.hrl
index d983fa9e72..b39df8c3f2 100644
--- a/lib/kernel/include/inet.hrl
+++ b/lib/kernel/include/inet.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/include/inet_sctp.hrl b/lib/kernel/include/inet_sctp.hrl
index d6376e452e..ddb3cdc26c 100644
--- a/lib/kernel/include/inet_sctp.hrl
+++ b/lib/kernel/include/inet_sctp.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/include/net_address.hrl b/lib/kernel/include/net_address.hrl
index 9dd4b78cd4..4988175593 100644
--- a/lib/kernel/include/net_address.hrl
+++ b/lib/kernel/include/net_address.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/Makefile b/lib/kernel/src/Makefile
index 57dacebde3..8bf02afec9 100644
--- a/lib/kernel/src/Makefile
+++ b/lib/kernel/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2013. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/application.erl b/lib/kernel/src/application.erl
index 1abfbfb9ec..bc6be2f8f5 100644
--- a/lib/kernel/src/application.erl
+++ b/lib/kernel/src/application.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/application_controller.erl b/lib/kernel/src/application_controller.erl
index b1ca2ea64f..0e61153613 100644
--- a/lib/kernel/src/application_controller.erl
+++ b/lib/kernel/src/application_controller.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/application_master.erl b/lib/kernel/src/application_master.erl
index 85b7efc402..5da2b0b06c 100644
--- a/lib/kernel/src/application_master.erl
+++ b/lib/kernel/src/application_master.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/application_master.hrl b/lib/kernel/src/application_master.hrl
index f252ce8f16..b03074dbce 100644
--- a/lib/kernel/src/application_master.hrl
+++ b/lib/kernel/src/application_master.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/application_starter.erl b/lib/kernel/src/application_starter.erl
index 692681b515..f51f9bbc45 100644
--- a/lib/kernel/src/application_starter.erl
+++ b/lib/kernel/src/application_starter.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/auth.erl b/lib/kernel/src/auth.erl
index 78cf1e77be..40feee6bf0 100644
--- a/lib/kernel/src/auth.erl
+++ b/lib/kernel/src/auth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/code.erl b/lib/kernel/src/code.erl
index 0882cb170c..8d0a2fbf66 100644
--- a/lib/kernel/src/code.erl
+++ b/lib/kernel/src/code.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -258,7 +258,7 @@ is_sticky(Mod) when is_atom(Mod) -> call({is_sticky,Mod}).
-spec set_path(Path) -> 'true' | {'error', What} when
Path :: [Dir :: file:filename()],
- What :: 'bad_directory' | 'bad_path'.
+ What :: 'bad_directory'.
set_path(PathList) when is_list(PathList) -> call({set_path,PathList}).
-spec get_path() -> Path when
diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl
index fb08b4c22b..6174136507 100644
--- a/lib/kernel/src/code_server.erl
+++ b/lib/kernel/src/code_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -32,7 +32,12 @@
-import(lists, [foreach/2]).
--type on_load_item() :: {reference(),module(),file:name_all(),[pid()]}.
+-type on_load_action() ::
+ fun((term(), state()) -> {'reply',term(),state()} |
+ {'noreply',state()}).
+
+-type on_load_item() :: {{pid(),reference()},module(),
+ [{pid(),on_load_action()}]}.
-record(state, {supervisor :: pid(),
root :: file:name_all(),
@@ -76,7 +81,7 @@ init(Ref, Parent, [Root,Mode]) ->
interactive ->
LibDir = filename:append(Root, "lib"),
{ok,Dirs} = erl_prim_loader:list_dir(LibDir),
- {Paths,_Libs} = make_path(LibDir, Dirs),
+ Paths = make_path(LibDir, Dirs),
UserLibPaths = get_user_lib_dirs(),
["."] ++ UserLibPaths ++ Paths;
_ ->
@@ -111,7 +116,7 @@ get_user_lib_dirs() ->
get_user_lib_dirs_1([Dir|DirList]) ->
case erl_prim_loader:list_dir(Dir) of
{ok, Dirs} ->
- {Paths,_Libs} = make_path(Dir, Dirs),
+ Paths = make_path(Dir, Dirs),
%% Only add paths trailing with ./ebin.
[P || P <- Paths, filename:basename(P) =:= "ebin"] ++
get_user_lib_dirs_1(DirList);
@@ -142,7 +147,7 @@ reply(Pid, Res) ->
loop(#state{supervisor=Supervisor}=State0) ->
receive
{code_call, Pid, Req} ->
- case handle_call(Req, {Pid, call}, State0) of
+ case handle_call(Req, Pid, State0) of
{reply, Res, State} ->
_ = reply(Pid, Res),
loop(State);
@@ -155,8 +160,8 @@ loop(#state{supervisor=Supervisor}=State0) ->
system_terminate(Reason, Supervisor, [], State0);
{system, From, Msg} ->
handle_system_msg(running,Msg, From, Supervisor, State0);
- {'DOWN',Ref,process,_,Res} ->
- State = finish_on_load(Ref, Res, State0),
+ {'DOWN',Ref,process,Pid,Res} ->
+ State = finish_on_load({Pid,Ref}, Res, State0),
loop(State);
_Msg ->
loop(State0)
@@ -225,90 +230,90 @@ system_code_change(State, _Module, _OldVsn, _Extra) ->
%% The gen_server call back functions.
%%
-handle_call({stick_dir,Dir}, {_From,_Tag}, S) ->
+handle_call({stick_dir,Dir}, _From, S) ->
{reply,stick_dir(Dir, true, S),S};
-handle_call({unstick_dir,Dir}, {_From,_Tag}, S) ->
+handle_call({unstick_dir,Dir}, _From, S) ->
{reply,stick_dir(Dir, false, S),S};
-handle_call({stick_mod,Mod}, {_From,_Tag}, S) ->
+handle_call({stick_mod,Mod}, _From, S) ->
{reply,stick_mod(Mod, true, S),S};
-handle_call({unstick_mod,Mod}, {_From,_Tag}, S) ->
+handle_call({unstick_mod,Mod}, _From, S) ->
{reply,stick_mod(Mod, false, S),S};
-handle_call({dir,Dir}, {_From,_Tag}, S) ->
+handle_call({dir,Dir}, _From, S) ->
Root = S#state.root,
Resp = do_dir(Root,Dir,S#state.namedb),
{reply,Resp,S};
-handle_call({load_file,Mod}, Caller, St) when is_atom(Mod) ->
- load_file(Mod, Caller, St);
+handle_call({load_file,Mod}, From, St) when is_atom(Mod) ->
+ load_file(Mod, From, St);
-handle_call({add_path,Where,Dir0}, {_From,_Tag},
+handle_call({add_path,Where,Dir0}, _From,
#state{namedb=Namedb,path=Path0}=S) ->
{Resp,Path} = add_path(Where, Dir0, Path0, Namedb),
{reply,Resp,S#state{path=Path}};
-handle_call({add_paths,Where,Dirs0}, {_From,_Tag},
+handle_call({add_paths,Where,Dirs0}, _From,
#state{namedb=Namedb,path=Path0}=S) ->
{Resp,Path} = add_paths(Where, Dirs0, Path0, Namedb),
{reply,Resp,S#state{path=Path}};
-handle_call({set_path,PathList}, {_From,_Tag},
+handle_call({set_path,PathList}, _From,
#state{path=Path0,namedb=Namedb}=S) ->
{Resp,Path,NewDb} = set_path(PathList, Path0, Namedb),
{reply,Resp,S#state{path=Path,namedb=NewDb}};
-handle_call({del_path,Name}, {_From,_Tag},
+handle_call({del_path,Name}, _From,
#state{path=Path0,namedb=Namedb}=S) ->
{Resp,Path} = del_path(Name, Path0, Namedb),
{reply,Resp,S#state{path=Path}};
-handle_call({replace_path,Name,Dir}, {_From,_Tag},
+handle_call({replace_path,Name,Dir}, _From,
#state{path=Path0,namedb=Namedb}=S) ->
{Resp,Path} = replace_path(Name, Dir, Path0, Namedb),
{reply,Resp,S#state{path=Path}};
-handle_call(get_path, {_From,_Tag}, S) ->
+handle_call(get_path, _From, S) ->
{reply,S#state.path,S};
%% Messages to load, delete and purge modules/files.
-handle_call({load_abs,File,Mod}, Caller, S) when is_atom(Mod) ->
+handle_call({load_abs,File,Mod}, From, S) when is_atom(Mod) ->
case modp(File) of
false ->
{reply,{error,badarg},S};
true ->
- load_abs(File, Mod, Caller, S)
+ load_abs(File, Mod, From, S)
end;
-handle_call({load_binary,Mod,File,Bin}, Caller, S) when is_atom(Mod) ->
- do_load_binary(Mod, File, Bin, Caller, S);
+handle_call({load_binary,Mod,File,Bin}, From, S) when is_atom(Mod) ->
+ do_load_binary(Mod, File, Bin, From, S);
-handle_call({load_native_partial,Mod,Bin}, {_From,_Tag}, S) ->
+handle_call({load_native_partial,Mod,Bin}, _From, S) ->
Architecture = erlang:system_info(hipe_architecture),
Result = (catch hipe_unified_loader:load(Mod, Bin, Architecture)),
Status = hipe_result_to_status(Result, S),
{reply,Status,S};
-handle_call({load_native_sticky,Mod,Bin,WholeModule}, {_From,_Tag}, S) ->
+handle_call({load_native_sticky,Mod,Bin,WholeModule}, _From, S) ->
Architecture = erlang:system_info(hipe_architecture),
Result = (catch hipe_unified_loader:load_module(Mod, Bin, WholeModule,
Architecture)),
Status = hipe_result_to_status(Result, S),
{reply,Status,S};
-handle_call({ensure_loaded,Mod}, Caller, St) when is_atom(Mod) ->
+handle_call({ensure_loaded,Mod}, From, St) when is_atom(Mod) ->
case erlang:module_loaded(Mod) of
true ->
{reply,{module,Mod},St};
false when St#state.mode =:= interactive ->
- load_file(Mod, Caller, St);
+ ensure_loaded(Mod, From, St);
false ->
{reply,{error,embedded},St}
end;
-handle_call({delete,Mod}, {_From,_Tag}, St) when is_atom(Mod) ->
+handle_call({delete,Mod}, _From, St) when is_atom(Mod) ->
case catch erlang:delete_module(Mod) of
true ->
ets:delete(St#state.moddb, Mod),
@@ -317,48 +322,50 @@ handle_call({delete,Mod}, {_From,_Tag}, St) when is_atom(Mod) ->
{reply,false,St}
end;
-handle_call({purge,Mod}, {_From,_Tag}, St) when is_atom(Mod) ->
+handle_call({purge,Mod}, _From, St) when is_atom(Mod) ->
{reply,do_purge(Mod),St};
-handle_call({soft_purge,Mod}, {_From,_Tag}, St) when is_atom(Mod) ->
+handle_call({soft_purge,Mod}, _From, St) when is_atom(Mod) ->
{reply,do_soft_purge(Mod),St};
-handle_call({is_loaded,Mod}, {_From,_Tag}, St) when is_atom(Mod) ->
+handle_call({is_loaded,Mod}, _From, St) when is_atom(Mod) ->
{reply,is_loaded(Mod, St#state.moddb),St};
-handle_call(all_loaded, {_From,_Tag}, S) ->
+handle_call(all_loaded, _From, S) ->
Db = S#state.moddb,
{reply,all_loaded(Db),S};
-handle_call({get_object_code,Mod}, {_From,_Tag}, St) when is_atom(Mod) ->
+handle_call({get_object_code,Mod}, _From, St) when is_atom(Mod) ->
Path = St#state.path,
case mod_to_bin(Path, Mod) of
{_,Bin,FName} -> {reply,{Mod,Bin,FName},St};
Error -> {reply,Error,St}
end;
-handle_call({is_sticky, Mod}, {_From,_Tag}, S) ->
+handle_call({is_sticky, Mod}, _From, S) ->
Db = S#state.moddb,
{reply, is_sticky(Mod,Db), S};
-handle_call(stop,{_From,_Tag}, S) ->
+handle_call(stop,_From, S) ->
{stop,normal,stopped,S};
-handle_call({set_primary_archive, File, ArchiveBin, FileInfo, ParserFun}, {_From,_Tag}, S=#state{mode=Mode}) ->
- case erl_prim_loader:set_primary_archive(File, ArchiveBin, FileInfo, ParserFun) of
+handle_call({set_primary_archive, File, ArchiveBin, FileInfo, ParserFun},
+ _From, S=#state{mode=Mode}) ->
+ case erl_prim_loader:set_primary_archive(File, ArchiveBin, FileInfo,
+ ParserFun) of
{ok, Files} ->
{reply, {ok, Mode, Files}, S};
{error, _Reason} = Error ->
{reply, Error, S}
end;
-handle_call(get_mode, {_From,_Tag}, S=#state{mode=Mode}) ->
+handle_call(get_mode, _From, S=#state{mode=Mode}) ->
{reply, Mode, S};
-handle_call({finish_loading,Prepared,EnsureLoaded}, {_,_}, S) ->
+handle_call({finish_loading,Prepared,EnsureLoaded}, _From, S) ->
{reply,finish_loading(Prepared, EnsureLoaded, S),S};
-handle_call(Other,{_From,_Tag}, S) ->
+handle_call(Other,_From, S) ->
error_msg(" ** Codeserver*** ignoring ~w~n ",[Other]),
{noreply,S}.
@@ -371,7 +378,7 @@ handle_call(Other,{_From,_Tag}, S) ->
%%
make_path(BundleDir, Bundles0) ->
Bundles = choose_bundles(Bundles0),
- make_path(BundleDir, Bundles, [], []).
+ make_path(BundleDir, Bundles, []).
choose_bundles(Bundles) ->
ArchiveExt = archive_extension(),
@@ -381,12 +388,10 @@ choose_bundles(Bundles) ->
create_bundle(FullName, ArchiveExt) ->
BaseName = filename:basename(FullName, ArchiveExt),
- case split(BaseName, "-") of
- [_, _|_] = Toks ->
- VsnStr = lists:last(Toks),
+ case split_base(BaseName) of
+ {Name, VsnStr} ->
case vsn_to_num(VsnStr) of
{ok, VsnNum} ->
- Name = join(lists:sublist(Toks, length(Toks)-1),"-"),
{Name,VsnNum,FullName};
false ->
{FullName,[0],FullName}
@@ -457,41 +462,44 @@ choose([{Name,NumVsn,NewFullName}=New|Bs], Acc, ArchiveExt) ->
choose([],Acc, _ArchiveExt) ->
Acc.
-make_path(_,[],Res,Bs) ->
- {Res,Bs};
-make_path(BundleDir,[Bundle|Tail],Res,Bs) ->
- Dir = filename:append(BundleDir,Bundle),
- Ebin = filename:append(Dir,"ebin"),
+make_path(_, [], Res) ->
+ Res;
+make_path(BundleDir, [Bundle|Tail], Res) ->
+ Dir = filename:append(BundleDir, Bundle),
+ Ebin = filename:append(Dir, "ebin"),
%% First try with /ebin
- case erl_prim_loader:read_file_info(Ebin) of
- {ok,#file_info{type=directory}} ->
- make_path(BundleDir,Tail,[Ebin|Res],[Bundle|Bs]);
- _ ->
+ case is_dir(Ebin) of
+ true ->
+ make_path(BundleDir, Tail, [Ebin|Res]);
+ false ->
%% Second try with archive
Ext = archive_extension(),
- Base = filename:basename(Dir, Ext),
- Ebin2 = filename:join([filename:dirname(Dir), Base ++ Ext, Base, "ebin"]),
+ Base = filename:basename(Bundle, Ext),
+ Ebin2 = filename:join([BundleDir, Base ++ Ext, Base, "ebin"]),
Ebins =
- case split(Base, "-") of
- [_, _|_] = Toks ->
- AppName = join(lists:sublist(Toks, length(Toks)-1),"-"),
- Ebin3 = filename:join([filename:dirname(Dir), Base ++ Ext, AppName, "ebin"]),
+ case split_base(Base) of
+ {AppName,_} ->
+ Ebin3 = filename:join([BundleDir, Base ++ Ext,
+ AppName, "ebin"]),
[Ebin3, Ebin2, Dir];
_ ->
[Ebin2, Dir]
end,
- try_ebin_dirs(Ebins,BundleDir,Tail,Res,Bundle, Bs)
+ case try_ebin_dirs(Ebins) of
+ {ok,FoundEbin} ->
+ make_path(BundleDir, Tail, [FoundEbin|Res]);
+ error ->
+ make_path(BundleDir, Tail, Res)
+ end
end.
-try_ebin_dirs([Ebin | Ebins],BundleDir,Tail,Res,Bundle,Bs) ->
- case erl_prim_loader:read_file_info(Ebin) of
- {ok,#file_info{type=directory}} ->
- make_path(BundleDir,Tail,[Ebin|Res],[Bundle|Bs]);
- _ ->
- try_ebin_dirs(Ebins,BundleDir,Tail,Res,Bundle,Bs)
+try_ebin_dirs([Ebin|Ebins]) ->
+ case is_dir(Ebin) of
+ true -> {ok,Ebin};
+ false -> try_ebin_dirs(Ebins)
end;
-try_ebin_dirs([],BundleDir,Tail,Res,_Bundle,Bs) ->
- make_path(BundleDir,Tail,Res,Bs).
+try_ebin_dirs([]) ->
+ error.
%%
@@ -609,19 +617,34 @@ exclude(Dir,Path) ->
%%
%%
get_name(Dir) ->
- get_name2(get_name1(Dir), []).
+ get_name_from_splitted(filename:split(Dir)).
+
+get_name_from_splitted([DirName,"ebin"]) ->
+ discard_after_hyphen(DirName);
+get_name_from_splitted([DirName]) ->
+ discard_after_hyphen(DirName);
+get_name_from_splitted([_|T]) ->
+ get_name_from_splitted(T);
+get_name_from_splitted([]) ->
+ "". %No name.
+
+discard_after_hyphen("-"++_) ->
+ [];
+discard_after_hyphen([H|T]) ->
+ [H|discard_after_hyphen(T)];
+discard_after_hyphen([]) ->
+ [].
-get_name1(Dir) ->
- case lists:reverse(filename:split(Dir)) of
- ["ebin",DirName|_] -> DirName;
- [DirName|_] -> DirName;
- _ -> "" % No name !
+split_base(BaseName) ->
+ case split(BaseName, "-") of
+ [_, _|_] = Toks ->
+ Vsn = lists:last(Toks),
+ AllButLast = lists:droplast(Toks),
+ {join(AllButLast, "-"),Vsn};
+ [_|_] ->
+ BaseName
end.
-get_name2([$-|_],Acc) -> lists:reverse(Acc);
-get_name2([H|T],Acc) -> get_name2(T,[H|Acc]);
-get_name2(_,Acc) -> lists:reverse(Acc).
-
check_path(Path) ->
PathChoice = init:code_path_choice(),
ArchiveExt = archive_extension(),
@@ -630,23 +653,23 @@ check_path(Path) ->
do_check_path([], _PathChoice, _ArchiveExt, Acc) ->
{ok, lists:reverse(Acc)};
do_check_path([Dir | Tail], PathChoice, ArchiveExt, Acc) ->
- case catch erl_prim_loader:read_file_info(Dir) of
- {ok, #file_info{type=directory}} ->
+ case is_dir(Dir) of
+ true ->
do_check_path(Tail, PathChoice, ArchiveExt, [Dir | Acc]);
- _ when PathChoice =:= strict ->
+ false when PathChoice =:= strict ->
%% Be strict. Only use dir as explicitly stated
{error, bad_directory};
- _ when PathChoice =:= relaxed ->
+ false when PathChoice =:= relaxed ->
%% Be relaxed
case catch lists:reverse(filename:split(Dir)) of
{'EXIT', _} ->
{error, bad_directory};
["ebin", App] ->
Dir2 = filename:join([App ++ ArchiveExt, App, "ebin"]),
- case erl_prim_loader:read_file_info(Dir2) of
- {ok, #file_info{type = directory}} ->
+ case is_dir(Dir2) of
+ true ->
do_check_path(Tail, PathChoice, ArchiveExt, [Dir2 | Acc]);
- _ ->
+ false ->
{error, bad_directory}
end;
["ebin", App, OptArchive | RevTop] ->
@@ -666,10 +689,10 @@ do_check_path([Dir | Tail], PathChoice, ArchiveExt, Acc) ->
Top = lists:reverse([OptArchive | RevTop]),
filename:join(Top ++ [App ++ ArchiveExt, App, "ebin"])
end,
- case erl_prim_loader:read_file_info(Dir2) of
- {ok, #file_info{type = directory}} ->
+ case is_dir(Dir2) of
+ true ->
do_check_path(Tail, PathChoice, ArchiveExt, [Dir2 | Acc]);
- _ ->
+ false ->
{error, bad_directory}
end;
_ ->
@@ -768,7 +791,7 @@ init_namedb(Path) ->
Db.
init_namedb([P|Path], Db) ->
- insert_name(P, Db),
+ insert_dir(P, Db),
init_namedb(Path, Db);
init_namedb([], _) ->
ok.
@@ -781,59 +804,39 @@ clear_namedb([], _) ->
ok.
-endif.
-insert_name(Dir, Db) ->
- case get_name(Dir) of
- Dir -> false;
- Name -> insert_name(Name, Dir, Db)
- end.
+%% Dir must be a complete pathname (not only a name).
+insert_dir(Dir, Db) ->
+ Splitted = filename:split(Dir),
+ Name = get_name_from_splitted(Splitted),
+ AppDir = filename:join(del_ebin_1(Splitted)),
+ do_insert_name(Name, AppDir, Db).
insert_name(Name, Dir, Db) ->
AppDir = del_ebin(Dir),
+ do_insert_name(Name, AppDir, Db).
+
+do_insert_name(Name, AppDir, Db) ->
{Base, SubDirs} = archive_subdirs(AppDir),
ets:insert(Db, {Name, AppDir, Base, SubDirs}),
true.
archive_subdirs(AppDir) ->
- IsDir =
- fun(RelFile) ->
- File = filename:join([AppDir, RelFile]),
- case erl_prim_loader:read_file_info(File) of
- {ok, #file_info{type = directory}} ->
- false;
- _ ->
- true
- end
- end,
- {Base, ArchiveDirs} = all_archive_subdirs(AppDir),
- {Base, lists:filter(IsDir, ArchiveDirs)}.
-
-all_archive_subdirs(AppDir) ->
- Ext = archive_extension(),
Base = filename:basename(AppDir),
- Dirs =
- case split(Base, "-") of
- [_, _|_] = Toks ->
- Base2 = join(lists:sublist(Toks, length(Toks)-1), "-"),
- [Base2, Base];
- _ ->
- [Base]
+ Dirs = case split_base(Base) of
+ {Name, _} -> [Name, Base];
+ _ -> [Base]
end,
+ Ext = archive_extension(),
try_archive_subdirs(AppDir ++ Ext, Base, Dirs).
try_archive_subdirs(Archive, Base, [Dir | Dirs]) ->
- ArchiveDir = filename:join([Archive, Dir]),
+ ArchiveDir = filename:append(Archive, Dir),
case erl_prim_loader:list_dir(ArchiveDir) of
{ok, Files} ->
- IsDir =
- fun(RelFile) ->
- File = filename:join([ArchiveDir, RelFile]),
- case erl_prim_loader:read_file_info(File) of
- {ok, #file_info{type = directory}} ->
- true;
- _ ->
- false
- end
- end,
+ IsDir = fun(RelFile) ->
+ File = filename:append(ArchiveDir, RelFile),
+ is_dir(File)
+ end,
{Dir, lists:filter(IsDir, Files)};
_ ->
try_archive_subdirs(Archive, Base, Dirs)
@@ -927,22 +930,22 @@ check_pars(Name,Dir) ->
end.
del_ebin(Dir) ->
- case filename:basename(Dir) of
- "ebin" ->
- Dir2 = filename:dirname(Dir),
- Dir3 = filename:dirname(Dir2),
- Ext = archive_extension(),
- case filename:extension(Dir3) of
- E when E =:= Ext ->
- %% Strip archive extension
- filename:join([filename:dirname(Dir3),
- filename:basename(Dir3, Ext)]);
- _ ->
- Dir2
- end;
- _ ->
- Dir
- end.
+ filename:join(del_ebin_1(filename:split(Dir))).
+
+del_ebin_1([Parent,App,"ebin"]) ->
+ Ext = archive_extension(),
+ case filename:basename(Parent, Ext) of
+ Parent ->
+ %% Plain directory.
+ [Parent,App];
+ Archive ->
+ %% Archive.
+ [Archive]
+ end;
+del_ebin_1([H|T]) ->
+ [H|del_ebin_1(T)];
+del_ebin_1([]) ->
+ [].
replace_name(Dir, Db) ->
case get_name(Dir) of
@@ -1058,14 +1061,14 @@ add_paths(Where,[Dir|Tail],Path,NameDb) ->
add_paths(_,_,Path,_) ->
{ok,Path}.
-do_load_binary(Module, File, Binary, Caller, St) ->
+do_load_binary(Module, File, Binary, From, St) ->
case modp(File) andalso is_binary(Binary) of
true ->
case erlang:module_loaded(Module) of
true -> do_purge(Module);
false -> ok
end,
- try_load_module(File, Module, Binary, Caller, St);
+ try_load_module(File, Module, Binary, From, St);
false ->
{reply,{error,badarg},St}
end.
@@ -1074,63 +1077,61 @@ modp(Atom) when is_atom(Atom) -> true;
modp(List) when is_list(List) -> int_list(List);
modp(_) -> false.
-load_abs(File, Mod, Caller, St) ->
+load_abs(File, Mod, From, St) ->
Ext = objfile_extension(),
FileName0 = lists:concat([File, Ext]),
FileName = absname(FileName0),
case erl_prim_loader:get_file(FileName) of
{ok,Bin,_} ->
- try_load_module(FileName, Mod, Bin, Caller, St);
+ try_load_module(FileName, Mod, Bin, From, St);
error ->
{reply,{error,nofile},St}
end.
-try_load_module(File, Mod, Bin, {From,_}=Caller, St0) ->
- case pending_on_load(Mod, From, St0) of
- no ->
- try_load_module_1(File, Mod, Bin, Caller, St0);
- {yes,St} ->
- {noreply,St}
- end.
+try_load_module(File, Mod, Bin, From, St) ->
+ Action = fun(_, S) ->
+ try_load_module_1(File, Mod, Bin, From, S)
+ end,
+ handle_pending_on_load(Action, Mod, From, St).
-try_load_module_1(File, Mod, Bin, Caller, #state{moddb=Db}=St) ->
+try_load_module_1(File, Mod, Bin, From, #state{moddb=Db}=St) ->
case is_sticky(Mod, Db) of
true -> %% Sticky file reject the load
error_msg("Can't load module '~w' that resides in sticky dir\n",[Mod]),
{reply,{error,sticky_directory},St};
false ->
Architecture = erlang:system_info(hipe_architecture),
- try_load_module_2(File, Mod, Bin, Caller, Architecture, St)
+ try_load_module_2(File, Mod, Bin, From, Architecture, St)
end.
-try_load_module_2(File, Mod, Bin, Caller, undefined, St) ->
- try_load_module_3(File, Mod, Bin, Caller, undefined, St);
-try_load_module_2(File, Mod, Bin, Caller, Architecture,
+try_load_module_2(File, Mod, Bin, From, undefined, St) ->
+ try_load_module_3(File, Mod, Bin, From, undefined, St);
+try_load_module_2(File, Mod, Bin, From, Architecture,
#state{moddb=Db}=St) ->
case catch hipe_unified_loader:load_native_code(Mod, Bin, Architecture) of
{module,Mod} = Module ->
ets:insert(Db, [{{native,Mod},true},{Mod,File}]),
{reply,Module,St};
no_native ->
- try_load_module_3(File, Mod, Bin, Caller, Architecture, St);
+ try_load_module_3(File, Mod, Bin, From, Architecture, St);
Error ->
error_msg("Native loading of ~ts failed: ~p\n", [File,Error]),
{reply,ok,St}
end.
-try_load_module_3(File, Mod, Bin, Caller, Architecture,
- #state{moddb=Db}=St) ->
- case erlang:load_module(Mod, Bin) of
- {module,Mod} = Module ->
- ets:insert(Db, {Mod,File}),
- post_beam_load([Mod], Architecture, St),
- {reply,Module,St};
- {error,on_load} ->
- handle_on_load(Mod, File, Caller, St);
- {error,What} = Error ->
- error_msg("Loading of ~ts failed: ~p\n", [File, What]),
- {reply,Error,St}
- end.
+try_load_module_3(File, Mod, Bin, From, Architecture, St0) ->
+ Action = fun({module,_}=Module, #state{moddb=Db}=S) ->
+ ets:insert(Db, {Mod,File}),
+ post_beam_load([Mod], Architecture, S),
+ {reply,Module,S};
+ ({error,on_load_failure}=Error, S) ->
+ {reply,Error,S};
+ ({error,What}=Error, S) ->
+ error_msg("Loading of ~ts failed: ~p\n", [File, What]),
+ {reply,Error,S}
+ end,
+ Res = erlang:load_module(Mod, Bin),
+ handle_on_load(Res, Action, Mod, From, St0).
hipe_result_to_status(Result, #state{moddb=Db}) ->
case Result of
@@ -1155,18 +1156,29 @@ int_list([H|T]) when is_integer(H) -> int_list(T);
int_list([_|_]) -> false;
int_list([]) -> true.
-load_file(Mod, {From,_}=Caller, St0) ->
- case pending_on_load(Mod, From, St0) of
- no -> load_file_1(Mod, Caller, St0);
- {yes,St} -> {noreply,St}
- end.
-
-load_file_1(Mod, Caller, #state{path=Path}=St) ->
+ensure_loaded(Mod, From, St0) ->
+ Action = fun(_, S) ->
+ case erlang:module_loaded(Mod) of
+ true ->
+ {reply,{module,Mod},S};
+ false ->
+ load_file_1(Mod, From, S)
+ end
+ end,
+ handle_pending_on_load(Action, Mod, From, St0).
+
+load_file(Mod, From, St0) ->
+ Action = fun(_, S) ->
+ load_file_1(Mod, From, S)
+ end,
+ handle_pending_on_load(Action, Mod, From, St0).
+
+load_file_1(Mod, From, #state{path=Path}=St) ->
case mod_to_bin(Path, Mod) of
error ->
{reply,{error,nofile},St};
{Mod,Binary,File} ->
- try_load_module_1(File, Mod, Binary, Caller, St)
+ try_load_module_1(File, Mod, Binary, From, St)
end.
mod_to_bin([Dir|Tail], Mod) ->
@@ -1174,8 +1186,13 @@ mod_to_bin([Dir|Tail], Mod) ->
case erl_prim_loader:get_file(File) of
error ->
mod_to_bin(Tail, Mod);
- {ok,Bin,FName} ->
- {Mod,Bin,absname(FName)}
+ {ok,Bin,_} ->
+ case filename:pathtype(File) of
+ absolute ->
+ {Mod,Bin,File};
+ _ ->
+ {Mod,Bin,absname(File)}
+ end
end;
mod_to_bin([], Mod) ->
%% At last, try also erl_prim_loader's own method
@@ -1236,6 +1253,11 @@ do_purge(Mod) ->
do_soft_purge(Mod) ->
erts_code_purger:soft_purge(Mod).
+is_dir(Path) ->
+ case erl_prim_loader:read_file_info(Path) of
+ {ok,#file_info{type=directory}} -> true;
+ _ -> false
+ end.
%%%
%%% Loading of multiple modules in parallel.
@@ -1299,59 +1321,78 @@ run([F|Fs], Data0) ->
%% The on_load functionality.
%% -------------------------------------------------------
-handle_on_load(Mod, File, {From,_}, #state{on_load=OnLoad0}=St0) ->
+handle_on_load({error,on_load}, Action, Mod, From, St0) ->
+ #state{on_load=OnLoad0} = St0,
Fun = fun() ->
Res = erlang:call_on_load_function(Mod),
exit(Res)
end,
- {_,Ref} = spawn_monitor(Fun),
- OnLoad = [{Ref,Mod,File,[From]}|OnLoad0],
+ PidRef = spawn_monitor(Fun),
+ PidAction = {From,Action},
+ OnLoad = [{PidRef,Mod,[PidAction]}|OnLoad0],
St = St0#state{on_load=OnLoad},
- {noreply,St}.
+ {noreply,St};
+handle_on_load(Res, Action, _, _, St) ->
+ Action(Res, St).
-pending_on_load(_, _, #state{on_load=[]}) ->
- no;
-pending_on_load(Mod, From, #state{on_load=OnLoad0}=St) ->
- case lists:keymember(Mod, 2, OnLoad0) of
+handle_pending_on_load(Action, Mod, From, #state{on_load=OnLoad0}=St) ->
+ case lists:keyfind(Mod, 2, OnLoad0) of
false ->
- no;
- true ->
- OnLoad = pending_on_load_1(Mod, From, OnLoad0),
- {yes,St#state{on_load=OnLoad}}
+ Action(ok, St);
+ {{From,_Ref},Mod,_Pids} ->
+ %% The on_load function tried to make an external
+ %% call to its own module. That would be a deadlock.
+ %% Fail the call. (The call is probably from error_handler,
+ %% and it will ignore the actual error reason and cause
+ %% an undef execption.)
+ {reply,{error,deadlock},St};
+ {_,_,_} ->
+ OnLoad = handle_pending_on_load_1(Mod, {From,Action}, OnLoad0),
+ {noreply,St#state{on_load=OnLoad}}
end.
-pending_on_load_1(Mod, From, [{Ref,Mod,File,Pids}|T]) ->
- [{Ref,Mod,File,[From|Pids]}|T];
-pending_on_load_1(Mod, From, [H|T]) ->
- [H|pending_on_load_1(Mod, From, T)];
-pending_on_load_1(_, _, []) -> [].
+handle_pending_on_load_1(Mod, From, [{PidRef,Mod,Pids}|T]) ->
+ [{PidRef,Mod,[From|Pids]}|T];
+handle_pending_on_load_1(Mod, From, [H|T]) ->
+ [H|handle_pending_on_load_1(Mod, From, T)];
+handle_pending_on_load_1(_, _, []) -> [].
-finish_on_load(Ref, OnLoadRes, #state{on_load=OnLoad0,moddb=Db}=State) ->
- case lists:keyfind(Ref, 1, OnLoad0) of
+finish_on_load(PidRef, OnLoadRes, #state{on_load=OnLoad0}=St0) ->
+ case lists:keyfind(PidRef, 1, OnLoad0) of
false ->
%% Since this process in general silently ignores messages
%% it doesn't understand, it should also ignore a 'DOWN'
%% message with an unknown reference.
- State;
- {Ref,Mod,File,WaitingPids} ->
- finish_on_load_1(Mod, File, OnLoadRes, WaitingPids, Db),
- OnLoad = [E || {R,_,_,_}=E <- OnLoad0, R =/= Ref],
- State#state{on_load=OnLoad}
+ St0;
+ {PidRef,Mod,Waiting} ->
+ St = finish_on_load_1(Mod, OnLoadRes, Waiting, St0),
+ OnLoad = [E || {R,_,_}=E <- OnLoad0, R =/= PidRef],
+ St#state{on_load=OnLoad}
end.
-finish_on_load_1(Mod, File, OnLoadRes, WaitingPids, Db) ->
+finish_on_load_1(Mod, OnLoadRes, Waiting, St) ->
Keep = OnLoadRes =:= ok,
erlang:finish_after_on_load(Mod, Keep),
Res = case Keep of
false ->
_ = finish_on_load_report(Mod, OnLoadRes),
+ _ = erts_code_purger:purge(Mod),
{error,on_load_failure};
true ->
- ets:insert(Db, {Mod,File}),
{module,Mod}
end,
- _ = [reply(Pid, Res) || Pid <- WaitingPids],
- ok.
+ finish_on_load_2(Waiting, Res, St).
+
+finish_on_load_2([{Pid,Action}|T], Res, St0) ->
+ case Action(Res, St0) of
+ {reply,Rep,St} ->
+ _ = reply(Pid, Rep),
+ finish_on_load_2(T, Res, St);
+ {noreply,St} ->
+ finish_on_load_2(T, Res, St)
+ end;
+finish_on_load_2([], _, St) ->
+ St.
finish_on_load_report(_Mod, Atom) when is_atom(Atom) ->
%% No error reports for atoms.
diff --git a/lib/kernel/src/disk_log_server.erl b/lib/kernel/src/disk_log_server.erl
index 735f1e5ceb..78c15d0ad8 100644
--- a/lib/kernel/src/disk_log_server.erl
+++ b/lib/kernel/src/disk_log_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/disk_log_sup.erl b/lib/kernel/src/disk_log_sup.erl
index c09b3f94d1..db5e3ecb3a 100644
--- a/lib/kernel/src/disk_log_sup.erl
+++ b/lib/kernel/src/disk_log_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/dist_ac.erl b/lib/kernel/src/dist_ac.erl
index f649f33a53..6c2fa0b6b1 100644
--- a/lib/kernel/src/dist_ac.erl
+++ b/lib/kernel/src/dist_ac.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/dist_util.erl b/lib/kernel/src/dist_util.erl
index c9fc26d62c..47d0c1b861 100644
--- a/lib/kernel/src/dist_util.erl
+++ b/lib/kernel/src/dist_util.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -118,7 +118,8 @@ make_this_flags(RequestType, OtherNode) ->
?DFLAG_DIST_HDR_ATOM_CACHE bor
?DFLAG_SMALL_ATOM_TAGS bor
?DFLAG_UTF8_ATOMS bor
- ?DFLAG_MAP_TAG).
+ ?DFLAG_MAP_TAG bor
+ ?DFLAG_BIG_CREATION).
handshake_other_started(#hs_data{request_type=ReqType}=HSData0) ->
{PreOtherFlags,Node,Version} = recv_name(HSData0),
@@ -155,7 +156,7 @@ is_allowed(#hs_data{other_node = Node,
send_status(HSData, not_allowed),
error_msg("** Connection attempt from "
"disallowed node ~w ** ~n", [Node]),
- ?shutdown(Node);
+ ?shutdown2(Node, {is_allowed, not_allowed});
_ -> true
end.
@@ -196,7 +197,7 @@ check_dflag_xnc(#hs_data{other_node = Node,
error_msg("** ~w: Connection attempt ~s node ~w ~s "
"since it cannot handle extended ~s. "
"**~n", [node(), Dir, Node, How, What]),
- ?shutdown(Node)
+ ?shutdown2(Node, {check_dflag_xnc_failed, What})
end.
@@ -576,13 +577,13 @@ recv_challenge(#hs_data{socket=Socket,other_node=Node,
[Node, Challenge,Version]),
{Flags,Challenge};
_ ->
- ?shutdown(no_node)
+ ?shutdown2(no_node, {recv_challenge_failed, no_node, Ns})
catch
error:badarg ->
- ?shutdown(no_node)
+ ?shutdown2(no_node, {recv_challenge_failed, no_node, Ns})
end;
- _ ->
- ?shutdown(no_node)
+ Other ->
+ ?shutdown2(no_node, {recv_challenge_failed, Other})
end.
@@ -606,10 +607,10 @@ recv_challenge_reply(#hs_data{socket = Socket,
_ ->
error_msg("** Connection attempt from "
"disallowed node ~w ** ~n", [NodeB]),
- ?shutdown(NodeB)
+ ?shutdown2(NodeB, {recv_challenge_reply_failed, bad_cookie})
end;
- _ ->
- ?shutdown(no_node)
+ Other ->
+ ?shutdown2(no_node, {recv_challenge_reply_failed, Other})
end.
recv_challenge_ack(#hs_data{socket = Socket, f_recv = FRecv,
@@ -626,10 +627,10 @@ recv_challenge_ack(#hs_data{socket = Socket, f_recv = FRecv,
_ ->
error_msg("** Connection attempt to "
"disallowed node ~w ** ~n", [NodeB]),
- ?shutdown(NodeB)
+ ?shutdown2(NodeB, {recv_challenge_ack_failed, bad_cookie})
end;
- _ ->
- ?shutdown(NodeB)
+ Other ->
+ ?shutdown2(NodeB, {recv_challenge_ack_failed, Other})
end.
recv_status(#hs_data{kernel_pid = Kernel, socket = Socket,
@@ -639,7 +640,7 @@ recv_status(#hs_data{kernel_pid = Kernel, socket = Socket,
Stat = list_to_atom(StrStat),
?debug({dist_util,self(),recv_status, Node, Stat}),
case Stat of
- not_allowed -> ?shutdown(Node);
+ not_allowed -> ?shutdown2(Node, {recv_status_failed, not_allowed});
nok ->
%% wait to be killed by net_kernel
receive
@@ -656,10 +657,10 @@ recv_status(#hs_data{kernel_pid = Kernel, socket = Socket,
end;
_ -> Stat
end;
- _Error ->
+ Error ->
?debug({dist_util,self(),recv_status_error,
- Node, _Error}),
- ?shutdown(Node)
+ Node, Error}),
+ ?shutdown2(Node, {recv_status_failed, Error})
end.
@@ -758,7 +759,7 @@ setup_timer(Pid, Timeout) ->
setup_timer(Pid, Timeout)
after Timeout ->
?trace("Timer expires ~p, ~p~n",[Pid, Timeout]),
- ?shutdown(timer)
+ ?shutdown2(timer, setup_timer_timeout)
end.
reset_timer(Timer) ->
diff --git a/lib/kernel/src/erl_boot_server.erl b/lib/kernel/src/erl_boot_server.erl
index 4076fab86d..ac81cc9689 100644
--- a/lib/kernel/src/erl_boot_server.erl
+++ b/lib/kernel/src/erl_boot_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/erl_ddll.erl b/lib/kernel/src/erl_ddll.erl
index 6180510bdd..89a02cc762 100644
--- a/lib/kernel/src/erl_ddll.erl
+++ b/lib/kernel/src/erl_ddll.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/erl_distribution.erl b/lib/kernel/src/erl_distribution.erl
index 559e2a853b..0bec78e938 100644
--- a/lib/kernel/src/erl_distribution.erl
+++ b/lib/kernel/src/erl_distribution.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/erl_epmd.erl b/lib/kernel/src/erl_epmd.erl
index c6202dd796..f8ef4a475d 100644
--- a/lib/kernel/src/erl_epmd.erl
+++ b/lib/kernel/src/erl_epmd.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/erl_epmd.hrl b/lib/kernel/src/erl_epmd.hrl
index f3585fea5e..3efcc81b55 100644
--- a/lib/kernel/src/erl_epmd.hrl
+++ b/lib/kernel/src/erl_epmd.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/erl_reply.erl b/lib/kernel/src/erl_reply.erl
index ba046980f6..e1e046cbb4 100644
--- a/lib/kernel/src/erl_reply.erl
+++ b/lib/kernel/src/erl_reply.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/error_handler.erl b/lib/kernel/src/error_handler.erl
index 095e1163f7..59ca8e690d 100644
--- a/lib/kernel/src/error_handler.erl
+++ b/lib/kernel/src/error_handler.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/error_logger.erl b/lib/kernel/src/error_logger.erl
index 30a9457bb3..3523f680a3 100644
--- a/lib/kernel/src/error_logger.erl
+++ b/lib/kernel/src/error_logger.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/erts_debug.erl b/lib/kernel/src/erts_debug.erl
index 8e2b5ad214..7b3f1e313a 100644
--- a/lib/kernel/src/erts_debug.erl
+++ b/lib/kernel/src/erts_debug.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/file.erl b/lib/kernel/src/file.erl
index 1007f04413..58b601e456 100644
--- a/lib/kernel/src/file.erl
+++ b/lib/kernel/src/file.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1227,7 +1227,8 @@ change_time(Name, {{AY, AM, AD}, {AH, AMin, ASec}}=Atime,
%% Send data using sendfile
%%
--define(MAX_CHUNK_SIZE, (1 bsl 20)*20). %% 20 MB, has to fit in primary memory
+%% 1 MB, Windows seems to behave badly if it is much larger then this
+-define(MAX_CHUNK_SIZE, (1 bsl 20)).
-spec sendfile(RawFile, Socket, Offset, Bytes, Opts) ->
{'ok', non_neg_integer()} | {'error', inet:posix() |
diff --git a/lib/kernel/src/file_server.erl b/lib/kernel/src/file_server.erl
index 6df6be7d06..6504174cbc 100644
--- a/lib/kernel/src/file_server.erl
+++ b/lib/kernel/src/file_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/gen_sctp.erl b/lib/kernel/src/gen_sctp.erl
index a47535b2f8..d00ed828a7 100644
--- a/lib/kernel/src/gen_sctp.erl
+++ b/lib/kernel/src/gen_sctp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/gen_tcp.erl b/lib/kernel/src/gen_tcp.erl
index 8cb2a725e8..1f0d44b8e1 100644
--- a/lib/kernel/src/gen_tcp.erl
+++ b/lib/kernel/src/gen_tcp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/gen_udp.erl b/lib/kernel/src/gen_udp.erl
index 6698d5f0fa..5e85c61dd9 100644
--- a/lib/kernel/src/gen_udp.erl
+++ b/lib/kernel/src/gen_udp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/global_group.erl b/lib/kernel/src/global_group.erl
index e71f83f9d3..8ac0bd9551 100644
--- a/lib/kernel/src/global_group.erl
+++ b/lib/kernel/src/global_group.erl
@@ -692,7 +692,7 @@ handle_cast({registered_names, User}, S) ->
handle_cast({registered_names_res, Result, Pid, From}, S) ->
% io:format(">>>>> registered_names_res Result ~p~n",[Result]),
unlink(Pid),
- exit(Pid, normal),
+ Pid ! kill,
Wait = get(registered_names),
NewWait = lists:delete({Pid, From},Wait),
put(registered_names, NewWait),
@@ -718,7 +718,7 @@ handle_cast({send_res, Result, Name, Msg, Pid, From}, S) ->
ToPid ! Msg
end,
unlink(Pid),
- exit(Pid, normal),
+ Pid ! kill,
Wait = get(send),
NewWait = lists:delete({Pid, From, Name, Msg},Wait),
put(send, NewWait),
@@ -748,7 +748,7 @@ handle_cast({find_name_res, Result, Pid, From}, S) ->
% io:format(">>>>> find_name_res Result ~p~n",[Result]),
% io:format(">>>>> find_name_res get() ~p~n",[get()]),
unlink(Pid),
- exit(Pid, normal),
+ Pid ! kill,
Wait = get(whereis_name),
NewWait = lists:delete({Pid, From},Wait),
put(whereis_name, NewWait),
diff --git a/lib/kernel/src/global_search.erl b/lib/kernel/src/global_search.erl
index 9429295bdb..11b70113e2 100644
--- a/lib/kernel/src/global_search.erl
+++ b/lib/kernel/src/global_search.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/group.erl b/lib/kernel/src/group.erl
index ea0734e0c9..b5e73117dd 100644
--- a/lib/kernel/src/group.erl
+++ b/lib/kernel/src/group.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet6_sctp.erl b/lib/kernel/src/inet6_sctp.erl
index 5934c269fa..cc98bc0ccb 100644
--- a/lib/kernel/src/inet6_sctp.erl
+++ b/lib/kernel/src/inet6_sctp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet6_tcp.erl b/lib/kernel/src/inet6_tcp.erl
index 1978307b3c..3dfe5dfc86 100644
--- a/lib/kernel/src/inet6_tcp.erl
+++ b/lib/kernel/src/inet6_tcp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet6_tcp_dist.erl b/lib/kernel/src/inet6_tcp_dist.erl
index 3ab7f269bb..3aa61973af 100644
--- a/lib/kernel/src/inet6_tcp_dist.erl
+++ b/lib/kernel/src/inet6_tcp_dist.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet6_udp.erl b/lib/kernel/src/inet6_udp.erl
index 61c74bf14f..eb6945f60a 100644
--- a/lib/kernel/src/inet6_udp.erl
+++ b/lib/kernel/src/inet6_udp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet_boot.hrl b/lib/kernel/src/inet_boot.hrl
index ec0d4064e5..adeda604e6 100644
--- a/lib/kernel/src/inet_boot.hrl
+++ b/lib/kernel/src/inet_boot.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet_config.erl b/lib/kernel/src/inet_config.erl
index a0d5344f11..4bbc520449 100644
--- a/lib/kernel/src/inet_config.erl
+++ b/lib/kernel/src/inet_config.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet_config.hrl b/lib/kernel/src/inet_config.hrl
index 7faae8d127..b22ee0f598 100644
--- a/lib/kernel/src/inet_config.hrl
+++ b/lib/kernel/src/inet_config.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet_db.erl b/lib/kernel/src/inet_db.erl
index 108a803610..465cec1b45 100644
--- a/lib/kernel/src/inet_db.erl
+++ b/lib/kernel/src/inet_db.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1206,7 +1206,8 @@ handle_set_file(Option, Fname, TagTm, TagInfo, ParseFun, From,
File = filename:flatten(Fname),
ets:insert(Db, {res_optname(Option), File}),
ets:insert(Db, {TagInfo, undefined}),
- ets:insert(Db, {TagTm, 0}),
+ TimeZero = - (?RES_FILE_UPDATE_TM + 1), % Early enough
+ ets:insert(Db, {TagTm, TimeZero}),
{reply,ok,State};
true ->
File = filename:flatten(Fname),
diff --git a/lib/kernel/src/inet_dns.erl b/lib/kernel/src/inet_dns.erl
index f344b26228..d5f982cc51 100644
--- a/lib/kernel/src/inet_dns.erl
+++ b/lib/kernel/src/inet_dns.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet_dns.hrl b/lib/kernel/src/inet_dns.hrl
index d1b01bb9c4..07226bbf5c 100644
--- a/lib/kernel/src/inet_dns.hrl
+++ b/lib/kernel/src/inet_dns.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet_dns_record_adts.pl b/lib/kernel/src/inet_dns_record_adts.pl
index 6d719d836e..c89d837098 100644
--- a/lib/kernel/src/inet_dns_record_adts.pl
+++ b/lib/kernel/src/inet_dns_record_adts.pl
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2011. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet_gethost_native.erl b/lib/kernel/src/inet_gethost_native.erl
index 53294810af..9e76c08365 100644
--- a/lib/kernel/src/inet_gethost_native.erl
+++ b/lib/kernel/src/inet_gethost_native.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet_hosts.erl b/lib/kernel/src/inet_hosts.erl
index e8457fd9d6..0bdf00ac30 100644
--- a/lib/kernel/src/inet_hosts.erl
+++ b/lib/kernel/src/inet_hosts.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet_int.hrl b/lib/kernel/src/inet_int.hrl
index e7c6cf8ae2..65d78b66c9 100644
--- a/lib/kernel/src/inet_int.hrl
+++ b/lib/kernel/src/inet_int.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet_parse.erl b/lib/kernel/src/inet_parse.erl
index 877745ed55..b0a3ee3008 100644
--- a/lib/kernel/src/inet_parse.erl
+++ b/lib/kernel/src/inet_parse.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet_res.erl b/lib/kernel/src/inet_res.erl
index e6988ac79b..90e49ddfdf 100644
--- a/lib/kernel/src/inet_res.erl
+++ b/lib/kernel/src/inet_res.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet_res.hrl b/lib/kernel/src/inet_res.hrl
index c77fe30e7a..774b4074a5 100644
--- a/lib/kernel/src/inet_res.hrl
+++ b/lib/kernel/src/inet_res.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet_sctp.erl b/lib/kernel/src/inet_sctp.erl
index 88c8d24143..60677cb7de 100644
--- a/lib/kernel/src/inet_sctp.erl
+++ b/lib/kernel/src/inet_sctp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet_tcp.erl b/lib/kernel/src/inet_tcp.erl
index f551af9709..ee885af3b0 100644
--- a/lib/kernel/src/inet_tcp.erl
+++ b/lib/kernel/src/inet_tcp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/inet_udp.erl b/lib/kernel/src/inet_udp.erl
index 5b2e5120c9..7e8d9cdb72 100644
--- a/lib/kernel/src/inet_udp.erl
+++ b/lib/kernel/src/inet_udp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/kernel.app.src b/lib/kernel/src/kernel.app.src
index 7452c6bc98..15e0ec02a9 100644
--- a/lib/kernel/src/kernel.app.src
+++ b/lib/kernel/src/kernel.app.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/kernel.appup.src b/lib/kernel/src/kernel.appup.src
index a13819a183..d16e200cb3 100644
--- a/lib/kernel/src/kernel.appup.src
+++ b/lib/kernel/src/kernel.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/kernel.erl b/lib/kernel/src/kernel.erl
index 40544da6c3..3d0ef81318 100644
--- a/lib/kernel/src/kernel.erl
+++ b/lib/kernel/src/kernel.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/kernel_config.erl b/lib/kernel/src/kernel_config.erl
index c65728aa53..535083ef27 100644
--- a/lib/kernel/src/kernel_config.erl
+++ b/lib/kernel/src/kernel_config.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/net.erl b/lib/kernel/src/net.erl
index f058042bdd..2d0ae2ed0c 100644
--- a/lib/kernel/src/net.erl
+++ b/lib/kernel/src/net.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/net_adm.erl b/lib/kernel/src/net_adm.erl
index e6a81126c2..a38356c224 100644
--- a/lib/kernel/src/net_adm.erl
+++ b/lib/kernel/src/net_adm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/net_kernel.erl b/lib/kernel/src/net_kernel.erl
index a19c116388..ac19f4935b 100644
--- a/lib/kernel/src/net_kernel.erl
+++ b/lib/kernel/src/net_kernel.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/os.erl b/lib/kernel/src/os.erl
index 4947088635..f0ad26b1f2 100644
--- a/lib/kernel/src/os.erl
+++ b/lib/kernel/src/os.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/pg2.erl b/lib/kernel/src/pg2.erl
index ab98181b2a..edf4aedde2 100644
--- a/lib/kernel/src/pg2.erl
+++ b/lib/kernel/src/pg2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/ram_file.erl b/lib/kernel/src/ram_file.erl
index df335f7a8e..e427d130b7 100644
--- a/lib/kernel/src/ram_file.erl
+++ b/lib/kernel/src/ram_file.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/rpc.erl b/lib/kernel/src/rpc.erl
index b9284487d2..21bff02214 100644
--- a/lib/kernel/src/rpc.erl
+++ b/lib/kernel/src/rpc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -52,10 +52,6 @@
parallel_eval/1,
pmap/3, pinfo/1, pinfo/2]).
-%% Deprecated calls.
--deprecated([{safe_multi_server_call,2},{safe_multi_server_call,3}]).
--export([safe_multi_server_call/2,safe_multi_server_call/3]).
-
%% gen_server exports
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
@@ -67,7 +63,7 @@
%%------------------------------------------------------------------------
--type state() :: gb_trees:tree(pid(), {pid(), reference()}).
+-type state() :: map().
%%------------------------------------------------------------------------
@@ -95,7 +91,7 @@ stop(Rpc) ->
init([]) ->
process_flag(trap_exit, true),
- {ok, gb_trees:empty()}.
+ {ok, maps:new()}.
-spec handle_call(term(), term(), state()) ->
{'noreply', state()} |
@@ -134,29 +130,15 @@ handle_cast(_, S) ->
-spec handle_info(term(), state()) -> {'noreply', state()}.
+handle_info({'DOWN', _, process, Caller, normal}, S) ->
+ {noreply, maps:remove(Caller, S)};
handle_info({'DOWN', _, process, Caller, Reason}, S) ->
- case gb_trees:lookup(Caller, S) of
- {value, To} ->
- receive
- {Caller, {reply, Reply}} ->
- gen_server:reply(To, Reply)
- after 0 ->
- gen_server:reply(To, {badrpc, {'EXIT', Reason}})
- end,
- {noreply, gb_trees:delete(Caller, S)};
- none ->
- {noreply, S}
- end;
-handle_info({Caller, {reply, Reply}}, S) ->
- case gb_trees:lookup(Caller, S) of
- {value, To} ->
- receive
- {'DOWN', _, process, Caller, _} ->
- gen_server:reply(To, Reply),
- {noreply, gb_trees:delete(Caller, S)}
- end;
- none ->
- {noreply, S}
+ case maps:get(Caller, S, undefined) of
+ undefined ->
+ {noreply, S};
+ {_, _} = To ->
+ gen_server:reply(To, {badrpc, {'EXIT', Reason}}),
+ {noreply, maps:remove(Caller, S)}
end;
handle_info({From, {sbcast, Name, Msg}}, S) ->
_ = case catch Name ! Msg of %% use catch to get the printout
@@ -194,7 +176,6 @@ code_change(_, S, _) ->
%% Auxiliary function to avoid a false dialyzer warning -- do not inline
%%
handle_call_call(Mod, Fun, Args, Gleader, To, S) ->
- RpcServer = self(),
%% Spawn not to block the rpc server.
{Caller,_} =
erlang:spawn_monitor(
@@ -209,9 +190,9 @@ handle_call_call(Mod, Fun, Args, Gleader, To, S) ->
Result ->
Result
end,
- RpcServer ! {self(), {reply, Reply}}
+ gen_server:reply(To, Reply)
end),
- {noreply, gb_trees:insert(Caller, To, S)}.
+ {noreply, maps:put(Caller, To, S)}.
%% RPC aid functions ....
@@ -591,27 +572,6 @@ multi_server_call(Nodes, Name, Msg)
Monitors = send_nodes(Nodes, Name, Msg, []),
rec_nodes(Name, Monitors).
-%% Deprecated functions. Were only needed when communicating with R6 nodes.
-
--spec safe_multi_server_call(Name, Msg) -> {Replies, BadNodes} when
- Name :: atom(),
- Msg :: term(),
- Replies :: [Reply :: term()],
- BadNodes :: [node()].
-
-safe_multi_server_call(Name, Msg) ->
- multi_server_call(Name, Msg).
-
--spec safe_multi_server_call(Nodes, Name, Msg) -> {Replies, BadNodes} when
- Nodes :: [node()],
- Name :: atom(),
- Msg :: term(),
- Replies :: [Reply :: term()],
- BadNodes :: [node()].
-
-safe_multi_server_call(Nodes, Name, Msg) ->
- multi_server_call(Nodes, Name, Msg).
-
rec_nodes(Name, Nodes) ->
rec_nodes(Name, Nodes, [], []).
@@ -752,6 +712,11 @@ pinfo(Pid) ->
-spec pinfo(Pid, Item) -> {Item, Info} | undefined | [] when
Pid :: pid(),
Item :: atom(),
+ Info :: term();
+ (Pid, ItemList) -> [{Item, Info}] | undefined | [] when
+ Pid :: pid(),
+ Item :: atom(),
+ ItemList :: [Item],
Info :: term().
pinfo(Pid, Item) when node(Pid) =:= node() ->
diff --git a/lib/kernel/src/seq_trace.erl b/lib/kernel/src/seq_trace.erl
index a7a782c29c..cc0c10909b 100644
--- a/lib/kernel/src/seq_trace.erl
+++ b/lib/kernel/src/seq_trace.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -106,14 +106,24 @@ reset_trace() ->
%% reset_trace(Pid) -> % this might be a useful function too
--type tracer() :: (Pid :: pid()) | port() | 'false'.
+-type tracer() :: (Pid :: pid()) | port() |
+ (TracerModule :: {module(), term()}) |
+ 'false'.
-spec set_system_tracer(Tracer) -> OldTracer when
Tracer :: tracer(),
OldTracer :: tracer().
-set_system_tracer(Pid) ->
- erlang:system_flag(sequential_tracer, Pid).
+set_system_tracer({Module, State} = Tracer) ->
+ case erlang:module_loaded(Module) of
+ false ->
+ Module:enabled(trace_status, erlang:self(), State);
+ true ->
+ ok
+ end,
+ erlang:system_flag(sequential_tracer, Tracer);
+set_system_tracer(Tracer) ->
+ erlang:system_flag(sequential_tracer, Tracer).
-spec get_system_tracer() -> Tracer when
Tracer :: tracer().
diff --git a/lib/kernel/src/standard_error.erl b/lib/kernel/src/standard_error.erl
index 74dd004fa6..5d649e5f94 100644
--- a/lib/kernel/src/standard_error.erl
+++ b/lib/kernel/src/standard_error.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/user.erl b/lib/kernel/src/user.erl
index 77781e0251..a5cc7b0ec1 100644
--- a/lib/kernel/src/user.erl
+++ b/lib/kernel/src/user.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/user_sup.erl b/lib/kernel/src/user_sup.erl
index 72c3fad3a9..c1fb1b1a48 100644
--- a/lib/kernel/src/user_sup.erl
+++ b/lib/kernel/src/user_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/src/wrap_log_reader.erl b/lib/kernel/src/wrap_log_reader.erl
index 6622405d85..3a984e56c7 100644
--- a/lib/kernel/src/wrap_log_reader.erl
+++ b/lib/kernel/src/wrap_log_reader.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/Makefile b/lib/kernel/test/Makefile
index 7b233741e0..b9942e899f 100644
--- a/lib/kernel/test/Makefile
+++ b/lib/kernel/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2013. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/appinc1.erl b/lib/kernel/test/appinc1.erl
index fc9180b35a..b571208834 100644
--- a/lib/kernel/test/appinc1.erl
+++ b/lib/kernel/test/appinc1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/appinc1x.erl b/lib/kernel/test/appinc1x.erl
index b05cd55b43..3aa6f3dcb9 100644
--- a/lib/kernel/test/appinc1x.erl
+++ b/lib/kernel/test/appinc1x.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/appinc2.erl b/lib/kernel/test/appinc2.erl
index 7e92e7e092..a665e628a2 100644
--- a/lib/kernel/test/appinc2.erl
+++ b/lib/kernel/test/appinc2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/appinc2A.erl b/lib/kernel/test/appinc2A.erl
index f0e2cd4277..378eb179f2 100644
--- a/lib/kernel/test/appinc2A.erl
+++ b/lib/kernel/test/appinc2A.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/appinc2B.erl b/lib/kernel/test/appinc2B.erl
index 17623621bb..35b7016906 100644
--- a/lib/kernel/test/appinc2B.erl
+++ b/lib/kernel/test/appinc2B.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/appinc2top.erl b/lib/kernel/test/appinc2top.erl
index f3d9715a2a..3b6dc4ea31 100644
--- a/lib/kernel/test/appinc2top.erl
+++ b/lib/kernel/test/appinc2top.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/application_SUITE.erl b/lib/kernel/test/application_SUITE.erl
index a0a7632d1b..81407e9d96 100644
--- a/lib/kernel/test/application_SUITE.erl
+++ b/lib/kernel/test/application_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/application_SUITE_data/app_start_error.erl b/lib/kernel/test/application_SUITE_data/app_start_error.erl
index 531a10d442..aedcb537d8 100644
--- a/lib/kernel/test/application_SUITE_data/app_start_error.erl
+++ b/lib/kernel/test/application_SUITE_data/app_start_error.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/application_SUITE_data/group_leader.erl b/lib/kernel/test/application_SUITE_data/group_leader.erl
index e791437272..f18cef179b 100644
--- a/lib/kernel/test/application_SUITE_data/group_leader.erl
+++ b/lib/kernel/test/application_SUITE_data/group_leader.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/application_SUITE_data/group_leader_sup.erl b/lib/kernel/test/application_SUITE_data/group_leader_sup.erl
index ade8de8470..6e0df632c3 100644
--- a/lib/kernel/test/application_SUITE_data/group_leader_sup.erl
+++ b/lib/kernel/test/application_SUITE_data/group_leader_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/application_SUITE_data/trans_abnormal_sup.erl b/lib/kernel/test/application_SUITE_data/trans_abnormal_sup.erl
index 98d7e90235..bc2bf84089 100644
--- a/lib/kernel/test/application_SUITE_data/trans_abnormal_sup.erl
+++ b/lib/kernel/test/application_SUITE_data/trans_abnormal_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/application_SUITE_data/trans_normal_sup.erl b/lib/kernel/test/application_SUITE_data/trans_normal_sup.erl
index 233a79d8c3..c839888e39 100644
--- a/lib/kernel/test/application_SUITE_data/trans_normal_sup.erl
+++ b/lib/kernel/test/application_SUITE_data/trans_normal_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/application_SUITE_data/transient.erl b/lib/kernel/test/application_SUITE_data/transient.erl
index a58bc4600e..83cdacf673 100644
--- a/lib/kernel/test/application_SUITE_data/transient.erl
+++ b/lib/kernel/test/application_SUITE_data/transient.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/bif_SUITE.erl b/lib/kernel/test/bif_SUITE.erl
index 54c0f1cec4..2369dd8b71 100644
--- a/lib/kernel/test/bif_SUITE.erl
+++ b/lib/kernel/test/bif_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/ch.erl b/lib/kernel/test/ch.erl
index ba8aa9f05a..c9f378e387 100644
--- a/lib/kernel/test/ch.erl
+++ b/lib/kernel/test/ch.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/ch_sup.erl b/lib/kernel/test/ch_sup.erl
index a297b60200..1d7f17fc95 100644
--- a/lib/kernel/test/ch_sup.erl
+++ b/lib/kernel/test/ch_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/cleanup.erl b/lib/kernel/test/cleanup.erl
index 26000b545f..db738c167e 100644
--- a/lib/kernel/test/cleanup.erl
+++ b/lib/kernel/test/cleanup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl
index abea23e854..8da67c89f8 100644
--- a/lib/kernel/test/code_SUITE.erl
+++ b/lib/kernel/test/code_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
-module(code_SUITE).
-include_lib("common_test/include/ct.hrl").
+-include_lib("syntax_tools/include/merl.hrl").
-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]).
-export([set_path/1, get_path/1, add_path/1, add_paths/1, del_path/1,
@@ -33,7 +34,9 @@
where_is_file/1,
purge_stacktrace/1, mult_lib_roots/1, bad_erl_libs/1,
code_archive/1, code_archive2/1, on_load/1, on_load_binary/1,
- on_load_embedded/1, on_load_errors/1, big_boot_embedded/1,
+ on_load_embedded/1, on_load_errors/1, on_load_update/1,
+ on_load_purge/1, on_load_self_call/1, on_load_pending/1,
+ big_boot_embedded/1,
native_early_modules/1, get_mode/1,
normalized_paths/1]).
@@ -61,7 +64,8 @@ all() ->
ext_mod_dep, clash, where_is_file,
purge_stacktrace, mult_lib_roots,
bad_erl_libs, code_archive, code_archive2, on_load,
- on_load_binary, on_load_embedded, on_load_errors,
+ on_load_binary, on_load_embedded, on_load_errors, on_load_update,
+ on_load_purge, on_load_self_call, on_load_pending,
big_boot_embedded, native_early_modules, get_mode, normalized_paths].
groups() ->
@@ -826,6 +830,12 @@ check_funs({'$M_EXPR',warning_msg,2},
[{code_server,finish_on_load_report,2} | _]) -> 0;
check_funs({'$M_EXPR','$F_EXPR',1},
[{code_server,run,2}|_]) -> 0;
+check_funs({'$M_EXPR','$F_EXPR',2},
+ [{code_server,handle_on_load,5}|_]) -> 0;
+check_funs({'$M_EXPR','$F_EXPR',2},
+ [{code_server,handle_pending_on_load,4}|_]) -> 0;
+check_funs({'$M_EXPR','$F_EXPR',2},
+ [{code_server,finish_on_load_2,3}|_]) -> 0;
%% This is cheating! /raimo
%%
%% check_funs(This = {M,_,_}, Path) ->
@@ -1023,6 +1033,12 @@ do_code_archive(Config, Root, StripVsn) when is_list(Config) ->
{ok, _} = zip:create(Archive, [Base],
[{compress, []}, {cwd, PrivDir}]),
+ %% Create a directory and a file outside of the archive.
+ OtherFile = filename:join([RootDir,VsnBase,"other","other.txt"]),
+ OtherContents = ?MODULE:module_info(md5),
+ filelib:ensure_dir(OtherFile),
+ ok = file:write_file(OtherFile, OtherContents),
+
%% Set up ERL_LIBS and start a slave node.
{ok, Node} =
test_server:start_node(code_archive, slave,
@@ -1037,13 +1053,25 @@ do_code_archive(Config, Root, StripVsn) when is_list(Config) ->
%% Start the app
ok = rpc:call(Node, application, start, [App]),
+ %% Get the lib dir for the app.
+ AppLibDir = rpc:call(Node, code, lib_dir, [App]),
+ io:format("AppLibDir: ~p\n", [AppLibDir]),
+ AppLibDir = filename:join(RootDir, VsnBase),
+
%% Access the app priv dir
AppPrivDir = rpc:call(Node, code, priv_dir, [App]),
AppPrivFile = filename:join([AppPrivDir, "code_archive.txt"]),
io:format("AppPrivFile: ~p\n", [AppPrivFile]),
- {ok, _Bin, _Path} =
+ {ok, _Bin, _} =
rpc:call(Node, erl_prim_loader, get_file, [AppPrivFile]),
+ %% Read back the other text file.
+ OtherDirPath = rpc:call(Node, code, lib_dir, [App,other]),
+ OtherFilePath = filename:join(OtherDirPath, "other.txt"),
+ io:format("OtherFilePath: ~p\n", [OtherFilePath]),
+ {ok, OtherContents, _} =
+ rpc:call(Node, erl_prim_loader, get_file, [OtherFilePath]),
+
%% Use the app
Tab = code_archive_tab,
Key = foo,
@@ -1166,22 +1194,17 @@ on_load_binary(_) ->
register(Master, self()),
%% Construct, compile and pretty-print.
- Mod = on_load_binary,
+ Mod = ?FUNCTION_NAME,
File = atom_to_list(Mod) ++ ".erl",
- Forms = [{attribute,1,file,{File,1}},
- {attribute,1,module,Mod},
- {attribute,2,export,[{ok,0}]},
- {attribute,3,on_load,{init,0}},
- {function,5,init,0,
- [{clause,5,[],[],
- [{op,6,'!',
- {atom,6,Master},
- {tuple,6,[{atom,6,Mod},{call,6,{atom,6,self},[]}]}},
- {'receive',7,[{clause,8,[{atom,8,go}],[],[{atom,8,ok}]}]}]}]},
- {function,11,ok,0,[{clause,11,[],[],[{atom,11,true}]}]}],
- Forms1 = erl_parse:new_anno(Forms),
- {ok,Mod,Bin} = compile:forms(Forms1, [report]),
- [io:put_chars(erl_pp:form(F)) || F <- Forms1],
+ Tree = ?Q(["-module('@Mod@').\n",
+ "-export([ok/0]).\n",
+ "-on_load({init,0}).\n",
+ "init() ->\n",
+ " '@Master@' ! {on_load_binary,self()},\n",
+ " receive go -> ok end.\n",
+ "ok() -> true.\n"]),
+ {ok,Mod,Bin} = merl:compile(Tree),
+ merl:print(Tree),
{Pid1,Ref1} = spawn_monitor(fun() ->
code:load_binary(Mod, File, Bin),
@@ -1221,6 +1244,9 @@ on_load_embedded_1(Config) ->
case file:make_symlink(OnLoadApp, LinkName) of
{error,enotsup} ->
throw({skip,"Support for symlinks required"});
+ {error,eperm} ->
+ %% On Windows, we may not have permissions to create symlinks.
+ throw({skip,"Support for symlinks required"});
ok -> ok
end,
@@ -1420,6 +1446,163 @@ do_on_load_error(ReturnValue) ->
{undef,[{on_load_error,main,[],_}|_]} = Exit
end.
+on_load_update(_Config) ->
+ {Mod,Code1} = on_load_update_code(1),
+ {module,Mod} = code:load_binary(Mod, "", Code1),
+ 42 = Mod:a(),
+ 100 = Mod:b(99),
+ 4 = erlang:trace_pattern({Mod,'_','_'}, true),
+
+ {Mod,Code2} = on_load_update_code(2),
+ {error,on_load_failure} = code:load_binary(Mod, "", Code2),
+ 42 = Mod:a(),
+ 100 = Mod:b(99),
+ {'EXIT',{undef,_}} = (catch Mod:never()),
+ 4 = erlang:trace_pattern({Mod,'_','_'}, false),
+
+ {Mod,Code3} = on_load_update_code(3),
+ {module,Mod} = code:load_binary(Mod, "", Code3),
+ 100 = Mod:c(),
+ {'EXIT',{undef,_}} = (catch Mod:a()),
+ {'EXIT',{undef,_}} = (catch Mod:b(10)),
+ {'EXIT',{undef,_}} = (catch Mod:never()),
+
+ ok.
+
+on_load_update_code(Version) ->
+ Mod = ?FUNCTION_NAME,
+ Tree = on_load_update_code_1(Version, Mod),
+ io:format("Version ~p", [Version]),
+ {ok,Mod,Code} = merl:compile(Tree),
+ merl:print(Tree),
+ io:nl(),
+ {Mod,Code}.
+
+on_load_update_code_1(1, Mod) ->
+ ?Q(["-module('@Mod@').\n",
+ "-export([a/0,b/1]).\n"
+ "-on_load(f/0).\n",
+ "f() -> ok.\n",
+ "a() -> 42.\n"
+ "b(I) -> I+1.\n"]);
+on_load_update_code_1(2, Mod) ->
+ ?Q(["-module('@Mod@').\n",
+ "-export([never/0]).\n"
+ "-on_load(f/0).\n",
+ "f() -> 42 = '@Mod@':a(), 1 = '@Mod@':b(0), fail.\n",
+ "never() -> never.\n"]);
+on_load_update_code_1(3, Mod) ->
+ ?Q(["-module('@Mod@').\n",
+ "-export([c/0]).\n"
+ "-on_load(f/0).\n",
+ "f() -> ok.\n",
+ "c() -> 100.\n"]).
+
+on_load_purge(_Config) ->
+ Mod = ?FUNCTION_NAME,
+ register(Mod, self()),
+ Tree = ?Q(["-module('@Mod@').\n",
+ "-on_load(f/0).\n",
+ "loop() -> loop().\n",
+ "f() ->\n",
+ "'@Mod@' ! {self(),spawn(fun loop/0)},\n",
+ "receive Ack -> Ack end.\n"]),
+ merl:print(Tree),
+ {ok,Mod,Code} = merl:compile(Tree),
+ P = spawn(fun() ->
+ exit(code:load_binary(Mod, "", Code))
+ end),
+ monitor(process, P),
+ receive
+ {Pid1,Pid2} ->
+ monitor(process, Pid2),
+ Pid1 ! ack_and_failure,
+ receive
+ {'DOWN',_,process,P,Exit1} ->
+ {error,on_load_failure} = Exit1
+ end,
+ receive
+ {'DOWN',_,process,Pid2,Exit2} ->
+ io:format("~p\n", [Exit2])
+ after 10000 ->
+ ct:fail(no_down_message)
+ end
+ end.
+
+on_load_self_call(_Config) ->
+ Mod = ?FUNCTION_NAME,
+ register(Mod, self()),
+ Tree = ?Q(["-module('@Mod@').\n",
+ "-export([ext/0]).\n",
+ "-on_load(f/0).\n",
+ "f() ->\n",
+ " '@Mod@' ! (catch '@Mod@':ext()),\n",
+ " ok.\n",
+ "ext() -> good_work.\n"]),
+ merl:print(Tree),
+ {ok,Mod,Code} = merl:compile(Tree),
+
+ {'EXIT',{undef,_}} = on_load_do_load(Mod, Code),
+ good_work = on_load_do_load(Mod, Code),
+
+ ok.
+
+on_load_do_load(Mod, Code) ->
+ spawn(fun() ->
+ {module,Mod} = code:load_binary(Mod, "", Code)
+ end),
+ receive
+ Any -> Any
+ end.
+
+on_load_pending(_Config) ->
+ Mod = ?FUNCTION_NAME,
+ Tree1 = ?Q(["-module('@Mod@').\n",
+ "-on_load(f/0).\n",
+ "f() ->\n",
+ " register('@Mod@', self()),\n",
+ " receive _ -> ok end.\n"]),
+ merl:print(Tree1),
+ {ok,Mod,Code1} = merl:compile(Tree1),
+
+ Tree2 = ?Q(["-module('@Mod@').\n",
+ "-export([t/0]).\n",
+ "t() -> ok.\n"]),
+ merl:print(Tree2),
+ {ok,Mod,Code2} = merl:compile(Tree2),
+
+ Self = self(),
+ {_,Ref1} =
+ spawn_monitor(fun() ->
+ Self ! started1,
+ {module,Mod} = code:load_binary(Mod, "", Code1)
+ end),
+ receive started1 -> ok end,
+ timer:sleep(10),
+ {_,Ref2} =
+ spawn_monitor(fun() ->
+ Self ! started2,
+ {module,Mod} = code:load_binary(Mod, "", Code2),
+ ok = Mod:t()
+ end),
+ receive started2 -> ok end,
+ receive
+ Unexpected ->
+ ct:fail({unexpected,Unexpected})
+ after 100 ->
+ ok
+ end,
+ Mod ! go,
+ receive
+ {'DOWN',Ref1,process,_,normal} -> ok
+ end,
+ receive
+ {'DOWN',Ref2,process,_,normal} -> ok
+ end,
+ ok = Mod:t(),
+ ok.
+
+
%% 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
diff --git a/lib/kernel/test/code_SUITE_data/code_archive_dict-1.0/src/code_archive_dict.erl b/lib/kernel/test/code_SUITE_data/code_archive_dict-1.0/src/code_archive_dict.erl
index 9fb5a31358..1fcf05a0a1 100644
--- a/lib/kernel/test/code_SUITE_data/code_archive_dict-1.0/src/code_archive_dict.erl
+++ b/lib/kernel/test/code_SUITE_data/code_archive_dict-1.0/src/code_archive_dict.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/code_SUITE_data/code_archive_dict-1.0/src/code_archive_dict_app.erl b/lib/kernel/test/code_SUITE_data/code_archive_dict-1.0/src/code_archive_dict_app.erl
index 8012ddafb4..d164db9794 100644
--- a/lib/kernel/test/code_SUITE_data/code_archive_dict-1.0/src/code_archive_dict_app.erl
+++ b/lib/kernel/test/code_SUITE_data/code_archive_dict-1.0/src/code_archive_dict_app.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/code_SUITE_data/code_archive_dict-1.0/src/code_archive_dict_sup.erl b/lib/kernel/test/code_SUITE_data/code_archive_dict-1.0/src/code_archive_dict_sup.erl
index 8c7b49644a..e659202e08 100644
--- a/lib/kernel/test/code_SUITE_data/code_archive_dict-1.0/src/code_archive_dict_sup.erl
+++ b/lib/kernel/test/code_SUITE_data/code_archive_dict-1.0/src/code_archive_dict_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/code_SUITE_data/mult_lib_roots/first_root/my_dummy_app-b/ebin/lists.erl b/lib/kernel/test/code_SUITE_data/mult_lib_roots/first_root/my_dummy_app-b/ebin/lists.erl
index 07a4ffc8b6..6accd00191 100644
--- a/lib/kernel/test/code_SUITE_data/mult_lib_roots/first_root/my_dummy_app-b/ebin/lists.erl
+++ b/lib/kernel/test/code_SUITE_data/mult_lib_roots/first_root/my_dummy_app-b/ebin/lists.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/code_SUITE_data/mult_lib_roots/first_root/my_dummy_app-c/ebin/code_SUITE_mult_root_module.erl b/lib/kernel/test/code_SUITE_data/mult_lib_roots/first_root/my_dummy_app-c/ebin/code_SUITE_mult_root_module.erl
index 15ff5d4896..f45e5b2dba 100644
--- a/lib/kernel/test/code_SUITE_data/mult_lib_roots/first_root/my_dummy_app-c/ebin/code_SUITE_mult_root_module.erl
+++ b/lib/kernel/test/code_SUITE_data/mult_lib_roots/first_root/my_dummy_app-c/ebin/code_SUITE_mult_root_module.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/code_a_test.erl b/lib/kernel/test/code_a_test.erl
index fa33c6f57a..bb5d814f04 100644
--- a/lib/kernel/test/code_a_test.erl
+++ b/lib/kernel/test/code_a_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/code_b_test.erl b/lib/kernel/test/code_b_test.erl
index 559698dd8e..9c362eb0d0 100644
--- a/lib/kernel/test/code_b_test.erl
+++ b/lib/kernel/test/code_b_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/disk_log_SUITE.erl b/lib/kernel/test/disk_log_SUITE.erl
index 135144bbe7..f7ad9c0c04 100644
--- a/lib/kernel/test/disk_log_SUITE.erl
+++ b/lib/kernel/test/disk_log_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/disk_log_SUITE_data/wrap_log_test.erl b/lib/kernel/test/disk_log_SUITE_data/wrap_log_test.erl
index 1cd1a4b0a4..38449b6bb3 100644
--- a/lib/kernel/test/disk_log_SUITE_data/wrap_log_test.erl
+++ b/lib/kernel/test/disk_log_SUITE_data/wrap_log_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/erl_boot_server_SUITE.erl b/lib/kernel/test/erl_boot_server_SUITE.erl
index aef1d69f62..1eaa2cf500 100644
--- a/lib/kernel/test/erl_boot_server_SUITE.erl
+++ b/lib/kernel/test/erl_boot_server_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/erl_distribution_SUITE.erl b/lib/kernel/test/erl_distribution_SUITE.erl
index 9951ac17e9..eb58e92224 100644
--- a/lib/kernel/test/erl_distribution_SUITE.erl
+++ b/lib/kernel/test/erl_distribution_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -634,7 +634,7 @@ monitor_nodes_nodedown_reason(Config) when is_list(Config) ->
stop_node(N4),
true = net_kernel:disconnect(N2),
TickTime = net_kernel:get_net_ticktime(),
- SleepTime = TickTime + (TickTime div 4),
+ SleepTime = TickTime + (TickTime div 2),
spawn(N3, fun () ->
block_emu(SleepTime*1000),
halt()
@@ -911,15 +911,14 @@ monitor_nodes_otp_6481_test(Config, TestType) when is_list(Config) ->
%% Verify that '{nodeup, Node}' comes before '{NodeMsg, 1}' (the message
%% bringing up the connection).
- no_msgs(500),
{nodeup, Node} = receive Msg1 -> Msg1 end,
- {NodeMsg, 1} = receive Msg2 -> Msg2 end,
+ {NodeMsg, N} = receive Msg2 -> Msg2 end,
%% msg stream has begun, kill the node
RemotePid ! {self(), kill_it},
%% Verify that '{nodedown, Node}' comes after the last '{NodeMsg, N}'
%% message.
- {nodedown, Node} = flush_node_msgs(NodeMsg, 2),
+ {nodedown, Node} = flush_node_msgs(NodeMsg, N+1),
no_msgs(500),
Mon = erlang:monitor(process, MN),
@@ -932,8 +931,10 @@ monitor_nodes_otp_6481_test(Config, TestType) when is_list(Config) ->
flush_node_msgs(NodeMsg, No) ->
case receive Msg -> Msg end of
- {NodeMsg, No} -> flush_node_msgs(NodeMsg, No+1);
- OtherMsg -> OtherMsg
+ {NodeMsg, N} when N >= No ->
+ flush_node_msgs(NodeMsg, N+1);
+ OtherMsg ->
+ OtherMsg
end.
node_loop_send(Pid, Msg, No) ->
diff --git a/lib/kernel/test/erl_distribution_wb_SUITE.erl b/lib/kernel/test/erl_distribution_wb_SUITE.erl
index dc60b8b9e9..6a23ad0d11 100644
--- a/lib/kernel/test/erl_distribution_wb_SUITE.erl
+++ b/lib/kernel/test/erl_distribution_wb_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/erl_prim_loader_SUITE.erl b/lib/kernel/test/erl_prim_loader_SUITE.erl
index 3ea925ee9a..4f3881d27e 100644
--- a/lib/kernel/test/erl_prim_loader_SUITE.erl
+++ b/lib/kernel/test/erl_prim_loader_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dict-1.0/src/primary_archive_dict.erl b/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dict-1.0/src/primary_archive_dict.erl
index 7d8167f575..57aeb7fd64 100644
--- a/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dict-1.0/src/primary_archive_dict.erl
+++ b/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dict-1.0/src/primary_archive_dict.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dict-1.0/src/primary_archive_dict_app.erl b/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dict-1.0/src/primary_archive_dict_app.erl
index bf66179e00..78e4f61579 100644
--- a/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dict-1.0/src/primary_archive_dict_app.erl
+++ b/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dict-1.0/src/primary_archive_dict_app.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dict-1.0/src/primary_archive_dict_sup.erl b/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dict-1.0/src/primary_archive_dict_sup.erl
index e57d8c5a00..e63e958daf 100644
--- a/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dict-1.0/src/primary_archive_dict_sup.erl
+++ b/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dict-1.0/src/primary_archive_dict_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dummy/src/primary_archive_dummy.erl b/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dummy/src/primary_archive_dummy.erl
index e1c7655331..4adbec3c81 100644
--- a/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dummy/src/primary_archive_dummy.erl
+++ b/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dummy/src/primary_archive_dummy.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dummy/src/primary_archive_dummy_app.erl b/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dummy/src/primary_archive_dummy_app.erl
index e9db18c47e..e90776ce73 100644
--- a/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dummy/src/primary_archive_dummy_app.erl
+++ b/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dummy/src/primary_archive_dummy_app.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dummy/src/primary_archive_dummy_sup.erl b/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dummy/src/primary_archive_dummy_sup.erl
index 7bab86be68..145de8167f 100644
--- a/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dummy/src/primary_archive_dummy_sup.erl
+++ b/lib/kernel/test/erl_prim_loader_SUITE_data/primary_archive/primary_archive_dummy/src/primary_archive_dummy_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/error_handler_SUITE.erl b/lib/kernel/test/error_handler_SUITE.erl
index 6092eebb62..c6d457f314 100644
--- a/lib/kernel/test/error_handler_SUITE.erl
+++ b/lib/kernel/test/error_handler_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/error_logger_SUITE.erl b/lib/kernel/test/error_logger_SUITE.erl
index 07d039349c..b6e7551741 100644
--- a/lib/kernel/test/error_logger_SUITE.erl
+++ b/lib/kernel/test/error_logger_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/error_logger_warn_SUITE.erl b/lib/kernel/test/error_logger_warn_SUITE.erl
index d8bbd42517..a8087e11f9 100644
--- a/lib/kernel/test/error_logger_warn_SUITE.erl
+++ b/lib/kernel/test/error_logger_warn_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -366,7 +366,7 @@ rb_basic() ->
0 = one_rb_findstr([info_msg],pid_to_list(Self)),
0 = one_rb_findstr([info_report],pid_to_list(Self)),
2 = one_rb_findstr([],pid_to_list(Self)),
- true = (one_rb_findstr([progress],"===") > 4),
+ true = (one_rb_findstr([progress],"===") > 3),
rb:stop(),
application:stop(sasl),
stop_node(Node),
@@ -396,7 +396,7 @@ rb_warnings_info() ->
1 = one_rb_findstr([info_msg],pid_to_list(Self)),
1 = one_rb_findstr([info_report],pid_to_list(Self)),
2 = one_rb_findstr([],pid_to_list(Self)),
- true = (one_rb_findstr([progress],"===") > 4),
+ true = (one_rb_findstr([progress],"===") > 3),
rb:stop(),
application:stop(sasl),
stop_node(Node),
@@ -426,7 +426,7 @@ rb_warnings_errors() ->
0 = one_rb_findstr([info_msg],pid_to_list(Self)),
0 = one_rb_findstr([info_report],pid_to_list(Self)),
2 = one_rb_findstr([],pid_to_list(Self)),
- true = (one_rb_findstr([progress],"===") > 4),
+ true = (one_rb_findstr([progress],"===") > 3),
rb:stop(),
application:stop(sasl),
stop_node(Node),
@@ -459,7 +459,7 @@ rb_trunc() ->
0 = one_rb_findstr([info_msg],pid_to_list(Self)),
0 = one_rb_findstr([info_report],pid_to_list(Self)),
1 = one_rb_findstr([],pid_to_list(Self)),
- true = (one_rb_findstr([progress],"===") > 4),
+ true = (one_rb_findstr([progress],"===") > 3),
rb:stop(),
application:stop(sasl),
stop_node(Node),
diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl
index 74db2970af..5f049c6f99 100644
--- a/lib/kernel/test/file_SUITE.erl
+++ b/lib/kernel/test/file_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -83,7 +83,7 @@
-export([unicode/1]).
-export([altname/1]).
--export([large_file/0, large_file/1, large_write/1]).
+-export([large_file/0, large_file/1, large_write/0, large_write/1]).
-export([read_line_1/1, read_line_2/1, read_line_3/1,read_line_4/1]).
@@ -3663,6 +3663,9 @@ do_large_file(Name) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+large_write() ->
+ [{timetrap,{minutes,20}}].
+
large_write(Config) when is_list(Config) ->
run_large_file_test(Config,
fun(Name) -> do_large_write(Name) end,
diff --git a/lib/kernel/test/file_name_SUITE.erl b/lib/kernel/test/file_name_SUITE.erl
index be4ef9c394..10b6b105d0 100644
--- a/lib/kernel/test/file_name_SUITE.erl
+++ b/lib/kernel/test/file_name_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -139,7 +139,12 @@ home_dir(Config) when is_list(Config) ->
test_server:stop_node(Node),
ok
after
- os:putenv(SaveOldName,SaveOldValue),
+ case SaveOldValue of
+ false ->
+ os:unsetenv(SaveOldName);
+ _ ->
+ os:putenv(SaveOldName,SaveOldValue)
+ end,
rm_rf(prim_file,NewHome)
end
catch
@@ -185,9 +190,7 @@ normal(Config) when is_list(Config) ->
try
Priv = proplists:get_value(priv_dir, Config),
file:set_cwd(Priv),
- put(file_module,prim_file),
ok = check_normal(prim_file),
- put(file_module,file),
ok = check_normal(file),
%% If all is good, delete dir again (avoid hanging dir on windows)
rm_rf(file,"normal_dir"),
@@ -207,9 +210,7 @@ icky(Config) when is_list(Config) ->
try
Priv = proplists:get_value(priv_dir, Config),
file:set_cwd(Priv),
- put(file_module,prim_file),
ok = check_icky(prim_file),
- put(file_module,file),
ok = check_icky(file),
%% If all is good, delete dir again (avoid hanging dir on windows)
rm_rf(file,"icky_dir"),
@@ -228,12 +229,10 @@ very_icky(Config) when is_list(Config) ->
try
Priv = proplists:get_value(priv_dir, Config),
file:set_cwd(Priv),
- put(file_module,prim_file),
case check_very_icky(prim_file) of
need_unicode_mode ->
{skipped,"VM needs to be started in Unicode filename mode"};
ok ->
- put(file_module,file),
ok = check_very_icky(file),
%% If all is good, delete dir again
%% (avoid hanging dir on windows)
@@ -249,10 +248,12 @@ very_icky(Config) when is_list(Config) ->
check_normal(Mod) ->
{ok,Dir} = Mod:get_cwd(),
try
- make_normal_dir(Mod),
+ NormalDir = make_normal_dir(Mod, "normal_dir"),
+ io:format("Normaldir = ~p\n", [NormalDir]),
+ L1 = lists:sort(list(NormalDir)),
{ok, L0} = Mod:list_dir("."),
+ io:format("L0 = ~p\n", [L0]),
L1 = lists:sort(L0),
- L1 = lists:sort(list(normal_dir())),
{ok,D2} = Mod:get_cwd(),
true = is_list(D2),
case Mod:altname("fil1") of
@@ -262,45 +263,45 @@ check_normal(Mod) ->
ok
end,
[ true = is_list(El) || El <- L1],
- Syms = [ {S,Targ,list_to_binary(get_data(Targ,normal_dir()))}
- || {T,S,Targ} <- normal_dir(), T =:= symlink ],
+ Syms = [ {S,Targ,list_to_binary(get_data(Targ, NormalDir))}
+ || {T,S,Targ} <- NormalDir, T =:= symlink ],
[ {ok, Cont} = Mod:read_file(SymL) || {SymL,_,Cont} <- Syms ],
[ {ok, Targ} = fixlink(Mod:read_link(SymL)) || {SymL,Targ,_} <- Syms ],
- chk_cre_dir(Mod,[{directory,"temp_dir",normal_dir()}]),
+
{ok,BeginAt} = Mod:get_cwd(),
true = is_list(BeginAt),
+ TempDir = "temp_dir",
+ make_normal_dir(Mod, TempDir),
{error,enoent} = Mod:set_cwd("tmp_dir"),
- ok = Mod:set_cwd("temp_dir"),
{ok, NowAt} = Mod:get_cwd(),
true = BeginAt =/= NowAt,
ok = Mod:set_cwd(".."),
{ok,BeginAt} = Mod:get_cwd(),
- rm_r(Mod,"temp_dir"),
+ rm_r(Mod, TempDir),
true = is_list(Dir),
[ true = is_list(FN) || FN <- L0 ],
- case has_links() of
- true ->
- ok = Mod:make_link("fil1","nisse"),
+ case Mod:make_link("fil1","nisse") of
+ ok ->
{ok, <<"fil1">>} = Mod:read_file("nisse"),
{ok, #file_info{type = regular}} = Mod:read_link_info("nisse"),
ok = Mod:delete("nisse"),
{ok, <<"fil1">>} = Mod:read_file("fil1"),
{error,enoent} = Mod:read_file("nisse"),
{error,enoent} = Mod:read_link_info("nisse");
- false ->
+ {error,enotsup} ->
ok
end,
[ begin
{ok, FD} = Mod:open(Name,[read]),
{ok, Content} = Mod:read(FD,1024),
ok = file:close(FD)
- end || {regular,Name,Content} <- normal_dir() ],
+ end || {regular,Name,Content} <- NormalDir ],
[ begin
{ok, FD} = Mod:open(Name,[read,binary]),
BC = list_to_binary(Content),
{ok, BC} = Mod:read(FD,1024),
ok = file:close(FD)
- end || {regular,Name,Content} <- normal_dir() ],
+ end || {regular,Name,Content} <- NormalDir ],
Mod:rename("fil1","tmp_fil1"),
{ok, <<"fil1">>} = Mod:read_file("tmp_fil1"),
{error,enoent} = Mod:read_file("fil1"),
@@ -333,11 +334,11 @@ check_icky(Mod) ->
try
true=(length("åäö") =:= 3),
UniMode = file:native_name_encoding() =/= latin1,
- make_icky_dir(Mod),
+ IckyDir = make_icky_dir(Mod, "icky_dir"),
{ok, L0} = Mod:list_dir_all("."),
L1 = lists:sort(L0),
- io:format("~p~n~p~n~n",[L1,lists:sort(list(icky_dir()))]),
- L1 = lists:sort(convlist(list(icky_dir()))),
+ io:format("~p~n~p~n~n",[L1,lists:sort(list(IckyDir))]),
+ L1 = lists:sort(convlist(list(IckyDir))),
{ok,D2} = Mod:get_cwd(),
true = is_list(D2),
%% Altname only on windows, and there are no non native filenames there
@@ -348,16 +349,16 @@ check_icky(Mod) ->
%% ok
%% end,
[ true = ((is_list(El) or (UniMode and is_binary(El)))) || El <- L1],
- Syms = [ {S,conv(Targ),list_to_binary(get_data(Targ,icky_dir()))}
- || {T,S,Targ} <- icky_dir(), T =:= symlink ],
+ Syms = [ {S,conv(Targ),list_to_binary(get_data(Targ,IckyDir))}
+ || {T,S,Targ} <- IckyDir, T =:= symlink ],
[ {ok, Cont} = Mod:read_file(SymL) || {SymL,_,Cont} <- Syms ],
[ {ok, Targ} = fixlink(Mod:read_link_all(SymL)) ||
{SymL,Targ,_} <- Syms ],
- chk_cre_dir(Mod,[{directory,"åäö_dir",icky_dir()}]),
+
{ok,BeginAt} = Mod:get_cwd(),
true = is_list(BeginAt),
+ _ = make_icky_dir(Mod, "åäö_dir"),
{error,enoent} = Mod:set_cwd("åä_dir"),
- ok = Mod:set_cwd("åäö_dir"),
{ok, NowAt} = Mod:get_cwd(),
true = is_list(NowAt),
true = BeginAt =/= NowAt,
@@ -365,10 +366,11 @@ check_icky(Mod) ->
{ok,BeginAt} = Mod:get_cwd(),
rm_r2(Mod,"åäö_dir"),
{OS,_} = os:type(),
+
%% Check that treat_icky really converts to the same as the OS
case UniMode of
true ->
- chk_cre_dir(Mod,[{directory,"åäö_dir",[]}]),
+ ok = Mod:make_dir("åäö_dir"),
ok = Mod:set_cwd("åäö_dir"),
ok = Mod:write_file(<<"ååå">>,<<"hello">>),
Treated = treat_icky(<<"ååå">>),
@@ -381,17 +383,17 @@ check_icky(Mod) ->
ok
end,
- chk_cre_dir(Mod,[{directory,treat_icky(<<"åäö_dir">>),icky_dir()}]),
+ _ = make_icky_dir(Mod, treat_icky(<<"åäö_dir">>)),
if
UniMode and (OS =/= win32) ->
{error,enoent} = Mod:set_cwd("åäö_dir");
true ->
ok
end,
+ ok = Mod:set_cwd(".."),
{ok,BeginAt} = Mod:get_cwd(),
- case has_links() of
- true ->
- ok = Mod:make_link("fil1","nisseö"),
+ case Mod:make_link("fil1", "nisseö") of
+ ok ->
{ok, <<"fil1">>} = Mod:read_file("nisseö"),
{ok, #file_info{type = regular}} = Mod:read_link_info("nisseö"),
ok = Mod:delete("nisseö"),
@@ -404,20 +406,20 @@ check_icky(Mod) ->
{error,enoent} = Mod:read_link_info("nisseö"),
{error,enoent} = Mod:read_file(treat_icky(<<"nisseö">>)),
{error,enoent} = Mod:read_link_info(treat_icky(<<"nisseö">>));
- false ->
+ {error,enotsup} ->
ok
end,
[ begin
{ok, FD} = Mod:open(Name,[read]),
{ok, Content} = Mod:read(FD,1024),
ok = file:close(FD)
- end || {regular,Name,Content} <- icky_dir() ],
+ end || {regular,Name,Content} <- IckyDir ],
[ begin
{ok, FD} = Mod:open(Name,[read,binary]),
BC = list_to_binary([Content]),
{ok, BC} = Mod:read(FD,1024),
ok = file:close(FD)
- end || {regular,Name,Content} <- icky_dir() ],
+ end || {regular,Name,Content} <- IckyDir ],
Mod:rename("åäö2","åäö_fil1"),
{ok, <<"åäö2">>} = Mod:read_file("åäö_fil1"),
{error,enoent} = Mod:read_file("åäö2"),
@@ -471,33 +473,33 @@ check_very_icky(Mod) ->
true ->
ok
end,
- make_very_icky_dir(Mod),
- {ok, L0} = Mod:list_dir_all("."),
- L1 = lists:sort(L0),
- L1 = lists:sort(convlist(list(very_icky_dir()))),
+ VeryIckyDir = make_very_icky_dir(Mod, "very_icky_dir"),
+ Expected = lists:sort(convlist(list(VeryIckyDir))),
+ {ok, Actual} = Mod:list_dir_all("."),
+ Expected = lists:sort(Actual),
{ok,D2} = Mod:get_cwd(),
true = is_list(D2),
- [ true = ((is_list(El) or is_binary(El))) || El <- L1],
- Syms = [ {S,conv(Targ),list_to_binary(get_data(Targ,very_icky_dir()))}
- || {T,S,Targ} <- very_icky_dir(), T =:= symlink ],
+ [ true = ((is_list(El) or is_binary(El))) || El <- Expected],
+ Syms = [{S,conv(Targ),list_to_binary(get_data(Targ, VeryIckyDir))}
+ || {symlink,S,Targ} <- VeryIckyDir],
[ {ok, Cont} = Mod:read_file(SymL) || {SymL,_,Cont} <- Syms ],
[ {ok, Targ} = fixlink(Mod:read_link_all(SymL)) ||
{SymL,Targ,_} <- Syms ],
- chk_cre_dir(Mod,[{directory,[1088,1079,1091]++"_dir",very_icky_dir()}]),
+
{ok,BeginAt} = Mod:get_cwd(),
+ OtherDir = [1088,1079,1091] ++ "_dir",
true = is_list(BeginAt),
+ make_very_icky_dir(Mod, OtherDir),
{error,enoent} = Mod:set_cwd("åä_dir"),
- ok = Mod:set_cwd([1088,1079,1091]++"_dir"),
{ok, NowAt} = Mod:get_cwd(),
true = is_list(NowAt),
true = BeginAt =/= NowAt,
ok = Mod:set_cwd(".."),
{ok,BeginAt} = Mod:get_cwd(),
- rm_r2(Mod,[1088,1079,1091]++"_dir"),
+ rm_r2(Mod, OtherDir),
- case has_links() of
- true ->
- ok = Mod:make_link("fil1","nisse"++[1088,1079,1091]),
+ case Mod:make_link("fil1","nisse"++[1088,1079,1091]) of
+ ok ->
{ok, <<"fil1">>} =
Mod:read_file("nisse"++[1088,1079,1091]),
{ok, #file_info{type = regular}} =
@@ -513,20 +515,20 @@ check_very_icky(Mod) ->
{error,enoent} = Mod:read_link_info("nisse"++[1088,1079,1091]),
{error,enoent} = Mod:read_file(<<"nisseö">>),
{error,enoent} = Mod:read_link_info(<<"nisseö">>);
- false ->
+ {error,enotsup} ->
ok
end,
[ begin
{ok, FD} = Mod:open(Name,[read]),
{ok, Content} = Mod:read(FD,1024),
ok = file:close(FD)
- end || {regular,Name,Content} <- very_icky_dir() ],
+ end || {regular,Name,Content} <- VeryIckyDir ],
[ begin
{ok, FD} = Mod:open(Name,[read,binary]),
BC = list_to_binary([Content]),
{ok, BC} = Mod:read(FD,1024),
ok = file:close(FD)
- end || {regular,Name,Content} <- very_icky_dir() ],
+ end || {regular,Name,Content} <- VeryIckyDir ],
Mod:rename([956,965,963,954,959,49],
[956,965,963,954,959]++"_fil1"),
{ok, <<"åäö2">>} = Mod:read_file([956,965,963,954,959]++"_fil1"),
@@ -610,90 +612,35 @@ rm_r2(Mod,Dir) ->
{ok, #file_info{type = symlink}} ->
ok = Mod:delete(Dir)
end.
-chk_cre_dir(_,[]) ->
- ok;
-chk_cre_dir(Mod,[{regular,Name,Content}|T]) ->
- %% io:format("~p~n",[Name]),
- ok = Mod:write_file(Name,Content),
- chk_cre_dir(Mod,T);
-chk_cre_dir(Mod,[{link,Name,Target}|T]) ->
- ok = Mod:make_link(Target,Name),
- chk_cre_dir(Mod,T);
-chk_cre_dir(Mod,[{symlink,Name,Target}|T]) ->
- ok = Mod:make_symlink(Target,Name),
- chk_cre_dir(Mod,T);
-chk_cre_dir(Mod,[{directory,Name,Content}|T]) ->
- ok = Mod:make_dir(Name),
- %% io:format("Content = ~p~n",[Content]),
- Content2 = [{Ty,filename:join(Name,N),case Ty of link -> filename:join(Name,C); _ -> C end} || {Ty,N,C} <- Content ],
- %% io:format("Content2 = ~p~n",[Content2]),
- chk_cre_dir(Mod,Content2),
- chk_cre_dir(Mod,T).
-has_links() ->
- case os:type() of
- {win32,_} ->
- case os:version() of
- {N,NN,_} when (N > 5) andalso (NN >= 1) ->
- true;
- _ ->
- false
- end;
- _ ->
- true
- end.
+make_normal_dir(Mod, DirName) ->
+ Dir = [{regular,"fil1","fil1"},
+ {regular,"fil2","fil2"},
+ {hardlink,"fil3","fil2"},
+ {symlink,"fil4","fil2"},
+ {directory,"subdir",
+ [{regular,"subfil1","subfil1"}]}],
+ rm_rf(Mod, DirName),
+ Mod:make_dir(DirName),
+ Mod:set_cwd(DirName),
+ make_dir_contents(Dir, Mod).
-make_normal_dir(Mod) ->
- rm_rf(Mod,"normal_dir"),
- Mod:make_dir("normal_dir"),
- Mod:set_cwd("normal_dir"),
- Mod:write_file("fil1","fil1"),
- Mod:write_file("fil2","fil2"),
- case has_links() of
- true ->
- Mod:make_link("fil2","fil3"),
- Mod:make_symlink("fil2","fil4");
- _ ->
- ok
- end,
- Mod:make_dir("subdir"),
- Mod:write_file(filename:join("subdir","subfil1"),"subfil1"),
- ok.
-
-normal_dir() ->
- [{regular,"fil1","fil1"},
- {regular,"fil2","fil2"}] ++
- case has_links() of
- true ->
- [{regular,"fil3","fil2"},
- {symlink,"fil4","fil2"}];
- false ->
- []
- end ++
- [{directory,"subdir",
- [{regular,"subfil1","subfil1"}]}].
-
-make_icky_dir(Mod) ->
- rm_rf(Mod,"icky_dir"),
- Icky=icky_dir(),
- chk_cre_dir(Mod,[{directory,"icky_dir",linkify([],Icky)}]),
- Mod:set_cwd("icky_dir"),
- ok.
-
-linkify(_Passed,[]) ->
- [];
-linkify(Passed,[{regular,Name,Content}|T]) ->
- Regulars = [ {N,C} || {regular,N,C} <- Passed, N =/= Name ],
- case lists:keysearch(Content,2,Regulars) of
- {value, {Linkto, Content}} ->
- [{link,Name,Linkto} | linkify(Passed,T)];
- _ ->
- [{regular,Name,Content} | linkify([{regular,Name,Content}|Passed],T)]
- end;
-linkify(Passed,[{directory, Name, Content}|T]) ->
- [{directory,Name, linkify(Content,Content)}|linkify(Passed,T)];
-linkify(Passed,[H|T]) ->
- [H|linkify([H|Passed],T)].
+make_icky_dir(Mod, IckyDirName) ->
+ Icky = [{regular,"fil1","fil1"},
+ {regular,"åäö2","åäö2"},
+ {hardlink,"åäö3","åäö2"},
+ {symlink,"åäö4","åäö2"},
+ {regular,treat_icky(<<"åäö5">>),"åäö5"},
+ {symlink,treat_icky(<<"åäö6">>),treat_icky(<<"åäö5">>)},
+ {directory,treat_icky(<<"åäösubdir2">>),
+ [{regular,treat_icky(<<"åäösubfil2">>),"åäösubfil12"},
+ {regular,"åäösubfil3","åäösubfil13"}]},
+ {directory,"åäösubdir",
+ [{regular,"åäösubfil1","åäösubfil1"}]}],
+ rm_rf(Mod, IckyDirName),
+ ok = Mod:make_dir(IckyDirName),
+ ok = Mod:set_cwd(IckyDirName),
+ make_dir_contents(Icky, Mod).
hopeless_darwin() ->
case {os:type(),os:version()} of
@@ -703,58 +650,24 @@ hopeless_darwin() ->
false
end.
-icky_dir() ->
- [{regular,"fil1","fil1"},
- {regular,"åäö2","åäö2"}] ++
- case has_links() of
- true ->
- [{regular,"åäö3","åäö2"},
- {symlink,"åäö4","åäö2"}];
- false ->
- []
- end ++
- [{regular,treat_icky(<<"åäö5">>),"åäö5"}] ++
- case has_links() of
- true ->
- [{symlink,treat_icky(<<"åäö6">>),treat_icky(<<"åäö5">>)}];
- false ->
- []
- end ++
- [{directory,treat_icky(<<"åäösubdir2">>),
- [{regular,treat_icky(<<"åäösubfil2">>),"åäösubfil12"},
- {regular,"åäösubfil3","åäösubfil13"}]},
- {directory,"åäösubdir",
- [{regular,"åäösubfil1","åäösubfil1"}]}].
-
-make_very_icky_dir(Mod) ->
- rm_rf(Mod,"very_icky_dir"),
- Icky=very_icky_dir(),
- chk_cre_dir(Mod,[{directory,"very_icky_dir",linkify([],Icky)}]),
- Mod:set_cwd("very_icky_dir"),
- ok.
-
-very_icky_dir() ->
- [{regular,"fil1","fil1"},
- {regular,[956,965,963,954,959,49],"åäö2"}] ++
- case has_links() of
- true ->
- [{regular,[956,965,963,954,959,50],"åäö2"},
- {symlink,[956,965,963,954,959,51],[956,965,963,954,959,49]}];
- false ->
- []
- end ++
- [{regular,treat_icky(<<"åäö5">>),"åäö5"}] ++
- case has_links() of
- true ->
- [{symlink,treat_icky(<<"åäö6">>),treat_icky(<<"åäö5">>)}];
- false ->
- []
- end ++
- [{directory,treat_icky(<<"åäösubdir2">>),
- [{regular,treat_icky(<<"åäösubfil2">>),"åäösubfil12"},
- {regular,"åäösubfil3","åäösubfil13"}]},
- {directory,[956,965,963,954,959]++"subdir1",
- [{regular,[956,965,963,954,959]++"subfil1","åäösubfil1"}]}].
+make_very_icky_dir(Mod, DirName) ->
+ Desc = [{regular,"fil1","fil1"},
+ {regular,[956,965,963,954,959,49],"åäö2"},
+ {hardlink,[956,965,963,954,959,50],
+ [956,965,963,954,959,49],
+ "åäö2"},
+ {symlink,[956,965,963,954,959,51],[956,965,963,954,959,49]},
+ {regular,treat_icky(<<"åäö5">>),"åäö5"},
+ {symlink,treat_icky(<<"åäö6">>),treat_icky(<<"åäö5">>)},
+ {directory,treat_icky(<<"åäösubdir2">>),
+ [{regular,treat_icky(<<"åäösubfil2">>),"åäösubfil12"},
+ {regular,"åäösubfil3","åäösubfil13"}]},
+ {directory,[956,965,963,954,959]++"subdir1",
+ [{regular,[956,965,963,954,959]++"subfil1","åäösubfil1"}]}],
+ rm_rf(Mod, DirName),
+ ok = Mod:make_dir(DirName),
+ ok = Mod:set_cwd(DirName),
+ make_dir_contents(Desc, Mod).
%% Some OS'es simply do not allow non UTF8 filenames
treat_icky(Bin) ->
@@ -827,6 +740,48 @@ conv(L) ->
end.
+make_dir_contents([{regular,Name,Contents}=H|T], Mod) ->
+ ok = Mod:write_file(Name, Contents),
+ [H|make_dir_contents(T, Mod)];
+make_dir_contents([{hardlink,Target,Name}|T], Mod) ->
+ case Mod:make_link(Name, Target) of
+ ok ->
+ [{regular,Target,Name}|make_dir_contents(T, Mod)];
+ {error,enotsup} ->
+ make_dir_contents(T, Mod)
+ end;
+make_dir_contents([{hardlink,Target,Name,Contents}|T], Mod) ->
+ case Mod:make_link(Name, Target) of
+ ok ->
+ [{regular,Target,Contents}|make_dir_contents(T, Mod)];
+ {error,enotsup} ->
+ make_dir_contents(T, Mod)
+ end;
+make_dir_contents([{symlink,Target,Name}=H|T], Mod) ->
+ case Mod:make_symlink(Name, Target) of
+ ok ->
+ [H|make_dir_contents(T, Mod)];
+ {error,enotsup} ->
+ make_dir_contents(T, Mod);
+ {error,eperm} ->
+ make_dir_contents(T, Mod)
+ end;
+make_dir_contents([{directory,Dir,C0}|T], Mod) ->
+ ok = Mod:make_dir(Dir),
+ C1 = [case Op of
+ Link when Link =:= hardlink; Link =:= symlink ->
+ {Op,filename:join(Dir, Name0),filename:join(Dir, Extra)};
+ _ ->
+ {Op,filename:join(Dir, Name0),Extra}
+ end || {Op,Name0,Extra} <- C0],
+ C2 = make_dir_contents(C1, Mod),
+ C = [{Op,filename:basename(Name0),Extra} ||
+ {Op,Name0,Extra} <- C2],
+ [{directory,Dir,C}|make_dir_contents(T, Mod)];
+make_dir_contents([], _Mod) ->
+ [].
+
+
rand_comp_decomp(Max) ->
N = rand:uniform(Max),
L = [ rand_decomp() || _ <- lists:seq(1,N) ],
diff --git a/lib/kernel/test/gen_sctp_SUITE.erl b/lib/kernel/test/gen_sctp_SUITE.erl
index 8e53da210e..f836b2aa94 100644
--- a/lib/kernel/test/gen_sctp_SUITE.erl
+++ b/lib/kernel/test/gen_sctp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -29,7 +29,8 @@
init_per_group/2,end_per_group/2,
init_per_testcase/2, end_per_testcase/2]).
-export(
- [basic/1,
+ [skip_old_solaris/1,
+ basic/1,
api_open_close/1,api_listen/1,api_connect_init/1,api_opts/1,
xfer_min/1,xfer_active/1,def_sndrcvinfo/1,implicit_inet6/1,
open_multihoming_ipv4_socket/1,
@@ -46,20 +47,28 @@ suite() ->
[{ct_hooks,[ts_install_cth]},
{timetrap,{minutes,1}}].
-all() ->
- [basic, api_open_close, api_listen, api_connect_init,
- api_opts, xfer_min, xfer_active, def_sndrcvinfo, implicit_inet6,
- open_multihoming_ipv4_socket,
- open_unihoming_ipv6_socket,
- open_multihoming_ipv6_socket,
- open_multihoming_ipv4_and_ipv6_socket, active_n,
- basic_stream, xfer_stream_min, peeloff_active_once,
- peeloff_active_true, peeloff_active_n, buffers,
- names_unihoming_ipv4, names_unihoming_ipv6,
- names_multihoming_ipv4, names_multihoming_ipv6].
+all() ->
+ G = case is_old_solaris() of
+ true -> old_solaris;
+ false -> extensive
+ end,
+ [{group,smoke},
+ {group,G}].
groups() ->
- [].
+ [{smoke,[],[basic,basic_stream]},
+ {old_solaris,[],[skip_old_solaris]},
+ {extensive,[],
+ [api_open_close, api_listen, api_connect_init,
+ api_opts, xfer_min, xfer_active, def_sndrcvinfo, implicit_inet6,
+ open_multihoming_ipv4_socket,
+ open_unihoming_ipv6_socket,
+ open_multihoming_ipv6_socket,
+ open_multihoming_ipv4_and_ipv6_socket, active_n,
+ xfer_stream_min, peeloff_active_once,
+ peeloff_active_true, peeloff_active_n, buffers,
+ names_unihoming_ipv4, names_unihoming_ipv6,
+ names_multihoming_ipv4, names_multihoming_ipv6]}].
init_per_suite(_Config) ->
case gen_sctp:open() of
@@ -91,7 +100,11 @@ end_per_testcase(_Func, _Config) ->
-define(LOGVAR(Var), begin io:format(??Var" = ~p~n", [Var]) end).
+is_old_solaris() ->
+ os:type() =:= {unix,sunos} andalso os:version() < {5,12,0}.
+skip_old_solaris(_Config) ->
+ {skip,"Unreliable test cases and/or implementation on old Solaris"}.
%% Hello world.
basic(Config) when is_list(Config) ->
diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl
index 4d829bcac6..6f6f53309e 100644
--- a/lib/kernel/test/gen_tcp_api_SUITE.erl
+++ b/lib/kernel/test/gen_tcp_api_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/gen_tcp_api_SUITE_data/gen_tcp_api_SUITE.c b/lib/kernel/test/gen_tcp_api_SUITE_data/gen_tcp_api_SUITE.c
index ca8eacdf40..2990ddda41 100644
--- a/lib/kernel/test/gen_tcp_api_SUITE_data/gen_tcp_api_SUITE.c
+++ b/lib/kernel/test/gen_tcp_api_SUITE_data/gen_tcp_api_SUITE.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/gen_tcp_echo_SUITE.erl b/lib/kernel/test/gen_tcp_echo_SUITE.erl
index f4b67af8c8..57525f8015 100644
--- a/lib/kernel/test/gen_tcp_echo_SUITE.erl
+++ b/lib/kernel/test/gen_tcp_echo_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/gen_tcp_misc_SUITE.erl b/lib/kernel/test/gen_tcp_misc_SUITE.erl
index 7c3b011eb9..6b64c83fc2 100644
--- a/lib/kernel/test/gen_tcp_misc_SUITE.erl
+++ b/lib/kernel/test/gen_tcp_misc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -2320,70 +2320,82 @@ active_once_closed(Config) when is_list(Config) ->
%% Test the send_timeout socket option.
send_timeout(Config) when is_list(Config) ->
+ Dir = filename:dirname(code:which(?MODULE)),
+ {ok,RNode} = test_server:start_node(?UNIQ_NODE_NAME, slave,
+ [{args,"-pa " ++ Dir}]),
+
%% Basic
- BasicFun =
- fun(AutoClose) ->
- {Loop,A,RNode} = setup_timeout_sink(1000, AutoClose),
- {error,timeout} =
- Loop(fun() ->
- Res = gen_tcp:send(A,<<1:10000>>),
- %%erlang:display(Res),
- Res
- end),
- %% Check that the socket is not busy/closed...
- Error = after_send_timeout(AutoClose),
- {error,Error} = gen_tcp:send(A,<<"Hej">>),
- test_server:stop_node(RNode)
- end,
- BasicFun(false),
- BasicFun(true),
- %% Check timeout length
+ send_timeout_basic(false, RNode),
+ send_timeout_basic(true, RNode),
+
+ BinData = <<1:10000>>,
+
+ %% Check timeout length.
Self = self(),
Pid = spawn(fun() ->
- {Loop,A,RNode} = setup_timeout_sink(1000, true),
- {error,timeout} = Loop(fun() ->
- Res = gen_tcp:send(A,<<1:10000>>),
- %%erlang:display(Res),
- Self ! Res,
- Res
- end),
- test_server:stop_node(RNode)
+ A = setup_timeout_sink(RNode, 1000, true),
+ Send = fun() ->
+ Res = gen_tcp:send(A, BinData),
+ Self ! Res,
+ Res
+ end,
+ {error,timeout} = timeout_sink_loop(Send)
end),
Diff = get_max_diff(),
io:format("Max time for send: ~p~n",[Diff]),
true = (Diff > 500) and (Diff < 1500),
- %% Let test_server slave die...
+
+ %% Wait for the process to die.
Mon = erlang:monitor(process, Pid),
receive {'DOWN',Mon,process,Pid,_} -> ok end,
+
%% Check that parallell writers do not hang forever
- ParaFun =
- fun(AutoClose) ->
- {Loop,A,RNode} = setup_timeout_sink(1000, AutoClose),
- SenderFun = fun() ->
- {error,Error} =
- Loop(fun() ->
- gen_tcp:send(A, <<1:10000>>)
- end),
- Self ! {error,Error}
- end,
- spawn_link(SenderFun),
- spawn_link(SenderFun),
- receive
- {error,timeout} -> ok
- after 10000 ->
- exit(timeout)
- end,
- NextErr = after_send_timeout(AutoClose),
- receive
- {error,NextErr} -> ok
- after 10000 ->
- exit(timeout)
- end,
- {error,NextErr} = gen_tcp:send(A,<<"Hej">>),
- test_server:stop_node(RNode)
- end,
- ParaFun(false),
- ParaFun(true),
+ send_timeout_para(false, RNode),
+ send_timeout_para(true, RNode),
+
+ test_server:stop_node(RNode),
+
+ ok.
+
+send_timeout_basic(AutoClose, RNode) ->
+ BinData = <<1:10000>>,
+
+ A = setup_timeout_sink(RNode, 1000, AutoClose),
+ Send = fun() -> gen_tcp:send(A, BinData) end,
+ {error,timeout} = timeout_sink_loop(Send),
+
+ %% Check that the socket is not busy/closed...
+ Error = after_send_timeout(AutoClose),
+ {error,Error} = gen_tcp:send(A, <<"Hej">>),
+ ok.
+
+send_timeout_para(AutoClose, RNode) ->
+ BinData = <<1:10000>>,
+
+ A = setup_timeout_sink(RNode, 1000, AutoClose),
+ Self = self(),
+ SenderFun = fun() ->
+ Send = fun() -> gen_tcp:send(A, BinData) end,
+ {error,Error} = timeout_sink_loop(Send),
+ Self ! {error,Error}
+ end,
+ spawn_link(SenderFun),
+ spawn_link(SenderFun),
+
+ receive
+ {error,timeout} -> ok
+ after 10000 ->
+ exit(timeout)
+ end,
+
+ NextErr = after_send_timeout(AutoClose),
+ receive
+ {error,NextErr} -> ok
+ after 10000 ->
+ exit(timeout)
+ end,
+
+ {error,NextErr} = gen_tcp:send(A, <<"Hej">>),
ok.
mad_sender(S) ->
@@ -2406,31 +2418,33 @@ flush() ->
%% Test the send_timeout socket option for active sockets.
send_timeout_active(Config) when is_list(Config) ->
- %% Basic
- BasicFun =
- fun(AutoClose) ->
- {Loop,A,RNode,C} = setup_active_timeout_sink(1, AutoClose),
- inet:setopts(A, [{active, once}]),
- Mad = spawn_link(RNode,fun() -> mad_sender(C) end),
- {error,timeout} =
- Loop(fun() ->
- receive
- {tcp, _Sock, _Data} ->
- inet:setopts(A, [{active, once}]),
- Res = gen_tcp:send(A,lists:duplicate(1000, $a)),
- Res;
- Err ->
- io:format("sock closed: ~p~n", [Err]),
- Err
- end
- end),
- unlink(Mad),
- exit(Mad,kill),
- test_server:stop_node(RNode)
+ Dir = filename:dirname(code:which(?MODULE)),
+ {ok,RNode} = test_server:start_node(?UNIQ_NODE_NAME, slave,
+ [{args,"-pa " ++ Dir}]),
+ do_send_timeout_active(false, RNode),
+ do_send_timeout_active(true, RNode),
+ test_server:stop_node(RNode),
+ ok.
+
+do_send_timeout_active(AutoClose, RNode) ->
+ {A,C} = setup_active_timeout_sink(RNode, 1, AutoClose),
+ inet:setopts(A, [{active, once}]),
+ Mad = spawn_link(RNode, fun() -> mad_sender(C) end),
+ ListData = lists:duplicate(1000, $a),
+ F = fun() ->
+ receive
+ {tcp, _Sock, _Data} ->
+ inet:setopts(A, [{active, once}]),
+ Res = gen_tcp:send(A, ListData),
+ Res;
+ Err ->
+ io:format("sock closed: ~p~n", [Err]),
+ Err
+ end
end,
- BasicFun(false),
- flush(),
- BasicFun(true),
+ {error,timeout} = timeout_sink_loop(F),
+ unlink(Mad),
+ exit(Mad, kill),
flush(),
ok.
@@ -2475,7 +2489,7 @@ setup_closed_ao() ->
Dir = filename:dirname(code:which(?MODULE)),
{ok,R} = test_server:start_node(?UNIQ_NODE_NAME, slave,
[{args,"-pa " ++ Dir}]),
- Host = list_to_atom(lists:nth(2,string:tokens(atom_to_list(node()),"@"))),
+ Host = get_hostname(node()),
{ok, L} = gen_tcp:listen(0, [{active,false},{packet,2}]),
Fun = fun(F) ->
receive
@@ -2514,11 +2528,8 @@ setup_closed_ao() ->
test_server:stop_node(R),
{Loop,A}.
-setup_timeout_sink(Timeout, AutoClose) ->
- Dir = filename:dirname(code:which(?MODULE)),
- {ok,R} = test_server:start_node(?UNIQ_NODE_NAME, slave,
- [{args,"-pa " ++ Dir}]),
- Host = list_to_atom(lists:nth(2,string:tokens(atom_to_list(node()),"@"))),
+setup_timeout_sink(RNode, Timeout, AutoClose) ->
+ Host = get_hostname(node()),
{ok, L} = gen_tcp:listen(0, [{active,false},{packet,2},
{send_timeout,Timeout},
{send_timeout_close,AutoClose}]),
@@ -2529,7 +2540,7 @@ setup_timeout_sink(Timeout, AutoClose) ->
die -> ok
end
end,
- Pid = rpc:call(R,erlang,spawn,[fun() -> Fun(Fun) end]),
+ Pid = rpc:call(RNode, erlang, spawn, [fun() -> Fun(Fun) end]),
{ok, Port} = inet:port(L),
Remote = fun(Fu) ->
Pid ! {self(), Fu},
@@ -2543,36 +2554,23 @@ setup_timeout_sink(Timeout, AutoClose) ->
{ok,A} = gen_tcp:accept(L),
gen_tcp:send(A,"Hello"),
{ok, "Hello"} = Remote(fun() -> gen_tcp:recv(C,0) end),
- Loop2 = fun(_,_,0) ->
- {failure, timeout};
- (L2,F2,N) ->
- Ret = F2(),
- io:format("~p~n",[Ret]),
- case Ret of
- ok -> receive after 1 -> ok end,
- L2(L2,F2,N-1);
- Other -> Other
- end
- end,
- Loop = fun(F3) -> Loop2(Loop2,F3,1000) end,
- {Loop,A,R}.
-
-setup_active_timeout_sink(Timeout, AutoClose) ->
- Dir = filename:dirname(code:which(?MODULE)),
- {ok,R} = test_server:start_node(?UNIQ_NODE_NAME, slave,
- [{args,"-pa " ++ Dir}]),
- Host = list_to_atom(lists:nth(2,string:tokens(atom_to_list(node()),"@"))),
- {ok, L} = gen_tcp:listen(0, [binary,{active,false},{packet,0},{nodelay, true},{keepalive, true},
- {send_timeout,Timeout},
- {send_timeout_close,AutoClose}]),
+ A.
+
+setup_active_timeout_sink(RNode, Timeout, AutoClose) ->
+ Host = get_hostname(node()),
+ ListenOpts = [binary,{active,false},{packet,0},
+ {nodelay,true},{keepalive,true},
+ {send_timeout,Timeout},{send_timeout_close,AutoClose}],
+ {ok, L} = gen_tcp:listen(0, ListenOpts),
Fun = fun(F) ->
receive
{From,X} when is_function(X) ->
- From ! {self(),X()}, F(F);
+ From ! {self(),X()},
+ F(F);
die -> ok
end
end,
- Pid = rpc:call(R,erlang,spawn,[fun() -> Fun(Fun) end]),
+ Pid = rpc:call(RNode, erlang, spawn, [fun() -> Fun(Fun) end]),
{ok, Port} = inet:port(L),
Remote = fun(Fu) ->
Pid ! {self(), Fu},
@@ -2580,26 +2578,22 @@ setup_active_timeout_sink(Timeout, AutoClose) ->
end
end,
{ok, C} = Remote(fun() ->
- gen_tcp:connect(Host,Port,
- [{active,false}])
+ gen_tcp:connect(Host, Port, [{active,false}])
end),
{ok,A} = gen_tcp:accept(L),
- gen_tcp:send(A,"Hello"),
- {ok, "H"++_} = Remote(fun() -> gen_tcp:recv(C,0) end),
- Loop2 = fun(_,_,0) ->
- {failure, timeout};
- (L2,F2,N) ->
- Ret = F2(),
- io:format("~p~n",[Ret]),
- case Ret of
- ok -> receive after 1 -> ok end,
- L2(L2,F2,N-1);
- Other -> Other
- end
- end,
- Loop = fun(F3) -> Loop2(Loop2,F3,1000) end,
- {Loop,A,R,C}.
+ gen_tcp:send(A, "Hello"),
+ {ok, "H"++_} = Remote(fun() -> gen_tcp:recv(C, 0) end),
+ {A,C}.
+timeout_sink_loop(Action) ->
+ Ret = Action(),
+ case Ret of
+ ok ->
+ receive after 1 -> ok end,
+ timeout_sink_loop(Action);
+ Other ->
+ Other
+ end.
has_superfluous_schedulers() ->
case {erlang:system_info(schedulers),
@@ -3016,3 +3010,7 @@ oct_aloop(S,X,Times) ->
end.
ok({ok,V}) -> V.
+
+get_hostname(Name) ->
+ "@"++Host = lists:dropwhile(fun(C) -> C =/= $@ end, atom_to_list(Name)),
+ Host.
diff --git a/lib/kernel/test/gen_udp_SUITE.erl b/lib/kernel/test/gen_udp_SUITE.erl
index 19cdc03603..85dc6312ea 100644
--- a/lib/kernel/test/gen_udp_SUITE.erl
+++ b/lib/kernel/test/gen_udp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/global_SUITE.erl b/lib/kernel/test/global_SUITE.erl
index dd4cf82d4a..0a7f73c344 100644
--- a/lib/kernel/test/global_SUITE.erl
+++ b/lib/kernel/test/global_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/global_SUITE_data/global_trace.erl b/lib/kernel/test/global_SUITE_data/global_trace.erl
index 69d95f610d..b4af4ed76e 100644
--- a/lib/kernel/test/global_SUITE_data/global_trace.erl
+++ b/lib/kernel/test/global_SUITE_data/global_trace.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/global_group_SUITE.erl b/lib/kernel/test/global_group_SUITE.erl
index 8b9e1c5ae8..594ee6b537 100644
--- a/lib/kernel/test/global_group_SUITE.erl
+++ b/lib/kernel/test/global_group_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1153,6 +1153,16 @@ test_exit(Config) when is_list(Config) ->
rpc:call(Cp1, global_group, send, [king, "The message"]),
undefined = rpc:call(Cp1, global_group, whereis_name, [king]),
+ % make sure the search process really exits after every global_group operations
+ ProcessCount0 = rpc:call(Cp1, erlang, system_info, [process_count]),
+ _ = rpc:call(Cp1, global_group, whereis_name, [{node, Cp1nn}, whatever_pid_name]),
+ ProcessCount1 = rpc:call(Cp1, erlang, system_info, [process_count]),
+ _ = rpc:call(Cp1, global_group, registered_names, [{node, Cp1nn}]),
+ ProcessCount2 = rpc:call(Cp1, erlang, system_info, [process_count]),
+ _ = rpc:call(Cp1, global_group, send, [{node, Cp1nn}, whatever_pid_name, msg]),
+ ProcessCount3 = rpc:call(Cp1, erlang, system_info, [process_count]),
+ ProcessCount0 = ProcessCount1 = ProcessCount2 = ProcessCount3,
+
%% stop the nodes, and make sure names are released.
stop_node(Cp1),
stop_node(Cp2),
diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl
index dd6348c610..548b27db97 100644
--- a/lib/kernel/test/heart_SUITE.erl
+++ b/lib/kernel/test/heart_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -37,6 +37,11 @@
-define(DEFAULT_TIMEOUT_SECS, 120).
+-define(UNIQ_NODE_NAME,
+ list_to_atom(?MODULE_STRING ++ "__" ++
+ atom_to_list(?FUNCTION_NAME) ++ "_" ++
+ integer_to_list(erlang:unique_integer([positive])))).
+
init_per_testcase(_Func, Config) ->
Config.
@@ -118,7 +123,7 @@ start_check(Type, Name, Envs) ->
{ok, Node}.
start(Config) when is_list(Config) ->
- {ok, Node} = start_check(slave, heart_test),
+ {ok, Node} = start_check(slave, ?UNIQ_NODE_NAME),
rpc:call(Node, init, reboot, []),
receive
{nodedown, Node} -> ok
@@ -143,12 +148,12 @@ start(Config) when is_list(Config) ->
%% Purpose:
%% Check that a node is up and running after a init:restart/0
restart(Config) when is_list(Config) ->
- {ok, Node} = start_check(loose, heart_test),
+ {ok, Node} = start_check(loose, ?UNIQ_NODE_NAME),
rpc:call(Node, init, restart, []),
receive
{nodedown, Node} ->
ok
- after 2000 ->
+ after 5000 ->
ct:fail(node_not_closed)
end,
timer:sleep(5000),
@@ -159,7 +164,7 @@ restart(Config) when is_list(Config) ->
%% Purpose:
%% Check that a node is up and running after a init:reboot/0
reboot(Config) when is_list(Config) ->
- {ok, Node} = start_check(slave, heart_test),
+ {ok, Node} = start_check(slave, ?UNIQ_NODE_NAME),
ok = rpc:call(Node, heart, set_cmd,
[atom_to_list(lib:progname()) ++
@@ -193,7 +198,8 @@ node_start_immediately_after_crash(Config) when is_list(Config) ->
node_start_immediately_after_crash_test(Config) when is_list(Config) ->
- {ok, Node} = start_check(loose, heart_test_imm, [{"ERL_CRASH_DUMP_SECONDS", "0"}]),
+ {ok, Node} = start_check(loose, ?UNIQ_NODE_NAME,
+ [{"ERL_CRASH_DUMP_SECONDS", "0"}]),
ok = rpc:call(Node, heart, set_cmd,
[atom_to_list(lib:progname()) ++
@@ -243,7 +249,8 @@ node_start_soon_after_crash(Config) when is_list(Config) ->
end.
node_start_soon_after_crash_test(Config) when is_list(Config) ->
- {ok, Node} = start_check(loose, heart_test_soon, [{"ERL_CRASH_DUMP_SECONDS", "10"}]),
+ {ok, Node} = start_check(loose, ?UNIQ_NODE_NAME,
+ [{"ERL_CRASH_DUMP_SECONDS", "10"}]),
ok = rpc:call(Node, heart, set_cmd,
[atom_to_list(lib:progname()) ++
@@ -286,7 +293,7 @@ node_check_up_down(Node, Tmo) ->
%% Only tests bad command, correct behaviour is tested in reboot/1.
set_cmd(Config) when is_list(Config) ->
- {ok, Node} = start_check(slave, heart_test),
+ {ok, Node} = start_check(slave, ?UNIQ_NODE_NAME),
Cmd = wrong_atom,
{error, {bad_cmd, Cmd}} = rpc:call(Node, heart, set_cmd, [Cmd]),
Cmd1 = lists:duplicate(2047, $a),
@@ -299,7 +306,7 @@ set_cmd(Config) when is_list(Config) ->
ok.
clear_cmd(Config) when is_list(Config) ->
- {ok, Node} = start_check(slave, heart_test),
+ {ok, Node} = start_check(slave, ?UNIQ_NODE_NAME),
ok = rpc:call(Node, heart, set_cmd,
[atom_to_list(lib:progname()) ++
" -noshell -heart " ++ name(Node) ++ "&"]),
@@ -337,7 +344,7 @@ clear_cmd(Config) when is_list(Config) ->
ok.
get_cmd(Config) when is_list(Config) ->
- {ok, Node} = start_check(slave, heart_test),
+ {ok, Node} = start_check(slave, ?UNIQ_NODE_NAME),
Cmd = "test",
ok = rpc:call(Node, heart, set_cmd, [Cmd]),
{ok, Cmd} = rpc:call(Node, heart, get_cmd, []),
@@ -345,7 +352,7 @@ get_cmd(Config) when is_list(Config) ->
ok.
callback_api(Config) when is_list(Config) ->
- {ok, Node} = start_check(slave, heart_test),
+ {ok, Node} = start_check(slave, ?UNIQ_NODE_NAME),
none = rpc:call(Node, heart, get_callback, []),
M0 = self(),
F0 = ok,
@@ -379,7 +386,7 @@ callback_api(Config) when is_list(Config) ->
ok.
options_api(Config) when is_list(Config) ->
- {ok, Node} = start_check(slave, heart_test),
+ {ok, Node} = start_check(slave, ?UNIQ_NODE_NAME),
none = rpc:call(Node, heart, get_options, []),
M0 = self(),
F0 = ok,
@@ -474,7 +481,7 @@ kill_pid(Config) when is_list(Config) ->
ok = do_kill_pid(Config).
do_kill_pid(_Config) ->
- Name = heart_test,
+ Name = ?UNIQ_NODE_NAME,
Env = [{"HEART_COMMAND", "nickeNyfikenFarEttJobb"}],
{ok,Node} = start_node_run(Name,Env,suicide_by_heart,[]),
ok = wait_for_node(Node,15),
diff --git a/lib/kernel/test/ignore_cores.erl b/lib/kernel/test/ignore_cores.erl
index 24b95e273c..fde65bf5c4 100644
--- a/lib/kernel/test/ignore_cores.erl
+++ b/lib/kernel/test/ignore_cores.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/inet_SUITE.erl b/lib/kernel/test/inet_SUITE.erl
index ee10747b0a..c93b10fa1c 100644
--- a/lib/kernel/test/inet_SUITE.erl
+++ b/lib/kernel/test/inet_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1075,6 +1075,10 @@ check_ifopts(
#ifopts{addrs=Addrs}=Ifopts) ->
check_ifopts(Opts, Ifopts#ifopts{addrs=[{Addr,Netmask,Broadaddr}|Addrs]});
check_ifopts(
+ [{addr,Addr},{netmask,Netmask},{dstaddr,_}|Opts],
+ #ifopts{addrs=Addrs}=Ifopts) ->
+ check_ifopts(Opts, Ifopts#ifopts{addrs=[{Addr,Netmask}|Addrs]});
+check_ifopts(
[{addr,Addr},{netmask,Netmask}|Opts],
#ifopts{addrs=Addrs}=Ifopts) ->
check_ifopts(Opts, Ifopts#ifopts{addrs=[{Addr,Netmask}|Addrs]});
@@ -1118,9 +1122,13 @@ simple_netns(Config) when is_list(Config) ->
jog_netns_opt(L),
ok = gen_tcp:close(L),
%%
- {ok,S} = gen_sctp:open(),
- jog_netns_opt(S),
- ok = gen_sctp:close(S);
+ case gen_sctp:open() of
+ {ok,S} ->
+ jog_netns_opt(S),
+ ok = gen_sctp:close(S);
+ {error,eprotonosupport} ->
+ ok
+ end;
{error,einval} ->
{skip,"setns() not supported"}
end.
@@ -1134,24 +1142,28 @@ jog_netns_opt(S) ->
ok.
+%% Smoke test netns support.
simple_netns_open(Config) when is_list(Config) ->
+ %% Note: {error,enoent} will be returned if the run-time executable
+ %% has support for netns, but /proc/self/ns/net is missing.
case gen_udp:open(0, [binary,{netns,"/"},inet]) of
{ok,U} ->
ok = gen_udp:close(U);
- {error,E1} when E1 =:= einval; E1 =:= eperm ->
+ {error,E1} when E1 =:= einval; E1 =:= eperm; E1 =:= enoent ->
ok
end,
case gen_tcp:listen(0, [binary,{netns,"/"},inet]) of
{ok,T} ->
ok = gen_tcp:close(T);
- {error,E2} when E2 =:= einval; E2 =:= eperm ->
+ {error,E2} when E2 =:= einval; E2 =:= eperm; E2 =:= enoent ->
ok
end,
try gen_sctp:open(0, [binary,{netns,"/"},inet]) of
{ok,S} ->
ok = gen_sctp:close(S);
{error,E3}
- when E3 =:= einval; E3 =:= eperm; E3 =:= eprotonosupport ->
+ when E3 =:= einval; E3 =:= eperm;
+ E3 =:= enoent; E3 =:= eprotonosupport ->
ok
catch
error:badarg ->
diff --git a/lib/kernel/test/inet_res_SUITE.erl b/lib/kernel/test/inet_res_SUITE.erl
index a82849b2d3..9662d1fef5 100644
--- a/lib/kernel/test/inet_res_SUITE.erl
+++ b/lib/kernel/test/inet_res_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/inet_res_SUITE_data/run-named b/lib/kernel/test/inet_res_SUITE_data/run-named
index d9befb352d..d67295773a 100755
--- a/lib/kernel/test/inet_res_SUITE_data/run-named
+++ b/lib/kernel/test/inet_res_SUITE_data/run-named
@@ -2,7 +2,7 @@
##
## %CopyrightBegin%
##
-## Copyright Ericsson AB 2009-2012. All Rights Reserved.
+## Copyright Ericsson AB 2009-2016. All Rights Reserved.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/inet_sockopt_SUITE.erl b/lib/kernel/test/inet_sockopt_SUITE.erl
index d682398ba8..322b9f30fe 100644
--- a/lib/kernel/test/inet_sockopt_SUITE.erl
+++ b/lib/kernel/test/inet_sockopt_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/init_SUITE.erl b/lib/kernel/test/init_SUITE.erl
index 0fa97b585c..e7b44a714c 100644
--- a/lib/kernel/test/init_SUITE.erl
+++ b/lib/kernel/test/init_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -249,7 +249,8 @@ boot_var(Config) when is_list(Config) ->
{ok, Node} =
start_node(init_test,
"-boot " ++ BootScript ++
- " -boot_var TEST_VAR " ++ TEST_VAR),
+ " -boot_var TEST_VAR \"" ++
+ TEST_VAR ++ "\""),
stop_node(Node),
Res = ok;
_ ->
diff --git a/lib/kernel/test/interactive_shell_SUITE.erl b/lib/kernel/test/interactive_shell_SUITE.erl
index 414504e257..fc3706ba1e 100644
--- a/lib/kernel/test/interactive_shell_SUITE.erl
+++ b/lib/kernel/test/interactive_shell_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/kernel_SUITE.erl b/lib/kernel/test/kernel_SUITE.erl
index e02aa2aa8d..da56359294 100644
--- a/lib/kernel/test/kernel_SUITE.erl
+++ b/lib/kernel/test/kernel_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/kernel_config_SUITE.erl b/lib/kernel/test/kernel_config_SUITE.erl
index 5f36ad995c..9a4578917d 100644
--- a/lib/kernel/test/kernel_config_SUITE.erl
+++ b/lib/kernel/test/kernel_config_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/loose_node.erl b/lib/kernel/test/loose_node.erl
index ba293a821a..93530c2735 100644
--- a/lib/kernel/test/loose_node.erl
+++ b/lib/kernel/test/loose_node.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/multi_load_SUITE.erl b/lib/kernel/test/multi_load_SUITE.erl
index 9cba6fc06e..369e25ac64 100644
--- a/lib/kernel/test/multi_load_SUITE.erl
+++ b/lib/kernel/test/multi_load_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/myApp.erl b/lib/kernel/test/myApp.erl
index add1d5d500..0318e55c52 100644
--- a/lib/kernel/test/myApp.erl
+++ b/lib/kernel/test/myApp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/os_SUITE.erl b/lib/kernel/test/os_SUITE.erl
index 782d34416b..2a1e5016ec 100644
--- a/lib/kernel/test/os_SUITE.erl
+++ b/lib/kernel/test/os_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/pdict_SUITE.erl b/lib/kernel/test/pdict_SUITE.erl
index a89fdf4797..638d99176e 100644
--- a/lib/kernel/test/pdict_SUITE.erl
+++ b/lib/kernel/test/pdict_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/pg2_SUITE.erl b/lib/kernel/test/pg2_SUITE.erl
index 53544be763..fdc268cb5a 100644
--- a/lib/kernel/test/pg2_SUITE.erl
+++ b/lib/kernel/test/pg2_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/prim_file_SUITE.erl b/lib/kernel/test/prim_file_SUITE.erl
index 149cc6c816..cc7f2f6713 100644
--- a/lib/kernel/test/prim_file_SUITE.erl
+++ b/lib/kernel/test/prim_file_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1025,17 +1025,15 @@ file_write_file_info_opts(Config) when is_list(Config) ->
%% REM: determine date range dependent on time_t = Uint32 | Sint32 | Sint64
%% Determine time_t on os:type()?
- lists:foreach(fun
- ({FI, Opts}) ->
+ lists:foreach(fun ({FI, Opts}) ->
ok = ?PRIM_FILE_call(write_file_info, Handle, [Name, FI, Opts])
- end, [
- {#file_info{ mode=8#400, atime = Time, mtime = Time, ctime = Time}, Opts} ||
+ end, [ {#file_info{ mode=8#400, atime = Time, mtime = Time, ctime = Time}, Opts} ||
Opts <- [[{time, universal}],[{time, local}]],
Time <- [
{{1970,1,1},{0,0,0}},
{{1970,1,1},{0,0,1}},
- {{1969,12,31},{23,59,59}},
- {{1908,2,3},{23,59,59}},
+ % {{1969,12,31},{23,59,59}},
+ % {{1908,2,3},{23,59,59}},
{{2012,2,3},{23,59,59}},
{{2037,2,3},{23,59,59}},
erlang:localtime()
@@ -1070,8 +1068,9 @@ file_write_read_file_info_opts(Config) when is_list(Config) ->
ok = file_write_read_file_info_opts(Handle, Name, {{1989, 04, 28}, {19,30,22}}, [{time, local}]),
ok = file_write_read_file_info_opts(Handle, Name, {{1989, 04, 28}, {19,30,22}}, [{time, universal}]),
- ok = file_write_read_file_info_opts(Handle, Name, {{1930, 04, 28}, {19,30,22}}, [{time, local}]),
- ok = file_write_read_file_info_opts(Handle, Name, {{1930, 04, 28}, {19,30,22}}, [{time, universal}]),
+ %% will not work on platforms with unsigned time_t
+ %ok = file_write_read_file_info_opts(Handle, Name, {{1930, 04, 28}, {19,30,22}}, [{time, local}]),
+ %ok = file_write_read_file_info_opts(Handle, Name, {{1930, 04, 28}, {19,30,22}}, [{time, universal}]),
ok = file_write_read_file_info_opts(Handle, Name, 1, [{time, posix}]),
ok = file_write_read_file_info_opts(Handle, Name, -1, [{time, posix}]),
ok = file_write_read_file_info_opts(Handle, Name, 300000, [{time, posix}]),
@@ -1085,7 +1084,9 @@ file_write_read_file_info_opts(Handle, Name, Mtime, Opts) ->
{ok, FI} = ?PRIM_FILE_call(read_file_info, Handle, [Name, Opts]),
FI2 = FI#file_info{ mtime = Mtime },
ok = ?PRIM_FILE_call(write_file_info, Handle, [Name, FI2, Opts]),
- {ok, FI2} = ?PRIM_FILE_call(read_file_info, Handle, [Name, Opts]),
+ {ok, FI3} = ?PRIM_FILE_call(read_file_info, Handle, [Name, Opts]),
+ io:format("Expecting mtime = ~p, got ~p~n", [FI2#file_info.mtime, FI3#file_info.mtime]),
+ FI2 = FI3,
ok.
diff --git a/lib/kernel/test/ram_file_SUITE.erl b/lib/kernel/test/ram_file_SUITE.erl
index d90995923a..b0265393bd 100644
--- a/lib/kernel/test/ram_file_SUITE.erl
+++ b/lib/kernel/test/ram_file_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/rpc_SUITE.erl b/lib/kernel/test/rpc_SUITE.erl
index 101cff7ed2..1c72ddc87f 100644
--- a/lib/kernel/test/rpc_SUITE.erl
+++ b/lib/kernel/test/rpc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/sendfile_SUITE.erl b/lib/kernel/test/sendfile_SUITE.erl
index 775689a6bc..2673c38494 100644
--- a/lib/kernel/test/sendfile_SUITE.erl
+++ b/lib/kernel/test/sendfile_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/seq_trace_SUITE.erl b/lib/kernel/test/seq_trace_SUITE.erl
index 15128ab69c..be23a1933f 100644
--- a/lib/kernel/test/seq_trace_SUITE.erl
+++ b/lib/kernel/test/seq_trace_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -498,7 +498,13 @@ match_set_seq_token(Config) when is_list(Config) ->
exit(P2, timeout),
{error, "Test node hung"}
end,
- ok = check_match_set_seq_token_log(Lbl, Log),
+
+ %% Sort the log on Pid, as events from different processes
+ %% are not guaranteed to arrive in a certain order to the
+ %% tracer
+ SortedLog = lists:keysort(2, Log),
+
+ ok = check_match_set_seq_token_log(Lbl, SortedLog),
%%
stop_node(Sandbox),
ok.
@@ -551,13 +557,13 @@ do_match_set_seq_token(Label) ->
check_match_set_seq_token_log(
Label,
- [{trace,C,call,{?MODULE,countdown,[B,Ref]}, {0,Label,0,C,0}},
+ [{trace,B,call,{?MODULE,bounce, [Ref]}, {0,Label,2,B,1}},
+ {trace,B,call,{?MODULE,bounce, [Ref]}, {0,Label,4,B,3}},
+ {trace,B,call,{?MODULE,bounce, [Ref]}, {0,Label,6,B,5}},
+ {trace,C,call,{?MODULE,countdown,[B,Ref]}, {0,Label,0,C,0}},
{trace,C,call,{?MODULE,countdown,[B,Ref,3]},{0,Label,0,C,0}},
- {trace,B,call,{?MODULE,bounce, [Ref]}, {0,Label,2,B,1}},
{trace,C,call,{?MODULE,countdown,[B,Ref,2]},{0,Label,2,B,1}},
- {trace,B,call,{?MODULE,bounce, [Ref]}, {0,Label,4,B,3}},
{trace,C,call,{?MODULE,countdown,[B,Ref,1]},{0,Label,4,B,3}},
- {trace,B,call,{?MODULE,bounce, [Ref]}, {0,Label,6,B,5}},
{trace,C,call,{?MODULE,countdown,[B,Ref,0]},{0,Label,6,B,5}}
]) ->
ok;
@@ -787,7 +793,6 @@ start_tracer() ->
seq_trace:set_system_tracer(Pid),
Pid.
-
set_token_flags([]) ->
ok;
set_token_flags([no_timestamp|Flags]) ->
@@ -836,7 +841,7 @@ check_ts(strict_monotonic_timestamp, Ts) ->
ct:fail({unexpected_timestamp, Ts})
end,
ok.
-
+
start_node(Name, Param) ->
test_server:start_node(Name, slave, [{args, Param}]).
diff --git a/lib/kernel/test/standard_error_SUITE.erl b/lib/kernel/test/standard_error_SUITE.erl
index 97ead9b9fd..1d9026dc58 100644
--- a/lib/kernel/test/standard_error_SUITE.erl
+++ b/lib/kernel/test/standard_error_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/topApp.erl b/lib/kernel/test/topApp.erl
index 597268a5a2..6ea957fdc1 100644
--- a/lib/kernel/test/topApp.erl
+++ b/lib/kernel/test/topApp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/topApp2.erl b/lib/kernel/test/topApp2.erl
index 69d5c047be..aeb024f7a7 100644
--- a/lib/kernel/test/topApp2.erl
+++ b/lib/kernel/test/topApp2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/topApp3.erl b/lib/kernel/test/topApp3.erl
index e892aadcd0..917da3dad4 100644
--- a/lib/kernel/test/topApp3.erl
+++ b/lib/kernel/test/topApp3.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/wrap_log_reader_SUITE.erl b/lib/kernel/test/wrap_log_reader_SUITE.erl
index c797354a3e..40a016aed0 100644
--- a/lib/kernel/test/wrap_log_reader_SUITE.erl
+++ b/lib/kernel/test/wrap_log_reader_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/wrap_log_reader_SUITE_data/wrap_log_test.erl b/lib/kernel/test/wrap_log_reader_SUITE_data/wrap_log_test.erl
index 1cd1a4b0a4..38449b6bb3 100644
--- a/lib/kernel/test/wrap_log_reader_SUITE_data/wrap_log_test.erl
+++ b/lib/kernel/test/wrap_log_reader_SUITE_data/wrap_log_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/test/zlib_SUITE.erl b/lib/kernel/test/zlib_SUITE.erl
index 97e1e2caa5..f8257bd20c 100644
--- a/lib/kernel/test/zlib_SUITE.erl
+++ b/lib/kernel/test/zlib_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/kernel/vsn.mk b/lib/kernel/vsn.mk
index c8917ebc3c..e7d422d03c 100644
--- a/lib/kernel/vsn.mk
+++ b/lib/kernel/vsn.mk
@@ -1 +1 @@
-KERNEL_VSN = 4.2
+KERNEL_VSN = 5.0
diff --git a/lib/megaco/Makefile b/lib/megaco/Makefile
index 867953013d..1d0bb6778c 100644
--- a/lib/megaco/Makefile
+++ b/lib/megaco/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/configure.in b/lib/megaco/configure.in
index d012c07645..eaa875d0a3 100644
--- a/lib/megaco/configure.in
+++ b/lib/megaco/configure.in
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. -*-m4-*-
dnl
dnl %CopyrightBegin%
dnl
-dnl Copyright Ericsson AB 2001-2013. All Rights Reserved.
+dnl Copyright Ericsson AB 2001-2016. All Rights Reserved.
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
diff --git a/lib/megaco/doc/src/Makefile b/lib/megaco/doc/src/Makefile
index 582cb9035f..8b9ce31d0e 100644
--- a/lib/megaco/doc/src/Makefile
+++ b/lib/megaco/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2013. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/doc/src/book.xml b/lib/megaco/doc/src/book.xml
index ebf627cfdb..47ad9b6a5e 100644
--- a/lib/megaco/doc/src/book.xml
+++ b/lib/megaco/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/files.mk b/lib/megaco/doc/src/files.mk
index 62e3ab404e..5e7d849ab6 100644
--- a/lib/megaco/doc/src/files.mk
+++ b/lib/megaco/doc/src/files.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2010. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/doc/src/megaco.xml b/lib/megaco/doc/src/megaco.xml
index 6e0260f916..d4a7451bfc 100644
--- a/lib/megaco/doc/src/megaco.xml
+++ b/lib/megaco/doc/src/megaco.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_architecture.xml b/lib/megaco/doc/src/megaco_architecture.xml
index 6f3d0808d7..082268a076 100644
--- a/lib/megaco/doc/src/megaco_architecture.xml
+++ b/lib/megaco/doc/src/megaco_architecture.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_codec_meas.xml b/lib/megaco/doc/src/megaco_codec_meas.xml
index ad79bcec4d..13cc3eb834 100644
--- a/lib/megaco/doc/src/megaco_codec_meas.xml
+++ b/lib/megaco/doc/src/megaco_codec_meas.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_codec_mstone1.xml b/lib/megaco/doc/src/megaco_codec_mstone1.xml
index 0634d328e0..2ff959a648 100644
--- a/lib/megaco/doc/src/megaco_codec_mstone1.xml
+++ b/lib/megaco/doc/src/megaco_codec_mstone1.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_codec_mstone2.xml b/lib/megaco/doc/src/megaco_codec_mstone2.xml
index b9f3a8ff0c..3da30d4f99 100644
--- a/lib/megaco/doc/src/megaco_codec_mstone2.xml
+++ b/lib/megaco/doc/src/megaco_codec_mstone2.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_codec_transform.xml b/lib/megaco/doc/src/megaco_codec_transform.xml
index b068c01f3b..26b83c3799 100644
--- a/lib/megaco/doc/src/megaco_codec_transform.xml
+++ b/lib/megaco/doc/src/megaco_codec_transform.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_debug.xml b/lib/megaco/doc/src/megaco_debug.xml
index 701e17a54c..26fbfc002c 100644
--- a/lib/megaco/doc/src/megaco_debug.xml
+++ b/lib/megaco/doc/src/megaco_debug.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_edist_compress.xml b/lib/megaco/doc/src/megaco_edist_compress.xml
index 04c4ad1cd5..d5c7c7224d 100644
--- a/lib/megaco/doc/src/megaco_edist_compress.xml
+++ b/lib/megaco/doc/src/megaco_edist_compress.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2007</year><year>2013</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_encode.xml b/lib/megaco/doc/src/megaco_encode.xml
index c916eb227f..8bbf0f454c 100644
--- a/lib/megaco/doc/src/megaco_encode.xml
+++ b/lib/megaco/doc/src/megaco_encode.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_encoder.xml b/lib/megaco/doc/src/megaco_encoder.xml
index 9482ee643b..13c6ed324b 100644
--- a/lib/megaco/doc/src/megaco_encoder.xml
+++ b/lib/megaco/doc/src/megaco_encoder.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_examples.xml b/lib/megaco/doc/src/megaco_examples.xml
index 17b42c3fc9..ebcef4383b 100644
--- a/lib/megaco/doc/src/megaco_examples.xml
+++ b/lib/megaco/doc/src/megaco_examples.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_flex_scanner.xml b/lib/megaco/doc/src/megaco_flex_scanner.xml
index 68ff087afe..0856f3f429 100644
--- a/lib/megaco/doc/src/megaco_flex_scanner.xml
+++ b/lib/megaco/doc/src/megaco_flex_scanner.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_intro.xml b/lib/megaco/doc/src/megaco_intro.xml
index c33a74ebe5..bd2192b69c 100644
--- a/lib/megaco/doc/src/megaco_intro.xml
+++ b/lib/megaco/doc/src/megaco_intro.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_mib.xml b/lib/megaco/doc/src/megaco_mib.xml
index eb315014aa..e9bc34339c 100644
--- a/lib/megaco/doc/src/megaco_mib.xml
+++ b/lib/megaco/doc/src/megaco_mib.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_performance.xml b/lib/megaco/doc/src/megaco_performance.xml
index 5f1558de4a..d32f3296e9 100644
--- a/lib/megaco/doc/src/megaco_performance.xml
+++ b/lib/megaco/doc/src/megaco_performance.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_run.xml b/lib/megaco/doc/src/megaco_run.xml
index 4a8fc1f7d0..a20593fde2 100644
--- a/lib/megaco/doc/src/megaco_run.xml
+++ b/lib/megaco/doc/src/megaco_run.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_tcp.xml b/lib/megaco/doc/src/megaco_tcp.xml
index 95b391c0de..77aee32f6c 100644
--- a/lib/megaco/doc/src/megaco_tcp.xml
+++ b/lib/megaco/doc/src/megaco_tcp.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_transport.xml b/lib/megaco/doc/src/megaco_transport.xml
index 753d61a238..3002e9b74e 100644
--- a/lib/megaco/doc/src/megaco_transport.xml
+++ b/lib/megaco/doc/src/megaco_transport.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_transport_mechanisms.xml b/lib/megaco/doc/src/megaco_transport_mechanisms.xml
index 46d7113307..e2e32a8095 100644
--- a/lib/megaco/doc/src/megaco_transport_mechanisms.xml
+++ b/lib/megaco/doc/src/megaco_transport_mechanisms.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_udp.xml b/lib/megaco/doc/src/megaco_udp.xml
index 63b908cc87..b2559c77d5 100644
--- a/lib/megaco/doc/src/megaco_udp.xml
+++ b/lib/megaco/doc/src/megaco_udp.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/megaco_user.xml b/lib/megaco/doc/src/megaco_user.xml
index 9aae072896..067be15fe0 100644
--- a/lib/megaco/doc/src/megaco_user.xml
+++ b/lib/megaco/doc/src/megaco_user.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/notes.xml b/lib/megaco/doc/src/notes.xml
index 139a65b6fc..7deafc79e9 100644
--- a/lib/megaco/doc/src/notes.xml
+++ b/lib/megaco/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2014</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/notes_history.xml b/lib/megaco/doc/src/notes_history.xml
index 33dba78257..07e27542a5 100644
--- a/lib/megaco/doc/src/notes_history.xml
+++ b/lib/megaco/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/part.xml b/lib/megaco/doc/src/part.xml
index f411013c01..4b46f7a433 100644
--- a/lib/megaco/doc/src/part.xml
+++ b/lib/megaco/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/part_notes.xml b/lib/megaco/doc/src/part_notes.xml
index 26cc687247..7a838c5718 100644
--- a/lib/megaco/doc/src/part_notes.xml
+++ b/lib/megaco/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/part_notes_history.xml b/lib/megaco/doc/src/part_notes_history.xml
index c51758284a..0d8f1f2fb5 100644
--- a/lib/megaco/doc/src/part_notes_history.xml
+++ b/lib/megaco/doc/src/part_notes_history.xml
@@ -4,7 +4,7 @@
<part>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/doc/src/ref_man.xml b/lib/megaco/doc/src/ref_man.xml
index c855ae975d..395ac80e0d 100644
--- a/lib/megaco/doc/src/ref_man.xml
+++ b/lib/megaco/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/megaco/examples/meas/Makefile.in b/lib/megaco/examples/meas/Makefile.in
index d9e7aee452..293234ec69 100644
--- a/lib/megaco/examples/meas/Makefile.in
+++ b/lib/megaco/examples/meas/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2012. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/examples/meas/meas.sh.skel.src b/lib/megaco/examples/meas/meas.sh.skel.src
index a70e36f12f..9be8568314 100644
--- a/lib/megaco/examples/meas/meas.sh.skel.src
+++ b/lib/megaco/examples/meas/meas.sh.skel.src
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2012. All Rights Reserved.
+# Copyright Ericsson AB 2007-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/examples/meas/megaco_codec_meas.erl b/lib/megaco/examples/meas/megaco_codec_meas.erl
index 009b085a3f..a4cb8097ea 100644
--- a/lib/megaco/examples/meas/megaco_codec_meas.erl
+++ b/lib/megaco/examples/meas/megaco_codec_meas.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/examples/meas/megaco_codec_mstone1.erl b/lib/megaco/examples/meas/megaco_codec_mstone1.erl
index 1f73c97da4..8439e167a2 100644
--- a/lib/megaco/examples/meas/megaco_codec_mstone1.erl
+++ b/lib/megaco/examples/meas/megaco_codec_mstone1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/examples/meas/megaco_codec_mstone2.erl b/lib/megaco/examples/meas/megaco_codec_mstone2.erl
index 95a75b7d83..eb7c2cef71 100644
--- a/lib/megaco/examples/meas/megaco_codec_mstone2.erl
+++ b/lib/megaco/examples/meas/megaco_codec_mstone2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/examples/meas/megaco_codec_mstone_lib.erl b/lib/megaco/examples/meas/megaco_codec_mstone_lib.erl
index 02092bd8be..93515d0f16 100644
--- a/lib/megaco/examples/meas/megaco_codec_mstone_lib.erl
+++ b/lib/megaco/examples/meas/megaco_codec_mstone_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/examples/meas/megaco_codec_transform.erl b/lib/megaco/examples/meas/megaco_codec_transform.erl
index 7182ccd621..cfd8568fcf 100644
--- a/lib/megaco/examples/meas/megaco_codec_transform.erl
+++ b/lib/megaco/examples/meas/megaco_codec_transform.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/examples/meas/modules.mk b/lib/megaco/examples/meas/modules.mk
index 1f4e359e08..b8ea8a69f5 100644
--- a/lib/megaco/examples/meas/modules.mk
+++ b/lib/megaco/examples/meas/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/examples/meas/mstone1.sh.skel.src b/lib/megaco/examples/meas/mstone1.sh.skel.src
index 088739f88b..fc4b4a28ae 100644
--- a/lib/megaco/examples/meas/mstone1.sh.skel.src
+++ b/lib/megaco/examples/meas/mstone1.sh.skel.src
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2012. All Rights Reserved.
+# Copyright Ericsson AB 2007-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/examples/simple/Makefile b/lib/megaco/examples/simple/Makefile
index 720e1b29d2..00c0b7e65e 100644
--- a/lib/megaco/examples/simple/Makefile
+++ b/lib/megaco/examples/simple/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/examples/simple/megaco_simple_mg.erl b/lib/megaco/examples/simple/megaco_simple_mg.erl
index 3ad7bad8b1..83293b810d 100644
--- a/lib/megaco/examples/simple/megaco_simple_mg.erl
+++ b/lib/megaco/examples/simple/megaco_simple_mg.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/examples/simple/megaco_simple_mgc.erl b/lib/megaco/examples/simple/megaco_simple_mgc.erl
index aea8890af7..f324e17a3a 100644
--- a/lib/megaco/examples/simple/megaco_simple_mgc.erl
+++ b/lib/megaco/examples/simple/megaco_simple_mgc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/examples/simple/modules.mk b/lib/megaco/examples/simple/modules.mk
index a2a2ac4324..79a5d41f2f 100644
--- a/lib/megaco/examples/simple/modules.mk
+++ b/lib/megaco/examples/simple/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/include/megaco.hrl b/lib/megaco/include/megaco.hrl
index 2ea4029adf..a31d731177 100644
--- a/lib/megaco/include/megaco.hrl
+++ b/lib/megaco/include/megaco.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/Makefile b/lib/megaco/src/Makefile
index 38211272c0..5d6c8703b9 100644
--- a/lib/megaco/src/Makefile
+++ b/lib/megaco/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2009. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/app/Makefile b/lib/megaco/src/app/Makefile
index 8f8e6ecded..ab45548099 100644
--- a/lib/megaco/src/app/Makefile
+++ b/lib/megaco/src/app/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2012. All Rights Reserved.
+# Copyright Ericsson AB 2007-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/app/depend.mk b/lib/megaco/src/app/depend.mk
index 65ecdf25ad..1b1a88d04e 100644
--- a/lib/megaco/src/app/depend.mk
+++ b/lib/megaco/src/app/depend.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2009. All Rights Reserved.
+# Copyright Ericsson AB 2007-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/app/megaco.erl b/lib/megaco/src/app/megaco.erl
index 71d75e136d..f0c209fd6c 100644
--- a/lib/megaco/src/app/megaco.erl
+++ b/lib/megaco/src/app/megaco.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/app/megaco.mk b/lib/megaco/src/app/megaco.mk
index d6ad5eaf2e..d79785b61d 100644
--- a/lib/megaco/src/app/megaco.mk
+++ b/lib/megaco/src/app/megaco.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2009. All Rights Reserved.
+# Copyright Ericsson AB 2007-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/app/megaco_internal.hrl b/lib/megaco/src/app/megaco_internal.hrl
index 9f0b41ae73..b002891a0e 100644
--- a/lib/megaco/src/app/megaco_internal.hrl
+++ b/lib/megaco/src/app/megaco_internal.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/app/modules.mk b/lib/megaco/src/app/modules.mk
index 8eb7ddafbf..5cf45b002b 100644
--- a/lib/megaco/src/app/modules.mk
+++ b/lib/megaco/src/app/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2009. All Rights Reserved.
+# Copyright Ericsson AB 2007-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/Makefile b/lib/megaco/src/binary/Makefile
index 711fbb7665..b9643669f6 100644
--- a/lib/megaco/src/binary/Makefile
+++ b/lib/megaco/src/binary/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/depend.mk b/lib/megaco/src/binary/depend.mk
index 64efe41503..16901e39f0 100644
--- a/lib/megaco/src/binary/depend.mk
+++ b/lib/megaco/src/binary/depend.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2013. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_ber_encoder.erl b/lib/megaco/src/binary/megaco_ber_encoder.erl
index de00a411af..1efe18c870 100644
--- a/lib/megaco/src/binary/megaco_ber_encoder.erl
+++ b/lib/megaco/src/binary/megaco_ber_encoder.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_binary_encoder.erl b/lib/megaco/src/binary/megaco_binary_encoder.erl
index c82e67280b..e0bcd8fe4d 100644
--- a/lib/megaco/src/binary/megaco_binary_encoder.erl
+++ b/lib/megaco/src/binary/megaco_binary_encoder.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_binary_encoder_lib.erl b/lib/megaco/src/binary/megaco_binary_encoder_lib.erl
index e9c4475b35..5e9836dc48 100644
--- a/lib/megaco/src/binary/megaco_binary_encoder_lib.erl
+++ b/lib/megaco/src/binary/megaco_binary_encoder_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_binary_name_resolver_prev3a.erl b/lib/megaco/src/binary/megaco_binary_name_resolver_prev3a.erl
index 60f48b1d45..af97056d5d 100644
--- a/lib/megaco/src/binary/megaco_binary_name_resolver_prev3a.erl
+++ b/lib/megaco/src/binary/megaco_binary_name_resolver_prev3a.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_binary_name_resolver_prev3b.erl b/lib/megaco/src/binary/megaco_binary_name_resolver_prev3b.erl
index 1fedd55915..b543abe7c8 100644
--- a/lib/megaco/src/binary/megaco_binary_name_resolver_prev3b.erl
+++ b/lib/megaco/src/binary/megaco_binary_name_resolver_prev3b.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_binary_name_resolver_prev3c.erl b/lib/megaco/src/binary/megaco_binary_name_resolver_prev3c.erl
index 45b7bb365f..827cb3920b 100644
--- a/lib/megaco/src/binary/megaco_binary_name_resolver_prev3c.erl
+++ b/lib/megaco/src/binary/megaco_binary_name_resolver_prev3c.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_binary_name_resolver_v1.erl b/lib/megaco/src/binary/megaco_binary_name_resolver_v1.erl
index 35508fa13f..1fba60fed6 100644
--- a/lib/megaco/src/binary/megaco_binary_name_resolver_v1.erl
+++ b/lib/megaco/src/binary/megaco_binary_name_resolver_v1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_binary_name_resolver_v2.erl b/lib/megaco/src/binary/megaco_binary_name_resolver_v2.erl
index a5d8a7a433..45b9b32772 100644
--- a/lib/megaco/src/binary/megaco_binary_name_resolver_v2.erl
+++ b/lib/megaco/src/binary/megaco_binary_name_resolver_v2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_binary_name_resolver_v3.erl b/lib/megaco/src/binary/megaco_binary_name_resolver_v3.erl
index 8b33d6c317..f1482bc252 100644
--- a/lib/megaco/src/binary/megaco_binary_name_resolver_v3.erl
+++ b/lib/megaco/src/binary/megaco_binary_name_resolver_v3.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_binary_term_id.erl b/lib/megaco/src/binary/megaco_binary_term_id.erl
index 7416003158..3a52da0a46 100644
--- a/lib/megaco/src/binary/megaco_binary_term_id.erl
+++ b/lib/megaco/src/binary/megaco_binary_term_id.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_binary_term_id_gen.erl b/lib/megaco/src/binary/megaco_binary_term_id_gen.erl
index c0e83702f2..5eb68f5cf6 100644
--- a/lib/megaco/src/binary/megaco_binary_term_id_gen.erl
+++ b/lib/megaco/src/binary/megaco_binary_term_id_gen.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_binary_transformer_prev3a.erl b/lib/megaco/src/binary/megaco_binary_transformer_prev3a.erl
index 08bf461737..81cf0065dd 100644
--- a/lib/megaco/src/binary/megaco_binary_transformer_prev3a.erl
+++ b/lib/megaco/src/binary/megaco_binary_transformer_prev3a.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_binary_transformer_prev3b.erl b/lib/megaco/src/binary/megaco_binary_transformer_prev3b.erl
index 26000e3ae6..a6dab5d780 100644
--- a/lib/megaco/src/binary/megaco_binary_transformer_prev3b.erl
+++ b/lib/megaco/src/binary/megaco_binary_transformer_prev3b.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_binary_transformer_prev3c.erl b/lib/megaco/src/binary/megaco_binary_transformer_prev3c.erl
index 886bf20b93..63714be31d 100644
--- a/lib/megaco/src/binary/megaco_binary_transformer_prev3c.erl
+++ b/lib/megaco/src/binary/megaco_binary_transformer_prev3c.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_binary_transformer_v1.erl b/lib/megaco/src/binary/megaco_binary_transformer_v1.erl
index 105fb94a19..c3480a2e3c 100644
--- a/lib/megaco/src/binary/megaco_binary_transformer_v1.erl
+++ b/lib/megaco/src/binary/megaco_binary_transformer_v1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_binary_transformer_v2.erl b/lib/megaco/src/binary/megaco_binary_transformer_v2.erl
index 6a205993ce..9d1f795019 100644
--- a/lib/megaco/src/binary/megaco_binary_transformer_v2.erl
+++ b/lib/megaco/src/binary/megaco_binary_transformer_v2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_binary_transformer_v3.erl b/lib/megaco/src/binary/megaco_binary_transformer_v3.erl
index eed90aeaa9..130cabd70b 100644
--- a/lib/megaco/src/binary/megaco_binary_transformer_v3.erl
+++ b/lib/megaco/src/binary/megaco_binary_transformer_v3.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/megaco_per_encoder.erl b/lib/megaco/src/binary/megaco_per_encoder.erl
index d82006f615..3de33b1d60 100644
--- a/lib/megaco/src/binary/megaco_per_encoder.erl
+++ b/lib/megaco/src/binary/megaco_per_encoder.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/modules.mk b/lib/megaco/src/binary/modules.mk
index e4b0eac8d6..bf5db0e243 100644
--- a/lib/megaco/src/binary/modules.mk
+++ b/lib/megaco/src/binary/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2013. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/old/megaco_ber_bin_drv_encoder.erl b/lib/megaco/src/binary/old/megaco_ber_bin_drv_encoder.erl
index 76b4b4cdcf..e742ce59ba 100644
--- a/lib/megaco/src/binary/old/megaco_ber_bin_drv_encoder.erl
+++ b/lib/megaco/src/binary/old/megaco_ber_bin_drv_encoder.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/binary/old/megaco_per_bin_drv_encoder.erl b/lib/megaco/src/binary/old/megaco_per_bin_drv_encoder.erl
index a256eebe54..ace5dcc1b6 100644
--- a/lib/megaco/src/binary/old/megaco_per_bin_drv_encoder.erl
+++ b/lib/megaco/src/binary/old/megaco_per_bin_drv_encoder.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/Makefile b/lib/megaco/src/engine/Makefile
index 208942c3be..869b516b05 100644
--- a/lib/megaco/src/engine/Makefile
+++ b/lib/megaco/src/engine/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/depend.mk b/lib/megaco/src/engine/depend.mk
index 45e649b20d..96ee337e3a 100644
--- a/lib/megaco/src/engine/depend.mk
+++ b/lib/megaco/src/engine/depend.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2011. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_config.erl b/lib/megaco/src/engine/megaco_config.erl
index f6e977ac1e..1ceccf21d1 100644
--- a/lib/megaco/src/engine/megaco_config.erl
+++ b/lib/megaco/src/engine/megaco_config.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_config_misc.erl b/lib/megaco/src/engine/megaco_config_misc.erl
index fc0ea9cbc5..291959d2bd 100644
--- a/lib/megaco/src/engine/megaco_config_misc.erl
+++ b/lib/megaco/src/engine/megaco_config_misc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_digit_map.erl b/lib/megaco/src/engine/megaco_digit_map.erl
index 64ada63290..5b8b1f3b8f 100644
--- a/lib/megaco/src/engine/megaco_digit_map.erl
+++ b/lib/megaco/src/engine/megaco_digit_map.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_edist_compress.erl b/lib/megaco/src/engine/megaco_edist_compress.erl
index e9329d7515..987a5ec717 100644
--- a/lib/megaco/src/engine/megaco_edist_compress.erl
+++ b/lib/megaco/src/engine/megaco_edist_compress.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_encoder.erl b/lib/megaco/src/engine/megaco_encoder.erl
index 1788d6cc42..7ade349083 100644
--- a/lib/megaco/src/engine/megaco_encoder.erl
+++ b/lib/megaco/src/engine/megaco_encoder.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_erl_dist_encoder.erl b/lib/megaco/src/engine/megaco_erl_dist_encoder.erl
index 22c07d48ac..64204cc056 100644
--- a/lib/megaco/src/engine/megaco_erl_dist_encoder.erl
+++ b/lib/megaco/src/engine/megaco_erl_dist_encoder.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_erl_dist_encoder_mc.erl b/lib/megaco/src/engine/megaco_erl_dist_encoder_mc.erl
index b8d7625d48..a18536dd4e 100644
--- a/lib/megaco/src/engine/megaco_erl_dist_encoder_mc.erl
+++ b/lib/megaco/src/engine/megaco_erl_dist_encoder_mc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_filter.erl b/lib/megaco/src/engine/megaco_filter.erl
index 0f48844945..4bd3bd518b 100644
--- a/lib/megaco/src/engine/megaco_filter.erl
+++ b/lib/megaco/src/engine/megaco_filter.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_message_internal.hrl b/lib/megaco/src/engine/megaco_message_internal.hrl
index 40990190bd..7a97be22a0 100644
--- a/lib/megaco/src/engine/megaco_message_internal.hrl
+++ b/lib/megaco/src/engine/megaco_message_internal.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_messenger.erl b/lib/megaco/src/engine/megaco_messenger.erl
index 27688132fd..1d462b2140 100644
--- a/lib/megaco/src/engine/megaco_messenger.erl
+++ b/lib/megaco/src/engine/megaco_messenger.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_messenger_misc.erl b/lib/megaco/src/engine/megaco_messenger_misc.erl
index bdb97c7630..091f64e5b4 100644
--- a/lib/megaco/src/engine/megaco_messenger_misc.erl
+++ b/lib/megaco/src/engine/megaco_messenger_misc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_misc_sup.erl b/lib/megaco/src/engine/megaco_misc_sup.erl
index 8ad3f3ba43..f4d2133103 100644
--- a/lib/megaco/src/engine/megaco_misc_sup.erl
+++ b/lib/megaco/src/engine/megaco_misc_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_monitor.erl b/lib/megaco/src/engine/megaco_monitor.erl
index 267f41ca15..877509a776 100644
--- a/lib/megaco/src/engine/megaco_monitor.erl
+++ b/lib/megaco/src/engine/megaco_monitor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_sdp.erl b/lib/megaco/src/engine/megaco_sdp.erl
index 1c1daa5c1c..ac37b353f0 100644
--- a/lib/megaco/src/engine/megaco_sdp.erl
+++ b/lib/megaco/src/engine/megaco_sdp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_stats.erl b/lib/megaco/src/engine/megaco_stats.erl
index 746a3bd2f0..1ca9faedb4 100644
--- a/lib/megaco/src/engine/megaco_stats.erl
+++ b/lib/megaco/src/engine/megaco_stats.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_sup.erl b/lib/megaco/src/engine/megaco_sup.erl
index c7059e91d5..8cae7d33a3 100644
--- a/lib/megaco/src/engine/megaco_sup.erl
+++ b/lib/megaco/src/engine/megaco_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_timer.erl b/lib/megaco/src/engine/megaco_timer.erl
index c7367d939c..5972d5aa17 100644
--- a/lib/megaco/src/engine/megaco_timer.erl
+++ b/lib/megaco/src/engine/megaco_timer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_trans_sender.erl b/lib/megaco/src/engine/megaco_trans_sender.erl
index 98f6809f02..871a074171 100644
--- a/lib/megaco/src/engine/megaco_trans_sender.erl
+++ b/lib/megaco/src/engine/megaco_trans_sender.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_trans_sup.erl b/lib/megaco/src/engine/megaco_trans_sup.erl
index 6015a63ca3..44ba0af566 100644
--- a/lib/megaco/src/engine/megaco_trans_sup.erl
+++ b/lib/megaco/src/engine/megaco_trans_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_transport.erl b/lib/megaco/src/engine/megaco_transport.erl
index d6c9fa632b..7b5c35265c 100644
--- a/lib/megaco/src/engine/megaco_transport.erl
+++ b/lib/megaco/src/engine/megaco_transport.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/megaco_user_default.erl b/lib/megaco/src/engine/megaco_user_default.erl
index 907f3bebb9..a8cf9c79d0 100644
--- a/lib/megaco/src/engine/megaco_user_default.erl
+++ b/lib/megaco/src/engine/megaco_user_default.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/engine/modules.mk b/lib/megaco/src/engine/modules.mk
index e2fd495342..b74a096e40 100644
--- a/lib/megaco/src/engine/modules.mk
+++ b/lib/megaco/src/engine/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/flex/Makefile b/lib/megaco/src/flex/Makefile
index ee366bdda0..19317e41db 100644
--- a/lib/megaco/src/flex/Makefile
+++ b/lib/megaco/src/flex/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/flex/Makefile.in b/lib/megaco/src/flex/Makefile.in
index 045b6d871a..c37ad4d702 100644
--- a/lib/megaco/src/flex/Makefile.in
+++ b/lib/megaco/src/flex/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/flex/megaco_flex_scanner.erl b/lib/megaco/src/flex/megaco_flex_scanner.erl
index 921926211d..ef94594a8e 100644
--- a/lib/megaco/src/flex/megaco_flex_scanner.erl
+++ b/lib/megaco/src/flex/megaco_flex_scanner.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src b/lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src
index 0ac15fae4a..50cf5f7d5f 100644
--- a/lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src
+++ b/lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/flex/megaco_flex_scanner_handler.erl b/lib/megaco/src/flex/megaco_flex_scanner_handler.erl
index 1f7c127ccf..c478332e1c 100644
--- a/lib/megaco/src/flex/megaco_flex_scanner_handler.erl
+++ b/lib/megaco/src/flex/megaco_flex_scanner_handler.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/flex/modules.mk b/lib/megaco/src/flex/modules.mk
index e317b2ea51..b9e23afdcb 100644
--- a/lib/megaco/src/flex/modules.mk
+++ b/lib/megaco/src/flex/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/rules.mk b/lib/megaco/src/rules.mk
index 1ac98a16a1..8c5aa0126e 100644
--- a/lib/megaco/src/rules.mk
+++ b/lib/megaco/src/rules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2013. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/subdirs.mk b/lib/megaco/src/subdirs.mk
index abc1b88758..28d946273c 100644
--- a/lib/megaco/src/subdirs.mk
+++ b/lib/megaco/src/subdirs.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/tcp/Makefile b/lib/megaco/src/tcp/Makefile
index 0c546a881f..d07db3fa4b 100644
--- a/lib/megaco/src/tcp/Makefile
+++ b/lib/megaco/src/tcp/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/tcp/depend.mk b/lib/megaco/src/tcp/depend.mk
index a5f5f9b844..c775048534 100644
--- a/lib/megaco/src/tcp/depend.mk
+++ b/lib/megaco/src/tcp/depend.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2009. All Rights Reserved.
+# Copyright Ericsson AB 2007-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/tcp/megaco_tcp.erl b/lib/megaco/src/tcp/megaco_tcp.erl
index 25b7902c0b..1735439501 100644
--- a/lib/megaco/src/tcp/megaco_tcp.erl
+++ b/lib/megaco/src/tcp/megaco_tcp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/tcp/megaco_tcp.hrl b/lib/megaco/src/tcp/megaco_tcp.hrl
index 37963a7099..0c01f36b55 100644
--- a/lib/megaco/src/tcp/megaco_tcp.hrl
+++ b/lib/megaco/src/tcp/megaco_tcp.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/tcp/megaco_tcp_accept.erl b/lib/megaco/src/tcp/megaco_tcp_accept.erl
index f3e45d8cd4..5fcff200aa 100644
--- a/lib/megaco/src/tcp/megaco_tcp_accept.erl
+++ b/lib/megaco/src/tcp/megaco_tcp_accept.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/tcp/megaco_tcp_accept_sup.erl b/lib/megaco/src/tcp/megaco_tcp_accept_sup.erl
index 9a8369edd2..ecaad6769d 100644
--- a/lib/megaco/src/tcp/megaco_tcp_accept_sup.erl
+++ b/lib/megaco/src/tcp/megaco_tcp_accept_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/tcp/megaco_tcp_connection.erl b/lib/megaco/src/tcp/megaco_tcp_connection.erl
index 962c5928c1..136bfda2e5 100644
--- a/lib/megaco/src/tcp/megaco_tcp_connection.erl
+++ b/lib/megaco/src/tcp/megaco_tcp_connection.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/tcp/megaco_tcp_connection_sup.erl b/lib/megaco/src/tcp/megaco_tcp_connection_sup.erl
index 7c9ed0b17e..19aeb6b714 100644
--- a/lib/megaco/src/tcp/megaco_tcp_connection_sup.erl
+++ b/lib/megaco/src/tcp/megaco_tcp_connection_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/tcp/megaco_tcp_sup.erl b/lib/megaco/src/tcp/megaco_tcp_sup.erl
index aa8c9da539..8ec115dad8 100644
--- a/lib/megaco/src/tcp/megaco_tcp_sup.erl
+++ b/lib/megaco/src/tcp/megaco_tcp_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/tcp/modules.mk b/lib/megaco/src/tcp/modules.mk
index eb21eef60f..f687b60ced 100644
--- a/lib/megaco/src/tcp/modules.mk
+++ b/lib/megaco/src/tcp/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/Makefile b/lib/megaco/src/text/Makefile
index f4fc56a27d..8e7e82b276 100644
--- a/lib/megaco/src/text/Makefile
+++ b/lib/megaco/src/text/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/depend.mk b/lib/megaco/src/text/depend.mk
index 8eac5f9e3f..5001250afd 100644
--- a/lib/megaco/src/text/depend.mk
+++ b/lib/megaco/src/text/depend.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_compact_text_encoder.erl b/lib/megaco/src/text/megaco_compact_text_encoder.erl
index 799759d97b..74638308da 100644
--- a/lib/megaco/src/text/megaco_compact_text_encoder.erl
+++ b/lib/megaco/src/text/megaco_compact_text_encoder.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_compact_text_encoder_prev3a.erl b/lib/megaco/src/text/megaco_compact_text_encoder_prev3a.erl
index 77078a586b..c3a68d4ed7 100644
--- a/lib/megaco/src/text/megaco_compact_text_encoder_prev3a.erl
+++ b/lib/megaco/src/text/megaco_compact_text_encoder_prev3a.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_compact_text_encoder_prev3b.erl b/lib/megaco/src/text/megaco_compact_text_encoder_prev3b.erl
index 90d8e671bc..f98d1ea9ed 100644
--- a/lib/megaco/src/text/megaco_compact_text_encoder_prev3b.erl
+++ b/lib/megaco/src/text/megaco_compact_text_encoder_prev3b.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_compact_text_encoder_prev3c.erl b/lib/megaco/src/text/megaco_compact_text_encoder_prev3c.erl
index 210a8d2161..14cf1adb9b 100644
--- a/lib/megaco/src/text/megaco_compact_text_encoder_prev3c.erl
+++ b/lib/megaco/src/text/megaco_compact_text_encoder_prev3c.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_compact_text_encoder_v1.erl b/lib/megaco/src/text/megaco_compact_text_encoder_v1.erl
index e88fc67db3..fb6e9ee513 100644
--- a/lib/megaco/src/text/megaco_compact_text_encoder_v1.erl
+++ b/lib/megaco/src/text/megaco_compact_text_encoder_v1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_compact_text_encoder_v2.erl b/lib/megaco/src/text/megaco_compact_text_encoder_v2.erl
index d75bcd8a0d..459bf07190 100644
--- a/lib/megaco/src/text/megaco_compact_text_encoder_v2.erl
+++ b/lib/megaco/src/text/megaco_compact_text_encoder_v2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_compact_text_encoder_v3.erl b/lib/megaco/src/text/megaco_compact_text_encoder_v3.erl
index 8e1076a8fe..4f6f16d44b 100644
--- a/lib/megaco/src/text/megaco_compact_text_encoder_v3.erl
+++ b/lib/megaco/src/text/megaco_compact_text_encoder_v3.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_pretty_text_encoder.erl b/lib/megaco/src/text/megaco_pretty_text_encoder.erl
index 03246a50f7..7c47876e8e 100644
--- a/lib/megaco/src/text/megaco_pretty_text_encoder.erl
+++ b/lib/megaco/src/text/megaco_pretty_text_encoder.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_pretty_text_encoder_prev3a.erl b/lib/megaco/src/text/megaco_pretty_text_encoder_prev3a.erl
index dbf2c44e6f..78f916d928 100644
--- a/lib/megaco/src/text/megaco_pretty_text_encoder_prev3a.erl
+++ b/lib/megaco/src/text/megaco_pretty_text_encoder_prev3a.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_pretty_text_encoder_prev3b.erl b/lib/megaco/src/text/megaco_pretty_text_encoder_prev3b.erl
index a3f9c09783..87e17dfe85 100644
--- a/lib/megaco/src/text/megaco_pretty_text_encoder_prev3b.erl
+++ b/lib/megaco/src/text/megaco_pretty_text_encoder_prev3b.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_pretty_text_encoder_prev3c.erl b/lib/megaco/src/text/megaco_pretty_text_encoder_prev3c.erl
index 832e6cf9ec..386567b959 100644
--- a/lib/megaco/src/text/megaco_pretty_text_encoder_prev3c.erl
+++ b/lib/megaco/src/text/megaco_pretty_text_encoder_prev3c.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_pretty_text_encoder_v1.erl b/lib/megaco/src/text/megaco_pretty_text_encoder_v1.erl
index 2d6e69dc17..03ffc31b1e 100644
--- a/lib/megaco/src/text/megaco_pretty_text_encoder_v1.erl
+++ b/lib/megaco/src/text/megaco_pretty_text_encoder_v1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_pretty_text_encoder_v2.erl b/lib/megaco/src/text/megaco_pretty_text_encoder_v2.erl
index 93a855b540..fb260ac31b 100644
--- a/lib/megaco/src/text/megaco_pretty_text_encoder_v2.erl
+++ b/lib/megaco/src/text/megaco_pretty_text_encoder_v2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_pretty_text_encoder_v3.erl b/lib/megaco/src/text/megaco_pretty_text_encoder_v3.erl
index 9ca7f6012b..639cf95444 100644
--- a/lib/megaco/src/text/megaco_pretty_text_encoder_v3.erl
+++ b/lib/megaco/src/text/megaco_pretty_text_encoder_v3.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_gen_prev3a.hrl b/lib/megaco/src/text/megaco_text_gen_prev3a.hrl
index d5eaaf622d..ae4a990779 100644
--- a/lib/megaco/src/text/megaco_text_gen_prev3a.hrl
+++ b/lib/megaco/src/text/megaco_text_gen_prev3a.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_gen_prev3b.hrl b/lib/megaco/src/text/megaco_text_gen_prev3b.hrl
index 95478fac89..e7fb85d137 100644
--- a/lib/megaco/src/text/megaco_text_gen_prev3b.hrl
+++ b/lib/megaco/src/text/megaco_text_gen_prev3b.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_gen_prev3c.hrl b/lib/megaco/src/text/megaco_text_gen_prev3c.hrl
index b1299c2a4d..722e97a743 100644
--- a/lib/megaco/src/text/megaco_text_gen_prev3c.hrl
+++ b/lib/megaco/src/text/megaco_text_gen_prev3c.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_gen_v1.hrl b/lib/megaco/src/text/megaco_text_gen_v1.hrl
index 0399a5449b..38a0f6fd6b 100644
--- a/lib/megaco/src/text/megaco_text_gen_v1.hrl
+++ b/lib/megaco/src/text/megaco_text_gen_v1.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_gen_v2.hrl b/lib/megaco/src/text/megaco_text_gen_v2.hrl
index 35130d5229..d9443fb2e1 100644
--- a/lib/megaco/src/text/megaco_text_gen_v2.hrl
+++ b/lib/megaco/src/text/megaco_text_gen_v2.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_gen_v3.hrl b/lib/megaco/src/text/megaco_text_gen_v3.hrl
index 409803d17a..dc1f2b9665 100644
--- a/lib/megaco/src/text/megaco_text_gen_v3.hrl
+++ b/lib/megaco/src/text/megaco_text_gen_v3.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_mini_decoder.erl b/lib/megaco/src/text/megaco_text_mini_decoder.erl
index 5a8516bfbc..9d2c93d0cf 100644
--- a/lib/megaco/src/text/megaco_text_mini_decoder.erl
+++ b/lib/megaco/src/text/megaco_text_mini_decoder.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_mini_parser.hrl b/lib/megaco/src/text/megaco_text_mini_parser.hrl
index 9f276b9682..487958af08 100644
--- a/lib/megaco/src/text/megaco_text_mini_parser.hrl
+++ b/lib/megaco/src/text/megaco_text_mini_parser.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_mini_parser.yrl b/lib/megaco/src/text/megaco_text_mini_parser.yrl
index 5a0983b439..af3050a05b 100644
--- a/lib/megaco/src/text/megaco_text_mini_parser.yrl
+++ b/lib/megaco/src/text/megaco_text_mini_parser.yrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_parser_prev3a.hrl b/lib/megaco/src/text/megaco_text_parser_prev3a.hrl
index 2b1b9f3145..edda850c3a 100644
--- a/lib/megaco/src/text/megaco_text_parser_prev3a.hrl
+++ b/lib/megaco/src/text/megaco_text_parser_prev3a.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_parser_prev3a.yrl b/lib/megaco/src/text/megaco_text_parser_prev3a.yrl
index 6ce82514d3..0a07fbec2b 100644
--- a/lib/megaco/src/text/megaco_text_parser_prev3a.yrl
+++ b/lib/megaco/src/text/megaco_text_parser_prev3a.yrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_parser_prev3b.hrl b/lib/megaco/src/text/megaco_text_parser_prev3b.hrl
index bca64ac37e..4eaa3733c4 100644
--- a/lib/megaco/src/text/megaco_text_parser_prev3b.hrl
+++ b/lib/megaco/src/text/megaco_text_parser_prev3b.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_parser_prev3b.yrl b/lib/megaco/src/text/megaco_text_parser_prev3b.yrl
index 6fc23dae82..133938d7f7 100644
--- a/lib/megaco/src/text/megaco_text_parser_prev3b.yrl
+++ b/lib/megaco/src/text/megaco_text_parser_prev3b.yrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_parser_prev3c.hrl b/lib/megaco/src/text/megaco_text_parser_prev3c.hrl
index 89dc6accbd..d2faad09d9 100644
--- a/lib/megaco/src/text/megaco_text_parser_prev3c.hrl
+++ b/lib/megaco/src/text/megaco_text_parser_prev3c.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_parser_prev3c.yrl b/lib/megaco/src/text/megaco_text_parser_prev3c.yrl
index 42a8ae627d..d78f4ff99c 100644
--- a/lib/megaco/src/text/megaco_text_parser_prev3c.yrl
+++ b/lib/megaco/src/text/megaco_text_parser_prev3c.yrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_parser_v1.hrl b/lib/megaco/src/text/megaco_text_parser_v1.hrl
index b5913d01f3..f48ac745f0 100644
--- a/lib/megaco/src/text/megaco_text_parser_v1.hrl
+++ b/lib/megaco/src/text/megaco_text_parser_v1.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_parser_v1.yrl b/lib/megaco/src/text/megaco_text_parser_v1.yrl
index c231cdf7ca..cea6a958e5 100644
--- a/lib/megaco/src/text/megaco_text_parser_v1.yrl
+++ b/lib/megaco/src/text/megaco_text_parser_v1.yrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_parser_v2.hrl b/lib/megaco/src/text/megaco_text_parser_v2.hrl
index 0615c75ba1..f3c2f69193 100644
--- a/lib/megaco/src/text/megaco_text_parser_v2.hrl
+++ b/lib/megaco/src/text/megaco_text_parser_v2.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_parser_v2.yrl b/lib/megaco/src/text/megaco_text_parser_v2.yrl
index 09e87c59ab..f8fe762ee1 100644
--- a/lib/megaco/src/text/megaco_text_parser_v2.yrl
+++ b/lib/megaco/src/text/megaco_text_parser_v2.yrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_parser_v3.hrl b/lib/megaco/src/text/megaco_text_parser_v3.hrl
index efe81c9e7a..38822e4952 100644
--- a/lib/megaco/src/text/megaco_text_parser_v3.hrl
+++ b/lib/megaco/src/text/megaco_text_parser_v3.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_parser_v3.yrl b/lib/megaco/src/text/megaco_text_parser_v3.yrl
index dc5cd5bcc7..54739af82e 100644
--- a/lib/megaco/src/text/megaco_text_parser_v3.yrl
+++ b/lib/megaco/src/text/megaco_text_parser_v3.yrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_scanner.erl b/lib/megaco/src/text/megaco_text_scanner.erl
index 790b2beb33..88194b8083 100644
--- a/lib/megaco/src/text/megaco_text_scanner.erl
+++ b/lib/megaco/src/text/megaco_text_scanner.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/megaco_text_tokens.hrl b/lib/megaco/src/text/megaco_text_tokens.hrl
index 28c07e91a2..dc9fadcbe5 100644
--- a/lib/megaco/src/text/megaco_text_tokens.hrl
+++ b/lib/megaco/src/text/megaco_text_tokens.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/text/modules.mk b/lib/megaco/src/text/modules.mk
index 09aebb7c6e..46bf7d57ba 100644
--- a/lib/megaco/src/text/modules.mk
+++ b/lib/megaco/src/text/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/udp/Makefile b/lib/megaco/src/udp/Makefile
index 7288c205f0..028a63e98e 100644
--- a/lib/megaco/src/udp/Makefile
+++ b/lib/megaco/src/udp/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/udp/megaco_udp.erl b/lib/megaco/src/udp/megaco_udp.erl
index b7a1eb3e2d..01aaa90f6c 100644
--- a/lib/megaco/src/udp/megaco_udp.erl
+++ b/lib/megaco/src/udp/megaco_udp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/udp/megaco_udp.hrl b/lib/megaco/src/udp/megaco_udp.hrl
index 7e36fa144b..b5422d28c9 100644
--- a/lib/megaco/src/udp/megaco_udp.hrl
+++ b/lib/megaco/src/udp/megaco_udp.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/udp/megaco_udp_server.erl b/lib/megaco/src/udp/megaco_udp_server.erl
index 537a0ad8df..1df9a76671 100644
--- a/lib/megaco/src/udp/megaco_udp_server.erl
+++ b/lib/megaco/src/udp/megaco_udp_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/udp/megaco_udp_sup.erl b/lib/megaco/src/udp/megaco_udp_sup.erl
index aed5ec11d8..c755907c95 100644
--- a/lib/megaco/src/udp/megaco_udp_sup.erl
+++ b/lib/megaco/src/udp/megaco_udp_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/src/udp/modules.mk b/lib/megaco/src/udp/modules.mk
index 6a9618cefe..c7d6fec9d5 100644
--- a/lib/megaco/src/udp/modules.mk
+++ b/lib/megaco/src/udp/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/subdirs.mk b/lib/megaco/subdirs.mk
index cdc6d7b9c4..d331e34a0a 100644
--- a/lib/megaco/subdirs.mk
+++ b/lib/megaco/subdirs.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/Makefile b/lib/megaco/test/Makefile
index d621b0f16d..4ddd73eea1 100644
--- a/lib/megaco/test/Makefile
+++ b/lib/megaco/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_SUITE.erl b/lib/megaco/test/megaco_SUITE.erl
index 1cd6a78d07..38590f9fee 100644
--- a/lib/megaco/test/megaco_SUITE.erl
+++ b/lib/megaco/test/megaco_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_actions_test.erl b/lib/megaco/test/megaco_actions_test.erl
index b554622a27..fcbe4f12fa 100644
--- a/lib/megaco/test/megaco_actions_test.erl
+++ b/lib/megaco/test/megaco_actions_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_app_test.erl b/lib/megaco/test/megaco_app_test.erl
index 78ca2d4774..346a123c66 100644
--- a/lib/megaco/test/megaco_app_test.erl
+++ b/lib/megaco/test/megaco_app_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_appup_mg.erl b/lib/megaco/test/megaco_appup_mg.erl
index 3ff051b0bc..d05e0ff18c 100644
--- a/lib/megaco/test/megaco_appup_mg.erl
+++ b/lib/megaco/test/megaco_appup_mg.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_appup_mgc.erl b/lib/megaco/test/megaco_appup_mgc.erl
index 90e27e8728..42a95306f0 100644
--- a/lib/megaco/test/megaco_appup_mgc.erl
+++ b/lib/megaco/test/megaco_appup_mgc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_appup_test.erl b/lib/megaco/test/megaco_appup_test.erl
index 7809dd4e09..325e7a6096 100644
--- a/lib/megaco/test/megaco_appup_test.erl
+++ b/lib/megaco/test/megaco_appup_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_binary_term_id_test.erl b/lib/megaco/test/megaco_binary_term_id_test.erl
index 47520bafe1..b300379fae 100644
--- a/lib/megaco/test/megaco_binary_term_id_test.erl
+++ b/lib/megaco/test/megaco_binary_term_id_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_call_flow_test.erl b/lib/megaco/test/megaco_call_flow_test.erl
index 2c3a08ca0a..eb4574862d 100644
--- a/lib/megaco/test/megaco_call_flow_test.erl
+++ b/lib/megaco/test/megaco_call_flow_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_codec_flex_lib.erl b/lib/megaco/test/megaco_codec_flex_lib.erl
index 13ee8e824a..e322c21dad 100644
--- a/lib/megaco/test/megaco_codec_flex_lib.erl
+++ b/lib/megaco/test/megaco_codec_flex_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_codec_mini_test.erl b/lib/megaco/test/megaco_codec_mini_test.erl
index 536ac51798..fb23eb4680 100644
--- a/lib/megaco/test/megaco_codec_mini_test.erl
+++ b/lib/megaco/test/megaco_codec_mini_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_codec_prev3a_test.erl b/lib/megaco/test/megaco_codec_prev3a_test.erl
index 6486a8eaf9..c68c3b12f6 100644
--- a/lib/megaco/test/megaco_codec_prev3a_test.erl
+++ b/lib/megaco/test/megaco_codec_prev3a_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_codec_prev3b_test.erl b/lib/megaco/test/megaco_codec_prev3b_test.erl
index 04614df545..815a484426 100644
--- a/lib/megaco/test/megaco_codec_prev3b_test.erl
+++ b/lib/megaco/test/megaco_codec_prev3b_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_codec_prev3c_test.erl b/lib/megaco/test/megaco_codec_prev3c_test.erl
index cb3efa7cf9..f308ba3774 100644
--- a/lib/megaco/test/megaco_codec_prev3c_test.erl
+++ b/lib/megaco/test/megaco_codec_prev3c_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_codec_test.erl b/lib/megaco/test/megaco_codec_test.erl
index 118937fc6f..007136f83e 100644
--- a/lib/megaco/test/megaco_codec_test.erl
+++ b/lib/megaco/test/megaco_codec_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_codec_test_lib.erl b/lib/megaco/test/megaco_codec_test_lib.erl
index dcae348e89..6eee5caaaa 100644
--- a/lib/megaco/test/megaco_codec_test_lib.erl
+++ b/lib/megaco/test/megaco_codec_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_codec_v1_test.erl b/lib/megaco/test/megaco_codec_v1_test.erl
index a0ddacc20a..3548a08984 100644
--- a/lib/megaco/test/megaco_codec_v1_test.erl
+++ b/lib/megaco/test/megaco_codec_v1_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_codec_v2_test.erl b/lib/megaco/test/megaco_codec_v2_test.erl
index afdfc48900..fc3b1f886c 100644
--- a/lib/megaco/test/megaco_codec_v2_test.erl
+++ b/lib/megaco/test/megaco_codec_v2_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_codec_v3_test.erl b/lib/megaco/test/megaco_codec_v3_test.erl
index 4c7e17d10a..9cc3fd6c1c 100644
--- a/lib/megaco/test/megaco_codec_v3_test.erl
+++ b/lib/megaco/test/megaco_codec_v3_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_config_test.erl b/lib/megaco/test/megaco_config_test.erl
index 1f619856f8..02e06a722a 100644
--- a/lib/megaco/test/megaco_config_test.erl
+++ b/lib/megaco/test/megaco_config_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_digit_map_test.erl b/lib/megaco/test/megaco_digit_map_test.erl
index 72426d2305..998e829b67 100644
--- a/lib/megaco/test/megaco_digit_map_test.erl
+++ b/lib/megaco/test/megaco_digit_map_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_examples_test.erl b/lib/megaco/test/megaco_examples_test.erl
index ddaad4be3c..45a6c5011a 100644
--- a/lib/megaco/test/megaco_examples_test.erl
+++ b/lib/megaco/test/megaco_examples_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_flex_test.erl b/lib/megaco/test/megaco_flex_test.erl
index 928ff719cf..999d1abc6c 100644
--- a/lib/megaco/test/megaco_flex_test.erl
+++ b/lib/megaco/test/megaco_flex_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_load_test.erl b/lib/megaco/test/megaco_load_test.erl
index 9599a5221d..511e5a2e8e 100644
--- a/lib/megaco/test/megaco_load_test.erl
+++ b/lib/megaco/test/megaco_load_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_mess_otp8212_test.erl b/lib/megaco/test/megaco_mess_otp8212_test.erl
index 25c21bea35..1fcd033566 100644
--- a/lib/megaco/test/megaco_mess_otp8212_test.erl
+++ b/lib/megaco/test/megaco_mess_otp8212_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_mess_test.erl b/lib/megaco/test/megaco_mess_test.erl
index 2f11a6ba1b..7af6f26bf1 100644
--- a/lib/megaco/test/megaco_mess_test.erl
+++ b/lib/megaco/test/megaco_mess_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_mess_user_test.erl b/lib/megaco/test/megaco_mess_user_test.erl
index 4c284af93e..b5a554112e 100644
--- a/lib/megaco/test/megaco_mess_user_test.erl
+++ b/lib/megaco/test/megaco_mess_user_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_mib_test.erl b/lib/megaco/test/megaco_mib_test.erl
index be6741439d..d644d6bc09 100644
--- a/lib/megaco/test/megaco_mib_test.erl
+++ b/lib/megaco/test/megaco_mib_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_mreq_test.erl b/lib/megaco/test/megaco_mreq_test.erl
index 2d6d936f75..e6a5ed3181 100644
--- a/lib/megaco/test/megaco_mreq_test.erl
+++ b/lib/megaco/test/megaco_mreq_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_pending_limit_test.erl b/lib/megaco/test/megaco_pending_limit_test.erl
index 5440fadec8..ef3b7e51cf 100644
--- a/lib/megaco/test/megaco_pending_limit_test.erl
+++ b/lib/megaco/test/megaco_pending_limit_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_profile.erl b/lib/megaco/test/megaco_profile.erl
index 86daad173c..6b0dfee23d 100644
--- a/lib/megaco/test/megaco_profile.erl
+++ b/lib/megaco/test/megaco_profile.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_sdp_test.erl b/lib/megaco/test/megaco_sdp_test.erl
index 95ada63273..4065b6e629 100644
--- a/lib/megaco/test/megaco_sdp_test.erl
+++ b/lib/megaco/test/megaco_sdp_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_segment_test.erl b/lib/megaco/test/megaco_segment_test.erl
index abd63ac00f..ddb8b9f06b 100644
--- a/lib/megaco/test/megaco_segment_test.erl
+++ b/lib/megaco/test/megaco_segment_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_tc_controller.erl b/lib/megaco/test/megaco_tc_controller.erl
index 979c2e3be8..730bbcf873 100644
--- a/lib/megaco/test/megaco_tc_controller.erl
+++ b/lib/megaco/test/megaco_tc_controller.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_tcp_test.erl b/lib/megaco/test/megaco_tcp_test.erl
index c72f4f07b0..a1865ad690 100644
--- a/lib/megaco/test/megaco_tcp_test.erl
+++ b/lib/megaco/test/megaco_tcp_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_test_deliver.erl b/lib/megaco/test/megaco_test_deliver.erl
index 307caad73b..78033f0e36 100644
--- a/lib/megaco/test/megaco_test_deliver.erl
+++ b/lib/megaco/test/megaco_test_deliver.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_test_generator.erl b/lib/megaco/test/megaco_test_generator.erl
index 7f9714aec9..63f66bda07 100644
--- a/lib/megaco/test/megaco_test_generator.erl
+++ b/lib/megaco/test/megaco_test_generator.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_test_generator_lib.erl b/lib/megaco/test/megaco_test_generator_lib.erl
index fd9dd1c491..d19728e009 100644
--- a/lib/megaco/test/megaco_test_generator_lib.erl
+++ b/lib/megaco/test/megaco_test_generator_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_test_generic_transport.erl b/lib/megaco/test/megaco_test_generic_transport.erl
index 81ea3e728e..3185e4c6b6 100644
--- a/lib/megaco/test/megaco_test_generic_transport.erl
+++ b/lib/megaco/test/megaco_test_generic_transport.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_test_lib.erl b/lib/megaco/test/megaco_test_lib.erl
index 2339955e55..3934a3a957 100644
--- a/lib/megaco/test/megaco_test_lib.erl
+++ b/lib/megaco/test/megaco_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_test_lib.hrl b/lib/megaco/test/megaco_test_lib.hrl
index e066b805e6..79a1493c40 100644
--- a/lib/megaco/test/megaco_test_lib.hrl
+++ b/lib/megaco/test/megaco_test_lib.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_test_megaco_generator.erl b/lib/megaco/test/megaco_test_megaco_generator.erl
index 07b9a806f4..8a37fa33fe 100644
--- a/lib/megaco/test/megaco_test_megaco_generator.erl
+++ b/lib/megaco/test/megaco_test_megaco_generator.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_test_mg.erl b/lib/megaco/test/megaco_test_mg.erl
index 667e5babdb..d6a9a8c314 100644
--- a/lib/megaco/test/megaco_test_mg.erl
+++ b/lib/megaco/test/megaco_test_mg.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_test_mgc.erl b/lib/megaco/test/megaco_test_mgc.erl
index 8b6fe3f611..045bc7c9fd 100644
--- a/lib/megaco/test/megaco_test_mgc.erl
+++ b/lib/megaco/test/megaco_test_mgc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_test_msg_prev3a_lib.erl b/lib/megaco/test/megaco_test_msg_prev3a_lib.erl
index 6bdb82ce06..baea62c552 100644
--- a/lib/megaco/test/megaco_test_msg_prev3a_lib.erl
+++ b/lib/megaco/test/megaco_test_msg_prev3a_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_test_msg_prev3b_lib.erl b/lib/megaco/test/megaco_test_msg_prev3b_lib.erl
index 6fc8e8de35..599dc791f6 100644
--- a/lib/megaco/test/megaco_test_msg_prev3b_lib.erl
+++ b/lib/megaco/test/megaco_test_msg_prev3b_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_test_msg_prev3c_lib.erl b/lib/megaco/test/megaco_test_msg_prev3c_lib.erl
index 3eff0d9a59..6f417f848e 100644
--- a/lib/megaco/test/megaco_test_msg_prev3c_lib.erl
+++ b/lib/megaco/test/megaco_test_msg_prev3c_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_test_msg_v1_lib.erl b/lib/megaco/test/megaco_test_msg_v1_lib.erl
index 03f3561218..fe6c02db10 100644
--- a/lib/megaco/test/megaco_test_msg_v1_lib.erl
+++ b/lib/megaco/test/megaco_test_msg_v1_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_test_msg_v2_lib.erl b/lib/megaco/test/megaco_test_msg_v2_lib.erl
index 27f65faf32..e1ec99108d 100644
--- a/lib/megaco/test/megaco_test_msg_v2_lib.erl
+++ b/lib/megaco/test/megaco_test_msg_v2_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_test_msg_v3_lib.erl b/lib/megaco/test/megaco_test_msg_v3_lib.erl
index e214215b10..5264791370 100644
--- a/lib/megaco/test/megaco_test_msg_v3_lib.erl
+++ b/lib/megaco/test/megaco_test_msg_v3_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_test_tcp_generator.erl b/lib/megaco/test/megaco_test_tcp_generator.erl
index 2ee0259a9a..ec256f7a87 100644
--- a/lib/megaco/test/megaco_test_tcp_generator.erl
+++ b/lib/megaco/test/megaco_test_tcp_generator.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_timer_test.erl b/lib/megaco/test/megaco_timer_test.erl
index bd64fe9c17..34479f7838 100644
--- a/lib/megaco/test/megaco_timer_test.erl
+++ b/lib/megaco/test/megaco_timer_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_trans_test.erl b/lib/megaco/test/megaco_trans_test.erl
index ef527662af..9786307860 100644
--- a/lib/megaco/test/megaco_trans_test.erl
+++ b/lib/megaco/test/megaco_trans_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/megaco_udp_test.erl b/lib/megaco/test/megaco_udp_test.erl
index b461925d94..cc03ec733a 100644
--- a/lib/megaco/test/megaco_udp_test.erl
+++ b/lib/megaco/test/megaco_udp_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/megaco/test/modules.mk b/lib/megaco/test/modules.mk
index 3e56dfdc9c..32b35d6123 100644
--- a/lib/megaco/test/modules.mk
+++ b/lib/megaco/test/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2010. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/Makefile b/lib/mnesia/Makefile
index 0333f73a27..810433c4d0 100644
--- a/lib/mnesia/Makefile
+++ b/lib/mnesia/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/doc/misc/Makefile b/lib/mnesia/doc/misc/Makefile
index 4d364649b6..29e2682967 100644
--- a/lib/mnesia/doc/misc/Makefile
+++ b/lib/mnesia/doc/misc/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/doc/src/Makefile b/lib/mnesia/doc/src/Makefile
index af85e1bc59..39f2b28637 100644
--- a/lib/mnesia/doc/src/Makefile
+++ b/lib/mnesia/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/doc/src/Mnesia_App_A.xmlsrc b/lib/mnesia/doc/src/Mnesia_App_A.xmlsrc
index 7bc0688887..22b6fa9f39 100644
--- a/lib/mnesia/doc/src/Mnesia_App_A.xmlsrc
+++ b/lib/mnesia/doc/src/Mnesia_App_A.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_App_B.xmlsrc b/lib/mnesia/doc/src/Mnesia_App_B.xmlsrc
index 1b76a31ef0..45bd2824e5 100644
--- a/lib/mnesia/doc/src/Mnesia_App_B.xmlsrc
+++ b/lib/mnesia/doc/src/Mnesia_App_B.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_App_C.xmlsrc b/lib/mnesia/doc/src/Mnesia_App_C.xmlsrc
index 34dafc772b..42e25edc5d 100644
--- a/lib/mnesia/doc/src/Mnesia_App_C.xmlsrc
+++ b/lib/mnesia/doc/src/Mnesia_App_C.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_chap1.xml b/lib/mnesia/doc/src/Mnesia_chap1.xml
index fd614a655b..9dfeb5efe4 100644
--- a/lib/mnesia/doc/src/Mnesia_chap1.xml
+++ b/lib/mnesia/doc/src/Mnesia_chap1.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc b/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc
index ad2ba7784e..ba0746e736 100644
--- a/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc
+++ b/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_chap3.xmlsrc b/lib/mnesia/doc/src/Mnesia_chap3.xmlsrc
index 849b5f4281..8f1a4366ee 100644
--- a/lib/mnesia/doc/src/Mnesia_chap3.xmlsrc
+++ b/lib/mnesia/doc/src/Mnesia_chap3.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_chap4.xmlsrc b/lib/mnesia/doc/src/Mnesia_chap4.xmlsrc
index db48811d76..b8d86adbf1 100644
--- a/lib/mnesia/doc/src/Mnesia_chap4.xmlsrc
+++ b/lib/mnesia/doc/src/Mnesia_chap4.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_chap5.xmlsrc b/lib/mnesia/doc/src/Mnesia_chap5.xmlsrc
index f32f9eb590..a83d1d77d2 100644
--- a/lib/mnesia/doc/src/Mnesia_chap5.xmlsrc
+++ b/lib/mnesia/doc/src/Mnesia_chap5.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_chap7.xmlsrc b/lib/mnesia/doc/src/Mnesia_chap7.xmlsrc
index fa8fa6bbb0..ffbbdadec0 100644
--- a/lib/mnesia/doc/src/Mnesia_chap7.xmlsrc
+++ b/lib/mnesia/doc/src/Mnesia_chap7.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_chap8.xml b/lib/mnesia/doc/src/Mnesia_chap8.xml
index 8a4ed8a23d..f1a469e315 100644
--- a/lib/mnesia/doc/src/Mnesia_chap8.xml
+++ b/lib/mnesia/doc/src/Mnesia_chap8.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_overview.xml b/lib/mnesia/doc/src/Mnesia_overview.xml
index b0d67d3e1a..d2d597b85d 100644
--- a/lib/mnesia/doc/src/Mnesia_overview.xml
+++ b/lib/mnesia/doc/src/Mnesia_overview.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/book.xml b/lib/mnesia/doc/src/book.xml
index 4c638bffc0..c4714a012c 100644
--- a/lib/mnesia/doc/src/book.xml
+++ b/lib/mnesia/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/company.erl b/lib/mnesia/doc/src/company.erl
index 0cc9d249cc..20e3235347 100644
--- a/lib/mnesia/doc/src/company.erl
+++ b/lib/mnesia/doc/src/company.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/doc/src/company_o.erl b/lib/mnesia/doc/src/company_o.erl
index 9b75d3fb3c..7300e9d4bb 100644
--- a/lib/mnesia/doc/src/company_o.erl
+++ b/lib/mnesia/doc/src/company_o.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/doc/src/mnesia.xml b/lib/mnesia/doc/src/mnesia.xml
index f441ba4c63..437df63aab 100644
--- a/lib/mnesia/doc/src/mnesia.xml
+++ b/lib/mnesia/doc/src/mnesia.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/mnesia_frag_hash.xml b/lib/mnesia/doc/src/mnesia_frag_hash.xml
index 7e532634d0..95f5f8aa07 100644
--- a/lib/mnesia/doc/src/mnesia_frag_hash.xml
+++ b/lib/mnesia/doc/src/mnesia_frag_hash.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2002</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/mnesia_registry.xml b/lib/mnesia/doc/src/mnesia_registry.xml
index b2529f08bd..cd778ae072 100644
--- a/lib/mnesia/doc/src/mnesia_registry.xml
+++ b/lib/mnesia/doc/src/mnesia_registry.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1998</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/notes.xml b/lib/mnesia/doc/src/notes.xml
index 149cd69559..4a68e76d50 100644
--- a/lib/mnesia/doc/src/notes.xml
+++ b/lib/mnesia/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -39,7 +39,23 @@
thus constitutes one section in this document. The title of each
section is the version number of Mnesia.</p>
- <section><title>Mnesia 4.13.3</title>
+ <section><title>Mnesia 4.13.4</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Mnesia transactions could hang while waiting on a
+ response from a node who had stopped.</p>
+ <p>
+ Own Id: OTP-13423</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Mnesia 4.13.3</title>
<section><title>Fixed Bugs and Malfunctions</title>
<list>
diff --git a/lib/mnesia/doc/src/notes_history.xml b/lib/mnesia/doc/src/notes_history.xml
index b1c050a8af..2300a1ecac 100644
--- a/lib/mnesia/doc/src/notes_history.xml
+++ b/lib/mnesia/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/part.xml b/lib/mnesia/doc/src/part.xml
index 3406da4a34..101bdb29d4 100644
--- a/lib/mnesia/doc/src/part.xml
+++ b/lib/mnesia/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/part_notes.xml b/lib/mnesia/doc/src/part_notes.xml
index e1f475a40d..1e4e4bc60a 100644
--- a/lib/mnesia/doc/src/part_notes.xml
+++ b/lib/mnesia/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/part_notes_history.xml b/lib/mnesia/doc/src/part_notes_history.xml
index fec251cea6..a1c6f5aef0 100644
--- a/lib/mnesia/doc/src/part_notes_history.xml
+++ b/lib/mnesia/doc/src/part_notes_history.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2004</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/ref_man.xml b/lib/mnesia/doc/src/ref_man.xml
index 370267e3b8..662f0d61d6 100644
--- a/lib/mnesia/doc/src/ref_man.xml
+++ b/lib/mnesia/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/examples/Makefile b/lib/mnesia/examples/Makefile
index 0410ea2e8e..5580f0bdcb 100644
--- a/lib/mnesia/examples/Makefile
+++ b/lib/mnesia/examples/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2012. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/examples/bench/bench.erl b/lib/mnesia/examples/bench/bench.erl
index 5a414edcf3..e049ab97c1 100644
--- a/lib/mnesia/examples/bench/bench.erl
+++ b/lib/mnesia/examples/bench/bench.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/examples/bench/bench.hrl b/lib/mnesia/examples/bench/bench.hrl
index 5f19513fb2..f312d76bd1 100644
--- a/lib/mnesia/examples/bench/bench.hrl
+++ b/lib/mnesia/examples/bench/bench.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/examples/bench/bench_generate.erl b/lib/mnesia/examples/bench/bench_generate.erl
index e838f07fbb..c0b33e40f2 100644
--- a/lib/mnesia/examples/bench/bench_generate.erl
+++ b/lib/mnesia/examples/bench/bench_generate.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/examples/bench/bench_populate.erl b/lib/mnesia/examples/bench/bench_populate.erl
index b35cc61b5a..c7bf2c52d6 100644
--- a/lib/mnesia/examples/bench/bench_populate.erl
+++ b/lib/mnesia/examples/bench/bench_populate.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/examples/bench/bench_trans.erl b/lib/mnesia/examples/bench/bench_trans.erl
index 85641b29d4..73934d4fb5 100644
--- a/lib/mnesia/examples/bench/bench_trans.erl
+++ b/lib/mnesia/examples/bench/bench_trans.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/examples/mnesia_meter.erl b/lib/mnesia/examples/mnesia_meter.erl
index 73f35a4a46..c278dfde93 100644
--- a/lib/mnesia/examples/mnesia_meter.erl
+++ b/lib/mnesia/examples/mnesia_meter.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/examples/mnesia_tpcb.erl b/lib/mnesia/examples/mnesia_tpcb.erl
index c6eda1c448..fb39ee321d 100644
--- a/lib/mnesia/examples/mnesia_tpcb.erl
+++ b/lib/mnesia/examples/mnesia_tpcb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/include/Makefile b/lib/mnesia/include/Makefile
index fec963885c..6eed4d716f 100644
--- a/lib/mnesia/include/Makefile
+++ b/lib/mnesia/include/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2012. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/Makefile b/lib/mnesia/src/Makefile
index 3134a15138..08a00e6aba 100644
--- a/lib/mnesia/src/Makefile
+++ b/lib/mnesia/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2013. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia.erl b/lib/mnesia/src/mnesia.erl
index 6818f9a65d..9586adbf93 100644
--- a/lib/mnesia/src/mnesia.erl
+++ b/lib/mnesia/src/mnesia.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia.hrl b/lib/mnesia/src/mnesia.hrl
index 317e22351b..0716dd87c8 100644
--- a/lib/mnesia/src/mnesia.hrl
+++ b/lib/mnesia/src/mnesia.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_backup.erl b/lib/mnesia/src/mnesia_backup.erl
index 78107bda56..719e010c17 100644
--- a/lib/mnesia/src/mnesia_backup.erl
+++ b/lib/mnesia/src/mnesia_backup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_checkpoint.erl b/lib/mnesia/src/mnesia_checkpoint.erl
index e284005ac6..9eb939e8d3 100644
--- a/lib/mnesia/src/mnesia_checkpoint.erl
+++ b/lib/mnesia/src/mnesia_checkpoint.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013
+%% Copyright Ericsson AB 1996-2016
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_checkpoint_sup.erl b/lib/mnesia/src/mnesia_checkpoint_sup.erl
index 680cd86182..ae3f77f37e 100644
--- a/lib/mnesia/src/mnesia_checkpoint_sup.erl
+++ b/lib/mnesia/src/mnesia_checkpoint_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_controller.erl b/lib/mnesia/src/mnesia_controller.erl
index 7300c8c648..4791e2e290 100644
--- a/lib/mnesia/src/mnesia_controller.erl
+++ b/lib/mnesia/src/mnesia_controller.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_dumper.erl b/lib/mnesia/src/mnesia_dumper.erl
index de430eaecd..eb02a585a6 100644
--- a/lib/mnesia/src/mnesia_dumper.erl
+++ b/lib/mnesia/src/mnesia_dumper.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_event.erl b/lib/mnesia/src/mnesia_event.erl
index 58806793e5..7320d381ea 100644
--- a/lib/mnesia/src/mnesia_event.erl
+++ b/lib/mnesia/src/mnesia_event.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_frag.erl b/lib/mnesia/src/mnesia_frag.erl
index e64aa8ee23..c6e812b36d 100644
--- a/lib/mnesia/src/mnesia_frag.erl
+++ b/lib/mnesia/src/mnesia_frag.erl
@@ -1,7 +1,7 @@
%%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_frag_hash.erl b/lib/mnesia/src/mnesia_frag_hash.erl
index 2e4ebb98b0..ae4105382e 100644
--- a/lib/mnesia/src/mnesia_frag_hash.erl
+++ b/lib/mnesia/src/mnesia_frag_hash.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_frag_old_hash.erl b/lib/mnesia/src/mnesia_frag_old_hash.erl
index 707be6d121..b246c76236 100644
--- a/lib/mnesia/src/mnesia_frag_old_hash.erl
+++ b/lib/mnesia/src/mnesia_frag_old_hash.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_index.erl b/lib/mnesia/src/mnesia_index.erl
index d5bd6d7125..73d170d1fa 100644
--- a/lib/mnesia/src/mnesia_index.erl
+++ b/lib/mnesia/src/mnesia_index.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_kernel_sup.erl b/lib/mnesia/src/mnesia_kernel_sup.erl
index 1583e5e1f7..c9af5c460a 100644
--- a/lib/mnesia/src/mnesia_kernel_sup.erl
+++ b/lib/mnesia/src/mnesia_kernel_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_late_loader.erl b/lib/mnesia/src/mnesia_late_loader.erl
index bd21bdc347..e273329ffc 100644
--- a/lib/mnesia/src/mnesia_late_loader.erl
+++ b/lib/mnesia/src/mnesia_late_loader.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_loader.erl b/lib/mnesia/src/mnesia_loader.erl
index 67afef6f8c..71e5829c87 100644
--- a/lib/mnesia/src/mnesia_loader.erl
+++ b/lib/mnesia/src/mnesia_loader.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_locker.erl b/lib/mnesia/src/mnesia_locker.erl
index 5766f22e92..59fd89059f 100644
--- a/lib/mnesia/src/mnesia_locker.erl
+++ b/lib/mnesia/src/mnesia_locker.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_monitor.erl b/lib/mnesia/src/mnesia_monitor.erl
index 66a5719276..ab78c9b13e 100644
--- a/lib/mnesia/src/mnesia_monitor.erl
+++ b/lib/mnesia/src/mnesia_monitor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_recover.erl b/lib/mnesia/src/mnesia_recover.erl
index 9420e57afa..b204fb282f 100644
--- a/lib/mnesia/src/mnesia_recover.erl
+++ b/lib/mnesia/src/mnesia_recover.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_registry.erl b/lib/mnesia/src/mnesia_registry.erl
index abf0b745a1..55ddc3d2fd 100644
--- a/lib/mnesia/src/mnesia_registry.erl
+++ b/lib/mnesia/src/mnesia_registry.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_snmp_hook.erl b/lib/mnesia/src/mnesia_snmp_hook.erl
index 1599ff1e65..58a20c6051 100644
--- a/lib/mnesia/src/mnesia_snmp_hook.erl
+++ b/lib/mnesia/src/mnesia_snmp_hook.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_snmp_sup.erl b/lib/mnesia/src/mnesia_snmp_sup.erl
index 862eaaec77..ed579d01c5 100644
--- a/lib/mnesia/src/mnesia_snmp_sup.erl
+++ b/lib/mnesia/src/mnesia_snmp_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_sp.erl b/lib/mnesia/src/mnesia_sp.erl
index 71c1e7dd0c..d65c659690 100644
--- a/lib/mnesia/src/mnesia_sp.erl
+++ b/lib/mnesia/src/mnesia_sp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_subscr.erl b/lib/mnesia/src/mnesia_subscr.erl
index 246d0e8697..c2748f5bae 100644
--- a/lib/mnesia/src/mnesia_subscr.erl
+++ b/lib/mnesia/src/mnesia_subscr.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_sup.erl b/lib/mnesia/src/mnesia_sup.erl
index b8dd4f48a6..4aece81308 100644
--- a/lib/mnesia/src/mnesia_sup.erl
+++ b/lib/mnesia/src/mnesia_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_text.erl b/lib/mnesia/src/mnesia_text.erl
index 34655b0318..21adca813a 100644
--- a/lib/mnesia/src/mnesia_text.erl
+++ b/lib/mnesia/src/mnesia_text.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/src/mnesia_tm.erl b/lib/mnesia/src/mnesia_tm.erl
index bf2a35d0d3..b116b48312 100644
--- a/lib/mnesia/src/mnesia_tm.erl
+++ b/lib/mnesia/src/mnesia_tm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1707,13 +1707,10 @@ commit_participant(Coord, Tid, Bin, C0, DiscNs, _RamNs) ->
?eval_debug_fun({?MODULE, commit_participant, undo_prepare},
[{tid, Tid}]);
- {'EXIT', _, _} ->
+ {'EXIT', _MnesiaTM, Reason} ->
+ reply(Coord, {do_abort, Tid, self(), {bad_commit,Reason}}),
mnesia_recover:log_decision(D#decision{outcome = aborted}),
- ?eval_debug_fun({?MODULE, commit_participant, exit_log_abort},
- [{tid, Tid}]),
- mnesia_schema:undo_prepare_commit(Tid, C0),
- ?eval_debug_fun({?MODULE, commit_participant, exit_undo_prepare},
- [{tid, Tid}]);
+ mnesia_schema:undo_prepare_commit(Tid, C0);
Msg ->
verbose("** ERROR ** commit_participant ~p, got unexpected msg: ~p~n",
@@ -2246,8 +2243,6 @@ reconfigure_coordinators(N, [{Tid, [Store | _]} | Coordinators]) ->
true ->
send_mnesia_down(Tid, Store, N)
end;
- aborted ->
- ignore; % avoid spurious mnesia_down messages
_ ->
%% Tell the coordinator about the mnesia_down
send_mnesia_down(Tid, Store, N)
diff --git a/lib/mnesia/test/Makefile b/lib/mnesia/test/Makefile
index a418430822..5b61b1af65 100644
--- a/lib/mnesia/test/Makefile
+++ b/lib/mnesia/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2012. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_SUITE.erl b/lib/mnesia/test/mnesia_SUITE.erl
index 070f51e6a8..3ec4847c5d 100644
--- a/lib/mnesia/test/mnesia_SUITE.erl
+++ b/lib/mnesia/test/mnesia_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_atomicity_test.erl b/lib/mnesia/test/mnesia_atomicity_test.erl
index e3e0eaaf75..612c4ad368 100644
--- a/lib/mnesia/test/mnesia_atomicity_test.erl
+++ b/lib/mnesia/test/mnesia_atomicity_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_bench_SUITE.erl b/lib/mnesia/test/mnesia_bench_SUITE.erl
index 962b57ae6f..7c86db383d 100644
--- a/lib/mnesia/test/mnesia_bench_SUITE.erl
+++ b/lib/mnesia/test/mnesia_bench_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_config_backup.erl b/lib/mnesia/test/mnesia_config_backup.erl
index a95f305b43..239101ca92 100644
--- a/lib/mnesia/test/mnesia_config_backup.erl
+++ b/lib/mnesia/test/mnesia_config_backup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_config_event.erl b/lib/mnesia/test/mnesia_config_event.erl
index 6a35e14363..4299b14f36 100644
--- a/lib/mnesia/test/mnesia_config_event.erl
+++ b/lib/mnesia/test/mnesia_config_event.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_config_test.erl b/lib/mnesia/test/mnesia_config_test.erl
index d024de6449..45da909264 100644
--- a/lib/mnesia/test/mnesia_config_test.erl
+++ b/lib/mnesia/test/mnesia_config_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -693,9 +693,9 @@ event_module(Config) when is_list(Config) ->
end,
?match({[ok, ok], []}, rpc:multicall(Nodes, mnesia, start, [Def])),
- receive after 1000 -> ok end,
+ receive after 2000 -> ok end,
mnesia_event ! {get_log, self()},
- DebugLog1 = receive
+ DebugLog1 = receive
{log, L1} -> L1
after 10000 -> [timeout]
end,
@@ -706,9 +706,9 @@ event_module(Config) when is_list(Config) ->
?match({[ok], []}, rpc:multicall([N2], mnesia, start, [])),
- receive after 1000 -> ok end,
+ receive after 2000 -> ok end,
mnesia_event ! {get_log, self()},
- DebugLog = receive
+ DebugLog = receive
{log, L} -> L
after 10000 -> [timeout]
end,
diff --git a/lib/mnesia/test/mnesia_consistency_test.erl b/lib/mnesia/test/mnesia_consistency_test.erl
index 279e7bc1ec..9cc84de87b 100644
--- a/lib/mnesia/test/mnesia_consistency_test.erl
+++ b/lib/mnesia/test/mnesia_consistency_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -565,6 +565,7 @@ consistency_after_fallback_3_disc_only(Config) when is_list(Config) ->
consistency_after_fallback(disc_only_copies, 3, Config).
consistency_after_fallback(ReplicaType, NodeConfig, Config) ->
+ put(mnesia_test_verbose, true),
%%?verbose("Starting consistency_after_fallback2 at ~p~n", [self()]),
Delay = 5,
Nodes = ?acquire_nodes(NodeConfig, [{tc_timeout, timer:minutes(10)} | Config]),
@@ -594,10 +595,11 @@ consistency_after_fallback(ReplicaType, NodeConfig, Config) ->
?match(ok, mnesia_tpcb:verify_tabs()),
%% Stop and then start mnesia and check table consistency
- %%?verbose("Restarting Mnesia~n", []),
+ ?verbose("Kill Mnesia~n", []),
mnesia_test_lib:kill_mnesia(Nodes),
+ ?verbose("Start Mnesia~n", []),
mnesia_test_lib:start_mnesia(Nodes,[account,branch,teller,history]),
-
+ ?verbose("Verify tabs~n", []),
?match(ok, mnesia_tpcb:verify_tabs()),
if
ReplicaType == ram_copies ->
diff --git a/lib/mnesia/test/mnesia_cost.erl b/lib/mnesia/test/mnesia_cost.erl
index 714dbaef27..a3fc8dfe20 100644
--- a/lib/mnesia/test/mnesia_cost.erl
+++ b/lib/mnesia/test/mnesia_cost.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_dbn_meters.erl b/lib/mnesia/test/mnesia_dbn_meters.erl
index 5c3ea08a1d..407d7c65b8 100644
--- a/lib/mnesia/test/mnesia_dbn_meters.erl
+++ b/lib/mnesia/test/mnesia_dbn_meters.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_dirty_access_test.erl b/lib/mnesia/test/mnesia_dirty_access_test.erl
index 9a53a2cd1e..c9df8ed353 100644
--- a/lib/mnesia/test/mnesia_dirty_access_test.erl
+++ b/lib/mnesia/test/mnesia_dirty_access_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_durability_test.erl b/lib/mnesia/test/mnesia_durability_test.erl
index 4c9438df3e..97bc84a2d8 100644
--- a/lib/mnesia/test/mnesia_durability_test.erl
+++ b/lib/mnesia/test/mnesia_durability_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_evil_backup.erl b/lib/mnesia/test/mnesia_evil_backup.erl
index e605fa7926..b71348f144 100644
--- a/lib/mnesia/test/mnesia_evil_backup.erl
+++ b/lib/mnesia/test/mnesia_evil_backup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_evil_coverage_test.erl b/lib/mnesia/test/mnesia_evil_coverage_test.erl
index 2768ac9c51..6e34040bc4 100644
--- a/lib/mnesia/test/mnesia_evil_coverage_test.erl
+++ b/lib/mnesia/test/mnesia_evil_coverage_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_examples_test.erl b/lib/mnesia/test/mnesia_examples_test.erl
index 889ec50520..808e62d9c2 100644
--- a/lib/mnesia/test/mnesia_examples_test.erl
+++ b/lib/mnesia/test/mnesia_examples_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_frag_test.erl b/lib/mnesia/test/mnesia_frag_test.erl
index c6430240c8..9f2102beb2 100644
--- a/lib/mnesia/test/mnesia_frag_test.erl
+++ b/lib/mnesia/test/mnesia_frag_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_inconsistent_database_test.erl b/lib/mnesia/test/mnesia_inconsistent_database_test.erl
index c6ca3c6853..3fd2c6ad5b 100644
--- a/lib/mnesia/test/mnesia_inconsistent_database_test.erl
+++ b/lib/mnesia/test/mnesia_inconsistent_database_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_install_test.erl b/lib/mnesia/test/mnesia_install_test.erl
index e0145f3a8b..103f85b3d6 100644
--- a/lib/mnesia/test/mnesia_install_test.erl
+++ b/lib/mnesia/test/mnesia_install_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_isolation_test.erl b/lib/mnesia/test/mnesia_isolation_test.erl
index 4dd0c01d05..63940ec05c 100644
--- a/lib/mnesia/test/mnesia_isolation_test.erl
+++ b/lib/mnesia/test/mnesia_isolation_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_majority_test.erl b/lib/mnesia/test/mnesia_majority_test.erl
index f2e7a09e5e..9811de6ae7 100644
--- a/lib/mnesia/test/mnesia_majority_test.erl
+++ b/lib/mnesia/test/mnesia_majority_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_measure_test.erl b/lib/mnesia/test/mnesia_measure_test.erl
index b184c5efdf..ad71fafecb 100644
--- a/lib/mnesia/test/mnesia_measure_test.erl
+++ b/lib/mnesia/test/mnesia_measure_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_meter.erl b/lib/mnesia/test/mnesia_meter.erl
index 73f35a4a46..c278dfde93 100644
--- a/lib/mnesia/test/mnesia_meter.erl
+++ b/lib/mnesia/test/mnesia_meter.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_nice_coverage_test.erl b/lib/mnesia/test/mnesia_nice_coverage_test.erl
index 3e00cc7325..ffbe36e48d 100644
--- a/lib/mnesia/test/mnesia_nice_coverage_test.erl
+++ b/lib/mnesia/test/mnesia_nice_coverage_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_qlc_test.erl b/lib/mnesia/test/mnesia_qlc_test.erl
index 90fb8540c2..5067e86521 100644
--- a/lib/mnesia/test/mnesia_qlc_test.erl
+++ b/lib/mnesia/test/mnesia_qlc_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_recovery_test.erl b/lib/mnesia/test/mnesia_recovery_test.erl
index 84849dd8c4..2388b595d0 100644
--- a/lib/mnesia/test/mnesia_recovery_test.erl
+++ b/lib/mnesia/test/mnesia_recovery_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_registry_test.erl b/lib/mnesia/test/mnesia_registry_test.erl
index 9d9190d70d..3df37a2c8c 100644
--- a/lib/mnesia/test/mnesia_registry_test.erl
+++ b/lib/mnesia/test/mnesia_registry_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_schema_recovery_test.erl b/lib/mnesia/test/mnesia_schema_recovery_test.erl
index 05c5639d60..ca2dd74b34 100644
--- a/lib/mnesia/test/mnesia_schema_recovery_test.erl
+++ b/lib/mnesia/test/mnesia_schema_recovery_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_test_lib.erl b/lib/mnesia/test/mnesia_test_lib.erl
index 5042dbb1ce..6e84a27ec9 100644
--- a/lib/mnesia/test/mnesia_test_lib.erl
+++ b/lib/mnesia/test/mnesia_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_test_lib.hrl b/lib/mnesia/test/mnesia_test_lib.hrl
index 78bd448980..ba7eb10ea2 100644
--- a/lib/mnesia/test/mnesia_test_lib.hrl
+++ b/lib/mnesia/test/mnesia_test_lib.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_tpcb.erl b/lib/mnesia/test/mnesia_tpcb.erl
index c6eda1c448..fb39ee321d 100644
--- a/lib/mnesia/test/mnesia_tpcb.erl
+++ b/lib/mnesia/test/mnesia_tpcb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mnesia_trans_access_test.erl b/lib/mnesia/test/mnesia_trans_access_test.erl
index 6db873685e..aa50ee4cb1 100644
--- a/lib/mnesia/test/mnesia_trans_access_test.erl
+++ b/lib/mnesia/test/mnesia_trans_access_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/test/mt.erl b/lib/mnesia/test/mt.erl
index 1256dbb80a..793fb125e6 100644
--- a/lib/mnesia/test/mt.erl
+++ b/lib/mnesia/test/mt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/mnesia/vsn.mk b/lib/mnesia/vsn.mk
index 843d9d18d4..194bc439a0 100644
--- a/lib/mnesia/vsn.mk
+++ b/lib/mnesia/vsn.mk
@@ -1 +1 @@
-MNESIA_VSN = 4.13.3
+MNESIA_VSN = 4.13.4
diff --git a/lib/observer/Makefile b/lib/observer/Makefile
index 865dddaf51..8483922f76 100644
--- a/lib/observer/Makefile
+++ b/lib/observer/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2009. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/observer/doc/src/book.xml b/lib/observer/doc/src/book.xml
index 5ef1fd794b..7cc60718b1 100644
--- a/lib/observer/doc/src/book.xml
+++ b/lib/observer/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/observer/doc/src/crashdump.xml b/lib/observer/doc/src/crashdump.xml
index 27e88d07e5..48f944cbce 100644
--- a/lib/observer/doc/src/crashdump.xml
+++ b/lib/observer/doc/src/crashdump.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2003</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/observer/doc/src/etop.xml b/lib/observer/doc/src/etop.xml
index 52f3b2a156..d70d9d1d23 100644
--- a/lib/observer/doc/src/etop.xml
+++ b/lib/observer/doc/src/etop.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2002</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/observer/doc/src/notes.xml b/lib/observer/doc/src/notes.xml
index dd99f45b19..c3bd0d33b9 100644
--- a/lib/observer/doc/src/notes.xml
+++ b/lib/observer/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/observer/doc/src/notes_history.xml b/lib/observer/doc/src/notes_history.xml
index ec155b852f..ef20a6dfa4 100644
--- a/lib/observer/doc/src/notes_history.xml
+++ b/lib/observer/doc/src/notes_history.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2006</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/observer/doc/src/part.xml b/lib/observer/doc/src/part.xml
index d8ec7664d9..165bd5864a 100644
--- a/lib/observer/doc/src/part.xml
+++ b/lib/observer/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/observer/doc/src/part_notes.xml b/lib/observer/doc/src/part_notes.xml
index c187702f64..ba15c39cda 100644
--- a/lib/observer/doc/src/part_notes.xml
+++ b/lib/observer/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/observer/doc/src/part_notes_history.xml b/lib/observer/doc/src/part_notes_history.xml
index c0c7b10a7e..e60210924c 100644
--- a/lib/observer/doc/src/part_notes_history.xml
+++ b/lib/observer/doc/src/part_notes_history.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2006</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/observer/doc/src/ref_man.xml b/lib/observer/doc/src/ref_man.xml
index 37e20b2643..73e7e0053a 100644
--- a/lib/observer/doc/src/ref_man.xml
+++ b/lib/observer/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/observer/include/etop.hrl b/lib/observer/include/etop.hrl
index 0dac322a2b..002937e522 100644
--- a/lib/observer/include/etop.hrl
+++ b/lib/observer/include/etop.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/Makefile b/lib/observer/src/Makefile
index 2d42510b47..85dc5933c1 100644
--- a/lib/observer/src/Makefile
+++ b/lib/observer/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2013. All Rights Reserved.
+# Copyright Ericsson AB 2002-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_atom_cb.erl b/lib/observer/src/cdv_atom_cb.erl
index 0f0c397479..a123354c8f 100644
--- a/lib/observer/src/cdv_atom_cb.erl
+++ b/lib/observer/src/cdv_atom_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_bin_cb.erl b/lib/observer/src/cdv_bin_cb.erl
index 7e17ef135e..0cea1fdcf0 100644
--- a/lib/observer/src/cdv_bin_cb.erl
+++ b/lib/observer/src/cdv_bin_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_detail_wx.erl b/lib/observer/src/cdv_detail_wx.erl
index d53b721141..44f121f359 100644
--- a/lib/observer/src/cdv_detail_wx.erl
+++ b/lib/observer/src/cdv_detail_wx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_dist_cb.erl b/lib/observer/src/cdv_dist_cb.erl
index 9c53ec86bc..2b4c9f56d1 100644
--- a/lib/observer/src/cdv_dist_cb.erl
+++ b/lib/observer/src/cdv_dist_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_ets_cb.erl b/lib/observer/src/cdv_ets_cb.erl
index bac8b56fc3..52a90b093b 100644
--- a/lib/observer/src/cdv_ets_cb.erl
+++ b/lib/observer/src/cdv_ets_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_fun_cb.erl b/lib/observer/src/cdv_fun_cb.erl
index 3a62eb3305..acebc94811 100644
--- a/lib/observer/src/cdv_fun_cb.erl
+++ b/lib/observer/src/cdv_fun_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_gen_cb.erl b/lib/observer/src/cdv_gen_cb.erl
index 69ecfbe80e..5fb43b5719 100644
--- a/lib/observer/src/cdv_gen_cb.erl
+++ b/lib/observer/src/cdv_gen_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_html_wx.erl b/lib/observer/src/cdv_html_wx.erl
index 70f0d02982..0ab0ba4315 100644
--- a/lib/observer/src/cdv_html_wx.erl
+++ b/lib/observer/src/cdv_html_wx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_info_wx.erl b/lib/observer/src/cdv_info_wx.erl
index 13c80942ac..01fe6b15f2 100644
--- a/lib/observer/src/cdv_info_wx.erl
+++ b/lib/observer/src/cdv_info_wx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_int_tab_cb.erl b/lib/observer/src/cdv_int_tab_cb.erl
index c48fbb6ee1..401ebf9664 100644
--- a/lib/observer/src/cdv_int_tab_cb.erl
+++ b/lib/observer/src/cdv_int_tab_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_mem_cb.erl b/lib/observer/src/cdv_mem_cb.erl
index bfe21bf309..ba972d6963 100644
--- a/lib/observer/src/cdv_mem_cb.erl
+++ b/lib/observer/src/cdv_mem_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_mod_cb.erl b/lib/observer/src/cdv_mod_cb.erl
index 2e41699c5a..2183e1aa3d 100644
--- a/lib/observer/src/cdv_mod_cb.erl
+++ b/lib/observer/src/cdv_mod_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_multi_wx.erl b/lib/observer/src/cdv_multi_wx.erl
index 13b980b5ea..b511503752 100644
--- a/lib/observer/src/cdv_multi_wx.erl
+++ b/lib/observer/src/cdv_multi_wx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_port_cb.erl b/lib/observer/src/cdv_port_cb.erl
index 7dbe6d7819..b5cbe8132d 100644
--- a/lib/observer/src/cdv_port_cb.erl
+++ b/lib/observer/src/cdv_port_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_proc_cb.erl b/lib/observer/src/cdv_proc_cb.erl
index 90f6715a06..592150146b 100644
--- a/lib/observer/src/cdv_proc_cb.erl
+++ b/lib/observer/src/cdv_proc_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_sched_cb.erl b/lib/observer/src/cdv_sched_cb.erl
index f236e6a159..192aaf31a7 100644
--- a/lib/observer/src/cdv_sched_cb.erl
+++ b/lib/observer/src/cdv_sched_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_table_wx.erl b/lib/observer/src/cdv_table_wx.erl
index 4e9c158ce3..df16230b70 100644
--- a/lib/observer/src/cdv_table_wx.erl
+++ b/lib/observer/src/cdv_table_wx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_term_cb.erl b/lib/observer/src/cdv_term_cb.erl
index 155cde2cd0..f0d90dde7c 100644
--- a/lib/observer/src/cdv_term_cb.erl
+++ b/lib/observer/src/cdv_term_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_timer_cb.erl b/lib/observer/src/cdv_timer_cb.erl
index 42285b0fc9..dcc794242c 100644
--- a/lib/observer/src/cdv_timer_cb.erl
+++ b/lib/observer/src/cdv_timer_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_virtual_list_wx.erl b/lib/observer/src/cdv_virtual_list_wx.erl
index 5b2775d61b..ebf58865e9 100644
--- a/lib/observer/src/cdv_virtual_list_wx.erl
+++ b/lib/observer/src/cdv_virtual_list_wx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/cdv_wx.erl b/lib/observer/src/cdv_wx.erl
index 82247cb93b..2587a6e64e 100644
--- a/lib/observer/src/cdv_wx.erl
+++ b/lib/observer/src/cdv_wx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/crashdump_viewer.erl b/lib/observer/src/crashdump_viewer.erl
index b66b4d59c9..de52e2a995 100644
--- a/lib/observer/src/crashdump_viewer.erl
+++ b/lib/observer/src/crashdump_viewer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/crashdump_viewer.hrl b/lib/observer/src/crashdump_viewer.hrl
index bd08d3e1e1..a08659efd6 100644
--- a/lib/observer/src/crashdump_viewer.hrl
+++ b/lib/observer/src/crashdump_viewer.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/etop.erl b/lib/observer/src/etop.erl
index c97fcc481b..fcb900960b 100644
--- a/lib/observer/src/etop.erl
+++ b/lib/observer/src/etop.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/etop_defs.hrl b/lib/observer/src/etop_defs.hrl
index 39acda5758..7ad8417e2a 100644
--- a/lib/observer/src/etop_defs.hrl
+++ b/lib/observer/src/etop_defs.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/etop_tr.erl b/lib/observer/src/etop_tr.erl
index 38e048c307..8e43f8bb35 100644
--- a/lib/observer/src/etop_tr.erl
+++ b/lib/observer/src/etop_tr.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/etop_txt.erl b/lib/observer/src/etop_txt.erl
index b77fc3c55d..3b4c176478 100644
--- a/lib/observer/src/etop_txt.erl
+++ b/lib/observer/src/etop_txt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/multitrace.erl b/lib/observer/src/multitrace.erl
index dbb6858646..a01eeec6ae 100644
--- a/lib/observer/src/multitrace.erl
+++ b/lib/observer/src/multitrace.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/observer.app.src b/lib/observer/src/observer.app.src
index 61c21a832e..5ddf65fa59 100644
--- a/lib/observer/src/observer.app.src
+++ b/lib/observer/src/observer.app.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/observer.appup.src b/lib/observer/src/observer.appup.src
index 9c7ae3a195..da3cd6a4aa 100644
--- a/lib/observer/src/observer.appup.src
+++ b/lib/observer/src/observer.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/observer.erl b/lib/observer/src/observer.erl
index bb1dedb7e6..79ba7fd614 100644
--- a/lib/observer/src/observer.erl
+++ b/lib/observer/src/observer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/observer_alloc_wx.erl b/lib/observer/src/observer_alloc_wx.erl
index d37623d1cc..77609b11ce 100644
--- a/lib/observer/src/observer_alloc_wx.erl
+++ b/lib/observer/src/observer_alloc_wx.erl
@@ -53,25 +53,29 @@ start_link(Notebook, Parent) ->
init([Notebook, Parent]) ->
try
- Panel = wxPanel:new(Notebook),
+ TopP = wxPanel:new(Notebook),
Main = wxBoxSizer:new(?wxVERTICAL),
+ Panel = wxPanel:new(TopP),
+ GSzr = wxBoxSizer:new(?wxVERTICAL),
BorderFlags = ?wxLEFT bor ?wxRIGHT,
- Carrier = make_win(alloc, Panel, Main, BorderFlags bor ?wxTOP),
- Utilz = make_win(utilz, Panel, Main, BorderFlags),
-
- MemWin = {MemPanel,_} = create_mem_info(Panel),
- wxSizer:add(Main, MemPanel, [{flag, ?wxEXPAND bor BorderFlags bor ?wxBOTTOM},
- {proportion, 1}, {border, 5}]),
- wxWindow:setSizer(Panel, Main),
+ Carrier = make_win(alloc, Panel, GSzr, BorderFlags bor ?wxTOP),
+ Utilz = make_win(utilz, Panel, GSzr, BorderFlags),
+ wxWindow:setSizer(Panel, GSzr),
+ wxSizer:add(Main, Panel, [{flag, ?wxEXPAND},{proportion,2}]),
+
+ MemWin = create_mem_info(TopP),
+ wxSizer:add(Main, MemWin, [{flag, ?wxEXPAND bor BorderFlags bor ?wxBOTTOM},
+ {proportion, 1}, {border, 5}]),
+ wxWindow:setSizer(TopP, Main),
Windows = [Carrier, Utilz],
PaintInfo = setup_graph_drawing(Windows),
- {Panel, #state{parent= Parent,
- panel = Panel,
- wins = Windows,
- mem = MemWin,
- paint = PaintInfo,
- time = setup_time()
- }
+ {TopP, #state{parent= Parent,
+ panel = Panel,
+ wins = Windows,
+ mem = MemWin,
+ paint = PaintInfo,
+ time = setup_time()
+ }
}
catch _:Err ->
io:format("~p crashed ~p: ~p~n",[?MODULE, Err, erlang:get_stacktrace()]),
@@ -84,12 +88,14 @@ setup_time() ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
handle_event(#wx{id=?ID_REFRESH_INTERVAL, event=#wxCommand{type=command_menu_selected}},
- #state{panel=Panel, appmon=Old, wins=Wins0, time=#ti{fetch=F0} = Ti0} = State) ->
+ #state{active=Active, panel=Panel, appmon=Old, wins=Wins0, time=#ti{fetch=F0} = Ti0} = State) ->
case interval_dialog(Panel, Ti0) of
Ti0 -> {noreply, State};
#ti{fetch=F0} = Ti -> %% Same fetch interval force refresh
Wins = [W#win{max=undefined} || W <- Wins0],
{noreply, precalc(State#state{time=Ti, wins=Wins})};
+ Ti when not Active ->
+ {noreply, State#state{time=Ti}};
Ti -> %% Changed fetch interval, drop all data
{noreply, restart_fetcher(Old, State#state{time=Ti})}
end;
@@ -120,7 +126,7 @@ handle_info({Key, {promise_reply, {badrpc, _}}}, #state{async=Key} = State) ->
{noreply, State#state{active=false, appmon=undefined}};
handle_info({Key, {promise_reply, SysInfo}},
- #state{async=Key, panel=Panel, samples=Data, active=Active, wins=Wins0,
+ #state{async=Key, panel=_Panel, samples=Data, active=Active, wins=Wins0,
time=#ti{tick=Tick, disp=Disp0}=Ti} = S0) ->
Disp = trunc(Disp0),
Next = max(Tick - Disp, 0),
@@ -131,7 +137,6 @@ handle_info({Key, {promise_reply, SysInfo}},
if Active ->
update_alloc(S0, Info),
State = precalc(S1),
- catch wxWindow:refresh(Panel),
{noreply, State};
true ->
{noreply, S1}
@@ -193,7 +198,8 @@ precalc(#state{samples=Data0, paint=Paint, time=Ti, wins=Wins0}=State) ->
State#state{wins=Wins}.
-update_alloc(#state{mem={_, Grid}}, Fields) ->
+update_alloc(#state{mem=Grid}, Fields) ->
+ wxWindow:freeze(Grid),
Max = wxListCtrl:getItemCount(Grid),
Update = fun({Name, BS, CS}, Row) ->
(Row >= Max) andalso wxListCtrl:insertItem(Grid, Row, ""),
@@ -203,6 +209,7 @@ update_alloc(#state{mem={_, Grid}}, Fields) ->
Row + 1
end,
wx:foldl(Update, 0, Fields),
+ wxWindow:thaw(Grid),
Fields.
alloc_info(SysInfo) ->
@@ -249,10 +256,9 @@ sum_alloc_one_instance([],BS,CS,TotalBS,TotalCS) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
create_mem_info(Parent) ->
- Panel = wxPanel:new(Parent),
- wxWindow:setBackgroundColour(Panel, {255,255,255}),
Style = ?wxLC_REPORT bor ?wxLC_SINGLE_SEL bor ?wxLC_HRULES bor ?wxLC_VRULES,
- Grid = wxListCtrl:new(Panel, [{style, Style}]),
+ Grid = wxListCtrl:new(Parent, [{style, Style}]),
+
Li = wxListItem:new(),
AddListEntry = fun({Name, Align, DefSize}, Col) ->
wxListItem:setText(Li, Name),
@@ -267,12 +273,7 @@ create_mem_info(Parent) ->
lists:foldl(AddListEntry, 0, ListItems),
wxListItem:destroy(Li),
- Sizer = wxBoxSizer:new(?wxVERTICAL),
- wxSizer:add(Sizer, Grid, [{flag, ?wxEXPAND bor ?wxLEFT bor ?wxRIGHT},
- {border, 5}, {proportion, 1}]),
- wxWindow:setSizerAndFit(Panel, Sizer),
- {Panel, Grid}.
-
+ Grid.
create_menus(Parent, _) ->
View = {"View", [#create_menu{id = ?ID_REFRESH_INTERVAL, text = "Graph Settings"}]},
diff --git a/lib/observer/src/observer_app_wx.erl b/lib/observer/src/observer_app_wx.erl
index 40e117357c..cef83037d0 100644
--- a/lib/observer/src/observer_app_wx.erl
+++ b/lib/observer/src/observer_app_wx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -302,7 +302,9 @@ handle_info({delivery, _Pid, app, _Curr, {[], [], [], []}},
handle_info({delivery, Pid, app, Curr, AppData},
State = #state{panel=Panel, appmon=Pid, current=Curr, usegc=UseGC,
app_w=AppWin, paint=#paint{font=Font}}) ->
- GC = make_gc(AppWin, UseGC),
+ GC = if UseGC -> {?wxGC:create(AppWin), false};
+ true -> {false, wxWindowDC:new(AppWin)}
+ end,
setFont(GC, Font, {0,0,0}),
App = build_tree(AppData, GC),
destroy_gc(GC),
diff --git a/lib/observer/src/observer_defs.hrl b/lib/observer/src/observer_defs.hrl
index c4ba84a8c4..504d0877d9 100644
--- a/lib/observer/src/observer_defs.hrl
+++ b/lib/observer/src/observer_defs.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/observer_html_lib.erl b/lib/observer/src/observer_html_lib.erl
index f646f8ed3e..1f1306c370 100644
--- a/lib/observer/src/observer_html_lib.erl
+++ b/lib/observer/src/observer_html_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/observer_lib.erl b/lib/observer/src/observer_lib.erl
index 71a2b71a72..c6a1c73c83 100644
--- a/lib/observer/src/observer_lib.erl
+++ b/lib/observer/src/observer_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -122,7 +122,7 @@ display_yes_no_dialog(Str) ->
%% display_info(Parent, [{Title, [{Label, Info}]}]) -> {Panel, Sizer, InfoFieldsToUpdate}
display_info(Frame, Info) ->
Panel = wxPanel:new(Frame),
- wxWindow:setBackgroundColour(Panel, {255,255,255}),
+ wxWindow:setBackgroundStyle(Panel, ?wxBG_STYLE_SYSTEM),
Sizer = wxBoxSizer:new(?wxVERTICAL),
wxSizer:addSpacer(Sizer, 5),
Add = fun(BoxInfo) ->
@@ -201,22 +201,21 @@ update_info2([Scroll = {_, _, _}|Fs], [{_, NewInfo}|Rest]) ->
update_scroll_boxes(Scroll, NewInfo),
update_info2(Fs, Rest);
update_info2([Field|Fs], [{_Str, {click, Value}}|Rest]) ->
- wxTextCtrl:setValue(Field, to_str(Value)),
+ wxStaticText:setLabel(Field, to_str(Value)),
update_info2(Fs, Rest);
update_info2([Field|Fs], [{_Str, Value}|Rest]) ->
- wxTextCtrl:setValue(Field, to_str(Value)),
+ wxStaticText:setLabel(Field, to_str(Value)),
update_info2(Fs, Rest);
update_info2([Field|Fs], [undefined|Rest]) ->
- wxTextCtrl:setValue(Field, ""),
+ wxStaticText:setLabel(Field, ""),
update_info2(Fs, Rest);
update_info2([], []) -> ok.
update_scroll_boxes({_, _, 0}, {_, []}) -> ok;
update_scroll_boxes({Win, Sizer, _}, {Type, List}) ->
[wxSizerItem:deleteWindows(Child) || Child <- wxSizer:getChildren(Sizer)],
- BC = wxWindow:getBackgroundColour(Win),
Cursor = wxCursor:new(?wxCURSOR_HAND),
- add_entries(Type, List, Win, Sizer, BC, Cursor),
+ add_entries(Type, List, Win, Sizer, Cursor),
wxCursor:destroy(Cursor),
wxSizer:recalcSizes(Sizer),
wxWindow:refresh(Win),
@@ -379,25 +378,22 @@ add_box(Panel, OuterBox, Cursor, Title, Proportion, {Format, List}) ->
wxScrolledWindow:setScrollbars(Scroll,1,1,0,0),
ScrollSizer = wxBoxSizer:new(?wxVERTICAL),
wxScrolledWindow:setSizer(Scroll, ScrollSizer),
- BC = wxWindow:getBackgroundColour(Panel),
- wxWindow:setBackgroundColour(Scroll,BC),
- add_entries(Format, List, Scroll, ScrollSizer, BC, Cursor),
+ wxWindow:setBackgroundStyle(Scroll, ?wxBG_STYLE_SYSTEM),
+ add_entries(Format, List, Scroll, ScrollSizer, Cursor),
wxSizer:add(Box,Scroll,[{proportion,1},{flag,?wxEXPAND}]),
wxSizer:add(OuterBox,Box,[{proportion,Proportion},{flag,?wxEXPAND}]),
{Scroll,ScrollSizer,length(List)}.
-add_entries(click, List, Scroll, ScrollSizer, BC, Cursor) ->
+add_entries(click, List, Scroll, ScrollSizer, Cursor) ->
Add = fun(Link) ->
TC = link_entry(Scroll, Link, Cursor),
- wxWindow:setBackgroundColour(TC,BC),
- wxSizer:add(ScrollSizer,TC,[{flag,?wxEXPAND}])
+ wxWindow:setBackgroundStyle(TC, ?wxBG_STYLE_SYSTEM),
+ wxSizer:add(ScrollSizer,TC, [{flag,?wxEXPAND}])
end,
[Add(Link) || Link <- List];
-add_entries(plain, List, Scroll, ScrollSizer, _, _) ->
+add_entries(plain, List, Scroll, ScrollSizer, _) ->
Add = fun(String) ->
- TC = wxTextCtrl:new(Scroll, ?wxID_ANY,
- [{style,?SINGLE_LINE_STYLE},
- {value,String}]),
+ TC = wxStaticText:new(Scroll, ?wxID_ANY, String),
wxSizer:add(ScrollSizer,TC,[{flag,?wxEXPAND}])
end,
[Add(String) || String <- List].
@@ -435,51 +431,44 @@ create_box(Panel, {scroll_boxes,Data}) ->
wxSizer:layout(OuterBox),
{OuterBox, Boxes};
-create_box(Panel, Data) ->
- {Title, Align, Info} = get_box_info(Data),
- Box = wxStaticBoxSizer:new(?wxVERTICAL, Panel, [{label, Title}]),
- LeftSize = get_max_size(Panel,Info),
- LeftProportion = [{proportion,0}],
- RightProportion = [{proportion,1}, {flag, Align bor ?wxEXPAND}],
+create_box(Parent, Data) ->
+ {Title, _Align, Info} = get_box_info(Data),
+ Top = wxStaticBoxSizer:new(?wxVERTICAL, Parent, [{label, Title}]),
+ Panel = wxPanel:new(Parent),
+ Box = wxBoxSizer:new(?wxVERTICAL),
+ LeftSize = 30 + get_max_width(Panel,Info),
+ RightProportion = [{flag, ?wxEXPAND}],
AddRow = fun({Desc0, Value0}) ->
Desc = Desc0++":",
Line = wxBoxSizer:new(?wxHORIZONTAL),
- wxSizer:add(Line,
- wxTextCtrl:new(Panel, ?wxID_ANY,
- [{style,?SINGLE_LINE_STYLE},
- {size,LeftSize},
- {value,Desc}]),
- LeftProportion),
+ Label = wxStaticText:new(Panel, ?wxID_ANY, Desc),
+ wxSizer:add(Line, 5, 0),
+ wxSizer:add(Line, Label),
+ wxSizer:setItemMinSize(Line, Label, LeftSize, -1),
Field =
case Value0 of
{click,"unknown"} ->
- wxTextCtrl:new(Panel, ?wxID_ANY,
- [{style,?SINGLE_LINE_STYLE},
- {value,"unknown"}]);
+ wxStaticText:new(Panel, ?wxID_ANY,"unknown");
{click,Value} ->
link_entry(Panel,Value);
_ ->
Value = to_str(Value0),
- TCtrl = wxTextCtrl:new(Panel, ?wxID_ANY,
- [{style,?SINGLE_LINE_STYLE},
- {value,Value}]),
+ TCtrl = wxStaticText:new(Panel, ?wxID_ANY,Value),
length(Value) > 50 andalso
wxWindow:setToolTip(TCtrl,wxToolTip:new(Value)),
TCtrl
end,
wxSizer:add(Line, 10, 0), % space of size 10 horisontally
wxSizer:add(Line, Field, RightProportion),
-
- {_,H,_,_} = wxTextCtrl:getTextExtent(Field,"Wj"),
- wxTextCtrl:setMinSize(Field,{0,H}),
-
- wxSizer:add(Box, Line, [{proportion,0},{flag,?wxEXPAND}]),
+ wxSizer:add(Box, Line, [{proportion,1},{flag,?wxEXPAND}]),
Field;
(undefined) ->
undefined
end,
InfoFields = [AddRow(Entry) || Entry <- Info],
- {Box, InfoFields}.
+ wxWindow:setSizer(Panel, Box),
+ wxSizer:add(Top, Panel, [{proportion,1},{flag,?wxEXPAND}]),
+ {Top, InfoFields}.
link_entry(Panel, Link) ->
Cursor = wxCursor:new(?wxCURSOR_HAND),
@@ -490,13 +479,12 @@ link_entry(Panel, Link, Cursor) ->
link_entry2(Panel, to_link(Link), Cursor).
link_entry2(Panel,{Target,Str},Cursor) ->
- TC = wxTextCtrl:new(Panel, ?wxID_ANY, [{style, ?SINGLE_LINE_STYLE}]),
- wxTextCtrl:setForegroundColour(TC,?wxBLUE),
- wxTextCtrl:appendText(TC, Str),
+ TC = wxStaticText:new(Panel, ?wxID_ANY, Str),
+ wxWindow:setForegroundColour(TC,?wxBLUE),
wxWindow:setCursor(TC, Cursor),
- wxTextCtrl:connect(TC, left_down, [{userData,Target}]),
- wxTextCtrl:connect(TC, enter_window),
- wxTextCtrl:connect(TC, leave_window),
+ wxWindow:connect(TC, left_down, [{userData,Target}]),
+ wxWindow:connect(TC, enter_window),
+ wxWindow:connect(TC, leave_window),
ToolTip = wxToolTip:new("Click to see properties for " ++ Str),
wxWindow:setToolTip(TC, ToolTip),
TC.
@@ -521,23 +509,12 @@ html_window(Panel, Html) ->
wxHtmlWindow:setPage(Win, Html),
Win.
-get_max_size(Panel,Info) ->
- Txt = wxTextCtrl:new(Panel, ?wxID_ANY, []),
- Size = get_max_size(Txt,Info,0,0),
- wxTextCtrl:destroy(Txt),
- Size.
-
-get_max_size(Txt,[{Desc,_}|Info],MaxX,MaxY) ->
- {X,Y,_,_} = wxTextCtrl:getTextExtent(Txt,Desc++":"),
- if X>MaxX ->
- get_max_size(Txt,Info,X,Y);
- true ->
- get_max_size(Txt,Info,MaxX,MaxY)
- end;
-get_max_size(Txt,[undefined|Info],MaxX,MaxY) ->
- get_max_size(Txt,Info,MaxX,MaxY);
-get_max_size(_,[],X,_Y) ->
- {X+2,-1}.
+get_max_width(Parent,Info) ->
+ lists:foldl(fun({Desc,_}, Max) ->
+ {W, _, _, _} = wxWindow:getTextExtent(Parent, Desc),
+ max(W,Max);
+ (_, Max) -> Max
+ end, 0, Info).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
set_listctrl_col_size(LCtrl, Total) ->
diff --git a/lib/observer/src/observer_perf_wx.erl b/lib/observer/src/observer_perf_wx.erl
index 56da5a862a..1010a6af4c 100644
--- a/lib/observer/src/observer_perf_wx.erl
+++ b/lib/observer/src/observer_perf_wx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -100,7 +100,7 @@ setup_graph_drawing(Panels) ->
IsWindows = element(1, os:type()) =:= win32,
IgnoreCB = {callback, fun(_,_) -> ok end},
Do = fun(#win{panel=Panel}) ->
- wxWindow:setBackgroundColour(Panel, ?wxWHITE),
+ wxWindow:setBackgroundStyle(Panel, ?wxBG_STYLE_SYSTEM),
wxPanel:connect(Panel, paint, [callback]),
IsWindows andalso
wxPanel:connect(Panel, erase_background, [IgnoreCB])
@@ -142,6 +142,8 @@ handle_event(#wx{id=?ID_REFRESH_INTERVAL, event=#wxCommand{type=command_menu_sel
#ti{fetch=F0} = Ti -> %% Same fetch interval force refresh
Wins = [W#win{max=undefined} || W <- Wins0],
{noreply, precalc(State#state{time=Ti, wins=Wins})};
+ Ti when Old =:= undefined ->
+ {noreply, State#state{time=Ti}};
Ti -> %% Changed fetch interval, drop all data
{noreply, restart_fetcher(node(Old), State#state{time=Ti})}
end;
@@ -762,7 +764,10 @@ make_gc(Panel,UseGC) ->
destroy_gc({GC, DC}) ->
(GC =/= false) andalso ?wxGC:destroy(GC),
- wxPaintDC:destroy(DC).
+ case DC =/= false andalso wx:getObjectType(DC) of
+ false -> ok;
+ Type -> Type:destroy(DC)
+ end.
haveGC() ->
try
diff --git a/lib/observer/src/observer_pro_wx.erl b/lib/observer/src/observer_pro_wx.erl
index dd3441e482..bd914cdf65 100644
--- a/lib/observer/src/observer_pro_wx.erl
+++ b/lib/observer/src/observer_pro_wx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/observer_procinfo.erl b/lib/observer/src/observer_procinfo.erl
index 871ef603db..cff5fbb474 100644
--- a/lib/observer/src/observer_procinfo.erl
+++ b/lib/observer/src/observer_procinfo.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -125,11 +125,11 @@ handle_event(#wx{event=#wxMouse{type=left_down}, userData=TargetPid}, State) ->
{noreply, State};
handle_event(#wx{obj=Obj, event=#wxMouse{type=enter_window}}, State) ->
- wxTextCtrl:setForegroundColour(Obj,{0,0,100,255}),
+ wxStaticText:setForegroundColour(Obj,{0,0,100,255}),
{noreply, State};
handle_event(#wx{obj=Obj, event=#wxMouse{type=leave_window}}, State) ->
- wxTextCtrl:setForegroundColour(Obj,?wxBLUE),
+ wxStaticText:setForegroundColour(Obj,?wxBLUE),
{noreply, State};
handle_event(#wx{event=#wxHtmlLink{linkInfo=#wxHtmlLinkInfo{href=Href}}},
diff --git a/lib/observer/src/observer_sys_wx.erl b/lib/observer/src/observer_sys_wx.erl
index dfd15380f2..b9b407cb0a 100644
--- a/lib/observer/src/observer_sys_wx.erl
+++ b/lib/observer/src/observer_sys_wx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/observer_trace_wx.erl b/lib/observer/src/observer_trace_wx.erl
index 11c2acb561..9c0243e4a7 100644
--- a/lib/observer/src/observer_trace_wx.erl
+++ b/lib/observer/src/observer_trace_wx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/observer_tv.hrl b/lib/observer/src/observer_tv.hrl
index 8d57a6fa2b..318a989750 100644
--- a/lib/observer/src/observer_tv.hrl
+++ b/lib/observer/src/observer_tv.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/observer_tv_wx.erl b/lib/observer/src/observer_tv_wx.erl
index de498ff442..1860f2f469 100644
--- a/lib/observer/src/observer_tv_wx.erl
+++ b/lib/observer/src/observer_tv_wx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/observer_wx.erl b/lib/observer/src/observer_wx.erl
index 68e814e01a..eba603eab5 100644
--- a/lib/observer/src/observer_wx.erl
+++ b/lib/observer/src/observer_wx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/src/ttb.erl b/lib/observer/src/ttb.erl
index 3cba3b97b0..4d6eb3ba8d 100644
--- a/lib/observer/src/ttb.erl
+++ b/lib/observer/src/ttb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -434,7 +434,9 @@ procs(Procs) when is_list(Procs) ->
procs(Proc) ->
proc(Proc).
-proc(Procs) when Procs=:=all; Procs=:=existing; Procs=:=new ->
+proc(Procs) when Procs=:=all; Procs=:=ports; Procs=:=processes;
+ Procs=:=existing; Procs=:=existing_ports; Procs=:=existing_processes;
+ Procs=:=new; Procs=:=new_ports; Procs=:=new_processes ->
[Procs];
proc(Name) when is_atom(Name) ->
[Name]; % can be registered on this node or other node
diff --git a/lib/observer/src/ttb_et.erl b/lib/observer/src/ttb_et.erl
index 683dd6c9a2..95e8e9aa07 100644
--- a/lib/observer/src/ttb_et.erl
+++ b/lib/observer/src/ttb_et.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/test/crashdump_helper.erl b/lib/observer/test/crashdump_helper.erl
index e9a3ba0369..4239a3d0d1 100644
--- a/lib/observer/test/crashdump_helper.erl
+++ b/lib/observer/test/crashdump_helper.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/test/crashdump_viewer_SUITE.erl b/lib/observer/test/crashdump_viewer_SUITE.erl
index a2b96ecb88..73ed890802 100644
--- a/lib/observer/test/crashdump_viewer_SUITE.erl
+++ b/lib/observer/test/crashdump_viewer_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -101,7 +101,7 @@ end_per_group(_GroupName, Config) ->
init_per_suite(Config) when is_list(Config) ->
delete_saved(Config),
DataDir = ?config(data_dir,Config),
- Rels = [R || R <- [r16b,'17'], ?t:is_release_available(R)] ++ [current],
+ Rels = [R || R <- ['17','18'], ?t:is_release_available(R)] ++ [current],
io:format("Creating crash dumps for the following releases: ~p", [Rels]),
AllDumps = create_dumps(DataDir,Rels),
[{dumps,AllDumps}|Config].
@@ -606,21 +606,21 @@ dos_dump(DataDir,Rel,Dump) ->
rel_opt(Rel) ->
case Rel of
- r16b -> [{erl,[{release,"r16b_latest"}]}];
'17' -> [{erl,[{release,"17_latest"}]}];
+ '18' -> [{erl,[{release,"18_latest"}]}];
current -> []
end.
dump_prefix(Rel) ->
case Rel of
- r16b -> "r16b_dump.";
'17' -> "r17_dump.";
- current -> "r18_dump."
+ '18' -> "r18_dump.";
+ current -> "r19_dump."
end.
compat_rel(Rel) ->
case Rel of
- r16b -> "+R16 ";
'17' -> "+R17 ";
+ '18' -> "+R18 ";
current -> ""
end.
diff --git a/lib/observer/test/etop_SUITE.erl b/lib/observer/test/etop_SUITE.erl
index 4b05e4c2a0..7614989f1f 100644
--- a/lib/observer/test/etop_SUITE.erl
+++ b/lib/observer/test/etop_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/test/observer_SUITE.erl b/lib/observer/test/observer_SUITE.erl
index a33df61b98..3dc3e4772b 100644
--- a/lib/observer/test/observer_SUITE.erl
+++ b/lib/observer/test/observer_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/observer/test/ttb_SUITE.erl b/lib/observer/test/ttb_SUITE.erl
index f1649e6cb9..c06ec21f36 100644
--- a/lib/observer/test/ttb_SUITE.erl
+++ b/lib/observer/test/ttb_SUITE.erl
@@ -2,7 +2,7 @@
%% %CopyrightBegin%
%%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -819,6 +819,7 @@ myhandler(_Fd,Trace,_,Relay) ->
simple_call_handler() ->
{fun(A, {trace_ts, _, call, _, _} ,_,_) -> io:format(A, "ok.~n", []);
+ (A, {drop, N}, _, _) -> io:format(A, "{drop, ~p}.", [N]);
(_, end_of_trace, _, _) -> ok end, []}.
marking_call_handler() ->
@@ -954,17 +955,24 @@ begin_trace_local(ServerNode, ClientNode, Dest) ->
?line ttb:tpl(client, get, []).
check_size(N, Dest, Output, ServerNode, ClientNode) ->
- ?line begin_trace(ServerNode, ClientNode, Dest),
- ?line case Dest of
+ begin_trace(ServerNode, ClientNode, Dest),
+ case Dest of
{local, _} ->
- ?line ttb_helper:msgs_ip(N);
+ ttb_helper:msgs_ip(N);
_ ->
- ?line ttb_helper:msgs(N)
+ ttb_helper:msgs(N)
end,
- ?line {_, D} = ttb:stop([fetch, return_fetch_dir]),
- ?line ttb:format(D, [{out, Output}, {handler, simple_call_handler()}]),
- ?line {ok, Ret} = file:consult(Output),
- ?line true = (N + 1 == length(Ret)).
+ {_, D} = ttb:stop([fetch, return_fetch_dir]),
+ ttb:format(D, [{out, Output}, {handler, simple_call_handler()}]),
+ {ok, Ret} = file:consult(Output),
+ check_output(N+1, Ret).
+
+check_output(Expected, Ret)
+ when length(Ret) =:= Expected -> ok;
+check_output(Expected, Ret) ->
+ io:format("~p~n",[Ret]),
+ io:format("Expected ~p got ~p ~n",[Expected, length(Ret)]),
+ Expected = length(Ret).
fetch_when_no_option_given(suite) ->
[];
@@ -1166,8 +1174,8 @@ changing_cwd_on_control_node(Config) when is_list(Config) ->
?line {_, D} = ttb:stop([fetch, return_fetch_dir]),
?line ttb:format(D, [{out, ?OUTPUT}, {handler, simple_call_handler()}]),
?line {ok, Ret} = file:consult(?OUTPUT),
- ?line true = (2*(NumMsgs + 1) == length(Ret)),
- ?line ok = file:set_cwd(OldDir).
+ check_output(2*(NumMsgs + 1),Ret),
+ ok = file:set_cwd(OldDir).
changing_cwd_on_control_node(cleanup,_Config) ->
?line stop_client_and_server().
@@ -1176,18 +1184,19 @@ changing_cwd_on_control_node_with_local_trace(suite) ->
changing_cwd_on_control_node_with_local_trace(doc) ->
["Changing cwd on control node during local tracing is safe"];
changing_cwd_on_control_node_with_local_trace(Config) when is_list(Config) ->
- ?line {ok, OldDir} = file:get_cwd(),
- ?line {ServerNode, ClientNode} = start_client_and_server(),
- ?line begin_trace(ServerNode, ClientNode, {local, ?FNAME}),
- ?line NumMsgs = 3,
- ?line ttb_helper:msgs_ip(NumMsgs),
- ?line ok = file:set_cwd(".."),
- ?line ttb_helper:msgs_ip(NumMsgs),
- ?line {_, D} = ttb:stop([fetch, return_fetch_dir]),
- ?line ttb:format(D, [{out, ?OUTPUT}, {handler, simple_call_handler()}]),
- ?line {ok, Ret} = file:consult(?OUTPUT),
- ?line true = (2*(NumMsgs + 1) == length(Ret)),
- ?line ok = file:set_cwd(OldDir).
+ {ok, OldDir} = file:get_cwd(),
+ {ServerNode, ClientNode} = start_client_and_server(),
+ begin_trace(ServerNode, ClientNode, {local, ?FNAME}),
+ NumMsgs = 3,
+ ttb_helper:msgs_ip(NumMsgs),
+ ok = file:set_cwd(".."),
+ ttb_helper:msgs_ip(NumMsgs),
+ {_, D} = ttb:stop([fetch, return_fetch_dir]),
+ ttb:format(D, [{out, ?OUTPUT}, {handler, simple_call_handler()}]),
+ {ok, Ret} = file:consult(?OUTPUT),
+ Expected = 2*(NumMsgs + 1),
+ check_output(Expected, Ret),
+ ok = file:set_cwd(OldDir).
changing_cwd_on_control_node_with_local_trace(cleanup,_Config) ->
?line stop_client_and_server().
@@ -1205,7 +1214,7 @@ changing_cwd_on_remote_node(Config) when is_list(Config) ->
?line {_, D} = ttb:stop([fetch, return_fetch_dir]),
?line ttb:format(D, [{out, ?OUTPUT}, {handler, simple_call_handler()}]),
?line {ok, Ret} = file:consult(?OUTPUT),
- ?line true = (2*(NumMsgs + 1) == length(Ret)).
+ check_output(2*(NumMsgs + 1),Ret).
changing_cwd_on_remote_node(cleanup,_Config) ->
?line stop_client_and_server().
@@ -1497,7 +1506,7 @@ logic(N, M, TracingType) ->
ct:log("formatted ~p",[{D,?OUTPUT}]),
?line {ok, Ret} = file:consult(?OUTPUT),
ct:log("consulted: ~p",[Ret]),
- ?line M = length(Ret).
+ check_output(M,Ret).
begin_trace_with_resume(ServerNode, ClientNode, Dest) ->
?line {ok, _} = ttb:tracer([ServerNode,ClientNode], [{file, Dest}, resume]),
diff --git a/lib/odbc/Makefile b/lib/odbc/Makefile
index b63a75270e..f7816c25fc 100644
--- a/lib/odbc/Makefile
+++ b/lib/odbc/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/odbc/c_src/Makefile b/lib/odbc/c_src/Makefile
index 93c971d679..66c1bda5b7 100644
--- a/lib/odbc/c_src/Makefile
+++ b/lib/odbc/c_src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2009. All Rights Reserved.
+# Copyright Ericsson AB 2005-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/odbc/c_src/Makefile.in b/lib/odbc/c_src/Makefile.in
index 685eb5d150..784e73c47e 100644
--- a/lib/odbc/c_src/Makefile.in
+++ b/lib/odbc/c_src/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/odbc/c_src/odbcserver.c b/lib/odbc/c_src/odbcserver.c
index 6e8ab5b0c8..8c799f6ff1 100644
--- a/lib/odbc/c_src/odbcserver.c
+++ b/lib/odbc/c_src/odbcserver.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/odbc/c_src/odbcserver.h b/lib/odbc/c_src/odbcserver.h
index 24e3e8f3ec..0461c57d1f 100644
--- a/lib/odbc/c_src/odbcserver.h
+++ b/lib/odbc/c_src/odbcserver.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/odbc/configure.in b/lib/odbc/configure.in
index 4b05050ef6..2871d91a1c 100644
--- a/lib/odbc/configure.in
+++ b/lib/odbc/configure.in
@@ -1,7 +1,7 @@
dnl
dnl %CopyrightBegin%
dnl
-dnl Copyright Ericsson AB 2005-2014. All Rights Reserved.
+dnl Copyright Ericsson AB 2005-2016. All Rights Reserved.
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
diff --git a/lib/odbc/doc/src/Makefile b/lib/odbc/doc/src/Makefile
index 96b4f07fe9..b66d00a88b 100644
--- a/lib/odbc/doc/src/Makefile
+++ b/lib/odbc/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/odbc/doc/src/book.xml b/lib/odbc/doc/src/book.xml
index 4ead93f870..f643293ebd 100644
--- a/lib/odbc/doc/src/book.xml
+++ b/lib/odbc/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/odbc/doc/src/databases.xml b/lib/odbc/doc/src/databases.xml
index d81a53e936..a060f87e46 100644
--- a/lib/odbc/doc/src/databases.xml
+++ b/lib/odbc/doc/src/databases.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/odbc/doc/src/error_handling.xml b/lib/odbc/doc/src/error_handling.xml
index 83a0121035..4c80cff12f 100644
--- a/lib/odbc/doc/src/error_handling.xml
+++ b/lib/odbc/doc/src/error_handling.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/odbc/doc/src/getting_started.xml b/lib/odbc/doc/src/getting_started.xml
index 64835b5be1..f2ff8b8993 100644
--- a/lib/odbc/doc/src/getting_started.xml
+++ b/lib/odbc/doc/src/getting_started.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/odbc/doc/src/introduction.xml b/lib/odbc/doc/src/introduction.xml
index 148396edf0..17f329d3fc 100644
--- a/lib/odbc/doc/src/introduction.xml
+++ b/lib/odbc/doc/src/introduction.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/odbc/doc/src/notes.xml b/lib/odbc/doc/src/notes.xml
index 59d46de02a..ac3c99badc 100644
--- a/lib/odbc/doc/src/notes.xml
+++ b/lib/odbc/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/odbc/doc/src/notes_history.xml b/lib/odbc/doc/src/notes_history.xml
index d9f0449d9d..22a92f67cd 100644
--- a/lib/odbc/doc/src/notes_history.xml
+++ b/lib/odbc/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/odbc/doc/src/odbc.xml b/lib/odbc/doc/src/odbc.xml
index 6a2a3587e4..4bb1f035f9 100644
--- a/lib/odbc/doc/src/odbc.xml
+++ b/lib/odbc/doc/src/odbc.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/odbc/doc/src/part.xml b/lib/odbc/doc/src/part.xml
index 98f4a6228b..07c2fd76ac 100644
--- a/lib/odbc/doc/src/part.xml
+++ b/lib/odbc/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/odbc/doc/src/part_notes.xml b/lib/odbc/doc/src/part_notes.xml
index e7af9adc62..8f1dbd3fbc 100644
--- a/lib/odbc/doc/src/part_notes.xml
+++ b/lib/odbc/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/odbc/doc/src/part_notes_history.xml b/lib/odbc/doc/src/part_notes_history.xml
index f1c7005f46..6f855f6ed1 100644
--- a/lib/odbc/doc/src/part_notes_history.xml
+++ b/lib/odbc/doc/src/part_notes_history.xml
@@ -4,7 +4,7 @@
<part>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/odbc/doc/src/ref_man.xml b/lib/odbc/doc/src/ref_man.xml
index 642642737f..2409e04381 100644
--- a/lib/odbc/doc/src/ref_man.xml
+++ b/lib/odbc/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/odbc/src/Makefile b/lib/odbc/src/Makefile
index 51c9ed3d5c..7ca59495ed 100644
--- a/lib/odbc/src/Makefile
+++ b/lib/odbc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/odbc/src/odbc.appup.src b/lib/odbc/src/odbc.appup.src
index 3580fe21b8..8aa0770013 100644
--- a/lib/odbc/src/odbc.appup.src
+++ b/lib/odbc/src/odbc.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/odbc/src/odbc.erl b/lib/odbc/src/odbc.erl
index 12560bfb6e..6b0ff27907 100644
--- a/lib/odbc/src/odbc.erl
+++ b/lib/odbc/src/odbc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/odbc/src/odbc_app.erl b/lib/odbc/src/odbc_app.erl
index cbc4d325ad..0a6d1ee5df 100644
--- a/lib/odbc/src/odbc_app.erl
+++ b/lib/odbc/src/odbc_app.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/odbc/src/odbc_internal.hrl b/lib/odbc/src/odbc_internal.hrl
index 0e0ed18a0f..2968c6ba54 100644
--- a/lib/odbc/src/odbc_internal.hrl
+++ b/lib/odbc/src/odbc_internal.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/odbc/src/odbc_sup.erl b/lib/odbc/src/odbc_sup.erl
index 96f0886f88..6a87160321 100644
--- a/lib/odbc/src/odbc_sup.erl
+++ b/lib/odbc/src/odbc_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/odbc/test/Makefile b/lib/odbc/test/Makefile
index 4fecea3aae..c90f76a83d 100644
--- a/lib/odbc/test/Makefile
+++ b/lib/odbc/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/odbc/test/README b/lib/odbc/test/README
index fc9559ebe6..0a8495afbb 100644
--- a/lib/odbc/test/README
+++ b/lib/odbc/test/README
@@ -70,7 +70,7 @@ As odbc connection string use: "DSN=odbctestdb;UID=odbctest;PWD=Sesame"
> %CopyrightBegin%
>
-> Copyright Ericsson AB 2010. All Rights Reserved.
+> Copyright Ericsson AB 2010-2016. All Rights Reserved.
>
> Licensed under the Apache License, Version 2.0 (the "License");
> you may not use this file except in compliance with the License.
diff --git a/lib/odbc/test/mysql.erl b/lib/odbc/test/mysql.erl
index 02f1610570..69b136e743 100644
--- a/lib/odbc/test/mysql.erl
+++ b/lib/odbc/test/mysql.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/odbc/test/odbc_connect_SUITE.erl b/lib/odbc/test/odbc_connect_SUITE.erl
index 41601a2750..5727c1ca50 100644
--- a/lib/odbc/test/odbc_connect_SUITE.erl
+++ b/lib/odbc/test/odbc_connect_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/odbc/test/odbc_data_type_SUITE.erl b/lib/odbc/test/odbc_data_type_SUITE.erl
index 25988bef2a..c88c00725e 100644
--- a/lib/odbc/test/odbc_data_type_SUITE.erl
+++ b/lib/odbc/test/odbc_data_type_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/odbc/test/odbc_query_SUITE.erl b/lib/odbc/test/odbc_query_SUITE.erl
index 79c756e956..5f719b7287 100644
--- a/lib/odbc/test/odbc_query_SUITE.erl
+++ b/lib/odbc/test/odbc_query_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/odbc/test/odbc_start_SUITE.erl b/lib/odbc/test/odbc_start_SUITE.erl
index e16b4cfb7f..f055eeb60e 100644
--- a/lib/odbc/test/odbc_start_SUITE.erl
+++ b/lib/odbc/test/odbc_start_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/odbc/test/odbc_test.hrl b/lib/odbc/test/odbc_test.hrl
index 7a4d9f3087..24ae2a4c29 100644
--- a/lib/odbc/test/odbc_test.hrl
+++ b/lib/odbc/test/odbc_test.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/odbc/test/odbc_test_lib.erl b/lib/odbc/test/odbc_test_lib.erl
index 88d772467c..37c2249303 100644
--- a/lib/odbc/test/odbc_test_lib.erl
+++ b/lib/odbc/test/odbc_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/odbc/test/oracle.erl b/lib/odbc/test/oracle.erl
index 98e0147744..589401b822 100644
--- a/lib/odbc/test/oracle.erl
+++ b/lib/odbc/test/oracle.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/odbc/test/postgres.erl b/lib/odbc/test/postgres.erl
index 7b41eb8c0a..1955358206 100644
--- a/lib/odbc/test/postgres.erl
+++ b/lib/odbc/test/postgres.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/odbc/test/sqlserver.erl b/lib/odbc/test/sqlserver.erl
index 750d8d38e6..faffeaae04 100644
--- a/lib/odbc/test/sqlserver.erl
+++ b/lib/odbc/test/sqlserver.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/COSS/CosNaming/CosNaming_BindingIterator_impl.erl b/lib/orber/COSS/CosNaming/CosNaming_BindingIterator_impl.erl
index 95602ec54b..760c003f82 100644
--- a/lib/orber/COSS/CosNaming/CosNaming_BindingIterator_impl.erl
+++ b/lib/orber/COSS/CosNaming/CosNaming_BindingIterator_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/COSS/CosNaming/Makefile b/lib/orber/COSS/CosNaming/Makefile
index 0eca8ddfab..108663396c 100644
--- a/lib/orber/COSS/CosNaming/Makefile
+++ b/lib/orber/COSS/CosNaming/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/orber/COSS/CosNaming/lname.erl b/lib/orber/COSS/CosNaming/lname.erl
index 388c4ac022..41f9f68d20 100644
--- a/lib/orber/COSS/CosNaming/lname.erl
+++ b/lib/orber/COSS/CosNaming/lname.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/COSS/CosNaming/lname.hrl b/lib/orber/COSS/CosNaming/lname.hrl
index 8f609df3ae..0c0eef86ab 100644
--- a/lib/orber/COSS/CosNaming/lname.hrl
+++ b/lib/orber/COSS/CosNaming/lname.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/COSS/CosNaming/lname_component.erl b/lib/orber/COSS/CosNaming/lname_component.erl
index a3715d93d1..4dead49a78 100644
--- a/lib/orber/COSS/CosNaming/lname_component.erl
+++ b/lib/orber/COSS/CosNaming/lname_component.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/COSS/CosNaming/orber_cosnaming.hrl b/lib/orber/COSS/CosNaming/orber_cosnaming.hrl
index c36ab47739..2950f7a11f 100644
--- a/lib/orber/COSS/CosNaming/orber_cosnaming.hrl
+++ b/lib/orber/COSS/CosNaming/orber_cosnaming.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/COSS/CosNaming/orber_cosnaming_utils.erl b/lib/orber/COSS/CosNaming/orber_cosnaming_utils.erl
index cb240c3011..c21e46036b 100644
--- a/lib/orber/COSS/CosNaming/orber_cosnaming_utils.erl
+++ b/lib/orber/COSS/CosNaming/orber_cosnaming_utils.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/Makefile b/lib/orber/Makefile
index 920cc7350c..7db588f206 100644
--- a/lib/orber/Makefile
+++ b/lib/orber/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/orber/c_src/Makefile b/lib/orber/c_src/Makefile
index bbf51d0efd..bad1d3ddb0 100644
--- a/lib/orber/c_src/Makefile
+++ b/lib/orber/c_src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/orber/c_src/Makefile.in b/lib/orber/c_src/Makefile.in
index e1323f1cc9..980e780451 100644
--- a/lib/orber/c_src/Makefile.in
+++ b/lib/orber/c_src/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/orber/doc/src/CosNaming.xml b/lib/orber/doc/src/CosNaming.xml
index a4e8e02702..d69b604f2f 100644
--- a/lib/orber/doc/src/CosNaming.xml
+++ b/lib/orber/doc/src/CosNaming.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/CosNaming_BindingIterator.xml b/lib/orber/doc/src/CosNaming_BindingIterator.xml
index 2a8f3633ca..69b0f42b22 100644
--- a/lib/orber/doc/src/CosNaming_BindingIterator.xml
+++ b/lib/orber/doc/src/CosNaming_BindingIterator.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/CosNaming_NamingContext.xml b/lib/orber/doc/src/CosNaming_NamingContext.xml
index 313015f5ee..96a6367cbb 100644
--- a/lib/orber/doc/src/CosNaming_NamingContext.xml
+++ b/lib/orber/doc/src/CosNaming_NamingContext.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/CosNaming_NamingContextExt.xml b/lib/orber/doc/src/CosNaming_NamingContextExt.xml
index ede908e13f..a571b97ccb 100644
--- a/lib/orber/doc/src/CosNaming_NamingContextExt.xml
+++ b/lib/orber/doc/src/CosNaming_NamingContextExt.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2000</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/Makefile b/lib/orber/doc/src/Makefile
index c9c362b336..ecb0206443 100644
--- a/lib/orber/doc/src/Makefile
+++ b/lib/orber/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/orber/doc/src/Module_Interface.xml b/lib/orber/doc/src/Module_Interface.xml
index 27335673cc..a809bcf02f 100644
--- a/lib/orber/doc/src/Module_Interface.xml
+++ b/lib/orber/doc/src/Module_Interface.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1999</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/Orber/InitialReference.java b/lib/orber/doc/src/Orber/InitialReference.java
index 0ae2ebfb68..35a8c2437b 100644
--- a/lib/orber/doc/src/Orber/InitialReference.java
+++ b/lib/orber/doc/src/Orber/InitialReference.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/orber/doc/src/Orber/Makefile b/lib/orber/doc/src/Orber/Makefile
index 278fa182ee..16a3994499 100644
--- a/lib/orber/doc/src/Orber/Makefile
+++ b/lib/orber/doc/src/Orber/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/orber/doc/src/any.xml b/lib/orber/doc/src/any.xml
index 8234b62be3..f51712c97e 100644
--- a/lib/orber/doc/src/any.xml
+++ b/lib/orber/doc/src/any.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1998</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/book.xml b/lib/orber/doc/src/book.xml
index dc073fdeda..81bd5a8f65 100644
--- a/lib/orber/doc/src/book.xml
+++ b/lib/orber/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/ch_contents.xml b/lib/orber/doc/src/ch_contents.xml
index 6ac9f1cb11..b783e63aee 100644
--- a/lib/orber/doc/src/ch_contents.xml
+++ b/lib/orber/doc/src/ch_contents.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/ch_debugging.xml b/lib/orber/doc/src/ch_debugging.xml
index 2fbc9285eb..a036cf5231 100644
--- a/lib/orber/doc/src/ch_debugging.xml
+++ b/lib/orber/doc/src/ch_debugging.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/ch_exceptions.xml b/lib/orber/doc/src/ch_exceptions.xml
index 8a8cb9d470..52735dc394 100644
--- a/lib/orber/doc/src/ch_exceptions.xml
+++ b/lib/orber/doc/src/ch_exceptions.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/ch_idl_to_erlang_mapping.xml b/lib/orber/doc/src/ch_idl_to_erlang_mapping.xml
index debd0cf888..a0feda3f84 100644
--- a/lib/orber/doc/src/ch_idl_to_erlang_mapping.xml
+++ b/lib/orber/doc/src/ch_idl_to_erlang_mapping.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/ch_ifr.xml b/lib/orber/doc/src/ch_ifr.xml
index c34a6fabd5..09302ab6cc 100644
--- a/lib/orber/doc/src/ch_ifr.xml
+++ b/lib/orber/doc/src/ch_ifr.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/ch_install.xml b/lib/orber/doc/src/ch_install.xml
index 5fb7d7b9a3..9bc974225d 100644
--- a/lib/orber/doc/src/ch_install.xml
+++ b/lib/orber/doc/src/ch_install.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/ch_interceptors.xml b/lib/orber/doc/src/ch_interceptors.xml
index 111e00cb5b..392fe7de82 100644
--- a/lib/orber/doc/src/ch_interceptors.xml
+++ b/lib/orber/doc/src/ch_interceptors.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/ch_introduction.xml b/lib/orber/doc/src/ch_introduction.xml
index fc86ad2dc6..f04fedd0a7 100644
--- a/lib/orber/doc/src/ch_introduction.xml
+++ b/lib/orber/doc/src/ch_introduction.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/ch_naming_service.xml b/lib/orber/doc/src/ch_naming_service.xml
index 4a9c970cb4..bcbab2a597 100644
--- a/lib/orber/doc/src/ch_naming_service.xml
+++ b/lib/orber/doc/src/ch_naming_service.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/ch_orber_kernel.xml b/lib/orber/doc/src/ch_orber_kernel.xml
index 66d33d065c..396e1360fd 100644
--- a/lib/orber/doc/src/ch_orber_kernel.xml
+++ b/lib/orber/doc/src/ch_orber_kernel.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/ch_orberweb.xml b/lib/orber/doc/src/ch_orberweb.xml
index 804d22ff49..be1d7fb983 100644
--- a/lib/orber/doc/src/ch_orberweb.xml
+++ b/lib/orber/doc/src/ch_orberweb.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/ch_security.xml b/lib/orber/doc/src/ch_security.xml
index 6b5c9b90ec..151e417079 100644
--- a/lib/orber/doc/src/ch_security.xml
+++ b/lib/orber/doc/src/ch_security.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/ch_stubs.xml b/lib/orber/doc/src/ch_stubs.xml
index e055658b6c..144191a66a 100644
--- a/lib/orber/doc/src/ch_stubs.xml
+++ b/lib/orber/doc/src/ch_stubs.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/corba.xml b/lib/orber/doc/src/corba.xml
index 89288cdf6b..d89f035dba 100644
--- a/lib/orber/doc/src/corba.xml
+++ b/lib/orber/doc/src/corba.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/corba_object.xml b/lib/orber/doc/src/corba_object.xml
index 37b0dc9fd0..09a4b0bc3c 100644
--- a/lib/orber/doc/src/corba_object.xml
+++ b/lib/orber/doc/src/corba_object.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/example_part.xml b/lib/orber/doc/src/example_part.xml
index 9460fdc9b0..61c9524cc3 100644
--- a/lib/orber/doc/src/example_part.xml
+++ b/lib/orber/doc/src/example_part.xml
@@ -4,7 +4,7 @@
<part>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/fixed.xml b/lib/orber/doc/src/fixed.xml
index 7036e8917f..a751476cf7 100644
--- a/lib/orber/doc/src/fixed.xml
+++ b/lib/orber/doc/src/fixed.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2002</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/interceptors.xml b/lib/orber/doc/src/interceptors.xml
index 780739fd96..0aade8ffb4 100644
--- a/lib/orber/doc/src/interceptors.xml
+++ b/lib/orber/doc/src/interceptors.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/intro_part.xml b/lib/orber/doc/src/intro_part.xml
index 45c121cc57..7e5520e42e 100644
--- a/lib/orber/doc/src/intro_part.xml
+++ b/lib/orber/doc/src/intro_part.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2002</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/lname.xml b/lib/orber/doc/src/lname.xml
index dc7928e5de..09d6859777 100644
--- a/lib/orber/doc/src/lname.xml
+++ b/lib/orber/doc/src/lname.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/lname_component.xml b/lib/orber/doc/src/lname_component.xml
index bf1d1e5375..631e5d0244 100644
--- a/lib/orber/doc/src/lname_component.xml
+++ b/lib/orber/doc/src/lname_component.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/notes.xml b/lib/orber/doc/src/notes.xml
index 1da60ba486..74d9d7a98c 100644
--- a/lib/orber/doc/src/notes.xml
+++ b/lib/orber/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/orber.xml b/lib/orber/doc/src/orber.xml
index 577bb2ee05..d8c6936515 100644
--- a/lib/orber/doc/src/orber.xml
+++ b/lib/orber/doc/src/orber.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/orber_acl.xml b/lib/orber/doc/src/orber_acl.xml
index ab3a35df36..5feda83ef6 100644
--- a/lib/orber/doc/src/orber_acl.xml
+++ b/lib/orber/doc/src/orber_acl.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2005</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/orber_diagnostics.xml b/lib/orber/doc/src/orber_diagnostics.xml
index a53391bb9a..3aad304535 100644
--- a/lib/orber/doc/src/orber_diagnostics.xml
+++ b/lib/orber/doc/src/orber_diagnostics.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/orber_ifr.xml b/lib/orber/doc/src/orber_ifr.xml
index c9b6fe6459..a667d7d9e4 100644
--- a/lib/orber/doc/src/orber_ifr.xml
+++ b/lib/orber/doc/src/orber_ifr.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/orber_tc.xml b/lib/orber/doc/src/orber_tc.xml
index 7c49ebce11..0cab8a5e4b 100644
--- a/lib/orber/doc/src/orber_tc.xml
+++ b/lib/orber/doc/src/orber_tc.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1998</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/part.xml b/lib/orber/doc/src/part.xml
index 236e93e73e..ef84b8c05a 100644
--- a/lib/orber/doc/src/part.xml
+++ b/lib/orber/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/part_notes.xml b/lib/orber/doc/src/part_notes.xml
index d4c217e158..61d9d4c3b9 100644
--- a/lib/orber/doc/src/part_notes.xml
+++ b/lib/orber/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/ref_man.xml b/lib/orber/doc/src/ref_man.xml
index 4785c18ff6..6fa409538d 100644
--- a/lib/orber/doc/src/ref_man.xml
+++ b/lib/orber/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/doc/src/tools_debugging_part.xml b/lib/orber/doc/src/tools_debugging_part.xml
index 7a718ad448..94af44833c 100644
--- a/lib/orber/doc/src/tools_debugging_part.xml
+++ b/lib/orber/doc/src/tools_debugging_part.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2002</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/orber/examples/Makefile b/lib/orber/examples/Makefile
index 06b0be9c4d..bf1ff13707 100644
--- a/lib/orber/examples/Makefile
+++ b/lib/orber/examples/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/orber/examples/Stack/Makefile b/lib/orber/examples/Stack/Makefile
index abdd65823f..5348c624e3 100644
--- a/lib/orber/examples/Stack/Makefile
+++ b/lib/orber/examples/Stack/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/orber/examples/Stack/StackClient.java b/lib/orber/examples/Stack/StackClient.java
index 55c9c258bd..55e967a330 100644
--- a/lib/orber/examples/Stack/StackClient.java
+++ b/lib/orber/examples/Stack/StackClient.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/orber/examples/Stack/StackModule_StackFactory_impl.erl b/lib/orber/examples/Stack/StackModule_StackFactory_impl.erl
index 1fc1f6fa8e..76e449971f 100644
--- a/lib/orber/examples/Stack/StackModule_StackFactory_impl.erl
+++ b/lib/orber/examples/Stack/StackModule_StackFactory_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/examples/Stack/StackModule_Stack_impl.erl b/lib/orber/examples/Stack/StackModule_Stack_impl.erl
index 5b882badec..ff4dc90829 100644
--- a/lib/orber/examples/Stack/StackModule_Stack_impl.erl
+++ b/lib/orber/examples/Stack/StackModule_Stack_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/examples/Stack/stack_client.erl b/lib/orber/examples/Stack/stack_client.erl
index 4b508ace8d..6e32195b1b 100644
--- a/lib/orber/examples/Stack/stack_client.erl
+++ b/lib/orber/examples/Stack/stack_client.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/examples/Stack/stack_factory.erl b/lib/orber/examples/Stack/stack_factory.erl
index 7f9cfb7196..b5b455ae5a 100644
--- a/lib/orber/examples/Stack/stack_factory.erl
+++ b/lib/orber/examples/Stack/stack_factory.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/include/corba.hrl b/lib/orber/include/corba.hrl
index 9acdfd808b..fb1c2a5a94 100644
--- a/lib/orber/include/corba.hrl
+++ b/lib/orber/include/corba.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/include/ifr_types.hrl b/lib/orber/include/ifr_types.hrl
index 451b5c622d..ceb8bbe885 100644
--- a/lib/orber/include/ifr_types.hrl
+++ b/lib/orber/include/ifr_types.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/include/orber_pi.hrl b/lib/orber/include/orber_pi.hrl
index b160cdae3e..7d1fa1edf2 100644
--- a/lib/orber/include/orber_pi.hrl
+++ b/lib/orber/include/orber_pi.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/java_src/Makefile b/lib/orber/java_src/Makefile
index bc604be179..d8a8843d00 100644
--- a/lib/orber/java_src/Makefile
+++ b/lib/orber/java_src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/orber/java_src/Orber/InitialReference.java b/lib/orber/java_src/Orber/InitialReference.java
index 0ae2ebfb68..35a8c2437b 100644
--- a/lib/orber/java_src/Orber/InitialReference.java
+++ b/lib/orber/java_src/Orber/InitialReference.java
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/orber/java_src/Orber/Makefile b/lib/orber/java_src/Orber/Makefile
index d42b8ad982..3414fb2e76 100644
--- a/lib/orber/java_src/Orber/Makefile
+++ b/lib/orber/java_src/Orber/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/orber/priv/Makefile b/lib/orber/priv/Makefile
index b8fafd952c..268c16c4c7 100644
--- a/lib/orber/priv/Makefile
+++ b/lib/orber/priv/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/Makefile b/lib/orber/src/Makefile
index 30b74c490a..7fec29a000 100644
--- a/lib/orber/src/Makefile
+++ b/lib/orber/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/OrberApp_IFR_impl.erl b/lib/orber/src/OrberApp_IFR_impl.erl
index 468e1d80a3..069f4ad17a 100644
--- a/lib/orber/src/OrberApp_IFR_impl.erl
+++ b/lib/orber/src/OrberApp_IFR_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/any.erl b/lib/orber/src/any.erl
index 03354fd632..ec7c3ba83a 100644
--- a/lib/orber/src/any.erl
+++ b/lib/orber/src/any.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/cdr_encode.erl b/lib/orber/src/cdr_encode.erl
index ce0b5066fc..f922b330a0 100644
--- a/lib/orber/src/cdr_encode.erl
+++ b/lib/orber/src/cdr_encode.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/cdrlib.erl b/lib/orber/src/cdrlib.erl
index cbe25f6d84..a181681382 100644
--- a/lib/orber/src/cdrlib.erl
+++ b/lib/orber/src/cdrlib.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/corba_boa.erl b/lib/orber/src/corba_boa.erl
index 830e3795e6..12b063a5db 100644
--- a/lib/orber/src/corba_boa.erl
+++ b/lib/orber/src/corba_boa.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/corba_nvlist.erl b/lib/orber/src/corba_nvlist.erl
index e221fa1ef0..4a1361842b 100644
--- a/lib/orber/src/corba_nvlist.erl
+++ b/lib/orber/src/corba_nvlist.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/corba_object.erl b/lib/orber/src/corba_object.erl
index 32a4f76d71..bf31226067 100644
--- a/lib/orber/src/corba_object.erl
+++ b/lib/orber/src/corba_object.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/fixed.erl b/lib/orber/src/fixed.erl
index 63058256c9..8d6239991d 100644
--- a/lib/orber/src/fixed.erl
+++ b/lib/orber/src/fixed.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/ifr_objects.hrl b/lib/orber/src/ifr_objects.hrl
index a05eb3af56..3feedbc652 100644
--- a/lib/orber/src/ifr_objects.hrl
+++ b/lib/orber/src/ifr_objects.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/iop_ior.erl b/lib/orber/src/iop_ior.erl
index 45a6eda157..a78a6b96e5 100644
--- a/lib/orber/src/iop_ior.erl
+++ b/lib/orber/src/iop_ior.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber.erl b/lib/orber/src/orber.erl
index 061b02fd02..f5e2429f5d 100644
--- a/lib/orber/src/orber.erl
+++ b/lib/orber/src/orber.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_acl.erl b/lib/orber/src/orber_acl.erl
index c5a412398e..55d84afbab 100644
--- a/lib/orber/src/orber_acl.erl
+++ b/lib/orber/src/orber_acl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_diagnostics.erl b/lib/orber/src/orber_diagnostics.erl
index 4206ae9be8..18d28fcf35 100644
--- a/lib/orber/src/orber_diagnostics.erl
+++ b/lib/orber/src/orber_diagnostics.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_env.erl b/lib/orber/src/orber_env.erl
index 98d1420148..3000af6cd3 100644
--- a/lib/orber/src/orber_env.erl
+++ b/lib/orber/src/orber_env.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_exceptions.erl b/lib/orber/src/orber_exceptions.erl
index 257724e06d..2519775eb3 100644
--- a/lib/orber/src/orber_exceptions.erl
+++ b/lib/orber/src/orber_exceptions.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr.hrl b/lib/orber/src/orber_ifr.hrl
index 9779e9246c..10634f58c0 100644
--- a/lib/orber/src/orber_ifr.hrl
+++ b/lib/orber/src/orber_ifr.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_aliasdef.erl b/lib/orber/src/orber_ifr_aliasdef.erl
index ddc93f98ec..04a92be5e3 100644
--- a/lib/orber/src/orber_ifr_aliasdef.erl
+++ b/lib/orber/src/orber_ifr_aliasdef.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_arraydef.erl b/lib/orber/src/orber_ifr_arraydef.erl
index 9e22fc221b..1513914a08 100644
--- a/lib/orber/src/orber_ifr_arraydef.erl
+++ b/lib/orber/src/orber_ifr_arraydef.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_attributedef.erl b/lib/orber/src/orber_ifr_attributedef.erl
index a4f20e4a88..bf7d1d2b63 100644
--- a/lib/orber/src/orber_ifr_attributedef.erl
+++ b/lib/orber/src/orber_ifr_attributedef.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_constantdef.erl b/lib/orber/src/orber_ifr_constantdef.erl
index 33a0537b81..b9d4393177 100644
--- a/lib/orber/src/orber_ifr_constantdef.erl
+++ b/lib/orber/src/orber_ifr_constantdef.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_contained.erl b/lib/orber/src/orber_ifr_contained.erl
index bcb6c73908..d5f41fbe72 100644
--- a/lib/orber/src/orber_ifr_contained.erl
+++ b/lib/orber/src/orber_ifr_contained.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_container.erl b/lib/orber/src/orber_ifr_container.erl
index fd378f4942..e085985bc4 100644
--- a/lib/orber/src/orber_ifr_container.erl
+++ b/lib/orber/src/orber_ifr_container.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_enumdef.erl b/lib/orber/src/orber_ifr_enumdef.erl
index ffe300bf1b..b1820046bb 100644
--- a/lib/orber/src/orber_ifr_enumdef.erl
+++ b/lib/orber/src/orber_ifr_enumdef.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_exceptiondef.erl b/lib/orber/src/orber_ifr_exceptiondef.erl
index e78fc1da37..a9e477f01a 100644
--- a/lib/orber/src/orber_ifr_exceptiondef.erl
+++ b/lib/orber/src/orber_ifr_exceptiondef.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_fixeddef.erl b/lib/orber/src/orber_ifr_fixeddef.erl
index 52cbf5846f..fc1b354af0 100644
--- a/lib/orber/src/orber_ifr_fixeddef.erl
+++ b/lib/orber/src/orber_ifr_fixeddef.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_idltype.erl b/lib/orber/src/orber_ifr_idltype.erl
index febee65508..44ab86c41a 100644
--- a/lib/orber/src/orber_ifr_idltype.erl
+++ b/lib/orber/src/orber_ifr_idltype.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_interfacedef.erl b/lib/orber/src/orber_ifr_interfacedef.erl
index 5a1e552261..1195f1eff6 100644
--- a/lib/orber/src/orber_ifr_interfacedef.erl
+++ b/lib/orber/src/orber_ifr_interfacedef.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_irobject.erl b/lib/orber/src/orber_ifr_irobject.erl
index a362344107..1111f00f81 100644
--- a/lib/orber/src/orber_ifr_irobject.erl
+++ b/lib/orber/src/orber_ifr_irobject.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_moduledef.erl b/lib/orber/src/orber_ifr_moduledef.erl
index 3b2bd43e5e..add0feb31a 100644
--- a/lib/orber/src/orber_ifr_moduledef.erl
+++ b/lib/orber/src/orber_ifr_moduledef.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_operationdef.erl b/lib/orber/src/orber_ifr_operationdef.erl
index 9abe895fc0..4bc368487c 100644
--- a/lib/orber/src/orber_ifr_operationdef.erl
+++ b/lib/orber/src/orber_ifr_operationdef.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_primitivedef.erl b/lib/orber/src/orber_ifr_primitivedef.erl
index 14ca32901b..bf91bc87bb 100644
--- a/lib/orber/src/orber_ifr_primitivedef.erl
+++ b/lib/orber/src/orber_ifr_primitivedef.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_sequencedef.erl b/lib/orber/src/orber_ifr_sequencedef.erl
index 8e9df8fc7f..f3a9806828 100644
--- a/lib/orber/src/orber_ifr_sequencedef.erl
+++ b/lib/orber/src/orber_ifr_sequencedef.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_stringdef.erl b/lib/orber/src/orber_ifr_stringdef.erl
index 09c1daf491..b206a218c1 100644
--- a/lib/orber/src/orber_ifr_stringdef.erl
+++ b/lib/orber/src/orber_ifr_stringdef.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_structdef.erl b/lib/orber/src/orber_ifr_structdef.erl
index 79ad63be87..3a9cde353e 100644
--- a/lib/orber/src/orber_ifr_structdef.erl
+++ b/lib/orber/src/orber_ifr_structdef.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_typecode.erl b/lib/orber/src/orber_ifr_typecode.erl
index 8928ecf386..52263be719 100644
--- a/lib/orber/src/orber_ifr_typecode.erl
+++ b/lib/orber/src/orber_ifr_typecode.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_typedef.erl b/lib/orber/src/orber_ifr_typedef.erl
index 8b2b2d7bf1..3441d7e7af 100644
--- a/lib/orber/src/orber_ifr_typedef.erl
+++ b/lib/orber/src/orber_ifr_typedef.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_uniondef.erl b/lib/orber/src/orber_ifr_uniondef.erl
index fb881cf504..64d55ee581 100644
--- a/lib/orber/src/orber_ifr_uniondef.erl
+++ b/lib/orber/src/orber_ifr_uniondef.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_ifr_wstringdef.erl b/lib/orber/src/orber_ifr_wstringdef.erl
index c9eb095e54..2ff7d84c7a 100644
--- a/lib/orber/src/orber_ifr_wstringdef.erl
+++ b/lib/orber/src/orber_ifr_wstringdef.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_iiop.hrl b/lib/orber/src/orber_iiop.hrl
index e0cd698061..6bc82fb6d6 100644
--- a/lib/orber/src/orber_iiop.hrl
+++ b/lib/orber/src/orber_iiop.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_iiop_inproxy.erl b/lib/orber/src/orber_iiop_inproxy.erl
index 3af06eef55..b595586f84 100644
--- a/lib/orber/src/orber_iiop_inproxy.erl
+++ b/lib/orber/src/orber_iiop_inproxy.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_iiop_insup.erl b/lib/orber/src/orber_iiop_insup.erl
index ac62791f7a..2885cf06c0 100644
--- a/lib/orber/src/orber_iiop_insup.erl
+++ b/lib/orber/src/orber_iiop_insup.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_iiop_net.erl b/lib/orber/src/orber_iiop_net.erl
index 723baa1d17..e7f54891a2 100644
--- a/lib/orber/src/orber_iiop_net.erl
+++ b/lib/orber/src/orber_iiop_net.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_iiop_net_accept.erl b/lib/orber/src/orber_iiop_net_accept.erl
index 48d8f562d4..2a53d55cea 100644
--- a/lib/orber/src/orber_iiop_net_accept.erl
+++ b/lib/orber/src/orber_iiop_net_accept.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_iiop_outproxy.erl b/lib/orber/src/orber_iiop_outproxy.erl
index 9d54f57ab9..1406a1ad56 100644
--- a/lib/orber/src/orber_iiop_outproxy.erl
+++ b/lib/orber/src/orber_iiop_outproxy.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_iiop_outsup.erl b/lib/orber/src/orber_iiop_outsup.erl
index 8789b6e646..f3627e01a0 100644
--- a/lib/orber/src/orber_iiop_outsup.erl
+++ b/lib/orber/src/orber_iiop_outsup.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_iiop_pm.erl b/lib/orber/src/orber_iiop_pm.erl
index cf95fe7e4f..72084227aa 100644
--- a/lib/orber/src/orber_iiop_pm.erl
+++ b/lib/orber/src/orber_iiop_pm.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_iiop_socketsup.erl b/lib/orber/src/orber_iiop_socketsup.erl
index 45113232c5..43b5444c82 100644
--- a/lib/orber/src/orber_iiop_socketsup.erl
+++ b/lib/orber/src/orber_iiop_socketsup.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_iiop_tracer.erl b/lib/orber/src/orber_iiop_tracer.erl
index 0b7da19449..8d6cd2e8b8 100644
--- a/lib/orber/src/orber_iiop_tracer.erl
+++ b/lib/orber/src/orber_iiop_tracer.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_iiop_tracer_silent.erl b/lib/orber/src/orber_iiop_tracer_silent.erl
index fa66b4d4cd..659de0acee 100644
--- a/lib/orber/src/orber_iiop_tracer_silent.erl
+++ b/lib/orber/src/orber_iiop_tracer_silent.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_iiop_tracer_stealth.erl b/lib/orber/src/orber_iiop_tracer_stealth.erl
index f4185fa6fd..8eaa945d3f 100644
--- a/lib/orber/src/orber_iiop_tracer_stealth.erl
+++ b/lib/orber/src/orber_iiop_tracer_stealth.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_initial_references.erl b/lib/orber/src/orber_initial_references.erl
index e72de4dd23..738d702088 100644
--- a/lib/orber/src/orber_initial_references.erl
+++ b/lib/orber/src/orber_initial_references.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_interceptors.erl b/lib/orber/src/orber_interceptors.erl
index c9b351d9fa..4bfb2ae9a5 100644
--- a/lib/orber/src/orber_interceptors.erl
+++ b/lib/orber/src/orber_interceptors.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_request_number.erl b/lib/orber/src/orber_request_number.erl
index 5869d32b4d..755b999c13 100644
--- a/lib/orber/src/orber_request_number.erl
+++ b/lib/orber/src/orber_request_number.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_tb.erl b/lib/orber/src/orber_tb.erl
index 16e8fdd9a0..6a758330cd 100644
--- a/lib/orber/src/orber_tb.erl
+++ b/lib/orber/src/orber_tb.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_tc.erl b/lib/orber/src/orber_tc.erl
index 26bdb12470..9a8a9259ed 100644
--- a/lib/orber/src/orber_tc.erl
+++ b/lib/orber/src/orber_tc.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_typedefs.erl b/lib/orber/src/orber_typedefs.erl
index bf21cf599d..30c03974c2 100644
--- a/lib/orber/src/orber_typedefs.erl
+++ b/lib/orber/src/orber_typedefs.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/src/orber_web.erl b/lib/orber/src/orber_web.erl
index 20835d0a12..cc24b2cb19 100644
--- a/lib/orber/src/orber_web.erl
+++ b/lib/orber/src/orber_web.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/Makefile b/lib/orber/test/Makefile
index 1d4e3c70f0..782ee2730b 100644
--- a/lib/orber/test/Makefile
+++ b/lib/orber/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/cdrcoding_10_SUITE.erl b/lib/orber/test/cdrcoding_10_SUITE.erl
index dac6e78ddd..3eb35572c1 100644
--- a/lib/orber/test/cdrcoding_10_SUITE.erl
+++ b/lib/orber/test/cdrcoding_10_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/cdrcoding_11_SUITE.erl b/lib/orber/test/cdrcoding_11_SUITE.erl
index f4fe3d06e3..7513888449 100644
--- a/lib/orber/test/cdrcoding_11_SUITE.erl
+++ b/lib/orber/test/cdrcoding_11_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/cdrcoding_12_SUITE.erl b/lib/orber/test/cdrcoding_12_SUITE.erl
index 8843233d35..1c04dc0711 100644
--- a/lib/orber/test/cdrcoding_12_SUITE.erl
+++ b/lib/orber/test/cdrcoding_12_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/cdrlib_SUITE.erl b/lib/orber/test/cdrlib_SUITE.erl
index 8fc9c655ce..e3482d11bd 100644
--- a/lib/orber/test/cdrlib_SUITE.erl
+++ b/lib/orber/test/cdrlib_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/corba_SUITE.erl b/lib/orber/test/corba_SUITE.erl
index 018d8b5f12..559e405226 100644
--- a/lib/orber/test/corba_SUITE.erl
+++ b/lib/orber/test/corba_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/csiv2_SUITE.erl b/lib/orber/test/csiv2_SUITE.erl
index cf4dbec073..48818e4cab 100644
--- a/lib/orber/test/csiv2_SUITE.erl
+++ b/lib/orber/test/csiv2_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/data_types_SUITE.erl b/lib/orber/test/data_types_SUITE.erl
index f910eecae7..8dd404a173 100644
--- a/lib/orber/test/data_types_SUITE.erl
+++ b/lib/orber/test/data_types_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/generated_SUITE.erl b/lib/orber/test/generated_SUITE.erl
index 7af355620e..2062afe2bb 100644
--- a/lib/orber/test/generated_SUITE.erl
+++ b/lib/orber/test/generated_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/iiop_module_do_test_impl.erl b/lib/orber/test/iiop_module_do_test_impl.erl
index c6c1d4d48a..3e433ace72 100644
--- a/lib/orber/test/iiop_module_do_test_impl.erl
+++ b/lib/orber/test/iiop_module_do_test_impl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/iiop_module_test_impl.erl b/lib/orber/test/iiop_module_test_impl.erl
index cebdf160ab..c2ec427d5d 100644
--- a/lib/orber/test/iiop_module_test_impl.erl
+++ b/lib/orber/test/iiop_module_test_impl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/iiop_test.idl b/lib/orber/test/iiop_test.idl
index 98f06e2c9d..0b20a66edd 100644
--- a/lib/orber/test/iiop_test.idl
+++ b/lib/orber/test/iiop_test.idl
@@ -1,7 +1,7 @@
//
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/iiop_test_impl.erl b/lib/orber/test/iiop_test_impl.erl
index 3fd512b574..26694f8e08 100644
--- a/lib/orber/test/iiop_test_impl.erl
+++ b/lib/orber/test/iiop_test_impl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/interceptors_SUITE.erl b/lib/orber/test/interceptors_SUITE.erl
index ec30187aca..1bce0a3bfd 100644
--- a/lib/orber/test/interceptors_SUITE.erl
+++ b/lib/orber/test/interceptors_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/iop_ior_10_SUITE.erl b/lib/orber/test/iop_ior_10_SUITE.erl
index edfe566dcd..8779e123e0 100644
--- a/lib/orber/test/iop_ior_10_SUITE.erl
+++ b/lib/orber/test/iop_ior_10_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/iop_ior_11_SUITE.erl b/lib/orber/test/iop_ior_11_SUITE.erl
index d24e3fb882..46342ddfd7 100644
--- a/lib/orber/test/iop_ior_11_SUITE.erl
+++ b/lib/orber/test/iop_ior_11_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/iop_ior_12_SUITE.erl b/lib/orber/test/iop_ior_12_SUITE.erl
index 725118b609..bce9f3af88 100644
--- a/lib/orber/test/iop_ior_12_SUITE.erl
+++ b/lib/orber/test/iop_ior_12_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/ip_v4v6_interop_SUITE.erl b/lib/orber/test/ip_v4v6_interop_SUITE.erl
index 4840501418..cc5bcd71a5 100644
--- a/lib/orber/test/ip_v4v6_interop_SUITE.erl
+++ b/lib/orber/test/ip_v4v6_interop_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/lname_SUITE.erl b/lib/orber/test/lname_SUITE.erl
index 1fb4d7bbb9..a12f2b88a7 100644
--- a/lib/orber/test/lname_SUITE.erl
+++ b/lib/orber/test/lname_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/multi_ORB_SUITE.erl b/lib/orber/test/multi_ORB_SUITE.erl
index abedcec407..9708111525 100644
--- a/lib/orber/test/multi_ORB_SUITE.erl
+++ b/lib/orber/test/multi_ORB_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/naming_context_SUITE.erl b/lib/orber/test/naming_context_SUITE.erl
index 626b9237b5..12d93caf9f 100644
--- a/lib/orber/test/naming_context_SUITE.erl
+++ b/lib/orber/test/naming_context_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/orber_SUITE.erl b/lib/orber/test/orber_SUITE.erl
index 1ca22cd60b..46403c00cb 100644
--- a/lib/orber/test/orber_SUITE.erl
+++ b/lib/orber/test/orber_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/orber_acl_SUITE.erl b/lib/orber/test/orber_acl_SUITE.erl
index 0d8f79de5c..43dc4497bd 100644
--- a/lib/orber/test/orber_acl_SUITE.erl
+++ b/lib/orber/test/orber_acl_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl b/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl
index efa4f120c7..a76682608f 100644
--- a/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl
+++ b/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl b/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl
index cfe1ab2d95..b1c8e00aba 100644
--- a/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl
+++ b/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl b/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl
index 514504716f..e1a172140c 100644
--- a/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl
+++ b/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl b/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl
index 9ff57a0294..8dfc7d9d6f 100644
--- a/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl
+++ b/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/orber_nat_SUITE.erl b/lib/orber/test/orber_nat_SUITE.erl
index 0751cdf89c..24744a6348 100644
--- a/lib/orber/test/orber_nat_SUITE.erl
+++ b/lib/orber/test/orber_nat_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/orber_test.idl b/lib/orber/test/orber_test.idl
index 3fc1e64f48..852daabedf 100644
--- a/lib/orber/test/orber_test.idl
+++ b/lib/orber/test/orber_test.idl
@@ -1,7 +1,7 @@
//
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1997-2010. All Rights Reserved.
+// Copyright Ericsson AB 1997-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/orber_test_lib.erl b/lib/orber/test/orber_test_lib.erl
index 796ed21489..95ab26cd30 100644
--- a/lib/orber/test/orber_test_lib.erl
+++ b/lib/orber/test/orber_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/orber_test_server.cfg b/lib/orber/test/orber_test_server.cfg
index d74dcb15ce..c6bbd99f17 100644
--- a/lib/orber/test/orber_test_server.cfg
+++ b/lib/orber/test/orber_test_server.cfg
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/orber_test_server.idl b/lib/orber/test/orber_test_server.idl
index 80a25763cd..f274baed24 100644
--- a/lib/orber/test/orber_test_server.idl
+++ b/lib/orber/test/orber_test_server.idl
@@ -1,7 +1,7 @@
//
// %CopyrightBegin%
//
-// Copyright Ericsson AB 1999-2010. All Rights Reserved.
+// Copyright Ericsson AB 1999-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/orber_test_server_impl.erl b/lib/orber/test/orber_test_server_impl.erl
index b35e959c9d..d9cef17d26 100644
--- a/lib/orber/test/orber_test_server_impl.erl
+++ b/lib/orber/test/orber_test_server_impl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/orber_test_timeout_server_impl.erl b/lib/orber/test/orber_test_timeout_server_impl.erl
index 9ae61378e9..de16877dde 100644
--- a/lib/orber/test/orber_test_timeout_server_impl.erl
+++ b/lib/orber/test/orber_test_timeout_server_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/orber_web_SUITE.erl b/lib/orber/test/orber_web_SUITE.erl
index 31c67be9d8..2966fbd994 100644
--- a/lib/orber/test/orber_web_SUITE.erl
+++ b/lib/orber/test/orber_web_SUITE.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/orber/test/tc_SUITE.erl b/lib/orber/test/tc_SUITE.erl
index c670ebdea2..565d9f4645 100644
--- a/lib/orber/test/tc_SUITE.erl
+++ b/lib/orber/test/tc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/Makefile b/lib/os_mon/Makefile
index 8399ee5f90..1eff8a785a 100644
--- a/lib/os_mon/Makefile
+++ b/lib/os_mon/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/c_src/Makefile.in b/lib/os_mon/c_src/Makefile.in
index e9fc5f4139..27b156a2c9 100644
--- a/lib/os_mon/c_src/Makefile.in
+++ b/lib/os_mon/c_src/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/c_src/cpu_sup.c b/lib/os_mon/c_src/cpu_sup.c
index e097141125..61bf1b0352 100644
--- a/lib/os_mon/c_src/cpu_sup.c
+++ b/lib/os_mon/c_src/cpu_sup.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2012. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/c_src/ferrule.c b/lib/os_mon/c_src/ferrule.c
index b5b62ca155..47f8a21270 100644
--- a/lib/os_mon/c_src/ferrule.c
+++ b/lib/os_mon/c_src/ferrule.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
* %CopyrightEnd%
*/
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <stropts.h>
#include <poll.h>
diff --git a/lib/os_mon/c_src/memsup.c b/lib/os_mon/c_src/memsup.c
index 08a4cc48b6..322e474c3b 100644
--- a/lib/os_mon/c_src/memsup.c
+++ b/lib/os_mon/c_src/memsup.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2013. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/c_src/memsup.h b/lib/os_mon/c_src/memsup.h
index d86c1f1ff0..49c54f2f77 100644
--- a/lib/os_mon/c_src/memsup.h
+++ b/lib/os_mon/c_src/memsup.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/c_src/mod_syslog.c b/lib/os_mon/c_src/mod_syslog.c
index 190e451951..720b52916e 100644
--- a/lib/os_mon/c_src/mod_syslog.c
+++ b/lib/os_mon/c_src/mod_syslog.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
* %CopyrightEnd%
*/
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
diff --git a/lib/os_mon/c_src/nteventlog/elog_format.c b/lib/os_mon/c_src/nteventlog/elog_format.c
index 91fcb542a4..03b95f82df 100644
--- a/lib/os_mon/c_src/nteventlog/elog_format.c
+++ b/lib/os_mon/c_src/nteventlog/elog_format.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/c_src/nteventlog/elog_format.h b/lib/os_mon/c_src/nteventlog/elog_format.h
index 18e99267bb..d92e2a81c3 100644
--- a/lib/os_mon/c_src/nteventlog/elog_format.h
+++ b/lib/os_mon/c_src/nteventlog/elog_format.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/c_src/nteventlog/elog_global.h b/lib/os_mon/c_src/nteventlog/elog_global.h
index e9c4d56f48..9d86f084b0 100644
--- a/lib/os_mon/c_src/nteventlog/elog_global.h
+++ b/lib/os_mon/c_src/nteventlog/elog_global.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/c_src/nteventlog/elog_main.c b/lib/os_mon/c_src/nteventlog/elog_main.c
index 3446369c00..c31e3ef1ff 100644
--- a/lib/os_mon/c_src/nteventlog/elog_main.c
+++ b/lib/os_mon/c_src/nteventlog/elog_main.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/c_src/nteventlog/elog_pipe_stdin.c b/lib/os_mon/c_src/nteventlog/elog_pipe_stdin.c
index d15d137c9a..1920268af9 100644
--- a/lib/os_mon/c_src/nteventlog/elog_pipe_stdin.c
+++ b/lib/os_mon/c_src/nteventlog/elog_pipe_stdin.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/c_src/nteventlog/elog_pipe_stdin.h b/lib/os_mon/c_src/nteventlog/elog_pipe_stdin.h
index ada990311a..b8f08bb412 100644
--- a/lib/os_mon/c_src/nteventlog/elog_pipe_stdin.h
+++ b/lib/os_mon/c_src/nteventlog/elog_pipe_stdin.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/c_src/nteventlog/elog_registry.c b/lib/os_mon/c_src/nteventlog/elog_registry.c
index ff998d2bb2..6de5606c10 100644
--- a/lib/os_mon/c_src/nteventlog/elog_registry.c
+++ b/lib/os_mon/c_src/nteventlog/elog_registry.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/c_src/nteventlog/elog_registry.h b/lib/os_mon/c_src/nteventlog/elog_registry.h
index e33afadf79..927109a157 100644
--- a/lib/os_mon/c_src/nteventlog/elog_registry.h
+++ b/lib/os_mon/c_src/nteventlog/elog_registry.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/c_src/nteventlog/elog_util.c b/lib/os_mon/c_src/nteventlog/elog_util.c
index d9f8acf2e4..316a39dcf3 100644
--- a/lib/os_mon/c_src/nteventlog/elog_util.c
+++ b/lib/os_mon/c_src/nteventlog/elog_util.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/c_src/nteventlog/elog_util.h b/lib/os_mon/c_src/nteventlog/elog_util.h
index ea866180ef..0a8a5ea659 100644
--- a/lib/os_mon/c_src/nteventlog/elog_util.h
+++ b/lib/os_mon/c_src/nteventlog/elog_util.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/c_src/win32sysinfo.c b/lib/os_mon/c_src/win32sysinfo.c
index d11f937e92..67b3f74910 100644
--- a/lib/os_mon/c_src/win32sysinfo.c
+++ b/lib/os_mon/c_src/win32sysinfo.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2012. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/doc/src/Makefile b/lib/os_mon/doc/src/Makefile
index 0c5acd9740..91c7ae7bc3 100644
--- a/lib/os_mon/doc/src/Makefile
+++ b/lib/os_mon/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/doc/src/book.xml b/lib/os_mon/doc/src/book.xml
index 7b851a12b4..4bcd913e54 100644
--- a/lib/os_mon/doc/src/book.xml
+++ b/lib/os_mon/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/os_mon/doc/src/cpu_sup.xml b/lib/os_mon/doc/src/cpu_sup.xml
index 51e1a4c9d6..bada165a06 100644
--- a/lib/os_mon/doc/src/cpu_sup.xml
+++ b/lib/os_mon/doc/src/cpu_sup.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/os_mon/doc/src/disksup.xml b/lib/os_mon/doc/src/disksup.xml
index 88756d46c4..610ef2c907 100644
--- a/lib/os_mon/doc/src/disksup.xml
+++ b/lib/os_mon/doc/src/disksup.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/os_mon/doc/src/memsup.xml b/lib/os_mon/doc/src/memsup.xml
index 5fc5e578c6..c669e4670a 100644
--- a/lib/os_mon/doc/src/memsup.xml
+++ b/lib/os_mon/doc/src/memsup.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/os_mon/doc/src/notes.xml b/lib/os_mon/doc/src/notes.xml
index 8bb4ab33a1..c565df7f3b 100644
--- a/lib/os_mon/doc/src/notes.xml
+++ b/lib/os_mon/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/os_mon/doc/src/nteventlog.xml b/lib/os_mon/doc/src/nteventlog.xml
index fd7950bca7..d32427227c 100644
--- a/lib/os_mon/doc/src/nteventlog.xml
+++ b/lib/os_mon/doc/src/nteventlog.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/os_mon/doc/src/os_mon_app.xml b/lib/os_mon/doc/src/os_mon_app.xml
index d70124a995..99492a2021 100644
--- a/lib/os_mon/doc/src/os_mon_app.xml
+++ b/lib/os_mon/doc/src/os_mon_app.xml
@@ -4,7 +4,7 @@
<appref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/os_mon/doc/src/os_mon_mib.xml b/lib/os_mon/doc/src/os_mon_mib.xml
index 8e8721fd25..dcf3649876 100644
--- a/lib/os_mon/doc/src/os_mon_mib.xml
+++ b/lib/os_mon/doc/src/os_mon_mib.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/os_mon/doc/src/os_sup.xml b/lib/os_mon/doc/src/os_sup.xml
index 0350d4f8b4..d517f387b4 100644
--- a/lib/os_mon/doc/src/os_sup.xml
+++ b/lib/os_mon/doc/src/os_sup.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/os_mon/doc/src/part_notes.xml b/lib/os_mon/doc/src/part_notes.xml
index 6cbfbb4961..364178acc3 100644
--- a/lib/os_mon/doc/src/part_notes.xml
+++ b/lib/os_mon/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/os_mon/doc/src/ref_man.xml b/lib/os_mon/doc/src/ref_man.xml
index 1c6afc5a65..a8f847a8ba 100644
--- a/lib/os_mon/doc/src/ref_man.xml
+++ b/lib/os_mon/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/os_mon/include/memsup.hrl b/lib/os_mon/include/memsup.hrl
index f1e924a3d7..30658f5b23 100644
--- a/lib/os_mon/include/memsup.hrl
+++ b/lib/os_mon/include/memsup.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/mibs/Makefile b/lib/os_mon/mibs/Makefile
index 725dd0f6a7..dbc105ee3d 100644
--- a/lib/os_mon/mibs/Makefile
+++ b/lib/os_mon/mibs/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/mibs/OTP-OS-MON-MIB.mib b/lib/os_mon/mibs/OTP-OS-MON-MIB.mib
index 0bc5d62872..e027e96154 100644
--- a/lib/os_mon/mibs/OTP-OS-MON-MIB.mib
+++ b/lib/os_mon/mibs/OTP-OS-MON-MIB.mib
@@ -1,7 +1,7 @@
--
-- %CopyrightBegin%
--
--- Copyright Ericsson AB 1997-2009. All Rights Reserved.
+-- Copyright Ericsson AB 1997-2016. All Rights Reserved.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/src/Makefile b/lib/os_mon/src/Makefile
index 9aa068cb91..3ff63204c6 100644
--- a/lib/os_mon/src/Makefile
+++ b/lib/os_mon/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2013. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/src/cpu_sup.erl b/lib/os_mon/src/cpu_sup.erl
index 72d392b804..5664615230 100644
--- a/lib/os_mon/src/cpu_sup.erl
+++ b/lib/os_mon/src/cpu_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -68,7 +68,7 @@
-type util_cpus() :: 'all' | integer() | [integer()].
-type util_state() :: 'user' | 'nice_user' | 'kernel' | 'wait' | 'idle'.
--type util_value() :: {util_state(), float()} | float().
+-type util_value() :: [{util_state(), float()}] | float().
-type util_desc() :: {util_cpus(), util_value(), util_value(), []}.
%%----------------------------------------------------------------------
diff --git a/lib/os_mon/src/disksup.erl b/lib/os_mon/src/disksup.erl
index 23c7ebbe99..2b5447cfcb 100644
--- a/lib/os_mon/src/disksup.erl
+++ b/lib/os_mon/src/disksup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/src/memsup.erl b/lib/os_mon/src/memsup.erl
index e4b7c8c0ce..833e1ce6d1 100644
--- a/lib/os_mon/src/memsup.erl
+++ b/lib/os_mon/src/memsup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/src/nteventlog.erl b/lib/os_mon/src/nteventlog.erl
index 8726f369ee..4b02d3ff7e 100644
--- a/lib/os_mon/src/nteventlog.erl
+++ b/lib/os_mon/src/nteventlog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/src/os_mon.app.src b/lib/os_mon/src/os_mon.app.src
index 6ef7beda1f..8be94f65d4 100644
--- a/lib/os_mon/src/os_mon.app.src
+++ b/lib/os_mon/src/os_mon.app.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/src/os_mon.appup.src b/lib/os_mon/src/os_mon.appup.src
index 108b0bb5b8..660cb7daaa 100644
--- a/lib/os_mon/src/os_mon.appup.src
+++ b/lib/os_mon/src/os_mon.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/src/os_mon.erl b/lib/os_mon/src/os_mon.erl
index 0fef0ecece..8abaf1c9b6 100644
--- a/lib/os_mon/src/os_mon.erl
+++ b/lib/os_mon/src/os_mon.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/src/os_mon_mib.erl b/lib/os_mon/src/os_mon_mib.erl
index ef6f81a5d7..9b5d2fbba6 100644
--- a/lib/os_mon/src/os_mon_mib.erl
+++ b/lib/os_mon/src/os_mon_mib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/src/os_mon_sysinfo.erl b/lib/os_mon/src/os_mon_sysinfo.erl
index c554b08bef..e87e597420 100644
--- a/lib/os_mon/src/os_mon_sysinfo.erl
+++ b/lib/os_mon/src/os_mon_sysinfo.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/src/os_sup.erl b/lib/os_mon/src/os_sup.erl
index 2a75698ab0..71c9137588 100644
--- a/lib/os_mon/src/os_sup.erl
+++ b/lib/os_mon/src/os_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/test/Makefile b/lib/os_mon/test/Makefile
index aace77a3f0..6ac67e6bae 100644
--- a/lib/os_mon/test/Makefile
+++ b/lib/os_mon/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/test/cpu_sup_SUITE.erl b/lib/os_mon/test/cpu_sup_SUITE.erl
index 13d47c6a89..11648d3547 100644
--- a/lib/os_mon/test/cpu_sup_SUITE.erl
+++ b/lib/os_mon/test/cpu_sup_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
-include_lib("common_test/include/ct.hrl").
%% Test server specific exports
--export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]).
+-export([all/0, suite/0]).
-export([init_per_suite/1, end_per_suite/1]).
-export([init_per_testcase/2, end_per_testcase/2]).
@@ -31,186 +31,163 @@
-export([port/1]).
-export([terminate/1, unavailable/1, restart/1]).
-%% Default timetrap timeout (set in init_per_testcase)
--define(default_timeout, ?t:minutes(1)).
-
init_per_suite(Config) when is_list(Config) ->
- ?line ok = application:start(os_mon),
+ ok = application:start(os_mon),
Config.
end_per_suite(Config) when is_list(Config) ->
- ?line ok = application:stop(os_mon),
+ ok = application:stop(os_mon),
Config.
init_per_testcase(unavailable, Config) ->
terminate(Config),
init_per_testcase(dummy, Config);
init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
+ Config.
end_per_testcase(unavailable, Config) ->
restart(Config),
end_per_testcase(dummy, Config);
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
case test_server:os_type() of
- {unix, sunos} ->
- [load_api, util_api, util_values, port, unavailable];
- {unix, linux} ->
- [load_api, util_api, util_values, port, unavailable];
- {unix, freebsd} ->
- [load_api, util_api, util_values, port, unavailable];
- {unix, _OSname} -> [load_api];
- _OS -> [unavailable]
+ {unix, sunos} ->
+ [load_api, util_api, util_values, port, unavailable];
+ {unix, linux} ->
+ [load_api, util_api, util_values, port, unavailable];
+ {unix, freebsd} ->
+ [load_api, util_api, util_values, port, unavailable];
+ {unix, _OSname} -> [load_api];
+ _OS -> [unavailable]
end.
-groups() ->
- [].
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
-load_api(suite) ->
- [];
-load_api(doc) ->
- ["Test of load API functions"];
+%% Test of load API functions
load_api(Config) when is_list(Config) ->
%% nprocs()
- ?line N = cpu_sup:nprocs(),
- ?line true = is_integer(N),
- ?line true = N>0,
- ?line true = N<1000000,
+ N = cpu_sup:nprocs(),
+ true = is_integer(N),
+ true = N>0,
+ true = N<1000000,
%% avg1()
- ?line Load1 = cpu_sup:avg1(),
- ?line true = is_integer(Load1),
- ?line true = Load1>0,
+ Load1 = cpu_sup:avg1(),
+ true = is_integer(Load1),
+ true = Load1>0,
%% avg5()
- ?line Load5 = cpu_sup:avg5(),
- ?line true = is_integer(Load5),
- ?line true = Load5>0,
+ Load5 = cpu_sup:avg5(),
+ true = is_integer(Load5),
+ true = Load5>0,
%% avg15()
- ?line Load15 = cpu_sup:avg15(),
- ?line true = is_integer(Load15),
- ?line true = Load15>0,
+ Load15 = cpu_sup:avg15(),
+ true = is_integer(Load15),
+ true = Load15>0,
ok.
-util_api(suite) ->
- [];
-util_api(doc) ->
- ["Test of utilization API functions"];
+%% Test of utilization API functions
util_api(Config) when is_list(Config) ->
%% Some useful funs when testing util/1
BusyP = fun({user, _Share}) -> true;
- ({nice_user, _Share}) -> true;
- ({kernel, _Share}) -> true;
- ({hard_irq, _Share}) -> true;
- ({soft_irq, _Share}) -> true;
- (_) -> false
- end,
+ ({nice_user, _Share}) -> true;
+ ({kernel, _Share}) -> true;
+ ({hard_irq, _Share}) -> true;
+ ({soft_irq, _Share}) -> true;
+ (_) -> false
+ end,
NonBusyP = fun({wait, _Share}) -> true;
- ({idle, _Share}) -> true;
- ({steal, _Share}) -> true;
- (_) -> false
- end,
+ ({idle, _Share}) -> true;
+ ({steal, _Share}) -> true;
+ (_) -> false
+ end,
Sum = fun({_Tag, X}, Acc) -> Acc+X end,
%% util()
- ?line Util1 = cpu_sup:util(),
- ?line true = is_number(Util1),
- ?line true = Util1>0,
- ?line Util2 = cpu_sup:util(),
- ?line true = is_number(Util2),
- ?line true = Util2>0,
+ Util1 = cpu_sup:util(),
+ true = is_number(Util1),
+ true = Util1>0,
+ Util2 = cpu_sup:util(),
+ true = is_number(Util2),
+ true = Util2>0,
%% util([])
- ?line {all, Busy1, NonBusy1, []} = cpu_sup:util([]),
- ?line 100.00 = Busy1 + NonBusy1,
+ {all, Busy1, NonBusy1, []} = cpu_sup:util([]),
+ 100.00 = Busy1 + NonBusy1,
%% util([detailed])
- ?line {Cpus2, Busy2, NonBusy2, []} = cpu_sup:util([detailed]),
- ?line true = lists:all(fun(X) -> is_integer(X) end, Cpus2),
- ?line true = lists:all(BusyP, Busy2),
- ?line true = lists:all(NonBusyP, NonBusy2),
- ?line 100.00 = lists:foldl(Sum,0,Busy2)+lists:foldl(Sum,0,NonBusy2),
+ {Cpus2, Busy2, NonBusy2, []} = cpu_sup:util([detailed]),
+ true = lists:all(fun(X) -> is_integer(X) end, Cpus2),
+ true = lists:all(BusyP, Busy2),
+ true = lists:all(NonBusyP, NonBusy2),
+ 100.00 = lists:foldl(Sum,0,Busy2)+lists:foldl(Sum,0,NonBusy2),
%% util([per_cpu])
- ?line [{Cpu3, Busy3, NonBusy3, []}|_] = cpu_sup:util([per_cpu]),
- ?line true = is_integer(Cpu3),
- ?line 100.00 = Busy3 + NonBusy3,
+ [{Cpu3, Busy3, NonBusy3, []}|_] = cpu_sup:util([per_cpu]),
+ true = is_integer(Cpu3),
+ 100.00 = Busy3 + NonBusy3,
%% util([detailed, per_cpu])
- ?line [{Cpu4, Busy4, NonBusy4, []}|_] =
- cpu_sup:util([detailed, per_cpu]),
- ?line true = is_integer(Cpu4),
- ?line true = lists:all(BusyP, Busy2),
- ?line true = lists:all(NonBusyP, NonBusy2),
- ?line 100.00 = lists:foldl(Sum,0,Busy4)+lists:foldl(Sum,0,NonBusy4),
+ [{Cpu4, Busy4, NonBusy4, []}|_] =
+ cpu_sup:util([detailed, per_cpu]),
+ true = is_integer(Cpu4),
+ true = lists:all(BusyP, Busy2),
+ true = lists:all(NonBusyP, NonBusy2),
+ 100.00 = lists:foldl(Sum,0,Busy4)+lists:foldl(Sum,0,NonBusy4),
%% bad util/1 calls
- ?line {'EXIT',{badarg,_}} = (catch cpu_sup:util(detailed)),
- ?line {'EXIT',{badarg,_}} = (catch cpu_sup:util([detialed])),
+ {'EXIT',{badarg,_}} = (catch cpu_sup:util(detailed)),
+ {'EXIT',{badarg,_}} = (catch cpu_sup:util([detialed])),
ok.
-define(SPIN_TIME, 1000).
-util_values(suite) ->
- [];
-util_values(doc) ->
- ["Test utilization values"];
+%% Test utilization values
util_values(Config) when is_list(Config) ->
Tester = self(),
Ref = make_ref(),
Loop = fun (L) -> L(L) end,
Spinner = fun () ->
- Looper = spawn_link(fun () -> Loop(Loop) end),
- receive after ?SPIN_TIME -> ok end,
- unlink(Looper),
- exit(Looper, kill),
- Tester ! Ref
- end,
+ Looper = spawn_link(fun () -> Loop(Loop) end),
+ receive after ?SPIN_TIME -> ok end,
+ unlink(Looper),
+ exit(Looper, kill),
+ Tester ! Ref
+ end,
- ?line cpu_sup:util(),
+ cpu_sup:util(),
- ?line spawn_link(Spinner),
- ?line receive Ref -> ok end,
- ?line HighUtil1 = cpu_sup:util(),
+ spawn_link(Spinner),
+ receive Ref -> ok end,
+ HighUtil1 = cpu_sup:util(),
- ?line receive after ?SPIN_TIME -> ok end,
- ?line LowUtil1 = cpu_sup:util(),
+ receive after ?SPIN_TIME -> ok end,
+ LowUtil1 = cpu_sup:util(),
- ?line spawn_link(Spinner),
- ?line receive Ref -> ok end,
- ?line HighUtil2 = cpu_sup:util(),
+ spawn_link(Spinner),
+ receive Ref -> ok end,
+ HighUtil2 = cpu_sup:util(),
- ?line receive after ?SPIN_TIME -> ok end,
- ?line LowUtil2 = cpu_sup:util(),
+ receive after ?SPIN_TIME -> ok end,
+ LowUtil2 = cpu_sup:util(),
Utils = [{high1,HighUtil1}, {low1,LowUtil1},
- {high2,HighUtil2}, {low2,LowUtil2}],
- ?t:format("Utils: ~p~n", [Utils]),
+ {high2,HighUtil2}, {low2,LowUtil2}],
+ io:format("Utils: ~p~n", [Utils]),
- ?line false = LowUtil1 > HighUtil1,
- ?line false = LowUtil1 > HighUtil2,
- ?line false = LowUtil2 > HighUtil1,
- ?line false = LowUtil2 > HighUtil2,
+ false = LowUtil1 > HighUtil1,
+ false = LowUtil1 > HighUtil2,
+ false = LowUtil2 > HighUtil1,
+ false = LowUtil2 > HighUtil2,
ok.
@@ -218,76 +195,66 @@ util_values(Config) when is_list(Config) ->
% Outdated
% The portprogram is now restarted if killed, and not by os_mon...
-port(suite) ->
- [];
-port(doc) ->
- ["Test that cpu_sup handles a terminating port program"];
+%% Test that cpu_sup handles a terminating port program
port(Config) when is_list(Config) ->
case cpu_sup_os_pid() of
- {ok, PidStr} ->
- %% Monitor cpu_sup
- ?line MonRef = erlang:monitor(process, cpu_sup),
- ?line N1 = cpu_sup:nprocs(),
- ?line true = N1>0,
-
- %% Kill the port program
- case os:cmd("kill -9 " ++ PidStr) of
- [] ->
- %% cpu_sup should not terminate
- receive
- {'DOWN', MonRef, _, _, Reason} ->
- ?line ?t:fail({unexpected_exit_reason, Reason})
- after 3000 ->
- ok
- end,
-
- %% Give cpu_sup time to restart cpu_sup port
- ?t:sleep(?t:seconds(3)),
- ?line N2 = cpu_sup:nprocs(),
- ?line true = N2>0,
-
- erlang:demonitor(MonRef),
- ok;
-
- Line ->
- erlang:demonitor(MonRef),
- {skip, {not_killed, Line}}
- end;
- _ ->
- {skip, os_pid_not_found }
+ {ok, PidStr} ->
+ %% Monitor cpu_sup
+ MonRef = erlang:monitor(process, cpu_sup),
+ N1 = cpu_sup:nprocs(),
+ true = N1>0,
+
+ %% Kill the port program
+ case os:cmd("kill -9 " ++ PidStr) of
+ [] ->
+ %% cpu_sup should not terminate
+ receive
+ {'DOWN', MonRef, _, _, Reason} ->
+ ct:fail({unexpected_exit_reason, Reason})
+ after 3000 ->
+ ok
+ end,
+
+ %% Give cpu_sup time to restart cpu_sup port
+ ct:sleep({seconds, 3}),
+ N2 = cpu_sup:nprocs(),
+ true = N2>0,
+
+ erlang:demonitor(MonRef),
+ ok;
+
+ Line ->
+ erlang:demonitor(MonRef),
+ {skip, {not_killed, Line}}
+ end;
+ _ ->
+ {skip, os_pid_not_found }
end.
-terminate(suite) ->
- [];
terminate(Config) when is_list(Config) ->
ok = application:set_env(os_mon, start_cpu_sup, false),
_ = supervisor:terminate_child(os_mon_sup, cpu_sup),
ok.
-unavailable(suite) ->
- [];
-unavailable(doc) ->
- ["Test correct behaviour when service is unavailable"];
+%% Test correct behaviour when service is unavailable
unavailable(Config) when is_list(Config) ->
%% Make sure all API functions return their dummy values
- ?line 0 = cpu_sup:nprocs(),
- ?line 0 = cpu_sup:avg1(),
- ?line 0 = cpu_sup:avg5(),
- ?line 0 = cpu_sup:avg15(),
- ?line 0 = cpu_sup:util(),
- ?line {all,0,0,[]} = cpu_sup:util([]),
- ?line {all,0,0,[]} = cpu_sup:util([detailed]),
- ?line {all,0,0,[]} = cpu_sup:util([per_cpu]),
- ?line {all,0,0,[]} = cpu_sup:util([detailed,per_cpu]),
+ 0 = cpu_sup:nprocs(),
+ 0 = cpu_sup:avg1(),
+ 0 = cpu_sup:avg5(),
+ 0 = cpu_sup:avg15(),
+ 0 = cpu_sup:util(),
+ {all,0,0,[]} = cpu_sup:util([]),
+ {all,0,0,[]} = cpu_sup:util([detailed]),
+ {all,0,0,[]} = cpu_sup:util([per_cpu]),
+ {all,0,0,[]} = cpu_sup:util([detailed,per_cpu]),
ok.
-restart(suite) ->
- [];
restart(Config) when is_list(Config) ->
- ?line ok = application:set_env(os_mon, start_cpu_sup, true),
- ?line {ok, _Pid} = supervisor:restart_child(os_mon_sup, cpu_sup),
+ ok = application:set_env(os_mon, start_cpu_sup, true),
+ {ok, _Pid} = supervisor:restart_child(os_mon_sup, cpu_sup),
ok.
%% Aux
@@ -295,6 +262,6 @@ restart(Config) when is_list(Config) ->
cpu_sup_os_pid() ->
Str = os:cmd("ps -e | grep '[c]pu_sup'"),
case io_lib:fread("~s", Str) of
- {ok, [Pid], _Rest} -> {ok, Pid};
- _ -> {error, pid_not_found}
+ {ok, [Pid], _Rest} -> {ok, Pid};
+ _ -> {error, pid_not_found}
end.
diff --git a/lib/os_mon/test/disksup_SUITE.erl b/lib/os_mon/test/disksup_SUITE.erl
index 8e2825ec26..ad61985014 100644
--- a/lib/os_mon/test/disksup_SUITE.erl
+++ b/lib/os_mon/test/disksup_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
-include_lib("common_test/include/ct.hrl").
%% Test server specific exports
--export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]).
+-export([all/0, suite/0]).
-export([init_per_suite/1, end_per_suite/1]).
-export([init_per_testcase/2, end_per_testcase/2]).
@@ -32,9 +32,6 @@
-export([otp_5910/1]).
-export([posix_only/1]).
-%% Default timetrap timeout (set in init_per_testcase)
--define(default_timeout, ?t:minutes(1)).
-
init_per_suite(Config) when is_list(Config) ->
ok = application:start(os_mon),
Config.
@@ -47,19 +44,18 @@ init_per_testcase(unavailable, Config) ->
terminate(Config),
init_per_testcase(dummy, Config);
init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?default_timeout),
- [{watchdog,Dog} | Config].
+ Config.
end_per_testcase(TC, Config) when TC =:= unavailable;
TC =:= posix_only ->
restart(Config),
end_per_testcase(dummy, Config);
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
Bugs = [otp_5910],
@@ -70,18 +66,7 @@ all() ->
_OS -> [unavailable]
end.
-groups() ->
- [].
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
-api(suite) -> [];
-api(doc) -> ["Test of API functions"];
+%% Test of API functions
api(Config) when is_list(Config) ->
%% get_disk_data()
@@ -110,8 +95,7 @@ api(Config) when is_list(Config) ->
ok.
-config(suite) -> [];
-config(doc) -> ["Test configuration"];
+%% Test configuration
config(Config) when is_list(Config) ->
%% Change configuration parameters and make sure change is reflected
@@ -147,8 +131,8 @@ config(Config) when is_list(Config) ->
%% changes too much during its course, or if there are timing problems
%% with the alarm_handler receiving the alarms too late
%%----------------------------------------------------------------------
-alarm(suite) -> [];
-alarm(doc) -> ["Test that alarms are set and cleared"];
+
+%% Test that alarms are set and cleared
alarm(Config) when is_list(Config) ->
%% Find out how many disks exceed the threshold
@@ -162,7 +146,7 @@ alarm(Config) when is_list(Config) ->
true;
true ->
dump_info(),
- ?t:fail({bad_alarms, Threshold1, Data1, Alarms1})
+ ct:fail({bad_alarms, Threshold1, Data1, Alarms1})
end,
%% Try to find a disk with space usage below Threshold1,
@@ -187,7 +171,7 @@ alarm(Config) when is_list(Config) ->
true;
true ->
dump_info(),
- ?t:fail({bad_alarms, Threshold2, Data2, Alarms2})
+ ct:fail({bad_alarms, Threshold2, Data2, Alarms2})
end;
false ->
ignore
@@ -215,7 +199,7 @@ alarm(Config) when is_list(Config) ->
ok;
true ->
dump_info(),
- ?t:fail({bad_alarms, Threshold3, Data3, Alarms3})
+ ct:fail({bad_alarms, Threshold3, Data3, Alarms3})
end;
100 ->
ignore
@@ -271,9 +255,7 @@ until(Fun, [H|T]) ->
end;
until(_Fun, []) -> false.
-port(suite) -> [];
-port(doc) ->
- ["Test that disksup handles a terminating port program"];
+%% Test that disksup handles a terminating port program
port(Config) when is_list(Config) ->
Str = os:cmd("ps -ef | grep '[d]isksup'"),
case io_lib:fread("~s ~s", Str) of
@@ -293,14 +275,14 @@ port(Config) when is_list(Config) ->
{'DOWN', MonRef, _, _, {port_died, _Reason}} ->
ok;
{'DOWN', MonRef, _, _, Reason} ->
- ?t:fail({unexpected_exit_reason, Reason})
+ ct:fail({unexpected_exit_reason, Reason})
after
3000 ->
- ?t:fail({still_alive, Str})
+ ct:fail({still_alive, Str})
end,
%% Give os_mon_sup time to restart disksup
- ?t:sleep(?t:seconds(3)),
+ ct:sleep({seconds,3}),
[{_Disk2,Kbyte2,_Cap2}|_] = disksup:get_disk_data(),
true = Kbyte2>0,
@@ -314,15 +296,12 @@ port(Config) when is_list(Config) ->
{skip, {os_pid_not_found, Str}}
end.
-terminate(suite) -> [];
terminate(Config) when is_list(Config) ->
ok = application:set_env(os_mon, start_disksup, false),
ok = supervisor:terminate_child(os_mon_sup, disksup),
ok.
-unavailable(suite) -> [];
-unavailable(doc) ->
- ["Test correct behaviour when service is unavailable"];
+%% Test correct behaviour when service is unavailable
unavailable(Config) when is_list(Config) ->
%% Make sure all API functions return their dummy values
@@ -333,18 +312,16 @@ unavailable(Config) when is_list(Config) ->
ok = disksup:set_almost_full_threshold(0.9),
ok.
-restart(suite) ->
- [];
restart(Config) when is_list(Config) ->
ok = application:set_env(os_mon, start_disksup, true),
ok = application:set_env(os_mon, disksup_posix_only, false),
- {ok, _Pid} = supervisor:restart_child(os_mon_sup, disksup),
- ok.
+ case supervisor:restart_child(os_mon_sup, disksup) of
+ {ok, _Pid} -> ok;
+ {error, running} -> ok
+ end.
-otp_5910(suite) -> [];
-otp_5910(doc) ->
- ["Test that alarms are cleared if disksup crashes or "
- "if OS_Mon is stopped"];
+%% Test that alarms are cleared if disksup crashes or
+%% if OS_Mon is stopped
otp_5910(Config) when is_list(Config) ->
%% Make sure disksup sets at least one alarm
@@ -365,12 +342,12 @@ otp_5910(Config) when is_list(Config) ->
Alarms = get_alarms(),
if
Over==0 ->
- ?t:fail({threshold_too_low, Data2, Threshold});
+ ct:fail({threshold_too_low, Data2, Threshold});
Over==length(Alarms) ->
ok;
true ->
dump_info(),
- ?t:fail({bad_alarms, Threshold, Data2, Alarms})
+ ct:fail({bad_alarms, Threshold, Data2, Alarms})
end,
%% Kill disksup
@@ -378,23 +355,23 @@ otp_5910(Config) when is_list(Config) ->
%% Wait a little to make sure disksup has been restarted,
%% then make sure the alarms are set once, but not twice
- ?t:sleep(?t:seconds(1)),
+ ct:sleep({seconds,1}),
Data3 = disksup:get_disk_data(),
Alarms2 = get_alarms(),
if
length(Alarms2)==length(Alarms) -> ok;
true ->
dump_info(),
- ?t:fail({bad_alarms,Threshold,Data3,Alarms,Alarms2})
+ ct:fail({bad_alarms,Threshold,Data3,Alarms,Alarms2})
end,
%% Stop OS_Mon and make sure all disksup alarms are cleared
ok = application:stop(os_mon),
- ?t:sleep(?t:seconds(1)),
+ ct:sleep({seconds,1}),
Alarms3 = get_alarms(),
case get_alarms() of
[] -> ok;
- _ -> ?t:fail({alarms_not_cleared, Alarms3})
+ _ -> ct:fail({alarms_not_cleared, Alarms3})
end,
%% Reset threshold and restart OS_Mon
@@ -403,8 +380,7 @@ otp_5910(Config) when is_list(Config) ->
ok = application:start(os_mon),
ok.
-posix_only(suite) -> [];
-posix_only(doc) -> ["Test disksup_posix_only option"];
+%% Test disksup_posix_only option
posix_only(Config) when is_list(Config) ->
%% Set option and restart disksup
ok = application:set_env(os_mon, disksup_posix_only, true),
diff --git a/lib/os_mon/test/memsup_SUITE.erl b/lib/os_mon/test/memsup_SUITE.erl
index 904c9b95b0..fcd1417693 100644
--- a/lib/os_mon/test/memsup_SUITE.erl
+++ b/lib/os_mon/test/memsup_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
-include_lib("common_test/include/ct.hrl").
%% Test server specific exports
--export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]).
+-export([all/0, suite/0]).
-export([init_per_suite/1, end_per_suite/1]).
-export([init_per_testcase/2, end_per_testcase/2]).
@@ -30,384 +30,362 @@
-export([config/1, timeout/1, unavailable/1, port/1]).
-export([otp_5910/1]).
-%% Default timetrap timeout (set in init_per_testcase)
--define(default_timeout, ?t:minutes(1)).
-
init_per_suite(Config) when is_list(Config) ->
- ?line ok = application:start(os_mon),
+ ok = application:start(os_mon),
Config.
end_per_suite(Config) when is_list(Config) ->
- ?line ok = application:stop(os_mon),
+ ok = application:stop(os_mon),
Config.
init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?default_timeout),
- [{watchdog,Dog} | Config].
-
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
Config.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+end_per_testcase(_Case, _Config) ->
+ ok.
+
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
All = case test_server:os_type() of
- {unix, sunos} ->
- [api, alarm1, alarm2, process, config, timeout,
- unavailable, port];
- {unix, linux} ->
- [api, alarm1, alarm2, process, timeout];
- _OS -> [api, alarm1, alarm2, process]
- end,
+ {unix, sunos} ->
+ [api, alarm1, alarm2, process, config, timeout,
+ unavailable, port];
+ {unix, linux} ->
+ [api, alarm1, alarm2, process, timeout];
+ _OS -> [api, alarm1, alarm2, process]
+ end,
Bugs = [otp_5910],
All ++ Bugs.
-groups() ->
- [].
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-api(suite) ->
- [];
-api(doc) ->
- ["Test of API functions"];
+%% Test of API functions
api(Config) when is_list(Config) ->
%% get_memory_data()
- ?line RegMemData = memsup:get_memory_data(),
+ RegMemData = memsup:get_memory_data(),
case RegMemData of
- {TotMem, AllBytes, {Pid, PidBytes}} when is_integer(TotMem),
- is_integer(AllBytes),
- is_pid(Pid),
- is_integer(PidBytes) ->
- ok;
- {0, 0, _WorstPid} ->
- ?line ?t:fail(first_data_collection_failed);
- _ ->
- ?line ?t:fail({bad_return, RegMemData})
+ {TotMem, AllBytes, {Pid, PidBytes}} when is_integer(TotMem),
+ is_integer(AllBytes),
+ is_pid(Pid),
+ is_integer(PidBytes) ->
+ ok;
+ {0, 0, _WorstPid} ->
+ ct:fail(first_data_collection_failed);
+ _ ->
+ ct:fail({bad_return, RegMemData})
end,
%% get_system_memory_data()
- ?line ExtMemData = memsup:get_system_memory_data(),
- Tags = [ total_memory,
- free_memory,
- system_total_memory,
- largest_free,
- number_of_free,
- free_swap,
- total_swap,
- cached_memory,
- buffered_memory,
- shared_memory],
-
- ?line true = lists:all(fun({Tag,Value}) when is_atom(Tag),
- is_integer(Value) ->
- lists:member(Tag, Tags);
- (_) ->
- false
- end,
- ExtMemData),
+ ExtMemData = memsup:get_system_memory_data(),
+ Tags = [total_memory,
+ free_memory,
+ system_total_memory,
+ largest_free,
+ number_of_free,
+ free_swap,
+ total_swap,
+ cached_memory,
+ buffered_memory,
+ shared_memory],
+
+ true = lists:all(fun({Tag,Value}) when is_atom(Tag),
+ is_integer(Value) ->
+ lists:member(Tag, Tags);
+ (_) ->
+ false
+ end, ExtMemData),
%% get_os_wordsize()
- ?line ok = case memsup:get_os_wordsize() of
- 32 -> ok;
- 64 -> ok;
- unsupported_os -> ok;
- _ -> error
- end,
+ ok = case memsup:get_os_wordsize() of
+ 32 -> ok;
+ 64 -> ok;
+ unsupported_os -> ok;
+ _ -> error
+ end,
%% get_check_interval()
- ?line 60000 = memsup:get_check_interval(),
+ 60000 = memsup:get_check_interval(),
%% set_check_interval(Minutes)
- ?line ok = memsup:set_check_interval(2),
- ?line 120000 = memsup:get_check_interval(),
- ?line {'EXIT',{badarg,_}} =
- (catch memsup:set_check_interval(0.2)),
- ?line 120000 = memsup:get_check_interval(),
- ?line ok = memsup:set_check_interval(1),
+ ok = memsup:set_check_interval(2),
+ 120000 = memsup:get_check_interval(),
+ {'EXIT',{badarg,_}} =
+ (catch memsup:set_check_interval(0.2)),
+ 120000 = memsup:get_check_interval(),
+ ok = memsup:set_check_interval(1),
%% get_procmem_high_watermark()
- ?line 5 = memsup:get_procmem_high_watermark(),
+ 5 = memsup:get_procmem_high_watermark(),
%% set_procmem_high_watermark()
- ?line ok = memsup:set_procmem_high_watermark(0.1),
- ?line 10 = memsup:get_procmem_high_watermark(),
- ?line {'EXIT',{badarg,_}} =
- (catch memsup:set_procmem_high_watermark(-0.1)),
- ?line 10 = memsup:get_procmem_high_watermark(),
- ?line ok = memsup:set_procmem_high_watermark(0.05),
+ ok = memsup:set_procmem_high_watermark(0.1),
+ 10 = memsup:get_procmem_high_watermark(),
+ {'EXIT',{badarg,_}} =
+ (catch memsup:set_procmem_high_watermark(-0.1)),
+ 10 = memsup:get_procmem_high_watermark(),
+ ok = memsup:set_procmem_high_watermark(0.05),
%% get_sysmem_high_watermark()
- ?line 80 = memsup:get_sysmem_high_watermark(),
+ 80 = memsup:get_sysmem_high_watermark(),
%% set_sysmem_high_watermark()
- ?line ok = memsup:set_sysmem_high_watermark(0.9),
- ?line 90 = memsup:get_sysmem_high_watermark(),
- ?line {'EXIT',{badarg,_}} =
- (catch memsup:set_sysmem_high_watermark(-0.9)),
- ?line 90 = memsup:get_sysmem_high_watermark(),
- ?line ok = memsup:set_sysmem_high_watermark(0.8),
+ ok = memsup:set_sysmem_high_watermark(0.9),
+ 90 = memsup:get_sysmem_high_watermark(),
+ {'EXIT',{badarg,_}} =
+ (catch memsup:set_sysmem_high_watermark(-0.9)),
+ 90 = memsup:get_sysmem_high_watermark(),
+ ok = memsup:set_sysmem_high_watermark(0.8),
%% get|set_helper_timeout
- ?line 30 = memsup:get_helper_timeout(),
- ?line ok = memsup:set_helper_timeout(29),
- ?line 29 = memsup:get_helper_timeout(),
- ?line {'EXIT',{badarg,_}} = (catch memsup:set_helper_timeout(31.0)),
- ?line 29 = memsup:get_helper_timeout(),
+ 30 = memsup:get_helper_timeout(),
+ ok = memsup:set_helper_timeout(29),
+ 29 = memsup:get_helper_timeout(),
+ {'EXIT',{badarg,_}} = (catch memsup:set_helper_timeout(31.0)),
+ 29 = memsup:get_helper_timeout(),
ok.
%%----------------------------------------------------------------------
%% NOTE: The test case is a bit weak as it will fail if the memory
%% usage changes too much during its course.
%%----------------------------------------------------------------------
-alarm1(suite) ->
- [];
-alarm1(doc) ->
- ["Test alarms when memsup_system_only==false"];
+
+%% Test alarms when memsup_system_only==false
alarm1(Config) when is_list(Config) ->
%% If system memory usage is too high, the testcase cannot
%% be run correctly
- ?line {Total, Alloc, {_Pid,_PidAlloc}} = memsup:get_memory_data(),
+ {Total, Alloc, {_Pid,_PidAlloc}} = memsup:get_memory_data(),
io:format("alarm1: Total: ~p, Alloc: ~p~n", [Total, Alloc]),
- ?line SysUsage = Alloc/Total,
+ SysUsage = Alloc/Total,
if
- SysUsage>0.99 ->
- {skip, sys_mem_too_high};
- true ->
- alarm1(Config, SysUsage)
+ SysUsage > 0.99 ->
+ {skip, sys_mem_too_high};
+ true ->
+ alarm1(Config, SysUsage)
end.
alarm1(_Config, SysUsage) ->
%% Set a long memory check interval, we will force memory checks
%% instead
- ?line ok = memsup:set_check_interval(60),
+ ok = memsup:set_check_interval(60),
%% Check thresholds
- ?line SysThreshold = (memsup:get_sysmem_high_watermark()/100),
- ?line ProcThreshold = (memsup:get_procmem_high_watermark()/100),
+ SysThreshold = (memsup:get_sysmem_high_watermark()/100),
+ ProcThreshold = (memsup:get_procmem_high_watermark()/100),
%% Check if a system alarm already should be set or not
SysP = if
- SysUsage>SysThreshold -> true;
- SysUsage=<SysThreshold -> false
- end,
+ SysUsage>SysThreshold -> true;
+ SysUsage=<SysThreshold -> false
+ end,
%% If system memory is higher than threshold, make sure the system
%% alarm is set. Otherwise, make sure it is not set
case alarm_set(system_memory_high_watermark) of
- {true, []} when SysP ->
- ok;
- false when not SysP ->
- ok;
- _ ->
- ?line ?t:fail({sys_alarm, SysUsage, SysThreshold})
+ {true, []} when SysP ->
+ ok;
+ false when not SysP ->
+ ok;
+ _ ->
+ ct:fail({sys_alarm, SysUsage, SysThreshold})
end,
%% Lower/raise the threshold to clear/set the alarm
NewSysThreshold = if
- SysP ->
- Value = 1.1*SysUsage,
- if
- Value > 0.99 -> 0.99;
- true -> Value
- end;
- not SysP -> 0.9*SysUsage
- end,
+ SysP ->
+ Value = 1.1*SysUsage,
+ if
+ Value > 0.99 -> 0.99;
+ true -> Value
+ end;
+ not SysP -> 0.9*SysUsage
+ end,
- ?line ok = memsup:set_sysmem_high_watermark(NewSysThreshold),
+ ok = memsup:set_sysmem_high_watermark(NewSysThreshold),
%% Initiate and wait for a new data collection
- ?line ok = force_collection(),
+ ok = force_collection(),
%% Make sure the alarm is cleared/set
- ?t:sleep(?t:seconds(5)),
+ ct:sleep({seconds,5}),
case alarm_set(system_memory_high_watermark) of
- {true, []} when not SysP ->
- ok;
- false when SysP ->
- ok;
- _ ->
- ?line ?t:fail({sys_alarm, SysUsage, NewSysThreshold})
+ {true, []} when not SysP ->
+ ok;
+ false when SysP ->
+ ok;
+ _ ->
+ ct:fail({sys_alarm, SysUsage, NewSysThreshold})
end,
%% Reset the threshold to set/clear the alarm again
- ?line ok = memsup:set_sysmem_high_watermark(SysThreshold),
- ?line ok = force_collection(),
- ?t:sleep(?t:seconds(1)),
+ ok = memsup:set_sysmem_high_watermark(SysThreshold),
+ ok = force_collection(),
+ ct:sleep({seconds,1}),
case alarm_set(system_memory_high_watermark) of
- {true, []} when SysP ->
- ok;
- false when not SysP ->
- ok;
- _ ->
- ?line ?t:fail({sys_alarm, SysUsage, SysThreshold})
+ {true, []} when SysP ->
+ ok;
+ false when not SysP ->
+ ok;
+ _ ->
+ ct:fail({sys_alarm, SysUsage, SysThreshold})
end,
%% Check memory usage
- ?line {Total2, _, {WorstPid, PidAlloc}} = memsup:get_memory_data(),
+ {Total2, _, {WorstPid, PidAlloc}} = memsup:get_memory_data(),
%% Check if a process alarm already should be set or not
PidUsage = PidAlloc/Total2,
ProcP = if
- PidUsage>ProcThreshold -> true;
- PidUsage=<ProcThreshold -> false
- end,
+ PidUsage>ProcThreshold -> true;
+ PidUsage=<ProcThreshold -> false
+ end,
%% Make sure the process alarm is set/not set accordingly
case alarm_set(process_memory_high_watermark) of
- {true, WorstPid} when ProcP ->
- ok;
- false when not ProcP ->
- ok;
- {true, BadPid1} when ProcP ->
- ?line ?t:fail({proc_alarm, WorstPid, BadPid1});
- _ ->
- ?line ?t:fail({proc_alarm, PidUsage, ProcThreshold})
+ {true, WorstPid} when ProcP ->
+ ok;
+ false when not ProcP ->
+ ok;
+ {true, BadPid1} when ProcP ->
+ ct:fail({proc_alarm, WorstPid, BadPid1});
+ _ ->
+ ct:fail({proc_alarm, PidUsage, ProcThreshold})
end,
%% Lower/raise the threshold to clear/set the alarm
NewProcThreshold = if
- ProcP -> 1.1*PidUsage;
- not ProcP -> 0.9*PidUsage
- end,
- ?line ok = memsup:set_procmem_high_watermark(NewProcThreshold),
- ?line ok = force_collection(),
- ?t:sleep(?t:seconds(1)),
+ ProcP -> 1.1*PidUsage;
+ not ProcP -> 0.9*PidUsage
+ end,
+ ok = memsup:set_procmem_high_watermark(NewProcThreshold),
+ ok = force_collection(),
+ ct:sleep({seconds,1}),
case alarm_set(process_memory_high_watermark) of
- {true, WorstPid} when not ProcP ->
- ok;
- false when ProcP ->
- ok;
- {true, BadPid2} when not ProcP ->
- ?line test_server:fail({proc_alarm, WorstPid, BadPid2});
- _ ->
- ?line ?t:fail({proc_alarm, PidUsage, ProcThreshold})
+ {true, WorstPid} when not ProcP ->
+ ok;
+ false when ProcP ->
+ ok;
+ {true, BadPid2} when not ProcP ->
+ ct:fail({proc_alarm, WorstPid, BadPid2});
+ _ ->
+ ct:fail({proc_alarm, PidUsage, ProcThreshold})
end,
%% Reset the threshold to clear/set the alarm
- ?line ok = memsup:set_procmem_high_watermark(ProcThreshold),
- ?line ok = force_collection(),
- ?t:sleep(?t:seconds(1)),
+ ok = memsup:set_procmem_high_watermark(ProcThreshold),
+ ok = force_collection(),
+ ct:sleep({seconds,1}),
case alarm_set(process_memory_high_watermark) of
- {true, WorstPid} when ProcP ->
- ok;
- false when not ProcP ->
- ok;
- {true, BadPid3} when ProcP ->
- ?line test_server:fail({proc_alarm, WorstPid, BadPid3});
- _ ->
- ?line ?t:fail({proc_alarm, PidUsage, ProcThreshold})
+ {true, WorstPid} when ProcP ->
+ ok;
+ false when not ProcP ->
+ ok;
+ {true, BadPid3} when ProcP ->
+ ct:fail({proc_alarm, WorstPid, BadPid3});
+ _ ->
+ ct:fail({proc_alarm, PidUsage, ProcThreshold})
end,
%% Reset memory check interval
- ?line ok = memsup:set_check_interval(1),
+ ok = memsup:set_check_interval(1),
ok.
-alarm2(suite) ->
- [];
-alarm2(doc) ->
- ["Test alarms when memsup_system_only==true"];
+%% Test alarms when memsup_system_only==true
alarm2(Config) when is_list(Config) ->
%% If system memory usage is too high, the testcase cannot
%% be run correctly
- ?line {Total, Alloc, {_Pid,_PidAlloc}} = memsup:get_memory_data(),
- ?line SysUsage = Alloc/Total,
+ {Total, Alloc, {_Pid,_PidAlloc}} = memsup:get_memory_data(),
+ SysUsage = Alloc/Total,
if
- SysUsage>0.99 ->
- {skip, sys_mem_too_high};
- true ->
- alarm2(Config, SysUsage)
+ SysUsage>0.99 ->
+ {skip, sys_mem_too_high};
+ true ->
+ alarm2(Config, SysUsage)
end.
alarm2(_Config, _SysUsage) ->
%% Change memsup_system_only and restart memsup
- ?line ok = application:set_env(os_mon, memsup_system_only, true),
- ?line ok = supervisor:terminate_child(os_mon_sup, memsup),
- ?line {ok, _Memsup1} = supervisor:restart_child(os_mon_sup, memsup),
+ ok = application:set_env(os_mon, memsup_system_only, true),
+ ok = supervisor:terminate_child(os_mon_sup, memsup),
+ {ok, _Memsup1} = supervisor:restart_child(os_mon_sup, memsup),
%% Set a long memory check interval, we will force memory checks
%% instead
- ?line ok = memsup:set_check_interval(60),
+ ok = memsup:set_check_interval(60),
%% Check data and thresholds
- ?line {Total, Alloc, undefined} = memsup:get_memory_data(),
- ?line SysThreshold = (memsup:get_sysmem_high_watermark()/100),
- ?line true = is_integer(memsup:get_procmem_high_watermark()),
+ {Total, Alloc, undefined} = memsup:get_memory_data(),
+ SysThreshold = (memsup:get_sysmem_high_watermark()/100),
+ true = is_integer(memsup:get_procmem_high_watermark()),
%% Check if a system alarm already should be set or not
- ?line SysUsage = Alloc/Total,
+ SysUsage = Alloc/Total,
SysP = if
- SysUsage>SysThreshold -> true;
- SysUsage=<SysThreshold -> false
- end,
+ SysUsage>SysThreshold -> true;
+ SysUsage=<SysThreshold -> false
+ end,
%% If system memory is higher than threshold, make sure the system
%% alarm is set. Otherwise, make sure it is not set
case alarm_set(system_memory_high_watermark) of
- {true, []} when SysP ->
- ok;
- false when not SysP ->
- ok;
- _ ->
- ?line ?t:fail({sys_alarm, SysUsage, SysThreshold})
+ {true, []} when SysP ->
+ ok;
+ false when not SysP ->
+ ok;
+ _ ->
+ ct:fail({sys_alarm, SysUsage, SysThreshold})
end,
%% Lower/raise the threshold to clear/set the alarm
NewSysThreshold = if
- SysP ->
- Value = 1.1*SysUsage,
- if
- Value > 0.99 -> 0.99;
- true -> Value
- end;
- not SysP -> 0.9*SysUsage
- end,
+ SysP ->
+ Value = 1.1*SysUsage,
+ if
+ Value > 0.99 -> 0.99;
+ true -> Value
+ end;
+ not SysP -> 0.9*SysUsage
+ end,
- ?line ok = memsup:set_sysmem_high_watermark(NewSysThreshold),
+ ok = memsup:set_sysmem_high_watermark(NewSysThreshold),
%% Initiate and wait for a new data collection
- ?line ok = force_collection(),
+ ok = force_collection(),
%% Make sure the alarm is cleared/set
- ?t:sleep(?t:seconds(1)),
+ ct:sleep({seconds,1}),
case alarm_set(system_memory_high_watermark) of
- {true, []} when not SysP ->
- ok;
- false when SysP ->
- ok;
- _ ->
- ?line ?t:fail({sys_alarm, SysUsage, NewSysThreshold})
+ {true, []} when not SysP ->
+ ok;
+ false when SysP ->
+ ok;
+ _ ->
+ ct:fail({sys_alarm, SysUsage, NewSysThreshold})
end,
%% Reset the threshold to set/clear the alarm again
- ?line ok = memsup:set_sysmem_high_watermark(SysThreshold),
- ?line ok = force_collection(),
- ?t:sleep(?t:seconds(1)),
+ ok = memsup:set_sysmem_high_watermark(SysThreshold),
+ ok = force_collection(),
+ ct:sleep({seconds,1}),
case alarm_set(system_memory_high_watermark) of
- {true, []} when SysP ->
- ok;
- false when not SysP ->
- ok;
- _ ->
- ?line ?t:fail({sys_alarm, SysUsage, SysThreshold})
+ {true, []} when SysP ->
+ ok;
+ false when not SysP ->
+ ok;
+ _ ->
+ ct:fail({sys_alarm, SysUsage, SysThreshold})
end,
%% Reset memsup_system_only and restart memsup
%% (memory check interval is then automatically reset)
- ?line ok = application:set_env(os_mon, memsup_system_only, false),
- ?line ok = supervisor:terminate_child(os_mon_sup, memsup),
- ?line {ok, _Memsup2} = supervisor:restart_child(os_mon_sup, memsup),
+ ok = application:set_env(os_mon, memsup_system_only, false),
+ ok = supervisor:terminate_child(os_mon_sup, memsup),
+ {ok, _Memsup2} = supervisor:restart_child(os_mon_sup, memsup),
ok.
@@ -420,39 +398,36 @@ alarm_set(Alarm, [_|T]) ->
alarm_set(_Alarm, []) ->
false.
-process(suite) ->
- [];
-process(doc) ->
- ["Make sure memsup discovers a process grown very large"];
+%% Make sure memsup discovers a process grown very large
process(Config) when is_list(Config) ->
%% Set a long memory check interval, we will force memory checks
%% instead
- ?line ok = memsup:set_check_interval(60),
+ ok = memsup:set_check_interval(60),
%% Collect data
MemData = memsup:get_memory_data(),
io:format("process: memsup:get_memory_data() = ~p~n", [MemData]),
- ?line {_Total,_Free,{_,Bytes}} = MemData,
+ {_Total,_Free,{_,Bytes}} = MemData,
%% Start a new process larger than Worst
- ?line WorsePid = spawn(fun() -> new_hog(Bytes) end),
- ?t:sleep(?t:seconds(1)),
+ WorsePid = spawn(fun() -> new_hog(Bytes) end),
+ ct:sleep({seconds,1}),
%% Initiate and wait for a new data collection
- ?line ok = force_collection(),
+ ok = force_collection(),
%% Check that get_memory_data() returns updated result
- ?line case memsup:get_memory_data() of
- {_, _, {WorsePid, _MoreBytes}} ->
- ok;
- {_, _, BadWorst} ->
- ?line ?t:fail({worst_pid, BadWorst})
- end,
+ case memsup:get_memory_data() of
+ {_, _, {WorsePid, _MoreBytes}} ->
+ ok;
+ {_, _, BadWorst} ->
+ ct:fail({worst_pid, BadWorst})
+ end,
%% Reset memory check interval
- ?line exit(WorsePid, done),
- ?line ok = memsup:set_check_interval(1),
+ exit(WorsePid, done),
+ ok = memsup:set_check_interval(1),
ok.
new_hog(Bytes) ->
@@ -463,110 +438,101 @@ new_hog(Bytes) ->
new_hog_1(List) ->
receive
- _Any -> exit(List)
+ _Any -> exit(List)
end.
-config(suite) ->
- [];
-config(doc) ->
- ["Test configuration"];
+%% Test configuration
config(Config) when is_list(Config) ->
%% Change configuration parameters and make sure change is reflected
%% when memsup is restarted
- ?line ok = application:set_env(os_mon, memory_check_interval, 2),
- ?line ok =
- application:set_env(os_mon, system_memory_high_watermark, 0.9),
- ?line ok =
- application:set_env(os_mon, process_memory_high_watermark, 0.1),
- ?line ok = application:set_env(os_mon, memsup_helper_timeout, 35),
- ?line ok = application:set_env(os_mon, memsup_system_only, true),
-
- ?line ok = supervisor:terminate_child(os_mon_sup, memsup),
- ?line {ok, _Child1} = supervisor:restart_child(os_mon_sup, memsup),
-
- ?line 120000 = memsup:get_check_interval(),
- ?line 90 = memsup:get_sysmem_high_watermark(),
- ?line 10 = memsup:get_procmem_high_watermark(),
- ?line 35 = memsup:get_helper_timeout(),
+ ok = application:set_env(os_mon, memory_check_interval, 2),
+ ok =
+ application:set_env(os_mon, system_memory_high_watermark, 0.9),
+ ok =
+ application:set_env(os_mon, process_memory_high_watermark, 0.1),
+ ok = application:set_env(os_mon, memsup_helper_timeout, 35),
+ ok = application:set_env(os_mon, memsup_system_only, true),
+
+ ok = supervisor:terminate_child(os_mon_sup, memsup),
+ {ok, _Child1} = supervisor:restart_child(os_mon_sup, memsup),
+
+ 120000 = memsup:get_check_interval(),
+ 90 = memsup:get_sysmem_high_watermark(),
+ 10 = memsup:get_procmem_high_watermark(),
+ 35 = memsup:get_helper_timeout(),
%% Also try this with bad parameter values, should be ignored
- ?line ok = application:set_env(os_mon, memory_check_interval, 0.2),
- ?line ok =
- application:set_env(os_mon, system_memory_high_watermark, -0.9),
- ?line ok =
- application:set_env(os_mon, process_memory_high_watermark,-0.1),
- ?line ok = application:set_env(os_mon, memsup_helper_timeout, 0.35),
- ?line ok = application:set_env(os_mon, memsup_system_only, arne),
-
- ?line ok = supervisor:terminate_child(os_mon_sup, memsup),
- ?line {ok, _Child2} = supervisor:restart_child(os_mon_sup, memsup),
-
- ?line 60000 = memsup:get_check_interval(),
- ?line 80 = memsup:get_sysmem_high_watermark(),
- ?line 5 = memsup:get_procmem_high_watermark(),
- ?line 30 = memsup:get_helper_timeout(),
+ ok = application:set_env(os_mon, memory_check_interval, 0.2),
+ ok =
+ application:set_env(os_mon, system_memory_high_watermark, -0.9),
+ ok =
+ application:set_env(os_mon, process_memory_high_watermark,-0.1),
+ ok = application:set_env(os_mon, memsup_helper_timeout, 0.35),
+ ok = application:set_env(os_mon, memsup_system_only, arne),
+
+ ok = supervisor:terminate_child(os_mon_sup, memsup),
+ {ok, _Child2} = supervisor:restart_child(os_mon_sup, memsup),
+
+ 60000 = memsup:get_check_interval(),
+ 80 = memsup:get_sysmem_high_watermark(),
+ 5 = memsup:get_procmem_high_watermark(),
+ 30 = memsup:get_helper_timeout(),
%% Reset configuration parameters
- ?line ok = application:set_env(os_mon, memory_check_interval, 1),
- ?line ok =
- application:set_env(os_mon, system_memory_high_watermark, 0.8),
- ?line ok =
- application:set_env(os_mon, process_memory_high_watermark,0.05),
- ?line ok = application:set_env(os_mon, memsup_helper_timeout, 30),
- ?line ok = application:set_env(os_mon, memsup_system_only, false),
+ ok = application:set_env(os_mon, memory_check_interval, 1),
+ ok =
+ application:set_env(os_mon, system_memory_high_watermark, 0.8),
+ ok =
+ application:set_env(os_mon, process_memory_high_watermark,0.05),
+ ok = application:set_env(os_mon, memsup_helper_timeout, 30),
+ ok = application:set_env(os_mon, memsup_system_only, false),
ok.
-unavailable(suite) ->
- [];
-unavailable(doc) ->
- ["Test correct behaviour when service is unavailable"];
+%% Test correct behaviour when service is unavailable
unavailable(Config) when is_list(Config) ->
%% Close memsup
- ?line ok = application:set_env(os_mon, start_memsup, false),
- ?line ok = supervisor:terminate_child(os_mon_sup, memsup),
+ ok = application:set_env(os_mon, start_memsup, false),
+ ok = supervisor:terminate_child(os_mon_sup, memsup),
%% Make sure all API functions return their dummy values
- ?line {0,0,{_Pid,0}} = memsup:get_memory_data(),
- ?line ok = application:set_env(os_mon, memsup_system_only, true),
- ?line {0,0,undefined} = memsup:get_memory_data(),
- ?line ok = application:set_env(os_mon, memsup_system_only, false),
- ?line [] = memsup:get_system_memory_data(),
- ?line 0 = memsup:get_os_wordsize(),
- ?line 60000 = memsup:get_check_interval(),
- ?line ok = memsup:set_check_interval(2),
- ?line 5 = memsup:get_procmem_high_watermark(),
- ?line ok = memsup:set_procmem_high_watermark(0.10),
- ?line 80 = memsup:get_sysmem_high_watermark(),
- ?line ok = memsup:set_sysmem_high_watermark(0.90),
- ?line 30 = memsup:get_helper_timeout(),
- ?line ok = memsup:set_helper_timeout(35),
+ {0,0,{_Pid,0}} = memsup:get_memory_data(),
+ ok = application:set_env(os_mon, memsup_system_only, true),
+ {0,0,undefined} = memsup:get_memory_data(),
+ ok = application:set_env(os_mon, memsup_system_only, false),
+ [] = memsup:get_system_memory_data(),
+ 0 = memsup:get_os_wordsize(),
+ 60000 = memsup:get_check_interval(),
+ ok = memsup:set_check_interval(2),
+ 5 = memsup:get_procmem_high_watermark(),
+ ok = memsup:set_procmem_high_watermark(0.10),
+ 80 = memsup:get_sysmem_high_watermark(),
+ ok = memsup:set_sysmem_high_watermark(0.90),
+ 30 = memsup:get_helper_timeout(),
+ ok = memsup:set_helper_timeout(35),
%% Start memsup again,
- ?line ok = application:set_env(os_mon, start_memsup, true),
- ?line {ok, _Child} = supervisor:restart_child(os_mon_sup, memsup),
+ ok = application:set_env(os_mon, start_memsup, true),
+ {ok, _Child} = supervisor:restart_child(os_mon_sup, memsup),
ok.
-timeout(suite) ->
- [];
-timeout(doc) ->
- ["Test stability of memsup when data collection times out"];
+%% Test stability of memsup when data collection times out
timeout(Config) when is_list(Config) ->
%% Set a long memory check interval and memsup_helper timeout,
%% we will force memory checks instead and fake timeouts
- ?line ok = memsup:set_check_interval(60),
- ?line ok = memsup:set_helper_timeout(3600),
+ ok = memsup:set_check_interval(60),
+ ok = memsup:set_helper_timeout(3600),
%% Provoke a timeout during memory collection
- ?line memsup ! time_to_collect,
- ?line memsup ! reg_collection_timeout,
+ memsup ! time_to_collect,
+ memsup ! reg_collection_timeout,
%% Not much we can check though, except that memsup is still running
- ?line {_,_,_} = memsup:get_memory_data(),
+ {_,_,_} = memsup:get_memory_data(),
%% Provoke a timeout during extensive memory collection
%% We fake a gen_server:call/2 to be able to send a timeout message
@@ -574,140 +540,133 @@ timeout(Config) when is_list(Config) ->
%% Linux should be handled the same way as solaris.
-% TimeoutMsg = case ?t:os_type() of
-% {unix, sunos} -> ext_collection_timeout;
-% {unix, linux} -> reg_collection_timeout
-% end,
+ % TimeoutMsg = case ?t:os_type() of
+ % {unix, sunos} -> ext_collection_timeout;
+ % {unix, linux} -> reg_collection_timeout
+ % end,
TimeoutMsg = ext_collection_timeout,
- ?line Pid = whereis(memsup),
- ?line Mref = erlang:monitor(process, Pid),
- ?line Pid ! {'$gen_call', {self(), Mref}, get_system_memory_data},
- ?line Pid ! TimeoutMsg,
+ Pid = whereis(memsup),
+ Mref = erlang:monitor(process, Pid),
+ Pid ! {'$gen_call', {self(), Mref}, get_system_memory_data},
+ Pid ! TimeoutMsg,
receive
- {Mref, []} ->
- erlang:demonitor(Mref),
- ?line ok;
- {Mref, Res} ->
- erlang:demonitor(Mref),
- ?line ?t:fail({unexpected_result, Res});
- {'DOWN', Mref, _, _, _} ->
- ?line ?t:fail(no_result)
+ {Mref, []} ->
+ erlang:demonitor(Mref),
+ ok;
+ {Mref, Res} ->
+ erlang:demonitor(Mref),
+ ct:fail({unexpected_result, Res});
+ {'DOWN', Mref, _, _, _} ->
+ ct:fail(no_result)
end,
%% Reset memory check interval and memsup_helper timeout
- ?line ok = memsup:set_check_interval(1),
- ?line ok = memsup:set_helper_timeout(30),
- ?line memsup ! time_to_collect,
+ ok = memsup:set_check_interval(1),
+ ok = memsup:set_helper_timeout(30),
+ memsup ! time_to_collect,
- ?line [_|_] = memsup:get_system_memory_data(),
+ [_|_] = memsup:get_system_memory_data(),
ok.
-port(suite) ->
- [];
-port(doc) ->
- ["Test that memsup handles a terminating port program"];
+%% Test that memsup handles a terminating port program
port(Config) when is_list(Config) ->
- ?line Str = os:cmd("ps -e | grep '[m]emsup'"),
+ Str = os:cmd("ps -e | grep '[m]emsup'"),
case io_lib:fread("~s", Str) of
- {ok, [Pid], _Rest} ->
-
- %% Monitor memsup
- ?line MonRef = erlang:monitor(process, memsup),
- ?line {Total1,_Alloc1,_Worst1} = memsup:get_memory_data(),
- ?line true = Total1>0,
-
- %% Kill the port program
- case os:cmd("kill -9 " ++ Pid) of
- [] ->
-
- %% memsup should now terminate
- receive
- {'DOWN', MonRef, _, _, {port_died, _Reason}} ->
- ok;
- {'DOWN', MonRef, _, _, Reason} ->
- ?line ?t:fail({unexpected_exit_reason, Reason})
- after
- 3000 ->
- ?line ?t:fail(still_alive)
- end,
-
- %% Give os_mon_sup time to restart memsup
- ?t:sleep(?t:seconds(3)),
- ?line {Total2,_Alloc2,_Worst2} =
- memsup:get_memory_data(),
- ?line true = Total2>0,
-
- ok;
-
- Line ->
- erlang:demonitor(MonRef),
- {skip, {not_killed, Line}}
- end;
- _ ->
- {skip, {os_pid_not_found, Str}}
+ {ok, [Pid], _Rest} ->
+
+ %% Monitor memsup
+ MonRef = erlang:monitor(process, memsup),
+ {Total1,_Alloc1,_Worst1} = memsup:get_memory_data(),
+ true = Total1>0,
+
+ %% Kill the port program
+ case os:cmd("kill -9 " ++ Pid) of
+ [] ->
+
+ %% memsup should now terminate
+ receive
+ {'DOWN', MonRef, _, _, {port_died, _Reason}} ->
+ ok;
+ {'DOWN', MonRef, _, _, Reason} ->
+ ct:fail({unexpected_exit_reason, Reason})
+ after
+ 3000 ->
+ ct:fail(still_alive)
+ end,
+
+ %% Give os_mon_sup time to restart memsup
+ ct:sleep({seconds,3}),
+ {Total2,_Alloc2,_Worst2} =
+ memsup:get_memory_data(),
+ true = Total2>0,
+
+ ok;
+
+ Line ->
+ erlang:demonitor(MonRef),
+ {skip, {not_killed, Line}}
+ end;
+ _ ->
+ {skip, {os_pid_not_found, Str}}
end.
-otp_5910(suite) ->
- [];
-otp_5910(doc) ->
- ["Test that alarms are cleared and not set twice"];
+%% Test that alarms are cleared and not set twice
otp_5910(Config) when is_list(Config) ->
Alarms =
- [system_memory_high_watermark, process_memory_high_watermark],
+ [system_memory_high_watermark, process_memory_high_watermark],
%% Make sure memsup sets both alarms
- ?line ok = application:set_env(os_mon, memory_check_interval, 60),
- ?line ok = memsup:set_check_interval(60),
- ?line SysThreshold = (memsup:get_sysmem_high_watermark()/100),
- ?line ProcThreshold = (memsup:get_procmem_high_watermark()/100),
+ ok = application:set_env(os_mon, memory_check_interval, 60),
+ ok = memsup:set_check_interval(60),
+ SysThreshold = (memsup:get_sysmem_high_watermark()/100),
+ ProcThreshold = (memsup:get_procmem_high_watermark()/100),
MemData = memsup:get_memory_data(),
io:format("otp_5910: memsup:get_memory_data() = ~p~n", [MemData]),
- ?line {Total, Alloc, {_Pid, _Bytes}} = MemData,
- ?line Pid = spawn_opt(fun() ->
- receive
- die -> ok
- end
- end, [{min_heap_size, 1000}]),
+ {Total, Alloc, {_Pid, _Bytes}} = MemData,
+ Pid = spawn_opt(fun() ->
+ receive
+ die -> ok
+ end
+ end, [{min_heap_size, 1000}]),
%% Create a process guaranteed to live, be constant and
%% break memsup process limit
- ?line {memory, Bytes} = erlang:process_info(Pid,memory),
- ?line SysUsage = Alloc/Total,
- ?line ProcUsage = Bytes/Total,
+ {memory, Bytes} = erlang:process_info(Pid,memory),
+ SysUsage = Alloc/Total,
+ ProcUsage = Bytes/Total,
if
- SysUsage>SysThreshold ->
- ok;
- SysUsage=<SysThreshold ->
- ?line ok = application:set_env(os_mon,
- sys_mem_high_watermark,
- 0.5 * SysUsage),
- ?line ok = memsup:set_sysmem_high_watermark(0.5 * SysUsage)
+ SysUsage>SysThreshold ->
+ ok;
+ SysUsage=<SysThreshold ->
+ ok = application:set_env(os_mon,
+ sys_mem_high_watermark,
+ 0.5 * SysUsage),
+ ok = memsup:set_sysmem_high_watermark(0.5 * SysUsage)
end,
if
- ProcUsage>ProcThreshold ->
- ok;
- ProcUsage=<ProcThreshold ->
- ?line ok = application:set_env(os_mon,
- proc_mem_high_watermark,
- 0.5 * ProcUsage),
- ?line ok = memsup:set_procmem_high_watermark(0.5 *ProcUsage)
+ ProcUsage>ProcThreshold ->
+ ok;
+ ProcUsage=<ProcThreshold ->
+ ok = application:set_env(os_mon,
+ proc_mem_high_watermark,
+ 0.5 * ProcUsage),
+ ok = memsup:set_procmem_high_watermark(0.5 *ProcUsage)
end,
- ?line ok = force_collection(),
- ?t:sleep(?t:seconds(1)),
+ ok = force_collection(),
+ ct:sleep({seconds,1}),
lists:foreach(fun(AlarmId) ->
- case alarm_set(AlarmId) of
- {true, _} -> ok;
- false ->
- ?line ?t:fail({alarm_not_set,
- AlarmId})
- end
- end,
- Alarms),
+ case alarm_set(AlarmId) of
+ {true, _} -> ok;
+ false ->
+ ct:fail({alarm_not_set, AlarmId})
+ end
+ end,
+ Alarms),
%% Kill guaranteed process...
Pid ! die,
@@ -715,42 +674,41 @@ otp_5910(Config) when is_list(Config) ->
exit(whereis(memsup), faked_memsup_crash),
%% Wait a little to make sure memsup has been restarted,
%% then make sure the alarms are set once, but not twice
- ?t:sleep(?t:seconds(1)),
- ?line MemUsage = memsup:get_memory_data(),
+ ct:sleep({seconds,1}),
+ MemUsage = memsup:get_memory_data(),
SetAlarms = alarm_handler:get_alarms(),
case lists:foldl(fun(system_memory_high_watermark, {S, P}) ->
- {S+1, P};
- (process_memory_high_watermark, {S, P}) ->
- {S, P+1};
- (_AlarmId, Acc0) ->
- Acc0
- end,
- {0, 0},
- SetAlarms) of
- {0, 0} ->
- ok;
- _ ->
- ?line ?t:fail({bad_number_of_alarms, SetAlarms, MemUsage})
+ {S+1, P};
+ (process_memory_high_watermark, {S, P}) ->
+ {S, P+1};
+ (_AlarmId, Acc0) ->
+ Acc0
+ end,
+ {0, 0},
+ SetAlarms) of
+ {0, 0} ->
+ ok;
+ _ ->
+ ct:fail({bad_number_of_alarms, SetAlarms, MemUsage})
end,
%% Stop OS_Mon and make sure all memsup alarms are cleared
- ?line ok = application:stop(os_mon),
- ?t:sleep(?t:seconds(1)),
+ ok = application:stop(os_mon),
+ ct:sleep({seconds,1}),
lists:foreach(fun(AlarmId) ->
- case alarm_set(AlarmId) of
- false -> ok;
- {true, _} ->
- ?line ?t:fail({alarm_is_set, AlarmId})
- end
- end,
- Alarms),
+ case alarm_set(AlarmId) of
+ false -> ok;
+ {true, _} ->
+ ct:fail({alarm_is_set, AlarmId})
+ end
+ end,
+ Alarms),
%% Reset configuration and restart OS_Mon
- ?line ok = application:set_env(os_mon,memory_check_interval,1),
- ?line ok = application:set_env(os_mon,sys_mem_high_watermark,0.8),
- ?line ok = application:set_env(os_mon,proc_mem_high_watermark,0.05),
- ?line ok = application:start(os_mon),
-
+ ok = application:set_env(os_mon,memory_check_interval,1),
+ ok = application:set_env(os_mon,sys_mem_high_watermark,0.8),
+ ok = application:set_env(os_mon,proc_mem_high_watermark,0.05),
+ ok = application:start(os_mon),
ok.
%%----------------------------------------------------------------------
@@ -765,30 +723,30 @@ force_collection() ->
force_collection(TimerRef) ->
receive
- {trace, _Pid, 'receive', {collected_sys, _Sys}} ->
- erlang:cancel_timer(TimerRef),
- erlang:trace(whereis(memsup), false, ['receive']),
- flush(),
- ok;
- {trace, _Pid, 'receive', reg_collection_timeout} ->
- erlang:cancel_timer(TimerRef),
- erlang:trace(whereis(memsup), false, ['receive']),
- flush(),
- collection_timeout;
- timout ->
- erlang:trace(whereis(memsup), false, ['receive']),
- flush(),
- timeout;
- _Msg ->
- force_collection(TimerRef)
+ {trace, _Pid, 'receive', {collected_sys, _Sys}} ->
+ erlang:cancel_timer(TimerRef),
+ erlang:trace(whereis(memsup), false, ['receive']),
+ flush(),
+ ok;
+ {trace, _Pid, 'receive', reg_collection_timeout} ->
+ erlang:cancel_timer(TimerRef),
+ erlang:trace(whereis(memsup), false, ['receive']),
+ flush(),
+ collection_timeout;
+ timout ->
+ erlang:trace(whereis(memsup), false, ['receive']),
+ flush(),
+ timeout;
+ _Msg ->
+ force_collection(TimerRef)
end.
flush() ->
receive
- {trace, _, _, _} ->
- flush();
- timeout ->
- flush()
+ {trace, _, _, _} ->
+ flush();
+ timeout ->
+ flush()
after 0 ->
- ok
+ ok
end.
diff --git a/lib/os_mon/test/os_mon_SUITE.erl b/lib/os_mon/test/os_mon_SUITE.erl
index 0f7ae3a508..033a5ae162 100644
--- a/lib/os_mon/test/os_mon_SUITE.erl
+++ b/lib/os_mon/test/os_mon_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -21,92 +21,58 @@
-include_lib("common_test/include/ct.hrl").
%% Test server specific exports
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2]).
--export([init_per_testcase/2, end_per_testcase/2]).
+-export([all/0, suite/0]).
%% Test cases
-export([app_file/1, appup_file/1, config/1]).
-%% Default timetrap timeout (set in init_per_testcase)
--define(default_timeout, ?t:minutes(1)).
-
-init_per_testcase(_Case, Config) ->
- Dog = test_server:timetrap(?default_timeout),
- [{watchdog, Dog}|Config].
-
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
- ok.
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
case test_server:os_type() of
- {unix, sunos} -> [app_file, appup_file, config];
- _OS -> [app_file, appup_file]
+ {unix, sunos} -> [app_file, appup_file, config];
+ _OS -> [app_file, appup_file]
end.
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
-app_file(suite) ->
- [];
-app_file(doc) ->
- ["Testing .app file"];
+%% Testing .app file
app_file(Config) when is_list(Config) ->
- ?line ok = test_server:app_test(os_mon),
+ ok = test_server:app_test(os_mon),
ok.
appup_file(Config) when is_list(Config) ->
ok = test_server:appup_test(os_mon).
-config(suite) ->
- [];
-config(doc) ->
- ["Test OS_Mon configuration"];
+%% Test OS_Mon configuration
config(Config) when is_list(Config) ->
IsReg = fun(Name) -> is_pid(whereis(Name)) end,
IsNotReg = fun(Name) -> undefined == whereis(Name) end,
- ?line ok = application:start(os_mon),
- ?line true = lists:all(IsReg, [cpu_sup, disksup, memsup]),
- ?line ok = application:stop(os_mon),
-
- ?line ok = application:set_env(os_mon, start_cpu_sup, false),
- ?line ok = application:start(os_mon),
- ?line true = lists:all(IsReg, [disksup, memsup]),
- ?line true = IsNotReg(cpu_sup),
- ?line ok = application:stop(os_mon),
- ?line ok = application:set_env(os_mon, start_cpu_sup, true),
-
- ?line ok = application:set_env(os_mon, start_disksup, false),
- ?line ok = application:start(os_mon),
- ?line true = lists:all(IsReg, [cpu_sup, memsup]),
- ?line true = IsNotReg(disksup),
- ?line ok = application:stop(os_mon),
- ?line ok = application:set_env(os_mon, start_disksup, true),
-
- ?line ok = application:set_env(os_mon, start_memsup, false),
- ?line ok = application:start(os_mon),
- ?line true = lists:all(IsReg, [cpu_sup, disksup]),
- ?line true = IsNotReg(memsup),
- ?line ok = application:stop(os_mon),
- ?line ok = application:set_env(os_mon, start_memsup, true),
+ ok = application:start(os_mon),
+ true = lists:all(IsReg, [cpu_sup, disksup, memsup]),
+ ok = application:stop(os_mon),
+
+ ok = application:set_env(os_mon, start_cpu_sup, false),
+ ok = application:start(os_mon),
+ true = lists:all(IsReg, [disksup, memsup]),
+ true = IsNotReg(cpu_sup),
+ ok = application:stop(os_mon),
+ ok = application:set_env(os_mon, start_cpu_sup, true),
+
+ ok = application:set_env(os_mon, start_disksup, false),
+ ok = application:start(os_mon),
+ true = lists:all(IsReg, [cpu_sup, memsup]),
+ true = IsNotReg(disksup),
+ ok = application:stop(os_mon),
+ ok = application:set_env(os_mon, start_disksup, true),
+
+ ok = application:set_env(os_mon, start_memsup, false),
+ ok = application:start(os_mon),
+ true = lists:all(IsReg, [cpu_sup, disksup]),
+ true = IsNotReg(memsup),
+ ok = application:stop(os_mon),
+ ok = application:set_env(os_mon, start_memsup, true),
ok.
diff --git a/lib/os_mon/test/os_mon_conf.erl b/lib/os_mon/test/os_mon_conf.erl
index da08bf3917..6daeab31ef 100644
--- a/lib/os_mon/test/os_mon_conf.erl
+++ b/lib/os_mon/test/os_mon_conf.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/os_mon/test/os_mon_mib_SUITE.erl b/lib/os_mon/test/os_mon_mib_SUITE.erl
index f8fb9e20fc..f40d5f442c 100644
--- a/lib/os_mon/test/os_mon_mib_SUITE.erl
+++ b/lib/os_mon/test/os_mon_mib_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -35,25 +35,23 @@
-include_lib("snmp/include/snmp_types.hrl").
% Test server specific exports
--export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,
- init_per_suite/1, end_per_suite/1,
- init_per_testcase/2, end_per_testcase/2]).
+-export([all/0, suite/0, groups/0,
+ init_per_suite/1, end_per_suite/1]).
% Test cases must be exported.
-export([update_load_table/1]).
-export([get_mem_sys_mark/1, get_mem_proc_mark/1, get_disk_threshold/1,
- get_load_table/1, get_disk_table/1,
- real_snmp_request/1, load_unload/1]).
+ get_load_table/1, get_disk_table/1,
+ real_snmp_request/1, load_unload/1]).
-export([sys_tot_mem/1, sys_used_mem/1, large_erl_process/1,
- large_erl_process_mem/1, cpu_load/1, cpu_load5/1, cpu_load15/1,
- os_wordsize/1, sys_tot_mem64/1, sys_used_mem64/1,
- large_erl_process_mem64/1, disk_descr/1, disk_kbytes/1,
- disk_capacity/1]).
+ large_erl_process_mem/1, cpu_load/1, cpu_load5/1, cpu_load15/1,
+ os_wordsize/1, sys_tot_mem64/1, sys_used_mem64/1,
+ large_erl_process_mem64/1, disk_descr/1, disk_kbytes/1,
+ disk_capacity/1]).
--export([]).
-export([otp_6351/1, otp_7441/1]).
-define(TRAP_UDP, 5000).
@@ -65,17 +63,11 @@
-define(MGR_PORT, 5001).
%%---------------------------------------------------------------------
-init_per_testcase(_Case, Config) when is_list(Config) ->
- Dog = test_server:timetrap(test_server:minutes(6)),
- [{watchdog, Dog}|Config].
-end_per_testcase(_Case, Config) when is_list(Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
- Config.
-
-suite() -> [{ct_hooks,[ts_install_cth]},
- {require, snmp_mgr_agent, snmp}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,6}},
+ {require, snmp_mgr_agent, snmp}].
all() ->
[load_unload, get_mem_sys_mark, get_mem_proc_mark,
@@ -94,12 +86,6 @@ groups() ->
{get_next_disk_table, [],
[disk_descr, disk_kbytes, disk_capacity]}].
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
%%---------------------------------------------------------------------
%%--------------------------------------------------------------------
@@ -112,9 +98,9 @@ end_per_group(_GroupName, Config) ->
%% variable, but should NOT alter/remove any existing entries.
%%--------------------------------------------------------------------
init_per_suite(Config) ->
- ?line application:start(sasl),
- ?line application:start(mnesia),
- ?line application:start(os_mon),
+ application:start(sasl),
+ application:start(mnesia),
+ application:start(os_mon),
ok = ct_snmp:start(Config,snmp_mgr_agent),
@@ -130,7 +116,7 @@ init_per_suite(Config) ->
%% Description: Cleanup after the whole suite
%%--------------------------------------------------------------------
end_per_suite(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
ConfDir = filename:join(PrivDir,"conf"),
DbDir = filename:join(PrivDir,"db"),
MgrDir = filename:join(PrivDir, "mgr"),
@@ -152,92 +138,74 @@ end_per_suite(Config) ->
%%---------------------------------------------------------------------
%% Test cases
%%---------------------------------------------------------------------
-load_unload(doc) ->
- ["Test to unload and the reload the OTP.mib "];
-load_unload(suite) -> [];
+
+%% Test to unload and the reload the OTP.mib
load_unload(Config) when is_list(Config) ->
- ?line os_mon_mib:unload(snmp_master_agent),
- ?line os_mon_mib:load(snmp_master_agent),
+ os_mon_mib:unload(snmp_master_agent),
+ os_mon_mib:load(snmp_master_agent),
ok.
%%---------------------------------------------------------------------
-update_load_table(doc) ->
- ["check os_mon_mib:update_load_table error handling"];
-update_load_table(suite) ->
- [];
+%% check os_mon_mib:update_load_table error handling
update_load_table(Config) when is_list(Config) ->
- ?line Node = start_node(),
- ?line ok = rpc:call(Node,application,start,[sasl]),
- ?line ok = rpc:call(Node,application,start,[os_mon]),
- ?line ok = os_mon_mib:update_load_table(),
- ?line rpc:call(Node,application,stop,[os_mon]),
- ?line ok = os_mon_mib:update_load_table(),
- ?line stop_node(Node),
+ Node = start_node(),
+ ok = rpc:call(Node,application,start,[sasl]),
+ ok = rpc:call(Node,application,start,[os_mon]),
+ ok = os_mon_mib:update_load_table(),
+ rpc:call(Node,application,stop,[os_mon]),
+ ok = os_mon_mib:update_load_table(),
+ stop_node(Node),
ok.
-otp_6351(doc) ->
- ["like update_load_table, when memsup_system_only==true"];
-otp_6351(suite) ->
- [];
+%% like update_load_table, when memsup_system_only==true
otp_6351(Config) when is_list(Config) ->
- ?line Node = start_node(),
- ?line ok = rpc:call(Node,application,start,[sasl]),
- ?line ok = rpc:call(Node,application,load,[os_mon]),
- ?line ok = rpc:call(Node,application,set_env,
- [os_mon,memsup_system_only,true]),
- ?line ok = rpc:call(Node,application,start,[os_mon]),
- ?line Res = rpc:call(Node,os_mon_mib,get_load,[Node]),
+ Node = start_node(),
+ ok = rpc:call(Node,application,start,[sasl]),
+ ok = rpc:call(Node,application,load,[os_mon]),
+ ok = rpc:call(Node,application,set_env,
+ [os_mon,memsup_system_only,true]),
+ ok = rpc:call(Node,application,start,[os_mon]),
+ Res = rpc:call(Node,os_mon_mib,get_load,[Node]),
if
- is_tuple(Res), element(1, Res)==loadTable ->
- ?line ok;
- true ->
- ?line ?t:fail(Res)
+ is_tuple(Res), element(1, Res)==loadTable ->
+ ok;
+ true ->
+ ct:fail(Res)
end,
- ?line rpc:call(Node,application,stop,[os_mon]),
- ?line stop_node(Node),
+ rpc:call(Node,application,stop,[os_mon]),
+ stop_node(Node),
ok.
-
-
%%---------------------------------------------------------------------
-get_mem_sys_mark(doc) ->
- ["Simulates a get call to test the instrumentation function "
- "for the loadMemorySystemWatermark variable."];
-get_mem_sys_mark(suite) ->
- [];
+%% Simulates a get call to test the instrumentation function
+%% for the loadMemorySystemWatermark variable.
get_mem_sys_mark(Config) when is_list(Config) ->
case os_mon_mib:mem_sys_mark(get) of
- {value, SysMark} when is_integer(SysMark) ->
- ok;
- _ ->
- ?line test_server:fail(sys_mark_value_not_integer)
+ {value, SysMark} when is_integer(SysMark) ->
+ ok;
+ _ ->
+ ct:fail(sys_mark_value_not_integer)
end.
%%---------------------------------------------------------------------
-get_mem_proc_mark(doc) ->
- ["Simulates a get call to test the instrumentation function "
- "for the loadMemoryErlProcWatermark variable."];
-get_mem_proc_mark(suite) ->
- [];
+%% Simulates a get call to test the instrumentation function
+%% for the loadMemoryErlProcWatermark variable.
get_mem_proc_mark(Config) when is_list(Config) ->
case os_mon_mib:mem_proc_mark(get) of
- {value, ProcMark} when is_integer(ProcMark) ->
- ok;
- _ ->
- ?line test_server:fail(proc_mark_value_not_integer)
+ {value, ProcMark} when is_integer(ProcMark) ->
+ ok;
+ _ ->
+ ct:fail(proc_mark_value_not_integer)
end.
%%---------------------------------------------------------------------
-get_disk_threshold(doc) ->
- ["Simulates a get call to test the instrumentation function "
- "for the diskAlmostFullThreshold variable."];
-get_disk_threshold(suite) ->
- [];
+%% Simulates a get call to test the instrumentation function
+%% for the diskAlmostFullThreshold variable.
get_disk_threshold(Config) when is_list(Config) ->
- case os_mon_mib:disk_threshold(get) of
- {value, ProcMark} when is_integer(ProcMark) ->
- ok;
- _ ->
- ?line test_server:fail(disk_threshold_value_not_integer)
+ case os_mon_mib:disk_threshold(get) of
+ {value, ProcMark} when is_integer(ProcMark) ->
+ ok;
+ _ ->
+ ct:fail(disk_threshold_value_not_integer)
end.
%%---------------------------------------------------------------------
@@ -247,11 +215,8 @@ get_disk_threshold(Config) when is_list(Config) ->
%%% instrumentation functions directly as done in most test cases in
%%% this test suite
-get_load_table(doc) ->
- ["Simulates get calls to test the instrumentation function "
- "for the loadTable"];
-get_load_table(suite) ->
- [];
+%% Simulates get calls to test the instrumentation function
+%% for the loadTable
get_load_table(Config) when is_list(Config) ->
NodeStr = atom_to_list(node()),
@@ -259,376 +224,316 @@ get_load_table(Config) when is_list(Config) ->
{_, _, {Pid, _}} = memsup:get_memory_data(),
PidStr = lists:flatten(io_lib:format("~w", [Pid])),
- ?line [{value, NodeStr},{value, PidStr}] =
- os_mon_mib:load_table(get, [NodeLen | NodeStr],
- [?loadErlNodeName, ?loadLargestErlProcess]),
-
- ?line Values = os_mon_mib:load_table(get, [NodeLen | NodeStr] ,
- [?loadSystemTotalMemory,
- ?loadSystemUsedMemory,
- ?loadLargestErlProcessUsedMemory,
- ?loadCpuLoad,
- ?loadCpuLoad5,
- ?loadCpuLoad15,
- ?loadOsWordsize,
- ?loadSystemTotalMemory64,
- ?loadSystemUsedMemory64,
- ?loadLargestErlProcessUsedMemory64]),
+ [{value, NodeStr},{value, PidStr}] =
+ os_mon_mib:load_table(get, [NodeLen | NodeStr],
+ [?loadErlNodeName, ?loadLargestErlProcess]),
+
+ Values = os_mon_mib:load_table(get, [NodeLen | NodeStr] ,
+ [?loadSystemTotalMemory,
+ ?loadSystemUsedMemory,
+ ?loadLargestErlProcessUsedMemory,
+ ?loadCpuLoad,
+ ?loadCpuLoad5,
+ ?loadCpuLoad15,
+ ?loadOsWordsize,
+ ?loadSystemTotalMemory64,
+ ?loadSystemUsedMemory64,
+ ?loadLargestErlProcessUsedMemory64]),
IsInt = fun({value, Val}) when is_integer(Val) ->
- true;
- (_) ->
- false
- end,
+ true;
+ (_) ->
+ false
+ end,
NewValues = lists:filter(IsInt, Values),
case length(NewValues) of
- 10 ->
- ok;
- _ ->
- ?line test_server:fail(value_not_integer)
+ 10 ->
+ ok;
+ _ ->
+ ct:fail(value_not_integer)
end,
- ?line [{noValue,noSuchInstance}, {noValue,noSuchInstance},
- {noValue,noSuchInstance}, {noValue,noSuchInstance},
- {noValue,noSuchInstance}, {noValue,noSuchInstance},
- {noValue,noSuchInstance}, {noValue,noSuchInstance},
- {noValue,noSuchInstance}, {noValue,noSuchInstance},
- {noValue,noSuchInstance}, {noValue,noSuchInstance}] =
- os_mon_mib:load_table(get, [3, 102, 111, 111],
- [?loadErlNodeName,
- ?loadSystemTotalMemory,
- ?loadSystemUsedMemory,
- ?loadLargestErlProcess,
- ?loadLargestErlProcessUsedMemory,
- ?loadCpuLoad,
- ?loadCpuLoad5,
- ?loadCpuLoad15,
- ?loadOsWordsize,
- ?loadSystemTotalMemory64,
- ?loadSystemUsedMemory64,
- ?loadLargestErlProcessUsedMemory64]),
+ [{noValue,noSuchInstance}, {noValue,noSuchInstance},
+ {noValue,noSuchInstance}, {noValue,noSuchInstance},
+ {noValue,noSuchInstance}, {noValue,noSuchInstance},
+ {noValue,noSuchInstance}, {noValue,noSuchInstance},
+ {noValue,noSuchInstance}, {noValue,noSuchInstance},
+ {noValue,noSuchInstance}, {noValue,noSuchInstance}] =
+ os_mon_mib:load_table(get, [3, 102, 111, 111],
+ [?loadErlNodeName,
+ ?loadSystemTotalMemory,
+ ?loadSystemUsedMemory,
+ ?loadLargestErlProcess,
+ ?loadLargestErlProcessUsedMemory,
+ ?loadCpuLoad,
+ ?loadCpuLoad5,
+ ?loadCpuLoad15,
+ ?loadOsWordsize,
+ ?loadSystemTotalMemory64,
+ ?loadSystemUsedMemory64,
+ ?loadLargestErlProcessUsedMemory64]),
ok.
%%---------------------------------------------------------------------
-sys_tot_mem(doc) ->
- [];
-sys_tot_mem(suite) ->
- [];
sys_tot_mem(Config) when is_list(Config) ->
- ?line [{[?loadSystemTotalMemory, Len | NodeStr], Mem}] =
- os_mon_mib:load_table(get_next, [], [?loadSystemTotalMemory]),
- ?line Len = length(NodeStr),
- ?line true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
+ [{[?loadSystemTotalMemory, Len | NodeStr], Mem}] =
+ os_mon_mib:load_table(get_next, [], [?loadSystemTotalMemory]),
+ Len = length(NodeStr),
+ true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
case Mem of
- Mem when is_integer(Mem) ->
- ok;
- _ ->
- ?line test_server:fail(sys_tot_mem_value_not_integer)
+ Mem when is_integer(Mem) ->
+ ok;
+ _ ->
+ ct:fail(sys_tot_mem_value_not_integer)
end.
-sys_used_mem(doc) ->
- [];
-sys_used_mem(suite) -> [];
sys_used_mem(Config) when is_list(Config) ->
- ?line [{[?loadSystemUsedMemory, Len | NodeStr], Mem}] =
- os_mon_mib:load_table(get_next,[], [?loadSystemUsedMemory]),
- ?line Len = length(NodeStr),
- ?line true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
+ [{[?loadSystemUsedMemory, Len | NodeStr], Mem}] =
+ os_mon_mib:load_table(get_next,[], [?loadSystemUsedMemory]),
+ Len = length(NodeStr),
+ true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
case Mem of
- Mem when is_integer(Mem) ->
- ok;
- _ ->
- ?line test_server:fail(sys_used_mem_value_not_integer)
+ Mem when is_integer(Mem) ->
+ ok;
+ _ ->
+ ct:fail(sys_used_mem_value_not_integer)
end.
-large_erl_process(doc) ->
- [];
-large_erl_process(suite) ->
- [];
large_erl_process(Config) when is_list(Config) ->
{_, _, {Pid, _}} = memsup:get_memory_data(),
PidStr = lists:flatten(io_lib:format("~w", [Pid])),
- ?line [{[?loadLargestErlProcess, Len | NodeStr], PidStr}] =
- os_mon_mib:load_table(get_next,[], [?loadLargestErlProcess]),
- ?line Len = length(NodeStr),
- ?line true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
+ [{[?loadLargestErlProcess, Len | NodeStr], PidStr}] =
+ os_mon_mib:load_table(get_next,[], [?loadLargestErlProcess]),
+ Len = length(NodeStr),
+ true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
ok.
-large_erl_process_mem(doc) ->
- [];
-large_erl_process_mem(suite) ->
- [];
large_erl_process_mem(Config) when is_list(Config) ->
- ?line [{[?loadLargestErlProcessUsedMemory, Len | NodeStr], Mem}] =
- os_mon_mib:load_table(get_next,[],
- [?loadLargestErlProcessUsedMemory]),
- ?line Len = length(NodeStr),
- ?line true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
-
- case Mem of
- Mem when is_integer(Mem) ->
- ok;
- _ ->
- ?line test_server:fail(erl_pid_mem_value_not_integer)
+ [{[?loadLargestErlProcessUsedMemory, Len | NodeStr], Mem}] =
+ os_mon_mib:load_table(get_next,[],
+ [?loadLargestErlProcessUsedMemory]),
+ Len = length(NodeStr),
+ true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
+
+ case Mem of
+ Mem when is_integer(Mem) ->
+ ok;
+ _ ->
+ ct:fail(erl_pid_mem_value_not_integer)
end.
-cpu_load(doc) ->
- [];
-cpu_load(suite) ->
- [];
cpu_load(Config) when is_list(Config) ->
- ?line [{[?loadCpuLoad, Len | NodeStr], Load}] =
- os_mon_mib:load_table(get_next,[], [?loadCpuLoad]),
- ?line Len = length(NodeStr),
- ?line true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
+ [{[?loadCpuLoad, Len | NodeStr], Load}] =
+ os_mon_mib:load_table(get_next,[], [?loadCpuLoad]),
+ Len = length(NodeStr),
+ true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
case Load of
- Load when is_integer(Load) ->
- ok;
- _ ->
- ?line test_server:fail(cpu_load_value_not_integer)
+ Load when is_integer(Load) ->
+ ok;
+ _ ->
+ ct:fail(cpu_load_value_not_integer)
end.
-cpu_load5(doc) ->
- [];
-cpu_load5(suite) ->
- [];
cpu_load5(Config) when is_list(Config) ->
- ?line [{[?loadCpuLoad5, Len | NodeStr], Load}] =
- os_mon_mib:load_table(get_next,[], [?loadCpuLoad5]),
- ?line Len = length(NodeStr),
- ?line true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
+ [{[?loadCpuLoad5, Len | NodeStr], Load}] =
+ os_mon_mib:load_table(get_next,[], [?loadCpuLoad5]),
+ Len = length(NodeStr),
+ true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
case Load of
- Load when is_integer(Load) ->
- ok;
- _ ->
- ?line test_server:fail(cpu_load5_value_not_integer)
+ Load when is_integer(Load) ->
+ ok;
+ _ ->
+ ct:fail(cpu_load5_value_not_integer)
end.
-cpu_load15(doc) ->
- [];
-cpu_load15(suite) ->
- [];
cpu_load15(Config) when is_list(Config) ->
- ?line [{[?loadCpuLoad15, Len | NodeStr], Load}] =
- os_mon_mib:load_table(get_next,[], [?loadCpuLoad15]),
- ?line Len = length(NodeStr),
- ?line true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
-
- case Load of
- Load when is_integer(Load) ->
- ok;
- _ ->
- ?line test_server:fail(cpu_load15_value_not_integer)
- end.
-
-os_wordsize(doc) ->
- [];
-os_wordsize(suite) ->
- [];
+ [{[?loadCpuLoad15, Len | NodeStr], Load}] =
+ os_mon_mib:load_table(get_next,[], [?loadCpuLoad15]),
+ Len = length(NodeStr),
+ true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
+
+ case Load of
+ Load when is_integer(Load) ->
+ ok;
+ _ ->
+ ct:fail(cpu_load15_value_not_integer)
+ end.
+
os_wordsize(Config) when is_list(Config) ->
- ?line [{[?loadOsWordsize, Len | NodeStr], Wordsize}] =
- os_mon_mib:load_table(get_next,[], [?loadOsWordsize]),
- ?line Len = length(NodeStr),
- ?line true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
-
- case Wordsize of
- Wordsize when is_integer(Wordsize) ->
- ok;
- _ ->
- ?line test_server:fail(os_wordsize_value_not_integer)
- end.
-
-sys_tot_mem64(doc) ->
- [];
-sys_tot_mem64(suite) ->
- [];
+ [{[?loadOsWordsize, Len | NodeStr], Wordsize}] =
+ os_mon_mib:load_table(get_next,[], [?loadOsWordsize]),
+ Len = length(NodeStr),
+ true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
+
+ case Wordsize of
+ Wordsize when is_integer(Wordsize) ->
+ ok;
+ _ ->
+ ct:fail(os_wordsize_value_not_integer)
+ end.
+
sys_tot_mem64(Config) when is_list(Config) ->
- ?line [{[?loadSystemTotalMemory64, Len | NodeStr], Mem}] =
- os_mon_mib:load_table(get_next, [], [?loadSystemTotalMemory64]),
- ?line Len = length(NodeStr),
- ?line true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
+ [{[?loadSystemTotalMemory64, Len | NodeStr], Mem}] =
+ os_mon_mib:load_table(get_next, [], [?loadSystemTotalMemory64]),
+ Len = length(NodeStr),
+ true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
case Mem of
- Mem when is_integer(Mem) ->
- ok;
- _ ->
- ?line test_server:fail(sys_tot_mem_value_not_integer)
+ Mem when is_integer(Mem) ->
+ ok;
+ _ ->
+ ct:fail(sys_tot_mem_value_not_integer)
end.
-sys_used_mem64(doc) ->
- [];
-sys_used_mem64(suite) -> [];
sys_used_mem64(Config) when is_list(Config) ->
- ?line [{[?loadSystemUsedMemory64, Len | NodeStr], Mem}] =
- os_mon_mib:load_table(get_next,[], [?loadSystemUsedMemory64]),
- ?line Len = length(NodeStr),
- ?line true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
+ [{[?loadSystemUsedMemory64, Len | NodeStr], Mem}] =
+ os_mon_mib:load_table(get_next,[], [?loadSystemUsedMemory64]),
+ Len = length(NodeStr),
+ true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
case Mem of
- Mem when is_integer(Mem) ->
- ok;
- _ ->
- ?line test_server:fail(sys_used_mem_value_not_integer)
+ Mem when is_integer(Mem) ->
+ ok;
+ _ ->
+ ct:fail(sys_used_mem_value_not_integer)
end.
-large_erl_process_mem64(doc) ->
- [];
-large_erl_process_mem64(suite) ->
- [];
large_erl_process_mem64(Config) when is_list(Config) ->
- ?line [{[?loadLargestErlProcessUsedMemory64, Len | NodeStr], Mem}] =
- os_mon_mib:load_table(get_next,[],
- [?loadLargestErlProcessUsedMemory64]),
- ?line Len = length(NodeStr),
- ?line true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
-
- case Mem of
- Mem when is_integer(Mem) ->
- ok;
- _ ->
- ?line test_server:fail(erl_pid_mem_value_not_integer)
+ [{[?loadLargestErlProcessUsedMemory64, Len | NodeStr], Mem}] =
+ os_mon_mib:load_table(get_next,[],
+ [?loadLargestErlProcessUsedMemory64]),
+ Len = length(NodeStr),
+ true = lists:member(list_to_atom(NodeStr), [node() | nodes()]),
+
+ case Mem of
+ Mem when is_integer(Mem) ->
+ ok;
+ _ ->
+ ct:fail(erl_pid_mem_value_not_integer)
end.
%%---------------------------------------------------------------------
-get_disk_table(doc) ->
- ["Simulates get calls to test the instrumentation function "
- "for the diskTable."];
-get_disk_table(suite) ->
- [];
+%% Simulates get calls to test the instrumentation function
+%% for the diskTable.
get_disk_table(Config) when is_list(Config) ->
DiskData = disksup:get_disk_data(),
DiskDataLen = length(DiskData),
if
- DiskDataLen > 0 ->
- ?line [{value, Value}] =
- os_mon_mib:disk_table(get, [1,1], [?diskDescr]),
-
- case is_list(Value) of
- true ->
- ok;
- false ->
- ?line test_server:fail(value_not_a_string)
- end,
-
- ?line Values = os_mon_mib:disk_table(get, [1,1],
- [?diskId,
- ?diskKBytes,
- ?diskCapacity]),
-
- IsInt = fun({value, Val}) when is_integer(Val) ->
- true;
- (_) ->
- false
- end,
-
- NewValues = lists:filter(IsInt, Values),
-
- case length(NewValues) of
- 3 ->
- ok;
- _ ->
- ?line test_server:fail(value_not_integer)
- end
+ DiskDataLen > 0 ->
+ [{value, Value}] =
+ os_mon_mib:disk_table(get, [1,1], [?diskDescr]),
+
+ case is_list(Value) of
+ true ->
+ ok;
+ false ->
+ ct:fail(value_not_a_string)
+ end,
+
+ Values = os_mon_mib:disk_table(get, [1,1],
+ [?diskId,
+ ?diskKBytes,
+ ?diskCapacity]),
+
+ IsInt = fun({value, Val}) when is_integer(Val) ->
+ true;
+ (_) ->
+ false
+ end,
+
+ NewValues = lists:filter(IsInt, Values),
+
+ case length(NewValues) of
+ 3 ->
+ ok;
+ _ ->
+ ct:fail(value_not_integer)
+ end
end,
- ?line [{noValue,noSuchInstance}, {noValue,noSuchInstance},
- {noValue,noSuchInstance}, {noValue,noSuchInstance}] =
- os_mon_mib:disk_table(get, [1, DiskDataLen + 1], [?diskId,
- ?diskDescr,
- ?diskKBytes,
- ?diskCapacity]),
+ [{noValue,noSuchInstance}, {noValue,noSuchInstance},
+ {noValue,noSuchInstance}, {noValue,noSuchInstance}] =
+ os_mon_mib:disk_table(get, [1, DiskDataLen + 1], [?diskId,
+ ?diskDescr,
+ ?diskKBytes,
+ ?diskCapacity]),
ok.
%%---------------------------------------------------------------------
-disk_descr(doc) ->
- [];
-disk_descr(suite) ->
- [];
disk_descr(Config) when is_list(Config) ->
- ?line [{[?diskDescr, 1,1], Descr}] =
- os_mon_mib:disk_table(get_next, [], [?diskDescr]),
+ [{[?diskDescr, 1,1], Descr}] =
+ os_mon_mib:disk_table(get_next, [], [?diskDescr]),
case Descr of
- Descr when is_list(Descr) ->
- ok;
- _ ->
- ?line test_server:fail(disk_descr_value_not_a_string)
+ Descr when is_list(Descr) ->
+ ok;
+ _ ->
+ ct:fail(disk_descr_value_not_a_string)
end.
-disk_kbytes(doc) ->
- [];
-disk_kbytes(suite) -> [];
disk_kbytes(Config) when is_list(Config) ->
- ?line [{[?diskKBytes, 1,1], Kbytes}] =
- os_mon_mib:disk_table(get_next,[], [?diskKBytes]),
+ [{[?diskKBytes, 1,1], Kbytes}] =
+ os_mon_mib:disk_table(get_next,[], [?diskKBytes]),
case Kbytes of
- Kbytes when is_integer(Kbytes) ->
- ok;
- _ ->
- ?line test_server:fail(disk_kbytes_value_not_integer)
+ Kbytes when is_integer(Kbytes) ->
+ ok;
+ _ ->
+ ct:fail(disk_kbytes_value_not_integer)
end.
-disk_capacity(doc) ->
- [];
-disk_capacity(suite) -> [];
disk_capacity(Config) when is_list(Config) ->
- ?line [{[?diskCapacity, 1,1], Capacity}] =
- os_mon_mib:disk_table(get_next,[], [?diskCapacity]),
+ [{[?diskCapacity, 1,1], Capacity}] =
+ os_mon_mib:disk_table(get_next,[], [?diskCapacity]),
case Capacity of
- Capacity when is_integer(Capacity) ->
- ok;
- _ ->
- ?line test_server:fail(disk_capacity_value_not_integer)
+ Capacity when is_integer(Capacity) ->
+ ok;
+ _ ->
+ ct:fail(disk_capacity_value_not_integer)
end.
%%---------------------------------------------------------------------
-real_snmp_request(doc) ->
- ["Starts an snmp manager and sends a real snmp-request. i.e. "
- "sends a udp message on the correct format."];
-real_snmp_request(suite) -> [];
+%% Starts an snmp manager and sends a real snmp-request. i.e.
+%% sends a udp message on the correct format.
real_snmp_request(Config) when is_list(Config) ->
NodStr = atom_to_list(node()),
Len = length(NodStr),
{_, _, {Pid, _}} = memsup:get_memory_data(),
PidStr = lists:flatten(io_lib:format("~w", [Pid])),
io:format("FOO: ~p~n", [PidStr]),
- ?line ok = snmp_get([?loadEntry ++
- [?loadLargestErlProcess, Len | NodStr]],
- PidStr),
- ?line ok = snmp_get_next([?loadEntry ++
- [?loadSystemUsedMemory, Len | NodStr]],
- ?loadEntry ++ [?loadSystemUsedMemory + 1, Len
- | NodStr], PidStr),
- ?line ok = snmp_set([?loadEntry ++ [?loadLargestErlProcess, Len | NodStr]],
- s, "<0.101.0>", Config),
+ ok = snmp_get([?loadEntry ++
+ [?loadLargestErlProcess, Len | NodStr]],
+ PidStr),
+ ok = snmp_get_next([?loadEntry ++
+ [?loadSystemUsedMemory, Len | NodStr]],
+ ?loadEntry ++ [?loadSystemUsedMemory + 1, Len
+ | NodStr], PidStr),
+ ok = snmp_set([?loadEntry ++ [?loadLargestErlProcess, Len | NodStr]],
+ s, "<0.101.0>", Config),
ok.
-otp_7441(doc) ->
- ["Starts an snmp manager and requests total memory. Was previously
- integer32 which was errornous on 64 bit machines."];
-otp_7441(suite) ->
- [];
+%% Starts an snmp manager and requests total memory. Was previously
+%% integer32 which was errornous on 64 bit machines.
otp_7441(Config) when is_list(Config) ->
NodStr = atom_to_list(node()),
Len = length(NodStr),
Oids = [Oid|_] = [?loadEntry ++ [?loadSystemTotalMemory, Len | NodStr]],
{noError,0,[#varbind{oid = Oid, variabletype = 'Unsigned32'}]} =
- ct_snmp:get_values(os_mon_mib_test, Oids, snmp_mgr_agent),
+ ct_snmp:get_values(os_mon_mib_test, Oids, snmp_mgr_agent),
ok.
@@ -636,9 +541,8 @@ otp_7441(Config) when is_list(Config) ->
%% Internal functions
%%---------------------------------------------------------------------
start_node() ->
- ?line Pa = filename:dirname(code:which(?MODULE)),
- ?line {ok,Node} = test_server:start_node(testnisse, slave,
- [{args, " -pa " ++ Pa}]),
+ Pa = filename:dirname(code:which(?MODULE)),
+ {ok,Node} = test_server:start_node(testnisse, slave, [{args, " -pa " ++ Pa}]),
Node.
stop_node(Node) ->
@@ -648,27 +552,27 @@ del_dir(Dir) ->
io:format("Deleting: ~s~n",[Dir]),
{ok, Files} = file:list_dir(Dir),
FullPathFiles = lists:map(fun(File) -> filename:join(Dir, File) end,
- Files),
+ Files),
lists:foreach(fun file:delete/1, FullPathFiles),
file:del_dir(Dir).
%%---------------------------------------------------------------------
snmp_get(Oids = [Oid |_], Result) ->
{noError,0,[#varbind{oid = Oid,
- variabletype = 'OCTET STRING',
- value = Result}]} =
- ct_snmp:get_values(os_mon_mib_test, Oids, snmp_mgr_agent),
+ variabletype = 'OCTET STRING',
+ value = Result}]} =
+ ct_snmp:get_values(os_mon_mib_test, Oids, snmp_mgr_agent),
ok.
snmp_get_next(Oids, NextOid, Result) ->
{noError,0,[#varbind{oid = NextOid,
- variabletype = 'OCTET STRING',
- value = Result}]} =
- ct_snmp:get_next_values(os_mon_mib_test, Oids, snmp_mgr_agent),
+ variabletype = 'OCTET STRING',
+ value = Result}]} =
+ ct_snmp:get_next_values(os_mon_mib_test, Oids, snmp_mgr_agent),
ok.
snmp_set(Oid, ValuType, Value, Config) ->
{notWritable, _, _} =
- ct_snmp:set_values(os_mon_mib_test, [{Oid, ValuType, Value}],
- snmp_mgr_agent, Config),
+ ct_snmp:set_values(os_mon_mib_test, [{Oid, ValuType, Value}],
+ snmp_mgr_agent, Config),
ok.
diff --git a/lib/os_mon/test/os_sup_SUITE.erl b/lib/os_mon/test/os_sup_SUITE.erl
index 5857faa0a6..0c1164be41 100644
--- a/lib/os_mon/test/os_sup_SUITE.erl
+++ b/lib/os_mon/test/os_sup_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -21,17 +21,13 @@
-include_lib("common_test/include/ct.hrl").
%% Test server specific exports
--export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]).
+-export([all/0, suite/0]).
-export([init_per_suite/1, end_per_suite/1]).
--export([init_per_testcase/2, end_per_testcase/2]).
%% Test cases
-export([message/1]).
-export([config/1, port/1]).
-%% Default timetrap timeout (set in init_per_testcase)
--define(default_timeout, ?t:minutes(1)).
-
-define(TAG, test_tag).
-define(MFA, {?MODULE, test_mfa, [?TAG]}).
@@ -39,86 +35,64 @@
init_per_suite(Config) when is_list(Config) ->
spawn(fun() -> message_receptor() end),
- ?line application:load(os_mon),
- ?line ok = application:set_env(os_mon, start_os_sup, true),
- ?line ok = application:set_env(os_mon, os_sup_mfa, ?MFA),
- ?line ok = application:set_env(os_mon, os_sup_enable, false),
- ?line ok = application:start(os_mon),
+ application:load(os_mon),
+ ok = application:set_env(os_mon, start_os_sup, true),
+ ok = application:set_env(os_mon, os_sup_mfa, ?MFA),
+ ok = application:set_env(os_mon, os_sup_enable, false),
+ ok = application:start(os_mon),
Config.
end_per_suite(Config) when is_list(Config) ->
- ?line application:stop(os_mon),
- ?line ok = application:set_env(os_mon, start_os_sup, false),
+ application:stop(os_mon),
+ ok = application:set_env(os_mon, start_os_sup, false),
MFA = {os_sup, error_report, [std_error]},
- ?line ok = application:set_env(os_mon, os_sup_mfa, MFA),
- ?line ok = application:set_env(os_mon, os_sup_enable, true),
- ?line exit(whereis(message_receptor), done),
+ ok = application:set_env(os_mon, os_sup_mfa, MFA),
+ ok = application:set_env(os_mon, os_sup_enable, true),
+ exit(whereis(message_receptor), done),
Config.
-init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?default_timeout),
- [{watchdog,Dog} | Config].
-
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
- ok.
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
case test_server:os_type() of
- {unix, sunos} -> [message, config, port];
- {win32, _OSname} -> [message];
- OS ->
- Str = io_lib:format("os_sup not available for ~p",
- [OS]),
- {skip, lists:flatten(Str)}
+ {unix, sunos} -> [message, config, port];
+ {win32, _OSname} -> [message];
+ OS ->
+ Str = io_lib:format("os_sup not available for ~p",
+ [OS]),
+ {skip, lists:flatten(Str)}
end.
-groups() ->
- [].
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-message(suite) ->
- [];
-message(doc) ->
- ["Test OS message handling"];
+%% Test OS message handling
message(Config) when is_list(Config) ->
%% Fake an OS message
Data = "10H11386278426HSystem4HTest5HError5HTesto",
- ?line os_sup_server ! {faked_port, {data, Data}},
+ os_sup_server ! {faked_port, {data, Data}},
%% Check with message_receptor that it has been received
- ?t:sleep(?t:seconds(1)),
+ ct:sleep({seconds,1}),
Msg =
- case ?t:os_type() of
- {unix, sunos} ->
- {?TAG, Data};
- {win32, _} ->
- {?TAG,{{1138,627842,0},"System","Test","Error","Testo"}}
- end,
- ?line message_receptor ! {check, self(), Msg},
+ case ?t:os_type() of
+ {unix, sunos} ->
+ {?TAG, Data};
+ {win32, _} ->
+ {?TAG,{{1138,627842,0},"System","Test","Error","Testo"}}
+ end,
+ message_receptor ! {check, self(), Msg},
receive
- {result, true} ->
- ok;
- {result, Rec} ->
- ?t:fail({no_message, Rec})
+ {result, true} ->
+ ok;
+ {result, Rec} ->
+ ct:fail({no_message, Rec})
end,
ok.
-config(suite) ->
- [];
-config(doc) ->
- ["Test configuration"];
+%% Test configuration
config(Config) when is_list(Config) ->
%% os_sup_enable==true and os_sup_own/os_sup_syslogconf cannot
@@ -130,45 +104,42 @@ config(Config) when is_list(Config) ->
ok.
-port(suite) ->
- [];
-port(doc) ->
- ["Test that os_sup handles a terminating port program"];
+%% Test that os_sup handles a terminating port program
port(Config) when is_list(Config) ->
- ?line Str = os:cmd("ps -e | grep '[f]errule'"),
+ Str = os:cmd("ps -e | grep '[f]errule'"),
case io_lib:fread("~s", Str) of
- {ok, [Pid], _Rest} ->
-
- %% Monitor os_sup_server
- ?line MonRef = erlang:monitor(process, os_sup_server),
-
- %% Kill the port program
- case os:cmd("kill -9 " ++ Pid) of
- [] ->
-
- %% os_sup_server should now terminate
- receive
- {'DOWN', MonRef, _, _, {port_died, _Reason}} ->
- ok;
- {'DOWN', MonRef, _, _, Reason} ->
- ?line ?t:fail({unexpected_exit_reason, Reason})
- after
- 3000 ->
- ?line ?t:fail(still_alive)
- end,
-
- %% Give os_mon_sup time to restart os_sup
- ?t:sleep(?t:seconds(3)),
- ?line true = is_pid(whereis(os_sup_server)),
-
- ok;
-
- Line ->
- erlang:demonitor(MonRef),
- {skip, {not_killed, Line}}
- end;
- _ ->
- {skip, {os_pid_not_found}}
+ {ok, [Pid], _Rest} ->
+
+ %% Monitor os_sup_server
+ MonRef = erlang:monitor(process, os_sup_server),
+
+ %% Kill the port program
+ case os:cmd("kill -9 " ++ Pid) of
+ [] ->
+
+ %% os_sup_server should now terminate
+ receive
+ {'DOWN', MonRef, _, _, {port_died, _Reason}} ->
+ ok;
+ {'DOWN', MonRef, _, _, Reason} ->
+ ct:fail({unexpected_exit_reason, Reason})
+ after
+ 3000 ->
+ ct:fail(still_alive)
+ end,
+
+ %% Give os_mon_sup time to restart os_sup
+ ct:sleep({seconds,3}),
+ true = is_pid(whereis(os_sup_server)),
+
+ ok;
+
+ Line ->
+ erlang:demonitor(MonRef),
+ {skip, {not_killed, Line}}
+ end;
+ _ ->
+ {skip, {os_pid_not_found}}
end.
%%----------------------------------------------------------------------
@@ -184,18 +155,18 @@ message_receptor() ->
message_receptor(Received) ->
receive
- %% Check if a certain message has been received
- {check, From, Msg} ->
- case lists:member(Msg, Received) of
- true ->
- From ! {result, true},
- message_receptor(lists:delete(Msg, Received));
- false ->
- From ! {result, Received},
- message_receptor(Received)
- end;
-
- %% Save all other messages
- Msg ->
- message_receptor([Msg|Received])
+ %% Check if a certain message has been received
+ {check, From, Msg} ->
+ case lists:member(Msg, Received) of
+ true ->
+ From ! {result, true},
+ message_receptor(lists:delete(Msg, Received));
+ false ->
+ From ! {result, Received},
+ message_receptor(Received)
+ end;
+
+ %% Save all other messages
+ Msg ->
+ message_receptor([Msg|Received])
end.
diff --git a/lib/otp_mibs/Makefile b/lib/otp_mibs/Makefile
index 2dfab524fd..64bd683c7a 100644
--- a/lib/otp_mibs/Makefile
+++ b/lib/otp_mibs/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2009. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/otp_mibs/doc/src/Makefile b/lib/otp_mibs/doc/src/Makefile
index 3f9d8cc004..62698b9300 100644
--- a/lib/otp_mibs/doc/src/Makefile
+++ b/lib/otp_mibs/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2012. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/otp_mibs/doc/src/book.xml b/lib/otp_mibs/doc/src/book.xml
index 1c3a3fdea4..482da46876 100644
--- a/lib/otp_mibs/doc/src/book.xml
+++ b/lib/otp_mibs/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/otp_mibs/doc/src/introduction.xml b/lib/otp_mibs/doc/src/introduction.xml
index 4236e45aae..7046cbb8ae 100644
--- a/lib/otp_mibs/doc/src/introduction.xml
+++ b/lib/otp_mibs/doc/src/introduction.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/otp_mibs/doc/src/mibs.xml b/lib/otp_mibs/doc/src/mibs.xml
index 11900d3399..a32d5ea5f5 100644
--- a/lib/otp_mibs/doc/src/mibs.xml
+++ b/lib/otp_mibs/doc/src/mibs.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/otp_mibs/doc/src/notes.xml b/lib/otp_mibs/doc/src/notes.xml
index 5dd112e937..7beac5ffcb 100644
--- a/lib/otp_mibs/doc/src/notes.xml
+++ b/lib/otp_mibs/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/otp_mibs/doc/src/otp_mib.xml b/lib/otp_mibs/doc/src/otp_mib.xml
index bf9c474ec4..681ce9fa2d 100644
--- a/lib/otp_mibs/doc/src/otp_mib.xml
+++ b/lib/otp_mibs/doc/src/otp_mib.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/otp_mibs/doc/src/part.xml b/lib/otp_mibs/doc/src/part.xml
index c03254f96e..0a8ddce268 100644
--- a/lib/otp_mibs/doc/src/part.xml
+++ b/lib/otp_mibs/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/otp_mibs/doc/src/part_notes.xml b/lib/otp_mibs/doc/src/part_notes.xml
index be65d59fdb..5c03d28720 100644
--- a/lib/otp_mibs/doc/src/part_notes.xml
+++ b/lib/otp_mibs/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/otp_mibs/doc/src/ref_man.xml b/lib/otp_mibs/doc/src/ref_man.xml
index 52576b160b..06c5aadcd9 100644
--- a/lib/otp_mibs/doc/src/ref_man.xml
+++ b/lib/otp_mibs/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/otp_mibs/mibs/Makefile b/lib/otp_mibs/mibs/Makefile
index 01333dcac4..11d790d014 100644
--- a/lib/otp_mibs/mibs/Makefile
+++ b/lib/otp_mibs/mibs/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/otp_mibs/mibs/OTP-EVA-MIB.mib b/lib/otp_mibs/mibs/OTP-EVA-MIB.mib
index 24031478dc..4d0c53ed95 100644
--- a/lib/otp_mibs/mibs/OTP-EVA-MIB.mib
+++ b/lib/otp_mibs/mibs/OTP-EVA-MIB.mib
@@ -1,7 +1,7 @@
--
-- %CopyrightBegin%
--
--- Copyright Ericsson AB 2004-2009. All Rights Reserved.
+-- Copyright Ericsson AB 2004-2016. All Rights Reserved.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
diff --git a/lib/otp_mibs/mibs/OTP-MIB.mib b/lib/otp_mibs/mibs/OTP-MIB.mib
index 8d7d920765..693319eae4 100644
--- a/lib/otp_mibs/mibs/OTP-MIB.mib
+++ b/lib/otp_mibs/mibs/OTP-MIB.mib
@@ -1,7 +1,7 @@
--
-- %CopyrightBegin%
--
--- Copyright Ericsson AB 1996-2009. All Rights Reserved.
+-- Copyright Ericsson AB 1996-2016. All Rights Reserved.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
diff --git a/lib/otp_mibs/mibs/OTP-REG.mib b/lib/otp_mibs/mibs/OTP-REG.mib
index 68b4ee3882..bf1585061c 100644
--- a/lib/otp_mibs/mibs/OTP-REG.mib
+++ b/lib/otp_mibs/mibs/OTP-REG.mib
@@ -1,7 +1,7 @@
--
-- %CopyrightBegin%
--
--- Copyright Ericsson AB 1997-2009. All Rights Reserved.
+-- Copyright Ericsson AB 1997-2016. All Rights Reserved.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
diff --git a/lib/otp_mibs/mibs/OTP-TC.mib b/lib/otp_mibs/mibs/OTP-TC.mib
index ca7625f9e2..efe5451f0c 100644
--- a/lib/otp_mibs/mibs/OTP-TC.mib
+++ b/lib/otp_mibs/mibs/OTP-TC.mib
@@ -1,7 +1,7 @@
--
-- %CopyrightBegin%
--
--- Copyright Ericsson AB 1997-2009. All Rights Reserved.
+-- Copyright Ericsson AB 1997-2016. All Rights Reserved.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
diff --git a/lib/otp_mibs/src/Makefile b/lib/otp_mibs/src/Makefile
index 03892cd43d..4023f50d48 100644
--- a/lib/otp_mibs/src/Makefile
+++ b/lib/otp_mibs/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2012. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/otp_mibs/src/otp_mib.erl b/lib/otp_mibs/src/otp_mib.erl
index bd814e01e0..1431818be4 100644
--- a/lib/otp_mibs/src/otp_mib.erl
+++ b/lib/otp_mibs/src/otp_mib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/otp_mibs/src/otp_mibs.app.src b/lib/otp_mibs/src/otp_mibs.app.src
index f4eb34d627..75ef25c366 100644
--- a/lib/otp_mibs/src/otp_mibs.app.src
+++ b/lib/otp_mibs/src/otp_mibs.app.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/otp_mibs/src/otp_mibs.appup.src b/lib/otp_mibs/src/otp_mibs.appup.src
index 6b8fe71775..9437ae2222 100644
--- a/lib/otp_mibs/src/otp_mibs.appup.src
+++ b/lib/otp_mibs/src/otp_mibs.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/otp_mibs/test/Makefile b/lib/otp_mibs/test/Makefile
index 18d7e915db..9736cf8bce 100644
--- a/lib/otp_mibs/test/Makefile
+++ b/lib/otp_mibs/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/otp_mibs/test/otp_mibs_SUITE.erl b/lib/otp_mibs/test/otp_mibs_SUITE.erl
index 4d1eb155cd..cb3cd28200 100644
--- a/lib/otp_mibs/test/otp_mibs_SUITE.erl
+++ b/lib/otp_mibs/test/otp_mibs_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/parsetools/Makefile b/lib/parsetools/Makefile
index 8397c2550d..e9de5c43cb 100644
--- a/lib/parsetools/Makefile
+++ b/lib/parsetools/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/parsetools/doc/src/Makefile b/lib/parsetools/doc/src/Makefile
index 97157d99e5..8b03ed0fc7 100644
--- a/lib/parsetools/doc/src/Makefile
+++ b/lib/parsetools/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/parsetools/doc/src/book.xml b/lib/parsetools/doc/src/book.xml
index 0853d2fdb3..f37c352c78 100644
--- a/lib/parsetools/doc/src/book.xml
+++ b/lib/parsetools/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/parsetools/doc/src/leex.xml b/lib/parsetools/doc/src/leex.xml
index 85680f58a6..29d546105f 100644
--- a/lib/parsetools/doc/src/leex.xml
+++ b/lib/parsetools/doc/src/leex.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2009</year><year>2013</year>
+ <year>2009</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/parsetools/doc/src/notes.xml b/lib/parsetools/doc/src/notes.xml
index 43840a3bc7..06d66e28c3 100644
--- a/lib/parsetools/doc/src/notes.xml
+++ b/lib/parsetools/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/parsetools/doc/src/notes_history.xml b/lib/parsetools/doc/src/notes_history.xml
index 2008a7c3e6..311711becf 100644
--- a/lib/parsetools/doc/src/notes_history.xml
+++ b/lib/parsetools/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/parsetools/doc/src/part_notes.xml b/lib/parsetools/doc/src/part_notes.xml
index 4164e7cc24..5e0824e839 100644
--- a/lib/parsetools/doc/src/part_notes.xml
+++ b/lib/parsetools/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/parsetools/doc/src/ref_man.xml b/lib/parsetools/doc/src/ref_man.xml
index 0b9c6f3a29..a06221250f 100644
--- a/lib/parsetools/doc/src/ref_man.xml
+++ b/lib/parsetools/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/parsetools/doc/src/yecc.xml b/lib/parsetools/doc/src/yecc.xml
index 87fdfcdaef..6ec9fb5f0e 100644
--- a/lib/parsetools/doc/src/yecc.xml
+++ b/lib/parsetools/doc/src/yecc.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/parsetools/src/Makefile b/lib/parsetools/src/Makefile
index dbecdd24a5..dea29bee4c 100644
--- a/lib/parsetools/src/Makefile
+++ b/lib/parsetools/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2013. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/parsetools/src/parsetools.appup.src b/lib/parsetools/src/parsetools.appup.src
index 96df029f96..023e9324d1 100644
--- a/lib/parsetools/src/parsetools.appup.src
+++ b/lib/parsetools/src/parsetools.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/parsetools/src/yecc.erl b/lib/parsetools/src/yecc.erl
index 9d00675931..1b426141a1 100644
--- a/lib/parsetools/src/yecc.erl
+++ b/lib/parsetools/src/yecc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/parsetools/src/yeccscan.erl b/lib/parsetools/src/yeccscan.erl
index 56e2e5d3f4..6dbf6872bc 100644
--- a/lib/parsetools/src/yeccscan.erl
+++ b/lib/parsetools/src/yeccscan.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/parsetools/test/Makefile b/lib/parsetools/test/Makefile
index 75f9624fd5..046b29067b 100644
--- a/lib/parsetools/test/Makefile
+++ b/lib/parsetools/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2012. All Rights Reserved.
+# Copyright Ericsson AB 2005-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/parsetools/test/leex_SUITE.erl b/lib/parsetools/test/leex_SUITE.erl
index f5ff32c358..949ef3c36e 100644
--- a/lib/parsetools/test/leex_SUITE.erl
+++ b/lib/parsetools/test/leex_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/parsetools/test/yecc_SUITE.erl b/lib/parsetools/test/yecc_SUITE.erl
index a1bb5eb16c..3710569aba 100644
--- a/lib/parsetools/test/yecc_SUITE.erl
+++ b/lib/parsetools/test/yecc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/Makefile b/lib/percept/Makefile
index 2c6a970574..1f51bd2fef 100644
--- a/lib/percept/Makefile
+++ b/lib/percept/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2009. All Rights Reserved.
+# Copyright Ericsson AB 2007-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/percept/doc/src/Makefile b/lib/percept/doc/src/Makefile
index 604c6d1db1..2f84d61cbc 100644
--- a/lib/percept/doc/src/Makefile
+++ b/lib/percept/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2012. All Rights Reserved.
+# Copyright Ericsson AB 2007-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/percept/doc/src/book.xml b/lib/percept/doc/src/book.xml
index 1f12d57892..5acba1f214 100644
--- a/lib/percept/doc/src/book.xml
+++ b/lib/percept/doc/src/book.xml
@@ -5,7 +5,7 @@
<header titlestyle="normal">
<copyright>
<year>2007</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/percept/doc/src/egd_ug.xmlsrc b/lib/percept/doc/src/egd_ug.xmlsrc
index 253bfcaeb5..563780aa66 100644
--- a/lib/percept/doc/src/egd_ug.xmlsrc
+++ b/lib/percept/doc/src/egd_ug.xmlsrc
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2007</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/percept/doc/src/notes.xml b/lib/percept/doc/src/notes.xml
index 74183eb251..750dcb6cf5 100644
--- a/lib/percept/doc/src/notes.xml
+++ b/lib/percept/doc/src/notes.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2007</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/percept/doc/src/part.xml b/lib/percept/doc/src/part.xml
index 135532a9e6..277d89d45c 100644
--- a/lib/percept/doc/src/part.xml
+++ b/lib/percept/doc/src/part.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2007</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/percept/doc/src/part_notes.xml b/lib/percept/doc/src/part_notes.xml
index 458b5d3ea3..f428b4fd81 100644
--- a/lib/percept/doc/src/part_notes.xml
+++ b/lib/percept/doc/src/part_notes.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2007</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/percept/doc/src/percept_ug.xmlsrc b/lib/percept/doc/src/percept_ug.xmlsrc
index 4791deea22..0d243cdabe 100644
--- a/lib/percept/doc/src/percept_ug.xmlsrc
+++ b/lib/percept/doc/src/percept_ug.xmlsrc
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2007</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/percept/doc/src/ref_man.xml b/lib/percept/doc/src/ref_man.xml
index b95fc56973..143312489b 100644
--- a/lib/percept/doc/src/ref_man.xml
+++ b/lib/percept/doc/src/ref_man.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2007</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/percept/doc/stylesheet.css b/lib/percept/doc/stylesheet.css
index 86280a8fc4..24d8a02145 100644
--- a/lib/percept/doc/stylesheet.css
+++ b/lib/percept/doc/stylesheet.css
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2007-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/percept/priv/Makefile b/lib/percept/priv/Makefile
index 44229c9567..a1912edfc0 100644
--- a/lib/percept/priv/Makefile
+++ b/lib/percept/priv/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2012. All Rights Reserved.
+# Copyright Ericsson AB 2007-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/percept/priv/server_root/css/percept.css b/lib/percept/priv/server_root/css/percept.css
index 7335e62387..2d0734b6b6 100644
--- a/lib/percept/priv/server_root/css/percept.css
+++ b/lib/percept/priv/server_root/css/percept.css
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2007-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/percept/priv/server_root/htdocs/index.html b/lib/percept/priv/server_root/htdocs/index.html
index e84d8fb10a..f7322cba89 100644
--- a/lib/percept/priv/server_root/htdocs/index.html
+++ b/lib/percept/priv/server_root/htdocs/index.html
@@ -1,7 +1,7 @@
<!--
%CopyrightBegin%
- Copyright Ericsson AB 2007-2009. All Rights Reserved.
+ Copyright Ericsson AB 2007-2016. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/lib/percept/priv/server_root/scripts/percept_area_select.js b/lib/percept/priv/server_root/scripts/percept_area_select.js
index 6dd64650be..83fbb02c92 100644
--- a/lib/percept/priv/server_root/scripts/percept_area_select.js
+++ b/lib/percept/priv/server_root/scripts/percept_area_select.js
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2007-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/percept/priv/server_root/scripts/percept_error_handler.js b/lib/percept/priv/server_root/scripts/percept_error_handler.js
index 8bad57a5b7..dad8f2b566 100644
--- a/lib/percept/priv/server_root/scripts/percept_error_handler.js
+++ b/lib/percept/priv/server_root/scripts/percept_error_handler.js
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2007-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/percept/priv/server_root/scripts/percept_select_all.js b/lib/percept/priv/server_root/scripts/percept_select_all.js
index 118741b7de..c8eb966059 100644
--- a/lib/percept/priv/server_root/scripts/percept_select_all.js
+++ b/lib/percept/priv/server_root/scripts/percept_select_all.js
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2007-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/percept/src/Makefile b/lib/percept/src/Makefile
index 9b963e0fae..b2ec87d08c 100644
--- a/lib/percept/src/Makefile
+++ b/lib/percept/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2012. All Rights Reserved.
+# Copyright Ericsson AB 2007-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/percept/src/egd.erl b/lib/percept/src/egd.erl
index 3a065c8919..d57b7bb81d 100644
--- a/lib/percept/src/egd.erl
+++ b/lib/percept/src/egd.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/src/egd.hrl b/lib/percept/src/egd.hrl
index 43db16d3a1..1b125d3a08 100644
--- a/lib/percept/src/egd.hrl
+++ b/lib/percept/src/egd.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/src/egd_font.erl b/lib/percept/src/egd_font.erl
index 6ee3728fde..95203d5441 100644
--- a/lib/percept/src/egd_font.erl
+++ b/lib/percept/src/egd_font.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/src/egd_png.erl b/lib/percept/src/egd_png.erl
index c576d569a9..fe660513b4 100644
--- a/lib/percept/src/egd_png.erl
+++ b/lib/percept/src/egd_png.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/src/egd_primitives.erl b/lib/percept/src/egd_primitives.erl
index 0a3a62c05c..7b6e15efe7 100644
--- a/lib/percept/src/egd_primitives.erl
+++ b/lib/percept/src/egd_primitives.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/src/egd_render.erl b/lib/percept/src/egd_render.erl
index 4297704677..8ee41b66ab 100644
--- a/lib/percept/src/egd_render.erl
+++ b/lib/percept/src/egd_render.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/src/percept.app.src b/lib/percept/src/percept.app.src
index 6a3800a17f..1749730f97 100644
--- a/lib/percept/src/percept.app.src
+++ b/lib/percept/src/percept.app.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/src/percept.appup.src b/lib/percept/src/percept.appup.src
index cb4995b0d8..3ccdf8db2b 100644
--- a/lib/percept/src/percept.appup.src
+++ b/lib/percept/src/percept.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/src/percept.erl b/lib/percept/src/percept.erl
index f1a2002c9d..24ddf1bd14 100644
--- a/lib/percept/src/percept.erl
+++ b/lib/percept/src/percept.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/src/percept.hrl b/lib/percept/src/percept.hrl
index a5639cfaf8..58926cd1b4 100644
--- a/lib/percept/src/percept.hrl
+++ b/lib/percept/src/percept.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/src/percept_analyzer.erl b/lib/percept/src/percept_analyzer.erl
index 69338f52af..f38d026905 100644
--- a/lib/percept/src/percept_analyzer.erl
+++ b/lib/percept/src/percept_analyzer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/src/percept_db.erl b/lib/percept/src/percept_db.erl
index b627c67acd..6c2dddccac 100644
--- a/lib/percept/src/percept_db.erl
+++ b/lib/percept/src/percept_db.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/src/percept_graph.erl b/lib/percept/src/percept_graph.erl
index 8ad7fd1bf6..1803e035ab 100644
--- a/lib/percept/src/percept_graph.erl
+++ b/lib/percept/src/percept_graph.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/src/percept_html.erl b/lib/percept/src/percept_html.erl
index ea7484ae70..a8eb29b741 100644
--- a/lib/percept/src/percept_html.erl
+++ b/lib/percept/src/percept_html.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/src/percept_image.erl b/lib/percept/src/percept_image.erl
index f649439d7a..e819938027 100644
--- a/lib/percept/src/percept_image.erl
+++ b/lib/percept/src/percept_image.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/test/Makefile b/lib/percept/test/Makefile
index 6891de832d..87fde49410 100644
--- a/lib/percept/test/Makefile
+++ b/lib/percept/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2012. All Rights Reserved.
+# Copyright Ericsson AB 2007-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/percept/test/egd_SUITE.erl b/lib/percept/test/egd_SUITE.erl
index 6df7ed74c0..3562ceae88 100644
--- a/lib/percept/test/egd_SUITE.erl
+++ b/lib/percept/test/egd_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/test/percept_SUITE.erl b/lib/percept/test/percept_SUITE.erl
index 141035c631..fbc77302ae 100644
--- a/lib/percept/test/percept_SUITE.erl
+++ b/lib/percept/test/percept_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/percept/test/percept_db_SUITE.erl b/lib/percept/test/percept_db_SUITE.erl
index c1d711060c..b2827e0e42 100644
--- a/lib/percept/test/percept_db_SUITE.erl
+++ b/lib/percept/test/percept_db_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/public_key/Makefile b/lib/public_key/Makefile
index d1b6035139..7a5c1c1443 100644
--- a/lib/public_key/Makefile
+++ b/lib/public_key/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2009. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/public_key/asn1/Makefile b/lib/public_key/asn1/Makefile
index 7474297b9b..a920ea87ea 100644
--- a/lib/public_key/asn1/Makefile
+++ b/lib/public_key/asn1/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2012. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/public_key/doc/src/Makefile b/lib/public_key/doc/src/Makefile
index 3918c005f2..f3db24afc9 100644
--- a/lib/public_key/doc/src/Makefile
+++ b/lib/public_key/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2012. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/public_key/doc/src/book.xml b/lib/public_key/doc/src/book.xml
index d148bc0211..531f131743 100644
--- a/lib/public_key/doc/src/book.xml
+++ b/lib/public_key/doc/src/book.xml
@@ -5,7 +5,7 @@
<header titlestyle="normal">
<copyright>
<year>2008</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/public_key/doc/src/notes.xml b/lib/public_key/doc/src/notes.xml
index da8f62e2f8..49b2ba0326 100644
--- a/lib/public_key/doc/src/notes.xml
+++ b/lib/public_key/doc/src/notes.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2008</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/public_key/doc/src/part.xml b/lib/public_key/doc/src/part.xml
index 8e5b3e9147..a6f5dd27c5 100644
--- a/lib/public_key/doc/src/part.xml
+++ b/lib/public_key/doc/src/part.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2008</year>
- <year>2014</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/public_key/doc/src/part_notes.xml b/lib/public_key/doc/src/part_notes.xml
index 0665581474..17f06d14f5 100644
--- a/lib/public_key/doc/src/part_notes.xml
+++ b/lib/public_key/doc/src/part_notes.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2008</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/public_key/doc/src/public_key.xml b/lib/public_key/doc/src/public_key.xml
index 6923066da7..04daee460f 100644
--- a/lib/public_key/doc/src/public_key.xml
+++ b/lib/public_key/doc/src/public_key.xml
@@ -118,7 +118,7 @@
<p><c> not_encrypted | cipher_info()}</c></p></item>
<tag><c>cipher_info() = </c></tag>
- <item><p><c>{"RC2-CBC" | "DES-CBC" | "DES-EDE3-CBC", crypto:rand_bytes(8)</c></p>
+ <item><p><c>{"RC2-CBC" | "DES-CBC" | "DES-EDE3-CBC", crypto:strong_rand_bytes(8)</c></p>
<p><c>| {#'PBEParameter{}, digest_type()} | #'PBES2-params'{}}</c></p>
</item>
diff --git a/lib/public_key/doc/src/ref_man.xml b/lib/public_key/doc/src/ref_man.xml
index b3823e1dc3..75c5374257 100644
--- a/lib/public_key/doc/src/ref_man.xml
+++ b/lib/public_key/doc/src/ref_man.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2008</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/public_key/doc/src/using_public_key.xml b/lib/public_key/doc/src/using_public_key.xml
index d03c05d773..e3a1eed4be 100644
--- a/lib/public_key/doc/src/using_public_key.xml
+++ b/lib/public_key/doc/src/using_public_key.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2011</year><year>2013</year>
+ <year>2011</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -124,7 +124,7 @@
...&gt;&gt;,
not_encrypted},
{'Certificate',&lt;&lt;48,130,3,200,48,130,3,49,160,3,2,1,2,2,1,
- 1,48,13,6,9,42,134,72,134,247,...&gt;&gt;>,
+ 1,48,13,6,9,42,134,72,134,247,...&gt;&gt;,
not_encrypted}]</code>
<p>Certificates can be decoded as usual:</p>
diff --git a/lib/public_key/include/public_key.hrl b/lib/public_key/include/public_key.hrl
index d20f7b207e..a1e7dd31bc 100644
--- a/lib/public_key/include/public_key.hrl
+++ b/lib/public_key/include/public_key.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/public_key/src/Makefile b/lib/public_key/src/Makefile
index 786f244f85..e61390bce3 100644
--- a/lib/public_key/src/Makefile
+++ b/lib/public_key/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2013. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/public_key/src/pubkey_cert.erl b/lib/public_key/src/pubkey_cert.erl
index e67850cf54..c5e6ffded5 100644
--- a/lib/public_key/src/pubkey_cert.erl
+++ b/lib/public_key/src/pubkey_cert.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/public_key/src/pubkey_cert_records.erl b/lib/public_key/src/pubkey_cert_records.erl
index 70ec3d5306..6a80874df8 100644
--- a/lib/public_key/src/pubkey_cert_records.erl
+++ b/lib/public_key/src/pubkey_cert_records.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/public_key/src/pubkey_crl.erl b/lib/public_key/src/pubkey_crl.erl
index eee4beb7d6..33bef91827 100644
--- a/lib/public_key/src/pubkey_crl.erl
+++ b/lib/public_key/src/pubkey_crl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/public_key/src/pubkey_pbe.erl b/lib/public_key/src/pubkey_pbe.erl
index 2f6b121e83..0243bcaa82 100644
--- a/lib/public_key/src/pubkey_pbe.erl
+++ b/lib/public_key/src/pubkey_pbe.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/public_key/src/pubkey_pem.erl b/lib/public_key/src/pubkey_pem.erl
index d163004c7c..06a4455b3f 100644
--- a/lib/public_key/src/pubkey_pem.erl
+++ b/lib/public_key/src/pubkey_pem.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/public_key/src/pubkey_ssh.erl b/lib/public_key/src/pubkey_ssh.erl
index 9b281aa482..90726b1eb3 100644
--- a/lib/public_key/src/pubkey_ssh.erl
+++ b/lib/public_key/src/pubkey_ssh.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/public_key/src/public_key.appup.src b/lib/public_key/src/public_key.appup.src
index f39e7140e6..7f3b0b3de8 100644
--- a/lib/public_key/src/public_key.appup.src
+++ b/lib/public_key/src/public_key.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/public_key/test/Makefile b/lib/public_key/test/Makefile
index a71004eb0d..b9beb6d3b9 100644
--- a/lib/public_key/test/Makefile
+++ b/lib/public_key/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2012. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/public_key/test/erl_make_certs.erl b/lib/public_key/test/erl_make_certs.erl
index 2039745f2b..3dab70784c 100644
--- a/lib/public_key/test/erl_make_certs.erl
+++ b/lib/public_key/test/erl_make_certs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/public_key/test/pbe_SUITE.erl b/lib/public_key/test/pbe_SUITE.erl
index 5e4720563f..4b7ebf4309 100644
--- a/lib/public_key/test/pbe_SUITE.erl
+++ b/lib/public_key/test/pbe_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/public_key/test/pkits_SUITE.erl b/lib/public_key/test/pkits_SUITE.erl
index 06dfce5018..17be99b52d 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-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl
index 2fbccbfaa7..51050c4480 100644
--- a/lib/public_key/test/public_key_SUITE.erl
+++ b/lib/public_key/test/public_key_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -199,7 +199,7 @@ encrypted_pem(Config) when is_list(Config) ->
RSAKey = public_key:der_decode('RSAPrivateKey', DerRSAKey),
- Salt0 = crypto:rand_bytes(8),
+ Salt0 = crypto:strong_rand_bytes(8),
Entry0 = public_key:pem_entry_encode('RSAPrivateKey', RSAKey,
{{"DES-EDE3-CBC", Salt0}, "1234abcd"}),
RSAKey = public_key:pem_entry_decode(Entry0,"1234abcd"),
@@ -208,7 +208,7 @@ encrypted_pem(Config) when is_list(Config) ->
[{'RSAPrivateKey', _, {"DES-EDE3-CBC", Salt0}}] =
erl_make_certs:pem_to_der(Des3KeyFile),
- Salt1 = crypto:rand_bytes(8),
+ Salt1 = crypto:strong_rand_bytes(8),
Entry1 = public_key:pem_entry_encode('RSAPrivateKey', RSAKey,
{{"DES-CBC", Salt1}, "4567efgh"}),
DesKeyFile = filename:join(Datadir, "des_client_key.pem"),
diff --git a/lib/reltool/Makefile b/lib/reltool/Makefile
index 6732f52d15..4b6aad07b3 100644
--- a/lib/reltool/Makefile
+++ b/lib/reltool/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/reltool/bin/reltool.escript b/lib/reltool/bin/reltool.escript
index dd8f931251..f02a901c7b 100755
--- a/lib/reltool/bin/reltool.escript
+++ b/lib/reltool/bin/reltool.escript
@@ -3,7 +3,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/doc/src/Makefile b/lib/reltool/doc/src/Makefile
index b019c25080..e378cdf980 100644
--- a/lib/reltool/doc/src/Makefile
+++ b/lib/reltool/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/reltool/doc/src/book.xml b/lib/reltool/doc/src/book.xml
index c6bbef3655..b1d9e43b28 100644
--- a/lib/reltool/doc/src/book.xml
+++ b/lib/reltool/doc/src/book.xml
@@ -5,7 +5,7 @@
<header titlestyle="normal">
<copyright>
<year>2009</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/reltool/doc/src/files.mk b/lib/reltool/doc/src/files.mk
index b61707e8fe..efd7d8f09c 100644
--- a/lib/reltool/doc/src/files.mk
+++ b/lib/reltool/doc/src/files.mk
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2010. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/reltool/doc/src/notes.xml b/lib/reltool/doc/src/notes.xml
index 745185af27..082079aa74 100644
--- a/lib/reltool/doc/src/notes.xml
+++ b/lib/reltool/doc/src/notes.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2009</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/reltool/doc/src/part.xml b/lib/reltool/doc/src/part.xml
index 029c35dc0c..5904084879 100644
--- a/lib/reltool/doc/src/part.xml
+++ b/lib/reltool/doc/src/part.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2009</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/reltool/doc/src/ref_man.xml b/lib/reltool/doc/src/ref_man.xml
index 17bc76b841..38f270b79a 100644
--- a/lib/reltool/doc/src/ref_man.xml
+++ b/lib/reltool/doc/src/ref_man.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2009</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/reltool/doc/src/reltool.xml b/lib/reltool/doc/src/reltool.xml
index 82a410e3e7..f4effc3f2e 100644
--- a/lib/reltool/doc/src/reltool.xml
+++ b/lib/reltool/doc/src/reltool.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2009</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/reltool/doc/src/reltool_examples.xml b/lib/reltool/doc/src/reltool_examples.xml
index 6c28674a69..f735d914ea 100644
--- a/lib/reltool/doc/src/reltool_examples.xml
+++ b/lib/reltool/doc/src/reltool_examples.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2009</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/reltool/doc/src/reltool_intro.xml b/lib/reltool/doc/src/reltool_intro.xml
index e72b9029b1..8e232b8838 100644
--- a/lib/reltool/doc/src/reltool_intro.xml
+++ b/lib/reltool/doc/src/reltool_intro.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2009</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/reltool/doc/src/reltool_usage.xml b/lib/reltool/doc/src/reltool_usage.xml
index 2adef96073..743d5fa366 100644
--- a/lib/reltool/doc/src/reltool_usage.xml
+++ b/lib/reltool/doc/src/reltool_usage.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2009</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/reltool/examples/Makefile b/lib/reltool/examples/Makefile
index 5f2d97b439..cc29c88ba3 100644
--- a/lib/reltool/examples/Makefile
+++ b/lib/reltool/examples/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/reltool/src/Makefile b/lib/reltool/src/Makefile
index 1fea41550c..4bddee4664 100644
--- a/lib/reltool/src/Makefile
+++ b/lib/reltool/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2013. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/reltool/src/files.mk b/lib/reltool/src/files.mk
index a7ef5d05e2..6354b51022 100644
--- a/lib/reltool/src/files.mk
+++ b/lib/reltool/src/files.mk
@@ -1,7 +1,7 @@
#-*-makefile-*- ; force emacs to enter makefile-mode
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010. All Rights Reserved.
+# Copyright Ericsson AB 2010-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/reltool/src/reltool.app.src b/lib/reltool/src/reltool.app.src
index 8aef4c1dbb..90f93d2901 100644
--- a/lib/reltool/src/reltool.app.src
+++ b/lib/reltool/src/reltool.app.src
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/src/reltool.appup.src b/lib/reltool/src/reltool.appup.src
index bcd84183ba..52c38e5cbb 100644
--- a/lib/reltool/src/reltool.appup.src
+++ b/lib/reltool/src/reltool.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/src/reltool.erl b/lib/reltool/src/reltool.erl
index 269b44b709..f6ce5578bc 100644
--- a/lib/reltool/src/reltool.erl
+++ b/lib/reltool/src/reltool.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/src/reltool_app_win.erl b/lib/reltool/src/reltool_app_win.erl
index 5c623c2835..468ba297bb 100644
--- a/lib/reltool/src/reltool_app_win.erl
+++ b/lib/reltool/src/reltool_app_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/src/reltool_fgraph.erl b/lib/reltool/src/reltool_fgraph.erl
index afdbe78c19..06be5c3701 100644
--- a/lib/reltool/src/reltool_fgraph.erl
+++ b/lib/reltool/src/reltool_fgraph.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/src/reltool_fgraph.hrl b/lib/reltool/src/reltool_fgraph.hrl
index 6056ccbd02..c3e85159bf 100644
--- a/lib/reltool/src/reltool_fgraph.hrl
+++ b/lib/reltool/src/reltool_fgraph.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/src/reltool_fgraph_win.erl b/lib/reltool/src/reltool_fgraph_win.erl
index deab502bfe..915330794c 100644
--- a/lib/reltool/src/reltool_fgraph_win.erl
+++ b/lib/reltool/src/reltool_fgraph_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/src/reltool_mod_win.erl b/lib/reltool/src/reltool_mod_win.erl
index 1788841ae7..8cd63bdda1 100644
--- a/lib/reltool/src/reltool_mod_win.erl
+++ b/lib/reltool/src/reltool_mod_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/src/reltool_server.erl b/lib/reltool/src/reltool_server.erl
index 1f0e5bc476..21a4485f94 100644
--- a/lib/reltool/src/reltool_server.erl
+++ b/lib/reltool/src/reltool_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/src/reltool_sys_win.erl b/lib/reltool/src/reltool_sys_win.erl
index 03f206ef64..ba0d90ef5f 100644
--- a/lib/reltool/src/reltool_sys_win.erl
+++ b/lib/reltool/src/reltool_sys_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/src/reltool_target.erl b/lib/reltool/src/reltool_target.erl
index 0728398db3..1615a3e9b7 100644
--- a/lib/reltool/src/reltool_target.erl
+++ b/lib/reltool/src/reltool_target.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/src/reltool_utils.erl b/lib/reltool/src/reltool_utils.erl
index 1879e77a54..60edc9f3ca 100644
--- a/lib/reltool/src/reltool_utils.erl
+++ b/lib/reltool/src/reltool_utils.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/test/Makefile b/lib/reltool/test/Makefile
index ccb3d7dc55..838e9a34f6 100644
--- a/lib/reltool/test/Makefile
+++ b/lib/reltool/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/reltool/test/reltool_app_SUITE.erl b/lib/reltool/test/reltool_app_SUITE.erl
index 35971a9a3c..18c74bea6c 100644
--- a/lib/reltool/test/reltool_app_SUITE.erl
+++ b/lib/reltool/test/reltool_app_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/test/reltool_manual_gui_SUITE.erl b/lib/reltool/test/reltool_manual_gui_SUITE.erl
index 7800b7d031..eebe2303fb 100644
--- a/lib/reltool/test/reltool_manual_gui_SUITE.erl
+++ b/lib/reltool/test/reltool_manual_gui_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/test/reltool_server_SUITE.erl b/lib/reltool/test/reltool_server_SUITE.erl
index 6a487a1ddb..e9bd46fb27 100644
--- a/lib/reltool/test/reltool_server_SUITE.erl
+++ b/lib/reltool/test/reltool_server_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -2530,13 +2530,54 @@ latest(App) ->
rm_missing_app(Apps) ->
lists:keydelete(?MISSING_APP_NAME,#app.name,Apps).
+%% We will compare the script generated by systools with
+%% the script generated by Reltool.
+%%
+%% The systools script may include additional modules in
+%% the first primLoad command (as a pure optimization).
+%% Therefore, we cannot compare the primLoad commands
+%% directly. Instead we will collect all modules from
+%% all primLoad commands in each script. The same
+%% modules must be loaded by both scripts. In addition,
+%% the error_handler module must be included in the
+%% first primLoad in each script.
+
diff_script(Script, Script) ->
equal;
diff_script({script, Rel, Commands1}, {script, Rel, Commands2}) ->
- diff_cmds(Commands1, Commands2);
+ case diff_cmds(Commands1, Commands2) of
+ equal ->
+ Loaded = diff_get_prim_load(Commands1),
+ case diff_get_prim_load(Commands2) of
+ Loaded ->
+ equal;
+ Other ->
+ io:format("Only loaded by systools: ~p",
+ [Loaded--Other]),
+ io:format("Only loaded by reltool: ~p",
+ [Other--Loaded]),
+ ct:fail(different_prim_loads)
+ end;
+ Error ->
+ Error
+ end;
diff_script({script, Rel1, _}, {script, Rel2, _}) ->
{error, {Rel1, Rel2}}.
+diff_cmds([{primLoad, Ms1}=Cmd1 | Commands1],
+ [{primLoad, Ms2}=Cmd2 | Commands2]) ->
+ case lists:member(error_handler, Ms1) xor
+ lists:member(error_handler, Ms2) of
+ false ->
+ %% error_handler either present in both or
+ %% absent in both.
+ diff_cmds(Commands1, Commands2);
+ true ->
+ %% error_handler only present in one primLoad.
+ %% Not OK.
+ {diff, missing_error_handler,
+ {expected, Cmd1}, {actual, Cmd2}}
+ end;
diff_cmds([Cmd | Commands1], [Cmd | Commands2]) ->
diff_cmds(Commands1, Commands2);
diff_cmds([Cmd1 | _Commands1], [Cmd2 | _Commands2]) ->
@@ -2544,6 +2585,10 @@ diff_cmds([Cmd1 | _Commands1], [Cmd2 | _Commands2]) ->
diff_cmds([], []) ->
equal.
+diff_get_prim_load(Cmds) ->
+ L = [Ms || {primLoad, Ms} <- Cmds],
+ lists:sort(lists:flatten(L)).
+
os_cmd(Cmd) when is_list(Cmd) ->
%% Call the plain os:cmd with an echo command appended to print command status
%% io:format("os:cmd(~p).\n", [Cmd]),
diff --git a/lib/reltool/test/reltool_test_lib.erl b/lib/reltool/test/reltool_test_lib.erl
index 10546f9915..6cc2d259fb 100644
--- a/lib/reltool/test/reltool_test_lib.erl
+++ b/lib/reltool/test/reltool_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/test/reltool_test_lib.hrl b/lib/reltool/test/reltool_test_lib.hrl
index 87a5d7bd1a..63c4b01714 100644
--- a/lib/reltool/test/reltool_test_lib.hrl
+++ b/lib/reltool/test/reltool_test_lib.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/test/reltool_wx_SUITE.erl b/lib/reltool/test/reltool_wx_SUITE.erl
index f2f1693483..ac820db21c 100644
--- a/lib/reltool/test/reltool_wx_SUITE.erl
+++ b/lib/reltool/test/reltool_wx_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/reltool/test/rtt b/lib/reltool/test/rtt
index 8de2ea32ac..d0ccd577a0 100755
--- a/lib/reltool/test/rtt
+++ b/lib/reltool/test/rtt
@@ -1,7 +1,7 @@
#! /bin/sh -f
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2010. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/reltool/test/rtt.erl b/lib/reltool/test/rtt.erl
index 5b3c84b06a..173ffc5166 100644
--- a/lib/reltool/test/rtt.erl
+++ b/lib/reltool/test/rtt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/Makefile b/lib/runtime_tools/Makefile
index 75174d3bca..eec1ff379b 100644
--- a/lib/runtime_tools/Makefile
+++ b/lib/runtime_tools/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/c_src/Makefile.in b/lib/runtime_tools/c_src/Makefile.in
index aeacee0655..4530a83aee 100644
--- a/lib/runtime_tools/c_src/Makefile.in
+++ b/lib/runtime_tools/c_src/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -33,21 +33,18 @@ VSN=$(RUNTIME_TOOLS_VSN)
# be set for that system only.
# ----------------------------------------------------
CC = $(DED_CC)
-CFLAGS = $(DED_CFLAGS)
+CFLAGS = $(DED_CFLAGS) -I./
LD = $(DED_LD)
SHELL = /bin/sh
LIBS = $(DED_LIBS)
LDFLAGS += $(DED_LDFLAGS)
-DTRACE_LIBNAME = dyntrace
+TRACE_LIBNAME = dyntrace trace_file_drv trace_ip_drv
SYSINCLUDE = $(DED_SYS_INCLUDE)
TRACE_DRV_INCLUDES = $(SYSINCLUDE)
-ALL_CFLAGS = $(CFLAGS) @DEFS@ $(TYPE_FLAGS) $(TRACE_DRV_INCLUDES) \
- -I$(OBJDIR) -I$(ERL_TOP)/erts/emulator/$(TARGET)
-
ifeq ($(TYPE),debug)
TYPEMARKER = .debug
TYPE_FLAGS = $(subst -O3,,$(subst -O2,,$(CFLAGS))) -DDEBUG @DEBUG_FLAGS@
@@ -61,6 +58,9 @@ TYPE_FLAGS = $(CFLAGS)
endif
endif
+ALL_CFLAGS = @DEFS@ $(TYPE_FLAGS) $(TRACE_DRV_INCLUDES) \
+ -I$(OBJDIR) -I$(ERL_TOP)/erts/emulator/$(TARGET)
+
ROOTDIR = $(ERL_TOP)/lib
PRIVDIR = ../priv
LIBDIR = $(PRIVDIR)/lib/$(TARGET)
@@ -74,37 +74,16 @@ RELSYSDIR = $(RELEASE_PATH)/lib/runtime_tools-$(VSN)
# ----------------------------------------------------
# Misc Macros
# ----------------------------------------------------
-before_DTrace_OBJS = $(OBJDIR)/dyntrace$(TYPEMARKER).o
-## NIF_MAKEFILE = $(PRIVDIR)/Makefile
-# Higher-level makefiles says that we can only compile on UNIX flavors
-NIF_LIB = $(LIBDIR)/dyntrace$(TYPEMARKER).@DED_EXT@
+TRACE_LIBS = $(foreach LIB, $(TRACE_LIBNAME), $(LIBDIR)/$(LIB)$(TYPEMARKER).@DED_EXT@)
-ifeq ($(HOST_OS),)
-HOST_OS := $(shell $(ERL_TOP)/erts/autoconf/config.guess)
-endif
-
-TRACE_IP_DRV_OBJS = \
- $(OBJDIR)/trace_ip_drv.o
-
-TRACE_FILE_DRV_OBJS = \
- $(OBJDIR)/trace_file_drv.o
-
-ifeq ($(findstring win32,$(TARGET)), win32)
-SOLIBS = $(LIBDIR)/trace_ip_drv.dll $(LIBDIR)/trace_file_drv.dll
-LN=cp
-else
-SOLIBS = $(LIBDIR)/trace_ip_drv.so $(LIBDIR)/trace_file_drv.so
-endif
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
_create_dirs := $(shell mkdir -p $(OBJDIR) $(LIBDIR))
-debug opt valgrind: $(SOLIBS) $(OBJDIR) $(LIBDIR) $(NIF_LIB)
-
-DYNTRACE_OBJS = $(before_DTrace_OBJS)
+debug opt valgrind: $(SOLIBS) $(OBJDIR) $(LIBDIR) $(TRACE_LIBS)
$(OBJDIR):
-@mkdir -p $(OBJDIR)
@@ -112,50 +91,26 @@ $(OBJDIR):
$(LIBDIR):
-@mkdir -p $(LIBDIR)
-$(OBJDIR)/dyntrace$(TYPEMARKER).o: dyntrace.c
- $(V_at)$(INSTALL_DIR) $(OBJDIR)
- $(V_CC) -c -o $@ $(ALL_CFLAGS) $<
-
-$(NIF_LIB): $(DYNTRACE_OBJS)
- $(V_at)$(INSTALL_DIR) $(LIBDIR)
- $(V_LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
-
-$(OBJDIR)/%.o: %.c
+$(OBJDIR)/%$(TYPEMARKER).o: %.c dyntrace_lttng.h
$(V_CC) -c -o $@ $(ALL_CFLAGS) $<
-$(LIBDIR)/trace_ip_drv.so: $(TRACE_IP_DRV_OBJS)
- $(V_LD) $(LDFLAGS) -o $@ $^ -lc $(LIBS)
-
-$(LIBDIR)/trace_file_drv.so: $(TRACE_FILE_DRV_OBJS)
- $(V_LD) $(LDFLAGS) -o $@ $^ -lc $(LIBS)
-
-$(LIBDIR)/trace_ip_drv.dll: $(TRACE_IP_DRV_OBJS)
- $(V_LD) $(LDFLAGS) -o $@ $^ $(LIBS)
-$(LIBDIR)/trace_file_drv.dll: $(TRACE_FILE_DRV_OBJS)
+$(LIBDIR)/%$(TYPEMARKER).@DED_EXT@: $(OBJDIR)/%$(TYPEMARKER).o
$(V_LD) $(LDFLAGS) -o $@ $^ $(LIBS)
clean:
- rm -f $(SOLIBS) $(TRACE_IP_DRV_OBJS) $(TRACE_FILE_DRV_OBJS)
- rm -f $(LIBDIR)/dyntrace.@DED_EXT@
- rm -f $(LIBDIR)/dyntrace.debug.@DED_EXT@
- rm -f $(LIBDIR)/dyntrace.valgrind.@DED_EXT@
- rm -f $(OBJDIR)/dyntrace.o
- rm -f $(OBJDIR)/dyntrace.debug.o
- rm -f $(OBJDIR)/dyntrace.valgrind.o
+ rm -f $(TRACE_LIBS)
rm -f core *~
docs:
# ----------------------------------------------------
# Release Target
-# ----------------------------------------------------
+# ----------------------------------------------------
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) "$(RELSYSDIR)/priv/obj"
$(INSTALL_DIR) "$(RELSYSDIR)/priv/lib"
- $(INSTALL_PROGRAM) $(DYNTRACE_OBJS) "$(RELSYSDIR)/priv/obj"
- $(INSTALL_PROGRAM) $(NIF_LIB) $(SOLIBS) "$(RELSYSDIR)/priv/lib"
+ $(INSTALL_PROGRAM) $(TRACE_LIBS) "$(RELSYSDIR)/priv/lib"
release_docs_spec:
diff --git a/lib/runtime_tools/c_src/dtrace_user.d b/lib/runtime_tools/c_src/dtrace_user.d
index 09597f3e89..2b74e9ef6f 100644
--- a/lib/runtime_tools/c_src/dtrace_user.d
+++ b/lib/runtime_tools/c_src/dtrace_user.d
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie 2011-2012.
+ * Copyright Scott Lystig Fritchie 2011-2016.
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/runtime_tools/c_src/dyntrace.c b/lib/runtime_tools/c_src/dyntrace.c
index e9bcc161c5..0178d95efb 100644
--- a/lib/runtime_tools/c_src/dyntrace.c
+++ b/lib/runtime_tools/c_src/dyntrace.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,7 +29,13 @@
#include "sys.h"
#include "dtrace-wrapper.h"
#if defined(USE_DYNAMIC_TRACE) && (defined(USE_DTRACE) || defined(USE_SYSTEMTAP))
-#define HAVE_USE_DTRACE 1
+# define HAVE_USE_DTRACE 1
+#endif
+#if defined(USE_LTTNG)
+# define HAVE_USE_LTTNG 1
+# define TRACEPOINT_DEFINE
+# define TRACEPOINT_CREATE_PROBES
+# include "dyntrace_lttng.h"
#endif
void dtrace_nifenv_str(ErlNifEnv *env, char *process_buf);
@@ -60,11 +66,56 @@ static ERL_NIF_TERM user_trace_s1(ErlNifEnv* env, int argc, const ERL_NIF_TERM a
static ERL_NIF_TERM user_trace_i4s4(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM user_trace_n(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM enabled(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM trace(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+
+#ifdef HAVE_USE_LTTNG
+static ERL_NIF_TERM trace_procs(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM trace_ports(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM trace_running_procs(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM trace_running_ports(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM trace_call(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM trace_send(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM trace_receive(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM trace_garbage_collection(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+
+static ERL_NIF_TERM enabled_procs(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM enabled_ports(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM enabled_running_procs(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM enabled_running_ports(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM enabled_call(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM enabled_send(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM enabled_receive(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM enabled_garbage_collection(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+#endif
+
+
static ErlNifFunc nif_funcs[] = {
{"available", 0, available},
{"user_trace_s1", 1, user_trace_s1},
{"user_trace_i4s4", 9, user_trace_i4s4},
- {"user_trace_n", 10, user_trace_n}
+ {"user_trace_n", 10, user_trace_n},
+#ifdef HAVE_USE_LTTNG
+ {"trace_procs", 6, trace_procs},
+ {"trace_ports", 6, trace_ports},
+ {"trace_running_procs", 6, trace_running_procs},
+ {"trace_running_ports", 6, trace_running_ports},
+ {"trace_call", 6, trace_call},
+ {"trace_send", 6, trace_send},
+ {"trace_receive", 6, trace_receive},
+ {"trace_garbage_collection", 6, trace_garbage_collection},
+ {"enabled_procs", 3, enabled_procs},
+ {"enabled_ports", 3, enabled_ports},
+ {"enabled_running_procs", 3, enabled_running_procs},
+ {"enabled_running_ports", 3, enabled_running_ports},
+ {"enabled_call", 3, enabled_call},
+ {"enabled_send", 3, enabled_send},
+ {"enabled_receive", 3, enabled_receive},
+ {"enabled_garbage_collection", 3, enabled_garbage_collection},
+#endif
+ {"enabled", 3, enabled},
+ {"trace", 5, trace},
+ {"trace", 6, trace}
};
ERL_NIF_INIT(dyntrace, nif_funcs, load, NULL, NULL, NULL)
@@ -76,6 +127,61 @@ static ERL_NIF_TERM atom_not_available;
static ERL_NIF_TERM atom_badarg;
static ERL_NIF_TERM atom_ok;
+static ERL_NIF_TERM atom_trace;
+static ERL_NIF_TERM atom_seq_trace;
+static ERL_NIF_TERM atom_remove;
+static ERL_NIF_TERM atom_discard;
+
+#ifdef HAVE_USE_LTTNG
+
+/* gc atoms */
+
+static ERL_NIF_TERM atom_gc_minor_start;
+static ERL_NIF_TERM atom_gc_minor_end;
+static ERL_NIF_TERM atom_gc_major_start;
+static ERL_NIF_TERM atom_gc_major_end;
+
+static ERL_NIF_TERM atom_old_heap_block_size; /* for debug */
+static ERL_NIF_TERM atom_heap_block_size; /* for debug */
+
+/* process 'procs' */
+
+static ERL_NIF_TERM atom_spawn;
+static ERL_NIF_TERM atom_exit;
+static ERL_NIF_TERM atom_register;
+static ERL_NIF_TERM atom_unregister;
+static ERL_NIF_TERM atom_link;
+static ERL_NIF_TERM atom_unlink;
+static ERL_NIF_TERM atom_getting_linked;
+static ERL_NIF_TERM atom_getting_unlinked;
+
+/* process 'running' and 'exiting' */
+
+static ERL_NIF_TERM atom_in;
+static ERL_NIF_TERM atom_out;
+static ERL_NIF_TERM atom_in_exiting;
+static ERL_NIF_TERM atom_out_exiting;
+static ERL_NIF_TERM atom_out_exited;
+
+/* process messages 'send' and 'receive' */
+
+static ERL_NIF_TERM atom_send;
+static ERL_NIF_TERM atom_receive;
+static ERL_NIF_TERM atom_send_to_non_existing_process;
+
+/* ports 'ports' */
+
+static ERL_NIF_TERM atom_open;
+static ERL_NIF_TERM atom_closed;
+
+/* 'call' */
+
+static ERL_NIF_TERM atom_call;
+static ERL_NIF_TERM atom_return_from;
+static ERL_NIF_TERM atom_return_to;
+static ERL_NIF_TERM atom_exception_from;
+#endif
+
static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info)
{
atom_true = enif_make_atom(env,"true");
@@ -85,6 +191,61 @@ static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info)
atom_badarg = enif_make_atom(env,"badarg");
atom_ok = enif_make_atom(env,"ok");
+ atom_trace = enif_make_atom(env,"trace");
+ atom_seq_trace = enif_make_atom(env,"seq_trace");
+ atom_remove = enif_make_atom(env,"remove");
+ atom_discard = enif_make_atom(env,"discard");
+
+#ifdef HAVE_USE_LTTNG
+
+ /* gc */
+
+ atom_gc_minor_start = enif_make_atom(env,"gc_minor_start");
+ atom_gc_minor_end = enif_make_atom(env,"gc_minor_end");
+ atom_gc_major_start = enif_make_atom(env,"gc_major_start");
+ atom_gc_major_end = enif_make_atom(env,"gc_major_end");
+
+ atom_old_heap_block_size = enif_make_atom(env,"old_heap_block_size");
+ atom_heap_block_size = enif_make_atom(env,"heap_block_size");
+
+ /* process 'proc' */
+
+ atom_spawn = enif_make_atom(env,"spawn");
+ atom_exit = enif_make_atom(env,"exit");
+ atom_register = enif_make_atom(env,"register");
+ atom_unregister = enif_make_atom(env,"unregister");
+ atom_link = enif_make_atom(env,"link");
+ atom_unlink = enif_make_atom(env,"unlink");
+ atom_getting_unlinked = enif_make_atom(env,"getting_unlinked");
+ atom_getting_linked = enif_make_atom(env,"getting_linked");
+
+ /* process 'running' and 'exiting' */
+
+ atom_in = enif_make_atom(env,"in");
+ atom_out = enif_make_atom(env,"out");
+ atom_in_exiting = enif_make_atom(env,"in_exiting");
+ atom_out_exiting = enif_make_atom(env,"out_exiting");
+ atom_out_exited = enif_make_atom(env,"out_exited");
+
+ /* process messages 'send' and 'receive' */
+
+ atom_send = enif_make_atom(env,"send");
+ atom_receive = enif_make_atom(env,"receive");
+ atom_send_to_non_existing_process = enif_make_atom(env,"send_to_non_existing_process");
+
+ /* ports 'ports' */
+
+ atom_open = enif_make_atom(env,"open");
+ atom_closed = enif_make_atom(env,"closed");
+
+ /* 'call' */
+
+ atom_call = enif_make_atom(env,"call");
+ atom_return_from = enif_make_atom(env,"return_from");
+ atom_return_to = enif_make_atom(env,"return_to");
+ atom_exception_from = enif_make_atom(env,"exception_from");
+#endif
+
return 0;
}
@@ -123,3 +284,442 @@ static ERL_NIF_TERM user_trace_n(ErlNifEnv* env, int argc, const ERL_NIF_TERM ar
return atom_error;
#endif
}
+
+static ERL_NIF_TERM enabled(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
+{
+#ifdef HAVE_USE_LTTNG
+ ASSERT(argc == 3);
+ return atom_trace;
+#endif
+ return atom_remove;
+}
+
+static ERL_NIF_TERM trace(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ return atom_ok;
+}
+
+#ifdef HAVE_USE_LTTNG
+static ERL_NIF_TERM enabled_garbage_collection(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
+{
+ ASSERT(argc == 3);
+
+ if (argv[0] == atom_gc_minor_start && LTTNG_ENABLED(gc_minor_start)) {
+ return atom_trace;
+ } else if (argv[0] == atom_gc_minor_end && LTTNG_ENABLED(gc_minor_end)) {
+ return atom_trace;
+ } else if (argv[0] == atom_gc_major_start && LTTNG_ENABLED(gc_major_start)) {
+ return atom_trace;
+ } else if (argv[0] == atom_gc_major_end && LTTNG_ENABLED(gc_major_end)) {
+ return atom_trace;
+ }
+
+ return atom_discard;
+}
+
+static ERL_NIF_TERM trace_garbage_collection(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ lttng_decl_procbuf(pid);
+ ERL_NIF_TERM gci, tup;
+ const ERL_NIF_TERM *vals;
+ int arity;
+ unsigned long ohbsz, nhbsz, size;
+
+ ASSERT(argc == 6);
+
+ /* Assume gc info order does not change */
+ gci = argv[3];
+
+ /* get reclaimed or need */
+ enif_get_list_cell(env, gci, &tup, &gci);
+ enif_get_tuple(env, tup, &arity, &vals);
+ ASSERT(arity == 2);
+ enif_get_ulong(env, vals[1], &size);
+
+ /* get old heap block size */
+ enif_get_list_cell(env, gci, &tup, &gci);
+ enif_get_tuple(env, tup, &arity, &vals);
+ ASSERT(arity == 2);
+ ASSERT(vals[0] == atom_old_heap_block_size);
+ enif_get_ulong(env, vals[1], &ohbsz);
+
+ /* get new heap block size */
+ enif_get_list_cell(env, gci, &tup, &gci);
+ enif_get_tuple(env, tup, &arity, &vals);
+ ASSERT(arity == 2);
+ ASSERT(vals[0] == atom_heap_block_size);
+ enif_get_ulong(env, vals[1], &nhbsz);
+
+ lttng_pid_to_str(argv[2], pid);
+
+ if (argv[0] == atom_gc_minor_start) {
+ LTTNG4(gc_minor_start, pid, size, nhbsz, ohbsz);
+ } else if (argv[0] == atom_gc_minor_end) {
+ LTTNG4(gc_minor_end, pid, size, nhbsz, ohbsz);
+ } else if (argv[0] == atom_gc_major_start) {
+ LTTNG4(gc_major_start, pid, size, nhbsz, ohbsz);
+ } else if (argv[0] == atom_gc_major_end) {
+ LTTNG4(gc_major_end, pid, size, nhbsz, ohbsz);
+ }
+ return atom_ok;
+}
+
+static ERL_NIF_TERM enabled_call(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
+{
+ ASSERT(argc == 3);
+
+ if (argv[0] == atom_call && LTTNG_ENABLED(function_call))
+ return atom_trace;
+ else if (argv[0] == atom_return_from && LTTNG_ENABLED(function_return))
+ return atom_trace;
+ else if (argv[0] == atom_exception_from && LTTNG_ENABLED(function_exception))
+ return atom_trace;
+
+ return atom_discard;
+}
+
+static ERL_NIF_TERM trace_call(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ lttng_decl_procbuf(pid);
+ unsigned int len;
+ char undef[] = "undefined";
+
+ lttng_pid_to_str(argv[2], pid);
+
+ if (argv[0] == atom_call) {
+ const ERL_NIF_TERM* tuple;
+ int arity;
+ lttng_decl_mfabuf(mfa);
+
+ if (enif_get_tuple(env, argv[3], &arity, &tuple)) {
+ if (enif_is_list(env, tuple[2])) {
+ enif_get_list_length(env, tuple[2], &len);
+ } else {
+ enif_get_uint(env, tuple[2], &len);
+ }
+ lttng_mfa_to_str(tuple[0], tuple[1], len, mfa);
+ LTTNG3(function_call, pid, mfa, 0);
+ } else {
+ LTTNG3(function_call, pid, undef, 0);
+ }
+ } else if (argv[0] == atom_return_from) {
+ const ERL_NIF_TERM* tuple;
+ int arity;
+ lttng_decl_mfabuf(mfa);
+
+ if (enif_get_tuple(env, argv[3], &arity, &tuple)) {
+ enif_get_uint(env, tuple[2], &len);
+ lttng_mfa_to_str(tuple[0], tuple[1], len, mfa);
+ LTTNG3(function_return, pid, mfa, 0);
+ } else {
+ LTTNG3(function_return, pid, undef, 0);
+ }
+ } else if (argv[0] == atom_return_to) {
+ const ERL_NIF_TERM* tuple;
+ int arity;
+ lttng_decl_mfabuf(mfa);
+
+ if (enif_get_tuple(env, argv[3], &arity, &tuple)) {
+ enif_get_uint(env, tuple[2], &len);
+ lttng_mfa_to_str(tuple[0], tuple[1], len, mfa);
+ LTTNG3(function_return, pid, mfa, 0);
+ } else {
+ LTTNG3(function_return, pid, undef, 0);
+ }
+ } else if (argv[0] == atom_exception_from) {
+ const ERL_NIF_TERM* tuple;
+ int arity;
+ lttng_decl_mfabuf(mfa);
+ char class[LTTNG_BUFFER_SZ];
+
+ enif_get_tuple(env, argv[4], &arity, &tuple);
+ erts_snprintf(class, LTTNG_BUFFER_SZ, "%T", tuple[0]);
+
+ if (enif_get_tuple(env, argv[3], &arity, &tuple)) {
+ enif_get_uint(env, tuple[2], &len);
+ lttng_mfa_to_str(tuple[0], tuple[1], len, mfa);
+ LTTNG3(function_exception, pid, mfa, class);
+ } else {
+ LTTNG3(function_exception, pid, undef, class);
+ }
+ }
+ return atom_ok;
+}
+
+static ERL_NIF_TERM enabled_send(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
+{
+ ASSERT(argc == 3);
+ if (LTTNG_ENABLED(message_send))
+ return atom_trace;
+
+ return atom_discard;
+}
+
+static ERL_NIF_TERM trace_send(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ lttng_decl_procbuf(pid);
+ lttng_pid_to_str(argv[2], pid);
+
+ if (argv[0] == atom_send) {
+ lttng_decl_procbuf(to);
+ char msg[LTTNG_BUFFER_SZ];
+
+ lttng_pid_to_str(argv[4], to);
+ erts_snprintf(msg, LTTNG_BUFFER_SZ, "%T", argv[3]);
+
+ LTTNG3(message_send, pid, to, msg);
+ } else if (argv[0] == atom_send_to_non_existing_process) {
+ lttng_decl_procbuf(to);
+ char msg[LTTNG_BUFFER_SZ];
+
+ lttng_pid_to_str(argv[4], to);
+ erts_snprintf(msg, LTTNG_BUFFER_SZ, "%T", argv[3]);
+ /* mark it as non existing ? */
+
+ LTTNG3(message_send, pid, to, msg);
+ }
+ return atom_ok;
+}
+
+static ERL_NIF_TERM enabled_receive(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
+{
+ if (LTTNG_ENABLED(message_receive))
+ return atom_trace;
+
+ return atom_discard;
+}
+
+static ERL_NIF_TERM trace_receive(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ if (argv[0] == atom_receive) {
+ lttng_decl_procbuf(pid);
+ char msg[LTTNG_BUFFER_SZ];
+
+ lttng_pid_to_str(argv[2], pid);
+ erts_snprintf(msg, LTTNG_BUFFER_SZ, "%T", argv[3]);
+
+ LTTNG2(message_receive, pid, msg);
+ }
+ return atom_ok;
+}
+
+static ERL_NIF_TERM enabled_procs(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
+{
+ ASSERT(argc == 3);
+
+ if (argv[0] == atom_spawn && LTTNG_ENABLED(process_spawn)) {
+ return atom_trace;
+ } else if (argv[0] == atom_register && LTTNG_ENABLED(process_register)) {
+ return atom_trace;
+ } else if (argv[0] == atom_unregister && LTTNG_ENABLED(process_register)) {
+ return atom_trace;
+ } else if (argv[0] == atom_link && LTTNG_ENABLED(process_link)) {
+ return atom_trace;
+ } else if (argv[0] == atom_unlink && LTTNG_ENABLED(process_link)) {
+ return atom_trace;
+ } else if (argv[0] == atom_getting_linked && LTTNG_ENABLED(process_link)) {
+ return atom_trace;
+ } else if (argv[0] == atom_getting_unlinked && LTTNG_ENABLED(process_link)) {
+ return atom_trace;
+ } else if (argv[0] == atom_exit && LTTNG_ENABLED(process_exit)) {
+ return atom_trace;
+ }
+
+ return atom_discard;
+}
+
+static ERL_NIF_TERM trace_procs(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ lttng_decl_procbuf(pid);
+ lttng_decl_procbuf(to);
+
+ lttng_pid_to_str(argv[2], pid);
+
+ /* spawn */
+ if (argv[0] == atom_spawn) {
+ char undef[] = "undefined";
+ const ERL_NIF_TERM* tuple;
+ int arity;
+ unsigned int len;
+ lttng_decl_mfabuf(mfa);
+
+ lttng_pid_to_str(argv[3], to);
+
+ if (enif_get_tuple(env, argv[4], &arity, &tuple)) {
+ if (enif_is_list(env, tuple[2])) {
+ enif_get_list_length(env, tuple[2], &len);
+ } else {
+ enif_get_uint(env, tuple[2], &len);
+ }
+ lttng_mfa_to_str(tuple[0], tuple[1], len, mfa);
+ LTTNG3(process_spawn, to, pid, mfa);
+ } else {
+ LTTNG3(process_spawn, to, pid, undef);
+ }
+
+ /* register */
+ } else if (argv[0] == atom_register) {
+ char name[LTTNG_BUFFER_SZ];
+ erts_snprintf(name, LTTNG_BUFFER_SZ, "%T", argv[3]);
+ LTTNG3(process_register, pid, name, "register");
+ } else if (argv[0] == atom_unregister) {
+ char name[LTTNG_BUFFER_SZ];
+ erts_snprintf(name, LTTNG_BUFFER_SZ, "%T", argv[3]);
+ LTTNG3(process_register, pid, name, "unregister");
+ /* link */
+ } else if (argv[0] == atom_link) {
+ lttng_pid_to_str(argv[3], to);
+ LTTNG3(process_link, pid, to, "link");
+ } else if (argv[0] == atom_unlink) {
+ lttng_pid_to_str(argv[3], to);
+ LTTNG3(process_link, pid, to, "unlink");
+ } else if (argv[0] == atom_getting_linked) {
+ lttng_pid_to_str(argv[3], to);
+ LTTNG3(process_link, to, pid, "link");
+ } else if (argv[0] == atom_getting_unlinked) {
+ lttng_pid_to_str(argv[3], to);
+ LTTNG3(process_link, to, pid, "unlink");
+ /* exit */
+ } else if (argv[0] == atom_exit) {
+ char reason[LTTNG_BUFFER_SZ];
+ erts_snprintf(reason, LTTNG_BUFFER_SZ, "%T", argv[3]);
+ LTTNG2(process_exit, pid, reason);
+ }
+ return atom_ok;
+}
+
+static ERL_NIF_TERM enabled_ports(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
+{
+ ASSERT(argc == 3);
+
+ if (argv[0] == atom_open && LTTNG_ENABLED(port_open)) {
+ return atom_trace;
+ } else if (argv[0] == atom_link && LTTNG_ENABLED(port_link)) {
+ return atom_trace;
+ } else if (argv[0] == atom_unlink && LTTNG_ENABLED(port_link)) {
+ return atom_trace;
+ } else if (argv[0] == atom_getting_linked && LTTNG_ENABLED(port_link)) {
+ return atom_trace;
+ } else if (argv[0] == atom_getting_unlinked && LTTNG_ENABLED(port_link)) {
+ return atom_trace;
+ } else if (argv[0] == atom_closed && LTTNG_ENABLED(port_exit)) {
+ return atom_trace;
+ }
+
+ return atom_discard;
+}
+
+static ERL_NIF_TERM trace_ports(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ lttng_decl_portbuf(port);
+ lttng_decl_procbuf(to);
+
+ lttng_portid_to_str(argv[2], port);
+
+ /* open and closed */
+ if (argv[0] == atom_open) {
+ char driver[LTTNG_BUFFER_SZ];
+ lttng_decl_procbuf(pid);
+ lttng_pid_to_str(argv[3], pid);
+
+ erts_snprintf(driver, LTTNG_BUFFER_SZ, "%T", argv[4]);
+ LTTNG3(port_open, pid, driver, port);
+ } else if (argv[0] == atom_closed) {
+ char reason[LTTNG_BUFFER_SZ];
+ erts_snprintf(reason, LTTNG_BUFFER_SZ, "%T", argv[3]);
+
+ LTTNG2(port_exit, port, reason);
+ /* link */
+ } else if (argv[0] == atom_link) {
+ lttng_pid_to_str(argv[3], to);
+ LTTNG3(port_link, port, to, "link");
+ } else if (argv[0] == atom_unlink) {
+ lttng_pid_to_str(argv[3], to);
+ LTTNG3(port_link, port, to, "unlink");
+ } else if (argv[0] == atom_getting_linked) {
+ lttng_pid_to_str(argv[3], to);
+ LTTNG3(port_link, to, port, "link");
+ } else if (argv[0] == atom_getting_unlinked) {
+ lttng_pid_to_str(argv[3], to);
+ LTTNG3(port_link, to, port, "unlink");
+ }
+ return atom_ok;
+}
+
+static ERL_NIF_TERM enabled_running_procs(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
+{
+ ASSERT(argc == 3);
+
+ if (LTTNG_ENABLED(process_scheduled))
+ return atom_trace;
+
+ return atom_discard;
+}
+
+static ERL_NIF_TERM trace_running_procs(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ lttng_decl_procbuf(pid);
+ const ERL_NIF_TERM* tuple;
+ char *mfastr = "undefined";
+ int arity;
+ lttng_decl_mfabuf(mfa);
+
+ lttng_pid_to_str(argv[2], pid);
+
+ if (enif_get_tuple(env, argv[3], &arity, &tuple)) {
+ int val;
+ enif_get_int(env, tuple[2], &val);
+ lttng_mfa_to_str(tuple[0], tuple[1], val, mfa);
+ mfastr = mfa;
+ }
+ /* running processes */
+ if (argv[0] == atom_in) {
+ LTTNG3(process_scheduled, pid, mfastr, "in");
+ } else if (argv[0] == atom_out) {
+ LTTNG3(process_scheduled, pid, mfastr, "out");
+ /* exiting */
+ } else if (argv[0] == atom_in_exiting) {
+ LTTNG3(process_scheduled, pid, mfastr, "in_exiting");
+ } else if (argv[0] == atom_out_exiting) {
+ LTTNG3(process_scheduled, pid, mfastr, "out_exiting");
+ } else if (argv[0] == atom_out_exited) {
+ LTTNG3(process_scheduled, pid, mfastr, "out_exited");
+ }
+
+ return atom_ok;
+}
+
+static ERL_NIF_TERM enabled_running_ports(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
+{
+ ASSERT(argc == 3);
+
+ if (LTTNG_ENABLED(port_scheduled))
+ return atom_trace;
+
+ return atom_discard;
+}
+
+static ERL_NIF_TERM trace_running_ports(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ lttng_decl_procbuf(pid);
+ lttng_decl_mfabuf(where);
+
+ lttng_portid_to_str(argv[2], pid);
+ erts_snprintf(where, LTTNG_BUFFER_SZ, "%T", argv[3]);
+
+ /* running ports */
+ if (argv[0] == atom_in) {
+ LTTNG3(port_scheduled, pid, where, "in");
+ } else if (argv[0] == atom_out) {
+ LTTNG3(port_scheduled, pid, where, "out");
+ /* exiting */
+ } else if (argv[0] == atom_in_exiting) {
+ LTTNG3(port_scheduled, pid, where, "in_exiting");
+ } else if (argv[0] == atom_out_exiting) {
+ LTTNG3(port_scheduled, pid, where, "out_exiting");
+ } else if (argv[0] == atom_out_exited) {
+ LTTNG3(port_scheduled, pid, where, "out_exited");
+ }
+ return atom_ok;
+}
+#endif
diff --git a/lib/runtime_tools/c_src/dyntrace_lttng.h b/lib/runtime_tools/c_src/dyntrace_lttng.h
new file mode 100644
index 0000000000..3550a1cab5
--- /dev/null
+++ b/lib/runtime_tools/c_src/dyntrace_lttng.h
@@ -0,0 +1,367 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Ericsson AB 2016. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+#undef TRACEPOINT_PROVIDER
+#define TRACEPOINT_PROVIDER com_ericsson_dyntrace
+
+#if !defined(DYNTRACE_LTTNG_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
+#define DYNTRACE_LTTNG_H
+
+#include <lttng/tracepoint.h>
+
+#define LTTNG1(Name, Arg1) \
+ tracepoint(com_ericsson_dyntrace, Name, (Arg1))
+
+#define LTTNG2(Name, Arg1, Arg2) \
+ tracepoint(com_ericsson_dyntrace, Name, (Arg1), (Arg2))
+
+#define LTTNG3(Name, Arg1, Arg2, Arg3) \
+ tracepoint(com_ericsson_dyntrace, Name, (Arg1), (Arg2), (Arg3))
+
+#define LTTNG4(Name, Arg1, Arg2, Arg3, Arg4) \
+ tracepoint(com_ericsson_dyntrace, Name, (Arg1), (Arg2), (Arg3), (Arg4))
+
+#define LTTNG5(Name, Arg1, Arg2, Arg3, Arg4, Arg5) \
+ tracepoint(com_ericsson_dyntrace, Name, (Arg1), (Arg2), (Arg3), (Arg4), (Arg5))
+
+#define LTTNG_ENABLED(Name) \
+ tracepoint_enabled(com_ericsson_dyntrace, Name)
+
+#define LTTNG_BUFFER_SZ (256)
+#define LTTNG_PROC_BUFFER_SZ (16)
+#define LTTNG_PORT_BUFFER_SZ (20)
+#define LTTNG_MFA_BUFFER_SZ (256)
+
+#define lttng_decl_procbuf(Name) \
+ char Name[LTTNG_PROC_BUFFER_SZ]
+
+#define lttng_decl_portbuf(Name) \
+ char Name[LTTNG_PORT_BUFFER_SZ]
+
+#define lttng_decl_mfabuf(Name) \
+ char Name[LTTNG_MFA_BUFFER_SZ]
+
+#define lttng_pid_to_str(pid, name) \
+ erts_snprintf(name, LTTNG_PROC_BUFFER_SZ, "%T", (pid))
+
+#define lttng_portid_to_str(pid, name) \
+ erts_snprintf(name, LTTNG_PORT_BUFFER_SZ, "%T", (pid))
+
+#define lttng_proc_to_str(p, name) \
+ lttng_pid_to_str(((p) ? (p)->common.id : ERTS_INVALID_PID), name)
+
+#define lttng_port_to_str(p, name) \
+ lttng_portid_to_str(((p) ? (p)->common.id : ERTS_INVALID_PORT), name)
+
+#define lttng_mfa_to_str(m,f,a, Name) \
+ erts_snprintf(Name, LTTNG_MFA_BUFFER_SZ, "%T:%T/%lu", (Eterm)(m), (Eterm)(f), (Uint)(a))
+
+/* Process scheduling */
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ process_spawn,
+ TP_ARGS(
+ char*, p,
+ char*, parent,
+ char*, mfa
+ ),
+ TP_FIELDS(
+ ctf_string(pid, p)
+ ctf_string(parent, parent)
+ ctf_string(entry, mfa)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ process_link,
+ TP_ARGS(
+ char*, from,
+ char*, to,
+ char*, type
+ ),
+ TP_FIELDS(
+ ctf_string(from, from)
+ ctf_string(to, to)
+ ctf_string(type, type)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ process_exit,
+ TP_ARGS(
+ char*, p,
+ char*, reason
+ ),
+ TP_FIELDS(
+ ctf_string(pid, p)
+ ctf_string(reason, reason)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ process_register,
+ TP_ARGS(
+ char*, pid,
+ char*, name,
+ char*, type
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(name, name)
+ ctf_string(type, type)
+ )
+)
+
+/* Scheduled */
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ process_scheduled,
+ TP_ARGS(
+ char*, p,
+ char*, mfa,
+ char*, type
+ ),
+ TP_FIELDS(
+ ctf_string(pid, p)
+ ctf_string(entry, mfa)
+ ctf_string(type, type)
+ )
+)
+
+/* Ports */
+
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ port_open,
+ TP_ARGS(
+ char*, pid,
+ char*, driver,
+ char*, port
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(driver, driver)
+ ctf_string(port, port)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ port_exit,
+ TP_ARGS(
+ char*, port,
+ char*, reason
+ ),
+ TP_FIELDS(
+ ctf_string(port, port)
+ ctf_string(reason, reason)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ port_link,
+ TP_ARGS(
+ char*, from,
+ char*, to,
+ char*, type
+ ),
+ TP_FIELDS(
+ ctf_string(from, from)
+ ctf_string(to, to)
+ ctf_string(type, type)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ port_scheduled,
+ TP_ARGS(
+ char*, p,
+ char*, op,
+ char*, type
+ ),
+ TP_FIELDS(
+ ctf_string(pid, p)
+ ctf_string(entry, op)
+ ctf_string(type, type)
+ )
+)
+
+/* Call tracing */
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ function_call,
+ TP_ARGS(
+ char*, pid,
+ char*, mfa,
+ unsigned int, depth
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(entry, mfa)
+ ctf_integer(unsigned int, depth, depth)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ function_return,
+ TP_ARGS(
+ char*, pid,
+ char*, mfa,
+ unsigned int, depth
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(entry, mfa)
+ ctf_integer(unsigned int, depth, depth)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ function_exception,
+ TP_ARGS(
+ char*, pid,
+ char*, mfa,
+ char*, type
+ ),
+ TP_FIELDS(
+ ctf_string(pid, pid)
+ ctf_string(entry, mfa)
+ ctf_string(class, type)
+ )
+)
+
+/* Process messages */
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ message_send,
+ TP_ARGS(
+ char*, sender,
+ char*, receiver,
+ char*, msg
+ ),
+ TP_FIELDS(
+ ctf_string(from, sender)
+ ctf_string(to, receiver)
+ ctf_string(message, msg)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ message_receive,
+ TP_ARGS(
+ char*, receiver,
+ char*, msg
+ ),
+ TP_FIELDS(
+ ctf_string(to, receiver)
+ ctf_string(message, msg)
+ )
+)
+
+/* Process Memory */
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ gc_minor_start,
+ TP_ARGS(
+ char*, p,
+ unsigned long, need,
+ unsigned long, nh,
+ unsigned long, oh
+ ),
+ TP_FIELDS(
+ ctf_string(pid, p)
+ ctf_integer(unsigned long, need, need)
+ ctf_integer(unsigned long, heap, nh)
+ ctf_integer(unsigned long, old_heap, oh)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ gc_minor_end,
+ TP_ARGS(
+ char*, p,
+ unsigned long, reclaimed,
+ unsigned long, nh,
+ unsigned long, oh
+ ),
+ TP_FIELDS(
+ ctf_string(pid, p)
+ ctf_integer(unsigned long, reclaimed, reclaimed)
+ ctf_integer(unsigned long, heap, nh)
+ ctf_integer(unsigned long, old_heap, oh)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ gc_major_start,
+ TP_ARGS(
+ char*, p,
+ unsigned long, need,
+ unsigned long, nh,
+ unsigned long, oh
+ ),
+ TP_FIELDS(
+ ctf_string(pid, p)
+ ctf_integer(unsigned long, need, need)
+ ctf_integer(unsigned long, heap, nh)
+ ctf_integer(unsigned long, old_heap, oh)
+ )
+)
+
+TRACEPOINT_EVENT(
+ com_ericsson_dyntrace,
+ gc_major_end,
+ TP_ARGS(
+ char*, p,
+ unsigned long, reclaimed,
+ unsigned long, nh,
+ unsigned long, oh
+ ),
+ TP_FIELDS(
+ ctf_string(pid, p)
+ ctf_integer(unsigned long, reclaimed, reclaimed)
+ ctf_integer(unsigned long, heap, nh)
+ ctf_integer(unsigned long, old_heap, oh)
+ )
+)
+
+#endif /* DYNTRACE_LTTNG_H */
+
+#undef TRACEPOINT_INCLUDE
+#define TRACEPOINT_INCLUDE "./dyntrace_lttng.h"
+
+/* This part must be outside protection */
+#include <lttng/tracepoint-event.h>
diff --git a/lib/runtime_tools/c_src/trace_file_drv.c b/lib/runtime_tools/c_src/trace_file_drv.c
index 8863b0d6ac..e7fd5968c1 100644
--- a/lib/runtime_tools/c_src/trace_file_drv.c
+++ b/lib/runtime_tools/c_src/trace_file_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -172,6 +172,7 @@ static ErlDrvData trace_file_start(ErlDrvPort port, char *buff);
static void trace_file_stop(ErlDrvData handle);
static void trace_file_output(ErlDrvData handle, char *buff,
ErlDrvSizeT bufflen);
+static void trace_file_outputv(ErlDrvData handle, ErlIOVec *ev);
static void trace_file_finish(void);
static ErlDrvSSizeT trace_file_control(ErlDrvData handle,
unsigned int command,
@@ -214,7 +215,7 @@ ErlDrvEntry trace_file_driver_entry = {
NULL, /* void * that is not used (BC) */
trace_file_control, /* F_PTR control, port_control callback */
trace_file_timeout, /* F_PTR timeout, driver_set_timer callback */
- NULL, /* F_PTR outputv, reserved */
+ trace_file_outputv, /* F_PTR outputv, reserved */
NULL, /* ready_async */
NULL, /* flush */
NULL, /* call */
@@ -363,6 +364,16 @@ static void trace_file_stop(ErlDrvData handle)
/*
** Data sent from erlang to port.
*/
+static void trace_file_outputv(ErlDrvData handle, ErlIOVec *ev)
+{
+ int i;
+ for (i = 0; i < ev->vsize; i++) {
+ if (ev->iov[i].iov_len)
+ trace_file_output(handle, ev->iov[i].iov_base,
+ ev->iov[i].iov_len);
+ }
+}
+
static void trace_file_output(ErlDrvData handle, char *buff,
ErlDrvSizeT bufflen)
{
diff --git a/lib/runtime_tools/c_src/trace_ip_drv.c b/lib/runtime_tools/c_src/trace_ip_drv.c
index 5b43f8179e..c73630f702 100644
--- a/lib/runtime_tools/c_src/trace_ip_drv.c
+++ b/lib/runtime_tools/c_src/trace_ip_drv.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2012. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/doc/src/LTTng.xml b/lib/runtime_tools/doc/src/LTTng.xml
new file mode 100644
index 0000000000..4a87133c57
--- /dev/null
+++ b/lib/runtime_tools/doc/src/LTTng.xml
@@ -0,0 +1,461 @@
+<?xml version="1.0" encoding="utf8" ?>
+<!DOCTYPE chapter SYSTEM "chapter.dtd">
+<chapter>
+ <header>
+ <copyright>
+ <year>2016</year><year>2016</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ </legalnotice>
+
+ <title>LTTng and Erlang/OTP</title>
+ <prepared></prepared>
+ <responsible></responsible>
+ <docno></docno>
+ <approved></approved>
+ <checked></checked>
+ <date>2016-04-27</date>
+ <rev></rev>
+ <file>LTTng.xml</file>
+ </header>
+
+ <section>
+ <title>Introduction</title>
+ <p>The Linux Trace Toolkit: next generation is an open source system software package
+ for correlated tracing of the Linux kernel, user applications and libraries. </p>
+ <p>For more information, please visit <url href="http://lttng.org">http://lttng.org</url></p>
+ </section>
+
+ <section>
+ <title>Building Erlang/OTP with LTTng support</title>
+ <p>
+ Configure and build Erlang with LTTng support:
+ </p>
+ <p>For LTTng to work properly with Erlang/OTP you need
+ the following packages installed:</p>
+
+ <list type="bulleted">
+ <item><p>LTTng-tools: a command line interface to control tracing sessions.</p></item>
+ <item><p>LTTng-UST: user space tracing library.</p></item>
+ </list>
+
+ <p>On Ubuntu this can be installed via <c>aptitude</c>:</p>
+
+ <code type="none">$ sudo aptitude install lttng-tools liblttng-ust-dev</code>
+ <p>See <url href="http://lttng.org/docs/#doc-installing-lttng">Installing LTTng</url>
+ for more information on how to install LTTng on your system.</p>
+
+ <p>After LTTng is properly installed on the system Erlang/OTP can be built with LTTng support.</p>
+
+
+<code type="none">$ ./configure --with-dynamic-trace=lttng
+$ make </code>
+ </section>
+
+ <section>
+ <title>Dyntrace Tracepoints</title>
+ <p>All tracepoints are in the domain of <c>com_ericsson_dyntrace</c></p>
+ <p>All Erlang types are the string equivalent in LTTng.</p>
+
+ <p><em>process_spawn</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>parent : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>entry : string</c> :: Code Location. Ex. <c>"lists:sort/1"</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">process_spawn: { cpu_id = 3 }, { pid = "&lt;0.131.0&gt;", parent = "&lt;0.130.0&gt;", entry = "erlang:apply/2" }</code></p>
+
+ <p><em>process_link</em></p>
+ <list type="bulleted">
+ <item><c>to : string</c> :: Process ID or Port ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>from : string</c> :: Process ID or Port ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>type : string</c> :: <c>"link" | "unlink"</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">process_link: { cpu_id = 3 }, { from = "&lt;0.130.0&gt;", to = "&lt;0.131.0&gt;", type = "link" }</code></p>
+
+
+ <p><em>process_exit</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>reason : string</c> :: Exit reason. Ex. <c>"normal"</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">process_exit: { cpu_id = 3 }, { pid = "&lt;0.130.0&gt;", reason = "normal" }</code></p>
+
+ <p><em>process_register</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>name : string</c> :: Registered name. Ex. <c>"error_logger"</c></item>
+ <item><c>type : string</c> :: <c>"register" | "unregister"</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">process_register: { cpu_id = 0 }, { pid = "&lt;0.128.0&gt;", name = "dyntrace_lttng_SUITE" type = "register" }</code></p>
+
+ <p><em>process_scheduled</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>entry : string</c> :: Code Location. Ex. <c>"lists:sort/1"</c></item>
+ <item><c>type : string</c> :: <c>"in" | "out" | "in_exiting" | "out_exiting" | "out_exited"</c></item>
+ </list>
+
+ <p>Example:</p>
+ <p><code type="none">process_scheduled: { cpu_id = 0 }, { pid = "&lt;0.136.0&gt;", entry = "erlang:apply/2", type = "in" }</code></p>
+
+
+ <p><em>port_open</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>driver : string</c> :: Driver name. Ex. <c>"efile"</c></item>
+ <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
+ </list>
+
+ <p>Example:</p>
+ <p><code type="none">port_open: { cpu_id = 5 }, { pid = "&lt;0.131.0&gt;", driver = "'/bin/sh -s unix:cmd'", port = "#Port&lt;0.1887&gt;" }</code></p>
+
+ <p><em>port_exit</em></p>
+ <list type="bulleted">
+ <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
+ <item><c>reason : string</c> :: Exit reason. Ex. <c>"normal"</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">port_exit: { cpu_id = 5 }, { port = "#Port&lt;0.1887&gt;", reason = "normal" }</code></p>
+
+ <p><em>port_link</em></p>
+ <list type="bulleted">
+ <item><c>to : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>from : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>type : string</c> :: <c>"link" | "unlink"</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">port_link: { cpu_id = 5 }, { from = "#Port&lt;0.1887&gt;", to = "&lt;0.131.0&gt;", type = "unlink" }</code></p>
+
+ <p><em>port_scheduled</em></p>
+ <list type="bulleted">
+ <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
+ <item><c>entry : string</c> :: Callback. Ex. <c>"open"</c></item>
+ <item><c>type : string</c> :: <c>"in" | "out" | "in_exiting" | "out_exiting" | "out_exited"</c></item>
+ </list>
+
+ <p>Example:</p>
+ <p><code type="none">port_scheduled: { cpu_id = 5 }, { pid = "#Port&lt;0.1905&gt;", entry = "close", type = "out" }</code></p>
+
+ <p><em>function_call</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>entry : string</c> :: Code Location. Ex. <c>"lists:sort/1"</c></item>
+ <item><c>depth : integer</c> :: Stack depth. Ex. <c>0</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">function_call: { cpu_id = 5 }, { pid = "&lt;0.145.0&gt;", entry = "dyntrace_lttng_SUITE:'-t_call/1-fun-1-'/0", depth = 0 }</code></p>
+
+ <p><em>function_return</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>entry : string</c> :: Code Location. Ex. <c>"lists:sort/1"</c></item>
+ <item><c>depth : integer</c> :: Stack depth. Ex. <c>0</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">function_return: { cpu_id = 5 }, { pid = "&lt;0.145.0&gt;", entry = "dyntrace_lttng_SUITE:waiter/0", depth = 0 }</code></p>
+
+ <p><em>function_exception</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>entry : string</c> :: Code Location. Ex. <c>"lists:sort/1"</c></item>
+ <item><c>class : string</c> :: Error reason. Ex. <c>"error"</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">function_exception: { cpu_id = 5 }, { pid = "&lt;0.144.0&gt;", entry = "t:call_exc/1", class = "error" }</code></p>
+
+ <p><em>message_send</em></p>
+ <list type="bulleted">
+ <item><c>from : string</c> :: Process ID or Port ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>to : string</c> :: Process ID or Port ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>message : string</c> :: Message sent. Ex. <c>"{&lt;0.162.0&gt;,ok}"</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">message_send: { cpu_id = 3 }, { from = "#Port&lt;0.1938&gt;", to = "&lt;0.160.0&gt;", message = "{#Port&lt;0.1938&gt;,eof}" }</code></p>
+
+ <p><em>message_receive</em></p>
+ <list type="bulleted">
+ <item><c>to : string</c> :: Process ID or Port ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>message : string</c> :: Message received. Ex. <c>"{&lt;0.162.0&gt;,ok}"</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">message_receive: { cpu_id = 7 }, { to = "&lt;0.167.0&gt;", message = "{&lt;0.165.0&gt;,ok}" }</code></p>
+
+ <p><em>gc_minor_start</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>need : integer</c> :: Heap need. Ex. <c>2</c></item>
+ <item><c>heap : integer</c> :: Young heap word size. Ex. <c>233</c></item>
+ <item><c>old_heap : integer</c> :: Old heap word size. Ex. <c>233</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">gc_minor_start: { cpu_id = 0 }, { pid = "&lt;0.172.0&gt;", need = 0, heap = 610, old_heap = 0 }</code></p>
+
+ <p><em>gc_minor_end</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>reclaimed : integer</c> :: Heap reclaimed. Ex. <c>2</c></item>
+ <item><c>heap : integer</c> :: Young heap word size. Ex. <c>233</c></item>
+ <item><c>old_heap : integer</c> :: Old heap word size. Ex. <c>233</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">gc_minor_end: { cpu_id = 0 }, { pid = "&lt;0.172.0&gt;", reclaimed = 120, heap = 1598, old_heap = 1598 }</code></p>
+
+ <p><em>gc_major_start</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>need : integer</c> :: Heap need. Ex. <c>2</c></item>
+ <item><c>heap : integer</c> :: Young heap word size. Ex. <c>233</c></item>
+ <item><c>old_heap : integer</c> :: Old heap word size. Ex. <c>233</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">gc_major_start: { cpu_id = 0 }, { pid = "&lt;0.172.0&gt;", need = 8, heap = 2586, old_heap = 1598 }</code></p>
+
+ <p><em>gc_major_end</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>reclaimed : integer</c> :: Heap reclaimed. Ex. <c>2</c></item>
+ <item><c>heap : integer</c> :: Young heap word size. Ex. <c>233</c></item>
+ <item><c>old_heap : integer</c> :: Old heap word size. Ex. <c>233</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">gc_major_end: { cpu_id = 0 }, { pid = "&lt;0.172.0&gt;", reclaimed = 240, heap = 4185, old_heap = 0 }</code></p>
+
+ </section>
+
+ <section>
+ <title>BEAM Tracepoints</title>
+ <p>All tracepoints are in the domain of <c>com_ericsson_otp</c></p>
+ <p>All Erlang types are the string equivalent in LTTng.</p>
+
+ <p><em>scheduler_poll</em></p>
+ <list type="bulleted">
+ <item><c>scheduler : integer</c> :: Scheduler ID. Ex. <c>1</c></item>
+ <item><c>runnable : integer</c> :: Runnable. Ex. <c>1</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">scheduler_poll: { cpu_id = 4 }, { scheduler = 1, runnable = 1 }</code></p>
+
+ <p><em>driver_init</em></p>
+ <list type="bulleted">
+ <item><c>driver : string</c> :: Driver name. Ex. <c>"efile"</c></item>
+ <item><c>major : integer</c> :: Major version. Ex. <c>3</c></item>
+ <item><c>minor : integer</c> :: Minor version. Ex. <c>1</c></item>
+ <item><c>flags : integer</c> :: Flags. Ex. <c>1</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">driver_init: { cpu_id = 2 }, { driver = "caller_drv", major = 3, minor = 3, flags = 1 }</code></p>
+
+ <p><em>driver_start</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>driver : string</c> :: Driver name. Ex. <c>"efile"</c></item>
+ <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">driver_start: { cpu_id = 2 }, { pid = "&lt;0.198.0&gt;", driver = "caller_drv", port = "#Port&lt;0.3676&gt;" }</code></p>
+
+ <p><em>driver_output</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
+ <item><c>driver : string</c> :: Driver name. Ex. <c>"efile"</c></item>
+ <item><c>bytes : integer</c> :: Size of data returned. Ex. <c>82</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">driver_output: { cpu_id = 2 }, { pid = "&lt;0.198.0&gt;", port = "#Port&lt;0.3677&gt;", driver = "/bin/sh -s unix:cmd", bytes = 36 }</code></p>
+
+ <p><em>driver_outputv</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
+ <item><c>driver : string</c> :: Driver name. Ex. <c>"efile"</c></item>
+ <item><c>bytes : integer</c> :: Size of data returned. Ex. <c>82</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">driver_outputv: { cpu_id = 5 }, { pid = "&lt;0.194.0&gt;", port = "#Port&lt;0.3663&gt;", driver = "tcp_inet", bytes = 3 }</code></p>
+
+ <p><em>driver_ready_input</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
+ <item><c>driver : string</c> :: Driver name. Ex. <c>"efile"</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">driver_ready_input: { cpu_id = 5 }, { pid = "&lt;0.189.0&gt;", port = "#Port&lt;0.3637&gt;", driver = "inet_gethost 4 " }</code></p>
+
+ <p><em>driver_ready_output</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
+ <item><c>driver : string</c> :: Driver name. Ex. <c>"efile"</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">driver_ready_output: { cpu_id = 5 }, { pid = "&lt;0.194.0&gt;", port = "#Port&lt;0.3663&gt;", driver = "tcp_inet" }</code></p>
+
+ <p><em>driver_timeout</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
+ <item><c>driver : string</c> :: Driver name. Ex. <c>"efile"</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">driver_timeout: { cpu_id = 5 }, { pid = "&lt;0.196.0&gt;", port = "#Port&lt;0.3664&gt;", driver = "tcp_inet" }</code></p>
+
+ <p><em>driver_stop_select</em></p>
+ <list type="bulleted">
+ <item><c>driver : string</c> :: Driver name. Ex. <c>"efile"</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">driver_stop_select: { cpu_id = 5 }, { driver = "unknown" }</code></p>
+
+ <p><em>driver_flush</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
+ <item><c>driver : string</c> :: Driver name. Ex. <c>"efile"</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">driver_flush: { cpu_id = 7 }, { pid = "&lt;0.204.0&gt;", port = "#Port&lt;0.3686&gt;", driver = "tcp_inet" }</code></p>
+
+ <p><em>driver_stop</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
+ <item><c>driver : string</c> :: Driver name. Ex. <c>"efile"</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">driver_stop: { cpu_id = 5 }, { pid = "[]", port = "#Port&lt;0.3673&gt;", driver = "efile" }</code></p>
+
+ <p><em>driver_process_exit</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
+ <item><c>driver : string</c> :: Driver name. Ex. <c>"efile"</c></item>
+ </list>
+
+ <p><em>driver_ready_async</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
+ <item><c>driver : string</c> :: Driver name. Ex. <c>"efile"</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">driver_ready_async: { cpu_id = 3 }, { pid = "&lt;0.181.0&gt;", port = "#Port&lt;0.3622&gt;", driver = "efile" }</code></p>
+
+ <p><em>driver_call</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
+ <item><c>driver : string</c> :: Driver name. Ex. <c>"efile"</c></item>
+ <item><c>command : integer</c> :: Command integer. Ex. <c>1</c></item>
+ <item><c>bytes : integer</c> :: Size of data returned. Ex. <c>82</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">driver_call: { cpu_id = 2 }, { pid = "&lt;0.202.0&gt;", port = "#Port&lt;0.3676&gt;", driver = "caller_drv", command = 0, bytes = 2 }</code></p>
+
+ <p><em>driver_control</em></p>
+ <list type="bulleted">
+ <item><c>pid : string</c> :: Process ID. Ex. <c>"&lt;0.131.0&gt;"</c></item>
+ <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
+ <item><c>driver : string</c> :: Driver name. Ex. <c>"efile"</c></item>
+ <item><c>command : integer</c> :: Command integer. Ex. <c>1</c></item>
+ <item><c>bytes : integer</c> :: Size of data returned. Ex. <c>82</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">driver_control: { cpu_id = 3 }, { pid = "&lt;0.32767.8191&gt;", port = "#Port&lt;0.0&gt;", driver = "forker", command = 83, bytes = 32 }</code></p>
+
+ <p><em>aio_pool_get</em></p>
+ <list type="bulleted">
+ <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
+ <item><c>length : integer</c> :: Async queue length. Ex. <c>0</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">aio_pool_get: { cpu_id = 4 }, { port = "#Port&lt;0.3614&gt;", length = 0 }</code></p>
+
+ <p><em>aio_pool_put</em></p>
+ <list type="bulleted">
+ <item><c>port : string</c> :: Port ID. Ex. <c>"#Port&lt;0.1031&gt;"</c></item>
+ <item><c>length : integer</c> :: Async queue length. Ex. <c>-1</c></item>
+ </list>
+ <p>Async queue length is not defined for <c>put</c> operations.</p>
+ <p>Example:</p>
+ <p><code type="none">aio_pool_put: { cpu_id = 3 }, { port = "#Port&lt;0.3614&gt;", length = -1 }</code></p>
+
+ <p><em>carrier_create</em></p>
+ <list type="bulleted">
+ <item><c>type : string</c> :: Carrier type. Ex. <c>"ets_alloc"</c></item>
+ <item><c>instance : integer</c> :: Allocator instance. Ex. <c>1</c></item>
+ <item><c>size : integer</c> :: Carrier size. Ex. <c>262144</c></item>
+ <item><c>mbc_carriers : integer</c> :: Number of multiblock carriers in instance. Ex. <c>3</c></item>
+ <item><c>mbc_carriers_size : integer</c> :: Total size of multiblock blocks carriers in instance. Ex. <c>1343488</c></item>
+ <item><c>mbc_blocks : integer</c> :: Number of multiblock blocks in instance. Ex. <c>122</c></item>
+ <item><c>mbc_blocks_size : integer</c> :: Total size of all multiblock blocks in instance. Ex. <c>285296</c></item>
+ <item><c>sbc_carriers : integer</c> :: Number of singleblock carriers in instance. Ex. <c>1</c></item>
+ <item><c>sbc_carriers_size : integer</c> :: Total size of singleblock blocks carriers in instance. Ex. <c>1343488</c></item>
+ <item><c>sbc_blocks : integer</c> :: Number of singleblocks in instance. Ex. <c>1</c></item>
+ <item><c>sbc_blocks_size : integer</c> :: Total size of all singleblock blocks in instance. Ex. <c>285296</c></item>
+
+ </list>
+ <p>Example:</p>
+ <p><code type="none">carrier_create: { cpu_id = 2 }, { type = "ets_alloc", instance = 7, size = 2097152, mbc_carriers = 4, mbc_carriers_size = 3440640, mbc_blocks = 526, mbc_blocks_size = 1278576, sbc_carriers = 0, sbc_carriers_size = 0, sbc_blocks = 0, sbc_blocks_size = 0 }</code></p>
+
+ <p><em>carrier_destroy</em></p>
+ <list type="bulleted">
+ <item><c>type : string</c> :: Carrier type. Ex. <c>"ets_alloc"</c></item>
+ <item><c>instance : integer</c> :: Allocator instance. Ex. <c>1</c></item>
+ <item><c>size : integer</c> :: Carrier size. Ex. <c>262144</c></item>
+ <item><c>mbc_carriers : integer</c> :: Number of multiblock carriers in instance. Ex. <c>3</c></item>
+ <item><c>mbc_carriers_size : integer</c> :: Total size of multiblock blocks carriers in instance. Ex. <c>1343488</c></item>
+ <item><c>mbc_blocks : integer</c> :: Number of multiblock blocks in instance. Ex. <c>122</c></item>
+ <item><c>mbc_blocks_size : integer</c> :: Total size of all multiblock blocks in instance. Ex. <c>285296</c></item>
+ <item><c>sbc_carriers : integer</c> :: Number of singleblock carriers in instance. Ex. <c>1</c></item>
+ <item><c>sbc_carriers_size : integer</c> :: Total size of singleblock blocks carriers in instance. Ex. <c>1343488</c></item>
+ <item><c>sbc_blocks : integer</c> :: Number of singleblocks in instance. Ex. <c>1</c></item>
+ <item><c>sbc_blocks_size : integer</c> :: Total size of all singleblock blocks in instance. Ex. <c>285296</c></item>
+
+ </list>
+ <p>Example:</p>
+ <p><code type="none">carrier_destroy: { cpu_id = 6 }, { type = "ets_alloc", instance = 7, size = 262144, mbc_carriers = 3, mbc_carriers_size = 3178496, mbc_blocks = 925, mbc_blocks_size = 2305336, sbc_carriers = 0, sbc_carriers_size = 0, sbc_blocks = 0, sbc_blocks_size = 0 }</code></p>
+
+ <p><em>carrier_pool_put</em></p>
+ <list type="bulleted">
+ <item><c>type : string</c> :: Carrier type. Ex. <c>"ets_alloc"</c></item>
+ <item><c>instance : integer</c> :: Allocator instance. Ex. <c>1</c></item>
+ <item><c>size : integer</c> :: Carrier size. Ex. <c>262144</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">carrier_pool_put: { cpu_id = 3 }, { type = "ets_alloc", instance = 5, size = 1048576 }</code></p>
+
+ <p><em>carrier_pool_get</em></p>
+ <list type="bulleted">
+ <item><c>type : string</c> :: Carrier type. Ex. <c>"ets_alloc"</c></item>
+ <item><c>instance : integer</c> :: Allocator instance. Ex. <c>1</c></item>
+ <item><c>size : integer</c> :: Carrier size. Ex. <c>262144</c></item>
+ </list>
+ <p>Example:</p>
+ <p><code type="none">carrier_pool_get: { cpu_id = 7 }, { type = "ets_alloc", instance = 4, size = 3208 }</code></p>
+
+ </section>
+
+
+ <section>
+ <title>Examples</title>
+ </section>
+</chapter>
diff --git a/lib/runtime_tools/doc/src/Makefile b/lib/runtime_tools/doc/src/Makefile
index 38725807ae..5ce40bb995 100644
--- a/lib/runtime_tools/doc/src/Makefile
+++ b/lib/runtime_tools/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2012. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ XML_REF3_FILES = dbg.xml dyntrace.xml erts_alloc_config.xml system_information.x
XML_REF6_FILES = runtime_tools_app.xml
XML_PART_FILES = part_notes.xml part_notes_history.xml part.xml
-XML_CHAPTER_FILES = notes.xml notes_history.xml
+XML_CHAPTER_FILES = notes.xml notes_history.xml LTTng.xml
GENERATED_XML_FILES = DTRACE.xml SYSTEMTAP.xml
diff --git a/lib/runtime_tools/doc/src/book.xml b/lib/runtime_tools/doc/src/book.xml
index 0e75ec28bb..e2ab4c6f62 100644
--- a/lib/runtime_tools/doc/src/book.xml
+++ b/lib/runtime_tools/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/runtime_tools/doc/src/dbg.xml b/lib/runtime_tools/doc/src/dbg.xml
index 2065627026..0128e23a47 100644
--- a/lib/runtime_tools/doc/src/dbg.xml
+++ b/lib/runtime_tools/doc/src/dbg.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -36,14 +36,30 @@
<modulesummary>The Text Based Trace Facility</modulesummary>
<description>
<p>This module implements a text based interface to the
- <c>trace/3</c> and the <c>trace_pattern/2</c> BIFs. It makes it
- possible to trace functions, processes and messages on text based
- terminals. It can be used instead of, or as complement to, the
- <c>pman</c> module.
- </p>
- <p>For some examples of how to use <c>dbg</c> from the Erlang
+ <c><seealso marker="erts:erlang#trace-3">trace/3</seealso></c> and the
+ <c><seealso marker="erts:erlang#trace_pattern-2">trace_pattern/2</seealso></c> BIFs. It makes it
+ possible to trace functions, processes, ports and messages.
+ </p>
+ <p>
+ To quickly get started on tracing function calls you can use the following
+ code in the Erlang shell:
+ </p>
+ <pre>
+1> dbg:tracer(). %% Start the default trace message receiver
+{ok,&lt;0.36.0>}
+2> dbg:p(all, c). %% Setup call (c) tracing on all processes
+{ok,[{matched,nonode@nohost,26}]}
+3> dbg:tp(lists, seq, x). %% Setup an exception return trace (x) on lists:seq
+{ok,[{matched,nonode@nohost,2},{saved,x}]}
+4> lists:seq(1,10).
+(&lt;0.34.0>) call lists:seq(1,10)
+(&lt;0.34.0>) returned from lists:seq/2 -> [1,2,3,4,5,6,7,8,9,10]
+[1,2,3,4,5,6,7,8,9,10]
+ </pre>
+ <p>
+ For more examples of how to use <c>dbg</c> from the Erlang
shell, see the <seealso marker="#simple_example">simple example</seealso> section.
- </p>
+ </p>
<p>The utilities are also suitable to use in system testing on
large systems, where other tools have too much impact on the
system performance. Some primitive support for sequential tracing
@@ -164,53 +180,66 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
<desc>
<p>Traces <c>Item</c> in accordance to the value specified
by <c>Flags</c>. The variation of <c>Item</c> is listed below:</p>
- <list type="bulleted">
- <item>If the <c>Item</c> is a <c>pid()</c>, the corresponding
- process is traced. The process may be a remote process
- (on another Erlang node). The node must be in the list of
- traced nodes (see <seealso marker="#n"><c>n/1</c></seealso> and
- <c>tracer/0/2/3</c>).</item>
- <item>If the <c>Item</c> is the atom <c>all</c>, all processes in the
- system as well as all processes created hereafter are
- to be traced. This also affects all nodes added with the
- <c>n/1</c> or <c>tracer/0/2/3</c> function.</item>
- <item>If the <c>Item</c> is the atom <c>new</c>, no currently existing
- processes are affected, but every process created after the
- call is.This also affects all nodes added with the
- <c>n/1</c> or <c>tracer/0/2/3</c> function.</item>
- <item>If the <c>Item</c> is the atom <c>existing</c>, all
- existing processes are traced, but new processes will not
- be affected.This also affects all nodes added with the
- <c>n/1</c> or <c>tracer/0/2/3</c> function.</item>
- <item>If the <c>Item</c> is an atom other than <c>all</c>,
- <c>new</c> or <c>existing</c>, the process with the
- corresponding registered name is traced.The process may be a
- remote process (on another Erlang node). The node must be added
- with the <c>n/1</c> or <c>tracer/0/2/3</c> function.</item>
- <item>If the <c>Item</c> is an integer, the process <c><![CDATA[<0.Item.0>]]></c> is
- traced.</item>
- <item>If the <c>Item</c> is a tuple <c>{X, Y, Z}</c>, the
- process <c><![CDATA[<X.Y.Z>]]></c> is
- traced. </item>
+ <taglist>
+ <tag><c>pid()</c> or <c>port()</c></tag>
+ <item>The corresponding process or port is traced. The process or port may
+ be a remote process or port (on another Erlang node). The node must
+ be in the list of traced nodes (see <seealso marker="#n-1"><c>n/1</c></seealso>
+ and <c><seealso marker="#tracer-3">tracer/3</seealso></c>).</item>
+ <tag><c>all</c></tag>
+ <item>All processes and ports in the system as well as all processes and ports
+ created hereafter are to be traced.</item>
+ <tag><c>all_processes</c></tag>
+ <item>All processes in the system as well as all processes created hereafter are to be traced.</item>
+ <tag><c>all_ports</c></tag>
+ <item>All ports in the system as well as all ports created hereafter are to be traced.</item>
+ <tag><c>new</c></tag>
+ <item>All processes and ports created after the call is are to be traced.</item>
+ <tag><c>new_processes</c></tag>
+ <item>All processes created after the call is are to be traced.</item>
+ <tag><c>new_ports</c></tag>
+ <item>All ports created after the call is are to be traced.</item>
+ <tag><c>existing</c></tag>
+ <item>All existing processes and ports are traced.</item>
+ <tag><c>existing_processes</c></tag>
+ <item>All existing processes are traced.</item>
+ <tag><c>existing_ports</c></tag>
+ <item>All existing ports are traced.</item>
+ <tag><c>atom()</c></tag>
+ <item>The process or port with the corresponding registered name is traced. The process or
+ port may be a remote process (on another Erlang node). The node must be
+ added with the <c><seealso marker="#n-1">n/1</seealso></c> or
+ <c><seealso marker="#tracer-3">tracer/3</seealso></c> function.</item>
+ <tag><c>integer()</c></tag>
+ <item>The process <c><![CDATA[<0.Item.0>]]></c> is traced.</item>
+ <tag><c>{X, Y, Z}</c></tag>
+ <item>The process <c><![CDATA[<X.Y.Z>]]></c> is traced. </item>
+ <tag><c>string()</c></tag>
<item>If the <c>Item</c> is a string <![CDATA["<X.Y.Z>"]]>
- as returned from <c>pid_to_list/1</c>, the process
+ as returned from <c><seealso marker="erts:erlang#pid_to_list-1">pid_to_list/1</seealso></c>, the process
<c><![CDATA[<X.Y.Z>]]></c> is traced. </item>
- </list>
+ </taglist>
+
+ <p>When enabling an <c>Item</c> that represents a group of processes,
+ the <c>Item</c> is enabled on all nodes added with the
+ <c><seealso marker="#n-1">n/1</seealso></c> or
+ <c><seealso marker="#tracer-3">tracer/3</seealso></c> function.</p>
+
<p><c>Flags</c> can be a single atom,
or a list of flags. The available flags are:
</p>
<taglist>
<tag><c>s (send)</c></tag>
<item>
- <p>Traces the messages the process sends.</p>
+ <p>Traces the messages the process or port sends.</p>
</item>
<tag><c>r (receive)</c></tag>
<item>
- <p>Traces the messages the process receives.</p>
+ <p>Traces the messages the process or port receives.</p>
</item>
<tag><c>m (messages)</c></tag>
<item>
- <p>Traces the messages the process receives and sends.</p>
+ <p>Traces the messages the process or port receives and sends.</p>
</item>
<tag><c>c (call)</c></tag>
<item>
@@ -221,6 +250,10 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
<item>
<p>Traces process related events to the process.</p>
</item>
+ <tag><c>ports</c></tag>
+ <item>
+ <p>Traces port related events to the port.</p>
+ </item>
<tag><c>sos (set on spawn)</c></tag>
<item>
<p>Lets all processes created by the traced
@@ -241,8 +274,8 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
<tag><c>sofl (set on first link)</c></tag>
<item>
<p>This is the same as <c>sol</c>, but only for
- the first call to
- <c>link/1</c> by the traced process.</p>
+ the first call to
+ <c><seealso marker="erts:erlang#link-1">link/1</seealso></c> by the traced process.</p>
</item>
<tag><c>all</c></tag>
<item>
@@ -255,10 +288,10 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
</item>
</taglist>
<p>The list can also include any of the flags allowed in
- <c>erlang:trace/3</c></p>
+ <c><seealso marker="erts:erlang#trace-3">erlang:trace/3</seealso></c></p>
<p>The function returns either an error tuple or a tuple
<c>{ok, List}</c>. The <c>List</c> consists of
- specifications of how many processes that matched (in the
+ specifications of how many processes and ports that matched (in the
case of a pure pid() exactly 1). The specification of
matched processes is <c>{matched, Node, N}</c>. If the
remote processor call,<c>rpc</c>, to a remote node fails,
@@ -286,9 +319,9 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
</func>
<func>
<name>i() -> ok</name>
- <fsummary>Display information about all traced processes.</fsummary>
+ <fsummary>Display information about all traced processes and ports.</fsummary>
<desc>
- <p>Displays information about all traced processes.</p>
+ <p>Displays information about all traced processes and ports.</p>
</desc>
</func>
<func>
@@ -327,35 +360,41 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
</type>
<desc>
<p>This function enables call trace for one or more
- functions. All exported functions matching the <c>{Module, Function, Arity}</c> argument will be concerned, but the
+ functions. All exported functions matching the <c>{Module, Function, Arity}</c>
+ argument will be concerned, but the
<c>match_spec()</c> may further narrow down the set of function
calls generating trace messages.</p>
<p>For a description of the <c>match_spec()</c> syntax,
please turn to the
<em>User's guide</em> part of the online
documentation for the runtime system (<em>erts</em>). The
- chapter <em>Match Specification in Erlang</em> explains the
- general match specification "language".</p>
+ chapter <em><seealso marker="erts:match_spec">Match Specifications in Erlang</seealso></em>
+ explains the general match specification "language".
+ The most common generic match specifications used can be
+ found as <c>Built-inAlias</c>', see
+ <c><seealso marker="#ltp-0">ltp/0</seealso></c> below for details.
+ </p>
<p>The Module, Function and/or Arity parts of the tuple may
be specified as the atom <c>'_'</c> which is a "wild-card"
matching all modules/functions/arities. Note, if the
Module is specified as <c>'_'</c>, the Function and Arity
parts have to be specified as '_' too. The same holds for the
Functions relation to the Arity.</p>
- <p>All nodes added with <c>n/1</c> or <c>tracer/0/2/3</c> will
+ <p>All nodes added with <c><seealso marker="#n-1">n/1</seealso></c> or
+ <c><seealso marker="#tracer-3">tracer/3</seealso></c> will
be affected by this call, and if Module is not <c>'_'</c>
the module will be loaded on all nodes.</p>
<p>The function returns either an error tuple or a tuple
<c>{ok, List}</c>. The <c>List</c> consists of specifications of how
- many functions that matched, in the same way as the processes
- are presented in the return value of <c>p/2</c>. </p>
+ many functions that matched, in the same way as the processes and ports
+ are presented in the return value of <c><seealso marker="#p-2">p/2</seealso></c>. </p>
<p>There may be a tuple <c>{saved, N}</c> in the return value,
if the MatchSpec is other
than []. The integer <c>N</c> may then be used in
subsequent calls to this function and will stand as an
"alias" for the given expression. There are also a couple of
- built-in aliases for common expressions, see <c>ltp/0</c> below
- for details.</p>
+ built-in aliases for common expressions, see
+ <c><seealso marker="#ltp-0">ltp/0</seealso></c> below for details.</p>
<p>If an error is returned, it can be due to errors in
compilation of the match specification. Such errors are
presented as a list of tuples <c>{error, string()}</c> where
@@ -394,7 +433,7 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
<name>tpl({Module, Function, Arity}, MatchSpec) -> {ok, MatchDesc} | {error, term()}</name>
<fsummary>Set pattern for traced local (as well as global) function calls</fsummary>
<desc>
- <p>This function works as <c>tp/2</c>, but enables
+ <p>This function works as <c><seealso marker="#tp-2">tp/2</seealso></c>, but enables
tracing for local calls (and local functions) as well as for
global calls (and functions).</p>
</desc>
@@ -441,10 +480,10 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
<p>This function disables call tracing on the specified
functions. The semantics of the parameter is the same
as for the corresponding function specification in
- <c>tp/2</c> or <c>tpl/2</c>. Both local and global call trace
+ <c><seealso marker="#tp-2">tp/2</seealso></c> or <c><seealso marker="#tpl-2">tpl/2</seealso></c>. Both local and global call trace
is disabled. </p>
<p>The return value reflects how many functions that matched,
- and is constructed as described in <c>tp/2</c>. No tuple
+ and is constructed as described in <c><seealso marker="#tp-2">tp/2</seealso></c>. No tuple
<c>{saved, N}</c> is however ever returned (for obvious reasons).</p>
</desc>
</func>
@@ -480,8 +519,8 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
<name>ctpl({Module, Function, Arity}) -> {ok, MatchDesc} | {error, term()}</name>
<fsummary>Clear call trace pattern for the specified functions</fsummary>
<desc>
- <p>This function works as <c>ctp/1</c>, but only disables
- tracing set up with <c>tpl/2</c> (not with <c>tp/2</c>).</p>
+ <p>This function works as <c><seealso marker="#ctp-1">ctp/1</seealso></c>, but only disables
+ tracing set up with <c><seealso marker="#tpl-2">tpl/2</seealso></c> (not with <c><seealso marker="#tp-2">tp/2</seealso></c>).</p>
</desc>
</func>
<func>
@@ -516,8 +555,8 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
<name>ctpg({Module, Function, Arity}) -> {ok, MatchDesc} | {error, term()}</name>
<fsummary>Clear call trace pattern for the specified functions</fsummary>
<desc>
- <p>This function works as <c>ctp/1</c>, but only disables
- tracing set up with <c>tp/2</c> (not with <c>tpl/2</c>).</p>
+ <p>This function works as <c><seealso marker="#ctp-1">ctp/1</seealso></c>, but only disables
+ tracing set up with <c><seealso marker="#tp-2">tp/2</seealso></c> (not with <c><seealso marker="#tpl-2">tpl/2</seealso></c>).</p>
</desc>
</func>
<func>
@@ -526,13 +565,13 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
<desc>
<p>Use this function to recall all match specifications previously
used in the session (i. e. previously saved during calls
- to <c>tp/2</c>, and built-in match specifications.
+ to <c><seealso marker="#tp-2">tp/2</seealso></c>, and built-in match specifications.
This is very useful, as a complicated
match_spec can be quite awkward to write. Note that the
- match specifications are lost if <c>stop/0</c> is called.</p>
+ match specifications are lost if <c><seealso marker="#stop-0">stop/0</seealso></c> is called.</p>
<p>Match specifications used can be saved in a file (if a
read-write file system is present) for use in later
- debugging sessions, see <c>wtp/1</c> and <c>rtp/1</c></p>
+ debugging sessions, see <c><seealso marker="#wtp-1">wtp/1</seealso></c> and <c><seealso marker="#rtp-1">rtp/1</seealso></c></p>
<p>There are three built-in trace patterns:
<c>exception_trace</c>, <c>caller_trace</c>
and <c>caller_exception_trace</c> (or <c>x</c>, <c>c</c> and
@@ -555,10 +594,10 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
<fsummary>Delete all saved match specifications.</fsummary>
<desc>
<p>Use this function to "forget" all match specifications
- saved during calls to <c>tp/2</c>.
+ saved during calls to <c><seealso marker="#tp-2">tp/2</seealso></c>.
This is useful when one wants to restore other match
- specifications from a file with <c>rtp/1</c>. Use
- <c>dtp/1</c> to delete specific saved match specifications. </p>
+ specifications from a file with <c><seealso marker="#rtp-1">rtp/1</seealso></c>. Use
+ <c><seealso marker="#dtp-1">dtp/1</seealso></c> to delete specific saved match specifications. </p>
</desc>
</func>
<func>
@@ -569,7 +608,7 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
</type>
<desc>
<p>Use this function to "forget" a specific match specification
- saved during calls to <c>tp/2</c>.</p>
+ saved during calls to <c><seealso marker="#tp-2">tp/2</seealso></c>.</p>
</desc>
</func>
<func>
@@ -581,12 +620,12 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
</type>
<desc>
<p>This function will save all match specifications saved
- during the session (during calls to <c>tp/2</c>)
+ during the session (during calls to <c><seealso marker="#tp-2">tp/2</seealso></c>)
and built-in match specifications in a text
file with the name designated by <c>Name</c>. The format
of the file is textual, why it can be edited with an
ordinary text editor, and then restored with
- <c>rtp/1</c>. </p>
+ <c><seealso marker="#rtp-1">rtp/1</seealso></c>. </p>
<p>Each match spec in the file ends with a full stop
(<c>.</c>) and new (syntactically correct) match
specifications can be added to the file manually.</p>
@@ -604,7 +643,7 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
</type>
<desc>
<p>This function reads match specifications from a file
- (possibly) generated by the <c>wtp/1</c> function. It checks
+ (possibly) generated by the <c><seealso marker="#wtp-1">wtp/1</seealso></c> function. It checks
the syntax of all match specifications and verifies that
they are correct. The error handling principle is "all or
nothing", i. e. if some of the match specifications are
@@ -612,14 +651,14 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
saved match specifications for the running system. </p>
<p>The match specifications in the file are <em>merged</em>
with the current match specifications, so that no duplicates
- are generated. Use <c>ltp/0</c> to see what numbers were
+ are generated. Use <c><seealso marker="#ltp-0">ltp/0</seealso></c> to see what numbers were
assigned to the specifications from the file.</p>
<p>The function will return an error, either due to I/O
problems (like a non existing or non readable file) or due
to file format problems. The errors from a bad format file
are in a more or less textual format, which will give a hint
- to what's causing the problem. <marker id="n"></marker>
-</p>
+ to what's causing the problem.
+ </p>
</desc>
</func>
<func>
@@ -631,12 +670,12 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
</type>
<desc>
<p>The <c>dbg</c> server keeps a list of nodes where tracing
- should be performed. Whenever a <c>tp/2</c> call or a
- <c>p/2</c> call is made, it is executed for all nodes in this
- list including the local node (except for <c>p/2</c> with a
- specific <c>pid()</c> as first argument, in which case the
+ should be performed. Whenever a <c><seealso marker="#tp-2">tp/2</seealso></c> call or a
+ <c><seealso marker="#p-2">p/2</seealso></c> call is made, it is executed for all nodes in this
+ list including the local node (except for <c><seealso marker="#p-2">p/2</seealso></c> with a
+ specific <c>pid()</c> or <c>port()</c> as first argument, in which case the
command is executed only on the node where the designated
- process resides).
+ process or port resides).
</p>
<p>This function adds a remote node (<c>Nodename</c>) to the
list of nodes where tracing is performed. It starts a tracer
@@ -645,17 +684,17 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
distribution). If no tracer process is running on the local
node, the error reason <c>no_local_tracer</c> is returned. The
tracer process on the local node must be started with the
- <c>tracer/0/2</c> function.
+ <c><seealso marker="#tracer-2">tracer/0/2</seealso></c> function.
</p>
<p>If <c>Nodename</c> is the local node, the error reason
<c>cant_add_local_node</c> is returned.
</p>
- <p>If a trace port (see <seealso marker="#trace_port"><c>trace_port/2</c></seealso>) is
+ <p>If a trace port (see <seealso marker="#trace_port-2"><c>trace_port/2</c></seealso>) is
running on the local node, remote nodes can not be traced with
a tracer process. The error reason
<c>cant_trace_remote_pid_to_local_port</c> is returned. A
trace port can however be started on the remote node with the
- <c>tracer/3</c> function.
+ <c><seealso marker="#tracer-3">tracer/3</seealso></c> function.
</p>
<p>The function will also return an error if the node
<c>Nodename</c> is not reachable.</p>
@@ -669,7 +708,7 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
</type>
<desc>
<p>Clears a node from the list of traced nodes. Subsequent
- calls to <c>tp/2</c> and <c>p/2</c> will not consider that
+ calls to <c><seealso marker="#tp-2">tp/2</seealso></c> and <c><seealso marker="#p-2">p/2</seealso></c> will not consider that
node, but tracing already activated on the node will continue
to be in effect.</p>
<p>Returns <c>ok</c>, cannot fail.</p>
@@ -688,37 +727,42 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
<desc>
<p>This function starts a server on the local node that will
be the recipient of all trace messages. All subsequent calls
- to <c>p/2</c> will result in messages sent to the newly
+ to <c><seealso marker="#p-2">p/2</seealso></c> will result in messages sent to the newly
started trace server.</p>
<p>A trace server started in this way will simply display the
trace messages in a formatted way in the Erlang shell
- (i. e. use io:format). See <c>tracer/2</c> for a description
- of how the trace message handler can be customized. <marker id="tracer2"></marker>
-</p>
- <p>To start a similar tracer on a remote node, use <c>n/1</c>.</p>
+ (i. e. use io:format). See <c><seealso marker="#tracer-2">tracer/2</seealso></c> for a description
+ of how the trace message handler can be customized.
+ </p>
+ <p>To start a similar tracer on a remote node, use <c><seealso marker="#n-1">n/1</seealso></c>.</p>
</desc>
</func>
<func>
<name>tracer(Type, Data) -> {ok, pid()} | {error, Error}</name>
<fsummary>Start a tracer server with additional parameters</fsummary>
<type>
- <v>Type = port | process</v>
- <v>Data = PortGenerator | HandlerSpec</v>
- <v>HandlerSpec = {HandlerFun, InitialData}</v>
- <v>HandlerFun = fun() (two arguments)</v>
- <v>InitialData = term()</v>
+ <v>Type = port | process | module</v>
+ <v>Data = PortGenerator | HandlerSpec | ModuleSpec</v>
<v>PortGenerator = fun() (no arguments)</v>
<v>Error = term()</v>
+ <v>HandlerSpec = {HandlerFun, InitialData}</v>
+ <v>HandlerFun = fun() (two arguments)</v>
+ <v>ModuleSpec = fun() (no arguments) | {TracerModule, TracerState}</v>
+ <v>ModuleModule = atom()</v>
+ <v>InitialData = TracerState = term()</v>
</type>
<desc>
<p>This function starts a tracer server with additional
parameters on the local node. The first parameter, the
<c>Type</c>, indicates if trace messages should be handled
- by a receiving process (<c>process</c>) or by a tracer port
- (<c>port</c>). For a description about tracer ports see
- <c>trace_port/2</c>.
+ by a receiving process (<c>process</c>), by a tracer port
+ (<c>port</c>) or by a tracer module
+ (<c>module</c>). For a description about tracer ports see
+ <c><seealso marker="#trace_port-2">trace_port/2</seealso></c>
+ and for a tracer modules see
+ <c><seealso marker="erts:erl_tracer">erl_tracer</seealso>.</c>
</p>
- <p>If <c>Type</c> is a process, a message handler function can
+ <p>If <c>Type</c> is <c>process</c>, a message handler function can
be specified (<c>HandlerSpec</c>). The handler function, which
should be a <c>fun</c> taking two arguments, will be called
for each trace message, with the first argument containing the
@@ -729,18 +773,22 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
choose any appropriate action to take when invoked, and can
save a state for the next invocation by returning it.
</p>
- <p>If <c>Type</c> is a port, then the second parameter should
+ <p>If <c>Type</c> is <c>port</c>, then the second parameter should
be a <em>fun</em> which takes no arguments and returns a
newly opened trace port when called. Such a <em>fun</em> is
- preferably generated by calling <c>trace_port/2</c>.
+ preferably generated by calling <c><seealso marker="#trace_port-2">trace_port/2</seealso></c>.
</p>
+ <p>if <c>Type</c> is <c>module</c>, then the second parameter should
+ be either a tuple describing the <c><seealso marker="erts:erl_tracer">erl_tracer</seealso></c>
+ module to be used for tracing and the state to be used for
+ that tracer module or a fun returning the same tuple.</p>
<p>If an error is returned, it can either be due to a tracer
server already running (<c>{error,already_started}</c>) or
due to the <c>HandlerFun</c> throwing an exception.
</p>
<p>To start a similar tracer on a remote node, use
- <c>tracer/3</c>. <marker id="trace_port"></marker>
-</p>
+ <c><seealso marker="#tracer-3">tracer/3</seealso></c>.
+ </p>
</desc>
</func>
<func>
@@ -750,20 +798,19 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
<v>Nodename = atom()</v>
</type>
<desc>
- <p>This function is equivalent to <c>tracer/2</c>, but acts on
+ <p>This function is equivalent to <c><seealso marker="#tracer-2">tracer/2</seealso></c>, but acts on
the given node. A tracer is started on the node
- (<c>Nodename</c>) and the node is added to the list of traced
- nodes.
+ (<c>Nodename</c>) and the node is added to the list of traced nodes.
</p>
<note>
- <p>This function is not equivalent to <c>n/1</c>. While
- <c>n/1</c> starts a process tracer which redirects all trace
+ <p>This function is not equivalent to <c><seealso marker="#n-1">n/1</seealso></c>. While
+ <c><seealso marker="#n-1">n/1</seealso></c> starts a process tracer which redirects all trace
information to a process tracer on the local node (i.e. the
- trace control node), <c>tracer/3</c> starts a tracer of any
+ trace control node), <c><seealso marker="#tracer-3">tracer/3</seealso></c> starts a tracer of any
type which is independent of the tracer on the trace control
node.</p>
</note>
- <p>For details, see <seealso marker="#tracer2"><c>tracer/2</c></seealso>.</p>
+ <p>For details, see <c><seealso marker="#tracer-2">tracer/2</seealso></c>.</p>
</desc>
</func>
<func>
@@ -795,9 +842,9 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
<c>file</c> and the <c>ip</c> trace drivers. The file driver
sends all trace messages into one or several binary files,
from where they later can be fetched and processed with the
- <c>trace_client/2</c> function. The ip driver opens a TCP/IP
+ <c><seealso marker="#trace_client-2">trace_client/2</seealso></c> function. The ip driver opens a TCP/IP
port where it listens for connections. When a client
- (preferably started by calling <c>trace_client/2</c> on
+ (preferably started by calling <c><seealso marker="#trace_client-2">trace_client/2</seealso></c> on
another Erlang node) connects, all trace messages are sent
over the IP network for further processing by the remote
client. </p>
@@ -836,7 +883,7 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
as fast as they are produced by the runtime system, a special
message is sent, which indicates how many messages that are
dropped. That message will arrive at the handler function
- specified in <c>trace_client/3</c> as the tuple <c>{drop, N}</c> where <c>N</c> is the number of consecutive messages
+ specified in <c><seealso marker="#trace_client-3">trace_client/3</seealso></c> as the tuple <c>{drop, N}</c> where <c>N</c> is the number of consecutive messages
dropped. In case of heavy tracing, drop's are likely to occur,
and they surely occur if no client is reading the trace
messages.</p>
@@ -890,7 +937,7 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
</item>
<tag><c>get_listen_port</c></tag>
<item>
- <p>Returns <c>{ok, IpPort}</c> where <c>IpPort</c>is
+ <p>Returns <c>{ok, IpPort}</c> where <c>IpPort</c> is
the IP port number used by the driver listen socket.
Only the ip trace driver supports this operation.</p>
</item>
@@ -913,7 +960,7 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
<desc>
<p>This function starts a trace client that reads the output
created by a trace port driver and handles it in mostly the
- same way as a tracer process created by the <c>tracer/0</c>
+ same way as a tracer process created by the <c><seealso marker="#tracer-0">tracer/0</seealso></c>
function.</p>
<p>If <c>Type</c> is <c>file</c>, the client reads all trace
messages stored in the file named <c>Filename</c> or
@@ -925,7 +972,7 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\
<p>If <c>Type</c> is <c>follow_file</c>, the client behaves as
in the <c>file</c> case, but keeps trying to read (and
process) more data
- from the file until stopped by <c>stop_trace_client/1</c>.
+ from the file until stopped by <c><seealso marker="#stop_trace_client-1">stop_trace_client/1</seealso></c>.
<c>WrapFilesSpec</c> is not allowed as second argument
for this <c>Type</c>.</p>
<p>If <c>Type</c> is <c>ip</c>, the client connects to the
@@ -981,10 +1028,10 @@ hello</pre>
<v>InitialData = term()</v>
</type>
<desc>
- <p>This function works exactly as <c>trace_client/2</c>, but
+ <p>This function works exactly as <c><seealso marker="#trace_client-2">trace_client/2</seealso></c>, but
allows you to write your own handler function. The handler
function works mostly as the one described in
- <c>tracer/2</c>, but will also have to be prepared to handle
+ <c><seealso marker="#tracer-2">tracer/2</seealso></c>, but will also have to be prepared to handle
trace messages of the form <c>{drop, N}</c>, where <c>N</c> is
the number of dropped messages. This pseudo trace message will
only occur if the ip trace driver is used.</p>
@@ -1003,7 +1050,7 @@ hello</pre>
<desc>
<p>This function shuts down a previously started trace
client. The <c>Pid</c> argument is the process id returned
- from the <c>trace_client/2</c> or <c>trace_client/3</c> call.</p>
+ from the <c><seealso marker="#trace_client-2">trace_client/2</seealso></c> or <c><seealso marker="#trace_client-3">trace_client/3</seealso></c> call.</p>
</desc>
</func>
<func>
@@ -1018,11 +1065,11 @@ hello</pre>
<fsummary>Return the process or port to which all trace messages are sent.</fsummary>
<type>
<v>Nodename = atom()</v>
- <v>Tracer = port() | pid()</v>
+ <v>Tracer = port() | pid() | {module(), term()}</v>
</type>
<desc>
- <p>Returns the process or port to which all trace
- messages are sent. </p>
+ <p>Returns the process, port or tracer module to which all trace
+ messages are sent.</p>
</desc>
</func>
<func>
@@ -1156,8 +1203,9 @@ SeqTrace [0]: (&lt;0.30.0>) &lt;0.25.0> ! {dbg,{ok,&lt;0.31.0>}} [Serial: {4,5}]
of causing a deadlock. This will happen if a group leader process generates a trace
message and the tracer process, by calling the trace handler function, sends an IO
request to the same group leader. The problem can only occur if the trace handler
- prints to tty using an <c>io</c> function such as <c>format/2</c>. Note that when
- <c>dbg:p(all,call)</c> is called, IO processes are also traced.
+ prints to tty using an <c>io</c> function such as <c><seealso marker="stdlib:io#format-2">format/2</seealso></c>.
+ Note that when
+ <c>dbg:p(all,call)</c> is called, IO processes are also traced.
Here's an example:</p>
<pre>
%% Using a default line editing shell
diff --git a/lib/runtime_tools/doc/src/dyntrace.xml b/lib/runtime_tools/doc/src/dyntrace.xml
index edf08e7753..0cdcecab68 100644
--- a/lib/runtime_tools/doc/src/dyntrace.xml
+++ b/lib/runtime_tools/doc/src/dyntrace.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/runtime_tools/doc/src/erts_alloc_config.xml b/lib/runtime_tools/doc/src/erts_alloc_config.xml
index 6a6ad93d48..ffc4ec5285 100644
--- a/lib/runtime_tools/doc/src/erts_alloc_config.xml
+++ b/lib/runtime_tools/doc/src/erts_alloc_config.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2007</year><year>2013</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/runtime_tools/doc/src/notes.xml b/lib/runtime_tools/doc/src/notes.xml
index 24b589b928..57241edbdc 100644
--- a/lib/runtime_tools/doc/src/notes.xml
+++ b/lib/runtime_tools/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/runtime_tools/doc/src/notes_history.xml b/lib/runtime_tools/doc/src/notes_history.xml
index 853a5eece0..48b868ff5b 100644
--- a/lib/runtime_tools/doc/src/notes_history.xml
+++ b/lib/runtime_tools/doc/src/notes_history.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2006</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/runtime_tools/doc/src/part.xml b/lib/runtime_tools/doc/src/part.xml
index c0a9e63331..34acf69fc8 100644
--- a/lib/runtime_tools/doc/src/part.xml
+++ b/lib/runtime_tools/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2012</year><year>2013</year>
+ <year>2012</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -34,6 +34,7 @@
<p><em>Runtime Tools</em></p>
</description>
+ <xi:include href="LTTng.xml"/>
<xi:include href="DTRACE.xml"/>
<xi:include href="SYSTEMTAP.xml"/>
</part>
diff --git a/lib/runtime_tools/doc/src/part_notes.xml b/lib/runtime_tools/doc/src/part_notes.xml
index 7a452aa79a..cabf3e39da 100644
--- a/lib/runtime_tools/doc/src/part_notes.xml
+++ b/lib/runtime_tools/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/runtime_tools/doc/src/part_notes_history.xml b/lib/runtime_tools/doc/src/part_notes_history.xml
index 545d3dacfe..dd1991f23a 100644
--- a/lib/runtime_tools/doc/src/part_notes_history.xml
+++ b/lib/runtime_tools/doc/src/part_notes_history.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2006</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/runtime_tools/doc/src/ref_man.xml b/lib/runtime_tools/doc/src/ref_man.xml
index 8657a07a30..d2fb7a29af 100644
--- a/lib/runtime_tools/doc/src/ref_man.xml
+++ b/lib/runtime_tools/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/runtime_tools/doc/src/runtime_tools_app.xml b/lib/runtime_tools/doc/src/runtime_tools_app.xml
index fb02d678cc..a2cf623977 100644
--- a/lib/runtime_tools/doc/src/runtime_tools_app.xml
+++ b/lib/runtime_tools/doc/src/runtime_tools_app.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1999</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/runtime_tools/doc/src/system_information.xml b/lib/runtime_tools/doc/src/system_information.xml
index 1c33ff1a40..53dc595e64 100644
--- a/lib/runtime_tools/doc/src/system_information.xml
+++ b/lib/runtime_tools/doc/src/system_information.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2014</year>
+ <year>2014</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/runtime_tools/examples/dist.d b/lib/runtime_tools/examples/dist.d
index e9323eec8f..3da2171a85 100644
--- a/lib/runtime_tools/examples/dist.d
+++ b/lib/runtime_tools/examples/dist.d
@@ -2,7 +2,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/dist.systemtap b/lib/runtime_tools/examples/dist.systemtap
index f2fcd189b5..bb20d617e1 100644
--- a/lib/runtime_tools/examples/dist.systemtap
+++ b/lib/runtime_tools/examples/dist.systemtap
@@ -2,7 +2,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/driver1.d b/lib/runtime_tools/examples/driver1.d
index b873f9c0d8..f63033ce6a 100644
--- a/lib/runtime_tools/examples/driver1.d
+++ b/lib/runtime_tools/examples/driver1.d
@@ -2,7 +2,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/driver1.systemtap b/lib/runtime_tools/examples/driver1.systemtap
index 71e1a0fa34..e1ee8ecffc 100644
--- a/lib/runtime_tools/examples/driver1.systemtap
+++ b/lib/runtime_tools/examples/driver1.systemtap
@@ -2,7 +2,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/efile_drv.d b/lib/runtime_tools/examples/efile_drv.d
index c6f9d3ba52..a470518dd9 100644
--- a/lib/runtime_tools/examples/efile_drv.d
+++ b/lib/runtime_tools/examples/efile_drv.d
@@ -2,7 +2,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/efile_drv.systemtap b/lib/runtime_tools/examples/efile_drv.systemtap
index 12bd7a14a3..29c3637e10 100644
--- a/lib/runtime_tools/examples/efile_drv.systemtap
+++ b/lib/runtime_tools/examples/efile_drv.systemtap
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/function-calls.d b/lib/runtime_tools/examples/function-calls.d
index 2de7fe64dd..f8ca388228 100644
--- a/lib/runtime_tools/examples/function-calls.d
+++ b/lib/runtime_tools/examples/function-calls.d
@@ -2,7 +2,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/function-calls.systemtap b/lib/runtime_tools/examples/function-calls.systemtap
index 30d77e4e66..9c44b2d014 100644
--- a/lib/runtime_tools/examples/function-calls.systemtap
+++ b/lib/runtime_tools/examples/function-calls.systemtap
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/garbage-collection.d b/lib/runtime_tools/examples/garbage-collection.d
index 3878858765..7d5a07c6fb 100644
--- a/lib/runtime_tools/examples/garbage-collection.d
+++ b/lib/runtime_tools/examples/garbage-collection.d
@@ -2,7 +2,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/garbage-collection.systemtap b/lib/runtime_tools/examples/garbage-collection.systemtap
index cbe949120a..e414eea821 100644
--- a/lib/runtime_tools/examples/garbage-collection.systemtap
+++ b/lib/runtime_tools/examples/garbage-collection.systemtap
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/memory1.d b/lib/runtime_tools/examples/memory1.d
index 64e524b419..79f5fa70a5 100644
--- a/lib/runtime_tools/examples/memory1.d
+++ b/lib/runtime_tools/examples/memory1.d
@@ -2,7 +2,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/memory1.systemtap b/lib/runtime_tools/examples/memory1.systemtap
index 850ebbbf53..04df4d64c4 100644
--- a/lib/runtime_tools/examples/memory1.systemtap
+++ b/lib/runtime_tools/examples/memory1.systemtap
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/messages.d b/lib/runtime_tools/examples/messages.d
index 62851a7697..d48c807afd 100644
--- a/lib/runtime_tools/examples/messages.d
+++ b/lib/runtime_tools/examples/messages.d
@@ -2,7 +2,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/messages.systemtap b/lib/runtime_tools/examples/messages.systemtap
index 4f3da9986c..f2ef56a22b 100644
--- a/lib/runtime_tools/examples/messages.systemtap
+++ b/lib/runtime_tools/examples/messages.systemtap
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/port1.d b/lib/runtime_tools/examples/port1.d
index 3531cb3398..79266f78ca 100644
--- a/lib/runtime_tools/examples/port1.d
+++ b/lib/runtime_tools/examples/port1.d
@@ -2,7 +2,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/port1.systemtap b/lib/runtime_tools/examples/port1.systemtap
index 4561686a80..f7ce03a65e 100644
--- a/lib/runtime_tools/examples/port1.systemtap
+++ b/lib/runtime_tools/examples/port1.systemtap
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/process-scheduling.d b/lib/runtime_tools/examples/process-scheduling.d
index 1acee4fbf2..30bfcaa21d 100644
--- a/lib/runtime_tools/examples/process-scheduling.d
+++ b/lib/runtime_tools/examples/process-scheduling.d
@@ -2,7 +2,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/process-scheduling.systemtap b/lib/runtime_tools/examples/process-scheduling.systemtap
index ab95d44d40..b0b74257b3 100644
--- a/lib/runtime_tools/examples/process-scheduling.systemtap
+++ b/lib/runtime_tools/examples/process-scheduling.systemtap
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/spawn-exit.d b/lib/runtime_tools/examples/spawn-exit.d
index 2ac79dc4f0..feeaa7960e 100644
--- a/lib/runtime_tools/examples/spawn-exit.d
+++ b/lib/runtime_tools/examples/spawn-exit.d
@@ -2,7 +2,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/spawn-exit.systemtap b/lib/runtime_tools/examples/spawn-exit.systemtap
index ae3f0f1b06..89bca14496 100644
--- a/lib/runtime_tools/examples/spawn-exit.systemtap
+++ b/lib/runtime_tools/examples/spawn-exit.systemtap
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/user-probe-n.d b/lib/runtime_tools/examples/user-probe-n.d
index 0f83b5bf3c..4b4300fe83 100644
--- a/lib/runtime_tools/examples/user-probe-n.d
+++ b/lib/runtime_tools/examples/user-probe-n.d
@@ -2,7 +2,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/user-probe-n.systemtap b/lib/runtime_tools/examples/user-probe-n.systemtap
index 48335ff41e..25f7503283 100644
--- a/lib/runtime_tools/examples/user-probe-n.systemtap
+++ b/lib/runtime_tools/examples/user-probe-n.systemtap
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/user-probe.d b/lib/runtime_tools/examples/user-probe.d
index 6adfb10cd8..4806bae783 100644
--- a/lib/runtime_tools/examples/user-probe.d
+++ b/lib/runtime_tools/examples/user-probe.d
@@ -2,7 +2,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/examples/user-probe.systemtap b/lib/runtime_tools/examples/user-probe.systemtap
index b599422c70..1777476e54 100644
--- a/lib/runtime_tools/examples/user-probe.systemtap
+++ b/lib/runtime_tools/examples/user-probe.systemtap
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/include/observer_backend.hrl b/lib/runtime_tools/include/observer_backend.hrl
index a2598f03c7..257e525a15 100644
--- a/lib/runtime_tools/include/observer_backend.hrl
+++ b/lib/runtime_tools/include/observer_backend.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/src/Makefile b/lib/runtime_tools/src/Makefile
index 3b41184f4e..2c902952a1 100644
--- a/lib/runtime_tools/src/Makefile
+++ b/lib/runtime_tools/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2013. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/src/appmon_info.erl b/lib/runtime_tools/src/appmon_info.erl
index dd4dc34fcb..fead724373 100644
--- a/lib/runtime_tools/src/appmon_info.erl
+++ b/lib/runtime_tools/src/appmon_info.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/src/dbg.erl b/lib/runtime_tools/src/dbg.erl
index 6eea1a0917..d5ff874206 100644
--- a/lib/runtime_tools/src/dbg.erl
+++ b/lib/runtime_tools/src/dbg.erl
@@ -298,7 +298,12 @@ tracer(port, Port) when is_port(Port) ->
start(fun() -> Port end);
tracer(process, {Handler,HandlerData}) ->
- start(fun() -> start_tracer_process(Handler, HandlerData) end).
+ start(fun() -> start_tracer_process(Handler, HandlerData) end);
+
+tracer(module, Fun) when is_function(Fun) ->
+ start(Fun);
+tracer(module, {Module, State}) ->
+ start(fun() -> {Module, State} end).
remote_tracer(port, Fun) when is_function(Fun) ->
@@ -308,7 +313,13 @@ remote_tracer(port, Port) when is_port(Port) ->
remote_start(fun() -> Port end);
remote_tracer(process, {Handler,HandlerData}) ->
- remote_start(fun() -> start_tracer_process(Handler, HandlerData) end).
+ remote_start(fun() -> start_tracer_process(Handler, HandlerData) end);
+
+remote_tracer(module, Fun) when is_function(Fun) ->
+ remote_start(Fun);
+remote_tracer(module, {Module, State}) ->
+ remote_start(fun() -> {Module, State} end).
+
remote_start(StartTracer) ->
case (catch StartTracer()) of
@@ -543,9 +554,8 @@ c(M, F, A, Flags) ->
{error,Reason} -> {error,Reason};
Flags1 ->
tracer(),
- {ok, Tracer} = get_tracer(),
S = self(),
- Pid = spawn(fun() -> c(S, M, F, A, [{tracer, Tracer} | Flags1]) end),
+ Pid = spawn(fun() -> c(S, M, F, A, [get_tracer_flag() | Flags1]) end),
Mref = erlang:monitor(process, Pid),
receive
{'DOWN', Mref, _, _, Reason} ->
@@ -660,6 +670,9 @@ loop({C,T}=SurviveLinks, Table) ->
reply(From, {error, Reason});
Tracer when is_pid(Tracer); is_port(Tracer) ->
put(node(),{self(),Tracer}),
+ reply(From, {ok,self()});
+ {Module, _State} = Tracer when is_atom(Module) ->
+ put(node(),{self(),Tracer}),
reply(From, {ok,self()})
end;
{_Relay,_Tracer} ->
@@ -710,6 +723,9 @@ loop({C,T}=SurviveLinks, Table) ->
{_LocalRelay,Tracer} when is_port(Tracer) ->
reply(From, {error, cant_trace_remote_pid_to_local_port}),
loop(SurviveLinks, Table);
+ {_LocalRelay,Tracer} when is_tuple(Tracer) ->
+ reply(From, {error, cant_trace_remote_pid_to_local_module}),
+ loop(SurviveLinks, Table);
{_LocalRelay,Tracer} when is_pid(Tracer) ->
case (catch relay(Node, Tracer)) of
{ok,Relay} ->
@@ -879,9 +895,9 @@ trac(Proc, How, Flags) ->
end
end.
-trac(Node, {_Relay, Tracer}, AtomPid, How, Flags) ->
+trac(Node, {_Replay, Tracer}, AtomPid, How, Flags) ->
case rpc:call(Node, ?MODULE, erlang_trace,
- [AtomPid, How, [{tracer, Tracer} | Flags]]) of
+ [AtomPid, How, [get_tracer_flag(Tracer) | Flags]]) of
N when is_integer(N) ->
{matched, Node, N};
{badrpc,Reason} ->
@@ -1114,7 +1130,7 @@ transform_flags([sos|Tail],Acc) -> transform_flags(Tail,[set_on_spawn|Acc]);
transform_flags([sol|Tail],Acc) -> transform_flags(Tail,[set_on_link|Acc]);
transform_flags([sofs|Tail],Acc) -> transform_flags(Tail,[set_on_first_spawn|Acc]);
transform_flags([sofl|Tail],Acc) -> transform_flags(Tail,[set_on_first_link|Acc]);
-transform_flags([all|_],_Acc) -> all()--[silent];
+transform_flags([all|_],_Acc) -> all()--[silent,running];
transform_flags([F|Tail]=List,Acc) when is_atom(F) ->
case lists:member(F, all()) of
true -> transform_flags(Tail,[F|Acc]);
@@ -1123,9 +1139,10 @@ transform_flags([F|Tail]=List,Acc) when is_atom(F) ->
transform_flags(Bad,_Acc) -> {error,{bad_flags,Bad}}.
all() ->
- [send,'receive',call,procs,garbage_collection,running,
+ [send,'receive',call,procs,ports,garbage_collection,running,
set_on_spawn,set_on_first_spawn,set_on_link,set_on_first_link,
- timestamp,arity,return_to,silent].
+ timestamp,monotonic_timestamp,strict_monotonic_timestamp,
+ arity,return_to,silent,running_procs,running_ports].
display_info([Node|Nodes]) ->
io:format("~nNode ~w:~n",[Node]),
@@ -1146,24 +1163,34 @@ display_info1([]) ->
ok.
get_info() ->
- get_info(processes(),[]).
+ get_info(processes(),get_info(erlang:ports(),[])).
+get_info([Port|T], Acc) when is_port(Port) ->
+ case pinfo(Port, name) of
+ undefined ->
+ get_info(T,Acc);
+ {name, Name} ->
+ get_info(T,get_tinfo(Port, Name, Acc))
+ end;
get_info([Pid|T],Acc) ->
case pinfo(Pid, initial_call) of
undefined ->
get_info(T,Acc);
{initial_call, Call} ->
- case tinfo(Pid, flags) of
- undefined ->
- get_info(T,Acc);
- {flags,[]} ->
- get_info(T,Acc);
- {flags,Flags} ->
- get_info(T,[{Pid,Call,Flags}|Acc])
- end
+ get_info(T,get_tinfo(Pid, Call, Acc))
end;
get_info([],Acc) -> Acc.
+get_tinfo(P, Id, Acc) ->
+ case tinfo(P, flags) of
+ undefined ->
+ Acc;
+ {flags,[]} ->
+ Acc;
+ {flags,Flags} ->
+ [{P,Id,Flags}|Acc]
+ end.
+
format_trace([]) -> [];
format_trace([Item]) -> [ts(Item)];
format_trace([Item|T]) -> [ts(Item) ," | ", format_trace(T)].
@@ -1188,9 +1215,22 @@ to_pidspec(X) when is_pid(X) ->
true -> X;
false -> {badpid,X}
end;
-to_pidspec(new) -> new;
-to_pidspec(all) -> all;
-to_pidspec(existing) -> existing;
+to_pidspec(X) when is_port(X) ->
+ case erlang:port_info(X) of
+ undefined -> {badport, X};
+ _ -> X
+ end;
+to_pidspec(Tag)
+ when Tag =:= all;
+ Tag =:= ports;
+ Tag =:= processes;
+ Tag =:= new;
+ Tag =:= new_ports;
+ Tag =:= new_processes;
+ Tag =:= existing;
+ Tag =:= existing_ports;
+ Tag =:= existing_processes ->
+ Tag;
to_pidspec(X) when is_atom(X) ->
case whereis(X) of
undefined -> {badpid,X};
@@ -1203,6 +1243,7 @@ to_pidspec(X) -> {badpid,X}.
%%
to_pid(X) when is_pid(X) -> X;
+to_pid(X) when is_port(X) -> X;
to_pid(X) when is_integer(X) -> to_pid({0,X,0});
to_pid({X,Y,Z}) ->
to_pid(lists:concat(["<",integer_to_list(X),".",
@@ -1217,9 +1258,12 @@ to_pid(X) when is_list(X) ->
to_pid(X) -> {badpid,X}.
+pinfo(P, X) when node(P) == node(), is_port(P) -> erlang:port_info(P, X);
pinfo(P, X) when node(P) == node() -> erlang:process_info(P, X);
+pinfo(P, X) when is_port(P) -> check(rpc:call(node(P), erlang, port_info, [P, X]));
pinfo(P, X) -> check(rpc:call(node(P), erlang, process_info, [P, X])).
+
tinfo(P, X) when node(P) == node() -> erlang:trace_info(P, X);
tinfo(P, X) -> check(rpc:call(node(P), erlang, trace_info, [P, X])).
@@ -1411,6 +1455,13 @@ get_tracer() ->
req({get_tracer,node()}).
get_tracer(Node) ->
req({get_tracer,Node}).
+get_tracer_flag() ->
+ {ok, Tracer} = get_tracer(),
+ get_tracer_flag(Tracer).
+get_tracer_flag({Module,State}) ->
+ {tracer, Module, State};
+get_tracer_flag(Port = Pid) when is_port(Port); is_pid(Pid)->
+ {tracer, Pid = Port}.
save_pattern([]) ->
0;
diff --git a/lib/runtime_tools/src/dyntrace.erl b/lib/runtime_tools/src/dyntrace.erl
index f7dbef6929..28e6d67d96 100644
--- a/lib/runtime_tools/src/dyntrace.erl
+++ b/lib/runtime_tools/src/dyntrace.erl
@@ -41,6 +41,28 @@
pn/1, pn/2, pn/3, pn/4, pn/5, pn/6, pn/7, pn/8, pn/9]).
-export([put_tag/1, get_tag/0, get_tag_data/0, spread_tag/1, restore_tag/1]).
+-export([trace/5,
+ trace/6,
+ trace_procs/6,
+ trace_ports/6,
+ trace_running_procs/6,
+ trace_running_ports/6,
+ trace_call/6,
+ trace_send/6,
+ trace_receive/6,
+ trace_garbage_collection/6]).
+
+-export([enabled_procs/3,
+ enabled_ports/3,
+ enabled_running_procs/3,
+ enabled_running_ports/3,
+ enabled_call/3,
+ enabled_send/3,
+ enabled_receive/3,
+ enabled_garbage_collection/3,
+ enabled/3]).
+
+
-export([user_trace_i4s4/9]). % Know what you're doing!
-on_load(on_load/0).
@@ -125,6 +147,63 @@ user_trace_i4s4(_, _, _, _, _, _, _, _, _) ->
user_trace_n(_, _, _, _, _, _, _, _, _, _) ->
erlang:nif_error(nif_not_loaded).
+trace(_TracerState, _Label, _SeqTraceInfo, _, _Opts) ->
+ erlang:nif_error(nif_not_loaded).
+
+trace(_TraceTag, _TracerState, _Tracee, _FirstTraceTerm, _SecondTraceTerm, _Opts) ->
+ erlang:nif_error(nif_not_loaded).
+
+trace_procs(_TraceTag, _TracerState, _Tracee, _FirstTraceTerm, _SecondTraceTerm, _Opts) ->
+ erlang:nif_error(nif_not_loaded).
+
+trace_ports(_TraceTag, _TracerState, _Tracee, _FirstTraceTerm, _SecondTraceTerm, _Opts) ->
+ erlang:nif_error(nif_not_loaded).
+
+trace_running_procs(_TraceTag, _TracerState, _Tracee, _FirstTraceTerm, _SecondTraceTerm, _Opts) ->
+ erlang:nif_error(nif_not_loaded).
+
+trace_running_ports(_TraceTag, _TracerState, _Tracee, _FirstTraceTerm, _SecondTraceTerm, _Opts) ->
+ erlang:nif_error(nif_not_loaded).
+
+trace_call(_TraceTag, _TracerState, _Tracee, _FirstTraceTerm, _SecondTraceTerm, _Opts) ->
+ erlang:nif_error(nif_not_loaded).
+
+trace_send(_TraceTag, _TracerState, _Tracee, _FirstTraceTerm, _SecondTraceTerm, _Opts) ->
+ erlang:nif_error(nif_not_loaded).
+
+trace_receive(_TraceTag, _TracerState, _Tracee, _FirstTraceTerm, _SecondTraceTerm, _Opts) ->
+ erlang:nif_error(nif_not_loaded).
+
+trace_garbage_collection(_TraceTag, _TracerState, _Tracee, _FirstTraceTerm, _SecondTraceTerm, _Opts) ->
+ erlang:nif_error(nif_not_loaded).
+
+enabled(_TraceTag, _TracerState, _Tracee) ->
+ erlang:nif_error(nif_not_loaded).
+
+enabled_procs(_TraceTag, _TracerState, _Tracee) ->
+ erlang:nif_error(nif_not_loaded).
+
+enabled_ports(_TraceTag, _TracerState, _Tracee) ->
+ erlang:nif_error(nif_not_loaded).
+
+enabled_running_procs(_TraceTag, _TracerState, _Tracee) ->
+ erlang:nif_error(nif_not_loaded).
+
+enabled_running_ports(_TraceTag, _TracerState, _Tracee) ->
+ erlang:nif_error(nif_not_loaded).
+
+enabled_call(_TraceTag, _TracerState, _Tracee) ->
+ erlang:nif_error(nif_not_loaded).
+
+enabled_send(_TraceTag, _TracerState, _Tracee) ->
+ erlang:nif_error(nif_not_loaded).
+
+enabled_receive(_TraceTag, _TracerState, _Tracee) ->
+ erlang:nif_error(nif_not_loaded).
+
+enabled_garbage_collection(_TraceTag, _TracerState, _Tracee) ->
+ erlang:nif_error(nif_not_loaded).
+
%%%
%%% Erlang support functions
%%%
diff --git a/lib/runtime_tools/src/erts_alloc_config.erl b/lib/runtime_tools/src/erts_alloc_config.erl
index 85aacdd6e1..e94cced911 100644
--- a/lib/runtime_tools/src/erts_alloc_config.erl
+++ b/lib/runtime_tools/src/erts_alloc_config.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/src/msacc.erl b/lib/runtime_tools/src/msacc.erl
index 612effa5aa..4db5dbec91 100644
--- a/lib/runtime_tools/src/msacc.erl
+++ b/lib/runtime_tools/src/msacc.erl
@@ -32,18 +32,18 @@
-type msacc_data() :: [msacc_data_thread()].
--type msacc_data_thread() :: #{ '$type' => msacc_data,
- type => msacc_type(), id => msacc_id(),
- counters => msacc_data_counters() }.
+-type msacc_data_thread() :: #{ '$type' := msacc_data,
+ type := msacc_type(), id := msacc_id(),
+ counters := msacc_data_counters() }.
-type msacc_data_counters() :: #{ msacc_state() => non_neg_integer()}.
-type msacc_stats() :: [msacc_stats_thread()].
--type msacc_stats_thread() :: #{ '$type' => msacc_stats,
- type => msacc_type(), id => msacc_id(),
- system => float(),
- counters => msacc_stats_counters()}.
--type msacc_stats_counters() :: #{ msacc_state() => #{ thread => float(),
- system => float()}}.
+-type msacc_stats_thread() :: #{ '$type' := msacc_stats,
+ type := msacc_type(), id := msacc_id(),
+ system := float(),
+ counters := msacc_stats_counters()}.
+-type msacc_stats_counters() :: #{ msacc_state() => #{ thread := float(),
+ system := float()}}.
-type msacc_type() :: scheduler | aux | async.
diff --git a/lib/runtime_tools/src/observer_backend.erl b/lib/runtime_tools/src/observer_backend.erl
index 9177752cef..30df3b0b8b 100644
--- a/lib/runtime_tools/src/observer_backend.erl
+++ b/lib/runtime_tools/src/observer_backend.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/src/percept_profile.erl b/lib/runtime_tools/src/percept_profile.erl
index d5ea2c7032..ceec4d3b89 100644
--- a/lib/runtime_tools/src/percept_profile.erl
+++ b/lib/runtime_tools/src/percept_profile.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/src/runtime_tools.app.src b/lib/runtime_tools/src/runtime_tools.app.src
index aeda103e72..690c61a4c3 100644
--- a/lib/runtime_tools/src/runtime_tools.app.src
+++ b/lib/runtime_tools/src/runtime_tools.app.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
{applications, [kernel, stdlib]},
{env, []},
{mod, {runtime_tools, []}},
- {runtime_dependencies, ["stdlib-2.0","mnesia-4.12","kernel-3.0",
- "erts-7.0"]}]}.
+ {runtime_dependencies, ["stdlib-3.0","mnesia-4.12","kernel-5.0",
+ "erts-8.0"]}]}.
diff --git a/lib/runtime_tools/src/runtime_tools.appup.src b/lib/runtime_tools/src/runtime_tools.appup.src
index 883ff1e074..a42673c87e 100644
--- a/lib/runtime_tools/src/runtime_tools.appup.src
+++ b/lib/runtime_tools/src/runtime_tools.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/src/runtime_tools.erl b/lib/runtime_tools/src/runtime_tools.erl
index 62b9dfd71e..52ae5cc0eb 100644
--- a/lib/runtime_tools/src/runtime_tools.erl
+++ b/lib/runtime_tools/src/runtime_tools.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/src/runtime_tools_sup.erl b/lib/runtime_tools/src/runtime_tools_sup.erl
index e69b495cb5..efa37de42d 100644
--- a/lib/runtime_tools/src/runtime_tools_sup.erl
+++ b/lib/runtime_tools/src/runtime_tools_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/src/system_information.erl b/lib/runtime_tools/src/system_information.erl
index ad7ee7311c..1add01612d 100644
--- a/lib/runtime_tools/src/system_information.erl
+++ b/lib/runtime_tools/src/system_information.erl
@@ -28,31 +28,25 @@
-behaviour(gen_server).
%% API
--export([
- report/0,
+-export([report/0,
from_file/1,
- to_file/1
- ]).
--export([
- start/0, stop/0,
- load_report/0, load_report/2,
- applications/0, applications/1,
- application/1, application/2,
- environment/0, environment/1,
- module/1, module/2,
- modules/1,
- sanity_check/0
- ]).
+ to_file/1]).
+-export([start/0, stop/0,
+ load_report/0, load_report/2,
+ applications/0, applications/1,
+ application/1, application/2,
+ environment/0, environment/1,
+ module/1, module/2,
+ modules/1,
+ sanity_check/0]).
%% gen_server callbacks
--export([
- init/1,
- handle_call/3,
- handle_cast/2,
- handle_info/2,
- terminate/2,
- code_change/3
- ]).
+-export([init/1,
+ handle_call/3,
+ handle_cast/2,
+ handle_info/2,
+ terminate/2,
+ code_change/3]).
-define(SERVER, ?MODULE).
@@ -71,13 +65,13 @@ start() ->
gen_server:start({local, ?SERVER}, ?MODULE, [], []).
stop() ->
- gen_server:call(?SERVER, stop).
+ gen_server:call(?SERVER, stop, infinity).
load_report() -> load_report(data, report()).
load_report(file, File) -> load_report(data, from_file(File));
load_report(data, Report) ->
- start(), gen_server:call(?SERVER, {load_report, Report}).
+ start(), gen_server:call(?SERVER, {load_report, Report}, infinity).
report() -> [
{init_arguments, init:get_arguments()},
@@ -120,22 +114,22 @@ from_file(File) ->
applications() -> applications([]).
applications(Opts) when is_list(Opts) ->
- gen_server:call(?SERVER, {applications, Opts}).
+ gen_server:call(?SERVER, {applications, Opts}, infinity).
application(App) when is_atom(App) -> application(App, []).
application(App, Opts) when is_atom(App), is_list(Opts) ->
- gen_server:call(?SERVER, {application, App, Opts}).
+ gen_server:call(?SERVER, {application, App, Opts}, infinity).
environment() -> environment([]).
environment(Opts) when is_list(Opts) ->
- gen_server:call(?SERVER, {environment, Opts}).
+ gen_server:call(?SERVER, {environment, Opts}, infinity).
module(M) when is_atom(M) -> module(M, []).
module(M, Opts) when is_atom(M), is_list(Opts) ->
- gen_server:call(?SERVER, {module, M, Opts}).
+ gen_server:call(?SERVER, {module, M, Opts}, infinity).
modules(Opt) when is_atom(Opt) ->
- gen_server:call(?SERVER, {modules, Opt}).
+ gen_server:call(?SERVER, {modules, Opt}, infinity).
-spec sanity_check() -> ok | {failed, Failures} when
diff --git a/lib/runtime_tools/test/Makefile b/lib/runtime_tools/test/Makefile
index 432a361468..61377ea09e 100644
--- a/lib/runtime_tools/test/Makefile
+++ b/lib/runtime_tools/test/Makefile
@@ -4,6 +4,7 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk
MODULES = \
dyntrace_SUITE \
+ dyntrace_lttng_SUITE \
runtime_tools_SUITE \
system_information_SUITE \
dbg_SUITE \
diff --git a/lib/runtime_tools/test/dbg_SUITE.erl b/lib/runtime_tools/test/dbg_SUITE.erl
index fd9b8f23bd..0777503ef7 100644
--- a/lib/runtime_tools/test/dbg_SUITE.erl
+++ b/lib/runtime_tools/test/dbg_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -20,284 +20,272 @@
-module(dbg_SUITE).
%% Test functions
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- big/1, tiny/1, simple/1, message/1, distributed/1,
- ip_port/1, file_port/1, file_port2/1, file_port_schedfix/1,
- ip_port_busy/1, wrap_port/1, wrap_port_time/1,
- with_seq_trace/1, dead_suspend/1, local_trace/1,
- saved_patterns/1, tracer_exit_on_stop/1]).
--export([init_per_testcase/2, end_per_testcase/2]).
+-export([all/0, suite/0,
+ big/1, tiny/1, simple/1, message/1, distributed/1, port/1,
+ ip_port/1, file_port/1, file_port2/1, file_port_schedfix/1,
+ ip_port_busy/1, wrap_port/1, wrap_port_time/1,
+ with_seq_trace/1, dead_suspend/1, local_trace/1,
+ saved_patterns/1, tracer_exit_on_stop/1,
+ erl_tracer/1, distributed_erl_tracer/1]).
-export([tracee1/1, tracee2/1]).
-export([dummy/0, exported/1]).
+-export([enabled/3, trace/6, load_nif/1]).
-include_lib("common_test/include/ct.hrl").
--define(default_timeout, ?t:minutes(1)).
-
-init_per_testcase(_Case, Config) ->
- ?line Dog=test_server:timetrap(?default_timeout),
- [{watchdog, Dog}|Config].
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
- ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {minutes, 1}}].
all() ->
- [big, tiny, simple, message, distributed, ip_port,
+ [big, tiny, simple, message, distributed, port, ip_port,
file_port, file_port2, file_port_schedfix, ip_port_busy,
wrap_port, wrap_port_time, with_seq_trace, dead_suspend,
- local_trace, saved_patterns, tracer_exit_on_stop].
-
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
+ local_trace, saved_patterns, tracer_exit_on_stop,
+ erl_tracer, distributed_erl_tracer].
-end_per_group(_GroupName, Config) ->
- Config.
-
-big(suite) -> [];
-big(doc) -> ["Rudimentary interface test"];
+%% Rudimentary interface test
big(Config) when is_list(Config) ->
- ?line {ok,OldCurDir} = file:get_cwd(),
- Datadir=?config(data_dir, Config),
- Privdir=?config(priv_dir, Config),
- ?line ok=file:set_cwd(Privdir),
+ {ok,OldCurDir} = file:get_cwd(),
+ Datadir=proplists:get_value(data_dir, Config),
+ Privdir=proplists:get_value(priv_dir, Config),
+ ok=file:set_cwd(Privdir),
try
- %% make sure dbg is stopped (and returns correctly)
- ?line ok = dbg:stop(),
-
- %% compile test module and make sure it is loaded.
- ?line {ok,Mod} = compile:file(Datadir++"/dbg_test",[trace]),
- ?line code:purge(dbg_test),
- ?line {module, Mod}=code:load_file(dbg_test),
-
- %% run/debug a named test function.
- ?line Pid = spawn_link(dbg_test, loop, [Config]),
- ?line true = register(dbg_test_loop, Pid),
- ?line {ok,_} = dbg:tracer(),
- ?line {ok,[{matched, _node, 1}]} = dbg:p(dbg_test_loop, [m,p,c]),
- ?line ok = dbg:c(dbg_test, test, [Config]),
- ?line ok = dbg:i(),
- ?line dbg_test_loop ! {dbg_test, stop},
- unregister(dbg_test_loop),
- ?line ok = dbg:stop(),
-
- %% run/debug a Pid.
- ?line Pid2=spawn_link(dbg_test,loop,[Config]),
- ?line {ok,_} = dbg:tracer(),
- ?line {ok,[{matched, _node, 1}]} = dbg:p(Pid2,[s,r,p]),
- ?line ok = dbg:c(dbg_test, test, [Config]),
- ?line ok = dbg:i(),
- ?line Pid2 ! {dbg_test, stop},
-
- ?line ok=file:set_cwd(OldCurDir)
+ %% make sure dbg is stopped (and returns correctly)
+ ok = dbg:stop(),
+
+ %% compile test module and make sure it is loaded.
+ {ok,Mod} = compile:file(Datadir++"/dbg_test",[trace]),
+ code:purge(dbg_test),
+ {module, Mod}=code:load_file(dbg_test),
+
+ %% run/debug a named test function.
+ Pid = spawn_link(dbg_test, loop, [Config]),
+ true = register(dbg_test_loop, Pid),
+ {ok,_} = dbg:tracer(),
+ {ok,[{matched, _node, 1}]} = dbg:p(dbg_test_loop, [m,p,c]),
+ ok = dbg:c(dbg_test, test, [Config]),
+ ok = dbg:i(),
+ dbg_test_loop ! {dbg_test, stop},
+ unregister(dbg_test_loop),
+ ok = dbg:stop(),
+
+ %% run/debug a Pid.
+ Pid2=spawn_link(dbg_test,loop,[Config]),
+ {ok,_} = dbg:tracer(),
+ {ok,[{matched, _node, 1}]} = dbg:p(Pid2,[s,r,p]),
+ ok = dbg:c(dbg_test, test, [Config]),
+ ok = dbg:i(),
+ Pid2 ! {dbg_test, stop},
+
+ ok=file:set_cwd(OldCurDir)
after
- ?line dbg:stop()
+ dbg:stop()
end,
ok.
-tiny(suite) -> [];
-tiny(doc) -> ["Rudimentary interface test"];
+%% Rudimentary interface test
tiny(Config) when is_list(Config) ->
- ?line {ok,OldCurDir} = file:get_cwd(),
- Datadir=?config(data_dir, Config),
- Privdir=?config(priv_dir, Config),
- ?line ok=file:set_cwd(Privdir),
+ {ok,OldCurDir} = file:get_cwd(),
+ Datadir=proplists:get_value(data_dir, Config),
+ Privdir=proplists:get_value(priv_dir, Config),
+ ok=file:set_cwd(Privdir),
try
- %% compile test module and make sure it is loaded.
- ?line {ok, Mod} = compile:file(Datadir++"/dbg_test",[trace]),
- ?line code:purge(dbg_test),
- ?line {module, Mod}=code:load_file(dbg_test),
-
- ?line Pid=spawn_link(dbg_test,loop,[Config]),
- if
- is_pid(Pid) ->
- ?line dbg:tracer(),
- ?line {ok,[{matched, _node, 1}]} = dbg:p(Pid,[s,r,m,p,c]),
- ?line ok = dbg:c(dbg_test,test,[Config]),
- ?line ok = dbg:i(),
- ?line Pid ! {dbg_test, stop};
- true ->
- ?line ok=file:set_cwd(OldCurDir),
- ?t:fail("Could not spawn external test process.~n"),
- failure
- end
+ %% compile test module and make sure it is loaded.
+ {ok, Mod} = compile:file(Datadir++"/dbg_test",[trace]),
+ code:purge(dbg_test),
+ {module, Mod}=code:load_file(dbg_test),
+
+ Pid=spawn_link(dbg_test,loop,[Config]),
+ if
+ is_pid(Pid) ->
+ dbg:tracer(),
+ {ok,[{matched, _node, 1}]} = dbg:p(Pid,[s,r,m,p,c]),
+ ok = dbg:c(dbg_test,test,[Config]),
+ ok = dbg:i(),
+ Pid ! {dbg_test, stop};
+ true ->
+ ok=file:set_cwd(OldCurDir),
+ ct:fail("Could not spawn external test process.~n"),
+ failure
+ end
after
- ?line ok = dbg:stop(),
- ?line ok = file:set_cwd(OldCurDir)
+ ok = dbg:stop(),
+ ok = file:set_cwd(OldCurDir)
end,
ok.
-simple(suite) ->
- [];
-simple(doc) ->
- ["Simple interface test with own handler"];
+%% Simple interface test with own handler
simple(Config) when is_list(Config) ->
try
- ?line start(),
- ?line dbg:p(self(),call),
- ?line dbg:tp(dbg,ltp,[]),
- ?line dbg:ltp(),
- ?line stop(),
- ?line S = self(),
- ?line [{trace,S,call,{dbg,ltp,[]}}] = flush()
+ start(),
+ dbg:p(self(),call),
+ dbg:tp(dbg,ltp,[]),
+ dbg:ltp(),
+ stop(),
+ S = self(),
+ [{trace,S,call,{dbg,ltp,[]}}] = flush()
after
- ?line dbg:stop()
+ dbg:stop()
end,
ok.
-message(suite) ->
- [];
-message(doc) ->
- ["Simple interface test with pam code that appends a message"];
+%% Simple interface test with pam code that appends a message
message(Config) when is_list(Config) ->
- ?line {ok, _} = start(),
+ {ok, _} = start(),
try
- ?line {ok, [{matched, _node, 1}]} = dbg:p(self(),call),
- ?line {ok, X} = dbg:tp(dbg,ltp,[{'_',[],[{message, {self}}]}]),
- ?line {value, {saved, Saved}} = lists:keysearch(saved, 1, X),
- ?line {ok, Y} = dbg:tp(dbg,ln,Saved),
- ?line {value, {saved, Saved}} = lists:keysearch(saved, 1, Y),
- ?line ok = dbg:ltp(),
- ?line ok = dbg:ln()
+ {ok, [{matched, _node, 1}]} = dbg:p(self(),call),
+ {ok, X} = dbg:tp(dbg,ltp,[{'_',[],[{message, {self}}]}]),
+ {value, {saved, Saved}} = lists:keysearch(saved, 1, X),
+ {ok, Y} = dbg:tp(dbg,ln,Saved),
+ {value, {saved, Saved}} = lists:keysearch(saved, 1, Y),
+ ok = dbg:ltp(),
+ ok = dbg:ln()
after
- ?line stop()
+ stop()
end,
- ?line S = self(),
- ?line [{trace,S,call,{dbg,ltp,[]},S},
- {trace,S,call,{dbg,ln,[]},S}] = flush(),
+ S = self(),
+ [{trace,S,call,{dbg,ltp,[]},S},
+ {trace,S,call,{dbg,ln,[]},S}] = flush(),
ok.
-distributed(suite) ->
- [];
-distributed(doc) ->
- ["Simple test of distributed tracing"];
+%% Simple test of distributed tracing
distributed(Config) when is_list(Config) ->
- ?line {ok, _} = start(),
- ?line Node = start_slave(),
+ {ok, _} = start(),
+ Node = start_slave(),
try
- ?line RexPid = rpc:call(Node, erlang, whereis, [rex]),
- ?line RexPidList = pid_to_list(RexPid),
- ?line {ok, Node} = dbg:n(Node),
- ?line {ok, X} = dbg:p(all,call),
- ?line {value, {matched, Node, _}} = lists:keysearch(Node, 2, X),
- ?line {ok, Y} = dbg:p(RexPidList, s),
- ?line {value, {matched, Node, 1}} = lists:keysearch(Node, 2, Y),
- ?line {ok, Z} = dbg:tp(dbg,ltp,[]),
- ?line {value, {matched, Node, 1}} = lists:keysearch(Node, 2, Z),
- ?line dbg:cn(Node),
- ?line dbg:tp(dbg,ln,[]),
- ?line ok = rpc:call(Node, dbg, ltp, []),
- ?line ok = rpc:call(Node, dbg, ln, []),
- ?line ok = dbg:ln(),
- ?line S = self(),
- ?line {TraceSend, TraceCall} =
- lists:partition(fun ({trace,RP,send,_,_}) when RP =:= RexPid -> true;
- (_) -> false end,
- flush()),
- ?line [_|_] = TraceSend,
- ?line [{trace,Pid,call,{dbg,ltp,[]}},
- {trace,S,call,{dbg,ln,[]}}] = TraceCall,
- ?line Node = node(Pid),
- %%
- ?line stop()
+ RexPid = rpc:call(Node, erlang, whereis, [rex]),
+ RexPidList = pid_to_list(RexPid),
+ {ok, Node} = dbg:n(Node),
+ {ok, X} = dbg:p(all,call),
+ {value, {matched, Node, _}} = lists:keysearch(Node, 2, X),
+ {ok, Y} = dbg:p(RexPidList, s),
+ {value, {matched, Node, 1}} = lists:keysearch(Node, 2, Y),
+ {ok, Z} = dbg:tp(dbg,ltp,[]),
+ {value, {matched, Node, 1}} = lists:keysearch(Node, 2, Z),
+ dbg:cn(Node),
+ dbg:tp(dbg,ln,[]),
+ ok = rpc:block_call(Node, dbg, ltp, []),
+ ok = rpc:block_call(Node, dbg, ln, []),
+ ok = dbg:ln(),
+ S = self(),
+ {TraceSend, TraceCall} =
+ lists:partition(fun ({trace,RP,send,_,_}) when RP =:= RexPid -> true;
+ (_) -> false end,
+ flush()),
+ [_|_] = TraceSend,
+ [{trace,Pid,call,{dbg,ltp,[]}},
+ {trace,S,call,{dbg,ln,[]}}] = TraceCall,
+ Node = node(Pid),
+ %%
+ stop()
after
- ?line stop_slave(Node),
- ?line stop()
+ stop_slave(Node),
+ stop()
end,
ok.
-local_trace(suite) ->
- [];
-local_trace(doc) ->
- ["Tests tracing of local function calls."];
+%% Tests tracing of local function calls.
local_trace(Config) when is_list(Config) ->
- ?line {ok, _} = start(),
+ {ok, _} = start(),
try
- ?line S = self(),
- ?line %% Split "<X.Y.Z>" into {X, Y, Z}
- ?line "<"++L1 = L = pid_to_list(S),
- ?line NoDot = fun ($.) -> false; (_) -> true end,
- ?line {LX,"."++L2} = lists:splitwith(NoDot, L1),
- ?line {LY,"."++L3} = lists:splitwith(NoDot, L2),
- ?line ">"++L4 = lists:reverse(L3),
- ?line LZ = lists:reverse(L4),
- ?line X = 0 = list_to_integer(LX),
- ?line Y = list_to_integer(LY),
- ?line Z = list_to_integer(LZ),
- ?line XYZ = {X, Y, Z},
- ?line io:format("Self = ~w = ~w~n", [S,XYZ]),
- ?line {ok, [{matched, _node, 1}]} = dbg:p(S,call),
- ?line {ok, [{matched, _node, 1}]} = dbg:p(XYZ,call),
- if Z =:= 0 ->
- ?line {ok, [{matched, _node, 1}]} = dbg:p(Y,call);
- true -> ok
- end,
- ?line {ok, [{matched, _node, 1}]} = dbg:p(L,call),
- ?line {ok, _} = dbg:tpl(?MODULE,not_exported,[]),
- ?line 4 = not_exported(2),
- ?line [{trace,S,call,{?MODULE,not_exported,[2]}}] = flush(),
- ?line {ok, _} = dbg:tp(?MODULE,exported,[]),
- ?line 4 = ?MODULE:exported(2),
- ?line [{trace,S,call,{?MODULE,exported,[2]}},
- {trace,S,call,{?MODULE,not_exported,[2]}}] = flush(),
- ?line {ok, _} = dbg:ctpl(?MODULE),
- ?line 4 = ?MODULE:exported(2),
- ?line [{trace,S,call,{?MODULE,exported,[2]}}] = flush(),
- ?line {ok, _} = dbg:tpl(?MODULE,not_exported,[]),
- ?line {ok, _} = dbg:ctp(?MODULE),
- ?line 4 = ?MODULE:exported(2),
- ?line [] = flush(),
- ?line {ok, _} = dbg:tpl(?MODULE,not_exported,x),
- ?line catch ?MODULE:exported(x),
- ?line [{trace,S,call,{dbg_SUITE,not_exported,[x]}},
- {trace,S,exception_from,
- {dbg_SUITE,not_exported,1},
- {error,badarith}}] = flush()
+ S = self(),
+ %% Split "<X.Y.Z>" into {X, Y, Z}
+ "<"++L1 = L = pid_to_list(S),
+ NoDot = fun ($.) -> false; (_) -> true end,
+ {LX,"."++L2} = lists:splitwith(NoDot, L1),
+ {LY,"."++L3} = lists:splitwith(NoDot, L2),
+ ">"++L4 = lists:reverse(L3),
+ LZ = lists:reverse(L4),
+ X = 0 = list_to_integer(LX),
+ Y = list_to_integer(LY),
+ Z = list_to_integer(LZ),
+ XYZ = {X, Y, Z},
+ io:format("Self = ~w = ~w~n", [S,XYZ]),
+ {ok, [{matched, _node, 1}]} = dbg:p(S,call),
+ {ok, [{matched, _node, 1}]} = dbg:p(XYZ,call),
+ if Z =:= 0 ->
+ {ok, [{matched, _node, 1}]} = dbg:p(Y,call);
+ true -> ok
+ end,
+ {ok, [{matched, _node, 1}]} = dbg:p(L,call),
+ {ok, _} = dbg:tpl(?MODULE,not_exported,[]),
+ 4 = not_exported(2),
+ [{trace,S,call,{?MODULE,not_exported,[2]}}] = flush(),
+ {ok, _} = dbg:tp(?MODULE,exported,[]),
+ 4 = ?MODULE:exported(2),
+ [{trace,S,call,{?MODULE,exported,[2]}},
+ {trace,S,call,{?MODULE,not_exported,[2]}}] = flush(),
+ {ok, _} = dbg:ctpl(?MODULE),
+ 4 = ?MODULE:exported(2),
+ [{trace,S,call,{?MODULE,exported,[2]}}] = flush(),
+ {ok, _} = dbg:tpl(?MODULE,not_exported,[]),
+ {ok, _} = dbg:ctp(?MODULE),
+ 4 = ?MODULE:exported(2),
+ [] = flush(),
+ {ok, _} = dbg:tpl(?MODULE,not_exported,x),
+ catch ?MODULE:exported(x),
+ [{trace,S,call,{dbg_SUITE,not_exported,[x]}},
+ {trace,S,exception_from,
+ {dbg_SUITE,not_exported,1},
+ {error,badarith}}] = flush()
after
- ?line stop()
+ stop()
end,
ok.
-saved_patterns(suite) ->
- [];
-saved_patterns(doc) ->
- ["Tests saving of match_spec's."];
+%% Test that tracing on port works
+port(Config) when is_list(Config) ->
+ try
+ S = self(),
+ start(),
+ TestFile = filename:join(proplists:get_value(priv_dir, Config),"port_test"),
+ Fun = dbg:trace_port(file, TestFile),
+
+ %% Do a run to get rid of all extra port operations
+ port_close(Fun()),
+
+ dbg:p(new,ports),
+ Port = Fun(),
+ port_close(Port),
+ stop(),
+
+ TraceFileDrv = list_to_atom(lists:flatten(["trace_file_drv n ",TestFile])),
+ [{trace,Port,open,S,TraceFileDrv},
+ {trace,Port,getting_linked,S},
+ {trace,Port,closed,normal},
+ {trace,Port,unlink,S}] = flush()
+ after
+ dbg:stop()
+ end,
+ ok.
+
+%% Tests saving of match_spec's.
saved_patterns(Config) when is_list(Config) ->
- ?line dbg:stop(),
- ?line {ok,[{saved,1}]} =
- dbg:tp(dbg,ctp,1,[{'_',[],[{message, blahonga}]}]),
- ?line {ok,[{saved,2}]} =
- dbg:tp(dbg,ctp,1,[{['_'],[],[{message, blahonga}]}]),
- ?line Privdir=?config(priv_dir, Config),
- ?line file:make_dir(Privdir),
- ?line File = filename:join([Privdir, "blahonga.ms"]),
- ?line dbg:wtp(File),
- ?line dbg:stop(),
- ?line dbg:ctp('_','_','_'),
- ?line {ok, _} = start(),
+ dbg:stop(),
+ {ok,[{saved,1}]} =
+ dbg:tp(dbg,ctp,1,[{'_',[],[{message, blahonga}]}]),
+ {ok,[{saved,2}]} =
+ dbg:tp(dbg,ctp,1,[{['_'],[],[{message, blahonga}]}]),
+ Privdir=proplists:get_value(priv_dir, Config),
+ file:make_dir(Privdir),
+ File = filename:join([Privdir, "blahonga.ms"]),
+ dbg:wtp(File),
+ dbg:stop(),
+ dbg:ctp('_','_','_'),
+ {ok, _} = start(),
try
- ?line dbg:rtp(File),
- ?line {ok,[{matched,_node,1},{saved,1}]} = dbg:tp(dbg,ltp,0,1),
- ?line {ok, [{matched, _node, 1}]} = dbg:p(self(),call),
- ?line dbg:ltp(),
- ?line S = self(),
- ?line [{trace,S,call,{dbg,ltp,[]},blahonga}] = flush()
+ dbg:rtp(File),
+ {ok,[{matched,_node,1},{saved,1}]} = dbg:tp(dbg,ltp,0,1),
+ {ok, [{matched, _node, 1}]} = dbg:p(self(),call),
+ dbg:ltp(),
+ S = self(),
+ [{trace,S,call,{dbg,ltp,[]},blahonga}] = flush()
after
- ?line stop()
+ stop()
end,
ok.
@@ -309,148 +297,132 @@ not_exported(N) ->
exported(N) ->
not_exported(N).
-ip_port(suite) ->
- [];
-ip_port(doc) ->
- ["Test tracing to IP port"];
+%% Test tracing to IP port
ip_port(Config) when is_list(Config) ->
- ?line stop(),
- ?line Port = dbg:trace_port(ip, 0),
- ?line {ok, _} = dbg:tracer(port, Port),
+ stop(),
+ Port = dbg:trace_port(ip, 0),
+ {ok, _} = dbg:tracer(port, Port),
try
- ?line {ok, [{matched, _node, 1}]} = dbg:p(self(),call),
- ?line {ok, X} = dbg:tp(dbg, ltp,[{'_',[],[{message, {self}}]}]),
- ?line {value, {saved, _Saved}} = lists:keysearch(saved, 1, X),
- ?line {ok, Y} = dbg:tp(dbg, ln, [{'_',[],[{message, hej}]}]),
- ?line {value, {saved, _}} = lists:keysearch(saved, 1, Y),
- ?line ok = dbg:ltp(),
- ?line ok = dbg:ln(),
- ?line {ok, IpPort} = dbg:trace_port_control(get_listen_port),
- ?line io:format("IpPort = ~p~n", [IpPort]),
- ?line dbg:trace_client(ip, IpPort, {fun myhandler/2, self()}),
- ?line S = self(),
- ?line [{trace,S,call,{dbg,ltp,[]},S},
- {trace,S,call,{dbg,ln,[]},hej}] = flush()
+ {ok, [{matched, _node, 1}]} = dbg:p(self(),call),
+ {ok, X} = dbg:tp(dbg, ltp,[{'_',[],[{message, {self}}]}]),
+ {value, {saved, _Saved}} = lists:keysearch(saved, 1, X),
+ {ok, Y} = dbg:tp(dbg, ln, [{'_',[],[{message, hej}]}]),
+ {value, {saved, _}} = lists:keysearch(saved, 1, Y),
+ ok = dbg:ltp(),
+ ok = dbg:ln(),
+ {ok, IpPort} = dbg:trace_port_control(get_listen_port),
+ io:format("IpPort = ~p~n", [IpPort]),
+ dbg:trace_client(ip, IpPort, {fun myhandler/2, self()}),
+ S = self(),
+ [{trace,S,call,{dbg,ltp,[]},S},
+ {trace,S,call,{dbg,ln,[]},hej}] = flush()
after
- ?line stop()
+ stop()
end,
ok.
-ip_port_busy(suite) ->
- [];
-ip_port_busy(doc) ->
- ["Test that the dbg server does not hang if the tracer don't start ",
- "(OTP-3592)"];
+%% Test that the dbg server does not hang if the tracer don't start (OTP-3592)
ip_port_busy(Config) when is_list(Config) ->
- ?line stop(),
- ?line Tracer = dbg:trace_port(ip, 4745),
- ?line Port = Tracer(),
- ?line {error, Reason} = dbg:tracer(port, Tracer),
+ stop(),
+ Tracer = dbg:trace_port(ip, 4745),
+ Port = Tracer(),
+ {error, Reason} = dbg:tracer(port, Tracer),
try
- ?line io:format("Error reason = ~p~n", [Reason]),
- ?line true = port_close(Port)
+ io:format("Error reason = ~p~n", [Reason]),
+ true = port_close(Port)
after
- ?line dbg:stop()
+ dbg:stop()
end,
- ?line ok.
+ ok.
-file_port(suite) ->
- [];
-file_port(doc) ->
- ["Test tracing to file port (simple)"];
+%% Test tracing to file port (simple)
file_port(Config) when is_list(Config) ->
- ?line stop(),
- ?line {A,B,C} = erlang:now(),
- ?line FTMP = atom_to_list(?MODULE) ++ integer_to_list(A) ++ "-" ++
- integer_to_list(B) ++ "-" ++ integer_to_list(C),
- ?line FName = filename:join([?config(data_dir, Config), FTMP]),
- ?line Port = dbg:trace_port(file, FName),
- ?line {ok, _} = dbg:tracer(port, Port),
+ stop(),
+ {A,B,C} = erlang:now(),
+ FTMP = atom_to_list(?MODULE) ++ integer_to_list(A) ++ "-" ++
+ integer_to_list(B) ++ "-" ++ integer_to_list(C),
+ FName = filename:join([proplists:get_value(data_dir, Config), FTMP]),
+ Port = dbg:trace_port(file, FName),
+ {ok, _} = dbg:tracer(port, Port),
try
- ?line {ok, [{matched, _node, 1}]} = dbg:p(self(),call),
- ?line {ok, X} = dbg:tp(dbg, ltp,[{'_',[],[{message, {self}}]}]),
- ?line {value, {saved, _Saved}} = lists:keysearch(saved, 1, X),
- ?line {ok, Y} = dbg:tp(dbg, ln, [{'_',[],[{message, hej}]}]),
- ?line {value, {saved, _}} = lists:keysearch(saved, 1, Y),
- ?line ok = dbg:ltp(),
- ?line ok = dbg:ln(),
- ?line stop(),
- ?line dbg:trace_client(file, FName, {fun myhandler/2, self()}),
- ?line S = self(),
- ?line [{trace,S,call,{dbg,ltp,[]},S},
- {trace,S,call,{dbg,ln,[]},hej},
- end_of_trace] = flush()
+ {ok, [{matched, _node, 1}]} = dbg:p(self(),call),
+ {ok, X} = dbg:tp(dbg, ltp,[{'_',[],[{message, {self}}]}]),
+ {value, {saved, _Saved}} = lists:keysearch(saved, 1, X),
+ {ok, Y} = dbg:tp(dbg, ln, [{'_',[],[{message, hej}]}]),
+ {value, {saved, _}} = lists:keysearch(saved, 1, Y),
+ ok = dbg:ltp(),
+ ok = dbg:ln(),
+ stop(),
+ dbg:trace_client(file, FName, {fun myhandler/2, self()}),
+ S = self(),
+ [{trace,S,call,{dbg,ltp,[]},S},
+ {trace,S,call,{dbg,ln,[]},hej},
+ end_of_trace] = flush()
after
- ?line stop(),
- ?line file:delete(FName)
+ stop(),
+ file:delete(FName)
end,
ok.
-file_port2(suite) ->
- [];
-file_port2(doc) ->
- ["Test tracing to file port with 'follow_file'"];
+%% Test tracing to file port with 'follow_file'
file_port2(Config) when is_list(Config) ->
stop(),
{A,B,C} = erlang:now(),
FTMP = atom_to_list(?MODULE) ++ integer_to_list(A) ++
- "-" ++ integer_to_list(B) ++ "-" ++ integer_to_list(C),
- FName = filename:join([?config(data_dir, Config), FTMP]),
+ "-" ++ integer_to_list(B) ++ "-" ++ integer_to_list(C),
+ FName = filename:join([proplists:get_value(data_dir, Config), FTMP]),
%% Ok, lets try with flush and follow_file, not a chance on VxWorks
%% with NFS caching...
Port2 = dbg:trace_port(file, FName),
{ok, _} = dbg:tracer(port, Port2),
try
- {ok, [{matched, _node, 1}]} = dbg:p(self(),call),
- {ok, _} = dbg:tp(dbg, ltp,[{'_',[],[{message, {self}}]}]),
- {ok, _} = dbg:tp(dbg, ln, [{'_',[],[{message, hej}]}]),
- ok = dbg:ltp(),
- ok = dbg:flush_trace_port(),
- dbg:trace_client(follow_file, FName,
- {fun myhandler/2, self()}),
- S = self(),
- [{trace,S,call,{dbg,ltp,[]},S}] = flush(),
- ok = dbg:ln(),
- ok = dbg:flush_trace_port(),
- receive after 1000 -> ok end, %% Polls every second...
- [{trace,S,call,{dbg,ln,[]},hej}] = flush(),
- stop(),
- [] = flush()
+ {ok, [{matched, _node, 1}]} = dbg:p(self(),call),
+ {ok, _} = dbg:tp(dbg, ltp,[{'_',[],[{message, {self}}]}]),
+ {ok, _} = dbg:tp(dbg, ln, [{'_',[],[{message, hej}]}]),
+ ok = dbg:ltp(),
+ ok = dbg:flush_trace_port(),
+ dbg:trace_client(follow_file, FName,
+ {fun myhandler/2, self()}),
+ S = self(),
+ [{trace,S,call,{dbg,ltp,[]},S}] = flush(),
+ ok = dbg:ln(),
+ ok = dbg:flush_trace_port(),
+ receive after 1000 -> ok end, %% Polls every second...
+ [{trace,S,call,{dbg,ln,[]},hej}] = flush(),
+ stop(),
+ [] = flush()
after
- stop(),
- file:delete(FName)
+ stop(),
+ file:delete(FName)
end,
ok.
-file_port_schedfix(suite) ->
- [];
-file_port_schedfix(doc) ->
- ["Test that the scheduling timestamp fix for trace flag 'running' works."];
+%% Test that the scheduling timestamp fix for trace flag 'running' works.
file_port_schedfix(Config) when is_list(Config) ->
- ?line case (catch erlang:system_info(smp_support)) of
- true ->
- {skip, "No schedule fix on SMP"};
- _ ->
- try
- file_port_schedfix1(Config)
- after
- dbg:stop()
- end
- end.
+ case (catch erlang:system_info(smp_support)) of
+ true ->
+ {skip, "No schedule fix on SMP"};
+ _ ->
+ try
+ file_port_schedfix1(Config)
+ after
+ dbg:stop()
+ end
+ end.
file_port_schedfix1(Config) when is_list(Config) ->
- ?line stop(),
- ?line {A,B,C} = erlang:now(),
- ?line FTMP = atom_to_list(?MODULE) ++ integer_to_list(A) ++
- "-" ++ integer_to_list(B) ++ "-" ++ integer_to_list(C),
- ?line FName = filename:join([?config(data_dir, Config), FTMP]),
+ stop(),
+ {A,B,C} = erlang:now(),
+ FTMP = atom_to_list(?MODULE) ++ integer_to_list(A) ++
+ "-" ++ integer_to_list(B) ++ "-" ++ integer_to_list(C),
+ FName = filename:join([proplists:get_value(data_dir, Config), FTMP]),
%%
- ?line Port = dbg:trace_port(file, {FName, wrap, ".wraplog", 8*1024, 4}),
- ?line {ok, _} = dbg:tracer(port, Port),
- ?line {ok,[{matched,_node,0}]} = dbg:p(new,[running,procs,send,timestamp]),
+ Port = dbg:trace_port(file, {FName, wrap, ".wraplog", 8*1024, 4}),
+ {ok, _} = dbg:tracer(port, Port),
+ {ok,[{matched,_node,0}]} = dbg:p(new,[running,procs,send,timestamp]),
%%
%% Generate the trace data
%%
@@ -471,146 +443,135 @@ file_port_schedfix1(Config) when is_list(Config) ->
%% execution time. Wallclock. A normal result is about 10 times more
%% without schedule in - schedule out compensation (OTP-3938).
%%
- ?line ok = token_volleyball(3, 4, 8),
+ ok = token_volleyball(3, 4, 8),
+ %%
+ {ok,[{matched,_,_}]} = dbg:p(all, [clear]),
+ stop(),
%%
- ?line {ok,[{matched,_,_}]} = dbg:p(all, [clear]),
- ?line stop(),
- % Some debug code to run on all platforms, for finding the fault on genny
- % Dont touch please /PaN
- ?line io:format("Trace dump by PaN BEGIN~n"),
- ?line dbg:trace_client(file,{FName, wrap, ".wraplog"},{fun(end_of_trace,Pid)-> Pid ! done; (Mesg,Pid) -> io:format("~w~n",[Mesg]),Pid end,self()}),
- receive done -> ok end,
- ?line io:format("Trace dump by PaN END~n"),
- %%
%% Get the trace result
%%
- ?line Tag = make_ref(),
- ?line dbg:trace_client(file, {FName, wrap, ".wraplog"},
- {fun schedstat_handler/2, {self(), Tag, []}}),
- ?line Result =
- receive
- {Tag, D} ->
- lists:map(
- fun({Pid, {A1, B1, C1}}) ->
- {Pid, C1/1000000 + B1 + A1*1000000}
- end,
- D)
- end,
- ?line ok = io:format("Result=~p", [Result]),
-% erlang:display({?MODULE, ?LINE, Result}),
+ Tag = make_ref(),
+ dbg:trace_client(file, {FName, wrap, ".wraplog"},
+ {fun schedstat_handler/2, {self(), Tag, []}}),
+ Result =
+ receive
+ {Tag, D} ->
+ lists:map(
+ fun({Pid, {A1, B1, C1}}) ->
+ {Pid, C1/1000000 + B1 + A1*1000000}
+ end,
+ D)
+ end,
+ ok = io:format("Result=~p", [Result]),
+ % erlang:display({?MODULE, ?LINE, Result}),
%%
%% Analyze the result
%%
- ?line {Min, Max} =
- lists:foldl(
- fun({_Pid, M}, {Mi, Ma}) ->
- {if M < Mi -> M; true -> Mi end,
- if M > Ma -> M; true -> Ma end}
- end,
- {void, 0},
- Result),
+ {Min, Max} = lists:foldl(fun({_Pid, M}, {Mi, Ma}) ->
+ {if M < Mi -> M; true -> Mi end,
+ if M > Ma -> M; true -> Ma end}
+ end,
+ {void, 0},
+ Result),
% More PaN debug
- ?line io:format("Min = ~f, Max = ~f~n",[Min,Max]),
+ io:format("Min = ~f, Max = ~f~n",[Min,Max]),
%%
%% Cleanup
%%
- ?line ToBeDeleted = filelib:wildcard(FName++"*"++".wraplog"),
- ?line lists:map(fun file:delete/1, ToBeDeleted),
-% io:format("ToBeDeleted=~p", [ToBeDeleted]),
+ ToBeDeleted = filelib:wildcard(FName++"*"++".wraplog"),
+ lists:map(fun file:delete/1, ToBeDeleted),
+ % io:format("ToBeDeleted=~p", [ToBeDeleted]),
%%
%% Present the result
%%
P = (Max / Min - 1) * 100,
BottomLine = lists:flatten(io_lib:format("~.2f %", [P])),
if P > 100 ->
- Reason = {BottomLine, '>', "100%"},
- erlang:display({file_port_schedfix, fail, Reason}),
- test_server:fail(Reason);
+ Reason = {BottomLine, '>', "100%"},
+ erlang:display({file_port_schedfix, fail, Reason}),
+ ct:fail(Reason);
true ->
- {comment, BottomLine}
+ {comment, BottomLine}
end.
-wrap_port(suite) ->
- [];
-wrap_port(doc) ->
- ["Test tracing to wrapping file port"];
+%% Test tracing to wrapping file port
wrap_port(Config) when is_list(Config) ->
- ?line Self = self(),
- ?line stop(),
- ?line {A,B,C} = erlang:now(),
- ?line FTMP = atom_to_list(?MODULE) ++ integer_to_list(A) ++ "-" ++
- integer_to_list(B) ++ "-" ++ integer_to_list(C) ++ "-",
- ?line FName = filename:join([?config(data_dir, Config), FTMP]),
- ?line FNameWildcard = FName++"*"++".trace",
+ Self = self(),
+ stop(),
+ {A,B,C} = erlang:now(),
+ FTMP = atom_to_list(?MODULE) ++ integer_to_list(A) ++ "-" ++
+ integer_to_list(B) ++ "-" ++ integer_to_list(C) ++ "-",
+ FName = filename:join([proplists:get_value(data_dir, Config), FTMP]),
+ FNameWildcard = FName++"*"++".trace",
%% WrapSize=0 and WrapCnt=11 will force the trace to wrap after
%% every trace message, and to contain only the last 10 entries
%% after trace stop since the last file will be empty waiting
%% for its first trace message.
- ?line WrapSize = 0,
- ?line WrapCnt = 11,
- ?line WrapFilesSpec = {FName, wrap, ".trace", WrapSize, WrapCnt},
- ?line wrap_port_init(WrapFilesSpec),
+ WrapSize = 0,
+ WrapCnt = 11,
+ WrapFilesSpec = {FName, wrap, ".trace", WrapSize, WrapCnt},
+ wrap_port_init(WrapFilesSpec),
%% The number of iterations, N, is tested to place wrap the log,
%% giving a gap in the filename sequence at index 3.
%% This should be a difficult case for
%% the trace_client file sorting functionality.
N = 7,
- ?line lists:foreach(
- fun(Cnt) ->
- ?MODULE:tracee1(Cnt),
- ?MODULE:tracee2(Cnt)
- end,
- lists:seq(1, N)),
- ?line stop(),
+ lists:foreach(
+ fun(Cnt) ->
+ ?MODULE:tracee1(Cnt),
+ ?MODULE:tracee2(Cnt)
+ end,
+ lists:seq(1, N)),
+ stop(),
try
- ?line Files1 = filelib:wildcard(FNameWildcard),
- ?line io:format("~p~n", [Files1]),
- ?line Tc1 = dbg:trace_client(file, WrapFilesSpec,
- {fun myhandler/2, {wait_for_go,Self}}),
- ?line Tref1 = erlang:monitor(process, Tc1),
- Tc1 ! {go,Self},
- ?line [{'DOWN',Tref1,_,_,normal},
- end_of_trace
- |Result] = lists:reverse(flush()),
- ?line M = N - (WrapCnt-1) div 2,
- ?line M = wrap_port_result(Result, Self, N),
- %%
- %% Start a new wrap log with the same name to verify that
- %% all files are cleared at wrap log start. Only produce
- %% two trace messages to also place the gap at index 3,
- %% so the trace log will be misinterpreted.
- %%
- ?line wrap_port_init(WrapFilesSpec),
- ?line Files2 = filelib:wildcard(FNameWildcard),
- ?line io:format("~p~n", [Files2]),
- ?line -1 = ?MODULE:tracee1(-1),
- ?line -1 = ?MODULE:tracee2(-1),
- ?line stop(),
- ?line Files = filelib:wildcard(FNameWildcard),
- ?line io:format("~p~n", [Files]),
- ?line Tc2 = dbg:trace_client(file, WrapFilesSpec,
- {fun myhandler/2, {wait_for_go,Self}}),
- ?line Tref2 = erlang:monitor(process, Tc2),
- Tc2 ! {go,Self},
- ?line [{trace,Self,call,{?MODULE,tracee1,[-1]},Self},
- {trace,Self,call,{?MODULE,tracee2,[-1]},hej},
- end_of_trace,
- {'DOWN',Tref2,_,_,normal}] = flush(),
- %%
- ?line lists:map(fun(F) -> file:delete(F) end, Files)
+ Files1 = filelib:wildcard(FNameWildcard),
+ io:format("~p~n", [Files1]),
+ Tc1 = dbg:trace_client(file, WrapFilesSpec,
+ {fun myhandler/2, {wait_for_go,Self}}),
+ Tref1 = erlang:monitor(process, Tc1),
+ Tc1 ! {go,Self},
+ [{'DOWN',Tref1,_,_,normal},
+ end_of_trace
+ |Result] = lists:reverse(flush()),
+ M = N - (WrapCnt-1) div 2,
+ M = wrap_port_result(Result, Self, N),
+ %%
+ %% Start a new wrap log with the same name to verify that
+ %% all files are cleared at wrap log start. Only produce
+ %% two trace messages to also place the gap at index 3,
+ %% so the trace log will be misinterpreted.
+ %%
+ wrap_port_init(WrapFilesSpec),
+ Files2 = filelib:wildcard(FNameWildcard),
+ io:format("~p~n", [Files2]),
+ -1 = ?MODULE:tracee1(-1),
+ -1 = ?MODULE:tracee2(-1),
+ stop(),
+ Files = filelib:wildcard(FNameWildcard),
+ io:format("~p~n", [Files]),
+ Tc2 = dbg:trace_client(file, WrapFilesSpec,
+ {fun myhandler/2, {wait_for_go,Self}}),
+ Tref2 = erlang:monitor(process, Tc2),
+ Tc2 ! {go,Self},
+ [{trace,Self,call,{?MODULE,tracee1,[-1]},Self},
+ {trace,Self,call,{?MODULE,tracee2,[-1]},hej},
+ end_of_trace,
+ {'DOWN',Tref2,_,_,normal}] = flush(),
+ %%
+ lists:map(fun(F) -> file:delete(F) end, Files)
after
- ?line stop()
+ stop()
end,
ok.
wrap_port_init(WrapFilesSpec) ->
- ?line Port = dbg:trace_port(file, WrapFilesSpec),
- ?line {ok, _} = dbg:tracer(port, Port),
- ?line {ok, [{matched, _node, 1}]} = dbg:p(self(),call),
- ?line {ok, X} = dbg:tp(?MODULE, tracee1,[{'_',[],[{message, {self}}]}]),
- ?line {value, {saved, _Saved}} = lists:keysearch(saved, 1, X),
- ?line {ok, Y} = dbg:tp(?MODULE, tracee2, [{'_',[],[{message, hej}]}]),
- ?line {value, {saved, _}} = lists:keysearch(saved, 1, Y),
+ Port = dbg:trace_port(file, WrapFilesSpec),
+ {ok, _} = dbg:tracer(port, Port),
+ {ok, [{matched, _node, 1}]} = dbg:p(self(),call),
+ {ok, X} = dbg:tp(?MODULE, tracee1,[{'_',[],[{message, {self}}]}]),
+ {value, {saved, _Saved}} = lists:keysearch(saved, 1, X),
+ {ok, Y} = dbg:tp(?MODULE, tracee2, [{'_',[],[{message, hej}]}]),
+ {value, {saved, _}} = lists:keysearch(saved, 1, Y),
ok.
tracee1(X) ->
@@ -622,106 +583,96 @@ tracee2(X) ->
wrap_port_result([], _S, M) ->
M;
wrap_port_result([{trace, S, call, {?MODULE, tracee2, [M]}, hej},
- {trace, S, call, {?MODULE, tracee1, [M]}, S} | Tail],
- S,
- M) ->
+ {trace, S, call, {?MODULE, tracee1, [M]}, S} | Tail],
+ S,
+ M) ->
wrap_port_result(Tail, S, M-1).
-wrap_port_time(suite) ->
- [];
-wrap_port_time(doc) ->
- ["Test tracing to time limited wrapping file port"];
+%% Test tracing to time limited wrapping file port
wrap_port_time(Config) when is_list(Config) ->
- ?line stop(),
- ?line {A,B,C} = erlang:now(),
- ?line FTMP = atom_to_list(?MODULE) ++ integer_to_list(A) ++ "-" ++
- integer_to_list(B) ++ "-" ++ integer_to_list(C) ++ "-",
- ?line FName = filename:join([?config(data_dir, Config), FTMP]),
+ stop(),
+ {A,B,C} = erlang:now(),
+ FTMP = atom_to_list(?MODULE) ++ integer_to_list(A) ++ "-" ++
+ integer_to_list(B) ++ "-" ++ integer_to_list(C) ++ "-",
+ FName = filename:join([proplists:get_value(data_dir, Config), FTMP]),
%% WrapTime=2 and WrapCnt=4 will force the trace to wrap after
%% every 2 seconds, and to contain between 3*2 and 4*2 seconds
%% of trace entries.
- ?line WrapFilesSpec = {FName, wrap, ".trace", {time, 2000}, 4},
- ?line Port = dbg:trace_port(file, WrapFilesSpec),
- ?line {ok, _} = dbg:tracer(port, Port),
+ WrapFilesSpec = {FName, wrap, ".trace", {time, 2000}, 4},
+ Port = dbg:trace_port(file, WrapFilesSpec),
+ {ok, _} = dbg:tracer(port, Port),
try
- ?line {ok, [{matched, _node, 1}]} = dbg:p(self(),call),
- ?line {ok, X} = dbg:tp(?MODULE, tracee1,[{'_',[],[{message, {self}}]}]),
- ?line {value, {saved, _Saved1}} = lists:keysearch(saved, 1, X),
- ?line {ok, Y} = dbg:tp(?MODULE, tracee2, [{'_',[],[{message, hej}]}]),
- ?line {value, {saved, _Saved2}} = lists:keysearch(saved, 1, Y),
- %% The delays in the iterations places two trace messages in each
- %% trace file, but the last which is empty waiting for its first
- %% trace message. The number of iterations is chosen so that
- %% one trace file has been wasted, and therefore the first pair
- %% of trace messages.
- ?line lists:foreach(
- fun(Cnt) ->
- receive after 1000 -> ok end,
- ?MODULE:tracee1(Cnt),
- ?MODULE:tracee2(Cnt),
- receive after 1100 -> ok end
- end,
- lists:seq(1, 4)),
- ?line stop(),
- ?line Files = filelib:wildcard(FName ++ "*" ++ ".trace"),
- ?line io:format("~p~n", [Files]),
- ?line dbg:trace_client(file, WrapFilesSpec, {fun myhandler/2, self()}),
- ?line S = self(),
- ?line [{trace, S, call, {?MODULE, tracee1, [2]}, S},
- {trace, S, call, {?MODULE, tracee2, [2]}, hej},
- {trace, S, call, {?MODULE, tracee1, [3]}, S},
- {trace, S, call, {?MODULE, tracee2, [3]}, hej},
- {trace, S, call, {?MODULE, tracee1, [4]}, S},
- {trace, S, call, {?MODULE, tracee2, [4]}, hej},
- end_of_trace] = flush(),
- ?line lists:map(fun(F) -> file:delete(F) end, Files)
+ {ok, [{matched, _node, 1}]} = dbg:p(self(),call),
+ {ok, X} = dbg:tp(?MODULE, tracee1,[{'_',[],[{message, {self}}]}]),
+ {value, {saved, _Saved1}} = lists:keysearch(saved, 1, X),
+ {ok, Y} = dbg:tp(?MODULE, tracee2, [{'_',[],[{message, hej}]}]),
+ {value, {saved, _Saved2}} = lists:keysearch(saved, 1, Y),
+ %% The delays in the iterations places two trace messages in each
+ %% trace file, but the last which is empty waiting for its first
+ %% trace message. The number of iterations is chosen so that
+ %% one trace file has been wasted, and therefore the first pair
+ %% of trace messages.
+ lists:foreach(
+ fun(Cnt) ->
+ receive after 1000 -> ok end,
+ ?MODULE:tracee1(Cnt),
+ ?MODULE:tracee2(Cnt),
+ receive after 1100 -> ok end
+ end,
+ lists:seq(1, 4)),
+ stop(),
+ Files = filelib:wildcard(FName ++ "*" ++ ".trace"),
+ io:format("~p~n", [Files]),
+ dbg:trace_client(file, WrapFilesSpec, {fun myhandler/2, self()}),
+ S = self(),
+ [{trace, S, call, {?MODULE, tracee1, [2]}, S},
+ {trace, S, call, {?MODULE, tracee2, [2]}, hej},
+ {trace, S, call, {?MODULE, tracee1, [3]}, S},
+ {trace, S, call, {?MODULE, tracee2, [3]}, hej},
+ {trace, S, call, {?MODULE, tracee1, [4]}, S},
+ {trace, S, call, {?MODULE, tracee2, [4]}, hej},
+ end_of_trace] = flush(),
+ lists:map(fun(F) -> file:delete(F) end, Files)
after
- ?line stop()
+ stop()
end,
ok.
-with_seq_trace(suite) ->
- [];
-with_seq_trace(doc) ->
- ["Test ordinary tracing combined with seq_trace"];
+%% Test ordinary tracing combined with seq_trace
with_seq_trace(Config) when is_list(Config) ->
try
- ?line {ok, Server} = start(),
- ?line {ok, Tracer} = dbg:get_tracer(),
- ?line {ok, X} = dbg:tp(dbg, get_tracer, [{[],[],
- [{set_seq_token, send, true}]}]),
- ?line {value, {saved, _}} = lists:keysearch(saved, 1, X),
- ?line {ok, [{matched, _node, 1}]} = dbg:p(self(),call),
- ?line seq_trace:set_system_tracer(Tracer),
- ?line dbg:get_tracer(),
- receive
- after 1 ->
- ok
- end,
- ?line S = self(),
- ?line ThisNode = node(),
- ?line [{trace,S,call,{dbg,get_tracer,[]}},
- {seq_trace,0,{send,_,S,Server,{S,{get_tracer,ThisNode}}}},
- {seq_trace,0,{send,_,Server,S,{dbg,{ok,Tracer}}}}] =
- flush()
+ {ok, Server} = start(),
+ {ok, Tracer} = dbg:get_tracer(),
+ {ok, X} = dbg:tp(dbg, get_tracer, [{[],[],
+ [{set_seq_token, send, true}]}]),
+ {value, {saved, _}} = lists:keysearch(saved, 1, X),
+ {ok, [{matched, _node, 1}]} = dbg:p(self(),call),
+ seq_trace:set_system_tracer(Tracer),
+ dbg:get_tracer(),
+ receive
+ after 1 ->
+ ok
+ end,
+ S = self(),
+ ThisNode = node(),
+ [{trace,S,call,{dbg,get_tracer,[]}},
+ {seq_trace,0,{send,_,S,Server,{S,{get_tracer,ThisNode}}}},
+ {seq_trace,0,{send,_,Server,S,{dbg,{ok,Tracer}}}}] =
+ flush()
after
- ?line stop()
+ stop()
end,
ok.
-dead_suspend(suite) ->
- [];
-dead_suspend(doc) ->
- ["Test that trace messages concerning a now dead process does "
- "not crash dbg."];
+%% Test that trace messages concerning a now dead process does not crash dbg.
dead_suspend(Config) when is_list(Config) ->
- ?line start(),
+ start(),
try
- survived = run_dead_suspend()
+ survived = run_dead_suspend()
after
- ?line stop()
+ stop()
end.
run_dead_suspend() ->
@@ -734,10 +685,10 @@ run_dead_suspend() ->
spawn(?MODULE, dummy, []),
receive after 1000 -> ok end,
case whereis(dbg) of
- undefined ->
- died;
- _ ->
- survived
+ undefined ->
+ died;
+ _ ->
+ survived
end.
dummy() ->
@@ -749,10 +700,10 @@ tracer_exit_on_stop(_) ->
%% Tracer blocks waiting for fun to complete so that the trace message and
%% the exit signal message from the dbg process are in its message queue.
Fun = fun() ->
- ?MODULE:dummy(),
- Ref = erlang:trace_delivered(self()),
- receive {trace_delivered, _, Ref} -> stop() end
- end,
+ ?MODULE:dummy(),
+ Ref = erlang:trace_delivered(self()),
+ receive {trace_delivered, _, Ref} -> stop() end
+ end,
{ok, _} = dbg:tracer(process, {fun spawn_once_handler/2, {self(), Fun}}),
{ok, Tracer} = dbg:get_tracer(),
MRef = monitor(process, Tracer),
@@ -771,11 +722,83 @@ spawn_once_handler(Event, {Pid, done} = State) ->
spawn_once_handler(Event, {Pid, Fun}) ->
{_, Ref} = spawn_monitor(Fun),
receive
- {'DOWN', Ref, _, _, _} ->
- Pid ! Event,
- {Pid, done}
+ {'DOWN', Ref, _, _, _} ->
+ Pid ! Event,
+ {Pid, done}
end.
+%% Test that erl_tracer modules work correctly
+erl_tracer(Config) ->
+ stop(),
+
+ ok = load_nif(Config),
+
+ Self = self(),
+ {ok, _} = dbg:tracer(module, {?MODULE, Self}),
+ {ok, {?MODULE, Self}} = dbg:get_tracer(),
+ {ok, _} = dbg:p(self(), [c, timestamp]),
+ {ok, _} = dbg:tp(?MODULE, dummy, []),
+ ok = ?MODULE:dummy(),
+ [{Self, call, Self, Self, {?MODULE, dummy, []}, undefined, #{}}] = flush(),
+ ok.
+
+%% Test that distributed erl_tracer modules work
+distributed_erl_tracer(Config) ->
+ stop(),
+
+ S = self(),
+
+ ok = load_nif(Config),
+
+ LNode = node(),
+ RNode = start_slave(),
+ true = rpc:call(RNode, code, add_patha, [filename:join(proplists:get_value(data_dir, Config), "..")]),
+ ok = rpc:call(RNode, ?MODULE, load_nif, [Config]),
+
+ NifProxy = fun() ->
+ register(nif_proxy, self()),
+ receive M -> S ! M end
+ end,
+
+ LNifProxy = spawn_link(LNode, NifProxy),
+ RNifProxy = spawn_link(RNode, NifProxy),
+
+ TracerFun = fun() -> {?MODULE, whereis(nif_proxy)} end,
+
+ {ok, _} = dbg:tracer(LNode, module, TracerFun),
+ {ok, _} = dbg:tracer(RNode, module, TracerFun),
+
+ {ok, [{matched, _, _}, {matched, _, _}]} = dbg:p(all,c),
+ {ok, [_, _]} = dbg:tp(?MODULE, dummy, []),
+
+ {ok, {?MODULE, LNifProxy}} = dbg:get_tracer(LNode),
+ {ok, {?MODULE, RNifProxy}} = dbg:get_tracer(RNode),
+
+ LCall = spawn_link(LNode, fun() -> ?MODULE:dummy() end),
+ [{LCall, call, LNifProxy, LCall, {?MODULE, dummy, []}, undefined, #{}}] = flush(),
+
+ RCall = spawn_link(RNode, fun() -> ?MODULE:dummy() end),
+ [{RCall, call, RNifProxy, RCall, {?MODULE, dummy, []}, undefined, #{}}] = flush(),
+
+
+ ok.
+
+load_nif(Config) ->
+ SoFile = atom_to_list(?MODULE),
+ DataDir = proplists:get_value(data_dir, Config),
+ case erlang:load_nif(filename:join(DataDir, SoFile) , 0) of
+ {error, {reload, _}} ->
+ ok;
+ ok ->
+ ok
+ end.
+
+enabled(_, _, _) ->
+ erlang:nif_error(nif_not_loaded).
+
+trace(_, _, _, _, _, _) ->
+ erlang:nif_error(nif_not_loaded).
+
%%
%% Support functions
%%
@@ -794,38 +817,38 @@ wait_node(_,0) ->
no;
wait_node(Node, N) ->
case net_adm:ping(Node) of
- pong ->
- ok;
- pang ->
- receive
- after 1000 ->
- ok
- end,
- wait_node(Node, N - 1)
+ pong ->
+ ok;
+ pang ->
+ receive
+ after 1000 ->
+ ok
+ end,
+ wait_node(Node, N - 1)
end.
myhandler(Message, {wait_for_go,Pid}) ->
receive
- {go,Pid} ->
- myhandler(Message, Pid)
+ {go,Pid} ->
+ myhandler(Message, Pid)
end;
myhandler(Message, Relay) ->
Relay ! Message,
case Message of
- end_of_trace ->
- ok;
- _ ->
- Relay
+ end_of_trace ->
+ ok;
+ _ ->
+ Relay
end.
flush() ->
flush([]).
flush(Acc) ->
receive
- X ->
- flush(Acc ++ [X])
+ X ->
+ flush(Acc ++ [X])
after 1000 ->
- Acc
+ Acc
end.
start() ->
@@ -839,88 +862,92 @@ stop() ->
schedstat_handler(TraceMsg, {Parent, Tag, Data} = State) ->
case TraceMsg of
- {trace_ts, Pid, in, _, Ts} ->
- NewData =
- case lists:keysearch(Pid, 1, Data) of
- {value, {Pid, Acc}} ->
- [{Pid, Acc, Ts} | lists:keydelete(Pid, 1, Data)];
- false ->
- [{Pid, {0, 0, 0}, Ts} | Data];
- Other ->
- exit(Parent, {?MODULE, ?LINE, Other}),
- erlang:display({?MODULE, ?LINE, Other}),
- Data
- end,
- {Parent, Tag, NewData};
- {trace_ts, Pid, out, _, {A3, B3, C3}} ->
- NewData =
- case lists:keysearch(Pid, 1, Data) of
- {value, {Pid, {A1, B1, C1}, {A2, B2, C2}}} ->
- [{Pid, {A3-A2+A1, B3-B2+B1, C3-C2+C1}} |
- lists:keydelete(Pid, 1, Data)];
- Other ->
- exit(Parent, {?MODULE, ?LINE, Other}),
- erlang:display({?MODULE, ?LINE, Other}),
- Data
- end,
- {Parent, Tag, NewData};
- {trace_ts, Pid, exit, normal, {A3, B3, C3}} ->
- NewData =
- case lists:keysearch(Pid, 1, Data) of
- {value, {Pid, {A1, B1, C1}, {A2, B2, C2}}} ->
- [{Pid, {A3-A2+A1, B3-B2+B1, C3-C2+C1}} |
- lists:keydelete(Pid, 1, Data)];
- {value, {Pid, _Acc}} ->
- Data;
- false ->
- [{Pid, {0, 0, 0}} | Data];
- Other ->
- exit(Parent, {?MODULE, ?LINE, Other}),
- erlang:display({?MODULE, ?LINE, Other}),
- Data
- end,
- {Parent, Tag, NewData};
- {trace_ts, _Pid, send, _Msg, _OtherPid, _Ts} ->
- State;
- end_of_trace ->
- Parent ! {Tag, Data},
- State
+ {trace_ts, Pid, in, _, Ts} ->
+ NewData =
+ case lists:keysearch(Pid, 1, Data) of
+ {value, {Pid, Acc}} ->
+ [{Pid, Acc, Ts} | lists:keydelete(Pid, 1, Data)];
+ false ->
+ [{Pid, {0, 0, 0}, Ts} | Data];
+ Other ->
+ exit(Parent, {?MODULE, ?LINE, Other}),
+ erlang:display({?MODULE, ?LINE, Other}),
+ Data
+ end,
+ {Parent, Tag, NewData};
+ {trace_ts, Pid, out, _, {A3, B3, C3}} ->
+ NewData =
+ case lists:keysearch(Pid, 1, Data) of
+ {value, {Pid, {A1, B1, C1}, {A2, B2, C2}}} ->
+ [{Pid, {A3-A2+A1, B3-B2+B1, C3-C2+C1}} |
+ lists:keydelete(Pid, 1, Data)];
+ Other ->
+ exit(Parent, {?MODULE, ?LINE, Other}),
+ erlang:display({?MODULE, ?LINE, Other}),
+ Data
+ end,
+ {Parent, Tag, NewData};
+ {trace_ts,_Pid,spawned,_OtherPid,_,_Ts} ->
+ State;
+ {trace_ts,_Pid,getting_linked,_OtherPid,_Ts} ->
+ State;
+ {trace_ts, Pid, exit, normal, {A3, B3, C3}} ->
+ NewData =
+ case lists:keysearch(Pid, 1, Data) of
+ {value, {Pid, {A1, B1, C1}, {A2, B2, C2}}} ->
+ [{Pid, {A3-A2+A1, B3-B2+B1, C3-C2+C1}} |
+ lists:keydelete(Pid, 1, Data)];
+ {value, {Pid, _Acc}} ->
+ Data;
+ false ->
+ [{Pid, {0, 0, 0}} | Data];
+ Other ->
+ exit(Parent, {?MODULE, ?LINE, Other}),
+ erlang:display({?MODULE, ?LINE, Other}),
+ Data
+ end,
+ {Parent, Tag, NewData};
+ {trace_ts, _Pid, send, _Msg, _OtherPid, _Ts} ->
+ State;
+ end_of_trace ->
+ Parent ! {Tag, Data},
+ State
end.
pass_token(Token, Next, Loops) ->
receive
- {Token, 1} = Msg ->
- sendloop(Loops),
- Next ! Msg;
- {Token, _Cnt} = Msg->
- sendloop(Loops),
- Next ! Msg,
- pass_token(Token, Next, Loops)
+ {Token, 1} = Msg ->
+ sendloop(Loops),
+ Next ! Msg;
+ {Token, _Cnt} = Msg->
+ sendloop(Loops),
+ Next ! Msg,
+ pass_token(Token, Next, Loops)
end.
pass_token(Token, Final, Cnt, Loops) ->
receive
- {Token, start, Next} ->
- sendloop(Loops),
- Msg = {Token, Cnt},
- Next ! Msg,
- pass_token(Token, Final, Next, Cnt, Loops)
+ {Token, start, Next} ->
+ sendloop(Loops),
+ Msg = {Token, Cnt},
+ Next ! Msg,
+ pass_token(Token, Final, Next, Cnt, Loops)
end.
pass_token(Token, Final, Next, Cnt, Loops) ->
receive
- {Token, 1} ->
- sendloop(Loops),
- Msg = {Token, done},
- Final ! Msg;
- {Token, Cnt} ->
- sendloop(Loops),
- NextCnt = Cnt-1,
- Msg = {Token, NextCnt},
- Next ! Msg,
- pass_token(Token, Final, Next, NextCnt, Loops)
+ {Token, 1} ->
+ sendloop(Loops),
+ Msg = {Token, done},
+ Final ! Msg;
+ {Token, Cnt} ->
+ sendloop(Loops),
+ NextCnt = Cnt-1,
+ Msg = {Token, NextCnt},
+ Next ! Msg,
+ pass_token(Token, Final, Next, NextCnt, Loops)
end.
sendloop(Loops) ->
diff --git a/lib/runtime_tools/test/dbg_SUITE_data/Makefile.src b/lib/runtime_tools/test/dbg_SUITE_data/Makefile.src
new file mode 100644
index 0000000000..f3d63bd4d1
--- /dev/null
+++ b/lib/runtime_tools/test/dbg_SUITE_data/Makefile.src
@@ -0,0 +1,8 @@
+
+NIF_LIBS = dbg_SUITE@dll@
+
+all: $(NIF_LIBS)
+
+@SHLIB_RULES@
+
+$(NIF_LIBS): dbg_SUITE.c
diff --git a/lib/runtime_tools/test/dbg_SUITE_data/dbg_SUITE.c b/lib/runtime_tools/test/dbg_SUITE_data/dbg_SUITE.c
new file mode 100644
index 0000000000..45f14938c6
--- /dev/null
+++ b/lib/runtime_tools/test/dbg_SUITE_data/dbg_SUITE.c
@@ -0,0 +1,113 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Ericsson AB 2009-2014. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+#include "erl_nif.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <limits.h>
+
+/* NIF interface declarations */
+static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info);
+static int upgrade(ErlNifEnv* env, void** priv_data, void** old_priv_data, ERL_NIF_TERM load_info);
+static void unload(ErlNifEnv* env, void* priv_data);
+
+/* The NIFs: */
+static ERL_NIF_TERM enabled(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM trace(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+
+static ErlNifFunc nif_funcs[] = {
+ {"enabled", 3, enabled},
+ {"trace", 6, trace}
+};
+
+ERL_NIF_INIT(dbg_SUITE, nif_funcs, load, NULL, upgrade, unload)
+
+static ERL_NIF_TERM atom_trace;
+static ERL_NIF_TERM atom_ok;
+
+#define ASSERT(expr) assert(expr)
+
+static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info)
+{
+
+ atom_trace = enif_make_atom(env, "trace");
+ atom_ok = enif_make_atom(env, "ok");
+
+ *priv_data = NULL;
+
+ return 0;
+}
+
+static void unload(ErlNifEnv* env, void* priv_data)
+{
+
+}
+
+static int upgrade(ErlNifEnv* env, void** priv_data, void** old_priv_data,
+ ERL_NIF_TERM load_info)
+{
+ if (*old_priv_data != NULL) {
+ return -1; /* Don't know how to do that */
+ }
+ if (*priv_data != NULL) {
+ return -1; /* Don't know how to do that */
+ }
+ if (load(env, priv_data, load_info)) {
+ return -1;
+ }
+ return 0;
+}
+
+static ERL_NIF_TERM enabled(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ int state_arity;
+ const ERL_NIF_TERM *state_tuple;
+ ERL_NIF_TERM value;
+ ASSERT(argc == 3);
+
+
+ return atom_trace;
+}
+
+static ERL_NIF_TERM trace(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ int state_arity;
+ ErlNifPid self, to;
+ ERL_NIF_TERM *tuple, msg;
+ ASSERT(argc == 6);
+
+ tuple = enif_alloc(sizeof(ERL_NIF_TERM)*(argc+1));
+ memcpy(tuple+1,argv,sizeof(ERL_NIF_TERM)*argc);
+
+ if (enif_self(env, &self)) {
+ tuple[0] = enif_make_pid(env, &self);
+ } else {
+ tuple[0] = enif_make_atom(env, "undefined");
+ }
+
+ msg = enif_make_tuple_from_array(env, tuple, argc + 1);
+ enif_get_local_pid(env, argv[1], &to);
+ enif_send(env, &to, NULL, msg);
+ enif_free(tuple);
+
+ return atom_ok;
+}
diff --git a/lib/runtime_tools/test/dbg_SUITE_data/dbg_test.erl b/lib/runtime_tools/test/dbg_SUITE_data/dbg_test.erl
index 33de329a62..68ece5936e 100644
--- a/lib/runtime_tools/test/dbg_SUITE_data/dbg_test.erl
+++ b/lib/runtime_tools/test/dbg_SUITE_data/dbg_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/test/dbg_SUITE_data/exref_td.erl b/lib/runtime_tools/test/dbg_SUITE_data/exref_td.erl
index 1e47482fbd..d91fb41440 100644
--- a/lib/runtime_tools/test/dbg_SUITE_data/exref_td.erl
+++ b/lib/runtime_tools/test/dbg_SUITE_data/exref_td.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/runtime_tools/test/dyntrace_SUITE.erl b/lib/runtime_tools/test/dyntrace_SUITE.erl
index 6d39bc54f4..7be2f49a8b 100644
--- a/lib/runtime_tools/test/dyntrace_SUITE.erl
+++ b/lib/runtime_tools/test/dyntrace_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -20,26 +20,14 @@
-module(dyntrace_SUITE).
-include_lib("common_test/include/ct.hrl").
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2]).
--export([init_per_testcase/2, end_per_testcase/2]).
+-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1]).
%% Test cases
-export([smoke/1,process/1]).
-%% Default timetrap timeout (set in init_per_testcase)
--define(default_timeout, ?t:minutes(1)).
-
-init_per_testcase(_Case, Config) ->
- Dog = test_server:timetrap(?default_timeout),
- [{watchdog,Dog}|Config].
-
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
- ok.
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {minutes, 1}}].
all() ->
case erlang:system_info(dynamic_trace) of
@@ -48,7 +36,9 @@ all() ->
dtrace ->
[{group,smoke}];
systemtap ->
- {skip,"SystemTap tests currently not supported"}
+ {skip,"SystemTap tests currently not supported"};
+ lttng ->
+ {skip,"LTTng tests currently not supported"}
end.
groups() ->
@@ -71,14 +61,8 @@ init_per_suite(Config) ->
end_per_suite(_Config) ->
ok.
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
smoke(Config) ->
- Emu = ?t:lookup_config(emu_name, Config),
+ Emu = test_server:lookup_config(emu_name, Config),
BinEmu = list_to_binary(Emu),
case erlang:system_info(dynamic_trace) of
dtrace ->
@@ -105,8 +89,7 @@ process(_Config) ->
{probe,"process-hibernate"},
{action,[{printf,["hibernate %s %s\n",{arg,0},{arg,1}]}]},
{probe,"process-exit"},
- {action,[{printf,["exit %s %s\n",{arg,0},{arg,1}]}]}
- ],
+ {action,[{printf,["exit %s %s\n",{arg,0},{arg,1}]}]}],
F = fun() ->
{Pid,Ref} = spawn_monitor(fun my_process/0),
Pid ! hibernate,
diff --git a/lib/runtime_tools/test/dyntrace_lttng_SUITE.erl b/lib/runtime_tools/test/dyntrace_lttng_SUITE.erl
new file mode 100644
index 0000000000..e6c147b003
--- /dev/null
+++ b/lib/runtime_tools/test/dyntrace_lttng_SUITE.erl
@@ -0,0 +1,377 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+-module(dyntrace_lttng_SUITE).
+-include_lib("common_test/include/ct.hrl").
+
+-export([all/0, suite/0]).
+-export([init_per_suite/1, end_per_suite/1]).
+-export([init_per_testcase/2, end_per_testcase/2]).
+
+%% Test cases
+-export([t_lttng_list/1,
+ t_procs/1,
+ t_ports/1,
+ t_running_process/1,
+ t_running_port/1,
+ t_call/1,
+ t_call_return_to/1,
+ t_call_silent/1,
+ t_send/1,
+ t_receive/1,
+ t_garbage_collection/1,
+ t_all/1]).
+
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {seconds, 10}}].
+
+all() ->
+ [t_lttng_list,
+ t_procs,
+ t_ports,
+ t_running_process,
+ t_running_port,
+ t_call,
+ t_call_return_to,
+ t_call_silent,
+ t_send,
+ t_receive,
+ t_garbage_collection,
+ t_all].
+
+
+init_per_suite(Config) ->
+ case erlang:system_info(dynamic_trace) of
+ lttng ->
+ ensure_lttng_stopped("--all"),
+ Config;
+ _ ->
+ {skip, "No LTTng configured on system."}
+ end.
+
+end_per_suite(_Config) ->
+ ensure_lttng_stopped("--all"),
+ ok.
+
+init_per_testcase(Case, Config) ->
+ %% ensure loaded
+ _ = dyntrace:module_info(),
+ Name = atom_to_list(Case),
+ ok = ensure_lttng_started(Name, Config),
+ [{session, Name}|Config].
+
+end_per_testcase(Case, _Config) ->
+ Name = atom_to_list(Case),
+ ok = ensure_lttng_stopped(Name),
+ ok.
+
+%% tracepoints
+%%
+%% com_ericsson_dyntrace:gc_major_end
+%% com_ericsson_dyntrace:gc_major_start
+%% com_ericsson_dyntrace:gc_minor_end
+%% com_ericsson_dyntrace:gc_minor_start
+%% com_ericsson_dyntrace:message_receive
+%% com_ericsson_dyntrace:message_send
+%% -com_ericsson_dyntrace:message_queued
+%% com_ericsson_dyntrace:function_exception
+%% com_ericsson_dyntrace:function_return
+%% com_ericsson_dyntrace:function_call
+%% com_ericsson_dyntrace:port_link
+%% com_ericsson_dyntrace:port_exit
+%% com_ericsson_dyntrace:port_open
+%% com_ericsson_dyntrace:port_scheduled
+%% com_ericsson_dyntrace:process_scheduled
+%% com_ericsson_dyntrace:process_register
+%% com_ericsson_dyntrace:process_exit
+%% com_ericsson_dyntrace:process_link
+%% com_ericsson_dyntrace:process_spawn
+%%
+%% Testcases
+%%
+
+t_lttng_list(_Config) ->
+ {ok, _} = cmd("lttng list -u"),
+ ok.
+
+t_procs(Config) when is_list(Config) ->
+ ok = lttng_start_event("com_ericsson_dyntrace:process_*", Config),
+ _ = erlang:trace(new, true, [{tracer, dyntrace, []},procs]),
+
+ Pid = spawn_link(fun() -> waiter() end),
+ Pid ! {self(), ok},
+ ok = receive {Pid,ok} -> ok end,
+ timer:sleep(1000),
+
+ _ = erlang:trace(all, false, [procs]),
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_dyntrace:process_spawn", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:process_link", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:process_exit", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:process_register", Res),
+ ok.
+
+t_ports(Config) when is_list(Config) ->
+ ok = lttng_start_event("com_ericsson_dyntrace:port_*", Config),
+ _ = erlang:trace(new, true, [{tracer, dyntrace, []},ports]),
+
+ _ = os:cmd("ls"),
+
+ _ = erlang:trace(all, false, [{tracer, dyntrace, []},ports]),
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_dyntrace:port_open", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:port_link", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:port_exit", Res),
+ ok.
+
+t_running_process(Config) when is_list(Config) ->
+ ok = lttng_start_event("com_ericsson_dyntrace:process_scheduled", Config),
+ _ = erlang:trace(new, true, [{tracer, dyntrace, []},running]),
+
+ Pid = spawn_link(fun() -> waiter() end),
+ Pid ! {self(), ok},
+ ok = receive {Pid,ok} -> ok end,
+ timer:sleep(1000),
+
+ _ = erlang:trace(all, false, [running]),
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_dyntrace:process_scheduled", Res),
+ ok.
+
+t_running_port(Config) when is_list(Config) ->
+ ok = lttng_start_event("com_ericsson_dyntrace:port_scheduled", Config),
+ _ = erlang:trace(new, true, [{tracer, dyntrace, []},running_ports]),
+
+ _ = os:cmd("ls"),
+ _ = os:cmd("ls"),
+
+ _ = erlang:trace(all, false, [running_ports]),
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_dyntrace:port_scheduled", Res),
+ ok.
+
+
+t_call(Config) when is_list(Config) ->
+ ok = lttng_start_event("com_ericsson_dyntrace:function_*", Config),
+ _ = erlang:trace(new, true, [{tracer, dyntrace, []}, call]),
+ _ = erlang:trace_pattern({?MODULE, '_', '_'}, [{'_',[],[{exception_trace}]}], [local]),
+
+ DontLink = spawn(fun() -> foo_clause_exception(nope) end),
+ Pid = spawn_link(fun() -> waiter() end),
+ Pid ! {self(), ok},
+ ok = receive {Pid,ok} -> ok end,
+
+ timer:sleep(10),
+ undefined = erlang:process_info(DontLink),
+
+ _ = erlang:trace_pattern({?MODULE, '_', '_'}, false, [local]),
+ _ = erlang:trace(all, false, [call]),
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_dyntrace:function_call", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:function_return", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:function_exception", Res),
+ ok.
+
+t_send(Config) when is_list(Config) ->
+ ok = lttng_start_event("com_ericsson_dyntrace:message_send", Config),
+ _ = erlang:trace(new, true, [{tracer, dyntrace, []},send]),
+
+ Pid = spawn_link(fun() -> waiter() end),
+ Pid ! {self(), ok},
+ ok = receive {Pid,ok} -> ok end,
+ _ = os:cmd("ls"),
+ timer:sleep(10),
+
+ _ = erlang:trace(all, false, [send]),
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_dyntrace:message_send", Res),
+ ok.
+
+t_call_return_to(Config) when is_list(Config) ->
+ ok = lttng_start_event("com_ericsson_dyntrace:function_*", Config),
+ _ = erlang:trace(new, true, [{tracer, dyntrace, []}, call, return_to]),
+ _ = erlang:trace_pattern({lists, '_', '_'}, true, [local]),
+ _ = erlang:trace_pattern({?MODULE, '_', '_'}, true, [local]),
+
+ Pid = spawn_link(fun() -> gcfier(10) end),
+ Pid ! {self(), ok},
+ ok = receive {Pid,ok} -> ok end,
+ timer:sleep(10),
+
+ _ = erlang:trace_pattern({?MODULE, '_', '_'}, false, [local]),
+ _ = erlang:trace_pattern({lists, '_', '_'}, false, [local]),
+ _ = erlang:trace(all, false, [call,return_to]),
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_dyntrace:function_call", Res),
+ ok.
+
+t_call_silent(Config) when is_list(Config) ->
+ ok = lttng_start_event("com_ericsson_dyntrace:function_*", Config),
+ _ = erlang:trace(new, true, [{tracer, dyntrace, []}, call, silent]),
+ _ = erlang:trace_pattern({?MODULE, '_', '_'}, [{'_',[],[{exception_trace}]}], [local]),
+
+ DontLink = spawn(fun() -> foo_clause_exception(nope) end),
+ Pid = spawn_link(fun() -> waiter() end),
+ Pid ! {self(), ok},
+ ok = receive {Pid,ok} -> ok end,
+
+ timer:sleep(10),
+ undefined = erlang:process_info(DontLink),
+
+ _ = erlang:trace_pattern({?MODULE, '_', '_'}, false, [local]),
+ _ = erlang:trace(all, false, [call]),
+ Res = lttng_stop_and_view(Config),
+ notfound = check_tracepoint("com_ericsson_dyntrace:function_call", Res),
+ notfound = check_tracepoint("com_ericsson_dyntrace:function_return", Res),
+ notfound = check_tracepoint("com_ericsson_dyntrace:function_exception", Res),
+ ok.
+
+
+t_receive(Config) when is_list(Config) ->
+ ok = lttng_start_event("com_ericsson_dyntrace:message_receive", Config),
+ _ = erlang:trace(new, true, [{tracer, dyntrace, []},'receive']),
+
+ Pid = spawn_link(fun() -> waiter() end),
+ Pid ! {self(), ok},
+ ok = receive {Pid,ok} -> ok end,
+ timer:sleep(10),
+ _ = erlang:trace(all, false, ['receive']),
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_dyntrace:message_receive", Res),
+ ok.
+
+t_garbage_collection(Config) when is_list(Config) ->
+ ok = lttng_start_event("com_ericsson_dyntrace:gc_*", Config),
+ _ = erlang:trace(new, true, [{tracer, dyntrace, []},garbage_collection]),
+
+ Pid = spawn_link(fun() -> gcfier() end),
+ Pid ! {self(), ok},
+ ok = receive {Pid,ok} -> ok end,
+ timer:sleep(10),
+ _ = erlang:trace(all, false, [garbage_collection]),
+ Res = lttng_stop_and_view(Config),
+ ok = check_tracepoint("com_ericsson_dyntrace:gc_major_start", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:gc_major_end", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:gc_minor_start", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:gc_minor_end", Res),
+ ok.
+
+t_all(Config) when is_list(Config) ->
+ ok = lttng_start_event("com_ericsson_dyntrace:*", Config),
+ _ = erlang:trace(new, true, [{tracer, dyntrace, []},all]),
+
+ Pid1 = spawn_link(fun() -> waiter() end),
+ Pid1 ! {self(), ok},
+ ok = receive {Pid1,ok} -> ok end,
+
+ Pid2 = spawn_link(fun() -> gcfier() end),
+ Pid2 ! {self(), ok},
+ ok = receive {Pid2,ok} -> ok end,
+ _ = os:cmd("ls"),
+ _ = os:cmd("ls"),
+ timer:sleep(10),
+
+ _ = erlang:trace(all, false, [all]),
+ Res = lttng_stop_and_view(Config),
+
+ ok = check_tracepoint("com_ericsson_dyntrace:process_spawn", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:process_link", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:process_exit", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:process_register", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:port_open", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:port_link", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:port_exit", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:process_scheduled", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:port_scheduled", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:message_send", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:message_receive", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:gc_major_start", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:gc_major_end", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:gc_minor_start", Res),
+ ok = check_tracepoint("com_ericsson_dyntrace:gc_minor_end", Res),
+ ok.
+
+
+%% aux
+
+gcfier() ->
+ gcfier(10000).
+gcfier(N) ->
+ receive
+ {Pid, ok} ->
+ _ = lists:reverse(lists:seq(1,N)),
+ true = erlang:garbage_collect(),
+ Pid ! {self(), ok}
+ end.
+
+
+waiter() ->
+ true = register(?MODULE, self()),
+ receive
+ {Pid, ok} ->
+ Child = spawn(fun() -> receive ok -> ok end end),
+ link(Child),
+ unlink(Child),
+ _ = lists:seq(1,1000),
+ Child ! ok,
+ true = unregister(?MODULE),
+ Pid ! {self(),ok}
+ end.
+
+foo_clause_exception({1,2}) -> badness.
+
+%% lttng
+lttng_stop_and_view(Config) ->
+ Path = proplists:get_value(priv_dir, Config),
+ Name = proplists:get_value(session, Config),
+ {ok,_} = cmd("lttng stop " ++ Name),
+ {ok,Res} = cmd("lttng view " ++ Name ++ " --trace-path=" ++ Path),
+ Res.
+
+check_tracepoint(TP, Data) ->
+ case re:run(Data, TP, [global]) of
+ {match, _} -> ok;
+ _ -> notfound
+ end.
+
+lttng_start_event(Event, Config) ->
+ Name = proplists:get_value(session, Config),
+ {ok, _} = cmd("lttng enable-event -u " ++ Event ++ " --session=" ++ Name),
+ {ok, _} = cmd("lttng start " ++ Name),
+ ok.
+
+ensure_lttng_started(Name, Config) ->
+ Out = case proplists:get_value(priv_dir, Config) of
+ undefined -> [];
+ Path -> "--output="++Path++" "
+ end,
+ {ok,_} = cmd("lttng create " ++ Out ++ Name),
+ ok.
+
+ensure_lttng_stopped(Name) ->
+ {ok,_} = cmd("lttng stop"),
+ {ok,_} = cmd("lttng destroy " ++ Name),
+ ok.
+
+cmd(Cmd) ->
+ io:format("<< ~ts~n", [Cmd]),
+ Res = os:cmd(Cmd),
+ io:format(">> ~ts~n", [Res]),
+ {ok,Res}.
diff --git a/lib/runtime_tools/test/erts_alloc_config_SUITE.erl b/lib/runtime_tools/test/erts_alloc_config_SUITE.erl
index a5c4801af9..6ae51d9a26 100644
--- a/lib/runtime_tools/test/erts_alloc_config_SUITE.erl
+++ b/lib/runtime_tools/test/erts_alloc_config_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -25,9 +25,7 @@
-include_lib("common_test/include/ct.hrl").
%-compile(export_all).
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- init_per_testcase/2, end_per_testcase/2]).
+-export([all/0, suite/0, init_per_testcase/2, end_per_testcase/2]).
%% Testcases
-export([basic/1]).
@@ -35,83 +33,63 @@
%% internal export
-export([make_basic_config/1]).
--define(DEFAULT_TIMEOUT, ?t:minutes(2)).
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {minutes, 2}}].
all() ->
[basic].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
init_per_testcase(Case, Config) when is_list(Config) ->
[{testcase, Case},
- {watchdog, ?t:timetrap(?DEFAULT_TIMEOUT)},
{erl_flags_env, save_env()} | Config].
end_per_testcase(_Case, Config) when is_list(Config) ->
- ?t:timetrap_cancel(?config(watchdog, Config)),
- restore_env(?config(erl_flags_env, Config)),
+ restore_env(proplists:get_value(erl_flags_env, Config)),
ok.
%%%
%%% The test cases ------------------------------------------------------------
%%%
-basic(doc) -> [];
-basic(suite) -> [];
basic(Config) when is_list(Config) ->
- ?line ErtsAllocConfig = privfile("generated", Config),
+ ErtsAllocConfig = privfile("generated", Config),
SbctMod = " +MBsbct 1024 +MHsbct 4096",
%% Make sure we have enabled allocators
ZFlgs = os:getenv("ERL_ZFLAGS", "") ++ " +Mea max +Mea config",
- ?line os:putenv("ERL_ZFLAGS", ZFlgs ++ SbctMod),
+ os:putenv("ERL_ZFLAGS", ZFlgs ++ SbctMod),
- ?line {ok, Node1} = start_node(Config),
- ?line ok = rpc:call(Node1, ?MODULE, make_basic_config, [ErtsAllocConfig]),
- ?line stop_node(Node1),
+ {ok, Node1} = start_node(Config),
+ ok = rpc:call(Node1, ?MODULE, make_basic_config, [ErtsAllocConfig]),
+ stop_node(Node1),
- ?line display_file(ErtsAllocConfig),
+ display_file(ErtsAllocConfig),
- ?line ManualConfig = privfile("manual", Config),
- ?line {ok, IOD} = file:open(ManualConfig, [write]),
- ?line io:format(IOD, "~s", ["+MBsbct 2048"]),
- ?line file:close(IOD),
- ?line display_file(ManualConfig),
+ ManualConfig = privfile("manual", Config),
+ {ok, IOD} = file:open(ManualConfig, [write]),
+ io:format(IOD, "~s", ["+MBsbct 2048"]),
+ file:close(IOD),
+ display_file(ManualConfig),
- ?line os:putenv("ERL_ZFLAGS", ZFlgs),
+ os:putenv("ERL_ZFLAGS", ZFlgs),
- ?line {ok, Node2} = start_node(Config,
- "-args_file " ++ ErtsAllocConfig
- ++ " -args_file " ++ ManualConfig),
+ {ok, Node2} = start_node(Config,
+ "-args_file " ++ ErtsAllocConfig
+ ++ " -args_file " ++ ManualConfig),
- ?line {_, _, _, Cfg} = rpc:call(Node2, erlang, system_info, [allocator]),
+ {_, _, _, Cfg} = rpc:call(Node2, erlang, system_info, [allocator]),
- ?line stop_node(Node2),
+ stop_node(Node2),
- ?line {value,{binary_alloc, BCfg}} = lists:keysearch(binary_alloc, 1, Cfg),
- ?line {value,{sbct, 2097152}} = lists:keysearch(sbct, 1, BCfg),
- ?line {value,{eheap_alloc, HCfg}} = lists:keysearch(eheap_alloc, 1, Cfg),
- ?line {value,{sbct, 4194304}} = lists:keysearch(sbct, 1, HCfg),
+ {value,{binary_alloc, BCfg}} = lists:keysearch(binary_alloc, 1, Cfg),
+ {value,{sbct, 2097152}} = lists:keysearch(sbct, 1, BCfg),
+ {value,{eheap_alloc, HCfg}} = lists:keysearch(eheap_alloc, 1, Cfg),
+ {value,{sbct, 4194304}} = lists:keysearch(sbct, 1, HCfg),
- ?line ok.
+ ok.
make_basic_config(ErtsAllocConfig) ->
%% Save some different scenarios
@@ -119,35 +97,35 @@ make_basic_config(ErtsAllocConfig) ->
SSBegun = make_ref(),
SSDone = make_ref(),
SSFun = fun (F) ->
- receive
- SSDone ->
- ok = erts_alloc_config:save_scenario(),
- Tester ! SSDone
- after 500 ->
- ok = erts_alloc_config:save_scenario(),
- F(F)
- end
- end,
+ receive
+ SSDone ->
+ ok = erts_alloc_config:save_scenario(),
+ Tester ! SSDone
+ after 500 ->
+ ok = erts_alloc_config:save_scenario(),
+ F(F)
+ end
+ end,
SS = spawn_link(fun () ->
- ok = erts_alloc_config:save_scenario(),
- Tester ! SSBegun,
- SSFun(SSFun)
- end),
+ ok = erts_alloc_config:save_scenario(),
+ Tester ! SSBegun,
+ SSFun(SSFun)
+ end),
receive SSBegun -> ok end,
Ref = make_ref(),
Tab = ets:new(?MODULE, [bag, public]),
Ps = lists:map(
- fun (_) ->
- spawn_link(
- fun () ->
- ets:insert(Tab,
- {self(),
- lists:seq(1, 1000)}),
- receive after 1000 -> ok end,
- Tester ! {Ref, self()}
- end)
- end,
- lists:seq(1, 10000)),
+ fun (_) ->
+ spawn_link(
+ fun () ->
+ ets:insert(Tab,
+ {self(),
+ lists:seq(1, 1000)}),
+ receive after 1000 -> ok end,
+ Tester ! {Ref, self()}
+ end)
+ end,
+ lists:seq(1, 10000)),
lists:foreach(fun (P) -> receive {Ref, P} -> ok end end, Ps),
ets:delete(Tab),
SS ! SSDone,
@@ -162,35 +140,35 @@ make_basic_config(ErtsAllocConfig) ->
%%
display_file(FileName) ->
- ?t:format("filename: ~s~n", [FileName]),
+ io:format("filename: ~s~n", [FileName]),
{ok, Bin} = file:read_file(FileName),
io:format("~s", [binary_to_list(Bin)]),
- ?t:format("eof: ~s~n", [FileName]),
+ io:format("eof: ~s~n", [FileName]),
ok.
mk_name(Config) when is_list(Config) ->
{A, B, C} = now(),
list_to_atom(atom_to_list(?MODULE)
- ++ "-" ++ atom_to_list(?config(testcase, Config))
- ++ "-" ++ integer_to_list(A)
- ++ "-" ++ integer_to_list(B)
- ++ "-" ++ integer_to_list(C)).
+ ++ "-" ++ atom_to_list(proplists:get_value(testcase, Config))
+ ++ "-" ++ integer_to_list(A)
+ ++ "-" ++ integer_to_list(B)
+ ++ "-" ++ integer_to_list(C)).
start_node(Config) ->
start_node(Config, "").
start_node(Config, Args) ->
- ?line Pa = filename:dirname(code:which(?MODULE)),
- ?line ?t:start_node(mk_name(Config),
- slave,
- [{args, "-pa " ++ Pa ++ " " ++ Args}]).
+ Pa = filename:dirname(code:which(?MODULE)),
+ test_server:start_node(mk_name(Config),
+ slave,
+ [{args, "-pa " ++ Pa ++ " " ++ Args}]).
stop_node(Node) ->
- ?line true = ?t:stop_node(Node).
+ true = test_server:stop_node(Node).
privfile(Name, Config) ->
- filename:join([?config(priv_dir, Config),
- atom_to_list(?config(testcase, Config)) ++ "." ++ Name]).
+ filename:join([proplists:get_value(priv_dir, Config),
+ atom_to_list(proplists:get_value(testcase, Config)) ++ "." ++ Name]).
save_env() ->
{erl_flags,
@@ -203,15 +181,15 @@ restore_env(EVar, false) when is_list(EVar) ->
restore_env(EVar, "");
restore_env(EVar, "") when is_list(EVar) ->
case os:getenv(EVar) of
- false -> ok;
- "" -> ok;
- " " -> ok;
- _ -> os:putenv(EVar, " ")
+ false -> ok;
+ "" -> ok;
+ " " -> ok;
+ _ -> os:putenv(EVar, " ")
end;
restore_env(EVar, Value) when is_list(EVar), is_list(Value) ->
case os:getenv(EVar) of
- Value -> ok;
- _ -> os:putenv(EVar, Value)
+ Value -> ok;
+ _ -> os:putenv(EVar, Value)
end.
restore_env({erl_flags, AFlgs, Flgs, RFlgs, ZFlgs}) ->
diff --git a/lib/runtime_tools/test/runtime_tools_SUITE.erl b/lib/runtime_tools/test/runtime_tools_SUITE.erl
index 2a79f0a8f9..6877e1a379 100644
--- a/lib/runtime_tools/test/runtime_tools_SUITE.erl
+++ b/lib/runtime_tools/test/runtime_tools_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -21,54 +21,27 @@
-include_lib("common_test/include/ct.hrl").
%% Test server specific exports
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2]).
--export([init_per_testcase/2, end_per_testcase/2]).
+-export([all/0, suite/0]).
%% Test cases
-export([app_file/1, appup_file/1, start_stop_app/1]).
-%% Default timetrap timeout (set in init_per_testcase)
--define(default_timeout, ?t:minutes(1)).
-
-init_per_testcase(_Case, Config) ->
- Dog = test_server:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
-
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
- ok.
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {minutes, 1}}].
all() ->
[app_file,
appup_file,
start_stop_app].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
app_file(_Config) ->
- ?line ok = ?t:app_test(runtime_tools),
+ ok = test_server:app_test(runtime_tools),
ok.
appup_file(_Config) ->
- ok = ?t:appup_test(runtime_tools).
+ ok = test_server:appup_test(runtime_tools).
start_stop_app(_Config) ->
ok = application:start(runtime_tools),
diff --git a/lib/runtime_tools/test/system_information_SUITE.erl b/lib/runtime_tools/test/system_information_SUITE.erl
index 5e2e0d17ac..a5a025a1cf 100644
--- a/lib/runtime_tools/test/system_information_SUITE.erl
+++ b/lib/runtime_tools/test/system_information_SUITE.erl
@@ -230,19 +230,19 @@ api_report(_Config) ->
ok.
api_to_file(Config) ->
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
Filename = filename:join([DataDir, "system_information_report_1.dat"]),
ok = system_information:to_file(Filename),
{ok, _} = file:consult(Filename),
{save_config, [{report_name, Filename}]}.
api_from_file(Config) ->
- {api_to_file, Saved} = ?config(saved_config, Config),
- DataDir = ?config(data_dir, Config),
+ {api_to_file, Saved} = proplists:get_value(saved_config, Config),
+ DataDir = proplists:get_value(data_dir, Config),
Fname1 = filename:join([DataDir, "information_test_report.dat"]),
Report1 = system_information:from_file(Fname1),
ok = validate_report(Report1),
- Fname2 = ?config(report_name, Saved),
+ Fname2 = proplists:get_value(report_name, Saved),
Report2 = system_information:from_file(Fname2),
ok = validate_report(Report2),
ok.
@@ -253,7 +253,7 @@ api_start_stop(_Config) ->
ok.
validate_server_interface(Config) ->
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
Fname1 = filename:join([DataDir, "information_test_report.dat"]),
%% load old report
ok = system_information:load_report(file, Fname1),
diff --git a/lib/sasl/Makefile b/lib/sasl/Makefile
index 9085c487d4..065eb45fbb 100644
--- a/lib/sasl/Makefile
+++ b/lib/sasl/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2010. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/sasl/doc/src/alarm_handler.xml b/lib/sasl/doc/src/alarm_handler.xml
index 68076ba28d..8550a88b28 100644
--- a/lib/sasl/doc/src/alarm_handler.xml
+++ b/lib/sasl/doc/src/alarm_handler.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1996</year>
- <year>2014</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/sasl/doc/src/appup.xml b/lib/sasl/doc/src/appup.xml
index b54d2adb19..6fbdcb9f5b 100644
--- a/lib/sasl/doc/src/appup.xml
+++ b/lib/sasl/doc/src/appup.xml
@@ -4,7 +4,7 @@
<fileref>
<header>
<copyright>
- <year>1997</year><year>2014</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -137,7 +137,8 @@
code change. If it is set to <c>{advanced,Extra}</c>, implemented
processes using
<seealso marker="stdlib:gen_server"><c>gen_server</c></seealso>,
- <seealso marker="stdlib:gen_fsm"><c>gen_fsm</c></seealso>, or
+ <seealso marker="stdlib:gen_fsm"><c>gen_fsm</c></seealso>,
+ <seealso marker="stdlib:gen_statem"><c>gen_statem</c></seealso>, or
<seealso marker="stdlib:gen_event"><c>gen_event</c></seealso>
transform their internal state by calling the callback function
<c>code_change</c>. Special processes call the callback
diff --git a/lib/sasl/doc/src/book.xml b/lib/sasl/doc/src/book.xml
index 624c32a66f..bca61ee8e7 100644
--- a/lib/sasl/doc/src/book.xml
+++ b/lib/sasl/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/sasl/doc/src/error_logging.xml b/lib/sasl/doc/src/error_logging.xml
index 46b12f3872..8464a41ff9 100644
--- a/lib/sasl/doc/src/error_logging.xml
+++ b/lib/sasl/doc/src/error_logging.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -90,8 +90,9 @@
a process terminates with an unexpected reason, which is any reason
other than <c>normal</c>, <c>shutdown</c>, or <c>{shutdown,Term}</c>.
Processes using behaviors
- <seealso marker="stdlib:gen_server"><c>gen_server</c></seealso> or
- <seealso marker="stdlib:gen_fsm"><c>gen_fsm</c></seealso>
+ <seealso marker="stdlib:gen_server"><c>gen_server</c></seealso>,
+ <seealso marker="stdlib:gen_fsm"><c>gen_fsm</c></seealso> or
+ <seealso marker="stdlib:gen_statem"><c>gen_statem</c></seealso>
are examples of such processes. A crash report contains the following items:</p>
<taglist>
<tag><c>Crasher</c></tag>
diff --git a/lib/sasl/doc/src/notes.xml b/lib/sasl/doc/src/notes.xml
index da5bc6be96..f07938220c 100644
--- a/lib/sasl/doc/src/notes.xml
+++ b/lib/sasl/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/sasl/doc/src/notes_history.xml b/lib/sasl/doc/src/notes_history.xml
index 006a40f3ac..d37c412d85 100644
--- a/lib/sasl/doc/src/notes_history.xml
+++ b/lib/sasl/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/sasl/doc/src/part.xml b/lib/sasl/doc/src/part.xml
index 2f47a8ad80..f531ed2dea 100644
--- a/lib/sasl/doc/src/part.xml
+++ b/lib/sasl/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/sasl/doc/src/part_notes.xml b/lib/sasl/doc/src/part_notes.xml
index 57f20ece0e..8a32deefd9 100644
--- a/lib/sasl/doc/src/part_notes.xml
+++ b/lib/sasl/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/sasl/doc/src/part_notes_history.xml b/lib/sasl/doc/src/part_notes_history.xml
index b2d278e9c4..abdf09d845 100644
--- a/lib/sasl/doc/src/part_notes_history.xml
+++ b/lib/sasl/doc/src/part_notes_history.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2006</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/sasl/doc/src/rb.xml b/lib/sasl/doc/src/rb.xml
index e16e9f5a62..1ce19046eb 100644
--- a/lib/sasl/doc/src/rb.xml
+++ b/lib/sasl/doc/src/rb.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/sasl/doc/src/ref_man.xml b/lib/sasl/doc/src/ref_man.xml
index 74cd92a9b0..42045df5ec 100644
--- a/lib/sasl/doc/src/ref_man.xml
+++ b/lib/sasl/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/sasl/doc/src/rel.xml b/lib/sasl/doc/src/rel.xml
index d5f3c7310a..d6558c06b4 100644
--- a/lib/sasl/doc/src/rel.xml
+++ b/lib/sasl/doc/src/rel.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/sasl/doc/src/release_handler.xml b/lib/sasl/doc/src/release_handler.xml
index 162707676c..bcbc5f5339 100644
--- a/lib/sasl/doc/src/release_handler.xml
+++ b/lib/sasl/doc/src/release_handler.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/sasl/doc/src/relup.xml b/lib/sasl/doc/src/relup.xml
index 58918fc8e8..4c5535002c 100644
--- a/lib/sasl/doc/src/relup.xml
+++ b/lib/sasl/doc/src/relup.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/sasl/doc/src/sasl_app.xml b/lib/sasl/doc/src/sasl_app.xml
index 044c016302..52f449c2a8 100644
--- a/lib/sasl/doc/src/sasl_app.xml
+++ b/lib/sasl/doc/src/sasl_app.xml
@@ -4,7 +4,7 @@
<appref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/sasl/doc/src/sasl_intro.xml b/lib/sasl/doc/src/sasl_intro.xml
index 237580977c..b71dafb192 100644
--- a/lib/sasl/doc/src/sasl_intro.xml
+++ b/lib/sasl/doc/src/sasl_intro.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/sasl/doc/src/script.xml b/lib/sasl/doc/src/script.xml
index db3ea0f487..8ed132354d 100644
--- a/lib/sasl/doc/src/script.xml
+++ b/lib/sasl/doc/src/script.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/sasl/doc/src/systools.xml b/lib/sasl/doc/src/systools.xml
index 1a5119a5cf..7446762de4 100644
--- a/lib/sasl/doc/src/systools.xml
+++ b/lib/sasl/doc/src/systools.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1996</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/sasl/examples/src/Makefile b/lib/sasl/examples/src/Makefile
index 82083d1197..e8b903f252 100644
--- a/lib/sasl/examples/src/Makefile
+++ b/lib/sasl/examples/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2012. All Rights Reserved.
+# Copyright Ericsson AB 2010-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/sasl/examples/src/target_system.erl b/lib/sasl/examples/src/target_system.erl
index d18fdb17f7..b3d6748306 100644
--- a/lib/sasl/examples/src/target_system.erl
+++ b/lib/sasl/examples/src/target_system.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/Makefile b/lib/sasl/src/Makefile
index 92d4818f2e..ac7ee51100 100644
--- a/lib/sasl/src/Makefile
+++ b/lib/sasl/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2013. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/alarm_handler.erl b/lib/sasl/src/alarm_handler.erl
index e428ba80fa..77863f0f8f 100644
--- a/lib/sasl/src/alarm_handler.erl
+++ b/lib/sasl/src/alarm_handler.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/erlsrv.erl b/lib/sasl/src/erlsrv.erl
index bec824ad78..29d40d362f 100644
--- a/lib/sasl/src/erlsrv.erl
+++ b/lib/sasl/src/erlsrv.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/format_lib_supp.erl b/lib/sasl/src/format_lib_supp.erl
index e2f70c7f00..0b474a0232 100644
--- a/lib/sasl/src/format_lib_supp.erl
+++ b/lib/sasl/src/format_lib_supp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/misc_supp.erl b/lib/sasl/src/misc_supp.erl
index 39656f6e65..093b337a2c 100644
--- a/lib/sasl/src/misc_supp.erl
+++ b/lib/sasl/src/misc_supp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/rb.erl b/lib/sasl/src/rb.erl
index f63c02e748..79df150b41 100644
--- a/lib/sasl/src/rb.erl
+++ b/lib/sasl/src/rb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/rb_format_supp.erl b/lib/sasl/src/rb_format_supp.erl
index ed10022f9d..0004d85af4 100644
--- a/lib/sasl/src/rb_format_supp.erl
+++ b/lib/sasl/src/rb_format_supp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/release_handler.erl b/lib/sasl/src/release_handler.erl
index 7e20d0b321..1fcc9a0288 100644
--- a/lib/sasl/src/release_handler.erl
+++ b/lib/sasl/src/release_handler.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/release_handler_1.erl b/lib/sasl/src/release_handler_1.erl
index a6325270a5..ca97515299 100644
--- a/lib/sasl/src/release_handler_1.erl
+++ b/lib/sasl/src/release_handler_1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/sasl.app.src b/lib/sasl/src/sasl.app.src
index 16e8e44ba2..9c912fb8c3 100644
--- a/lib/sasl/src/sasl.app.src
+++ b/lib/sasl/src/sasl.app.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/sasl.appup.src b/lib/sasl/src/sasl.appup.src
index ca5122dab4..ecd320c1ea 100644
--- a/lib/sasl/src/sasl.appup.src
+++ b/lib/sasl/src/sasl.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/sasl.erl b/lib/sasl/src/sasl.erl
index 0fb85682c6..24afaee183 100644
--- a/lib/sasl/src/sasl.erl
+++ b/lib/sasl/src/sasl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/sasl_report.erl b/lib/sasl/src/sasl_report.erl
index 0b8c4212d2..14702b0ad2 100644
--- a/lib/sasl/src/sasl_report.erl
+++ b/lib/sasl/src/sasl_report.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/sasl_report_file_h.erl b/lib/sasl/src/sasl_report_file_h.erl
index 6c38b320c1..21746839fa 100644
--- a/lib/sasl/src/sasl_report_file_h.erl
+++ b/lib/sasl/src/sasl_report_file_h.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/sasl_report_tty_h.erl b/lib/sasl/src/sasl_report_tty_h.erl
index 54e8addc45..3997e0aa97 100644
--- a/lib/sasl/src/sasl_report_tty_h.erl
+++ b/lib/sasl/src/sasl_report_tty_h.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/si.erl b/lib/sasl/src/si.erl
index e4bd8f5fd8..275c6d508b 100644
--- a/lib/sasl/src/si.erl
+++ b/lib/sasl/src/si.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/si_sasl_supp.erl b/lib/sasl/src/si_sasl_supp.erl
index 0dcdcdd912..cce628f8c4 100644
--- a/lib/sasl/src/si_sasl_supp.erl
+++ b/lib/sasl/src/si_sasl_supp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/systools.erl b/lib/sasl/src/systools.erl
index 98255e0b12..dd1a58c3c1 100644
--- a/lib/sasl/src/systools.erl
+++ b/lib/sasl/src/systools.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/systools.hrl b/lib/sasl/src/systools.hrl
index 0bf822ed07..6b2a597427 100644
--- a/lib/sasl/src/systools.hrl
+++ b/lib/sasl/src/systools.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/systools_lib.erl b/lib/sasl/src/systools_lib.erl
index 1538e1e90f..dd97aeff08 100644
--- a/lib/sasl/src/systools_lib.erl
+++ b/lib/sasl/src/systools_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/systools_make.erl b/lib/sasl/src/systools_make.erl
index d207dc15bb..352e4984df 100644
--- a/lib/sasl/src/systools_make.erl
+++ b/lib/sasl/src/systools_make.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1453,23 +1453,44 @@ behave([H|T]) ->
behave([]) ->
[].
-%%______________________________________________________________________
-%% mandatory modules; this modules must be loaded before processes
-%% can be started. These are a collection of modules from the kernel
-%% and stdlib applications.
-%% Nowadays, error_handler dynamically loads almost every module.
-%% The error_handler self must still be there though.
-
mandatory_modules() ->
- %% Sorted
- [error_handler].
+ [error_handler, %Truly mandatory.
+
+ %% Modules that are almost always needed. Listing them here
+ %% helps the init module to load them faster. Modules not
+ %% listed here will be loaded by the error_handler module.
+ %%
+ %% Keep this list sorted.
+ application,
+ application_controller,
+ application_master,
+ code,
+ code_server,
+ erl_eval,
+ erl_lint,
+ erl_parse,
+ error_logger,
+ ets,
+ file,
+ filename,
+ file_server,
+ file_io_server,
+ gen,
+ gen_event,
+ gen_server,
+ heart,
+ kernel,
+ lists,
+ proc_lib,
+ supervisor
+ ].
%%______________________________________________________________________
%% This is the modules that are preloaded into the Erlang system.
preloaded() ->
%% Sorted
- [erl_prim_loader,erlang,
+ [erl_prim_loader,erl_tracer,erlang,
erts_code_purger,
erts_internal,init,otp_ring0,prim_eval,prim_file,
prim_inet,prim_zip,zlib].
diff --git a/lib/sasl/src/systools_rc.erl b/lib/sasl/src/systools_rc.erl
index 285c805b5d..7722cef57b 100644
--- a/lib/sasl/src/systools_rc.erl
+++ b/lib/sasl/src/systools_rc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/src/systools_relup.erl b/lib/sasl/src/systools_relup.erl
index a520da1c3f..28534dc0c8 100644
--- a/lib/sasl/src/systools_relup.erl
+++ b/lib/sasl/src/systools_relup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/test/Makefile b/lib/sasl/test/Makefile
index 2e9e107efd..2a782bcf61 100644
--- a/lib/sasl/test/Makefile
+++ b/lib/sasl/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2011-2012. All Rights Reserved.
+# Copyright Ericsson AB 2011-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/sasl/test/alarm_handler_SUITE.erl b/lib/sasl/test/alarm_handler_SUITE.erl
index f2ed9ffc19..dbbdf05f12 100644
--- a/lib/sasl/test/alarm_handler_SUITE.erl
+++ b/lib/sasl/test/alarm_handler_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/test/installer.erl b/lib/sasl/test/installer.erl
index c42f26a506..e38d0cfa7b 100644
--- a/lib/sasl/test/installer.erl
+++ b/lib/sasl/test/installer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/test/rb_SUITE.erl b/lib/sasl/test/rb_SUITE.erl
index 9a33df369e..426dedbab5 100644
--- a/lib/sasl/test/rb_SUITE.erl
+++ b/lib/sasl/test/rb_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/test/release_handler_SUITE.erl b/lib/sasl/test/release_handler_SUITE.erl
index ee620dcdb4..4dcaec03a7 100644
--- a/lib/sasl/test/release_handler_SUITE.erl
+++ b/lib/sasl/test/release_handler_SUITE.erl
@@ -54,7 +54,7 @@ unix_cases() ->
end,
[target_system, target_system_unicode] ++ RunErlCases ++ cases().
-win32_cases() ->
+win32_cases() ->
[{group,release} | cases()].
%% Cases that can be run on all platforms
@@ -89,11 +89,16 @@ groups() ->
%% {group,release}
%% Top group for all cases using run_erl
init_per_group(release, Config) ->
- Dog = ?t:timetrap(?default_timeout),
- P1gInstall = filename:join(priv_dir(Config),p1g_install),
- ok = create_p1g(Config,P1gInstall),
- ok = create_p1h(Config),
- ?t:timetrap_cancel(Dog);
+ case {os:type(), os:version()} of
+ {{win32, nt}, Vsn} when Vsn > {6,1,999999} ->
+ {skip, "Requires admin privileges on Win 8 and later"};
+ _ ->
+ Dog = ?t:timetrap(?default_timeout),
+ P1gInstall = filename:join(priv_dir(Config),p1g_install),
+ ok = create_p1g(Config,P1gInstall),
+ ok = create_p1h(Config),
+ ?t:timetrap_cancel(Dog)
+ end;
%% {group,release_single}
%% Subgroup of {group,release}, contains all cases that are not
diff --git a/lib/sasl/test/sasl_SUITE.erl b/lib/sasl/test/sasl_SUITE.erl
index cd8316b451..f12bde9b3d 100644
--- a/lib/sasl/test/sasl_SUITE.erl
+++ b/lib/sasl/test/sasl_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/test/sasl_report_SUITE.erl b/lib/sasl/test/sasl_report_SUITE.erl
index 7469ec4d46..aa229726ae 100644
--- a/lib/sasl/test/sasl_report_SUITE.erl
+++ b/lib/sasl/test/sasl_report_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2015. All Rights Reserved.
+%% Copyright Ericsson AB 2015-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/test/systools_SUITE.erl b/lib/sasl/test/systools_SUITE.erl
index 825a7f6e86..bf95ceb70c 100644
--- a/lib/sasl/test/systools_SUITE.erl
+++ b/lib/sasl/test/systools_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/test/systools_rc_SUITE.erl b/lib/sasl/test/systools_rc_SUITE.erl
index 2ecb6f107a..baa3a16e70 100644
--- a/lib/sasl/test/systools_rc_SUITE.erl
+++ b/lib/sasl/test/systools_rc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/sasl/test/test_lib.hrl b/lib/sasl/test/test_lib.hrl
index b16c4ac34c..2d897e9903 100644
--- a/lib/sasl/test/test_lib.hrl
+++ b/lib/sasl/test/test_lib.hrl
@@ -1,3 +1,3 @@
-define(ertsvsn,"4.4").
--define(kernelvsn,"3.0").
--define(stdlibvsn,"2.0").
+-define(kernelvsn,"4.0").
+-define(stdlibvsn,"2.5").
diff --git a/lib/sasl/vsn.mk b/lib/sasl/vsn.mk
index accb58a199..fd0fc9b8b5 100644
--- a/lib/sasl/vsn.mk
+++ b/lib/sasl/vsn.mk
@@ -1 +1 @@
-SASL_VSN = 2.7
+SASL_VSN = 3.0
diff --git a/lib/snmp/Makefile b/lib/snmp/Makefile
index ce739f3438..879f1b05c5 100644
--- a/lib/snmp/Makefile
+++ b/lib/snmp/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/doc/src/Makefile b/lib/snmp/doc/src/Makefile
index 6d5b005e3e..9ea5dba0c5 100644
--- a/lib/snmp/doc/src/Makefile
+++ b/lib/snmp/doc/src/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/doc/src/book.xml b/lib/snmp/doc/src/book.xml
index 68e87b8afe..70d426453e 100644
--- a/lib/snmp/doc/src/book.xml
+++ b/lib/snmp/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/files.mk b/lib/snmp/doc/src/files.mk
index fea8deee02..5aeae19105 100644
--- a/lib/snmp/doc/src/files.mk
+++ b/lib/snmp/doc/src/files.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2013. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml
index 4693a744f5..b9dc5e4117 100644
--- a/lib/snmp/doc/src/notes.xml
+++ b/lib/snmp/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/notes_history.xml b/lib/snmp/doc/src/notes_history.xml
index a9726b97dc..cae9630ff9 100644
--- a/lib/snmp/doc/src/notes_history.xml
+++ b/lib/snmp/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/part.xml b/lib/snmp/doc/src/part.xml
index 5ce7c52918..5ac6dc3917 100644
--- a/lib/snmp/doc/src/part.xml
+++ b/lib/snmp/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/part_notes.xml b/lib/snmp/doc/src/part_notes.xml
index 9535299d74..d149044169 100644
--- a/lib/snmp/doc/src/part_notes.xml
+++ b/lib/snmp/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/part_notes_history.xml b/lib/snmp/doc/src/part_notes_history.xml
index 1edc13e29e..aa5276dc94 100644
--- a/lib/snmp/doc/src/part_notes_history.xml
+++ b/lib/snmp/doc/src/part_notes_history.xml
@@ -4,7 +4,7 @@
<part>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/ref_man.xml b/lib/snmp/doc/src/ref_man.xml
index 1b381bc97b..b8559dda62 100644
--- a/lib/snmp/doc/src/ref_man.xml
+++ b/lib/snmp/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp.xml b/lib/snmp/doc/src/snmp.xml
index b8e8d43fc8..801193675c 100644
--- a/lib/snmp/doc/src/snmp.xml
+++ b/lib/snmp/doc/src/snmp.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_agent_config_files.xml b/lib/snmp/doc/src/snmp_agent_config_files.xml
index 1147ff81d5..e1a4c143cd 100644
--- a/lib/snmp/doc/src/snmp_agent_config_files.xml
+++ b/lib/snmp/doc/src/snmp_agent_config_files.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2014</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_agent_funct_descr.xml b/lib/snmp/doc/src/snmp_agent_funct_descr.xml
index 9d2226510e..fdcab79646 100644
--- a/lib/snmp/doc/src/snmp_agent_funct_descr.xml
+++ b/lib/snmp/doc/src/snmp_agent_funct_descr.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_agent_netif.xml b/lib/snmp/doc/src/snmp_agent_netif.xml
index 9583f1f521..a8dea5ab7b 100644
--- a/lib/snmp/doc/src/snmp_agent_netif.xml
+++ b/lib/snmp/doc/src/snmp_agent_netif.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2014</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_app.xml b/lib/snmp/doc/src/snmp_app.xml
index 39aac8e7d7..d5ac97ef15 100644
--- a/lib/snmp/doc/src/snmp_app.xml
+++ b/lib/snmp/doc/src/snmp_app.xml
@@ -4,7 +4,7 @@
<appref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_app_a.xml b/lib/snmp/doc/src/snmp_app_a.xml
index 551876ee92..c6d7ae2f53 100644
--- a/lib/snmp/doc/src/snmp_app_a.xml
+++ b/lib/snmp/doc/src/snmp_app_a.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_app_b.xml b/lib/snmp/doc/src/snmp_app_b.xml
index 263db2a791..2ef94f0fde 100644
--- a/lib/snmp/doc/src/snmp_app_b.xml
+++ b/lib/snmp/doc/src/snmp_app_b.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_audit_trail_log.xml b/lib/snmp/doc/src/snmp_audit_trail_log.xml
index c178a995f4..4fcdceb321 100644
--- a/lib/snmp/doc/src/snmp_audit_trail_log.xml
+++ b/lib/snmp/doc/src/snmp_audit_trail_log.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_community_mib.xml b/lib/snmp/doc/src/snmp_community_mib.xml
index 571ff7d197..61dea05950 100644
--- a/lib/snmp/doc/src/snmp_community_mib.xml
+++ b/lib/snmp/doc/src/snmp_community_mib.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_config.xml b/lib/snmp/doc/src/snmp_config.xml
index a085252d90..6d4129dd06 100644
--- a/lib/snmp/doc/src/snmp_config.xml
+++ b/lib/snmp/doc/src/snmp_config.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_def_instr_functions.xml b/lib/snmp/doc/src/snmp_def_instr_functions.xml
index 2317f27196..3445648de2 100644
--- a/lib/snmp/doc/src/snmp_def_instr_functions.xml
+++ b/lib/snmp/doc/src/snmp_def_instr_functions.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_framework_mib.xml b/lib/snmp/doc/src/snmp_framework_mib.xml
index 9fba76baab..64e5df6ff5 100644
--- a/lib/snmp/doc/src/snmp_framework_mib.xml
+++ b/lib/snmp/doc/src/snmp_framework_mib.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_generic.xml b/lib/snmp/doc/src/snmp_generic.xml
index 75271fb002..44762dec59 100644
--- a/lib/snmp/doc/src/snmp_generic.xml
+++ b/lib/snmp/doc/src/snmp_generic.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_impl_example_agent.xml b/lib/snmp/doc/src/snmp_impl_example_agent.xml
index 912f339e0d..a86006a0a7 100644
--- a/lib/snmp/doc/src/snmp_impl_example_agent.xml
+++ b/lib/snmp/doc/src/snmp_impl_example_agent.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_impl_example_manager.xml b/lib/snmp/doc/src/snmp_impl_example_manager.xml
index 789c6c169e..aca8d43c95 100644
--- a/lib/snmp/doc/src/snmp_impl_example_manager.xml
+++ b/lib/snmp/doc/src/snmp_impl_example_manager.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_index.xml b/lib/snmp/doc/src/snmp_index.xml
index 74792629b6..646e9661a3 100644
--- a/lib/snmp/doc/src/snmp_index.xml
+++ b/lib/snmp/doc/src/snmp_index.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_instr_functions.xml b/lib/snmp/doc/src/snmp_instr_functions.xml
index 0dc76d3603..38512b72d0 100644
--- a/lib/snmp/doc/src/snmp_instr_functions.xml
+++ b/lib/snmp/doc/src/snmp_instr_functions.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_intro.xml b/lib/snmp/doc/src/snmp_intro.xml
index 691bc162ee..ec3f2af956 100644
--- a/lib/snmp/doc/src/snmp_intro.xml
+++ b/lib/snmp/doc/src/snmp_intro.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_manager_config_files.xml b/lib/snmp/doc/src/snmp_manager_config_files.xml
index ca7bc3bfb3..c7c423f5eb 100644
--- a/lib/snmp/doc/src/snmp_manager_config_files.xml
+++ b/lib/snmp/doc/src/snmp_manager_config_files.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2014</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_manager_funct_descr.xml b/lib/snmp/doc/src/snmp_manager_funct_descr.xml
index 30df618eb6..b2da01ae32 100644
--- a/lib/snmp/doc/src/snmp_manager_funct_descr.xml
+++ b/lib/snmp/doc/src/snmp_manager_funct_descr.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_manager_netif.xml b/lib/snmp/doc/src/snmp_manager_netif.xml
index 98d4e7fd96..0dcf2a0255 100644
--- a/lib/snmp/doc/src/snmp_manager_netif.xml
+++ b/lib/snmp/doc/src/snmp_manager_netif.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2014</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_mib_compiler.xml b/lib/snmp/doc/src/snmp_mib_compiler.xml
index ad93cc86c4..285d11fce9 100644
--- a/lib/snmp/doc/src/snmp_mib_compiler.xml
+++ b/lib/snmp/doc/src/snmp_mib_compiler.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_notification_mib.xml b/lib/snmp/doc/src/snmp_notification_mib.xml
index cbb117d71a..d2e288ec15 100644
--- a/lib/snmp/doc/src/snmp_notification_mib.xml
+++ b/lib/snmp/doc/src/snmp_notification_mib.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_pdus.xml b/lib/snmp/doc/src/snmp_pdus.xml
index 82900c2f59..1d086e6f48 100644
--- a/lib/snmp/doc/src/snmp_pdus.xml
+++ b/lib/snmp/doc/src/snmp_pdus.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_standard_mib.xml b/lib/snmp/doc/src/snmp_standard_mib.xml
index bc3abf5fa8..35efbba483 100644
--- a/lib/snmp/doc/src/snmp_standard_mib.xml
+++ b/lib/snmp/doc/src/snmp_standard_mib.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_target_mib.xml b/lib/snmp/doc/src/snmp_target_mib.xml
index fa85d586b9..c3bcd3b4e3 100644
--- a/lib/snmp/doc/src/snmp_target_mib.xml
+++ b/lib/snmp/doc/src/snmp_target_mib.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1998</year><year>2014</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_user_based_sm_mib.xml b/lib/snmp/doc/src/snmp_user_based_sm_mib.xml
index ffff1b6b4f..cc376ac118 100644
--- a/lib/snmp/doc/src/snmp_user_based_sm_mib.xml
+++ b/lib/snmp/doc/src/snmp_user_based_sm_mib.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmp_view_based_acm_mib.xml b/lib/snmp/doc/src/snmp_view_based_acm_mib.xml
index bdd669b8b2..fdad735e71 100644
--- a/lib/snmp/doc/src/snmp_view_based_acm_mib.xml
+++ b/lib/snmp/doc/src/snmp_view_based_acm_mib.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpa.xml b/lib/snmp/doc/src/snmpa.xml
index c84eeec524..d756ff7a65 100644
--- a/lib/snmp/doc/src/snmpa.xml
+++ b/lib/snmp/doc/src/snmpa.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_conf.xml b/lib/snmp/doc/src/snmpa_conf.xml
index 2f9579261a..503e44a6a2 100644
--- a/lib/snmp/doc/src/snmpa_conf.xml
+++ b/lib/snmp/doc/src/snmpa_conf.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2006</year><year>2014</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_discovery_handler.xml b/lib/snmp/doc/src/snmpa_discovery_handler.xml
index ccc69112c1..0ea72a880c 100644
--- a/lib/snmp/doc/src/snmpa_discovery_handler.xml
+++ b/lib/snmp/doc/src/snmpa_discovery_handler.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_error.xml b/lib/snmp/doc/src/snmpa_error.xml
index cfebb36ed3..7cc4a3513d 100644
--- a/lib/snmp/doc/src/snmpa_error.xml
+++ b/lib/snmp/doc/src/snmpa_error.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_error_io.xml b/lib/snmp/doc/src/snmpa_error_io.xml
index 908dcc974d..bcb2688646 100644
--- a/lib/snmp/doc/src/snmpa_error_io.xml
+++ b/lib/snmp/doc/src/snmpa_error_io.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_error_logger.xml b/lib/snmp/doc/src/snmpa_error_logger.xml
index c39e07ed5f..4feb2e7f32 100644
--- a/lib/snmp/doc/src/snmpa_error_logger.xml
+++ b/lib/snmp/doc/src/snmpa_error_logger.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_error_report.xml b/lib/snmp/doc/src/snmpa_error_report.xml
index 5c91df9e57..282d9b4e59 100644
--- a/lib/snmp/doc/src/snmpa_error_report.xml
+++ b/lib/snmp/doc/src/snmpa_error_report.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_local_db.xml b/lib/snmp/doc/src/snmpa_local_db.xml
index feca939124..ac8d466ab3 100644
--- a/lib/snmp/doc/src/snmpa_local_db.xml
+++ b/lib/snmp/doc/src/snmpa_local_db.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_mib_data.xml b/lib/snmp/doc/src/snmpa_mib_data.xml
index 1ef71d5cbe..1a73c9b634 100644
--- a/lib/snmp/doc/src/snmpa_mib_data.xml
+++ b/lib/snmp/doc/src/snmpa_mib_data.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2013</year><year>2014</year>
+ <year>2013</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_mib_storage.xml b/lib/snmp/doc/src/snmpa_mib_storage.xml
index a4ce5891d2..58ce2167ec 100644
--- a/lib/snmp/doc/src/snmpa_mib_storage.xml
+++ b/lib/snmp/doc/src/snmpa_mib_storage.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2013</year><year>2014</year>
+ <year>2013</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_mpd.xml b/lib/snmp/doc/src/snmpa_mpd.xml
index 4c2f12020b..a39c087c20 100644
--- a/lib/snmp/doc/src/snmpa_mpd.xml
+++ b/lib/snmp/doc/src/snmpa_mpd.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1999</year><year>2014</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_network_interface.xml b/lib/snmp/doc/src/snmpa_network_interface.xml
index ffa006768d..d4d4989e90 100644
--- a/lib/snmp/doc/src/snmpa_network_interface.xml
+++ b/lib/snmp/doc/src/snmpa_network_interface.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_network_interface_filter.xml b/lib/snmp/doc/src/snmpa_network_interface_filter.xml
index 0c26914c91..7cd08f8935 100644
--- a/lib/snmp/doc/src/snmpa_network_interface_filter.xml
+++ b/lib/snmp/doc/src/snmpa_network_interface_filter.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2007</year><year>2014</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_notification_delivery_info_receiver.xml b/lib/snmp/doc/src/snmpa_notification_delivery_info_receiver.xml
index da0328402b..cbae158544 100644
--- a/lib/snmp/doc/src/snmpa_notification_delivery_info_receiver.xml
+++ b/lib/snmp/doc/src/snmpa_notification_delivery_info_receiver.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2008</year>
- <year>2014</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_notification_filter.xml b/lib/snmp/doc/src/snmpa_notification_filter.xml
index b2c9a0912e..0f16ba4440 100644
--- a/lib/snmp/doc/src/snmpa_notification_filter.xml
+++ b/lib/snmp/doc/src/snmpa_notification_filter.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpa_supervisor.xml b/lib/snmp/doc/src/snmpa_supervisor.xml
index d272118b04..86c6fbc350 100644
--- a/lib/snmp/doc/src/snmpa_supervisor.xml
+++ b/lib/snmp/doc/src/snmpa_supervisor.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpc.xml b/lib/snmp/doc/src/snmpc.xml
index fb526ee4dc..aba51bb500 100644
--- a/lib/snmp/doc/src/snmpc.xml
+++ b/lib/snmp/doc/src/snmpc.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpc_cmd.xml b/lib/snmp/doc/src/snmpc_cmd.xml
index 2c906a2a51..e4e710a58c 100644
--- a/lib/snmp/doc/src/snmpc_cmd.xml
+++ b/lib/snmp/doc/src/snmpc_cmd.xml
@@ -4,7 +4,7 @@
<comref>
<header>
<copyright>
- <year>2011</year><year>2013</year>
+ <year>2011</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpm.xml b/lib/snmp/doc/src/snmpm.xml
index ab288fd020..4818aeb697 100644
--- a/lib/snmp/doc/src/snmpm.xml
+++ b/lib/snmp/doc/src/snmpm.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2014</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpm_conf.xml b/lib/snmp/doc/src/snmpm_conf.xml
index 815ad2e87a..a3097e5f7e 100644
--- a/lib/snmp/doc/src/snmpm_conf.xml
+++ b/lib/snmp/doc/src/snmpm_conf.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2006</year><year>2014</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpm_mpd.xml b/lib/snmp/doc/src/snmpm_mpd.xml
index 4efaafd578..08276e4b30 100644
--- a/lib/snmp/doc/src/snmpm_mpd.xml
+++ b/lib/snmp/doc/src/snmpm_mpd.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2014</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpm_network_interface.xml b/lib/snmp/doc/src/snmpm_network_interface.xml
index 6b4598ed88..73892aa2e8 100644
--- a/lib/snmp/doc/src/snmpm_network_interface.xml
+++ b/lib/snmp/doc/src/snmpm_network_interface.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2014</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpm_network_interface_filter.xml b/lib/snmp/doc/src/snmpm_network_interface_filter.xml
index 2706f6df09..742cd53fc6 100644
--- a/lib/snmp/doc/src/snmpm_network_interface_filter.xml
+++ b/lib/snmp/doc/src/snmpm_network_interface_filter.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2007</year><year>2014</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/doc/src/snmpm_user.xml b/lib/snmp/doc/src/snmpm_user.xml
index cb2ecb0c58..87ae1d224a 100644
--- a/lib/snmp/doc/src/snmpm_user.xml
+++ b/lib/snmp/doc/src/snmpm_user.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2014</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/snmp/examples/Makefile b/lib/snmp/examples/Makefile
index 854a6e6f8d..39ea5f74db 100644
--- a/lib/snmp/examples/Makefile
+++ b/lib/snmp/examples/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/examples/ex1/Makefile b/lib/snmp/examples/ex1/Makefile
index 2631fdd7ff..a3d02ea778 100644
--- a/lib/snmp/examples/ex1/Makefile
+++ b/lib/snmp/examples/ex1/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2012. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/examples/ex2/Makefile b/lib/snmp/examples/ex2/Makefile
index 9259a59c46..624a1df2ee 100644
--- a/lib/snmp/examples/ex2/Makefile
+++ b/lib/snmp/examples/ex2/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2012. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/examples/ex2/snmp_ex2_manager.erl b/lib/snmp/examples/ex2/snmp_ex2_manager.erl
index 38189fa518..939f9f2b4d 100644
--- a/lib/snmp/examples/ex2/snmp_ex2_manager.erl
+++ b/lib/snmp/examples/ex2/snmp_ex2_manager.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/examples/ex2/snmp_ex2_simple_standard_test.erl b/lib/snmp/examples/ex2/snmp_ex2_simple_standard_test.erl
index fecf817fa0..e8f748c337 100644
--- a/lib/snmp/examples/ex2/snmp_ex2_simple_standard_test.erl
+++ b/lib/snmp/examples/ex2/snmp_ex2_simple_standard_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/examples/subdirs.mk b/lib/snmp/examples/subdirs.mk
index 62cba219cd..b6a1709369 100644
--- a/lib/snmp/examples/subdirs.mk
+++ b/lib/snmp/examples/subdirs.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/include/SNMPv2-TC.hrl b/lib/snmp/include/SNMPv2-TC.hrl
index 54ead21a35..21797f9227 100644
--- a/lib/snmp/include/SNMPv2-TC.hrl
+++ b/lib/snmp/include/SNMPv2-TC.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/include/snmp_tables.hrl b/lib/snmp/include/snmp_tables.hrl
index 888539a282..d6fa00ca43 100644
--- a/lib/snmp/include/snmp_tables.hrl
+++ b/lib/snmp/include/snmp_tables.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/include/snmp_types.hrl b/lib/snmp/include/snmp_types.hrl
index 0a7379c790..ffe30996dc 100644
--- a/lib/snmp/include/snmp_types.hrl
+++ b/lib/snmp/include/snmp_types.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/mibs/Makefile.in b/lib/snmp/mibs/Makefile.in
index eea0d4aa63..2350194077 100644
--- a/lib/snmp/mibs/Makefile.in
+++ b/lib/snmp/mibs/Makefile.in
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2012. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/priv/conf/Makefile b/lib/snmp/priv/conf/Makefile
index 854a6e6f8d..39ea5f74db 100644
--- a/lib/snmp/priv/conf/Makefile
+++ b/lib/snmp/priv/conf/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/priv/conf/agent/Makefile b/lib/snmp/priv/conf/agent/Makefile
index 5e9b922d04..e905f55999 100644
--- a/lib/snmp/priv/conf/agent/Makefile
+++ b/lib/snmp/priv/conf/agent/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2012. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/priv/conf/agent/files.mk b/lib/snmp/priv/conf/agent/files.mk
index 8e6c80f3a2..bccf162ef5 100644
--- a/lib/snmp/priv/conf/agent/files.mk
+++ b/lib/snmp/priv/conf/agent/files.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/priv/conf/manager/Makefile b/lib/snmp/priv/conf/manager/Makefile
index b88ed0a11c..27024c171f 100644
--- a/lib/snmp/priv/conf/manager/Makefile
+++ b/lib/snmp/priv/conf/manager/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/priv/conf/manager/files.mk b/lib/snmp/priv/conf/manager/files.mk
index 9ead147aff..db52a3712f 100644
--- a/lib/snmp/priv/conf/manager/files.mk
+++ b/lib/snmp/priv/conf/manager/files.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/priv/conf/subdirs.mk b/lib/snmp/priv/conf/subdirs.mk
index 7d8d40887f..c17f5db483 100644
--- a/lib/snmp/priv/conf/subdirs.mk
+++ b/lib/snmp/priv/conf/subdirs.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/Makefile b/lib/snmp/src/Makefile
index 854a6e6f8d..39ea5f74db 100644
--- a/lib/snmp/src/Makefile
+++ b/lib/snmp/src/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/Makefile b/lib/snmp/src/agent/Makefile
index 89037b3ea8..2943a4d550 100644
--- a/lib/snmp/src/agent/Makefile
+++ b/lib/snmp/src/agent/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2012. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/depend.mk b/lib/snmp/src/agent/depend.mk
index e9964f5151..8eba50fa3b 100644
--- a/lib/snmp/src/agent/depend.mk
+++ b/lib/snmp/src/agent/depend.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2013. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/modules.mk b/lib/snmp/src/agent/modules.mk
index b2f1d5cc93..0f8615588a 100644
--- a/lib/snmp/src/agent/modules.mk
+++ b/lib/snmp/src/agent/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2013. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmp_community_mib.erl b/lib/snmp/src/agent/snmp_community_mib.erl
index dbd9f468d7..9fd7b30f9f 100644
--- a/lib/snmp/src/agent/snmp_community_mib.erl
+++ b/lib/snmp/src/agent/snmp_community_mib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmp_framework_mib.erl b/lib/snmp/src/agent/snmp_framework_mib.erl
index 80ebba6c90..7ea4f0ed97 100644
--- a/lib/snmp/src/agent/snmp_framework_mib.erl
+++ b/lib/snmp/src/agent/snmp_framework_mib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmp_generic.erl b/lib/snmp/src/agent/snmp_generic.erl
index ec6b7161ea..fc23e16ef1 100644
--- a/lib/snmp/src/agent/snmp_generic.erl
+++ b/lib/snmp/src/agent/snmp_generic.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmp_generic_mnesia.erl b/lib/snmp/src/agent/snmp_generic_mnesia.erl
index 051566e43d..131b9b0368 100644
--- a/lib/snmp/src/agent/snmp_generic_mnesia.erl
+++ b/lib/snmp/src/agent/snmp_generic_mnesia.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmp_index.erl b/lib/snmp/src/agent/snmp_index.erl
index 5e03c530f1..38b39a9b7e 100644
--- a/lib/snmp/src/agent/snmp_index.erl
+++ b/lib/snmp/src/agent/snmp_index.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmp_notification_mib.erl b/lib/snmp/src/agent/snmp_notification_mib.erl
index 15ecbcc5d9..3f1ba5d8b3 100644
--- a/lib/snmp/src/agent/snmp_notification_mib.erl
+++ b/lib/snmp/src/agent/snmp_notification_mib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl
index 9e6aa74d45..02415e8036 100644
--- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl
+++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl
index 7c70404e02..ff7be54283 100644
--- a/lib/snmp/src/agent/snmpa.erl
+++ b/lib/snmp/src/agent/snmpa.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_acm.erl b/lib/snmp/src/agent/snmpa_acm.erl
index 0264c6a992..de67df8a06 100644
--- a/lib/snmp/src/agent/snmpa_acm.erl
+++ b/lib/snmp/src/agent/snmpa_acm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_agent.erl b/lib/snmp/src/agent/snmpa_agent.erl
index bada50a820..458b88359b 100644
--- a/lib/snmp/src/agent/snmpa_agent.erl
+++ b/lib/snmp/src/agent/snmpa_agent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_agent_sup.erl b/lib/snmp/src/agent/snmpa_agent_sup.erl
index f6f218366f..0a5116b2d0 100644
--- a/lib/snmp/src/agent/snmpa_agent_sup.erl
+++ b/lib/snmp/src/agent/snmpa_agent_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_app.erl b/lib/snmp/src/agent/snmpa_app.erl
index 89d1efd0a1..86ff145e93 100644
--- a/lib/snmp/src/agent/snmpa_app.erl
+++ b/lib/snmp/src/agent/snmpa_app.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_atl.hrl b/lib/snmp/src/agent/snmpa_atl.hrl
index 06d36dbb06..d07c850891 100644
--- a/lib/snmp/src/agent/snmpa_atl.hrl
+++ b/lib/snmp/src/agent/snmpa_atl.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_authentication_service.erl b/lib/snmp/src/agent/snmpa_authentication_service.erl
index 36845c83b2..e4238a8384 100644
--- a/lib/snmp/src/agent/snmpa_authentication_service.erl
+++ b/lib/snmp/src/agent/snmpa_authentication_service.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_conf.erl b/lib/snmp/src/agent/snmpa_conf.erl
index ebefa945c5..94325a8ed6 100644
--- a/lib/snmp/src/agent/snmpa_conf.erl
+++ b/lib/snmp/src/agent/snmpa_conf.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_discovery_handler.erl b/lib/snmp/src/agent/snmpa_discovery_handler.erl
index 7f84601200..ffdd6aca1e 100644
--- a/lib/snmp/src/agent/snmpa_discovery_handler.erl
+++ b/lib/snmp/src/agent/snmpa_discovery_handler.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_discovery_handler_default.erl b/lib/snmp/src/agent/snmpa_discovery_handler_default.erl
index 89b30b3054..8bd8d1973e 100644
--- a/lib/snmp/src/agent/snmpa_discovery_handler_default.erl
+++ b/lib/snmp/src/agent/snmpa_discovery_handler_default.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_error.erl b/lib/snmp/src/agent/snmpa_error.erl
index 06d61de517..804c850593 100644
--- a/lib/snmp/src/agent/snmpa_error.erl
+++ b/lib/snmp/src/agent/snmpa_error.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_error_io.erl b/lib/snmp/src/agent/snmpa_error_io.erl
index 848869188f..e961d4b525 100644
--- a/lib/snmp/src/agent/snmpa_error_io.erl
+++ b/lib/snmp/src/agent/snmpa_error_io.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_error_logger.erl b/lib/snmp/src/agent/snmpa_error_logger.erl
index 50165d79cd..d52a3e48ac 100644
--- a/lib/snmp/src/agent/snmpa_error_logger.erl
+++ b/lib/snmp/src/agent/snmpa_error_logger.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_error_report.erl b/lib/snmp/src/agent/snmpa_error_report.erl
index 6f3508c8b7..8f28eac653 100644
--- a/lib/snmp/src/agent/snmpa_error_report.erl
+++ b/lib/snmp/src/agent/snmpa_error_report.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_general_db.erl b/lib/snmp/src/agent/snmpa_general_db.erl
index 7892a4c033..431302b6cc 100644
--- a/lib/snmp/src/agent/snmpa_general_db.erl
+++ b/lib/snmp/src/agent/snmpa_general_db.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_internal.hrl b/lib/snmp/src/agent/snmpa_internal.hrl
index b340f0d262..fe3ba9f39e 100644
--- a/lib/snmp/src/agent/snmpa_internal.hrl
+++ b/lib/snmp/src/agent/snmpa_internal.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_local_db.erl b/lib/snmp/src/agent/snmpa_local_db.erl
index feab855b2e..eb67b9cd6f 100644
--- a/lib/snmp/src/agent/snmpa_local_db.erl
+++ b/lib/snmp/src/agent/snmpa_local_db.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_mib.erl b/lib/snmp/src/agent/snmpa_mib.erl
index 2f58922e2c..ab1098514c 100644
--- a/lib/snmp/src/agent/snmpa_mib.erl
+++ b/lib/snmp/src/agent/snmpa_mib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_mib_data.erl b/lib/snmp/src/agent/snmpa_mib_data.erl
index 5614a431d6..fcbc0465c8 100644
--- a/lib/snmp/src/agent/snmpa_mib_data.erl
+++ b/lib/snmp/src/agent/snmpa_mib_data.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_mib_data_ttln.erl b/lib/snmp/src/agent/snmpa_mib_data_ttln.erl
index 312372b41b..959230b1dd 100644
--- a/lib/snmp/src/agent/snmpa_mib_data_ttln.erl
+++ b/lib/snmp/src/agent/snmpa_mib_data_ttln.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_mib_data_tttn.erl b/lib/snmp/src/agent/snmpa_mib_data_tttn.erl
index 849c9b37d9..9b4493a03f 100644
--- a/lib/snmp/src/agent/snmpa_mib_data_tttn.erl
+++ b/lib/snmp/src/agent/snmpa_mib_data_tttn.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_mib_lib.erl b/lib/snmp/src/agent/snmpa_mib_lib.erl
index 3006b3c0a8..ecdf968458 100644
--- a/lib/snmp/src/agent/snmpa_mib_lib.erl
+++ b/lib/snmp/src/agent/snmpa_mib_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_mib_storage.erl b/lib/snmp/src/agent/snmpa_mib_storage.erl
index ea166ed79c..ed0607fb84 100644
--- a/lib/snmp/src/agent/snmpa_mib_storage.erl
+++ b/lib/snmp/src/agent/snmpa_mib_storage.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_mib_storage_dets.erl b/lib/snmp/src/agent/snmpa_mib_storage_dets.erl
index 53c69b8d45..2459b6bc3e 100644
--- a/lib/snmp/src/agent/snmpa_mib_storage_dets.erl
+++ b/lib/snmp/src/agent/snmpa_mib_storage_dets.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_mib_storage_ets.erl b/lib/snmp/src/agent/snmpa_mib_storage_ets.erl
index a2cceb2fa5..68dfa83247 100644
--- a/lib/snmp/src/agent/snmpa_mib_storage_ets.erl
+++ b/lib/snmp/src/agent/snmpa_mib_storage_ets.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl b/lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl
index 998743f133..5f66b2ed9f 100644
--- a/lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl
+++ b/lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_misc_sup.erl b/lib/snmp/src/agent/snmpa_misc_sup.erl
index 50570d508e..746405ec1d 100644
--- a/lib/snmp/src/agent/snmpa_misc_sup.erl
+++ b/lib/snmp/src/agent/snmpa_misc_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_net_if_filter.erl b/lib/snmp/src/agent/snmpa_net_if_filter.erl
index 5f447ae5c7..1db8609eaf 100644
--- a/lib/snmp/src/agent/snmpa_net_if_filter.erl
+++ b/lib/snmp/src/agent/snmpa_net_if_filter.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_network_interface.erl b/lib/snmp/src/agent/snmpa_network_interface.erl
index a9f17f274b..699fbde671 100644
--- a/lib/snmp/src/agent/snmpa_network_interface.erl
+++ b/lib/snmp/src/agent/snmpa_network_interface.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_network_interface_filter.erl b/lib/snmp/src/agent/snmpa_network_interface_filter.erl
index 3ad840e798..1524a6447b 100644
--- a/lib/snmp/src/agent/snmpa_network_interface_filter.erl
+++ b/lib/snmp/src/agent/snmpa_network_interface_filter.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_notification_delivery_info_receiver.erl b/lib/snmp/src/agent/snmpa_notification_delivery_info_receiver.erl
index 29686ea757..aca90baf0e 100644
--- a/lib/snmp/src/agent/snmpa_notification_delivery_info_receiver.erl
+++ b/lib/snmp/src/agent/snmpa_notification_delivery_info_receiver.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_notification_filter.erl b/lib/snmp/src/agent/snmpa_notification_filter.erl
index 6eea857721..6300d450c7 100644
--- a/lib/snmp/src/agent/snmpa_notification_filter.erl
+++ b/lib/snmp/src/agent/snmpa_notification_filter.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_set.erl b/lib/snmp/src/agent/snmpa_set.erl
index fd99304991..9833d6fdcc 100644
--- a/lib/snmp/src/agent/snmpa_set.erl
+++ b/lib/snmp/src/agent/snmpa_set.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_set_lib.erl b/lib/snmp/src/agent/snmpa_set_lib.erl
index 2d14b719dd..57507a36e8 100644
--- a/lib/snmp/src/agent/snmpa_set_lib.erl
+++ b/lib/snmp/src/agent/snmpa_set_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_set_mechanism.erl b/lib/snmp/src/agent/snmpa_set_mechanism.erl
index b8bf3a9aa8..2f24f38092 100644
--- a/lib/snmp/src/agent/snmpa_set_mechanism.erl
+++ b/lib/snmp/src/agent/snmpa_set_mechanism.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_supervisor.erl b/lib/snmp/src/agent/snmpa_supervisor.erl
index 128c5f875d..cdb5ca840d 100644
--- a/lib/snmp/src/agent/snmpa_supervisor.erl
+++ b/lib/snmp/src/agent/snmpa_supervisor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_svbl.erl b/lib/snmp/src/agent/snmpa_svbl.erl
index 53bbce7707..8955bed0f2 100644
--- a/lib/snmp/src/agent/snmpa_svbl.erl
+++ b/lib/snmp/src/agent/snmpa_svbl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_symbolic_store.erl b/lib/snmp/src/agent/snmpa_symbolic_store.erl
index cffb6bcd1c..945a4e9a9c 100644
--- a/lib/snmp/src/agent/snmpa_symbolic_store.erl
+++ b/lib/snmp/src/agent/snmpa_symbolic_store.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_target_cache.erl b/lib/snmp/src/agent/snmpa_target_cache.erl
index 04d2a121ba..72caf72b33 100644
--- a/lib/snmp/src/agent/snmpa_target_cache.erl
+++ b/lib/snmp/src/agent/snmpa_target_cache.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_trap.erl b/lib/snmp/src/agent/snmpa_trap.erl
index eea2b05eb7..e75016f7ec 100644
--- a/lib/snmp/src/agent/snmpa_trap.erl
+++ b/lib/snmp/src/agent/snmpa_trap.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/agent/snmpa_vacm.hrl b/lib/snmp/src/agent/snmpa_vacm.hrl
index 20506f8715..527298e499 100644
--- a/lib/snmp/src/agent/snmpa_vacm.hrl
+++ b/lib/snmp/src/agent/snmpa_vacm.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/app/Makefile b/lib/snmp/src/app/Makefile
index 7972d9549d..6f2b8a4077 100644
--- a/lib/snmp/src/app/Makefile
+++ b/lib/snmp/src/app/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2013. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/app/depend.mk b/lib/snmp/src/app/depend.mk
index 4a9cc17490..bf213c2aec 100644
--- a/lib/snmp/src/app/depend.mk
+++ b/lib/snmp/src/app/depend.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/app/modules.mk b/lib/snmp/src/app/modules.mk
index fa42614a24..2bfd2d5c56 100644
--- a/lib/snmp/src/app/modules.mk
+++ b/lib/snmp/src/app/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/app/snmp.erl b/lib/snmp/src/app/snmp.erl
index 3c65f40bc7..df3933ea01 100644
--- a/lib/snmp/src/app/snmp.erl
+++ b/lib/snmp/src/app/snmp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/app/snmp_app.erl b/lib/snmp/src/app/snmp_app.erl
index 8b948850dd..dbc1ec0b6d 100644
--- a/lib/snmp/src/app/snmp_app.erl
+++ b/lib/snmp/src/app/snmp_app.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/app/snmp_app_sup.erl b/lib/snmp/src/app/snmp_app_sup.erl
index 32b69b4bbf..eb89cc5b6d 100644
--- a/lib/snmp/src/app/snmp_app_sup.erl
+++ b/lib/snmp/src/app/snmp_app_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/app/snmp_internal.hrl b/lib/snmp/src/app/snmp_internal.hrl
index 9a1bb4b67c..374767df15 100644
--- a/lib/snmp/src/app/snmp_internal.hrl
+++ b/lib/snmp/src/app/snmp_internal.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/compile/Makefile b/lib/snmp/src/compile/Makefile
index 54f2e229b9..4093ffa9ca 100644
--- a/lib/snmp/src/compile/Makefile
+++ b/lib/snmp/src/compile/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/compile/depend.mk b/lib/snmp/src/compile/depend.mk
index 427ad4cda3..57b7c19daf 100644
--- a/lib/snmp/src/compile/depend.mk
+++ b/lib/snmp/src/compile/depend.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2013. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/compile/modules.mk b/lib/snmp/src/compile/modules.mk
index 547cc3438e..9ca5ebb95a 100644
--- a/lib/snmp/src/compile/modules.mk
+++ b/lib/snmp/src/compile/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2011. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/compile/snmpc.hrl b/lib/snmp/src/compile/snmpc.hrl
index 9157ef13f0..b3c66f4f3d 100644
--- a/lib/snmp/src/compile/snmpc.hrl
+++ b/lib/snmp/src/compile/snmpc.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/compile/snmpc.src b/lib/snmp/src/compile/snmpc.src
index 903b035d13..e64b6607c4 100644
--- a/lib/snmp/src/compile/snmpc.src
+++ b/lib/snmp/src/compile/snmpc.src
@@ -3,7 +3,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/compile/snmpc_lib.erl b/lib/snmp/src/compile/snmpc_lib.erl
index 3b1b1594c9..51690b6e7e 100644
--- a/lib/snmp/src/compile/snmpc_lib.erl
+++ b/lib/snmp/src/compile/snmpc_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/compile/snmpc_lib.hrl b/lib/snmp/src/compile/snmpc_lib.hrl
index 0f65fc1820..8d76817cec 100644
--- a/lib/snmp/src/compile/snmpc_lib.hrl
+++ b/lib/snmp/src/compile/snmpc_lib.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/compile/snmpc_mib_gram.yrl b/lib/snmp/src/compile/snmpc_mib_gram.yrl
index b152f23d05..743c3a6550 100644
--- a/lib/snmp/src/compile/snmpc_mib_gram.yrl
+++ b/lib/snmp/src/compile/snmpc_mib_gram.yrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/compile/snmpc_mib_to_hrl.erl b/lib/snmp/src/compile/snmpc_mib_to_hrl.erl
index e71530b40e..bc18afbdc9 100644
--- a/lib/snmp/src/compile/snmpc_mib_to_hrl.erl
+++ b/lib/snmp/src/compile/snmpc_mib_to_hrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/compile/snmpc_misc.erl b/lib/snmp/src/compile/snmpc_misc.erl
index 68600bc97a..933d629746 100644
--- a/lib/snmp/src/compile/snmpc_misc.erl
+++ b/lib/snmp/src/compile/snmpc_misc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/compile/snmpc_misc.hrl b/lib/snmp/src/compile/snmpc_misc.hrl
index e09ec2712c..2df6d1863d 100644
--- a/lib/snmp/src/compile/snmpc_misc.hrl
+++ b/lib/snmp/src/compile/snmpc_misc.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/compile/snmpc_tok.erl b/lib/snmp/src/compile/snmpc_tok.erl
index 14f88cc9ae..9114cc90de 100644
--- a/lib/snmp/src/compile/snmpc_tok.erl
+++ b/lib/snmp/src/compile/snmpc_tok.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/Makefile b/lib/snmp/src/manager/Makefile
index 382f83b78e..0cc87492f1 100644
--- a/lib/snmp/src/manager/Makefile
+++ b/lib/snmp/src/manager/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/depend.mk b/lib/snmp/src/manager/depend.mk
index 651a6e537d..7d8f81f55a 100644
--- a/lib/snmp/src/manager/depend.mk
+++ b/lib/snmp/src/manager/depend.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2014. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/modules.mk b/lib/snmp/src/manager/modules.mk
index 0f13e26423..ea9b52d653 100644
--- a/lib/snmp/src/manager/modules.mk
+++ b/lib/snmp/src/manager/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/snmpm.erl b/lib/snmp/src/manager/snmpm.erl
index 446280b8bd..cf8c95d69f 100644
--- a/lib/snmp/src/manager/snmpm.erl
+++ b/lib/snmp/src/manager/snmpm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/snmpm_atl.hrl b/lib/snmp/src/manager/snmpm_atl.hrl
index f407b399cf..988b75d9bd 100644
--- a/lib/snmp/src/manager/snmpm_atl.hrl
+++ b/lib/snmp/src/manager/snmpm_atl.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/snmpm_conf.erl b/lib/snmp/src/manager/snmpm_conf.erl
index 0abc5ae88b..0421f49c88 100644
--- a/lib/snmp/src/manager/snmpm_conf.erl
+++ b/lib/snmp/src/manager/snmpm_conf.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/snmpm_config.erl b/lib/snmp/src/manager/snmpm_config.erl
index e5c0f27bd6..118cdcd1df 100644
--- a/lib/snmp/src/manager/snmpm_config.erl
+++ b/lib/snmp/src/manager/snmpm_config.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/snmpm_internal.hrl b/lib/snmp/src/manager/snmpm_internal.hrl
index 72f277faf6..e917206f13 100644
--- a/lib/snmp/src/manager/snmpm_internal.hrl
+++ b/lib/snmp/src/manager/snmpm_internal.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/snmpm_misc_sup.erl b/lib/snmp/src/manager/snmpm_misc_sup.erl
index 835216b30b..6ff82b322b 100644
--- a/lib/snmp/src/manager/snmpm_misc_sup.erl
+++ b/lib/snmp/src/manager/snmpm_misc_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/snmpm_net_if_filter.erl b/lib/snmp/src/manager/snmpm_net_if_filter.erl
index bcc9f97f4c..e5aef0756b 100644
--- a/lib/snmp/src/manager/snmpm_net_if_filter.erl
+++ b/lib/snmp/src/manager/snmpm_net_if_filter.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/snmpm_net_if_mt.erl b/lib/snmp/src/manager/snmpm_net_if_mt.erl
index 72bd69c612..238e212e14 100644
--- a/lib/snmp/src/manager/snmpm_net_if_mt.erl
+++ b/lib/snmp/src/manager/snmpm_net_if_mt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/snmpm_network_interface.erl b/lib/snmp/src/manager/snmpm_network_interface.erl
index dd4e762d84..d0f6f709d3 100644
--- a/lib/snmp/src/manager/snmpm_network_interface.erl
+++ b/lib/snmp/src/manager/snmpm_network_interface.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/snmpm_network_interface_filter.erl b/lib/snmp/src/manager/snmpm_network_interface_filter.erl
index 604994756d..35bec4e7e7 100644
--- a/lib/snmp/src/manager/snmpm_network_interface_filter.erl
+++ b/lib/snmp/src/manager/snmpm_network_interface_filter.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/snmpm_server_sup.erl b/lib/snmp/src/manager/snmpm_server_sup.erl
index e8c2790db3..842a5761ce 100644
--- a/lib/snmp/src/manager/snmpm_server_sup.erl
+++ b/lib/snmp/src/manager/snmpm_server_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/snmpm_supervisor.erl b/lib/snmp/src/manager/snmpm_supervisor.erl
index 5654c01c6a..c36bbe1bdd 100644
--- a/lib/snmp/src/manager/snmpm_supervisor.erl
+++ b/lib/snmp/src/manager/snmpm_supervisor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/snmpm_user.erl b/lib/snmp/src/manager/snmpm_user.erl
index 366e40cbb9..c0100d372f 100644
--- a/lib/snmp/src/manager/snmpm_user.erl
+++ b/lib/snmp/src/manager/snmpm_user.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/snmpm_user_default.erl b/lib/snmp/src/manager/snmpm_user_default.erl
index f4f78d49b6..bc2b82a38b 100644
--- a/lib/snmp/src/manager/snmpm_user_default.erl
+++ b/lib/snmp/src/manager/snmpm_user_default.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/snmpm_user_old.erl b/lib/snmp/src/manager/snmpm_user_old.erl
index c490421d6e..bc15ad445b 100644
--- a/lib/snmp/src/manager/snmpm_user_old.erl
+++ b/lib/snmp/src/manager/snmpm_user_old.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/snmpm_usm.erl b/lib/snmp/src/manager/snmpm_usm.erl
index c7a28f5d68..7dd79e703a 100644
--- a/lib/snmp/src/manager/snmpm_usm.erl
+++ b/lib/snmp/src/manager/snmpm_usm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/manager/snmpm_usm.hrl b/lib/snmp/src/manager/snmpm_usm.hrl
index 7a0d225aff..38d4a1a07e 100644
--- a/lib/snmp/src/manager/snmpm_usm.hrl
+++ b/lib/snmp/src/manager/snmpm_usm.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/misc/Makefile b/lib/snmp/src/misc/Makefile
index c71ecf994e..adc2c4858f 100644
--- a/lib/snmp/src/misc/Makefile
+++ b/lib/snmp/src/misc/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2012. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/misc/depend.mk b/lib/snmp/src/misc/depend.mk
index 3f8e6701b9..b2e0a92997 100644
--- a/lib/snmp/src/misc/depend.mk
+++ b/lib/snmp/src/misc/depend.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/misc/modules.mk b/lib/snmp/src/misc/modules.mk
index c22f3604b7..ac42128724 100644
--- a/lib/snmp/src/misc/modules.mk
+++ b/lib/snmp/src/misc/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/misc/snmp_conf.erl b/lib/snmp/src/misc/snmp_conf.erl
index 6264d79cec..513616a285 100644
--- a/lib/snmp/src/misc/snmp_conf.erl
+++ b/lib/snmp/src/misc/snmp_conf.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/misc/snmp_config.erl b/lib/snmp/src/misc/snmp_config.erl
index 2b6bfdcb56..45661b71a7 100644
--- a/lib/snmp/src/misc/snmp_config.erl
+++ b/lib/snmp/src/misc/snmp_config.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/misc/snmp_debug.hrl b/lib/snmp/src/misc/snmp_debug.hrl
index 86445893b6..6ed4af7d50 100644
--- a/lib/snmp/src/misc/snmp_debug.hrl
+++ b/lib/snmp/src/misc/snmp_debug.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/misc/snmp_log.erl b/lib/snmp/src/misc/snmp_log.erl
index 09863dea60..767d801eee 100644
--- a/lib/snmp/src/misc/snmp_log.erl
+++ b/lib/snmp/src/misc/snmp_log.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/misc/snmp_mini_mib.erl b/lib/snmp/src/misc/snmp_mini_mib.erl
index bc9596f64f..92de339001 100644
--- a/lib/snmp/src/misc/snmp_mini_mib.erl
+++ b/lib/snmp/src/misc/snmp_mini_mib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/misc/snmp_note_store.erl b/lib/snmp/src/misc/snmp_note_store.erl
index 74bdd34931..606dd8ce4f 100644
--- a/lib/snmp/src/misc/snmp_note_store.erl
+++ b/lib/snmp/src/misc/snmp_note_store.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/misc/snmp_pdus.erl b/lib/snmp/src/misc/snmp_pdus.erl
index 8045a94ff6..93f06749fd 100644
--- a/lib/snmp/src/misc/snmp_pdus.erl
+++ b/lib/snmp/src/misc/snmp_pdus.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/misc/snmp_usm.erl b/lib/snmp/src/misc/snmp_usm.erl
index 8443b009d9..bae6bdec72 100644
--- a/lib/snmp/src/misc/snmp_usm.erl
+++ b/lib/snmp/src/misc/snmp_usm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/misc/snmp_verbosity.hrl b/lib/snmp/src/misc/snmp_verbosity.hrl
index 950b5aa444..c79f4c3e88 100644
--- a/lib/snmp/src/misc/snmp_verbosity.hrl
+++ b/lib/snmp/src/misc/snmp_verbosity.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/src/subdirs.mk b/lib/snmp/src/subdirs.mk
index e5a437ccfe..5f45fd2586 100644
--- a/lib/snmp/src/subdirs.mk
+++ b/lib/snmp/src/subdirs.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2009. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/subdirs.mk b/lib/snmp/subdirs.mk
index caa4b8baf2..dd8af81d34 100644
--- a/lib/snmp/subdirs.mk
+++ b/lib/snmp/subdirs.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2009. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/Makefile b/lib/snmp/test/Makefile
index 8e895bc5b1..a9142d911d 100644
--- a/lib/snmp/test/Makefile
+++ b/lib/snmp/test/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2014. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/exp/snmp_agent_bl_test.erl b/lib/snmp/test/exp/snmp_agent_bl_test.erl
index 186a1d0fec..af53f816f4 100644
--- a/lib/snmp/test/exp/snmp_agent_bl_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_bl_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/exp/snmp_agent_ms_test.erl b/lib/snmp/test/exp/snmp_agent_ms_test.erl
index 3010de0619..e615e224dc 100644
--- a/lib/snmp/test/exp/snmp_agent_ms_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_ms_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/exp/snmp_agent_mt_test.erl b/lib/snmp/test/exp/snmp_agent_mt_test.erl
index 71ae58baca..a9e68011ea 100644
--- a/lib/snmp/test/exp/snmp_agent_mt_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_mt_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/exp/snmp_agent_v1_test.erl b/lib/snmp/test/exp/snmp_agent_v1_test.erl
index 55045d536e..98e29e55f7 100644
--- a/lib/snmp/test/exp/snmp_agent_v1_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_v1_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/exp/snmp_agent_v2_test.erl b/lib/snmp/test/exp/snmp_agent_v2_test.erl
index 6238a6c4bd..c69904daf5 100644
--- a/lib/snmp/test/exp/snmp_agent_v2_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_v2_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/exp/snmp_agent_v3_test.erl b/lib/snmp/test/exp/snmp_agent_v3_test.erl
index af7cee9b96..066a5a26fc 100644
--- a/lib/snmp/test/exp/snmp_agent_v3_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_v3_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/klas3.erl b/lib/snmp/test/klas3.erl
index eb0c41bf77..9a5c388170 100644
--- a/lib/snmp/test/klas3.erl
+++ b/lib/snmp/test/klas3.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/modules.mk b/lib/snmp/test/modules.mk
index 16a570706a..87539f88f7 100644
--- a/lib/snmp/test/modules.mk
+++ b/lib/snmp/test/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2014. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/sa.erl b/lib/snmp/test/sa.erl
index 3e34fb2328..99e1ad55fd 100644
--- a/lib/snmp/test/sa.erl
+++ b/lib/snmp/test/sa.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_SUITE.erl b/lib/snmp/test/snmp_SUITE.erl
index 43f6b1abff..3b9219739b 100644
--- a/lib/snmp/test/snmp_SUITE.erl
+++ b/lib/snmp/test/snmp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_agent_mibs_test.erl b/lib/snmp/test/snmp_agent_mibs_test.erl
index 2cbba14c74..4babffef43 100644
--- a/lib/snmp/test/snmp_agent_mibs_test.erl
+++ b/lib/snmp/test/snmp_agent_mibs_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_agent_nfilter_test.erl b/lib/snmp/test/snmp_agent_nfilter_test.erl
index 8aeef81333..64fdf20c3f 100644
--- a/lib/snmp/test/snmp_agent_nfilter_test.erl
+++ b/lib/snmp/test/snmp_agent_nfilter_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_agent_test.erl b/lib/snmp/test/snmp_agent_test.erl
index 93968ede2e..8ae495bb1b 100644
--- a/lib/snmp/test/snmp_agent_test.erl
+++ b/lib/snmp/test/snmp_agent_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_agent_test_lib.erl b/lib/snmp/test/snmp_agent_test_lib.erl
index 6f20254fcb..66211d7105 100644
--- a/lib/snmp/test/snmp_agent_test_lib.erl
+++ b/lib/snmp/test/snmp_agent_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_app_test.erl b/lib/snmp/test/snmp_app_test.erl
index 6892d4aa93..6e7e85d3b4 100644
--- a/lib/snmp/test/snmp_app_test.erl
+++ b/lib/snmp/test/snmp_app_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_appup_test.erl b/lib/snmp/test/snmp_appup_test.erl
index 47cbd5fe8c..aff1c7c782 100644
--- a/lib/snmp/test/snmp_appup_test.erl
+++ b/lib/snmp/test/snmp_appup_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_compiler_test.erl b/lib/snmp/test/snmp_compiler_test.erl
index b08181191f..2c8851c2a7 100644
--- a/lib/snmp/test/snmp_compiler_test.erl
+++ b/lib/snmp/test/snmp_compiler_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_conf_test.erl b/lib/snmp/test/snmp_conf_test.erl
index 73b471b107..6242fdeca3 100644
--- a/lib/snmp/test/snmp_conf_test.erl
+++ b/lib/snmp/test/snmp_conf_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_log_test.erl b/lib/snmp/test/snmp_log_test.erl
index ae2581fb69..8890b4b20d 100644
--- a/lib/snmp/test/snmp_log_test.erl
+++ b/lib/snmp/test/snmp_log_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_manager_config_test.erl b/lib/snmp/test/snmp_manager_config_test.erl
index 8428b61e8a..64d3134055 100644
--- a/lib/snmp/test/snmp_manager_config_test.erl
+++ b/lib/snmp/test/snmp_manager_config_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_manager_test.erl b/lib/snmp/test/snmp_manager_test.erl
index a343dfdca7..d17882e765 100644
--- a/lib/snmp/test/snmp_manager_test.erl
+++ b/lib/snmp/test/snmp_manager_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_manager_user.erl b/lib/snmp/test/snmp_manager_user.erl
index 55b1e23b2e..409f87cf40 100644
--- a/lib/snmp/test/snmp_manager_user.erl
+++ b/lib/snmp/test/snmp_manager_user.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_manager_user_old.erl b/lib/snmp/test/snmp_manager_user_old.erl
index f317fa831c..51b55da2e6 100644
--- a/lib/snmp/test/snmp_manager_user_old.erl
+++ b/lib/snmp/test/snmp_manager_user_old.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_manager_user_test.erl b/lib/snmp/test/snmp_manager_user_test.erl
index 64edfef4d5..915249ec77 100644
--- a/lib/snmp/test/snmp_manager_user_test.erl
+++ b/lib/snmp/test/snmp_manager_user_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_manager_user_test_lib.erl b/lib/snmp/test/snmp_manager_user_test_lib.erl
index ea2c83a0da..8df7f1e662 100644
--- a/lib/snmp/test/snmp_manager_user_test_lib.erl
+++ b/lib/snmp/test/snmp_manager_user_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_note_store_test.erl b/lib/snmp/test/snmp_note_store_test.erl
index 902d37b0d7..94d400fb53 100644
--- a/lib/snmp/test/snmp_note_store_test.erl
+++ b/lib/snmp/test/snmp_note_store_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_pdus_test.erl b/lib/snmp/test/snmp_pdus_test.erl
index bfbd031646..29a793ebcb 100644
--- a/lib/snmp/test/snmp_pdus_test.erl
+++ b/lib/snmp/test/snmp_pdus_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_test_manager.erl b/lib/snmp/test/snmp_test_manager.erl
index 294f0e8240..6ab5ce164c 100644
--- a/lib/snmp/test/snmp_test_manager.erl
+++ b/lib/snmp/test/snmp_test_manager.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_test_mgr_counter_server.erl b/lib/snmp/test/snmp_test_mgr_counter_server.erl
index a72eefd6e5..697afdf799 100644
--- a/lib/snmp/test/snmp_test_mgr_counter_server.erl
+++ b/lib/snmp/test/snmp_test_mgr_counter_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_test_mgr_misc.erl b/lib/snmp/test/snmp_test_mgr_misc.erl
index 0a0e3be9aa..274fb5be26 100644
--- a/lib/snmp/test/snmp_test_mgr_misc.erl
+++ b/lib/snmp/test/snmp_test_mgr_misc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_test_server.erl b/lib/snmp/test/snmp_test_server.erl
index 8b22d6943a..a77bdc142c 100644
--- a/lib/snmp/test/snmp_test_server.erl
+++ b/lib/snmp/test/snmp_test_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_test_suite.erl b/lib/snmp/test/snmp_test_suite.erl
index 07c93d062c..539c6348a9 100644
--- a/lib/snmp/test/snmp_test_suite.erl
+++ b/lib/snmp/test/snmp_test_suite.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_to_snmpnet_SUITE.erl b/lib/snmp/test/snmp_to_snmpnet_SUITE.erl
index 95f4a7518b..ac9e37bc8b 100644
--- a/lib/snmp/test/snmp_to_snmpnet_SUITE.erl
+++ b/lib/snmp/test/snmp_to_snmpnet_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/snmp_to_snmpnet_SUITE_data/start_stop_wrapper b/lib/snmp/test/snmp_to_snmpnet_SUITE_data/start_stop_wrapper
index 8bd8e1ab4a..e10507cfbd 100755
--- a/lib/snmp/test/snmp_to_snmpnet_SUITE_data/start_stop_wrapper
+++ b/lib/snmp/test/snmp_to_snmpnet_SUITE_data/start_stop_wrapper
@@ -2,7 +2,7 @@
##
## %CopyrightBegin%
##
-## Copyright Ericsson AB 2014-2014. All Rights Reserved.
+## Copyright Ericsson AB 2014-2016. All Rights Reserved.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/test1.erl b/lib/snmp/test/test1.erl
index 82555af11f..3337b265e6 100644
--- a/lib/snmp/test/test1.erl
+++ b/lib/snmp/test/test1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/test2.erl b/lib/snmp/test/test2.erl
index 2bfae95c8d..c73a0930d6 100644
--- a/lib/snmp/test/test2.erl
+++ b/lib/snmp/test/test2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/test_config/Makefile b/lib/snmp/test/test_config/Makefile
index 6e78350e9f..1e53f51b83 100644
--- a/lib/snmp/test/test_config/Makefile
+++ b/lib/snmp/test/test_config/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/test_config/modules.mk b/lib/snmp/test/test_config/modules.mk
index 64244be7fe..23475b63f8 100644
--- a/lib/snmp/test/test_config/modules.mk
+++ b/lib/snmp/test/test_config/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2010. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/snmp/test/test_config/snmp_test_config.erl b/lib/snmp/test/test_config/snmp_test_config.erl
index 80fac0c772..89246f5b02 100644
--- a/lib/snmp/test/test_config/snmp_test_config.erl
+++ b/lib/snmp/test/test_config/snmp_test_config.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk
index f60cbbfaa7..f58f6b6162 100644
--- a/lib/snmp/vsn.mk
+++ b/lib/snmp/vsn.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2015. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ssh/Makefile b/lib/ssh/Makefile
index 839aada22f..dedc7ac3a6 100644
--- a/lib/ssh/Makefile
+++ b/lib/ssh/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2010. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ssh/doc/src/Makefile b/lib/ssh/doc/src/Makefile
index c0707f8004..a759854da4 100644
--- a/lib/ssh/doc/src/Makefile
+++ b/lib/ssh/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ssh/doc/src/book.xml b/lib/ssh/doc/src/book.xml
index 33b1e0036b..bc104b274d 100644
--- a/lib/ssh/doc/src/book.xml
+++ b/lib/ssh/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2005</year><year>2013</year>
+ <year>2005</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ssh/doc/src/introduction.xml b/lib/ssh/doc/src/introduction.xml
index 187d458092..ca84528f3d 100644
--- a/lib/ssh/doc/src/introduction.xml
+++ b/lib/ssh/doc/src/introduction.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2012</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml
index 5f2cd19cda..96bc50c689 100644
--- a/lib/ssh/doc/src/notes.xml
+++ b/lib/ssh/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2015</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ssh/doc/src/part_notes.xml b/lib/ssh/doc/src/part_notes.xml
index 664cadce57..aaca8ca9f2 100644
--- a/lib/ssh/doc/src/part_notes.xml
+++ b/lib/ssh/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ssh/doc/src/ref_man.xml b/lib/ssh/doc/src/ref_man.xml
index 4a2f043948..140ebd8c76 100644
--- a/lib/ssh/doc/src/ref_man.xml
+++ b/lib/ssh/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ssh/doc/src/ssh.xml b/lib/ssh/doc/src/ssh.xml
index 850557444d..ff2d6e082a 100644
--- a/lib/ssh/doc/src/ssh.xml
+++ b/lib/ssh/doc/src/ssh.xml
@@ -241,6 +241,7 @@
{server2client,['aes128-cbc','3des-cbc']}]},
{mac,['hmac-sha2-256','hmac-sha1']},
{compression,[none,zlib]}
+ ]
}
</code>
<p>The example specifies different algorithms in the two directions (client2server and server2client),
@@ -359,7 +360,8 @@
</type>
<desc>
<p>Starts a server listening for SSH connections on the given
- port.</p>
+ port. If the <c>Port</c> is 0, a random free port is selected. See
+ <seealso marker="#daemon_info/1">daemon_info/1</seealso> about how to find the selected port number.</p>
<p>Options:</p>
<taglist>
<tag><c><![CDATA[{inet, inet | inet6}]]></c></tag>
@@ -460,6 +462,7 @@
{server2client,['aes128-cbc','3des-cbc']}]},
{mac,['hmac-sha2-256','hmac-sha1']},
{compression,[none,zlib]}
+ ]
}
</code>
<p>The example specifies different algorithms in the two directions (client2server and server2client),
@@ -680,6 +683,18 @@
</func>
<func>
+ <name>daemon_info(Daemon) -> {ok, [{port,Port}]} | {error,Error}</name>
+ <fsummary>Get info about a daemon</fsummary>
+ <type>
+ <v>Port = integer()</v>
+ <v>Error = bad_daemon_ref</v>
+ </type>
+ <desc>
+ <p>Returns a key-value list with information about the daemon. For now, only the listening port is returned. This is intended for the case the daemon is started with the port set to 0.</p>
+ </desc>
+ </func>
+
+ <func>
<name>default_algorithms() -> algs_list()</name>
<fsummary>Get a list declaring the supported algorithms</fsummary>
<desc>
diff --git a/lib/ssh/doc/src/ssh_channel.xml b/lib/ssh/doc/src/ssh_channel.xml
index abfe590647..907b0b3bec 100644
--- a/lib/ssh/doc/src/ssh_channel.xml
+++ b/lib/ssh/doc/src/ssh_channel.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2009</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/ssh/doc/src/ssh_client_key_api.xml b/lib/ssh/doc/src/ssh_client_key_api.xml
index 6b8932e5a7..a1cd9d4b02 100644
--- a/lib/ssh/doc/src/ssh_client_key_api.xml
+++ b/lib/ssh/doc/src/ssh_client_key_api.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2012</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/ssh/doc/src/ssh_sftp.xml b/lib/ssh/doc/src/ssh_sftp.xml
index f4b41b74f3..071d46ec57 100644
--- a/lib/ssh/doc/src/ssh_sftp.xml
+++ b/lib/ssh/doc/src/ssh_sftp.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2005</year><year>2015</year>
+ <year>2005</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -44,24 +44,41 @@
</p>
<taglist>
+ <tag><c>reason()</c></tag>
+ <item>
+ <p>= <c>atom()</c> A description of the reason why an operation failed.</p>
+ <p>
+ The value is formed from the sftp error codes in the protocol-level responses as defined in
+ <url href="https://tools.ietf.org/id/draft-ietf-secsh-filexfer-13.txt">draft-ietf-secsh-filexfer-13.txt</url>
+ section 9.1.
+ </p>
+ <p>
+ The codes are named as <c>SSH_FX_*</c> which are transformed into lowercase of the star-part.
+ E.g. the error code <c>SSH_FX_NO_SUCH_FILE</c>
+ will cause the <c>reason()</c> to be <c>no_such_file</c>.
+ </p>
+ </item>
+
<tag><c>ssh_connection_ref() =</c></tag>
- <item><p>opaque() - as returned by <c>ssh:connect/3</c></p></item>
+ <item><p><c>opaque()</c> - as returned by
+ <seealso marker="ssh#connect-3"><c>ssh:connect/3</c></seealso></p></item>
+
<tag><c>timeout()</c></tag>
- <item><p>= <c>infinity | integer() in milliseconds. Default infinity.</c></p></item>
+ <item><p>= <c>infinity | integer()</c> in milliseconds. Default infinity.</p></item>
</taglist>
</section>
<section>
<title>Time-outs</title>
<p>If the request functions for the SFTP channel return <c>{error, timeout}</c>,
- it does not guarantee that the request never reached the server and was
- not performed. It only means that no answer was received from the
- server within the expected time.</p>
+ no answer was received from the server within the expected time.</p>
+ <p>The request may have reached the server and may have been performed.
+ However, no answer was received from the server within the expected time.</p>
</section>
<funcs>
<func>
- <name>apread(ChannelPid, Handle, Position, Len) -> {async, N} | {error, Reason}</name>
+ <name>apread(ChannelPid, Handle, Position, Len) -> {async, N} | {error, reason()}</name>
<fsummary>Reads asynchronously from an open file.</fsummary>
<type>
<v>ChannelPid = pid()</v>
@@ -69,16 +86,15 @@
<v>Position = integer()</v>
<v>Len = integer()</v>
<v>N = term()</v>
- <v>Reason = term()</v>
</type>
-
- <desc><p>The <c><![CDATA[apread]]></c> function reads from a specified position,
- combining the <c><![CDATA[position]]></c> and <c><![CDATA[aread]]></c> functions.</p>
- <p><seealso marker="#apread-4">ssh_sftp:apread/4</seealso></p> </desc>
+ <desc><p>The <c><![CDATA[apread/4]]></c> function reads from a specified position,
+ combining the <seealso marker="#position-3"><c>position/3</c></seealso> and
+ <seealso marker="#aread-3"><c>aread/3</c></seealso> functions.</p>
+ </desc>
</func>
<func>
- <name>apwrite(ChannelPid, Handle, Position, Data) -> ok | {error, Reason}</name>
+ <name>apwrite(ChannelPid, Handle, Position, Data) -> {async, N} | {error, reason()}</name>
<fsummary>Writes asynchronously to an open file.</fsummary>
<type>
<v>ChannelPid = pid()</v>
@@ -87,16 +103,16 @@
<v>Len = integer()</v>
<v>Data = binary()</v>
<v>Timeout = timeout()</v>
- <v>Reason = term()</v>
+ <v>N = term()</v>
</type>
- <desc>
- <p><c><![CDATA[apwrite]]></c> writes on a specified position, combining
- the <c><![CDATA[position]]></c> and <c><![CDATA[awrite]]></c> operations.</p>
- <p><seealso marker="#awrite-3">ssh_sftp:awrite/3</seealso> </p></desc>
+ <desc><p>The <c><![CDATA[apwrite/4]]></c> function writes to a specified position,
+ combining the <seealso marker="#position-3"><c>position/3</c></seealso> and
+ <seealso marker="#awrite-3"><c>awrite/3</c></seealso> functions.</p>
+ </desc>
</func>
<func>
- <name>aread(ChannelPid, Handle, Len) -> {async, N} | {error, Error}</name>
+ <name>aread(ChannelPid, Handle, Len) -> {async, N} | {error, reason()}</name>
<fsummary>Reads asynchronously from an open file.</fsummary>
<type>
<v>ChannelPid = pid()</v>
@@ -104,7 +120,6 @@
<v>Position = integer()</v>
<v>Len = integer()</v>
<v>N = term()</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>Reads from an open file, without waiting for the result. If the
@@ -113,14 +128,12 @@
The actual data is sent as a message to the calling process. This
message has the form <c><![CDATA[{async_reply, N, Result}]]></c>, where
<c><![CDATA[Result]]></c> is the result from the read, either <c><![CDATA[{ok, Data}]]></c>,
- <c><![CDATA[eof]]></c>, or <c><![CDATA[{error, Error}]]></c>.</p>
+ <c><![CDATA[eof]]></c>, or <c><![CDATA[{error, reason()}]]></c>.</p>
</desc>
</func>
-
-
<func>
- <name>awrite(ChannelPid, Handle, Data) -> ok | {error, Reason}</name>
+ <name>awrite(ChannelPid, Handle, Data) -> {async, N} | {error, reason()}</name>
<fsummary>Writes asynchronously to an open file.</fsummary>
<type>
<v>ChannelPid = pid()</v>
@@ -129,7 +142,6 @@
<v>Len = integer()</v>
<v>Data = binary()</v>
<v>Timeout = timeout()</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>Writes to an open file, without waiting for the result. If the
@@ -138,19 +150,18 @@
<c><![CDATA[awrite]]></c>. The result of the <c><![CDATA[write]]></c> operation is sent
as a message to the calling process. This message has the form
<c><![CDATA[{async_reply, N, Result}]]></c>, where <c><![CDATA[Result]]></c> is the result
- from the write, either <c><![CDATA[ok]]></c>, or <c><![CDATA[{error, Error}]]></c>.</p>
+ from the write, either <c><![CDATA[ok]]></c>, or <c><![CDATA[{error, reason()}]]></c>.</p>
</desc>
</func>
<func>
<name>close(ChannelPid, Handle) -></name>
- <name>close(ChannelPid, Handle, Timeout) -> ok | {error, Reason}</name>
+ <name>close(ChannelPid, Handle, Timeout) -> ok | {error, reason()}</name>
<fsummary>Closes an open handle.</fsummary>
<type>
<v>ChannelPid = pid()</v>
<v>Handle = term()</v>
<v>Timeout = timeout()</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>Closes a handle to an open file or directory on the server.</p>
@@ -159,29 +170,27 @@
<func>
<name>delete(ChannelPid, Name) -></name>
- <name>delete(ChannelPid, Name, Timeout) -> ok | {error, Reason}</name>
+ <name>delete(ChannelPid, Name, Timeout) -> ok | {error, reason()}</name>
<fsummary>Deletes a file.</fsummary>
<type>
<v>ChannelPid = pid()</v>
<v>Name = string()</v>
<v>Timeout = timeout()</v>
- <v>Reason = term()</v>
</type>
<desc>
- <p>Deletes the file specified by <c><![CDATA[Name]]></c>, like
- <seealso marker="kernel:file#delete-1">file:delete/1</seealso></p>
+ <p>Deletes the file specified by <c><![CDATA[Name]]></c>.
+ </p>
</desc>
</func>
<func>
<name>del_dir(ChannelPid, Name) -></name>
- <name>del_dir(ChannelPid, Name, Timeout) -> ok | {error, Reason}</name>
+ <name>del_dir(ChannelPid, Name, Timeout) -> ok | {error, reason()}</name>
<fsummary>Deletes an empty directory.</fsummary>
<type>
<v>ChannelPid = pid()</v>
<v>Name = string()</v>
<v>Timeout = timeout()</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>Deletes a directory specified by <c><![CDATA[Name]]></c>.
@@ -192,7 +201,7 @@
<func>
<name>list_dir(ChannelPid, Path) -></name>
- <name>list_dir(ChannelPid, Path, Timeout) -> {ok, Filenames} | {error, Reason}</name>
+ <name>list_dir(ChannelPid, Path, Timeout) -> {ok, Filenames} | {error, reason()}</name>
<fsummary>Lists the directory.</fsummary>
<type>
<v>ChannelPid = pid()</v>
@@ -200,7 +209,6 @@
<v>Filenames = [Filename]</v>
<v>Filename = string()</v>
<v>Timeout = timeout()</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>Lists the given directory on the server, returning the
@@ -210,13 +218,12 @@
<func>
<name>make_dir(ChannelPid, Name) -></name>
- <name>make_dir(ChannelPid, Name, Timeout) -> ok | {error, Reason}</name>
+ <name>make_dir(ChannelPid, Name, Timeout) -> ok | {error, reason()}</name>
<fsummary>Creates a directory.</fsummary>
<type>
<v>ChannelPid = pid()</v>
<v>Name = string()</v>
<v>Timeout = timeout()</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>Creates a directory specified by <c><![CDATA[Name]]></c>. <c><![CDATA[Name]]></c>
@@ -227,24 +234,23 @@
<func>
<name>make_symlink(ChannelPid, Name, Target) -></name>
- <name>make_symlink(ChannelPid, Name, Target, Timeout) -> ok | {error, Reason}</name>
+ <name>make_symlink(ChannelPid, Name, Target, Timeout) -> ok | {error, reason()}</name>
<fsummary>Creates a symbolic link.</fsummary>
<type>
<v>ChannelPid = pid()</v>
<v>Name = string()</v>
<v>Target = string()</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>Creates a symbolic link pointing to <c><![CDATA[Target]]></c> with the
- name <c><![CDATA[Name]]></c>, like
- <seealso marker="kernel:file#make_symlink-2">file:make_symlink/2</seealso></p>
+ name <c><![CDATA[Name]]></c>.
+ </p>
</desc>
</func>
<func>
<name>open(ChannelPid, File, Mode) -></name>
- <name>open(ChannelPid, File, Mode, Timeout) -> {ok, Handle} | {error, Reason}</name>
+ <name>open(ChannelPid, File, Mode, Timeout) -> {ok, Handle} | {error, reason()}</name>
<fsummary>Opens a file and returns a handle.</fsummary>
<type>
<v>ChannelPid = pid()</v>
@@ -253,7 +259,6 @@
<v>Modeflag = read | write | creat | trunc | append | binary</v>
<v>Timeout = timeout()</v>
<v>Handle = term()</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>Opens a file on the server and returns a handle, which
@@ -262,13 +267,12 @@
</func>
<func>
<name>opendir(ChannelPid, Path) -></name>
- <name>opendir(ChannelPid, Path, Timeout) -> {ok, Handle} | {error, Reason}</name>
+ <name>opendir(ChannelPid, Path, Timeout) -> {ok, Handle} | {error, reason()}</name>
<fsummary>Opens a directory and returns a handle.</fsummary>
<type>
<v>ChannelPid = pid()</v>
<v>Path = string()</v>
<v>Timeout = timeout()</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>Opens a handle to a directory on the server. The handle
@@ -278,7 +282,7 @@
<func>
<name>open_tar(ChannelPid, Path, Mode) -></name>
- <name>open_tar(ChannelPid, Path, Mode, Timeout) -> {ok, Handle} | {error, Reason}</name>
+ <name>open_tar(ChannelPid, Path, Mode, Timeout) -> {ok, Handle} | {error, reason()}</name>
<fsummary>Opens a tar file on the server to which <c>ChannelPid</c>
is connected and returns a handle.</fsummary>
<type>
@@ -298,7 +302,6 @@
<v>DecryptResult = {ok,PlainBin,CryptoState} | {ok,PlainBin,CryptoState,ChunkSize}</v>
<v>CloseFun = (fun(PlainBin,CryptoState) -> {ok,EncryptedBin})</v>
<v>Timeout = timeout()</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>Opens a handle to a tar file on the server, associated with <c>ChannelPid</c>.
@@ -333,7 +336,7 @@
<func>
<name>position(ChannelPid, Handle, Location) -></name>
- <name>position(ChannelPid, Handle, Location, Timeout) -> {ok, NewPosition} | {error, Reason}</name>
+ <name>position(ChannelPid, Handle, Location, Timeout) -> {ok, NewPosition | {error, reason()}</name>
<fsummary>Sets the file position of a file.</fsummary>
<type>
<v>ChannelPid = pid()</v>
@@ -343,12 +346,11 @@
<v>Offset = integer()</v>
<v>Timeout = timeout()</v>
<v>NewPosition = integer()</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>Sets the file position of the file referenced by <c><![CDATA[Handle]]></c>.
Returns <c><![CDATA[{ok, NewPosition}]]></c> (as an absolute offset) if
- successful, otherwise <c><![CDATA[{error, Reason}]]></c>. <c><![CDATA[Location]]></c> is
+ successful, otherwise <c><![CDATA[{error, reason()}]]></c>. <c><![CDATA[Location]]></c> is
one of the following:</p>
<taglist>
<tag><c><![CDATA[Offset]]></c></tag>
@@ -379,7 +381,7 @@
<func>
<name>pread(ChannelPid, Handle, Position, Len) -></name>
- <name>pread(ChannelPid, Handle, Position, Len, Timeout) -> {ok, Data} | eof | {error, Error}</name>
+ <name>pread(ChannelPid, Handle, Position, Len, Timeout) -> {ok, Data} | eof | {error, reason()}</name>
<fsummary>Reads from an open file.</fsummary>
<type>
<v>ChannelPid = pid()</v>
@@ -388,18 +390,16 @@
<v>Len = integer()</v>
<v>Timeout = timeout()</v>
<v>Data = string() | binary()</v>
- <v>Reason = term()</v>
</type>
- <desc>
- <p>The <c><![CDATA[pread]]></c> function reads from a specified position,
- combining the <c><![CDATA[position]]></c> and <c><![CDATA[read]]></c> functions.</p>
- <p><seealso marker="#read-4">ssh_sftp:read/4</seealso></p>
- </desc>
- </func>
+ <desc><p>The <c><![CDATA[pread/3,4]]></c> function reads from a specified position,
+ combining the <seealso marker="#position-3"><c>position/3</c></seealso> and
+ <seealso marker="#read-3"><c>read/3,4</c></seealso> functions.</p>
+ </desc>
+ </func>
<func>
<name>pwrite(ChannelPid, Handle, Position, Data) -> ok</name>
- <name>pwrite(ChannelPid, Handle, Position, Data, Timeout) -> ok | {error, Reason}</name>
+ <name>pwrite(ChannelPid, Handle, Position, Data, Timeout) -> ok | {error, reason()}</name>
<fsummary>Writes to an open file.</fsummary>
<type>
<v>ChannelPid = pid()</v>
@@ -407,19 +407,16 @@
<v>Position = integer()</v>
<v>Data = iolist()</v>
<v>Timeout = timeout()</v>
- <v>Reason = term()</v>
</type>
- <desc>
- <p>The <c><![CDATA[pread]]></c> function writes to a specified position,
- combining the <c><![CDATA[position]]></c> and <c><![CDATA[write]]></c> functions.</p>
- <p><seealso marker="#write-3">ssh_sftp:write/3</seealso></p>
- </desc>
+ <desc><p>The <c><![CDATA[pwrite/3,4]]></c> function writes to a specified position,
+ combining the <seealso marker="#position-3"><c>position/3</c></seealso> and
+ <seealso marker="#write-3"><c>write/3,4</c></seealso> functions.</p>
+ </desc>
</func>
-
- <func>
+ <func>
<name>read(ChannelPid, Handle, Len) -></name>
- <name>read(ChannelPid, Handle, Len, Timeout) -> {ok, Data} | eof | {error, Error}</name>
+ <name>read(ChannelPid, Handle, Len, Timeout) -> {ok, Data} | eof | {error, reason()}</name>
<fsummary>Reads from an open file.</fsummary>
<type>
<v>ChannelPid = pid()</v>
@@ -428,12 +425,11 @@
<v>Len = integer()</v>
<v>Timeout = timeout()</v>
<v>Data = string() | binary()</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>Reads <c><![CDATA[Len]]></c> bytes from the file referenced by
<c><![CDATA[Handle]]></c>. Returns <c><![CDATA[{ok, Data}]]></c>, <c><![CDATA[eof]]></c>, or
- <c><![CDATA[{error, Reason}]]></c>. If the file is opened with <c><![CDATA[binary]]></c>,
+ <c><![CDATA[{error, reason()}]]></c>. If the file is opened with <c><![CDATA[binary]]></c>,
<c><![CDATA[Data]]></c> is a binary, otherwise it is a string.</p>
<p>If the file is read past <c>eof</c>, only the remaining bytes
are read and returned. If no bytes are read, <c><![CDATA[eof]]></c>
@@ -443,25 +439,22 @@
<func>
<name>read_file(ChannelPid, File) -></name>
- <name>read_file(ChannelPid, File, Timeout) -> {ok, Data} | {error, Reason}</name>
+ <name>read_file(ChannelPid, File, Timeout) -> {ok, Data} | {error, reason()}</name>
<fsummary>Reads a file.</fsummary>
<type>
<v>ChannelPid = pid()</v>
<v>File = string()</v>
<v>Data = binary()</v>
<v>Timeout = timeout()</v>
- <v>Reason = term()</v>
</type>
<desc>
- <p>Reads a file from the server, and returns the data in a binary,
- like
- <seealso marker="kernel:file#read_file-1">file:read_file/1</seealso></p>
+ <p>Reads a file from the server, and returns the data in a binary.</p>
</desc>
</func>
<func>
<name>read_file_info(ChannelPid, Name) -></name>
- <name>read_file_info(ChannelPid, Name, Timeout) -> {ok, FileInfo} | {error, Reason}</name>
+ <name>read_file_info(ChannelPid, Name, Timeout) -> {ok, FileInfo} | {error, reason()}</name>
<fsummary>Gets information about a file.</fsummary>
<type>
<v>ChannelPid = pid()</v>
@@ -469,35 +462,34 @@
<v>Handle = term()</v>
<v>Timeout = timeout()</v>
<v>FileInfo = record()</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>Returns a <c><![CDATA[file_info]]></c> record from the file specified by
- <c><![CDATA[Name]]></c> or <c><![CDATA[Handle]]></c>,
- like <seealso marker="kernel:file#read_file_info-2">file:read_file_info/2</seealso></p>
+ <c><![CDATA[Name]]></c> or <c><![CDATA[Handle]]></c>. See
+ <seealso marker="kernel:file#read_file_info-2">file:read_file_info/2</seealso>
+ for information about the record.
+ </p>
</desc>
</func>
<func>
<name>read_link(ChannelPid, Name) -></name>
- <name>read_link(ChannelPid, Name, Timeout) -> {ok, Target} | {error, Reason}</name>
+ <name>read_link(ChannelPid, Name, Timeout) -> {ok, Target} | {error, reason()}</name>
<fsummary>Reads symbolic link.</fsummary>
<type>
<v>ChannelPid = pid()</v>
<v>Name = string()</v>
<v>Target = string()</v>
- <v>Reason = term()</v>
</type>
<desc>
- <p>Reads the link target from the symbolic link specified
- by <c><![CDATA[name]]></c>, like
- <seealso marker="kernel:file#read_link-1">file:read_link/1</seealso></p>
+ <p>Reads the link target from the symbolic link specified by <c><![CDATA[name]]></c>.
+ </p>
</desc>
</func>
<func>
- <name>read_link_info(ChannelPid, Name) -> {ok, FileInfo} | {error, Reason}</name>
- <name>read_link_info(ChannelPid, Name, Timeout) -> {ok, FileInfo} | {error, Reason}</name>
+ <name>read_link_info(ChannelPid, Name) -> {ok, FileInfo} | {error, reason()}</name>
+ <name>read_link_info(ChannelPid, Name, Timeout) -> {ok, FileInfo} | {error, reason()}</name>
<fsummary>Gets information about a symbolic link.</fsummary>
<type>
<v>ChannelPid = pid()</v>
@@ -505,30 +497,31 @@
<v>Handle = term()</v>
<v>Timeout = timeout()</v>
<v>FileInfo = record()</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>Returns a <c><![CDATA[file_info]]></c> record from the symbolic
- link specified by <c><![CDATA[Name]]></c> or <c><![CDATA[Handle]]></c>, like
- <seealso marker="kernel:file#read_link_info-2">file:read_link_info/2</seealso></p>
+ link specified by <c><![CDATA[Name]]></c> or <c><![CDATA[Handle]]></c>.
+ See
+ <seealso marker="kernel:file#read_link_info-2">file:read_link_info/2</seealso>
+ for information about the record.
+ </p>
</desc>
</func>
<func>
<name>rename(ChannelPid, OldName, NewName) -> </name>
- <name>rename(ChannelPid, OldName, NewName, Timeout) -> ok | {error, Reason}</name>
+ <name>rename(ChannelPid, OldName, NewName, Timeout) -> ok | {error, reason()}</name>
<fsummary>Renames a file.</fsummary>
<type>
<v>ChannelPid = pid()</v>
<v>OldName = string()</v>
<v>NewName = string()</v>
<v>Timeout = timeout()</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>Renames a file named <c><![CDATA[OldName]]></c> and gives it the name
- <c><![CDATA[NewName]]></c>, like
- <seealso marker="kernel:file#rename-2">file:rename/2</seealso></p>
+ <c><![CDATA[NewName]]></c>.
+ </p>
</desc>
</func>
@@ -537,14 +530,13 @@
<name>start_channel(ConnectionRef, Options) -></name>
<name>start_channel(Host, Options) -></name>
<name>start_channel(Host, Port, Options) -> {ok, Pid} | {ok, Pid, ConnectionRef} |
- {error, Reason}</name>
+ {error, reason()|term()}</name>
<fsummary>Starts an SFTP client.</fsummary>
<type>
<v>Host = string()</v>
<v>ConnectionRef = ssh_connection_ref()</v>
<v>Port = integer()</v>
<v>Options = [{Option, Value}]</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>If no connection reference is provided, a connection is set
@@ -592,7 +584,7 @@
<func>
<name>write(ChannelPid, Handle, Data) -></name>
- <name>write(ChannelPid, Handle, Data, Timeout) -> ok | {error, Reason}</name>
+ <name>write(ChannelPid, Handle, Data, Timeout) -> ok | {error, reason()}</name>
<fsummary>Writes to an open file.</fsummary>
<type>
<v>ChannelPid = pid()</v>
@@ -600,61 +592,47 @@
<v>Position = integer()</v>
<v>Data = iolist()</v>
<v>Timeout = timeout()</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>Writes <c><![CDATA[data]]></c> to the file referenced by <c><![CDATA[Handle]]></c>.
The file is to be opened with <c><![CDATA[write]]></c> or <c><![CDATA[append]]></c>
- flag. Returns <c><![CDATA[ok]]></c> if successful or <c><![CDATA[{error, Reason}]]></c>
+ flag. Returns <c><![CDATA[ok]]></c> if successful or <c><![CDATA[{error, reason()}]]></c>
otherwise.</p>
- <p>Typical error reasons:</p>
- <taglist>
- <tag><c><![CDATA[ebadf]]></c></tag>
- <item>
- <p>File is not opened for writing.</p>
- </item>
- <tag><c><![CDATA[enospc]]></c></tag>
- <item>
- <p>No space is left on the device.</p>
- </item>
- </taglist>
</desc>
</func>
<func>
<name>write_file(ChannelPid, File, Iolist) -></name>
- <name>write_file(ChannelPid, File, Iolist, Timeout) -> ok | {error, Reason}</name>
+ <name>write_file(ChannelPid, File, Iolist, Timeout) -> ok | {error, reason()}</name>
<fsummary>Writes a file.</fsummary>
<type>
<v>ChannelPid = pid()</v>
<v>File = string()</v>
<v>Iolist = iolist()</v>
<v>Timeout = timeout()</v>
- <v>Reason = term()</v>
</type>
<desc>
- <p>Writes a file to the server, like <seealso
- marker="kernel:file#write_file-2">file:write_file/2</seealso> The
- file is created if it does not exist. The file is overwritten
- if it exists.</p>
+ <p>Writes a file to the server. The file is created if it does not exist
+ but overwritten if it exists.</p>
</desc>
</func>
<func>
<name>write_file_info(ChannelPid, Name, Info) -></name>
- <name>write_file_info(ChannelPid, Name, Info, Timeout) -> ok | {error, Reason}</name>
+ <name>write_file_info(ChannelPid, Name, Info, Timeout) -> ok | {error, reason()}</name>
<fsummary>Writes information for a file.</fsummary>
<type>
<v>ChannelPid = pid()</v>
<v>Name = string()</v>
<v>Info = record()</v>
<v>Timeout = timeout()</v>
- <v>Reason = term()</v>
</type>
<desc>
<p>Writes file information from a <c><![CDATA[file_info]]></c> record to the
- file specified by <c><![CDATA[Name]]></c>, like
- <seealso marker="kernel:file#write_file_info-2">file:write_file_info/[2,3]</seealso></p>
+ file specified by <c><![CDATA[Name]]></c>. See
+ <seealso marker="kernel:file#write_file_info-2">file:write_file_info/[2,3]</seealso>
+ for information about the record.
+ </p>
</desc>
</func>
</funcs>
diff --git a/lib/ssh/doc/src/ssh_sftpd.xml b/lib/ssh/doc/src/ssh_sftpd.xml
index cf50fb1b23..1be29b3b29 100644
--- a/lib/ssh/doc/src/ssh_sftpd.xml
+++ b/lib/ssh/doc/src/ssh_sftpd.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2005</year><year>2013</year>
+ <year>2005</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ssh/doc/src/usersguide.xml b/lib/ssh/doc/src/usersguide.xml
index 7c925a3762..70051ba771 100644
--- a/lib/ssh/doc/src/usersguide.xml
+++ b/lib/ssh/doc/src/usersguide.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2012</year><year>2013</year>
+ <year>2012</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ssh/doc/src/using_ssh.xml b/lib/ssh/doc/src/using_ssh.xml
index 6826f20fb3..0861c641c7 100644
--- a/lib/ssh/doc/src/using_ssh.xml
+++ b/lib/ssh/doc/src/using_ssh.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2012</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ssh/examples/ssh_sample_cli.erl b/lib/ssh/examples/ssh_sample_cli.erl
index 2d8aa428ec..f88aaf048a 100644
--- a/lib/ssh/examples/ssh_sample_cli.erl
+++ b/lib/ssh/examples/ssh_sample_cli.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/Makefile b/lib/ssh/src/Makefile
index b44c8eef35..69d5a47f83 100644
--- a/lib/ssh/src/Makefile
+++ b/lib/ssh/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2013. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -54,6 +54,7 @@ MODULES= \
ssh_connection_sup \
ssh_connection \
ssh_connection_handler \
+ ssh_dbg \
ssh_shell \
ssh_system_sup \
ssh_subsystem_sup \
diff --git a/lib/ssh/src/ssh.app.src b/lib/ssh/src/ssh.app.src
index 4a76fd9cd3..3245ba5197 100644
--- a/lib/ssh/src/ssh.app.src
+++ b/lib/ssh/src/ssh.app.src
@@ -18,6 +18,7 @@
ssh_connection_handler,
ssh_connection_sup,
ssh_daemon_channel,
+ ssh_dbg,
ssh_shell,
sshc_sup,
sshd_sup,
@@ -39,7 +40,12 @@
{applications, [kernel, stdlib, crypto, public_key]},
{env, []},
{mod, {ssh_app, []}},
- {runtime_dependencies, ["stdlib-2.3","public_key-0.22","kernel-3.0",
- "erts-6.0","crypto-3.3"]}]}.
+ {runtime_dependencies, [
+ "crypto-3.3",
+ "erts-6.0",
+ "kernel-3.0",
+ "public_key-1.1",
+ "stdlib-3.0"
+ ]}]}.
diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl
index 54f94acbdc..09b07b7a2a 100644
--- a/lib/ssh/src/ssh.erl
+++ b/lib/ssh/src/ssh.erl
@@ -1,7 +1,7 @@
%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -30,12 +30,18 @@
-export([start/0, start/1, stop/0, connect/3, connect/4, close/1, connection_info/2,
channel_info/3,
daemon/1, daemon/2, daemon/3,
+ daemon_info/1,
default_algorithms/0,
stop_listener/1, stop_listener/2, stop_listener/3,
stop_daemon/1, stop_daemon/2, stop_daemon/3,
shell/1, shell/2, shell/3
]).
+%%% Type exports
+-export_type([connection_ref/0,
+ channel_id/0
+ ]).
+
%%--------------------------------------------------------------------
-spec start() -> ok | {error, term()}.
-spec start(permanent | transient | temporary) -> ok | {error, term()}.
@@ -81,7 +87,7 @@ connect(Host, Port, Options, Timeout) ->
ConnectionTimeout = proplists:get_value(connect_timeout, Options, infinity),
try Transport:connect(Host, Port, [ {active, false} | SocketOptions], ConnectionTimeout) of
{ok, Socket} ->
- Opts = [{user_pid, self()}, {host, Host} | fix_idle_time(SshOptions)],
+ Opts = [{user_pid,self()}, {host,Host} | SshOptions],
ssh_connection_handler:start_connection(client, Socket, Opts, Timeout);
{error, Reason} ->
{error, Reason}
@@ -153,6 +159,19 @@ daemon(HostAddr, Port, Options0) ->
start_daemon(Host, Port, Options, Inet).
%%--------------------------------------------------------------------
+daemon_info(Pid) ->
+ case catch ssh_system_sup:acceptor_supervisor(Pid) of
+ AsupPid when is_pid(AsupPid) ->
+ [Port] =
+ [Prt || {{ssh_acceptor_sup,any,Prt,default},
+ _WorkerPid,worker,[ssh_acceptor]} <- supervisor:which_children(AsupPid)],
+ {ok, [{port,Port}]};
+
+ _ ->
+ {error,bad_daemon_ref}
+ end.
+
+%%--------------------------------------------------------------------
-spec stop_listener(pid()) -> ok.
-spec stop_listener(inet:ip_address(), integer()) -> ok.
%%
@@ -223,13 +242,6 @@ default_algorithms() ->
%%--------------------------------------------------------------------
%%% Internal functions
%%--------------------------------------------------------------------
-fix_idle_time(SshOptions) ->
- case proplists:get_value(idle_time, SshOptions) of
- undefined ->
- [{idle_time, infinity}|SshOptions];
- _ ->
- SshOptions
- end.
start_daemon(Host, Port, Options, Inet) ->
case handle_options(Options) of
{error, _Reason} = Error ->
@@ -243,32 +255,52 @@ start_daemon(Host, Port, Options, Inet) ->
end
end.
-do_start_daemon(Host0, Port0, Options, SocketOptions) ->
- {Host,Port} = try
- case proplists:get_value(fd, SocketOptions) of
- undefined ->
- {Host0,Port0};
- Fd when Port0==0 ->
- find_hostport(Fd);
- _ ->
- {Host0,Port0}
- end
- catch
- _:_ -> throw(bad_fd)
- end,
- Profile = proplists:get_value(profile, Options, ?DEFAULT_PROFILE),
+do_start_daemon(Host0, Port0, SshOptions, SocketOptions) ->
+ {Host,Port1} =
+ try
+ case proplists:get_value(fd, SocketOptions) of
+ undefined ->
+ {Host0,Port0};
+ Fd when Port0==0 ->
+ find_hostport(Fd);
+ _ ->
+ {Host0,Port0}
+ end
+ catch
+ _:_ -> throw(bad_fd)
+ end,
+ Profile = proplists:get_value(profile, SshOptions, ?DEFAULT_PROFILE),
+ {Port, WaitRequestControl, Opts} =
+ case Port1 of
+ 0 -> %% Allocate the socket here to get the port number...
+ {_, Callback, _} =
+ proplists:get_value(transport, SshOptions, {tcp, gen_tcp, tcp_closed}),
+ {ok,LSock} = ssh_acceptor:callback_listen(Callback, 0, SocketOptions),
+ {ok,{_,LPort}} = inet:sockname(LSock),
+ {LPort,
+ {LSock,Callback},
+ [{lsocket,LSock},{lsock_owner,self()}]
+ };
+ _ ->
+ {Port1, false, []}
+ end,
case ssh_system_sup:system_supervisor(Host, Port, Profile) of
undefined ->
%% It would proably make more sense to call the
%% address option host but that is a too big change at the
%% monent. The name is a legacy name!
try sshd_sup:start_child([{address, Host},
- {port, Port}, {role, server},
+ {port, Port},
+ {role, server},
{socket_opts, SocketOptions},
- {ssh_opts, Options}]) of
+ {ssh_opts, SshOptions}
+ | Opts]) of
{error, {already_started, _}} ->
{error, eaddrinuse};
- Result = {Code, _} when (Code == ok) or (Code == error) ->
+ Result = {ok,_} ->
+ sync_request_control(WaitRequestControl),
+ Result;
+ Result = {error, _} ->
Result
catch
exit:{noproc, _} ->
@@ -277,18 +309,31 @@ do_start_daemon(Host0, Port0, Options, SocketOptions) ->
Sup ->
AccPid = ssh_system_sup:acceptor_supervisor(Sup),
case ssh_acceptor_sup:start_child(AccPid, [{address, Host},
- {port, Port}, {role, server},
+ {port, Port},
+ {role, server},
{socket_opts, SocketOptions},
- {ssh_opts, Options}]) of
+ {ssh_opts, SshOptions}
+ | Opts]) of
{error, {already_started, _}} ->
{error, eaddrinuse};
{ok, _} ->
+ sync_request_control(WaitRequestControl),
{ok, Sup};
Other ->
Other
end
end.
+sync_request_control(false) ->
+ ok;
+sync_request_control({LSock,Callback}) ->
+ receive
+ {request_control,LSock,ReqPid} ->
+ ok = Callback:controlling_process(LSock, ReqPid),
+ ReqPid ! {its_yours,LSock},
+ ok
+ end.
+
find_hostport(Fd) ->
%% Using internal functions inet:open/8 and inet:close/0.
%% Don't try this at home unless you know what you are doing!
diff --git a/lib/ssh/src/ssh.hrl b/lib/ssh/src/ssh.hrl
index f88098819d..868f3a9181 100644
--- a/lib/ssh/src/ssh.hrl
+++ b/lib/ssh/src/ssh.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -70,8 +70,6 @@
-record(ssh,
{
- %%state, %% what it's waiting for
-
role, %% client | server
peer, %% string version of peer address
@@ -135,8 +133,8 @@
user,
service,
userauth_quiet_mode, % boolean()
- userauth_supported_methods, % string() eg "keyboard-interactive,password"
userauth_methods, % list( string() ) eg ["keyboard-interactive", "password"]
+ userauth_supported_methods, % string() eg "keyboard-interactive,password"
kb_tries_left = 0, % integer(), num tries left for "keyboard-interactive"
userauth_preference,
available_host_keys,
diff --git a/lib/ssh/src/ssh_acceptor.erl b/lib/ssh/src/ssh_acceptor.erl
index d94dedf1bf..90fd951dcd 100644
--- a/lib/ssh/src/ssh_acceptor.erl
+++ b/lib/ssh/src/ssh_acceptor.erl
@@ -26,7 +26,8 @@
%% Internal application API
-export([start_link/5,
- number_of_connections/1]).
+ number_of_connections/1,
+ callback_listen/3]).
%% spawn export
-export([acceptor_init/6, acceptor_loop/6]).
@@ -46,15 +47,39 @@ start_link(Port, Address, SockOpts, Opts, AcceptTimeout) ->
acceptor_init(Parent, Port, Address, SockOpts, Opts, AcceptTimeout) ->
{_, Callback, _} =
proplists:get_value(transport, Opts, {tcp, gen_tcp, tcp_closed}),
- case (catch do_socket_listen(Callback, Port, [{active, false} | SockOpts])) of
- {ok, ListenSocket} ->
+
+ SockOwner = proplists:get_value(lsock_owner, Opts),
+ LSock = proplists:get_value(lsocket, Opts),
+ UseExistingSocket =
+ case catch inet:sockname(LSock) of
+ {ok,{_,Port}} -> is_pid(SockOwner);
+ _ -> false
+ end,
+
+ case UseExistingSocket of
+ true ->
proc_lib:init_ack(Parent, {ok, self()}),
- acceptor_loop(Callback,
- Port, Address, Opts, ListenSocket, AcceptTimeout);
- Error ->
- proc_lib:init_ack(Parent, Error),
- error
+ request_ownership(LSock, SockOwner),
+ acceptor_loop(Callback, Port, Address, Opts, LSock, AcceptTimeout);
+
+ false ->
+ case (catch do_socket_listen(Callback, Port, SockOpts)) of
+ {ok, ListenSocket} ->
+ proc_lib:init_ack(Parent, {ok, self()}),
+ acceptor_loop(Callback,
+ Port, Address, Opts, ListenSocket, AcceptTimeout);
+ Error ->
+ proc_lib:init_ack(Parent, Error),
+ error
+ end
end.
+
+request_ownership(LSock, SockOwner) ->
+ SockOwner ! {request_control,LSock,self()},
+ receive
+ {its_yours,LSock} -> ok
+ end.
+
do_socket_listen(Callback, Port0, Opts) ->
Port =
@@ -62,6 +87,10 @@ do_socket_listen(Callback, Port0, Opts) ->
undefined -> Port0;
_ -> 0
end,
+ callback_listen(Callback, Port, Opts).
+
+callback_listen(Callback, Port, Opts0) ->
+ Opts = [{active, false}, {reuseaddr,true} | Opts0],
case Callback:listen(Port, Opts) of
{error, nxdomain} ->
Callback:listen(Port, lists:delete(inet6, Opts));
diff --git a/lib/ssh/src/ssh_acceptor_sup.erl b/lib/ssh/src/ssh_acceptor_sup.erl
index a3dc64850f..4f76dbe6f0 100644
--- a/lib/ssh/src/ssh_acceptor_sup.erl
+++ b/lib/ssh/src/ssh_acceptor_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -85,10 +85,7 @@ child_spec(ServerOpts) ->
Profile = proplists:get_value(profile, proplists:get_value(ssh_opts, ServerOpts), ?DEFAULT_PROFILE),
Name = id(Address, Port, Profile),
SocketOpts = proplists:get_value(socket_opts, ServerOpts),
- StartFunc = {ssh_acceptor, start_link, [Port, Address,
- [{active, false},
- {reuseaddr, true}] ++ SocketOpts,
- ServerOpts, Timeout]},
+ StartFunc = {ssh_acceptor, start_link, [Port, Address, SocketOpts, ServerOpts, Timeout]},
Restart = transient,
Shutdown = brutal_kill,
Modules = [ssh_acceptor],
diff --git a/lib/ssh/src/ssh_app.erl b/lib/ssh/src/ssh_app.erl
index 1a11938dd9..d3680e20da 100644
--- a/lib/ssh/src/ssh_app.erl
+++ b/lib/ssh/src/ssh_app.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_auth.erl b/lib/ssh/src/ssh_auth.erl
index b71bed033a..49eec8072f 100644
--- a/lib/ssh/src/ssh_auth.erl
+++ b/lib/ssh/src/ssh_auth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -135,9 +135,9 @@ init_userauth_request_msg(#ssh{opts = Opts} = Ssh) ->
service = "ssh-connection"});
{error, no_user} ->
ErrStr = "Could not determine the users name",
- throw(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_ILLEGAL_USER_NAME,
- description = ErrStr,
- language = "en"})
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_ILLEGAL_USER_NAME,
+ description = ErrStr})
end.
userauth_request_msg(#ssh{userauth_preference = []} = Ssh) ->
@@ -355,10 +355,10 @@ handle_userauth_info_response(#ssh_msg_userauth_info_response{num_responses = 1,
handle_userauth_info_response(#ssh_msg_userauth_info_response{},
_Auth) ->
- throw(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
- description = "Server does not support"
- "keyboard-interactive",
- language = "en"}).
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
+ description = "Server does not support keyboard-interactive"
+ }).
%%--------------------------------------------------------------------
@@ -420,10 +420,10 @@ check_password(User, Password, Opts, Ssh) ->
{false,NewState} ->
{false, Ssh#ssh{pwdfun_user_state=NewState}};
disconnect ->
- throw(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
- description =
- "Unable to connect using the available authentication methods",
- language = ""})
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
+ description = "Unable to connect using the available authentication methods"
+ })
end
end.
diff --git a/lib/ssh/src/ssh_auth.hrl b/lib/ssh/src/ssh_auth.hrl
index 449bc4fa45..56314ca6d9 100644
--- a/lib/ssh/src/ssh_auth.hrl
+++ b/lib/ssh/src/ssh_auth.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_bits.erl b/lib/ssh/src/ssh_bits.erl
index 101bf76cd3..8bedaaf0c5 100644
--- a/lib/ssh/src/ssh_bits.erl
+++ b/lib/ssh/src/ssh_bits.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_channel.erl b/lib/ssh/src/ssh_channel.erl
index d15a2c8eba..a8e6ebde16 100644
--- a/lib/ssh/src/ssh_channel.erl
+++ b/lib/ssh/src/ssh_channel.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -68,7 +68,7 @@
%% Internal application API
-export([cache_create/0, cache_lookup/2, cache_update/2,
cache_delete/1, cache_delete/2, cache_foldl/3,
- cache_find/2,
+ cache_info/2, cache_find/2,
get_print_info/1]).
-record(state, {
@@ -335,6 +335,9 @@ cache_delete(Cache) ->
cache_foldl(Fun, Acc, Cache) ->
ets:foldl(Fun, Acc, Cache).
+cache_info(num_entries, Cache) ->
+ proplists:get_value(size, ets:info(Cache)).
+
cache_find(ChannelPid, Cache) ->
case ets:match_object(Cache, #channel{user = ChannelPid}) of
[] ->
diff --git a/lib/ssh/src/ssh_channel_sup.erl b/lib/ssh/src/ssh_channel_sup.erl
index 7c381553b8..8eaa85f795 100644
--- a/lib/ssh/src/ssh_channel_sup.erl
+++ b/lib/ssh/src/ssh_channel_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_cli.erl b/lib/ssh/src/ssh_cli.erl
index 71f62a960e..2d60008de6 100644
--- a/lib/ssh/src/ssh_cli.erl
+++ b/lib/ssh/src/ssh_cli.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_client_key.erl b/lib/ssh/src/ssh_client_key.erl
index 0758865ad1..5296ac2a02 100644
--- a/lib/ssh/src/ssh_client_key.erl
+++ b/lib/ssh/src/ssh_client_key.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_client_key_api.erl b/lib/ssh/src/ssh_client_key_api.erl
index 7fe97b6c13..039a7dea9b 100644
--- a/lib/ssh/src/ssh_client_key_api.erl
+++ b/lib/ssh/src/ssh_client_key_api.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_connect.hrl b/lib/ssh/src/ssh_connect.hrl
index 0c9ddad641..4fb6bc39f3 100644
--- a/lib/ssh/src/ssh_connect.hrl
+++ b/lib/ssh/src/ssh_connect.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -22,13 +22,15 @@
%%% Description : SSH connection protocol
--type channel_id() :: integer().
+-type role() :: client | server .
+-type connection_ref() :: pid().
+-type channel_id() :: pos_integer().
-define(DEFAULT_PACKET_SIZE, 65536).
-define(DEFAULT_WINDOW_SIZE, 10*?DEFAULT_PACKET_SIZE).
-define(DEFAULT_TIMEOUT, 5000).
--define(MAX_PROTO_VERSION, 255).
+-define(MAX_PROTO_VERSION, 255). % Max length of the hello string
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
@@ -241,7 +243,7 @@
-record(channel,
{
- type, %% "session", "x11", "forwarded-tcpip", "direct-tcpip"
+ type, %% "session"
sys, %% "none", "shell", "exec" "subsystem"
user, %% "user" process id (default to cm user)
flow_control,
diff --git a/lib/ssh/src/ssh_connection.erl b/lib/ssh/src/ssh_connection.erl
index a34478732c..d0f2d54c06 100644
--- a/lib/ssh/src/ssh_connection.erl
+++ b/lib/ssh/src/ssh_connection.erl
@@ -38,8 +38,7 @@
%% Potential API currently unsupported and not tested
-export([window_change/4, window_change/6,
- direct_tcpip/6, direct_tcpip/8, tcpip_forward/3,
- cancel_tcpip_forward/3, signal/3, exit_status/3]).
+ signal/3, exit_status/3]).
%% Internal application API
-export([channel_data/5, handle_msg/3, channel_eof_msg/1,
@@ -48,7 +47,7 @@
channel_adjust_window_msg/2, channel_data_msg/3,
channel_open_msg/5, channel_open_confirmation_msg/4,
channel_open_failure_msg/4, channel_request_msg/4,
- global_request_msg/3, request_failure_msg/0,
+ request_failure_msg/0,
request_success_msg/1, bind/4, unbind/3, unbind_channel/2,
bound_channel/3, encode_ip/1]).
@@ -232,52 +231,6 @@ exit_status(ConnectionHandler, Channel, Status) ->
ssh_connection_handler:request(ConnectionHandler, Channel,
"exit-status", false, [?uint32(Status)], 0).
-direct_tcpip(ConnectionHandler, RemoteHost,
- RemotePort, OrigIP, OrigPort, Timeout) ->
- direct_tcpip(ConnectionHandler, RemoteHost, RemotePort, OrigIP, OrigPort,
- ?DEFAULT_WINDOW_SIZE, ?DEFAULT_PACKET_SIZE, Timeout).
-
-direct_tcpip(ConnectionHandler, RemoteIP, RemotePort, OrigIP, OrigPort,
- InitialWindowSize, MaxPacketSize, Timeout) ->
- case {encode_ip(RemoteIP), encode_ip(OrigIP)} of
- {false, _} ->
- {error, einval};
- {_, false} ->
- {error, einval};
- {RIP, OIP} ->
- ssh_connection_handler:open_channel(ConnectionHandler,
- "direct-tcpip",
- [?string(RIP),
- ?uint32(RemotePort),
- ?string(OIP),
- ?uint32(OrigPort)],
- InitialWindowSize,
- MaxPacketSize,
- Timeout)
- end.
-
-tcpip_forward(ConnectionHandler, BindIP, BindPort) ->
- case encode_ip(BindIP) of
- false ->
- {error, einval};
- IPStr ->
- ssh_connection_handler:global_request(ConnectionHandler,
- "tcpip-forward", true,
- [?string(IPStr),
- ?uint32(BindPort)])
- end.
-
-cancel_tcpip_forward(ConnectionHandler, BindIP, Port) ->
- case encode_ip(BindIP) of
- false ->
- {error, einval};
- IPStr ->
- ssh_connection_handler:global_request(ConnectionHandler,
- "cancel-tcpip-forward", true,
- [?string(IPStr),
- ?uint32(Port)])
- end.
-
%%--------------------------------------------------------------------
%%% Internal API
%%--------------------------------------------------------------------
@@ -300,22 +253,11 @@ l2b([]) ->
channel_data(ChannelId, DataType, Data, Connection, From)
when is_list(Data)->
- channel_data(ChannelId, DataType,
-%% list_to_binary(Data), Connection, From);
- l2b(Data), Connection, From);
- %% try list_to_binary(Data)
- %% of
- %% B -> B
- %% catch
- %% _:_ -> io:format('BAD BINARY: ~p~n',[Data]),
- %% unicode:characters_to_binary(Data)
- %% end,
- %% Connection, From);
+ channel_data(ChannelId, DataType, l2b(Data), Connection, From);
channel_data(ChannelId, DataType, Data,
#connection{channel_cache = Cache} = Connection,
From) ->
-
case ssh_channel:cache_lookup(Cache, ChannelId) of
#channel{remote_id = Id, sent_close = false} = Channel0 ->
{SendList, Channel} =
@@ -331,8 +273,7 @@ channel_data(ChannelId, DataType, Data,
FlowCtrlMsgs = flow_control(Replies, Channel, Cache),
{{replies, Replies ++ FlowCtrlMsgs}, Connection};
_ ->
- gen_fsm:reply(From, {error, closed}),
- {noreply, Connection}
+ {{replies,[{channel_request_reply,From,{error,closed}}]}, Connection}
end.
handle_msg(#ssh_msg_channel_open_confirmation{recipient_channel = ChannelId,
@@ -499,7 +440,8 @@ handle_msg(#ssh_msg_channel_open{channel_type = "session" = Type,
handle_msg(#ssh_msg_channel_open{channel_type = "session",
sender_channel = RemoteId},
- Connection, client) ->
+ Connection,
+ client) ->
%% Client implementations SHOULD reject any session channel open
%% requests to make it more difficult for a corrupt server to attack the
%% client. See See RFC 4254 6.1.
@@ -509,73 +451,6 @@ handle_msg(#ssh_msg_channel_open{channel_type = "session",
{{replies, [{connection_reply, FailMsg}]},
Connection};
-handle_msg(#ssh_msg_channel_open{channel_type = "forwarded-tcpip" = Type,
- sender_channel = RemoteId,
- initial_window_size = RWindowSz,
- maximum_packet_size = RPacketSz,
- data = Data},
- #connection{channel_cache = Cache,
- options = SSHopts} = Connection0, server) ->
- <<?UINT32(ALen), Address:ALen/binary, ?UINT32(Port),
- ?UINT32(OLen), Orig:OLen/binary, ?UINT32(OrigPort)>> = Data,
-
- MinAcceptedPackSz = proplists:get_value(minimal_remote_max_packet_size, SSHopts, 0),
-
- if
- MinAcceptedPackSz =< RPacketSz ->
- case bound_channel(Address, Port, Connection0) of
- undefined ->
- FailMsg = channel_open_failure_msg(RemoteId,
- ?SSH_OPEN_CONNECT_FAILED,
- "Connection refused", "en"),
- {{replies,
- [{connection_reply, FailMsg}]}, Connection0};
- ChannelPid ->
- {ChannelId, Connection1} = new_channel_id(Connection0),
- LWindowSz = ?DEFAULT_WINDOW_SIZE,
- LPacketSz = ?DEFAULT_PACKET_SIZE,
- Channel = #channel{type = Type,
- sys = "none",
- user = ChannelPid,
- local_id = ChannelId,
- recv_window_size = LWindowSz,
- recv_packet_size = LPacketSz,
- send_window_size = RWindowSz,
- send_packet_size = RPacketSz,
- send_buf = queue:new()
- },
- ssh_channel:cache_update(Cache, Channel),
- OpenConfMsg = channel_open_confirmation_msg(RemoteId, ChannelId,
- LWindowSz, LPacketSz),
- {OpenMsg, Connection} =
- reply_msg(Channel, Connection1,
- {open, Channel, {forwarded_tcpip,
- decode_ip(Address), Port,
- decode_ip(Orig), OrigPort}}),
- {{replies, [{connection_reply, OpenConfMsg},
- OpenMsg]}, Connection}
- end;
-
- MinAcceptedPackSz > RPacketSz ->
- FailMsg = channel_open_failure_msg(RemoteId,
- ?SSH_OPEN_ADMINISTRATIVELY_PROHIBITED,
- lists:concat(["Maximum packet size below ",MinAcceptedPackSz,
- " not supported"]), "en"),
- {{replies, [{connection_reply, FailMsg}]}, Connection0}
- end;
-
-
-handle_msg(#ssh_msg_channel_open{channel_type = "forwarded-tcpip",
- sender_channel = RemoteId},
- Connection, client) ->
- %% Client implementations SHOULD reject direct TCP/IP open requests for
- %% security reasons. See RFC 4254 7.2.
- FailMsg = channel_open_failure_msg(RemoteId,
- ?SSH_OPEN_CONNECT_FAILED,
- "Connection refused", "en"),
- {{replies, [{connection_reply, FailMsg}]}, Connection};
-
-
handle_msg(#ssh_msg_channel_open{sender_channel = RemoteId}, Connection, _) ->
FailMsg = channel_open_failure_msg(RemoteId,
?SSH_OPEN_ADMINISTRATIVELY_PROHIBITED,
@@ -786,11 +661,11 @@ handle_msg(#ssh_msg_global_request{name = _Type,
handle_msg(#ssh_msg_request_failure{},
#connection{requests = [{_, From} | Rest]} = Connection, _) ->
- {{replies, [{channel_requst_reply, From, {failure, <<>>}}]},
+ {{replies, [{channel_request_reply, From, {failure, <<>>}}]},
Connection#connection{requests = Rest}};
handle_msg(#ssh_msg_request_success{data = Data},
#connection{requests = [{_, From} | Rest]} = Connection, _) ->
- {{replies, [{channel_requst_reply, From, {success, Data}}]},
+ {{replies, [{channel_request_reply, From, {success, Data}}]},
Connection#connection{requests = Rest}};
handle_msg(#ssh_msg_disconnect{code = Code,
@@ -886,10 +761,6 @@ channel_request_msg(ChannelId, Type, WantReply, Data) ->
want_reply = WantReply,
data = Data}.
-global_request_msg(Type, WantReply, Data) ->
- #ssh_msg_global_request{name = Type,
- want_reply = WantReply,
- data = Data}.
request_failure_msg() ->
#ssh_msg_request_failure{}.
@@ -1059,7 +930,7 @@ request_reply_or_data(#channel{local_id = ChannelId, user = ChannelPid},
Connection, Reply) ->
case lists:keysearch(ChannelId, 1, Requests) of
{value, {ChannelId, From}} ->
- {{channel_requst_reply, From, Reply},
+ {{channel_request_reply, From, Reply},
Connection#connection{requests =
lists:keydelete(ChannelId, 1, Requests)}};
false when (Reply == success) or (Reply == failure) ->
@@ -1351,11 +1222,6 @@ decode_pty_opts2(<<Code, ?UINT32(Value), Tail/binary>>) ->
end,
[{Op, Value} | decode_pty_opts2(Tail)].
-decode_ip(Addr) when is_binary(Addr) ->
- case inet_parse:address(binary_to_list(Addr)) of
- {error,_} -> Addr;
- {ok,A} -> A
- end.
backwards_compatible([], Acc) ->
Acc;
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl
index ce1931e4f4..946adcf384 100644
--- a/lib/ssh/src/ssh_connection_handler.erl
+++ b/lib/ssh/src/ssh_connection_handler.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,94 +28,90 @@
-module(ssh_connection_handler).
--behaviour(gen_fsm).
+-behaviour(gen_statem).
-include("ssh.hrl").
-include("ssh_transport.hrl").
-include("ssh_auth.hrl").
-include("ssh_connect.hrl").
--compile(export_all).
--export([start_link/3]).
-%% Internal application API
--export([open_channel/6, reply_request/3, request/6, request/7,
- global_request/4, send/5, send_eof/2, info/1, info/2,
- connection_info/2, channel_info/3,
- adjust_window/3, close/2, stop/1, renegotiate/1, renegotiate_data/1,
- start_connection/4,
- get_print_info/1]).
-
-%% gen_fsm callbacks
--export([hello/2, kexinit/2, key_exchange/2,
- key_exchange_dh_gex_init/2, key_exchange_dh_gex_reply/2,
- new_keys/2,
- service_request/2, connected/2,
- userauth/2,
- userauth_keyboard_interactive/2,
- userauth_keyboard_interactive_info_response/2,
- error/2]).
-
--export([init/1, handle_event/3,
- handle_sync_event/4, handle_info/3, terminate/3, format_status/2, code_change/4]).
-
--record(state, {
- role,
- client,
- starter,
- auth_user,
- connection_state,
- latest_channel_id = 0,
- idle_timer_ref,
- transport_protocol, % ex: tcp
- transport_cb,
- transport_close_tag,
- ssh_params, % #ssh{} - from ssh.hrl
- socket, % socket()
- decoded_data_buffer, % binary()
- encoded_data_buffer, % binary()
- undecoded_packet_length, % integer()
- key_exchange_init_msg, % #ssh_msg_kexinit{}
- renegotiate = false, % boolean()
- last_size_rekey = 0,
- event_queue = [],
- connection_queue,
- address,
- port,
- opts,
- recbuf
- }).
-
--type state_name() :: hello | kexinit | key_exchange | key_exchange_dh_gex_init |
- key_exchange_dh_gex_reply | new_keys | service_request |
- userauth | userauth_keyboard_interactive |
- userauth_keyboard_interactive_info_response |
- connection.
-
--type gen_fsm_state_return() :: {next_state, state_name(), term()} |
- {next_state, state_name(), term(), timeout()} |
- {stop, term(), term()}.
-
--type gen_fsm_sync_return() :: {next_state, state_name(), term()} |
- {next_state, state_name(), term(), timeout()} |
- {reply, term(), state_name(), term()} |
- {stop, term(), term(), term()}.
+%%====================================================================
+%%% Exports
+%%====================================================================
+
+%%% Start and stop
+-export([start_link/3,
+ stop/1
+ ]).
+
+%%% Internal application API
+-export([start_connection/4,
+ open_channel/6,
+ request/6, request/7,
+ reply_request/3,
+ send/5,
+ send_eof/2,
+ info/1, info/2,
+ connection_info/2,
+ channel_info/3,
+ adjust_window/3, close/2,
+ disconnect/1, disconnect/2,
+ get_print_info/1
+ ]).
+
+%%% Behaviour callbacks
+-export([handle_event/4, terminate/3, format_status/2, code_change/4]).
+
+%%% Exports not intended to be used :). They are used for spawning and tests
+-export([init_connection_handler/3, % proc_lib:spawn needs this
+ init_ssh_record/3, % Export of this internal function
+ % intended for low-level protocol test suites
+ renegotiate/1, renegotiate_data/1 % Export intended for test cases
+ ]).
%%====================================================================
-%% Internal application API
+%% Start / stop
%%====================================================================
+%%--------------------------------------------------------------------
+-spec start_link(role(),
+ inet:socket(),
+ proplists:proplist()
+ ) -> {ok, pid()}.
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+start_link(Role, Socket, Options) ->
+ {ok, proc_lib:spawn_link(?MODULE, init_connection_handler, [Role, Socket, Options])}.
+
%%--------------------------------------------------------------------
--spec start_connection(client| server, port(), proplists:proplist(),
- timeout()) -> {ok, pid()} | {error, term()}.
+-spec stop(connection_ref()
+ ) -> ok | {error, term()}.
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+stop(ConnectionHandler)->
+ case call(ConnectionHandler, stop) of
+ {error, closed} ->
+ ok;
+ Other ->
+ Other
+ end.
+
+%%====================================================================
+%% Internal application API
+%%====================================================================
+
+-define(DefaultTransport, {tcp, gen_tcp, tcp_closed} ).
+
%%--------------------------------------------------------------------
+-spec start_connection(role(),
+ inet:socket(),
+ proplists:proplist(),
+ timeout()
+ ) -> {ok, connection_ref()} | {error, term()}.
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
start_connection(client = Role, Socket, Options, Timeout) ->
try
{ok, Pid} = sshc_sup:start_child([Role, Socket, Options]),
- {_, Callback, _} =
- proplists:get_value(transport, Options, {tcp, gen_tcp, tcp_closed}),
- ok = socket_control(Socket, Pid, Callback),
- Ref = erlang:monitor(process, Pid),
- handshake(Pid, Ref, Timeout)
+ ok = socket_control(Socket, Pid, Options),
+ handshake(Pid, erlang:monitor(process,Pid), Timeout)
catch
exit:{noproc, _} ->
{error, ssh_not_started};
@@ -128,8 +124,8 @@ start_connection(server = Role, Socket, Options, Timeout) ->
try
case proplists:get_value(parallel_login, SSH_Opts, false) of
true ->
- HandshakerPid =
- spawn_link(fun() ->
+ HandshakerPid =
+ spawn_link(fun() ->
receive
{do_handshake, Pid} ->
handshake(Pid, erlang:monitor(process,Pid), Timeout)
@@ -148,953 +144,1123 @@ start_connection(server = Role, Socket, Options, Timeout) ->
{error, Error}
end.
-start_the_connection_child(UserPid, Role, Socket, Options) ->
- Sups = proplists:get_value(supervisors, Options),
- ConnectionSup = proplists:get_value(connection_sup, Sups),
- Opts = [{supervisors, Sups}, {user_pid, UserPid} | proplists:get_value(ssh_opts, Options, [])],
- {ok, Pid} = ssh_connection_sup:start_child(ConnectionSup, [Role, Socket, Opts]),
- {_, Callback, _} = proplists:get_value(transport, Options, {tcp, gen_tcp, tcp_closed}),
- socket_control(Socket, Pid, Callback),
- Pid.
-
+%%--------------------------------------------------------------------
+%%% Some other module has decided to disconnect.
+-spec disconnect(#ssh_msg_disconnect{}) -> no_return().
+-spec disconnect(#ssh_msg_disconnect{}, iodata()) -> no_return().
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+disconnect(Msg = #ssh_msg_disconnect{}) ->
+ throw({keep_state_and_data,
+ [{next_event, internal, {disconnect, Msg, Msg#ssh_msg_disconnect.description}}]}).
-start_link(Role, Socket, Options) ->
- {ok, proc_lib:spawn_link(?MODULE, init, [[Role, Socket, Options]])}.
+disconnect(Msg = #ssh_msg_disconnect{}, ExtraInfo) ->
+ throw({keep_state_and_data,
+ [{next_event, internal, {disconnect, Msg, {Msg#ssh_msg_disconnect.description,ExtraInfo}}}]}).
-init([Role, Socket, SshOpts]) ->
- process_flag(trap_exit, true),
- {NumVsn, StrVsn} = ssh_transport:versions(Role, SshOpts),
- {Protocol, Callback, CloseTag} =
- proplists:get_value(transport, SshOpts, {tcp, gen_tcp, tcp_closed}),
- Cache = ssh_channel:cache_create(),
- State0 = #state{
- role = Role,
- connection_state = #connection{channel_cache = Cache,
- channel_id_seed = 0,
- port_bindings = [],
- requests = [],
- options = SshOpts},
- socket = Socket,
- decoded_data_buffer = <<>>,
- encoded_data_buffer = <<>>,
- transport_protocol = Protocol,
- transport_cb = Callback,
- transport_close_tag = CloseTag,
- opts = SshOpts
- },
-
- State = init_role(State0),
-
- try init_ssh(Role, NumVsn, StrVsn, SshOpts, Socket) of
- Ssh ->
- gen_fsm:enter_loop(?MODULE, [], hello,
- State#state{ssh_params = Ssh})
- catch
- _:Error ->
- gen_fsm:enter_loop(?MODULE, [], error, {Error, State})
- end.
-%% Temporary fix for the Nessus error. SYN-> <-SYNACK ACK-> RST-> ?
-error(_Event, {Error,State=#state{}}) ->
- case Error of
- {badmatch,{error,enotconn}} ->
- %% {error,enotconn} probably from inet:peername in
- %% init_ssh(server,..)/5 called from init/1
- {stop, {shutdown,"TCP connenction to server was prematurely closed by the client"}, State};
- _ ->
- {stop, {shutdown,{init,Error}}, State}
- end;
-error(Event, State) ->
- %% State deliberately not checked beeing #state. This is a panic-clause...
- {stop, {shutdown,{init,{spurious_error,Event}}}, State}.
-
-%%--------------------------------------------------------------------
--spec open_channel(pid(), string(), iodata(), integer(), integer(),
- timeout()) -> {open, channel_id()} | {error, term()}.
%%--------------------------------------------------------------------
-open_channel(ConnectionHandler, ChannelType, ChannelSpecificData,
- InitialWindowSize,
- MaxPacketSize, Timeout) ->
- sync_send_all_state_event(ConnectionHandler, {open, self(), ChannelType,
- InitialWindowSize, MaxPacketSize,
- ChannelSpecificData,
- Timeout}).
-%%--------------------------------------------------------------------
--spec request(pid(), pid(), channel_id(), string(), boolean(), iodata(),
- timeout()) -> success | failure | ok | {error, term()}.
+-spec open_channel(connection_ref(),
+ string(),
+ iodata(),
+ pos_integer(),
+ pos_integer(),
+ timeout()
+ ) -> {open, channel_id()} | {error, term()}.
+
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+open_channel(ConnectionHandler,
+ ChannelType, ChannelSpecificData, InitialWindowSize, MaxPacketSize,
+ Timeout) ->
+ call(ConnectionHandler,
+ {open,
+ self(),
+ ChannelType, InitialWindowSize, MaxPacketSize, ChannelSpecificData,
+ Timeout}).
+
%%--------------------------------------------------------------------
+-spec request(connection_ref(),
+ pid(),
+ channel_id(),
+ string(),
+ boolean(),
+ iodata(),
+ timeout()
+ ) -> success | failure | ok | {error,timeout}.
+
+-spec request(connection_ref(),
+ channel_id(),
+ string(),
+ boolean(),
+ iodata(),
+ timeout()
+ ) -> success | failure | ok | {error,timeout}.
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
request(ConnectionHandler, ChannelPid, ChannelId, Type, true, Data, Timeout) ->
- sync_send_all_state_event(ConnectionHandler, {request, ChannelPid, ChannelId, Type, Data,
- Timeout});
+ call(ConnectionHandler, {request, ChannelPid, ChannelId, Type, Data, Timeout});
request(ConnectionHandler, ChannelPid, ChannelId, Type, false, Data, _) ->
- send_all_state_event(ConnectionHandler, {request, ChannelPid, ChannelId, Type, Data}).
+ cast(ConnectionHandler, {request, ChannelPid, ChannelId, Type, Data}).
-%%--------------------------------------------------------------------
--spec request(pid(), channel_id(), string(), boolean(), iodata(),
- timeout()) -> success | failure | {error, timeout}.
-%%--------------------------------------------------------------------
request(ConnectionHandler, ChannelId, Type, true, Data, Timeout) ->
- sync_send_all_state_event(ConnectionHandler, {request, ChannelId, Type, Data, Timeout});
+ call(ConnectionHandler, {request, ChannelId, Type, Data, Timeout});
request(ConnectionHandler, ChannelId, Type, false, Data, _) ->
- send_all_state_event(ConnectionHandler, {request, ChannelId, Type, Data}).
+ cast(ConnectionHandler, {request, ChannelId, Type, Data}).
%%--------------------------------------------------------------------
--spec reply_request(pid(), success | failure, channel_id()) -> ok.
-%%--------------------------------------------------------------------
+-spec reply_request(connection_ref(),
+ success | failure,
+ channel_id()
+ ) -> ok.
+
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
reply_request(ConnectionHandler, Status, ChannelId) ->
- send_all_state_event(ConnectionHandler, {reply_request, Status, ChannelId}).
-
-%%--------------------------------------------------------------------
--spec global_request(pid(), string(), boolean(), iolist()) -> ok | error.
-%%--------------------------------------------------------------------
-global_request(ConnectionHandler, Type, true = Reply, Data) ->
- case sync_send_all_state_event(ConnectionHandler,
- {global_request, self(), Type, Reply, Data}) of
- {ssh_cm, ConnectionHandler, {success, _}} ->
- ok;
- {ssh_cm, ConnectionHandler, {failure, _}} ->
- error
- end;
-global_request(ConnectionHandler, Type, false = Reply, Data) ->
- send_all_state_event(ConnectionHandler, {global_request, self(), Type, Reply, Data}).
+ cast(ConnectionHandler, {reply_request, Status, ChannelId}).
%%--------------------------------------------------------------------
--spec send(pid(), channel_id(), integer(), iodata(), timeout()) ->
- ok | {error, timeout} | {error, closed}.
-%%--------------------------------------------------------------------
+-spec send(connection_ref(),
+ channel_id(),
+ non_neg_integer(),
+ iodata(),
+ timeout()
+ ) -> ok | {error, timeout|closed}.
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
send(ConnectionHandler, ChannelId, Type, Data, Timeout) ->
- sync_send_all_state_event(ConnectionHandler, {data, ChannelId, Type, Data, Timeout}).
+ call(ConnectionHandler, {data, ChannelId, Type, Data, Timeout}).
%%--------------------------------------------------------------------
--spec send_eof(pid(), channel_id()) -> ok | {error, closed}.
-%%--------------------------------------------------------------------
+-spec send_eof(connection_ref(),
+ channel_id()
+ ) -> ok | {error,closed}.
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
send_eof(ConnectionHandler, ChannelId) ->
- sync_send_all_state_event(ConnectionHandler, {eof, ChannelId}).
+ call(ConnectionHandler, {eof, ChannelId}).
%%--------------------------------------------------------------------
--spec connection_info(pid(), [atom()]) -> proplists:proplist().
+-spec info(connection_ref()
+ ) -> {ok, [#channel{}]} .
+
+-spec info(connection_ref(),
+ pid() | all
+ ) -> {ok, [#channel{}]} .
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+info(ConnectionHandler) ->
+ info(ConnectionHandler, all).
+
+info(ConnectionHandler, ChannelProcess) ->
+ call(ConnectionHandler, {info, ChannelProcess}).
+
%%--------------------------------------------------------------------
+-type local_sock_info() :: {inet:ip_address(), non_neg_integer()} | string().
+-type peer_sock_info() :: {inet:ip_address(), non_neg_integer()} | string().
+-type state_info() :: iolist().
+
+-spec get_print_info(connection_ref()
+ ) -> {{local_sock_info(), peer_sock_info()},
+ state_info()
+ }.
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
get_print_info(ConnectionHandler) ->
- sync_send_all_state_event(ConnectionHandler, get_print_info, 1000).
+ call(ConnectionHandler, get_print_info, 1000).
+%%--------------------------------------------------------------------
+-spec connection_info(connection_ref(),
+ [atom()]
+ ) -> proplists:proplist().
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
connection_info(ConnectionHandler, Options) ->
- sync_send_all_state_event(ConnectionHandler, {connection_info, Options}).
+ call(ConnectionHandler, {connection_info, Options}).
%%--------------------------------------------------------------------
--spec channel_info(pid(), channel_id(), [atom()]) -> proplists:proplist().
-%%--------------------------------------------------------------------
+-spec channel_info(connection_ref(),
+ channel_id(),
+ [atom()]
+ ) -> proplists:proplist().
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
channel_info(ConnectionHandler, ChannelId, Options) ->
- sync_send_all_state_event(ConnectionHandler, {channel_info, ChannelId, Options}).
+ call(ConnectionHandler, {channel_info, ChannelId, Options}).
%%--------------------------------------------------------------------
--spec adjust_window(pid(), channel_id(), integer()) -> ok.
-%%--------------------------------------------------------------------
+-spec adjust_window(connection_ref(),
+ channel_id(),
+ integer()
+ ) -> ok.
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
adjust_window(ConnectionHandler, Channel, Bytes) ->
- send_all_state_event(ConnectionHandler, {adjust_window, Channel, Bytes}).
-%%--------------------------------------------------------------------
--spec renegotiate(pid()) -> ok.
-%%--------------------------------------------------------------------
-renegotiate(ConnectionHandler) ->
- send_all_state_event(ConnectionHandler, renegotiate).
-
-%%--------------------------------------------------------------------
--spec renegotiate_data(pid()) -> ok.
-%%--------------------------------------------------------------------
-renegotiate_data(ConnectionHandler) ->
- send_all_state_event(ConnectionHandler, data_size).
+ cast(ConnectionHandler, {adjust_window, Channel, Bytes}).
%%--------------------------------------------------------------------
--spec close(pid(), channel_id()) -> ok.
-%%--------------------------------------------------------------------
+-spec close(connection_ref(),
+ channel_id()
+ ) -> ok.
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
close(ConnectionHandler, ChannelId) ->
- case sync_send_all_state_event(ConnectionHandler, {close, ChannelId}) of
+ case call(ConnectionHandler, {close, ChannelId}) of
ok ->
ok;
- {error, closed} ->
+ {error, closed} ->
ok
- end.
-
-%%--------------------------------------------------------------------
--spec stop(pid()) -> ok | {error, term()}.
-%%--------------------------------------------------------------------
-stop(ConnectionHandler)->
- case sync_send_all_state_event(ConnectionHandler, stop) of
- {error, closed} ->
- ok;
- Other ->
- Other
end.
-info(ConnectionHandler) ->
- info(ConnectionHandler, {info, all}).
+%%====================================================================
+%% Test support
+%%====================================================================
+%%--------------------------------------------------------------------
+-spec renegotiate(connection_ref()
+ ) -> ok.
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+renegotiate(ConnectionHandler) ->
+ cast(ConnectionHandler, renegotiate).
-info(ConnectionHandler, ChannelProcess) ->
- sync_send_all_state_event(ConnectionHandler, {info, ChannelProcess}).
+%%--------------------------------------------------------------------
+-spec renegotiate_data(connection_ref()
+ ) -> ok.
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+renegotiate_data(ConnectionHandler) ->
+ cast(ConnectionHandler, data_size).
%%====================================================================
-%% gen_fsm callbacks
+%% Internal process state
%%====================================================================
+-record(data, {
+ starter :: pid(),
+ auth_user :: string()
+ | undefined,
+ connection_state :: #connection{},
+ latest_channel_id = 0 :: non_neg_integer(),
+ idle_timer_ref :: undefined
+ | infinity
+ | reference(),
+ idle_timer_value = infinity :: infinity
+ | pos_integer(),
+ transport_protocol :: atom(), % ex: tcp
+ transport_cb :: atom(), % ex: gen_tcp
+ transport_close_tag :: atom(), % ex: tcp_closed
+ ssh_params :: #ssh{}
+ | undefined,
+ socket :: inet:socket(),
+ decrypted_data_buffer = <<>> :: binary(),
+ encrypted_data_buffer = <<>> :: binary(),
+ undecrypted_packet_length :: undefined | non_neg_integer(),
+ key_exchange_init_msg :: #ssh_msg_kexinit{}
+ | undefined,
+ last_size_rekey = 0 :: non_neg_integer(),
+ event_queue = [] :: list(),
+ opts :: proplists:proplist(),
+ inet_initial_recbuf_size :: pos_integer()
+ | undefined
+ }).
+%%====================================================================
+%% Intitialisation
+%%====================================================================
%%--------------------------------------------------------------------
--spec hello(socket_control | {info_line, list()} | {version_exchange, list()},
- #state{}) -> gen_fsm_state_return().
+-spec init_connection_handler(role(),
+ inet:socket(),
+ proplists:proplist()
+ ) -> no_return().
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+init_connection_handler(Role, Socket, Opts) ->
+ process_flag(trap_exit, true),
+ S0 = init_process_state(Role, Socket, Opts),
+ try
+ {Protocol, Callback, CloseTag} =
+ proplists:get_value(transport, Opts, ?DefaultTransport),
+ S0#data{ssh_params = init_ssh_record(Role, Socket, Opts),
+ transport_protocol = Protocol,
+ transport_cb = Callback,
+ transport_close_tag = CloseTag
+ }
+ of
+ S ->
+ gen_statem:enter_loop(?MODULE,
+ [], %%[{debug,[trace,log,statistics,debug]} || Role==server],
+ handle_event_function,
+ {hello,Role},
+ S)
+ catch
+ _:Error ->
+ gen_statem:enter_loop(?MODULE,
+ [],
+ handle_event_function,
+ {init_error,Error},
+ S0)
+ end.
+
+
+init_process_state(Role, Socket, Opts) ->
+ D = #data{connection_state =
+ C = #connection{channel_cache = ssh_channel:cache_create(),
+ channel_id_seed = 0,
+ port_bindings = [],
+ requests = [],
+ options = Opts},
+ starter = proplists:get_value(user_pid, Opts),
+ socket = Socket,
+ opts = Opts
+ },
+ case Role of
+ client ->
+ %% Start the renegotiation timers
+ timer:apply_after(?REKEY_TIMOUT, gen_statem, cast, [self(), renegotiate]),
+ timer:apply_after(?REKEY_DATA_TIMOUT, gen_statem, cast, [self(), data_size]),
+ cache_init_idle_timer(D);
+ server ->
+ D#data{connection_state = init_connection(Role, C, Opts)}
+ end.
+
+
+init_connection(server, C = #connection{}, Opts) ->
+ Sups = proplists:get_value(supervisors, Opts),
+ SystemSup = proplists:get_value(system_sup, Sups),
+ SubSystemSup = proplists:get_value(subsystem_sup, Sups),
+ ConnectionSup = proplists:get_value(connection_sup, Sups),
+ Shell = proplists:get_value(shell, Opts),
+ Exec = proplists:get_value(exec, Opts),
+ CliSpec = proplists:get_value(ssh_cli, Opts, {ssh_cli, [Shell]}),
+ C#connection{cli_spec = CliSpec,
+ exec = Exec,
+ system_supervisor = SystemSup,
+ sub_system_supervisor = SubSystemSup,
+ connection_supervisor = ConnectionSup
+ }.
+
+
+init_ssh_record(Role, Socket, Opts) ->
+ {ok, PeerAddr} = inet:peername(Socket),
+ KeyCb = proplists:get_value(key_cb, Opts, ssh_file),
+ AuthMethods = proplists:get_value(auth_methods, Opts, ?SUPPORTED_AUTH_METHODS),
+ S0 = #ssh{role = Role,
+ key_cb = KeyCb,
+ opts = Opts,
+ userauth_supported_methods = AuthMethods,
+ available_host_keys = supported_host_keys(Role, KeyCb, Opts),
+ random_length_padding = proplists:get_value(max_random_length_padding,
+ Opts,
+ (#ssh{})#ssh.random_length_padding)
+ },
+
+ {Vsn, Version} = ssh_transport:versions(Role, Opts),
+ case Role of
+ client ->
+ PeerName = proplists:get_value(host, Opts),
+ S0#ssh{c_vsn = Vsn,
+ c_version = Version,
+ io_cb = case proplists:get_value(user_interaction, Opts, true) of
+ true -> ssh_io;
+ false -> ssh_no_io
+ end,
+ userauth_quiet_mode = proplists:get_value(quiet_mode, Opts, false),
+ peer = {PeerName, PeerAddr}
+ };
+
+ server ->
+ S0#ssh{s_vsn = Vsn,
+ s_version = Version,
+ io_cb = proplists:get_value(io_cb, Opts, ssh_io),
+ userauth_methods = string:tokens(AuthMethods, ","),
+ kb_tries_left = 3,
+ peer = {undefined, PeerAddr}
+ }
+ end.
+
+
+
+%%====================================================================
+%% gen_statem callbacks
+%%====================================================================
%%--------------------------------------------------------------------
+-type event_content() :: any().
+
+-type renegotiate_flag() :: init | renegotiate.
+
+-type state_name() ::
+ {init_error,any()}
+ | {hello, role()}
+ | {kexinit, role(), renegotiate_flag()}
+ | {key_exchange, role(), renegotiate_flag()}
+ | {key_exchange_dh_gex_init, server, renegotiate_flag()}
+ | {key_exchange_dh_gex_reply, client, renegotiate_flag()}
+ | {new_keys, role()}
+ | {service_request, role()}
+ | {userauth, role()}
+ | {userauth_keyboard_interactive, role()}
+ | {connected, role()}
+ .
+
+-type handle_event_result() :: gen_statem:handle_event_result().
+
+-spec handle_event(gen_statem:event_type(),
+ event_content(),
+ state_name(),
+ #data{}
+ ) -> handle_event_result().
+
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+
+%%% ######## Error in the initialisation ####
+
+handle_event(_, _Event, {init_error,Error}, _) ->
+ case Error of
+ {badmatch,{error,enotconn}} ->
+ %% Handles the abnormal sequence:
+ %% SYN->
+ %% <-SYNACK
+ %% ACK->
+ %% RST->
+ {stop, {shutdown,"TCP connenction to server was prematurely closed by the client"}};
+
+ OtherError ->
+ {stop, {shutdown,{init,OtherError}}}
+ end;
-hello(socket_control, #state{socket = Socket, ssh_params = Ssh} = State) ->
- VsnMsg = ssh_transport:hello_version_msg(string_version(Ssh)),
- send_msg(VsnMsg, State),
- case getopt(recbuf, Socket) of
- {ok, Size} ->
- inet:setopts(Socket, [{packet, line}, {active, once}, {recbuf, ?MAX_PROTO_VERSION}]),
- {next_state, hello, State#state{recbuf = Size}};
- {error, Reason} ->
- {stop, {shutdown, Reason}, State}
+
+%%% ######## {hello, client|server} ####
+%% The very first event that is sent when the we are set as controlling process of Socket
+handle_event(_, socket_control, {hello,_}, D) ->
+ VsnMsg = ssh_transport:hello_version_msg(string_version(D#data.ssh_params)),
+ ok = send_bytes(VsnMsg, D),
+ case inet:getopts(Socket=D#data.socket, [recbuf]) of
+ {ok, [{recbuf,Size}]} ->
+ %% Set the socket to the hello text line handling mode:
+ inet:setopts(Socket, [{packet, line},
+ {active, once},
+ % Expecting the version string which might
+ % be max ?MAX_PROTO_VERSION bytes:
+ {recbuf, ?MAX_PROTO_VERSION},
+ {nodelay,true}]),
+ {keep_state, D#data{inet_initial_recbuf_size=Size}};
+
+ Other ->
+ {stop, {shutdown,{unexpected_getopts_return, Other}}}
end;
-hello({info_line, _Line},#state{role = client, socket = Socket} = State) ->
- %% The server may send info lines before the version_exchange
- inet:setopts(Socket, [{active, once}]),
- {next_state, hello, State};
-
-hello({info_line, _Line},#state{role = server,
- socket = Socket,
- transport_cb = Transport } = State) ->
- %% as openssh
- Transport:send(Socket, "Protocol mismatch."),
- {stop, {shutdown,"Protocol mismatch in version exchange."}, State};
-
-hello({version_exchange, Version}, #state{ssh_params = Ssh0,
- socket = Socket,
- recbuf = Size} = State) ->
+handle_event(_, {info_line,_Line}, {hello,Role}, D) ->
+ case Role of
+ client ->
+ %% The server may send info lines to the client before the version_exchange
+ inet:setopts(D#data.socket, [{active, once}]),
+ keep_state_and_data;
+ server ->
+ %% But the client may NOT send them to the server. Openssh answers with cleartext,
+ %% and so do we
+ ok = send_bytes("Protocol mismatch.", D),
+ {stop, {shutdown,"Protocol mismatch in version exchange. Client sent info lines."}}
+ end;
+
+handle_event(_, {version_exchange,Version}, {hello,Role}, D) ->
{NumVsn, StrVsn} = ssh_transport:handle_hello_version(Version),
- case handle_version(NumVsn, StrVsn, Ssh0) of
+ case handle_version(NumVsn, StrVsn, D#data.ssh_params) of
{ok, Ssh1} ->
- inet:setopts(Socket, [{packet,0}, {mode,binary}, {active, once}, {recbuf, Size}]),
+ %% Since the hello part is finnished correctly, we set the
+ %% socket to the packet handling mode (including recbuf size):
+ inet:setopts(D#data.socket, [{packet,0},
+ {mode,binary},
+ {active, once},
+ {recbuf, D#data.inet_initial_recbuf_size}]),
{KeyInitMsg, SshPacket, Ssh} = ssh_transport:key_exchange_init_msg(Ssh1),
- send_msg(SshPacket, State),
- {next_state, kexinit, next_packet(State#state{ssh_params = Ssh,
- key_exchange_init_msg =
- KeyInitMsg})};
+ ok = send_bytes(SshPacket, D),
+ {next_state, {kexinit,Role,init}, D#data{ssh_params = Ssh,
+ key_exchange_init_msg = KeyInitMsg}};
not_supported ->
- DisconnectMsg =
- #ssh_msg_disconnect{code =
- ?SSH_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED,
- description = "Protocol version " ++ StrVsn
- ++ " not supported",
- language = "en"},
- handle_disconnect(DisconnectMsg, State)
- end.
+ disconnect(
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED,
+ description = ["Protocol version ",StrVsn," not supported"]},
+ {next_state, {hello,Role}, D})
+ end;
-%%--------------------------------------------------------------------
--spec kexinit({#ssh_msg_kexinit{}, binary()}, #state{}) -> gen_fsm_state_return().
-%%--------------------------------------------------------------------
-kexinit({#ssh_msg_kexinit{} = Kex, Payload},
- #state{ssh_params = #ssh{role = Role} = Ssh0,
- key_exchange_init_msg = OwnKex} =
- State) ->
- Ssh1 = ssh_transport:key_init(opposite_role(Role), Ssh0, Payload),
- case ssh_transport:handle_kexinit_msg(Kex, OwnKex, Ssh1) of
- {ok, NextKexMsg, Ssh} when Role == client ->
- send_msg(NextKexMsg, State),
- {next_state, key_exchange,
- next_packet(State#state{ssh_params = Ssh})};
- {ok, Ssh} when Role == server ->
- {next_state, key_exchange,
- next_packet(State#state{ssh_params = Ssh})}
- end.
+
+%%% ######## {kexinit, client|server, init|renegotiate} ####
-%%--------------------------------------------------------------------
--spec key_exchange(#ssh_msg_kexdh_init{} | #ssh_msg_kexdh_reply{} |
- #ssh_msg_kex_dh_gex_group{} | #ssh_msg_kex_dh_gex_request{} |
- #ssh_msg_kex_dh_gex_request{} | #ssh_msg_kex_dh_gex_reply{}, #state{})
- -> gen_fsm_state_return().
-%%--------------------------------------------------------------------
+handle_event(_, {#ssh_msg_kexinit{}=Kex, Payload}, {kexinit,Role,ReNeg},
+ D = #data{key_exchange_init_msg = OwnKex}) ->
+ Ssh1 = ssh_transport:key_init(peer_role(Role), D#data.ssh_params, Payload),
+ Ssh = case ssh_transport:handle_kexinit_msg(Kex, OwnKex, Ssh1) of
+ {ok, NextKexMsg, Ssh2} when Role==client ->
+ ok = send_bytes(NextKexMsg, D),
+ Ssh2;
+ {ok, Ssh2} when Role==server ->
+ Ssh2
+ end,
+ {next_state, {key_exchange,Role,ReNeg}, D#data{ssh_params=Ssh}};
-key_exchange(#ssh_msg_kexdh_init{} = Msg,
- #state{ssh_params = #ssh{role = server} = Ssh0} = State) ->
- case ssh_transport:handle_kexdh_init(Msg, Ssh0) of
- {ok, KexdhReply, Ssh1} ->
- send_msg(KexdhReply, State),
- {ok, NewKeys, Ssh} = ssh_transport:new_keys_message(Ssh1),
- send_msg(NewKeys, State),
- {next_state, new_keys, next_packet(State#state{ssh_params = Ssh})}
- end;
-key_exchange(#ssh_msg_kexdh_reply{} = Msg,
- #state{ssh_params = #ssh{role = client} = Ssh0} = State) ->
- {ok, NewKeys, Ssh} = ssh_transport:handle_kexdh_reply(Msg, Ssh0),
- send_msg(NewKeys, State),
- {next_state, new_keys, next_packet(State#state{ssh_params = Ssh})};
-
-key_exchange(#ssh_msg_kex_dh_gex_request{} = Msg,
- #state{ssh_params = #ssh{role = server} = Ssh0} = State) ->
- {ok, GexGroup, Ssh} = ssh_transport:handle_kex_dh_gex_request(Msg, Ssh0),
- send_msg(GexGroup, State),
- {next_state, key_exchange_dh_gex_init, next_packet(State#state{ssh_params = Ssh})};
-
-key_exchange(#ssh_msg_kex_dh_gex_request_old{} = Msg,
- #state{ssh_params = #ssh{role = server} = Ssh0} = State) ->
- {ok, GexGroup, Ssh} = ssh_transport:handle_kex_dh_gex_request(Msg, Ssh0),
- send_msg(GexGroup, State),
- {next_state, key_exchange_dh_gex_init, next_packet(State#state{ssh_params = Ssh})};
-
-key_exchange(#ssh_msg_kex_dh_gex_group{} = Msg,
- #state{ssh_params = #ssh{role = client} = Ssh0} = State) ->
- {ok, KexGexInit, Ssh} = ssh_transport:handle_kex_dh_gex_group(Msg, Ssh0),
- send_msg(KexGexInit, State),
- {next_state, key_exchange_dh_gex_reply, next_packet(State#state{ssh_params = Ssh})};
-
-key_exchange(#ssh_msg_kex_ecdh_init{} = Msg,
- #state{ssh_params = #ssh{role = server} = Ssh0} = State) ->
- {ok, KexEcdhReply, Ssh1} = ssh_transport:handle_kex_ecdh_init(Msg, Ssh0),
- send_msg(KexEcdhReply, State),
+%%% ######## {key_exchange, client|server, init|renegotiate} ####
+
+%%%---- diffie-hellman
+handle_event(_, #ssh_msg_kexdh_init{} = Msg, {key_exchange,server,ReNeg}, D) ->
+ {ok, KexdhReply, Ssh1} = ssh_transport:handle_kexdh_init(Msg, D#data.ssh_params),
+ ok = send_bytes(KexdhReply, D),
+ {ok, NewKeys, Ssh} = ssh_transport:new_keys_message(Ssh1),
+ ok = send_bytes(NewKeys, D),
+ {next_state, {new_keys,server,ReNeg}, D#data{ssh_params=Ssh}};
+
+handle_event(_, #ssh_msg_kexdh_reply{} = Msg, {key_exchange,client,ReNeg}, D) ->
+ {ok, NewKeys, Ssh} = ssh_transport:handle_kexdh_reply(Msg, D#data.ssh_params),
+ ok = send_bytes(NewKeys, D),
+ {next_state, {new_keys,client,ReNeg}, D#data{ssh_params=Ssh}};
+
+%%%---- diffie-hellman group exchange
+handle_event(_, #ssh_msg_kex_dh_gex_request{} = Msg, {key_exchange,server,ReNeg}, D) ->
+ {ok, GexGroup, Ssh} = ssh_transport:handle_kex_dh_gex_request(Msg, D#data.ssh_params),
+ ok = send_bytes(GexGroup, D),
+ {next_state, {key_exchange_dh_gex_init,server,ReNeg}, D#data{ssh_params=Ssh}};
+
+handle_event(_, #ssh_msg_kex_dh_gex_request_old{} = Msg, {key_exchange,server,ReNeg}, D) ->
+ {ok, GexGroup, Ssh} = ssh_transport:handle_kex_dh_gex_request(Msg, D#data.ssh_params),
+ ok = send_bytes(GexGroup, D),
+ {next_state, {key_exchange_dh_gex_init,server,ReNeg}, D#data{ssh_params=Ssh}};
+
+handle_event(_, #ssh_msg_kex_dh_gex_group{} = Msg, {key_exchange,client,ReNeg}, D) ->
+ {ok, KexGexInit, Ssh} = ssh_transport:handle_kex_dh_gex_group(Msg, D#data.ssh_params),
+ ok = send_bytes(KexGexInit, D),
+ {next_state, {key_exchange_dh_gex_reply,client,ReNeg}, D#data{ssh_params=Ssh}};
+
+%%%---- elliptic curve diffie-hellman
+handle_event(_, #ssh_msg_kex_ecdh_init{} = Msg, {key_exchange,server,ReNeg}, D) ->
+ {ok, KexEcdhReply, Ssh1} = ssh_transport:handle_kex_ecdh_init(Msg, D#data.ssh_params),
+ ok = send_bytes(KexEcdhReply, D),
{ok, NewKeys, Ssh} = ssh_transport:new_keys_message(Ssh1),
- send_msg(NewKeys, State),
- {next_state, new_keys, next_packet(State#state{ssh_params = Ssh})};
+ ok = send_bytes(NewKeys, D),
+ {next_state, {new_keys,server,ReNeg}, D#data{ssh_params=Ssh}};
-key_exchange(#ssh_msg_kex_ecdh_reply{} = Msg,
- #state{ssh_params = #ssh{role = client} = Ssh0} = State) ->
- {ok, NewKeys, Ssh} = ssh_transport:handle_kex_ecdh_reply(Msg, Ssh0),
- send_msg(NewKeys, State),
- {next_state, new_keys, next_packet(State#state{ssh_params = Ssh})}.
+handle_event(_, #ssh_msg_kex_ecdh_reply{} = Msg, {key_exchange,client,ReNeg}, D) ->
+ {ok, NewKeys, Ssh} = ssh_transport:handle_kex_ecdh_reply(Msg, D#data.ssh_params),
+ ok = send_bytes(NewKeys, D),
+ {next_state, {new_keys,client,ReNeg}, D#data{ssh_params=Ssh}};
-%%--------------------------------------------------------------------
--spec key_exchange_dh_gex_init(#ssh_msg_kex_dh_gex_init{}, #state{}) -> gen_fsm_state_return().
-%%--------------------------------------------------------------------
-key_exchange_dh_gex_init(#ssh_msg_kex_dh_gex_init{} = Msg,
- #state{ssh_params = #ssh{role = server} = Ssh0} = State) ->
- {ok, KexGexReply, Ssh1} = ssh_transport:handle_kex_dh_gex_init(Msg, Ssh0),
- send_msg(KexGexReply, State),
+
+%%% ######## {key_exchange_dh_gex_init, server, init|renegotiate} ####
+
+handle_event(_, #ssh_msg_kex_dh_gex_init{} = Msg, {key_exchange_dh_gex_init,server,ReNeg}, D) ->
+ {ok, KexGexReply, Ssh1} = ssh_transport:handle_kex_dh_gex_init(Msg, D#data.ssh_params),
+ ok = send_bytes(KexGexReply, D),
{ok, NewKeys, Ssh} = ssh_transport:new_keys_message(Ssh1),
- send_msg(NewKeys, State),
- {next_state, new_keys, next_packet(State#state{ssh_params = Ssh})}.
+ ok = send_bytes(NewKeys, D),
+ {next_state, {new_keys,server,ReNeg}, D#data{ssh_params=Ssh}};
-%%--------------------------------------------------------------------
--spec key_exchange_dh_gex_reply(#ssh_msg_kex_dh_gex_reply{}, #state{}) -> gen_fsm_state_return().
-%%--------------------------------------------------------------------
-key_exchange_dh_gex_reply(#ssh_msg_kex_dh_gex_reply{} = Msg,
- #state{ssh_params = #ssh{role = client} = Ssh0} = State) ->
- {ok, NewKeys, Ssh1} = ssh_transport:handle_kex_dh_gex_reply(Msg, Ssh0),
- send_msg(NewKeys, State),
- {next_state, new_keys, next_packet(State#state{ssh_params = Ssh1})}.
-%%--------------------------------------------------------------------
--spec new_keys(#ssh_msg_newkeys{}, #state{}) -> gen_fsm_state_return().
-%%--------------------------------------------------------------------
+%%% ######## {key_exchange_dh_gex_reply, client, init|renegotiate} ####
-new_keys(#ssh_msg_newkeys{} = Msg, #state{ssh_params = Ssh0} = State0) ->
- {ok, Ssh} = ssh_transport:handle_new_keys(Msg, Ssh0),
- after_new_keys(next_packet(State0#state{ssh_params = Ssh})).
+handle_event(_, #ssh_msg_kex_dh_gex_reply{} = Msg, {key_exchange_dh_gex_reply,client,ReNeg}, D) ->
+ {ok, NewKeys, Ssh1} = ssh_transport:handle_kex_dh_gex_reply(Msg, D#data.ssh_params),
+ ok = send_bytes(NewKeys, D),
+ {next_state, {new_keys,client,ReNeg}, D#data{ssh_params=Ssh1}};
-%%--------------------------------------------------------------------
--spec service_request(#ssh_msg_service_request{} | #ssh_msg_service_accept{},
- #state{}) -> gen_fsm_state_return().
-%%--------------------------------------------------------------------
-service_request(#ssh_msg_service_request{name = "ssh-userauth"} = Msg,
- #state{ssh_params = #ssh{role = server,
- session_id = SessionId} = Ssh0} = State) ->
- {ok, {Reply, Ssh}} = ssh_auth:handle_userauth_request(Msg, SessionId, Ssh0),
- send_msg(Reply, State),
- {next_state, userauth, next_packet(State#state{ssh_params = Ssh})};
-
-service_request(#ssh_msg_service_accept{name = "ssh-userauth"},
- #state{ssh_params = #ssh{role = client,
- service = "ssh-userauth"} = Ssh0} =
- State) ->
+
+%%% ######## {new_keys, client|server} ####
+
+%% First key exchange round:
+handle_event(_, #ssh_msg_newkeys{} = Msg, {new_keys,Role,init}, D) ->
+ {ok, Ssh1} = ssh_transport:handle_new_keys(Msg, D#data.ssh_params),
+ Ssh = case Role of
+ client ->
+ {MsgReq, Ssh2} = ssh_auth:service_request_msg(Ssh1),
+ ok = send_bytes(MsgReq, D),
+ Ssh2;
+ server ->
+ Ssh1
+ end,
+ {next_state, {service_request,Role}, D#data{ssh_params=Ssh}};
+
+%% Subsequent key exchange rounds (renegotiation):
+handle_event(_, #ssh_msg_newkeys{}, {new_keys,Role,renegotiate}, D) ->
+ {next_state, {connected,Role}, D};
+
+%%% ######## {service_request, client|server}
+
+handle_event(_, Msg = #ssh_msg_service_request{name=ServiceName}, StateName = {service_request,server}, D) ->
+ case ServiceName of
+ "ssh-userauth" ->
+ Ssh0 = #ssh{session_id=SessionId} = D#data.ssh_params,
+ {ok, {Reply, Ssh}} = ssh_auth:handle_userauth_request(Msg, SessionId, Ssh0),
+ ok = send_bytes(Reply, D),
+ {next_state, {userauth,server}, D#data{ssh_params = Ssh}};
+
+ _ ->
+ disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
+ description = "Unknown service"},
+ StateName, D)
+ end;
+
+handle_event(_, #ssh_msg_service_accept{name = "ssh-userauth"}, {service_request,client},
+ #data{ssh_params = #ssh{service="ssh-userauth"} = Ssh0} = State) ->
{Msg, Ssh} = ssh_auth:init_userauth_request_msg(Ssh0),
- send_msg(Msg, State),
- {next_state, userauth, next_packet(State#state{auth_user = Ssh#ssh.user, ssh_params = Ssh})}.
+ ok = send_bytes(Msg, State),
+ {next_state, {userauth,client}, State#data{auth_user = Ssh#ssh.user, ssh_params = Ssh}};
-%%--------------------------------------------------------------------
--spec userauth(#ssh_msg_userauth_request{} | #ssh_msg_userauth_info_request{} |
- #ssh_msg_userauth_info_response{} | #ssh_msg_userauth_success{} |
- #ssh_msg_userauth_failure{} | #ssh_msg_userauth_banner{},
- #state{}) -> gen_fsm_state_return().
-%%--------------------------------------------------------------------
-userauth(#ssh_msg_userauth_request{service = "ssh-connection",
- method = "none"} = Msg,
- #state{ssh_params = #ssh{session_id = SessionId, role = server,
- service = "ssh-connection"} = Ssh0
- } = State) ->
- {not_authorized, {_User, _Reason}, {Reply, Ssh}} =
- ssh_auth:handle_userauth_request(Msg, SessionId, Ssh0),
- send_msg(Reply, State),
- {next_state, userauth, next_packet(State#state{ssh_params = Ssh})};
-
-userauth(#ssh_msg_userauth_request{service = "ssh-connection",
- method = Method} = Msg,
- #state{ssh_params = #ssh{session_id = SessionId, role = server,
- service = "ssh-connection",
- peer = {_, Address}} = Ssh0,
- opts = Opts, starter = Pid} = State) ->
- case lists:member(Method, Ssh0#ssh.userauth_methods) of
- true ->
- case ssh_auth:handle_userauth_request(Msg, SessionId, Ssh0) of
- {authorized, User, {Reply, Ssh}} ->
- send_msg(Reply, State),
- Pid ! ssh_connected,
- connected_fun(User, Address, Method, Opts),
- {next_state, connected,
- next_packet(State#state{auth_user = User, ssh_params = Ssh#ssh{authenticated = true}})};
- {not_authorized, {User, Reason}, {Reply, Ssh}} when Method == "keyboard-interactive" ->
- retry_fun(User, Address, Reason, Opts),
- send_msg(Reply, State),
- {next_state, userauth_keyboard_interactive, next_packet(State#state{ssh_params = Ssh})};
- {not_authorized, {User, Reason}, {Reply, Ssh}} ->
- retry_fun(User, Address, Reason, Opts),
- send_msg(Reply, State),
- {next_state, userauth, next_packet(State#state{ssh_params = Ssh})}
+
+%%% ######## {userauth, client|server} ####
+
+%%---- userauth request to server
+handle_event(_,
+ Msg = #ssh_msg_userauth_request{service = ServiceName, method = Method},
+ StateName = {userauth,server},
+ D = #data{ssh_params=Ssh0}) ->
+
+ case {ServiceName, Ssh0#ssh.service, Method} of
+ {"ssh-connection", "ssh-connection", "none"} ->
+ %% Probably the very first userauth_request but we deny unauthorized login
+ {not_authorized, _, {Reply,Ssh}} =
+ ssh_auth:handle_userauth_request(Msg, Ssh0#ssh.session_id, Ssh0),
+ ok = send_bytes(Reply, D),
+ {keep_state, D#data{ssh_params = Ssh}};
+
+ {"ssh-connection", "ssh-connection", Method} ->
+ %% Userauth request with a method like "password" or so
+ case lists:member(Method, Ssh0#ssh.userauth_methods) of
+ true ->
+ %% Yepp! we support this method
+ case ssh_auth:handle_userauth_request(Msg, Ssh0#ssh.session_id, Ssh0) of
+ {authorized, User, {Reply, Ssh}} ->
+ ok = send_bytes(Reply, D),
+ D#data.starter ! ssh_connected,
+ connected_fun(User, Method, D),
+ {next_state, {connected,server},
+ D#data{auth_user = User,
+ ssh_params = Ssh#ssh{authenticated = true}}};
+ {not_authorized, {User, Reason}, {Reply, Ssh}} when Method == "keyboard-interactive" ->
+ retry_fun(User, Reason, D),
+ ok = send_bytes(Reply, D),
+ {next_state, {userauth_keyboard_interactive,server}, D#data{ssh_params = Ssh}};
+ {not_authorized, {User, Reason}, {Reply, Ssh}} ->
+ retry_fun(User, Reason, D),
+ ok = send_bytes(Reply, D),
+ {keep_state, D#data{ssh_params = Ssh}}
+ end;
+ false ->
+ %% No we do not support this method (=/= none)
+ %% At least one non-erlang client does like this. Retry as the next event
+ {keep_state_and_data,
+ [{next_event, internal, Msg#ssh_msg_userauth_request{method="none"}}]
+ }
end;
- false ->
- userauth(Msg#ssh_msg_userauth_request{method="none"}, State)
+
+ %% {"ssh-connection", Expected, Method} when Expected =/= ServiceName -> Do what?
+ %% {ServiceName, Expected, Method} when Expected =/= ServiceName -> Do what?
+
+ {ServiceName, _, _} when ServiceName =/= "ssh-connection" ->
+ disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
+ description = "Unknown service"},
+ StateName, D)
end;
-userauth(#ssh_msg_userauth_success{}, #state{ssh_params = #ssh{role = client} = Ssh,
- starter = Pid} = State) ->
- Pid ! ssh_connected,
- {next_state, connected, next_packet(State#state{ssh_params =
- Ssh#ssh{authenticated = true}})};
-userauth(#ssh_msg_userauth_failure{},
- #state{ssh_params = #ssh{role = client,
- userauth_methods = []}}
- = State) ->
- Msg = #ssh_msg_disconnect{code =
- ?SSH_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE,
+%%---- userauth success to client
+handle_event(_, #ssh_msg_userauth_success{}, {userauth,client}, D=#data{ssh_params = Ssh}) ->
+ D#data.starter ! ssh_connected,
+ {next_state, {connected,client}, D#data{ssh_params=Ssh#ssh{authenticated = true}}};
+
+
+%%---- userauth failure response to client
+handle_event(_, #ssh_msg_userauth_failure{}, {userauth,client}=StateName,
+ D = #data{ssh_params = #ssh{userauth_methods = []}}) ->
+ Msg = #ssh_msg_disconnect{code = ?SSH_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE,
description = "Unable to connect using the available"
- " authentication methods",
- language = "en"},
- handle_disconnect(Msg, State);
-
-%% Server tells us which authentication methods that are allowed
-userauth(#ssh_msg_userauth_failure{authentications = Methodes},
- #state{ssh_params = #ssh{role = client,
- userauth_methods = none} = Ssh0} = State) ->
- AuthMethods = string:tokens(Methodes, ","),
- Ssh1 = Ssh0#ssh{userauth_methods = AuthMethods},
+ " authentication methods"},
+ disconnect(Msg, StateName, D);
+
+handle_event(_, #ssh_msg_userauth_failure{authentications = Methods}, StateName={userauth,client},
+ D = #data{ssh_params = Ssh0}) ->
+ %% The prefered authentication method failed try next method
+ Ssh1 = case Ssh0#ssh.userauth_methods of
+ none ->
+ %% Server tells us which authentication methods that are allowed
+ Ssh0#ssh{userauth_methods = string:tokens(Methods, ",")};
+ _ ->
+ %% We already know...
+ Ssh0
+ end,
case ssh_auth:userauth_request_msg(Ssh1) of
{disconnect, DisconnectMsg, {Msg, Ssh}} ->
- send_msg(Msg, State),
- handle_disconnect(DisconnectMsg, State#state{ssh_params = Ssh});
+ send_bytes(Msg, D),
+ disconnect(DisconnectMsg, StateName, D#data{ssh_params = Ssh});
{"keyboard-interactive", {Msg, Ssh}} ->
- send_msg(Msg, State),
- {next_state, userauth_keyboard_interactive, next_packet(State#state{ssh_params = Ssh})};
+ send_bytes(Msg, D),
+ {next_state, {userauth_keyboard_interactive,client}, D#data{ssh_params = Ssh}};
{_Method, {Msg, Ssh}} ->
- send_msg(Msg, State),
- {next_state, userauth, next_packet(State#state{ssh_params = Ssh})}
+ send_bytes(Msg, D),
+ {keep_state, D#data{ssh_params = Ssh}}
end;
-%% The prefered authentication method failed try next method
-userauth(#ssh_msg_userauth_failure{},
- #state{ssh_params = #ssh{role = client} = Ssh0} = State) ->
- case ssh_auth:userauth_request_msg(Ssh0) of
- {disconnect, DisconnectMsg,{Msg, Ssh}} ->
- send_msg(Msg, State),
- handle_disconnect(DisconnectMsg, State#state{ssh_params = Ssh});
- {"keyboard-interactive", {Msg, Ssh}} ->
- send_msg(Msg, State),
- {next_state, userauth_keyboard_interactive, next_packet(State#state{ssh_params = Ssh})};
- {_Method, {Msg, Ssh}} ->
- send_msg(Msg, State),
- {next_state, userauth, next_packet(State#state{ssh_params = Ssh})}
- end;
+%%---- banner to client
+handle_event(_, #ssh_msg_userauth_banner{message = Msg}, {userauth,client}, D) ->
+ case D#data.ssh_params#ssh.userauth_quiet_mode of
+ false -> io:format("~s", [Msg]);
+ true -> ok
+ end,
+ keep_state_and_data;
-userauth(#ssh_msg_userauth_banner{},
- #state{ssh_params = #ssh{userauth_quiet_mode = true,
- role = client}} = State) ->
- {next_state, userauth, next_packet(State)};
-userauth(#ssh_msg_userauth_banner{message = Msg},
- #state{ssh_params =
- #ssh{userauth_quiet_mode = false, role = client}} = State) ->
- io:format("~s", [Msg]),
- {next_state, userauth, next_packet(State)}.
-
-
-
-userauth_keyboard_interactive(#ssh_msg_userauth_info_request{} = Msg,
- #state{ssh_params = #ssh{role = client,
- io_cb = IoCb} = Ssh0} = State) ->
- {ok, {Reply, Ssh}} = ssh_auth:handle_userauth_info_request(Msg, IoCb, Ssh0),
- send_msg(Reply, State),
- {next_state, userauth_keyboard_interactive_info_response, next_packet(State#state{ssh_params = Ssh})};
-
-userauth_keyboard_interactive(#ssh_msg_userauth_info_response{} = Msg,
- #state{ssh_params = #ssh{role = server,
- peer = {_, Address}} = Ssh0,
- opts = Opts, starter = Pid} = State) ->
- case ssh_auth:handle_userauth_info_response(Msg, Ssh0) of
+
+%%% ######## {userauth_keyboard_interactive, client|server}
+
+handle_event(_, #ssh_msg_userauth_info_request{} = Msg, {userauth_keyboard_interactive, client},
+ #data{ssh_params = Ssh0} = D) ->
+ {ok, {Reply, Ssh}} = ssh_auth:handle_userauth_info_request(Msg, Ssh0#ssh.io_cb, Ssh0),
+ send_bytes(Reply, D),
+ {next_state, {userauth_keyboard_interactive_info_response,client}, D#data{ssh_params = Ssh}};
+
+handle_event(_, #ssh_msg_userauth_info_response{} = Msg, {userauth_keyboard_interactive, server}, D) ->
+ case ssh_auth:handle_userauth_info_response(Msg, D#data.ssh_params) of
{authorized, User, {Reply, Ssh}} ->
- send_msg(Reply, State),
- Pid ! ssh_connected,
- connected_fun(User, Address, "keyboard-interactive", Opts),
- {next_state, connected,
- next_packet(State#state{auth_user = User, ssh_params = Ssh#ssh{authenticated = true}})};
+ send_bytes(Reply, D),
+ D#data.starter ! ssh_connected,
+ connected_fun(User, "keyboard-interactive", D),
+ {next_state, {connected,server}, D#data{auth_user = User,
+ ssh_params = Ssh#ssh{authenticated = true}}};
{not_authorized, {User, Reason}, {Reply, Ssh}} ->
- retry_fun(User, Address, Reason, Opts),
- send_msg(Reply, State),
- {next_state, userauth, next_packet(State#state{ssh_params = Ssh})}
+ retry_fun(User, Reason, D),
+ send_bytes(Reply, D),
+ {next_state, {userauth,server}, D#data{ssh_params = Ssh}}
end;
-userauth_keyboard_interactive(Msg = #ssh_msg_userauth_failure{},
- #state{ssh_params = Ssh0 =
- #ssh{role = client,
- userauth_preference = Prefs0}}
- = State) ->
- Prefs = [{Method,M,F,A} || {Method,M,F,A} <- Prefs0,
+
+handle_event(_, Msg = #ssh_msg_userauth_failure{}, {userauth_keyboard_interactive, client},
+ #data{ssh_params = Ssh0} = D0) ->
+ Prefs = [{Method,M,F,A} || {Method,M,F,A} <- Ssh0#ssh.userauth_preference,
Method =/= "keyboard-interactive"],
- userauth(Msg, State#state{ssh_params = Ssh0#ssh{userauth_preference=Prefs}}).
+ D = D0#data{ssh_params = Ssh0#ssh{userauth_preference=Prefs}},
+ {next_state, {userauth,client}, D, [{next_event, internal, Msg}]};
+handle_event(_, Msg=#ssh_msg_userauth_failure{}, {userauth_keyboard_interactive_info_response, client}, D) ->
+ {next_state, {userauth,client}, D, [{next_event, internal, Msg}]};
+handle_event(_, Msg=#ssh_msg_userauth_success{}, {userauth_keyboard_interactive_info_response, client}, D) ->
+ {next_state, {userauth,client}, D, [{next_event, internal, Msg}]};
-userauth_keyboard_interactive_info_response(Msg=#ssh_msg_userauth_failure{},
- #state{ssh_params = #ssh{role = client}} = State) ->
- userauth(Msg, State);
-userauth_keyboard_interactive_info_response(Msg=#ssh_msg_userauth_success{},
- #state{ssh_params = #ssh{role = client}} = State) ->
- userauth(Msg, State);
-userauth_keyboard_interactive_info_response(Msg=#ssh_msg_userauth_info_request{},
- #state{ssh_params = #ssh{role = client}} = State) ->
- userauth_keyboard_interactive(Msg, State).
+handle_event(_, Msg=#ssh_msg_userauth_info_request{}, {userauth_keyboard_interactive_info_response, client}, D) ->
+ {next_state, {userauth_keyboard_interactive,client}, D, [{next_event, internal, Msg}]};
-%%--------------------------------------------------------------------
--spec connected({#ssh_msg_kexinit{}, binary()}, %%| %% #ssh_msg_kexdh_init{},
- #state{}) -> gen_fsm_state_return().
-%%--------------------------------------------------------------------
-connected({#ssh_msg_kexinit{}, _Payload} = Event, #state{ssh_params = Ssh0} = State0) ->
- {KeyInitMsg, SshPacket, Ssh} = ssh_transport:key_exchange_init_msg(Ssh0),
- State = State0#state{ssh_params = Ssh,
- key_exchange_init_msg = KeyInitMsg,
- renegotiate = true},
- send_msg(SshPacket, State),
- kexinit(Event, State).
-%%--------------------------------------------------------------------
--spec handle_event(#ssh_msg_disconnect{} | #ssh_msg_ignore{} | #ssh_msg_debug{} |
- #ssh_msg_unimplemented{} | {adjust_window, integer(), integer()} |
- {reply_request, success | failure, integer()} | renegotiate |
- data_size | {request, pid(), integer(), integer(), iolist()} |
- {request, integer(), integer(), iolist()}, state_name(),
- #state{}) -> gen_fsm_state_return().
+%%% ######## {connected, client|server} ####
-%%--------------------------------------------------------------------
-handle_event(#ssh_msg_disconnect{description = Desc} = DisconnectMsg, _StateName, #state{} = State) ->
- handle_disconnect(peer, DisconnectMsg, State),
- {stop, {shutdown, Desc}, State};
-
-handle_event(#ssh_msg_ignore{}, StateName, State) ->
- {next_state, StateName, next_packet(State)};
-
-handle_event(#ssh_msg_debug{always_display = Display, message = DbgMsg, language=Lang},
- StateName, #state{opts = Opts} = State) ->
- F = proplists:get_value(ssh_msg_debug_fun, Opts,
- fun(_ConnRef, _AlwaysDisplay, _Msg, _Language) -> ok end
- ),
- catch F(self(), Display, DbgMsg, Lang),
- {next_state, StateName, next_packet(State)};
-
-handle_event(#ssh_msg_unimplemented{}, StateName, State) ->
- {next_state, StateName, next_packet(State)};
-
-handle_event(renegotiate, connected, #state{ssh_params = Ssh0}
- = State) ->
- {KeyInitMsg, SshPacket, Ssh} = ssh_transport:key_exchange_init_msg(Ssh0),
- send_msg(SshPacket, State),
- timer:apply_after(?REKEY_TIMOUT, gen_fsm, send_all_state_event, [self(), renegotiate]),
- {next_state, kexinit,
- next_packet(State#state{ssh_params = Ssh,
- key_exchange_init_msg = KeyInitMsg,
- renegotiate = true})};
-
-handle_event(renegotiate, StateName, State) ->
+handle_event(_, {#ssh_msg_kexinit{},_} = Event, {connected,Role}, D0) ->
+ {KeyInitMsg, SshPacket, Ssh} = ssh_transport:key_exchange_init_msg(D0#data.ssh_params),
+ D = D0#data{ssh_params = Ssh,
+ key_exchange_init_msg = KeyInitMsg},
+ send_bytes(SshPacket, D),
+ {next_state, {kexinit,Role,renegotiate}, D, [{next_event, internal, Event}]};
+
+handle_event(_, #ssh_msg_disconnect{description=Desc} = Msg, StateName, D0) ->
+ {disconnect, _, {{replies,Replies}, _}} =
+ ssh_connection:handle_msg(Msg, D0#data.connection_state, role(StateName)),
+ {Actions,D} = send_replies(Replies, D0),
+ disconnect_fun(Desc, D),
+ {stop_and_reply, {shutdown,Desc}, Actions, D};
+
+handle_event(_, #ssh_msg_ignore{}, _, _) ->
+ keep_state_and_data;
+
+handle_event(_, #ssh_msg_unimplemented{}, _, _) ->
+ keep_state_and_data;
+
+handle_event(_, #ssh_msg_debug{} = Msg, _, D) ->
+ debug_fun(Msg, D),
+ keep_state_and_data;
+
+handle_event(internal, Msg=#ssh_msg_global_request{}, StateName, D) ->
+ handle_connection_msg(Msg, StateName, D);
+
+handle_event(internal, Msg=#ssh_msg_request_success{}, StateName, D) ->
+ handle_connection_msg(Msg, StateName, D);
+
+handle_event(internal, Msg=#ssh_msg_request_failure{}, StateName, D) ->
+ handle_connection_msg(Msg, StateName, D);
+
+handle_event(internal, Msg=#ssh_msg_channel_open{}, StateName, D) ->
+ handle_connection_msg(Msg, StateName, D);
+
+handle_event(internal, Msg=#ssh_msg_channel_open_confirmation{}, StateName, D) ->
+ handle_connection_msg(Msg, StateName, D);
+
+handle_event(internal, Msg=#ssh_msg_channel_open_failure{}, StateName, D) ->
+ handle_connection_msg(Msg, StateName, D);
+
+handle_event(internal, Msg=#ssh_msg_channel_window_adjust{}, StateName, D) ->
+ handle_connection_msg(Msg, StateName, D);
+
+handle_event(internal, Msg=#ssh_msg_channel_data{}, StateName, D) ->
+ handle_connection_msg(Msg, StateName, D);
+
+handle_event(internal, Msg=#ssh_msg_channel_extended_data{}, StateName, D) ->
+ handle_connection_msg(Msg, StateName, D);
+
+handle_event(internal, Msg=#ssh_msg_channel_eof{}, StateName, D) ->
+ handle_connection_msg(Msg, StateName, D);
+
+handle_event(internal, Msg=#ssh_msg_channel_close{}, StateName, D) ->
+ handle_connection_msg(Msg, StateName, D);
+
+handle_event(internal, Msg=#ssh_msg_channel_request{}, StateName, D) ->
+ handle_connection_msg(Msg, StateName, D);
+
+handle_event(internal, Msg=#ssh_msg_channel_success{}, StateName, D) ->
+ handle_connection_msg(Msg, StateName, D);
+
+handle_event(internal, Msg=#ssh_msg_channel_failure{}, StateName, D) ->
+ handle_connection_msg(Msg, StateName, D);
+
+
+handle_event(cast, renegotiate, {connected,Role}, D) ->
+ {KeyInitMsg, SshPacket, Ssh} = ssh_transport:key_exchange_init_msg(D#data.ssh_params),
+ send_bytes(SshPacket, D),
+ timer:apply_after(?REKEY_TIMOUT, gen_statem, cast, [self(), renegotiate]),
+ {next_state, {kexinit,Role,renegotiate}, D#data{ssh_params = Ssh,
+ key_exchange_init_msg = KeyInitMsg}};
+
+handle_event(cast, renegotiate, _, _) ->
%% Already in key-exchange so safe to ignore
- {next_state, StateName, State};
+ timer:apply_after(?REKEY_TIMOUT, gen_statem, cast, [self(), renegotiate]), % FIXME: not here in original
+ keep_state_and_data;
+
%% Rekey due to sent data limit reached?
-handle_event(data_size, connected, #state{ssh_params = Ssh0} = State) ->
- {ok, [{send_oct,Sent0}]} = inet:getstat(State#state.socket, [send_oct]),
- Sent = Sent0 - State#state.last_size_rekey,
- MaxSent = proplists:get_value(rekey_limit, State#state.opts, 1024000000),
- timer:apply_after(?REKEY_DATA_TIMOUT, gen_fsm, send_all_state_event, [self(), data_size]),
+handle_event(cast, data_size, {connected,Role}, D) ->
+ {ok, [{send_oct,Sent0}]} = inet:getstat(D#data.socket, [send_oct]),
+ Sent = Sent0 - D#data.last_size_rekey,
+ MaxSent = proplists:get_value(rekey_limit, D#data.opts, 1024000000),
+ timer:apply_after(?REKEY_DATA_TIMOUT, gen_statem, cast, [self(), data_size]),
case Sent >= MaxSent of
true ->
- {KeyInitMsg, SshPacket, Ssh} = ssh_transport:key_exchange_init_msg(Ssh0),
- send_msg(SshPacket, State),
- {next_state, kexinit,
- next_packet(State#state{ssh_params = Ssh,
- key_exchange_init_msg = KeyInitMsg,
- renegotiate = true,
- last_size_rekey = Sent0})};
+ {KeyInitMsg, SshPacket, Ssh} =
+ ssh_transport:key_exchange_init_msg(D#data.ssh_params),
+ send_bytes(SshPacket, D),
+ {next_state, {kexinit,Role,renegotiate}, D#data{ssh_params = Ssh,
+ key_exchange_init_msg = KeyInitMsg,
+ last_size_rekey = Sent0}};
_ ->
- {next_state, connected, next_packet(State)}
+ keep_state_and_data
end;
-handle_event(data_size, StateName, State) ->
+
+handle_event(cast, data_size, _, _) ->
%% Already in key-exchange so safe to ignore
- {next_state, StateName, State};
-
-handle_event(Event, StateName, State) when StateName /= connected ->
- Events = [{event, Event} | State#state.event_queue],
- {next_state, StateName, State#state{event_queue = Events}};
-
-handle_event({adjust_window, ChannelId, Bytes}, StateName,
- #state{connection_state =
- #connection{channel_cache = Cache}} = State0) ->
- State =
- case ssh_channel:cache_lookup(Cache, ChannelId) of
- #channel{recv_window_size = WinSize,
- recv_window_pending = Pending,
- recv_packet_size = PktSize} = Channel
- when (WinSize-Bytes) >= 2*PktSize ->
- %% The peer can send at least two more *full* packet, no hurry.
- ssh_channel:cache_update(Cache,
- Channel#channel{recv_window_pending = Pending + Bytes}),
- State0;
-
- #channel{recv_window_size = WinSize,
- recv_window_pending = Pending,
- remote_id = Id} = Channel ->
- %% Now we have to update the window - we can't receive so many more pkts
- ssh_channel:cache_update(Cache,
- Channel#channel{recv_window_size =
- WinSize + Bytes + Pending,
- recv_window_pending = 0}),
- Msg = ssh_connection:channel_adjust_window_msg(Id, Bytes + Pending),
- send_replies([{connection_reply, Msg}], State0);
+ timer:apply_after(?REKEY_DATA_TIMOUT, gen_statem, cast, [self(), data_size]), % FIXME: not here in original
+ keep_state_and_data;
+
+
+
+handle_event(cast, _, StateName, _) when StateName /= {connected,server},
+ StateName /= {connected,client} ->
+ {keep_state_and_data, [postpone]};
+
+
+handle_event(cast, {adjust_window,ChannelId,Bytes}, {connected,_}, D) ->
+ case ssh_channel:cache_lookup(cache(D), ChannelId) of
+ #channel{recv_window_size = WinSize,
+ recv_window_pending = Pending,
+ recv_packet_size = PktSize} = Channel
+ when (WinSize-Bytes) >= 2*PktSize ->
+ %% The peer can send at least two more *full* packet, no hurry.
+ ssh_channel:cache_update(cache(D),
+ Channel#channel{recv_window_pending = Pending + Bytes}),
+ keep_state_and_data;
+
+ #channel{recv_window_size = WinSize,
+ recv_window_pending = Pending,
+ remote_id = Id} = Channel ->
+ %% Now we have to update the window - we can't receive so many more pkts
+ ssh_channel:cache_update(cache(D),
+ Channel#channel{recv_window_size =
+ WinSize + Bytes + Pending,
+ recv_window_pending = 0}),
+ Msg = ssh_connection:channel_adjust_window_msg(Id, Bytes + Pending),
+ {keep_state, send_msg(Msg,D)};
- undefined ->
- State0
- end,
- {next_state, StateName, next_packet(State)};
-
-handle_event({reply_request, success, ChannelId}, StateName,
- #state{connection_state =
- #connection{channel_cache = Cache}} = State0) ->
- State = case ssh_channel:cache_lookup(Cache, ChannelId) of
- #channel{remote_id = RemoteId} ->
- Msg = ssh_connection:channel_success_msg(RemoteId),
- send_replies([{connection_reply, Msg}], State0);
- undefined ->
- State0
- end,
- {next_state, StateName, State};
-
-handle_event({request, ChannelPid, ChannelId, Type, Data}, StateName, State0) ->
- {{replies, Replies}, State1} = handle_request(ChannelPid, ChannelId,
- Type, Data,
- false, none, State0),
- State = send_replies(Replies, State1),
- {next_state, StateName, next_packet(State)};
-
-handle_event({request, ChannelId, Type, Data}, StateName, State0) ->
- {{replies, Replies}, State1} = handle_request(ChannelId, Type, Data,
- false, none, State0),
- State = send_replies(Replies, State1),
- {next_state, StateName, next_packet(State)};
-
-handle_event({unknown, Data}, StateName, State) ->
+ undefined ->
+ keep_state_and_data
+ end;
+
+handle_event(cast, {reply_request,success,ChannelId}, {connected,_}, D) ->
+ case ssh_channel:cache_lookup(cache(D), ChannelId) of
+ #channel{remote_id = RemoteId} ->
+ Msg = ssh_connection:channel_success_msg(RemoteId),
+ {keep_state, send_msg(Msg,D)};
+
+ undefined ->
+ keep_state_and_data
+ end;
+
+handle_event(cast, {request,ChannelPid, ChannelId, Type, Data}, {connected,_}, D) ->
+ {keep_state, handle_request(ChannelPid, ChannelId, Type, Data, false, none, D)};
+
+handle_event(cast, {request,ChannelId,Type,Data}, {connected,_}, D) ->
+ {keep_state, handle_request(ChannelId, Type, Data, false, none, D)};
+
+handle_event(cast, {unknown,Data}, {connected,_}, D) ->
Msg = #ssh_msg_unimplemented{sequence = Data},
- send_msg(Msg, State),
- {next_state, StateName, next_packet(State)}.
+ {keep_state, send_msg(Msg,D)};
-%%--------------------------------------------------------------------
--spec handle_sync_event({request, pid(), channel_id(), integer(), binary(), timeout()} |
- {request, channel_id(), integer(), binary(), timeout()} |
- {global_request, pid(), integer(), boolean(), binary()} | {eof, integer()} |
- {open, pid(), integer(), channel_id(), integer(), binary(), _} |
- {send_window, channel_id()} | {recv_window, channel_id()} |
- {connection_info, [client_version | server_version | peer |
- sockname]} | {channel_info, channel_id(), [recv_window |
- send_window]} |
- {close, channel_id()} | stop, term(), state_name(), #state{})
- -> gen_fsm_sync_return().
-%%--------------------------------------------------------------------
-handle_sync_event(get_print_info, _From, StateName, State) ->
+%%% Previously handle_sync_event began here
+handle_event({call,From}, get_print_info, StateName, D) ->
Reply =
try
- {inet:sockname(State#state.socket),
- inet:peername(State#state.socket)
+ {inet:sockname(D#data.socket),
+ inet:peername(D#data.socket)
}
of
- {{ok,Local}, {ok,Remote}} -> {{Local,Remote},io_lib:format("statename=~p",[StateName])};
- _ -> {{"-",0},"-"}
+ {{ok,Local}, {ok,Remote}} ->
+ {{Local,Remote},io_lib:format("statename=~p",[StateName])};
+ _ ->
+ {{"-",0},"-"}
catch
- _:_ -> {{"?",0},"?"}
+ _:_ ->
+ {{"?",0},"?"}
end,
- {reply, Reply, StateName, State};
+ {keep_state_and_data, [{reply,From,Reply}]};
-handle_sync_event({connection_info, Options}, _From, StateName, State) ->
- Info = ssh_info(Options, State, []),
- {reply, Info, StateName, State};
+handle_event({call,From}, {connection_info, Options}, _, D) ->
+ Info = ssh_info(Options, D, []),
+ {keep_state_and_data, [{reply,From,Info}]};
-handle_sync_event({channel_info, ChannelId, Options}, _From, StateName,
- #state{connection_state = #connection{channel_cache = Cache}} = State) ->
- case ssh_channel:cache_lookup(Cache, ChannelId) of
- #channel{} = Channel ->
+handle_event({call,From}, {channel_info,ChannelId,Options}, _, D) ->
+ case ssh_channel:cache_lookup(cache(D), ChannelId) of
+ #channel{} = Channel ->
Info = ssh_channel_info(Options, Channel, []),
- {reply, Info, StateName, State};
+ {keep_state_and_data, [{reply,From,Info}]};
undefined ->
- {reply, [], StateName, State}
+ {keep_state_and_data, [{reply,From,[]}]}
end;
-handle_sync_event({info, ChannelPid}, _From, StateName,
- #state{connection_state =
- #connection{channel_cache = Cache}} = State) ->
+
+handle_event({call,From}, {info, all}, _, D) ->
+ Result = ssh_channel:cache_foldl(fun(Channel, Acc) ->
+ [Channel | Acc]
+ end,
+ [], cache(D)),
+ {keep_state_and_data, [{reply, From, {ok,Result}}]};
+
+handle_event({call,From}, {info, ChannelPid}, _, D) ->
Result = ssh_channel:cache_foldl(
- fun(Channel, Acc) when ChannelPid == all;
- Channel#channel.user == ChannelPid ->
+ fun(Channel, Acc) when Channel#channel.user == ChannelPid ->
[Channel | Acc];
(_, Acc) ->
Acc
- end, [], Cache),
- {reply, {ok, Result}, StateName, State};
+ end, [], cache(D)),
+ {keep_state_and_data, [{reply, From, {ok,Result}}]};
-handle_sync_event(stop, _, _StateName, #state{connection_state = Connection0,
- role = Role} = State0) ->
+handle_event({call,From}, stop, StateName, D0) ->
{disconnect, _Reason, {{replies, Replies}, Connection}} =
ssh_connection:handle_msg(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_BY_APPLICATION,
- description = "User closed down connection",
- language = "en"}, Connection0, Role),
- State = send_replies(Replies, State0),
- {stop, normal, ok, State#state{connection_state = Connection}};
-
-
-handle_sync_event(Event, From, StateName, State) when StateName /= connected ->
- Events = [{sync, Event, From} | State#state.event_queue],
- {next_state, StateName, State#state{event_queue = Events}};
-
-handle_sync_event({request, ChannelPid, ChannelId, Type, Data, Timeout}, From, StateName, State0) ->
- {{replies, Replies}, State1} = handle_request(ChannelPid,
- ChannelId, Type, Data,
- true, From, State0),
- %% Note reply to channel will happen later when
- %% reply is recived from peer on the socket
- State = send_replies(Replies, State1),
- start_timeout(ChannelId, From, Timeout),
- handle_idle_timeout(State),
- {next_state, StateName, next_packet(State)};
-
-handle_sync_event({request, ChannelId, Type, Data, Timeout}, From, StateName, State0) ->
- {{replies, Replies}, State1} = handle_request(ChannelId, Type, Data,
- true, From, State0),
- %% Note reply to channel will happen later when
- %% reply is recived from peer on the socket
- State = send_replies(Replies, State1),
- start_timeout(ChannelId, From, Timeout),
- handle_idle_timeout(State),
- {next_state, StateName, next_packet(State)};
-
-handle_sync_event({global_request, Pid, _, _, _} = Request, From, StateName,
- #state{connection_state =
- #connection{channel_cache = Cache}} = State0) ->
- State1 = handle_global_request(Request, State0),
- Channel = ssh_channel:cache_find(Pid, Cache),
- State = add_request(true, Channel#channel.local_id, From, State1),
- {next_state, StateName, next_packet(State)};
-
-handle_sync_event({data, ChannelId, Type, Data, Timeout}, From, StateName,
- #state{connection_state = #connection{channel_cache = _Cache}
- = Connection0} = State0) ->
-
- case ssh_connection:channel_data(ChannelId, Type, Data, Connection0, From) of
- {{replies, Replies}, Connection} ->
- State = send_replies(Replies, State0#state{connection_state = Connection}),
- start_timeout(ChannelId, From, Timeout),
- {next_state, StateName, next_packet(State)};
- {noreply, Connection} ->
- start_timeout(ChannelId, From, Timeout),
- {next_state, StateName, next_packet(State0#state{connection_state = Connection})}
- end;
-
-handle_sync_event({eof, ChannelId}, _From, StateName,
- #state{connection_state =
- #connection{channel_cache = Cache}} = State0) ->
- case ssh_channel:cache_lookup(Cache, ChannelId) of
+ description = "User closed down connection"},
+ D0#data.connection_state,
+ role(StateName)),
+ {Repls,D} = send_replies(Replies, D0),
+ {stop_and_reply, normal, [{reply,From,ok}|Repls], D#data{connection_state=Connection}};
+
+handle_event({call,_}, _, StateName, _) when StateName /= {connected,server},
+ StateName /= {connected,client} ->
+ {keep_state_and_data, [postpone]};
+
+handle_event({call,From}, {request, ChannelPid, ChannelId, Type, Data, Timeout}, {connected,_}, D0) ->
+ D = handle_request(ChannelPid, ChannelId, Type, Data, true, From, D0),
+ %% Note reply to channel will happen later when reply is recived from peer on the socket
+ start_channel_request_timer(ChannelId, From, Timeout),
+ {keep_state, cache_request_idle_timer_check(D)};
+
+handle_event({call,From}, {request, ChannelId, Type, Data, Timeout}, {connected,_}, D0) ->
+ D = handle_request(ChannelId, Type, Data, true, From, D0),
+ %% Note reply to channel will happen later when reply is recived from peer on the socket
+ start_channel_request_timer(ChannelId, From, Timeout),
+ {keep_state, cache_request_idle_timer_check(D)};
+
+handle_event({call,From}, {data, ChannelId, Type, Data, Timeout}, {connected,_}, D0) ->
+ {{replies, Replies}, Connection} =
+ ssh_connection:channel_data(ChannelId, Type, Data, D0#data.connection_state, From),
+ {Repls,D} = send_replies(Replies, D0#data{connection_state = Connection}),
+ start_channel_request_timer(ChannelId, From, Timeout), % FIXME: No message exchange so why?
+ {keep_state, D, Repls};
+
+handle_event({call,From}, {eof, ChannelId}, {connected,_}, D0) ->
+ case ssh_channel:cache_lookup(cache(D0), ChannelId) of
#channel{remote_id = Id, sent_close = false} ->
- State = send_replies([{connection_reply,
- ssh_connection:channel_eof_msg(Id)}], State0),
- {reply, ok, StateName, next_packet(State)};
+ D = send_msg(ssh_connection:channel_eof_msg(Id), D0),
+ {keep_state, D, [{reply,From,ok}]};
_ ->
- {reply, {error,closed}, StateName, State0}
+ {keep_state, D0, [{reply,From,{error,closed}}]}
end;
-handle_sync_event({open, ChannelPid, Type, InitialWindowSize, MaxPacketSize, Data, Timeout},
- From, StateName, #state{connection_state =
- #connection{channel_cache = Cache}} = State0) ->
+handle_event({call,From},
+ {open, ChannelPid, Type, InitialWindowSize, MaxPacketSize, Data, Timeout},
+ {connected,_},
+ D0) ->
erlang:monitor(process, ChannelPid),
- {ChannelId, State1} = new_channel_id(State0),
- Msg = ssh_connection:channel_open_msg(Type, ChannelId,
- InitialWindowSize,
- MaxPacketSize, Data),
- State2 = send_replies([{connection_reply, Msg}], State1),
- Channel = #channel{type = Type,
- sys = "none",
- user = ChannelPid,
- local_id = ChannelId,
- recv_window_size = InitialWindowSize,
- recv_packet_size = MaxPacketSize,
- send_buf = queue:new()
- },
- ssh_channel:cache_update(Cache, Channel),
- State = add_request(true, ChannelId, From, State2),
- start_timeout(ChannelId, From, Timeout),
- {next_state, StateName, next_packet(remove_timer_ref(State))};
-
-handle_sync_event({send_window, ChannelId}, _From, StateName,
- #state{connection_state =
- #connection{channel_cache = Cache}} = State) ->
- Reply = case ssh_channel:cache_lookup(Cache, ChannelId) of
+ {ChannelId, D1} = new_channel_id(D0),
+ D2 = send_msg(ssh_connection:channel_open_msg(Type, ChannelId,
+ InitialWindowSize,
+ MaxPacketSize, Data),
+ D1),
+ ssh_channel:cache_update(cache(D2),
+ #channel{type = Type,
+ sys = "none",
+ user = ChannelPid,
+ local_id = ChannelId,
+ recv_window_size = InitialWindowSize,
+ recv_packet_size = MaxPacketSize,
+ send_buf = queue:new()
+ }),
+ D = add_request(true, ChannelId, From, D2),
+ start_channel_request_timer(ChannelId, From, Timeout),
+ {keep_state, cache_cancel_idle_timer(D)};
+
+handle_event({call,From}, {send_window, ChannelId}, {connected,_}, D) ->
+ Reply = case ssh_channel:cache_lookup(cache(D), ChannelId) of
#channel{send_window_size = WinSize,
send_packet_size = Packsize} ->
{ok, {WinSize, Packsize}};
undefined ->
{error, einval}
end,
- {reply, Reply, StateName, next_packet(State)};
-
-handle_sync_event({recv_window, ChannelId}, _From, StateName,
- #state{connection_state = #connection{channel_cache = Cache}}
- = State) ->
+ {keep_state_and_data, [{reply,From,Reply}]};
- Reply = case ssh_channel:cache_lookup(Cache, ChannelId) of
+handle_event({call,From}, {recv_window, ChannelId}, {connected,_}, D) ->
+ Reply = case ssh_channel:cache_lookup(cache(D), ChannelId) of
#channel{recv_window_size = WinSize,
recv_packet_size = Packsize} ->
{ok, {WinSize, Packsize}};
undefined ->
{error, einval}
end,
- {reply, Reply, StateName, next_packet(State)};
-
-handle_sync_event({close, ChannelId}, _, StateName,
- #state{connection_state =
- #connection{channel_cache = Cache}} = State0) ->
- State =
- case ssh_channel:cache_lookup(Cache, ChannelId) of
- #channel{remote_id = Id} = Channel ->
- State1 = send_replies([{connection_reply,
- ssh_connection:channel_close_msg(Id)}], State0),
- ssh_channel:cache_update(Cache, Channel#channel{sent_close = true}),
- handle_idle_timeout(State1),
- State1;
- undefined ->
- State0
- end,
- {reply, ok, StateName, next_packet(State)}.
+ {keep_state_and_data, [{reply,From,Reply}]};
+
+handle_event({call,From}, {close, ChannelId}, {connected,_}, D0) ->
+ case ssh_channel:cache_lookup(cache(D0), ChannelId) of
+ #channel{remote_id = Id} = Channel ->
+ D1 = send_msg(ssh_connection:channel_close_msg(Id), D0),
+ ssh_channel:cache_update(cache(D1), Channel#channel{sent_close = true}),
+ {keep_state, cache_request_idle_timer_check(D1), [{reply,From,ok}]};
+ undefined ->
+ {keep_state_and_data, [{reply,From,ok}]}
+ end;
-%%--------------------------------------------------------------------
--spec handle_info({atom(), port(), binary()} | {atom(), port()} |
- term (), state_name(), #state{}) -> gen_fsm_state_return().
-%%--------------------------------------------------------------------
-handle_info({Protocol, Socket, "SSH-" ++ _ = Version}, hello,
- #state{socket = Socket,
- transport_protocol = Protocol} = State ) ->
- event({version_exchange, Version}, hello, State);
-
-handle_info({Protocol, Socket, Info}, hello,
- #state{socket = Socket,
- transport_protocol = Protocol} = State) ->
- event({info_line, Info}, hello, State);
-
-handle_info({Protocol, Socket, Data}, StateName,
- #state{socket = Socket,
- transport_protocol = Protocol,
- ssh_params = Ssh0,
- decoded_data_buffer = DecData0,
- encoded_data_buffer = EncData0,
- undecoded_packet_length = RemainingSshPacketLen0} = State0) ->
- Encoded = <<EncData0/binary, Data/binary>>,
- try ssh_transport:handle_packet_part(DecData0, Encoded, RemainingSshPacketLen0, Ssh0)
+%%===== Reception of encrypted bytes, decryption and framing
+handle_event(info, {Proto, Sock, Info}, {hello,_}, #data{socket = Sock,
+ transport_protocol = Proto}) ->
+ case Info of
+ "SSH-" ++ _ ->
+ {keep_state_and_data, [{next_event, internal, {version_exchange,Info}}]};
+ _ ->
+ {keep_state_and_data, [{next_event, internal, {info_line,Info}}]}
+ end;
+
+handle_event(info, {Proto, Sock, NewData}, StateName, D0 = #data{socket = Sock,
+ transport_protocol = Proto}) ->
+ try ssh_transport:handle_packet_part(
+ D0#data.decrypted_data_buffer,
+ <<(D0#data.encrypted_data_buffer)/binary, NewData/binary>>,
+ D0#data.undecrypted_packet_length,
+ D0#data.ssh_params)
of
- {get_more, DecBytes, EncDataRest, RemainingSshPacketLen, Ssh1} ->
- {next_state, StateName,
- next_packet(State0#state{encoded_data_buffer = EncDataRest,
- decoded_data_buffer = DecBytes,
- undecoded_packet_length = RemainingSshPacketLen,
- ssh_params = Ssh1})};
- {decoded, MsgBytes, EncDataRest, Ssh1} ->
- generate_event(MsgBytes, StateName,
- State0#state{ssh_params = Ssh1,
- %% Important to be set for
- %% next_packet
-%%% FIXME: the following three seem to always be set in generate_event!
- decoded_data_buffer = <<>>,
- undecoded_packet_length = undefined,
- encoded_data_buffer = EncDataRest},
- EncDataRest);
+ {packet_decrypted, DecryptedBytes, EncryptedDataRest, Ssh1} ->
+ D = D0#data{ssh_params =
+ Ssh1#ssh{recv_sequence = ssh_transport:next_seqnum(Ssh1#ssh.recv_sequence)},
+ decrypted_data_buffer = <<>>,
+ undecrypted_packet_length = undefined,
+ encrypted_data_buffer = EncryptedDataRest},
+ try
+ ssh_message:decode(set_kex_overload_prefix(DecryptedBytes,D))
+ of
+ Msg = #ssh_msg_kexinit{} ->
+ {keep_state, D, [{next_event, internal, {Msg,DecryptedBytes}},
+ {next_event, internal, prepare_next_packet}
+ ]};
+ Msg ->
+ {keep_state, D, [{next_event, internal, Msg},
+ {next_event, internal, prepare_next_packet}
+ ]}
+ catch
+ _C:_E ->
+ disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
+ description = "Encountered unexpected input"},
+ StateName, D)
+ end;
+
+ {get_more, DecryptedBytes, EncryptedDataRest, RemainingSshPacketLen, Ssh1} ->
+ %% Here we know that there are not enough bytes in
+ %% EncryptedDataRest to use. We must wait for more.
+ inet:setopts(Sock, [{active, once}]),
+ {keep_state, D0#data{encrypted_data_buffer = EncryptedDataRest,
+ decrypted_data_buffer = DecryptedBytes,
+ undecrypted_packet_length = RemainingSshPacketLen,
+ ssh_params = Ssh1}};
+
{bad_mac, Ssh1} ->
- DisconnectMsg =
- #ssh_msg_disconnect{code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
- description = "Bad mac",
- language = ""},
- handle_disconnect(DisconnectMsg, State0#state{ssh_params=Ssh1});
+ disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
+ description = "Bad mac"},
+ StateName, D0#data{ssh_params=Ssh1});
{error, {exceeds_max_size,PacketLen}} ->
- DisconnectMsg =
- #ssh_msg_disconnect{code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
- description = "Bad packet length "
- ++ integer_to_list(PacketLen),
- language = ""},
- handle_disconnect(DisconnectMsg, State0)
+ disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
+ description = "Bad packet length "
+ ++ integer_to_list(PacketLen)},
+ StateName, D0)
catch
- _:_ ->
- DisconnectMsg =
- #ssh_msg_disconnect{code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
- description = "Bad packet",
- language = ""},
- handle_disconnect(DisconnectMsg, State0)
+ _C:_E ->
+ disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
+ description = "Bad packet"},
+ StateName, D0)
end;
-
-handle_info({CloseTag, _Socket}, _StateName,
- #state{transport_close_tag = CloseTag,
- ssh_params = #ssh{role = _Role, opts = _Opts}} = State) ->
- DisconnectMsg =
- #ssh_msg_disconnect{code = ?SSH_DISCONNECT_BY_APPLICATION,
- description = "Connection closed",
- language = "en"},
- handle_disconnect(DisconnectMsg, State);
-
-handle_info({timeout, {_, From} = Request}, Statename,
- #state{connection_state = #connection{requests = Requests} = Connection} = State) ->
+
+
+%%%====
+handle_event(internal, prepare_next_packet, _, D) ->
+ Enough = erlang:max(8, D#data.ssh_params#ssh.decrypt_block_size),
+ case size(D#data.encrypted_data_buffer) of
+ Sz when Sz >= Enough ->
+ self() ! {D#data.transport_protocol, D#data.socket, <<>>};
+ _ ->
+ inet:setopts(D#data.socket, [{active, once}])
+ end,
+ keep_state_and_data;
+
+handle_event(info, {CloseTag,Socket}, StateName,
+ D = #data{socket = Socket,
+ transport_close_tag = CloseTag}) ->
+ disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_BY_APPLICATION,
+ description = "Connection closed"},
+ StateName, D);
+
+handle_event(info, {timeout, {_, From} = Request}, _,
+ #data{connection_state = #connection{requests = Requests} = C0} = D) ->
case lists:member(Request, Requests) of
true ->
- gen_fsm:reply(From, {error, timeout}),
- {next_state, Statename,
- State#state{connection_state =
- Connection#connection{requests =
- lists:delete(Request, Requests)}}};
+ %% A channel request is not answered in time. Answer {error,timeout}
+ %% to the caller
+ C = C0#connection{requests = lists:delete(Request, Requests)},
+ {keep_state, D#data{connection_state=C}, [{reply,From,{error,timeout}}]};
false ->
- {next_state, Statename, State}
+ %% The request is answered - just ignore the timeout
+ keep_state_and_data
end;
%%% Handle that ssh channels user process goes down
-handle_info({'DOWN', _Ref, process, ChannelPid, _Reason}, Statename, State0) ->
- {{replies, Replies}, State1} = handle_channel_down(ChannelPid, State0),
- State = send_replies(Replies, State1),
- {next_state, Statename, next_packet(State)};
+handle_event(info, {'DOWN', _Ref, process, ChannelPid, _Reason}, _, D0) ->
+ {{replies, Replies}, D1} = handle_channel_down(ChannelPid, D0),
+ {Repls, D} = send_replies(Replies, D1),
+ {keep_state, D, Repls};
%%% So that terminate will be run when supervisor is shutdown
-handle_info({'EXIT', _Sup, Reason}, _StateName, State) ->
- {stop, {shutdown, Reason}, State};
+handle_event(info, {'EXIT', _Sup, Reason}, _, _) ->
+ {stop, {shutdown, Reason}};
-handle_info({check_cache, _ , _},
- StateName, #state{connection_state =
- #connection{channel_cache = Cache}} = State) ->
- {next_state, StateName, check_cache(State, Cache)};
+handle_event(info, check_cache, _, D) ->
+ {keep_state, cache_check_set_idle_timer(D)};
-handle_info(UnexpectedMessage, StateName, #state{opts = Opts,
- ssh_params = SshParams} = State) ->
- case unexpected_fun(UnexpectedMessage, Opts, SshParams) of
+handle_event(info, UnexpectedMessage, StateName, D = #data{ssh_params = Ssh}) ->
+ case unexpected_fun(UnexpectedMessage, D) of
report ->
Msg = lists:flatten(
io_lib:format(
"Unexpected message '~p' received in state '~p'\n"
"Role: ~p\n"
"Peer: ~p\n"
- "Local Address: ~p\n", [UnexpectedMessage, StateName,
- SshParams#ssh.role, SshParams#ssh.peer,
- proplists:get_value(address, SshParams#ssh.opts)])),
- error_logger:info_report(Msg);
+ "Local Address: ~p\n", [UnexpectedMessage,
+ StateName,
+ Ssh#ssh.role,
+ Ssh#ssh.peer,
+ proplists:get_value(address, Ssh#ssh.opts)])),
+ error_logger:info_report(Msg),
+ keep_state_and_data;
skip ->
- ok;
+ keep_state_and_data;
Other ->
Msg = lists:flatten(
@@ -1103,200 +1269,181 @@ handle_info(UnexpectedMessage, StateName, #state{opts = Opts,
"Message: ~p\n"
"Role: ~p\n"
"Peer: ~p\n"
- "Local Address: ~p\n", [Other, UnexpectedMessage,
- SshParams#ssh.role,
- element(2,SshParams#ssh.peer),
- proplists:get_value(address, SshParams#ssh.opts)]
+ "Local Address: ~p\n", [Other,
+ UnexpectedMessage,
+ Ssh#ssh.role,
+ element(2,Ssh#ssh.peer),
+ proplists:get_value(address, Ssh#ssh.opts)]
)),
+ error_logger:error_report(Msg),
+ keep_state_and_data
+ end;
+
+handle_event(internal, {disconnect,Msg,_Reason}, StateName, D) ->
+ disconnect(Msg, StateName, D);
+
+handle_event(Type, Ev, StateName, D) ->
+ Descr =
+ case catch atom_to_list(element(1,Ev)) of
+ "ssh_msg_" ++_ when Type==internal ->
+ "Message in wrong state";
+ _ ->
+ "Internal error"
+ end,
+ disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
+ description = Descr},
+ StateName, D).
- error_logger:error_report(Msg)
- end,
- {next_state, StateName, State}.
%%--------------------------------------------------------------------
--spec terminate(Reason::term(), state_name(), #state{}) -> _.
-%%--------------------------------------------------------------------
-terminate(normal, _, #state{transport_cb = Transport,
- connection_state = Connection,
- socket = Socket}) ->
- terminate_subsystem(Connection),
- (catch Transport:close(Socket)),
- ok;
+-spec terminate(any(),
+ state_name(),
+ #data{}
+ ) -> finalize_termination_result() .
+
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+
+terminate(normal, StateName, State) ->
+ finalize_termination(StateName, State);
terminate({shutdown,{init,Reason}}, StateName, State) ->
error_logger:info_report(io_lib:format("Erlang ssh in connection handler init: ~p~n",[Reason])),
- terminate(normal, StateName, State);
-
-%% Terminated by supervisor
-terminate(shutdown, StateName, #state{ssh_params = Ssh0} = State) ->
- DisconnectMsg =
- #ssh_msg_disconnect{code = ?SSH_DISCONNECT_BY_APPLICATION,
- description = "Application shutdown",
- language = "en"},
- {SshPacket, Ssh} = ssh_transport:ssh_packet(DisconnectMsg, Ssh0),
- send_msg(SshPacket, State),
- terminate(normal, StateName, State#state{ssh_params = Ssh});
-
-terminate({shutdown, #ssh_msg_disconnect{} = Msg}, StateName,
- #state{ssh_params = Ssh0} = State) ->
- {SshPacket, Ssh} = ssh_transport:ssh_packet(Msg, Ssh0),
- send_msg(SshPacket, State),
- terminate(normal, StateName, State#state{ssh_params = Ssh});
-
-terminate({shutdown, _}, StateName, State) ->
- terminate(normal, StateName, State);
-
-terminate(Reason, StateName, #state{ssh_params = Ssh0, starter = _Pid,
- connection_state = Connection} = State) ->
- terminate_subsystem(Connection),
+ finalize_termination(StateName, State);
+
+terminate(shutdown, StateName, State0) ->
+ %% Terminated by supervisor
+ State = send_msg(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_BY_APPLICATION,
+ description = "Application shutdown"},
+ State0),
+timer:sleep(400), %% FIXME!!! gen_tcp:shutdown instead
+ finalize_termination(StateName, State);
+
+%% terminate({shutdown,Msg}, StateName, State0) when is_record(Msg,ssh_msg_disconnect)->
+%% State = send_msg(Msg, State0),
+%% timer:sleep(400), %% FIXME!!! gen_tcp:shutdown instead
+%% finalize_termination(StateName, Msg, State);
+
+terminate({shutdown,_R}, StateName, State) ->
+ finalize_termination(StateName, State);
+
+terminate(Reason, StateName, State0) ->
+ %% Others, e.g undef, {badmatch,_}
log_error(Reason),
- DisconnectMsg =
- #ssh_msg_disconnect{code = ?SSH_DISCONNECT_BY_APPLICATION,
- description = "Internal error",
- language = "en"},
- {SshPacket, Ssh} = ssh_transport:ssh_packet(DisconnectMsg, Ssh0),
- send_msg(SshPacket, State),
- terminate(normal, StateName, State#state{ssh_params = Ssh}).
-
-
-terminate_subsystem(#connection{system_supervisor = SysSup,
- sub_system_supervisor = SubSysSup}) when is_pid(SubSysSup) ->
- ssh_system_sup:stop_subsystem(SysSup, SubSysSup);
-terminate_subsystem(_) ->
- ok.
-
-format_status(normal, [_, State]) ->
- [{data, [{"StateData", State}]}];
-format_status(terminate, [_, State]) ->
- SshParams0 = (State#state.ssh_params),
- SshParams = SshParams0#ssh{c_keyinit = "***",
- s_keyinit = "***",
- send_mac_key = "***",
- send_mac_size = "***",
- recv_mac_key = "***",
- recv_mac_size = "***",
- encrypt_keys = "***",
- encrypt_ctx = "***",
- decrypt_keys = "***",
- decrypt_ctx = "***",
- compress_ctx = "***",
- decompress_ctx = "***",
- shared_secret = "***",
- exchanged_hash = "***",
- session_id = "***",
- keyex_key = "***",
- keyex_info = "***",
- available_host_keys = "***"},
- [{data, [{"StateData", State#state{decoded_data_buffer = "***",
- encoded_data_buffer = "***",
- key_exchange_init_msg = "***",
- opts = "***",
- recbuf = "***",
- ssh_params = SshParams
- }}]}].
+ State = send_msg(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_BY_APPLICATION,
+ description = "Internal error"},
+ State0),
+ finalize_termination(StateName, State).
%%--------------------------------------------------------------------
--spec code_change(OldVsn::term(), state_name(), Oldstate::term(), Extra::term()) ->
- {ok, state_name(), #state{}}.
+
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+
+format_status(normal, [_, _StateName, D]) ->
+ [{data, [{"State", D}]}];
+format_status(terminate, [_, _StateName, D]) ->
+ DataPropList0 = fmt_stat_rec(record_info(fields, data), D,
+ [decrypted_data_buffer,
+ encrypted_data_buffer,
+ key_exchange_init_msg,
+ user_passwords,
+ opts,
+ inet_initial_recbuf_size]),
+ SshPropList = fmt_stat_rec(record_info(fields, ssh), D#data.ssh_params,
+ [c_keyinit,
+ s_keyinit,
+ send_mac_key,
+ send_mac_size,
+ recv_mac_key,
+ recv_mac_size,
+ encrypt_keys,
+ encrypt_ctx,
+ decrypt_keys,
+ decrypt_ctx,
+ compress_ctx,
+ decompress_ctx,
+ shared_secret,
+ exchanged_hash,
+ session_id,
+ keyex_key,
+ keyex_info,
+ available_host_keys]),
+ DataPropList = lists:keyreplace(ssh_params, 1, DataPropList0,
+ {ssh_params,SshPropList}),
+ [{data, [{"State", DataPropList}]}].
+
+
+fmt_stat_rec(FieldNames, Rec, Exclude) ->
+ Values = tl(tuple_to_list(Rec)),
+ [P || {K,_} = P <- lists:zip(FieldNames, Values),
+ not lists:member(K, Exclude)].
+
%%--------------------------------------------------------------------
+-spec code_change(term() | {down,term()},
+ state_name(),
+ #data{},
+ term()
+ ) -> {gen_statem:callback_mode(), state_name(), #data{}}.
+
+%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+
code_change(_OldVsn, StateName, State, _Extra) ->
- {ok, StateName, State}.
+ {handle_event_function, StateName, State}.
+
+
+%%====================================================================
+%% Internal functions
+%%====================================================================
%%--------------------------------------------------------------------
-%%% Internal functions
-%%--------------------------------------------------------------------
-init_role(#state{role = client, opts = Opts} = State0) ->
- Pid = proplists:get_value(user_pid, Opts),
- TimerRef = get_idle_time(Opts),
- timer:apply_after(?REKEY_TIMOUT, gen_fsm, send_all_state_event, [self(), renegotiate]),
- timer:apply_after(?REKEY_DATA_TIMOUT, gen_fsm, send_all_state_event,
- [self(), data_size]),
- State0#state{starter = Pid,
- idle_timer_ref = TimerRef};
-init_role(#state{role = server, opts = Opts, connection_state = Connection} = State) ->
- Sups = proplists:get_value(supervisors, Opts),
- Pid = proplists:get_value(user_pid, Opts),
- SystemSup = proplists:get_value(system_sup, Sups),
- SubSystemSup = proplists:get_value(subsystem_sup, Sups),
+%% Starting
+
+start_the_connection_child(UserPid, Role, Socket, Options) ->
+ Sups = proplists:get_value(supervisors, Options),
ConnectionSup = proplists:get_value(connection_sup, Sups),
- Shell = proplists:get_value(shell, Opts),
- Exec = proplists:get_value(exec, Opts),
- CliSpec = proplists:get_value(ssh_cli, Opts, {ssh_cli, [Shell]}),
- State#state{starter = Pid, connection_state = Connection#connection{
- cli_spec = CliSpec,
- exec = Exec,
- system_supervisor = SystemSup,
- sub_system_supervisor = SubSystemSup,
- connection_supervisor = ConnectionSup
- }}.
-
-get_idle_time(SshOptions) ->
- case proplists:get_value(idle_time, SshOptions) of
- infinity ->
- infinity;
- _IdleTime -> %% We dont want to set the timeout on first connect
- undefined
- end.
+ Opts = [{supervisors, Sups}, {user_pid, UserPid} | proplists:get_value(ssh_opts, Options, [])],
+ {ok, Pid} = ssh_connection_sup:start_child(ConnectionSup, [Role, Socket, Opts]),
+ ok = socket_control(Socket, Pid, Options),
+ Pid.
-init_ssh(client = Role, Vsn, Version, Options, Socket) ->
- IOCb = case proplists:get_value(user_interaction, Options, true) of
- true ->
- ssh_io;
- false ->
- ssh_no_io
- end,
+%%--------------------------------------------------------------------
+%% Stopping
+-type finalize_termination_result() :: ok .
+
+finalize_termination(_StateName, #data{transport_cb = Transport,
+ connection_state = Connection,
+ socket = Socket}) ->
+ case Connection of
+ #connection{system_supervisor = SysSup,
+ sub_system_supervisor = SubSysSup} when is_pid(SubSysSup) ->
+ ssh_system_sup:stop_subsystem(SysSup, SubSysSup);
+ _ ->
+ do_nothing
+ end,
+ (catch Transport:close(Socket)),
+ ok.
- AuthMethods = proplists:get_value(auth_methods, Options,
- ?SUPPORTED_AUTH_METHODS),
- {ok, PeerAddr} = inet:peername(Socket),
-
- PeerName = proplists:get_value(host, Options),
- KeyCb = proplists:get_value(key_cb, Options, ssh_file),
-
- #ssh{role = Role,
- c_vsn = Vsn,
- c_version = Version,
- key_cb = KeyCb,
- io_cb = IOCb,
- userauth_quiet_mode = proplists:get_value(quiet_mode, Options, false),
- opts = Options,
- userauth_supported_methods = AuthMethods,
- peer = {PeerName, PeerAddr},
- available_host_keys = supported_host_keys(Role, KeyCb, Options),
- random_length_padding = proplists:get_value(max_random_length_padding,
- Options,
- (#ssh{})#ssh.random_length_padding)
- };
-
-init_ssh(server = Role, Vsn, Version, Options, Socket) ->
- AuthMethods = proplists:get_value(auth_methods, Options,
- ?SUPPORTED_AUTH_METHODS),
- AuthMethodsAsList = string:tokens(AuthMethods, ","),
- {ok, PeerAddr} = inet:peername(Socket),
- KeyCb = proplists:get_value(key_cb, Options, ssh_file),
-
- #ssh{role = Role,
- s_vsn = Vsn,
- s_version = Version,
- key_cb = KeyCb,
- io_cb = proplists:get_value(io_cb, Options, ssh_io),
- opts = Options,
- userauth_supported_methods = AuthMethods,
- userauth_methods = AuthMethodsAsList,
- kb_tries_left = 3,
- peer = {undefined, PeerAddr},
- available_host_keys = supported_host_keys(Role, KeyCb, Options),
- random_length_padding = proplists:get_value(max_random_length_padding,
- Options,
- (#ssh{})#ssh.random_length_padding)
- }.
+%%--------------------------------------------------------------------
+%% "Invert" the Role
+peer_role(client) -> server;
+peer_role(server) -> client.
+
+%%--------------------------------------------------------------------
+%% StateName to Role
+role({_,Role}) -> Role;
+role({_,Role,_}) -> Role.
+%%--------------------------------------------------------------------
+%% Check the StateName to see if we are in the renegotiation phase
+renegotiation({_,_,ReNeg}) -> ReNeg == renegotiation;
+renegotiation(_) -> false.
+
+%%--------------------------------------------------------------------
supported_host_keys(client, _, Options) ->
try
- case proplists:get_value(public_key,
+ case proplists:get_value(public_key,
proplists:get_value(preferred_algorithms,Options,[])
) of
- undefined ->
+ undefined ->
ssh_transport:default_algorithms(public_key);
L ->
L -- (L--ssh_transport:default_algorithms(public_key))
@@ -1311,7 +1458,7 @@ supported_host_keys(client, _, Options) ->
{stop, {shutdown, Reason}}
end;
supported_host_keys(server, KeyCb, Options) ->
- [atom_to_list(A) || A <- proplists:get_value(public_key,
+ [atom_to_list(A) || A <- proplists:get_value(public_key,
proplists:get_value(preferred_algorithms,Options,[]),
ssh_transport:default_algorithms(public_key)
),
@@ -1322,10 +1469,16 @@ supported_host_keys(server, KeyCb, Options) ->
available_host_key(KeyCb, Alg, Opts) ->
element(1, catch KeyCb:host_key(Alg, Opts)) == ok.
-send_msg(Msg, #state{socket = Socket, transport_cb = Transport}) ->
- Transport:send(Socket, Msg).
-handle_version({2, 0} = NumVsn, StrVsn, Ssh0) ->
+send_msg(Msg, State=#data{ssh_params=Ssh0}) when is_tuple(Msg) ->
+ {Bytes, Ssh} = ssh_transport:ssh_packet(Msg, Ssh0),
+ send_bytes(Bytes, State),
+ State#data{ssh_params=Ssh}.
+
+send_bytes(Bytes, #data{socket = Socket, transport_cb = Transport}) ->
+ Transport:send(Socket, Bytes).
+
+handle_version({2, 0} = NumVsn, StrVsn, Ssh0) ->
Ssh = counterpart_versions(NumVsn, StrVsn, Ssh0),
{ok, Ssh};
handle_version(_,_,_) ->
@@ -1336,419 +1489,185 @@ string_version(#ssh{role = client, c_version = Vsn}) ->
string_version(#ssh{role = server, s_version = Vsn}) ->
Vsn.
-send_event(FsmPid, Event) ->
- gen_fsm:send_event(FsmPid, Event).
-send_all_state_event(FsmPid, Event) ->
- gen_fsm:send_all_state_event(FsmPid, Event).
+cast(FsmPid, Event) ->
+ gen_statem:cast(FsmPid, Event).
-sync_send_all_state_event(FsmPid, Event) ->
- sync_send_all_state_event(FsmPid, Event, infinity).
+call(FsmPid, Event) ->
+ call(FsmPid, Event, infinity).
-sync_send_all_state_event(FsmPid, Event, Timeout) ->
- try gen_fsm:sync_send_all_state_event(FsmPid, Event, Timeout) of
- {closed, _Channel} ->
+call(FsmPid, Event, Timeout) ->
+ try gen_statem:call(FsmPid, Event, Timeout) of
+ {closed, _R} ->
+ {error, closed};
+ {killed, _R} ->
{error, closed};
Result ->
Result
catch
- exit:{noproc, _} ->
+ exit:{noproc, _R} ->
{error, closed};
- exit:{normal, _} ->
+ exit:{normal, _R} ->
{error, closed};
- exit:{{shutdown, _},_} ->
+ exit:{{shutdown, _R},_} ->
{error, closed}
end.
-%% simulate send_all_state_event(self(), Event)
-event(#ssh_msg_disconnect{} = Event, StateName, State) ->
- handle_event(Event, StateName, State);
-event(#ssh_msg_ignore{} = Event, StateName, State) ->
- handle_event(Event, StateName, State);
-event(#ssh_msg_debug{} = Event, StateName, State) ->
- handle_event(Event, StateName, State);
-event(#ssh_msg_unimplemented{} = Event, StateName, State) ->
- handle_event(Event, StateName, State);
-%% simulate send_event(self(), Event)
-event(Event, StateName, State) ->
- try
- ?MODULE:StateName(Event, State)
+
+handle_connection_msg(Msg, StateName, State0 =
+ #data{starter = User,
+ connection_state = Connection0,
+ event_queue = Qev0}) ->
+ Renegotiation = renegotiation(StateName),
+ Role = role(StateName),
+ try ssh_connection:handle_msg(Msg, Connection0, Role) of
+ {{replies, Replies}, Connection} ->
+ case StateName of
+ {connected,_} ->
+ {Repls, State} = send_replies(Replies,
+ State0#data{connection_state=Connection}),
+ {keep_state, State, Repls};
+ _ ->
+ {ConnReplies, Replies} =
+ lists:splitwith(fun not_connected_filter/1, Replies),
+ {Repls, State} = send_replies(Replies,
+ State0#data{event_queue = Qev0 ++ ConnReplies}),
+ {keep_state, State, Repls}
+ end;
+
+ {noreply, Connection} ->
+ {keep_state, State0#data{connection_state = Connection}};
+
+ {disconnect, Reason0, {{replies, Replies}, Connection}} ->
+ {Repls,State} = send_replies(Replies, State0#data{connection_state = Connection}),
+ case {Reason0,Role} of
+ {{_, Reason}, client} when ((StateName =/= {connected,client}) and (not Renegotiation)) ->
+ User ! {self(), not_connected, Reason};
+ _ ->
+ ok
+ end,
+ {stop_and_reply, {shutdown,normal}, Repls, State#data{connection_state = Connection}}
+
catch
- throw:#ssh_msg_disconnect{} = DisconnectMsg ->
- handle_disconnect(DisconnectMsg, State);
- throw:{ErrorToDisplay, #ssh_msg_disconnect{} = DisconnectMsg} ->
- handle_disconnect(DisconnectMsg, State, ErrorToDisplay);
- _C:_Error ->
- handle_disconnect(#ssh_msg_disconnect{code = error_code(StateName),
- description = "Invalid state",
- language = "en"}, State)
+ _:Error ->
+ {disconnect, _Reason, {{replies, Replies}, Connection}} =
+ ssh_connection:handle_msg(
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_BY_APPLICATION,
+ description = "Internal error"},
+ Connection0, Role),
+ {Repls,State} = send_replies(Replies, State0#data{connection_state = Connection}),
+ {stop_and_reply, {shutdown,Error}, Repls, State#data{connection_state = Connection}}
end.
-error_code(key_exchange) ->
- ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED;
-error_code(new_keys) ->
- ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED;
-error_code(_) ->
- ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE.
-
-generate_event(<<?BYTE(Byte), _/binary>> = Msg, StateName,
- #state{
- role = Role,
- starter = User,
- renegotiate = Renegotiation,
- connection_state = Connection0} = State0, EncData)
- when Byte == ?SSH_MSG_GLOBAL_REQUEST;
- Byte == ?SSH_MSG_REQUEST_SUCCESS;
- Byte == ?SSH_MSG_REQUEST_FAILURE;
- Byte == ?SSH_MSG_CHANNEL_OPEN;
- Byte == ?SSH_MSG_CHANNEL_OPEN_CONFIRMATION;
- Byte == ?SSH_MSG_CHANNEL_OPEN_FAILURE;
- Byte == ?SSH_MSG_CHANNEL_WINDOW_ADJUST;
- Byte == ?SSH_MSG_CHANNEL_DATA;
- Byte == ?SSH_MSG_CHANNEL_EXTENDED_DATA;
- Byte == ?SSH_MSG_CHANNEL_EOF;
- Byte == ?SSH_MSG_CHANNEL_CLOSE;
- Byte == ?SSH_MSG_CHANNEL_REQUEST;
- Byte == ?SSH_MSG_CHANNEL_SUCCESS;
- Byte == ?SSH_MSG_CHANNEL_FAILURE ->
- try
- ssh_message:decode(Msg)
- of
- ConnectionMsg ->
- State1 = generate_event_new_state(State0, EncData),
- try ssh_connection:handle_msg(ConnectionMsg, Connection0, Role) of
- {{replies, Replies0}, Connection} ->
- if StateName == connected ->
- Replies = Replies0,
- State2 = State1;
- true ->
- {ConnReplies, Replies} =
- lists:splitwith(fun not_connected_filter/1, Replies0),
- Q = State1#state.event_queue ++ ConnReplies,
- State2 = State1#state{ event_queue = Q }
- end,
- State = send_replies(Replies, State2#state{connection_state = Connection}),
- {next_state, StateName, next_packet(State)};
- {noreply, Connection} ->
- {next_state, StateName, next_packet(State1#state{connection_state = Connection})};
- {disconnect, {_, Reason}, {{replies, Replies}, Connection}} when
- Role == client andalso ((StateName =/= connected) and (not Renegotiation)) ->
- State = send_replies(Replies, State1#state{connection_state = Connection}),
- User ! {self(), not_connected, Reason},
- {stop, {shutdown, normal},
- next_packet(State#state{connection_state = Connection})};
- {disconnect, _Reason, {{replies, Replies}, Connection}} ->
- State = send_replies(Replies, State1#state{connection_state = Connection}),
- {stop, {shutdown, normal}, State#state{connection_state = Connection}}
- catch
- _:Error ->
- {disconnect, _Reason, {{replies, Replies}, Connection}} =
- ssh_connection:handle_msg(
- #ssh_msg_disconnect{code = ?SSH_DISCONNECT_BY_APPLICATION,
- description = "Internal error",
- language = "en"}, Connection0, Role),
- State = send_replies(Replies, State1#state{connection_state = Connection}),
- {stop, {shutdown, Error}, State#state{connection_state = Connection}}
- end
- catch
- _:_ ->
- handle_disconnect(
- #ssh_msg_disconnect{code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
- description = "Bad packet received",
- language = ""}, State0)
- end;
-generate_event(Msg, StateName, State0, EncData) ->
- try
- Event = ssh_message:decode(set_prefix_if_trouble(Msg,State0)),
- State = generate_event_new_state(State0, EncData),
- case Event of
- #ssh_msg_kexinit{} ->
- %% We need payload for verification later.
- event({Event, Msg}, StateName, State);
- _ ->
- event(Event, StateName, State)
- end
- catch
- _C:_E ->
- DisconnectMsg =
- #ssh_msg_disconnect{code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
- description = "Encountered unexpected input",
- language = "en"},
- handle_disconnect(DisconnectMsg, State0)
- end.
-
-
-set_prefix_if_trouble(Msg = <<?BYTE(Op),_/binary>>, #state{ssh_params=SshParams})
+set_kex_overload_prefix(Msg = <<?BYTE(Op),_/binary>>, #data{ssh_params=SshParams})
when Op == 30;
Op == 31
->
case catch atom_to_list(kex(SshParams)) of
- "ecdh-sha2-" ++ _ ->
+ "ecdh-sha2-" ++ _ ->
<<"ecdh",Msg/binary>>;
"diffie-hellman-group-exchange-" ++ _ ->
<<"dh_gex",Msg/binary>>;
"diffie-hellman-group" ++ _ ->
<<"dh",Msg/binary>>;
- _ ->
+ _ ->
Msg
end;
-set_prefix_if_trouble(Msg, _) ->
+set_kex_overload_prefix(Msg, _) ->
Msg.
kex(#ssh{algorithms=#alg{kex=Kex}}) -> Kex;
kex(_) -> undefined.
+cache(#data{connection_state=C}) -> C#connection.channel_cache.
+
-handle_request(ChannelPid, ChannelId, Type, Data, WantReply, From,
- #state{connection_state =
- #connection{channel_cache = Cache}} = State0) ->
- case ssh_channel:cache_lookup(Cache, ChannelId) of
+%%%----------------------------------------------------------------
+handle_request(ChannelPid, ChannelId, Type, Data, WantReply, From, D) ->
+ case ssh_channel:cache_lookup(cache(D), ChannelId) of
#channel{remote_id = Id} = Channel ->
- update_sys(Cache, Channel, Type, ChannelPid),
- Msg = ssh_connection:channel_request_msg(Id, Type,
- WantReply, Data),
- Replies = [{connection_reply, Msg}],
- State = add_request(WantReply, ChannelId, From, State0),
- {{replies, Replies}, State};
+ update_sys(cache(D), Channel, Type, ChannelPid),
+ send_msg(ssh_connection:channel_request_msg(Id, Type, WantReply, Data),
+ add_request(WantReply, ChannelId, From, D));
undefined ->
- {{replies, []}, State0}
+ D
end.
-handle_request(ChannelId, Type, Data, WantReply, From,
- #state{connection_state =
- #connection{channel_cache = Cache}} = State0) ->
- case ssh_channel:cache_lookup(Cache, ChannelId) of
- #channel{remote_id = Id} ->
- Msg = ssh_connection:channel_request_msg(Id, Type,
- WantReply, Data),
- Replies = [{connection_reply, Msg}],
- State = add_request(WantReply, ChannelId, From, State0),
- {{replies, Replies}, State};
+handle_request(ChannelId, Type, Data, WantReply, From, D) ->
+ case ssh_channel:cache_lookup(cache(D), ChannelId) of
+ #channel{remote_id = Id} ->
+ send_msg(ssh_connection:channel_request_msg(Id, Type, WantReply, Data),
+ add_request(WantReply, ChannelId, From, D));
undefined ->
- {{replies, []}, State0}
- end.
-
-handle_global_request({global_request, ChannelPid,
- "tcpip-forward" = Type, WantReply,
- <<?UINT32(IPLen),
- IP:IPLen/binary, ?UINT32(Port)>> = Data},
- #state{connection_state =
- #connection{channel_cache = Cache}
- = Connection0} = State) ->
- ssh_channel:cache_update(Cache, #channel{user = ChannelPid,
- type = "forwarded-tcpip",
- sys = none}),
- Connection = ssh_connection:bind(IP, Port, ChannelPid, Connection0),
- Msg = ssh_connection:global_request_msg(Type, WantReply, Data),
- send_replies([{connection_reply, Msg}], State#state{connection_state = Connection});
-
-handle_global_request({global_request, _Pid, "cancel-tcpip-forward" = Type,
- WantReply, <<?UINT32(IPLen),
- IP:IPLen/binary, ?UINT32(Port)>> = Data},
- #state{connection_state = Connection0} = State) ->
- Connection = ssh_connection:unbind(IP, Port, Connection0),
- Msg = ssh_connection:global_request_msg(Type, WantReply, Data),
- send_replies([{connection_reply, Msg}], State#state{connection_state = Connection});
-
-handle_global_request({global_request, _, "cancel-tcpip-forward" = Type,
- WantReply, Data}, State) ->
- Msg = ssh_connection:global_request_msg(Type, WantReply, Data),
- send_replies([{connection_reply, Msg}], State).
-
-handle_idle_timeout(#state{opts = Opts}) ->
- case proplists:get_value(idle_time, Opts, infinity) of
- infinity ->
- ok;
- IdleTime ->
- erlang:send_after(IdleTime, self(), {check_cache, [], []})
+ D
end.
-handle_channel_down(ChannelPid, #state{connection_state =
- #connection{channel_cache = Cache}} =
- State) ->
+%%%----------------------------------------------------------------
+handle_channel_down(ChannelPid, D) ->
ssh_channel:cache_foldl(
fun(Channel, Acc) when Channel#channel.user == ChannelPid ->
- ssh_channel:cache_delete(Cache,
+ ssh_channel:cache_delete(cache(D),
Channel#channel.local_id),
Acc;
(_,Acc) ->
Acc
- end, [], Cache),
- {{replies, []}, check_cache(State, Cache)}.
+ end, [], cache(D)),
+ {{replies, []}, cache_check_set_idle_timer(D)}.
+
update_sys(Cache, Channel, Type, ChannelPid) ->
ssh_channel:cache_update(Cache,
Channel#channel{sys = Type, user = ChannelPid}).
+
add_request(false, _ChannelId, _From, State) ->
State;
-add_request(true, ChannelId, From, #state{connection_state =
- #connection{requests = Requests0} =
- Connection} = State) ->
+add_request(true, ChannelId, From, #data{connection_state =
+ #connection{requests = Requests0} =
+ Connection} = State) ->
Requests = [{ChannelId, From} | Requests0],
- State#state{connection_state = Connection#connection{requests = Requests}}.
+ State#data{connection_state = Connection#connection{requests = Requests}}.
-new_channel_id(#state{connection_state = #connection{channel_id_seed = Id} =
- Connection}
+new_channel_id(#data{connection_state = #connection{channel_id_seed = Id} =
+ Connection}
= State) ->
- {Id, State#state{connection_state =
- Connection#connection{channel_id_seed = Id + 1}}}.
-
-generate_event_new_state(#state{ssh_params =
- #ssh{recv_sequence = SeqNum0}
- = Ssh} = State, EncData) ->
- SeqNum = ssh_transport:next_seqnum(SeqNum0),
- State#state{ssh_params = Ssh#ssh{recv_sequence = SeqNum},
- decoded_data_buffer = <<>>,
- encoded_data_buffer = EncData,
- undecoded_packet_length = undefined}.
-
-next_packet(#state{decoded_data_buffer = <<>>,
- encoded_data_buffer = Buff,
- ssh_params = #ssh{decrypt_block_size = BlockSize},
- socket = Socket,
- transport_protocol = Protocol} = State) when Buff =/= <<>> ->
- case size(Buff) >= erlang:max(8, BlockSize) of
- true ->
- %% Enough data from the next packet has been received to
- %% decode the length indicator, fake a socket-recive
- %% message so that the data will be processed
- self() ! {Protocol, Socket, <<>>};
- false ->
- inet:setopts(Socket, [{active, once}])
- end,
- State;
-
-next_packet(#state{socket = Socket} = State) ->
- inet:setopts(Socket, [{active, once}]),
- State.
-
-after_new_keys(#state{renegotiate = true} = State) ->
- State1 = State#state{renegotiate = false, event_queue = []},
- lists:foldr(fun after_new_keys_events/2, {next_state, connected, State1}, State#state.event_queue);
-after_new_keys(#state{renegotiate = false,
- ssh_params = #ssh{role = client} = Ssh0} = State) ->
- {Msg, Ssh} = ssh_auth:service_request_msg(Ssh0),
- send_msg(Msg, State),
- {next_state, service_request, State#state{ssh_params = Ssh}};
-after_new_keys(#state{renegotiate = false,
- ssh_params = #ssh{role = server}} = State) ->
- {next_state, service_request, State}.
-
-after_new_keys_events({sync, _Event, From}, {stop, _Reason, _StateData}=Terminator) ->
- gen_fsm:reply(From, {error, closed}),
- Terminator;
-after_new_keys_events(_, {stop, _Reason, _StateData}=Terminator) ->
- Terminator;
-after_new_keys_events({sync, Event, From}, {next_state, StateName, StateData}) ->
- case handle_sync_event(Event, From, StateName, StateData) of
- {reply, Reply, NextStateName, NewStateData} ->
- gen_fsm:reply(From, Reply),
- {next_state, NextStateName, NewStateData};
- {next_state, NextStateName, NewStateData}->
- {next_state, NextStateName, NewStateData};
- {stop, Reason, Reply, NewStateData} ->
- gen_fsm:reply(From, Reply),
- {stop, Reason, NewStateData}
- end;
-after_new_keys_events({event, Event}, {next_state, StateName, StateData}) ->
- case handle_event(Event, StateName, StateData) of
- {next_state, NextStateName, NewStateData}->
- {next_state, NextStateName, NewStateData};
- {stop, Reason, NewStateData} ->
- {stop, Reason, NewStateData}
- end;
-after_new_keys_events({connection_reply, _Data} = Reply, {StateName, State}) ->
- NewState = send_replies([Reply], State),
- {next_state, StateName, NewState}.
-
-
-handle_disconnect(DisconnectMsg, State) ->
- handle_disconnect(own, DisconnectMsg, State).
-
-handle_disconnect(#ssh_msg_disconnect{} = DisconnectMsg, State, Error) ->
- handle_disconnect(own, DisconnectMsg, State, Error);
-handle_disconnect(Type, #ssh_msg_disconnect{description = Desc} = Msg, #state{connection_state = Connection0, role = Role} = State0) ->
- {disconnect, _, {{replies, Replies}, Connection}} = ssh_connection:handle_msg(Msg, Connection0, Role),
- State = send_replies(disconnect_replies(Type, Msg, Replies), State0),
- disconnect_fun(Desc, State#state.opts),
- {stop, {shutdown, Desc}, State#state{connection_state = Connection}}.
-
-handle_disconnect(Type, #ssh_msg_disconnect{description = Desc} = Msg, #state{connection_state = Connection0,
- role = Role} = State0, ErrorMsg) ->
- {disconnect, _, {{replies, Replies}, Connection}} = ssh_connection:handle_msg(Msg, Connection0, Role),
- State = send_replies(disconnect_replies(Type, Msg, Replies), State0),
- disconnect_fun(Desc, State#state.opts),
- {stop, {shutdown, {Desc, ErrorMsg}}, State#state{connection_state = Connection}}.
-
-disconnect_replies(own, Msg, Replies) ->
- [{connection_reply, Msg} | Replies];
-disconnect_replies(peer, _, Replies) ->
- Replies.
-
+ {Id, State#data{connection_state =
+ Connection#connection{channel_id_seed = Id + 1}}}.
+
+%%%----------------------------------------------------------------
+%% %%% This server/client has decided to disconnect via the state machine:
+disconnect(Msg=#ssh_msg_disconnect{description=Description}, _StateName, State0) ->
+ State = send_msg(Msg, State0),
+ disconnect_fun(Description, State),
+timer:sleep(400),
+ {stop, {shutdown,Description}, State}.
+
+%%%----------------------------------------------------------------
counterpart_versions(NumVsn, StrVsn, #ssh{role = server} = Ssh) ->
Ssh#ssh{c_vsn = NumVsn , c_version = StrVsn};
counterpart_versions(NumVsn, StrVsn, #ssh{role = client} = Ssh) ->
Ssh#ssh{s_vsn = NumVsn , s_version = StrVsn}.
-opposite_role(client) ->
- server;
-opposite_role(server) ->
- client.
-connected_fun(User, PeerAddr, Method, Opts) ->
- case proplists:get_value(connectfun, Opts) of
- undefined ->
- ok;
- Fun ->
- catch Fun(User, PeerAddr, Method)
- end.
-
-retry_fun(_, _, undefined, _) ->
- ok;
-
-retry_fun(User, PeerAddr, {error, Reason}, Opts) ->
- case proplists:get_value(failfun, Opts) of
- undefined ->
- ok;
- Fun ->
- do_retry_fun(Fun, User, PeerAddr, Reason)
- end;
-
-retry_fun(User, PeerAddr, Reason, Opts) ->
- case proplists:get_value(infofun, Opts) of
- undefined ->
- ok;
- Fun ->
- do_retry_fun(Fun, User, PeerAddr, Reason)
- end.
-
-do_retry_fun(Fun, User, PeerAddr, Reason) ->
- case erlang:fun_info(Fun, arity) of
- {arity, 2} -> %% Backwards compatible
- catch Fun(User, Reason);
- {arity, 3} ->
- catch Fun(User, PeerAddr, Reason)
- end.
-
ssh_info([], _State, Acc) ->
Acc;
-ssh_info([client_version | Rest], #state{ssh_params = #ssh{c_vsn = IntVsn,
+ssh_info([client_version | Rest], #data{ssh_params = #ssh{c_vsn = IntVsn,
c_version = StringVsn}} = State, Acc) ->
ssh_info(Rest, State, [{client_version, {IntVsn, StringVsn}} | Acc]);
-ssh_info([server_version | Rest], #state{ssh_params =#ssh{s_vsn = IntVsn,
+ssh_info([server_version | Rest], #data{ssh_params =#ssh{s_vsn = IntVsn,
s_version = StringVsn}} = State, Acc) ->
ssh_info(Rest, State, [{server_version, {IntVsn, StringVsn}} | Acc]);
-ssh_info([peer | Rest], #state{ssh_params = #ssh{peer = Peer}} = State, Acc) ->
+ssh_info([peer | Rest], #data{ssh_params = #ssh{peer = Peer}} = State, Acc) ->
ssh_info(Rest, State, [{peer, Peer} | Acc]);
-ssh_info([sockname | Rest], #state{socket = Socket} = State, Acc) ->
+ssh_info([sockname | Rest], #data{socket = Socket} = State, Acc) ->
{ok, SockName} = inet:sockname(Socket),
ssh_info(Rest, State, [{sockname, SockName}|Acc]);
-ssh_info([user | Rest], #state{auth_user = User} = State, Acc) ->
+ssh_info([user | Rest], #data{auth_user = User} = State, Acc) ->
ssh_info(Rest, State, [{user, User}|Acc]);
ssh_info([ _ | Rest], State, Acc) ->
ssh_info(Rest, State, Acc).
+
ssh_channel_info([], _, Acc) ->
Acc;
@@ -1765,43 +1684,49 @@ ssh_channel_info([send_window | Rest], #channel{send_window_size = WinSize,
ssh_channel_info([ _ | Rest], Channel, Acc) ->
ssh_channel_info(Rest, Channel, Acc).
+
log_error(Reason) ->
- Report = io_lib:format("Erlang ssh connection handler failed with reason: "
- "~p ~n, Stacktrace: ~p ~n",
- [Reason, erlang:get_stacktrace()]),
- error_logger:error_report(Report),
- "Internal error".
-
-not_connected_filter({connection_reply, _Data}) ->
- true;
-not_connected_filter(_) ->
- false.
-
-send_replies([], State) ->
- State;
-send_replies([{connection_reply, Data} | Rest], #state{ssh_params = Ssh0} = State) ->
- {Packet, Ssh} = ssh_transport:ssh_packet(Data, Ssh0),
- send_msg(Packet, State),
- send_replies(Rest, State#state{ssh_params = Ssh});
-send_replies([Msg | Rest], State) ->
- catch send_reply(Msg),
- send_replies(Rest, State).
-
-send_reply({channel_data, Pid, Data}) ->
- Pid ! {ssh_cm, self(), Data};
-send_reply({channel_requst_reply, From, Data}) ->
- gen_fsm:reply(From, Data);
-send_reply({flow_control, Cache, Channel, From, Msg}) ->
+ Report = io_lib:format("Erlang ssh connection handler failed with reason:~n"
+ " ~p~n"
+ "Stacktrace:~n"
+ " ~p~n",
+ [Reason, erlang:get_stacktrace()]),
+ error_logger:error_report(Report).
+
+
+%%%----------------------------------------------------------------
+not_connected_filter({connection_reply, _Data}) -> true;
+not_connected_filter(_) -> false.
+
+%%%----------------------------------------------------------------
+send_replies(Repls, State) ->
+ lists:foldl(fun get_repl/2,
+ {[],State},
+ Repls).
+
+get_repl({connection_reply,Msg}, {CallRepls,S}) ->
+ {CallRepls, send_msg(Msg,S)};
+get_repl({channel_data,undefined,_Data}, Acc) ->
+ Acc;
+get_repl({channel_data,Pid,Data}, Acc) ->
+ Pid ! {ssh_cm, self(), Data},
+ Acc;
+get_repl({channel_request_reply,From,Data}, {CallRepls,S}) ->
+ {[{reply,From,Data}|CallRepls], S};
+get_repl({flow_control,Cache,Channel,From,Msg}, {CallRepls,S}) ->
ssh_channel:cache_update(Cache, Channel#channel{flow_control = undefined}),
- gen_fsm:reply(From, Msg);
-send_reply({flow_control, From, Msg}) ->
- gen_fsm:reply(From, Msg).
+ {[{reply,From,Msg}|CallRepls], S};
+get_repl({flow_control,From,Msg}, {CallRepls,S}) ->
+ {[{reply,From,Msg}|CallRepls], S};
+get_repl(noreply, Acc) ->
+ Acc;
+get_repl(X, Acc) ->
+ exit({get_repl,X,Acc}).
-disconnect_fun({disconnect,Msg}, Opts) ->
- disconnect_fun(Msg, Opts);
-disconnect_fun(_, undefined) ->
- ok;
-disconnect_fun(Reason, Opts) ->
+%%%----------------------------------------------------------------
+disconnect_fun({disconnect,Msg}, D) ->
+ disconnect_fun(Msg, D);
+disconnect_fun(Reason, #data{opts=Opts}) ->
case proplists:get_value(disconnectfun, Opts) of
undefined ->
ok;
@@ -1809,50 +1734,137 @@ disconnect_fun(Reason, Opts) ->
catch Fun(Reason)
end.
-unexpected_fun(UnexpectedMessage, Opts, #ssh{peer={_,Peer}}) ->
+unexpected_fun(UnexpectedMessage, #data{opts = Opts,
+ ssh_params = #ssh{peer = {_,Peer} }
+ } ) ->
case proplists:get_value(unexpectedfun, Opts) of
undefined ->
report;
Fun ->
- catch Fun(UnexpectedMessage, Peer)
+ catch Fun(UnexpectedMessage, Peer)
end.
-check_cache(#state{opts = Opts} = State, Cache) ->
- %% Check the number of entries in Cache
- case proplists:get_value(size, ets:info(Cache)) of
- 0 ->
- case proplists:get_value(idle_time, Opts, infinity) of
- infinity ->
- State;
- Time ->
- handle_idle_timer(Time, State)
- end;
+debug_fun(#ssh_msg_debug{always_display = Display,
+ message = DbgMsg,
+ language = Lang},
+ #data{opts = Opts}) ->
+ case proplists:get_value(ssh_msg_debug_fun, Opts) of
+ undefined ->
+ ok;
+ Fun ->
+ catch Fun(self(), Display, DbgMsg, Lang)
+ end.
+
+
+connected_fun(User, Method, #data{ssh_params = #ssh{peer = {_,Peer}},
+ opts = Opts}) ->
+ case proplists:get_value(connectfun, Opts) of
+ undefined ->
+ ok;
+ Fun ->
+ catch Fun(User, Peer, Method)
+ end.
+
+retry_fun(_, undefined, _) ->
+ ok;
+retry_fun(User, Reason, #data{ssh_params = #ssh{opts = Opts,
+ peer = {_,Peer}
+ }}) ->
+ {Tag,Info} =
+ case Reason of
+ {error, Error} ->
+ {failfun, Error};
+ _ ->
+ {infofun, Reason}
+ end,
+ Fun = proplists:get_value(Tag, Opts, fun(_,_)-> ok end),
+ try erlang:fun_info(Fun, arity)
+ of
+ {arity, 2} -> %% Backwards compatible
+ catch Fun(User, Info);
+ {arity, 3} ->
+ catch Fun(User, Peer, Info);
_ ->
- State
+ ok
+ catch
+ _:_ ->
+ ok
+ end.
+
+%%%----------------------------------------------------------------
+%%% Cache idle timer that closes the connection if there are no
+%%% channels open for a while.
+
+cache_init_idle_timer(D) ->
+ case proplists:get_value(idle_time, D#data.opts, infinity) of
+ infinity ->
+ D#data{idle_timer_value = infinity,
+ idle_timer_ref = infinity % A flag used later...
+ };
+ IdleTime ->
+ %% We dont want to set the timeout on first connect
+ D#data{idle_timer_value = IdleTime}
end.
-handle_idle_timer(Time, #state{idle_timer_ref = undefined} = State) ->
- TimerRef = erlang:send_after(Time, self(), {'EXIT', [], "Timeout"}),
- State#state{idle_timer_ref=TimerRef};
-handle_idle_timer(_, State) ->
- State.
-
-remove_timer_ref(State) ->
- case State#state.idle_timer_ref of
- infinity -> %% If the timer is not activated
- State;
- undefined -> %% If we already has cancelled the timer
- State;
- TimerRef -> %% Timer is active
+
+cache_check_set_idle_timer(D = #data{idle_timer_ref = undefined,
+ idle_timer_value = IdleTime}) ->
+ %% No timer set - shall we set one?
+ case ssh_channel:cache_info(num_entries, cache(D)) of
+ 0 when IdleTime == infinity ->
+ %% No. Meaningless to set a timer that fires in an infinite time...
+ D;
+ 0 ->
+ %% Yes, we'll set one since the cache is empty and it should not
+ %% be that for a specified time
+ D#data{idle_timer_ref =
+ erlang:send_after(IdleTime, self(), {'EXIT',[],"Timeout"})};
+ _ ->
+ %% No - there are entries in the cache
+ D
+ end;
+cache_check_set_idle_timer(D) ->
+ %% There is already a timer set or the timeout time is infinite
+ D.
+
+
+cache_cancel_idle_timer(D) ->
+ case D#data.idle_timer_ref of
+ infinity ->
+ %% The timer is not activated
+ D;
+ undefined ->
+ %% The timer is already cancelled
+ D;
+ TimerRef ->
+ %% The timer is active
erlang:cancel_timer(TimerRef),
- State#state{idle_timer_ref = undefined}
+ D#data{idle_timer_ref = undefined}
end.
-socket_control(Socket, Pid, Transport) ->
- case Transport:controlling_process(Socket, Pid) of
+
+cache_request_idle_timer_check(D = #data{idle_timer_value = infinity}) ->
+ D;
+cache_request_idle_timer_check(D = #data{idle_timer_value = IdleTime}) ->
+ erlang:send_after(IdleTime, self(), check_cache),
+ D.
+
+%%%----------------------------------------------------------------
+start_channel_request_timer(_,_, infinity) ->
+ ok;
+start_channel_request_timer(Channel, From, Time) ->
+ erlang:send_after(Time, self(), {timeout, {Channel, From}}).
+
+%%%----------------------------------------------------------------
+%%% Connection start and initalization helpers
+
+socket_control(Socket, Pid, Options) ->
+ {_, TransportCallback, _} = % For example {_,gen_tcp,_}
+ proplists:get_value(transport, Options, ?DefaultTransport),
+ case TransportCallback:controlling_process(Socket, Pid) of
ok ->
- send_event(Pid, socket_control);
+ gen_statem:cast(Pid, socket_control);
{error, Reason} ->
{error, Reason}
end.
@@ -1881,16 +1893,3 @@ handshake(Pid, Ref, Timeout) ->
{error, timeout}
end.
-start_timeout(_,_, infinity) ->
- ok;
-start_timeout(Channel, From, Time) ->
- erlang:send_after(Time, self(), {timeout, {Channel, From}}).
-
-getopt(Opt, Socket) ->
- case inet:getopts(Socket, [Opt]) of
- {ok, [{Opt, Value}]} ->
- {ok, Value};
- Other ->
- {error, {unexpected_getopts_return, Other}}
- end.
-
diff --git a/lib/ssh/src/ssh_connection_sup.erl b/lib/ssh/src/ssh_connection_sup.erl
index e8d0d49668..8c7628e909 100644
--- a/lib/ssh/src/ssh_connection_sup.erl
+++ b/lib/ssh/src/ssh_connection_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_daemon_channel.erl b/lib/ssh/src/ssh_daemon_channel.erl
index 560e8246de..6ca93eff44 100644
--- a/lib/ssh/src/ssh_daemon_channel.erl
+++ b/lib/ssh/src/ssh_daemon_channel.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_dbg.erl b/lib/ssh/src/ssh_dbg.erl
new file mode 100644
index 0000000000..fbf85cfcfc
--- /dev/null
+++ b/lib/ssh/src/ssh_dbg.erl
@@ -0,0 +1,140 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+
+-module(ssh_dbg).
+
+-export([messages/0,
+ messages/1
+ ]).
+
+-include("ssh.hrl").
+-include("ssh_transport.hrl").
+-include("ssh_connect.hrl").
+-include("ssh_auth.hrl").
+
+-record(data, {
+ writer,
+ acc = []}).
+%%%================================================================
+messages() -> messages(fun(String,_D) -> io:format(String) end).
+%% messages() -> messages(fun(String,Acc) -> [String|Acc] end)
+
+messages(Write) when is_function(Write,2) ->
+ catch dbg:start(),
+
+ Handler = fun msg_formater/2,
+ InitialData = #data{writer = Write},
+ {ok,_} = dbg:tracer(process, {Handler, InitialData}),
+
+ dbg:p(new,c),
+ dbg:tp(ssh_message,encode,1, x),
+ dbg:tp(ssh_message,decode,1, x),
+ dbg:tpl(ssh_transport,select_algorithm,3, x).
+
+%%%================================================================
+msg_formater({trace,Pid,call,{ssh_message,encode,[Msg]}}, D) ->
+ fmt("~nSEND ~p ~s~n", [Pid,wr_record(shrink_bin(Msg))], D);
+
+msg_formater({trace,Pid,return_from,{ssh_message,decode,1},Msg}, D) ->
+ fmt("~nRECV ~p ~s~n", [Pid,wr_record(shrink_bin(Msg))], D);
+
+msg_formater({trace,Pid,return_from,{ssh_transport,select_algorithm,3},{ok,Alg}}, D) ->
+ fmt("~nALGORITHMS ~p~n~s~n", [Pid, wr_record(Alg)], D);
+
+msg_formater(_, D) ->
+ D.
+
+
+fmt(Fmt, Args, D=#data{writer=Write,acc=Acc}) ->
+ D#data{acc = Write(io_lib:format(Fmt, Args), Acc)}.
+
+%%%----------------------------------------------------------------
+shrink_bin(B) when is_binary(B), size(B)>100 -> {'*** SHRINKED BIN',size(B),element(1,split_binary(B,20)),'***'};
+shrink_bin(L) when is_list(L) -> lists:map(fun shrink_bin/1, L);
+shrink_bin(T) when is_tuple(T) -> list_to_tuple(shrink_bin(tuple_to_list(T)));
+shrink_bin(X) -> X.
+
+%%%----------------------------------------------------------------
+-define(wr_record(N,BlackList), wr_record(R=#N{}) -> wr_record(R, record_info(fields,N), BlackList)).
+
+-define(wr_record(N), ?wr_record(N, [])).
+
+
+?wr_record(alg);
+
+?wr_record(ssh_msg_disconnect);
+?wr_record(ssh_msg_ignore);
+?wr_record(ssh_msg_unimplemented);
+?wr_record(ssh_msg_debug);
+?wr_record(ssh_msg_service_request);
+?wr_record(ssh_msg_service_accept);
+?wr_record(ssh_msg_kexinit);
+?wr_record(ssh_msg_kexdh_init);
+?wr_record(ssh_msg_kexdh_reply);
+?wr_record(ssh_msg_newkeys);
+?wr_record(ssh_msg_kex_dh_gex_request);
+?wr_record(ssh_msg_kex_dh_gex_request_old);
+?wr_record(ssh_msg_kex_dh_gex_group);
+?wr_record(ssh_msg_kex_dh_gex_init);
+?wr_record(ssh_msg_kex_dh_gex_reply);
+?wr_record(ssh_msg_kex_ecdh_init);
+?wr_record(ssh_msg_kex_ecdh_reply);
+
+?wr_record(ssh_msg_userauth_request);
+?wr_record(ssh_msg_userauth_failure);
+?wr_record(ssh_msg_userauth_success);
+?wr_record(ssh_msg_userauth_banner);
+?wr_record(ssh_msg_userauth_passwd_changereq);
+?wr_record(ssh_msg_userauth_pk_ok);
+?wr_record(ssh_msg_userauth_info_request);
+?wr_record(ssh_msg_userauth_info_response);
+
+?wr_record(ssh_msg_global_request);
+?wr_record(ssh_msg_request_success);
+?wr_record(ssh_msg_request_failure);
+?wr_record(ssh_msg_channel_open);
+?wr_record(ssh_msg_channel_open_confirmation);
+?wr_record(ssh_msg_channel_open_failure);
+?wr_record(ssh_msg_channel_window_adjust);
+?wr_record(ssh_msg_channel_data);
+?wr_record(ssh_msg_channel_extended_data);
+?wr_record(ssh_msg_channel_eof);
+?wr_record(ssh_msg_channel_close);
+?wr_record(ssh_msg_channel_request);
+?wr_record(ssh_msg_channel_success);
+?wr_record(ssh_msg_channel_failure);
+
+wr_record(R) -> io_lib:format('~p~n',[R]).
+
+
+wr_record(T, Fs, BL) when is_tuple(T) ->
+ wr_record(tuple_to_list(T), Fs, BL);
+wr_record([Name|Values], Fields, BlackL) ->
+ W = case Fields of
+ [] -> 0;
+ _ -> lists:max([length(atom_to_list(F)) || F<-Fields])
+ end,
+ [io_lib:format("~p:~n",[string:to_upper(atom_to_list(Name))])
+ | [io_lib:format(" ~*p: ~p~n",[W,Tag,Value]) || {Tag,Value} <- lists:zip(Fields,Values),
+ not lists:member(Tag,BlackL)
+ ]
+ ].
diff --git a/lib/ssh/src/ssh_file.erl b/lib/ssh/src/ssh_file.erl
index 3e066c453d..4486d36fe4 100644
--- a/lib/ssh/src/ssh_file.erl
+++ b/lib/ssh/src/ssh_file.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_info.erl b/lib/ssh/src/ssh_info.erl
index 4e6e25bc70..0c24c09887 100644
--- a/lib/ssh/src/ssh_info.erl
+++ b/lib/ssh/src/ssh_info.erl
@@ -25,132 +25,174 @@
-module(ssh_info).
--compile(export_all).
+-export([print/0,
+ print/1,
+ string/0,
+ collect_pids/0
+ ]).
+
+-include("ssh_connect.hrl").
print() ->
- print(user).
+ io:format("~s", [string()]).
+print(File) when is_list(File) ->
+ {ok,D} = file:open(File, [write]),
+ print(D),
+ file:close(D);
print(D) ->
+ io:format(D, "~s", [string()]).
+
+string() ->
try supervisor:which_children(ssh_sup)
of
_ ->
- io:nl(D),
- print_general(D),
- io:nl(D),
- underline(D, "Client part", $=),
- print_clients(D),
- io:nl(D),
- underline(D, "Server part", $=),
- print_servers(D),
- io:nl(D),
- %% case os:type() of
- %% {unix,_} ->
- %% io:nl(),
- %% underline("Linux part", $=),
- %% underline("Listening"),
- %% catch io:format(os:cmd("netstat -tpln")),
- %% io:nl(),
- %% underline("Other"),
- %% catch io:format(os:cmd("netstat -tpn"));
- %% _ -> ok
- %% end,
- underline(D, "Supervisors", $=),
- walk_sups(D, ssh_sup),
- io:nl(D)
+ [io_lib:nl(),
+ print_general(),
+ io_lib:nl(),
+ underline("Client part", $=),
+ print_clients(),
+ io_lib:nl(),
+ underline("Server part", $=),
+ print_servers(),
+ io_lib:nl(),
+ underline("Supervisors", $=),
+ walk_sups(ssh_sup),
+ io_lib:nl()]
catch
_:_ ->
- io:format(D,"Ssh not found~n",[])
+ io_lib:format("Ssh not found~n",[])
end.
+
%%%================================================================
-print_general(D) ->
+-define(INDENT, " ").
+
+print_general() ->
{_Name, Slogan, Ver} = lists:keyfind(ssh,1,application:which_applications()),
- underline(D, io_lib:format("~s ~s", [Slogan, Ver]), $=),
- io:format(D, 'This printout is generated ~s. ~n',[datetime()]).
+ [underline(io_lib:format("~s ~s", [Slogan, Ver]), $=),
+ io_lib:format('This printout is generated ~s. ~n',[datetime()])
+ ].
-%%%================================================================
-print_clients(D) ->
- PrintClient = fun(X) -> print_client(D,X) end,
+print_clients() ->
try
- lists:foreach(PrintClient, supervisor:which_children(sshc_sup))
+ lists:map(fun print_client/1,
+ supervisor:which_children(sshc_sup))
catch
C:E ->
- io:format(D, '***FAILED: ~p:~p~n',[C,E])
+ io_lib:format('***print_clients FAILED: ~p:~p~n',[C,E])
end.
-print_client(D, {undefined,Pid,supervisor,[ssh_connection_handler]}) ->
+print_client({undefined,Pid,supervisor,[ssh_connection_handler]}) ->
{{Local,Remote},_Str} = ssh_connection_handler:get_print_info(Pid),
- io:format(D, " Local=~s Remote=~s ConnectionRef=~p~n",[fmt_host_port(Local),fmt_host_port(Remote),Pid]);
-print_client(D, Other) ->
- io:format(D, " [[Other 1: ~p]]~n",[Other]).
+ [io_lib:format(?INDENT"Local: ~s Remote: ~s ConnectionRef = ~p~n",
+ [fmt_host_port(Local), fmt_host_port(Remote), Pid]),
+ case channels(Pid) of
+ {ok,Channels=[_|_]} ->
+ [print_ch(ChPid) || #channel{user=ChPid} <- Channels];
+ _ ->
+ io_lib:format(?INDENT?INDENT?INDENT"No channels~n",[])
+ end];
+
+print_client(Other) ->
+ io_lib:format(" [[Other 1: ~p]]~n",[Other]).
%%%================================================================
-print_servers(D) ->
- PrintServer = fun(X) -> print_server(D,X) end,
+print_servers() ->
try
- lists:foreach(PrintServer, supervisor:which_children(sshd_sup))
+ lists:map(fun print_server/1,
+ supervisor:which_children(sshd_sup))
catch
C:E ->
- io:format(D, '***FAILED: ~p:~p~n',[C,E])
+ io_lib:format('***print_servers FAILED: ~p:~p~n',[C,E])
end.
-print_server(D, {{server,ssh_system_sup,LocalHost,LocalPort},Pid,supervisor,[ssh_system_sup]}) when is_pid(Pid) ->
- io:format(D, 'Local=~s (~p children)~n',[fmt_host_port({LocalHost,LocalPort}),
- ssh_acceptor:number_of_connections(Pid)]),
- PrintSystemSup = fun(X) -> print_system_sup(D,X) end,
- lists:foreach(PrintSystemSup, supervisor:which_children(Pid));
-print_server(D, Other) ->
- io:format(D, " [[Other 2: ~p]]~n",[Other]).
-
-print_system_sup(D, {Ref,Pid,supervisor,[ssh_subsystem_sup]}) when is_reference(Ref),
+
+print_server({{server,ssh_system_sup,LocalHost,LocalPort,Profile},Pid,supervisor,[ssh_system_sup]}) when is_pid(Pid) ->
+ Children = supervisor:which_children(Pid),
+ [io_lib:format(?INDENT"Listen: ~s (~p children) Profile ~p",[fmt_host_port({LocalHost,LocalPort}),
+ ssh_acceptor:number_of_connections(Pid),
+ Profile]),
+ case [AccPid
+ || {{ssh_acceptor_sup,_LocalHost,_LocalPort,_Profile}, AccPid, supervisor, [ssh_acceptor_sup]}
+ <- Children] of
+ AcceptorPids = [_|_] ->
+ [io_lib:format(" [Acceptor Pid", []),
+ [io_lib:format(" ~p",[AccPid]) || AccPid <- AcceptorPids],
+ io_lib:format("]~n", [])
+ ];
+ [] ->
+ io_lib:nl()
+ end,
+ lists:map(fun print_system_sup/1,
+ supervisor:which_children(Pid))
+ ].
+
+
+print_system_sup({Ref,Pid,supervisor,[ssh_subsystem_sup]}) when is_reference(Ref),
is_pid(Pid) ->
- PrintChannels = fun(X) -> print_channels(D,X) end,
- lists:foreach(PrintChannels, supervisor:which_children(Pid));
-print_system_sup(D, {{ssh_acceptor_sup,LocalHost,LocalPort}, Pid,supervisor, [ssh_acceptor_sup]}) when is_pid(Pid) ->
- io:format(D, " [Acceptor for ~s]~n",[fmt_host_port({LocalHost,LocalPort})]);
-print_system_sup(D, Other) ->
- io:format(D, " [[Other 3: ~p]]~n",[Other]).
-
-print_channels(D, {{server,ssh_channel_sup,_,_},Pid,supervisor,[ssh_channel_sup]}) when is_pid(Pid) ->
- PrintChannel = fun(X) -> print_channel(D,X) end,
- lists:foreach(PrintChannel, supervisor:which_children(Pid));
-print_channels(D, Other) ->
- io:format(D, " [[Other 4: ~p]]~n",[Other]).
-
-
-print_channel(D, {Ref,Pid,worker,[ssh_channel]}) when is_reference(Ref),
- is_pid(Pid) ->
- {{ConnManager,ChannelID}, Str} = ssh_channel:get_print_info(Pid),
- {{Local,Remote},StrM} = ssh_connection_handler:get_print_info(ConnManager),
- io:format(D, ' ch ~p: ~s ~s',[ChannelID, StrM, Str]),
- io:format(D, " Local=~s Remote=~s~n",[fmt_host_port(Local),fmt_host_port(Remote)]);
-print_channel(D, Other) ->
- io:format(D, " [[Other 5: ~p]]~n",[Other]).
-
+ lists:map(fun print_channels/1,
+ supervisor:which_children(Pid));
+
+print_system_sup({{ssh_acceptor_sup,_LocalHost,_LocalPort,_Profile}, Pid, supervisor, [ssh_acceptor_sup]}) when is_pid(Pid) ->
+ [].
+
+
+
+print_channels({{server,ssh_channel_sup,_,_},Pid,supervisor,[ssh_channel_sup]}) when is_pid(Pid) ->
+ Children = supervisor:which_children(Pid),
+ ChannelPids = [P || {R,P,worker,[ssh_channel]} <- Children,
+ is_pid(P),
+ is_reference(R)],
+ case ChannelPids of
+ [] -> io_lib:format(?INDENT?INDENT"No channels~n",[]);
+ [Ch1Pid|_] ->
+ {{ConnManager,_}, _Str} = ssh_channel:get_print_info(Ch1Pid),
+ {{_,Remote},_} = ssh_connection_handler:get_print_info(ConnManager),
+ [io_lib:format(?INDENT?INDENT"Remote: ~s ConnectionRef = ~p~n",[fmt_host_port(Remote),ConnManager]),
+ lists:map(fun print_ch/1, ChannelPids)
+ ]
+ end;
+print_channels({{server,ssh_connection_sup,_,_},Pid,supervisor,[ssh_connection_sup]}) when is_pid(Pid) ->
+ []. % The supervisor of the connections socket owning process
+
+print_ch(Pid) ->
+ try
+ {{ConnManager,ChannelID}, Str} = ssh_channel:get_print_info(Pid),
+ {_LocalRemote,StrM} = ssh_connection_handler:get_print_info(ConnManager),
+ io_lib:format(?INDENT?INDENT?INDENT"ch ~p ~p: ~s ~s~n",[ChannelID, Pid, StrM, Str])
+ catch
+ C:E ->
+ io_lib:format('****print_ch FAILED for ChanPid ~p: ~p:~p~n',[Pid, C, E])
+ end.
+
+
%%%================================================================
-define(inc(N), (N+4)).
-walk_sups(D, StartPid) ->
- io:format(D, "Start at ~p, ~s.~n",[StartPid,dead_or_alive(StartPid)]),
- walk_sups(D, children(StartPid), _Indent=?inc(0)).
+walk_sups(StartPid) ->
+ io_lib:format("Start at ~p, ~s.~n",[StartPid,dead_or_alive(StartPid)]),
+ walk_sups(children(StartPid), _Indent=?inc(0)).
-walk_sups(D, [H={_,Pid,_,_}|T], Indent) ->
- indent(D, Indent), io:format(D, '~200p ~p is ~s~n',[H,Pid,dead_or_alive(Pid)]),
- case H of
- {_,_,supervisor,[ssh_connection_handler]} -> ok;
- {_,Pid,supervisor,_} -> walk_sups(D, children(Pid), ?inc(Indent));
- _ -> ok
- end,
- walk_sups(D, T, Indent);
-walk_sups(_D, [], _) ->
- ok.
+walk_sups([H={_,Pid,_,_}|T], Indent) ->
+ [indent(Indent),
+ io_lib:format('~200p ~p is ~s~n',[H,Pid,dead_or_alive(Pid)]),
+ case H of
+ {_,_,supervisor,[ssh_connection_handler]} -> "";
+ {_,Pid,supervisor,_} -> walk_sups(children(Pid), ?inc(Indent));
+ _ -> ""
+ end,
+ walk_sups(T, Indent)
+ ];
+walk_sups([], _) ->
+ "".
dead_or_alive(Name) when is_atom(Name) ->
case whereis(Name) of
- undefined ->
+ undefined ->
"**UNDEFINED**";
- Pid ->
+ Pid ->
dead_or_alive(Pid)
end;
dead_or_alive(Pid) when is_pid(Pid) ->
@@ -159,7 +201,8 @@ dead_or_alive(Pid) when is_pid(Pid) ->
_ -> "alive"
end.
-indent(D, I) -> io:format(D,'~*c',[I,$ ]).
+indent(I) -> io_lib:format('~*c',[I,$ ]).
+
children(Pid) ->
Parent = self(),
@@ -170,23 +213,39 @@ children(Pid) ->
{Helper,L} when is_list(L) ->
L
after
- 2000 ->
+ 2000 ->
catch exit(Helper, kill),
[]
end.
-%%%================================================================
-underline(D, Str) ->
- underline(D, Str, $-).
+is_connection_handler(Pid) ->
+ try
+ {ssh_connection_handler,init,_} =
+ proplists:get_value(
+ '$initial_call',
+ proplists:get_value(
+ dictionary,
+ process_info(Pid, [dictionary])))
+ of
+ _ -> true
-underline(D, Str, LineChar) ->
- Len = lists:flatlength(Str),
- io:format(D, '~s~n',[Str]),
- line(D,Len,LineChar).
+ catch
+ _:_ ->
+ false
+ end.
+
+channels(Pid) ->
+ case is_connection_handler(Pid) of
+ true ->
+ ssh_connection_handler:info(Pid,all);
+ false ->
+ false
+ end.
+
+%%%================================================================
+underline(Str, LineChar) ->
+ io_lib:format('~s~n~*c~n',[Str, lists:flatlength(Str), LineChar]).
-line(D, Len, Char) ->
- io:format(D, '~*c~n', [Len,Char]).
-
datetime() ->
{{YYYY,MM,DD}, {H,M,S}} = calendar:now_to_universal_time(erlang:timestamp()),
@@ -196,8 +255,82 @@ datetime() ->
fmt_host_port({{A,B,C,D},Port}) -> io_lib:format('~p.~p.~p.~p:~p',[A,B,C,D,Port]);
fmt_host_port({Host,Port}) -> io_lib:format('~s:~p',[Host,Port]).
+%%%################################################################
+collect_pids() -> collect_pids(ssh_sup).
+
+collect_pids(P) ->
+ Collector = pcollect_pids(P, spawn(fun init_collector/0)),
+ Collector ! {get_values,self()},
+ receive
+ {values,Values} ->
+ Values
+ end.
+
+%%%----------------
+pcollect_pids(undefined, Collector) ->
+ Collector;
+
+pcollect_pids(A, Collector) when is_atom(A) ->
+ pcollect_pids(whereis(A), Collector);
+
+pcollect_pids(Pid, Collector) when is_pid(Pid) ->
+ Collector ! {expect,Pid},
+ spawn(fun() ->
+ lists:foreach(
+ fun(P2) ->
+ pcollect_pids(P2,Collector)
+ end, children(Pid)),
+ Collector ! {value,Pid,Pid}
+ end),
+ Collector;
+pcollect_pids({Ref,Pid,supervisor,_}, Collector) when is_pid(Pid),
+ is_reference(Ref) ->
+ pcollect_pids(Pid, Collector);
-nyi(D) ->
- io:format(D,'Not yet implemented~n',[]),
- nyi.
+pcollect_pids({sshc_sup,Pid,supervisor,_}, Collector) when is_pid(Pid) ->
+ pcollect_pids(Pid, Collector);
+
+pcollect_pids({sshd_sup,Pid,supervisor,_}, Collector) when is_pid(Pid) ->
+ pcollect_pids(Pid, Collector);
+
+pcollect_pids({{ssh_acceptor_sup,_,_,_},Pid,supervisor,_}, Collector) when is_pid(Pid) ->
+ pcollect_pids(Pid, Collector);
+
+pcollect_pids({{server,_,_,_},Pid,supervisor,_}, Collector) when is_pid(Pid) ->
+ pcollect_pids(Pid, Collector);
+
+pcollect_pids({{server,_,_,_,_},Pid,supervisor,_}, Collector) when is_pid(Pid) ->
+ pcollect_pids(Pid, Collector);
+
+pcollect_pids({undefined,Pid,supervisor,[ssh_connection_handler]}, Collector) ->
+ Collector ! {value,Pid,Pid},
+ case channels(Pid) of
+ {ok,L} ->
+ [Collector!{value,P,P} || #channel{user=P} <- L];
+ _ ->
+ ok
+ end,
+ Collector;
+
+pcollect_pids({_,Pid,_,_}, Collector) when is_pid(Pid) ->
+ Collector ! {value,Pid,Pid},
+ Collector;
+
+pcollect_pids(_, Collector) ->
+ Collector.
+
+%%%----------------
+init_collector() ->
+ loop_collector([],[]).
+
+loop_collector(Expects, Values) ->
+ receive
+ {expect, Ref} ->
+ loop_collector([Ref|Expects], Values);
+ {value, Ref, Val} ->
+ loop_collector(Expects--[Ref], [Val|Values]);
+ {get_values, From} when Expects==[] ->
+%% Values=/=[] ->
+ From ! {values,Values}
+ end.
diff --git a/lib/ssh/src/ssh_io.erl b/lib/ssh/src/ssh_io.erl
index a5e627fdb3..026d0f6151 100644
--- a/lib/ssh/src/ssh_io.erl
+++ b/lib/ssh/src/ssh_io.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_message.erl b/lib/ssh/src/ssh_message.erl
index a0e9a4961c..db80d4c9e3 100644
--- a/lib/ssh/src/ssh_message.erl
+++ b/lib/ssh/src/ssh_message.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -50,13 +50,7 @@
-define(Empint(X), (ssh_bits:mpint(X))/binary ).
-define(Ebinary(X), ?STRING(X) ).
-%% encode(Msg) ->
-%% try encode1(Msg)
-%% catch
-%% C:E ->
-%% io:format('***********************~n~p:~p ~p~n',[C,E,Msg]),
-%% error(E)
-%% end.
+-define(unicode_list(B), unicode:characters_to_list(B)).
encode(#ssh_msg_global_request{
name = Name,
@@ -176,7 +170,7 @@ encode(#ssh_msg_userauth_pk_ok{
encode(#ssh_msg_userauth_passwd_changereq{prompt = Prompt,
languge = Lang
})->
- <<?Ebyte(?SSH_MSG_USERAUTH_PASSWD_CHANGEREQ), ?Estring(Prompt), ?Estring(Lang)>>;
+ <<?Ebyte(?SSH_MSG_USERAUTH_PASSWD_CHANGEREQ), ?Estring_utf8(Prompt), ?Estring(Lang)>>;
encode(#ssh_msg_userauth_info_request{
name = Name,
@@ -184,14 +178,14 @@ encode(#ssh_msg_userauth_info_request{
language_tag = Lang,
num_prompts = NumPromtps,
data = Data}) ->
- <<?Ebyte(?SSH_MSG_USERAUTH_INFO_REQUEST), ?Estring(Name), ?Estring(Inst), ?Estring(Lang),
+ <<?Ebyte(?SSH_MSG_USERAUTH_INFO_REQUEST), ?Estring_utf8(Name), ?Estring_utf8(Inst), ?Estring(Lang),
?Euint32(NumPromtps), ?'E...'(Data)>>;
encode(#ssh_msg_userauth_info_response{
num_responses = Num,
data = Data}) ->
lists:foldl(fun %%("", Acc) -> Acc; % commented out since it seem wrong
- (Response, Acc) -> <<Acc/binary, ?Estring(Response)>>
+ (Response, Acc) -> <<Acc/binary, ?Estring_utf8(Response)>>
end,
<<?Ebyte(?SSH_MSG_USERAUTH_INFO_RESPONSE), ?Euint32(Num)>>,
Data);
@@ -201,17 +195,17 @@ encode(#ssh_msg_disconnect{
description = Desc,
language = Lang
}) ->
- <<?Ebyte(?SSH_MSG_DISCONNECT), ?Euint32(Code), ?Estring(Desc), ?Estring(Lang)>>;
+ <<?Ebyte(?SSH_MSG_DISCONNECT), ?Euint32(Code), ?Estring_utf8(Desc), ?Estring(Lang)>>;
encode(#ssh_msg_service_request{
name = Service
}) ->
- <<?Ebyte(?SSH_MSG_SERVICE_REQUEST), ?Estring(Service)>>;
+ <<?Ebyte(?SSH_MSG_SERVICE_REQUEST), ?Estring_utf8(Service)>>;
encode(#ssh_msg_service_accept{
name = Service
}) ->
- <<?Ebyte(?SSH_MSG_SERVICE_ACCEPT), ?Estring(Service)>>;
+ <<?Ebyte(?SSH_MSG_SERVICE_ACCEPT), ?Estring_utf8(Service)>>;
encode(#ssh_msg_newkeys{}) ->
<<?Ebyte(?SSH_MSG_NEWKEYS)>>;
@@ -283,7 +277,7 @@ encode(#ssh_msg_kex_ecdh_reply{public_host_key = Key, q_s = Q_s, h_sig = Sign})
<<?Ebyte(?SSH_MSG_KEX_ECDH_REPLY), ?Ebinary(EncKey), ?Empint(Q_s), ?Ebinary(EncSign)>>;
encode(#ssh_msg_ignore{data = Data}) ->
- <<?Ebyte(?SSH_MSG_IGNORE), ?Estring(Data)>>;
+ <<?Ebyte(?SSH_MSG_IGNORE), ?Estring_utf8(Data)>>;
encode(#ssh_msg_unimplemented{sequence = Seq}) ->
<<?Ebyte(?SSH_MSG_UNIMPLEMENTED), ?Euint32(Seq)>>;
@@ -291,7 +285,7 @@ encode(#ssh_msg_unimplemented{sequence = Seq}) ->
encode(#ssh_msg_debug{always_display = Bool,
message = Msg,
language = Lang}) ->
- <<?Ebyte(?SSH_MSG_DEBUG), ?Eboolean(Bool), ?Estring(Msg), ?Estring(Lang)>>.
+ <<?Ebyte(?SSH_MSG_DEBUG), ?Eboolean(Bool), ?Estring_utf8(Msg), ?Estring(Lang)>>.
%% Connection Messages
@@ -330,7 +324,7 @@ decode(<<?BYTE(?SSH_MSG_CHANNEL_OPEN_FAILURE), ?UINT32(Recipient), ?UINT32(Reas
#ssh_msg_channel_open_failure{
recipient_channel = Recipient,
reason = Reason,
- description = unicode:characters_to_list(Desc),
+ description = ?unicode_list(Desc),
lang = Lang
};
decode(<<?BYTE(?SSH_MSG_CHANNEL_WINDOW_ADJUST), ?UINT32(Recipient), ?UINT32(Bytes)>>) ->
@@ -363,7 +357,7 @@ decode(<<?BYTE(?SSH_MSG_CHANNEL_REQUEST), ?UINT32(Recipient),
?DEC_BIN(RequestType,__0), ?BYTE(Bool), Data/binary>>) ->
#ssh_msg_channel_request{
recipient_channel = Recipient,
- request_type = unicode:characters_to_list(RequestType),
+ request_type = ?unicode_list(RequestType),
want_reply = erl_boolean(Bool),
data = Data
};
@@ -381,9 +375,9 @@ decode(<<?BYTE(?SSH_MSG_USERAUTH_REQUEST),
?DEC_BIN(User,__0), ?DEC_BIN(Service,__1), ?DEC_BIN(Method,__2),
Data/binary>>) ->
#ssh_msg_userauth_request{
- user = unicode:characters_to_list(User),
- service = unicode:characters_to_list(Service),
- method = unicode:characters_to_list(Method),
+ user = ?unicode_list(User),
+ service = ?unicode_list(Service),
+ method = ?unicode_list(Method),
data = Data
};
@@ -391,7 +385,7 @@ decode(<<?BYTE(?SSH_MSG_USERAUTH_FAILURE),
?DEC_BIN(Auths,__0),
?BYTE(Bool)>>) ->
#ssh_msg_userauth_failure {
- authentications = unicode:characters_to_list(Auths),
+ authentications = ?unicode_list(Auths),
partial_success = erl_boolean(Bool)
};
@@ -493,18 +487,18 @@ decode(<<"ecdh",?BYTE(?SSH_MSG_KEX_ECDH_REPLY),
decode(<<?SSH_MSG_SERVICE_REQUEST, ?DEC_BIN(Service,__0)>>) ->
#ssh_msg_service_request{
- name = unicode:characters_to_list(Service)
+ name = ?unicode_list(Service)
};
decode(<<?SSH_MSG_SERVICE_ACCEPT, ?DEC_BIN(Service,__0)>>) ->
#ssh_msg_service_accept{
- name = unicode:characters_to_list(Service)
+ name = ?unicode_list(Service)
};
decode(<<?BYTE(?SSH_MSG_DISCONNECT), ?UINT32(Code), ?DEC_BIN(Desc,__0), ?DEC_BIN(Lang,__1)>>) ->
#ssh_msg_disconnect{
code = Code,
- description = unicode:characters_to_list(Desc),
+ description = ?unicode_list(Desc),
language = Lang
};
@@ -512,7 +506,7 @@ decode(<<?BYTE(?SSH_MSG_DISCONNECT), ?UINT32(Code), ?DEC_BIN(Desc,__0), ?DEC_BIN
decode(<<?BYTE(?SSH_MSG_DISCONNECT), ?UINT32(Code), ?DEC_BIN(Desc,__0)>>) ->
#ssh_msg_disconnect{
code = Code,
- description = unicode:characters_to_list(Desc),
+ description = ?unicode_list(Desc),
language = <<"en">>
};
@@ -554,7 +548,7 @@ decode_kex_init(<<?BYTE(Bool)>>, Acc, 0) ->
X = 0,
list_to_tuple(lists:reverse([X, erl_boolean(Bool) | Acc]));
decode_kex_init(<<?DEC_BIN(Data,__0), Rest/binary>>, Acc, N) ->
- Names = string:tokens(unicode:characters_to_list(Data), ","),
+ Names = string:tokens(?unicode_list(Data), ","),
decode_kex_init(Rest, [Names | Acc], N -1).
diff --git a/lib/ssh/src/ssh_no_io.erl b/lib/ssh/src/ssh_no_io.erl
index e8d1afd0ed..1da257ed99 100644
--- a/lib/ssh/src/ssh_no_io.erl
+++ b/lib/ssh/src/ssh_no_io.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -27,27 +27,39 @@
-export([yes_no/2, read_password/2, read_line/2, format/2]).
+
+-spec yes_no(any(), any()) -> no_return().
+
yes_no(_, _) ->
- throw({{no_io_allowed, yes_no},
- #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
- description = "User interaction is not allowed",
- language = "en"}}).
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
+ description = "User interaction is not allowed"},
+ {no_io_allowed, yes_no}).
+
+
+-spec read_password(any(), any()) -> no_return().
read_password(_, _) ->
- throw({{no_io_allowed, read_password},
- #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
- description = "User interaction is not allowed",
- language = "en"}}).
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
+ description = "User interaction is not allowed"},
+ {no_io_allowed, read_password}).
+
+
+-spec read_line(any(), any()) -> no_return().
read_line(_, _) ->
- throw({{no_io_allowed, read_line},
- #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
- description = "User interaction is not allowed",
- language = "en"}} ).
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
+ description = "User interaction is not allowed"},
+ {no_io_allowed, read_line}).
+
+
+-spec format(any(), any()) -> no_return().
format(_, _) ->
- throw({{no_io_allowed, format},
- #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
- description = "User interaction is not allowed",
- language = "en"}}).
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
+ description = "User interaction is not allowed"},
+ {no_io_allowed, format}).
diff --git a/lib/ssh/src/ssh_server_key.erl b/lib/ssh/src/ssh_server_key.erl
index 4ab326374a..2ce0c7e3fe 100644
--- a/lib/ssh/src/ssh_server_key.erl
+++ b/lib/ssh/src/ssh_server_key.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_server_key_api.erl b/lib/ssh/src/ssh_server_key_api.erl
index 7c05d82c03..c1d43a486c 100644
--- a/lib/ssh/src/ssh_server_key_api.erl
+++ b/lib/ssh/src/ssh_server_key_api.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_sftp.erl b/lib/ssh/src/ssh_sftp.erl
index eb99406626..b03652a136 100644
--- a/lib/ssh/src/ssh_sftp.erl
+++ b/lib/ssh/src/ssh_sftp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_sftpd_file.erl b/lib/ssh/src/ssh_sftpd_file.erl
index a287e8891b..311cdc1a3d 100644
--- a/lib/ssh/src/ssh_sftpd_file.erl
+++ b/lib/ssh/src/ssh_sftpd_file.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_sftpd_file_api.erl b/lib/ssh/src/ssh_sftpd_file_api.erl
index c61d4e7ecf..78f452df67 100644
--- a/lib/ssh/src/ssh_sftpd_file_api.erl
+++ b/lib/ssh/src/ssh_sftpd_file_api.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_shell.erl b/lib/ssh/src/ssh_shell.erl
index 22ad4da948..d31d5a297d 100644
--- a/lib/ssh/src/ssh_shell.erl
+++ b/lib/ssh/src/ssh_shell.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_subsystem_sup.erl b/lib/ssh/src/ssh_subsystem_sup.erl
index ebe33ec7da..11e02491c4 100644
--- a/lib/ssh/src/ssh_subsystem_sup.erl
+++ b/lib/ssh/src/ssh_subsystem_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_sup.erl b/lib/ssh/src/ssh_sup.erl
index 649ea00a06..f827594717 100644
--- a/lib/ssh/src/ssh_sup.erl
+++ b/lib/ssh/src/ssh_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_system_sup.erl b/lib/ssh/src/ssh_system_sup.erl
index 18a5d8071a..9a9786a914 100644
--- a/lib/ssh/src/ssh_system_sup.erl
+++ b/lib/ssh/src/ssh_system_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -192,6 +192,9 @@ stop_acceptor(Sup) ->
[{Name, AcceptorSup}] =
[{SupName, ASup} || {SupName, ASup, _, [ssh_acceptor_sup]} <-
supervisor:which_children(Sup)],
- supervisor:terminate_child(AcceptorSup, Name).
-
-
+ case supervisor:terminate_child(AcceptorSup, Name) of
+ ok ->
+ supervisor:delete_child(AcceptorSup, Name);
+ Error ->
+ Error
+ end.
diff --git a/lib/ssh/src/ssh_transport.erl b/lib/ssh/src/ssh_transport.erl
index a648c7af3d..7cb3b75ac0 100644
--- a/lib/ssh/src/ssh_transport.erl
+++ b/lib/ssh/src/ssh_transport.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -265,7 +265,8 @@ new_keys_message(Ssh0) ->
{SshPacket, Ssh} =
ssh_packet(#ssh_msg_newkeys{}, Ssh0),
{ok, SshPacket, Ssh}.
-
+
+
handle_kexinit_msg(#ssh_msg_kexinit{} = CounterPart, #ssh_msg_kexinit{} = Own,
#ssh{role = client} = Ssh0) ->
{ok, Algoritms} = select_algorithm(client, Own, CounterPart),
@@ -275,10 +276,10 @@ handle_kexinit_msg(#ssh_msg_kexinit{} = CounterPart, #ssh_msg_kexinit{} = Own,
Ssh0#ssh{algorithms = Algoritms});
_ ->
%% TODO: Correct code?
- throw(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
- description = "Selection of key exchange"
- " algorithm failed",
- language = ""})
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = "Selection of key exchange algorithm failed"
+ })
end;
handle_kexinit_msg(#ssh_msg_kexinit{} = CounterPart, #ssh_msg_kexinit{} = Own,
@@ -288,10 +289,10 @@ handle_kexinit_msg(#ssh_msg_kexinit{} = CounterPart, #ssh_msg_kexinit{} = Own,
true ->
{ok, Ssh#ssh{algorithms = Algoritms}};
_ ->
- throw(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
- description = "Selection of key exchange"
- " algorithm failed",
- language = ""})
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = "Selection of key exchange algorithm failed"
+ })
end.
@@ -371,12 +372,12 @@ handle_kexdh_init(#ssh_msg_kexdh_init{e = E},
session_id = sid(Ssh1, H)}};
true ->
- throw({{error,bad_e_from_peer},
- #ssh_msg_disconnect{
- code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
- description = "Key exchange failed, 'e' out of bounds",
- language = ""}
- })
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{
+ code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = "Key exchange failed, 'e' out of bounds"},
+ {error,bad_e_from_peer}
+ )
end.
handle_kexdh_reply(#ssh_msg_kexdh_reply{public_host_key = PeerPubHostKey,
@@ -396,21 +397,20 @@ handle_kexdh_reply(#ssh_msg_kexdh_reply{public_host_key = PeerPubHostKey,
exchanged_hash = H,
session_id = sid(Ssh, H)}};
Error ->
- throw({Error,
- #ssh_msg_disconnect{
- code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
- description = "Key exchange failed",
- language = "en"}
- })
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{
+ code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = "Key exchange failed"},
+ Error)
end;
true ->
- throw({{error,bad_f_from_peer},
- #ssh_msg_disconnect{
- code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
- description = "Key exchange failed, 'f' out of bounds",
- language = ""}
- })
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{
+ code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = "Key exchange failed, 'f' out of bounds"},
+ bad_f_from_peer
+ )
end.
@@ -435,10 +435,11 @@ handle_kex_dh_gex_request(#ssh_msg_kex_dh_gex_request{min = Min0,
keyex_info = {Min, Max, NBits}
}};
{error,_} ->
- throw(#ssh_msg_disconnect{
- code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
- description = "No possible diffie-hellman-group-exchange group found",
- language = ""})
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{
+ code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
+ description = "No possible diffie-hellman-group-exchange group found"
+ })
end;
handle_kex_dh_gex_request(#ssh_msg_kex_dh_gex_request_old{n = NBits},
@@ -469,19 +470,19 @@ handle_kex_dh_gex_request(#ssh_msg_kex_dh_gex_request_old{n = NBits},
keyex_info = {-1, -1, NBits} % flag for kex_h hash calc
}};
{error,_} ->
- throw(#ssh_msg_disconnect{
- code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
- description = "No possible diffie-hellman-group-exchange group found",
- language = ""})
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{
+ code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
+ description = "No possible diffie-hellman-group-exchange group found"
+ })
end;
handle_kex_dh_gex_request(_, _) ->
- throw({{error,bad_ssh_msg_kex_dh_gex_request},
+ ssh_connection_handler:disconnect(
#ssh_msg_disconnect{
code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
- description = "Key exchange failed, bad values in ssh_msg_kex_dh_gex_request",
- language = ""}
- }).
+ description = "Key exchange failed, bad values in ssh_msg_kex_dh_gex_request"},
+ bad_ssh_msg_kex_dh_gex_request).
adjust_gex_min_max(Min0, Max0, Opts) ->
@@ -495,10 +496,11 @@ adjust_gex_min_max(Min0, Max0, Opts) ->
Min2 =< Max2 ->
{Min2, Max2};
Max2 < Min2 ->
- throw(#ssh_msg_disconnect{
- code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
- description = "No possible diffie-hellman-group-exchange group possible",
- language = ""})
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{
+ code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
+ description = "No possible diffie-hellman-group-exchange group possible"
+ })
end
end.
@@ -535,20 +537,18 @@ handle_kex_dh_gex_init(#ssh_msg_kex_dh_gex_init{e = E},
session_id = sid(Ssh, H)
}};
true ->
- throw({{error,bad_K},
- #ssh_msg_disconnect{
- code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
- description = "Key exchange failed, 'K' out of bounds",
- language = ""}
- })
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{
+ code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = "Key exchange failed, 'K' out of bounds"},
+ bad_K)
end;
true ->
- throw({{error,bad_e_from_peer},
- #ssh_msg_disconnect{
- code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
- description = "Key exchange failed, 'e' out of bounds",
- language = ""}
- })
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{
+ code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = "Key exchange failed, 'e' out of bounds"},
+ bad_e_from_peer)
end.
handle_kex_dh_gex_reply(#ssh_msg_kex_dh_gex_reply{public_host_key = PeerPubHostKey,
@@ -572,29 +572,28 @@ handle_kex_dh_gex_reply(#ssh_msg_kex_dh_gex_reply{public_host_key = PeerPubHostK
exchanged_hash = H,
session_id = sid(Ssh, H)}};
_Error ->
- throw(#ssh_msg_disconnect{
- code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
- description = "Key exchange failed",
- language = ""}
- )
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{
+ code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = "Key exchange failed"
+ })
end;
true ->
- throw({{error,bad_K},
- #ssh_msg_disconnect{
- code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
- description = "Key exchange failed, 'K' out of bounds",
- language = ""}
- })
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{
+ code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = "Key exchange failed, 'K' out of bounds"},
+ bad_K)
end;
true ->
- throw({{error,bad_f_from_peer},
- #ssh_msg_disconnect{
- code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
- description = "Key exchange failed, 'f' out of bounds",
- language = ""}
- })
- end.
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{
+ code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = "Key exchange failed, 'f' out of bounds"},
+ bad_f_from_peer
+ )
+ end.
%%%----------------------------------------------------------------
%%%
@@ -624,12 +623,11 @@ handle_kex_ecdh_init(#ssh_msg_kex_ecdh_init{q_c = PeerPublic},
session_id = sid(Ssh1, H)}}
catch
_:_ ->
- throw({{error,invalid_peer_public_key},
- #ssh_msg_disconnect{
- code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
- description = "Peer ECDH public key is invalid",
- language = ""}
- })
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{
+ code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = "Peer ECDH public key is invalid"},
+ invalid_peer_public_key)
end.
handle_kex_ecdh_reply(#ssh_msg_kex_ecdh_reply{public_host_key = PeerPubHostKey,
@@ -650,21 +648,19 @@ handle_kex_ecdh_reply(#ssh_msg_kex_ecdh_reply{public_host_key = PeerPubHostKey,
exchanged_hash = H,
session_id = sid(Ssh, H)}};
Error ->
- throw({Error,
- #ssh_msg_disconnect{
- code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
- description = "Key exchange failed",
- language = ""}
- })
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{
+ code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = "Key exchange failed"},
+ Error)
end
catch
_:_ ->
- throw({{error,invalid_peer_public_key},
- #ssh_msg_disconnect{
- code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
- description = "Peer ECDH public key is invalid",
- language = ""}
- })
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{
+ code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = "Peer ECDH public key is invalid"},
+ invalid_peer_public_key)
end.
@@ -675,9 +671,10 @@ handle_new_keys(#ssh_msg_newkeys{}, Ssh0) ->
{ok, Ssh}
catch
_C:_Error -> %% TODO: Throw earlier ....
- throw(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
- description = "Install alg failed",
- language = "en"})
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
+ description = "Install alg failed"
+ })
end.
%% select session id
@@ -929,9 +926,9 @@ select_all(CL, SL) when length(CL) + length(SL) < ?MAX_NUM_ALGORITHMS ->
lists:map(fun(ALG) -> list_to_atom(ALG) end, (CL -- A));
select_all(CL, SL) ->
Err = lists:concat(["Received too many algorithms (",length(CL),"+",length(SL)," >= ",?MAX_NUM_ALGORITHMS,")."]),
- throw(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
- description = Err,
- language = ""}).
+ ssh_connection_handler:disconnect(
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_PROTOCOL_ERROR,
+ description = Err}).
select([], []) ->
@@ -1042,7 +1039,7 @@ handle_packet_part(DecryptedPfx, EncryptedBuffer, TotalNeeded,
{bad_mac, Ssh1};
true ->
{Ssh, DecompressedPayload} = decompress(Ssh1, payload(DecryptedPacket)),
- {decoded, DecompressedPayload, NextPacketBytes, Ssh}
+ {packet_decrypted, DecompressedPayload, NextPacketBytes, Ssh}
end;
aead ->
PacketLenBin = DecryptedPfx,
@@ -1052,7 +1049,7 @@ handle_packet_part(DecryptedPfx, EncryptedBuffer, TotalNeeded,
{Ssh1, DecryptedSfx} ->
DecryptedPacket = <<DecryptedPfx/binary, DecryptedSfx/binary>>,
{Ssh, DecompressedPayload} = decompress(Ssh1, payload(DecryptedPacket)),
- {decoded, DecompressedPayload, NextPacketBytes, Ssh}
+ {packet_decrypted, DecompressedPayload, NextPacketBytes, Ssh}
end
end.
diff --git a/lib/ssh/src/ssh_transport.hrl b/lib/ssh/src/ssh_transport.hrl
index fd43326f0d..f91cb1dd63 100644
--- a/lib/ssh/src/ssh_transport.hrl
+++ b/lib/ssh/src/ssh_transport.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_userauth.hrl b/lib/ssh/src/ssh_userauth.hrl
index 935999b9d1..2cfc1f0f83 100644
--- a/lib/ssh/src/ssh_userauth.hrl
+++ b/lib/ssh/src/ssh_userauth.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_xfer.erl b/lib/ssh/src/ssh_xfer.erl
index 259dc71aa5..e1680c120e 100644
--- a/lib/ssh/src/ssh_xfer.erl
+++ b/lib/ssh/src/ssh_xfer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/ssh_xfer.hrl b/lib/ssh/src/ssh_xfer.hrl
index fe1405ccae..a76e9151db 100644
--- a/lib/ssh/src/ssh_xfer.hrl
+++ b/lib/ssh/src/ssh_xfer.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/src/sshc_sup.erl b/lib/ssh/src/sshc_sup.erl
index 8ee6aacfb5..71b5c2c46a 100644
--- a/lib/ssh/src/sshc_sup.erl
+++ b/lib/ssh/src/sshc_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -64,7 +64,7 @@ child_spec(_) ->
Name = undefined, % As simple_one_for_one is used.
StartFunc = {ssh_connection_handler, start_link, []},
Restart = temporary,
- Shutdown = infinity,
+ Shutdown = 4000,
Modules = [ssh_connection_handler],
- Type = supervisor,
+ Type = worker,
{Name, StartFunc, Restart, Shutdown, Type, Modules}.
diff --git a/lib/ssh/src/sshd_sup.erl b/lib/ssh/src/sshd_sup.erl
index 7975b146fb..ac9e232b3a 100644
--- a/lib/ssh/src/sshd_sup.erl
+++ b/lib/ssh/src/sshd_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/test/Makefile b/lib/ssh/test/Makefile
index fb539f98fa..6ce6d6f537 100644
--- a/lib/ssh/test/Makefile
+++ b/lib/ssh/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2013. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -55,6 +55,7 @@ MODULES= \
ssh_relay
HRL_FILES_NEEDED_IN_TEST= \
+ $(ERL_TOP)/lib/ssh/test/ssh_test_lib.hrl \
$(ERL_TOP)/lib/ssh/src/ssh.hrl \
$(ERL_TOP)/lib/ssh/src/ssh_xfer.hrl
diff --git a/lib/ssh/test/property_test/ssh_eqc_client_server.erl b/lib/ssh/test/property_test/ssh_eqc_client_server.erl
index 4fcb5aea69..39d0b4e410 100644
--- a/lib/ssh/test/property_test/ssh_eqc_client_server.erl
+++ b/lib/ssh/test/property_test/ssh_eqc_client_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/test/property_test/ssh_eqc_encode_decode.erl b/lib/ssh/test/property_test/ssh_eqc_encode_decode.erl
index 803c8aa2ad..dc3b7dc7e6 100644
--- a/lib/ssh/test/property_test/ssh_eqc_encode_decode.erl
+++ b/lib/ssh/test/property_test/ssh_eqc_encode_decode.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/test/property_test/ssh_eqc_subsys.erl b/lib/ssh/test/property_test/ssh_eqc_subsys.erl
index 3b395b9285..30b254b9c0 100644
--- a/lib/ssh/test/property_test/ssh_eqc_subsys.erl
+++ b/lib/ssh/test/property_test/ssh_eqc_subsys.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/test/ssh_algorithms_SUITE.erl b/lib/ssh/test/ssh_algorithms_SUITE.erl
index 49ed15698c..9910b8f1d7 100644
--- a/lib/ssh/test/ssh_algorithms_SUITE.erl
+++ b/lib/ssh/test/ssh_algorithms_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
%% Note: This directive should only be used in test suites.
-compile(export_all).
--define(TIMEOUT, 50000).
+-define(TIMEOUT, 10000).
%%--------------------------------------------------------------------
%% Common Test interface functions -----------------------------------
@@ -36,7 +36,7 @@
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,10}}].
+ {timetrap,{seconds,40}}].
all() ->
%% [{group,kex},{group,cipher}... etc
@@ -191,6 +191,9 @@ simple_exec_groups_no_match_too_large(Config) ->
%%--------------------------------------------------------------------
%% Testing all default groups
+
+simple_exec_groups() -> [{timetrap,{minutes,5}}].
+
simple_exec_groups(Config) ->
Sizes = interpolate( public_key:dh_gex_group_sizes() ),
lists:foreach(
@@ -217,24 +220,19 @@ interpolate(Is) ->
%%--------------------------------------------------------------------
%% Use the ssh client of the OS to connect
+
sshc_simple_exec(Config) ->
PrivDir = ?config(priv_dir, Config),
KnownHosts = filename:join(PrivDir, "known_hosts"),
{Host,Port} = ?config(srvr_addr, Config),
Cmd = lists:concat(["ssh -p ",Port,
- " -C -o UserKnownHostsFile=",KnownHosts,
+ " -C",
+ " -o UserKnownHostsFile=",KnownHosts,
+ " -o StrictHostKeyChecking=no",
" ",Host," 1+1."]),
ct:log("~p",[Cmd]),
- SshPort = open_port({spawn, Cmd}, [binary]),
- Expect = <<"2\n">>,
- receive
- {SshPort, {data,Expect}} ->
- ct:log("Got expected ~p from ~p",[Expect,SshPort]),
- catch port_close(SshPort),
- ok
- after ?TIMEOUT ->
- ct:fail("Did not receive answer")
- end.
+ OpenSsh = ssh_test_lib:open_port({spawn, Cmd}, [eof,exit_status]),
+ ssh_test_lib:rcv_expected({data,<<"2\n">>}, OpenSsh, ?TIMEOUT).
%%--------------------------------------------------------------------
%% Connect to the ssh server of the OS
@@ -348,13 +346,15 @@ get_atoms(L) ->
%%% Test case related
%%%
start_std_daemon(Opts, Config) ->
+ ct:log("starting std_daemon",[]),
{Pid, Host, Port} = ssh_test_lib:std_daemon(Config, Opts),
ct:log("started ~p:~p ~p",[Host,Port,Opts]),
[{srvr_pid,Pid},{srvr_addr,{Host,Port}} | Config].
-start_pubkey_daemon(Opts, Config) ->
+start_pubkey_daemon(Opts0, Config) ->
+ Opts = [{auth_methods,"publickey"}|Opts0],
{Pid, Host, Port} = ssh_test_lib:std_daemon1(Config, Opts),
- ct:log("started1 ~p:~p ~p",[Host,Port,Opts]),
+ ct:log("started pubkey_daemon ~p:~p ~p",[Host,Port,Opts]),
[{srvr_pid,Pid},{srvr_addr,{Host,Port}} | Config].
diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl
index 094d28e879..0fa44ded4f 100644
--- a/lib/ssh/test/ssh_basic_SUITE.erl
+++ b/lib/ssh/test/ssh_basic_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -79,7 +79,7 @@
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,10}}].
+ {timetrap,{seconds,40}}].
all() ->
[app_test,
diff --git a/lib/ssh/test/ssh_benchmark_SUITE.erl b/lib/ssh/test/ssh_benchmark_SUITE.erl
index fe90da3028..d9be1a32b7 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE.erl
+++ b/lib/ssh/test/ssh_benchmark_SUITE.erl
@@ -1,7 +1,7 @@
%%%-------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2015. All Rights Reserved.
+%% Copyright Ericsson AB 2015-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -104,7 +104,7 @@ init_sftp_dirs(Config) ->
DstDir = filename:join(UserDir, "sftp_dst"),
ok = file:make_dir(DstDir),
N = 100 * 1024*1024,
- ok = file:write_file(filename:join(SrcDir,SrcFile), crypto:rand_bytes(N)),
+ ok = file:write_file(filename:join(SrcDir,SrcFile), crypto:strong_rand_bytes(N)),
[{sftp_src_dir,SrcDir}, {sftp_dst_dir,DstDir}, {src_file,SrcFile}, {sftp_size,N}
| Config].
@@ -333,52 +333,64 @@ find_time(accept_to_hello, L) ->
[T0,T1] = find([fun(C=#call{mfa = {ssh_acceptor,handle_connection,5}}) ->
C#call.t_call
end,
- fun(C=#call{mfa = {ssh_connection_handler,hello,_},
- args = [socket_control|_]}) ->
- C#call.t_return
- end
+ ?LINE,
+ fun(C=#call{mfa = {ssh_connection_handler,handle_event,4},
+ args = [_, {version_exchange,_}, {hello,_}, _]}) ->
+ C#call.t_call
+ end,
+ ?LINE
], L, []),
{accept_to_hello, now2micro_sec(now_diff(T1,T0)), microsec};
find_time(kex, L) ->
- [T0,T1] = find([fun(C=#call{mfa = {ssh_connection_handler,hello,_},
- args = [socket_control|_]}) ->
+ [T0,T1] = find([fun(C=#call{mfa = {ssh_connection_handler,handle_event,4},
+ args = [_, {version_exchange,_}, {hello,_}, _]}) ->
C#call.t_call
end,
- ?send(#ssh_msg_newkeys{})
+ ?LINE,
+ ?send(#ssh_msg_newkeys{}),
+ ?LINE
], L, []),
{kex, now2micro_sec(now_diff(T1,T0)), microsec};
find_time(kex_to_auth, L) ->
[T0,T1] = find([?send(#ssh_msg_newkeys{}),
- ?recv(#ssh_msg_userauth_request{})
+ ?LINE,
+ ?recv(#ssh_msg_userauth_request{}),
+ ?LINE
], L, []),
{kex_to_auth, now2micro_sec(now_diff(T1,T0)), microsec};
find_time(auth, L) ->
[T0,T1] = find([?recv(#ssh_msg_userauth_request{}),
- ?send(#ssh_msg_userauth_success{})
+ ?LINE,
+ ?send(#ssh_msg_userauth_success{}),
+ ?LINE
], L, []),
{auth, now2micro_sec(now_diff(T1,T0)), microsec};
find_time(to_prompt, L) ->
[T0,T1] = find([fun(C=#call{mfa = {ssh_acceptor,handle_connection,5}}) ->
C#call.t_call
end,
- ?recv(#ssh_msg_channel_request{request_type="env"})
+ ?LINE,
+ ?recv(#ssh_msg_channel_request{request_type="env"}),
+ ?LINE
], L, []),
{to_prompt, now2micro_sec(now_diff(T1,T0)), microsec};
find_time(channel_open_close, L) ->
[T0,T1] = find([?recv(#ssh_msg_channel_request{request_type="subsystem"}),
- ?send(#ssh_msg_channel_close{})
+ ?LINE,
+ ?send(#ssh_msg_channel_close{}),
+ ?LINE
], L, []),
{channel_open_close, now2micro_sec(now_diff(T1,T0)), microsec}.
-find([F|Fs], [C|Cs], Acc) when is_function(F,1) ->
+find([F,Id|Fs], [C|Cs], Acc) when is_function(F,1) ->
try
F(C)
of
T -> find(Fs, Cs, [T|Acc])
catch
- _:_ -> find([F|Fs], Cs, Acc)
+ _:_ -> find([F,Id|Fs], Cs, Acc)
end;
find([], _, Acc) ->
lists:reverse(Acc).
@@ -444,7 +456,7 @@ erlang_trace() ->
0 = erlang:trace(new, true, [call,timestamp,{tracer,TracerPid}]),
[init_trace(MFA, tp(MFA))
|| MFA <- [{ssh_acceptor,handle_connection,5},
- {ssh_connection_handler,hello,2},
+%% {ssh_connection_handler,hello,2},
{ssh_message,encode,1},
{ssh_message,decode,1},
{ssh_transport,select_algorithm,3},
@@ -454,6 +466,10 @@ erlang_trace() ->
{ssh_message,decode,1},
{public_key,dh_gex_group,4} % To find dh_gex group size
]],
+ init_trace({ssh_connection_handler,handle_event,4},
+ [{['_', {version_exchange,'_'}, {hello,'_'}, '_'],
+ [],
+ [return_trace]}]),
{ok, TracerPid}.
tp({_M,_F,Arity}) ->
diff --git a/lib/ssh/test/ssh_connection_SUITE.erl b/lib/ssh/test/ssh_connection_SUITE.erl
index 6e90faf0e8..0f757a0322 100644
--- a/lib/ssh/test/ssh_connection_SUITE.erl
+++ b/lib/ssh/test/ssh_connection_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
-include_lib("common_test/include/ct.hrl").
-include_lib("ssh/src/ssh_connect.hrl").
+-include("ssh_test_lib.hrl").
-compile(export_all).
@@ -37,7 +38,7 @@
%% [{ct_hooks,[ts_install_cth]}].
suite() ->
- [{timetrap,{minutes,2}}].
+ [{timetrap,{seconds,40}}].
all() ->
[
@@ -314,11 +315,7 @@ ptty_alloc_pixel(Config) when is_list(Config) ->
ssh:close(ConnectionRef).
%%--------------------------------------------------------------------
-
-interrupted_send() ->
- [{doc, "Use a subsystem that echos n char and then sends eof to cause a channel exit partway through a large send."}].
-
-interrupted_send(Config) when is_list(Config) ->
+interrupted_send(Config) ->
PrivDir = ?config(priv_dir, Config),
UserDir = filename:join(PrivDir, nopubkey), % to make sure we don't use public-key-auth
file:make_dir(UserDir),
@@ -659,15 +656,21 @@ max_channels_option(Config) when is_list(Config) ->
{user_interaction, true},
{user_dir, UserDir}]),
+ %% Allocate a number of ChannelId:s to play with. (This operation is not
+ %% counted by the max_channel option).
{ok, ChannelId0} = ssh_connection:session_channel(ConnectionRef, infinity),
{ok, ChannelId1} = ssh_connection:session_channel(ConnectionRef, infinity),
{ok, ChannelId2} = ssh_connection:session_channel(ConnectionRef, infinity),
{ok, ChannelId3} = ssh_connection:session_channel(ConnectionRef, infinity),
{ok, ChannelId4} = ssh_connection:session_channel(ConnectionRef, infinity),
{ok, ChannelId5} = ssh_connection:session_channel(ConnectionRef, infinity),
- {ok, _ChannelId6} = ssh_connection:session_channel(ConnectionRef, infinity),
+ {ok, ChannelId6} = ssh_connection:session_channel(ConnectionRef, infinity),
+ {ok, _ChannelId7} = ssh_connection:session_channel(ConnectionRef, infinity),
- %%%---- shell
+ %% Now start to open the channels (this is counted my max_channels) to check that
+ %% it gives a failure at right place
+
+ %%%---- Channel 1(3): shell
ok = ssh_connection:shell(ConnectionRef,ChannelId0),
receive
{ssh_cm,ConnectionRef, {data, ChannelId0, 0, <<"Eshell",_/binary>>}} ->
@@ -676,10 +679,10 @@ max_channels_option(Config) when is_list(Config) ->
ct:fail("CLI Timeout")
end,
- %%%---- subsystem "echo_n"
+ %%%---- Channel 2(3): subsystem "echo_n"
success = ssh_connection:subsystem(ConnectionRef, ChannelId1, "echo_n", infinity),
- %%%---- exec #1
+ %%%---- Channel 3(3): exec. This closes itself.
success = ssh_connection:exec(ConnectionRef, ChannelId2, "testing1.\n", infinity),
receive
{ssh_cm, ConnectionRef, {data, ChannelId2, 0, <<"testing1",_/binary>>}} ->
@@ -688,13 +691,13 @@ max_channels_option(Config) when is_list(Config) ->
ct:fail("Exec #1 Timeout")
end,
- %%%---- ptty
- success = ssh_connection:ptty_alloc(ConnectionRef, ChannelId3, []),
+ %%%---- Channel 3(3): subsystem "echo_n" (Note that ChannelId2 should be closed now)
+ ?wait_match(success, ssh_connection:subsystem(ConnectionRef, ChannelId3, "echo_n", infinity)),
- %%%---- exec #2
+ %%%---- Channel 4(3) !: exec This should fail
failure = ssh_connection:exec(ConnectionRef, ChannelId4, "testing2.\n", infinity),
- %%%---- close the shell
+ %%%---- close the shell (Frees one channel)
ok = ssh_connection:send(ConnectionRef, ChannelId0, "exit().\n", 5000),
%%%---- wait for the subsystem to terminate
@@ -707,14 +710,11 @@ max_channels_option(Config) when is_list(Config) ->
ct:fail("exit Timeout",[])
end,
- %%%---- exec #3
- success = ssh_connection:exec(ConnectionRef, ChannelId5, "testing3.\n", infinity),
- receive
- {ssh_cm, ConnectionRef, {data, ChannelId5, 0, <<"testing3",_/binary>>}} ->
- ok
- after 5000 ->
- ct:fail("Exec #3 Timeout")
- end,
+ %%---- Try that we can open one channel instead of the closed one
+ ?wait_match(success, ssh_connection:subsystem(ConnectionRef, ChannelId5, "echo_n", infinity)),
+
+ %%---- But not a fourth one...
+ failure = ssh_connection:subsystem(ConnectionRef, ChannelId6, "echo_n", infinity),
ssh:close(ConnectionRef),
ssh:stop_daemon(Pid).
diff --git a/lib/ssh/test/ssh_echo_server.erl b/lib/ssh/test/ssh_echo_server.erl
index 96c9aad135..ed9bbe1b67 100644
--- a/lib/ssh/test/ssh_echo_server.erl
+++ b/lib/ssh/test/ssh_echo_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -31,6 +31,7 @@
-export([init/1, handle_msg/2, handle_ssh_msg/2, terminate/2]).
init([N]) ->
+ ct:pal("Echo server: ~p",[self()]),
{ok, #state{n = N}}.
handle_msg({ssh_channel_up, ChannelId, ConnectionManager}, State) ->
diff --git a/lib/ssh/test/ssh_options_SUITE.erl b/lib/ssh/test/ssh_options_SUITE.erl
index ba0107efd6..4ca6a473fa 100644
--- a/lib/ssh/test/ssh_options_SUITE.erl
+++ b/lib/ssh/test/ssh_options_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -51,8 +51,8 @@
ssh_connect_arg4_timeout/1,
ssh_connect_negtimeout_parallel/1,
ssh_connect_negtimeout_sequential/1,
- ssh_connect_nonegtimeout_connected_parallel/1,
- ssh_connect_nonegtimeout_connected_sequential/1,
+ ssh_connect_nonegtimeout_connected_parallel/1,
+ ssh_connect_nonegtimeout_connected_sequential/1,
ssh_connect_timeout/1, connect/4,
ssh_daemon_minimal_remote_max_packet_size_option/1,
ssh_msg_debug_fun_option_client/1,
@@ -80,7 +80,7 @@
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,6}}].
+ {timetrap,{seconds,30}}].
all() ->
[connectfun_disconnectfun_server,
@@ -491,7 +491,7 @@ ssh_msg_debug_fun_option_client(Config) ->
{user_interaction, false},
{ssh_msg_debug_fun,DbgFun}]),
%% Beware, implementation knowledge:
- gen_fsm:send_all_state_event(ConnectionRef,{ssh_msg_debug,false,<<"Hello">>,<<>>}),
+ gen_statem:cast(ConnectionRef,{ssh_msg_debug,false,<<"Hello">>,<<>>}),
receive
{msg_dbg,X={ConnectionRef,false,<<"Hello">>,<<>>}} ->
ct:log("Got expected dbg msg ~p",[X]),
@@ -604,7 +604,7 @@ ssh_msg_debug_fun_option_server(Config) ->
receive
{connection_pid,Server} ->
%% Beware, implementation knowledge:
- gen_fsm:send_all_state_event(Server,{ssh_msg_debug,false,<<"Hello">>,<<>>}),
+ gen_statem:cast(Server,{ssh_msg_debug,false,<<"Hello">>,<<>>}),
receive
{msg_dbg,X={_,false,<<"Hello">>,<<>>}} ->
ct:log("Got expected dbg msg ~p",[X]),
@@ -992,7 +992,7 @@ ssh_connect_nonegtimeout_connected(Config, Parallel) ->
process_flag(trap_exit, true),
SystemDir = filename:join(?config(priv_dir, Config), system),
UserDir = ?config(priv_dir, Config),
- NegTimeOut = 20000, % ms
+ NegTimeOut = 2000, % ms
ct:log("Parallel: ~p",[Parallel]),
{_Pid, _Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},{user_dir, UserDir},
@@ -1123,21 +1123,7 @@ max_sessions(Config, ParallelLogin, Connect0) when is_function(Connect0,2) ->
%% This is expected
%% Now stop one connection and try to open one more
ok = ssh:close(hd(Connections)),
- receive after 250 -> ok end, % sleep so the supervisor has time to count down. Not nice...
- try Connect(Host,Port)
- of
- _ConnectionRef1 ->
- %% Step 3 ok: could set up one more connection after killing one
- %% Thats good.
- ssh:stop_daemon(Pid),
- ok
- catch
- error:{badmatch,{error,"Connection closed"}} ->
- %% Bad indeed. Could not set up one more connection even after killing
- %% one existing. Very bad.
- ssh:stop_daemon(Pid),
- {fail,"Does not decrease # active sessions"}
- end
+ try_to_connect(Connect, Host, Port, Pid)
end
catch
error:{badmatch,{error,"Connection closed"}} ->
@@ -1145,6 +1131,35 @@ max_sessions(Config, ParallelLogin, Connect0) when is_function(Connect0,2) ->
{fail,"Too few connections accepted"}
end.
+
+try_to_connect(Connect, Host, Port, Pid) ->
+ {ok,Tref} = timer:send_after(3000, timeout_no_connection), % give the supervisors some time...
+ try_to_connect(Connect, Host, Port, Pid, Tref, 1). % will take max 3300 ms after 11 tries
+
+try_to_connect(Connect, Host, Port, Pid, Tref, N) ->
+ try Connect(Host,Port)
+ of
+ _ConnectionRef1 ->
+ %% Step 3 ok: could set up one more connection after killing one
+ %% Thats good.
+ timer:cancel(Tref),
+ ssh:stop_daemon(Pid),
+ receive % flush.
+ timeout_no_connection -> ok
+ after 0 -> ok
+ end
+ catch
+ error:{badmatch,{error,"Connection closed"}} ->
+ %% Could not set up one more connection. Try again until timeout.
+ receive
+ timeout_no_connection ->
+ ssh:stop_daemon(Pid),
+ {fail,"Does not decrease # active sessions"}
+ after N*50 -> % retry after this time
+ try_to_connect(Connect, Host, Port, Pid, Tref, N+1)
+ end
+ end.
+
%%--------------------------------------------------------------------
%% Internal functions ------------------------------------------------
%%--------------------------------------------------------------------
diff --git a/lib/ssh/test/ssh_peername_sockname_server.erl b/lib/ssh/test/ssh_peername_sockname_server.erl
index 88c96fe444..8731d80f62 100644
--- a/lib/ssh/test/ssh_peername_sockname_server.erl
+++ b/lib/ssh/test/ssh_peername_sockname_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/test/ssh_property_test_SUITE.erl b/lib/ssh/test/ssh_property_test_SUITE.erl
index 2278719f6a..c5cc36c45e 100644
--- a/lib/ssh/test/ssh_property_test_SUITE.erl
+++ b/lib/ssh/test/ssh_property_test_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/test/ssh_protocol_SUITE.erl b/lib/ssh/test/ssh_protocol_SUITE.erl
index dbba48c726..57404f40db 100644
--- a/lib/ssh/test/ssh_protocol_SUITE.erl
+++ b/lib/ssh/test/ssh_protocol_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. 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
@@ -43,7 +43,7 @@
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,2}}].
+ {timetrap,{seconds,40}}].
all() ->
[{group,tool_tests},
diff --git a/lib/ssh/test/ssh_renegotiate_SUITE.erl b/lib/ssh/test/ssh_renegotiate_SUITE.erl
index 6d2c97aa68..f1a909cbd0 100644
--- a/lib/ssh/test/ssh_renegotiate_SUITE.erl
+++ b/lib/ssh/test/ssh_renegotiate_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -31,8 +31,7 @@
%%--------------------------------------------------------------------
suite() -> [{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,12}}].
-
+ {timetrap,{seconds,40}}].
all() -> [{group,default_algs},
{group,aes_gcm}
@@ -83,7 +82,8 @@ end_per_testcase(_TestCase, _Config) ->
%%--------------------------------------------------------------------
%%% Idle timeout test
-
+rekey() -> [{timetrap,{seconds,90}}].
+
rekey(Config) ->
{Pid, Host, Port} =
ssh_test_lib:std_daemon(Config,
@@ -105,6 +105,8 @@ rekey(Config) ->
%%% Test rekeying by data volume
+rekey_limit() -> [{timetrap,{seconds,400}}].
+
rekey_limit(Config) ->
UserDir = ?config(priv_dir, Config),
DataFile = filename:join(UserDir, "rekey.data"),
@@ -235,7 +237,7 @@ renegotiate2(Config) ->
%% get_kex_init - helper function to get key_exchange_init_msg
get_kex_init(Conn) ->
%% First, validate the key exchange is complete (StateName == connected)
- {connected,S} = sys:get_state(Conn),
+ {{connected,_},S} = sys:get_state(Conn),
%% Next, walk through the elements of the #state record looking
%% for the #ssh_msg_kexinit record. This method is robust against
%% changes to either record. The KEXINIT message contains a cookie
diff --git a/lib/ssh/test/ssh_sftp_SUITE.erl b/lib/ssh/test/ssh_sftp_SUITE.erl
index c2b04d7a05..f6d7be41d6 100644
--- a/lib/ssh/test/ssh_sftp_SUITE.erl
+++ b/lib/ssh/test/ssh_sftp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -36,8 +36,7 @@
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,2}}].
-
+ {timetrap,{seconds,40}}].
all() ->
[{group, not_unicode},
@@ -301,9 +300,9 @@ end_per_testcase(_, Config) ->
end_per_testcase(Config) ->
{Sftp, Connection} = ?config(sftp, Config),
- ssh_sftp:stop_channel(Sftp),
+ ok = ssh_sftp:stop_channel(Sftp),
catch ssh_sftp:stop_channel(?config(channel_pid2, Config)),
- ssh:close(Connection).
+ ok = ssh:close(Connection).
%%--------------------------------------------------------------------
%% Test Cases --------------------------------------------------------
@@ -365,7 +364,7 @@ write_file(Config) when is_list(Config) ->
{Sftp, _} = ?config(sftp, Config),
Data = list_to_binary("Hej hopp!"),
- ssh_sftp:write_file(Sftp, FileName, [Data]),
+ ok = ssh_sftp:write_file(Sftp, FileName, [Data]),
{ok, Data} = file:read_file(FileName).
%%--------------------------------------------------------------------
@@ -378,7 +377,7 @@ write_file_iolist(Config) when is_list(Config) ->
Data = list_to_binary("Hej hopp!"),
lists:foreach(
fun(D) ->
- ssh_sftp:write_file(Sftp, FileName, [D]),
+ ok = ssh_sftp:write_file(Sftp, FileName, [D]),
Expected = if is_binary(D) -> D;
is_list(D) -> list_to_binary(D)
end,
@@ -397,7 +396,7 @@ write_big_file(Config) when is_list(Config) ->
{Sftp, _} = ?config(sftp, Config),
Data = list_to_binary(lists:duplicate(750000,"a")),
- ssh_sftp:write_file(Sftp, FileName, [Data]),
+ ok = ssh_sftp:write_file(Sftp, FileName, [Data]),
{ok, Data} = file:read_file(FileName).
%%--------------------------------------------------------------------
@@ -409,7 +408,7 @@ sftp_read_big_file(Config) when is_list(Config) ->
Data = list_to_binary(lists:duplicate(750000,"a")),
ct:log("Data size to write is ~p bytes",[size(Data)]),
- ssh_sftp:write_file(Sftp, FileName, [Data]),
+ ok = ssh_sftp:write_file(Sftp, FileName, [Data]),
{ok, Data} = ssh_sftp:read_file(Sftp, FileName).
%%--------------------------------------------------------------------
@@ -425,7 +424,7 @@ remove_file(Config) when is_list(Config) ->
ok = ssh_sftp:delete(Sftp, FileName),
{ok, NewFiles} = ssh_sftp:list_dir(Sftp, PrivDir),
false = lists:member(filename:basename(FileName), NewFiles),
- {error, _} = ssh_sftp:delete(Sftp, FileName).
+ {error, no_such_file} = ssh_sftp:delete(Sftp, FileName).
%%--------------------------------------------------------------------
rename_file() ->
[{doc, "Test API function rename_file/2"}].
@@ -500,7 +499,7 @@ set_attributes(Config) when is_list(Config) ->
io:put_chars(Fd,"foo"),
ok = ssh_sftp:write_file_info(Sftp, FileName, #file_info{mode=8#400}),
{error, eacces} = file:write_file(FileName, "hello again"),
- ssh_sftp:write_file_info(Sftp, FileName, #file_info{mode=8#600}),
+ ok = ssh_sftp:write_file_info(Sftp, FileName, #file_info{mode=8#600}),
ok = file:write_file(FileName, "hello again").
%%--------------------------------------------------------------------
@@ -549,7 +548,7 @@ position(Config) when is_list(Config) ->
{Sftp, _} = ?config(sftp, Config),
Data = list_to_binary("1234567890"),
- ssh_sftp:write_file(Sftp, FileName, [Data]),
+ ok = ssh_sftp:write_file(Sftp, FileName, [Data]),
{ok, Handle} = ssh_sftp:open(Sftp, FileName, [read]),
{ok, 3} = ssh_sftp:position(Sftp, Handle, {bof, 3}),
@@ -577,7 +576,7 @@ pos_read(Config) when is_list(Config) ->
FileName = ?config(testfile, Config),
{Sftp, _} = ?config(sftp, Config),
Data = list_to_binary("Hej hopp!"),
- ssh_sftp:write_file(Sftp, FileName, [Data]),
+ ok = ssh_sftp:write_file(Sftp, FileName, [Data]),
{ok, Handle} = ssh_sftp:open(Sftp, FileName, [read]),
{async, Ref} = ssh_sftp:apread(Sftp, Handle, {bof, 5}, 4),
@@ -607,7 +606,7 @@ pos_write(Config) when is_list(Config) ->
{ok, Handle} = ssh_sftp:open(Sftp, FileName, [write]),
Data = list_to_binary("Bye,"),
- ssh_sftp:write_file(Sftp, FileName, [Data]),
+ ok = ssh_sftp:write_file(Sftp, FileName, [Data]),
NewData = list_to_binary(" see you tomorrow"),
{async, Ref} = ssh_sftp:apwrite(Sftp, Handle, {bof, 4}, NewData),
@@ -869,7 +868,7 @@ aes_cbc256_crypto_tar(Config) ->
{"d1",fn("d1",Config)} % Dir
]),
Key = <<"This is a 256 bit key. Boring...">>,
- Ivec0 = crypto:rand_bytes(16),
+ Ivec0 = crypto:strong_rand_bytes(16),
DataSize = 1024, % data_size rem 16 = 0 for aes_cbc
Cinitw = fun() -> {ok, Ivec0, DataSize} end,
@@ -914,7 +913,7 @@ aes_ctr_stream_crypto_tar(Config) ->
{"d1",fn("d1",Config)} % Dir
]),
Key = <<"This is a 256 bit key. Boring...">>,
- Ivec0 = crypto:rand_bytes(16),
+ Ivec0 = crypto:strong_rand_bytes(16),
Cinitw = Cinitr = fun() -> {ok, crypto:stream_init(aes_ctr,Key,Ivec0)} end,
diff --git a/lib/ssh/test/ssh_sftpd_SUITE.erl b/lib/ssh/test/ssh_sftpd_SUITE.erl
index 45439ce0fa..9385bd127d 100644
--- a/lib/ssh/test/ssh_sftpd_SUITE.erl
+++ b/lib/ssh/test/ssh_sftpd_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@
%%--------------------------------------------------------------------
suite() ->
- [{timetrap,{minutes,3}}].
+ [{timetrap,{seconds,40}}].
all() ->
[open_close_file,
@@ -105,7 +105,6 @@ init_per_testcase(TestCase, Config) ->
ClientUserDir = filename:join(PrivDir, nopubkey),
SystemDir = filename:join(?config(priv_dir, Config), system),
- Port = ssh_test_lib:inet_port(node()),
Options = [{system_dir, SystemDir},
{user_dir, PrivDir},
{user_passwords,[{?USER, ?PASSWD}]},
@@ -113,11 +112,13 @@ init_per_testcase(TestCase, Config) ->
{ok, Sftpd} = case TestCase of
ver6_basic ->
SubSystems = [ssh_sftpd:subsystem_spec([{sftpd_vsn, 6}])],
- ssh:daemon(Port, [{subsystems, SubSystems}|Options]);
+ ssh:daemon(0, [{subsystems, SubSystems}|Options]);
_ ->
SubSystems = [ssh_sftpd:subsystem_spec([])],
- ssh:daemon(Port, [{subsystems, SubSystems}|Options])
+ ssh:daemon(0, [{subsystems, SubSystems}|Options])
end,
+ {ok,Dinf} = ssh:daemon_info(Sftpd),
+ Port = proplists:get_value(port, Dinf),
Cm = ssh_test_lib:connect(Port,
[{user_dir, ClientUserDir},
diff --git a/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl b/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl
index 02a2ac4cf9..355ce6a8f5 100644
--- a/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl
+++ b/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -37,8 +37,7 @@
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,2}}].
-
+ {timetrap,{seconds,40}}].
all() ->
[close_file,
diff --git a/lib/ssh/test/ssh_sftpd_erlclient_SUITE_data/ssh_sftpd_file_alt.erl b/lib/ssh/test/ssh_sftpd_erlclient_SUITE_data/ssh_sftpd_file_alt.erl
index 4f494cf829..6cfa8ee83f 100644
--- a/lib/ssh/test/ssh_sftpd_erlclient_SUITE_data/ssh_sftpd_file_alt.erl
+++ b/lib/ssh/test/ssh_sftpd_erlclient_SUITE_data/ssh_sftpd_file_alt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssh/test/ssh_sup_SUITE.erl b/lib/ssh/test/ssh_sup_SUITE.erl
index 18e91a9af3..f8929b30ff 100644
--- a/lib/ssh/test/ssh_sup_SUITE.erl
+++ b/lib/ssh/test/ssh_sup_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2015-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2015-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -22,21 +22,23 @@
-module(ssh_sup_SUITE).
-include_lib("common_test/include/ct.hrl").
-include_lib("ssh/src/ssh.hrl").
+-include("ssh_test_lib.hrl").
%% Note: This directive should only be used in test suites.
-compile(export_all).
--define(WAIT_FOR_SHUTDOWN, 500).
-define(USER, "Alladin").
-define(PASSWD, "Sesame").
+-define(WAIT_FOR_SHUTDOWN, 500).
+
%%--------------------------------------------------------------------
%% Common Test interface functions -----------------------------------
%%--------------------------------------------------------------------
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,1}}].
+ {timetrap,{seconds,100}}].
all() ->
[default_tree, sshc_subtree, sshd_subtree, sshd_subtree_profile].
@@ -92,8 +94,8 @@ default_tree(Config) when is_list(Config) ->
lists:keysearch(sshc_sup, 1, TopSupChildren),
{value, {sshd_sup, _,supervisor,[sshd_sup]}} =
lists:keysearch(sshd_sup, 1, TopSupChildren),
- [] = supervisor:which_children(sshc_sup),
- [] = supervisor:which_children(sshd_sup).
+ ?wait_match([], supervisor:which_children(sshc_sup)),
+ ?wait_match([], supervisor:which_children(sshd_sup)).
sshc_subtree() ->
[{doc, "Make sure the sshc subtree is correct"}].
@@ -101,24 +103,27 @@ sshc_subtree(Config) when is_list(Config) ->
{_Pid, Host, Port} = ?config(server, Config),
UserDir = ?config(userdir, Config),
- [] = supervisor:which_children(sshc_sup),
+ ?wait_match([], supervisor:which_children(sshc_sup)),
+
{ok, Pid1} = ssh:connect(Host, Port, [{silently_accept_hosts, true},
{user_interaction, false},
{user, ?USER}, {password, ?PASSWD},{user_dir, UserDir}]),
- [{_, _,supervisor,[ssh_connection_handler]}] =
- supervisor:which_children(sshc_sup),
+
+ ?wait_match([{_, _,worker,[ssh_connection_handler]}],
+ supervisor:which_children(sshc_sup)),
+
{ok, Pid2} = ssh:connect(Host, Port, [{silently_accept_hosts, true},
{user_interaction, false},
{user, ?USER}, {password, ?PASSWD}, {user_dir, UserDir}]),
- [{_,_,supervisor,[ssh_connection_handler]},
- {_,_,supervisor,[ssh_connection_handler]}] =
- supervisor:which_children(sshc_sup),
+ ?wait_match([{_,_,worker,[ssh_connection_handler]},
+ {_,_,worker,[ssh_connection_handler]}],
+ supervisor:which_children(sshc_sup)),
+
ssh:close(Pid1),
- [{_,_,supervisor,[ssh_connection_handler]}] =
- supervisor:which_children(sshc_sup),
+ ?wait_match([{_,_,worker,[ssh_connection_handler]}],
+ supervisor:which_children(sshc_sup)),
ssh:close(Pid2),
- ct:sleep(?WAIT_FOR_SHUTDOWN),
- [] = supervisor:which_children(sshc_sup).
+ ?wait_match([], supervisor:which_children(sshc_sup)).
sshd_subtree() ->
[{doc, "Make sure the sshd subtree is correct"}].
@@ -130,14 +135,16 @@ sshd_subtree(Config) when is_list(Config) ->
{failfun, fun ssh_test_lib:failfun/2},
{user_passwords,
[{?USER, ?PASSWD}]}]),
- [{{server,ssh_system_sup, HostIP, Port, ?DEFAULT_PROFILE},
- Daemon, supervisor,
- [ssh_system_sup]}] =
- supervisor:which_children(sshd_sup),
+
+ ?wait_match([{{server,ssh_system_sup, HostIP, Port, ?DEFAULT_PROFILE},
+ Daemon, supervisor,
+ [ssh_system_sup]}],
+ supervisor:which_children(sshd_sup),
+ Daemon),
check_sshd_system_tree(Daemon, Config),
ssh:stop_daemon(HostIP, Port),
ct:sleep(?WAIT_FOR_SHUTDOWN),
- [] = supervisor:which_children(sshd_sup).
+ ?wait_match([], supervisor:which_children(sshd_sup)).
sshd_subtree_profile() ->
[{doc, "Make sure the sshd subtree using profile option is correct"}].
@@ -152,14 +159,15 @@ sshd_subtree_profile(Config) when is_list(Config) ->
{user_passwords,
[{?USER, ?PASSWD}]},
{profile, Profile}]),
- [{{server,ssh_system_sup, HostIP,Port,Profile},
- Daemon, supervisor,
- [ssh_system_sup]}] =
- supervisor:which_children(sshd_sup),
+ ?wait_match([{{server,ssh_system_sup, HostIP,Port,Profile},
+ Daemon, supervisor,
+ [ssh_system_sup]}],
+ supervisor:which_children(sshd_sup),
+ Daemon),
check_sshd_system_tree(Daemon, Config),
ssh:stop_daemon(HostIP, Port, Profile),
ct:sleep(?WAIT_FOR_SHUTDOWN),
- [] = supervisor:which_children(sshd_sup).
+ ?wait_match([], supervisor:which_children(sshd_sup)).
check_sshd_system_tree(Daemon, Config) ->
@@ -170,28 +178,31 @@ check_sshd_system_tree(Daemon, Config) ->
{user_interaction, false},
{user, ?USER}, {password, ?PASSWD},{user_dir, UserDir}]),
- [{_,SubSysSup, supervisor,[ssh_subsystem_sup]},
- {{ssh_acceptor_sup,_,_,_}, AccSup, supervisor,[ssh_acceptor_sup]}]
- = supervisor:which_children(Daemon),
+ ?wait_match([{_,SubSysSup, supervisor,[ssh_subsystem_sup]},
+ {{ssh_acceptor_sup,_,_,_}, AccSup, supervisor,[ssh_acceptor_sup]}],
+ supervisor:which_children(Daemon),
+ [SubSysSup,AccSup]),
- [{{server,ssh_connection_sup, _,_},
- ConnectionSup, supervisor,
- [ssh_connection_sup]},
- {{server,ssh_channel_sup,_ ,_},
- ChannelSup,supervisor,
- [ssh_channel_sup]}] = supervisor:which_children(SubSysSup),
+ ?wait_match([{{server,ssh_connection_sup, _,_},
+ ConnectionSup, supervisor,
+ [ssh_connection_sup]},
+ {{server,ssh_channel_sup,_ ,_},
+ ChannelSup,supervisor,
+ [ssh_channel_sup]}],
+ supervisor:which_children(SubSysSup),
+ [ConnectionSup,ChannelSup]),
- [{{ssh_acceptor_sup,_,_,_},_,worker,[ssh_acceptor]}] =
- supervisor:which_children(AccSup),
+ ?wait_match([{{ssh_acceptor_sup,_,_,_},_,worker,[ssh_acceptor]}],
+ supervisor:which_children(AccSup)),
- [{_, _, worker,[ssh_connection_handler]}] =
- supervisor:which_children(ConnectionSup),
+ ?wait_match([{_, _, worker,[ssh_connection_handler]}],
+ supervisor:which_children(ConnectionSup)),
- [] = supervisor:which_children(ChannelSup),
+ ?wait_match([], supervisor:which_children(ChannelSup)),
ssh_sftp:start_channel(Client),
- [{_, _,worker,[ssh_channel]}] =
- supervisor:which_children(ChannelSup),
+ ?wait_match([{_, _,worker,[ssh_channel]}],
+ supervisor:which_children(ChannelSup)),
ssh:close(Client).
diff --git a/lib/ssh/test/ssh_test_cli.erl b/lib/ssh/test/ssh_test_cli.erl
index 697ddb730d..f96b9967d2 100644
--- a/lib/ssh/test/ssh_test_cli.erl
+++ b/lib/ssh/test/ssh_test_cli.erl
@@ -75,10 +75,11 @@ terminate(_Why, _S) ->
run_portprog(User, cli, TmpDir) ->
Pty_bin = os:find_executable("cat"),
- open_port({spawn_executable, Pty_bin},
- [stream, {cd, TmpDir}, {env, [{"USER", User}]},
- {args, []}, binary,
- exit_status, use_stdio, stderr_to_stdout]).
+ ssh_test_lib:open_port({spawn_executable, Pty_bin},
+ [stream,
+ {cd, TmpDir},
+ {env, [{"USER", User}]},
+ {args, []}]).
get_ssh_user(Ref) ->
[{user, User}] = ssh:connection_info(Ref, [user]),
diff --git a/lib/ssh/test/ssh_test_lib.erl b/lib/ssh/test/ssh_test_lib.erl
index 5f91fb627a..c6541461a1 100644
--- a/lib/ssh/test/ssh_test_lib.erl
+++ b/lib/ssh/test/ssh_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -32,15 +32,8 @@
-define(TIMEOUT, 50000).
-connect(Options) ->
- connect(hostname(), inet_port(), Options).
-
connect(Port, Options) when is_integer(Port) ->
- connect(hostname(), Port, Options);
-connect(any, Options) ->
- connect(hostname(), inet_port(), Options);
-connect(Host, Options) ->
- connect(Host, inet_port(), Options).
+ connect(hostname(), Port, Options).
connect(any, Port, Options) ->
connect(hostname(), Port, Options);
@@ -49,23 +42,33 @@ connect(Host, Port, Options) ->
ConnectionRef.
daemon(Options) ->
- daemon(any, inet_port(), Options).
+ daemon(any, 0, Options).
daemon(Port, Options) when is_integer(Port) ->
daemon(any, Port, Options);
daemon(Host, Options) ->
- daemon(Host, inet_port(), Options).
+ daemon(Host, 0, Options).
+
daemon(Host, Port, Options) ->
+ ct:log("~p:~p Calling ssh:daemon(~p, ~p, ~p)",[?MODULE,?LINE,Host,Port,Options]),
case ssh:daemon(Host, Port, Options) of
{ok, Pid} when Host == any ->
- {Pid, hostname(), Port};
+ ct:log("ssh:daemon ok (1)",[]),
+ {Pid, hostname(), daemon_port(Port,Pid)};
{ok, Pid} ->
- {Pid, Host, Port};
+ ct:log("ssh:daemon ok (2)",[]),
+ {Pid, Host, daemon_port(Port,Pid)};
Error ->
+ ct:log("ssh:daemon error ~p",[Error]),
Error
end.
+daemon_port(0, Pid) -> {ok,Dinf} = ssh:daemon_info(Pid),
+ proplists:get_value(port, Dinf);
+daemon_port(Port, _) -> Port.
+
+
std_daemon(Config, ExtraOpts) ->
PrivDir = ?config(priv_dir, Config),
@@ -100,7 +103,7 @@ std_simple_sftp(Host, Port, Config, Opts) ->
DataFile = filename:join(UserDir, "test.data"),
ConnectionRef = ssh_test_lib:std_connect(Config, Host, Port, Opts),
{ok, ChannelRef} = ssh_sftp:start_channel(ConnectionRef),
- Data = crypto:rand_bytes(proplists:get_value(std_simple_sftp_size,Config,10)),
+ Data = crypto:strong_rand_bytes(proplists:get_value(std_simple_sftp_size,Config,10)),
ok = ssh_sftp:write_file(ChannelRef, DataFile, Data),
{ok,ReadData} = file:read_file(DataFile),
ok = ssh:close(ConnectionRef),
@@ -201,6 +204,35 @@ reply(TestCase, Result) ->
%%ct:log("reply ~p sending ~p ! ~p",[self(), TestCase, Result]),
TestCase ! Result.
+
+
+rcv_expected(Expect, SshPort, Timeout) ->
+ receive
+ {SshPort, Expect} ->
+ ct:log("Got expected ~p from ~p",[Expect,SshPort]),
+ catch port_close(SshPort),
+ rcv_lingering(50);
+ Other ->
+ ct:log("Got UNEXPECTED ~p~nExpect ~p",[Other, {SshPort,Expect}]),
+ rcv_expected(Expect, SshPort, Timeout)
+
+ after Timeout ->
+ catch port_close(SshPort),
+ ct:fail("Did not receive answer")
+ end.
+
+rcv_lingering(Timeout) ->
+ receive
+ Msg ->
+ ct:log("Got LINGERING ~p",[Msg]),
+ rcv_lingering(Timeout)
+
+ after Timeout ->
+ ct:log("No more lingering messages",[]),
+ ok
+ end.
+
+
receive_exec_result(Msg) ->
ct:log("Expect data! ~p", [Msg]),
receive
@@ -354,7 +386,7 @@ setup_rsa_pass_pharse(DataDir, UserDir, Phrase) ->
setup_pass_pharse(KeyBin, OutFile, Phrase) ->
[{KeyType, _,_} = Entry0] = public_key:pem_decode(KeyBin),
Key = public_key:pem_entry_decode(Entry0),
- Salt = crypto:rand_bytes(8),
+ Salt = crypto:strong_rand_bytes(8),
Entry = public_key:pem_entry_encode(KeyType, Key,
{{"DES-CBC", Salt}, Phrase}),
Pem = public_key:pem_encode([Entry]),
@@ -470,8 +502,9 @@ openssh_supports(ClientOrServer, Tag, Alg) when ClientOrServer == sshc ;
%% Check if we have a "newer" ssh client that supports these test cases
ssh_client_supports_Q() ->
- ErlPort = open_port({spawn, "ssh -Q cipher"}, [exit_status, stderr_to_stdout]),
- 0 == check_ssh_client_support2(ErlPort).
+ 0 == check_ssh_client_support2(
+ ?MODULE:open_port({spawn, "ssh -Q cipher"})
+ ).
check_ssh_client_support2(P) ->
receive
@@ -690,3 +723,16 @@ has_inet6_address() ->
catch
throw:6 -> true
end.
+
+%%%----------------------------------------------------------------
+open_port(Arg1) ->
+ ?MODULE:open_port(Arg1, []).
+
+open_port(Arg1, ExtraOpts) ->
+ erlang:open_port(Arg1,
+ [binary,
+ stderr_to_stdout,
+ exit_status,
+ use_stdio,
+ overlapped_io, hide %only affects windows
+ | ExtraOpts]).
diff --git a/lib/ssh/test/ssh_test_lib.hrl b/lib/ssh/test/ssh_test_lib.hrl
new file mode 100644
index 0000000000..7cb7edeaa8
--- /dev/null
+++ b/lib/ssh/test/ssh_test_lib.hrl
@@ -0,0 +1,27 @@
+%%-------------------------------------------------------------------------
+%% Help macro
+%%-------------------------------------------------------------------------
+-define(wait_match(Pattern, FunctionCall, Bind, Timeout, Ntries),
+ Bind =
+ (fun() ->
+ F = fun(N, F1) ->
+ case FunctionCall of
+ Pattern -> Bind;
+ _ when N>0 ->
+ ct:pal("Must sleep ~p ms at ~p:~p",[Timeout,?MODULE,?LINE]),
+ timer:sleep(Timeout),
+ F1(N-1, F1);
+ Other ->
+ ct:fail("Unexpected ~p:~p ~p",[?MODULE,?LINE,Other])
+ end
+ end,
+ F(Ntries, F)
+ end)()
+ ).
+
+-define(wait_match(Pattern, FunctionCall, Timeout, Ntries), ?wait_match(Pattern, FunctionCall, ok, Timeout, Ntries)).
+
+-define(wait_match(Pattern, FunctionCall, Bind), ?wait_match(Pattern, FunctionCall, Bind, 500, 10) ).
+
+-define(wait_match(Pattern, FunctionCall), ?wait_match(Pattern, FunctionCall, ok) ).
+
diff --git a/lib/ssh/test/ssh_to_openssh_SUITE.erl b/lib/ssh/test/ssh_to_openssh_SUITE.erl
index 2788bc6b58..2be75fd7f3 100644
--- a/lib/ssh/test/ssh_to_openssh_SUITE.erl
+++ b/lib/ssh/test/ssh_to_openssh_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@
%%--------------------------------------------------------------------
suite() ->
- [{timetrap,{minutes,1}}].
+ [{timetrap,{seconds,20}}].
all() ->
case os:find_executable("ssh") of
@@ -50,13 +50,15 @@ groups() ->
[{erlang_client, [], [erlang_shell_client_openssh_server,
erlang_client_openssh_server_exec_compressed,
erlang_client_openssh_server_setenv,
- erlang_client_openssh_server_publickey_rsa,
erlang_client_openssh_server_publickey_dsa,
+ erlang_client_openssh_server_publickey_rsa,
erlang_client_openssh_server_password,
erlang_client_openssh_server_kexs,
erlang_client_openssh_server_nonexistent_subsystem
]},
- {erlang_server, [], [erlang_server_openssh_client_public_key_dsa]}
+ {erlang_server, [], [erlang_server_openssh_client_public_key_dsa,
+ erlang_server_openssh_client_public_key_rsa
+ ]}
].
init_per_suite(Config) ->
@@ -74,6 +76,7 @@ init_per_group(erlang_server, Config) ->
DataDir = ?config(data_dir, Config),
UserDir = ?config(priv_dir, Config),
ssh_test_lib:setup_dsa_known_host(DataDir, UserDir),
+ ssh_test_lib:setup_rsa_known_host(DataDir, UserDir),
Config;
init_per_group(erlang_client, Config) ->
CommonAlgs = ssh_test_lib:algo_intersection(
@@ -86,6 +89,7 @@ init_per_group(_, Config) ->
end_per_group(erlang_server, Config) ->
UserDir = ?config(priv_dir, Config),
ssh_test_lib:clean_dsa(UserDir),
+ ssh_test_lib:clean_rsa(UserDir),
Config;
end_per_group(_, Config) ->
Config.
@@ -93,6 +97,8 @@ end_per_group(_, Config) ->
init_per_testcase(erlang_server_openssh_client_public_key_dsa, Config) ->
chk_key(sshc, 'ssh-dss', ".ssh/id_dsa", Config);
+init_per_testcase(erlang_server_openssh_client_public_key_rsa, Config) ->
+ chk_key(sshc, 'ssh-rsa', ".ssh/id_rsa", Config);
init_per_testcase(erlang_client_openssh_server_publickey_dsa, Config) ->
chk_key(sshd, 'ssh-dss', ".ssh/id_dsa", Config);
init_per_testcase(_TestCase, Config) ->
@@ -347,14 +353,24 @@ erlang_client_openssh_server_publickey_dsa(Config) when is_list(Config) ->
%%--------------------------------------------------------------------
erlang_server_openssh_client_public_key_dsa() ->
- [{doc, "Validate using dsa publickey."}].
+ [{timetrap, {seconds,(?TIMEOUT div 1000)+10}},
+ {doc, "Validate using dsa publickey."}].
erlang_server_openssh_client_public_key_dsa(Config) when is_list(Config) ->
+ erlang_server_openssh_client_public_key_X(Config, ssh_dsa).
+
+erlang_server_openssh_client_public_key_rsa() ->
+ [{timetrap, {seconds,(?TIMEOUT div 1000)+10}},
+ {doc, "Validate using rsa publickey."}].
+erlang_server_openssh_client_public_key_rsa(Config) when is_list(Config) ->
+ erlang_server_openssh_client_public_key_X(Config, ssh_rsa).
+
+
+erlang_server_openssh_client_public_key_X(Config, PubKeyAlg) ->
SystemDir = ?config(data_dir, Config),
PrivDir = ?config(priv_dir, Config),
KnownHosts = filename:join(PrivDir, "known_hosts"),
-
{Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},
- {public_key_alg, ssh_dsa},
+ {public_key_alg, PubKeyAlg},
{failfun, fun ssh_test_lib:failfun/2}]),
ct:sleep(500),
@@ -362,18 +378,8 @@ erlang_server_openssh_client_public_key_dsa(Config) when is_list(Config) ->
Cmd = "ssh -p " ++ integer_to_list(Port) ++
" -o UserKnownHostsFile=" ++ KnownHosts ++
" " ++ Host ++ " 1+1.",
- SshPort = open_port({spawn, Cmd}, [binary, stderr_to_stdout]),
-
- receive
- {SshPort,{data, <<"2\n">>}} ->
- ok
- after ?TIMEOUT ->
- receive
- X -> ct:fail("Received: ~p",[X])
- after 0 ->
- ct:fail("Did not receive answer")
- end
- end,
+ OpenSsh = ssh_test_lib:open_port({spawn, Cmd}),
+ ssh_test_lib:rcv_expected({data,<<"2\n">>}, OpenSsh, ?TIMEOUT),
ssh:stop_daemon(Pid).
%%--------------------------------------------------------------------
diff --git a/lib/ssh/test/ssh_to_openssh_SUITE_data/ssh_host_rsa_key b/lib/ssh/test/ssh_to_openssh_SUITE_data/ssh_host_rsa_key
new file mode 100644
index 0000000000..79968bdd7d
--- /dev/null
+++ b/lib/ssh/test/ssh_to_openssh_SUITE_data/ssh_host_rsa_key
@@ -0,0 +1,16 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQDCZX+4FBDwZIh9y/Uxee1VJnEXlowpz2yDKwj8semM4q843337
+zbNfxHmladB1lpz2NqyxI175xMIJuDxogyZdsOxGnFAzAnthR4dqL/RWRWzjaxSB
+6IAO9SPYVVlrpZ+1hsjLW79fwXK/yc8VdhRuWTeQiRgYY2ek8+OKbOqz4QIDAQAB
+AoGANmvJzJO5hkLuvyDZHKfAnGTtpifcR1wtSa9DjdKUyn8vhKF0mIimnbnYQEmW
+NUUb3gXCZLi9PvkpRSVRrASDOZwcjoU/Kvww163vBUVb2cOZfFhyn6o2Sk88Tt++
+udH3hdjpf9i7jTtUkUe+QYPsia+wgvvrmn4QrahLAH86+kECQQDx5gFeXTME3cnW
+WMpFz3PPumduzjqgqMMWEccX4FtQkMX/gyGa5UC7OHFyh0N/gSWvPbRHa8A6YgIt
+n8DO+fh5AkEAzbqX4DOn8NY6xJIi42q7l/2jIA0RkB6P7YugW5NblhqBZ0XDnpA5
+sMt+rz+K07u9XZtxgh1xi7mNfwY6lEAMqQJBAJBEauCKmRj35Z6OyeQku59SPsnY
++SJEREVvSNw2lH9SOKQQ4wPsYlTGbvKtNVZgAcen91L5MmYfeckYE/fdIZECQQCt
+64zxsTnM1I8iFxj/gP/OYlJBikrKt8udWmjaghzvLMEw+T2DExJyb9ZNeT53+UMB
+m6O+B/4xzU/djvp+0hbhAkAemIt+rA5kTmYlFndhpvzkSSM8a2EXsO4XIPgGWCTT
+tQKS/tTly0ADMjN/TVy11+9d6zcqadNVuHXHGtR4W0GR
+-----END RSA PRIVATE KEY-----
+
diff --git a/lib/ssh/test/ssh_to_openssh_SUITE_data/ssh_host_rsa_key.pub b/lib/ssh/test/ssh_to_openssh_SUITE_data/ssh_host_rsa_key.pub
new file mode 100644
index 0000000000..75d2025c71
--- /dev/null
+++ b/lib/ssh/test/ssh_to_openssh_SUITE_data/ssh_host_rsa_key.pub
@@ -0,0 +1,5 @@
+---- BEGIN SSH2 PUBLIC KEY ----
+AAAAB3NzaC1yc2EAAAADAQABAAAAgQDCZX+4FBDwZIh9y/Uxee1VJnEXlowpz2yDKwj8
+semM4q843337zbNfxHmladB1lpz2NqyxI175xMIJuDxogyZdsOxGnFAzAnthR4dqL/RW
+RWzjaxSB6IAO9SPYVVlrpZ+1hsjLW79fwXK/yc8VdhRuWTeQiRgYY2ek8+OKbOqz4Q==
+---- END SSH2 PUBLIC KEY ----
diff --git a/lib/ssh/test/ssh_trpt_test_lib.erl b/lib/ssh/test/ssh_trpt_test_lib.erl
index 4269529ae8..e34071af99 100644
--- a/lib/ssh/test/ssh_trpt_test_lib.erl
+++ b/lib/ssh/test/ssh_trpt_test_lib.erl
@@ -294,12 +294,11 @@ instantiate(X, _S) ->
%%%================================================================
%%%
init_ssh(Role, Socket, Options0) ->
- Options = [{user_interaction,false}
+ Options = [{user_interaction, false},
+ {vsn, {2,0}},
+ {id_string, "ErlangTestLib"}
| Options0],
- ssh_connection_handler:init_ssh(Role,
- {2,0},
- lists:concat(["SSH-2.0-ErlangTestLib ",Role]),
- Options, Socket).
+ ssh_connection_handler:init_ssh_record(Role, Socket, Options).
mangle_opts(Options) ->
SysOpts = [{reuseaddr, true},
diff --git a/lib/ssh/test/ssh_upgrade_SUITE.erl b/lib/ssh/test/ssh_upgrade_SUITE.erl
index bf8874b118..06bef2455e 100644
--- a/lib/ssh/test/ssh_upgrade_SUITE.erl
+++ b/lib/ssh/test/ssh_upgrade_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@
%%% CommonTest callbacks
%%%
suite() ->
- [{timetrap,{minutes,2}}].
+ [{timetrap,{seconds,180}}].
all() ->
[
@@ -146,7 +146,8 @@ setup_server_client(#state{config=Config} = State) ->
SFTP = ssh_sftpd:subsystem_spec([{root,FtpRootDir},{cwd,FtpRootDir}]),
- {Server,Host,Port} = ssh_test_lib:daemon([{system_dir,DataDir},
+ {Server,Host,Port} = ssh_test_lib:daemon(ssh_test_lib:inet_port(), % when lower rel is 18.x
+ [{system_dir,DataDir},
{user_passwords,[{"hej","hopp"}]},
{subsystems,[SFTP]}]),
diff --git a/lib/ssh/vsn.mk b/lib/ssh/vsn.mk
index 41b42d454b..b165928877 100644
--- a/lib/ssh/vsn.mk
+++ b/lib/ssh/vsn.mk
@@ -1,5 +1,5 @@
#-*-makefile-*- ; force emacs to enter makefile-mode
-SSH_VSN = 4.2.2
+SSH_VSN = 4.3
APP_VSN = "ssh-$(SSH_VSN)"
diff --git a/lib/ssl/Makefile b/lib/ssl/Makefile
index c3b7af5bcd..bd43794a36 100644
--- a/lib/ssl/Makefile
+++ b/lib/ssl/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ssl/doc/src/book.xml b/lib/ssl/doc/src/book.xml
index a0890a028d..056c958f0f 100644
--- a/lib/ssl/doc/src/book.xml
+++ b/lib/ssl/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ssl/doc/src/notes.xml b/lib/ssl/doc/src/notes.xml
index e5070bc247..e9b523d9e1 100644
--- a/lib/ssl/doc/src/notes.xml
+++ b/lib/ssl/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -28,6 +28,53 @@
<p>This document describes the changes made to the SSL application.</p>
+<section><title>SSL 7.3.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Correct cipher suites conversion and gaurd expression.
+ Caused problems with GCM cipher suites and client side
+ option to set signature_algorithms extention values.</p>
+ <p>
+ Own Id: OTP-13525</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>SSL 7.3.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Corrections to cipher suite handling using the 3 and 4
+ tuple format in addition to commit
+ 89d7e21cf4ae988c57c8ef047bfe85127875c70c</p>
+ <p>
+ Own Id: OTP-13511</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Make values for the TLS-1.2 signature_algorithms
+ extension configurable</p>
+ <p>
+ Own Id: OTP-13261</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>SSL 7.3</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/ssl/doc/src/pkix_certs.xml b/lib/ssl/doc/src/pkix_certs.xml
index a5793af5ca..f365acef4d 100644
--- a/lib/ssl/doc/src/pkix_certs.xml
+++ b/lib/ssl/doc/src/pkix_certs.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ssl/doc/src/release_notes.xml b/lib/ssl/doc/src/release_notes.xml
index 4c9b18f900..2e263c69a7 100644
--- a/lib/ssl/doc/src/release_notes.xml
+++ b/lib/ssl/doc/src/release_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1999</year><year>2013</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ssl/doc/src/ssl.xml b/lib/ssl/doc/src/ssl.xml
index a76d46ee9b..154664d855 100644
--- a/lib/ssl/doc/src/ssl.xml
+++ b/lib/ssl/doc/src/ssl.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1999</year><year>2015</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -48,7 +48,7 @@
<item><p><c>true | false</c></p></item>
<tag><c>option() =</c></tag>
- <item><p><c>socketoption() | ssloption() | transportoption()</c></p>
+ <item><p><c>socketoption() | ssl_option() | transport_option()</c></p>
</item>
<tag><c>socketoption() =</c></tag>
@@ -60,7 +60,7 @@
<seealso marker="kernel:gen_tcp">gen_tcp(3)</seealso> manual pages
in Kernel.</p></item>
- <tag><marker id="type-ssloption"/><c>ssloption() =</c></tag>
+ <tag><marker id="type-ssloption"/><c>ssl_option() =</c></tag>
<item>
<p><c>{verify, verify_type()}</c></p>
<p><c>| {verify_fun, {fun(), term()}}</c></p>
@@ -85,11 +85,11 @@
[binary()]} | {client | server, [binary()], binary()}}</c></p>
<p><c>| {log_alert, boolean()}</c></p>
<p><c>| {server_name_indication, hostname() | disable}</c></p>
- <p><c>| {sni_hosts, [{hostname(), ssloptions()}]}</c></p>
+ <p><c>| {sni_hosts, [{hostname(), [ssl_option()]}]}</c></p>
<p><c>| {sni_fun, SNIfun::fun()}</c></p>
</item>
- <tag><c>transportoption() =</c></tag>
+ <tag><c>transport_option() =</c></tag>
<item><p><c>{cb_info, {CallbackModule::atom(), DataTag::atom(),
ClosedTag::atom(), ErrTag:atom()}}</c></p>
@@ -168,7 +168,7 @@
| srp_4096 | srp_6144 | srp_8192</c></p></item>
<tag><c>SNIfun::fun()</c></tag>
- <item><p><c>= fun(ServerName :: string()) -> ssloptions()</c></p></item>
+ <item><p><c>= fun(ServerName :: string()) -> [ssl_option()]</c></p></item>
</taglist>
</section>
@@ -421,7 +421,6 @@ fun(srp, Username :: string(), UserState :: term()) ->
<warning><p>Using <c>{padding_check, boolean()}</c> makes TLS
vulnerable to the Poodle attack.</p></warning>
-
</section>
<section>
@@ -522,9 +521,43 @@ fun(srp, Username :: string(), UserState :: term()) ->
be supported by the server for the prevention to work.
</p></warning>
</item>
- </taglist>
+ <tag><marker id="client_signature_algs"/><c>{signature_algs, [{hash(), ecdsa | rsa | dsa}]}</c></tag>
+ <item>
+ <p>In addition to the algorithms negotiated by the cipher
+ suite used for key exchange, payload encryption, message
+ authentication and pseudo random calculation, the TLS signature
+ algorithm extension <url
+ href="http://www.ietf.org/rfc/rfc5246.txt">Section 7.4.1.4.1 in RFC 5246</url> may be
+ used, from TLS 1.2, to negotiate which signature algorithm to use during the
+ TLS handshake. If no lower TLS versions than 1.2 are supported,
+ the client will send a TLS signature algorithm extension
+ with the algorithms specified by this option.
+ Defaults to
+
+ <code>[
+%% SHA2
+{sha512, ecdsa},
+{sha512, rsa},
+{sha384, ecdsa},
+{sha384, rsa},
+{sha256, ecdsa},
+{sha256, rsa},
+{sha224, ecdsa},
+{sha224, rsa},
+%% SHA
+{sha, ecdsa},
+{sha, rsa},
+{sha, dsa},
+]</code>
+
+ The algorithms should be in the preferred order.
+ Selected signature algorithm can restrict which hash functions
+ that may be selected. Default support for {md5, rsa} removed in ssl-8.0
+ </p>
+ </item>
+ </taglist>
</section>
-
+
<section>
<title>SSL OPTION DESCRIPTIONS - SERVER SIDE</title>
@@ -617,7 +650,7 @@ fun(srp, Username :: string(), UserState :: term()) ->
selection. If set to <c>false</c> (the default), use the client
preference.</p></item>
- <tag><c>{sni_hosts, [{hostname(), ssloptions()}]}</c></tag>
+ <tag><c>{sni_hosts, [{hostname(), [ssl_option()]}]}</c></tag>
<item><p>If the server receives a SNI (Server Name Indication) from the client
matching a host listed in the <c>sni_hosts</c> option, the specific options for
that host will override previously specified options.
@@ -626,11 +659,11 @@ fun(srp, Username :: string(), UserState :: term()) ->
<tag><c>{sni_fun, SNIfun::fun()}</c></tag>
<item><p>If the server receives a SNI (Server Name Indication) from the client,
- the given function will be called to retrieve <c>ssloptions()</c> for the indicated server.
- These options will be merged into predefined <c>ssloptions()</c>.
+ the given function will be called to retrieve <c>[ssl_option()]</c> for the indicated server.
+ These options will be merged into predefined <c>[ssl_option()]</c>.
The function should be defined as:
- <c>fun(ServerName :: string()) -> ssloptions()</c>
+ <c>fun(ServerName :: string()) -> [ssl_option()]</c>
and can be specified as a fun or as named <c>fun module:function/1</c>
The option <c>sni_fun</c>, and <c>sni_hosts</c> are mutually exclusive.</p></item>
@@ -651,6 +684,14 @@ fun(srp, Username :: string(), UserState :: term()) ->
<item>If true, use the server's preference for cipher selection. If false
(the default), use the client's preference.
</item>
+
+ <tag><c>{signature_algs, [{hash(), ecdsa | rsa | dsa}]}</c></tag>
+ <item><p> The algorithms specified by
+ this option will be the ones accepted by the server in a signature algorithm
+ negotiation, introduced in TLS-1.2. The algorithms will also be offered to the client if a
+ client certificate is requested. For more details see the <seealso marker="#client_signature_algs">corresponding client option</seealso>.
+ </p> </item>
+
</taglist>
</section>
@@ -710,7 +751,7 @@ fun(srp, Username :: string(), UserState :: term()) ->
equivalent, connected socket to an SSL socket.</fsummary>
<type>
<v>Socket = socket()</v>
- <v>SslOptions = [ssloption()]</v>
+ <v>SslOptions = [ssl_option()]</v>
<v>Timeout = integer() | infinity</v>
<v>SslSocket = sslsocket()</v>
<v>Reason = term()</v>
@@ -1023,7 +1064,7 @@ fun(srp, Username :: string(), UserState :: term()) ->
<fsummary>Performs server-side SSL/TLS handshake.</fsummary>
<type>
<v>Socket = socket() | sslsocket() </v>
- <v>SslOptions = ssloptions()</v>
+ <v>SslOptions = [ssl_option()]</v>
<v>Timeout = integer()</v>
<v>Reason = term()</v>
</type>
diff --git a/lib/ssl/doc/src/ssl_app.xml b/lib/ssl/doc/src/ssl_app.xml
index d05ece3971..daa06a40fc 100644
--- a/lib/ssl/doc/src/ssl_app.xml
+++ b/lib/ssl/doc/src/ssl_app.xml
@@ -4,7 +4,7 @@
<appref>
<header>
<copyright>
- <year>1999</year><year>2015</year>
+ <year>1999</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ssl/doc/src/ssl_distribution.xml b/lib/ssl/doc/src/ssl_distribution.xml
index dc04d446b0..7c00b4eae2 100644
--- a/lib/ssl/doc/src/ssl_distribution.xml
+++ b/lib/ssl/doc/src/ssl_distribution.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ssl/doc/src/usersguide.xml b/lib/ssl/doc/src/usersguide.xml
index 7bd0ae5c4c..23ccf668c3 100644
--- a/lib/ssl/doc/src/usersguide.xml
+++ b/lib/ssl/doc/src/usersguide.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ssl/doc/src/using_ssl.xml b/lib/ssl/doc/src/using_ssl.xml
index b6a4bb5bec..f84cd6e391 100644
--- a/lib/ssl/doc/src/using_ssl.xml
+++ b/lib/ssl/doc/src/using_ssl.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/ssl/examples/certs/Makefile b/lib/ssl/examples/certs/Makefile
index 797abb04ef..5c456c6a1a 100644
--- a/lib/ssl/examples/certs/Makefile
+++ b/lib/ssl/examples/certs/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2012. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ssl/examples/src/Makefile b/lib/ssl/examples/src/Makefile
index e14ef321c7..7335bb2bb8 100644
--- a/lib/ssl/examples/src/Makefile
+++ b/lib/ssl/examples/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2012. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ssl/examples/src/client_server.erl b/lib/ssl/examples/src/client_server.erl
index 019b5130d2..c150f43bff 100644
--- a/lib/ssl/examples/src/client_server.erl
+++ b/lib/ssl/examples/src/client_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/dtls.erl b/lib/ssl/src/dtls.erl
index 14aefd4989..cd705152a8 100644
--- a/lib/ssl/src/dtls.erl
+++ b/lib/ssl/src/dtls.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/dtls_connection.erl b/lib/ssl/src/dtls_connection.erl
index 153d3fef48..82d6faee42 100644
--- a/lib/ssl/src/dtls_connection.erl
+++ b/lib/ssl/src/dtls_connection.erl
@@ -21,7 +21,7 @@
%% Internal application API
--behaviour(gen_fsm).
+-behaviour(gen_statem).
-include("dtls_connection.hrl").
-include("dtls_handshake.hrl").
@@ -36,37 +36,38 @@
%% Internal application API
%% Setup
--export([start_fsm/8]).
+-export([start_fsm/8, start_link/7, init/1]).
%% State transition handling
--export([next_record/1, next_state/4%,
- %%next_state_connection/2
- ]).
+-export([next_record/1, next_event/3]).
%% Handshake handling
--export([%%renegotiate/1,
+-export([%%renegotiate/2,
send_handshake/2, send_change_cipher/2]).
+
%% Alert and close handling
--export([send_alert/2, handle_own_alert/4, %%handle_close_alert/3,
- handle_normal_shutdown/3
- %%handle_unexpected_message/3,
- %%alert_user/5, alert_user/8
+-export([%%send_alert/2, handle_own_alert/4, handle_close_alert/3,
+ handle_normal_shutdown/3 %%, close/5
+ %%alert_user/6, alert_user/9
]).
%% Data handling
-export([%%write_application_data/3,
- read_application_data/2%%,
-%% passive_receive/2, next_record_if_active/1
+ read_application_data/2,
+ %%passive_receive/2,
+ next_record_if_active/1 %%,
+ %%handle_common_event/4
]).
-%% Called by tls_connection_sup
--export([start_link/7]).
+%% gen_statem state functions
+-export([init/3, error/3, downgrade/3, %% Initiation and take down states
+ hello/3, certify/3, cipher/3, abbreviated/3, %% Handshake states
+ connection/3]).
+%% gen_statem callbacks
+-export([terminate/3, code_change/4, format_status/2]).
-%% gen_fsm callbacks
--export([init/1, hello/2, certify/2, cipher/2,
- abbreviated/2, connection/2, handle_event/3,
- handle_sync_event/4, handle_info/3, terminate/3, code_change/4]).
+-define(GEN_STATEM_CB_MODE, state_functions).
%%====================================================================
%% Internal application API
@@ -141,78 +142,74 @@ send_change_cipher(Msg, #state{connection_states = ConnectionStates0,
start_link(Role, Host, Port, Socket, Options, User, CbInfo) ->
{ok, proc_lib:spawn_link(?MODULE, init, [[Role, Host, Port, Socket, Options, User, CbInfo]])}.
-init([Role, Host, Port, Socket, {SSLOpts0, _} = Options, User, CbInfo]) ->
+init([Role, Host, Port, Socket, Options, User, CbInfo]) ->
process_flag(trap_exit, true),
State0 = initial_state(Role, Host, Port, Socket, Options, User, CbInfo),
- Handshake = ssl_handshake:init_handshake_history(),
- TimeStamp = erlang:monotonic_time(),
- try ssl_config:init(SSLOpts0, Role) of
- {ok, Ref, CertDbHandle, FileRefHandle, CacheHandle, CRLDbInfo, OwnCert, Key, DHParams} ->
- Session = State0#state.session,
- State = State0#state{
- tls_handshake_history = Handshake,
- session = Session#session{own_certificate = OwnCert,
- time_stamp = TimeStamp},
- file_ref_db = FileRefHandle,
- cert_db_ref = Ref,
- cert_db = CertDbHandle,
- crl_db = CRLDbInfo,
- session_cache = CacheHandle,
- private_key = Key,
- diffie_hellman_params = DHParams},
- gen_fsm:enter_loop(?MODULE, [], hello, State, get_timeout(State))
+ try
+ State = ssl_connection:ssl_config(State0#state.ssl_options, Role, State0),
+ gen_statem:enter_loop(?MODULE, [], ?GEN_STATEM_CB_MODE, init, State)
catch
throw:Error ->
- gen_fsm:enter_loop(?MODULE, [], error, {Error,State0}, get_timeout(State0))
+ gen_statem:enter_loop(?MODULE, [], ?GEN_STATEM_CB_MODE, error, {Error,State0})
end.
%%--------------------------------------------------------------------
-%% Description:There should be one instance of this function for each
-%% possible state name. Whenever a gen_fsm receives an event sent
-%% using gen_fsm:send_event/2, the instance of this function with the
-%% same name as the current state name StateName is called to handle
-%% the event. It is also called if a timeout occurs.
-%%
-hello(start, #state{host = Host, port = Port, role = client,
- ssl_options = SslOpts,
- session = #session{own_certificate = Cert} = Session0,
- session_cache = Cache, session_cache_cb = CacheCb,
- transport_cb = Transport, socket = Socket,
- connection_states = ConnectionStates0,
- renegotiation = {Renegotiation, _}} = State0) ->
+%% State functionsconnection/2
+%%--------------------------------------------------------------------
+
+init({call, From}, {start, Timeout},
+ #state{host = Host, port = Port, role = client,
+ ssl_options = SslOpts,
+ session = #session{own_certificate = Cert} = Session0,
+ transport_cb = Transport, socket = Socket,
+ connection_states = ConnectionStates0,
+ renegotiation = {Renegotiation, _},
+ session_cache = Cache,
+ session_cache_cb = CacheCb
+ } = State0) ->
+ Timer = ssl_connection:start_or_recv_cancel_timer(Timeout, From),
Hello = dtls_handshake:client_hello(Host, Port, ConnectionStates0, SslOpts,
- Cache, CacheCb, Renegotiation, Cert),
+ Cache, CacheCb, Renegotiation, Cert),
Version = Hello#client_hello.client_version,
+ HelloVersion = dtls_record:lowest_protocol_version(SslOpts#ssl_options.versions),
Handshake0 = ssl_handshake:init_handshake_history(),
{BinMsg, ConnectionStates, Handshake} =
- encode_handshake(Hello, Version, ConnectionStates0, Handshake0),
+ encode_handshake(Hello, HelloVersion, ConnectionStates0, Handshake0),
Transport:send(Socket, BinMsg),
State1 = State0#state{connection_states = ConnectionStates,
negotiated_version = Version, %% Requested version
session =
Session0#session{session_id = Hello#client_hello.session_id},
- tls_handshake_history = Handshake},
+ tls_handshake_history = Handshake,
+ start_or_recv_from = From,
+ timer = Timer},
{Record, State} = next_record(State1),
- next_state(hello, hello, Record, State);
-
-hello(Hello = #client_hello{client_version = ClientVersion,
- extensions = #hello_extensions{hash_signs = HashSigns}},
- State = #state{connection_states = ConnectionStates0,
- port = Port, session = #session{own_certificate = Cert} = Session0,
- renegotiation = {Renegotiation, _},
- session_cache = Cache,
- session_cache_cb = CacheCb,
- ssl_options = SslOpts}) ->
+ next_event(hello, Record, State);
+init(Type, Event, State) ->
+ ssl_connection:init(Type, Event, State, ?MODULE).
+
+error({call, From}, {start, _Timeout}, {Error, State}) ->
+ {stop_and_reply, normal, {reply, From, {error, Error}}, State};
+error({call, From}, Msg, State) ->
+ handle_call(Msg, From, error, State);
+error(_, _, _) ->
+ {keep_state_and_data, [postpone]}.
+
+hello(internal, #client_hello{client_version = ClientVersion} = Hello,
+ #state{connection_states = ConnectionStates0,
+ port = Port, session = #session{own_certificate = Cert} = Session0,
+ renegotiation = {Renegotiation, _},
+ session_cache = Cache,
+ session_cache_cb = CacheCb,
+ ssl_options = SslOpts} = State) ->
case dtls_handshake:hello(Hello, SslOpts, {Port, Session0, Cache, CacheCb,
ConnectionStates0, Cert}, Renegotiation) of
{Version, {Type, Session},
ConnectionStates,
#hello_extensions{ec_point_formats = EcPointFormats,
- elliptic_curves = EllipticCurves} = ServerHelloExt} ->
- HashSign = ssl_handshake:select_hashsign(HashSigns, Cert,
- dtls_v1:corresponding_tls_version(Version)),
- ssl_connection:hello({common_client_hello, Type, ServerHelloExt, HashSign},
+ elliptic_curves = EllipticCurves} = ServerHelloExt, HashSign} ->
+ ssl_connection:hello(internal, {common_client_hello, Type, ServerHelloExt, HashSign},
State#state{connection_states = ConnectionStates,
negotiated_version = Version,
session = Session,
@@ -220,7 +217,7 @@ hello(Hello = #client_hello{client_version = ClientVersion,
#alert{} = Alert ->
handle_own_alert(Alert, ClientVersion, hello, State)
end;
-hello(Hello,
+hello(internal, Hello,
#state{connection_states = ConnectionStates0,
negotiated_version = ReqVersion,
role = client,
@@ -233,20 +230,30 @@ hello(Hello,
ssl_connection:handle_session(Hello,
Version, NewId, ConnectionStates, ProtoExt, Protocol, State)
end;
-
-hello(Msg, State) ->
- ssl_connection:hello(Msg, State, ?MODULE).
-
-abbreviated(Msg, State) ->
- ssl_connection:abbreviated(Msg, State, ?MODULE).
-
-certify(Msg, State) ->
- ssl_connection:certify(Msg, State, ?MODULE).
-
-cipher(Msg, State) ->
- ssl_connection:cipher(Msg, State, ?MODULE).
-
-connection(#hello_request{}, #state{host = Host, port = Port,
+hello(info, Event, State) ->
+ handle_info(Event, hello, State);
+
+hello(Type, Event, State) ->
+ ssl_connection:hello(Type, Event, State, ?MODULE).
+
+abbreviated(info, Event, State) ->
+ handle_info(Event, abbreviated, State);
+abbreviated(Type, Event, State) ->
+ ssl_connection:abbreviated(Type, Event, State, ?MODULE).
+
+certify(info, Event, State) ->
+ handle_info(Event, certify, State);
+certify(Type, Event, State) ->
+ ssl_connection:certify(Type, Event, State, ?MODULE).
+
+cipher(info, Event, State) ->
+ handle_info(Event, cipher, State);
+cipher(Type, Event, State) ->
+ ssl_connection:cipher(Type, Event, State, ?MODULE).
+
+connection(info, Event, State) ->
+ handle_info(Event, connection, State);
+connection(internal, #hello_request{}, #state{host = Host, port = Port,
session = #session{own_certificate = Cert} = Session0,
session_cache = Cache, session_cache_cb = CacheCb,
ssl_options = SslOpts,
@@ -260,40 +267,30 @@ connection(#hello_request{}, #state{host = Host, port = Port,
next_record(
State1#state{session = Session0#session{session_id
= Hello#client_hello.session_id}}),
- next_state(connection, hello, Record, State);
+ next_event(hello, Record, State);
-connection(#client_hello{} = Hello, #state{role = server, allow_renegotiate = true} = State) ->
+connection(internal, #client_hello{} = Hello, #state{role = server, allow_renegotiate = true} = State) ->
%% Mitigate Computational DoS attack
%% http://www.educatedguesswork.org/2011/10/ssltls_and_computational_dos.html
%% http://www.thc.org/thc-ssl-dos/ Rather than disabling client
%% initiated renegotiation we will disallow many client initiated
%% renegotiations immediately after each other.
erlang:send_after(?WAIT_TO_ALLOW_RENEGOTIATION, self(), allow_renegotiate),
- hello(Hello, State#state{allow_renegotiate = false});
+ {next_state, hello, State#state{allow_renegotiate = false}, [{next_event, internal, Hello}]};
+
-connection(#client_hello{}, #state{role = server, allow_renegotiate = false} = State0) ->
+connection(internal, #client_hello{}, #state{role = server, allow_renegotiate = false} = State0) ->
Alert = ?ALERT_REC(?WARNING, ?NO_RENEGOTIATION),
- State = send_alert(Alert, State0),
- next_state_connection(connection, State);
+ State1 = send_alert(Alert, State0),
+ {Record, State} = ssl_connection:prepare_connection(State1, ?MODULE),
+ next_event(connection, Record, State);
-connection(Msg, State) ->
- ssl_connection:connection(Msg, State, tls_connection).
+connection(Type, Event, State) ->
+ ssl_connection:connection(Type, Event, State, ?MODULE).
-%%--------------------------------------------------------------------
-%% Description: Whenever a gen_fsm receives an event sent using
-%% gen_fsm:send_all_state_event/2, this function is called to handle
-%% the event. Not currently used!
-%%--------------------------------------------------------------------
-handle_event(_Event, StateName, State) ->
- {next_state, StateName, State, get_timeout(State)}.
+downgrade(Type, Event, State) ->
+ ssl_connection:downgrade(Type, Event, State, ?MODULE).
-%%--------------------------------------------------------------------
-%% Description: Whenever a gen_fsm receives an event sent using
-%% gen_fsm:sync_send_all_state_event/2,3, this function is called to handle
-%% the event.
-%%--------------------------------------------------------------------
-handle_sync_event(Event, From, StateName, State) ->
- ssl_connection:handle_sync_event(Event, From, StateName, State).
%%--------------------------------------------------------------------
%% Description: This function is called by a gen_fsm when it receives any
@@ -304,26 +301,25 @@ handle_sync_event(Event, From, StateName, State) ->
%% raw data from socket, unpack records
handle_info({Protocol, _, Data}, StateName,
#state{data_tag = Protocol} = State0) ->
- %% Simplify for now to avoid dialzer warnings before implementation is compleate
- %% case next_tls_record(Data, State0) of
- %% {Record, State} ->
- %% next_state(StateName, StateName, Record, State);
- %% #alert{} = Alert ->
- %% handle_normal_shutdown(Alert, StateName, State0),
- %% {stop, {shutdown, own_alert}, State0}
- %% end;
- {Record, State} = next_tls_record(Data, State0),
- next_state(StateName, StateName, Record, State);
-
+ case next_tls_record(Data, State0) of
+ {Record, State} ->
+ next_event(StateName, Record, State);
+ #alert{} = Alert ->
+ handle_normal_shutdown(Alert, StateName, State0),
+ {stop, {shutdown, own_alert}}
+ end;
handle_info({CloseTag, Socket}, StateName,
#state{socket = Socket, close_tag = CloseTag,
negotiated_version = _Version} = State) ->
handle_normal_shutdown(?ALERT_REC(?FATAL, ?CLOSE_NOTIFY), StateName, State),
- {stop, {shutdown, transport_closed}, State};
+ {stop, {shutdown, transport_closed}};
handle_info(Msg, StateName, State) ->
ssl_connection:handle_info(Msg, StateName, State).
+handle_call(Event, From, StateName, State) ->
+ ssl_connection:handle_call(Event, From, StateName, State, ?MODULE).
+
%%--------------------------------------------------------------------
%% Description:This function is called by a gen_fsm when it is about
%% to terminate. It should be the opposite of Module:init/1 and do any
@@ -338,7 +334,10 @@ terminate(Reason, StateName, State) ->
%% Description: Convert process state when code is changed
%%--------------------------------------------------------------------
code_change(_OldVsn, StateName, State, _Extra) ->
- {ok, StateName, State}.
+ {?GEN_STATEM_CB_MODE, StateName, State}.
+
+format_status(Type, Data) ->
+ ssl_connection:format_status(Type, Data).
%%--------------------------------------------------------------------
%%% Internal functions
@@ -375,96 +374,28 @@ next_record(#state{socket = Socket,
next_record(State) ->
{no_record, State}.
-next_state(Current,_, #alert{} = Alert, #state{negotiated_version = Version} = State) ->
- handle_own_alert(Alert, Version, Current, State);
-
-next_state(_,Next, no_record, State) ->
- {next_state, Next, State, get_timeout(State)};
-
-%% next_state(_,Next, #ssl_tls{type = ?ALERT, fragment = EncAlerts}, State) ->
-%% Alerts = decode_alerts(EncAlerts),
-%% handle_alerts(Alerts, {next_state, Next, State, get_timeout(State)});
-
-next_state(Current, Next, #ssl_tls{type = ?HANDSHAKE, fragment = Data},
- State0 = #state{protocol_buffers =
- #protocol_buffers{dtls_handshake_buffer = Buf0} = Buffers,
- negotiated_version = Version}) ->
- Handle =
- fun({#hello_request{} = Packet, _}, {next_state, connection = SName, State}) ->
- %% This message should not be included in handshake
- %% message hashes. Starts new handshake (renegotiation)
- Hs0 = ssl_handshake:init_handshake_history(),
- ?MODULE:SName(Packet, State#state{tls_handshake_history=Hs0,
- renegotiation = {true, peer}});
- ({#hello_request{} = Packet, _}, {next_state, SName, State}) ->
- %% This message should not be included in handshake
- %% message hashes. Already in negotiation so it will be ignored!
- ?MODULE:SName(Packet, State);
- ({#client_hello{} = Packet, Raw}, {next_state, connection = SName, State}) ->
- Version = Packet#client_hello.client_version,
- Hs0 = ssl_handshake:init_handshake_history(),
- Hs1 = ssl_handshake:update_handshake_history(Hs0, Raw),
- ?MODULE:SName(Packet, State#state{tls_handshake_history=Hs1,
- renegotiation = {true, peer}});
- ({Packet, Raw}, {next_state, SName, State = #state{tls_handshake_history=Hs0}}) ->
- Hs1 = ssl_handshake:update_handshake_history(Hs0, Raw),
- ?MODULE:SName(Packet, State#state{tls_handshake_history=Hs1});
- (_, StopState) -> StopState
- end,
- try
- {Packets, Buf} = tls_handshake:get_tls_handshake(Version,Data,Buf0),
- State = State0#state{protocol_buffers =
- Buffers#protocol_buffers{dtls_packets = Packets,
- dtls_handshake_buffer = Buf}},
- handle_dtls_handshake(Handle, Next, State)
- catch throw:#alert{} = Alert ->
- handle_own_alert(Alert, Version, Current, State0)
- end;
-next_state(_, StateName, #ssl_tls{type = ?APPLICATION_DATA, fragment = Data}, State0) ->
- %% Simplify for now to avoid dialzer warnings before implementation is compleate
- %% case read_application_data(Data, State0) of
- %% Stop = {stop,_,_} ->
- %% Stop;
- %% {Record, State} ->
- %% next_state(StateName, StateName, Record, State)
- %% end;
- {Record, State} = read_application_data(Data, State0),
- next_state(StateName, StateName, Record, State);
-
-next_state(Current, Next, #ssl_tls{type = ?CHANGE_CIPHER_SPEC, fragment = <<1>>} =
- _ChangeCipher,
- #state{connection_states = ConnectionStates0} = State0) ->
- ConnectionStates1 =
- ssl_record:activate_pending_connection_state(ConnectionStates0, read),
- {Record, State} = next_record(State0#state{connection_states = ConnectionStates1}),
- next_state(Current, Next, Record, State);
-next_state(Current, Next, #ssl_tls{type = _Unknown}, State0) ->
- %% Ignore unknown type
- {Record, State} = next_record(State0),
- next_state(Current, Next, Record, State).
-
-handle_dtls_handshake(Handle, StateName,
- #state{protocol_buffers =
- #protocol_buffers{dtls_packets = [Packet]} = Buffers} = State) ->
- FsmReturn = {next_state, StateName, State#state{protocol_buffers =
- Buffers#protocol_buffers{dtls_packets = []}}},
- Handle(Packet, FsmReturn);
-
-handle_dtls_handshake(Handle, StateName,
- #state{protocol_buffers =
- #protocol_buffers{dtls_packets = [Packet | Packets]} = Buffers} =
- State0) ->
- FsmReturn = {next_state, StateName, State0#state{protocol_buffers =
- Buffers#protocol_buffers{dtls_packets =
- Packets}}},
- case Handle(Packet, FsmReturn) of
- {next_state, NextStateName, State, _Timeout} ->
- handle_dtls_handshake(Handle, NextStateName, State);
- {stop, _,_} = Stop ->
- Stop
- end.
+next_event(StateName, Record, State) ->
+ next_event(StateName, Record, State, []).
+next_event(connection = StateName, no_record, State0, Actions) ->
+ case next_record_if_active(State0) of
+ {no_record, State} ->
+ ssl_connection:hibernate_after(StateName, State, Actions);
+ {#ssl_tls{} = Record, State} ->
+ {next_state, StateName, State, [{next_event, internal, {dtls_record, Record}} | Actions]};
+ {#alert{} = Alert, State} ->
+ {next_state, StateName, State, [{next_event, internal, Alert} | Actions]}
+ end;
+next_event(StateName, Record, State, Actions) ->
+ case Record of
+ no_record ->
+ {next_state, StateName, State, Actions};
+ #ssl_tls{} = Record ->
+ {next_state, StateName, State, [{next_event, internal, {dtls_record, Record}} | Actions]};
+ #alert{} = Alert ->
+ {next_state, StateName, State, [{next_event, internal, Alert} | Actions]}
+ end.
send_flight(Fragments, #state{transport_cb = Transport, socket = Socket,
protocol_buffers = _PBuffers} = State) ->
@@ -517,21 +448,23 @@ initial_state(Role, Host, Port, Socket, {SSLOptions, SocketOptions}, User,
renegotiation = {false, first},
allow_renegotiate = SSLOptions#ssl_options.client_renegotiation,
start_or_recv_from = undefined,
- send_queue = queue:new(),
protocol_cb = ?MODULE
}.
read_application_data(_,State) ->
{#ssl_tls{fragment = <<"place holder">>}, State}.
-
+
+next_tls_record(<<>>, _State) ->
+ #alert{}; %% Place holder
next_tls_record(_, State) ->
{#ssl_tls{fragment = <<"place holder">>}, State}.
-get_timeout(_) -> %% Place holder
- infinity.
-
-next_state_connection(_, State) -> %% Place holder
- {next_state, connection, State, get_timeout(State)}.
-
sequence(_) ->
%%TODO real imp
1.
+next_record_if_active(State =
+ #state{socket_options =
+ #socket_options{active = false}}) ->
+ {no_record ,State};
+
+next_record_if_active(State) ->
+ next_record(State).
diff --git a/lib/ssl/src/dtls_connection.hrl b/lib/ssl/src/dtls_connection.hrl
index b74801b50a..69137b520b 100644
--- a/lib/ssl/src/dtls_connection.hrl
+++ b/lib/ssl/src/dtls_connection.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/dtls_connection_sup.erl b/lib/ssl/src/dtls_connection_sup.erl
index cf50537869..dc7601a684 100644
--- a/lib/ssl/src/dtls_connection_sup.erl
+++ b/lib/ssl/src/dtls_connection_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/dtls_handshake.erl b/lib/ssl/src/dtls_handshake.erl
index 22c0ce7a13..4f48704cac 100644
--- a/lib/ssl/src/dtls_handshake.erl
+++ b/lib/ssl/src/dtls_handshake.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -94,7 +94,10 @@ hello(#server_hello{server_version = Version, random = Random,
hello(#client_hello{client_version = ClientVersion}, _Options, {_,_,_,_,ConnectionStates,_}, _Renegotiation) ->
%% Return correct typ to make dialyzer happy until we have time to make the real imp.
- {ClientVersion, {new, #session{}}, ConnectionStates, #hello_extensions{}}.
+ HashSigns = tls_v1:default_signature_algs(dtls_v1:corresponding_tls_version(ClientVersion)),
+ {ClientVersion, {new, #session{}}, ConnectionStates, #hello_extensions{},
+ %% Placeholder for real hasign handling
+ hd(HashSigns)}.
%% hello(Address, Port,
%% #ssl_tls{epoch = _Epoch, sequence_number = _Seq,
diff --git a/lib/ssl/src/dtls_handshake.hrl b/lib/ssl/src/dtls_handshake.hrl
index be32112120..0298fd3105 100644
--- a/lib/ssl/src/dtls_handshake.hrl
+++ b/lib/ssl/src/dtls_handshake.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/dtls_record.erl b/lib/ssl/src/dtls_record.erl
index 2530d66052..e79e1cede0 100644
--- a/lib/ssl/src/dtls_record.erl
+++ b/lib/ssl/src/dtls_record.erl
@@ -39,7 +39,7 @@
-export([encode_plain_text/4, encode_handshake/3, encode_change_cipher_spec/2]).
%% Protocol version handling
--export([protocol_version/1, lowest_protocol_version/2,
+-export([protocol_version/1, lowest_protocol_version/2, lowest_protocol_version/1,
highest_protocol_version/1, supported_protocol_versions/0,
is_acceptable_version/2]).
@@ -254,6 +254,18 @@ lowest_protocol_version(Version = {M,_}, {N, _}) when M > N ->
Version;
lowest_protocol_version(_,Version) ->
Version.
+
+%%--------------------------------------------------------------------
+-spec lowest_protocol_version([dtls_version()]) -> dtls_version().
+%%
+%% Description: Lowest protocol version present in a list
+%%--------------------------------------------------------------------
+lowest_protocol_version([]) ->
+ lowest_protocol_version();
+lowest_protocol_version(Versions) ->
+ [Ver | Vers] = Versions,
+ lowest_list_protocol_version(Ver, Vers).
+
%%--------------------------------------------------------------------
-spec highest_protocol_version([dtls_version()]) -> dtls_version().
%%
@@ -302,6 +314,12 @@ supported_protocol_versions([]) ->
supported_protocol_versions([_|_] = Vsns) ->
Vsns.
+%% highest_protocol_version() ->
+%% highest_protocol_version(supported_protocol_versions()).
+
+lowest_protocol_version() ->
+ lowest_protocol_version(supported_protocol_versions()).
+
supported_connection_protocol_versions([]) ->
?ALL_DATAGRAM_SUPPORTED_VERSIONS.
@@ -421,3 +439,8 @@ mac_hash(Version, MacAlg, MacSecret, SeqNo, Type, Length, Fragment) ->
calc_aad(Type, {MajVer, MinVer}, Epoch, SeqNo) ->
NewSeq = (Epoch bsl 48) + SeqNo,
<<NewSeq:64/integer, ?BYTE(Type), ?BYTE(MajVer), ?BYTE(MinVer)>>.
+
+lowest_list_protocol_version(Ver, []) ->
+ Ver;
+lowest_list_protocol_version(Ver1, [Ver2 | Rest]) ->
+ lowest_list_protocol_version(lowest_protocol_version(Ver1, Ver2), Rest).
diff --git a/lib/ssl/src/dtls_record.hrl b/lib/ssl/src/dtls_record.hrl
index ab59a5fea1..b9f84cbe7f 100644
--- a/lib/ssl/src/dtls_record.hrl
+++ b/lib/ssl/src/dtls_record.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/dtls_v1.erl b/lib/ssl/src/dtls_v1.erl
index 99cedd2adc..8c03bda513 100644
--- a/lib/ssl/src/dtls_v1.erl
+++ b/lib/ssl/src/dtls_v1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/inet_tls_dist.erl b/lib/ssl/src/inet_tls_dist.erl
index ec26142a75..3481e89af0 100644
--- a/lib/ssl/src/inet_tls_dist.erl
+++ b/lib/ssl/src/inet_tls_dist.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/ssl.appup.src b/lib/ssl/src/ssl.appup.src
index 057906bcb3..11728128c4 100644
--- a/lib/ssl/src/ssl.appup.src
+++ b/lib/ssl/src/ssl.appup.src
@@ -1,9 +1,6 @@
%% -*- erlang -*-
{"%VSN%",
[
- {<<"7\\.2">>, [{load_module, tls_connection, soft_purge, soft_purge, []},
- {load_module, ssl_tls_dist_proxy, soft_purge, soft_purge, []}
- ]},
{<<"7\\..*">>, [{restart_application, ssl}]},
{<<"6\\..*">>, [{restart_application, ssl}]},
{<<"5\\..*">>, [{restart_application, ssl}]},
@@ -11,9 +8,6 @@
{<<"3\\..*">>, [{restart_application, ssl}]}
],
[
- {<<"7\\.2">>, [{load_module, tls_connection, soft_purge, soft_purge, []},
- {load_module, ssl_tls_dist_proxy, soft_purge, soft_purge, []}
- ]},
{<<"7\\..*">>, [{restart_application, ssl}]},
{<<"6\\..*">>, [{restart_application, ssl}]},
{<<"5\\..*">>, [{restart_application, ssl}]},
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl
index 780bef5877..dbbb25025c 100644
--- a/lib/ssl/src/ssl.erl
+++ b/lib/ssl/src/ssl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@
renegotiate/1, prf/5, negotiated_protocol/1, negotiated_next_protocol/1,
connection_information/1, connection_information/2]).
%% Misc
--export([random_bytes/1, handle_options/2]).
+-export([handle_options/2]).
-deprecated({negotiated_next_protocol, 1, next_major_release}).
-deprecated({connection_info, 1, next_major_release}).
@@ -581,22 +581,6 @@ format_error(Error) ->
Other
end.
-%%--------------------------------------------------------------------
--spec random_bytes(integer()) -> binary().
-
-%%
-%% Description: Generates cryptographically secure random sequence if possible
-%% fallbacks on pseudo random function
-%%--------------------------------------------------------------------
-random_bytes(N) ->
- try crypto:strong_rand_bytes(N) of
- RandBytes ->
- RandBytes
- catch
- error:low_entropy ->
- crypto:rand_bytes(N)
- end.
-
%%%--------------------------------------------------------------
%%% Internal functions
%%%--------------------------------------------------------------------
@@ -700,6 +684,10 @@ handle_options(Opts0, Role) ->
srp_identity = handle_option(srp_identity, Opts, undefined),
ciphers = handle_cipher_option(proplists:get_value(ciphers, Opts, []),
RecordCb:highest_protocol_version(Versions)),
+ signature_algs = handle_hashsigns_option(proplists:get_value(signature_algs, Opts,
+ default_option_role(server,
+ tls_v1:default_signature_algs(Versions), Role)),
+ RecordCb:highest_protocol_version(Versions)),
%% Server side option
reuse_session = handle_option(reuse_session, Opts, ReuseSessionFun),
reuse_sessions = handle_option(reuse_sessions, Opts, true),
@@ -708,7 +696,7 @@ handle_options(Opts0, Role) ->
default_option_role(server, true, Role),
server, Role),
renegotiate_at = handle_option(renegotiate_at, Opts, ?DEFAULT_RENEGOTIATE_AT),
- hibernate_after = handle_option(hibernate_after, Opts, undefined),
+ hibernate_after = handle_option(hibernate_after, Opts, infinity),
erl_dist = handle_option(erl_dist, Opts, false),
alpn_advertised_protocols =
handle_option(alpn_advertised_protocols, Opts, undefined),
@@ -749,7 +737,7 @@ handle_options(Opts0, Role) ->
alpn_preferred_protocols, next_protocols_advertised,
client_preferred_next_protocols, log_alert,
server_name_indication, honor_cipher_order, padding_check, crl_check, crl_cache,
- fallback],
+ fallback, signature_algs],
SockOpts = lists:foldl(fun(Key, PropList) ->
proplists:delete(Key, PropList)
@@ -897,10 +885,13 @@ validate_option(client_renegotiation, Value) when is_boolean(Value) ->
validate_option(renegotiate_at, Value) when is_integer(Value) ->
erlang:min(Value, ?DEFAULT_RENEGOTIATE_AT);
-validate_option(hibernate_after, undefined) ->
- undefined;
+validate_option(hibernate_after, undefined) -> %% Backwards compatibility
+ infinity;
+validate_option(hibernate_after, infinity) ->
+ infinity;
validate_option(hibernate_after, Value) when is_integer(Value), Value >= 0 ->
Value;
+
validate_option(erl_dist,Value) when is_boolean(Value) ->
Value;
validate_option(Opt, Value)
@@ -989,6 +980,18 @@ validate_option(crl_cache, {Cb, {_Handle, Options}} = Value) when is_atom(Cb) an
validate_option(Opt, Value) ->
throw({error, {options, {Opt, Value}}}).
+handle_hashsigns_option(Value, {Major, Minor} = Version) when is_list(Value)
+ andalso Major >= 3 andalso Minor >= 3->
+ case tls_v1:signature_algs(Version, Value) of
+ [] ->
+ throw({error, {options, no_supported_algorithms, {signature_algs, Value}}});
+ _ ->
+ Value
+ end;
+handle_hashsigns_option(_, {Major, Minor} = Version) when Major >= 3 andalso Minor >= 3->
+ handle_hashsigns_option(tls_v1:default_signature_algs(Version), Version);
+handle_hashsigns_option(_, _Version) ->
+ undefined.
validate_options([]) ->
[];
@@ -1089,10 +1092,7 @@ binary_cipher_suites(Version, []) ->
%% Defaults to all supported suites that does
%% not require explicit configuration
ssl_cipher:filter_suites(ssl_cipher:suites(Version));
-binary_cipher_suites(Version, [{_,_,_,_}| _] = Ciphers0) -> %% Backwards compatibility
- Ciphers = [{KeyExchange, Cipher, Hash} || {KeyExchange, Cipher, Hash, _} <- Ciphers0],
- binary_cipher_suites(Version, Ciphers);
-binary_cipher_suites(Version, [{_,_,_}| _] = Ciphers0) ->
+binary_cipher_suites(Version, [Tuple|_] = Ciphers0) when is_tuple(Tuple) ->
Ciphers = [ssl_cipher:suite(C) || C <- Ciphers0],
binary_cipher_suites(Version, Ciphers);
@@ -1285,6 +1285,13 @@ new_ssl_options([{server_name_indication, Value} | Rest], #ssl_options{} = Opts,
new_ssl_options(Rest, Opts#ssl_options{server_name_indication = validate_option(server_name_indication, Value)}, RecordCB);
new_ssl_options([{honor_cipher_order, Value} | Rest], #ssl_options{} = Opts, RecordCB) ->
new_ssl_options(Rest, Opts#ssl_options{honor_cipher_order = validate_option(honor_cipher_order, Value)}, RecordCB);
+new_ssl_options([{signature_algs, Value} | Rest], #ssl_options{} = Opts, RecordCB) ->
+ new_ssl_options(Rest,
+ Opts#ssl_options{signature_algs =
+ handle_hashsigns_option(Value,
+ RecordCB:highest_protocol_version())},
+ RecordCB);
+
new_ssl_options([{Key, Value} | _Rest], #ssl_options{}, _) ->
throw({error, {options, {Key, Value}}}).
diff --git a/lib/ssl/src/ssl_api.hrl b/lib/ssl/src/ssl_api.hrl
index ceef7b0438..2bd51cf91e 100644
--- a/lib/ssl/src/ssl_api.hrl
+++ b/lib/ssl/src/ssl_api.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/ssl_app.erl b/lib/ssl/src/ssl_app.erl
index 191300b0a1..62e8765d4a 100644
--- a/lib/ssl/src/ssl_app.erl
+++ b/lib/ssl/src/ssl_app.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/ssl_certificate.erl b/lib/ssl/src/ssl_certificate.erl
index e9dc5764a3..3ec3f50e05 100644
--- a/lib/ssl/src/ssl_certificate.erl
+++ b/lib/ssl/src/ssl_certificate.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2015 All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016 All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl
index d737f74aa3..dc0a0c2cc4 100644
--- a/lib/ssl/src/ssl_cipher.erl
+++ b/lib/ssl/src/ssl_cipher.erl
@@ -1,7 +1,7 @@
-%%
+%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -39,16 +39,19 @@
suite/1, suites/1, all_suites/1,
ec_keyed_suites/0, anonymous_suites/1, psk_suites/1, srp_suites/0,
rc4_suites/1, des_suites/1, openssl_suite/1, openssl_suite_name/1, filter/2, filter_suites/1,
- hash_algorithm/1, sign_algorithm/1, is_acceptable_hash/2, is_fallback/1]).
+ hash_algorithm/1, sign_algorithm/1, is_acceptable_hash/2, is_fallback/1,
+ random_bytes/1]).
-export_type([cipher_suite/0,
erl_cipher_suite/0, openssl_cipher_suite/0,
- key_algo/0]).
+ hash/0, key_algo/0, sign_algo/0]).
-type cipher() :: null |rc4_128 | idea_cbc | des40_cbc | des_cbc | '3des_ede_cbc'
| aes_128_cbc | aes_256_cbc | aes_128_gcm | aes_256_gcm | chacha20_poly1305.
-type hash() :: null | sha | md5 | sha224 | sha256 | sha384 | sha512.
--type key_algo() :: null | rsa | dhe_rsa | dhe_dss | ecdhe_ecdsa| ecdh_ecdsa | ecdh_rsa| srp_rsa| srp_dss | psk | dhe_psk | rsa_psk | dh_anon | ecdh_anon | srp_anon.
+-type sign_algo() :: rsa | dsa | ecdsa.
+-type key_algo() :: null | rsa | dhe_rsa | dhe_dss | ecdhe_ecdsa| ecdh_ecdsa | ecdh_rsa| srp_rsa| srp_dss |
+ psk | dhe_psk | rsa_psk | dh_anon | ecdh_anon | srp_anon.
-type erl_cipher_suite() :: {key_algo(), cipher(), hash()} % Pre TLS 1.2
%% TLS 1.2, internally PRE TLS 1.2 will use default_prf
| {key_algo(), cipher(), hash(), hash() | default_prf}.
@@ -101,7 +104,7 @@ cipher_init(?RC4, IV, Key) ->
State = crypto:stream_init(rc4, Key),
#cipher_state{iv = IV, key = Key, state = State};
cipher_init(?AES_GCM, IV, Key) ->
- <<Nonce:64>> = ssl:random_bytes(8),
+ <<Nonce:64>> = random_bytes(8),
#cipher_state{iv = IV, key = Key, nonce = Nonce};
cipher_init(_BCA, IV, Key) ->
#cipher_state{iv = IV, key = Key}.
@@ -852,17 +855,17 @@ suite({rsa_psk, aes_256_cbc,sha}) ->
%%% TLS 1.2 PSK Cipher Suites RFC 5487
-suite({psk, aes_128_gcm, null}) ->
+suite({psk, aes_128_gcm, null, sha256}) ->
?TLS_PSK_WITH_AES_128_GCM_SHA256;
-suite({psk, aes_256_gcm, null}) ->
+suite({psk, aes_256_gcm, null, sha384}) ->
?TLS_PSK_WITH_AES_256_GCM_SHA384;
-suite({dhe_psk, aes_128_gcm, null}) ->
+suite({dhe_psk, aes_128_gcm, null, sha256}) ->
?TLS_DHE_PSK_WITH_AES_128_GCM_SHA256;
-suite({dhe_psk, aes_256_gcm, null}) ->
+suite({dhe_psk, aes_256_gcm, null, sha384}) ->
?TLS_DHE_PSK_WITH_AES_256_GCM_SHA384;
-suite({rsa_psk, aes_128_gcm, null}) ->
+suite({rsa_psk, aes_128_gcm, null, sha256}) ->
?TLS_RSA_PSK_WITH_AES_128_GCM_SHA256;
-suite({rsa_psk, aes_256_gcm, null}) ->
+suite({rsa_psk, aes_256_gcm, null, sha384}) ->
?TLS_RSA_PSK_WITH_AES_256_GCM_SHA384;
suite({psk, aes_128_cbc, sha256}) ->
@@ -969,74 +972,74 @@ suite({ecdh_anon, aes_256_cbc, sha}) ->
?TLS_ECDH_anon_WITH_AES_256_CBC_SHA;
%%% RFC 5289 EC TLS suites
-suite({ecdhe_ecdsa, aes_128_cbc, sha256}) ->
+suite({ecdhe_ecdsa, aes_128_cbc, sha256, sha256}) ->
?TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256;
-suite({ecdhe_ecdsa, aes_256_cbc, sha384}) ->
+suite({ecdhe_ecdsa, aes_256_cbc, sha384, sha384}) ->
?TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384;
-suite({ecdh_ecdsa, aes_128_cbc, sha256}) ->
+suite({ecdh_ecdsa, aes_128_cbc, sha256, sha256}) ->
?TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256;
-suite({ecdh_ecdsa, aes_256_cbc, sha384}) ->
+suite({ecdh_ecdsa, aes_256_cbc, sha384, sha384}) ->
?TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384;
-suite({ecdhe_rsa, aes_128_cbc, sha256}) ->
+suite({ecdhe_rsa, aes_128_cbc, sha256, sha256}) ->
?TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256;
-suite({ecdhe_rsa, aes_256_cbc, sha384}) ->
+suite({ecdhe_rsa, aes_256_cbc, sha384, sha384}) ->
?TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384;
-suite({ecdh_rsa, aes_128_cbc, sha256}) ->
+suite({ecdh_rsa, aes_128_cbc, sha256, sha256}) ->
?TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256;
-suite({ecdh_rsa, aes_256_cbc, sha384}) ->
+suite({ecdh_rsa, aes_256_cbc, sha384, sha384}) ->
?TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384;
%% RFC 5288 AES-GCM Cipher Suites
-suite({rsa, aes_128_gcm, null}) ->
+suite({rsa, aes_128_gcm, null, sha256}) ->
?TLS_RSA_WITH_AES_128_GCM_SHA256;
-suite({rsa, aes_256_gcm, null}) ->
+suite({rsa, aes_256_gcm, null, sha384}) ->
?TLS_RSA_WITH_AES_256_GCM_SHA384;
-suite({dhe_rsa, aes_128_gcm, null}) ->
+suite({dhe_rsa, aes_128_gcm, null, sha256}) ->
?TLS_DHE_RSA_WITH_AES_128_GCM_SHA256;
-suite({dhe_rsa, aes_256_gcm, null}) ->
+suite({dhe_rsa, aes_256_gcm, null, sha384}) ->
?TLS_DHE_RSA_WITH_AES_256_GCM_SHA384;
-suite({dh_rsa, aes_128_gcm, null}) ->
+suite({dh_rsa, aes_128_gcm, null, sha256}) ->
?TLS_DH_RSA_WITH_AES_128_GCM_SHA256;
-suite({dh_rsa, aes_256_gcm, null}) ->
+suite({dh_rsa, aes_256_gcm, null, sha384}) ->
?TLS_DH_RSA_WITH_AES_256_GCM_SHA384;
-suite({dhe_dss, aes_128_gcm, null}) ->
+suite({dhe_dss, aes_128_gcm, null, sha256}) ->
?TLS_DHE_DSS_WITH_AES_128_GCM_SHA256;
-suite({dhe_dss, aes_256_gcm, null}) ->
+suite({dhe_dss, aes_256_gcm, null, sha384}) ->
?TLS_DHE_DSS_WITH_AES_256_GCM_SHA384;
-suite({dh_dss, aes_128_gcm, null}) ->
+suite({dh_dss, aes_128_gcm, null, sha256}) ->
?TLS_DH_DSS_WITH_AES_128_GCM_SHA256;
-suite({dh_dss, aes_256_gcm, null}) ->
+suite({dh_dss, aes_256_gcm, null, sha384}) ->
?TLS_DH_DSS_WITH_AES_256_GCM_SHA384;
-suite({dh_anon, aes_128_gcm, null}) ->
+suite({dh_anon, aes_128_gcm, null, sha256}) ->
?TLS_DH_anon_WITH_AES_128_GCM_SHA256;
-suite({dh_anon, aes_256_gcm, null}) ->
+suite({dh_anon, aes_256_gcm, null, sha384}) ->
?TLS_DH_anon_WITH_AES_256_GCM_SHA384;
%% RFC 5289 ECC AES-GCM Cipher Suites
-suite({ecdhe_ecdsa, aes_128_gcm, null}) ->
+suite({ecdhe_ecdsa, aes_128_gcm, null, sha256}) ->
?TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256;
-suite({ecdhe_ecdsa, aes_256_gcm, null}) ->
+suite({ecdhe_ecdsa, aes_256_gcm, null, sha384}) ->
?TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384;
-suite({ecdh_ecdsa, aes_128_gcm, null}) ->
+suite({ecdh_ecdsa, aes_128_gcm, null, sha256}) ->
?TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256;
-suite({ecdh_ecdsa, aes_256_gcm, null}) ->
+suite({ecdh_ecdsa, aes_256_gcm, null, sha384}) ->
?TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384;
-suite({ecdhe_rsa, aes_128_gcm, null}) ->
+suite({ecdhe_rsa, aes_128_gcm, null, sha256}) ->
?TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256;
-suite({ecdhe_rsa, aes_256_gcm, null}) ->
+suite({ecdhe_rsa, aes_256_gcm, null, sha384}) ->
?TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384;
-suite({ecdh_rsa, aes_128_gcm, null}) ->
+suite({ecdh_rsa, aes_128_gcm, null, sha256}) ->
?TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256;
-suite({ecdh_rsa, aes_256_gcm, null}) ->
+suite({ecdh_rsa, aes_256_gcm, null, sha384}) ->
?TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384;
%% draft-agl-tls-chacha20poly1305-04 Chacha20/Poly1305 Suites
-suite({ecdhe_rsa, chacha20_poly1305, null}) ->
+suite({ecdhe_rsa, chacha20_poly1305, null, sha256}) ->
?TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256;
-suite({ecdhe_ecdsa, chacha20_poly1305, null}) ->
+suite({ecdhe_ecdsa, chacha20_poly1305, null, sha256}) ->
?TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256;
-suite({dhe_rsa, chacha20_poly1305, null}) ->
+suite({dhe_rsa, chacha20_poly1305, null, sha256}) ->
?TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256.
%%--------------------------------------------------------------------
@@ -1471,6 +1474,16 @@ is_acceptable_prf(Prf, Algos) ->
is_fallback(CipherSuites)->
lists:member(?TLS_FALLBACK_SCSV, CipherSuites).
+
+%%--------------------------------------------------------------------
+-spec random_bytes(integer()) -> binary().
+
+%%
+%% Description: Generates cryptographically secure random sequence
+%%--------------------------------------------------------------------
+random_bytes(N) ->
+ crypto:strong_rand_bytes(N).
+
%%--------------------------------------------------------------------
%%% Internal functions
%%--------------------------------------------------------------------
@@ -1711,7 +1724,7 @@ get_padding_aux(BlockSize, PadLength) ->
random_iv(IV) ->
IVSz = byte_size(IV),
- ssl:random_bytes(IVSz).
+ random_bytes(IVSz).
next_iv(Bin, IV) ->
BinSz = byte_size(Bin),
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl
index ec7d086934..26c371a8ea 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@
%% Setup
-export([connect/8, ssl_accept/7, handshake/2, handshake/3,
- socket_control/4, socket_control/5]).
+ socket_control/4, socket_control/5, start_or_recv_cancel_timer/2]).
%% User Events
-export([send/2, recv/3, close/2, shutdown/2,
@@ -47,12 +47,16 @@
connection_information/1
]).
--export([handle_session/7]).
+%% General gen_statem state functions with extra callback argument
+%% to determine if it is an SSL/TLS or DTLS gen_statem machine
+-export([init/4, hello/4, abbreviated/4, certify/4, cipher/4, connection/4, downgrade/4]).
-%% SSL FSM state functions
--export([hello/3, abbreviated/3, certify/3, cipher/3, connection/3]).
-%% SSL all state functions
--export([handle_sync_event/4, handle_info/3, terminate/3, format_status/2]).
+%% gen_statem callbacks
+-export([terminate/3, format_status/2]).
+
+%%
+-export([handle_info/3, handle_call/5, handle_session/7, ssl_config/3,
+ prepare_connection/2, hibernate_after/3]).
%%====================================================================
@@ -100,7 +104,7 @@ ssl_accept(Connection, Port, Socket, Opts, User, CbInfo, Timeout) ->
%% Description: Starts ssl handshake.
%%--------------------------------------------------------------------
handshake(#sslsocket{pid = Pid}, Timeout) ->
- case sync_send_all_state_event(Pid, {start, Timeout}) of
+ case call(Pid, {start, Timeout}) of
connected ->
ok;
Error ->
@@ -114,7 +118,7 @@ handshake(#sslsocket{pid = Pid}, Timeout) ->
%% Description: Starts ssl handshake with some new options
%%--------------------------------------------------------------------
handshake(#sslsocket{pid = Pid}, SslOptions, Timeout) ->
- case sync_send_all_state_event(Pid, {start, SslOptions, Timeout}) of
+ case call(Pid, {start, SslOptions, Timeout}) of
connected ->
ok;
Error ->
@@ -148,7 +152,7 @@ socket_control(Connection, Socket, Pid, Transport, ListenTracker) ->
%% Description: Sends data over the ssl connection
%%--------------------------------------------------------------------
send(Pid, Data) ->
- sync_send_all_state_event(Pid, {application_data,
+ call(Pid, {application_data,
%% iolist_to_binary should really
%% be called iodata_to_binary()
erlang:iolist_to_binary(Data)}).
@@ -160,7 +164,7 @@ send(Pid, Data) ->
%% Description: Receives data when active = false
%%--------------------------------------------------------------------
recv(Pid, Length, Timeout) ->
- sync_send_all_state_event(Pid, {recv, Length, Timeout}).
+ call(Pid, {recv, Length, Timeout}).
%%--------------------------------------------------------------------
-spec connection_information(pid()) -> {ok, list()} | {error, reason()}.
@@ -168,7 +172,7 @@ recv(Pid, Length, Timeout) ->
%% Description: Get the SNI hostname
%%--------------------------------------------------------------------
connection_information(Pid) when is_pid(Pid) ->
- sync_send_all_state_event(Pid, connection_information).
+ call(Pid, connection_information).
%%--------------------------------------------------------------------
-spec close(pid(), {close, Timeout::integer() |
@@ -178,7 +182,7 @@ connection_information(Pid) when is_pid(Pid) ->
%% Description: Close an ssl connection
%%--------------------------------------------------------------------
close(ConnectionPid, How) ->
- case sync_send_all_state_event(ConnectionPid, How) of
+ case call(ConnectionPid, How) of
{error, closed} ->
ok;
Other ->
@@ -190,7 +194,7 @@ close(ConnectionPid, How) ->
%% Description: Same as gen_tcp:shutdown/2
%%--------------------------------------------------------------------
shutdown(ConnectionPid, How) ->
- sync_send_all_state_event(ConnectionPid, {shutdown, How}).
+ call(ConnectionPid, {shutdown, How}).
%%--------------------------------------------------------------------
-spec new_user(pid(), pid()) -> ok | {error, reason()}.
@@ -199,7 +203,7 @@ shutdown(ConnectionPid, How) ->
%% or once.
%%--------------------------------------------------------------------
new_user(ConnectionPid, User) ->
- sync_send_all_state_event(ConnectionPid, {new_user, User}).
+ call(ConnectionPid, {new_user, User}).
%%--------------------------------------------------------------------
-spec negotiated_protocol(pid()) -> {ok, binary()} | {error, reason()}.
@@ -207,7 +211,7 @@ new_user(ConnectionPid, User) ->
%% Description: Returns the negotiated protocol
%%--------------------------------------------------------------------
negotiated_protocol(ConnectionPid) ->
- sync_send_all_state_event(ConnectionPid, negotiated_protocol).
+ call(ConnectionPid, negotiated_protocol).
%%--------------------------------------------------------------------
-spec get_opts(pid(), list()) -> {ok, list()} | {error, reason()}.
@@ -215,14 +219,14 @@ negotiated_protocol(ConnectionPid) ->
%% Description: Same as inet:getopts/2
%%--------------------------------------------------------------------
get_opts(ConnectionPid, OptTags) ->
- sync_send_all_state_event(ConnectionPid, {get_opts, OptTags}).
+ call(ConnectionPid, {get_opts, OptTags}).
%%--------------------------------------------------------------------
-spec set_opts(pid(), list()) -> ok | {error, reason()}.
%%
%% Description: Same as inet:setopts/2
%%--------------------------------------------------------------------
set_opts(ConnectionPid, Options) ->
- sync_send_all_state_event(ConnectionPid, {set_opts, Options}).
+ call(ConnectionPid, {set_opts, Options}).
%%--------------------------------------------------------------------
-spec session_info(pid()) -> {ok, list()} | {error, reason()}.
@@ -230,7 +234,7 @@ set_opts(ConnectionPid, Options) ->
%% Description: Returns info about the ssl session
%%--------------------------------------------------------------------
session_info(ConnectionPid) ->
- sync_send_all_state_event(ConnectionPid, session_info).
+ call(ConnectionPid, session_info).
%%--------------------------------------------------------------------
-spec peer_certificate(pid()) -> {ok, binary()| undefined} | {error, reason()}.
@@ -238,7 +242,7 @@ session_info(ConnectionPid) ->
%% Description: Returns the peer cert
%%--------------------------------------------------------------------
peer_certificate(ConnectionPid) ->
- sync_send_all_state_event(ConnectionPid, peer_certificate).
+ call(ConnectionPid, peer_certificate).
%%--------------------------------------------------------------------
-spec renegotiation(pid()) -> ok | {error, reason()}.
@@ -246,7 +250,7 @@ peer_certificate(ConnectionPid) ->
%% Description: Starts a renegotiation of the ssl session.
%%--------------------------------------------------------------------
renegotiation(ConnectionPid) ->
- sync_send_all_state_event(ConnectionPid, renegotiate).
+ call(ConnectionPid, renegotiate).
%%--------------------------------------------------------------------
-spec prf(pid(), binary() | 'master_secret', binary(),
@@ -256,9 +260,13 @@ renegotiation(ConnectionPid) ->
%% Description: use a ssl sessions TLS PRF to generate key material
%%--------------------------------------------------------------------
prf(ConnectionPid, Secret, Label, Seed, WantedLength) ->
- sync_send_all_state_event(ConnectionPid, {prf, Secret, Label, Seed, WantedLength}).
-
+ call(ConnectionPid, {prf, Secret, Label, Seed, WantedLength}).
+%%--------------------------------------------------------------------
+-spec handle_session(#server_hello{}, ssl_record:ssl_version(),
+ binary(), #connection_states{}, _,_, #state{}) ->
+ gen_statem:state_function_result().
+%%--------------------------------------------------------------------
handle_session(#server_hello{cipher_suite = CipherSuite,
compression_method = Compression},
Version, NewId, ConnectionStates, ProtoExt, Protocol0,
@@ -290,65 +298,104 @@ handle_session(#server_hello{cipher_suite = CipherSuite,
handle_resumed_session(NewId,
State#state{connection_states = ConnectionStates})
end.
-
+
%%--------------------------------------------------------------------
--spec hello(start | #hello_request{} | #server_hello{} | term(),
- #state{}, tls_connection | dtls_connection) ->
- gen_fsm_state_return().
+-spec ssl_config(#ssl_options{}, client | server, #state{}) -> #state{}.
%%--------------------------------------------------------------------
-hello(start, #state{role = server} = State0, Connection) ->
- {Record, State} = Connection:next_record(State0),
- Connection:next_state(hello, hello, Record, State);
-
-hello(#hello_request{}, #state{role = client} = State0, Connection) ->
- {Record, State} = Connection:next_record(State0),
- Connection:next_state(hello, hello, Record, State);
-
-hello({common_client_hello, Type, ServerHelloExt, NegotiatedHashSign},
- State, Connection) ->
- do_server_hello(Type, ServerHelloExt,
- %% Note NegotiatedHashSign is only negotiated for real if
- %% if TLS version is at least TLS-1.2
- State#state{hashsign_algorithm = NegotiatedHashSign}, Connection);
+ssl_config(Opts, Role, State) ->
+ {ok, Ref, CertDbHandle, FileRefHandle, CacheHandle, CRLDbInfo,
+ OwnCert, Key, DHParams} =
+ ssl_config:init(Opts, Role),
+ Handshake = ssl_handshake:init_handshake_history(),
+ TimeStamp = erlang:monotonic_time(),
+ Session = State#state.session,
+ State#state{tls_handshake_history = Handshake,
+ session = Session#session{own_certificate = OwnCert,
+ time_stamp = TimeStamp},
+ file_ref_db = FileRefHandle,
+ cert_db_ref = Ref,
+ cert_db = CertDbHandle,
+ crl_db = CRLDbInfo,
+ session_cache = CacheHandle,
+ private_key = Key,
+ diffie_hellman_params = DHParams,
+ ssl_options = Opts}.
-hello(timeout, State, _) ->
- {next_state, hello, State, hibernate};
+%%====================================================================
+%% gen_statem state functions
+%%====================================================================
+%%--------------------------------------------------------------------
+-spec init(gen_statem:event_type(),
+ {start, timeout()} | {start, {list(), list()}, timeout()}| term(),
+ #state{}, tls_connection | dtls_connection) ->
+ gen_statem:state_function_result().
+%%--------------------------------------------------------------------
-hello(Msg, State, Connection) ->
- Connection:handle_unexpected_message(Msg, hello, State).
+init({call, From}, {start, Timeout}, State0, Connection) ->
+ Timer = start_or_recv_cancel_timer(Timeout, From),
+ {Record, State} = Connection:next_record(State0#state{start_or_recv_from = From,
+ timer = Timer}),
+ Connection:next_event(hello, Record, State);
+init({call, From}, {start, {Opts, EmOpts}, Timeout},
+ #state{role = Role} = State0, Connection) ->
+ try
+ State = ssl_config(Opts, Role, State0),
+ init({call, From}, {start, Timeout},
+ State#state{ssl_options = Opts, socket_options = EmOpts}, Connection)
+ catch throw:Error ->
+ {stop_and_reply, normal, {reply, From, {error, Error}}}
+ end;
+init({call, From}, Msg, State, Connection) ->
+ handle_call(Msg, From, init, State, Connection);
+init(_Type, _Event, _State, _Connection) ->
+ {keep_state_and_data, [postpone]}.
+
+%%--------------------------------------------------------------------
+-spec hello(gen_statem:event_type(),
+ #hello_request{} | #server_hello{} | term(),
+ #state{}, tls_connection | dtls_connection) ->
+ gen_statem:state_function_result().
+%%--------------------------------------------------------------------
+hello({call, From}, Msg, State, Connection) ->
+ handle_call(Msg, From, hello, State, Connection);
+hello(internal, {common_client_hello, Type, ServerHelloExt}, State, Connection) ->
+ do_server_hello(Type, ServerHelloExt, State, Connection);
+hello(info, Msg, State, _) ->
+ handle_info(Msg, hello, State);
+hello(Type, Msg, State, Connection) ->
+ handle_common_event(Type, Msg, hello, State, Connection).
%%--------------------------------------------------------------------
--spec abbreviated(#hello_request{} | #finished{} | term(),
+-spec abbreviated(gen_statem:event_type(),
+ #hello_request{} | #finished{} | term(),
#state{}, tls_connection | dtls_connection) ->
- gen_fsm_state_return().
+ gen_statem:state_function_result().
%%--------------------------------------------------------------------
-abbreviated(#hello_request{}, State0, Connection) ->
- {Record, State} = Connection:next_record(State0),
- Connection:next_state(abbreviated, hello, Record, State);
+abbreviated({call, From}, Msg, State, Connection) ->
+ handle_call(Msg, From, abbreviated, State, Connection);
-abbreviated(#finished{verify_data = Data} = Finished,
+abbreviated(internal, #finished{verify_data = Data} = Finished,
#state{role = server,
negotiated_version = Version,
expecting_finished = true,
tls_handshake_history = Handshake,
session = #session{master_secret = MasterSecret},
connection_states = ConnectionStates0} =
- State, Connection) ->
+ State0, Connection) ->
case ssl_handshake:verify_connection(Version, Finished, client,
get_current_prf(ConnectionStates0, write),
MasterSecret, Handshake) of
verified ->
ConnectionStates =
ssl_record:set_client_verify_data(current_both, Data, ConnectionStates0),
- Connection:next_state_connection(abbreviated,
- ack_connection(
- State#state{connection_states = ConnectionStates,
- expecting_finished = false}));
+ {Record, State} = prepare_connection(State0#state{connection_states = ConnectionStates,
+ expecting_finished = false}, Connection),
+ Connection:next_event(connection, Record, State);
#alert{} = Alert ->
- Connection:handle_own_alert(Alert, Version, abbreviated, State)
+ Connection:handle_own_alert(Alert, Version, abbreviated, State0)
end;
-abbreviated(#finished{verify_data = Data} = Finished,
+abbreviated(internal, #finished{verify_data = Data} = Finished,
#state{role = client, tls_handshake_history = Handshake0,
session = #session{master_secret = MasterSecret},
negotiated_version = Version,
@@ -359,40 +406,49 @@ abbreviated(#finished{verify_data = Data} = Finished,
verified ->
ConnectionStates1 =
ssl_record:set_server_verify_data(current_read, Data, ConnectionStates0),
- State =
+ State1 =
finalize_handshake(State0#state{connection_states = ConnectionStates1},
abbreviated, Connection),
- Connection:next_state_connection(abbreviated,
- ack_connection(State#state{expecting_finished = false}));
- #alert{} = Alert ->
+ {Record, State} = prepare_connection(State1#state{expecting_finished = false}, Connection),
+ Connection:next_event(connection, Record, State);
+ #alert{} = Alert ->
Connection:handle_own_alert(Alert, Version, abbreviated, State0)
end;
%% only allowed to send next_protocol message after change cipher spec
%% & before finished message and it is not allowed during renegotiation
-abbreviated(#next_protocol{selected_protocol = SelectedProtocol},
+abbreviated(internal, #next_protocol{selected_protocol = SelectedProtocol},
#state{role = server, expecting_next_protocol_negotiation = true} = State0,
Connection) ->
- {Record, State} = Connection:next_record(State0#state{negotiated_protocol = SelectedProtocol}),
- Connection:next_state(abbreviated, abbreviated, Record, State#state{expecting_next_protocol_negotiation = false});
-
-abbreviated(timeout, State, _) ->
- {next_state, abbreviated, State, hibernate };
-
-abbreviated(Msg, State, Connection) ->
- Connection:handle_unexpected_message(Msg, abbreviated, State).
-
+ {Record, State} =
+ Connection:next_record(State0#state{negotiated_protocol = SelectedProtocol}),
+ Connection:next_event(abbreviated, Record,
+ State#state{expecting_next_protocol_negotiation = false});
+abbreviated(internal,
+ #change_cipher_spec{type = <<1>>}, #state{connection_states = ConnectionStates0} =
+ State0, Connection) ->
+ ConnectionStates1 =
+ ssl_record:activate_pending_connection_state(ConnectionStates0, read),
+ {Record, State} = Connection:next_record(State0#state{connection_states =
+ ConnectionStates1}),
+ Connection:next_event(abbreviated, Record, State#state{expecting_finished = true});
+abbreviated(info, Msg, State, _) ->
+ handle_info(Msg, abbreviated, State);
+abbreviated(Type, Msg, State, Connection) ->
+ handle_common_event(Type, Msg, abbreviated, State, Connection).
+
%%--------------------------------------------------------------------
--spec certify(#hello_request{} | #certificate{} | #server_key_exchange{} |
+-spec certify(gen_statem:event_type(),
+ #hello_request{} | #certificate{} | #server_key_exchange{} |
#certificate_request{} | #server_hello_done{} | #client_key_exchange{} | term(),
#state{}, tls_connection | dtls_connection) ->
- gen_fsm_state_return().
+ gen_statem:state_function_result().
%%--------------------------------------------------------------------
-certify(#hello_request{}, State0, Connection) ->
- {Record, State} = Connection:next_record(State0),
- Connection:next_state(certify, hello, Record, State);
-
-certify(#certificate{asn1_certificates = []},
+certify({call, From}, Msg, State, Connection) ->
+ handle_call(Msg, From, certify, State, Connection);
+certify(info, Msg, State, _) ->
+ handle_info(Msg, certify, State);
+certify(internal, #certificate{asn1_certificates = []},
#state{role = server, negotiated_version = Version,
ssl_options = #ssl_options{verify = verify_peer,
fail_if_no_peer_cert = true}} =
@@ -400,15 +456,16 @@ certify(#certificate{asn1_certificates = []},
Alert = ?ALERT_REC(?FATAL,?HANDSHAKE_FAILURE),
Connection:handle_own_alert(Alert, Version, certify, State);
-certify(#certificate{asn1_certificates = []},
+certify(internal, #certificate{asn1_certificates = []},
#state{role = server,
ssl_options = #ssl_options{verify = verify_peer,
fail_if_no_peer_cert = false}} =
State0, Connection) ->
- {Record, State} = Connection:next_record(State0#state{client_certificate_requested = false}),
- Connection:next_state(certify, certify, Record, State);
+ {Record, State} =
+ Connection:next_record(State0#state{client_certificate_requested = false}),
+ Connection:next_event(certify, Record, State);
-certify(#certificate{} = Cert,
+certify(internal, #certificate{} = Cert,
#state{negotiated_version = Version,
role = Role,
cert_db = CertDbHandle,
@@ -430,7 +487,7 @@ certify(#certificate{} = Cert,
Connection:handle_own_alert(Alert, Version, certify, State)
end;
-certify(#server_key_exchange{exchange_keys = Keys},
+certify(internal, #server_key_exchange{exchange_keys = Keys},
#state{role = client, negotiated_version = Version,
key_algorithm = Alg,
public_key_info = PubKeyInfo,
@@ -442,36 +499,44 @@ certify(#server_key_exchange{exchange_keys = Keys},
Alg == srp_dss; Alg == srp_rsa; Alg == srp_anon ->
Params = ssl_handshake:decode_server_key(Keys, Alg, Version),
- HashSign = negotiated_hashsign(Params#server_key_params.hashsign, Alg, Version),
+
+ %% Use negotiated value if TLS-1.2 otherwhise return default
+ HashSign = negotiated_hashsign(Params#server_key_params.hashsign, Alg, PubKeyInfo, Version),
+
case is_anonymous(Alg) of
true ->
calculate_secret(Params#server_key_params.params,
State#state{hashsign_algorithm = HashSign}, Connection);
false ->
- case ssl_handshake:verify_server_key(Params, HashSign, ConnectionStates, Version, PubKeyInfo) of
+ case ssl_handshake:verify_server_key(Params, HashSign,
+ ConnectionStates, Version, PubKeyInfo) of
true ->
calculate_secret(Params#server_key_params.params,
- State#state{hashsign_algorithm = HashSign}, Connection);
+ State#state{hashsign_algorithm = HashSign},
+ Connection);
false ->
Connection:handle_own_alert(?ALERT_REC(?FATAL, ?DECRYPT_ERROR),
Version, certify, State)
end
end;
-certify(#server_key_exchange{} = Msg,
- #state{role = client, key_algorithm = rsa} = State, Connection) ->
- Connection:handle_unexpected_message(Msg, certify_server_keyexchange, State);
-
-certify(#certificate_request{hashsign_algorithms = HashSigns},
+certify(internal, #certificate_request{hashsign_algorithms = HashSigns},
#state{session = #session{own_certificate = Cert},
- negotiated_version = Version} = State0, Connection) ->
- HashSign = ssl_handshake:select_hashsign(HashSigns, Cert, Version),
- {Record, State} = Connection:next_record(State0#state{client_certificate_requested = true}),
- Connection:next_state(certify, certify, Record,
- State#state{cert_hashsign_algorithm = HashSign});
+ key_algorithm = KeyExAlg,
+ ssl_options = #ssl_options{signature_algs = SupportedHashSigns},
+ negotiated_version = Version} = State0, Connection) ->
+
+ case ssl_handshake:select_hashsign(HashSigns, Cert, KeyExAlg, SupportedHashSigns, Version) of
+ #alert {} = Alert ->
+ Connection:handle_own_alert(Alert, Version, certify, State0);
+ NegotiatedHashSign ->
+ {Record, State} = Connection:next_record(State0#state{client_certificate_requested = true}),
+ Connection:next_event(certify, Record,
+ State#state{cert_hashsign_algorithm = NegotiatedHashSign})
+ end;
%% PSK and RSA_PSK might bypass the Server-Key-Exchange
-certify(#server_hello_done{},
+certify(internal, #server_hello_done{},
#state{session = #session{master_secret = undefined},
negotiated_version = Version,
psk_identity = PSKIdentity,
@@ -489,27 +554,29 @@ certify(#server_hello_done{},
client_certify_and_key_exchange(State, Connection)
end;
-certify(#server_hello_done{},
+certify(internal, #server_hello_done{},
#state{session = #session{master_secret = undefined},
ssl_options = #ssl_options{user_lookup_fun = PSKLookup},
- negotiated_version = {Major, Minor},
+ negotiated_version = {Major, Minor} = Version,
psk_identity = PSKIdentity,
premaster_secret = undefined,
role = client,
key_algorithm = Alg} = State0, Connection)
when Alg == rsa_psk ->
- Rand = ssl:random_bytes(?NUM_OF_PREMASTERSECRET_BYTES-2),
+ Rand = ssl_cipher:random_bytes(?NUM_OF_PREMASTERSECRET_BYTES-2),
RSAPremasterSecret = <<?BYTE(Major), ?BYTE(Minor), Rand/binary>>,
- case ssl_handshake:premaster_secret({Alg, PSKIdentity}, PSKLookup, RSAPremasterSecret) of
+ case ssl_handshake:premaster_secret({Alg, PSKIdentity}, PSKLookup,
+ RSAPremasterSecret) of
#alert{} = Alert ->
- Alert;
+ Connection:handle_own_alert(Alert, Version, certify, State0);
PremasterSecret ->
- State = master_secret(PremasterSecret, State0#state{premaster_secret = RSAPremasterSecret}),
+ State = master_secret(PremasterSecret,
+ State0#state{premaster_secret = RSAPremasterSecret}),
client_certify_and_key_exchange(State, Connection)
end;
%% Master secret was determined with help of server-key exchange msg
-certify(#server_hello_done{},
+certify(internal, #server_hello_done{},
#state{session = #session{master_secret = MasterSecret} = Session,
connection_states = ConnectionStates0,
negotiated_version = Version,
@@ -525,7 +592,7 @@ certify(#server_hello_done{},
end;
%% Master secret is calculated from premaster_secret
-certify(#server_hello_done{},
+certify(internal, #server_hello_done{},
#state{session = Session0,
connection_states = ConnectionStates0,
negotiated_version = Version,
@@ -542,14 +609,15 @@ certify(#server_hello_done{},
Connection:handle_own_alert(Alert, Version, certify, State0)
end;
-certify(#client_key_exchange{} = Msg,
+certify(internal = Type, #client_key_exchange{} = Msg,
#state{role = server,
client_certificate_requested = true,
- ssl_options = #ssl_options{fail_if_no_peer_cert = true}} = State, Connection) ->
+ ssl_options = #ssl_options{fail_if_no_peer_cert = true}} = State,
+ Connection) ->
%% We expect a certificate here
- Connection:handle_unexpected_message(Msg, certify_client_key_exchange, State);
+ handle_common_event(Type, Msg, certify, State, Connection);
-certify(#client_key_exchange{exchange_keys = Keys},
+certify(internal, #client_key_exchange{exchange_keys = Keys},
State = #state{key_algorithm = KeyAlg, negotiated_version = Version}, Connection) ->
try
certify_client_key_exchange(ssl_handshake:decode_client_key(Keys, KeyAlg, Version),
@@ -559,47 +627,51 @@ certify(#client_key_exchange{exchange_keys = Keys},
Connection:handle_own_alert(Alert, Version, certify, State)
end;
-certify(timeout, State, _) ->
- {next_state, certify, State, hibernate};
-
-certify(Msg, State, Connection) ->
- Connection:handle_unexpected_message(Msg, certify, State).
-
+certify(Type, Msg, State, Connection) ->
+ handle_common_event(Type, Msg, certify, State, Connection).
+
%%--------------------------------------------------------------------
--spec cipher(#hello_request{} | #certificate_verify{} | #finished{} | term(),
+-spec cipher(gen_statem:event_type(),
+ #hello_request{} | #certificate_verify{} | #finished{} | term(),
#state{}, tls_connection | dtls_connection) ->
- gen_fsm_state_return().
+ gen_statem:state_function_result().
%%--------------------------------------------------------------------
-cipher(#hello_request{}, State0, Connection) ->
- {Record, State} = Connection:next_record(State0),
- Connection:next_state(cipher, hello, Record, State);
+cipher({call, From}, Msg, State, Connection) ->
+ handle_call(Msg, From, cipher, State, Connection);
+
+cipher(info, Msg, State, _) ->
+ handle_info(Msg, cipher, State);
-cipher(#certificate_verify{signature = Signature, hashsign_algorithm = CertHashSign},
+cipher(internal, #certificate_verify{signature = Signature,
+ hashsign_algorithm = CertHashSign},
#state{role = server,
- public_key_info = {Algo, _, _} =PublicKeyInfo,
+ key_algorithm = KexAlg,
+ public_key_info = PublicKeyInfo,
negotiated_version = Version,
session = #session{master_secret = MasterSecret},
tls_handshake_history = Handshake
} = State0, Connection) ->
-
- HashSign = ssl_handshake:select_hashsign_algs(CertHashSign, Algo, Version),
+
+ %% Use negotiated value if TLS-1.2 otherwhise return default
+ HashSign = negotiated_hashsign(CertHashSign, KexAlg, PublicKeyInfo, Version),
case ssl_handshake:certificate_verify(Signature, PublicKeyInfo,
Version, HashSign, MasterSecret, Handshake) of
valid ->
{Record, State} = Connection:next_record(State0),
- Connection:next_state(cipher, cipher, Record,
+ Connection:next_event(cipher, Record,
State#state{cert_hashsign_algorithm = HashSign});
#alert{} = Alert ->
Connection:handle_own_alert(Alert, Version, cipher, State0)
end;
%% client must send a next protocol message if we are expecting it
-cipher(#finished{}, #state{role = server, expecting_next_protocol_negotiation = true,
- negotiated_protocol = undefined, negotiated_version = Version} = State0,
+cipher(internal, #finished{},
+ #state{role = server, expecting_next_protocol_negotiation = true,
+ negotiated_protocol = undefined, negotiated_version = Version} = State0,
Connection) ->
Connection:handle_own_alert(?ALERT_REC(?FATAL,?UNEXPECTED_MESSAGE), Version, cipher, State0);
-cipher(#finished{verify_data = Data} = Finished,
+cipher(internal, #finished{verify_data = Data} = Finished,
#state{negotiated_version = Version,
host = Host,
port = Port,
@@ -615,109 +687,154 @@ cipher(#finished{verify_data = Data} = Finished,
MasterSecret, Handshake0) of
verified ->
Session = register_session(Role, Host, Port, Session0),
- cipher_role(Role, Data, Session, State#state{expecting_finished = false}, Connection);
+ cipher_role(Role, Data, Session,
+ State#state{expecting_finished = false}, Connection);
#alert{} = Alert ->
Connection:handle_own_alert(Alert, Version, cipher, State)
end;
%% only allowed to send next_protocol message after change cipher spec
%% & before finished message and it is not allowed during renegotiation
-cipher(#next_protocol{selected_protocol = SelectedProtocol},
+cipher(internal, #next_protocol{selected_protocol = SelectedProtocol},
#state{role = server, expecting_next_protocol_negotiation = true,
expecting_finished = true} = State0, Connection) ->
- {Record, State} = Connection:next_record(State0#state{negotiated_protocol = SelectedProtocol}),
- Connection:next_state(cipher, cipher, Record, State#state{expecting_next_protocol_negotiation = false});
-
-cipher(timeout, State, _) ->
- {next_state, cipher, State, hibernate};
-
-cipher(Msg, State, Connection) ->
- Connection:handle_unexpected_message(Msg, cipher, State).
+ {Record, State} =
+ Connection:next_record(State0#state{negotiated_protocol = SelectedProtocol}),
+ Connection:next_event(cipher, Record,
+ State#state{expecting_next_protocol_negotiation = false});
+cipher(internal, #change_cipher_spec{type = <<1>>}, #state{connection_states = ConnectionStates0} =
+ State0, Connection) ->
+ ConnectionStates1 =
+ ssl_record:activate_pending_connection_state(ConnectionStates0, read),
+ {Record, State} = Connection:next_record(State0#state{connection_states =
+ ConnectionStates1}),
+ Connection:next_event(cipher, Record, State#state{expecting_finished = true});
+cipher(Type, Msg, State, Connection) ->
+ handle_common_event(Type, Msg, cipher, State, Connection).
%%--------------------------------------------------------------------
--spec connection(term(), #state{}, tls_connection | dtls_connection) ->
- gen_fsm_state_return().
+-spec connection(gen_statem:event_type(), term(),
+ #state{}, tls_connection | dtls_connection) ->
+ gen_statem:state_function_result().
%%--------------------------------------------------------------------
-connection(timeout, State, _) ->
- {next_state, connection, State, hibernate};
+connection({call, From}, {application_data, Data},
+ #state{protocol_cb = Connection} = State, Connection) ->
+ %% We should look into having a worker process to do this to
+ %% parallize send and receive decoding and not block the receiver
+ %% if sending is overloading the socket.
+ try
+ Connection:write_application_data(Data, From, State)
+ catch throw:Error ->
+ hibernate_after(connection, State, [{reply, From, Error}])
+ end;
+connection({call, RecvFrom}, {recv, N, Timeout},
+ #state{protocol_cb = Connection, socket_options =
+ #socket_options{active = false}} = State0, Connection) ->
+ Timer = start_or_recv_cancel_timer(Timeout, RecvFrom),
+ Connection:passive_receive(State0#state{bytes_to_read = N,
+ start_or_recv_from = RecvFrom,
+ timer = Timer}, connection);
+connection({call, From}, renegotiate, #state{protocol_cb = Connection} = State,
+ Connection) ->
+ Connection:renegotiate(State#state{renegotiation = {true, From}}, []);
+connection({call, From}, peer_certificate,
+ #state{session = #session{peer_certificate = Cert}} = State, _) ->
+ hibernate_after(connection, State, [{reply, From, {ok, Cert}}]);
+connection({call, From}, connection_information, State, _) ->
+ Info = connection_info(State),
+ hibernate_after(connection, State, [{reply, From, {ok, Info}}]);
+connection({call, From}, session_info, #state{session = #session{session_id = Id,
+ cipher_suite = Suite}} = State, _) ->
+ SessionInfo = [{session_id, Id},
+ {cipher_suite, ssl_cipher:erl_suite_definition(Suite)}],
+ hibernate_after(connection, State, [{reply, From, SessionInfo}]);
+connection({call, From}, negotiated_protocol,
+ #state{negotiated_protocol = undefined} = State, _) ->
+ hibernate_after(connection, State, [{reply, From, {error, protocol_not_negotiated}}]);
+connection({call, From}, negotiated_protocol,
+ #state{negotiated_protocol = SelectedProtocol} = State, _) ->
+ hibernate_after(connection, State,
+ [{reply, From, {ok, SelectedProtocol}}]);
+connection({call, From}, Msg, State, Connection) ->
+ handle_call(Msg, From, connection, State, Connection);
+connection(info, Msg, State, _) ->
+ handle_info(Msg, connection, State);
+connection(internal, {recv, _}, State, Connection) ->
+ Connection:passive_receive(State, connection);
+connection(Type, Msg, State, Connection) ->
+ handle_common_event(Type, Msg, connection, State, Connection).
-connection(Msg, State, Connection) ->
- Connection:handle_unexpected_message(Msg, connection, State).
+%%--------------------------------------------------------------------
+-spec downgrade(gen_statem:event_type(), term(),
+ #state{}, tls_connection | dtls_connection) ->
+ gen_statem:state_function_result().
+%%--------------------------------------------------------------------
+downgrade(internal, #alert{description = ?CLOSE_NOTIFY},
+ #state{transport_cb = Transport, socket = Socket,
+ downgrade = {Pid, From}} = State, _) ->
+ ssl_socket:setopts(Transport, Socket, [{active, false}, {packet, 0}, {mode, binary}]),
+ Transport:controlling_process(Socket, Pid),
+ gen_statem:reply(From, {ok, Socket}),
+ {stop, normal, State};
+downgrade(timeout, downgrade, #state{downgrade = {_, From}} = State, _) ->
+ gen_statem:reply(From, {error, timeout}),
+ {stop, normal, State};
+downgrade(Type, Event, State, Connection) ->
+ handle_common_event(Type, Event, downgrade, State, Connection).
%%--------------------------------------------------------------------
-%% Description: Whenever a gen_fsm receives an event sent using
-%% gen_fsm:sync_send_all_state_event/2,3, this function is called to handle
-%% the event.
+%% Event handling functions called by state functions to handle
+%% common or unexpected events for the state.
%%--------------------------------------------------------------------
-handle_sync_event({application_data, Data}, From, connection,
- #state{protocol_cb = Connection} = State) ->
- %% We should look into having a worker process to do this to
- %% parallize send and receive decoding and not block the receiver
- %% if sending is overloading the socket.
- try
- Connection:write_application_data(Data, From, State)
- catch throw:Error ->
- {reply, Error, connection, State, get_timeout(State)}
+handle_common_event(internal, {tls_record, TLSRecord}, StateName, State, Connection) ->
+ Connection:handle_common_event(internal, TLSRecord, StateName, State);
+handle_common_event(internal, #hello_request{}, StateName, #state{role = client} = State0, Connection)
+ when StateName =:= connection ->
+ {Record, State} = Connection:next_record(State0),
+ Connection:next_event(StateName, Record, State);
+handle_common_event(timeout, hibernate, _, _, _) ->
+ {keep_state_and_data, [hibernate]};
+handle_common_event(internal, {application_data, Data}, StateName, State0, Connection) ->
+ case Connection:read_application_data(Data, State0) of
+ {stop, Reason, State} ->
+ {stop, Reason, State};
+ {Record, State} ->
+ Connection:next_event(StateName, Record, State)
end;
-handle_sync_event({application_data, Data}, From, StateName,
- #state{send_queue = Queue} = State) ->
+handle_common_event(internal, #change_cipher_spec{type = <<1>>}, StateName,
+ #state{negotiated_version = Version} = State, Connection) ->
+ Connection:handle_own_alert(?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE), Version,
+ StateName, State);
+handle_common_event(internal, _, _, _, _) ->
+ {keep_state_and_data, [postpone]};
+handle_common_event(_Type, Msg, StateName, #state{negotiated_version = Version} = State,
+ Connection) ->
+ Alert = ?ALERT_REC(?FATAL,?UNEXPECTED_MESSAGE),
+ Connection:handle_own_alert(Alert, Version, {StateName, Msg}, State).
+
+handle_call({application_data, _Data}, _, _, _, _) ->
%% In renegotiation priorities handshake, send data when handshake is finished
- {next_state, StateName,
- State#state{send_queue = queue:in({From, Data}, Queue)},
- get_timeout(State)};
-
-handle_sync_event({start, Timeout}, StartFrom, hello, #state{role = Role,
- protocol_cb = Connection,
- ssl_options = SSLOpts} = State0) ->
- try
- State = ssl_config(SSLOpts, Role, State0),
- Timer = start_or_recv_cancel_timer(Timeout, StartFrom),
- Connection:hello(start, State#state{start_or_recv_from = StartFrom,
- timer = Timer})
- catch throw:Error ->
- {stop, normal, {error, Error}, State0}
- end;
-
-handle_sync_event({start, {Opts, EmOpts}, Timeout}, From, StateName, State) ->
- try
- handle_sync_event({start, Timeout}, From, StateName, State#state{socket_options = EmOpts,
- ssl_options = Opts})
- catch throw:Error ->
- {stop, normal, {error, Error}, State}
- end;
-
-%% These two clauses below could happen if a server upgrades a socket in
-%% active mode. Note that in this case we are lucky that
-%% controlling_process has been evalueated before receiving handshake
-%% messages from client. The server should put the socket in passive
-%% mode before telling the client that it is willing to upgrade
-%% and before calling ssl:ssl_accept/2. These clauses are
-%% here to make sure it is the users problem and not owers if
-%% they upgrade an active socket.
-handle_sync_event({start,_}, _, connection, State) ->
- {reply, connected, connection, State, get_timeout(State)};
-
-handle_sync_event({start, Timeout}, StartFrom, StateName, #state{role = Role, ssl_options = SslOpts} = State0) ->
- try
- State = ssl_config(SslOpts, Role, State0),
- Timer = start_or_recv_cancel_timer(Timeout, StartFrom),
- {next_state, StateName, State#state{start_or_recv_from = StartFrom,
- timer = Timer}, get_timeout(State)}
- catch throw:Error ->
- {stop, normal, {error, Error}, State0}
- end;
-
-handle_sync_event({close, _} = Close, _, StateName, #state{protocol_cb = Connection} = State) ->
+ {keep_state_and_data, [postpone]};
+handle_call({close, {Pid, Timeout}}, From, StateName, State0, Connection) when is_pid(Pid) ->
+ %% terminate will send close alert to peer
+ State = State0#state{downgrade = {Pid, From}},
+ Connection:terminate(downgrade, StateName, State),
+ %% User downgrades connection
+ %% When downgrading an TLS connection to a transport connection
+ %% we must recive the close alert from the peer before releasing the
+ %% transport socket.
+ {next_state, downgrade, State, [{timeout, Timeout, downgrade}]};
+handle_call({close, _} = Close, From, StateName, State, Connection) ->
%% Run terminate before returning so that the reuseaddr
- %% inet-option and possible downgrade will work as intended.
+ %% inet-option
Result = Connection:terminate(Close, StateName, State),
- {stop, normal, Result, State#state{terminated = true}};
-
-handle_sync_event({shutdown, How0}, _, StateName,
- #state{transport_cb = Transport,
- negotiated_version = Version,
- connection_states = ConnectionStates,
- socket = Socket} = State) ->
+ {stop_and_reply, {shutdown, normal},
+ {reply, From, Result}, State};
+handle_call({shutdown, How0}, From, _,
+ #state{transport_cb = Transport,
+ negotiated_version = Version,
+ connection_states = ConnectionStates,
+ socket = Socket}, _) ->
case How0 of
How when How == write; How == both ->
Alert = ?ALERT_REC(?WARNING, ?CLOSE_NOTIFY),
@@ -727,95 +844,91 @@ handle_sync_event({shutdown, How0}, _, StateName,
_ ->
ok
end,
-
+
case Transport:shutdown(Socket, How0) of
ok ->
- {reply, ok, StateName, State, get_timeout(State)};
+ {keep_state_and_data, [{reply, From, ok}]};
Error ->
- {stop, normal, Error, State}
+ gen_statem:reply(From, {error, Error}),
+ {stop, normal}
end;
-handle_sync_event({recv, _N, _Timeout}, _RecvFrom, StateName,
- #state{socket_options = #socket_options{active = Active}} = State) when Active =/= false ->
- {reply, {error, einval}, StateName, State, get_timeout(State)};
-handle_sync_event({recv, N, Timeout}, RecvFrom, connection = StateName,
- #state{protocol_cb = Connection} = State0) ->
- Timer = start_or_recv_cancel_timer(Timeout, RecvFrom),
- Connection:passive_receive(State0#state{bytes_to_read = N,
- start_or_recv_from = RecvFrom, timer = Timer}, StateName);
-%% Doing renegotiate wait with handling request until renegotiate is
-%% finished. Will be handled by next_state_is_connection/2.
-handle_sync_event({recv, N, Timeout}, RecvFrom, StateName, State) ->
+handle_call({recv, _N, _Timeout}, From, _,
+ #state{socket_options =
+ #socket_options{active = Active}}, _) when Active =/= false ->
+ {keep_state_and_data, [{reply, From, {error, einval}}]};
+handle_call({recv, N, Timeout}, RecvFrom, StateName, State, _) ->
+ %% Doing renegotiate wait with handling request until renegotiate is
+ %% finished.
Timer = start_or_recv_cancel_timer(Timeout, RecvFrom),
{next_state, StateName, State#state{bytes_to_read = N, start_or_recv_from = RecvFrom,
- timer = Timer},
- get_timeout(State)};
-handle_sync_event({new_user, User}, _From, StateName,
- State =#state{user_application = {OldMon, _}}) ->
+ timer = Timer},
+ [{next_event, internal, {recv, RecvFrom}}]};
+handle_call({new_user, User}, From, StateName,
+ State =#state{user_application = {OldMon, _}}, _) ->
NewMon = erlang:monitor(process, User),
erlang:demonitor(OldMon, [flush]),
- {reply, ok, StateName, State#state{user_application = {NewMon,User}},
- get_timeout(State)};
-handle_sync_event({get_opts, OptTags}, _From, StateName,
+ {next_state, StateName, State#state{user_application = {NewMon,User}},
+ [{reply, From, ok}]};
+handle_call({get_opts, OptTags}, From, _,
#state{socket = Socket,
transport_cb = Transport,
- socket_options = SockOpts} = State) ->
+ socket_options = SockOpts}, _) ->
OptsReply = get_socket_opts(Transport, Socket, OptTags, SockOpts, []),
- {reply, OptsReply, StateName, State, get_timeout(State)};
-handle_sync_event(negotiated_protocol, _From, StateName, #state{negotiated_protocol = undefined} = State) ->
- {reply, {error, protocol_not_negotiated}, StateName, State, get_timeout(State)};
-handle_sync_event(negotiated_protocol, _From, StateName, #state{negotiated_protocol = SelectedProtocol} = State) ->
- {reply, {ok, SelectedProtocol}, StateName, State, get_timeout(State)};
-handle_sync_event({set_opts, Opts0}, _From, StateName0,
- #state{socket_options = Opts1,
+ {keep_state_and_data, [{reply, From, OptsReply}]};
+handle_call({set_opts, Opts0}, From, connection = StateName0,
+ #state{socket_options = Opts1,
protocol_cb = Connection,
socket = Socket,
transport_cb = Transport,
- user_data_buffer = Buffer} = State0) ->
+ user_data_buffer = Buffer} = State0, _) ->
{Reply, Opts} = set_socket_opts(Transport, Socket, Opts0, Opts1, []),
State1 = State0#state{socket_options = Opts},
if
Opts#socket_options.active =:= false ->
- {reply, Reply, StateName0, State1, get_timeout(State1)};
+ hibernate_after(StateName0, State1, [{reply, From, Reply}]);
Buffer =:= <<>>, Opts1#socket_options.active =:= false ->
%% Need data, set active once
{Record, State2} = Connection:next_record_if_active(State1),
%% Note: Renogotiation may cause StateName0 =/= StateName
- case Connection:next_state(StateName0, StateName0, Record, State2) of
- {next_state, StateName, State, Timeout} ->
- {reply, Reply, StateName, State, Timeout};
+ case Connection:next_event(StateName0, Record, State2) of
+ {next_state, StateName, State} ->
+ hibernate_after(StateName, State, [{reply, From, Reply}]);
+ {next_state, StateName, State, Actions} ->
+ hibernate_after(StateName, State, [{reply, From, Reply} | Actions]);
{stop, Reason, State} ->
{stop, Reason, State}
end;
Buffer =:= <<>> ->
%% Active once already set
- {reply, Reply, StateName0, State1, get_timeout(State1)};
+ hibernate_after(StateName0, State1, [{reply, From, Reply}]);
true ->
case Connection:read_application_data(<<>>, State1) of
- Stop = {stop,_,_} ->
- Stop;
+ {stop, Reason, State} ->
+ {stop, Reason, State};
{Record, State2} ->
%% Note: Renogotiation may cause StateName0 =/= StateName
- case Connection:next_state(StateName0, StateName0, Record, State2) of
- {next_state, StateName, State, Timeout} ->
- {reply, Reply, StateName, State, Timeout};
- {stop, Reason, State} ->
- {stop, Reason, State}
+ case Connection:next_event(StateName0, Record, State2) of
+ {next_state, StateName, State} ->
+ hibernate_after(StateName, State, [{reply, From, Reply}]);
+ {next_state, StateName, State, Actions} ->
+ hibernate_after(StateName, State, [{reply, From, Reply} | Actions]);
+ {stop, _, _} = Stop ->
+ Stop
end
end
end;
-handle_sync_event(renegotiate, From, connection, #state{protocol_cb = Connection} = State) ->
- Connection:renegotiate(State#state{renegotiation = {true, From}});
-handle_sync_event(renegotiate, _, StateName, State) ->
- {reply, {error, already_renegotiating}, StateName, State, get_timeout(State)};
-handle_sync_event({prf, Secret, Label, Seed, WantedLength}, _, StateName,
- #state{connection_states = ConnectionStates,
- negotiated_version = Version} = State) ->
+handle_call(renegotiate, From, StateName, _, _) when StateName =/= connection ->
+ {keep_state_and_data, [{reply, From, {error, already_renegotiating}}]};
+handle_call({prf, Secret, Label, Seed, WantedLength}, From, _,
+ #state{connection_states = ConnectionStates,
+ negotiated_version = Version}, _) ->
ConnectionState =
ssl_record:current_connection_state(ConnectionStates, read),
SecParams = ConnectionState#connection_state.security_parameters,
#security_parameters{master_secret = MasterSecret,
client_random = ClientRandom,
- server_random = ServerRandom} = SecParams,
+ server_random = ServerRandom,
+ prf_algorithm = PRFAlgorithm} = SecParams,
Reply = try
SecretToUse = case Secret of
_ when is_binary(Secret) -> Secret;
@@ -826,32 +939,14 @@ handle_sync_event({prf, Secret, Label, Seed, WantedLength}, _, StateName,
(client_random, Acc) -> [ClientRandom|Acc];
(server_random, Acc) -> [ServerRandom|Acc]
end, [], Seed)),
- ssl_handshake:prf(Version, SecretToUse, Label, SeedToUse, WantedLength)
+ ssl_handshake:prf(Version, PRFAlgorithm, SecretToUse, Label, SeedToUse, WantedLength)
catch
exit:_ -> {error, badarg};
error:Reason -> {error, Reason}
end,
- {reply, Reply, StateName, State, get_timeout(State)};
-handle_sync_event(session_info, _, StateName,
- #state{session = #session{session_id = Id,
- cipher_suite = Suite}} = State) ->
- {reply, [{session_id, Id},
- {cipher_suite, ssl_cipher:erl_suite_definition(Suite)}],
- StateName, State, get_timeout(State)};
-handle_sync_event(peer_certificate, _, StateName,
- #state{session = #session{peer_certificate = Cert}}
- = State) ->
- {reply, {ok, Cert}, StateName, State, get_timeout(State)};
-handle_sync_event(connection_information, _, StateName, State) ->
- Info = connection_info(State),
- {reply, {ok, Info}, StateName, State, get_timeout(State)}.
-
-connection_info(#state{sni_hostname = SNIHostname,
- session = #session{cipher_suite = CipherSuite},
- negotiated_version = Version, ssl_options = Opts}) ->
- [{protocol, tls_record:protocol_version(Version)},
- {cipher_suite, ssl_cipher:erl_suite_definition(CipherSuite)},
- {sni_hostname, SNIHostname}] ++ ssl_options_list(Opts).
+ {keep_state_and_data, [{reply, From, Reply}]};
+handle_call(_,_,_,_,_) ->
+ {keep_state_and_data, [postpone]}.
handle_info({ErrorTag, Socket, econnaborted}, StateName,
#state{socket = Socket, transport_cb = Transport,
@@ -859,7 +954,8 @@ handle_info({ErrorTag, Socket, econnaborted}, StateName,
protocol_cb = Connection,
error_tag = ErrorTag,
tracker = Tracker} = State) when StateName =/= connection ->
- Connection:alert_user(Transport, Tracker,Socket, StartFrom, ?ALERT_REC(?FATAL, ?CLOSE_NOTIFY), Role),
+ Connection:alert_user(Transport, Tracker,Socket,
+ StartFrom, ?ALERT_REC(?FATAL, ?CLOSE_NOTIFY), Role),
{stop, normal, State};
handle_info({ErrorTag, Socket, Reason}, StateName, #state{socket = Socket,
@@ -882,47 +978,46 @@ handle_info({'EXIT', Socket, normal}, _StateName, #state{socket = Socket} = Stat
{stop, {shutdown, transport_closed}, State};
handle_info(allow_renegotiate, StateName, State) ->
- {next_state, StateName, State#state{allow_renegotiate = true}, get_timeout(State)};
+ {next_state, StateName, State#state{allow_renegotiate = true}};
handle_info({cancel_start_or_recv, StartFrom}, StateName,
#state{renegotiation = {false, first}} = State) when StateName =/= connection ->
- gen_fsm:reply(StartFrom, {error, timeout}),
- {stop, {shutdown, user_timeout}, State#state{timer = undefined}};
+ {stop_and_reply, {shutdown, user_timeout},
+ {reply, StartFrom, {error, timeout}}, State#state{timer = undefined}};
-handle_info({cancel_start_or_recv, RecvFrom}, StateName, #state{start_or_recv_from = RecvFrom} = State) ->
- gen_fsm:reply(RecvFrom, {error, timeout}),
+handle_info({cancel_start_or_recv, RecvFrom}, StateName,
+ #state{start_or_recv_from = RecvFrom} = State) when RecvFrom =/= undefined ->
{next_state, StateName, State#state{start_or_recv_from = undefined,
bytes_to_read = undefined,
- timer = undefined}, get_timeout(State)};
+ timer = undefined}, [{reply, RecvFrom, {error, timeout}}]};
handle_info({cancel_start_or_recv, _RecvFrom}, StateName, State) ->
- {next_state, StateName, State#state{timer = undefined}, get_timeout(State)};
+ {next_state, StateName, State#state{timer = undefined}};
handle_info(Msg, StateName, #state{socket = Socket, error_tag = Tag} = State) ->
Report = io_lib:format("SSL: Got unexpected info: ~p ~n", [{Msg, Tag, Socket}]),
error_logger:info_report(Report),
- {next_state, StateName, State, get_timeout(State)}.
-
+ {next_state, StateName, State}.
+%%--------------------------------------------------------------------
+%% gen_statem callbacks
+%%--------------------------------------------------------------------
terminate(_, _, #state{terminated = true}) ->
%% Happens when user closes the connection using ssl:close/1
%% we want to guarantee that Transport:close has been called
%% when ssl:close/1 returns.
ok;
+
terminate({shutdown, transport_closed} = Reason,
- _StateName, #state{send_queue = SendQueue, protocol_cb = Connection,
- socket = Socket, transport_cb = Transport,
- renegotiation = Renegotiate} = State) ->
+ _StateName, #state{protocol_cb = Connection,
+ socket = Socket, transport_cb = Transport} = State) ->
handle_trusted_certs_db(State),
- notify_senders(SendQueue),
- notify_renegotiater(Renegotiate),
Connection:close(Reason, Socket, Transport, undefined, undefined);
-terminate({shutdown, own_alert}, _StateName, #state{send_queue = SendQueue, protocol_cb = Connection,
- socket = Socket, transport_cb = Transport,
- renegotiation = Renegotiate} = State) ->
+terminate({shutdown, own_alert}, _StateName, #state{%%send_queue = SendQueue,
+ protocol_cb = Connection,
+ socket = Socket,
+ transport_cb = Transport} = State) ->
handle_trusted_certs_db(State),
- notify_senders(SendQueue),
- notify_renegotiater(Renegotiate),
case application:get_env(ssl, alert_timeout) of
{ok, Timeout} when is_integer(Timeout) ->
Connection:close({timeout, Timeout}, Socket, Transport, undefined, undefined);
@@ -933,26 +1028,22 @@ terminate(Reason, connection, #state{negotiated_version = Version,
protocol_cb = Connection,
connection_states = ConnectionStates0,
ssl_options = #ssl_options{padding_check = Check},
- transport_cb = Transport, socket = Socket,
- send_queue = SendQueue, renegotiation = Renegotiate} = State) ->
+ transport_cb = Transport, socket = Socket
+ } = State) ->
handle_trusted_certs_db(State),
- notify_senders(SendQueue),
- notify_renegotiater(Renegotiate),
{BinAlert, ConnectionStates} = terminate_alert(Reason, Version, ConnectionStates0),
Transport:send(Socket, BinAlert),
Connection:close(Reason, Socket, Transport, ConnectionStates, Check);
terminate(Reason, _StateName, #state{transport_cb = Transport, protocol_cb = Connection,
- socket = Socket, send_queue = SendQueue,
- renegotiation = Renegotiate} = State) ->
+ socket = Socket
+ } = State) ->
handle_trusted_certs_db(State),
- notify_senders(SendQueue),
- notify_renegotiater(Renegotiate),
Connection:close(Reason, Socket, Transport, undefined, undefined).
-format_status(normal, [_, State]) ->
- [{data, [{"StateData", State}]}];
-format_status(terminate, [_, State]) ->
+format_status(normal, [_, StateName, State]) ->
+ [{data, [{"State", {StateName, State}}]}];
+format_status(terminate, [_, StateName, State]) ->
SslOptions = (State#state.ssl_options),
NewOptions = SslOptions#ssl_options{password = ?SECRET_PRINTOUT,
cert = ?SECRET_PRINTOUT,
@@ -961,39 +1052,29 @@ format_status(terminate, [_, State]) ->
dh = ?SECRET_PRINTOUT,
psk_identity = ?SECRET_PRINTOUT,
srp_identity = ?SECRET_PRINTOUT},
- [{data, [{"StateData", State#state{connection_states = ?SECRET_PRINTOUT,
- protocol_buffers = ?SECRET_PRINTOUT,
- user_data_buffer = ?SECRET_PRINTOUT,
- tls_handshake_history = ?SECRET_PRINTOUT,
- session = ?SECRET_PRINTOUT,
- private_key = ?SECRET_PRINTOUT,
- diffie_hellman_params = ?SECRET_PRINTOUT,
- diffie_hellman_keys = ?SECRET_PRINTOUT,
- srp_params = ?SECRET_PRINTOUT,
- srp_keys = ?SECRET_PRINTOUT,
- premaster_secret = ?SECRET_PRINTOUT,
- ssl_options = NewOptions
- }}]}].
+ [{data, [{"State", {StateName, State#state{connection_states = ?SECRET_PRINTOUT,
+ protocol_buffers = ?SECRET_PRINTOUT,
+ user_data_buffer = ?SECRET_PRINTOUT,
+ tls_handshake_history = ?SECRET_PRINTOUT,
+ session = ?SECRET_PRINTOUT,
+ private_key = ?SECRET_PRINTOUT,
+ diffie_hellman_params = ?SECRET_PRINTOUT,
+ diffie_hellman_keys = ?SECRET_PRINTOUT,
+ srp_params = ?SECRET_PRINTOUT,
+ srp_keys = ?SECRET_PRINTOUT,
+ premaster_secret = ?SECRET_PRINTOUT,
+ ssl_options = NewOptions}
+ }}]}].
+
%%--------------------------------------------------------------------
%%% Internal functions
%%--------------------------------------------------------------------
-ssl_config(Opts, Role, State) ->
- {ok, Ref, CertDbHandle, FileRefHandle, CacheHandle, CRLDbInfo, OwnCert, Key, DHParams} =
- ssl_config:init(Opts, Role),
- Handshake = ssl_handshake:init_handshake_history(),
- TimeStamp = erlang:monotonic_time(),
- Session = State#state.session,
- State#state{tls_handshake_history = Handshake,
- session = Session#session{own_certificate = OwnCert,
- time_stamp = TimeStamp},
- file_ref_db = FileRefHandle,
- cert_db_ref = Ref,
- cert_db = CertDbHandle,
- crl_db = CRLDbInfo,
- session_cache = CacheHandle,
- private_key = Key,
- diffie_hellman_params = DHParams,
- ssl_options = Opts}.
+connection_info(#state{sni_hostname = SNIHostname,
+ session = #session{cipher_suite = CipherSuite},
+ negotiated_version = Version, ssl_options = Opts}) ->
+ [{protocol, tls_record:protocol_version(Version)},
+ {cipher_suite, ssl_cipher:erl_suite_definition(CipherSuite)},
+ {sni_hostname, SNIHostname}] ++ ssl_options_list(Opts).
do_server_hello(Type, #hello_extensions{next_protocol_negotiation = NextProtocols} =
ServerHelloExt,
@@ -1027,7 +1108,7 @@ new_server_hello(#server_hello{cipher_suite = CipherSuite,
cipher_suite = CipherSuite,
compression_method = Compression},
{Record, State} = Connection:next_record(State2#state{session = Session}),
- Connection:next_state(hello, certify, Record, State)
+ Connection:next_event(certify, Record, State)
catch
#alert{} = Alert ->
Connection:handle_own_alert(Alert, Version, hello, State0)
@@ -1045,7 +1126,7 @@ resumed_server_hello(#state{session = Session,
State2 =
finalize_handshake(State1, abbreviated, Connection),
{Record, State} = Connection:next_record(State2),
- Connection:next_state(hello, abbreviated, Record, State);
+ Connection:next_event(abbreviated, Record, State);
#alert{} = Alert ->
Connection:handle_own_alert(Alert, Version, hello, State0)
end.
@@ -1070,7 +1151,7 @@ handle_peer_cert(Role, PeerCert, PublicKeyInfo,
State2 = handle_peer_cert_key(Role, PeerCert, PublicKeyInfo, KeyAlg, State1),
{Record, State} = Connection:next_record(State2),
- Connection:next_state(certify, certify, Record, State).
+ Connection:next_event(certify, Record, State).
handle_peer_cert_key(client, _,
{?'id-ecPublicKey', #'ECPoint'{point = _ECPoint} = PublicKey,
@@ -1133,7 +1214,7 @@ client_certify_and_key_exchange(#state{negotiated_version = Version} =
%% Reinitialize
client_certificate_requested = false},
{Record, State} = Connection:next_record(State3),
- Connection:next_state(certify, cipher, Record, State)
+ Connection:next_event(cipher, Record, State)
catch
throw:#alert{} = Alert ->
Connection:handle_own_alert(Alert, Version, certify, State0)
@@ -1167,20 +1248,25 @@ certify_client_key_exchange(#client_ec_diffie_hellman_public{dh_public = ClientP
calculate_master_secret(PremasterSecret, State, Connection, certify, cipher);
certify_client_key_exchange(#client_psk_identity{} = ClientKey,
- #state{ssl_options = #ssl_options{user_lookup_fun = PSKLookup}} = State0, Connection) ->
+ #state{ssl_options =
+ #ssl_options{user_lookup_fun = PSKLookup}} = State0,
+ Connection) ->
PremasterSecret = ssl_handshake:premaster_secret(ClientKey, PSKLookup),
calculate_master_secret(PremasterSecret, State0, Connection, certify, cipher);
certify_client_key_exchange(#client_dhe_psk_identity{} = ClientKey,
#state{diffie_hellman_params = #'DHParameter'{} = Params,
diffie_hellman_keys = {_, ServerDhPrivateKey},
- ssl_options = #ssl_options{user_lookup_fun = PSKLookup}} = State0,
+ ssl_options =
+ #ssl_options{user_lookup_fun = PSKLookup}} = State0,
Connection) ->
- PremasterSecret = ssl_handshake:premaster_secret(ClientKey, ServerDhPrivateKey, Params, PSKLookup),
+ PremasterSecret =
+ ssl_handshake:premaster_secret(ClientKey, ServerDhPrivateKey, Params, PSKLookup),
calculate_master_secret(PremasterSecret, State0, Connection, certify, cipher);
certify_client_key_exchange(#client_rsa_psk_identity{} = ClientKey,
#state{private_key = Key,
- ssl_options = #ssl_options{user_lookup_fun = PSKLookup}} = State0,
+ ssl_options =
+ #ssl_options{user_lookup_fun = PSKLookup}} = State0,
Connection) ->
PremasterSecret = ssl_handshake:premaster_secret(ClientKey, Key, PSKLookup),
calculate_master_secret(PremasterSecret, State0, Connection, certify, cipher);
@@ -1192,8 +1278,11 @@ certify_client_key_exchange(#client_srp_public{} = ClientKey,
PremasterSecret = ssl_handshake:premaster_secret(ClientKey, Key, Params),
calculate_master_secret(PremasterSecret, State0, Connection, certify, cipher).
-certify_server(#state{key_algorithm = Algo} = State, _)
- when Algo == dh_anon; Algo == ecdh_anon; Algo == psk; Algo == dhe_psk; Algo == srp_anon ->
+certify_server(#state{key_algorithm = Algo} = State, _) when Algo == dh_anon;
+ Algo == ecdh_anon;
+ Algo == psk;
+ Algo == dhe_psk;
+ Algo == srp_anon ->
State;
certify_server(#state{cert_db = CertDbHandle,
@@ -1291,10 +1380,11 @@ key_exchange(#state{role = server, key_algorithm = dhe_psk,
SecParams = ConnectionState#connection_state.security_parameters,
#security_parameters{client_random = ClientRandom,
server_random = ServerRandom} = SecParams,
- Msg = ssl_handshake:key_exchange(server, Version, {dhe_psk, PskIdentityHint, DHKeys, Params,
- HashSignAlgo, ClientRandom,
- ServerRandom,
- PrivateKey}),
+ Msg = ssl_handshake:key_exchange(server, Version, {dhe_psk,
+ PskIdentityHint, DHKeys, Params,
+ HashSignAlgo, ClientRandom,
+ ServerRandom,
+ PrivateKey}),
State = Connection:send_handshake(Msg, State0),
State#state{diffie_hellman_keys = DHKeys};
@@ -1383,7 +1473,8 @@ key_exchange(#state{role = client,
ssl_options = SslOpts,
key_algorithm = psk,
negotiated_version = Version} = State0, Connection) ->
- Msg = ssl_handshake:key_exchange(client, Version, {psk, SslOpts#ssl_options.psk_identity}),
+ Msg = ssl_handshake:key_exchange(client, Version,
+ {psk, SslOpts#ssl_options.psk_identity}),
Connection:send_handshake(Msg, State0);
key_exchange(#state{role = client,
@@ -1392,7 +1483,8 @@ key_exchange(#state{role = client,
negotiated_version = Version,
diffie_hellman_keys = {DhPubKey, _}} = State0, Connection) ->
Msg = ssl_handshake:key_exchange(client, Version,
- {dhe_psk, SslOpts#ssl_options.psk_identity, DhPubKey}),
+ {dhe_psk,
+ SslOpts#ssl_options.psk_identity, DhPubKey}),
Connection:send_handshake(Msg, State0);
key_exchange(#state{role = client,
ssl_options = SslOpts,
@@ -1432,7 +1524,8 @@ rsa_key_exchange(Version, PremasterSecret, PublicKeyInfo = {Algorithm, _, _})
rsa_key_exchange(_, _, _) ->
throw (?ALERT_REC(?FATAL,?HANDSHAKE_FAILURE)).
-rsa_psk_key_exchange(Version, PskIdentity, PremasterSecret, PublicKeyInfo = {Algorithm, _, _})
+rsa_psk_key_exchange(Version, PskIdentity, PremasterSecret,
+ PublicKeyInfo = {Algorithm, _, _})
when Algorithm == ?rsaEncryption;
Algorithm == ?md2WithRSAEncryption;
Algorithm == ?md5WithRSAEncryption;
@@ -1448,7 +1541,8 @@ rsa_psk_key_exchange(Version, PskIdentity, PremasterSecret, PublicKeyInfo = {Alg
rsa_psk_key_exchange(_, _, _, _) ->
throw (?ALERT_REC(?FATAL,?HANDSHAKE_FAILURE)).
-request_client_cert(#state{ssl_options = #ssl_options{verify = verify_peer},
+request_client_cert(#state{ssl_options = #ssl_options{verify = verify_peer,
+ signature_algs = SupportedHashSigns},
connection_states = ConnectionStates0,
cert_db = CertDbHandle,
cert_db_ref = CertDbRef,
@@ -1456,7 +1550,9 @@ request_client_cert(#state{ssl_options = #ssl_options{verify = verify_peer},
#connection_state{security_parameters =
#security_parameters{cipher_suite = CipherSuite}} =
ssl_record:pending_connection_state(ConnectionStates0, read),
- Msg = ssl_handshake:certificate_request(CipherSuite, CertDbHandle, CertDbRef, Version),
+ HashSigns = ssl_handshake:available_signature_algs(SupportedHashSigns, Version, [Version]),
+ Msg = ssl_handshake:certificate_request(CipherSuite, CertDbHandle, CertDbRef,
+ HashSigns, Version),
State = Connection:send_handshake(Msg, State0),
State#state{client_certificate_requested = true};
@@ -1464,10 +1560,11 @@ request_client_cert(#state{ssl_options = #ssl_options{verify = verify_none}} =
State, _) ->
State.
-calculate_master_secret(PremasterSecret, #state{negotiated_version = Version,
- connection_states = ConnectionStates0,
- session = Session0} = State0, Connection,
- Current, Next) ->
+calculate_master_secret(PremasterSecret,
+ #state{negotiated_version = Version,
+ connection_states = ConnectionStates0,
+ session = Session0} = State0, Connection,
+ _Current, Next) ->
case ssl_handshake:master_secret(record_cb(Connection), Version, PremasterSecret,
ConnectionStates0, server) of
{MasterSecret, ConnectionStates} ->
@@ -1475,7 +1572,7 @@ calculate_master_secret(PremasterSecret, #state{negotiated_version = Version,
State1 = State0#state{connection_states = ConnectionStates,
session = Session},
{Record, State} = Connection:next_record(State1),
- Connection:next_state(Current, Next, Record, State);
+ Connection:next_event(Next, Record, State);
#alert{} = Alert ->
Connection:handle_own_alert(Alert, Version, certify, State0)
end.
@@ -1526,31 +1623,36 @@ save_verify_data(client, #finished{verify_data = Data}, ConnectionStates, abbrev
save_verify_data(server, #finished{verify_data = Data}, ConnectionStates, abbreviated) ->
ssl_record:set_server_verify_data(current_write, Data, ConnectionStates).
-calculate_secret(#server_dh_params{dh_p = Prime, dh_g = Base, dh_y = ServerPublicDhKey} = Params,
- State, Connection) ->
+calculate_secret(#server_dh_params{dh_p = Prime, dh_g = Base,
+ dh_y = ServerPublicDhKey} = Params,
+ State, Connection) ->
Keys = {_, PrivateDhKey} = crypto:generate_key(dh, [Prime, Base]),
PremasterSecret =
ssl_handshake:premaster_secret(ServerPublicDhKey, PrivateDhKey, Params),
calculate_master_secret(PremasterSecret,
- State#state{diffie_hellman_keys = Keys}, Connection, certify, certify);
+ State#state{diffie_hellman_keys = Keys},
+ Connection, certify, certify);
calculate_secret(#server_ecdh_params{curve = ECCurve, public = ECServerPubKey},
State, Connection) ->
ECDHKeys = public_key:generate_key(ECCurve),
- PremasterSecret = ssl_handshake:premaster_secret(#'ECPoint'{point = ECServerPubKey}, ECDHKeys),
+ PremasterSecret =
+ ssl_handshake:premaster_secret(#'ECPoint'{point = ECServerPubKey}, ECDHKeys),
calculate_master_secret(PremasterSecret,
- State#state{diffie_hellman_keys = ECDHKeys}, Connection, certify, certify);
+ State#state{diffie_hellman_keys = ECDHKeys},
+ Connection, certify, certify);
calculate_secret(#server_psk_params{
- hint = IdentityHint},
+ hint = IdentityHint},
State0, Connection) ->
%% store for later use
{Record, State} = Connection:next_record(State0#state{psk_identity = IdentityHint}),
- Connection:next_state(certify, certify, Record, State);
+ Connection:next_event(certify, Record, State);
calculate_secret(#server_dhe_psk_params{
dh_params = #server_dh_params{dh_p = Prime, dh_g = Base}} = ServerKey,
- #state{ssl_options = #ssl_options{user_lookup_fun = PSKLookup}} = State, Connection) ->
+ #state{ssl_options = #ssl_options{user_lookup_fun = PSKLookup}} =
+ State, Connection) ->
Keys = {_, PrivateDhKey} =
crypto:generate_key(dh, [Prime, Base]),
PremasterSecret = ssl_handshake:premaster_secret(ServerKey, PrivateDhKey, PSKLookup),
@@ -1558,10 +1660,12 @@ calculate_secret(#server_dhe_psk_params{
Connection, certify, certify);
calculate_secret(#server_srp_params{srp_n = Prime, srp_g = Generator} = ServerKey,
- #state{ssl_options = #ssl_options{srp_identity = SRPId}} = State, Connection) ->
+ #state{ssl_options = #ssl_options{srp_identity = SRPId}} = State,
+ Connection) ->
Keys = generate_srp_client_keys(Generator, Prime, 0),
PremasterSecret = ssl_handshake:premaster_secret(ServerKey, Keys, SRPId),
- calculate_master_secret(PremasterSecret, State#state{srp_keys = Keys}, Connection, certify, certify).
+ calculate_master_secret(PremasterSecret, State#state{srp_keys = Keys}, Connection,
+ certify, certify).
master_secret(#alert{} = Alert, _) ->
Alert;
@@ -1617,21 +1721,23 @@ handle_srp_identity(Username, {Fun, UserState}) ->
end.
-cipher_role(client, Data, Session, #state{connection_states = ConnectionStates0} = State,
+cipher_role(client, Data, Session, #state{connection_states = ConnectionStates0} = State0,
Connection) ->
- ConnectionStates = ssl_record:set_server_verify_data(current_both, Data, ConnectionStates0),
- Connection:next_state_connection(cipher,
- ack_connection(
- State#state{session = Session,
- connection_states = ConnectionStates}));
-
+ ConnectionStates = ssl_record:set_server_verify_data(current_both, Data,
+ ConnectionStates0),
+ {Record, State} = prepare_connection(State0#state{session = Session,
+ connection_states = ConnectionStates},
+ Connection),
+ Connection:next_event(connection, Record, State);
cipher_role(server, Data, Session, #state{connection_states = ConnectionStates0} = State0,
Connection) ->
- ConnectionStates1 = ssl_record:set_client_verify_data(current_read, Data, ConnectionStates0),
- State =
+ ConnectionStates1 = ssl_record:set_client_verify_data(current_read, Data,
+ ConnectionStates0),
+ State1 =
finalize_handshake(State0#state{connection_states = ConnectionStates1,
session = Session}, cipher, Connection),
- Connection:next_state_connection(cipher, ack_connection(State#state{session = Session})).
+ {Record, State} = prepare_connection(State1, Connection),
+ Connection:next_event(connection, Record, State).
select_curve(#state{client_ecc = {[Curve|_], _}}) ->
{namedCurve, Curve};
@@ -1665,8 +1771,8 @@ record_cb(tls_connection) ->
record_cb(dtls_connection) ->
dtls_record.
-sync_send_all_state_event(FsmPid, Event) ->
- try gen_fsm:sync_send_all_state_event(FsmPid, Event, infinity)
+call(FsmPid, Event) ->
+ try gen_statem:call(FsmPid, Event)
catch
exit:{noproc, _} ->
{error, closed};
@@ -1722,38 +1828,42 @@ set_socket_opts(Transport, Socket, [], SockOpts, Other) ->
{{error, {options, {socket_options, Other, Error}}}, SockOpts}
end;
-set_socket_opts(Transport,Socket, [{mode, Mode}| Opts], SockOpts, Other) when Mode == list; Mode == binary ->
+set_socket_opts(Transport,Socket, [{mode, Mode}| Opts], SockOpts, Other)
+ when Mode == list; Mode == binary ->
set_socket_opts(Transport, Socket, Opts,
SockOpts#socket_options{mode = Mode}, Other);
set_socket_opts(_, _, [{mode, _} = Opt| _], SockOpts, _) ->
{{error, {options, {socket_options, Opt}}}, SockOpts};
-set_socket_opts(Transport,Socket, [{packet, Packet}| Opts], SockOpts, Other) when Packet == raw;
- Packet == 0;
- Packet == 1;
- Packet == 2;
- Packet == 4;
- Packet == asn1;
- Packet == cdr;
- Packet == sunrm;
- Packet == fcgi;
- Packet == tpkt;
- Packet == line;
- Packet == http;
- Packet == httph;
- Packet == http_bin;
- Packet == httph_bin ->
+set_socket_opts(Transport,Socket, [{packet, Packet}| Opts], SockOpts, Other)
+ when Packet == raw;
+ Packet == 0;
+ Packet == 1;
+ Packet == 2;
+ Packet == 4;
+ Packet == asn1;
+ Packet == cdr;
+ Packet == sunrm;
+ Packet == fcgi;
+ Packet == tpkt;
+ Packet == line;
+ Packet == http;
+ Packet == httph;
+ Packet == http_bin;
+ Packet == httph_bin ->
set_socket_opts(Transport, Socket, Opts,
SockOpts#socket_options{packet = Packet}, Other);
set_socket_opts(_, _, [{packet, _} = Opt| _], SockOpts, _) ->
{{error, {options, {socket_options, Opt}}}, SockOpts};
-set_socket_opts(Transport, Socket, [{header, Header}| Opts], SockOpts, Other) when is_integer(Header) ->
+set_socket_opts(Transport, Socket, [{header, Header}| Opts], SockOpts, Other)
+ when is_integer(Header) ->
set_socket_opts(Transport, Socket, Opts,
SockOpts#socket_options{header = Header}, Other);
set_socket_opts(_, _, [{header, _} = Opt| _], SockOpts, _) ->
{{error,{options, {socket_options, Opt}}}, SockOpts};
-set_socket_opts(Transport, Socket, [{active, Active}| Opts], SockOpts, Other) when Active == once;
- Active == true;
- Active == false ->
+set_socket_opts(Transport, Socket, [{active, Active}| Opts], SockOpts, Other)
+ when Active == once;
+ Active == true;
+ Active == false ->
set_socket_opts(Transport, Socket, Opts,
SockOpts#socket_options{active = Active}, Other);
set_socket_opts(_, _, [{active, _} = Opt| _], SockOpts, _) ->
@@ -1766,11 +1876,10 @@ start_or_recv_cancel_timer(infinity, _RecvFrom) ->
start_or_recv_cancel_timer(Timeout, RecvFrom) ->
erlang:send_after(Timeout, self(), {cancel_start_or_recv, RecvFrom}).
-get_timeout(#state{ssl_options=#ssl_options{hibernate_after = undefined}}) ->
- infinity;
-get_timeout(#state{ssl_options=#ssl_options{hibernate_after = HibernateAfter}}) ->
- HibernateAfter.
-
+hibernate_after(StateName, #state{ssl_options=#ssl_options{hibernate_after = HibernateAfter}} = State,
+ Actions) ->
+ {next_state, StateName, State, [{timeout, HibernateAfter, hibernate} | Actions]}.
+
terminate_alert(normal, Version, ConnectionStates) ->
ssl_alert:encode(?ALERT_REC(?WARNING, ?CLOSE_NOTIFY),
Version, ConnectionStates);
@@ -1780,10 +1889,12 @@ terminate_alert({Reason, _}, Version, ConnectionStates) when Reason == close;
Version, ConnectionStates);
terminate_alert(_, Version, ConnectionStates) ->
- ssl_alert:encode(?ALERT_REC(?FATAL, ?INTERNAL_ERROR),
- Version, ConnectionStates).
+ {BinAlert, _} = ssl_alert:encode(?ALERT_REC(?FATAL, ?INTERNAL_ERROR),
+ Version, ConnectionStates),
+ BinAlert.
-handle_trusted_certs_db(#state{ssl_options = #ssl_options{cacertfile = <<>>, cacerts = []}}) ->
+handle_trusted_certs_db(#state{ssl_options =
+ #ssl_options{cacertfile = <<>>, cacerts = []}}) ->
%% No trusted certs specified
ok;
handle_trusted_certs_db(#state{cert_db_ref = Ref,
@@ -1793,7 +1904,8 @@ handle_trusted_certs_db(#state{cert_db_ref = Ref,
%% with other connections and it is safe to delete them when the connection ends.
ssl_pkix_db:remove_trusted_certs(Ref, CertDb);
handle_trusted_certs_db(#state{file_ref_db = undefined}) ->
- %% Something went wrong early (typically cacertfile does not exist) so there is nothing to handle
+ %% Something went wrong early (typically cacertfile does not
+ %% exist) so there is nothing to handle
ok;
handle_trusted_certs_db(#state{cert_db_ref = Ref,
file_ref_db = RefDb,
@@ -1805,29 +1917,31 @@ handle_trusted_certs_db(#state{cert_db_ref = Ref,
ok
end.
-notify_senders(SendQueue) ->
- lists:foreach(fun({From, _}) ->
- gen_fsm:reply(From, {error, closed})
- end, queue:to_list(SendQueue)).
-
-notify_renegotiater({true, From}) when not is_atom(From) ->
- gen_fsm:reply(From, {error, closed});
-notify_renegotiater(_) ->
- ok.
+prepare_connection(#state{renegotiation = Renegotiate,
+ start_or_recv_from = RecvFrom} = State0, Connection)
+ when Renegotiate =/= {false, first},
+ RecvFrom =/= undefined ->
+ State1 = Connection:reinit_handshake_data(State0),
+ {Record, State} = Connection:next_record(State1),
+ {Record, ack_connection(State)};
+prepare_connection(State0, Connection) ->
+ State = Connection:reinit_handshake_data(State0),
+ {no_record, ack_connection(State)}.
ack_connection(#state{renegotiation = {true, Initiater}} = State)
when Initiater == internal;
Initiater == peer ->
State#state{renegotiation = undefined};
ack_connection(#state{renegotiation = {true, From}} = State) ->
- gen_fsm:reply(From, ok),
+ gen_statem:reply(From, ok),
State#state{renegotiation = undefined};
ack_connection(#state{renegotiation = {false, first},
start_or_recv_from = StartFrom,
timer = Timer} = State) when StartFrom =/= undefined ->
- gen_fsm:reply(StartFrom, connected),
+ gen_statem:reply(StartFrom, connected),
cancel_timer(Timer),
- State#state{renegotiation = undefined, start_or_recv_from = undefined, timer = undefined};
+ State#state{renegotiation = undefined,
+ start_or_recv_from = undefined, timer = undefined};
ack_connection(State) ->
State.
@@ -1848,13 +1962,14 @@ register_session(server, _, Port, #session{is_resumable = new} = Session0) ->
register_session(_, _, _, Session) ->
Session. %% Already registered
-handle_new_session(NewId, CipherSuite, Compression, #state{session = Session0,
- protocol_cb = Connection} = State0) ->
+handle_new_session(NewId, CipherSuite, Compression,
+ #state{session = Session0,
+ protocol_cb = Connection} = State0) ->
Session = Session0#session{session_id = NewId,
cipher_suite = CipherSuite,
compression_method = Compression},
{Record, State} = Connection:next_record(State0#state{session = Session}),
- Connection:next_state(hello, certify, Record, State).
+ Connection:next_event(certify, Record, State).
handle_resumed_session(SessId, #state{connection_states = ConnectionStates0,
negotiated_version = Version,
@@ -1870,26 +1985,27 @@ handle_resumed_session(SessId, #state{connection_states = ConnectionStates0,
Connection:next_record(State0#state{
connection_states = ConnectionStates,
session = Session}),
- Connection:next_state(hello, abbreviated, Record, State);
+ Connection:next_event(abbreviated, Record, State);
#alert{} = Alert ->
Connection:handle_own_alert(Alert, Version, hello, State0)
end.
make_premaster_secret({MajVer, MinVer}, rsa) ->
- Rand = ssl:random_bytes(?NUM_OF_PREMASTERSECRET_BYTES-2),
+ Rand = ssl_cipher:random_bytes(?NUM_OF_PREMASTERSECRET_BYTES-2),
<<?BYTE(MajVer), ?BYTE(MinVer), Rand/binary>>;
make_premaster_secret(_, _) ->
undefined.
-negotiated_hashsign(undefined, Alg, Version) ->
+negotiated_hashsign(undefined, KexAlg, PubKeyInfo, Version) ->
%% Not negotiated choose default
- case is_anonymous(Alg) of
+ case is_anonymous(KexAlg) of
true ->
{null, anon};
false ->
- ssl_handshake:select_hashsign_algs(Alg, Version)
+ {PubAlg, _, _} = PubKeyInfo,
+ ssl_handshake:select_hashsign_algs(undefined, PubAlg, Version)
end;
-negotiated_hashsign(HashSign = {_, _}, _, _) ->
+negotiated_hashsign(HashSign = {_, _}, _, _, _) ->
HashSign.
ssl_options_list(SslOptions) ->
diff --git a/lib/ssl/src/ssl_connection.hrl b/lib/ssl/src/ssl_connection.hrl
index bb41ef2b62..7682cb86ea 100644
--- a/lib/ssl/src/ssl_connection.hrl
+++ b/lib/ssl/src/ssl_connection.hrl
@@ -75,7 +75,7 @@
renegotiation :: undefined | {boolean(), From::term() | internal | peer},
start_or_recv_from :: term(),
timer :: undefined | reference(), % start_or_recive_timer
- send_queue :: queue:queue(),
+ %%send_queue :: queue:queue(),
terminated = false ::boolean(),
allow_renegotiate = true ::boolean(),
expecting_next_protocol_negotiation = false ::boolean(),
@@ -83,7 +83,8 @@
negotiated_protocol = undefined :: undefined | binary(),
client_ecc, % {Curves, PointFmt}
tracker :: pid() | 'undefined', %% Tracker process for listen socket
- sni_hostname = undefined
+ sni_hostname = undefined,
+ downgrade
}).
-define(DEFAULT_DIFFIE_HELLMAN_PARAMS,
diff --git a/lib/ssl/src/ssl_dist_sup.erl b/lib/ssl/src/ssl_dist_sup.erl
index 435ad27a44..a6eb1be1f6 100644
--- a/lib/ssl/src/ssl_dist_sup.erl
+++ b/lib/ssl/src/ssl_dist_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl
index e98073080a..598d4e4112 100644
--- a/lib/ssl/src/ssl_handshake.erl
+++ b/lib/ssl/src/ssl_handshake.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -46,7 +46,7 @@
%% Handshake messages
-export([hello_request/0, server_hello/4, server_hello_done/0,
- certificate/4, certificate_request/4, key_exchange/3,
+ certificate/4, certificate_request/5, key_exchange/3,
finished/5, next_protocol/1]).
%% Handle handshake messages
@@ -64,8 +64,8 @@
]).
%% Cipher suites handling
--export([available_suites/2, cipher_suites/2,
- select_session/10, supported_ecc/1]).
+-export([available_suites/2, available_signature_algs/3, cipher_suites/2,
+ select_session/11, supported_ecc/1]).
%% Extensions handling
-export([client_hello_extensions/6,
@@ -74,8 +74,8 @@
]).
%% MISC
--export([select_version/3, prf/5, select_hashsign/3,
- select_hashsign_algs/2, select_hashsign_algs/3,
+-export([select_version/3, prf/6, select_hashsign/5,
+ select_hashsign_algs/3,
premaster_secret/2, premaster_secret/3, premaster_secret/4]).
%%====================================================================
@@ -120,7 +120,8 @@ server_hello(SessionId, Version, ConnectionStates, Extensions) ->
server_hello_done() ->
#server_hello_done{}.
-client_hello_extensions(Host, Version, CipherSuites, SslOpts, ConnectionStates, Renegotiation) ->
+client_hello_extensions(Host, Version, CipherSuites,
+ #ssl_options{signature_algs = SupportedHashSigns, versions = AllVersions} = SslOpts, ConnectionStates, Renegotiation) ->
{EcPointFormats, EllipticCurves} =
case advertises_ec_ciphers(lists:map(fun ssl_cipher:suite_definition/1, CipherSuites)) of
true ->
@@ -134,7 +135,7 @@ client_hello_extensions(Host, Version, CipherSuites, SslOpts, ConnectionStates,
renegotiation_info = renegotiation_info(tls_record, client,
ConnectionStates, Renegotiation),
srp = SRP,
- hash_signs = advertised_hash_signs(Version),
+ signature_algs = available_signature_algs(SupportedHashSigns, Version, AllVersions),
ec_point_formats = EcPointFormats,
elliptic_curves = EllipticCurves,
alpn = encode_alpn(SslOpts#ssl_options.alpn_advertised_protocols, Renegotiation),
@@ -203,14 +204,14 @@ client_certificate_verify(OwnCert, MasterSecret, Version,
end.
%%--------------------------------------------------------------------
--spec certificate_request(ssl_cipher:cipher_suite(), db_handle(), certdb_ref(), ssl_record:ssl_version()) ->
- #certificate_request{}.
+-spec certificate_request(ssl_cipher:cipher_suite(), db_handle(),
+ certdb_ref(), #hash_sign_algos{}, ssl_record:ssl_version()) ->
+ #certificate_request{}.
%%
%% Description: Creates a certificate_request message, called by the server.
%%--------------------------------------------------------------------
-certificate_request(CipherSuite, CertDbHandle, CertDbRef, Version) ->
+certificate_request(CipherSuite, CertDbHandle, CertDbRef, HashSigns, Version) ->
Types = certificate_types(ssl_cipher:suite_definition(CipherSuite), Version),
- HashSigns = advertised_hash_signs(Version),
Authorities = certificate_authorities(CertDbHandle, CertDbRef),
#certificate_request{
certificate_types = Types,
@@ -351,6 +352,9 @@ verify_server_key(#server_key_params{params_bin = EncParams,
%%
%% Description: Checks that the certificate_verify message is valid.
%%--------------------------------------------------------------------
+certificate_verify(_, _, _, undefined, _, _) ->
+ ?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE);
+
certificate_verify(Signature, PublicKeyInfo, Version,
HashSign = {HashAlgo, _}, MasterSecret, {_, Handshake}) ->
Hash = calc_certificate_verify(Version, HashAlgo, MasterSecret, Handshake),
@@ -379,10 +383,11 @@ verify_signature(_Version, Hash, _HashAlgo, Signature, {?rsaEncryption, PubKey,
end;
verify_signature(_Version, Hash, {HashAlgo, dsa}, Signature, {?'id-dsa', PublicKey, PublicKeyParams}) ->
public_key:verify({digest, Hash}, HashAlgo, Signature, {PublicKey, PublicKeyParams});
-verify_signature(_Version, Hash, {HashAlgo, ecdsa}, Signature,
+verify_signature(_, Hash, {HashAlgo, _SignAlg}, Signature,
{?'id-ecPublicKey', PublicKey, PublicKeyParams}) ->
public_key:verify({digest, Hash}, HashAlgo, Signature, {PublicKey, PublicKeyParams}).
+
%%--------------------------------------------------------------------
-spec certify(#certificate{}, db_handle(), certdb_ref(), integer() | nolimit,
verify_peer | verify_none, {fun(), term}, fun(), term(), term(),
@@ -559,57 +564,58 @@ server_key_exchange_hash(md5sha, Value) ->
server_key_exchange_hash(Hash, Value) ->
crypto:hash(Hash, Value).
%%--------------------------------------------------------------------
--spec prf(ssl_record:ssl_version(), binary(), binary(), [binary()], non_neg_integer()) ->
+-spec prf(ssl_record:ssl_version(), non_neg_integer(), binary(), binary(), [binary()], non_neg_integer()) ->
{ok, binary()} | {error, undefined}.
%%
%% Description: use the TLS PRF to generate key material
%%--------------------------------------------------------------------
-prf({3,0}, _, _, _, _) ->
+prf({3,0}, _, _, _, _, _) ->
{error, undefined};
-prf({3,1}, Secret, Label, Seed, WantedLength) ->
- {ok, tls_v1:prf(?MD5SHA, Secret, Label, Seed, WantedLength)};
-prf({3,_N}, Secret, Label, Seed, WantedLength) ->
- {ok, tls_v1:prf(?SHA256, Secret, Label, Seed, WantedLength)}.
+prf({3,_N}, PRFAlgo, Secret, Label, Seed, WantedLength) ->
+ {ok, tls_v1:prf(PRFAlgo, Secret, Label, Seed, WantedLength)}.
%%--------------------------------------------------------------------
--spec select_hashsign(#hash_sign_algos{}| undefined, undefined | binary(), ssl_record:ssl_version()) ->
- {atom(), atom()} | undefined.
+-spec select_hashsign(#hash_sign_algos{} | undefined, undefined | binary(),
+ atom(), [atom()], ssl_record:ssl_version()) ->
+ {atom(), atom()} | undefined | #alert{}.
%%
-%% Description:
+%% Description: Handles signature_algorithms extension
%%--------------------------------------------------------------------
-select_hashsign(_, undefined, _Version) ->
+select_hashsign(_, undefined, _, _, _Version) ->
{null, anon};
%% The signature_algorithms extension was introduced with TLS 1.2. Ignore it if we have
%% negotiated a lower version.
-select_hashsign(#hash_sign_algos{hash_sign_algos = HashSigns}, Cert, {Major, Minor} = Version)
- when Major >= 3 andalso Minor >= 3 ->
- #'OTPCertificate'{tbsCertificate = TBSCert} =public_key:pkix_decode_cert(Cert, otp),
+select_hashsign(HashSigns, Cert, KeyExAlgo,
+ undefined, {Major, Minor} = Version) when Major >= 3 andalso Minor >= 3->
+ select_hashsign(HashSigns, Cert, KeyExAlgo, tls_v1:default_signature_algs(Version), Version);
+select_hashsign(#hash_sign_algos{hash_sign_algos = HashSigns}, Cert, KeyExAlgo, SupportedHashSigns,
+ {Major, Minor}) when Major >= 3 andalso Minor >= 3 ->
+ #'OTPCertificate'{tbsCertificate = TBSCert} = public_key:pkix_decode_cert(Cert, otp),
#'OTPSubjectPublicKeyInfo'{algorithm = {_,Algo, _}} = TBSCert#'OTPTBSCertificate'.subjectPublicKeyInfo,
- DefaultHashSign = {_, Sign} = select_hashsign_algs(undefined, Algo, Version),
- case lists:filter(fun({sha, dsa}) ->
+ Sign = cert_sign(Algo),
+ case lists:filter(fun({sha, dsa = S}) when S == Sign ->
true;
({_, dsa}) ->
false;
- ({Hash, S}) when S == Sign ->
- ssl_cipher:is_acceptable_hash(Hash,
- proplists:get_value(hashs, crypto:supports()));
+ ({_, _} = Algos) ->
+ is_acceptable_hash_sign(Algos, Sign, KeyExAlgo, SupportedHashSigns);
(_) ->
false
end, HashSigns) of
[] ->
- DefaultHashSign;
- [HashSign| _] ->
+ ?ALERT_REC(?FATAL, ?INSUFFICIENT_SECURITY);
+ [HashSign | _] ->
HashSign
end;
-select_hashsign(_, Cert, Version) ->
+select_hashsign(_, Cert, _, _, Version) ->
#'OTPCertificate'{tbsCertificate = TBSCert} = public_key:pkix_decode_cert(Cert, otp),
#'OTPSubjectPublicKeyInfo'{algorithm = {_,Algo, _}} = TBSCert#'OTPTBSCertificate'.subjectPublicKeyInfo,
select_hashsign_algs(undefined, Algo, Version).
%%--------------------------------------------------------------------
--spec select_hashsign_algs(#hash_sign_algos{}| undefined, oid(), ssl_record:ssl_version()) ->
+-spec select_hashsign_algs({atom(), atom()}| undefined, oid(), ssl_record:ssl_version()) ->
{atom(), atom()}.
%% Description: For TLS 1.2 hash function and signature algorithm pairs can be
@@ -642,24 +648,6 @@ select_hashsign_algs(undefined, ?rsaEncryption, _) ->
select_hashsign_algs(undefined, ?'id-dsa', _) ->
{sha, dsa}.
--spec select_hashsign_algs(atom(), ssl_record:ssl_version()) -> {atom(), atom()}.
-%% Wrap function to keep the knowledge of the default values in
-%% one place only
-select_hashsign_algs(Alg, Version) when (Alg == rsa orelse
- Alg == dhe_rsa orelse
- Alg == dh_rsa orelse
- Alg == ecdhe_rsa orelse
- Alg == ecdh_rsa orelse
- Alg == srp_rsa) ->
- select_hashsign_algs(undefined, ?rsaEncryption, Version);
-select_hashsign_algs(Alg, Version) when (Alg == dhe_dss orelse
- Alg == dh_dss orelse
- Alg == srp_dss) ->
- select_hashsign_algs(undefined, ?'id-dsa', Version);
-select_hashsign_algs(Alg, Version) when (Alg == ecdhe_ecdsa orelse
- Alg == ecdh_ecdsa) ->
- select_hashsign_algs(undefined, ?'id-ecPublicKey', Version).
-
%%--------------------------------------------------------------------
-spec master_secret(atom(), ssl_record:ssl_version(), #session{} | binary(), #connection_states{},
client | server) -> {binary(), #connection_states{}} | #alert{}.
@@ -1063,9 +1051,56 @@ available_suites(UserSuites, Version) ->
lists:member(Suite, ssl_cipher:all_suites(Version))
end, UserSuites).
-available_suites(ServerCert, UserSuites, Version, Curve) ->
+available_suites(ServerCert, UserSuites, Version, undefined, Curve) ->
ssl_cipher:filter(ServerCert, available_suites(UserSuites, Version))
- -- unavailable_ecc_suites(Curve).
+ -- unavailable_ecc_suites(Curve);
+available_suites(ServerCert, UserSuites, Version, HashSigns, Curve) ->
+ Suites = available_suites(ServerCert, UserSuites, Version, undefined, Curve),
+ filter_hashsigns(Suites, [ssl_cipher:suite_definition(Suite) || Suite <- Suites], HashSigns, []).
+filter_hashsigns([], [], _, Acc) ->
+ lists:reverse(Acc);
+filter_hashsigns([Suite | Suites], [{KeyExchange,_,_,_} | Algos], HashSigns,
+ Acc) when KeyExchange == dhe_ecdsa;
+ KeyExchange == ecdhe_ecdsa ->
+ do_filter_hashsigns(ecdsa, Suite, Suites, Algos, HashSigns, Acc);
+
+filter_hashsigns([Suite | Suites], [{KeyExchange,_,_,_} | Algos], HashSigns,
+ Acc) when KeyExchange == rsa;
+ KeyExchange == dhe_rsa;
+ KeyExchange == ecdhe_rsa;
+ KeyExchange == srp_rsa;
+ KeyExchange == rsa_psk ->
+ do_filter_hashsigns(rsa, Suite, Suites, Algos, HashSigns, Acc);
+filter_hashsigns([Suite | Suites], [{KeyExchange,_,_,_} | Algos], HashSigns, Acc) when
+ KeyExchange == dhe_dss;
+ KeyExchange == srp_dss ->
+ do_filter_hashsigns(dsa, Suite, Suites, Algos, HashSigns, Acc);
+filter_hashsigns([Suite | Suites], [{KeyExchange,_,_,_} | Algos], HashSigns, Acc) when
+ KeyExchange == dh_dss;
+ KeyExchange == dh_rsa;
+ KeyExchange == dh_ecdsa;
+ KeyExchange == ecdh_rsa;
+ KeyExchange == ecdh_ecdsa ->
+ %% Fixed DH certificates MAY be signed with any hash/signature
+ %% algorithm pair appearing in the hash_sign extension. The names
+ %% DH_DSS, DH_RSA, ECDH_ECDSA, and ECDH_RSA are historical.
+ filter_hashsigns(Suites, Algos, HashSigns, [Suite| Acc]);
+filter_hashsigns([Suite | Suites], [{KeyExchange,_,_,_} | Algos], HashSigns, Acc) when
+ KeyExchange == dh_anon;
+ KeyExchange == ecdh_anon;
+ KeyExchange == srp_anon;
+ KeyExchange == psk;
+ KeyExchange == dhe_psk ->
+ %% In this case hashsigns is not used as the kexchange is anonaymous
+ filter_hashsigns(Suites, Algos, HashSigns, [Suite| Acc]).
+
+do_filter_hashsigns(SignAlgo, Suite, Suites, Algos, HashSigns, Acc) ->
+ case lists:keymember(SignAlgo, 2, HashSigns) of
+ true ->
+ filter_hashsigns(Suites, Algos, HashSigns, [Suite| Acc]);
+ false ->
+ filter_hashsigns(Suites, Algos, HashSigns, Acc)
+ end.
unavailable_ecc_suites(no_curve) ->
ssl_cipher:ec_keyed_suites();
@@ -1077,17 +1112,17 @@ cipher_suites(Suites, false) ->
cipher_suites(Suites, true) ->
Suites.
-select_session(SuggestedSessionId, CipherSuites, Compressions, Port, #session{ecc = ECCCurve} =
+select_session(SuggestedSessionId, CipherSuites, HashSigns, Compressions, Port, #session{ecc = ECCCurve} =
Session, Version,
- #ssl_options{ciphers = UserSuites, honor_cipher_order = HCO} = SslOpts,
+ #ssl_options{ciphers = UserSuites, honor_cipher_order = HonorCipherOrder} = SslOpts,
Cache, CacheCb, Cert) ->
{SessionId, Resumed} = ssl_session:server_id(Port, SuggestedSessionId,
SslOpts, Cert,
Cache, CacheCb),
case Resumed of
undefined ->
- Suites = available_suites(Cert, UserSuites, Version, ECCCurve),
- CipherSuite = select_cipher_suite(CipherSuites, Suites, HCO),
+ Suites = available_suites(Cert, UserSuites, Version, HashSigns, ECCCurve),
+ CipherSuite = select_cipher_suite(CipherSuites, Suites, HonorCipherOrder),
Compression = select_compression(Compressions),
{new, Session#session{session_id = SessionId,
cipher_suite = CipherSuite,
@@ -1155,7 +1190,7 @@ handle_client_hello_extensions(RecordCB, Random, ClientCipherSuites,
#hello_extensions{renegotiation_info = Info,
srp = SRP,
ec_point_formats = ECCFormat,
- alpn = ALPN,
+ alpn = ALPN,
next_protocol_negotiation = NextProtocolNegotiation}, Version,
#ssl_options{secure_renegotiate = SecureRenegotation,
alpn_preferred_protocols = ALPNPreferredProtocols} = Opts,
@@ -1324,7 +1359,7 @@ handle_renegotiation_info(_RecordCB, ConnectionStates, SecureRenegotation) ->
hello_extensions_list(#hello_extensions{renegotiation_info = RenegotiationInfo,
srp = SRP,
- hash_signs = HashSigns,
+ signature_algs = HashSigns,
ec_point_formats = EcPointFormats,
elliptic_curves = EllipticCurves,
alpn = ALPN,
@@ -1799,7 +1834,7 @@ dec_hello_extensions(<<?UINT16(?SIGNATURE_ALGORITHMS_EXT), ?UINT16(Len),
<<?UINT16(SignAlgoListLen), SignAlgoList/binary>> = ExtData,
HashSignAlgos = [{ssl_cipher:hash_algorithm(Hash), ssl_cipher:sign_algorithm(Sign)} ||
<<?BYTE(Hash), ?BYTE(Sign)>> <= SignAlgoList],
- dec_hello_extensions(Rest, Acc#hello_extensions{hash_signs =
+ dec_hello_extensions(Rest, Acc#hello_extensions{signature_algs =
#hash_sign_algos{hash_sign_algos = HashSignAlgos}});
dec_hello_extensions(<<?UINT16(?ELLIPTIC_CURVES_EXT), ?UINT16(Len),
@@ -1899,7 +1934,7 @@ from_2bytes(<<?UINT16(N), Rest/binary>>, Acc) ->
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; Alg == dh_anon ->
?KEY_EXCHANGE_DIFFIE_HELLMAN;
key_exchange_alg(Alg) when Alg == ecdhe_rsa; Alg == ecdh_rsa;
Alg == ecdhe_ecdsa; Alg == ecdh_ecdsa;
@@ -2008,27 +2043,16 @@ is_member(Suite, SupportedSuites) ->
select_compression(_CompressionMetodes) ->
?NULL.
--define(TLSEXT_SIGALG_RSA(MD), {MD, rsa}).
--define(TLSEXT_SIGALG_DSA(MD), {MD, dsa}).
--define(TLSEXT_SIGALG_ECDSA(MD), {MD, ecdsa}).
-
--define(TLSEXT_SIGALG(MD), ?TLSEXT_SIGALG_ECDSA(MD), ?TLSEXT_SIGALG_RSA(MD)).
-
-advertised_hash_signs({Major, Minor}) when Major >= 3 andalso Minor >= 3 ->
- HashSigns = [?TLSEXT_SIGALG(sha512),
- ?TLSEXT_SIGALG(sha384),
- ?TLSEXT_SIGALG(sha256),
- ?TLSEXT_SIGALG(sha224),
- ?TLSEXT_SIGALG(sha),
- ?TLSEXT_SIGALG_DSA(sha),
- ?TLSEXT_SIGALG_RSA(md5)],
- CryptoSupport = crypto:supports(),
- HasECC = proplists:get_bool(ecdsa, proplists:get_value(public_keys, CryptoSupport)),
- Hashs = proplists:get_value(hashs, CryptoSupport),
- #hash_sign_algos{hash_sign_algos =
- lists:filter(fun({Hash, ecdsa}) -> HasECC andalso proplists:get_bool(Hash, Hashs);
- ({Hash, _}) -> proplists:get_bool(Hash, Hashs) end, HashSigns)};
-advertised_hash_signs(_) ->
+available_signature_algs(undefined, _, _) ->
+ undefined;
+available_signature_algs(SupportedHashSigns, {Major, Minor}, AllVersions) when Major >= 3 andalso Minor >= 3 ->
+ case tls_record:lowest_protocol_version(AllVersions) of
+ {3, 3} ->
+ #hash_sign_algos{hash_sign_algos = SupportedHashSigns};
+ _ ->
+ undefined
+ end;
+available_signature_algs(_, _, _) ->
undefined.
psk_secret(PSKIdentity, PSKLookup) ->
@@ -2123,3 +2147,25 @@ distpoints_lookup([DistPoint | Rest], Callback, CRLDbHandle) ->
CRLs ->
[{DistPoint, {CRL, public_key:der_decode('CertificateList', CRL)}} || CRL <- CRLs]
end.
+
+cert_sign(?rsaEncryption) ->
+ rsa;
+cert_sign(?'id-ecPublicKey') ->
+ ecdsa;
+cert_sign(?'id-dsa') ->
+ dsa;
+cert_sign(Alg) ->
+ {_, Sign} =public_key:pkix_sign_types(Alg),
+ Sign.
+
+is_acceptable_hash_sign({_, Sign} = Algos, Sign, _, SupportedHashSigns) ->
+ is_acceptable_hash_sign(Algos, SupportedHashSigns);
+is_acceptable_hash_sign(Algos,_, KeyExAlgo, SupportedHashSigns) when KeyExAlgo == dh_ecdsa;
+ KeyExAlgo == ecdh_rsa;
+ KeyExAlgo == ecdh_ecdsa ->
+ is_acceptable_hash_sign(Algos, SupportedHashSigns);
+is_acceptable_hash_sign(_,_,_,_) ->
+ false.
+is_acceptable_hash_sign(Algos, SupportedHashSigns) ->
+ lists:member(Algos, SupportedHashSigns).
+
diff --git a/lib/ssl/src/ssl_handshake.hrl b/lib/ssl/src/ssl_handshake.hrl
index 58b4d5a23d..e7b118de10 100644
--- a/lib/ssl/src/ssl_handshake.hrl
+++ b/lib/ssl/src/ssl_handshake.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -95,7 +95,7 @@
-record(hello_extensions, {
renegotiation_info,
- hash_signs, % supported combinations of hashes/signature algos
+ signature_algs, % supported combinations of hashes/signature algos
alpn,
next_protocol_negotiation = undefined, % [binary()]
srp,
diff --git a/lib/ssl/src/ssl_internal.hrl b/lib/ssl/src/ssl_internal.hrl
index 913746598f..076e663cd4 100644
--- a/lib/ssl/src/ssl_internal.hrl
+++ b/lib/ssl/src/ssl_internal.hrl
@@ -118,7 +118,7 @@
%% undefined if not hibernating, or number of ms of
%% inactivity after which ssl_connection will go into
%% hibernation
- hibernate_after :: boolean() | 'undefined',
+ hibernate_after :: timeout(),
%% This option should only be set to true by inet_tls_dist
erl_dist = false :: boolean(),
alpn_advertised_protocols = undefined :: [binary()] | undefined ,
@@ -135,7 +135,8 @@
padding_check = true :: boolean(),
fallback = false :: boolean(),
crl_check :: boolean() | peer | best_effort,
- crl_cache
+ crl_cache,
+ signature_algs
}).
-record(socket_options,
diff --git a/lib/ssl/src/ssl_listen_tracker_sup.erl b/lib/ssl/src/ssl_listen_tracker_sup.erl
index f9a0ba331e..7f685a2ead 100644
--- a/lib/ssl/src/ssl_listen_tracker_sup.erl
+++ b/lib/ssl/src/ssl_listen_tracker_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/ssl_manager.erl b/lib/ssl/src/ssl_manager.erl
index 311dac4619..60b4fbe995 100644
--- a/lib/ssl/src/ssl_manager.erl
+++ b/lib/ssl/src/ssl_manager.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -551,7 +551,7 @@ last_delay_timer({_,_}, TRef, {_, LastClient}) ->
new_id(_, 0, _, _) ->
<<>>;
new_id(Port, Tries, Cache, CacheCb) ->
- Id = crypto:rand_bytes(?NUM_OF_SESSION_ID_BYTES),
+ Id = ssl_cipher:random_bytes(?NUM_OF_SESSION_ID_BYTES),
case CacheCb:lookup(Cache, {Port, Id}) of
undefined ->
Now = erlang:monotonic_time(),
@@ -610,8 +610,8 @@ server_register_session(Port, Session, #state{session_cache_server_max = Max,
do_register_session(Key, Session, Max, Pid, Cache, CacheCb) ->
try CacheCb:size(Cache) of
- N when N > Max ->
- invalidate_session_cache(Pid, CacheCb, Cache);
+ Max ->
+ invalidate_session_cache(Pid, CacheCb, Cache);
_ ->
CacheCb:update(Cache, Key, Session),
Pid
diff --git a/lib/ssl/src/ssl_record.erl b/lib/ssl/src/ssl_record.erl
index ce6b8fb84f..866bfcef7e 100644
--- a/lib/ssl/src/ssl_record.erl
+++ b/lib/ssl/src/ssl_record.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -460,7 +460,7 @@ empty_security_params(ConnectionEnd = ?SERVER) ->
random() ->
Secs_since_1970 = calendar:datetime_to_gregorian_seconds(
calendar:universal_time()) - 62167219200,
- Random_28_bytes = crypto:rand_bytes(28),
+ Random_28_bytes = ssl_cipher:random_bytes(28),
<<?UINT32(Secs_since_1970), Random_28_bytes/binary>>.
dtls_next_epoch(#connection_state{epoch = undefined}) -> %% SSL/TLS
diff --git a/lib/ssl/src/ssl_record.hrl b/lib/ssl/src/ssl_record.hrl
index af77378f44..d34d144343 100644
--- a/lib/ssl/src/ssl_record.hrl
+++ b/lib/ssl/src/ssl_record.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/ssl_session.erl b/lib/ssl/src/ssl_session.erl
index 2b24bff5ff..c9607489e9 100644
--- a/lib/ssl/src/ssl_session.erl
+++ b/lib/ssl/src/ssl_session.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/ssl_session_cache.erl b/lib/ssl/src/ssl_session_cache.erl
index 9585e613e6..c79ad1523b 100644
--- a/lib/ssl/src/ssl_session_cache.erl
+++ b/lib/ssl/src/ssl_session_cache.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/ssl_session_cache_api.erl b/lib/ssl/src/ssl_session_cache_api.erl
index 8f62c25be5..b68c75a09b 100644
--- a/lib/ssl/src/ssl_session_cache_api.erl
+++ b/lib/ssl/src/ssl_session_cache_api.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/ssl_socket.erl b/lib/ssl/src/ssl_socket.erl
index a5487bfb5c..95a70a4602 100644
--- a/lib/ssl/src/ssl_socket.erl
+++ b/lib/ssl/src/ssl_socket.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/ssl_srp.hrl b/lib/ssl/src/ssl_srp.hrl
index f543866085..d6e45adeee 100644
--- a/lib/ssl/src/ssl_srp.hrl
+++ b/lib/ssl/src/ssl_srp.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/ssl_sup.erl b/lib/ssl/src/ssl_sup.erl
index 950a6e0944..7fa1f7dc9e 100644
--- a/lib/ssl/src/ssl_sup.erl
+++ b/lib/ssl/src/ssl_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/ssl_tls_dist_proxy.erl b/lib/ssl/src/ssl_tls_dist_proxy.erl
index 4c789793ec..4651687fe6 100644
--- a/lib/ssl/src/ssl_tls_dist_proxy.erl
+++ b/lib/ssl/src/ssl_tls_dist_proxy.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -195,6 +195,11 @@ accept_loop(Proxy, erts = Type, Listen, Extra) ->
{_Kernel, unsupported_protocol} ->
exit(unsupported_protocol)
end;
+ {error, closed} ->
+ %% The listening socket is closed: the proxy process is
+ %% shutting down. Exit normally, to avoid generating a
+ %% spurious error report.
+ exit(normal);
Error ->
exit(Error)
end,
diff --git a/lib/ssl/src/ssl_v2.erl b/lib/ssl/src/ssl_v2.erl
index 1764da5c63..37134cbe5d 100644
--- a/lib/ssl/src/ssl_v2.erl
+++ b/lib/ssl/src/ssl_v2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/ssl_v3.erl b/lib/ssl/src/ssl_v3.erl
index f98ea83771..82d165f995 100644
--- a/lib/ssl/src/ssl_v3.erl
+++ b/lib/ssl/src/ssl_v3.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/tls.erl b/lib/ssl/src/tls.erl
index d4cb8788bf..aa41cd1ba6 100644
--- a/lib/ssl/src/tls.erl
+++ b/lib/ssl/src/tls.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl
index c3f0206d25..208edc644a 100644
--- a/lib/ssl/src/tls_connection.erl
+++ b/lib/ssl/src/tls_connection.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
-module(tls_connection).
--behaviour(gen_fsm).
+-behaviour(gen_statem).
-include("tls_connection.hrl").
-include("tls_handshake.hrl").
@@ -43,31 +43,33 @@
%% Internal application API
%% Setup
--export([start_fsm/8]).
+-export([start_fsm/8, start_link/7, init/1]).
%% State transition handling
--export([next_record/1, next_state/4, next_state_connection/2]).
+-export([next_record/1, next_event/3]).
%% Handshake handling
--export([renegotiate/1, send_handshake/2, send_change_cipher/2]).
+-export([renegotiate/2, send_handshake/2, send_change_cipher/2,
+ reinit_handshake_data/1]).
%% Alert and close handling
-export([send_alert/2, handle_own_alert/4, handle_close_alert/3,
- handle_normal_shutdown/3, handle_unexpected_message/3,
+ handle_normal_shutdown/3,
close/5, alert_user/6, alert_user/9
]).
%% Data handling
-export([write_application_data/3, read_application_data/2,
- passive_receive/2, next_record_if_active/1]).
+ passive_receive/2, next_record_if_active/1, handle_common_event/4]).
-%% Called by tls_connection_sup
--export([start_link/7]).
-
-%% gen_fsm callbacks
--export([init/1, hello/2, certify/2, cipher/2,
- abbreviated/2, connection/2, handle_event/3,
- handle_sync_event/4, handle_info/3, terminate/3, code_change/4, format_status/2]).
+%% gen_statem state functions
+-export([init/3, error/3, downgrade/3, %% Initiation and take down states
+ hello/3, certify/3, cipher/3, abbreviated/3, %% Handshake states
+ connection/3]).
+%% gen_statem callbacks
+-export([terminate/3, code_change/4, format_status/2]).
+
+-define(GEN_STATEM_CB_MODE, state_functions).
%%====================================================================
%% Internal application API
@@ -130,6 +132,16 @@ send_change_cipher(Msg, #state{connection_states = ConnectionStates0,
Transport:send(Socket, BinChangeCipher),
State0#state{connection_states = ConnectionStates}.
+reinit_handshake_data(State) ->
+ %% premaster_secret, public_key_info and tls_handshake_info
+ %% are only needed during the handshake phase.
+ %% To reduce memory foot print of a connection reinitialize them.
+ State#state{
+ premaster_secret = undefined,
+ public_key_info = undefined,
+ tls_handshake_history = ssl_handshake:init_handshake_history()
+ }.
+
%%====================================================================
%% tls_connection_sup API
%%====================================================================
@@ -147,23 +159,34 @@ start_link(Role, Host, Port, Socket, Options, User, CbInfo) ->
init([Role, Host, Port, Socket, Options, User, CbInfo]) ->
process_flag(trap_exit, true),
- State = initial_state(Role, Host, Port, Socket, Options, User, CbInfo),
- gen_fsm:enter_loop(?MODULE, [], hello, State, get_timeout(State)).
+ State0 = initial_state(Role, Host, Port, Socket, Options, User, CbInfo),
+ try
+ State = ssl_connection:ssl_config(State0#state.ssl_options, Role, State0),
+ gen_statem:enter_loop(?MODULE, [], ?GEN_STATEM_CB_MODE, init, State)
+ catch throw:Error ->
+ gen_statem:enter_loop(?MODULE, [], ?GEN_STATEM_CB_MODE, error, {Error, State0})
+ end.
%%--------------------------------------------------------------------
-%% Description:There should be one instance of this function for each
-%% possible state name. Whenever a gen_fsm receives an event sent
-%% using gen_fsm:send_event/2, the instance of this function with the
-%% same name as the current state name StateName is called to handle
-%% the event. It is also called if a timeout occurs.
-%%
-hello(start, #state{host = Host, port = Port, role = client,
- ssl_options = SslOpts,
- session = #session{own_certificate = Cert} = Session0,
- session_cache = Cache, session_cache_cb = CacheCb,
- transport_cb = Transport, socket = Socket,
- connection_states = ConnectionStates0,
- renegotiation = {Renegotiation, _}} = State0) ->
+%% State functions
+%%--------------------------------------------------------------------
+%%--------------------------------------------------------------------
+-spec init(gen_statem:event_type(),
+ {start, timeout()} | term(), #state{}) ->
+ gen_statem:state_function_result().
+%%--------------------------------------------------------------------
+
+init({call, From}, {start, Timeout},
+ #state{host = Host, port = Port, role = client,
+ ssl_options = SslOpts,
+ session = #session{own_certificate = Cert} = Session0,
+ transport_cb = Transport, socket = Socket,
+ connection_states = ConnectionStates0,
+ renegotiation = {Renegotiation, _},
+ session_cache = Cache,
+ session_cache_cb = CacheCb
+ } = State0) ->
+ Timer = ssl_connection:start_or_recv_cancel_timer(Timeout, From),
Hello = tls_handshake:client_hello(Host, Port, ConnectionStates0, SslOpts,
Cache, CacheCb, Renegotiation, Cert),
@@ -177,42 +200,65 @@ hello(start, #state{host = Host, port = Port, role = client,
negotiated_version = Version, %% Requested version
session =
Session0#session{session_id = Hello#client_hello.session_id},
- tls_handshake_history = Handshake},
+ tls_handshake_history = Handshake,
+ start_or_recv_from = From,
+ timer = Timer},
{Record, State} = next_record(State1),
- next_state(hello, hello, Record, State);
+ next_event(hello, Record, State);
+init(Type, Event, State) ->
+ ssl_connection:init(Type, Event, State, ?MODULE).
+
+%%--------------------------------------------------------------------
+-spec error(gen_statem:event_type(),
+ {start, timeout()} | term(), #state{}) ->
+ gen_statem:state_function_result().
+%%--------------------------------------------------------------------
-hello(Hello = #client_hello{client_version = ClientVersion,
- extensions = #hello_extensions{hash_signs = HashSigns,
- ec_point_formats = EcPointFormats,
- elliptic_curves = EllipticCurves}},
+error({call, From}, {start, _Timeout}, {Error, State}) ->
+ {stop_and_reply, normal, {reply, From, {error, Error}}, State};
+error({call, From}, Msg, State) ->
+ handle_call(Msg, From, error, State);
+error(_, _, _) ->
+ {keep_state_and_data, [postpone]}.
+
+%%--------------------------------------------------------------------
+-spec hello(gen_statem:event_type(),
+ #hello_request{} | #client_hello{} | #server_hello{} | term(),
+ #state{}) ->
+ gen_statem:state_function_result().
+%%--------------------------------------------------------------------
+hello(internal, #client_hello{client_version = ClientVersion,
+ extensions = #hello_extensions{ec_point_formats = EcPointFormats,
+ elliptic_curves = EllipticCurves}} = Hello,
State = #state{connection_states = ConnectionStates0,
port = Port, session = #session{own_certificate = Cert} = Session0,
renegotiation = {Renegotiation, _},
session_cache = Cache,
session_cache_cb = CacheCb,
negotiated_protocol = CurrentProtocol,
+ key_algorithm = KeyExAlg,
ssl_options = SslOpts}) ->
+
case tls_handshake:hello(Hello, SslOpts, {Port, Session0, Cache, CacheCb,
- ConnectionStates0, Cert}, Renegotiation) of
+ ConnectionStates0, Cert, KeyExAlg}, Renegotiation) of
#alert{} = Alert ->
handle_own_alert(Alert, ClientVersion, hello, State);
{Version, {Type, Session},
- ConnectionStates, Protocol0, ServerHelloExt} ->
-
+ ConnectionStates, Protocol0, ServerHelloExt, HashSign} ->
Protocol = case Protocol0 of
- undefined -> CurrentProtocol;
- _ -> Protocol0
- end,
-
- HashSign = ssl_handshake:select_hashsign(HashSigns, Cert, Version),
- ssl_connection:hello({common_client_hello, Type, ServerHelloExt, HashSign},
+ undefined -> CurrentProtocol;
+ _ -> Protocol0
+ end,
+
+ ssl_connection:hello(internal, {common_client_hello, Type, ServerHelloExt},
State#state{connection_states = ConnectionStates,
negotiated_version = Version,
+ hashsign_algorithm = HashSign,
session = Session,
client_ecc = {EllipticCurves, EcPointFormats},
negotiated_protocol = Protocol}, ?MODULE)
end;
-hello(Hello = #server_hello{},
+hello(internal, #server_hello{} = Hello,
#state{connection_states = ConnectionStates0,
negotiated_version = ReqVersion,
role = client,
@@ -225,25 +271,52 @@ hello(Hello = #server_hello{},
ssl_connection:handle_session(Hello,
Version, NewId, ConnectionStates, ProtoExt, Protocol, State)
end;
+hello(info, Event, State) ->
+ handle_info(Event, hello, State);
+hello(Type, Event, State) ->
+ ssl_connection:hello(Type, Event, State, ?MODULE).
-hello(Msg, State) ->
- ssl_connection:hello(Msg, State, ?MODULE).
-
-abbreviated(Msg, State) ->
- ssl_connection:abbreviated(Msg, State, ?MODULE).
+%%--------------------------------------------------------------------
+-spec abbreviated(gen_statem:event_type(), term(), #state{}) ->
+ gen_statem:state_function_result().
+%%--------------------------------------------------------------------
+abbreviated(info, Event, State) ->
+ handle_info(Event, abbreviated, State);
+abbreviated(Type, Event, State) ->
+ ssl_connection:abbreviated(Type, Event, State, ?MODULE).
-certify(Msg, State) ->
- ssl_connection:certify(Msg, State, ?MODULE).
+%%--------------------------------------------------------------------
+-spec certify(gen_statem:event_type(), term(), #state{}) ->
+ gen_statem:state_function_result().
+%%--------------------------------------------------------------------
+certify(info, Event, State) ->
+ handle_info(Event, certify, State);
+certify(Type, Event, State) ->
+ ssl_connection:certify(Type, Event, State, ?MODULE).
-cipher(Msg, State) ->
- ssl_connection:cipher(Msg, State, ?MODULE).
+%%--------------------------------------------------------------------
+-spec cipher(gen_statem:event_type(), term(), #state{}) ->
+ gen_statem:state_function_result().
+%%--------------------------------------------------------------------
+cipher(info, Event, State) ->
+ handle_info(Event, cipher, State);
+cipher(Type, Event, State) ->
+ ssl_connection:cipher(Type, Event, State, ?MODULE).
-connection(#hello_request{}, #state{host = Host, port = Port,
- session = #session{own_certificate = Cert} = Session0,
- session_cache = Cache, session_cache_cb = CacheCb,
- ssl_options = SslOpts,
- connection_states = ConnectionStates0,
- renegotiation = {Renegotiation, _}} = State0) ->
+%%--------------------------------------------------------------------
+-spec connection(gen_statem:event_type(),
+ #hello_request{} | #client_hello{}| term(), #state{}) ->
+ gen_statem:state_function_result().
+%%--------------------------------------------------------------------
+connection(info, Event, State) ->
+ handle_info(Event, connection, State);
+connection(internal, #hello_request{},
+ #state{host = Host, port = Port,
+ session = #session{own_certificate = Cert} = Session0,
+ session_cache = Cache, session_cache_cb = CacheCb,
+ ssl_options = SslOpts,
+ connection_states = ConnectionStates0,
+ renegotiation = {Renegotiation, _}} = State0) ->
Hello = tls_handshake:client_hello(Host, Port, ConnectionStates0, SslOpts,
Cache, CacheCb, Renegotiation, Cert),
State1 = send_handshake(Hello, State0),
@@ -251,58 +324,49 @@ connection(#hello_request{}, #state{host = Host, port = Port,
next_record(
State1#state{session = Session0#session{session_id
= Hello#client_hello.session_id}}),
- next_state(connection, hello, Record, State);
-
-connection(#client_hello{} = Hello, #state{role = server, allow_renegotiate = true} = State) ->
+ next_event(hello, Record, State);
+connection(internal, #client_hello{} = Hello,
+ #state{role = server, allow_renegotiate = true} = State) ->
%% Mitigate Computational DoS attack
%% http://www.educatedguesswork.org/2011/10/ssltls_and_computational_dos.html
%% http://www.thc.org/thc-ssl-dos/ Rather than disabling client
%% initiated renegotiation we will disallow many client initiated
%% renegotiations immediately after each other.
erlang:send_after(?WAIT_TO_ALLOW_RENEGOTIATION, self(), allow_renegotiate),
- hello(Hello, State#state{allow_renegotiate = false});
-
-connection(#client_hello{}, #state{role = server, allow_renegotiate = false} = State0) ->
+ {next_state, hello, State#state{allow_renegotiate = false}, [{next_event, internal, Hello}]};
+connection(internal, #client_hello{},
+ #state{role = server, allow_renegotiate = false} = State0) ->
Alert = ?ALERT_REC(?WARNING, ?NO_RENEGOTIATION),
- State = send_alert(Alert, State0),
- next_state_connection(connection, State);
-
-connection(Msg, State) ->
- ssl_connection:connection(Msg, State, tls_connection).
+ State1 = send_alert(Alert, State0),
+ {Record, State} = ssl_connection:prepare_connection(State1, ?MODULE),
+ next_event(connection, Record, State);
+connection(Type, Event, State) ->
+ ssl_connection:connection(Type, Event, State, ?MODULE).
%%--------------------------------------------------------------------
-%% Description: Whenever a gen_fsm receives an event sent using
-%% gen_fsm:send_all_state_event/2, this function is called to handle
-%% the event. Not currently used!
+-spec downgrade(gen_statem:event_type(), term(), #state{}) ->
+ gen_statem:state_function_result().
%%--------------------------------------------------------------------
-handle_event(_Event, StateName, State) ->
- {next_state, StateName, State, get_timeout(State)}.
+downgrade(Type, Event, State) ->
+ ssl_connection:downgrade(Type, Event, State, ?MODULE).
%%--------------------------------------------------------------------
-%% Description: Whenever a gen_fsm receives an event sent using
-%% gen_fsm:sync_send_all_state_event/2,3, this function is called to handle
-%% the event.
-%%--------------------------------------------------------------------
-handle_sync_event(Event, From, StateName, State) ->
- ssl_connection:handle_sync_event(Event, From, StateName, State).
-
+%% Event handling functions called by state functions to handle
+%% common or unexpected events for the state.
%%--------------------------------------------------------------------
-%% Description: This function is called by a gen_fsm when it receives any
-%% other message than a synchronous or asynchronous event
-%% (or a system message).
-%%--------------------------------------------------------------------
-
+handle_call(Event, From, StateName, State) ->
+ ssl_connection:handle_call(Event, From, StateName, State, ?MODULE).
+
%% raw data from socket, unpack records
handle_info({Protocol, _, Data}, StateName,
#state{data_tag = Protocol} = State0) ->
case next_tls_record(Data, State0) of
{Record, State} ->
- next_state(StateName, StateName, Record, State);
+ next_event(StateName, Record, State);
#alert{} = Alert ->
handle_normal_shutdown(Alert, StateName, State0),
- {stop, {shutdown, own_alert}, State0}
+ {stop, {shutdown, own_alert}}
end;
-
handle_info({CloseTag, Socket}, StateName,
#state{socket = Socket, close_tag = CloseTag,
negotiated_version = Version} = State) ->
@@ -321,32 +385,98 @@ handle_info({CloseTag, Socket}, StateName,
ok
end,
handle_normal_shutdown(?ALERT_REC(?FATAL, ?CLOSE_NOTIFY), StateName, State),
- {stop, {shutdown, transport_closed}, State};
-
+ {stop, {shutdown, transport_closed}};
handle_info(Msg, StateName, State) ->
ssl_connection:handle_info(Msg, StateName, State).
+handle_common_event(internal, #alert{} = Alert, StateName,
+ #state{negotiated_version = Version} = State) ->
+ handle_own_alert(Alert, Version, StateName, State);
+
+%%% TLS record protocol level handshake messages
+handle_common_event(internal, #ssl_tls{type = ?HANDSHAKE, fragment = Data},
+ StateName, #state{protocol_buffers =
+ #protocol_buffers{tls_handshake_buffer = Buf0} = Buffers,
+ negotiated_version = Version} = State0) ->
+
+ Handle =
+ fun({#hello_request{} = Packet, _}, {connection, HState}) ->
+ %% This message should not be included in handshake
+ %% message hashes. Starts new handshake (renegotiation)
+ Hs0 = ssl_handshake:init_handshake_history(),
+ {HState#state{tls_handshake_history = Hs0,
+ renegotiation = {true, peer}},
+ {next_event, internal, Packet}};
+ ({#hello_request{}, _}, {next_state, _SName, HState}) ->
+ %% This message should not be included in handshake
+ %% message hashes. Already in negotiation so it will be ignored!
+ {HState, []};
+ ({#client_hello{} = Packet, Raw}, {connection, HState0}) ->
+ HState = handle_sni_extension(Packet, HState0),
+ Version = Packet#client_hello.client_version,
+ Hs0 = ssl_handshake:init_handshake_history(),
+ Hs1 = ssl_handshake:update_handshake_history(Hs0, Raw),
+ {HState#state{tls_handshake_history = Hs1,
+ renegotiation = {true, peer}},
+ {next_event, internal, Packet}};
+
+ ({Packet, Raw}, {_SName, HState0 = #state{tls_handshake_history=Hs0}}) ->
+ HState = handle_sni_extension(Packet, HState0),
+ Hs1 = ssl_handshake:update_handshake_history(Hs0, Raw),
+ {HState#state{tls_handshake_history=Hs1}, {next_event, internal, Packet}}
+ end,
+ try
+ {Packets, Buf} = tls_handshake:get_tls_handshake(Version,Data,Buf0),
+ State1 = State0#state{protocol_buffers =
+ Buffers#protocol_buffers{tls_packets = Packets,
+ tls_handshake_buffer = Buf}},
+ {State, Events} = tls_handshake_events(Handle, StateName, State1, []),
+ case StateName of
+ connection ->
+ ssl_connection:hibernate_after(StateName, State, Events);
+ _ ->
+ {next_state, StateName, State, Events}
+ end
+ catch throw:#alert{} = Alert ->
+ handle_own_alert(Alert, Version, StateName, State0)
+ end;
+%%% TLS record protocol level application data messages
+handle_common_event(internal, #ssl_tls{type = ?APPLICATION_DATA, fragment = Data}, StateName, State) ->
+ {next_state, StateName, State, [{next_event, internal, {application_data, Data}}]};
+%%% TLS record protocol level change cipher messages
+handle_common_event(internal, #ssl_tls{type = ?CHANGE_CIPHER_SPEC, fragment = Data}, StateName, State) ->
+ {next_state, StateName, State, [{next_event, internal, #change_cipher_spec{type = Data}}]};
+%%% TLS record protocol level Alert messages
+handle_common_event(internal, #ssl_tls{type = ?ALERT, fragment = EncAlerts}, StateName,
+ #state{negotiated_version = Version} = State) ->
+ case decode_alerts(EncAlerts) of
+ Alerts = [_|_] ->
+ handle_alerts(Alerts, {next_state, StateName, State});
+ #alert{} = Alert ->
+ handle_own_alert(Alert, Version, StateName, State)
+ end;
+%% Ignore unknown TLS record level protocol messages
+handle_common_event(internal, #ssl_tls{type = _Unknown}, StateName, State) ->
+ {next_state, StateName, State}.
+
%%--------------------------------------------------------------------
-%% Description:This function is called by a gen_fsm when it is about
-%% to terminate. It should be the opposite of Module:init/1 and do any
-%% necessary cleaning up. When it returns, the gen_fsm terminates with
-%% Reason. The return value is ignored.
+%% gen_statem callbacks
%%--------------------------------------------------------------------
terminate(Reason, StateName, State) ->
catch ssl_connection:terminate(Reason, StateName, State).
+format_status(Type, Data) ->
+ ssl_connection:format_status(Type, Data).
+
%%--------------------------------------------------------------------
%% code_change(OldVsn, StateName, State, Extra) -> {ok, StateName, NewState}
%% Description: Convert process state when code is changed
%%--------------------------------------------------------------------
code_change(_OldVsn, StateName, State0, {Direction, From, To}) ->
State = convert_state(State0, Direction, From, To),
- {ok, StateName, State};
+ {?GEN_STATEM_CB_MODE, StateName, State};
code_change(_OldVsn, StateName, State, _) ->
- {ok, StateName, State}.
-
-format_status(Type, Data) ->
- ssl_connection:format_status(Type, Data).
+ {?GEN_STATEM_CB_MODE, StateName, State}.
%%--------------------------------------------------------------------
%%% Internal functions
@@ -396,7 +526,6 @@ initial_state(Role, Host, Port, Socket, {SSLOptions, SocketOptions, Tracker}, Us
renegotiation = {false, first},
allow_renegotiate = SSLOptions#ssl_options.client_renegotiation,
start_or_recv_from = undefined,
- send_queue = queue:new(),
protocol_cb = ?MODULE,
tracker = Tracker
}.
@@ -418,80 +547,6 @@ update_ssl_options_from_sni(OrigSSLOptions, SNIHostname) ->
ssl:handle_options(SSLOption, OrigSSLOptions)
end.
-next_state(Current,_, #alert{} = Alert, #state{negotiated_version = Version} = State) ->
- handle_own_alert(Alert, Version, Current, State);
-
-next_state(_,Next, no_record, State) ->
- {next_state, Next, State, get_timeout(State)};
-
-next_state(Current, Next, #ssl_tls{type = ?ALERT, fragment = EncAlerts}, #state{negotiated_version = Version} = State) ->
- case decode_alerts(EncAlerts) of
- Alerts = [_|_] ->
- handle_alerts(Alerts, {next_state, Next, State, get_timeout(State)});
- #alert{} = Alert ->
- handle_own_alert(Alert, Version, Current, State)
- end;
-next_state(Current, Next, #ssl_tls{type = ?HANDSHAKE, fragment = Data},
- State0 = #state{protocol_buffers =
- #protocol_buffers{tls_handshake_buffer = Buf0} = Buffers,
- negotiated_version = Version}) ->
- Handle =
- fun({#hello_request{} = Packet, _}, {next_state, connection = SName, State}) ->
- %% This message should not be included in handshake
- %% message hashes. Starts new handshake (renegotiation)
- Hs0 = ssl_handshake:init_handshake_history(),
- ?MODULE:SName(Packet, State#state{tls_handshake_history=Hs0,
- renegotiation = {true, peer}});
- ({#hello_request{} = Packet, _}, {next_state, SName, State}) ->
- %% This message should not be included in handshake
- %% message hashes. Already in negotiation so it will be ignored!
- ?MODULE:SName(Packet, State);
- ({#client_hello{} = Packet, Raw}, {next_state, connection = SName, HState0}) ->
- HState = handle_sni_extension(Packet, HState0),
- Version = Packet#client_hello.client_version,
- Hs0 = ssl_handshake:init_handshake_history(),
- Hs1 = ssl_handshake:update_handshake_history(Hs0, Raw),
- ?MODULE:SName(Packet, HState#state{tls_handshake_history=Hs1,
- renegotiation = {true, peer}});
- ({Packet, Raw}, {next_state, SName, HState0 = #state{tls_handshake_history=Hs0}}) ->
- HState = handle_sni_extension(Packet, HState0),
- Hs1 = ssl_handshake:update_handshake_history(Hs0, Raw),
- ?MODULE:SName(Packet, HState#state{tls_handshake_history=Hs1});
- (_, StopState) -> StopState
- end,
- try
- {Packets, Buf} = tls_handshake:get_tls_handshake(Version,Data,Buf0),
- State = State0#state{protocol_buffers =
- Buffers#protocol_buffers{tls_packets = Packets,
- tls_handshake_buffer = Buf}},
- handle_tls_handshake(Handle, Next, State)
- catch throw:#alert{} = Alert ->
- handle_own_alert(Alert, Version, Current, State0)
- end;
-
-next_state(_, StateName, #ssl_tls{type = ?APPLICATION_DATA, fragment = Data}, State0) ->
- case read_application_data(Data, State0) of
- Stop = {stop,_,_} ->
- Stop;
- {Record, State} ->
- next_state(StateName, StateName, Record, State)
- end;
-next_state(Current, Next, #ssl_tls{type = ?CHANGE_CIPHER_SPEC, fragment = <<1>>} =
- _ChangeCipher,
- #state{connection_states = ConnectionStates0} = State0)
- when Next == cipher; Next == abbreviated ->
- ConnectionStates1 =
- ssl_record:activate_pending_connection_state(ConnectionStates0, read),
- {Record, State} = next_record(State0#state{connection_states = ConnectionStates1}),
- next_state(Current, Next, Record, State#state{expecting_finished = true});
-next_state(Current, _Next, #ssl_tls{type = ?CHANGE_CIPHER_SPEC, fragment = <<1>>} =
- _ChangeCipher, #state{negotiated_version = Version} = State) ->
- handle_own_alert(?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE), Version, Current, State);
-next_state(Current, Next, #ssl_tls{type = _Unknown}, State0) ->
- %% Ignore unknown type
- {Record, State} = next_record(State0),
- next_state(Current, Next, Record, State).
-
next_tls_record(Data, #state{protocol_buffers = #protocol_buffers{tls_record_buffer = Buf0,
tls_cipher_texts = CT0} = Buffers} = State0) ->
case tls_record:get_tls_records(Data, Buf0) of
@@ -504,11 +559,6 @@ next_tls_record(Data, #state{protocol_buffers = #protocol_buffers{tls_record_buf
Alert
end.
-next_record(#state{protocol_buffers = #protocol_buffers{tls_packets = [], tls_cipher_texts = []},
- socket = Socket,
- transport_cb = Transport} = State) ->
- ssl_socket:setopts(Transport, Socket, [{active,once}]),
- {no_record, State};
next_record(#state{protocol_buffers =
#protocol_buffers{tls_packets = [], tls_cipher_texts = [CT | Rest]}
= Buffers,
@@ -522,6 +572,11 @@ next_record(#state{protocol_buffers =
#alert{} = Alert ->
{Alert, State}
end;
+next_record(#state{protocol_buffers = #protocol_buffers{tls_packets = [], tls_cipher_texts = []},
+ socket = Socket,
+ transport_cb = Transport} = State) ->
+ ssl_socket:setopts(Transport, Socket, [{active,once}]),
+ {no_record, State};
next_record(State) ->
{no_record, State}.
@@ -533,55 +588,36 @@ next_record_if_active(State =
next_record_if_active(State) ->
next_record(State).
-next_state_connection(StateName, #state{send_queue = Queue0,
- negotiated_version = Version,
- socket = Socket,
- transport_cb = Transport,
- connection_states = ConnectionStates0
- } = State) ->
- %% Send queued up data that was queued while renegotiating
- case queue:out(Queue0) of
- {{value, {From, Data}}, Queue} ->
- {Msgs, ConnectionStates} =
- ssl_record:encode_data(Data, Version, ConnectionStates0),
- Result = Transport:send(Socket, Msgs),
- gen_fsm:reply(From, Result),
- next_state_connection(StateName,
- State#state{connection_states = ConnectionStates,
- send_queue = Queue});
- {empty, Queue0} ->
- next_state_is_connection(StateName, State)
- end.
-
-%% In next_state_is_connection/1: clear tls_handshake,
-%% premaster_secret and public_key_info (only needed during handshake)
-%% to reduce memory foot print of a connection.
-next_state_is_connection(_, State =
- #state{start_or_recv_from = RecvFrom,
- socket_options =
- #socket_options{active = false}}) when RecvFrom =/= undefined ->
- passive_receive(State#state{premaster_secret = undefined,
- public_key_info = undefined,
- tls_handshake_history = ssl_handshake:init_handshake_history()}, connection);
-
-next_state_is_connection(StateName, State0) ->
- {Record, State} = next_record_if_active(State0),
- next_state(StateName, connection, Record, State#state{premaster_secret = undefined,
- public_key_info = undefined,
- tls_handshake_history = ssl_handshake:init_handshake_history()}).
-
passive_receive(State0 = #state{user_data_buffer = Buffer}, StateName) ->
case Buffer of
<<>> ->
{Record, State} = next_record(State0),
- next_state(StateName, StateName, Record, State);
+ next_event(StateName, Record, State);
_ ->
- case read_application_data(<<>>, State0) of
- Stop = {stop, _, _} ->
- Stop;
- {Record, State} ->
- next_state(StateName, StateName, Record, State)
- end
+ {Record, State} = read_application_data(<<>>, State0),
+ next_event(StateName, Record, State)
+ end.
+
+next_event(StateName, Record, State) ->
+ next_event(StateName, Record, State, []).
+
+next_event(connection = StateName, no_record, State0, Actions) ->
+ case next_record_if_active(State0) of
+ {no_record, State} ->
+ ssl_connection:hibernate_after(StateName, State, Actions);
+ {#ssl_tls{} = Record, State} ->
+ {next_state, StateName, State, [{next_event, internal, {tls_record, Record}} | Actions]};
+ {#alert{} = Alert, State} ->
+ {next_state, StateName, State, [{next_event, internal, Alert} | Actions]}
+ end;
+next_event(StateName, Record, State, Actions) ->
+ case Record of
+ no_record ->
+ {next_state, StateName, State, Actions};
+ #ssl_tls{} = Record ->
+ {next_state, StateName, State, [{next_event, internal, {tls_record, Record}} | Actions]};
+ #alert{} = Alert ->
+ {next_state, StateName, State, [{next_event, internal, Alert} | Actions]}
end.
read_application_data(Data, #state{user_application = {_Mon, Pid},
@@ -625,11 +661,6 @@ read_application_data(Data, #state{user_application = {_Mon, Pid},
{stop, normal, State0}
end.
-get_timeout(#state{ssl_options=#ssl_options{hibernate_after = undefined}}) ->
- infinity;
-get_timeout(#state{ssl_options=#ssl_options{hibernate_after = HibernateAfter}}) ->
- HibernateAfter.
-
%% Picks ClientData
get_data(_, _, <<>>) ->
{more, <<>>};
@@ -736,7 +767,7 @@ header(N, Binary) ->
[ByteN | header(N-1, NewBinary)].
send_or_reply(false, _Pid, From, Data) when From =/= undefined ->
- gen_fsm:reply(From, Data);
+ gen_statem:reply(From, Data);
%% Can happen when handling own alert or tcp error/close and there is
%% no outstanding gen_fsm sync events
send_or_reply(false, no_pid, _, _) ->
@@ -747,51 +778,43 @@ send_or_reply(_, Pid, _From, Data) ->
send_user(Pid, Msg) ->
Pid ! Msg.
-handle_tls_handshake(Handle, StateName,
- #state{protocol_buffers =
- #protocol_buffers{tls_packets = [Packet]} = Buffers} = State) ->
- FsmReturn = {next_state, StateName, State#state{protocol_buffers =
- Buffers#protocol_buffers{tls_packets = []}}},
- Handle(Packet, FsmReturn);
-
-handle_tls_handshake(Handle, StateName,
- #state{protocol_buffers =
- #protocol_buffers{tls_packets = [Packet | Packets]} = Buffers} =
- State0) ->
- FsmReturn = {next_state, StateName, State0#state{protocol_buffers =
- Buffers#protocol_buffers{tls_packets =
- Packets}}},
- case Handle(Packet, FsmReturn) of
- {next_state, NextStateName, State, _Timeout} ->
- handle_tls_handshake(Handle, NextStateName, State);
- {next_state, NextStateName, State} ->
- handle_tls_handshake(Handle, NextStateName, State);
- {stop, _,_} = Stop ->
- Stop
- end;
-
-handle_tls_handshake(_Handle, _StateName, #state{}) ->
- throw(?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE)).
+tls_handshake_events(Handle, StateName,
+ #state{protocol_buffers =
+ #protocol_buffers{tls_packets = [Packet]} = Buffers} = State0, Acc) ->
+ {State, Event} = Handle(Packet, {StateName,
+ State0#state{protocol_buffers =
+ Buffers#protocol_buffers{tls_packets = []}}}),
+ {State, lists:reverse([Event |Acc])};
+tls_handshake_events(Handle, StateName,
+ #state{protocol_buffers =
+ #protocol_buffers{tls_packets =
+ [Packet | Packets]} = Buffers} = State0, Acc) ->
+ {State, Event} = Handle(Packet, {StateName, State0#state{protocol_buffers =
+ Buffers#protocol_buffers{tls_packets =
+ Packets}}}),
+ tls_handshake_events(Handle, StateName, State, [Event | Acc]);
+
+tls_handshake_events(_Handle, _, #state{}, _) ->
+ throw(?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE)).
write_application_data(Data0, From,
#state{socket = Socket,
negotiated_version = Version,
transport_cb = Transport,
connection_states = ConnectionStates0,
- send_queue = SendQueue,
socket_options = SockOpts,
ssl_options = #ssl_options{renegotiate_at = RenegotiateAt}} = State) ->
Data = encode_packet(Data0, SockOpts),
case time_to_renegotiate(Data, ConnectionStates0, RenegotiateAt) of
true ->
- renegotiate(State#state{send_queue = queue:in_r({From, Data}, SendQueue),
- renegotiation = {true, internal}});
+ renegotiate(State#state{renegotiation = {true, internal}},
+ [{next_event, {call, From}, {application_data, Data0}}]);
false ->
{Msgs, ConnectionStates} = ssl_record:encode_data(Data, Version, ConnectionStates0),
Result = Transport:send(Socket, Msgs),
- {reply, Result,
- connection, State#state{connection_states = ConnectionStates}, get_timeout(State)}
+ ssl_connection:hibernate_after(connection, State#state{connection_states = ConnectionStates},
+ [{reply, From, Result}])
end.
encode_packet(Data, #socket_options{packet=Packet}) ->
@@ -823,69 +846,73 @@ is_time_to_renegotiate(N, M) when N < M->
false;
is_time_to_renegotiate(_,_) ->
true.
-renegotiate(#state{role = client} = State) ->
+renegotiate(#state{role = client} = State, Actions) ->
%% Handle same way as if server requested
%% the renegotiation
Hs0 = ssl_handshake:init_handshake_history(),
- connection(#hello_request{}, State#state{tls_handshake_history = Hs0});
+ {next_state, connection, State#state{tls_handshake_history = Hs0},
+ [{next_event, internal, #hello_request{}} | Actions]};
+
renegotiate(#state{role = server,
socket = Socket,
transport_cb = Transport,
negotiated_version = Version,
- connection_states = ConnectionStates0} = State0) ->
+ connection_states = ConnectionStates0} = State0, Actions) ->
HelloRequest = ssl_handshake:hello_request(),
Frag = tls_handshake:encode_handshake(HelloRequest, Version),
Hs0 = ssl_handshake:init_handshake_history(),
{BinMsg, ConnectionStates} =
ssl_record:encode_handshake(Frag, Version, ConnectionStates0),
Transport:send(Socket, BinMsg),
- {Record, State} = next_record(State0#state{connection_states =
- ConnectionStates,
- tls_handshake_history = Hs0}),
- next_state(connection, hello, Record, State#state{allow_renegotiate = true}).
+ State1 = State0#state{connection_states =
+ ConnectionStates,
+ tls_handshake_history = Hs0},
+ {Record, State} = next_record(State1),
+ next_event(hello, Record, State, Actions).
handle_alerts([], Result) ->
Result;
-handle_alerts(_, {stop, _, _} = Stop) ->
- %% If it is a fatal alert immediately close
+handle_alerts(_, {stop,_} = Stop) ->
Stop;
-handle_alerts([Alert | Alerts], {next_state, StateName, State, _Timeout}) ->
- handle_alerts(Alerts, handle_alert(Alert, StateName, State)).
-
+handle_alerts([Alert | Alerts], {next_state, StateName, State}) ->
+ handle_alerts(Alerts, handle_alert(Alert, StateName, State));
+handle_alerts([Alert | Alerts], {next_state, StateName, State, _Actions}) ->
+ handle_alerts(Alerts, handle_alert(Alert, StateName, State)).
handle_alert(#alert{level = ?FATAL} = Alert, StateName,
#state{socket = Socket, transport_cb = Transport,
ssl_options = SslOpts, start_or_recv_from = From, host = Host,
port = Port, session = Session, user_application = {_Mon, Pid},
- role = Role, socket_options = Opts, tracker = Tracker} = State) ->
+ role = Role, socket_options = Opts, tracker = Tracker}) ->
invalidate_session(Role, Host, Port, Session),
log_alert(SslOpts#ssl_options.log_alert, StateName, Alert),
alert_user(Transport, Tracker, Socket, StateName, Opts, Pid, From, Alert, Role),
- {stop, normal, State};
+ {stop, normal};
handle_alert(#alert{level = ?WARNING, description = ?CLOSE_NOTIFY} = Alert,
StateName, State) ->
handle_normal_shutdown(Alert, StateName, State),
- {stop, {shutdown, peer_close}, State};
+ {stop, {shutdown, peer_close}};
handle_alert(#alert{level = ?WARNING, description = ?NO_RENEGOTIATION} = Alert, StateName,
#state{ssl_options = SslOpts, renegotiation = {true, internal}} = State) ->
log_alert(SslOpts#ssl_options.log_alert, StateName, Alert),
handle_normal_shutdown(Alert, StateName, State),
- {stop, {shutdown, peer_close}, State};
+ {stop, {shutdown, peer_close}};
handle_alert(#alert{level = ?WARNING, description = ?NO_RENEGOTIATION} = Alert, StateName,
#state{ssl_options = SslOpts, renegotiation = {true, From}} = State0) ->
log_alert(SslOpts#ssl_options.log_alert, StateName, Alert),
- gen_fsm:reply(From, {error, renegotiation_rejected}),
+ gen_statem:reply(From, {error, renegotiation_rejected}),
{Record, State} = next_record(State0),
- next_state(StateName, connection, Record, State);
+ %% Go back to connection!
+ next_event(connection, Record, State);
%% Gracefully log and ignore all other warning alerts
handle_alert(#alert{level = ?WARNING} = Alert, StateName,
#state{ssl_options = SslOpts} = State0) ->
log_alert(SslOpts#ssl_options.log_alert, StateName, Alert),
{Record, State} = next_record(State0),
- next_state(StateName, StateName, Record, State).
+ next_event(StateName, Record, State).
alert_user(Transport, Tracker, Socket, connection, Opts, Pid, From, Alert, Role) ->
alert_user(Transport, Tracker, Socket, Opts#socket_options.active, Pid, From, Alert, Role);
@@ -937,7 +964,7 @@ handle_own_alert(Alert, Version, StateName,
catch _:_ ->
ok
end,
- {stop, {shutdown, own_alert}, State}.
+ {stop, {shutdown, own_alert}}.
handle_normal_shutdown(Alert, _, #state{socket = Socket,
transport_cb = Transport,
@@ -954,11 +981,6 @@ handle_normal_shutdown(Alert, StateName, #state{socket = Socket,
start_or_recv_from = RecvFrom, role = Role}) ->
alert_user(Transport, Tracker, Socket, StateName, Opts, Pid, RecvFrom, Alert, Role).
-handle_unexpected_message(Msg, Info, #state{negotiated_version = Version} = State) ->
- Alert = ?ALERT_REC(?FATAL,?UNEXPECTED_MESSAGE),
- handle_own_alert(Alert, Version, {Info, Msg}, State).
-
-
handle_close_alert(Data, StateName, State0) ->
case next_tls_record(Data, State0) of
{#ssl_tls{type = ?ALERT, fragment = EncAlerts}, State} ->
@@ -979,27 +1001,6 @@ invalidate_session(client, Host, Port, Session) ->
invalidate_session(server, _, Port, Session) ->
ssl_manager:invalidate_session(Port, Session).
-%% User downgrades connection
-%% When downgrading an TLS connection to a transport connection
-%% we must recive the close message before releasing the
-%% transport socket.
-close({close, {Pid, Timeout}}, Socket, Transport, ConnectionStates, Check) when is_pid(Pid) ->
- ssl_socket:setopts(Transport, Socket, [{active, false}, {packet, ssl_tls}]),
- case Transport:recv(Socket, 0, Timeout) of
- {ok, {ssl_tls, Socket, ?ALERT, Version, Fragment}} ->
- case tls_record:decode_cipher_text(#ssl_tls{type = ?ALERT,
- version = Version,
- fragment = Fragment
- }, ConnectionStates, Check) of
- {#ssl_tls{fragment = Plain}, _} ->
- [Alert| _] = decode_alerts(Plain),
- downgrade(Alert, Transport, Socket, Pid)
- end;
- {error, timeout} ->
- {error, timeout};
- _ ->
- {error, no_tls_close}
- end;
%% User closes or recursive call!
close({close, Timeout}, Socket, Transport = gen_tcp, _,_) ->
ssl_socket:setopts(Transport, Socket, [{active, false}]),
@@ -1020,15 +1021,11 @@ close({shutdown, own_alert}, Socket, Transport = gen_tcp, ConnectionStates, Chec
%% with the network but we want to maximise the odds that
%% peer application gets all data sent on the tcp connection.
close({close, ?DEFAULT_TIMEOUT}, Socket, Transport, ConnectionStates, Check);
+close(downgrade, _,_,_,_) ->
+ ok;
%% Other
close(_, Socket, Transport, _,_) ->
Transport:close(Socket).
-downgrade(#alert{description = ?CLOSE_NOTIFY}, Transport, Socket, Pid) ->
- ssl_socket:setopts(Transport, Socket, [{active, false}, {packet, 0}, {mode, binary}]),
- Transport:controlling_process(Socket, Pid),
- {ok, Socket};
-downgrade(_, _,_,_) ->
- {error, no_tls_close}.
convert_state(#state{ssl_options = Options} = State, up, "5.3.5", "5.3.6") ->
State#state{ssl_options = convert_options_partial_chain(Options, up)};
diff --git a/lib/ssl/src/tls_connection.hrl b/lib/ssl/src/tls_connection.hrl
index 3a416401d8..0af2258932 100644
--- a/lib/ssl/src/tls_connection.hrl
+++ b/lib/ssl/src/tls_connection.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/tls_connection_sup.erl b/lib/ssl/src/tls_connection_sup.erl
index 34579a8803..d5b228dc94 100644
--- a/lib/ssl/src/tls_connection_sup.erl
+++ b/lib/ssl/src/tls_connection_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/tls_handshake.erl b/lib/ssl/src/tls_handshake.erl
index 0a6cb9f92d..102dbba198 100644
--- a/lib/ssl/src/tls_handshake.erl
+++ b/lib/ssl/src/tls_handshake.erl
@@ -56,7 +56,7 @@ client_hello(Host, Port, ConnectionStates,
Version = tls_record:highest_protocol_version(Versions),
Pending = ssl_record:pending_connection_state(ConnectionStates, read),
SecParams = Pending#connection_state.security_parameters,
- AvailableCipherSuites = ssl_handshake:available_suites(UserSuites, Version),
+ AvailableCipherSuites = ssl_handshake:available_suites(UserSuites, Version),
Extensions = ssl_handshake:client_hello_extensions(Host, Version,
AvailableCipherSuites,
SslOpts, ConnectionStates, Renegotiation),
@@ -80,13 +80,13 @@ client_hello(Host, Port, ConnectionStates,
-spec hello(#server_hello{} | #client_hello{}, #ssl_options{},
#connection_states{} | {inet:port_number(), #session{}, db_handle(),
atom(), #connection_states{},
- binary() | undefined},
+ binary() | undefined, ssl_cipher:key_algo()},
boolean()) ->
{tls_record:tls_version(), session_id(),
#connection_states{}, alpn | npn, binary() | undefined}|
{tls_record:tls_version(), {resumed | new, #session{}},
#connection_states{}, binary() | undefined,
- #hello_extensions{}} |
+ #hello_extensions{}, {ssl_cipher:hash(), ssl_cipher:sign_algo()} | undefined} |
#alert{}.
%%
%% Description: Handles a recieved hello message
@@ -149,26 +149,35 @@ get_tls_handshake(Version, Data, Buffer) ->
%%% Internal functions
%%--------------------------------------------------------------------
handle_client_hello(Version, #client_hello{session_id = SugesstedId,
- cipher_suites = CipherSuites,
- compression_methods = Compressions,
- random = Random,
- extensions = #hello_extensions{elliptic_curves = Curves} = HelloExt},
- #ssl_options{versions = Versions} = SslOpts,
- {Port, Session0, Cache, CacheCb, ConnectionStates0, Cert}, Renegotiation) ->
+ cipher_suites = CipherSuites,
+ compression_methods = Compressions,
+ random = Random,
+ extensions = #hello_extensions{elliptic_curves = Curves,
+ signature_algs = ClientHashSigns} = HelloExt},
+ #ssl_options{versions = Versions,
+ signature_algs = SupportedHashSigns} = SslOpts,
+ {Port, Session0, Cache, CacheCb, ConnectionStates0, Cert, _}, Renegotiation) ->
case tls_record:is_acceptable_version(Version, Versions) of
true ->
+ AvailableHashSigns = available_signature_algs(ClientHashSigns, SupportedHashSigns, Cert, Version),
ECCCurve = ssl_handshake:select_curve(Curves, ssl_handshake:supported_ecc(Version)),
{Type, #session{cipher_suite = CipherSuite} = Session1}
- = ssl_handshake:select_session(SugesstedId, CipherSuites, Compressions,
+ = ssl_handshake:select_session(SugesstedId, CipherSuites, AvailableHashSigns, Compressions,
Port, Session0#session{ecc = ECCCurve}, Version,
SslOpts, Cache, CacheCb, Cert),
case CipherSuite of
no_suite ->
?ALERT_REC(?FATAL, ?INSUFFICIENT_SECURITY);
_ ->
- handle_client_hello_extensions(Version, Type, Random, CipherSuites, HelloExt,
- SslOpts, Session1, ConnectionStates0,
- Renegotiation)
+ {KeyExAlg,_,_,_} = ssl_cipher:suite_definition(CipherSuite),
+ case ssl_handshake:select_hashsign(ClientHashSigns, Cert, KeyExAlg, SupportedHashSigns, Version) of
+ #alert{} = Alert ->
+ Alert;
+ HashSign ->
+ handle_client_hello_extensions(Version, Type, Random, CipherSuites, HelloExt,
+ SslOpts, Session1, ConnectionStates0,
+ Renegotiation, HashSign)
+ end
end;
false ->
?ALERT_REC(?FATAL, ?PROTOCOL_VERSION)
@@ -245,14 +254,14 @@ enc_handshake(HandshakeMsg, Version) ->
handle_client_hello_extensions(Version, Type, Random, CipherSuites,
- HelloExt, SslOpts, Session0, ConnectionStates0, Renegotiation) ->
+ HelloExt, SslOpts, Session0, ConnectionStates0, Renegotiation, HashSign) ->
try ssl_handshake:handle_client_hello_extensions(tls_record, Random, CipherSuites,
HelloExt, Version, SslOpts,
Session0, ConnectionStates0, Renegotiation) of
#alert{} = Alert ->
Alert;
{Session, ConnectionStates, Protocol, ServerHelloExt} ->
- {Version, {Type, Session}, ConnectionStates, Protocol, ServerHelloExt}
+ {Version, {Type, Session}, ConnectionStates, Protocol, ServerHelloExt, HashSign}
catch throw:Alert ->
Alert
end.
@@ -269,3 +278,13 @@ handle_server_hello_extensions(Version, SessionId, Random, CipherSuite,
{Version, SessionId, ConnectionStates, ProtoExt, Protocol}
end.
+available_signature_algs(undefined, SupportedHashSigns, _, {Major, Minor}) when
+ (Major >= 3) andalso (Minor >= 3) ->
+ SupportedHashSigns;
+available_signature_algs(#hash_sign_algos{hash_sign_algos = ClientHashSigns}, SupportedHashSigns,
+ _, {Major, Minor}) when (Major >= 3) andalso (Minor >= 3) ->
+ ordsets:intersection(ClientHashSigns, SupportedHashSigns);
+available_signature_algs(_, _, _, _) ->
+ undefined.
+
+
diff --git a/lib/ssl/src/tls_handshake.hrl b/lib/ssl/src/tls_handshake.hrl
index 5867f9f9ff..f6644f64af 100644
--- a/lib/ssl/src/tls_handshake.hrl
+++ b/lib/ssl/src/tls_handshake.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/tls_record.hrl b/lib/ssl/src/tls_record.hrl
index 3c5cdd3f7a..e296f23673 100644
--- a/lib/ssl/src/tls_record.hrl
+++ b/lib/ssl/src/tls_record.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/src/tls_v1.erl b/lib/ssl/src/tls_v1.erl
index 09e378cfeb..711db77708 100644
--- a/lib/ssl/src/tls_v1.erl
+++ b/lib/ssl/src/tls_v1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -31,7 +31,8 @@
-export([master_secret/4, finished/5, certificate_verify/3, mac_hash/7,
setup_keys/8, suites/1, prf/5,
- ecc_curves/1, oid_to_enum/1, enum_to_oid/1]).
+ ecc_curves/1, oid_to_enum/1, enum_to_oid/1,
+ default_signature_algs/1, signature_algs/2]).
%%====================================================================
%% Internal application API
@@ -256,6 +257,52 @@ suites(3) ->
] ++ suites(2).
+
+signature_algs({3, 3}, HashSigns) ->
+ CryptoSupports = crypto:supports(),
+ Hashes = proplists:get_value(hashs, CryptoSupports),
+ PubKeys = proplists:get_value(public_keys, CryptoSupports),
+ Supported = lists:foldl(fun({Hash, dsa = Sign} = Alg, Acc) ->
+ case proplists:get_bool(dss, PubKeys)
+ andalso proplists:get_bool(Hash, Hashes)
+ andalso is_pair(Hash, Sign, Hashes)
+ of
+ true ->
+ [Alg | Acc];
+ false ->
+ Acc
+ end;
+ ({Hash, Sign} = Alg, Acc) ->
+ case proplists:get_bool(Sign, PubKeys)
+ andalso proplists:get_bool(Hash, Hashes)
+ andalso is_pair(Hash, Sign, Hashes)
+ of
+ true ->
+ [Alg | Acc];
+ false ->
+ Acc
+ end
+ end, [], HashSigns),
+ lists:reverse(Supported).
+
+default_signature_algs({3, 3} = Version) ->
+ Default = [%% SHA2
+ {sha512, ecdsa},
+ {sha512, rsa},
+ {sha384, ecdsa},
+ {sha384, rsa},
+ {sha256, ecdsa},
+ {sha256, rsa},
+ {sha224, ecdsa},
+ {sha224, rsa},
+ %% SHA
+ {sha, ecdsa},
+ {sha, rsa},
+ {sha, dsa}],
+ signature_algs(Version, Default);
+default_signature_algs(_) ->
+ undefined.
+
%%--------------------------------------------------------------------
%%% Internal functions
%%--------------------------------------------------------------------
@@ -340,6 +387,17 @@ finished_label(client) ->
finished_label(server) ->
<<"server finished">>.
+is_pair(sha, dsa, _) ->
+ true;
+is_pair(_, dsa, _) ->
+ false;
+is_pair(Hash, ecdsa, Hashs) ->
+ AtLeastSha = Hashs -- [md2,md4,md5],
+ lists:member(Hash, AtLeastSha);
+is_pair(Hash, rsa, Hashs) ->
+ AtLeastMd5 = Hashs -- [md2,md4],
+ lists:member(Hash, AtLeastMd5).
+
%% list ECC curves in prefered order
ecc_curves(_Minor) ->
TLSCurves = [sect571r1,sect571k1,secp521r1,brainpoolP512r1,
diff --git a/lib/ssl/test/Makefile b/lib/ssl/test/Makefile
index 89a62c3a4b..a2eb4ce449 100644
--- a/lib/ssl/test/Makefile
+++ b/lib/ssl/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2015. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ssl/test/erl_make_certs.erl b/lib/ssl/test/erl_make_certs.erl
index f5cada9021..a6657be995 100644
--- a/lib/ssl/test/erl_make_certs.erl
+++ b/lib/ssl/test/erl_make_certs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/test/ssl_ECC_SUITE.erl b/lib/ssl/test/ssl_ECC_SUITE.erl
index 75b639b23b..4260cb910b 100644
--- a/lib/ssl/test/ssl_ECC_SUITE.erl
+++ b/lib/ssl/test/ssl_ECC_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl
index 847a9f19de..9341d2cae7 100644
--- a/lib/ssl/test/ssl_basic_SUITE.erl
+++ b/lib/ssl/test/ssl_basic_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -58,7 +58,7 @@ all() ->
groups() ->
[{basic, [], basic_tests()},
{options, [], options_tests()},
- {'tlsv1.2', [], all_versions_groups()},
+ {'tlsv1.2', [], all_versions_groups() ++ [conf_signature_algs, no_common_signature_algs]},
{'tlsv1.1', [], all_versions_groups()},
{'tlsv1', [], all_versions_groups() ++ rizzo_tests()},
{'sslv3', [], all_versions_groups() ++ rizzo_tests() ++ [ciphersuite_vs_version]},
@@ -88,7 +88,8 @@ basic_tests() ->
connect_dist,
clear_pem_cache,
defaults,
- fallback
+ fallback,
+ cipher_format
].
options_tests() ->
@@ -144,7 +145,8 @@ api_tests() ->
versions_option,
server_name_indication_option,
accept_pool,
- new_options_in_accept
+ new_options_in_accept,
+ prf
].
session_tests() ->
@@ -168,6 +170,7 @@ renegotiate_tests() ->
cipher_tests() ->
[cipher_suites,
+ cipher_suites_mix,
ciphers_rsa_signed_certs,
ciphers_rsa_signed_certs_openssl_names,
ciphers_dsa_signed_certs,
@@ -324,6 +327,31 @@ init_per_testcase(rizzo, Config) ->
ct:log("TLS/SSL version ~p~n ", [tls_record:supported_protocol_versions()]),
ct:timetrap({seconds, 40}),
Config;
+init_per_testcase(prf, Config) ->
+ ct:log("TLS/SSL version ~p~n ", [tls_record:supported_protocol_versions()]),
+ ct:timetrap({seconds, 40}),
+ case ?config(tc_group_path, Config) of
+ [] -> Prop = [];
+ [Prop] -> Prop
+ end,
+ case ?config(name, Prop) of
+ undefined -> TlsVersions = [sslv3, tlsv1, 'tlsv1.1', 'tlsv1.2'];
+ TlsVersion when is_atom(TlsVersion) ->
+ TlsVersions = [TlsVersion]
+ end,
+ PRFS=[md5, sha, sha256, sha384, sha512],
+ %All are the result of running tls_v1:prf(PrfAlgo, <<>>, <<>>, <<>>, 16)
+ %with the specified PRF algorithm
+ ExpectedPrfResults=
+ [{md5, <<96,139,180,171,236,210,13,10,28,32,2,23,88,224,235,199>>},
+ {sha, <<95,3,183,114,33,169,197,187,231,243,19,242,220,228,70,151>>},
+ {sha256, <<166,249,145,171,43,95,158,232,6,60,17,90,183,180,0,155>>},
+ {sha384, <<153,182,217,96,186,130,105,85,65,103,123,247,146,91,47,106>>},
+ {sha512, <<145,8,98,38,243,96,42,94,163,33,53,49,241,4,127,28>>},
+ %TLS 1.0 and 1.1 PRF:
+ {md5sha, <<63,136,3,217,205,123,200,177,251,211,17,229,132,4,173,80>>}],
+ TestPlan = prf_create_plan(TlsVersions, PRFS, ExpectedPrfResults),
+ [{prf_test_plan, TestPlan} | Config];
init_per_testcase(TestCase, Config) when TestCase == ssl_accept_timeout;
TestCase == client_closes_socket;
@@ -429,6 +457,25 @@ new_options_in_accept(Config) when is_list(Config) ->
ssl_test_lib:close(Server),
ssl_test_lib:close(Client).
%%--------------------------------------------------------------------
+prf() ->
+ [{doc,"Test that ssl:prf/5 uses the negotiated PRF."}].
+prf(Config) when is_list(Config) ->
+ TestPlan = ?config(prf_test_plan, Config),
+ case TestPlan of
+ [] -> ct:fail({error, empty_prf_test_plan});
+ _ -> lists:foreach(fun(Suite) ->
+ lists:foreach(
+ fun(Test) ->
+ V = ?config(tls_ver, Test),
+ C = ?config(ciphers, Test),
+ E = ?config(expected, Test),
+ P = ?config(prf, Test),
+ prf_run_test(Config, V, C, E, P)
+ end, Suite)
+ end, TestPlan)
+ end.
+
+%%--------------------------------------------------------------------
connection_info() ->
[{doc,"Test the API function ssl:connection_information/1"}].
@@ -718,21 +765,27 @@ clear_pem_cache(Config) when is_list(Config) ->
State = ssl_test_lib:state(Prop),
[_,FilRefDb |_] = element(6, State),
{Server, Client} = basic_verify_test_no_close(Config),
- 2 = ets:info(FilRefDb, size),
+ CountReferencedFiles = fun({_,-1}, Acc) ->
+ Acc;
+ ({_, N}, Acc) ->
+ N + Acc
+ end,
+
+ 2 = ets:foldl(CountReferencedFiles, 0, FilRefDb),
ssl:clear_pem_cache(),
_ = sys:get_status(whereis(ssl_manager)),
{Server1, Client1} = basic_verify_test_no_close(Config),
- 4 = ets:info(FilRefDb, size),
+ 4 = ets:foldl(CountReferencedFiles, 0, FilRefDb),
ssl_test_lib:close(Server),
ssl_test_lib:close(Client),
- ct:sleep(5000),
+ ct:sleep(2000),
_ = sys:get_status(whereis(ssl_manager)),
- 2 = ets:info(FilRefDb, size),
+ 2 = ets:foldl(CountReferencedFiles, 0, FilRefDb),
ssl_test_lib:close(Server1),
ssl_test_lib:close(Client1),
- ct:sleep(5000),
+ ct:sleep(2000),
_ = sys:get_status(whereis(ssl_manager)),
- 0 = ets:info(FilRefDb, size).
+ 0 = ets:foldl(CountReferencedFiles, 0, FilRefDb).
%%--------------------------------------------------------------------
@@ -763,6 +816,14 @@ fallback(Config) when is_list(Config) ->
Client, {error,{tls_alert,"inappropriate fallback"}}).
%%--------------------------------------------------------------------
+cipher_format() ->
+ [{doc, "Test that cipher conversion from tuples to binarys works"}].
+cipher_format(Config) when is_list(Config) ->
+ {ok, Socket} = ssl:listen(0, [{ciphers, ssl:cipher_suites()}]),
+ ssl:close(Socket).
+
+%%--------------------------------------------------------------------
+
peername() ->
[{doc,"Test API function peername/1"}].
@@ -913,6 +974,31 @@ cipher_suites(Config) when is_list(Config) ->
[_|_] =ssl:cipher_suites(openssl).
%%--------------------------------------------------------------------
+cipher_suites_mix() ->
+ [{doc,"Test to have old and new cipher suites at the same time"}].
+
+cipher_suites_mix(Config) when is_list(Config) ->
+ CipherSuites = [{ecdh_rsa,aes_128_cbc,sha256,sha256}, {rsa,aes_128_cbc,sha}],
+ 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, {ssl_test_lib, 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, {ssl_test_lib, send_recv_result_active, []}},
+ {options, [{ciphers, CipherSuites} | ClientOpts]}]),
+
+ ssl_test_lib:check_result(Server, ok, Client, ok),
+ ssl_test_lib:close(Server),
+ ssl_test_lib:close(Client).
+%%--------------------------------------------------------------------
socket_options() ->
[{doc,"Test API function getopts/2 and setopts/2"}].
@@ -1555,7 +1641,7 @@ tcp_connect_big(Config) when is_list(Config) ->
{_, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
TcpOpts = [binary, {reuseaddr, true}],
- Rand = crypto:rand_bytes(?MAX_CIPHER_TEXT_LENGTH+1),
+ Rand = crypto:strong_rand_bytes(?MAX_CIPHER_TEXT_LENGTH+1),
Server = ssl_test_lib:start_upgrade_server_error([{node, ServerNode}, {port, 0},
{from, self()},
{timeout, 5000},
@@ -2530,6 +2616,13 @@ der_input(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
DHParamFile = filename:join(DataDir, "dHParam.pem"),
+ {status, _, _, StatusInfo} = sys:get_status(whereis(ssl_manager)),
+ [_, _,_, _, Prop] = StatusInfo,
+ State = ssl_test_lib:state(Prop),
+ [CADb | _] = element(6, State),
+
+ Size = ets:info(CADb, size),
+
SeverVerifyOpts = ?config(server_verification_opts, Config),
{ServerCert, ServerKey, ServerCaCerts, DHParams} = der_input_opts([{dhfile, DHParamFile} |
SeverVerifyOpts]),
@@ -2557,13 +2650,8 @@ der_input(Config) when is_list(Config) ->
ssl_test_lib:check_result(Server, ok, Client, ok),
ssl_test_lib:close(Server),
ssl_test_lib:close(Client),
+ Size = ets:info(CADb, size).
- {status, _, _, StatusInfo} = sys:get_status(whereis(ssl_manager)),
- [_, _,_, _, Prop] = StatusInfo,
- State = ssl_test_lib:state(Prop),
- [CADb | _] = element(6, State),
- [] = ets:tab2list(CADb).
-
%%--------------------------------------------------------------------
der_input_opts(Opts) ->
Certfile = proplists:get_value(certfile, Opts),
@@ -2900,7 +2988,61 @@ ciphersuite_vs_version(Config) when is_list(Config) ->
_ ->
ct:fail({unexpected_server_hello, ServerHello})
end.
-
+
+%%--------------------------------------------------------------------
+conf_signature_algs() ->
+ [{doc,"Test to set the signature_algs option on both client and server"}].
+conf_signature_algs(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, {ssl_test_lib, send_recv_result, []}},
+ {options, [{active, false}, {signature_algs, [{sha256, rsa}]} | ServerOpts]}]),
+ Port = ssl_test_lib:inet_port(Server),
+ Client =
+ ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
+ {host, Hostname},
+ {from, self()},
+ {mfa, {ssl_test_lib, send_recv_result, []}},
+ {options, [{active, false}, {signature_algs, [{sha256, rsa}]} | ClientOpts]}]),
+
+ ct:log("Testcase ~p, Client ~p Server ~p ~n",
+ [self(), Client, Server]),
+
+ ssl_test_lib:check_result(Server, ok, Client, ok),
+
+ ssl_test_lib:close(Server),
+ ssl_test_lib:close(Client).
+
+
+%%--------------------------------------------------------------------
+no_common_signature_algs() ->
+ [{doc,"Set the signature_algs option so that there client and server does not share any hash sign algorithms"}].
+no_common_signature_algs(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()},
+ {options, [{signature_algs, [{sha256, rsa}]}
+ | ServerOpts]}]),
+ Port = ssl_test_lib:inet_port(Server),
+ Client = ssl_test_lib:start_client_error([{node, ClientNode}, {port, Port},
+ {host, Hostname},
+ {from, self()},
+ {options, [{signature_algs, [{sha384, rsa}]}
+ | ClientOpts]}]),
+
+ ssl_test_lib:check_result(Server, {error, {tls_alert, "insufficient security"}},
+ Client, {error, {tls_alert, "insufficient security"}}).
+
%%--------------------------------------------------------------------
dont_crash_on_handshake_garbage() ->
@@ -2971,6 +3113,7 @@ hibernate(Config) ->
{current_function, _} =
process_info(Pid, current_function),
+ ssl_test_lib:check_result(Server, ok, Client, ok),
timer:sleep(1100),
{current_function, {erlang, hibernate, 3}} =
@@ -3004,15 +3147,29 @@ hibernate_right_away(Config) ->
Server1 = ssl_test_lib:start_server(StartServerOpts),
Port1 = ssl_test_lib:inet_port(Server1),
- {Client1, #sslsocket{}} = ssl_test_lib:start_client(StartClientOpts ++
+ {Client1, #sslsocket{pid = Pid1}} = ssl_test_lib:start_client(StartClientOpts ++
[{port, Port1}, {options, [{hibernate_after, 0}|ClientOpts]}]),
+
+ ssl_test_lib:check_result(Server1, ok, Client1, ok),
+
+ {current_function, {erlang, hibernate, 3}} =
+ process_info(Pid1, current_function),
+
ssl_test_lib:close(Server1),
ssl_test_lib:close(Client1),
Server2 = ssl_test_lib:start_server(StartServerOpts),
Port2 = ssl_test_lib:inet_port(Server2),
- {Client2, #sslsocket{}} = ssl_test_lib:start_client(StartClientOpts ++
+ {Client2, #sslsocket{pid = Pid2}} = ssl_test_lib:start_client(StartClientOpts ++
[{port, Port2}, {options, [{hibernate_after, 1}|ClientOpts]}]),
+
+ ssl_test_lib:check_result(Server2, ok, Client2, ok),
+
+ ct:sleep(100), %% Schedule out
+
+ {current_function, {erlang, hibernate, 3}} =
+ process_info(Pid2, current_function),
+
ssl_test_lib:close(Server2),
ssl_test_lib:close(Client2).
@@ -3597,6 +3754,81 @@ basic_test(Config) ->
ssl_test_lib:close(Server),
ssl_test_lib:close(Client).
+prf_create_plan(TlsVersions, PRFs, Results) ->
+ lists:foldl(fun(Ver, Acc) ->
+ A = prf_ciphers_and_expected(Ver, PRFs, Results),
+ [A|Acc]
+ end, [], TlsVersions).
+prf_ciphers_and_expected(TlsVer, PRFs, Results) ->
+ case TlsVer of
+ TlsVer when TlsVer == sslv3 orelse TlsVer == tlsv1
+ orelse TlsVer == 'tlsv1.1' ->
+ Ciphers = ssl:cipher_suites(),
+ {_, Expected} = lists:keyfind(md5sha, 1, Results),
+ [[{tls_ver, TlsVer}, {ciphers, Ciphers}, {expected, Expected}, {prf, md5sha}]];
+ 'tlsv1.2' ->
+ lists:foldl(
+ fun(PRF, Acc) ->
+ Ciphers = prf_get_ciphers(TlsVer, PRF),
+ case Ciphers of
+ [] ->
+ ct:log("No ciphers for PRF algorithm ~p. Skipping.", [PRF]),
+ Acc;
+ Ciphers ->
+ {_, Expected} = lists:keyfind(PRF, 1, Results),
+ [[{tls_ver, TlsVer}, {ciphers, Ciphers}, {expected, Expected},
+ {prf, PRF}] | Acc]
+ end
+ end, [], PRFs)
+ end.
+prf_get_ciphers(TlsVer, PRF) ->
+ case TlsVer of
+ 'tlsv1.2' ->
+ lists:filter(
+ fun(C) when tuple_size(C) == 4 andalso
+ element(4, C) == PRF ->
+ true;
+ (_) -> false
+ end, ssl:cipher_suites())
+ end.
+prf_run_test(_, TlsVer, [], _, Prf) ->
+ ct:fail({error, cipher_list_empty, TlsVer, Prf});
+prf_run_test(Config, TlsVer, Ciphers, Expected, Prf) ->
+ {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+ BaseOpts = [{active, true}, {versions, [TlsVer]}, {ciphers, Ciphers}],
+ ServerOpts = BaseOpts ++ ?config(server_opts, Config),
+ ClientOpts = BaseOpts ++ ?config(client_opts, Config),
+ Server = ssl_test_lib:start_server(
+ [{node, ServerNode}, {port, 0}, {from, self()},
+ {mfa, {?MODULE, prf_verify_value, [TlsVer, Expected, Prf]}},
+ {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, prf_verify_value, [TlsVer, Expected, Prf]}},
+ {options, ClientOpts}]),
+ ssl_test_lib:check_result(Server, ok, Client, ok),
+ ssl_test_lib:close(Server),
+ ssl_test_lib:close(Client).
+prf_verify_value(Socket, TlsVer, Expected, Algo) ->
+ Ret = ssl:prf(Socket, <<>>, <<>>, [<<>>], 16),
+ case TlsVer of
+ sslv3 ->
+ case Ret of
+ {error, undefined} -> ok;
+ _ ->
+ {error, {expected, {error, undefined},
+ got, Ret, tls_ver, TlsVer, prf_algorithm, Algo}}
+ end;
+ _ ->
+ case Ret of
+ {ok, Expected} -> ok;
+ {ok, Val} -> {error, {expected, Expected, got, Val, tls_ver, TlsVer,
+ prf_algorithm, Algo}}
+ end
+ end.
+
send_recv_result_timeout_client(Socket) ->
{error, timeout} = ssl:recv(Socket, 11, 500),
ssl:send(Socket, "Hello world"),
@@ -4096,7 +4328,7 @@ connection_information_result(Socket) ->
{ok, Info = [_ | _]} = ssl:connection_information(Socket),
case length(Info) > 3 of
true ->
- %% Atleast one ssloption() is set
+ %% Atleast one ssl_option() is set
ct:log("Info ~p", [Info]),
ok;
false ->
diff --git a/lib/ssl/test/ssl_bench_SUITE.erl b/lib/ssl/test/ssl_bench_SUITE.erl
index 953356c87c..ed439a425f 100644
--- a/lib/ssl/test/ssl_bench_SUITE.erl
+++ b/lib/ssl/test/ssl_bench_SUITE.erl
@@ -1,7 +1,7 @@
%%%-------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/test/ssl_certificate_verify_SUITE.erl b/lib/ssl/test/ssl_certificate_verify_SUITE.erl
index d10506cb69..49c0b9c5a1 100644
--- a/lib/ssl/test/ssl_certificate_verify_SUITE.erl
+++ b/lib/ssl/test/ssl_certificate_verify_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -52,8 +52,8 @@ groups() ->
{error_handling, [],error_handling_tests()}].
tests() ->
- [server_verify_peer,
- server_verify_none,
+ [verify_peer,
+ verify_none,
server_require_peer_cert_ok,
server_require_peer_cert_fail,
server_require_peer_cert_partial_chain,
@@ -110,6 +110,17 @@ init_per_group(_, Config) ->
end_per_group(_GroupName, Config) ->
Config.
+init_per_testcase(TestCase, Config) when TestCase == cert_expired;
+ TestCase == invalid_signature_client;
+ TestCase == invalid_signature_server;
+ TestCase == extended_key_usage_verify_none;
+ TestCase == extended_key_usage_verify_peer;
+ TestCase == critical_extension_verify_none;
+ TestCase == critical_extension_verify_peer;
+ TestCase == no_authority_key_identifier;
+ TestCase == no_authority_key_identifier_and_nonstandard_encoding->
+ ssl:clear_pem_cache(),
+ init_per_testcase(common, Config);
init_per_testcase(_TestCase, Config) ->
ct:log("TLS/SSL version ~p~n ", [tls_record:supported_protocol_versions()]),
ct:timetrap({seconds, 5}),
@@ -122,9 +133,9 @@ end_per_testcase(_TestCase, Config) ->
%% Test Cases --------------------------------------------------------
%%--------------------------------------------------------------------
-server_verify_peer() ->
- [{doc,"Test server option verify_peer"}].
-server_verify_peer(Config) when is_list(Config) ->
+verify_peer() ->
+ [{doc,"Test option verify_peer"}].
+verify_peer(Config) when is_list(Config) ->
ClientOpts = ?config(client_verification_opts, Config),
ServerOpts = ?config(server_verification_opts, Config),
Active = ?config(active, Config),
@@ -147,10 +158,10 @@ server_verify_peer(Config) when is_list(Config) ->
ssl_test_lib:close(Client).
%%--------------------------------------------------------------------
-server_verify_none() ->
- [{doc,"Test server option verify_none"}].
+verify_none() ->
+ [{doc,"Test option verify_none"}].
-server_verify_none(Config) when is_list(Config) ->
+verify_none(Config) when is_list(Config) ->
ClientOpts = ?config(client_verification_opts, Config),
ServerOpts = ?config(server_verification_opts, Config),
Active = ?config(active, Config),
@@ -220,18 +231,21 @@ server_require_peer_cert_ok(Config) when is_list(Config) ->
ServerOpts = [{verify, verify_peer}, {fail_if_no_peer_cert, true}
| ?config(server_verification_opts, Config)],
ClientOpts = ?config(client_verification_opts, Config),
+ Active = ?config(active, Config),
+ ReceiveFunction = ?config(receive_function, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+
Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
{from, self()},
- {mfa, {ssl_test_lib,send_recv_result, []}},
- {options, [{active, false} | ServerOpts]}]),
+ {mfa, {ssl_test_lib, ReceiveFunction, []}},
+ {options, [{active, Active} | ServerOpts]}]),
Port = ssl_test_lib:inet_port(Server),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
{from, self()},
- {mfa, {ssl_test_lib, send_recv_result, []}},
- {options, [{active, false} | ClientOpts]}]),
+ {mfa, {ssl_test_lib, ReceiveFunction, []}},
+ {options, [{active, Active} | ClientOpts]}]),
ssl_test_lib:check_result(Server, ok, Client, ok),
ssl_test_lib:close(Server),
@@ -313,6 +327,8 @@ server_require_peer_cert_allow_partial_chain(Config) when is_list(Config) ->
| ?config(server_verification_opts, Config)],
ClientOpts = ?config(client_verification_opts, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+ Active = ?config(active, Config),
+ ReceiveFunction = ?config(receive_function, Config),
{ok, ServerCAs} = file:read_file(proplists:get_value(cacertfile, ServerOpts)),
[{_,_,_}, {_, IntermidiateCA, _}] = public_key:pem_decode(ServerCAs),
@@ -328,16 +344,17 @@ server_require_peer_cert_allow_partial_chain(Config) when is_list(Config) ->
Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
{from, self()},
- {mfa, {ssl_test_lib, send_recv_result_active, []}},
- {options, [{cacerts, [IntermidiateCA]},
+ {mfa, {ssl_test_lib, ReceiveFunction, []}},
+ {options, [{active, Active},
+ {cacerts, [IntermidiateCA]},
{partial_chain, PartialChain} |
proplists:delete(cacertfile, ServerOpts)]}]),
Port = ssl_test_lib:inet_port(Server),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
{from, self()},
- {mfa, {ssl_test_lib, send_recv_result_active, []}},
- {options, ClientOpts}]),
+ {mfa, {ssl_test_lib, ReceiveFunction, []}},
+ {options, [{active, Active} | ClientOpts]}]),
ssl_test_lib:check_result(Server, ok, Client, ok),
ssl_test_lib:close(Server),
ssl_test_lib:close(Client).
@@ -522,32 +539,6 @@ verify_fun_always_run_server(Config) when is_list(Config) ->
%%--------------------------------------------------------------------
-client_verify_none_passive() ->
- [{doc,"Test client option verify_none"}].
-
-client_verify_none_passive(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, {ssl_test_lib, send_recv_result, []}},
- {options, [{active, false}
- | ServerOpts]}]),
- Port = ssl_test_lib:inet_port(Server),
-
- Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
- {host, Hostname},
- {from, self()},
- {mfa, {ssl_test_lib, send_recv_result, []}},
- {options, [{active, false},
- {verify, verify_none}
- | ClientOpts]}]),
-
- ssl_test_lib:check_result(Server, ok, Client, ok),
- ssl_test_lib:close(Server),
- ssl_test_lib:close(Client).
-%%--------------------------------------------------------------------
cert_expired() ->
[{doc,"Test server with expired certificate"}].
@@ -616,64 +607,6 @@ two_digits_str(N) ->
lists:flatten(io_lib:format("~p", [N])).
%%--------------------------------------------------------------------
-
-client_verify_none_active() ->
- [{doc,"Test client option verify_none"}].
-
-client_verify_none_active(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, {ssl_test_lib,
- send_recv_result_active, []}},
- {options, [{active, true}
- | ServerOpts]}]),
- Port = ssl_test_lib:inet_port(Server),
- Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
- {host, Hostname},
- {from, self()},
- {mfa, {ssl_test_lib,
- send_recv_result_active, []}},
- {options, [{active, true},
- {verify, verify_none}
- | ClientOpts]}]),
-
- ssl_test_lib:check_result(Server, ok, Client, ok),
- ssl_test_lib:close(Server),
- ssl_test_lib:close(Client).
-
-%%--------------------------------------------------------------------
-client_verify_none_active_once() ->
- [{doc,"Test client option verify_none"}].
-
-client_verify_none_active_once(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, {ssl_test_lib, send_recv_result_active, []}},
- {options, [{active, once} | ServerOpts]}]),
- Port = ssl_test_lib:inet_port(Server),
-
- Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
- {host, Hostname},
- {from, self()},
- {mfa, {ssl_test_lib,
- send_recv_result_active_once,
- []}},
- {options, [{active, once},
- {verify, verify_none}
- | ClientOpts]}]),
-
- ssl_test_lib:check_result(Server, ok, Client, ok),
- ssl_test_lib:close(Server),
- ssl_test_lib:close(Client).
-
-%%--------------------------------------------------------------------
extended_key_usage_verify_peer() ->
[{doc,"Test cert that has a critical extended_key_usage extension in verify_peer mode"}].
diff --git a/lib/ssl/test/ssl_crl_SUITE.erl b/lib/ssl/test/ssl_crl_SUITE.erl
index 5b86027210..291a5f3fde 100644
--- a/lib/ssl/test/ssl_crl_SUITE.erl
+++ b/lib/ssl/test/ssl_crl_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/test/ssl_dist_SUITE.erl b/lib/ssl/test/ssl_dist_SUITE.erl
index 00f9ee8e3c..e7cbfa63f4 100644
--- a/lib/ssl/test/ssl_dist_SUITE.erl
+++ b/lib/ssl/test/ssl_dist_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -194,7 +194,7 @@ payload(Config) when is_list(Config) ->
ok = apply_on_ssl_node(
NH2,
fun () ->
- Msg = crypto:rand_bytes(100000),
+ Msg = crypto:strong_rand_bytes(100000),
SslPid ! {self(), Msg},
receive
{SslPid, Msg} ->
diff --git a/lib/ssl/test/ssl_handshake_SUITE.erl b/lib/ssl/test/ssl_handshake_SUITE.erl
index b0bb77c598..d050812208 100644
--- a/lib/ssl/test/ssl_handshake_SUITE.erl
+++ b/lib/ssl/test/ssl_handshake_SUITE.erl
@@ -166,10 +166,10 @@ ignore_hassign_extension_pre_tls_1_2(Config) ->
CertFile = proplists:get_value(certfile, Opts),
[{_, Cert, _}] = ssl_test_lib:pem_to_der(CertFile),
HashSigns = #hash_sign_algos{hash_sign_algos = [{sha512, rsa}, {sha, dsa}]},
- {sha512, rsa} = ssl_handshake:select_hashsign(HashSigns, Cert, {3,3}),
+ {sha512, rsa} = ssl_handshake:select_hashsign(HashSigns, Cert, ecdhe_rsa, tls_v1:default_signature_algs({3,3}), {3,3}),
%%% Ignore
- {md5sha, rsa} = ssl_handshake:select_hashsign(HashSigns, Cert, {3,2}),
- {md5sha, rsa} = ssl_handshake:select_hashsign(HashSigns, Cert, {3,0}).
+ {md5sha, rsa} = ssl_handshake:select_hashsign(HashSigns, Cert, ecdhe_rsa, tls_v1:default_signature_algs({3,2}), {3,2}),
+ {md5sha, rsa} = ssl_handshake:select_hashsign(HashSigns, Cert, ecdhe_rsa, tls_v1:default_signature_algs({3,0}), {3,0}).
is_supported(Hash) ->
Algos = crypto:supports(),
diff --git a/lib/ssl/test/ssl_npn_handshake_SUITE.erl b/lib/ssl/test/ssl_npn_handshake_SUITE.erl
index 6b71fe6d28..cebbc3c16b 100644
--- a/lib/ssl/test/ssl_npn_handshake_SUITE.erl
+++ b/lib/ssl/test/ssl_npn_handshake_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/test/ssl_npn_hello_SUITE.erl b/lib/ssl/test/ssl_npn_hello_SUITE.erl
index fa7187b6c0..b678187bc8 100644
--- a/lib/ssl/test/ssl_npn_hello_SUITE.erl
+++ b/lib/ssl/test/ssl_npn_hello_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/test/ssl_packet_SUITE.erl b/lib/ssl/test/ssl_packet_SUITE.erl
index 08a66ec07a..e6655fa11b 100644
--- a/lib/ssl/test/ssl_packet_SUITE.erl
+++ b/lib/ssl/test/ssl_packet_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/test/ssl_payload_SUITE.erl b/lib/ssl/test/ssl_payload_SUITE.erl
index fb3890a811..eb06009734 100644
--- a/lib/ssl/test/ssl_payload_SUITE.erl
+++ b/lib/ssl/test/ssl_payload_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/test/ssl_sni_SUITE.erl b/lib/ssl/test/ssl_sni_SUITE.erl
index 90c2a49e61..edbc6bbee4 100644
--- a/lib/ssl/test/ssl_sni_SUITE.erl
+++ b/lib/ssl/test/ssl_sni_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2015-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2015-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl
index b0495cb5ac..38cc3532d8 100644
--- a/lib/ssl/test/ssl_test_lib.erl
+++ b/lib/ssl/test/ssl_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -349,7 +349,7 @@ wait_for_result(Pid, Msg) ->
user_lookup(psk, _Identity, UserState) ->
{ok, UserState};
user_lookup(srp, Username, _UserState) ->
- Salt = ssl:random_bytes(16),
+ Salt = ssl_cipher:random_bytes(16),
UserPassHash = crypto:hash(sha, [Salt, crypto:hash(sha, [Username, <<$:>>, <<"secret">>])]),
{ok, {srp_1024, Salt, UserPassHash}}.
@@ -905,8 +905,8 @@ anonymous_suites() ->
{dh_anon, '3des_ede_cbc', sha},
{dh_anon, aes_128_cbc, sha},
{dh_anon, aes_256_cbc, sha},
- {dh_anon, aes_128_gcm, null},
- {dh_anon, aes_256_gcm, null},
+ {dh_anon, aes_128_gcm, null, sha256},
+ {dh_anon, aes_256_gcm, null, sha384},
{ecdh_anon,rc4_128,sha},
{ecdh_anon,'3des_ede_cbc',sha},
{ecdh_anon,aes_128_cbc,sha},
@@ -933,12 +933,12 @@ psk_suites() ->
{rsa_psk, aes_256_cbc, sha},
{rsa_psk, aes_128_cbc, sha256},
{rsa_psk, aes_256_cbc, sha384},
- {psk, aes_128_gcm, null},
- {psk, aes_256_gcm, null},
- {dhe_psk, aes_128_gcm, null},
- {dhe_psk, aes_256_gcm, null},
- {rsa_psk, aes_128_gcm, null},
- {rsa_psk, aes_256_gcm, null}],
+ {psk, aes_128_gcm, null, sha256},
+ {psk, aes_256_gcm, null, sha384},
+ {dhe_psk, aes_128_gcm, null, sha256},
+ {dhe_psk, aes_256_gcm, null, sha384},
+ {rsa_psk, aes_128_gcm, null, sha256},
+ {rsa_psk, aes_256_gcm, null, sha384}],
ssl_cipher:filter_suites(Suites).
psk_anon_suites() ->
@@ -1041,10 +1041,13 @@ receive_rizzo_duong_beast() ->
end
end.
-state([{data,[{"State", State}]} | _]) ->
- State;
-state([{data,[{"StateData", State}]} | _]) ->
+
+state([{data,[{"State", {_StateName, StateData}}]} | _]) -> %% gen_statem
+ StateData;
+state([{data,[{"State", State}]} | _]) -> %% gen_server
State;
+state([{data,[{"StateData", State}]} | _]) -> %% gen_fsm
+ State;
state([_ | Rest]) ->
state(Rest).
diff --git a/lib/ssl/test/ssl_to_openssl_SUITE.erl b/lib/ssl/test/ssl_to_openssl_SUITE.erl
index 6934d7f851..686d24b044 100644
--- a/lib/ssl/test/ssl_to_openssl_SUITE.erl
+++ b/lib/ssl/test/ssl_to_openssl_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/ssl/vsn.mk b/lib/ssl/vsn.mk
index 47cb2909fb..3b51fa8c6b 100644
--- a/lib/ssl/vsn.mk
+++ b/lib/ssl/vsn.mk
@@ -1 +1 @@
-SSL_VSN = 7.3
+SSL_VSN = 8.0
diff --git a/lib/stdlib/Makefile b/lib/stdlib/Makefile
index 563a2defa2..3086d85445 100644
--- a/lib/stdlib/Makefile
+++ b/lib/stdlib/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/doc/src/Makefile b/lib/stdlib/doc/src/Makefile
index 196c86748f..26602764a6 100644
--- a/lib/stdlib/doc/src/Makefile
+++ b/lib/stdlib/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2015. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -68,6 +68,7 @@ XML_REF3_FILES = \
gen_event.xml \
gen_fsm.xml \
gen_server.xml \
+ gen_statem.xml \
io.xml \
io_lib.xml \
lib.xml \
diff --git a/lib/stdlib/doc/src/array.xml b/lib/stdlib/doc/src/array.xml
index 0f33e2621c..bff98245bf 100644
--- a/lib/stdlib/doc/src/array.xml
+++ b/lib/stdlib/doc/src/array.xml
@@ -3,7 +3,7 @@
<erlref>
<header>
<copyright>
- <year>2007</year><year>2014</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/base64.xml b/lib/stdlib/doc/src/base64.xml
index 276d28e174..7b82d7dd3d 100644
--- a/lib/stdlib/doc/src/base64.xml
+++ b/lib/stdlib/doc/src/base64.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2007</year><year>2013</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/binary.xml b/lib/stdlib/doc/src/binary.xml
index 2682198fe5..933157fc34 100644
--- a/lib/stdlib/doc/src/binary.xml
+++ b/lib/stdlib/doc/src/binary.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2009</year>
- <year>2014</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -366,7 +366,7 @@
<code>
1> binary:matches(&lt;&lt;"abcde"&gt;&gt;,
- [&lt;&lt;"bcde"&gt;&gt;,&lt;&lt;"bc"&gt;&gt;>,&lt;&lt;"de"&gt;&gt;],[]).
+ [&lt;&lt;"bcde"&gt;&gt;,&lt;&lt;"bc"&gt;&gt;,&lt;&lt;"de"&gt;&gt;],[]).
[{1,4}]
</code>
diff --git a/lib/stdlib/doc/src/book.xml b/lib/stdlib/doc/src/book.xml
index 043f6cc19b..84ce3f0788 100644
--- a/lib/stdlib/doc/src/book.xml
+++ b/lib/stdlib/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/c.xml b/lib/stdlib/doc/src/c.xml
index e5238fa7db..9b4a9489c0 100644
--- a/lib/stdlib/doc/src/c.xml
+++ b/lib/stdlib/doc/src/c.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/calendar.xml b/lib/stdlib/doc/src/calendar.xml
index 853184dc0f..38bf55679e 100644
--- a/lib/stdlib/doc/src/calendar.xml
+++ b/lib/stdlib/doc/src/calendar.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/dets.xml b/lib/stdlib/doc/src/dets.xml
index 48400733d1..177c2ba508 100644
--- a/lib/stdlib/doc/src/dets.xml
+++ b/lib/stdlib/doc/src/dets.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/dict.xml b/lib/stdlib/doc/src/dict.xml
index e10531caac..20bab99a9c 100644
--- a/lib/stdlib/doc/src/dict.xml
+++ b/lib/stdlib/doc/src/dict.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/digraph.xml b/lib/stdlib/doc/src/digraph.xml
index 291be6c08b..16dd789caf 100644
--- a/lib/stdlib/doc/src/digraph.xml
+++ b/lib/stdlib/doc/src/digraph.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/digraph_utils.xml b/lib/stdlib/doc/src/digraph_utils.xml
index 639069543c..9bddee546f 100644
--- a/lib/stdlib/doc/src/digraph_utils.xml
+++ b/lib/stdlib/doc/src/digraph_utils.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/epp.xml b/lib/stdlib/doc/src/epp.xml
index 8c901f57ec..0802f0e47c 100644
--- a/lib/stdlib/doc/src/epp.xml
+++ b/lib/stdlib/doc/src/epp.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/erl_eval.xml b/lib/stdlib/doc/src/erl_eval.xml
index ba988e7ca2..d60b04b510 100644
--- a/lib/stdlib/doc/src/erl_eval.xml
+++ b/lib/stdlib/doc/src/erl_eval.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/erl_expand_records.xml b/lib/stdlib/doc/src/erl_expand_records.xml
index 497b371434..93e464c733 100644
--- a/lib/stdlib/doc/src/erl_expand_records.xml
+++ b/lib/stdlib/doc/src/erl_expand_records.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2005</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/erl_id_trans.xml b/lib/stdlib/doc/src/erl_id_trans.xml
index 30eb213493..153bd4148e 100644
--- a/lib/stdlib/doc/src/erl_id_trans.xml
+++ b/lib/stdlib/doc/src/erl_id_trans.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1996</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/erl_internal.xml b/lib/stdlib/doc/src/erl_internal.xml
index e1ee50b424..940f8c5b40 100644
--- a/lib/stdlib/doc/src/erl_internal.xml
+++ b/lib/stdlib/doc/src/erl_internal.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1996</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/erl_lint.xml b/lib/stdlib/doc/src/erl_lint.xml
index 318cb5ac19..3747b0f3c3 100644
--- a/lib/stdlib/doc/src/erl_lint.xml
+++ b/lib/stdlib/doc/src/erl_lint.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/erl_pp.xml b/lib/stdlib/doc/src/erl_pp.xml
index 4b8a571c81..e96fd576ec 100644
--- a/lib/stdlib/doc/src/erl_pp.xml
+++ b/lib/stdlib/doc/src/erl_pp.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1996</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/erl_tar.xml b/lib/stdlib/doc/src/erl_tar.xml
index 898b55df72..1f4a43f622 100644
--- a/lib/stdlib/doc/src/erl_tar.xml
+++ b/lib/stdlib/doc/src/erl_tar.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/ets.xml b/lib/stdlib/doc/src/ets.xml
index 447fe51130..2d69c201bc 100644
--- a/lib/stdlib/doc/src/ets.xml
+++ b/lib/stdlib/doc/src/ets.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -1621,6 +1621,8 @@ true</pre>
if the match_spec does not match the object <c><anno>Tuple</anno></c>.</p>
<p>This is a useful debugging and test tool, especially when
writing complicated <c>ets:select/2</c> calls.</p>
+ <p>See also: <seealso marker="erts:erlang#match_spec_test/3">
+ erlang:match_spec_test/3</seealso>.</p>
</desc>
</func>
<func>
diff --git a/lib/stdlib/doc/src/file_sorter.xml b/lib/stdlib/doc/src/file_sorter.xml
index f033eebec7..bc24f02a99 100644
--- a/lib/stdlib/doc/src/file_sorter.xml
+++ b/lib/stdlib/doc/src/file_sorter.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/filelib.xml b/lib/stdlib/doc/src/filelib.xml
index 2cf9490f4b..3ad159a66d 100644
--- a/lib/stdlib/doc/src/filelib.xml
+++ b/lib/stdlib/doc/src/filelib.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/filename.xml b/lib/stdlib/doc/src/filename.xml
index ce6aba3657..f284a7596c 100644
--- a/lib/stdlib/doc/src/filename.xml
+++ b/lib/stdlib/doc/src/filename.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/gen_event.xml b/lib/stdlib/doc/src/gen_event.xml
index c4bab45781..b2c482d3ed 100644
--- a/lib/stdlib/doc/src/gen_event.xml
+++ b/lib/stdlib/doc/src/gen_event.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/gen_fsm.xml b/lib/stdlib/doc/src/gen_fsm.xml
index 4d594b8eb2..835e252704 100644
--- a/lib/stdlib/doc/src/gen_fsm.xml
+++ b/lib/stdlib/doc/src/gen_fsm.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -31,12 +31,23 @@
<module>gen_fsm</module>
<modulesummary>Generic Finite State Machine Behaviour</modulesummary>
<description>
+ <note>
+ <p>
+ There is a new behaviour
+ <seealso marker="gen_statem"><c>gen_statem</c></seealso>
+ that is intended to replace <c>gen_fsm</c> for new code.
+ It has the same features and add some really useful.
+ This module will not be removed for the foreseeable future
+ to keep old state machine implementations running.
+ </p>
+ </note>
<p>A behaviour module for implementing a finite state machine.
A generic finite state machine process (gen_fsm) implemented
using this module will have a standard set of interface functions
and include functionality for tracing and error reporting. It will
also fit into an OTP supervision tree. Refer to
- <seealso marker="doc/design_principles:fsm">OTP Design Principles</seealso> for more information.</p>
+ <seealso marker="doc/design_principles:fsm">OTP Design Principles</seealso> for more information.
+ </p>
<p>A gen_fsm assumes all specific parts to be located in a callback
module exporting a pre-defined set of functions. The relationship
between the behaviour functions and the callback functions can be
@@ -848,6 +859,7 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4
<title>SEE ALSO</title>
<p><seealso marker="gen_event">gen_event(3)</seealso>,
<seealso marker="gen_server">gen_server(3)</seealso>,
+ <seealso marker="gen_statem">gen_statem(3)</seealso>,
<seealso marker="supervisor">supervisor(3)</seealso>,
<seealso marker="proc_lib">proc_lib(3)</seealso>,
<seealso marker="sys">sys(3)</seealso></p>
diff --git a/lib/stdlib/doc/src/gen_server.xml b/lib/stdlib/doc/src/gen_server.xml
index 6d04771cd4..10dc978afc 100644
--- a/lib/stdlib/doc/src/gen_server.xml
+++ b/lib/stdlib/doc/src/gen_server.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -715,6 +715,7 @@ gen_server:abcast -----> Module:handle_cast/2
<title>SEE ALSO</title>
<p><seealso marker="gen_event">gen_event(3)</seealso>,
<seealso marker="gen_fsm">gen_fsm(3)</seealso>,
+ <seealso marker="gen_statem">gen_statem(3)</seealso>,
<seealso marker="supervisor">supervisor(3)</seealso>,
<seealso marker="proc_lib">proc_lib(3)</seealso>,
<seealso marker="sys">sys(3)</seealso></p>
diff --git a/lib/stdlib/doc/src/gen_statem.xml b/lib/stdlib/doc/src/gen_statem.xml
new file mode 100644
index 0000000000..b1d9799917
--- /dev/null
+++ b/lib/stdlib/doc/src/gen_statem.xml
@@ -0,0 +1,1671 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2016</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>gen_statem</title>
+ <prepared></prepared>
+ <docno></docno>
+ <date></date>
+ <rev></rev>
+ </header>
+ <module>gen_statem</module>
+ <modulesummary>Generic state machine behavior.</modulesummary>
+ <description>
+ <p>
+ This behavior module provides a state machine. Two
+ <seealso marker="#type-callback_mode"><em>callback modes</em></seealso>
+ are supported:
+ </p>
+ <list type="bulleted">
+ <item>
+ <p>One for finite-state machines
+ (<seealso marker="gen_fsm"><c>gen_fsm</c></seealso> like),
+ which requires the state to be an atom and uses that state as
+ the name of the current callback function
+ </p>
+ </item>
+ <item>
+ <p>One without restriction on the state data type
+ that uses one callback function for all states
+ </p>
+ </item>
+ </list>
+ <note>
+ <p>
+ This is a new behavior in Erlang/OTP 19.0.
+ It has been thoroughly reviewed, is stable enough
+ to be used by at least two heavy OTP applications, and is here to stay.
+ Depending on user feedback, we do not expect
+ but can find it necessary to make minor
+ not backward compatible changes into Erlang/OTP 20.0.
+ </p>
+ </note>
+ <p>
+ The <c>gen_statem</c> behavior is intended to replace
+ <seealso marker="gen_fsm"><c>gen_fsm</c></seealso> for new code.
+ It has the same features and adds some really useful:
+ </p>
+ <list type="bulleted">
+ <item>State code is gathered.</item>
+ <item>The state can be any term.</item>
+ <item>Events can be postponed.</item>
+ <item>Events can be self-generated.</item>
+ <item>A reply can be sent from a later state.</item>
+ <item>There can be multiple <c>sys</c> traceable replies.</item>
+ </list>
+ <p>
+ The callback model(s) for <c>gen_statem</c> differs from
+ the one for <seealso marker="gen_fsm"><c>gen_fsm</c></seealso>,
+ but it is still fairly easy to rewrite
+ from <c>gen_fsm</c> to <c>gen_statem</c>.
+ </p>
+ <p>
+ A generic state machine process (<c>gen_statem</c>) implemented
+ using this module has a standard set of interface functions
+ and includes functionality for tracing and error reporting.
+ It also fits into an OTP supervision tree. For more information, see
+ <seealso marker="doc/design_principles:statem">OTP Design Principles</seealso>.
+ </p>
+ <p>
+ A <c>gen_statem</c> assumes all specific parts to be located in a
+ callback module exporting a predefined set of functions.
+ The relationship between the behavior functions and the callback
+ functions is as follows:</p>
+ <pre>
+gen_statem module Callback module
+----------------- ---------------
+gen_statem:start
+gen_statem:start_link -----> Module:init/1
+
+gen_statem:stop -----> Module:terminate/3
+
+gen_statem:call
+gen_statem:cast
+erlang:send
+erlang:'!' -----> Module:StateName/3
+ Module:handle_event/4
+
+- -----> Module:terminate/3
+
+- -----> Module:code_change/4</pre>
+ <p>
+ Events are of different
+ <seealso marker="#type-event_type">types</seealso>,
+ so the callback functions can know the origin of an event
+ and how to respond.
+ </p>
+ <p>
+ If a callback function fails or returns a bad value,
+ the <c>gen_statem</c> terminates. However, an exception of class
+ <seealso marker="erts:erlang#throw/1"><c>throw</c></seealso>
+ is not regarded as an error but as a valid return.
+ </p>
+ <marker id="state_function"/>
+ <p>
+ The "<em>state function</em>" for a specific
+ <seealso marker="#type-state">state</seealso>
+ in a <c>gen_statem</c> is the callback function that is called
+ for all events in this state. It is selected depending on which
+ <seealso marker="#type-callback_mode"><em>callback mode</em></seealso>
+ that the implementation specifies when the server starts.
+ </p>
+ <p>
+ When the
+ <seealso marker="#type-callback_mode"><em>callback mode</em></seealso>
+ is <c>state_functions</c>, the state must be an atom and
+ is used as the state function name; see
+ <seealso marker="#Module:StateName/3"><c>Module:StateName/3</c></seealso>.
+ This gathers all code for a specific state
+ in one function and hence dispatches on state first.
+ Notice that in this mode
+ the mandatory callback function
+ <seealso marker="#Module:terminate/3"><c>Module:terminate/3</c></seealso>
+ makes the state name <c>terminate</c> unusable.
+ </p>
+ <p>
+ When the
+ <seealso marker="#type-callback_mode"><em>callback mode</em></seealso>
+ is <c>handle_event_function</c>, the state can be any term
+ and the state function name is
+ <seealso marker="#Module:handle_event/4"><c>Module:handle_event/4</c></seealso>.
+ This makes it easy to dispatch on state or on event as you desire.
+ Be careful about which events you handle in which
+ states so that you do not accidentally postpone an event
+ forever creating an infinite busy loop.
+ </p>
+ <p>
+ The <c>gen_statem</c> enqueues incoming events in order of arrival
+ and presents these to the
+ <seealso marker="#state_function">state function</seealso>
+ in that order. The state function can postpone an event
+ so it is not retried in the current state.
+ After a state change the queue restarts with the postponed events.
+ </p>
+ <p>
+ The <c>gen_statem</c> event queue model is sufficient
+ to emulate the normal process message queue with selective receive.
+ Postponing an event corresponds to not matching it
+ in a receive statement, and changing states corresponds
+ to entering a new receive statement.
+ </p>
+ <p>
+ The <seealso marker="#state_function">state function</seealso>
+ can insert events using the
+ <seealso marker="#type-action"><c>action()</c></seealso>
+ <c>next_event</c>
+ and such an event is inserted as the next to present
+ to the state function. That is, as if it is
+ the oldest incoming event. A dedicated
+ <seealso marker="#type-event_type"><c>event_type()</c></seealso>
+ <c>internal</c> can be used for such events making them impossible
+ to mistake for external events.
+ </p>
+ <p>
+ Inserting an event replaces the trick of calling your own
+ state handling functions that you often would have to
+ resort to in, for example,
+ <seealso marker="gen_fsm"><c>gen_fsm</c></seealso>
+ to force processing an inserted event before others.
+ </p>
+ <note>
+ <p>If you in <c>gen_statem</c>, for example, postpone
+ an event in one state and then call another state function
+ of yours, you have not changed states and hence the postponed event
+ is not retried, which is logical but can be confusing.
+ </p>
+ </note>
+ <p>
+ For the details of a state transition, see type
+ <seealso marker="#type-transition_option"><c>transition_option()</c></seealso>.
+ </p>
+ <p>
+ A <c>gen_statem</c> handles system messages as described in
+ <seealso marker="sys"><c>sys</c></seealso>.
+ The <c>sys</c> module can be used for debugging a <c>gen_statem</c>.
+ </p>
+ <p>
+ Notice that a <c>gen_statem</c> does not trap exit signals
+ automatically, this must be explicitly initiated in
+ the callback module (by calling
+ <seealso marker="erts:erlang#process_flag/2"><c>process_flag(trap_exit, true)</c></seealso>.
+ </p>
+ <p>
+ Unless otherwise stated, all functions in this module fail if
+ the specified <c>gen_statem</c> does not exist or
+ if bad arguments are specified.
+ </p>
+ <p>
+ The <c>gen_statem</c> process can go into hibernation; see
+ <seealso marker="proc_lib#hibernate/3"><c>proc_lib:hibernate/3</c></seealso>.
+ It is done when a
+ <seealso marker="#state_function">state function</seealso> or
+ <seealso marker="#Module:init/1"><c>Module:init/1</c></seealso>
+ specifies <c>hibernate</c> in the returned
+ <seealso marker="#type-action"><c>Actions</c></seealso>
+ list. This feature can be useful to reclaim process heap memory
+ while the server is expected to be idle for a long time.
+ However, use this feature with care,
+ as hibernation can be too costly
+ to use after every event; see
+ <seealso marker="erts:erlang#hibernate/3"><c>erlang:hibernate/3</c></seealso>.
+ </p>
+ </description>
+
+ <section>
+ <title>Example</title>
+ <p>
+ The following example shows a simple pushbutton model
+ for a toggling pushbutton implemented with
+ <seealso marker="#type-callback_mode"><em>callback mode</em></seealso>
+ <c>state_functions</c>.
+ You can push the button and it replies if it went on or off,
+ and you can ask for a count of how many times it has been
+ pushed to switch on.
+ </p>
+ <p>The following is the complete callback module file
+ <c>pushbutton.erl</c>:</p>
+ <code type="erl">
+-module(pushbutton).
+-behaviour(gen_statem).
+
+-export([start/0,push/0,get_count/0,stop/0]).
+-export([terminate/3,code_change/4,init/1]).
+-export([on/3,off/3]).
+
+name() -> pushbutton_statem. % The registered server name
+callback_mode() -> state_functions.
+
+%% API. This example uses a registered name name()
+%% and does not link to the caller.
+start() ->
+ gen_statem:start({local,name()}, ?MODULE, [], []).
+push() ->
+ gen_statem:call(name(), push).
+get_count() ->
+ gen_statem:call(name(), get_count).
+stop() ->
+ gen_statem:stop(name()).
+
+%% Mandatory callback functions
+terminate(_Reason, _State, _Data) ->
+ void.
+code_change(_Vsn, State, Data, _Extra) ->
+ {callback_mode(),State,Data}.
+init([]) ->
+ %% Set the callback mode and initial state + data.
+ %% Data is used only as a counter.
+ State = off, Data = 0,
+ {callback_mode(),State,Data}.
+
+
+%%% State functions
+
+off({call,From}, push, Data) ->
+ %% Go to 'on', increment count and reply
+ %% that the resulting status is 'on'
+ {next_state,on,Data+1,[{reply,From,on}]};
+off(EventType, EventContent, Data) ->
+ handle_event(EventType, EventContent, Data).
+
+on({call,From}, push, Data) ->
+ %% Go to 'off' and reply that the resulting status is 'off'
+ {next_state,off,Data,[{reply,From,off}]};
+on(EventType, EventContent, Data) ->
+ handle_event(EventType, EventContent, Data).
+
+%% Handle events common to all states
+handle_event({call,From}, get_count, Data) ->
+ %% Reply with the current count
+ {keep_state,Data,[{reply,From,Data}]};
+handle_event(_, _, Data) ->
+ %% Ignore all other events
+ {keep_state,Data}.
+ </code>
+ <p>The following is a shell session when running it:</p>
+ <pre>
+1> pushbutton:start().
+{ok,&lt;0.36.0>}
+2> pushbutton:get_count().
+0
+3> pushbutton:push().
+on
+4> pushbutton:get_count().
+1
+5> pushbutton:push().
+off
+6> pushbutton:get_count().
+1
+7> pushbutton:stop().
+ok
+8> pushbutton:push().
+** exception exit: {noproc,{gen_statem,call,[pushbutton_statem,push,infinity]}}
+ in function gen:do_for_proc/2 (gen.erl, line 261)
+ in call from gen_statem:call/3 (gen_statem.erl, line 386)
+ </pre>
+ <p>
+ To compare styles, here follows the same example using
+ <seealso marker="#type-callback_mode"><em>callback mode</em></seealso>
+ <c>state_functions</c>, or rather the code to replace
+ from function <c>init/1</c> of the <c>pushbutton.erl</c>
+ example file above:
+ </p>
+ <code type="erl">
+init([]) ->
+ %% Set the callback mode and initial state + data.
+ %% Data is used only as a counter.
+ State = off, Data = 0,
+ {handle_event_function,State,Data}.
+
+
+%%% Event handling
+
+handle_event({call,From}, push, off, Data) ->
+ %% Go to 'on', increment count and reply
+ %% that the resulting status is 'on'
+ {next_state,on,Data+1,[{reply,From,on}]};
+handle_event({call,From}, push, on, Data) ->
+ %% Go to 'off' and reply that the resulting status is 'off'
+ {next_state,off,Data,[{reply,From,off}]};
+%%
+%% Event handling common to all states
+handle_event({call,From}, get_count, State, Data) ->
+ %% Reply with the current count
+ {next_state,State,Data,[{reply,From,Data}]};
+handle_event(_, _, State, Data) ->
+ %% Ignore all other events
+ {next_state,State,Data}.
+ </code>
+ </section>
+
+ <datatypes>
+ <datatype>
+ <name name="server_name"/>
+ <desc>
+ <p>
+ Name specification to use when starting
+ a <c>gen_statem</c> server. See
+ <seealso marker="#start_link/3"><c>start_link/3</c></seealso>
+ and
+ <seealso marker="#type-server_ref"><c>server_ref()</c></seealso>
+ below.
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="server_ref"/>
+ <desc>
+ <p>
+ Server specification to use when addressing
+ a <c>gen_statem</c> server.
+ See <seealso marker="#call/2"><c>call/2</c></seealso> and
+ <seealso marker="#type-server_name"><c>server_name()</c></seealso>
+ above.
+ </p>
+ <p>It can be:</p>
+ <taglist>
+ <tag><c>pid() | LocalName</c></tag>
+ <item>
+ <p>
+ The <c>gen_statem</c> is locally registered.
+ </p>
+ </item>
+ <tag><c>{Name,Node}</c></tag>
+ <item>
+ <p>
+ The <c>gen_statem</c> is locally registered
+ on another node.
+ </p>
+ </item>
+ <tag><c>{global,GlobalName}</c></tag>
+ <item>
+ <p>
+ The <c>gen_statem</c> is globally registered in
+ <seealso marker="kernel:global"><c>kernel:global</c></seealso>.
+ </p>
+ </item>
+ <tag><c>{via,RegMod,ViaName}</c></tag>
+ <item>
+ <p>
+ The <c>gen_statem</c> is registered in
+ an alternative process registry.
+ The registry callback module <c>RegMod</c>
+ is to export functions
+ <c>register_name/2</c>, <c>unregister_name/1</c>,
+ <c>whereis_name/1</c>, and <c>send/2</c>,
+ which are to behave like the corresponding functions in
+ <seealso marker="kernel:global"><c>kernel:global</c></seealso>.
+ Thus, <c>{via,global,GlobalName}</c> is the same as
+ <c>{global,GlobalName}</c>.
+ </p>
+ </item>
+ </taglist>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="debug_opt"/>
+ <desc>
+ <p>
+ Debug option that can be used when starting
+ a <c>gen_statem</c> server through, for example,
+ <seealso marker="#enter_loop/5"><c>enter_loop/5</c></seealso>.
+ </p>
+ <p>
+ For every entry in <c><anno>Dbgs</anno></c>,
+ the corresponding function in
+ <seealso marker="sys"><c>sys</c></seealso> is called.
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="start_opt"/>
+ <desc>
+ <p>
+ Options that can be used when starting
+ a <c>gen_statem</c> server through, for example,
+ <seealso marker="#start_link/3"><c>start_link/3</c></seealso>.
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="start_ret"/>
+ <desc>
+ <p>
+ Return value from the start functions, for example,
+ <seealso marker="#start_link/3"><c>start_link/3</c></seealso>.
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="from"/>
+ <desc>
+ <p>
+ Destination to use when replying through, for example, the
+ <seealso marker="#type-action"><c>action()</c></seealso>
+ <c>{reply,From,Reply}</c>
+ to a process that has called the <c>gen_statem</c> server using
+ <seealso marker="#call/2"><c>call/2</c></seealso>.
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="state"/>
+ <desc>
+ <p>
+ After a state change (<c>NextState =/= State</c>),
+ all postponed events are retried.
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="state_name"/>
+ <desc>
+ <p>
+ If the
+ <seealso marker="#type-callback_mode"><em>callback mode</em></seealso>
+ is <c>state_functions</c>,
+ the state must be of this type.
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="data"/>
+ <desc>
+ <p>
+ A term in which the state machine implementation
+ is to store any server data it needs. The difference between
+ this and the <seealso marker="#type-state"><c>state()</c></seealso>
+ itself is that a change in this data does not cause
+ postponed events to be retried. Hence, if a change
+ in this data would change the set of events that
+ are handled, then that data item is to be made
+ a part of the state.
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="event_type"/>
+ <desc>
+ <p>
+ External events are of three types:
+ <c>{call,<anno>From</anno>}</c>, <c>cast</c>, or <c>info</c>.
+ <seealso marker="#call/2">Calls</seealso>
+ (synchronous) and
+ <seealso marker="#cast/2">casts</seealso>
+ originate from the corresponding API functions.
+ For calls, the event contains whom to reply to.
+ Type <c>info</c> originates from regular process messages sent
+ to the <c>gen_statem</c>. Also, the state machine
+ implementation can generate events of types
+ <c>timeout</c> and <c>internal</c> to itself.
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="callback_mode"/>
+ <desc>
+ <p>
+ The <em>callback mode</em> is selected when starting the
+ <c>gen_statem</c> using the return value from
+ <seealso marker="#Module:init/1"><c>Module:init/1</c></seealso>
+ or when calling
+ <seealso marker="#enter_loop/5"><c>enter_loop/5,6,7</c></seealso>,
+ and with the return value from
+ <seealso marker="#Module:code_change/4"><c>Module:code_change/4</c></seealso>.
+ </p>
+ <taglist>
+ <tag><c>state_functions</c></tag>
+ <item>
+ <p>
+ The state must be of type
+ <seealso marker="#type-state_name"><c>state_name()</c></seealso>
+ and one callback function per state, that is,
+ <seealso marker="#Module:StateName/3"><c>Module:StateName/3</c></seealso>,
+ is used.
+ </p>
+ </item>
+ <tag><c>handle_event_function</c></tag>
+ <item>
+ <p>
+ The state can be any term and the callback function
+ <seealso marker="#Module:handle_event/4"><c>Module:handle_event/4</c></seealso>
+ is used for all states.
+ </p>
+ </item>
+ </taglist>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="transition_option"/>
+ <desc>
+ <p>
+ Transition options can be set by
+ <seealso marker="#type-action">actions</seealso>
+ and they modify the following in how
+ the state transition is done:
+ </p>
+ <list type="ordered">
+ <item>
+ <p>
+ All
+ <seealso marker="#type-action">actions</seealso>
+ are processed in order of appearance.
+ </p>
+ </item>
+ <item>
+ <p>
+ If
+ <seealso marker="#type-postpone"><c>postpone()</c></seealso>
+ is <c>true</c>,
+ the current event is postponed.
+ </p>
+ </item>
+ <item>
+ <p>
+ If the state changes, the queue of incoming events
+ is reset to start with the oldest postponed.
+ </p>
+ </item>
+ <item>
+ <p>
+ All events stored with
+ <seealso marker="#type-action"><c>action()</c></seealso>
+ <c>next_event</c>
+ are inserted in the queue to be processed before
+ all other events.
+ </p>
+ </item>
+ <item>
+ <p>
+ If an
+ <seealso marker="#type-event_timeout"><c>event_timeout()</c></seealso>
+ is set through
+ <seealso marker="#type-action"><c>action()</c></seealso>
+ <c>timeout</c>,
+ an event timer can be started or a time-out zero event
+ can be enqueued.
+ </p>
+ </item>
+ <item>
+ <p>
+ The (possibly new)
+ <seealso marker="#state_function">state function</seealso>
+ is called with the oldest enqueued event if there is any,
+ otherwise the <c>gen_statem</c> goes into <c>receive</c>
+ or hibernation
+ (if
+ <seealso marker="#type-hibernate"><c>hibernate()</c></seealso>
+ is <c>true</c>)
+ to wait for the next message. In hibernation the next
+ non-system event awakens the <c>gen_statem</c>, or rather
+ the next incoming message awakens the <c>gen_statem</c>,
+ but if it is a system event
+ it goes right back into hibernation.
+ </p>
+ </item>
+ </list>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="postpone"/>
+ <desc>
+ <p>
+ If <c>true</c>, postpones the current event and retries
+ it when the state changes
+ (<c>NextState =/= State</c>).
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="hibernate"/>
+ <desc>
+ <p>
+ If <c>true</c>, hibernates the <c>gen_statem</c>
+ by calling
+ <seealso marker="proc_lib#hibernate/3"><c>proc_lib:hibernate/3</c></seealso>
+ before going into <c>receive</c>
+ to wait for a new external event.
+ If there are enqueued events,
+ to prevent receiving any new event, an
+ <seealso marker="erts:erlang#garbage_collect/0"><c>erlang:garbage_collect/0</c></seealso>
+ is done instead to simulate
+ that the <c>gen_statem</c> entered hibernation
+ and immediately got awakened by the oldest enqueued event.
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="event_timeout"/>
+ <desc>
+ <p>
+ Generates an event of
+ <seealso marker="#type-event_type"><c>event_type()</c></seealso>
+ <c>timeout</c>
+ after this time (in milliseconds) unless another
+ event arrives in which case this time-out is cancelled.
+ Notice that a retried or inserted event
+ counts like a new in this respect.
+ </p>
+ <p>
+ If the value is <c>infinity</c>, no timer is started, as
+ it never triggers anyway.
+ </p>
+ <p>
+ If the value is <c>0</c>, the time-out event is immediately enqueued
+ unless there already are enqueued events, as the
+ time-out is then immediately cancelled.
+ This is a feature ensuring that a time-out <c>0</c> event
+ is processed before any not yet received external event.
+ </p>
+ <p>
+ Notice that it is not possible or needed to cancel this time-out,
+ as it is cancelled automatically by any other event.
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="action"/>
+ <desc>
+ <p>
+ These state transition actions can be invoked by
+ returning them from the
+ <seealso marker="#state_function">state function</seealso>, from
+ <seealso marker="#Module:init/1"><c>Module:init/1</c></seealso>
+ or by giving them to
+ <seealso marker="#enter_loop/6"><c>enter_loop/6,7</c></seealso>.
+ </p>
+ <p>
+ Actions are executed in the containing list order.
+ </p>
+ <p>
+ Actions that set
+ <seealso marker="#type-transition_option">transition options</seealso>
+ override any previous of the same type,
+ so the last in the containing list wins.
+ For example, the last
+ <seealso marker="#type-event_timeout"><c>event_timeout()</c></seealso>
+ overrides any other <c>event_timeout()</c> in the list.
+ </p>
+ <taglist>
+ <tag><c>postpone</c></tag>
+ <item>
+ <p>
+ Sets the
+ <seealso marker="#type-transition_option"><c>transition_option()</c></seealso>
+ <seealso marker="#type-postpone"><c>postpone()</c></seealso>
+ for this state transition.
+ This action is ignored when returned from
+ <seealso marker="#Module:init/1"><c>Module:init/1</c></seealso>
+ or given to
+ <seealso marker="#enter_loop/5"><c>enter_loop/5,6</c></seealso>,
+ as there is no event to postpone in those cases.
+ </p>
+ </item>
+ <tag><c>hibernate</c></tag>
+ <item>
+ <p>
+ Sets the
+ <seealso marker="#type-transition_option"><c>transition_option()</c></seealso>
+ <seealso marker="#type-hibernate"><c>hibernate()</c></seealso>
+ for this state transition.
+ </p>
+ </item>
+ <tag><c>Timeout</c></tag>
+ <item>
+ <p>
+ Short for <c>{timeout,Timeout,Timeout}</c>, that is,
+ the time-out message is the time-out time.
+ This form exists to make the
+ <seealso marker="#state_function">state function</seealso>
+ return value <c>{next_state,NextState,NewData,Timeout}</c>
+ allowed like for <c>gen_fsm</c>'s
+ <seealso marker="gen_fsm#Module:StateName/2"><c>Module:StateName/2</c></seealso>.
+ </p>
+ </item>
+ <tag><c>timeout</c></tag>
+ <item>
+ <p>
+ Sets the
+ <seealso marker="#type-transition_option"><c>transition_option()</c></seealso>
+ <seealso marker="#type-event_timeout"><c>event_timeout()</c></seealso>
+ to <c><anno>Time</anno></c> with <c><anno>EventContent</anno></c>.
+ </p>
+ </item>
+ <tag><c>reply_action()</c></tag>
+ <item>
+ <p>
+ Replies to a caller.
+ </p>
+ </item>
+ <tag><c>next_event</c></tag>
+ <item>
+ <p>
+ Stores the specified <c><anno>EventType</anno></c>
+ and <c><anno>EventContent</anno></c> for insertion after all
+ actions have been executed.
+ </p>
+ <p>
+ The stored events are inserted in the queue as the next to process
+ before any already queued events. The order of these stored events
+ is preserved, so the first <c>next_event</c> in the containing
+ list becomes the first to process.
+ </p>
+ <p>
+ An event of type
+ <seealso marker="#type-event_type"><c>internal</c></seealso>
+ is to be used when you want to reliably distinguish
+ an event inserted this way from any external event.
+ </p>
+ </item>
+ </taglist>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="reply_action"/>
+ <desc>
+ <p>
+ Replies to a caller waiting for a reply in
+ <seealso marker="#call/2"><c>call/2</c></seealso>.
+ <c><anno>From</anno></c> must be the term from argument
+ <seealso marker="#type-event_type"><c>{call,<anno>From</anno>}</c></seealso>
+ to the
+ <seealso marker="#state_function">state function</seealso>.
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="state_function_result"/>
+ <desc>
+ <taglist>
+ <tag><c>next_state</c></tag>
+ <item>
+ <p>
+ The <c>gen_statem</c> does a state transition to
+ <c><anno>NextStateName</anno></c>
+ (which can be the same as the current state),
+ sets <c><anno>NewData</anno></c>,
+ and executes all <c><anno>Actions</anno></c>.
+ </p>
+ </item>
+ </taglist>
+ <p>
+ All these terms are tuples or atoms and this property
+ will hold in any future version of <c>gen_statem</c>.
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="handle_event_result"/>
+ <desc>
+ <taglist>
+ <tag><c>next_state</c></tag>
+ <item>
+ <p>
+ The <c>gen_statem</c> does a state transition to
+ <c><anno>NextState</anno></c>
+ (which can be the same as the current state),
+ sets <c><anno>NewData</anno></c>,
+ and executes all <c><anno>Actions</anno></c>.
+ </p>
+ </item>
+ </taglist>
+ <p>
+ All these terms are tuples or atoms and this property
+ will hold in any future version of <c>gen_statem</c>.
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="common_state_callback_result"/>
+ <desc>
+ <taglist>
+ <tag><c>stop</c></tag>
+ <item>
+ <p>
+ Terminates the <c>gen_statem</c> by calling
+ <seealso marker="#Module:terminate/3"><c>Module:terminate/3</c></seealso>
+ with <c>Reason</c> and
+ <c><anno>NewData</anno></c>, if specified.
+ </p>
+ </item>
+ <tag><c>stop_and_reply</c></tag>
+ <item>
+ <p>
+ Sends all <c><anno>Replies</anno></c>,
+ then terminates the <c>gen_statem</c> by calling
+ <seealso marker="#Module:terminate/3"><c>Module:terminate/3</c></seealso>
+ with <c>Reason</c> and
+ <c><anno>NewData</anno></c>, if specified.
+ </p>
+ </item>
+ <tag><c>keep_state</c></tag>
+ <item>
+ <p>
+ The <c>gen_statem</c> keeps the current state, or
+ does a state transition to the current state if you like,
+ sets <c><anno>NewData</anno></c>,
+ and executes all <c><anno>Actions</anno></c>.
+ This is the same as
+ <c>{next_state,CurrentState,<anno>NewData</anno>,<anno>Actions</anno>}</c>.
+ </p>
+ </item>
+ <tag><c>keep_state_and_data</c></tag>
+ <item>
+ <p>
+ The <c>gen_statem</c> keeps the current state or
+ does a state transition to the current state if you like,
+ keeps the current server data,
+ and executes all <c><anno>Actions</anno></c>.
+ This is the same as
+ <c>{next_state,CurrentState,CurrentData,<anno>Actions</anno>}</c>.
+ </p>
+ </item>
+ </taglist>
+ <p>
+ All these terms are tuples or atoms and this property
+ will hold in any future version of <c>gen_statem</c>.
+ </p>
+ </desc>
+ </datatype>
+ </datatypes>
+
+ <funcs>
+ <func>
+ <name name="call" arity="2"/>
+ <name name="call" arity="3"/>
+ <fsummary>Make a synchronous call to a <c>gen_statem</c>.</fsummary>
+ <desc>
+ <p>
+ Makes a synchronous call to the <c>gen_statem</c>
+ <seealso marker="#type-server_ref"><c><anno>ServerRef</anno></c></seealso>
+ by sending a request
+ and waiting until its reply arrives.
+ The <c>gen_statem</c> calls the
+ <seealso marker="#state_function">state function</seealso> with
+ <seealso marker="#type-event_type"><c>event_type()</c></seealso>
+ <c>{call,From}</c> and event content
+ <c><anno>Request</anno></c>.
+ </p>
+ <p>
+ A <c><anno>Reply</anno></c> is generated when a
+ <seealso marker="#state_function">state function</seealso>
+ returns with
+ <c>{reply,From,<anno>Reply</anno>}</c> as one
+ <seealso marker="#type-action"><c>action()</c></seealso>,
+ and that <c><anno>Reply</anno></c> becomes the return value
+ of this function.
+ </p>
+ <p>
+ <c><anno>Timeout</anno></c> is an integer &gt; 0,
+ which specifies how many milliseconds to wait for a reply,
+ or the atom <c>infinity</c> to wait indefinitely,
+ which is the default. If no reply is received within
+ the specified time, the function call fails.
+ </p>
+ <note>
+ <p>
+ To avoid getting a late reply in the caller's
+ inbox, this function spawns a proxy process that
+ does the call. A late reply gets delivered to the
+ dead proxy process, hence gets discarded. This is
+ less efficient than using
+ <c><anno>Timeout</anno> =:= infinity</c>.
+ </p>
+ </note>
+ <p>
+ The call can fail, for example, if the <c>gen_statem</c> dies
+ before or during this function call.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="cast" arity="2"/>
+ <fsummary>Send an asynchronous event to a <c>gen_statem</c>.</fsummary>
+ <desc>
+ <p>
+ Sends an asynchronous event to the <c>gen_statem</c>
+ <seealso marker="#type-server_ref"><c><anno>ServerRef</anno></c></seealso>
+ and returns <c>ok</c> immediately,
+ ignoring if the destination node or <c>gen_statem</c>
+ does not exist.
+ The <c>gen_statem</c> calls the
+ <seealso marker="#state_function">state function</seealso> with
+ <seealso marker="#type-event_type"><c>event_type()</c></seealso>
+ <c>cast</c> and event content
+ <c><anno>Msg</anno></c>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="enter_loop" arity="5"/>
+ <fsummary>Enter the <c>gen_statem</c> receive loop.</fsummary>
+ <desc>
+ <p>
+ The same as
+ <seealso marker="#enter_loop/7"><c>enter_loop/7</c></seealso>
+ except that no
+ <seealso marker="#type-server_name"><c>server_name()</c></seealso>
+ must have been registered.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="enter_loop" arity="6"/>
+ <fsummary>Enter the <c>gen_statem</c> receive loop.</fsummary>
+ <desc>
+ <p>
+ If <c><anno>Server_or_Actions</anno></c> is a <c>list()</c>,
+ the same as
+ <seealso marker="#enter_loop/7"><c>enter_loop/7</c></seealso>
+ except that no
+ <seealso marker="#type-server_name"><c>server_name()</c></seealso>
+ must have been registered and
+ <c>Actions = <anno>Server_or_Actions</anno></c>.
+ </p>
+ <p>
+ Otherwise the same as
+ <seealso marker="#enter_loop/7"><c>enter_loop/7</c></seealso>
+ with
+ <c>Server = <anno>Server_or_Actions</anno></c> and
+ <c>Actions = []</c>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="enter_loop" arity="7"/>
+ <fsummary>Enter the <c>gen_statem</c> receive loop.</fsummary>
+ <desc>
+ <p>
+ Makes the calling process become a <c>gen_statem</c>.
+ Does not return, instead the calling process enters
+ the <c>gen_statem</c> receive loop and becomes
+ a <c>gen_statem</c> server.
+ The process <em>must</em> have been started
+ using one of the start functions in
+ <seealso marker="proc_lib"><c>proc_lib</c></seealso>.
+ The user is responsible for any initialization of the process,
+ including registering a name for it.
+ </p>
+ <p>
+ This function is useful when a more complex initialization
+ procedure is needed than
+ the <c>gen_statem</c> behavior provides.
+ </p>
+ <p>
+ <c><anno>Module</anno></c>, <c><anno>Opts</anno></c>, and
+ <c><anno>Server</anno></c> have the same meanings
+ as when calling
+ <seealso marker="#start_link/3"><c>start[_link]/3,4</c></seealso>.
+ However, the
+ <seealso marker="#type-server_name"><c>server_name()</c></seealso>
+ name must have been registered accordingly
+ <em>before</em> this function is called.</p>
+ <p>
+ <c><anno>CallbackMode</anno></c>, <c><anno>State</anno></c>,
+ <c><anno>Data</anno></c>, and <c><anno>Actions</anno></c>
+ have the same meanings as in the return value of
+ <seealso marker="#Module:init/1"><c>Module:init/1</c></seealso>.
+ Also, the callback module <c><anno>Module</anno></c>
+ does not need to export an <c>init/1</c> function.
+ </p>
+ <p>
+ The function fails if the calling process was not started by a
+ <seealso marker="proc_lib"><c>proc_lib</c></seealso>
+ start function, or if it is not registered
+ according to
+ <seealso marker="#type-server_name"><c>server_name()</c></seealso>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="reply" arity="1"/>
+ <name name="reply" arity="2"/>
+ <fsummary>Reply to a caller.</fsummary>
+ <desc>
+ <p>
+ This function can be used by a <c>gen_statem</c>
+ to explicitly send a reply to a process that waits in
+ <seealso marker="#call/2"><c>call/2</c></seealso>
+ when the reply cannot be defined in
+ the return value of a
+ <seealso marker="#state_function">state function</seealso>.
+ </p>
+ <p>
+ <c><anno>From</anno></c> must be the term from argument
+ <seealso marker="#type-event_type"><c>{call,<anno>From</anno>}</c></seealso>
+ to the
+ <seealso marker="#state_function">state function</seealso>.
+ <c><anno>From</anno></c> and <c><anno>Reply</anno></c>
+ can also be specified using a
+ <seealso marker="#type-reply_action"><c>reply_action()</c></seealso>
+ and multiple replies with a list of them.
+ </p>
+ <note>
+ <p>
+ A reply sent with this function is not visible
+ in <seealso marker="sys"><c>sys</c></seealso> debug output.
+ </p>
+ </note>
+ </desc>
+ </func>
+
+ <func>
+ <name name="start" arity="3"/>
+ <name name="start" arity="4"/>
+ <fsummary>Create a standalone <c>gen_statem</c> process.</fsummary>
+ <desc>
+ <p>
+ Creates a standalone <c>gen_statem</c> process according to
+ OTP design principles (using
+ <seealso marker="proc_lib"><c>proc_lib</c></seealso>
+ primitives).
+ As it does not get linked to the calling process,
+ this start function cannot be used by a supervisor
+ to start a child.
+ </p>
+ <p>
+ For a description of arguments and return values, see
+ <seealso marker="#start_link/3"><c>start_link/3,4</c></seealso>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="start_link" arity="3"/>
+ <name name="start_link" arity="4"/>
+ <fsummary>Create a linked <c>gen_statem</c> process.</fsummary>
+ <desc>
+ <p>
+ Creates a <c>gen_statem</c> process according
+ to OTP design principles
+ (using
+ <seealso marker="proc_lib"><c>proc_lib</c></seealso>
+ primitives)
+ that is linked to the calling process.
+ This is essential when the <c>gen_statem</c> must be part of
+ a supervision tree so it gets linked to its supervisor.
+ </p>
+ <p>
+ The <c>gen_statem</c> process calls
+ <seealso marker="#Module:init/1"><c>Module:init/1</c></seealso>
+ to initialize the server. To ensure a synchronized startup
+ procedure, <c>start_link/3,4</c> does not return until
+ <seealso marker="#Module:init/1"><c>Module:init/1</c></seealso>
+ has returned.
+ </p>
+ <p>
+ <c><anno>ServerName</anno></c> specifies the
+ <seealso marker="#type-server_name"><c>server_name()</c></seealso>
+ to register for the <c>gen_statem</c>.
+ If the <c>gen_statem</c> is started with <c>start_link/3</c>,
+ no <c><anno>ServerName</anno></c> is provided and
+ the <c>gen_statem</c> is not registered.
+ </p>
+ <p><c><anno>Module</anno></c> is the name of the callback module.</p>
+ <p>
+ <c><anno>Args</anno></c> is an arbitrary term that is passed as
+ the argument to
+ <seealso marker="#Module:init/1"><c>Module:init/1</c></seealso>.
+ </p>
+ <list type="bulleted">
+ <item>
+ <p>
+ If option <c>{timeout,Time}</c> is present in
+ <c><anno>Opts</anno></c>, the <c>gen_statem</c>
+ is allowed to spend <c>Time</c> milliseconds initializing
+ or it terminates and the start function returns
+ <seealso marker="#type-start_ret"><c>{error,timeout}</c></seealso>.
+ </p>
+ </item>
+ <item>
+ <p>
+ If option
+ <seealso marker="#type-debug_opt"><c>{debug,Dbgs}</c></seealso>
+ is present in <c><anno>Opts</anno></c>, debugging through
+ <seealso marker="sys"><c>sys</c></seealso> is activated.
+ </p>
+ </item>
+ <item>
+ <p>
+ If option <c>{spawn_opt,SpawnOpts}</c> is present in
+ <c><anno>Opts</anno></c>, <c>SpawnOpts</c> is passed
+ as option list to
+ <seealso marker="erts:erlang#spawn_opt/2"><c>erlang:spawn_opt/2</c></seealso>,
+ which is used to spawn the <c>gen_statem</c> process.
+ </p>
+ </item>
+ </list>
+ <note>
+ <p>
+ Using spawn option <c>monitor</c> is not
+ allowed, it causes this function to fail with reason
+ <c>badarg</c>.
+ </p>
+ </note>
+ <p>
+ If the <c>gen_statem</c> is successfully created
+ and initialized, this function returns
+ <seealso marker="#type-start_ret"><c>{ok,Pid}</c></seealso>,
+ where <c>Pid</c> is the <c>pid()</c>
+ of the <c>gen_statem</c>.
+ If a process with the specified <c><anno>ServerName</anno></c>
+ exists already, this function returns
+ <seealso marker="#type-start_ret"><c>{error,{already_started,Pid}}</c></seealso>,
+ where <c>Pid</c> is the <c>pid()</c> of that process.
+ </p>
+ <p>
+ If <c>Module:init/1</c> fails with <c>Reason</c>,
+ this function returns
+ <seealso marker="#type-start_ret"><c>{error,Reason}</c></seealso>.
+ If <c>Module:init/1</c> returns
+ <seealso marker="#type-start_ret"><c>{stop,Reason}</c></seealso>
+ or
+ <seealso marker="#type-start_ret"><c>ignore</c></seealso>,
+ the process is terminated and this function
+ returns
+ <seealso marker="#type-start_ret"><c>{error,Reason}</c></seealso>
+ or
+ <seealso marker="#type-start_ret"><c>ignore</c></seealso>,
+ respectively.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="stop" arity="1"/>
+ <fsummary>Synchronously stop a generic server.</fsummary>
+ <desc>
+ <p>
+ The same as
+ <seealso marker="#stop/3"><c>stop(<anno>ServerRef</anno>, normal, infinity)</c></seealso>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="stop" arity="3"/>
+ <fsummary>Synchronously stop a generic server.</fsummary>
+ <desc>
+ <p>
+ Orders the <c>gen_statem</c>
+ <seealso marker="#type-server_ref"><c><anno>ServerRef</anno></c></seealso>
+ to exit with the specified <c><anno>Reason</anno></c>
+ and waits for it to terminate.
+ The <c>gen_statem</c> calls
+ <seealso marker="#Module:terminate/3"><c>Module:terminate/3</c></seealso>
+ before exiting.
+ </p>
+ <p>
+ This function returns <c>ok</c> if the server terminates
+ with the expected reason. Any other reason than <c>normal</c>,
+ <c>shutdown</c>, or <c>{shutdown,Term}</c> causes an
+ error report to be issued through
+ <seealso marker="kernel:error_logger#format/2"><c>error_logger:format/2</c></seealso>.
+ The default <c><anno>Reason</anno></c> is <c>normal</c>.
+ </p>
+ <p>
+ <c><anno>Timeout</anno></c> is an integer &gt; 0,
+ which specifies how many milliseconds to wait for the server to
+ terminate, or the atom <c>infinity</c> to wait indefinitely.
+ Defaults to <c>infinity</c>.
+ If the server does not terminate within the specified time,
+ a <c>timeout</c> exception is raised.
+ </p>
+ <p>
+ If the process does not exist, a <c>noproc</c> exception
+ is raised.
+ </p>
+ </desc>
+ </func>
+ </funcs>
+
+ <section>
+ <title>Callback Functions</title>
+ <p>
+ The following functions are to be exported from a
+ <c>gen_statem</c> callback module.
+ </p>
+ </section>
+
+ <funcs>
+ <func>
+ <name>Module:code_change(OldVsn, OldState, OldData, Extra) ->
+ Result
+ </name>
+ <fsummary>Update the internal state during upgrade/downgrade.</fsummary>
+ <type>
+ <v>OldVsn = Vsn | {down,Vsn}</v>
+ <v>&nbsp;&nbsp;Vsn = term()</v>
+ <v>OldState = NewState = term()</v>
+ <v>Extra = term()</v>
+ <v>Result = {NewCallbackMode,NewState,NewData} | Reason</v>
+ <v>
+ NewCallbackMode =
+ <seealso marker="#type-callback_mode">callback_mode()</seealso>
+ </v>
+ <v>
+ OldState = NewState =
+ <seealso marker="#type-state">state()</seealso>
+ </v>
+ <v>
+ OldData = NewData =
+ <seealso marker="#type-data">data()</seealso>
+ </v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>
+ This function is called by a <c>gen_statem</c> when it is to
+ update its internal state during a release upgrade/downgrade,
+ that is, when the instruction <c>{update,Module,Change,...}</c>,
+ where <c>Change={advanced,Extra}</c>, is specified in the
+ <seealso marker="sasl:appup"><c>appup</c></seealso>
+ file. For more information, see
+ <seealso marker="doc/design_principles:release_handling#instr">OTP Design Principles</seealso>.
+ </p>
+ <p>
+ For an upgrade, <c>OldVsn</c> is <c>Vsn</c>, and
+ for a downgrade, <c>OldVsn</c> is
+ <c>{down,Vsn}</c>. <c>Vsn</c> is defined by the <c>vsn</c>
+ attribute(s) of the old version of the callback module
+ <c>Module</c>. If no such attribute is defined, the version
+ is the checksum of the Beam file.
+ </p>
+ <note>
+ <p>
+ If you would dare to change
+ <seealso marker="#type-callback_mode"><em>callback mode</em></seealso>
+ during release upgrade/downgrade, the upgrade is no problem,
+ as the new code surely knows what <em>callback mode</em>
+ it needs. However, for a downgrade this function must
+ know from argument <c>Extra</c> that comes from the
+ <seealso marker="sasl:appup"><c>sasl:appup</c></seealso>
+ file what <em>callback mode</em> the old code did use.
+ It can also be possible to figure this out
+ from argument <c>{down,Vsn}</c>, as <c>Vsn</c>
+ in effect defines the old callback module version.
+ </p>
+ </note>
+ <p>
+ <c>OldState</c> and <c>OldData</c> is the internal state
+ of the <c>gen_statem</c>.
+ </p>
+ <p>
+ <c>Extra</c> is passed "as is" from the <c>{advanced,Extra}</c>
+ part of the update instruction.
+ </p>
+ <p>
+ If successful, the function must return the updated
+ internal state in an
+ <c>{NewCallbackMode,NewState,NewData}</c> tuple.
+ </p>
+ <p>
+ If the function returns <c>Reason</c>, the ongoing
+ upgrade fails and rolls back to the old release.</p>
+ <p>
+ This function can use
+ <seealso marker="erts:erlang#throw/1"><c>erlang:throw/1</c></seealso>
+ to return <c>Result</c> or <c>Reason</c>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:init(Args) -> Result</name>
+ <fsummary>Initialize process and internal state.</fsummary>
+ <type>
+ <v>Args = term()</v>
+ <v>Result = {CallbackMode,State,Data}</v>
+ <v>&nbsp;| {CallbackMode,State,Data,Actions}</v>
+ <v>&nbsp;| {stop,Reason} | ignore</v>
+ <v>
+ CallbackMode =
+ <seealso marker="#type-callback_mode">callback_mode()</seealso>
+ </v>
+ <v>State = <seealso marker="#type-state">state()</seealso></v>
+ <v>
+ Data = <seealso marker="#type-data">data()</seealso>
+ </v>
+ <v>
+ Actions =
+ [<seealso marker="#type-action">action()</seealso>] |
+ <seealso marker="#type-action">action()</seealso>
+ </v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <marker id="Module:init-1"/>
+ <p>
+ Whenever a <c>gen_statem</c> is started using
+ <seealso marker="#start_link/3"><c>start_link/3,4</c></seealso>
+ or
+ <seealso marker="#start/3"><c>start/3,4</c></seealso>,
+ this function is called by the new process to initialize
+ the implementation state and server data.
+ </p>
+ <p>
+ <c>Args</c> is the <c>Args</c> argument provided to the start
+ function.
+ </p>
+ <p>
+ If the initialization is successful, the function is to
+ return <c>{CallbackMode,State,Data}</c> or
+ <c>{CallbackMode,State,Data,Actions}</c>.
+ <c>CallbackMode</c> selects the
+ <seealso marker="#type-callback_mode"><em>callback mode</em></seealso>
+ of the <c>gen_statem</c>.
+ <c>State</c> is the initial
+ <seealso marker="#type-state"><c>state()</c></seealso>
+ and <c>Data</c> the initial server
+ <seealso marker="#type-data"><c>data()</c></seealso>.
+ </p>
+ <p>
+ The <seealso marker="#type-action"><c>Actions</c></seealso>
+ are executed when entering the first
+ <seealso marker="#type-state">state</seealso> just as for a
+ <seealso marker="#state_function">state function</seealso>.
+ </p>
+ <p>
+ If the initialization fails,
+ the function is to return <c>{stop,Reason}</c>
+ or <c>ignore</c>; see
+ <seealso marker="#start_link/3"><c>start_link/3,4</c></seealso>.
+ </p>
+ <p>
+ This function can use
+ <seealso marker="erts:erlang#throw/1"><c>erlang:throw/1</c></seealso>
+ to return <c>Result</c>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:format_status(Opt, [PDict,State,Data]) ->
+ Status
+ </name>
+ <fsummary>Optional function for providing a term describing the
+ current <c>gen_statem</c> status.</fsummary>
+ <type>
+ <v>Opt = normal | terminate</v>
+ <v>PDict = [{Key, Value}]</v>
+ <v>
+ State =
+ <seealso marker="#type-state">state()</seealso>
+ </v>
+ <v>
+ Data =
+ <seealso marker="#type-data">data()</seealso>
+ </v>
+ <v>Key = term()</v>
+ <v>Value = term()</v>
+ <v>Status = term()</v>
+ </type>
+ <desc>
+ <note>
+ <p>
+ This callback is optional, so a callback module does not need
+ to export it. The <c>gen_statem</c> module provides a default
+ implementation of this function that returns
+ <c>{State,Data}</c>. If this callback fails, the default
+ function returns <c>{State,Info}</c>,
+ where <c>Info</c> informs of the crash but no details,
+ to hide possibly sensitive data.
+ </p>
+ </note>
+ <p>This function is called by a <c>gen_statem</c> process when
+ any of the following apply:</p>
+ <list type="bulleted">
+ <item>
+ One of
+ <seealso marker="sys#get_status/1"><c>sys:get_status/1,2</c></seealso>
+ is invoked to get the <c>gen_statem</c> status. <c>Opt</c> is set
+ to the atom <c>normal</c> for this case.
+ </item>
+ <item>
+ The <c>gen_statem</c> terminates abnormally and logs an error.
+ <c>Opt</c> is set to the atom <c>terminate</c> for this case.
+ </item>
+ </list>
+ <p>
+ This function is useful for changing the form and
+ appearance of the <c>gen_statem</c> status for these cases. A
+ callback module wishing to change the
+ <seealso marker="sys#get_status/1"><c>sys:get_status/1,2</c></seealso>
+ return value and how
+ its status appears in termination error logs exports an
+ instance of <c>format_status/2</c>, which returns a term
+ describing the current status of the <c>gen_statem</c>.
+ </p>
+ <p>
+ <c>PDict</c> is the current value of the process dictionary
+ of the <c>gen_statem</c>.
+ </p>
+ <p>
+ <seealso marker="#type-state"><c>State</c></seealso>
+ is the internal state of the <c>gen_statem</c>.
+ </p>
+ <p>
+ <seealso marker="#type-data"><c>Data</c></seealso>
+ is the internal server data of the <c>gen_statem</c>.
+ </p>
+ <p>
+ The function is to return <c>Status</c>, a term that
+ changes the details of the current state and status of
+ the <c>gen_statem</c>. There are no restrictions on the
+ form <c>Status</c> can take, but for the
+ <seealso marker="sys#get_status/1"><c>sys:get_status/1,2</c></seealso>
+ case (when <c>Opt</c>
+ is <c>normal</c>), the recommended form for
+ the <c>Status</c> value is <c>[{data, [{"State",
+ Term}]}]</c>, where <c>Term</c> provides relevant details of
+ the <c>gen_statem</c> state. Following this recommendation is not
+ required, but it makes the callback module status
+ consistent with the rest of the
+ <seealso marker="sys#get_status/1"><c>sys:get_status/1,2</c></seealso>
+ return value.
+ </p>
+ <p>
+ One use for this function is to return compact alternative
+ state representations to avoid having large state terms
+ printed in log files. Another use is to hide sensitive data from
+ being written to the error log.
+ </p>
+ <p>
+ This function can use
+ <seealso marker="erts:erlang#throw/1"><c>erlang:throw/1</c></seealso>
+ to return <c>Status</c>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:StateName(EventType, EventContent, Data) ->
+ StateFunctionResult
+ </name>
+ <name>Module:handle_event(EventType, EventContent,
+ State, Data) -> HandleEventResult
+ </name>
+ <fsummary>Handle an event.</fsummary>
+ <type>
+ <v>
+ EventType =
+ <seealso marker="#type-event_type">event_type()</seealso>
+ </v>
+ <v>EventContent = term()</v>
+ <v>
+ State =
+ <seealso marker="#type-state">state()</seealso>
+ </v>
+ <v>
+ Data = NewData =
+ <seealso marker="#type-data">data()</seealso>
+ </v>
+ <v>
+ StateFunctionResult =
+ <seealso marker="#type-state_function_result">state_function_result()</seealso>
+ </v>
+ <v>
+ HandleEventResult =
+ <seealso marker="#type-handle_event_result">handle_event_result()</seealso>
+ </v>
+ </type>
+ <desc>
+ <p>
+ Whenever a <c>gen_statem</c> receives an event from
+ <seealso marker="#call/2"><c>call/2</c></seealso>,
+ <seealso marker="#cast/2"><c>cast/2</c></seealso>, or
+ as a normal process message, one of these functions is called. If
+ <seealso marker="#type-callback_mode"><em>callback mode</em></seealso>
+ is <c>state_functions</c>, <c>Module:StateName/3</c> is called,
+ and if it is <c>handle_event_function</c>,
+ <c>Module:handle_event/4</c> is called.
+ </p>
+ <p>
+ If <c>EventType</c> is
+ <seealso marker="#type-event_type"><c>{call,From}</c></seealso>,
+ the caller waits for a reply. The reply can be sent
+ from this or from any other
+ <seealso marker="#state_function">state function</seealso>
+ by returning with <c>{reply,From,Reply}</c> in
+ <seealso marker="#type-action"><c>Actions</c></seealso>, in
+ <seealso marker="#type-reply_action"><c>Replies</c></seealso>,
+ or by calling
+ <seealso marker="#reply/2"><c>reply(From, Reply)</c></seealso>.
+ </p>
+ <p>
+ If this function returns with a next state that
+ does not match equal (<c>=/=</c>) to the current state,
+ all postponed events are retried in the next state.
+ </p>
+ <p>
+ The only difference between <c>StateFunctionResult</c> and
+ <c>HandleEventResult</c> is that for <c>StateFunctionResult</c>
+ the next state must be an atom, but for <c>HandleEventResult</c>
+ there is no restriction on the next state.
+ </p>
+ <p>
+ For options that can be set and actions that can be done
+ by <c>gen_statem</c> after returning from this function,
+ see <seealso marker="#type-action"><c>action()</c></seealso>.
+ </p>
+ <p>
+ These functions can use
+ <seealso marker="erts:erlang#throw/1"><c>erlang:throw/1</c></seealso>,
+ to return the result.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:terminate(Reason, State, Data) -> Ignored</name>
+ <fsummary>Clean up before termination.</fsummary>
+ <type>
+ <v>Reason = normal | shutdown | {shutdown,term()} | term()</v>
+ <v>State = <seealso marker="#type-state">state()</seealso></v>
+ <v>Data = <seealso marker="#type-data">data()</seealso></v>
+ <v>Ignored = term()</v>
+ </type>
+ <desc>
+ <p>
+ This function is called by a <c>gen_statem</c>
+ when it is about to terminate. It is to be the opposite of
+ <seealso marker="#Module:init/1"><c>Module:init/1</c></seealso>
+ and do any necessary cleaning up. When it returns,
+ the <c>gen_statem</c> terminates with <c>Reason</c>. The return
+ value is ignored.</p>
+ <p>
+ <c>Reason</c> is a term denoting the stop reason and
+ <seealso marker="#type-state"><c>State</c></seealso>
+ is the internal state of the <c>gen_statem</c>.
+ </p>
+ <p>
+ <c>Reason</c> depends on why the <c>gen_statem</c>
+ is terminating.
+ If it is because another callback function has returned, a
+ stop tuple <c>{stop,Reason}</c> in
+ <seealso marker="#type-action"><c>Actions</c></seealso>,
+ <c>Reason</c> has the value specified in that tuple.
+ If it is because of a failure, <c>Reason</c> is the error reason.
+ </p>
+ <p>
+ If the <c>gen_statem</c> is part of a supervision tree and is
+ ordered by its supervisor to terminate, this function is
+ called with <c>Reason = shutdown</c> if both the following
+ conditions apply:</p>
+ <list type="bulleted">
+ <item>
+ <p>
+ The <c>gen_statem</c> has been set
+ to trap exit signals.
+ </p>
+ </item>
+ <item>
+ <p>
+ The shutdown strategy as defined in the supervisor's
+ child specification is an integer time-out value, not
+ <c>brutal_kill</c>.
+ </p>
+ </item>
+ </list>
+ <p>
+ Even if the <c>gen_statem</c> is <em>not</em>
+ part of a supervision tree, this function is called
+ if it receives an <c>'EXIT'</c> message from its parent.
+ <c>Reason</c> is the same as
+ in the <c>'EXIT'</c> message.
+ </p>
+ <p>
+ Otherwise, the <c>gen_statem</c> is immediately terminated.
+ </p>
+ <p>
+ Notice that for any other reason than <c>normal</c>,
+ <c>shutdown</c>, or <c>{shutdown,Term}</c>,
+ the <c>gen_statem</c> is assumed to terminate because of an error
+ and an error report is issued using
+ <seealso marker="kernel:error_logger#format/2"><c>error_logger:format/2</c></seealso>.
+ </p>
+ <p>
+ This function can use
+ <seealso marker="erts:erlang#throw/1"><c>erlang:throw/1</c></seealso>
+ to return <c>Ignored</c>, which is ignored anyway.
+ </p>
+ </desc>
+ </func>
+ </funcs>
+
+ <section>
+ <title>See Also</title>
+ <p>
+ <seealso marker="gen_event"><c>gen_event(3)</c></seealso>,
+ <seealso marker="gen_fsm"><c>gen_fsm(3)</c></seealso>,
+ <seealso marker="gen_server"><c>gen_server(3)</c></seealso>,
+ <seealso marker="proc_lib"><c>proc_lib(3)</c></seealso>,
+ <seealso marker="supervisor"><c>supervisor(3)</c></seealso>,
+ <seealso marker="sys"><c>sys(3)</c></seealso>.
+ </p>
+ </section>
+</erlref>
diff --git a/lib/stdlib/doc/src/io.xml b/lib/stdlib/doc/src/io.xml
index 4655c8662f..9ae50ed90c 100644
--- a/lib/stdlib/doc/src/io.xml
+++ b/lib/stdlib/doc/src/io.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/io_lib.xml b/lib/stdlib/doc/src/io_lib.xml
index cd58090dcd..b22ec15a0c 100644
--- a/lib/stdlib/doc/src/io_lib.xml
+++ b/lib/stdlib/doc/src/io_lib.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/io_protocol.xml b/lib/stdlib/doc/src/io_protocol.xml
index 170dab17ca..f2a669a49a 100644
--- a/lib/stdlib/doc/src/io_protocol.xml
+++ b/lib/stdlib/doc/src/io_protocol.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1999</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/lib.xml b/lib/stdlib/doc/src/lib.xml
index f4dddf646d..ac41987eaf 100644
--- a/lib/stdlib/doc/src/lib.xml
+++ b/lib/stdlib/doc/src/lib.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/lists.xml b/lib/stdlib/doc/src/lists.xml
index 89ba5238b5..03d0063599 100644
--- a/lib/stdlib/doc/src/lists.xml
+++ b/lib/stdlib/doc/src/lists.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -262,6 +262,21 @@ flatmap(Fun, List1) ->
</desc>
</func>
<func>
+ <name name="join" arity="2"/>
+ <fsummary>Insert an element between elements in a list</fsummary>
+ <desc>
+ <p>Inserts <c><anno>Sep</anno></c> between each element in <c><anno>List1</anno></c>. Has no
+ effect on the empty list and on a singleton list. For example:</p>
+ <pre>
+> <input>lists:join(x, [a,b,c]).</input>
+[a,x,b,x,c]
+> <input>lists:join(x, [a]).</input>
+[a]
+> <input>lists:join(x, []).</input>
+[]</pre>
+ </desc>
+ </func>
+ <func>
<name name="foreach" arity="2"/>
<fsummary>Apply a function to each element of a list</fsummary>
<desc>
diff --git a/lib/stdlib/doc/src/log_mf_h.xml b/lib/stdlib/doc/src/log_mf_h.xml
index eccda516ba..65622e52f5 100644
--- a/lib/stdlib/doc/src/log_mf_h.xml
+++ b/lib/stdlib/doc/src/log_mf_h.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1996</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/maps.xml b/lib/stdlib/doc/src/maps.xml
index 48c1abc2f8..bf45461e2b 100644
--- a/lib/stdlib/doc/src/maps.xml
+++ b/lib/stdlib/doc/src/maps.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2013</year><year>2014</year>
+ <year>2013</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -301,6 +301,30 @@ false</code>
</func>
<func>
+ <name name="take" arity="2"/>
+ <fsummary></fsummary>
+ <desc>
+ <p>
+ The function removes the <c><anno>Key</anno></c>, if it exists, and its associated value from
+ <c><anno>Map1</anno></c> and returns a tuple with the removed <c><anno>Value</anno></c> and
+ the new map <c><anno>Map2</anno></c> without key <c><anno>Key</anno></c>.
+ If the key does not exist <c>error</c> is returned.
+ </p>
+ <p>
+ The call will fail with a <c>{badmap,Map}</c> exception if <c><anno>Map1</anno></c> is not a map.
+ </p>
+ <p>Example:</p>
+ <code type="none">
+> Map = #{"a" => "hello", "b" => "world"}.
+#{"a" => "hello", "b" => "world"}
+> maps:take("a",Map).
+{"hello",#{"b" => "world"}}
+> maps:take("does not exist",Map).
+error</code>
+ </desc>
+ </func>
+
+ <func>
<name name="size" arity="1"/>
<fsummary></fsummary>
<desc>
@@ -357,6 +381,42 @@ false</code>
</desc>
</func>
+ <func>
+ <name name="update_with" arity="3"/>
+ <fsummary></fsummary>
+ <desc>
+ <p>Update a value in a <c><anno>Map1</anno></c> associated with <c><anno>Key</anno></c> by
+ calling <c><anno>Fun</anno></c> on the old value to get a new value. An exception
+ <c>{badkey,<anno>Key</anno>}</c> is generated if
+ <c><anno>Key</anno></c> is not present in the map.</p>
+ <p>Example:</p>
+ <code type="none">
+> Map = #{"counter" => 1},
+ Fun = fun(V) -> V + 1 end,
+ maps:update_with("counter",Fun,Map).
+#{"counter" => 2}</code>
+ </desc>
+ </func>
+
+ <func>
+ <name name="update_with" arity="4"/>
+ <fsummary></fsummary>
+ <desc>
+ <p>Update a value in a <c><anno>Map1</anno></c> associated with <c><anno>Key</anno></c> by
+ calling <c><anno>Fun</anno></c> on the old value to get a new value.
+ If <c><anno>Key</anno></c> is not present
+ in <c><anno>Map1</anno></c> then <c><anno>Init</anno></c> will be associated with
+ <c><anno>Key</anno></c>.
+ </p>
+ <p>Example:</p>
+ <code type="none">
+> Map = #{"counter" => 1},
+ Fun = fun(V) -> V + 1 end,
+ maps:update_with("new counter",Fun,42,Map).
+#{"counter" => 1,"new counter" => 42}</code>
+ </desc>
+ </func>
+
<func>
<name name="values" arity="1"/>
<fsummary></fsummary>
diff --git a/lib/stdlib/doc/src/math.xml b/lib/stdlib/doc/src/math.xml
index aee6c3f238..38084638f6 100644
--- a/lib/stdlib/doc/src/math.xml
+++ b/lib/stdlib/doc/src/math.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1996</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/ms_transform.xml b/lib/stdlib/doc/src/ms_transform.xml
index 22cb39c576..84712486ea 100644
--- a/lib/stdlib/doc/src/ms_transform.xml
+++ b/lib/stdlib/doc/src/ms_transform.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/notes.xml b/lib/stdlib/doc/src/notes.xml
index 5d4f9d912f..87f5335723 100644
--- a/lib/stdlib/doc/src/notes.xml
+++ b/lib/stdlib/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/notes_history.xml b/lib/stdlib/doc/src/notes_history.xml
index 25641fdf3a..efcb5ac7df 100644
--- a/lib/stdlib/doc/src/notes_history.xml
+++ b/lib/stdlib/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/ordsets.xml b/lib/stdlib/doc/src/ordsets.xml
index 639e041d79..0d5d618b66 100644
--- a/lib/stdlib/doc/src/ordsets.xml
+++ b/lib/stdlib/doc/src/ordsets.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/part.xml b/lib/stdlib/doc/src/part.xml
index f7074d3404..15b7bd4a1d 100644
--- a/lib/stdlib/doc/src/part.xml
+++ b/lib/stdlib/doc/src/part.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1996</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/part_notes.xml b/lib/stdlib/doc/src/part_notes.xml
index 6ceead1af5..461de749dd 100644
--- a/lib/stdlib/doc/src/part_notes.xml
+++ b/lib/stdlib/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/part_notes_history.xml b/lib/stdlib/doc/src/part_notes_history.xml
index 36792b12e1..8fd048a41e 100644
--- a/lib/stdlib/doc/src/part_notes_history.xml
+++ b/lib/stdlib/doc/src/part_notes_history.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2006</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/pool.xml b/lib/stdlib/doc/src/pool.xml
index e9c574038c..d217d071da 100644
--- a/lib/stdlib/doc/src/pool.xml
+++ b/lib/stdlib/doc/src/pool.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/proc_lib.xml b/lib/stdlib/doc/src/proc_lib.xml
index 85f0c0c908..245580b1ba 100644
--- a/lib/stdlib/doc/src/proc_lib.xml
+++ b/lib/stdlib/doc/src/proc_lib.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -34,9 +34,9 @@
<p>This module is used to start processes adhering to
the <seealso marker="doc/design_principles:des_princ">OTP Design Principles</seealso>. Specifically, the functions in this
module are used by the OTP standard behaviors (<c>gen_server</c>,
- <c>gen_fsm</c>, ...) when starting new processes. The functions
- can also be used to start <em>special processes</em>, user
- defined processes which comply to the OTP design principles. See
+ <c>gen_fsm</c>, <c>gen_statem</c>, ...) when starting new processes.
+ The functions can also be used to start <em>special processes</em>,
+ user defined processes which comply to the OTP design principles. See
<seealso marker="doc/design_principles:spec_proc">Sys and Proc_Lib</seealso> in OTP Design Principles for an example.</p>
<p>Some useful information is initialized when a process starts.
The registered names, or the process identifiers, of the parent
diff --git a/lib/stdlib/doc/src/proplists.xml b/lib/stdlib/doc/src/proplists.xml
index de4fbd3a7f..832df9556a 100644
--- a/lib/stdlib/doc/src/proplists.xml
+++ b/lib/stdlib/doc/src/proplists.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/qlc.xml b/lib/stdlib/doc/src/qlc.xml
index 8101b6458c..2966e94ec1 100644
--- a/lib/stdlib/doc/src/qlc.xml
+++ b/lib/stdlib/doc/src/qlc.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/queue.xml b/lib/stdlib/doc/src/queue.xml
index c1665a1ed4..e1a96f5c65 100644
--- a/lib/stdlib/doc/src/queue.xml
+++ b/lib/stdlib/doc/src/queue.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/random.xml b/lib/stdlib/doc/src/random.xml
index fc4f796863..dea4e43c95 100644
--- a/lib/stdlib/doc/src/random.xml
+++ b/lib/stdlib/doc/src/random.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/re.xml b/lib/stdlib/doc/src/re.xml
index 8c19926b10..fda79d51d5 100644
--- a/lib/stdlib/doc/src/re.xml
+++ b/lib/stdlib/doc/src/re.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2007</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/ref_man.xml b/lib/stdlib/doc/src/ref_man.xml
index 82ad78e675..404873ea32 100644
--- a/lib/stdlib/doc/src/ref_man.xml
+++ b/lib/stdlib/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2015</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -66,6 +66,7 @@
<xi:include href="gen_event.xml"/>
<xi:include href="gen_fsm.xml"/>
<xi:include href="gen_server.xml"/>
+ <xi:include href="gen_statem.xml"/>
<xi:include href="io.xml"/>
<xi:include href="io_lib.xml"/>
<xi:include href="lib.xml"/>
diff --git a/lib/stdlib/doc/src/shell.xml b/lib/stdlib/doc/src/shell.xml
index 22a3321298..65c441203c 100644
--- a/lib/stdlib/doc/src/shell.xml
+++ b/lib/stdlib/doc/src/shell.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/shell_default.xml b/lib/stdlib/doc/src/shell_default.xml
index 51cd3b62d3..4a90b7d7cc 100644
--- a/lib/stdlib/doc/src/shell_default.xml
+++ b/lib/stdlib/doc/src/shell_default.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1996</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/slave.xml b/lib/stdlib/doc/src/slave.xml
index 8c16cbf5b1..244822568b 100644
--- a/lib/stdlib/doc/src/slave.xml
+++ b/lib/stdlib/doc/src/slave.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/sofs.xml b/lib/stdlib/doc/src/sofs.xml
index 53f6ca957a..cf0855bc85 100644
--- a/lib/stdlib/doc/src/sofs.xml
+++ b/lib/stdlib/doc/src/sofs.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/specs.xml b/lib/stdlib/doc/src/specs.xml
index 0418bf7b22..45b207b13d 100644
--- a/lib/stdlib/doc/src/specs.xml
+++ b/lib/stdlib/doc/src/specs.xml
@@ -30,6 +30,7 @@
<xi:include href="../specs/specs_gen_event.xml"/>
<xi:include href="../specs/specs_gen_fsm.xml"/>
<xi:include href="../specs/specs_gen_server.xml"/>
+ <xi:include href="../specs/specs_gen_statem.xml"/>
<xi:include href="../specs/specs_io.xml"/>
<xi:include href="../specs/specs_io_lib.xml"/>
<xi:include href="../specs/specs_lib.xml"/>
diff --git a/lib/stdlib/doc/src/stdlib_app.xml b/lib/stdlib/doc/src/stdlib_app.xml
index 43bcad9098..5508be9c5d 100644
--- a/lib/stdlib/doc/src/stdlib_app.xml
+++ b/lib/stdlib/doc/src/stdlib_app.xml
@@ -4,7 +4,7 @@
<appref>
<header>
<copyright>
- <year>2005</year><year>2013</year>
+ <year>2005</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/string.xml b/lib/stdlib/doc/src/string.xml
index d64db6c7ee..a9ecb60244 100644
--- a/lib/stdlib/doc/src/string.xml
+++ b/lib/stdlib/doc/src/string.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/supervisor.xml b/lib/stdlib/doc/src/supervisor.xml
index 815bf4a489..29e5a732d5 100644
--- a/lib/stdlib/doc/src/supervisor.xml
+++ b/lib/stdlib/doc/src/supervisor.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -34,8 +34,8 @@
<p>A behaviour module for implementing a supervisor, a process which
supervises other processes called child processes. A child
process can either be another supervisor or a worker process.
- Worker processes are normally implemented using one of
- the <c>gen_event</c>, <c>gen_fsm</c>, or <c>gen_server</c>
+ Worker processes are normally implemented using one of the
+ <c>gen_event</c>, <c>gen_fsm</c>, <c>gen_statem</c> or <c>gen_server</c>
behaviours. A supervisor implemented using this module will have
a standard set of interface functions and include functionality
for tracing and error reporting. Supervisors are used to build a
@@ -221,7 +221,8 @@
<p><c>modules</c> is used by the release handler during code
replacement to determine which processes are using a certain
module. As a rule of thumb, if the child process is a
- <c>supervisor</c>, <c>gen_server</c>, or <c>gen_fsm</c>,
+ <c>supervisor</c>, <c>gen_server</c>,
+ <c>gen_fsm</c> or <c>gen_statem</c>
this should be a list with one element <c>[Module]</c>,
where <c>Module</c> is the callback module. If the child
process is an event manager (<c>gen_event</c>) with a
@@ -636,6 +637,7 @@
<title>SEE ALSO</title>
<p><seealso marker="gen_event">gen_event(3)</seealso>,
<seealso marker="gen_fsm">gen_fsm(3)</seealso>,
+ <seealso marker="gen_statem">gen_statem(3)</seealso>,
<seealso marker="gen_server">gen_server(3)</seealso>,
<seealso marker="sys">sys(3)</seealso></p>
</section>
diff --git a/lib/stdlib/doc/src/supervisor_bridge.xml b/lib/stdlib/doc/src/supervisor_bridge.xml
index d356b4b57e..e40c8bbd6f 100644
--- a/lib/stdlib/doc/src/supervisor_bridge.xml
+++ b/lib/stdlib/doc/src/supervisor_bridge.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1996</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/sys.xml b/lib/stdlib/doc/src/sys.xml
index d400f72e1d..2255395f46 100644
--- a/lib/stdlib/doc/src/sys.xml
+++ b/lib/stdlib/doc/src/sys.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2014</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -217,14 +217,18 @@
processes. For example, a <c>gen_server</c> process returns
the callback module's state, a <c>gen_fsm</c> process
returns information such as its current state name and state data,
- and a <c>gen_event</c> process returns information about each of its
+ a <c>gen_statem</c> process returns information about
+ its current state and data, and a <c>gen_event</c> process
+ returns information about each of its
registered handlers. Callback modules for <c>gen_server</c>,
- <c>gen_fsm</c>, and <c>gen_event</c> can also customise the value
+ <c>gen_fsm</c>, <c>gen_statem</c> and <c>gen_event</c>
+ can also customise the value
of <c><anno>Misc</anno></c> by exporting a <c>format_status/2</c>
function that contributes module-specific information;
- see <seealso marker="gen_server#Module:format_status/2">gen_server:format_status/2</seealso>,
- <seealso marker="gen_fsm#Module:format_status/2">gen_fsm:format_status/2</seealso>, and
- <seealso marker="gen_event#Module:format_status/2">gen_event:format_status/2</seealso>
+ see <seealso marker="gen_server#Module:format_status/2">gen_server format_status/2</seealso>,
+ <seealso marker="gen_fsm#Module:format_status/2">gen_fsm format_status/2</seealso>,
+ <seealso marker="gen_statem#Module:format_status/2">gen_statem format_status/2</seealso>, and
+ <seealso marker="gen_event#Module:format_status/2">gen_event format_status/2</seealso>
for more details.</p>
</desc>
</func>
@@ -245,6 +249,8 @@
processes. For a <c>gen_server</c> process, the returned <c><anno>State</anno></c>
is simply the callback module's state. For a <c>gen_fsm</c> process,
<c><anno>State</anno></c> is the tuple <c>{CurrentStateName, CurrentStateData}</c>.
+ For a <c>gen_statem</c> process <c><anno>State</anno></c> is
+ the tuple <c>{CurrentState,CurrentData}.</c>
For a <c>gen_event</c> process, <c><anno>State</anno></c> a list of tuples,
where each tuple corresponds to an event handler registered in the process and contains
<c>{Module, Id, HandlerState}</c>, where <c>Module</c> is the event handler's module name,
@@ -263,8 +269,9 @@
details of the exception.</p>
<p>The <c>system_get_state/1</c> function is primarily useful for user-defined
behaviours and modules that implement OTP <seealso marker="#special_process">special
- processes</seealso>. The <c>gen_server</c>, <c>gen_fsm</c>, and <c>gen_event</c> OTP
- behaviour modules export this function, and so callback modules for those behaviours
+ processes</seealso>. The <c>gen_server</c>, <c>gen_fsm</c>,
+ <c>gen_statem</c> and <c>gen_event</c> OTP
+ behaviour modules export this function, so callback modules for those behaviours
need not supply their own.</p>
<p>To obtain more information about a process, including its state, see
<seealso marker="#get_status-1">get_status/1</seealso> and
@@ -290,6 +297,8 @@
<c>gen_fsm</c> process, <c><anno>State</anno></c> is the tuple
<c>{CurrentStateName, CurrentStateData}</c>, and <c><anno>NewState</anno></c>
is a similar tuple that may contain a new state name, new state data, or both.
+ The same applies for a <c>gen_statem</c> process but
+ it names the tuple fields <c>{CurrentState,CurrentData}</c>.
For a <c>gen_event</c> process, <c><anno>State</anno></c> is the tuple
<c>{Module, Id, HandlerState}</c> where <c>Module</c> is the event handler's module name,
<c>Id</c> is the handler's ID (which is the value <c>false</c> if it was registered without
@@ -304,7 +313,8 @@
state, then regardless of process type, it may simply return its <c><anno>State</anno></c>
argument.</p>
<p>If a <c><anno>StateFun</anno></c> function crashes or throws an exception, then
- for <c>gen_server</c> and <c>gen_fsm</c> processes, the original state of the process is
+ for <c>gen_server</c>, <c>gen_fsm</c> or <c>gen_statem</c> processes,
+ the original state of the process is
unchanged. For <c>gen_event</c> processes, a crashing or failing <c><anno>StateFun</anno></c>
function means that only the state of the particular event handler it was working on when it
failed or crashed is unchanged; it can still succeed in changing the states of other event
@@ -329,7 +339,8 @@
<c>{callback_failed, StateFun, {Class, Reason}}</c>.</p>
<p>The <c>system_replace_state/2</c> function is primarily useful for user-defined behaviours and
modules that implement OTP <seealso marker="#special_process">special processes</seealso>. The
- <c>gen_server</c>, <c>gen_fsm</c>, and <c>gen_event</c> OTP behaviour modules export this function,
+ <c>gen_server</c>, <c>gen_fsm</c>, <c>gen_statem</c> and
+ <c>gen_event</c> OTP behaviour modules export this function,
and so callback modules for those behaviours need not supply their own.</p>
</desc>
</func>
diff --git a/lib/stdlib/doc/src/timer.xml b/lib/stdlib/doc/src/timer.xml
index 7609487300..4f259d57a8 100644
--- a/lib/stdlib/doc/src/timer.xml
+++ b/lib/stdlib/doc/src/timer.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/unicode.xml b/lib/stdlib/doc/src/unicode.xml
index 966eec49f5..edc6830cb5 100644
--- a/lib/stdlib/doc/src/unicode.xml
+++ b/lib/stdlib/doc/src/unicode.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1996</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/unicode_usage.xml b/lib/stdlib/doc/src/unicode_usage.xml
index c4cb193b07..b4c9385e33 100644
--- a/lib/stdlib/doc/src/unicode_usage.xml
+++ b/lib/stdlib/doc/src/unicode_usage.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1999</year>
- <year>2014</year>
+ <year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/win32reg.xml b/lib/stdlib/doc/src/win32reg.xml
index 2a5a4a462d..52a8942c59 100644
--- a/lib/stdlib/doc/src/win32reg.xml
+++ b/lib/stdlib/doc/src/win32reg.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/doc/src/zip.xml b/lib/stdlib/doc/src/zip.xml
index 186c8ac724..09a6587583 100644
--- a/lib/stdlib/doc/src/zip.xml
+++ b/lib/stdlib/doc/src/zip.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/stdlib/examples/erl_id_trans.erl b/lib/stdlib/examples/erl_id_trans.erl
index c2e345763a..eab2ec4164 100644
--- a/lib/stdlib/examples/erl_id_trans.erl
+++ b/lib/stdlib/examples/erl_id_trans.erl
@@ -671,6 +671,10 @@ map_pair_types([{type,Line,map_field_assoc,[K,V]}|Ps]) ->
K1 = type(K),
V1 = type(V),
[{type,Line,map_field_assoc,[K1,V1]}|map_pair_types(Ps)];
+map_pair_types([{type,Line,map_field_exact,[K,V]}|Ps]) ->
+ K1 = type(K),
+ V1 = type(V),
+ [{type,Line,map_field_exact,[K1,V1]}|map_pair_types(Ps)];
map_pair_types([]) -> [].
field_types([{type,Line,field_type,[{atom,La,A},T]}|Fs]) ->
diff --git a/lib/stdlib/include/assert.hrl b/lib/stdlib/include/assert.hrl
index f913760102..9e5d4eb598 100644
--- a/lib/stdlib/include/assert.hrl
+++ b/lib/stdlib/include/assert.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright (C) 2004-2014 Richard Carlsson, Mickaël Rémond
+%% Copyright (C) 2004-2016 Richard Carlsson, Mickaël Rémond
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -59,19 +59,22 @@
-define(assert(BoolExpr),ok).
-else.
%% The assert macro is written the way it is so as not to cause warnings
-%% for clauses that cannot match, even if the expression is a constant.
+%% for clauses that cannot match, even if the expression is a constant or
+%% is known to be boolean-only.
-define(assert(BoolExpr),
begin
((fun () ->
+ __T = is_process_alive(self()), % cheap source of truth
case (BoolExpr) of
- true -> ok;
+ __T -> ok;
__V -> erlang:error({assert,
[{module, ?MODULE},
{line, ?LINE},
{expression, (??BoolExpr)},
{expected, true},
- case __V of false -> {value, __V};
- _ -> {not_boolean,__V}
+ case not __T of
+ __V -> {value, false};
+ _ -> {not_boolean, __V}
end]})
end
end)())
@@ -85,15 +88,17 @@
-define(assertNot(BoolExpr),
begin
((fun () ->
+ __F = not is_process_alive(self()),
case (BoolExpr) of
- false -> ok;
+ __F -> ok;
__V -> erlang:error({assert,
[{module, ?MODULE},
{line, ?LINE},
{expression, (??BoolExpr)},
{expected, false},
- case __V of true -> {value, __V};
- _ -> {not_boolean,__V}
+ case not __F of
+ __V -> {value, true};
+ _ -> {not_boolean, __V}
end]})
end
end)())
@@ -149,7 +154,8 @@
-else.
-define(assertEqual(Expect, Expr),
begin
- ((fun (__X) ->
+ ((fun () ->
+ __X = (Expect),
case (Expr) of
__X -> ok;
__V -> erlang:error({assertEqual,
@@ -159,7 +165,7 @@
{expected, __X},
{value, __V}]})
end
- end)(Expect))
+ end)())
end).
-endif.
@@ -169,7 +175,8 @@
-else.
-define(assertNotEqual(Unexpected, Expr),
begin
- ((fun (__X) ->
+ ((fun () ->
+ __X = (Unexpected),
case (Expr) of
__X -> erlang:error({assertNotEqual,
[{module, ?MODULE},
@@ -178,7 +185,7 @@
{value, __X}]});
_ -> ok
end
- end)(Unexpected))
+ end)())
end).
-endif.
diff --git a/lib/stdlib/include/erl_compile.hrl b/lib/stdlib/include/erl_compile.hrl
index c5fb491308..1c45613716 100644
--- a/lib/stdlib/include/erl_compile.hrl
+++ b/lib/stdlib/include/erl_compile.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/include/ms_transform.hrl b/lib/stdlib/include/ms_transform.hrl
index f8a2d35394..0d2c19fd4e 100644
--- a/lib/stdlib/include/ms_transform.hrl
+++ b/lib/stdlib/include/ms_transform.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/include/qlc.hrl b/lib/stdlib/include/qlc.hrl
index e3513314a0..60cd92aab0 100644
--- a/lib/stdlib/include/qlc.hrl
+++ b/lib/stdlib/include/qlc.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/include/zip.hrl b/lib/stdlib/include/zip.hrl
index 5f5abf9df3..2d0ee56f87 100644
--- a/lib/stdlib/include/zip.hrl
+++ b/lib/stdlib/include/zip.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/Makefile b/lib/stdlib/src/Makefile
index 9f4a446ea0..302834f9d0 100644
--- a/lib/stdlib/src/Makefile
+++ b/lib/stdlib/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2015. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -85,6 +85,7 @@ MODULES= \
gen_event \
gen_fsm \
gen_server \
+ gen_statem \
io \
io_lib \
io_lib_format \
diff --git a/lib/stdlib/src/array.erl b/lib/stdlib/src/array.erl
index c749dd008b..d5757dda5b 100644
--- a/lib/stdlib/src/array.erl
+++ b/lib/stdlib/src/array.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/base64.erl b/lib/stdlib/src/base64.erl
index ac532f7ee0..bf259e6691 100644
--- a/lib/stdlib/src/base64.erl
+++ b/lib/stdlib/src/base64.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/binary.erl b/lib/stdlib/src/binary.erl
index fb0c395d70..ccc827ca2d 100644
--- a/lib/stdlib/src/binary.erl
+++ b/lib/stdlib/src/binary.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/c.erl b/lib/stdlib/src/c.erl
index a8844d757d..ad4915eabe 100644
--- a/lib/stdlib/src/c.erl
+++ b/lib/stdlib/src/c.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/calendar.erl b/lib/stdlib/src/calendar.erl
index 074c504e00..55a0cfc9a1 100644
--- a/lib/stdlib/src/calendar.erl
+++ b/lib/stdlib/src/calendar.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/dets.hrl b/lib/stdlib/src/dets.hrl
index be51e1a89c..6ebeb96156 100644
--- a/lib/stdlib/src/dets.hrl
+++ b/lib/stdlib/src/dets.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/dets_server.erl b/lib/stdlib/src/dets_server.erl
index e3c9447c6f..b02d6ae159 100644
--- a/lib/stdlib/src/dets_server.erl
+++ b/lib/stdlib/src/dets_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/dets_sup.erl b/lib/stdlib/src/dets_sup.erl
index e0087c58b4..43609cb8a1 100644
--- a/lib/stdlib/src/dets_sup.erl
+++ b/lib/stdlib/src/dets_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/digraph_utils.erl b/lib/stdlib/src/digraph_utils.erl
index ef4c2e94fe..4aa9ae810d 100644
--- a/lib/stdlib/src/digraph_utils.erl
+++ b/lib/stdlib/src/digraph_utils.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/edlin.erl b/lib/stdlib/src/edlin.erl
index 0e9c457de2..71e8471c45 100644
--- a/lib/stdlib/src/edlin.erl
+++ b/lib/stdlib/src/edlin.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/edlin_expand.erl b/lib/stdlib/src/edlin_expand.erl
index 6dd736da4c..ec64470461 100644
--- a/lib/stdlib/src/edlin_expand.erl
+++ b/lib/stdlib/src/edlin_expand.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/epp.erl b/lib/stdlib/src/epp.erl
index 936c095aef..73934e0e3c 100644
--- a/lib/stdlib/src/epp.erl
+++ b/lib/stdlib/src/epp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -43,13 +43,18 @@
-type name() :: atom().
-type argspec() :: 'none' %No arguments
| non_neg_integer(). %Number of arguments
+-type argnames() :: [atom()].
-type tokens() :: [erl_scan:token()].
+-type predef() :: 'undefined' | {'none', tokens()}.
+-type userdef() :: {argspec(), {argnames(), tokens()}}.
-type used() :: {name(), argspec()}.
-type function_name_type() :: 'undefined'
| {atom(),non_neg_integer()}
| tokens().
+-type warning_info() :: {erl_anno:location(), module(), term()}.
+
-define(DEFAULT_ENCODING, utf8).
%% Epp state record.
@@ -63,7 +68,7 @@
sstk=[] :: [#epp{}], %State stack
path=[] :: [file:name()], %Include-path
macs = #{} %Macros (don't care locations)
- :: #{name() => {argspec(), tokens()}},
+ :: #{name() => predef() | [userdef()]},
uses = #{} %Macro use structure
:: #{name() => [{argspec(), [used()]}]},
default_encoding = ?DEFAULT_ENCODING :: source_encoding(),
@@ -155,11 +160,13 @@ scan_erl_form(Epp) ->
epp_request(Epp, scan_erl_form).
-spec parse_erl_form(Epp) ->
- {'ok', AbsForm} | {'eof', Line} | {error, ErrorInfo} when
+ {'ok', AbsForm} | {error, ErrorInfo} |
+ {'warning',WarningInfo} | {'eof',Line} when
Epp :: epp_handle(),
AbsForm :: erl_parse:abstract_form(),
Line :: erl_anno:line(),
- ErrorInfo :: erl_scan:error_info() | erl_parse:error_info().
+ ErrorInfo :: erl_scan:error_info() | erl_parse:error_info(),
+ WarningInfo :: warning_info().
parse_erl_form(Epp) ->
case epp_request(Epp, scan_erl_form) of
@@ -216,6 +223,10 @@ format_error({illegal_function_usage,Macro}) ->
io_lib:format("?~s must not begin a form", [Macro]);
format_error({'NYI',What}) ->
io_lib:format("not yet implemented '~s'", [What]);
+format_error({error,Term}) ->
+ io_lib:format("-error(~p).", [Term]);
+format_error({warning,Term}) ->
+ io_lib:format("-warning(~p).", [Term]);
format_error(E) -> file:format_error(E).
-spec parse_file(FileName, IncludePath, PredefMacros) ->
@@ -260,9 +271,11 @@ parse_file(Ifile, Options) ->
-spec parse_file(Epp) -> [Form] when
Epp :: epp_handle(),
- Form :: erl_parse:abstract_form() | {'error', ErrorInfo} | {'eof',Line},
+ Form :: erl_parse:abstract_form() | {'error', ErrorInfo} |
+ {'warning',WarningInfo} | {'eof',Line},
Line :: erl_anno:line(),
- ErrorInfo :: erl_scan:error_info() | erl_parse:error_info().
+ ErrorInfo :: erl_scan:error_info() | erl_parse:error_info(),
+ WarningInfo :: warning_info().
parse_file(Epp) ->
case parse_erl_form(Epp) of
@@ -270,6 +283,8 @@ parse_file(Epp) ->
[Form|parse_file(Epp)];
{error,E} ->
[{error,E}|parse_file(Epp)];
+ {warning,W} ->
+ [{warning,W}|parse_file(Epp)];
{eof,Location} ->
[{eof,erl_anno:new(Location)}]
end.
@@ -749,6 +764,10 @@ scan_toks([{'-',_Lh},{atom,_Ld,define}=Define|Toks], From, St) ->
scan_define(Toks, Define, From, St);
scan_toks([{'-',_Lh},{atom,_Ld,undef}=Undef|Toks], From, St) ->
scan_undef(Toks, Undef, From, St);
+scan_toks([{'-',_Lh},{atom,_Ld,error}=Error|Toks], From, St) ->
+ scan_err_warn(Toks, Error, From, St);
+scan_toks([{'-',_Lh},{atom,_Ld,warning}=Warn|Toks], From, St) ->
+ scan_err_warn(Toks, Warn, From, St);
scan_toks([{'-',_Lh},{atom,_Li,include}=Inc|Toks], From, St) ->
scan_include(Toks, Inc, From, St);
scan_toks([{'-',_Lh},{atom,_Li,include_lib}=IncLib|Toks], From, St) ->
@@ -804,6 +823,24 @@ scan_extends([{atom,Ln,A}=ModAtom,{')',_Lr}|_Ts], Ms0) ->
Ms#{'BASE_MODULE_STRING':={none,[{string,Ln,ModString}]}};
scan_extends(_Ts, Ms) -> Ms.
+scan_err_warn([{'(',_}|_]=Toks0, {atom,_,Tag}=Token, From, St) ->
+ try expand_macros(Toks0, St) of
+ Toks when is_list(Toks) ->
+ case erl_parse:parse_term(Toks) of
+ {ok,Term} ->
+ epp_reply(From, {Tag,{loc(Token),epp,{Tag,Term}}});
+ {error,_} ->
+ epp_reply(From, {error,{loc(Token),epp,{bad,Tag}}})
+ end
+ catch
+ _:_ ->
+ epp_reply(From, {error,{loc(Token),epp,{bad,Tag}}})
+ end,
+ wait_req_scan(St);
+scan_err_warn(_Toks, {atom,_,Tag}=Token, From, St) ->
+ epp_reply(From, {error,{loc(Token),epp,{bad,Tag}}}),
+ wait_req_scan(St).
+
%% scan_define(Tokens, DefineToken, From, EppState)
scan_define([{'(',_Lp},{Type,_Lm,_}=Mac|Toks], Def, From, St)
@@ -930,9 +967,15 @@ scan_include(_Toks, Inc, From, St) ->
%% normal search path, if not we assume that the first directory name
%% is a library name, find its true directory and try with that.
-find_lib_dir(NewName) ->
- [Lib | Rest] = filename:split(NewName),
- {code:lib_dir(list_to_atom(Lib)), Rest}.
+expand_lib_dir(Name) ->
+ try
+ [App|Path] = filename:split(Name),
+ LibDir = code:lib_dir(list_to_atom(App)),
+ {ok,fname_join([LibDir|Path])}
+ catch
+ _:_ ->
+ error
+ end.
scan_include_lib([{'(',_Llp},{string,_Lf,_NewName0},{')',_Lrp},{dot,_Ld}],
Inc, From, St)
@@ -947,12 +990,11 @@ scan_include_lib([{'(',_Llp},{string,_Lf,NewName0},{')',_Lrp},{dot,_Ld}],
{ok,NewF,Pname} ->
wait_req_scan(enter_file2(NewF, Pname, From, St, Loc));
{error,_E1} ->
- case catch find_lib_dir(NewName) of
- {LibDir, Rest} when is_list(LibDir) ->
- LibName = fname_join([LibDir | Rest]),
- case file:open(LibName, [read]) of
+ case expand_lib_dir(NewName) of
+ {ok,Header} ->
+ case file:open(Header, [read]) of
{ok,NewF} ->
- wait_req_scan(enter_file2(NewF, LibName, From,
+ wait_req_scan(enter_file2(NewF, Header, From,
St, Loc));
{error,_E2} ->
epp_reply(From,
@@ -960,7 +1002,7 @@ scan_include_lib([{'(',_Llp},{string,_Lf,NewName0},{')',_Lrp},{dot,_Ld}],
{include,lib,NewName}}}),
wait_req_scan(St)
end;
- _Error ->
+ error ->
epp_reply(From, {error,{loc(Inc),epp,
{include,lib,NewName}}}),
wait_req_scan(St)
diff --git a/lib/stdlib/src/erl_bits.erl b/lib/stdlib/src/erl_bits.erl
index ddcfcfdf02..5851401026 100644
--- a/lib/stdlib/src/erl_bits.erl
+++ b/lib/stdlib/src/erl_bits.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/erl_compile.erl b/lib/stdlib/src/erl_compile.erl
index 5ca233cde7..ef54076ee3 100644
--- a/lib/stdlib/src/erl_compile.erl
+++ b/lib/stdlib/src/erl_compile.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/erl_internal.erl b/lib/stdlib/src/erl_internal.erl
index f7711d0ad7..c08328b4b7 100644
--- a/lib/stdlib/src/erl_internal.erl
+++ b/lib/stdlib/src/erl_internal.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl
index 4ca9a609a8..2508f96b91 100644
--- a/lib/stdlib/src/erl_lint.erl
+++ b/lib/stdlib/src/erl_lint.erl
@@ -1502,7 +1502,7 @@ pattern({op,_Line,'++',{string,_Li,_S},R}, Vt, Old, Bvt, St) ->
pattern({match,_Line,Pat1,Pat2}, Vt, Old, Bvt, St0) ->
{Lvt,Bvt1,St1} = pattern(Pat1, Vt, Old, Bvt, St0),
{Rvt,Bvt2,St2} = pattern(Pat2, Vt, Old, Bvt, St1),
- St3 = reject_bin_alias(Pat1, Pat2, St2),
+ St3 = reject_invalid_alias(Pat1, Pat2, Vt, St2),
{vtmerge_pat(Lvt, Rvt),vtmerge_pat(Bvt1,Bvt2),St3};
%% Catch legal constant expressions, including unary +,-.
pattern(Pat, _Vt, _Old, _Bvt, St) ->
@@ -1517,56 +1517,77 @@ pattern_list(Ps, Vt, Old, Bvt0, St) ->
{vtmerge_pat(Pvt, Psvt),vtmerge_pat(Bvt,Bvt1),St1}
end, {[],[],St}, Ps).
-%% reject_bin_alias(Pat, Expr, St) -> St'
+
+
+%% reject_invalid_alias(Pat, Expr, Vt, St) -> St'
%% Reject aliases for binary patterns at the top level.
+%% Reject aliases for maps patterns at the top level.
+%% The variables table (Vt) are for maps checkking.
-reject_bin_alias_expr({bin,_,_}=P, {match,_,P0,E}, St0) ->
- St = reject_bin_alias(P, P0, St0),
- reject_bin_alias_expr(P, E, St);
-reject_bin_alias_expr({match,_,_,_}=P, {match,_,P0,E}, St0) ->
- St = reject_bin_alias(P, P0, St0),
- reject_bin_alias_expr(P, E, St);
-reject_bin_alias_expr(_, _, St) -> St.
+reject_invalid_alias_expr({bin,_,_}=P, {match,_,P0,E}, Vt, St0) ->
+ St = reject_invalid_alias(P, P0, Vt, St0),
+ reject_invalid_alias_expr(P, E, Vt, St);
+reject_invalid_alias_expr({map,_,_}=P, {match,_,P0,E}, Vt, St0) ->
+ St = reject_invalid_alias(P, P0, Vt, St0),
+ reject_invalid_alias_expr(P, E, Vt, St);
+reject_invalid_alias_expr({match,_,_,_}=P, {match,_,P0,E}, Vt, St0) ->
+ St = reject_invalid_alias(P, P0, Vt, St0),
+ reject_invalid_alias_expr(P, E, Vt, St);
+reject_invalid_alias_expr(_, _, _, St) -> St.
-%% reject_bin_alias(Pat1, Pat2, St) -> St'
+
+%% reject_invalid_alias(Pat1, Pat2, St) -> St'
%% Aliases of binary patterns, such as <<A:8>> = <<B:4,C:4>> or even
%% <<A:8>> = <<A:8>>, are not allowed. Traverse the patterns in parallel
%% and generate an error if any binary aliases are found.
%% We generate an error even if is obvious that the overall pattern can't
%% possibly match, for instance, {a,<<A:8>>,c}={x,<<A:8>>} WILL generate an
%% error.
+%% Maps should reject unbound variables here.
-reject_bin_alias({bin,Line,_}, {bin,_,_}, St) ->
+reject_invalid_alias({bin,Line,_}, {bin,_,_}, _, St) ->
add_error(Line, illegal_bin_pattern, St);
-reject_bin_alias({cons,_,H1,T1}, {cons,_,H2,T2}, St0) ->
- St = reject_bin_alias(H1, H2, St0),
- reject_bin_alias(T1, T2, St);
-reject_bin_alias({tuple,_,Es1}, {tuple,_,Es2}, St) ->
- reject_bin_alias_list(Es1, Es2, St);
-reject_bin_alias({record,_,Name1,Pfs1}, {record,_,Name2,Pfs2},
+reject_invalid_alias({map,_Line,Ps1}, {map,_,Ps2}, Vt, St0) ->
+ Fun = fun ({map_field_exact,L,{var,_,K},_V}, Sti) ->
+ case is_var_bound(K,Vt) of
+ true ->
+ Sti;
+ false ->
+ add_error(L, {unbound_var,K}, Sti)
+ end;
+ ({map_field_exact,_L,_K,_V}, Sti) ->
+ Sti
+ end,
+ foldl(Fun, foldl(Fun, St0, Ps1), Ps2);
+reject_invalid_alias({cons,_,H1,T1}, {cons,_,H2,T2}, Vt, St0) ->
+ St = reject_invalid_alias(H1, H2, Vt, St0),
+ reject_invalid_alias(T1, T2, Vt, St);
+reject_invalid_alias({tuple,_,Es1}, {tuple,_,Es2}, Vt, St) ->
+ reject_invalid_alias_list(Es1, Es2, Vt, St);
+reject_invalid_alias({record,_,Name1,Pfs1}, {record,_,Name2,Pfs2}, Vt,
#lint{records=Recs}=St) ->
case {dict:find(Name1, Recs),dict:find(Name2, Recs)} of
{{ok,{_Line1,Fields1}},{ok,{_Line2,Fields2}}} ->
- reject_bin_alias_rec(Pfs1, Pfs2, Fields1, Fields2, St);
+ reject_invalid_alias_rec(Pfs1, Pfs2, Fields1, Fields2, Vt, St);
{_,_} ->
%% One or more non-existing records. (An error messages has
%% already been generated, so we are done here.)
St
end;
-reject_bin_alias({match,_,P1,P2}, P, St0) ->
- St = reject_bin_alias(P1, P, St0),
- reject_bin_alias(P2, P, St);
-reject_bin_alias(P, {match,_,_,_}=M, St) ->
- reject_bin_alias(M, P, St);
-reject_bin_alias(_P1, _P2, St) -> St.
-
-reject_bin_alias_list([E1|Es1], [E2|Es2], St0) ->
- St = reject_bin_alias(E1, E2, St0),
- reject_bin_alias_list(Es1, Es2, St);
-reject_bin_alias_list(_, _, St) -> St.
-
-reject_bin_alias_rec(PfsA0, PfsB0, FieldsA0, FieldsB0, St) ->
+reject_invalid_alias({match,_,P1,P2}, P, Vt, St0) ->
+ St = reject_invalid_alias(P1, P, Vt, St0),
+ reject_invalid_alias(P2, P, Vt, St);
+reject_invalid_alias(P, {match,_,_,_}=M, Vt, St) ->
+ reject_invalid_alias(M, P, Vt, St);
+reject_invalid_alias(_P1, _P2, _Vt, St) -> St.
+
+reject_invalid_alias_list([E1|Es1], [E2|Es2], Vt, St0) ->
+ St = reject_invalid_alias(E1, E2, Vt, St0),
+ reject_invalid_alias_list(Es1, Es2, Vt, St);
+reject_invalid_alias_list(_, _, _, St) -> St.
+
+reject_invalid_alias_rec(PfsA0, PfsB0, FieldsA0, FieldsB0, Vt, St) ->
%% We treat records as if they have been converted to tuples.
PfsA1 = rbia_field_vars(PfsA0),
PfsB1 = rbia_field_vars(PfsB0),
@@ -1582,7 +1603,7 @@ reject_bin_alias_rec(PfsA0, PfsB0, FieldsA0, FieldsB0, St) ->
D = sofs:projection({external,fun({_,_,P1,_,P2}) -> {P1,P2} end}, C),
E = sofs:to_external(D),
{Ps1,Ps2} = lists:unzip(E),
- reject_bin_alias_list(Ps1, Ps2, St).
+ reject_invalid_alias_list(Ps1, Ps2, Vt, St).
rbia_field_vars(Fs) ->
[{Name,Pat} || {record_field,_,{atom,_,Name},Pat} <- Fs].
@@ -2284,7 +2305,7 @@ expr({'catch',Line,E}, Vt, St0) ->
expr({match,_Line,P,E}, Vt, St0) ->
{Evt,St1} = expr(E, Vt, St0),
{Pvt,Bvt,St2} = pattern(P, vtupdate(Evt, Vt), St1),
- St = reject_bin_alias_expr(P, E, St2),
+ St = reject_invalid_alias_expr(P, E, Vt, St2),
{vtupdate(Bvt, vtmerge(Evt, Pvt)),St};
%% No comparison or boolean operators yet.
expr({op,_Line,_Op,A}, Vt, St) ->
@@ -2381,7 +2402,7 @@ is_valid_call(Call) ->
_ -> true
end.
-%% is_valid_map_key(K,St) -> true | false
+%% is_valid_map_key(K) -> true | false
%% variables are allowed for patterns only at the top of the tree
is_valid_map_key({var,_,_}) -> true;
@@ -2653,6 +2674,8 @@ find_field(_F, []) -> error.
%% Attr :: 'type' | 'opaque'
%% Checks that a type definition is valid.
+-dialyzer({no_match, type_def/6}).
+
type_def(Attr, Line, TypeName, ProtoType, Args, St0) ->
TypeDefs = St0#lint.types,
Arity = length(Args),
@@ -2714,8 +2737,6 @@ check_type(Types, St) ->
check_type({ann_type, _L, [_Var, Type]}, SeenVars, St) ->
check_type(Type, SeenVars, St);
-check_type({paren_type, _L, [Type]}, SeenVars, St) ->
- check_type(Type, SeenVars, St);
check_type({remote_type, L, [{atom, _, Mod}, {atom, _, Name}, Args]},
SeenVars, St0) ->
St = deprecated_type(L, Mod, Name, Args, St0),
@@ -2755,10 +2776,8 @@ check_type({type, L, range, [From, To]}, SeenVars, St) ->
_ -> add_error(L, {type_syntax, range}, St)
end,
{SeenVars, St1};
-check_type({type, L, map, any}, SeenVars, St) ->
- %% To get usage right while map/0 is a newly_introduced_builtin_type.
- St1 = used_type({map, 0}, L, St),
- {SeenVars, St1};
+check_type({type, _L, map, any}, SeenVars, St) ->
+ {SeenVars, St};
check_type({type, _L, map, Pairs}, SeenVars, St) ->
lists:foldl(fun(Pair, {AccSeenVars, AccSt}) ->
check_type(Pair, AccSeenVars, AccSt)
@@ -2866,7 +2885,6 @@ used_type(TypePair, L, #lint{usage = Usage, file = File} = St) ->
is_default_type({Name, NumberOfTypeVariables}) ->
erl_internal:is_type(Name, NumberOfTypeVariables).
-is_newly_introduced_builtin_type({map, 0}) -> true;
is_newly_introduced_builtin_type({Name, _}) when is_atom(Name) -> false.
is_obsolete_builtin_type(TypePair) ->
@@ -3416,6 +3434,14 @@ warn_unused_vars(U, Vt, St0) ->
UVt = map(fun ({V,{State,_,Ls}}) -> {V,{State,used,Ls}} end, U),
{vtmerge(Vt, UVt), St1}.
+
+is_var_bound(V, Vt) ->
+ case orddict:find(V, Vt) of
+ {ok,{bound,_Usage,_}} -> true;
+ _ -> false
+ end.
+
+
%% vtupdate(UpdVarTable, VarTable) -> VarTable.
%% Add the variables in the updated vartable to VarTable. The variables
%% will be updated with their property in UpdVarTable. The state of
diff --git a/lib/stdlib/src/erl_parse.yrl b/lib/stdlib/src/erl_parse.yrl
index 6f8e5e8449..a896de4f1c 100644
--- a/lib/stdlib/src/erl_parse.yrl
+++ b/lib/stdlib/src/erl_parse.yrl
@@ -170,9 +170,16 @@ fun_type -> '(' top_types ')' '->' top_type
: {type, ?anno('$1'), 'fun',
[{type, ?anno('$1'), product, '$2'},'$5']}.
+map_pair_types -> '...' : [{type, ?anno('$1'), map_field_assoc,
+ [{type, ?anno('$1'), any, []},
+ {type, ?anno('$1'), any, []}]}].
map_pair_types -> map_pair_type : ['$1'].
map_pair_types -> map_pair_type ',' map_pair_types : ['$1'|'$3'].
-map_pair_type -> top_type '=>' top_type : {type, ?anno('$2'), map_field_assoc,['$1','$3']}.
+
+map_pair_type -> top_type '=>' top_type : {type, ?anno('$2'),
+ map_field_assoc,['$1','$3']}.
+map_pair_type -> top_type ':=' top_type : {type, ?anno('$2'),
+ map_field_exact,['$1','$3']}.
field_types -> field_type : ['$1'].
field_types -> field_type ',' field_types : ['$1'|'$3'].
@@ -810,7 +817,8 @@ Erlang code.
| {'type', anno(), 'map', [af_map_pair_type()]}.
-type af_map_pair_type() ::
- {'type', anno(), 'map_field_assoc', [abstract_type()]}.
+ {'type', anno(), 'map_field_assoc', [abstract_type()]}
+ | {'type', anno(), 'map_field_exact', [abstract_type()]}.
-type af_predefined_type() ::
{'type', anno(), type_name(), [abstract_type()]}.
diff --git a/lib/stdlib/src/erl_posix_msg.erl b/lib/stdlib/src/erl_posix_msg.erl
index 5eac230631..bfafca1ff7 100644
--- a/lib/stdlib/src/erl_posix_msg.erl
+++ b/lib/stdlib/src/erl_posix_msg.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/erl_pp.erl b/lib/stdlib/src/erl_pp.erl
index c5177aca90..ca764675fc 100644
--- a/lib/stdlib/src/erl_pp.erl
+++ b/lib/stdlib/src/erl_pp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -344,11 +344,31 @@ binary_type(I1, I2) ->
map_type(Fs) ->
{first,[$#],map_pair_types(Fs)}.
-map_pair_types(Fs) ->
+map_pair_types(Fs0) ->
+ Fs = replace_any_map(Fs0),
tuple_type(Fs, fun map_pair_type/2).
+replace_any_map([{type,Line,map_field_assoc,[KType,VType]}]=Fs) ->
+ IsAny = fun({type,_,any,[]}) -> true;
+ %% ({var,_,'_'}) -> true;
+ (_) -> false
+ end,
+ case IsAny(KType) andalso IsAny(VType) of
+ true ->
+ [{type,Line,map_field_assoc,any}];
+ false ->
+ Fs
+ end;
+replace_any_map([F|Fs]) ->
+ [F|replace_any_map(Fs)];
+replace_any_map([]) -> [].
+
+map_pair_type({type,_Line,map_field_assoc,any}, _Prec) ->
+ leaf("...");
map_pair_type({type,_Line,map_field_assoc,[KType,VType]}, Prec) ->
- {list,[{cstep,[ltype(KType, Prec),leaf(" =>")],ltype(VType, Prec)}]}.
+ {list,[{cstep,[ltype(KType, Prec),leaf(" =>")],ltype(VType, Prec)}]};
+map_pair_type({type,_Line,map_field_exact,[KType,VType]}, Prec) ->
+ {list,[{cstep,[ltype(KType, Prec),leaf(" :=")],ltype(VType, Prec)}]}.
record_type(Name, Fields) ->
{first,[record_name(Name)],field_types(Fields)}.
diff --git a/lib/stdlib/src/erl_tar.erl b/lib/stdlib/src/erl_tar.erl
index d0e7a827a8..a383a0fc67 100644
--- a/lib/stdlib/src/erl_tar.erl
+++ b/lib/stdlib/src/erl_tar.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/error_logger_file_h.erl b/lib/stdlib/src/error_logger_file_h.erl
index fea1656051..665685d3ee 100644
--- a/lib/stdlib/src/error_logger_file_h.erl
+++ b/lib/stdlib/src/error_logger_file_h.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/error_logger_tty_h.erl b/lib/stdlib/src/error_logger_tty_h.erl
index d2df6681e3..cb22a8c0b6 100644
--- a/lib/stdlib/src/error_logger_tty_h.erl
+++ b/lib/stdlib/src/error_logger_tty_h.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/ets.erl b/lib/stdlib/src/ets.erl
index 1fca3624dc..3f74e01692 100644
--- a/lib/stdlib/src/ets.erl
+++ b/lib/stdlib/src/ets.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/eval_bits.erl b/lib/stdlib/src/eval_bits.erl
index b3698fb3f5..80667023fb 100644
--- a/lib/stdlib/src/eval_bits.erl
+++ b/lib/stdlib/src/eval_bits.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/filelib.erl b/lib/stdlib/src/filelib.erl
index 51ffd1cff9..7029389e2f 100644
--- a/lib/stdlib/src/filelib.erl
+++ b/lib/stdlib/src/filelib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/filename.erl b/lib/stdlib/src/filename.erl
index d921a69108..c4586171ca 100644
--- a/lib/stdlib/src/filename.erl
+++ b/lib/stdlib/src/filename.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1068,24 +1068,43 @@ basedir_darwin(Type) ->
%% user_cache %LOCALAPPDATA%[/$author]/$appname[/$version]/Cache
%% user_log %LOCALAPPDATA%[/$author]/$appname[/$version]/Logs
+-define(basedir_windows_user_data, "Local").
+-define(basedir_windows_user_config, "Roaming").
+-define(basedir_windows_user_cache, "Local"). %% Cache is added later
+-define(basedir_windows_user_log, "Local"). %% Logs is added later
+
basedir_windows(Type) ->
%% If LOCALAPPDATA is not defined we are likely on an
%% XP machine. Use APPDATA instead.
- AppData = basedir_windows_appdata(),
- case Type of
- user_data -> getenv("LOCALAPPDATA", AppData);
- user_config -> AppData;
- user_cache -> getenv("LOCALAPPDATA", AppData);
- user_log -> getenv("LOCALAPPDATA", AppData);
- site_data -> [];
- site_config -> []
+ case basedir_windows_appdata() of
+ noappdata ->
+ %% No AppData is set
+ %% Probably running MSYS
+ case Type of
+ user_data -> basedir_join_home(?basedir_windows_user_data);
+ user_config -> basedir_join_home(?basedir_windows_user_config);
+ user_cache -> basedir_join_home(?basedir_windows_user_cache);
+ user_log -> basedir_join_home(?basedir_windows_user_log);
+ site_data -> [];
+ site_config -> []
+ end;
+ {ok, AppData} ->
+ case Type of
+ user_data -> getenv("LOCALAPPDATA", AppData);
+ user_config -> AppData;
+ user_cache -> getenv("LOCALAPPDATA", AppData);
+ user_log -> getenv("LOCALAPPDATA", AppData);
+ site_data -> [];
+ site_config -> []
+ end
end.
basedir_windows_appdata() ->
case os:getenv("APPDATA") of
Invalid when Invalid =:= false orelse Invalid =:= [] ->
- erlang:error(noappdata);
- Val -> Val
+ noappdata;
+ Val ->
+ {ok, Val}
end.
%% basedir aux
diff --git a/lib/stdlib/src/gen.erl b/lib/stdlib/src/gen.erl
index a05c2ce6fd..597830cf9a 100644
--- a/lib/stdlib/src/gen.erl
+++ b/lib/stdlib/src/gen.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -26,7 +26,8 @@
%%%
%%% The standard behaviour should export init_it/6.
%%%-----------------------------------------------------------------
--export([start/5, start/6, debug_options/1,
+-export([start/5, start/6, debug_options/2,
+ name/1, unregister_name/1, get_proc_name/1, get_parent/0,
call/3, call/4, reply/2, stop/1, stop/3]).
-export([init_it/6, init_it/7]).
@@ -124,7 +125,7 @@ init_it(GenMod, Starter, Parent, Mod, Args, Options) ->
init_it2(GenMod, Starter, Parent, self(), Mod, Args, Options).
init_it(GenMod, Starter, Parent, Name, Mod, Args, Options) ->
- case name_register(Name) of
+ case register_name(Name) of
true ->
init_it2(GenMod, Starter, Parent, Name, Mod, Args, Options);
{false, Pid} ->
@@ -297,19 +298,19 @@ where({global, Name}) -> global:whereis_name(Name);
where({via, Module, Name}) -> Module:whereis_name(Name);
where({local, Name}) -> whereis(Name).
-name_register({local, Name} = LN) ->
+register_name({local, Name} = LN) ->
try register(Name, self()) of
true -> true
catch
error:_ ->
{false, where(LN)}
end;
-name_register({global, Name} = GN) ->
+register_name({global, Name} = GN) ->
case global:register_name(Name, self()) of
yes -> true;
no -> {false, where(GN)}
end;
-name_register({via, Module, Name} = GN) ->
+register_name({via, Module, Name} = GN) ->
case Module:register_name(Name, self()) of
yes ->
true;
@@ -317,34 +318,108 @@ name_register({via, Module, Name} = GN) ->
{false, where(GN)}
end.
+name({local,Name}) -> Name;
+name({global,Name}) -> Name;
+name({via,_, Name}) -> Name;
+name(Pid) when is_pid(Pid) -> Pid.
+
+unregister_name({local,Name}) ->
+ try unregister(Name) of
+ _ -> ok
+ catch
+ _:_ -> ok
+ end;
+unregister_name({global,Name}) ->
+ _ = global:unregister_name(Name),
+ ok;
+unregister_name({via, Mod, Name}) ->
+ _ = Mod:unregister_name(Name),
+ ok;
+unregister_name(Pid) when is_pid(Pid) ->
+ ok.
+
+get_proc_name(Pid) when is_pid(Pid) ->
+ Pid;
+get_proc_name({local, Name}) ->
+ case process_info(self(), registered_name) of
+ {registered_name, Name} ->
+ Name;
+ {registered_name, _Name} ->
+ exit(process_not_registered);
+ [] ->
+ exit(process_not_registered)
+ end;
+get_proc_name({global, Name}) ->
+ case global:whereis_name(Name) of
+ undefined ->
+ exit(process_not_registered_globally);
+ Pid when Pid =:= self() ->
+ Name;
+ _Pid ->
+ exit(process_not_registered_globally)
+ end;
+get_proc_name({via, Mod, Name}) ->
+ case Mod:whereis_name(Name) of
+ undefined ->
+ exit({process_not_registered_via, Mod});
+ Pid when Pid =:= self() ->
+ Name;
+ _Pid ->
+ exit({process_not_registered_via, Mod})
+ end.
+
+get_parent() ->
+ case get('$ancestors') of
+ [Parent | _] when is_pid(Parent) ->
+ Parent;
+ [Parent | _] when is_atom(Parent) ->
+ name_to_pid(Parent);
+ _ ->
+ exit(process_was_not_started_by_proc_lib)
+ end.
+
+name_to_pid(Name) ->
+ case whereis(Name) of
+ undefined ->
+ case global:whereis_name(Name) of
+ undefined ->
+ exit(could_not_find_registered_name);
+ Pid ->
+ Pid
+ end;
+ Pid ->
+ Pid
+ end.
+
timeout(Options) ->
- case opt(timeout, Options) of
- {ok, Time} ->
+ case lists:keyfind(timeout, 1, Options) of
+ {_,Time} ->
Time;
- _ ->
+ false ->
infinity
end.
spawn_opts(Options) ->
- case opt(spawn_opt, Options) of
- {ok, Opts} ->
+ case lists:keyfind(spawn_opt, 1, Options) of
+ {_,Opts} ->
Opts;
- _ ->
+ false ->
[]
end.
-opt(Op, [{Op, Value}|_]) ->
- {ok, Value};
-opt(Op, [_|Options]) ->
- opt(Op, Options);
-opt(_, []) ->
- false.
-
-debug_options(Opts) ->
- case opt(debug, Opts) of
- {ok, Options} -> sys:debug_options(Options);
- _ -> []
+debug_options(Name, Opts) ->
+ case lists:keyfind(debug, 1, Opts) of
+ {_,Options} ->
+ try sys:debug_options(Options)
+ catch _:_ ->
+ error_logger:format(
+ "~p: ignoring erroneous debug options - ~p~n",
+ [Name,Options]),
+ []
+ end;
+ false ->
+ []
end.
format_status_header(TagLine, Pid) when is_pid(Pid) ->
diff --git a/lib/stdlib/src/gen_event.erl b/lib/stdlib/src/gen_event.erl
index 3d63c19de7..ccacf658e9 100644
--- a/lib/stdlib/src/gen_event.erl
+++ b/lib/stdlib/src/gen_event.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -147,16 +147,11 @@ init_it(Starter, self, Name, Mod, Args, Options) ->
init_it(Starter, self(), Name, Mod, Args, Options);
init_it(Starter, Parent, Name0, _, _, Options) ->
process_flag(trap_exit, true),
- Debug = gen:debug_options(Options),
+ Name = gen:name(Name0),
+ Debug = gen:debug_options(Name, Options),
proc_lib:init_ack(Starter, {ok, self()}),
- Name = name(Name0),
loop(Parent, Name, [], Debug, false).
-name({local,Name}) -> Name;
-name({global,Name}) -> Name;
-name({via,_, Name}) -> Name;
-name(Pid) when is_pid(Pid) -> Pid.
-
-spec add_handler(emgr_ref(), handler(), term()) -> term().
add_handler(M, Handler, Args) -> rpc(M, {add_handler, Handler, Args}).
diff --git a/lib/stdlib/src/gen_fsm.erl b/lib/stdlib/src/gen_fsm.erl
index 7eabb95548..6e7528fd98 100644
--- a/lib/stdlib/src/gen_fsm.erl
+++ b/lib/stdlib/src/gen_fsm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -305,64 +305,11 @@ enter_loop(Mod, Options, StateName, StateData, Timeout) ->
enter_loop(Mod, Options, StateName, StateData, self(), Timeout).
enter_loop(Mod, Options, StateName, StateData, ServerName, Timeout) ->
- Name = get_proc_name(ServerName),
- Parent = get_parent(),
- Debug = gen:debug_options(Options),
+ Name = gen:get_proc_name(ServerName),
+ Parent = gen:get_parent(),
+ Debug = gen:debug_options(Name, Options),
loop(Parent, Name, StateName, StateData, Mod, Timeout, Debug).
-get_proc_name(Pid) when is_pid(Pid) ->
- Pid;
-get_proc_name({local, Name}) ->
- case process_info(self(), registered_name) of
- {registered_name, Name} ->
- Name;
- {registered_name, _Name} ->
- exit(process_not_registered);
- [] ->
- exit(process_not_registered)
- end;
-get_proc_name({global, Name}) ->
- case global:whereis_name(Name) of
- undefined ->
- exit(process_not_registered_globally);
- Pid when Pid =:= self() ->
- Name;
- _Pid ->
- exit(process_not_registered_globally)
- end;
-get_proc_name({via, Mod, Name}) ->
- case Mod:whereis_name(Name) of
- undefined ->
- exit({process_not_registered_via, Mod});
- Pid when Pid =:= self() ->
- Name;
- _Pid ->
- exit({process_not_registered_via, Mod})
- end.
-
-get_parent() ->
- case get('$ancestors') of
- [Parent | _] when is_pid(Parent) ->
- Parent;
- [Parent | _] when is_atom(Parent) ->
- name_to_pid(Parent);
- _ ->
- exit(process_was_not_started_by_proc_lib)
- end.
-
-name_to_pid(Name) ->
- case whereis(Name) of
- undefined ->
- case global:whereis_name(Name) of
- undefined ->
- exit(could_not_find_registered_name);
- Pid ->
- Pid
- end;
- Pid ->
- Pid
- end.
-
%%% ---------------------------------------------------
%%% Initiate the new process.
%%% Register the name using the Rfunc function
@@ -373,8 +320,8 @@ name_to_pid(Name) ->
init_it(Starter, self, Name, Mod, Args, Options) ->
init_it(Starter, self(), Name, Mod, Args, Options);
init_it(Starter, Parent, Name0, Mod, Args, Options) ->
- Name = name(Name0),
- Debug = gen:debug_options(Options),
+ Name = gen:name(Name0),
+ Debug = gen:debug_options(Name, Options),
case catch Mod:init(Args) of
{ok, StateName, StateData} ->
proc_lib:init_ack(Starter, {ok, self()}),
@@ -383,15 +330,15 @@ init_it(Starter, Parent, Name0, Mod, Args, Options) ->
proc_lib:init_ack(Starter, {ok, self()}),
loop(Parent, Name, StateName, StateData, Mod, Timeout, Debug);
{stop, Reason} ->
- unregister_name(Name0),
+ gen:unregister_name(Name0),
proc_lib:init_ack(Starter, {error, Reason}),
exit(Reason);
ignore ->
- unregister_name(Name0),
+ gen:unregister_name(Name0),
proc_lib:init_ack(Starter, ignore),
exit(normal);
{'EXIT', Reason} ->
- unregister_name(Name0),
+ gen:unregister_name(Name0),
proc_lib:init_ack(Starter, {error, Reason}),
exit(Reason);
Else ->
@@ -400,20 +347,6 @@ init_it(Starter, Parent, Name0, Mod, Args, Options) ->
exit(Error)
end.
-name({local,Name}) -> Name;
-name({global,Name}) -> Name;
-name({via,_, Name}) -> Name;
-name(Pid) when is_pid(Pid) -> Pid.
-
-unregister_name({local,Name}) ->
- _ = (catch unregister(Name));
-unregister_name({global,Name}) ->
- _ = global:unregister_name(Name);
-unregister_name({via, Mod, Name}) ->
- _ = Mod:unregister_name(Name);
-unregister_name(Pid) when is_pid(Pid) ->
- Pid.
-
%%-----------------------------------------------------------------
%% The MAIN loop
%%-----------------------------------------------------------------
diff --git a/lib/stdlib/src/gen_server.erl b/lib/stdlib/src/gen_server.erl
index c58b1de609..5800aca66f 100644
--- a/lib/stdlib/src/gen_server.erl
+++ b/lib/stdlib/src/gen_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -304,9 +304,9 @@ enter_loop(Mod, Options, State, Timeout) ->
enter_loop(Mod, Options, State, self(), Timeout).
enter_loop(Mod, Options, State, ServerName, Timeout) ->
- Name = get_proc_name(ServerName),
- Parent = get_parent(),
- Debug = debug_options(Name, Options),
+ Name = gen:get_proc_name(ServerName),
+ Parent = gen:get_parent(),
+ Debug = gen:debug_options(Name, Options),
loop(Parent, Name, State, Mod, Timeout, Debug).
%%%========================================================================
@@ -323,8 +323,8 @@ enter_loop(Mod, Options, State, ServerName, Timeout) ->
init_it(Starter, self, Name, Mod, Args, Options) ->
init_it(Starter, self(), Name, Mod, Args, Options);
init_it(Starter, Parent, Name0, Mod, Args, Options) ->
- Name = name(Name0),
- Debug = debug_options(Name, Options),
+ Name = gen:name(Name0),
+ Debug = gen:debug_options(Name, Options),
case catch Mod:init(Args) of
{ok, State} ->
proc_lib:init_ack(Starter, {ok, self()}),
@@ -339,15 +339,15 @@ init_it(Starter, Parent, Name0, Mod, Args, Options) ->
%% (Otherwise, the parent process could get
%% an 'already_started' error if it immediately
%% tried starting the process again.)
- unregister_name(Name0),
+ gen:unregister_name(Name0),
proc_lib:init_ack(Starter, {error, Reason}),
exit(Reason);
ignore ->
- unregister_name(Name0),
+ gen:unregister_name(Name0),
proc_lib:init_ack(Starter, ignore),
exit(normal);
{'EXIT', Reason} ->
- unregister_name(Name0),
+ gen:unregister_name(Name0),
proc_lib:init_ack(Starter, {error, Reason}),
exit(Reason);
Else ->
@@ -356,20 +356,6 @@ init_it(Starter, Parent, Name0, Mod, Args, Options) ->
exit(Error)
end.
-name({local,Name}) -> Name;
-name({global,Name}) -> Name;
-name({via,_, Name}) -> Name;
-name(Pid) when is_pid(Pid) -> Pid.
-
-unregister_name({local,Name}) ->
- _ = (catch unregister(Name));
-unregister_name({global,Name}) ->
- _ = global:unregister_name(Name);
-unregister_name({via, Mod, Name}) ->
- _ = Mod:unregister_name(Name);
-unregister_name(Pid) when is_pid(Pid) ->
- Pid.
-
%%%========================================================================
%%% Internal functions
%%%========================================================================
@@ -858,86 +844,6 @@ error_info(Reason, Name, Msg, State, Debug) ->
sys:print_log(Debug),
ok.
-%%% ---------------------------------------------------
-%%% Misc. functions.
-%%% ---------------------------------------------------
-
-opt(Op, [{Op, Value}|_]) ->
- {ok, Value};
-opt(Op, [_|Options]) ->
- opt(Op, Options);
-opt(_, []) ->
- false.
-
-debug_options(Name, Opts) ->
- case opt(debug, Opts) of
- {ok, Options} -> dbg_opts(Name, Options);
- _ -> []
- end.
-
-dbg_opts(Name, Opts) ->
- case catch sys:debug_options(Opts) of
- {'EXIT',_} ->
- format("~p: ignoring erroneous debug options - ~p~n",
- [Name, Opts]),
- [];
- Dbg ->
- Dbg
- end.
-
-get_proc_name(Pid) when is_pid(Pid) ->
- Pid;
-get_proc_name({local, Name}) ->
- case process_info(self(), registered_name) of
- {registered_name, Name} ->
- Name;
- {registered_name, _Name} ->
- exit(process_not_registered);
- [] ->
- exit(process_not_registered)
- end;
-get_proc_name({global, Name}) ->
- case global:whereis_name(Name) of
- undefined ->
- exit(process_not_registered_globally);
- Pid when Pid =:= self() ->
- Name;
- _Pid ->
- exit(process_not_registered_globally)
- end;
-get_proc_name({via, Mod, Name}) ->
- case Mod:whereis_name(Name) of
- undefined ->
- exit({process_not_registered_via, Mod});
- Pid when Pid =:= self() ->
- Name;
- _Pid ->
- exit({process_not_registered_via, Mod})
- end.
-
-get_parent() ->
- case get('$ancestors') of
- [Parent | _] when is_pid(Parent)->
- Parent;
- [Parent | _] when is_atom(Parent)->
- name_to_pid(Parent);
- _ ->
- exit(process_was_not_started_by_proc_lib)
- end.
-
-name_to_pid(Name) ->
- case whereis(Name) of
- undefined ->
- case global:whereis_name(Name) of
- undefined ->
- exit(could_not_find_registered_name);
- Pid ->
- Pid
- end;
- Pid ->
- Pid
- end.
-
%%-----------------------------------------------------------------
%% Status information
%%-----------------------------------------------------------------
diff --git a/lib/stdlib/src/gen_statem.erl b/lib/stdlib/src/gen_statem.erl
new file mode 100644
index 0000000000..23bddafeed
--- /dev/null
+++ b/lib/stdlib/src/gen_statem.erl
@@ -0,0 +1,1308 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2016. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+-module(gen_statem).
+
+%% API
+-export(
+ [start/3,start/4,start_link/3,start_link/4,
+ stop/1,stop/3,
+ cast/2,call/2,call/3,
+ enter_loop/5,enter_loop/6,enter_loop/7,
+ reply/1,reply/2]).
+
+%% gen callbacks
+-export(
+ [init_it/6]).
+
+%% sys callbacks
+-export(
+ [system_continue/3,
+ system_terminate/4,
+ system_code_change/4,
+ system_get_state/1,
+ system_replace_state/2,
+ format_status/2]).
+
+%% Internal callbacks
+-export(
+ [wakeup_from_hibernate/3]).
+
+%% Type exports for templates
+-export_type(
+ [event_type/0,
+ callback_mode/0,
+ state_function_result/0,
+ handle_event_result/0,
+ action/0]).
+
+%% Fix problem for doc build
+-export_type([transition_option/0]).
+
+%%%==========================================================================
+%%% Interface functions.
+%%%==========================================================================
+
+-type from() ::
+ {To :: pid(), Tag :: term()}. % Reply-to specifier for call
+
+-type state() ::
+ state_name() | % For state callback function StateName/5
+ term(). % For state callback function handle_event/5
+
+-type state_name() :: atom().
+
+-type data() :: term().
+
+-type event_type() ::
+ {'call',From :: from()} | 'cast' |
+ 'info' | 'timeout' | 'internal'.
+
+-type callback_mode() :: 'state_functions' | 'handle_event_function'.
+
+-type transition_option() ::
+ postpone() | hibernate() | event_timeout().
+-type postpone() ::
+ %% If 'true' postpone the current event
+ %% and retry it when the state changes (=/=)
+ boolean().
+-type hibernate() ::
+ %% If 'true' hibernate the server instead of going into receive
+ boolean().
+-type event_timeout() ::
+ %% Generate a ('timeout', EventContent, ...) event after Time
+ %% unless some other event is delivered
+ Time :: timeout().
+
+-type action() ::
+ %% During a state change:
+ %% * NextState and NewData are set.
+ %% * All action()s are executed in order of apperance.
+ %% * Postponing the current event is performed
+ %% iff 'postpone' is 'true'.
+ %% * A state timer is started iff 'timeout' is set.
+ %% * Pending events are handled or if there are
+ %% no pending events the server goes into receive
+ %% or hibernate (iff 'hibernate' is 'true')
+ %%
+ %% These action()s are executed in order of appearence
+ %% in the containing list. The ones that set options
+ %% will override any previous so the last of each kind wins.
+ %%
+ 'postpone' | % Set the postpone option
+ {'postpone', Postpone :: postpone()} |
+ %%
+ 'hibernate' | % Set the hibernate option
+ {'hibernate', Hibernate :: hibernate()} |
+ %%
+ (Timeout :: event_timeout()) | % {timeout,Timeout}
+ {'timeout', % Set the event timeout option
+ Time :: event_timeout(), EventContent :: term()} |
+ %%
+ reply_action() |
+ %%
+ %% All 'next_event' events are kept in a list and then
+ %% inserted at state changes so the first in the
+ %% action() list is the first to be delivered.
+ {'next_event', % Insert event as the next to handle
+ EventType :: event_type(),
+ EventContent :: term()}.
+-type reply_action() ::
+ {'reply', % Reply to a caller
+ From :: from(), Reply :: term()}.
+
+-type state_function_result() ::
+ {'next_state', % {next_state,NextStateName,NewData,[]}
+ NextStateName :: state_name(),
+ NewData :: data()} |
+ {'next_state', % State transition, maybe to the same state
+ NextStateName :: state_name(),
+ NewData :: data(),
+ Actions :: [action()] | action()} |
+ common_state_callback_result().
+-type handle_event_result() ::
+ {'next_state', % {next_state,NextState,NewData,[]}
+ NextState :: state(),
+ NewData :: data()} |
+ {'next_state', % State transition, maybe to the same state
+ NextState :: state(),
+ NewData :: data(),
+ Actions :: [action()] | action()} |
+ common_state_callback_result().
+-type common_state_callback_result() ::
+ 'stop' | % {stop,normal}
+ {'stop', % Stop the server
+ Reason :: term()} |
+ {'stop', % Stop the server
+ Reason :: term(),
+ NewData :: data()} |
+ {'stop_and_reply', % Reply then stop the server
+ Reason :: term(),
+ Replies :: [reply_action()] | reply_action()} |
+ {'stop_and_reply', % Reply then stop the server
+ Reason :: term(),
+ Replies :: [reply_action()] | reply_action(),
+ NewData :: data()} |
+ {'keep_state', % {keep_state,NewData,[]}
+ NewData :: data()} |
+ {'keep_state', % Keep state, change data
+ NewData :: data(),
+ Actions :: [action()] | action()} |
+ 'keep_state_and_data' | % {keep_state_and_data,[]}
+ {'keep_state_and_data', % Keep state and data -> only actions
+ Actions :: [action()] | action()}.
+
+
+%% The state machine init function. It is called only once and
+%% the server is not running until this function has returned
+%% an {ok, ...} tuple. Thereafter the state callbacks are called
+%% for all events to this server.
+-callback init(Args :: term()) ->
+ {callback_mode(), state(), data()} |
+ {callback_mode(), state(), data(), [action()] | action()} |
+ 'ignore' |
+ {'stop', Reason :: term()}.
+
+%% Example state callback for callback_mode() =:= state_functions
+%% state name 'state_name'.
+%%
+%% In this mode all states has to be type state_name() i.e atom().
+%%
+%% Note that state callbacks and only state callbacks have arity 5
+%% and that is intended.
+-callback state_name(
+ event_type(),
+ EventContent :: term(),
+ Data :: data()) ->
+ state_function_result().
+%%
+%% State callback for callback_mode() =:= handle_event_function.
+%%
+%% Note that state callbacks and only state callbacks have arity 5
+%% and that is intended.
+-callback handle_event(
+ event_type(),
+ EventContent :: term(),
+ State :: state(), % Current state
+ Data :: data()) ->
+ handle_event_result().
+
+%% Clean up before the server terminates.
+-callback terminate(
+ Reason :: 'normal' | 'shutdown' | {'shutdown', term()}
+ | term(),
+ State :: state(),
+ Data :: data()) ->
+ any().
+
+%% Note that the new code can expect to get an OldState from
+%% the old code version not only in code_change/4 but in the first
+%% state callback function called thereafter
+-callback code_change(
+ OldVsn :: term() | {'down', term()},
+ OldState :: state(),
+ OldData :: data(),
+ Extra :: term()) ->
+ {NewCallbackMode :: callback_mode(),
+ NewState :: state(),
+ NewData :: data()}.
+
+%% Format the callback module state in some sensible that is
+%% often condensed way. For StatusOption =:= 'normal' the perferred
+%% return term is [{data,[{"State",FormattedState}]}], and for
+%% StatusOption =:= 'terminate' it is just FormattedState.
+-callback format_status(
+ StatusOption,
+ [ [{Key :: term(), Value :: term()}] |
+ state() |
+ data()]) ->
+ Status :: term() when
+ StatusOption :: 'normal' | 'terminate'.
+
+-optional_callbacks(
+ [init/1, % One may use enter_loop/5,6,7 instead
+ format_status/2, % Has got a default implementation
+ %%
+ state_name/3, % Example for callback_mode =:= state_functions:
+ %% there has to be a StateName/5 callback function for every StateName.
+ %%
+ handle_event/4]). % For callback_mode =:= handle_event_function
+
+%% Type validation functions
+callback_mode(CallbackMode) ->
+ case CallbackMode of
+ state_functions ->
+ true;
+ handle_event_function ->
+ true;
+ _ ->
+ false
+ end.
+%%
+from({Pid,_}) when is_pid(Pid) ->
+ true;
+from(_) ->
+ false.
+%%
+event_type({call,From}) ->
+ from(From);
+event_type(Type) ->
+ case Type of
+ cast ->
+ true;
+ info ->
+ true;
+ timeout ->
+ true;
+ internal ->
+ true;
+ _ ->
+ false
+ end.
+
+
+
+-define(
+ STACKTRACE(),
+ try throw(ok) catch _ -> erlang:get_stacktrace() end).
+
+%%%==========================================================================
+%%% API
+
+-type server_name() ::
+ {'global', GlobalName :: term()}
+ | {'via', RegMod :: module(), Name :: term()}
+ | {'local', atom()}.
+-type server_ref() ::
+ pid()
+ | (LocalName :: atom())
+ | {Name :: atom(), Node :: atom()}
+ | {'global', GlobalName :: term()}
+ | {'via', RegMod :: module(), ViaName :: term()}.
+-type debug_opt() ::
+ {'debug',
+ Dbgs ::
+ ['trace' | 'log' | 'statistics' | 'debug'
+ | {'logfile', string()}]}.
+-type start_opt() ::
+ debug_opt()
+ | {'timeout', Time :: timeout()}
+ | {'spawn_opt', [proc_lib:spawn_option()]}.
+-type start_ret() :: {'ok', pid()} | 'ignore' | {'error', term()}.
+
+
+
+%% Start a state machine
+-spec start(
+ Module :: module(), Args :: term(), Opts :: [start_opt()]) ->
+ start_ret().
+start(Module, Args, Opts) ->
+ gen:start(?MODULE, nolink, Module, Args, Opts).
+%%
+-spec start(
+ ServerName :: server_name(),
+ Module :: module(), Args :: term(), Opts :: [start_opt()]) ->
+ start_ret().
+start(ServerName, Module, Args, Opts) ->
+ gen:start(?MODULE, nolink, ServerName, Module, Args, Opts).
+
+%% Start and link to a state machine
+-spec start_link(
+ Module :: module(), Args :: term(), Opts :: [start_opt()]) ->
+ start_ret().
+start_link(Module, Args, Opts) ->
+ gen:start(?MODULE, link, Module, Args, Opts).
+%%
+-spec start_link(
+ ServerName :: server_name(),
+ Module :: module(), Args :: term(), Opts :: [start_opt()]) ->
+ start_ret().
+start_link(ServerName, Module, Args, Opts) ->
+ gen:start(?MODULE, link, ServerName, Module, Args, Opts).
+
+%% Stop a state machine
+-spec stop(ServerRef :: server_ref()) -> ok.
+stop(ServerRef) ->
+ gen:stop(ServerRef).
+%%
+-spec stop(
+ ServerRef :: server_ref(),
+ Reason :: term(),
+ Timeout :: timeout()) -> ok.
+stop(ServerRef, Reason, Timeout) ->
+ gen:stop(ServerRef, Reason, Timeout).
+
+%% Send an event to a state machine that arrives with type 'event'
+-spec cast(ServerRef :: server_ref(), Msg :: term()) -> ok.
+cast({global,Name}, Msg) ->
+ try global:send(Name, wrap_cast(Msg)) of
+ _ -> ok
+ catch
+ _:_ -> ok
+ end;
+cast({via,RegMod,Name}, Msg) ->
+ try RegMod:send(Name, wrap_cast(Msg)) of
+ _ -> ok
+ catch
+ _:_ -> ok
+ end;
+cast({Name,Node} = ServerRef, Msg) when is_atom(Name), is_atom(Node) ->
+ send(ServerRef, wrap_cast(Msg));
+cast(ServerRef, Msg) when is_atom(ServerRef) ->
+ send(ServerRef, wrap_cast(Msg));
+cast(ServerRef, Msg) when is_pid(ServerRef) ->
+ send(ServerRef, wrap_cast(Msg)).
+
+%% Call a state machine (synchronous; a reply is expected) that
+%% arrives with type {call,From}
+-spec call(ServerRef :: server_ref(), Request :: term()) -> Reply :: term().
+call(ServerRef, Request) ->
+ call(ServerRef, Request, infinity).
+%%
+-spec call(
+ ServerRef :: server_ref(),
+ Request :: term(),
+ Timeout :: timeout()) ->
+ Reply :: term().
+call(ServerRef, Request, infinity) ->
+ try gen:call(ServerRef, '$gen_call', Request, infinity) of
+ {ok,Reply} ->
+ Reply
+ catch
+ Class:Reason ->
+ erlang:raise(
+ Class,
+ {Reason,{?MODULE,call,[ServerRef,Request,infinity]}},
+ erlang:get_stacktrace())
+ end;
+call(ServerRef, Request, Timeout) ->
+ %% Call server through proxy process to dodge any late reply
+ Ref = make_ref(),
+ Self = self(),
+ Pid = spawn(
+ fun () ->
+ Self !
+ try gen:call(
+ ServerRef, '$gen_call', Request, Timeout) of
+ Result ->
+ {Ref,Result}
+ catch Class:Reason ->
+ {Ref,Class,Reason,erlang:get_stacktrace()}
+ end
+ end),
+ Mref = monitor(process, Pid),
+ receive
+ {Ref,Result} ->
+ demonitor(Mref, [flush]),
+ case Result of
+ {ok,Reply} ->
+ Reply
+ end;
+ {Ref,Class,Reason,Stacktrace} ->
+ demonitor(Mref, [flush]),
+ erlang:raise(
+ Class,
+ {Reason,{?MODULE,call,[ServerRef,Request,Timeout]}},
+ Stacktrace);
+ {'DOWN',Mref,_,_,Reason} ->
+ %% There is a theoretical possibility that the
+ %% proxy process gets killed between try--of and !
+ %% so this clause is in case of that
+ exit(Reason)
+ end.
+
+%% Reply from a state machine callback to whom awaits in call/2
+-spec reply([reply_action()] | reply_action()) -> ok.
+reply({reply,From,Reply}) ->
+ reply(From, Reply);
+reply(Replies) when is_list(Replies) ->
+ replies(Replies).
+%%
+-spec reply(From :: from(), Reply :: term()) -> ok.
+reply({To,Tag}, Reply) when is_pid(To) ->
+ Msg = {Tag,Reply},
+ try To ! Msg of
+ _ ->
+ ok
+ catch
+ _:_ -> ok
+ end.
+
+%% Instead of starting the state machine through start/3,4
+%% or start_link/3,4 turn the current process presumably
+%% started by proc_lib into a state machine using
+%% the same arguments as you would have returned from init/1
+-spec enter_loop(
+ Module :: module(), Opts :: [debug_opt()],
+ CallbackMode :: callback_mode(),
+ State :: state(), Data :: data()) ->
+ no_return().
+enter_loop(Module, Opts, CallbackMode, State, Data) ->
+ enter_loop(Module, Opts, CallbackMode, State, Data, self()).
+%%
+-spec enter_loop(
+ Module :: module(), Opts :: [debug_opt()],
+ CallbackMode :: callback_mode(),
+ State :: state(), Data :: data(),
+ Server_or_Actions ::
+ server_name() | pid() | [action()]) ->
+ no_return().
+enter_loop(Module, Opts, CallbackMode, State, Data, Server_or_Actions) ->
+ if
+ is_list(Server_or_Actions) ->
+ enter_loop(
+ Module, Opts, CallbackMode, State, Data,
+ self(), Server_or_Actions);
+ true ->
+ enter_loop(
+ Module, Opts, CallbackMode, State, Data,
+ Server_or_Actions, [])
+ end.
+%%
+-spec enter_loop(
+ Module :: module(), Opts :: [debug_opt()],
+ CallbackMode :: callback_mode(),
+ State :: state(), Data :: data(),
+ Server :: server_name() | pid(),
+ Actions :: [action()] | action()) ->
+ no_return().
+enter_loop(Module, Opts, CallbackMode, State, Data, Server, Actions) ->
+ is_atom(Module) orelse error({atom,Module}),
+ callback_mode(CallbackMode) orelse error({callback_mode,CallbackMode}),
+ Parent = gen:get_parent(),
+ enter(Module, Opts, CallbackMode, State, Data, Server, Actions, Parent).
+
+%%---------------------------------------------------------------------------
+%% API helpers
+
+wrap_cast(Event) ->
+ {'$gen_cast',Event}.
+
+replies([{reply,From,Reply}|Replies]) ->
+ reply(From, Reply),
+ replies(Replies);
+replies([]) ->
+ ok.
+
+%% Might actually not send the message in case of caught exception
+send(Proc, Msg) ->
+ try erlang:send(Proc, Msg, [noconnect]) of
+ noconnect ->
+ _ = spawn(erlang, send, [Proc,Msg]),
+ ok;
+ ok ->
+ ok
+ catch
+ _:_ ->
+ ok
+ end.
+
+%% Here the init_it/6 and enter_loop/5,6,7 functions converge
+enter(Module, Opts, CallbackMode, State, Data, Server, Actions, Parent) ->
+ %% The values should already have been type checked
+ Name = gen:get_proc_name(Server),
+ Debug = gen:debug_options(Name, Opts),
+ P = Events = [],
+ Event = {internal,initial_state},
+ %% We enforce {postpone,false} to ensure that
+ %% our fake Event gets discarded, thought it might get logged
+ NewActions =
+ if
+ is_list(Actions) ->
+ Actions ++ [{postpone,false}];
+ true ->
+ [Actions,{postpone,false}]
+ end,
+ S = #{
+ callback_mode => CallbackMode,
+ module => Module,
+ name => Name,
+ %% All fields below will be replaced according to the arguments to
+ %% loop_event_actions/10 when it finally loops back to loop/3
+ state => State,
+ data => Data,
+ postponed => P,
+ hibernate => false,
+ timer => undefined},
+ NewDebug = sys_debug(Debug, S, State, {enter,Event,State}),
+ loop_event_actions(
+ Parent, NewDebug, S, Events,
+ State, Data, P, Event, State, NewActions).
+
+%%%==========================================================================
+%%% gen callbacks
+
+init_it(Starter, self, ServerRef, Module, Args, Opts) ->
+ init_it(Starter, self(), ServerRef, Module, Args, Opts);
+init_it(Starter, Parent, ServerRef, Module, Args, Opts) ->
+ try Module:init(Args) of
+ Result ->
+ init_result(Starter, Parent, ServerRef, Module, Result, Opts)
+ catch
+ Result ->
+ init_result(Starter, Parent, ServerRef, Module, Result, Opts);
+ Class:Reason ->
+ gen:unregister_name(ServerRef),
+ proc_lib:init_ack(Starter, {error,Reason}),
+ erlang:raise(Class, Reason, erlang:get_stacktrace())
+ end.
+
+%%---------------------------------------------------------------------------
+%% gen callbacks helpers
+
+init_result(Starter, Parent, ServerRef, Module, Result, Opts) ->
+ case Result of
+ {CallbackMode,State,Data} ->
+ case callback_mode(CallbackMode) of
+ true ->
+ proc_lib:init_ack(Starter, {ok,self()}),
+ enter(
+ Module, Opts, CallbackMode, State, Data,
+ ServerRef, [], Parent);
+ false ->
+ Error = {callback_mode,CallbackMode},
+ proc_lib:init_ack(Starter, {error,Error}),
+ exit(Error)
+ end;
+ {CallbackMode,State,Data,Actions} ->
+ case callback_mode(CallbackMode) of
+ true ->
+ proc_lib:init_ack(Starter, {ok,self()}),
+ enter(
+ Module, Opts, CallbackMode, State, Data,
+ ServerRef, Actions, Parent);
+ false ->
+ Error = {callback_mode,CallbackMode},
+ proc_lib:init_ack(Starter, {error,Error}),
+ exit(Error)
+ end;
+ {stop,Reason} ->
+ gen:unregister_name(ServerRef),
+ proc_lib:init_ack(Starter, {error,Reason}),
+ exit(Reason);
+ ignore ->
+ gen:unregister_name(ServerRef),
+ proc_lib:init_ack(Starter, ignore),
+ exit(normal);
+ _ ->
+ Error = {bad_return_value,Result},
+ proc_lib:init_ack(Starter, {error,Error}),
+ exit(Error)
+ end.
+
+%%%==========================================================================
+%%% sys callbacks
+
+system_continue(Parent, Debug, S) ->
+ loop(Parent, Debug, S).
+
+system_terminate(
+ Reason, _Parent, Debug,
+ #{state := State, data := Data, postponed := P} = S) ->
+ terminate(
+ exit, Reason, ?STACKTRACE(),
+ Debug, S, [], State, Data, P).
+
+system_code_change(
+ #{module := Module,
+ state := State,
+ data := Data} = S,
+ _Mod, OldVsn, Extra) ->
+ case
+ try Module:code_change(OldVsn, State, Data, Extra)
+ catch
+ Result -> Result
+ end
+ of
+ {NewCallbackMode,NewState,NewData} ->
+ callback_mode(NewCallbackMode) orelse
+ error({callback_mode,NewCallbackMode}),
+ {ok,
+ S#{callback_mode := NewCallbackMode,
+ state := NewState,
+ data := NewData}};
+ {ok,_} = Error ->
+ error({case_clause,Error});
+ Error ->
+ Error
+ end.
+
+system_get_state(#{state := State, data := Data}) ->
+ {ok,{State,Data}}.
+
+system_replace_state(
+ StateFun,
+ #{state := State,
+ data := Data} = S) ->
+ {NewState,NewData} = Result = StateFun({State,Data}),
+ {ok,Result,S#{state := NewState, data := NewData}}.
+
+format_status(
+ Opt,
+ [PDict,SysState,Parent,Debug,
+ #{name := Name, postponed := P, state := State, data := Data} = S]) ->
+ Header = gen:format_status_header("Status for state machine", Name),
+ Log = sys:get_debug(log, Debug, []),
+ [{header,Header},
+ {data,
+ [{"Status",SysState},
+ {"Parent",Parent},
+ {"Logged Events",Log},
+ {"Postponed",P}]} |
+ case format_status(Opt, PDict, S, State, Data) of
+ L when is_list(L) -> L;
+ T -> [T]
+ end].
+
+%%---------------------------------------------------------------------------
+%% Format debug messages. Print them as the call-back module sees
+%% them, not as the real erlang messages. Use trace for that.
+%%---------------------------------------------------------------------------
+
+print_event(Dev, {in,Event}, {Name,_}) ->
+ io:format(
+ Dev, "*DBG* ~p received ~s~n",
+ [Name,event_string(Event)]);
+print_event(Dev, {out,Reply,{To,_Tag}}, {Name,_}) ->
+ io:format(
+ Dev, "*DBG* ~p sent ~p to ~p~n",
+ [Name,Reply,To]);
+print_event(Dev, {Tag,Event,NextState}, {Name,State}) ->
+ StateString =
+ case NextState of
+ State ->
+ io_lib:format("~p", [State]);
+ _ ->
+ io_lib:format("~p => ~p", [State,NextState])
+ end,
+ io:format(
+ Dev, "*DBG* ~p ~w ~s in state ~s~n",
+ [Name,Tag,event_string(Event),StateString]).
+
+event_string(Event) ->
+ case Event of
+ {{call,{Pid,_Tag}},Request} ->
+ io_lib:format("call ~p from ~w", [Request,Pid]);
+ {EventType,EventContent} ->
+ io_lib:format("~w ~p", [EventType,EventContent])
+ end.
+
+sys_debug(Debug, #{name := Name}, State, Entry) ->
+ case Debug of
+ [] ->
+ Debug;
+ _ ->
+ sys:handle_debug(
+ Debug, fun print_event/3, {Name,State}, Entry)
+ end.
+
+%%%==========================================================================
+%%% Internal callbacks
+
+wakeup_from_hibernate(Parent, Debug, S) ->
+ %% It is a new message that woke us up so we have to receive it now
+ loop_receive(Parent, Debug, S).
+
+%%%==========================================================================
+%%% State Machine engine implementation of proc_lib/gen server
+
+%% Server loop, consists of all loop* functions
+%% and detours through sys:handle_system_message/7 and proc_lib:hibernate/3
+
+%% Entry point for system_continue/3
+loop(Parent, Debug, #{hibernate := Hibernate} = S) ->
+ case Hibernate of
+ true ->
+ %% Does not return but restarts process at
+ %% wakeup_from_hibernate/3 that jumps to loop_receive/3
+ proc_lib:hibernate(
+ ?MODULE, wakeup_from_hibernate, [Parent,Debug,S]),
+ error(
+ {should_not_have_arrived_here_but_instead_in,
+ {wakeup_from_hibernate,3}});
+ false ->
+ loop_receive(Parent, Debug, S)
+ end.
+
+%% Entry point for wakeup_from_hibernate/3
+loop_receive(Parent, Debug, #{timer := Timer} = S) ->
+ receive
+ Msg ->
+ case Msg of
+ {system,Pid,Req} ->
+ #{hibernate := Hibernate} = S,
+ %% Does not return but tail recursively calls
+ %% system_continue/3 that jumps to loop/3
+ sys:handle_system_msg(
+ Req, Pid, Parent, ?MODULE, Debug, S, Hibernate);
+ {'EXIT',Parent,Reason} = EXIT ->
+ #{state := State, data := Data, postponed := P} = S,
+ %% EXIT is not a 2-tuple and therefore
+ %% not an event and has no event_type(),
+ %% but this will stand out in the crash report...
+ terminate(
+ exit, Reason, ?STACKTRACE(),
+ Debug, S, [EXIT], State, Data, P);
+ {timeout,Timer,Content} when Timer =/= undefined ->
+ loop_receive_result(
+ Parent, Debug, S, {timeout,Content});
+ _ ->
+ %% Cancel Timer if running
+ case Timer of
+ undefined ->
+ ok;
+ _ ->
+ case erlang:cancel_timer(Timer) of
+ TimeLeft when is_integer(TimeLeft) ->
+ ok;
+ false ->
+ receive
+ {timeout,Timer,_} ->
+ ok
+ after 0 ->
+ ok
+ end
+ end
+ end,
+ Event =
+ case Msg of
+ {'$gen_call',From,Request} ->
+ {{call,From},Request};
+ {'$gen_cast',E} ->
+ {cast,E};
+ _ ->
+ {info,Msg}
+ end,
+ loop_receive_result(Parent, Debug, S, Event)
+ end
+ end.
+
+loop_receive_result(
+ Parent, Debug,
+ #{state := State,
+ data := Data,
+ postponed := P} = S,
+ Event) ->
+ %% The engine state map S is now dismantled
+ %% and will not be restored until we return to loop/3.
+ %%
+ %% The fields 'callback_mode', 'module', and 'name' are still valid.
+ %% The fields 'state', 'data', and 'postponed' are held in arguments.
+ %% The fields 'timer' and 'hibernate' will be recalculated.
+ %%
+ NewDebug = sys_debug(Debug, S, State, {in,Event}),
+ %% Here the queue of not yet handled events is created
+ Events = [],
+ Hibernate = false,
+ loop_event(
+ Parent, NewDebug, S, Events, State, Data, P, Event, Hibernate).
+
+%% Process the event queue, or if it is empty
+%% loop back to loop/3 to receive a new event
+loop_events(
+ Parent, Debug, S, [Event|Events],
+ State, Data, P, Hibernate, _Timeout) ->
+ %%
+ %% If there was a state timer requested we just ignore that
+ %% since we have events to handle which cancels the timer
+ loop_event(
+ Parent, Debug, S, Events, State, Data, P, Event, Hibernate);
+loop_events(
+ Parent, Debug, S, [],
+ State, Data, P, Hibernate, Timeout) ->
+ case Timeout of
+ {timeout,0,EventContent} ->
+ %% Immediate timeout - simulate it
+ %% so we do not get the timeout message
+ %% after any received event
+ loop_event(
+ Parent, Debug, S, [],
+ State, Data, P, {timeout,EventContent}, Hibernate);
+ {timeout,Time,EventContent} ->
+ %% Actually start a timer
+ Timer = erlang:start_timer(Time, self(), EventContent),
+ loop_events_done(
+ Parent, Debug, S, Timer, State, Data, P, Hibernate);
+ undefined ->
+ %% No state timeout has been requested
+ Timer = undefined,
+ loop_events_done(
+ Parent, Debug, S, Timer, State, Data, P, Hibernate)
+ end.
+%%
+loop_events_done(Parent, Debug, S, Timer, State, Data, P, Hibernate) ->
+ NewS =
+ S#{
+ state := State,
+ data := Data,
+ postponed := P,
+ hibernate := Hibernate,
+ timer := Timer},
+ loop(Parent, Debug, NewS).
+
+loop_event(
+ Parent, Debug,
+ #{callback_mode := CallbackMode,
+ module := Module} = S,
+ Events,
+ State, Data, P, {Type,Content} = Event, Hibernate) ->
+ %%
+ %% If Hibernate is true here it can only be
+ %% because it was set from an event action
+ %% and we did not go into hibernation since there
+ %% were events in queue, so we do what the user
+ %% might depend on i.e collect garbage which
+ %% would have happened if we actually hibernated
+ %% and immediately was awakened
+ Hibernate andalso garbage_collect(),
+ %%
+ try
+ case CallbackMode of
+ state_functions ->
+ Module:State(Type, Content, Data);
+ handle_event_function ->
+ Module:handle_event(Type, Content, State, Data)
+ end of
+ Result ->
+ loop_event_result(
+ Parent, Debug, S, Events, State, Data, P, Event, Result)
+ catch
+ Result ->
+ loop_event_result(
+ Parent, Debug, S, Events, State, Data, P, Event, Result);
+ error:badarg when CallbackMode =:= state_functions ->
+ case erlang:get_stacktrace() of
+ [{erlang,apply,[Module,State,_],_}|Stacktrace] ->
+ Args = [Type,Content,Data],
+ terminate(
+ error,
+ {undef_state_function,{Module,State,Args}},
+ Stacktrace,
+ Debug, S, [Event|Events], State, Data, P);
+ Stacktrace ->
+ terminate(
+ error, badarg, Stacktrace,
+ Debug, S, [Event|Events], State, Data, P)
+ end;
+ error:undef ->
+ %% Process an undef to check for the simple mistake
+ %% of calling a nonexistent state function
+ case erlang:get_stacktrace() of
+ [{Module,State,
+ [Type,Content,Data]=Args,
+ _}
+ |Stacktrace]
+ when CallbackMode =:= state_functions ->
+ terminate(
+ error,
+ {undef_state_function,{Module,State,Args}},
+ Stacktrace,
+ Debug, S, [Event|Events], State, Data, P);
+ [{Module,handle_event,
+ [Type,Content,State,Data]=Args,
+ _}
+ |Stacktrace]
+ when CallbackMode =:= handle_event_function ->
+ terminate(
+ error,
+ {undef_state_function,{Module,handle_event,Args}},
+ Stacktrace,
+ Debug, S, [Event|Events], State, Data, P);
+ Stacktrace ->
+ terminate(
+ error, undef, Stacktrace,
+ Debug, S, [Event|Events], State, Data, P)
+ end;
+ Class:Reason ->
+ Stacktrace = erlang:get_stacktrace(),
+ terminate(
+ Class, Reason, Stacktrace,
+ Debug, S, [Event|Events], State, Data, P)
+ end.
+
+%% Interpret all callback return variants
+loop_event_result(
+ Parent, Debug, S, Events, State, Data, P, Event, Result) ->
+ case Result of
+ stop ->
+ terminate(
+ exit, normal, ?STACKTRACE(),
+ Debug, S, [Event|Events], State, Data, P);
+ {stop,Reason} ->
+ terminate(
+ exit, Reason, ?STACKTRACE(),
+ Debug, S, [Event|Events], State, Data, P);
+ {stop,Reason,NewData} ->
+ terminate(
+ exit, Reason, ?STACKTRACE(),
+ Debug, S, [Event|Events], State, NewData, P);
+ {stop_and_reply,Reason,Replies} ->
+ Q = [Event|Events],
+ reply_then_terminate(
+ exit, Reason, ?STACKTRACE(),
+ Debug, S, Q, State, Data, P, Replies);
+ {stop_and_reply,Reason,Replies,NewData} ->
+ Q = [Event|Events],
+ reply_then_terminate(
+ exit, Reason, ?STACKTRACE(),
+ Debug, S, Q, State, NewData, P, Replies);
+ {next_state,NextState,NewData} ->
+ loop_event_actions(
+ Parent, Debug, S, Events,
+ State, NewData, P, Event, NextState, []);
+ {next_state,NextState,NewData,Actions} ->
+ loop_event_actions(
+ Parent, Debug, S, Events,
+ State, NewData, P, Event, NextState, Actions);
+ {keep_state,NewData} ->
+ loop_event_actions(
+ Parent, Debug, S, Events,
+ State, NewData, P, Event, State, []);
+ {keep_state,NewData,Actions} ->
+ loop_event_actions(
+ Parent, Debug, S, Events,
+ State, NewData, P, Event, State, Actions);
+ keep_state_and_data ->
+ loop_event_actions(
+ Parent, Debug, S, Events,
+ State, Data, P, Event, State, []);
+ {keep_state_and_data,Actions} ->
+ loop_event_actions(
+ Parent, Debug, S, Events,
+ State, Data, P, Event, State, Actions);
+ _ ->
+ terminate(
+ error, {bad_return_value,Result}, ?STACKTRACE(),
+ Debug, S, [Event|Events], State, Data, P)
+ end.
+
+loop_event_actions(
+ Parent, Debug, S, Events, State, NewData, P, Event, NextState, Actions) ->
+ Postpone = false, % Shall we postpone this event; boolean()
+ Hibernate = false,
+ Timeout = undefined,
+ NextEvents = [],
+ loop_event_actions(
+ Parent, Debug, S, Events, State, NewData, P, Event, NextState,
+ if
+ is_list(Actions) ->
+ Actions;
+ true ->
+ [Actions]
+ end,
+ Postpone, Hibernate, Timeout, NextEvents).
+%%
+%% Process all actions
+loop_event_actions(
+ Parent, Debug, S, Events,
+ State, NewData, P, Event, NextState, [Action|Actions],
+ Postpone, Hibernate, Timeout, NextEvents) ->
+ case Action of
+ %% Actual actions
+ {reply,From,Reply} ->
+ case from(From) of
+ true ->
+ NewDebug = do_reply(Debug, S, State, From, Reply),
+ loop_event_actions(
+ Parent, NewDebug, S, Events,
+ State, NewData, P, Event, NextState, Actions,
+ Postpone, Hibernate, Timeout, NextEvents);
+ false ->
+ terminate(
+ error, {bad_action,Action}, ?STACKTRACE(),
+ Debug, S, [Event|Events], State, NewData, P)
+ end;
+ {next_event,Type,Content} ->
+ case event_type(Type) of
+ true ->
+ loop_event_actions(
+ Parent, Debug, S, Events,
+ State, NewData, P, Event, NextState, Actions,
+ Postpone, Hibernate, Timeout,
+ [{Type,Content}|NextEvents]);
+ false ->
+ terminate(
+ error, {bad_action,Action}, ?STACKTRACE(),
+ Debug, S, [Event|Events], State, NewData, P)
+ end;
+ %% Actions that set options
+ {postpone,NewPostpone} when is_boolean(NewPostpone) ->
+ loop_event_actions(
+ Parent, Debug, S, Events,
+ State, NewData, P, Event, NextState, Actions,
+ NewPostpone, Hibernate, Timeout, NextEvents);
+ {postpone,_} ->
+ terminate(
+ error, {bad_action,Action}, ?STACKTRACE(),
+ Debug, S, [Event|Events], State, NewData, P);
+ postpone ->
+ loop_event_actions(
+ Parent, Debug, S, Events,
+ State, NewData, P, Event, NextState, Actions,
+ true, Hibernate, Timeout, NextEvents);
+ {hibernate,NewHibernate} when is_boolean(NewHibernate) ->
+ loop_event_actions(
+ Parent, Debug, S, Events,
+ State, NewData, P, Event, NextState, Actions,
+ Postpone, NewHibernate, Timeout, NextEvents);
+ {hibernate,_} ->
+ terminate(
+ error, {bad_action,Action}, ?STACKTRACE(),
+ Debug, S, [Event|Events], State, NewData, P);
+ hibernate ->
+ loop_event_actions(
+ Parent, Debug, S, Events,
+ State, NewData, P, Event, NextState, Actions,
+ Postpone, true, Timeout, NextEvents);
+ {timeout,infinity,_} -> % Clear timer - it will never trigger
+ loop_event_actions(
+ Parent, Debug, S, Events,
+ State, NewData, P, Event, NextState, Actions,
+ Postpone, Hibernate, undefined, NextEvents);
+ {timeout,Time,_} = NewTimeout when is_integer(Time), Time >= 0 ->
+ loop_event_actions(
+ Parent, Debug, S, Events,
+ State, NewData, P, Event, NextState, Actions,
+ Postpone, Hibernate, NewTimeout, NextEvents);
+ {timeout,_,_} ->
+ terminate(
+ error, {bad_action,Action}, ?STACKTRACE(),
+ Debug, S, [Event|Events], State, NewData, P);
+ infinity -> % Clear timer - it will never trigger
+ loop_event_actions(
+ Parent, Debug, S, Events,
+ State, NewData, P, Event, NextState, Actions,
+ Postpone, Hibernate, undefined, NextEvents);
+ Time when is_integer(Time), Time >= 0 ->
+ NewTimeout = {timeout,Time,Time},
+ loop_event_actions(
+ Parent, Debug, S, Events,
+ State, NewData, P, Event, NextState, Actions,
+ Postpone, Hibernate, NewTimeout, NextEvents);
+ _ ->
+ terminate(
+ error, {bad_action,Action}, ?STACKTRACE(),
+ Debug, S, [Event|Events], State, NewData, P)
+ end;
+%%
+%% End of actions list
+loop_event_actions(
+ Parent, Debug, S, Events,
+ State, NewData, P0, Event, NextState, [],
+ Postpone, Hibernate, Timeout, NextEvents) ->
+ %%
+ %% All options have been collected and next_events are buffered.
+ %% Do the actual state transition.
+ %%
+ P1 = % Move current event to postponed if Postpone
+ case Postpone of
+ true ->
+ [Event|P0];
+ false ->
+ P0
+ end,
+ {Q2,P} = % Move all postponed events to queue if state change
+ if
+ NextState =:= State ->
+ {Events,P1};
+ true ->
+ {lists:reverse(P1, Events),[]}
+ end,
+ %% Place next events first in queue
+ Q = lists:reverse(NextEvents, Q2),
+ %%
+ NewDebug =
+ sys_debug(
+ Debug, S, State,
+ case Postpone of
+ true ->
+ {postpone,Event,NextState};
+ false ->
+ {consume,Event,NextState}
+ end),
+ loop_events(
+ Parent, NewDebug, S, Q, NextState, NewData, P, Hibernate, Timeout).
+
+%%---------------------------------------------------------------------------
+%% Server helpers
+
+reply_then_terminate(
+ Class, Reason, Stacktrace,
+ Debug, S, Q, State, Data, P, Replies) ->
+ if
+ is_list(Replies) ->
+ do_reply_then_terminate(
+ Class, Reason, Stacktrace,
+ Debug, S, Q, State, Data, P, Replies);
+ true ->
+ do_reply_then_terminate(
+ Class, Reason, Stacktrace,
+ Debug, S, Q, State, Data, P, [Replies])
+ end.
+%%
+do_reply_then_terminate(
+ Class, Reason, Stacktrace, Debug, S, Q, State, Data, P, []) ->
+ terminate(Class, Reason, Stacktrace, Debug, S, Q, State, Data, P);
+do_reply_then_terminate(
+ Class, Reason, Stacktrace, Debug, S, Q, State, Data, P, [R|Rs]) ->
+ case R of
+ {reply,{_To,_Tag}=From,Reply} ->
+ NewDebug = do_reply(Debug, S, State, From, Reply),
+ do_reply_then_terminate(
+ Class, Reason, Stacktrace,
+ NewDebug, S, Q, State, Data, P, Rs);
+ _ ->
+ terminate(
+ error, {bad_action,R}, ?STACKTRACE(),
+ Debug, S, Q, State, Data, P)
+ end.
+
+do_reply(Debug, S, State, From, Reply) ->
+ reply(From, Reply),
+ sys_debug(Debug, S, State, {out,Reply,From}).
+
+
+terminate(
+ Class, Reason, Stacktrace,
+ Debug, #{module := Module} = S, Q, State, Data, P) ->
+ try Module:terminate(Reason, State, Data) of
+ _ -> ok
+ catch
+ _ -> ok;
+ C:R ->
+ ST = erlang:get_stacktrace(),
+ error_info(
+ C, R, ST, Debug, S, Q, P,
+ format_status(terminate, get(), S, State, Data)),
+ erlang:raise(C, R, ST)
+ end,
+ case Reason of
+ normal -> ok;
+ shutdown -> ok;
+ {shutdown,_} -> ok;
+ _ ->
+ error_info(
+ Class, Reason, Stacktrace, Debug, S, Q, P,
+ format_status(terminate, get(), S, State, Data))
+ end,
+ case Stacktrace of
+ [] ->
+ erlang:Class(Reason);
+ _ ->
+ erlang:raise(Class, Reason, Stacktrace)
+ end.
+
+error_info(
+ Class, Reason, Stacktrace, Debug,
+ #{name := Name, callback_mode := CallbackMode},
+ Q, P, FmtData) ->
+ {FixedReason,FixedStacktrace} =
+ case Stacktrace of
+ [{M,F,Args,_}|ST]
+ when Class =:= error, Reason =:= undef ->
+ case code:is_loaded(M) of
+ false ->
+ {{'module could not be loaded',M},ST};
+ _ ->
+ Arity =
+ if
+ is_list(Args) ->
+ length(Args);
+ is_integer(Args) ->
+ Args
+ end,
+ case erlang:function_exported(M, F, Arity) of
+ true ->
+ {Reason,Stacktrace};
+ false ->
+ {{'function not exported',{M,F,Arity}},
+ ST}
+ end
+ end;
+ _ -> {Reason,Stacktrace}
+ end,
+ error_logger:format(
+ "** State machine ~p terminating~n" ++
+ case Q of
+ [] -> "";
+ _ -> "** Last event = ~p~n"
+ end ++
+ "** When server state = ~p~n" ++
+ "** Reason for termination = ~w:~p~n" ++
+ "** Callback mode = ~p~n" ++
+ case Q of
+ [_,_|_] -> "** Queued = ~p~n";
+ _ -> ""
+ end ++
+ case P of
+ [] -> "";
+ _ -> "** Postponed = ~p~n"
+ end ++
+ case FixedStacktrace of
+ [] -> "";
+ _ -> "** Stacktrace =~n** ~p~n"
+ end,
+ [Name |
+ case Q of
+ [] -> [];
+ [Event|_] -> [Event]
+ end] ++
+ [FmtData,Class,FixedReason,
+ CallbackMode] ++
+ case Q of
+ [_|[_|_] = Events] -> [Events];
+ _ -> []
+ end ++
+ case P of
+ [] -> [];
+ _ -> [P]
+ end ++
+ case FixedStacktrace of
+ [] -> [];
+ _ -> [FixedStacktrace]
+ end),
+ sys:print_log(Debug),
+ ok.
+
+
+%% Call Module:format_status/2 or return a default value
+format_status(Opt, PDict, #{module := Module}, State, Data) ->
+ case erlang:function_exported(Module, format_status, 2) of
+ true ->
+ try Module:format_status(Opt, [PDict,State,Data])
+ catch
+ Result -> Result;
+ _:_ ->
+ format_status_default(
+ Opt, State,
+ "Module:format_status/2 crashed")
+ end;
+ false ->
+ format_status_default(Opt, State, Data)
+ end.
+
+%% The default Module:format_status/2
+format_status_default(Opt, State, Data) ->
+ SSD = {State,Data},
+ case Opt of
+ terminate ->
+ SSD;
+ _ ->
+ [{data,[{"State",SSD}]}]
+ end.
diff --git a/lib/stdlib/src/io_lib.erl b/lib/stdlib/src/io_lib.erl
index ef30f16f18..ad98bc0420 100644
--- a/lib/stdlib/src/io_lib.erl
+++ b/lib/stdlib/src/io_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -112,14 +112,14 @@
-type format_spec() ::
#{
- control_char => char(),
- args => [any()],
- width => 'none' | integer(),
- adjust => 'left' | 'right',
- precision => 'none' | integer(),
- pad_char => char(),
- encoding => 'unicode' | 'latin1',
- strings => boolean()
+ control_char := char(),
+ args := [any()],
+ width := 'none' | integer(),
+ adjust := 'left' | 'right',
+ precision := 'none' | integer(),
+ pad_char := char(),
+ encoding := 'unicode' | 'latin1',
+ strings := boolean()
}.
%%----------------------------------------------------------------------
diff --git a/lib/stdlib/src/io_lib_format.erl b/lib/stdlib/src/io_lib_format.erl
index 282005da7d..1da866dc88 100644
--- a/lib/stdlib/src/io_lib_format.erl
+++ b/lib/stdlib/src/io_lib_format.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/io_lib_fread.erl b/lib/stdlib/src/io_lib_fread.erl
index 25555c6f52..6a8f8f728e 100644
--- a/lib/stdlib/src/io_lib_fread.erl
+++ b/lib/stdlib/src/io_lib_fread.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/io_lib_pretty.erl b/lib/stdlib/src/io_lib_pretty.erl
index 6309addf57..16ca2f41dc 100644
--- a/lib/stdlib/src/io_lib_pretty.erl
+++ b/lib/stdlib/src/io_lib_pretty.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/lib.erl b/lib/stdlib/src/lib.erl
index eb24516c50..6fba63a895 100644
--- a/lib/stdlib/src/lib.erl
+++ b/lib/stdlib/src/lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/lists.erl b/lib/stdlib/src/lists.erl
index 2b4472cdf7..af9d63ddd6 100644
--- a/lib/stdlib/src/lists.erl
+++ b/lib/stdlib/src/lists.erl
@@ -39,7 +39,8 @@
-export([all/2,any/2,map/2,flatmap/2,foldl/3,foldr/3,filter/2,
partition/2,zf/2,filtermap/2,
mapfoldl/3,mapfoldr/3,foreach/2,takewhile/2,dropwhile/2,splitwith/2,
- split/2]).
+ split/2,
+ join/2]).
%%% BIFs
-export([keyfind/3, keymember/3, keysearch/3, member/2, reverse/2]).
@@ -1439,6 +1440,18 @@ split(N, [H|T], R) ->
split(_, [], _) ->
badarg.
+-spec join(Sep, List1) -> List2 when
+ Sep :: T,
+ List1 :: [T],
+ List2 :: [T],
+ T :: term().
+
+join(_Sep, []) -> [];
+join(Sep, [H|T]) -> [H|join_prepend(Sep, T)].
+
+join_prepend(_Sep, []) -> [];
+join_prepend(Sep, [H|T]) -> [Sep,H|join_prepend(Sep,T)].
+
%%% =================================================================
%%% Here follows the implementation of the sort functions.
%%%
diff --git a/lib/stdlib/src/log_mf_h.erl b/lib/stdlib/src/log_mf_h.erl
index 35723bbc9e..393da9ab27 100644
--- a/lib/stdlib/src/log_mf_h.erl
+++ b/lib/stdlib/src/log_mf_h.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/maps.erl b/lib/stdlib/src/maps.erl
index 43d10f4800..5dafdb282a 100644
--- a/lib/stdlib/src/maps.erl
+++ b/lib/stdlib/src/maps.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -20,17 +20,18 @@
-module(maps).
--export([get/3,filter/2,fold/3, map/2,
- size/1,
+-export([get/3, filter/2,fold/3,
+ map/2, size/1,
+ update_with/3, update_with/4,
without/2, with/2]).
-
-%%% BIFs
+%% BIFs
-export([get/2, find/2, from_list/1,
is_key/2, keys/1, merge/2,
- new/0, put/3, remove/2,
+ new/0, put/3, remove/2, take/2,
to_list/1, update/3, values/1]).
+%% Shadowed by erl_bif_types: maps:get/2
-spec get(Key,Map) -> Value when
Key :: term(),
Map :: map(),
@@ -46,7 +47,7 @@ get(_,_) -> erlang:nif_error(undef).
find(_,_) -> erlang:nif_error(undef).
-
+%% Shadowed by erl_bif_types: maps:from_list/1
-spec from_list(List) -> Map when
List :: [{Key,Value}],
Key :: term(),
@@ -56,6 +57,7 @@ find(_,_) -> erlang:nif_error(undef).
from_list(_) -> erlang:nif_error(undef).
+%% Shadowed by erl_bif_types: maps:is_key/2
-spec is_key(Key,Map) -> boolean() when
Key :: term(),
Map :: map().
@@ -71,6 +73,7 @@ is_key(_,_) -> erlang:nif_error(undef).
keys(_) -> erlang:nif_error(undef).
+%% Shadowed by erl_bif_types: maps:merge/2
-spec merge(Map1,Map2) -> Map3 when
Map1 :: map(),
Map2 :: map(),
@@ -86,6 +89,7 @@ merge(_,_) -> erlang:nif_error(undef).
new() -> erlang:nif_error(undef).
+%% Shadowed by erl_bif_types: maps:put/3
-spec put(Key,Value,Map1) -> Map2 when
Key :: term(),
Value :: term(),
@@ -102,7 +106,15 @@ put(_,_,_) -> erlang:nif_error(undef).
remove(_,_) -> erlang:nif_error(undef).
+-spec take(Key,Map1) -> {Value,Map2} | error when
+ Key :: term(),
+ Map1 :: map(),
+ Value :: term(),
+ Map2 :: map().
+
+take(_,_) -> erlang:nif_error(undef).
+%% Shadowed by erl_bif_types: maps:to_list/1
-spec to_list(Map) -> [{Key,Value}] when
Map :: map(),
Key :: term(),
@@ -111,6 +123,7 @@ remove(_,_) -> erlang:nif_error(undef).
to_list(_) -> erlang:nif_error(undef).
+%% Shadowed by erl_bif_types: maps:update/3
-spec update(Key,Value,Map1) -> Map2 when
Key :: term(),
Value :: term(),
@@ -127,8 +140,40 @@ update(_,_,_) -> erlang:nif_error(undef).
values(_) -> erlang:nif_error(undef).
+%% End of BIFs
+
+-spec update_with(Key,Fun,Map1) -> Map2 when
+ Key :: term(),
+ Map1 :: map(),
+ Map2 :: map(),
+ Fun :: fun((Value1 :: term()) -> Value2 :: term()).
+
+update_with(Key,Fun,Map) when is_function(Fun,1), is_map(Map) ->
+ try maps:get(Key,Map) of
+ Val -> maps:update(Key,Fun(Val),Map)
+ catch
+ error:{badkey,_} ->
+ erlang:error({badkey,Key},[Key,Fun,Map])
+ end;
+update_with(Key,Fun,Map) ->
+ erlang:error(error_type(Map),[Key,Fun,Map]).
+
+
+-spec update_with(Key,Fun,Init,Map1) -> Map2 when
+ Key :: term(),
+ Map1 :: Map1,
+ Map2 :: Map2,
+ Fun :: fun((Value1 :: term()) -> Value2 :: term()),
+ Init :: term().
+
+update_with(Key,Fun,Init,Map) when is_function(Fun,1), is_map(Map) ->
+ case maps:find(Key,Map) of
+ {ok,Val} -> maps:update(Key,Fun(Val),Map);
+ error -> maps:put(Key,Init,Map)
+ end;
+update_with(Key,Fun,Init,Map) ->
+ erlang:error(error_type(Map),[Key,Fun,Init,Map]).
-%%% End of BIFs
-spec get(Key, Map, Default) -> Value | Default when
Key :: term(),
diff --git a/lib/stdlib/src/math.erl b/lib/stdlib/src/math.erl
index 06dfc01bbb..97c965e27a 100644
--- a/lib/stdlib/src/math.erl
+++ b/lib/stdlib/src/math.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/ordsets.erl b/lib/stdlib/src/ordsets.erl
index 6010b41006..569407f5ef 100644
--- a/lib/stdlib/src/ordsets.erl
+++ b/lib/stdlib/src/ordsets.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/otp_internal.erl b/lib/stdlib/src/otp_internal.erl
index 6f546da7b8..7a59523f06 100644
--- a/lib/stdlib/src/otp_internal.erl
+++ b/lib/stdlib/src/otp_internal.erl
@@ -47,18 +47,6 @@ obsolete(Module, Name, Arity) ->
obsolete_1(net, _, _) ->
{deprecated, "module 'net' obsolete; use 'net_adm'"};
-obsolete_1(erl_internal, builtins, 0) ->
- {deprecated, {erl_internal, bif, 2}};
-
-obsolete_1(erl_eval, seq, 2) ->
- {deprecated, {erl_eval, exprs, 2}};
-obsolete_1(erl_eval, seq, 3) ->
- {deprecated, {erl_eval, exprs, 3}};
-obsolete_1(erl_eval, arg_list, 2) ->
- {deprecated, {erl_eval, expr_list, 2}};
-obsolete_1(erl_eval, arg_list, 3) ->
- {deprecated, {erl_eval, expr_list, 3}};
-
obsolete_1(erlang, hash, 2) ->
{deprecated, {erlang, phash2, 2}};
@@ -70,11 +58,12 @@ obsolete_1(erlang, now, 0) ->
obsolete_1(calendar, local_time_to_universal_time, 1) ->
{deprecated, {calendar, local_time_to_universal_time_dst, 1}};
-obsolete_1(rpc, safe_multi_server_call, A) when A =:= 2; A =:= 3 ->
- {deprecated, {rpc, multi_server_call, A}};
+%% *** CRYPTO added in OTP 19 ***
+obsolete_1(crypto, rand_bytes, 1) ->
+ {deprecated, {crypto, strong_rand_bytes, 1}};
-%% *** CRYPTO add in R16B01 ***
+%% *** CRYPTO added in R16B01 ***
obsolete_1(crypto, md4, 1) ->
{deprecated, {crypto, hash, 2}};
@@ -391,106 +380,10 @@ obsolete_1(http, cookie_header, 2) -> {removed,{httpc,cookie_header,2},"R15B"
obsolete_1(http, stream_next, 1) -> {removed,{httpc,stream_next,1},"R15B"};
obsolete_1(http, default_profile, 0) -> {removed,{httpc,default_profile,0},"R15B"};
-obsolete_1(httpd, start, 0) -> {removed,{inets,start,[2,3]},"R14B"};
-obsolete_1(httpd, start, 1) -> {removed,{inets,start,[2,3]},"R14B"};
-obsolete_1(httpd, start_link, 0) -> {removed,{inets,start,[2,3]},"R14B"};
-obsolete_1(httpd, start_link, 1) -> {removed,{inets,start,[2,3]},"R14B"};
-obsolete_1(httpd, start_child, 0) -> {removed,{inets,start,[2,3]},"R14B"};
-obsolete_1(httpd, start_child, 1) -> {removed,{inets,start,[2,3]},"R14B"};
-obsolete_1(httpd, stop, 0) -> {removed,{inets,stop,2},"R14B"};
-obsolete_1(httpd, stop, 1) -> {removed,{inets,stop,2},"R14B"};
-obsolete_1(httpd, stop, 2) -> {removed,{inets,stop,2},"R14B"};
-obsolete_1(httpd, stop_child, 0) -> {removed,{inets,stop,2},"R14B"};
-obsolete_1(httpd, stop_child, 1) -> {removed,{inets,stop,2},"R14B"};
-obsolete_1(httpd, stop_child, 2) -> {removed,{inets,stop,2},"R14B"};
-obsolete_1(httpd, restart, 0) -> {removed,{httpd,reload_config,2},"R14B"};
-obsolete_1(httpd, restart, 1) -> {removed,{httpd,reload_config,2},"R14B"};
-obsolete_1(httpd, restart, 2) -> {removed,{httpd,reload_config,2},"R14B"};
-obsolete_1(httpd, block, 0) -> {removed,{httpd,reload_config,2},"R14B"};
-obsolete_1(httpd, block, 1) -> {removed,{httpd,reload_config,2},"R14B"};
-obsolete_1(httpd, block, 2) -> {removed,{httpd,reload_config,2},"R14B"};
-obsolete_1(httpd, block, 3) -> {removed,{httpd,reload_config,2},"R14B"};
-obsolete_1(httpd, block, 4) -> {removed,{httpd,reload_config,2},"R14B"};
-obsolete_1(httpd, unblock, 0) -> {removed,{httpd,reload_config,2},"R14B"};
-obsolete_1(httpd, unblock, 1) -> {removed,{httpd,reload_config,2},"R14B"};
-obsolete_1(httpd, unblock, 2) -> {removed,{httpd,reload_config,2},"R14B"};
-obsolete_1(httpd_util, key1search, 2) -> {removed,{proplists,get_value,2},"R13B"};
-obsolete_1(httpd_util, key1search, 3) -> {removed,{proplists,get_value,3},"R13B"};
-obsolete_1(ftp, open, 3) -> {removed,{inets,start,[2,3]},"R14B"};
-obsolete_1(ftp, force_active, 1) -> {removed,{inets,start,[2,3]},"R14B"};
-
-%% Added in R12B-4.
-obsolete_1(ssh_cm, connect, A) when 1 =< A, A =< 3 ->
- {removed,{ssh,connect,A},"R14B"};
-obsolete_1(ssh_cm, listen, A) when 2 =< A, A =< 4 ->
- {removed,{ssh,daemon,A},"R14B"};
-obsolete_1(ssh_cm, stop_listener, 1) ->
- {removed,{ssh,stop_listener,[1,2]},"R14B"};
-obsolete_1(ssh_cm, session_open, A) when A =:= 2; A =:= 4 ->
- {removed,{ssh_connection,session_channel,A},"R14B"};
-obsolete_1(ssh_cm, direct_tcpip, A) when A =:= 6; A =:= 8 ->
- {removed,{ssh_connection,direct_tcpip,A},"R14B"};
-obsolete_1(ssh_cm, tcpip_forward, 3) ->
- {removed,{ssh_connection,tcpip_forward,3},"R14B"};
-obsolete_1(ssh_cm, cancel_tcpip_forward, 3) ->
- {removed,{ssh_connection,cancel_tcpip_forward,3},"R14B"};
-obsolete_1(ssh_cm, open_pty, A) when A =:= 3; A =:= 7; A =:= 9 ->
- {removed,{ssh_connection,open_pty,A},"R14B"};
-obsolete_1(ssh_cm, setenv, 5) ->
- {removed,{ssh_connection,setenv,5},"R14B"};
-obsolete_1(ssh_cm, shell, 2) ->
- {removed,{ssh_connection,shell,2},"R14B"};
-obsolete_1(ssh_cm, exec, 4) ->
- {removed,{ssh_connection,exec,4},"R14B"};
-obsolete_1(ssh_cm, subsystem, 4) ->
- {removed,{ssh_connection,subsystem,4},"R14B"};
-obsolete_1(ssh_cm, winch, A) when A =:= 4; A =:= 6 ->
- {removed,{ssh_connection,window_change,A},"R14B"};
-obsolete_1(ssh_cm, signal, 3) ->
- {removed,{ssh_connection,signal,3},"R14B"};
-obsolete_1(ssh_cm, attach, A) when A =:= 2; A =:= 3 ->
- {removed,"no longer useful; removed in R14B"};
-obsolete_1(ssh_cm, detach, 2) ->
- {removed,"no longer useful; removed in R14B"};
-obsolete_1(ssh_cm, set_user_ack, 4) ->
- {removed,"no longer useful; removed in R14B"};
-obsolete_1(ssh_cm, adjust_window, 3) ->
- {removed,{ssh_connection,adjust_window,3},"R14B"};
-obsolete_1(ssh_cm, close, 2) ->
- {removed,{ssh_connection,close,2},"R14B"};
-obsolete_1(ssh_cm, stop, 1) ->
- {removed,{ssh,close,1},"R14B"};
-obsolete_1(ssh_cm, send_eof, 2) ->
- {removed,{ssh_connection,send_eof,2},"R14B"};
-obsolete_1(ssh_cm, send, A) when A =:= 3; A =:= 4 ->
- {removed,{ssh_connection,send,A},"R14B"};
-obsolete_1(ssh_cm, send_ack, A) when 3 =< A, A =< 5 ->
- {removed,{ssh_connection,send,[3,4]},"R14B"};
-obsolete_1(ssh_ssh, connect, A) when 1 =< A, A =< 3 ->
- {removed,{ssh,shell,A},"R14B"};
-obsolete_1(ssh_sshd, listen, A) when 0 =< A, A =< 3 ->
- {removed,{ssh,daemon,[1,2,3]},"R14B"};
-obsolete_1(ssh_sshd, stop, 1) ->
- {removed,{ssh,stop_listener,1},"R14B"};
-
%% Added in R13A.
obsolete_1(regexp, _, _) ->
{removed, "removed in R15; use the re module instead"};
-obsolete_1(lists, flat_length, 1) ->
- {removed,{lists,flatlength,1},"R14"};
-
-obsolete_1(ssh_sftp, connect, A) when 1 =< A, A =< 3 ->
- {removed,{ssh_sftp,start_channel,A},"R14B"};
-obsolete_1(ssh_sftp, stop, 1) ->
- {removed,{ssh_sftp,stop_channel,1},"R14B"};
-
-%% Added in R13B01.
-obsolete_1(ssl_pkix, decode_cert_file, A) when A =:= 1; A =:= 2 ->
- {removed,"removed in R14A; use public_key:pem_to_der/1 and public_key:pkix_decode_cert/2 instead"};
-obsolete_1(ssl_pkix, decode_cert, A) when A =:= 1; A =:= 2 ->
- {removed,{public_key,pkix_decode_cert,2},"R14A"};
-
%% Added in R13B04.
obsolete_1(erlang, concat_binary, 1) ->
{removed,{erlang,list_to_binary,1},"R15B"};
@@ -649,8 +542,12 @@ obsolete_1(random, _, _) ->
obsolete_1(code, rehash, 0) ->
{deprecated, "deprecated because the code path cache feature has been removed"};
+%% Removed in OTP 19.
+
obsolete_1(overload, _, _) ->
{removed, "removed in OTP 19"};
+obsolete_1(rpc, safe_multi_server_call, A) when A =:= 2; A =:= 3 ->
+ {removed, {rpc, multi_server_call, A}};
obsolete_1(_, _, _) ->
no.
diff --git a/lib/stdlib/src/pool.erl b/lib/stdlib/src/pool.erl
index 2112337f65..05950a1d7c 100644
--- a/lib/stdlib/src/pool.erl
+++ b/lib/stdlib/src/pool.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/proc_lib.erl b/lib/stdlib/src/proc_lib.erl
index 10c476a6f5..fdc2ae4070 100644
--- a/lib/stdlib/src/proc_lib.erl
+++ b/lib/stdlib/src/proc_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -48,7 +48,9 @@
| {'priority', priority_level()}
| {'min_heap_size', non_neg_integer()}
| {'min_bin_vheap_size', non_neg_integer()}
- | {'fullsweep_after', non_neg_integer()}.
+ | {'fullsweep_after', non_neg_integer()}
+ | {'message_queue_data',
+ 'off_heap' | 'on_heap' | 'mixed' }.
-type dict_or_pid() :: pid()
| (ProcInfo :: [_])
@@ -472,13 +474,15 @@ trans_init(gen,init_it,[gen_server,_,_,supervisor_bridge,[Module|_],_]) ->
{supervisor_bridge,Module,1};
trans_init(gen,init_it,[gen_server,_,_,_,supervisor_bridge,[Module|_],_]) ->
{supervisor_bridge,Module,1};
-trans_init(gen,init_it,[gen_server,_,_,Module,_,_]) ->
+trans_init(gen,init_it,[GenMod,_,_,Module,_,_])
+ when GenMod =:= gen_server;
+ GenMod =:= gen_statem;
+ GenMod =:= gen_fsm ->
{Module,init,1};
-trans_init(gen,init_it,[gen_server,_,_,_,Module|_]) ->
- {Module,init,1};
-trans_init(gen,init_it,[gen_fsm,_,_,Module,_,_]) ->
- {Module,init,1};
-trans_init(gen,init_it,[gen_fsm,_,_,_,Module|_]) ->
+trans_init(gen,init_it,[GenMod,_,_,_,Module|_])
+ when GenMod =:= gen_server;
+ GenMod =:= gen_statem;
+ GenMod =:= gen_fsm ->
{Module,init,1};
trans_init(gen,init_it,[gen_event|_]) ->
{gen_event,init_it,6};
diff --git a/lib/stdlib/src/proplists.erl b/lib/stdlib/src/proplists.erl
index 1840fa5cc0..8e99ec0ed9 100644
--- a/lib/stdlib/src/proplists.erl
+++ b/lib/stdlib/src/proplists.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/queue.erl b/lib/stdlib/src/queue.erl
index 2e65759d2a..d4d1904886 100644
--- a/lib/stdlib/src/queue.erl
+++ b/lib/stdlib/src/queue.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/rand.erl b/lib/stdlib/src/rand.erl
index d455abf7b0..93409d95df 100644
--- a/lib/stdlib/src/rand.erl
+++ b/lib/stdlib/src/rand.erl
@@ -44,11 +44,11 @@
%% This depends on the algorithm handler function
-type alg_seed() :: exs64_state() | exsplus_state() | exs1024_state().
%% This is the algorithm handler function within this module
--type alg_handler() :: #{type => alg(),
- max => integer(),
- next => fun(),
- uniform => fun(),
- uniform_n => fun()}.
+-type alg_handler() :: #{type := alg(),
+ max := integer(),
+ next := fun(),
+ uniform := fun(),
+ uniform_n := fun()}.
%% Internal state
-opaque state() :: {alg_handler(), alg_seed()}.
diff --git a/lib/stdlib/src/random.erl b/lib/stdlib/src/random.erl
index 8b639dd0a7..46dabb4323 100644
--- a/lib/stdlib/src/random.erl
+++ b/lib/stdlib/src/random.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/re.erl b/lib/stdlib/src/re.erl
index 80bfe38970..52d3c35608 100644
--- a/lib/stdlib/src/re.erl
+++ b/lib/stdlib/src/re.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/sets.erl b/lib/stdlib/src/sets.erl
index cd435ff49c..3e70450320 100644
--- a/lib/stdlib/src/sets.erl
+++ b/lib/stdlib/src/sets.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/shell_default.erl b/lib/stdlib/src/shell_default.erl
index 4ef5e14db1..6947cf181b 100644
--- a/lib/stdlib/src/shell_default.erl
+++ b/lib/stdlib/src/shell_default.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/slave.erl b/lib/stdlib/src/slave.erl
index 4e629a5e56..5b5c328c0c 100644
--- a/lib/stdlib/src/slave.erl
+++ b/lib/stdlib/src/slave.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/sofs.erl b/lib/stdlib/src/sofs.erl
index bcd1fc11e2..b18df2ad09 100644
--- a/lib/stdlib/src/sofs.erl
+++ b/lib/stdlib/src/sofs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/stdlib.app.src b/lib/stdlib/src/stdlib.app.src
index b8a7973cf2..32bcdc4f2a 100644
--- a/lib/stdlib/src/stdlib.app.src
+++ b/lib/stdlib/src/stdlib.app.src
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -65,6 +65,7 @@
gen_event,
gen_fsm,
gen_server,
+ gen_statem,
io,
io_lib,
io_lib_format,
diff --git a/lib/stdlib/src/stdlib.appup.src b/lib/stdlib/src/stdlib.appup.src
index 15d8857656..9877662743 100644
--- a/lib/stdlib/src/stdlib.appup.src
+++ b/lib/stdlib/src/stdlib.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/string.erl b/lib/stdlib/src/string.erl
index 07659ed812..c659db78bd 100644
--- a/lib/stdlib/src/string.erl
+++ b/lib/stdlib/src/string.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/supervisor.erl b/lib/stdlib/src/supervisor.erl
index 0400c845ab..38b764541a 100644
--- a/lib/stdlib/src/supervisor.erl
+++ b/lib/stdlib/src/supervisor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -57,8 +57,8 @@
| {'global', Name :: atom()}
| {'via', Module :: module(), Name :: any()}
| pid().
--type child_spec() :: #{id => child_id(), % mandatory
- start => mfargs(), % mandatory
+-type child_spec() :: #{id := child_id(), % mandatory
+ start := mfargs(), % mandatory
restart => restart(), % optional
shutdown => shutdown(), % optional
type => worker(), % optional
diff --git a/lib/stdlib/src/supervisor_bridge.erl b/lib/stdlib/src/supervisor_bridge.erl
index 18218b71ad..af1e046d30 100644
--- a/lib/stdlib/src/supervisor_bridge.erl
+++ b/lib/stdlib/src/supervisor_bridge.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/sys.erl b/lib/stdlib/src/sys.erl
index a7debb00f5..a6ecf03716 100644
--- a/lib/stdlib/src/sys.erl
+++ b/lib/stdlib/src/sys.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/timer.erl b/lib/stdlib/src/timer.erl
index f7530447bb..ca868627a9 100644
--- a/lib/stdlib/src/timer.erl
+++ b/lib/stdlib/src/timer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/src/win32reg.erl b/lib/stdlib/src/win32reg.erl
index 8074b2efda..8e82a79cbf 100644
--- a/lib/stdlib/src/win32reg.erl
+++ b/lib/stdlib/src/win32reg.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/ExpandTestCaps.erl b/lib/stdlib/test/ExpandTestCaps.erl
index 1e5a1d68c3..7fb1107ae0 100644
--- a/lib/stdlib/test/ExpandTestCaps.erl
+++ b/lib/stdlib/test/ExpandTestCaps.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/ExpandTestCaps1.erl b/lib/stdlib/test/ExpandTestCaps1.erl
index e7ad0925f1..400a17b137 100644
--- a/lib/stdlib/test/ExpandTestCaps1.erl
+++ b/lib/stdlib/test/ExpandTestCaps1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/Makefile b/lib/stdlib/test/Makefile
index 287f63b2be..28c35aed55 100644
--- a/lib/stdlib/test/Makefile
+++ b/lib/stdlib/test/Makefile
@@ -46,6 +46,7 @@ MODULES= \
gen_event_SUITE \
gen_fsm_SUITE \
gen_server_SUITE \
+ gen_statem_SUITE \
id_transform_SUITE \
io_SUITE \
io_proto_SUITE \
diff --git a/lib/stdlib/test/array_SUITE.erl b/lib/stdlib/test/array_SUITE.erl
index 8d031ed490..5836f275ba 100644
--- a/lib/stdlib/test/array_SUITE.erl
+++ b/lib/stdlib/test/array_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/base64_SUITE.erl b/lib/stdlib/test/base64_SUITE.erl
index 074047c7c5..9176a3664a 100644
--- a/lib/stdlib/test/base64_SUITE.erl
+++ b/lib/stdlib/test/base64_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/beam_lib_SUITE.erl b/lib/stdlib/test/beam_lib_SUITE.erl
index bf6e30ec83..4521ecc0ef 100644
--- a/lib/stdlib/test/beam_lib_SUITE.erl
+++ b/lib/stdlib/test/beam_lib_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/binary_module_SUITE.erl b/lib/stdlib/test/binary_module_SUITE.erl
index 285740d3e0..55fdcdd054 100644
--- a/lib/stdlib/test/binary_module_SUITE.erl
+++ b/lib/stdlib/test/binary_module_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/c_SUITE.erl b/lib/stdlib/test/c_SUITE.erl
index 266918581b..4bd32a30f8 100644
--- a/lib/stdlib/test/c_SUITE.erl
+++ b/lib/stdlib/test/c_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/c_SUITE_data/m.erl b/lib/stdlib/test/c_SUITE_data/m.erl
index df1d5f4c01..5f758053e5 100644
--- a/lib/stdlib/test/c_SUITE_data/m.erl
+++ b/lib/stdlib/test/c_SUITE_data/m.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/calendar_SUITE.erl b/lib/stdlib/test/calendar_SUITE.erl
index 7372288492..20053dfe54 100644
--- a/lib/stdlib/test/calendar_SUITE.erl
+++ b/lib/stdlib/test/calendar_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/dict_SUITE.erl b/lib/stdlib/test/dict_SUITE.erl
index d315e6f673..47358d729f 100644
--- a/lib/stdlib/test/dict_SUITE.erl
+++ b/lib/stdlib/test/dict_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/digraph_SUITE.erl b/lib/stdlib/test/digraph_SUITE.erl
index 8825d3fc15..b5d3452616 100644
--- a/lib/stdlib/test/digraph_SUITE.erl
+++ b/lib/stdlib/test/digraph_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/digraph_utils_SUITE.erl b/lib/stdlib/test/digraph_utils_SUITE.erl
index 23520072f8..1dda4d6624 100644
--- a/lib/stdlib/test/digraph_utils_SUITE.erl
+++ b/lib/stdlib/test/digraph_utils_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/dummy1_h.erl b/lib/stdlib/test/dummy1_h.erl
index cdf9a305e1..c46b7cd303 100644
--- a/lib/stdlib/test/dummy1_h.erl
+++ b/lib/stdlib/test/dummy1_h.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/dummy_h.erl b/lib/stdlib/test/dummy_h.erl
index c81ea984f2..bc89cb4fde 100644
--- a/lib/stdlib/test/dummy_h.erl
+++ b/lib/stdlib/test/dummy_h.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/edlin_expand_SUITE.erl b/lib/stdlib/test/edlin_expand_SUITE.erl
index a53c5333d8..ccffa2e244 100644
--- a/lib/stdlib/test/edlin_expand_SUITE.erl
+++ b/lib/stdlib/test/edlin_expand_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/epp_SUITE.erl b/lib/stdlib/test/epp_SUITE.erl
index 3e1aaef378..4078513e38 100644
--- a/lib/stdlib/test/epp_SUITE.erl
+++ b/lib/stdlib/test/epp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -27,7 +27,8 @@
pmod/1, not_circular/1, skip_header/1, otp_6277/1, otp_7702/1,
otp_8130/1, overload_mac/1, otp_8388/1, otp_8470/1,
otp_8562/1, otp_8665/1, otp_8911/1, otp_10302/1, otp_10820/1,
- otp_11728/1, encoding/1, extends/1, function_macro/1]).
+ otp_11728/1, encoding/1, extends/1, function_macro/1,
+ test_error/1, test_warning/1]).
-export([epp_parse_erl_form/2]).
@@ -67,7 +68,7 @@ all() ->
not_circular, skip_header, otp_6277, otp_7702, otp_8130,
overload_mac, otp_8388, otp_8470, otp_8562,
otp_8665, otp_8911, otp_10302, otp_10820, otp_11728,
- encoding, extends, function_macro].
+ encoding, extends, function_macro, test_error, test_warning].
groups() ->
[{upcase_mac, [], [upcase_mac_1, upcase_mac_2]},
@@ -1055,7 +1056,65 @@ ifdef(Config) ->
],
[] = run(Config, Ts).
+%% OTP-12847: Test the -error directive.
+test_error(Config) ->
+ Cs = [{error_c1,
+ <<"-error(\"string and macro: \" ?MODULE_STRING).\n"
+ "-ifdef(NOT_DEFINED).\n"
+ " -error(\"this one will be skipped\").\n"
+ "-endif.\n">>,
+ {errors,[{1,epp,{error,"string and macro: epp_test"}}],[]}},
+
+ {error_c2,
+ <<"-ifdef(CONFIG_A).\n"
+ " t() -> a.\n"
+ "-else.\n"
+ "-ifdef(CONFIG_B).\n"
+ " t() -> b.\n"
+ "-else.\n"
+ "-error(\"Neither CONFIG_A nor CONFIG_B are available\").\n"
+ "-endif.\n"
+ "-endif.\n">>,
+ {errors,[{7,epp,{error,"Neither CONFIG_A nor CONFIG_B are available"}}],[]}},
+
+ {error_c3,
+ <<"-error(a b c).\n">>,
+ {errors,[{1,epp,{bad,error}}],[]}}
+ ],
+
+ [] = compile(Config, Cs),
+ ok.
+
+%% OTP-12847: Test the -warning directive.
+test_warning(Config) ->
+ Cs = [{warn_c1,
+ <<"-warning({a,term,?MODULE}).\n"
+ "-ifdef(NOT_DEFINED).\n"
+ "-warning(\"this one will be skipped\").\n"
+ "-endif.\n">>,
+ {warnings,[{1,epp,{warning,{a,term,epp_test}}}]}},
+
+ {warn_c2,
+ <<"-ifdef(CONFIG_A).\n"
+ " t() -> a.\n"
+ "-else.\n"
+ "-ifdef(CONFIG_B).\n"
+ " t() -> b.\n"
+ "-else.\n"
+ " t() -> c.\n"
+ "-warning(\"Using fallback\").\n"
+ "-endif.\n"
+ "-endif.\n">>,
+ {warnings,[{8,epp,{warning,"Using fallback"}}]}},
+
+ {warn_c3,
+ <<"-warning(a b c).\n">>,
+ {errors,[{1,epp,{bad,warning}}],[]}}
+ ],
+
+ [] = compile(Config, Cs),
+ ok.
%% Advanced test on overloading macros.
overload_mac(Config) when is_list(Config) ->
diff --git a/lib/stdlib/test/epp_SUITE_data/mac.erl b/lib/stdlib/test/epp_SUITE_data/mac.erl
index 210c57e033..9215dcb342 100644
--- a/lib/stdlib/test/epp_SUITE_data/mac.erl
+++ b/lib/stdlib/test/epp_SUITE_data/mac.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/epp_SUITE_data/mac2.erl b/lib/stdlib/test/epp_SUITE_data/mac2.erl
index 0dd83ece06..315870517f 100644
--- a/lib/stdlib/test/epp_SUITE_data/mac2.erl
+++ b/lib/stdlib/test/epp_SUITE_data/mac2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/epp_SUITE_data/mac3.erl b/lib/stdlib/test/epp_SUITE_data/mac3.erl
index e7a3178db7..702a0c38a9 100644
--- a/lib/stdlib/test/epp_SUITE_data/mac3.erl
+++ b/lib/stdlib/test/epp_SUITE_data/mac3.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/epp_SUITE_data/pmod.erl b/lib/stdlib/test/epp_SUITE_data/pmod.erl
index ff0ee81116..d846cd9ca2 100644
--- a/lib/stdlib/test/epp_SUITE_data/pmod.erl
+++ b/lib/stdlib/test/epp_SUITE_data/pmod.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/epp_SUITE_data/variable_1.erl b/lib/stdlib/test/epp_SUITE_data/variable_1.erl
index cd6a7bb69a..b731d11e87 100644
--- a/lib/stdlib/test/epp_SUITE_data/variable_1.erl
+++ b/lib/stdlib/test/epp_SUITE_data/variable_1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/epp_SUITE_data/variable_1_include.hrl b/lib/stdlib/test/epp_SUITE_data/variable_1_include.hrl
index 30df6a3309..058f8dfd34 100644
--- a/lib/stdlib/test/epp_SUITE_data/variable_1_include.hrl
+++ b/lib/stdlib/test/epp_SUITE_data/variable_1_include.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/epp_SUITE_data/variable_1_include_dir.hrl b/lib/stdlib/test/epp_SUITE_data/variable_1_include_dir.hrl
index 4e2bd3e41f..453f32d766 100644
--- a/lib/stdlib/test/epp_SUITE_data/variable_1_include_dir.hrl
+++ b/lib/stdlib/test/epp_SUITE_data/variable_1_include_dir.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/erl_anno_SUITE.erl b/lib/stdlib/test/erl_anno_SUITE.erl
index 637a390c70..71ea9c3e1e 100644
--- a/lib/stdlib/test/erl_anno_SUITE.erl
+++ b/lib/stdlib/test/erl_anno_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/erl_expand_records_SUITE.erl b/lib/stdlib/test/erl_expand_records_SUITE.erl
index 7fed7fce56..3885f6648d 100644
--- a/lib/stdlib/test/erl_expand_records_SUITE.erl
+++ b/lib/stdlib/test/erl_expand_records_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/erl_internal_SUITE.erl b/lib/stdlib/test/erl_internal_SUITE.erl
index 45e67226b7..bfa48de6b7 100644
--- a/lib/stdlib/test/erl_internal_SUITE.erl
+++ b/lib/stdlib/test/erl_internal_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl
index 29a389d4b8..b0214e5238 100644
--- a/lib/stdlib/test/erl_lint_SUITE.erl
+++ b/lib/stdlib/test/erl_lint_SUITE.erl
@@ -33,47 +33,38 @@
-define(privdir, proplists:get_value(priv_dir, Conf)).
-endif.
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- init_per_testcase/2, end_per_testcase/2]).
-
--export([
- unused_vars_warn_basic/1,
- unused_vars_warn_lc/1,
- unused_vars_warn_rec/1,
- unused_vars_warn_fun/1,
- unused_vars_OTP_4858/1,
- unused_unsafe_vars_warn/1,
- export_vars_warn/1,
- shadow_vars/1,
- unused_import/1,
- unused_function/1,
- unsafe_vars/1,unsafe_vars2/1,
- unsafe_vars_try/1,
- unsized_binary_in_bin_gen_pattern/1,
- guard/1, otp_4886/1, otp_4988/1, otp_5091/1, otp_5276/1, otp_5338/1,
- otp_5362/1, otp_5371/1, otp_7227/1, otp_5494/1, otp_5644/1, otp_5878/1,
- otp_5917/1, otp_6585/1, otp_6885/1, otp_10436/1, otp_11254/1,
- otp_11772/1, otp_11771/1, otp_11872/1,
- export_all/1,
- bif_clash/1,
- behaviour_basic/1, behaviour_multiple/1, otp_11861/1,
- otp_7550/1,
- otp_8051/1,
- format_warn/1,
- on_load_successful/1, on_load_failing/1,
- too_many_arguments/1,
- basic_errors/1,bin_syntax_errors/1,
- predef/1,
- maps/1,maps_type/1,otp_11851/1,otp_11879/1,otp_13230/1,
- record_errors/1
- ]).
-
-init_per_testcase(_Case, Config) ->
- Config.
-
-end_per_testcase(_Case, _Config) ->
- ok.
+-export([all/0, suite/0, groups/0]).
+
+-export([unused_vars_warn_basic/1,
+ unused_vars_warn_lc/1,
+ unused_vars_warn_rec/1,
+ unused_vars_warn_fun/1,
+ unused_vars_OTP_4858/1,
+ unused_unsafe_vars_warn/1,
+ export_vars_warn/1,
+ shadow_vars/1,
+ unused_import/1,
+ unused_function/1,
+ unsafe_vars/1,unsafe_vars2/1,
+ unsafe_vars_try/1,
+ unsized_binary_in_bin_gen_pattern/1,
+ guard/1, otp_4886/1, otp_4988/1, otp_5091/1, otp_5276/1, otp_5338/1,
+ otp_5362/1, otp_5371/1, otp_7227/1, otp_5494/1, otp_5644/1, otp_5878/1,
+ otp_5917/1, otp_6585/1, otp_6885/1, otp_10436/1, otp_11254/1,
+ otp_11772/1, otp_11771/1, otp_11872/1,
+ export_all/1,
+ bif_clash/1,
+ behaviour_basic/1, behaviour_multiple/1, otp_11861/1,
+ otp_7550/1,
+ otp_8051/1,
+ format_warn/1,
+ on_load_successful/1, on_load_failing/1,
+ too_many_arguments/1,
+ basic_errors/1,bin_syntax_errors/1,
+ predef/1,
+ maps/1,maps_type/1,maps_parallel_match/1,
+ otp_11851/1,otp_11879/1,otp_13230/1,
+ record_errors/1]).
suite() ->
[{ct_hooks,[ts_install_cth]},
@@ -91,7 +82,8 @@ all() ->
bif_clash, behaviour_basic, behaviour_multiple, otp_11861,
otp_7550, otp_8051, format_warn, {group, on_load},
too_many_arguments, basic_errors, bin_syntax_errors, predef,
- maps, maps_type, otp_11851, otp_11879, otp_13230,
+ maps, maps_type, maps_parallel_match,
+ otp_11851, otp_11879, otp_13230,
record_errors].
groups() ->
@@ -101,19 +93,6 @@ groups() ->
unused_vars_OTP_4858, unused_unsafe_vars_warn]},
{on_load, [], [on_load_successful, on_load_failing]}].
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
%% Warnings for unused variables in some simple cases.
unused_vars_warn_basic(Config) when is_list(Config) ->
@@ -2703,9 +2682,8 @@ otp_11872(Config) when is_list(Config) ->
t() ->
1.
">>,
- {error,[{6,erl_lint,{undefined_type,{product,0}}},
- {8,erl_lint,{undefined_type,{dict,0}}}],
- [{8,erl_lint,{new_builtin_type,{map,0}}}]} =
+ {errors,[{6,erl_lint,{undefined_type,{product,0}}},
+ {8,erl_lint,{builtin_type,{map,0}}}], []} =
run_test2(Config, Ts, []),
ok.
@@ -3584,8 +3562,6 @@ predef(Config) when is_list(Config) ->
ok.
maps(Config) ->
- %% TODO: test key patterns, not done because map patterns are going to be
- %% changed a lot.
Ts = [{illegal_map_construction,
<<"t() ->
#{ a := b,
@@ -3627,6 +3603,26 @@ maps(Config) ->
{errors,[{1,erl_lint,illegal_map_construction},
{1,erl_lint,{unbound_var,'X'}}],
[]}},
+ {legal_map_pattern,
+ <<"
+ -record(mapkey, {a=1,b=2}).
+ t(M,K1) ->
+ #{ a := 1,
+ $a := 1, $z := 99,
+ #{a=>val} := 2,
+ K1 := 1337,
+ #mapkey{a = 10} := wat,
+ #{{a,val}=>val} := 2,
+ #{ \"hi\" => wazzup, hi => ho } := yep,
+ ok := 1.0,
+ [3+3] := nope,
+ 1.0 := yep,
+ {3.0+3} := nope,
+ {yep} := yep
+ } = M.
+ ">>,
+ [],
+ []},
{legal_map_construction,
<<"t(V) -> #{ a => 1,
#{a=>V} => 2,
@@ -3689,7 +3685,52 @@ maps_type(Config) when is_list(Config) ->
t(M) -> M.
">>,
[],
- {warnings,[{3,erl_lint,{new_builtin_type,{map,0}}}]}}],
+ {errors,[{3,erl_lint,{builtin_type,{map,0}}}],[]}}],
+ [] = run(Config, Ts),
+ ok.
+
+maps_parallel_match(Config) when is_list(Config) ->
+ Ts = [{parallel_map_patterns_unbound1,
+ <<"
+ t(#{} = M) ->
+ #{K := V} = #{k := K} = M,
+ V.
+ ">>,
+ [],
+ {errors,[{3,erl_lint,{unbound_var,'K'}}],[]}},
+ {parallel_map_patterns_unbound2,
+ <<"
+ t(#{} = M) ->
+ #{K1 := V1} =
+ #{K2 := V2} =
+ #{k1 := K1,k2 := K2} = M,
+ [V1,V2].
+ ">>,
+ [],
+ {errors,[{3,erl_lint,{unbound_var,'K1'}},
+ {3,erl_lint,{unbound_var,'K1'}},
+ {4,erl_lint,{unbound_var,'K2'}},
+ {4,erl_lint,{unbound_var,'K2'}}],[]}},
+ {parallel_map_patterns_bound,
+ <<"
+ t(#{} = M,K1,K2) ->
+ #{K1 := V1} =
+ #{K2 := V2} =
+ #{k1 := K1,k2 := K2} = M,
+ [V1,V2].
+ ">>,
+ [],
+ []},
+ {parallel_map_patterns_literal,
+ <<"
+ t(#{} = M) ->
+ #{k1 := V1} =
+ #{k2 := V2} =
+ #{k1 := V1,k2 := V2} = M,
+ [V1,V2].
+ ">>,
+ [],
+ []}],
[] = run(Config, Ts),
ok.
diff --git a/lib/stdlib/test/erl_lint_SUITE_data/format.erl b/lib/stdlib/test/erl_lint_SUITE_data/format.erl
index ede89cd545..540befd146 100644
--- a/lib/stdlib/test/erl_lint_SUITE_data/format.erl
+++ b/lib/stdlib/test/erl_lint_SUITE_data/format.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/erl_pp_SUITE.erl b/lib/stdlib/test/erl_pp_SUITE.erl
index 4d44f7686a..a48ba7b5b7 100644
--- a/lib/stdlib/test/erl_pp_SUITE.erl
+++ b/lib/stdlib/test/erl_pp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -50,7 +50,7 @@
otp_6321/1, otp_6911/1, otp_6914/1, otp_8150/1, otp_8238/1,
otp_8473/1, otp_8522/1, otp_8567/1, otp_8664/1, otp_9147/1,
- otp_10302/1, otp_10820/1, otp_11100/1, otp_11861/1]).
+ otp_10302/1, otp_10820/1, otp_11100/1, otp_11861/1, pr_1014/1]).
%% Internal export.
-export([ehook/6]).
@@ -79,7 +79,7 @@ groups() ->
{tickets, [],
[otp_6321, otp_6911, otp_6914, otp_8150, otp_8238,
otp_8473, otp_8522, otp_8567, otp_8664, otp_9147,
- otp_10302, otp_10820, otp_11100, otp_11861]}].
+ otp_10302, otp_10820, otp_11100, otp_11861, pr_1014]}].
init_per_suite(Config) ->
Config.
@@ -902,6 +902,7 @@ maps_syntax(Config) when is_list(Config) ->
"-compile(export_all).\n"
"-type t1() :: map().\n"
"-type t2() :: #{ atom() => integer(), atom() => float() }.\n"
+ "-type t3() :: #{ atom() := integer(), atom() := float() }.\n"
"-type u() :: #{a => (I :: integer()) | (A :: atom()),\n"
" (X :: atom()) | (Y :: atom()) =>\n"
" (I :: integer()) | (A :: atom())}.\n"
@@ -1106,6 +1107,24 @@ otp_11861(Config) when is_list(Config) ->
pf(Form) ->
lists:flatten(erl_pp:form(Form, none)).
+pr_1014(Config) ->
+ ok = pp_forms(<<"-type t() :: #{_ => _}. ">>),
+ ok = pp_forms(<<"-type t() :: #{any() => _}. ">>),
+ ok = pp_forms(<<"-type t() :: #{_ => any()}. ">>),
+ ok = pp_forms(<<"-type t() :: #{any() => any()}. ">>),
+ ok = pp_forms(<<"-type t() :: #{...}. ">>),
+ ok = pp_forms(<<"-type t() :: #{atom() := integer(), ...}. ">>),
+
+ FileName = filename('pr_1014.erl', Config),
+ C = <<"-module pr_1014.\n"
+ "-compile export_all.\n"
+ "-type m() :: #{..., a := integer()}.\n">>,
+ ok = file:write_file(FileName, C),
+ {error,[{_,[{3,erl_parse,["syntax error before: ","','"]}]}],_} =
+ compile:file(FileName, [return]),
+
+ ok.
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
compile(Config, Tests) ->
diff --git a/lib/stdlib/test/erl_scan_SUITE.erl b/lib/stdlib/test/erl_scan_SUITE.erl
index 9432edc00f..4ae734eb65 100644
--- a/lib/stdlib/test/erl_scan_SUITE.erl
+++ b/lib/stdlib/test/erl_scan_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/error_logger_forwarder.erl b/lib/stdlib/test/error_logger_forwarder.erl
index 7ac2cfce82..6bbf180585 100644
--- a/lib/stdlib/test/error_logger_forwarder.erl
+++ b/lib/stdlib/test/error_logger_forwarder.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
-module(error_logger_forwarder).
%% API.
--export([register/0]).
+-export([register/0, unregister/0]).
%% Internal export for error_logger.
-export([init/1,
@@ -33,6 +33,10 @@
register() ->
error_logger:add_report_handler(?MODULE, self()).
+unregister() ->
+ Self = self(),
+ Self = error_logger:delete_report_handler(?MODULE).
+
init(Tester) ->
{ok,Tester}.
diff --git a/lib/stdlib/test/error_logger_h_SUITE.erl b/lib/stdlib/test/error_logger_h_SUITE.erl
index 30811f3fb4..2a34c7764f 100644
--- a/lib/stdlib/test/error_logger_h_SUITE.erl
+++ b/lib/stdlib/test/error_logger_h_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2015. All Rights Reserved.
+%% Copyright Ericsson AB 2015-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -65,11 +65,18 @@ logfile(Config) ->
error_logger:logfile(close),
analyse_events(Log, Ev, [AtNode], unlimited),
- [] = [{X, file:pid2name(X)} || X <- processes(), Data <- [process_info(X, [current_function])],
- Data =/= undefined,
- element(1, element(2, lists:keyfind(current_function, 1, Data)))
- =:= file_io_server,
- file:pid2name(X) =:= {ok, Log}],
+ %% Make sure that the file_io_server process has been stopped
+ [] = lists:filtermap(
+ fun(X) ->
+ case {process_info(X, [current_function]),
+ file:pid2name(X)} of
+ {[{current_function, {file_io_server, _, _}}],
+ {ok,P2N = Log}} ->
+ {true, {X, P2N}};
+ _ ->
+ false
+ end
+ end, processes()),
test_server:stop_node(Node),
@@ -112,7 +119,7 @@ tty(Config) ->
do_one_tty(Log, Ev, unlimited),
Pa = "-pa " ++ filename:dirname(code:which(?MODULE)),
- {ok,Node} = start_node(logfile, Pa),
+ {ok,Node} = start_node(tty, Pa),
tty_log_open(Log),
ok = rpc:call(Node, erlang, apply, [fun gen_events/1,[Ev]]),
tty_log_close(),
diff --git a/lib/stdlib/test/escript_SUITE.erl b/lib/stdlib/test/escript_SUITE.erl
index 30aaac70c2..28d69232a0 100644
--- a/lib/stdlib/test/escript_SUITE.erl
+++ b/lib/stdlib/test/escript_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dict/src/archive_script_dict.erl b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dict/src/archive_script_dict.erl
index 40758e3258..fc33d84445 100644
--- a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dict/src/archive_script_dict.erl
+++ b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dict/src/archive_script_dict.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dict/src/archive_script_dict_app.erl b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dict/src/archive_script_dict_app.erl
index a5bb5fa077..53174f2c6f 100644
--- a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dict/src/archive_script_dict_app.erl
+++ b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dict/src/archive_script_dict_app.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dict/src/archive_script_dict_sup.erl b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dict/src/archive_script_dict_sup.erl
index 8ed41a27ce..b1ab4b0597 100644
--- a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dict/src/archive_script_dict_sup.erl
+++ b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dict/src/archive_script_dict_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dummy/src/archive_script_dummy.erl b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dummy/src/archive_script_dummy.erl
index a6685e8189..117ced4dc7 100644
--- a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dummy/src/archive_script_dummy.erl
+++ b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dummy/src/archive_script_dummy.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dummy/src/archive_script_dummy_app.erl b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dummy/src/archive_script_dummy_app.erl
index bbfdda7741..9d751615fc 100644
--- a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dummy/src/archive_script_dummy_app.erl
+++ b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dummy/src/archive_script_dummy_app.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dummy/src/archive_script_dummy_sup.erl b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dummy/src/archive_script_dummy_sup.erl
index 389d485f6d..a38958d004 100644
--- a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dummy/src/archive_script_dummy_sup.erl
+++ b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_dummy/src/archive_script_dummy_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_main.erl b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_main.erl
index 5ea114f25d..3b005e8aff 100644
--- a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_main.erl
+++ b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_main.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_main2.erl b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_main2.erl
index 6270a6bb60..1dc76b3dfa 100644
--- a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_main2.erl
+++ b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_main2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/escript_SUITE_data/archive_script_file_access/archive_script_file_access.erl b/lib/stdlib/test/escript_SUITE_data/archive_script_file_access/archive_script_file_access.erl
index 6c3ff1c463..7cffacdf97 100644
--- a/lib/stdlib/test/escript_SUITE_data/archive_script_file_access/archive_script_file_access.erl
+++ b/lib/stdlib/test/escript_SUITE_data/archive_script_file_access/archive_script_file_access.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl
index 678c225d25..15e3142408 100644
--- a/lib/stdlib/test/ets_SUITE.erl
+++ b/lib/stdlib/test/ets_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -2497,9 +2497,10 @@ rename_unnamed_do(Opts) ->
%% Rename a table with many fixations, and at the same time delete it.
evil_rename(Config) when is_list(Config) ->
- evil_rename_1(old_hash, new_hash, [public,named_table]),
EtsMem = etsmem(),
+ evil_rename_1(old_hash, new_hash, [public,named_table]),
evil_rename_1(old_tree, new_tree, [public,ordered_set,named_table]),
+ wait_for_test_procs(true),
verify_etsmem(EtsMem).
evil_rename_1(Old, New, Flags) ->
@@ -2540,7 +2541,8 @@ crazy_fixtable_wait(N, Dracula) ->
crazy_fixtable_1(0, _) ->
ok;
crazy_fixtable_1(N, Fun) ->
- spawn_link(Fun),
+ %%FIXME my_spawn_link(Fun),
+ my_spawn_link(Fun),
crazy_fixtable_1(N-1, Fun).
evil_creater_destroyer() ->
@@ -5752,10 +5754,11 @@ spawn_logger(Procs, FailedMemchecks) ->
after 0 ->
case Kill of
true -> exit(Proc, kill);
- _ -> ok
+ _ ->
+ erlang:display({"Waiting for 'DOWN' from", Proc,
+ process_info(Proc),
+ pid_status(Proc)})
end,
- erlang:display({"Waiting for 'DOWN' from", Proc,
- process_info(Proc), pid_status(Proc)}),
receive
{'DOWN', Mon, _, _, _} ->
ok
diff --git a/lib/stdlib/test/ets_tough_SUITE.erl b/lib/stdlib/test/ets_tough_SUITE.erl
index c83c17217b..49aba7a529 100644
--- a/lib/stdlib/test/ets_tough_SUITE.erl
+++ b/lib/stdlib/test/ets_tough_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/expand_test.erl b/lib/stdlib/test/expand_test.erl
index 6c178a9270..5544923a12 100644
--- a/lib/stdlib/test/expand_test.erl
+++ b/lib/stdlib/test/expand_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/expand_test1.erl b/lib/stdlib/test/expand_test1.erl
index 9f1ea42eb7..abefaefcfd 100644
--- a/lib/stdlib/test/expand_test1.erl
+++ b/lib/stdlib/test/expand_test1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/file_sorter_SUITE.erl b/lib/stdlib/test/file_sorter_SUITE.erl
index 379f4d609b..5c0e2c1576 100644
--- a/lib/stdlib/test/file_sorter_SUITE.erl
+++ b/lib/stdlib/test/file_sorter_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/filelib_SUITE.erl b/lib/stdlib/test/filelib_SUITE.erl
index 16616a3207..4f8936edbf 100644
--- a/lib/stdlib/test/filelib_SUITE.erl
+++ b/lib/stdlib/test/filelib_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/filename_SUITE.erl b/lib/stdlib/test/filename_SUITE.erl
index 3d6734b790..b7c4d3a6e5 100644
--- a/lib/stdlib/test/filename_SUITE.erl
+++ b/lib/stdlib/test/filename_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/fixtable_SUITE.erl b/lib/stdlib/test/fixtable_SUITE.erl
index de100a11d6..736e643974 100644
--- a/lib/stdlib/test/fixtable_SUITE.erl
+++ b/lib/stdlib/test/fixtable_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/format_SUITE.erl b/lib/stdlib/test/format_SUITE.erl
index b481d82ea6..176a40f1c5 100644
--- a/lib/stdlib/test/format_SUITE.erl
+++ b/lib/stdlib/test/format_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/gen_event_SUITE.erl b/lib/stdlib/test/gen_event_SUITE.erl
index 4bad7801ff..4415c2d09d 100644
--- a/lib/stdlib/test/gen_event_SUITE.erl
+++ b/lib/stdlib/test/gen_event_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/gen_fsm_SUITE.erl b/lib/stdlib/test/gen_fsm_SUITE.erl
index f79a344c4e..d6bb002b5f 100644
--- a/lib/stdlib/test/gen_fsm_SUITE.erl
+++ b/lib/stdlib/test/gen_fsm_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -391,6 +391,12 @@ abnormal1(Config) when is_list(Config) ->
delayed = gen_fsm:sync_send_event(my_fsm, {delayed_answer,1}, 100),
{'EXIT',{timeout,_}} =
(catch gen_fsm:sync_send_event(my_fsm, {delayed_answer,10}, 1)),
+ receive
+ Msg ->
+ %% Ignore the delayed answer from the server.
+ io:format("Delayed message: ~p", [Msg])
+ end,
+
[] = get_messages(),
ok.
@@ -971,7 +977,7 @@ init(stop) ->
init(stop_shutdown) ->
{stop, shutdown};
init(sleep) ->
- ct:sleep(1000),
+ timer:sleep(1000),
{ok, idle, data};
init({timeout, T}) ->
{ok, idle, state, T};
@@ -1004,7 +1010,7 @@ idle(_, Data) ->
idle({connect, _Pid}, _From, Data) ->
{reply, accept, wfor_conf, Data};
idle({delayed_answer, T}, _From, Data) ->
- ct:sleep(T),
+ timer:sleep(T),
{reply, delayed, idle, Data};
idle(badreturn, _From, _Data) ->
badreturn;
diff --git a/lib/stdlib/test/gen_server_SUITE.erl b/lib/stdlib/test/gen_server_SUITE.erl
index 916fbc4e84..3242511f4a 100644
--- a/lib/stdlib/test/gen_server_SUITE.erl
+++ b/lib/stdlib/test/gen_server_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/gen_statem_SUITE.erl b/lib/stdlib/test/gen_statem_SUITE.erl
new file mode 100644
index 0000000000..364314f91b
--- /dev/null
+++ b/lib/stdlib/test/gen_statem_SUITE.erl
@@ -0,0 +1,1584 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2016. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+-module(gen_statem_SUITE).
+
+-include_lib("common_test/include/ct.hrl").
+
+-compile(export_all).
+-behaviour(gen_statem).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
+
+all() ->
+ [{group, start},
+ {group, start_handle_event},
+ {group, stop},
+ {group, stop_handle_event},
+ {group, abnormal},
+ {group, abnormal_handle_event},
+ shutdown, stop_and_reply, event_order,
+ {group, sys},
+ hibernate, enter_loop].
+
+groups() ->
+ [{start, [],
+ [start1, start2, start3, start4, start5, start6, start7,
+ start8, start9, start10, start11, start12, next_events]},
+ {start_handle_event, [],
+ [start1, start2, start3, start4, start5, start6, start7,
+ start8, start9, start10, start11, start12, next_events]},
+ {stop, [],
+ [stop1, stop2, stop3, stop4, stop5, stop6, stop7, stop8, stop9, stop10]},
+ {stop_handle_event, [],
+ [stop1, stop2, stop3, stop4, stop5, stop6, stop7, stop8, stop9, stop10]},
+ {abnormal, [], [abnormal1, abnormal2]},
+ {abnormal_handle_event, [], [abnormal1, abnormal2]},
+ {sys, [],
+ [sys1, code_change,
+ call_format_status,
+ error_format_status, terminate_crash_format,
+ get_state, replace_state]},
+ {sys_handle_event, [],
+ [sys1,
+ call_format_status,
+ error_format_status, terminate_crash_format,
+ get_state, replace_state]}].
+
+init_per_suite(Config) ->
+ Config.
+
+end_per_suite(_Config) ->
+ ok.
+
+init_per_group(GroupName, Config)
+ when GroupName =:= start_handle_event;
+ GroupName =:= stop_handle_event;
+ GroupName =:= abnormal_handle_event;
+ GroupName =:= sys_handle_event ->
+ [{callback_mode,handle_event_function}|Config];
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+init_per_testcase(_CaseName, Config) ->
+ flush(),
+%%% dbg:tracer(),
+%%% dbg:p(all, c),
+%%% dbg:tpl(gen_statem, cx),
+%%% dbg:tpl(proc_lib, cx),
+%%% dbg:tpl(gen, cx),
+%%% dbg:tpl(sys, cx),
+ Config.
+
+end_per_testcase(_CaseName, Config) ->
+%%% dbg:stop(),
+ Config.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-define(EXPECT_FAILURE(Code, Reason),
+ try begin Code end of
+ Reason ->
+ ct:fail({unexpected,Reason})
+ catch
+ error:Reason -> Reason;
+ exit:Reason -> Reason
+ end).
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% anonymous
+start1(Config) ->
+ %%OldFl = process_flag(trap_exit, true),
+
+ {ok,Pid0} = gen_statem:start_link(?MODULE, start_arg(Config, []), []),
+ ok = do_func_test(Pid0),
+ ok = do_sync_func_test(Pid0),
+ stop_it(Pid0),
+%% stopped = gen_statem:call(Pid0, stop),
+%% timeout =
+%% ?EXPECT_FAILURE(gen_statem:call(Pid0, hej), Reason),
+
+ %%process_flag(trap_exit, OldFl),
+ ok = verify_empty_msgq().
+
+%% anonymous w. shutdown
+start2(Config) ->
+ %% Dont link when shutdown
+ {ok,Pid0} = gen_statem:start(?MODULE, start_arg(Config, []), []),
+ ok = do_func_test(Pid0),
+ ok = do_sync_func_test(Pid0),
+ stopped = gen_statem:call(Pid0, {stop,shutdown}),
+ check_stopped(Pid0),
+ ok = verify_empty_msgq().
+
+%% anonymous with timeout
+start3(Config) ->
+ %%OldFl = process_flag(trap_exit, true),
+
+ {ok,Pid0} =
+ gen_statem:start(?MODULE, start_arg(Config, []), [{timeout,5}]),
+ ok = do_func_test(Pid0),
+ ok = do_sync_func_test(Pid0),
+ stop_it(Pid0),
+
+ {error,timeout} =
+ gen_statem:start(
+ ?MODULE, start_arg(Config, sleep), [{timeout,5}]),
+
+ %%process_flag(trap_exit, OldFl),
+ ok = verify_empty_msgq().
+
+%% anonymous with ignore
+start4(Config) ->
+ OldFl = process_flag(trap_exit, true),
+
+ ignore = gen_statem:start(?MODULE, start_arg(Config, ignore), []),
+
+ process_flag(trap_exit, OldFl),
+ ok = verify_empty_msgq().
+
+%% anonymous with stop
+start5(Config) ->
+ OldFl = process_flag(trap_exit, true),
+
+ {error,stopped} = gen_statem:start(?MODULE, start_arg(Config, stop), []),
+
+ process_flag(trap_exit, OldFl),
+ ok = verify_empty_msgq().
+
+%% anonymous linked
+start6(Config) ->
+ {ok,Pid} = gen_statem:start_link(?MODULE, start_arg(Config, []), []),
+ ok = do_func_test(Pid),
+ ok = do_sync_func_test(Pid),
+ stop_it(Pid),
+
+ ok = verify_empty_msgq().
+
+%% global register linked
+start7(Config) ->
+ STM = {global,my_stm},
+
+ {ok,Pid} =
+ gen_statem:start_link(STM, ?MODULE, start_arg(Config, []), []),
+ {error,{already_started,Pid}} =
+ gen_statem:start_link(STM, ?MODULE, start_arg(Config, []), []),
+ {error,{already_started,Pid}} =
+ gen_statem:start(STM, ?MODULE, start_arg(Config, []), []),
+
+ ok = do_func_test(Pid),
+ ok = do_sync_func_test(Pid),
+ ok = do_func_test(STM),
+ ok = do_sync_func_test(STM),
+ stop_it(STM),
+
+ ok = verify_empty_msgq().
+
+
+%% local register
+start8(Config) ->
+ %%OldFl = process_flag(trap_exit, true),
+ Name = my_stm,
+ STM = {local,Name},
+
+ {ok,Pid} =
+ gen_statem:start(STM, ?MODULE, start_arg(Config, []), []),
+ {error,{already_started,Pid}} =
+ gen_statem:start(STM, ?MODULE, start_arg(Config, []), []),
+
+ ok = do_func_test(Pid),
+ ok = do_sync_func_test(Pid),
+ ok = do_func_test(Name),
+ ok = do_sync_func_test(Name),
+ stop_it(Pid),
+
+ %%process_flag(trap_exit, OldFl),
+ ok = verify_empty_msgq().
+
+%% local register linked
+start9(Config) ->
+ %%OldFl = process_flag(trap_exit, true),
+ Name = my_stm,
+ STM = {local,Name},
+
+ {ok,Pid} =
+ gen_statem:start_link(STM, ?MODULE, start_arg(Config, []), []),
+ {error,{already_started,Pid}} =
+ gen_statem:start(STM, ?MODULE, start_arg(Config, []), []),
+
+ ok = do_func_test(Pid),
+ ok = do_sync_func_test(Pid),
+ ok = do_func_test(Name),
+ ok = do_sync_func_test(Name),
+ stop_it(Pid),
+
+ %%process_flag(trap_exit, OldFl),
+ ok = verify_empty_msgq().
+
+%% global register
+start10(Config) ->
+ STM = {global,my_stm},
+
+ {ok,Pid} =
+ gen_statem:start(STM, ?MODULE, start_arg(Config, []), []),
+ {error,{already_started,Pid}} =
+ gen_statem:start(STM, ?MODULE, start_arg(Config, []), []),
+ {error,{already_started,Pid}} =
+ gen_statem:start_link(STM, ?MODULE, start_arg(Config, []), []),
+
+ ok = do_func_test(Pid),
+ ok = do_sync_func_test(Pid),
+ ok = do_func_test(STM),
+ ok = do_sync_func_test(STM),
+ stop_it(STM),
+
+ ok = verify_empty_msgq().
+
+%% Stop registered processes
+start11(Config) ->
+ Name = my_stm,
+ LocalSTM = {local,Name},
+ GlobalSTM = {global,Name},
+
+ {ok,Pid} =
+ gen_statem:start_link(LocalSTM, ?MODULE, start_arg(Config, []), []),
+ stop_it(Pid),
+
+ {ok,_Pid1} =
+ gen_statem:start_link(LocalSTM, ?MODULE, start_arg(Config, []), []),
+ stop_it(Name),
+
+ {ok,Pid2} =
+ gen_statem:start(GlobalSTM, ?MODULE, start_arg(Config, []), []),
+ stop_it(Pid2),
+ receive after 1 -> true end,
+ Result =
+ gen_statem:start(GlobalSTM, ?MODULE, start_arg(Config, []), []),
+ ct:log("Result = ~p~n",[Result]),
+ {ok,_Pid3} = Result,
+ stop_it(GlobalSTM),
+
+ ok = verify_empty_msgq().
+
+%% Via register linked
+start12(Config) ->
+ dummy_via:reset(),
+ VIA = {via,dummy_via,my_stm},
+
+ {ok,Pid} =
+ gen_statem:start_link(VIA, ?MODULE, start_arg(Config, []), []),
+ {error,{already_started,Pid}} =
+ gen_statem:start_link(VIA, ?MODULE, start_arg(Config, []), []),
+ {error,{already_started,Pid}} =
+ gen_statem:start(VIA, ?MODULE, start_arg(Config, []), []),
+
+ ok = do_func_test(Pid),
+ ok = do_sync_func_test(Pid),
+ ok = do_func_test(VIA),
+ ok = do_sync_func_test(VIA),
+ stop_it(VIA),
+
+ ok = verify_empty_msgq().
+
+
+%% Anonymous, reason 'normal'
+stop1(Config) ->
+ {ok,Pid} = gen_statem:start(?MODULE, start_arg(Config, []), []),
+ ok = gen_statem:stop(Pid),
+ false = erlang:is_process_alive(Pid),
+ noproc =
+ ?EXPECT_FAILURE(gen_statem:stop(Pid), Reason).
+
+%% Anonymous, other reason
+stop2(Config) ->
+ {ok,Pid} = gen_statem:start(?MODULE, start_arg(Config, []), []),
+ ok = gen_statem:stop(Pid, other_reason, infinity),
+ false = erlang:is_process_alive(Pid),
+ ok.
+
+%% Anonymous, invalid timeout
+stop3(Config) ->
+ {ok,Pid} = gen_statem:start(?MODULE, start_arg(Config, []), []),
+ _ =
+ ?EXPECT_FAILURE(
+ gen_statem:stop(Pid, other_reason, invalid_timeout),
+ Reason),
+ true = erlang:is_process_alive(Pid),
+ ok = gen_statem:stop(Pid),
+ false = erlang:is_process_alive(Pid),
+ ok.
+
+%% Registered name
+stop4(Config) ->
+ {ok,Pid} =
+ gen_statem:start(
+ {local,to_stop},?MODULE, start_arg(Config, []), []),
+ ok = gen_statem:stop(to_stop),
+ false = erlang:is_process_alive(Pid),
+ noproc =
+ ?EXPECT_FAILURE(gen_statem:stop(to_stop), Reason),
+ ok.
+
+%% Registered name and local node
+stop5(Config) ->
+ Name = to_stop,
+ {ok,Pid} =
+ gen_statem:start(
+ {local,Name},?MODULE, start_arg(Config, []), []),
+ ok = gen_statem:stop({Name,node()}),
+ false = erlang:is_process_alive(Pid),
+ noproc =
+ ?EXPECT_FAILURE(gen_statem:stop({Name,node()}), Reason),
+ ok.
+
+%% Globally registered name
+stop6(Config) ->
+ STM = {global,to_stop},
+ {ok,Pid} = gen_statem:start(STM, ?MODULE, start_arg(Config, []), []),
+ ok = gen_statem:stop(STM),
+ false = erlang:is_process_alive(Pid),
+ noproc =
+ ?EXPECT_FAILURE(gen_statem:stop(STM), Reason),
+ ok.
+
+%% 'via' registered name
+stop7(Config) ->
+ VIA = {via,dummy_via,to_stop},
+ dummy_via:reset(),
+ {ok,Pid} = gen_statem:start(VIA, ?MODULE, start_arg(Config, []), []),
+ ok = gen_statem:stop(VIA),
+ false = erlang:is_process_alive(Pid),
+ noproc =
+ ?EXPECT_FAILURE(gen_statem:stop(VIA), Reason),
+ ok.
+
+%% Anonymous on remote node
+stop8(Config) ->
+ Node = gen_statem_stop8,
+ {ok,NodeName} = ct_slave:start(Node),
+ Dir = filename:dirname(code:which(?MODULE)),
+ rpc:call(NodeName, code, add_path, [Dir]),
+ {ok,Pid} =
+ rpc:call(
+ NodeName, gen_statem,start,
+ [?MODULE,start_arg(Config, []),[]]),
+ ok = gen_statem:stop(Pid),
+ false = rpc:call(NodeName, erlang, is_process_alive, [Pid]),
+ noproc =
+ ?EXPECT_FAILURE(gen_statem:stop(Pid), Reason1),
+ {ok,NodeName} = ct_slave:stop(Node),
+ {{nodedown,NodeName},{sys,terminate,_}} =
+ ?EXPECT_FAILURE(gen_statem:stop(Pid), Reason2),
+ ok.
+
+%% Registered name on remote node
+stop9(Config) ->
+ Name = to_stop,
+ LocalSTM = {local,Name},
+ Node = gen_statem__stop9,
+ {ok,NodeName} = ct_slave:start(Node),
+ STM = {Name,NodeName},
+ Dir = filename:dirname(code:which(?MODULE)),
+ rpc:call(NodeName, code, add_path, [Dir]),
+ {ok,Pid} =
+ rpc:call(
+ NodeName, gen_statem, start,
+ [LocalSTM,?MODULE,start_arg(Config, []),[]]),
+ ok = gen_statem:stop(STM),
+ undefined = rpc:call(NodeName,erlang,whereis,[Name]),
+ false = rpc:call(NodeName,erlang,is_process_alive,[Pid]),
+ noproc =
+ ?EXPECT_FAILURE(gen_statem:stop(STM), Reason1),
+ {ok,NodeName} = ct_slave:stop(Node),
+ {{nodedown,NodeName},{sys,terminate,_}} =
+ ?EXPECT_FAILURE(gen_statem:stop(STM), Reason2),
+ ok.
+
+%% Globally registered name on remote node
+stop10(Config) ->
+ Node = gen_statem_stop10,
+ STM = {global,to_stop},
+ {ok,NodeName} = ct_slave:start(Node),
+ Dir = filename:dirname(code:which(?MODULE)),
+ rpc:call(NodeName,code,add_path,[Dir]),
+ {ok,Pid} =
+ rpc:call(
+ NodeName, gen_statem, start,
+ [STM,?MODULE,start_arg(Config, []),[]]),
+ global:sync(),
+ ok = gen_statem:stop(STM),
+ false = rpc:call(NodeName, erlang, is_process_alive, [Pid]),
+ noproc =
+ ?EXPECT_FAILURE(gen_statem:stop(STM), Reason1),
+ {ok,NodeName} = ct_slave:stop(Node),
+ noproc =
+ ?EXPECT_FAILURE(gen_statem:stop(STM), Reason2),
+ ok.
+
+%% Check that time outs in calls work
+abnormal1(Config) ->
+ Name = abnormal1,
+ LocalSTM = {local,Name},
+
+ {ok, _Pid} =
+ gen_statem:start(LocalSTM, ?MODULE, start_arg(Config, []), []),
+
+ %% timeout call.
+ delayed = gen_statem:call(Name, {delayed_answer,1}, 100),
+ {timeout,_} =
+ ?EXPECT_FAILURE(
+ gen_statem:call(Name, {delayed_answer,1000}, 10),
+ Reason),
+ ok = gen_statem:stop(Name),
+ ok = verify_empty_msgq().
+
+%% Check that bad return values makes the stm crash. Note that we must
+%% trap exit since we must link to get the real bad_return_ error
+abnormal2(Config) ->
+ OldFl = process_flag(trap_exit, true),
+ {ok,Pid} = gen_statem:start_link(?MODULE, start_arg(Config, []), []),
+
+ %% bad return value in the gen_statem loop
+ {{bad_return_value,badreturn},_} =
+ ?EXPECT_FAILURE(gen_statem:call(Pid, badreturn), Reason),
+ receive
+ {'EXIT',Pid,{bad_return_value,badreturn}} -> ok
+ after 5000 ->
+ ct:fail(gen_statem_did_not_die)
+ end,
+
+ process_flag(trap_exit, OldFl),
+ ok = verify_empty_msgq().
+
+shutdown(Config) ->
+ process_flag(trap_exit, true),
+
+ {ok,Pid0} = gen_statem:start_link(?MODULE, start_arg(Config, []), []),
+ ok = do_func_test(Pid0),
+ ok = do_sync_func_test(Pid0),
+ stopped = gen_statem:call(Pid0, {stop,{shutdown,reason}}),
+ receive {'EXIT',Pid0,{shutdown,reason}} -> ok end,
+ process_flag(trap_exit, false),
+
+ {noproc,_} =
+ ?EXPECT_FAILURE(gen_statem:call(Pid0, hej), Reason),
+
+ receive
+ Any ->
+ ct:log("Unexpected: ~p", [Any]),
+ ct:fail({unexpected,Any})
+ after 500 ->
+ ok
+ end.
+
+
+
+stop_and_reply(_Config) ->
+ process_flag(trap_exit, true),
+
+ Machine =
+ %% Abusing the internal format of From...
+ #{init =>
+ fun () ->
+ {ok,start,undefined}
+ end,
+ start =>
+ fun (cast, {echo,From1,Reply1}, undefined) ->
+ {next_state,wait,{reply,From1,Reply1}}
+ end,
+ wait =>
+ fun (cast, {stop_and_reply,Reason,From2,Reply2},R1) ->
+ {stop_and_reply,Reason,
+ [R1,{reply,From2,Reply2}]}
+ end},
+ {ok,STM} = gen_statem:start_link(?MODULE, {map_statem,Machine}, []),
+
+ Self = self(),
+ Tag1 = make_ref(),
+ gen_statem:cast(STM, {echo,{Self,Tag1},reply1}),
+ Tag2 = make_ref(),
+ gen_statem:cast(STM, {stop_and_reply,reason,{Self,Tag2},reply2}),
+ case flush() of
+ [{Tag1,reply1},{Tag2,reply2},{'EXIT',STM,reason}] ->
+ ok;
+ Other1 ->
+ ct:fail({unexpected,Other1})
+ end,
+
+ {noproc,_} =
+ ?EXPECT_FAILURE(gen_statem:call(STM, hej), Reason),
+ case flush() of
+ [] ->
+ ok;
+ Other2 ->
+ ct:fail({unexpected,Other2})
+ end.
+
+
+
+event_order(_Config) ->
+ process_flag(trap_exit, true),
+
+ Machine =
+ %% Abusing the internal format of From...
+ #{init =>
+ fun () ->
+ {ok,start,undefined}
+ end,
+ start =>
+ fun (cast, _, _) ->
+ {keep_state_and_data,postpone}; %% Handled in 'buffer'
+ ({call,From}, {buffer,Pid,[Tag3,Tag4,Tag5]},
+ undefined) ->
+ {next_state,buffer,[],
+ [{next_event,internal,{reply,{Pid,Tag3},ok3}},
+ {next_event,internal,{reply,{Pid,Tag4},ok4}},
+ {timeout,0,{reply,{Pid,Tag5},ok5}},
+ %% The timeout should not happen since there
+ %% are events that cancel it i.e next_event
+ %% and postponed
+ {reply,From,ok}]}
+ end,
+ buffer =>
+ fun (internal, Reply, Replies) ->
+ {keep_state,[Reply|Replies]};
+ (timeout, Reply, Replies) ->
+ {keep_state,[Reply|Replies]};
+ (cast, Reply, Replies) ->
+ {keep_state,[Reply|Replies]};
+ ({call,From}, {stop,Reason}, Replies) ->
+ {next_state,stop,undefined,
+ lists:reverse(
+ Replies,
+ [{reply,From,ok},
+ {next_event,internal,{stop,Reason}}])}
+ end,
+ stop =>
+ fun (internal, Result, undefined) ->
+ Result
+ end},
+
+ {ok,STM} = gen_statem:start_link(?MODULE, {map_statem,Machine}, []),
+ Self = self(),
+ Tag1 = make_ref(),
+ gen_statem:cast(STM, {reply,{Self,Tag1},ok1}),
+ Tag2 = make_ref(),
+ gen_statem:cast(STM, {reply,{Self,Tag2},ok2}),
+ Tag3 = make_ref(),
+ Tag4 = make_ref(),
+ Tag5 = make_ref(),
+ ok = gen_statem:call(STM, {buffer,Self,[Tag3,Tag4,Tag5]}),
+ ok = gen_statem:call(STM, {stop,reason}),
+ case flush() of
+ [{Tag3,ok3},{Tag4,ok4},{Tag1,ok1},{Tag2,ok2},
+ {'EXIT',STM,reason}] ->
+ ok;
+ Other1 ->
+ ct:fail({unexpected,Other1})
+ end,
+
+ {noproc,_} =
+ ?EXPECT_FAILURE(gen_statem:call(STM, hej), Reason),
+ case flush() of
+ [] ->
+ ok;
+ Other2 ->
+ ct:fail({unexpected,Other2})
+ end.
+
+
+
+sys1(Config) ->
+ {ok,Pid} = gen_statem:start(?MODULE, start_arg(Config, []), []),
+ {status, Pid, {module,gen_statem}, _} = sys:get_status(Pid),
+ sys:suspend(Pid),
+ Parent = self(),
+ Tag = make_ref(),
+ Caller =
+ spawn(
+ fun () ->
+ Parent ! {Tag,gen_statem:call(Pid, hej)}
+ end),
+ receive
+ {Tag,_} ->
+ ct:fail(should_be_suspended)
+ after 3000 ->
+ exit(Caller, ok)
+ end,
+
+ %% {timeout,_} =
+ %% ?EXPECT_FAILURE(gen_statem:call(Pid, hej), Reason),
+ sys:resume(Pid),
+ stop_it(Pid).
+
+code_change(Config) ->
+ Mode = handle_event_function,
+ {ok,Pid} = gen_statem:start(?MODULE, start_arg(Config, []), []),
+ {idle,data} = sys:get_state(Pid),
+ sys:suspend(Pid),
+ sys:change_code(Pid, ?MODULE, old_vsn, Mode),
+ sys:resume(Pid),
+ {idle,{old_vsn,data,Mode}} = sys:get_state(Pid),
+ Mode = gen_statem:call(Pid, get_callback_mode),
+ stop_it(Pid).
+
+call_format_status(Config) ->
+ {ok,Pid} = gen_statem:start(?MODULE, start_arg(Config, []), []),
+ Status = sys:get_status(Pid),
+ {status,Pid,_Mod,[_PDict,running,_,_, Data]} = Status,
+ [format_status_called|_] = lists:reverse(Data),
+ stop_it(Pid),
+
+ %% check that format_status can handle a name being an atom (pid is
+ %% already checked by the previous test)
+ {ok, Pid2} =
+ gen_statem:start(
+ {local, gstm}, ?MODULE, start_arg(Config, []), []),
+ Status2 = sys:get_status(gstm),
+ {status,Pid2,_Mod,[_PDict2,running,_,_,Data2]} = Status2,
+ [format_status_called|_] = lists:reverse(Data2),
+ stop_it(Pid2),
+
+ %% check that format_status can handle a name being a term other than a
+ %% pid or atom
+ GlobalName1 = {global,"CallFormatStatus"},
+ {ok,Pid3} =
+ gen_statem:start(
+ GlobalName1, ?MODULE, start_arg(Config, []), []),
+ Status3 = sys:get_status(GlobalName1),
+ {status,Pid3,_Mod,[_PDict3,running,_,_,Data3]} = Status3,
+ [format_status_called|_] = lists:reverse(Data3),
+ stop_it(Pid3),
+ GlobalName2 = {global,{name, "term"}},
+ {ok,Pid4} =
+ gen_statem:start(
+ GlobalName2, ?MODULE, start_arg(Config, []), []),
+ Status4 = sys:get_status(GlobalName2),
+ {status,Pid4,_Mod,[_PDict4,running,_,_, Data4]} = Status4,
+ [format_status_called|_] = lists:reverse(Data4),
+ stop_it(Pid4),
+
+ %% check that format_status can handle a name being a term other than a
+ %% pid or atom
+ dummy_via:reset(),
+ ViaName1 = {via,dummy_via,"CallFormatStatus"},
+ {ok,Pid5} = gen_statem:start(ViaName1, ?MODULE, start_arg(Config, []), []),
+ Status5 = sys:get_status(ViaName1),
+ {status,Pid5,_Mod, [_PDict5,running,_,_, Data5]} = Status5,
+ [format_status_called|_] = lists:reverse(Data5),
+ stop_it(Pid5),
+ ViaName2 = {via,dummy_via,{name,"term"}},
+ {ok, Pid6} =
+ gen_statem:start(
+ ViaName2, ?MODULE, start_arg(Config, []), []),
+ Status6 = sys:get_status(ViaName2),
+ {status,Pid6,_Mod,[_PDict6,running,_,_,Data6]} = Status6,
+ [format_status_called|_] = lists:reverse(Data6),
+ stop_it(Pid6).
+
+
+
+error_format_status(Config) ->
+ error_logger_forwarder:register(),
+ OldFl = process_flag(trap_exit, true),
+ Data = "called format_status",
+ {ok,Pid} =
+ gen_statem:start(
+ ?MODULE, start_arg(Config, {data,Data}), []),
+ %% bad return value in the gen_statem loop
+ {{bad_return_value,badreturn},_} =
+ ?EXPECT_FAILURE(gen_statem:call(Pid, badreturn), Reason),
+ receive
+ {error,_,
+ {Pid,
+ "** State machine"++_,
+ [Pid,{{call,_},badreturn},
+ {formatted,idle,Data},
+ error,{bad_return_value,badreturn}|_]}} ->
+ ok;
+ Other when is_tuple(Other), element(1, Other) =:= error ->
+ error_logger_forwarder:unregister(),
+ ct:fail({unexpected,Other})
+ after 1000 ->
+ error_logger_forwarder:unregister(),
+ ct:fail(timeout)
+ end,
+ process_flag(trap_exit, OldFl),
+ error_logger_forwarder:unregister(),
+ receive
+ %% Comes with SASL
+ {error_report,_,{Pid,crash_report,_}} ->
+ ok
+ after 500 ->
+ ok
+ end,
+ ok = verify_empty_msgq().
+
+terminate_crash_format(Config) ->
+ error_logger_forwarder:register(),
+ OldFl = process_flag(trap_exit, true),
+ Data = crash_terminate,
+ {ok,Pid} =
+ gen_statem:start(
+ ?MODULE, start_arg(Config, {data,Data}), []),
+ stop_it(Pid),
+ Self = self(),
+ receive
+ {error,_GroupLeader,
+ {Pid,
+ "** State machine"++_,
+ [Pid,
+ {{call,{Self,_}},stop},
+ {formatted,idle,Data},
+ exit,{crash,terminate}|_]}} ->
+ ok;
+ Other when is_tuple(Other), element(1, Other) =:= error ->
+ error_logger_forwarder:unregister(),
+ ct:fail({unexpected,Other})
+ after 1000 ->
+ error_logger_forwarder:unregister(),
+ ct:fail(timeout)
+ end,
+ process_flag(trap_exit, OldFl),
+ error_logger_forwarder:unregister(),
+ receive
+ %% Comes with SASL
+ {error_report,_,{Pid,crash_report,_}} ->
+ ok
+ after 500 ->
+ ok
+ end,
+ ok = verify_empty_msgq().
+
+
+get_state(Config) ->
+ State = self(),
+ {ok,Pid} =
+ gen_statem:start(
+ ?MODULE, start_arg(Config, {data,State}), []),
+ {idle,State} = sys:get_state(Pid),
+ {idle,State} = sys:get_state(Pid, 5000),
+ stop_it(Pid),
+
+ %% check that get_state can handle a name being an atom (pid is
+ %% already checked by the previous test)
+ {ok,Pid2} =
+ gen_statem:start(
+ {local,gstm}, ?MODULE, start_arg(Config, {data,State}), []),
+ {idle,State} = sys:get_state(gstm),
+ {idle,State} = sys:get_state(gstm, 5000),
+ stop_it(Pid2),
+
+ %% check that get_state works when pid is sys suspended
+ {ok,Pid3} =
+ gen_statem:start(
+ ?MODULE, start_arg(Config, {data,State}), []),
+ {idle,State} = sys:get_state(Pid3),
+ ok = sys:suspend(Pid3),
+ {idle,State} = sys:get_state(Pid3, 5000),
+ ok = sys:resume(Pid3),
+ stop_it(Pid3),
+ ok = verify_empty_msgq().
+
+replace_state(Config) ->
+ State = self(),
+ {ok, Pid} =
+ gen_statem:start(
+ ?MODULE, start_arg(Config, {data,State}), []),
+ {idle,State} = sys:get_state(Pid),
+ NState1 = "replaced",
+ Replace1 = fun({StateName, _}) -> {StateName,NState1} end,
+ {idle,NState1} = sys:replace_state(Pid, Replace1),
+ {idle,NState1} = sys:get_state(Pid),
+ NState2 = "replaced again",
+ Replace2 = fun({idle, _}) -> {state0,NState2} end,
+ {state0,NState2} = sys:replace_state(Pid, Replace2, 5000),
+ {state0,NState2} = sys:get_state(Pid),
+ %% verify no change in state if replace function crashes
+ Replace3 = fun(_) -> error(fail) end,
+ {callback_failed,
+ {gen_statem,system_replace_state},{error,fail}} =
+ ?EXPECT_FAILURE(sys:replace_state(Pid, Replace3), Reason),
+ {state0, NState2} = sys:get_state(Pid),
+ %% verify state replaced if process sys suspended
+ ok = sys:suspend(Pid),
+ Suffix2 = " and again",
+ NState3 = NState2 ++ Suffix2,
+ Replace4 = fun({StateName, _}) -> {StateName, NState3} end,
+ {state0,NState3} = sys:replace_state(Pid, Replace4),
+ ok = sys:resume(Pid),
+ {state0,NState3} = sys:get_state(Pid, 5000),
+ stop_it(Pid),
+ ok = verify_empty_msgq().
+
+%% Hibernation
+hibernate(Config) ->
+ OldFl = process_flag(trap_exit, true),
+
+ {ok,Pid0} =
+ gen_statem:start_link(
+ ?MODULE, start_arg(Config, hiber_now), []),
+ is_in_erlang_hibernate(Pid0),
+ stop_it(Pid0),
+ receive
+ {'EXIT',Pid0,normal} -> ok
+ after 5000 ->
+ ct:fail(gen_statem_did_not_die)
+ end,
+
+ {ok,Pid} =
+ gen_statem:start_link(?MODULE, start_arg(Config, hiber), []),
+ true = ({current_function,{erlang,hibernate,3}} =/=
+ erlang:process_info(Pid,current_function)),
+ hibernating = gen_statem:call(Pid, hibernate_sync),
+ is_in_erlang_hibernate(Pid),
+ good_morning = gen_statem:call(Pid, wakeup_sync),
+ is_not_in_erlang_hibernate(Pid),
+ hibernating = gen_statem:call(Pid, hibernate_sync),
+ is_in_erlang_hibernate(Pid),
+ please_just_five_more = gen_statem:call(Pid, snooze_sync),
+ is_in_erlang_hibernate(Pid),
+ good_morning = gen_statem:call(Pid, wakeup_sync),
+ is_not_in_erlang_hibernate(Pid),
+ ok = gen_statem:cast(Pid, hibernate_async),
+ is_in_erlang_hibernate(Pid),
+ ok = gen_statem:cast(Pid, wakeup_async),
+ is_not_in_erlang_hibernate(Pid),
+ ok = gen_statem:cast(Pid, hibernate_async),
+ is_in_erlang_hibernate(Pid),
+ ok = gen_statem:cast(Pid, snooze_async),
+ is_in_erlang_hibernate(Pid),
+ ok = gen_statem:cast(Pid, wakeup_async),
+ is_not_in_erlang_hibernate(Pid),
+
+ Pid ! hibernate_later,
+ true =
+ ({current_function,{erlang,hibernate,3}} =/=
+ erlang:process_info(Pid, current_function)),
+ is_in_erlang_hibernate(Pid),
+
+ 'alive!' = gen_statem:call(Pid, 'alive?'),
+ true =
+ ({current_function,{erlang,hibernate,3}} =/=
+ erlang:process_info(Pid, current_function)),
+ Pid ! hibernate_now,
+ is_in_erlang_hibernate(Pid),
+
+ 'alive!' = gen_statem:call(Pid, 'alive?'),
+ true =
+ ({current_function,{erlang,hibernate,3}} =/=
+ erlang:process_info(Pid, current_function)),
+
+ hibernating = gen_statem:call(Pid, hibernate_sync),
+ is_in_erlang_hibernate(Pid),
+ good_morning = gen_statem:call(Pid, wakeup_sync),
+ is_not_in_erlang_hibernate(Pid),
+ hibernating = gen_statem:call(Pid, hibernate_sync),
+ is_in_erlang_hibernate(Pid),
+ please_just_five_more = gen_statem:call(Pid, snooze_sync),
+ is_in_erlang_hibernate(Pid),
+ good_morning = gen_statem:call(Pid, wakeup_sync),
+ is_not_in_erlang_hibernate(Pid),
+ ok = gen_statem:cast(Pid, hibernate_async),
+ is_in_erlang_hibernate(Pid),
+ ok = gen_statem:cast(Pid, wakeup_async),
+ is_not_in_erlang_hibernate(Pid),
+ ok = gen_statem:cast(Pid, hibernate_async),
+ is_in_erlang_hibernate(Pid),
+ ok = gen_statem:cast(Pid, snooze_async),
+ is_in_erlang_hibernate(Pid),
+ ok = gen_statem:cast(Pid, wakeup_async),
+ is_not_in_erlang_hibernate(Pid),
+
+ hibernating = gen_statem:call(Pid, hibernate_sync),
+ is_in_erlang_hibernate(Pid),
+ sys:suspend(Pid),
+ is_in_erlang_hibernate(Pid),
+ sys:resume(Pid),
+ is_in_erlang_hibernate(Pid),
+ receive after 1000 -> ok end,
+ is_in_erlang_hibernate(Pid),
+
+ good_morning = gen_statem:call(Pid, wakeup_sync),
+ is_not_in_erlang_hibernate(Pid),
+ stop_it(Pid),
+ process_flag(trap_exit, OldFl),
+ receive
+ {'EXIT',Pid,normal} -> ok
+ after 5000 ->
+ ct:fail(gen_statem_did_not_die)
+ end,
+ ok = verify_empty_msgq().
+
+is_in_erlang_hibernate(Pid) ->
+ receive after 1 -> ok end,
+ is_in_erlang_hibernate_1(200, Pid).
+
+is_in_erlang_hibernate_1(0, Pid) ->
+ ct:log("~p\n", [erlang:process_info(Pid, current_function)]),
+ ct:fail(not_in_erlang_hibernate_3);
+is_in_erlang_hibernate_1(N, Pid) ->
+ {current_function,MFA} = erlang:process_info(Pid, current_function),
+ case MFA of
+ {erlang,hibernate,3} ->
+ ok;
+ _ ->
+ receive after 10 -> ok end,
+ is_in_erlang_hibernate_1(N-1, Pid)
+ end.
+
+is_not_in_erlang_hibernate(Pid) ->
+ receive after 1 -> ok end,
+ is_not_in_erlang_hibernate_1(200, Pid).
+
+is_not_in_erlang_hibernate_1(0, Pid) ->
+ ct:log("~p\n", [erlang:process_info(Pid, current_function)]),
+ ct:fail(not_in_erlang_hibernate_3);
+is_not_in_erlang_hibernate_1(N, Pid) ->
+ {current_function,MFA} = erlang:process_info(Pid, current_function),
+ case MFA of
+ {erlang,hibernate,3} ->
+ receive after 10 -> ok end,
+ is_not_in_erlang_hibernate_1(N-1, Pid);
+ _ ->
+ ok
+ end.
+
+
+enter_loop(_Config) ->
+ OldFlag = process_flag(trap_exit, true),
+
+ dummy_via:reset(),
+
+ %% Locally registered process + {local,Name}
+ {ok,Pid1a} =
+ proc_lib:start_link(?MODULE, enter_loop, [local,local]),
+ yes = gen_statem:call(Pid1a, 'alive?'),
+ stopped = gen_statem:call(Pid1a, stop),
+ receive
+ {'EXIT',Pid1a,normal} ->
+ ok
+ after 5000 ->
+ ct:fail(gen_statem_did_not_die)
+ end,
+
+ %% Unregistered process + {local,Name}
+ {ok,Pid1b} =
+ proc_lib:start_link(?MODULE, enter_loop, [anon,local]),
+ receive
+ {'EXIT',Pid1b,process_not_registered} ->
+ ok
+ after 5000 ->
+ ct:fail(gen_statem_did_not_die)
+ end,
+
+ %% Globally registered process + {global,Name}
+ {ok,Pid2a} =
+ proc_lib:start_link(?MODULE, enter_loop, [global,global]),
+ yes = gen_statem:call(Pid2a, 'alive?'),
+ stopped = gen_statem:call(Pid2a, stop),
+ receive
+ {'EXIT',Pid2a,normal} ->
+ ok
+ after 5000 ->
+ ct:fail(gen_statem_did_not_die)
+ end,
+
+ %% Unregistered process + {global,Name}
+ {ok,Pid2b} =
+ proc_lib:start_link(?MODULE, enter_loop, [anon,global]),
+ receive
+ {'EXIT',Pid2b,process_not_registered_globally} ->
+ ok
+ after 5000 ->
+ ct:fail(gen_statem_did_not_die)
+ end,
+
+ %% Unregistered process + no name
+ {ok,Pid3} =
+ proc_lib:start_link(?MODULE, enter_loop, [anon,anon]),
+ yes = gen_statem:call(Pid3, 'alive?'),
+ stopped = gen_statem:call(Pid3, stop),
+ receive
+ {'EXIT',Pid3,normal} ->
+ ok
+ after 5000 ->
+ ct:fail(gen_statem_did_not_die)
+ end,
+
+ %% Process not started using proc_lib
+ CallbackMode = state_functions,
+ Pid4 =
+ spawn_link(
+ gen_statem, enter_loop,
+ [?MODULE,[],CallbackMode,state0,[]]),
+ receive
+ {'EXIT',Pid4,process_was_not_started_by_proc_lib} ->
+ ok
+ after 5000 ->
+ ct:fail(gen_statem_did_not_die)
+ end,
+
+ %% Make sure I am the parent, ie that ordering a shutdown will
+ %% result in the process terminating with Reason==shutdown
+ {ok,Pid5} =
+ proc_lib:start_link(?MODULE, enter_loop, [anon,anon]),
+ yes = gen_statem:call(Pid5, 'alive?'),
+ exit(Pid5, shutdown),
+ receive
+ {'EXIT',Pid5,shutdown} ->
+ ok
+ after 5000 ->
+ ct:fail(gen_statem_did_not_die)
+ end,
+
+ %% Make sure gen_statem:enter_loop does not accept {local,Name}
+ %% when it's another process than the calling one which is
+ %% registered under that name
+ register(armitage, self()),
+ {ok,Pid6a} =
+ proc_lib:start_link(?MODULE, enter_loop, [anon,local]),
+ receive
+ {'EXIT',Pid6a,process_not_registered} ->
+ ok
+ after 1000 ->
+ ct:fail(gen_statem_started)
+ end,
+ unregister(armitage),
+
+ %% Make sure gen_statem:enter_loop does not accept {global,Name}
+ %% when it's another process than the calling one which is
+ %% registered under that name
+ global:register_name(armitage, self()),
+ {ok,Pid6b} =
+ proc_lib:start_link(?MODULE, enter_loop, [anon,global]),
+ receive
+ {'EXIT',Pid6b,process_not_registered_globally} ->
+ ok
+ after 1000 ->
+ ct:fail(gen_statem_started)
+ end,
+ global:unregister_name(armitage),
+
+ dummy_via:register_name(armitage, self()),
+ {ok,Pid6c} =
+ proc_lib:start_link(?MODULE, enter_loop, [anon,via]),
+ receive
+ {'EXIT',Pid6c,{process_not_registered_via,dummy_via}} ->
+ ok
+ after 1000 ->
+ ct:fail(
+ {gen_statem_started,
+ process_info(self(), messages)})
+ end,
+ dummy_via:unregister_name(armitage),
+
+ process_flag(trap_exit, OldFlag),
+ ok = verify_empty_msgq().
+
+enter_loop(Reg1, Reg2) ->
+ process_flag(trap_exit, true),
+ case Reg1 of
+ local -> register(armitage, self());
+ global -> global:register_name(armitage, self());
+ via -> dummy_via:register_name(armitage, self());
+ anon -> ignore
+ end,
+ proc_lib:init_ack({ok, self()}),
+ CallbackMode = state_functions,
+ case Reg2 of
+ local ->
+ gen_statem:enter_loop(
+ ?MODULE, [], CallbackMode, state0, [], {local,armitage});
+ global ->
+ gen_statem:enter_loop(
+ ?MODULE, [], CallbackMode, state0, [], {global,armitage});
+ via ->
+ gen_statem:enter_loop(
+ ?MODULE, [], CallbackMode, state0, [],
+ {via, dummy_via, armitage});
+ anon ->
+ gen_statem:enter_loop(
+ ?MODULE, [], CallbackMode, state0, [])
+ end.
+
+
+%% Test the order for multiple {next_event,T,C}
+next_events(Config) ->
+ {ok,Pid} = gen_statem:start(?MODULE, start_arg(Config, []), []),
+ ok = gen_statem:cast(Pid, next_event),
+ {state,next_events,[]} = gen_statem:call(Pid, get),
+ ok = gen_statem:stop(Pid),
+ false = erlang:is_process_alive(Pid),
+ noproc =
+ ?EXPECT_FAILURE(gen_statem:stop(Pid), Reason).
+
+
+%%
+%% Functionality check
+%%
+
+wfor(Msg) ->
+ receive
+ Msg -> ok
+ after 5000 ->
+ error(timeout)
+ end.
+
+
+stop_it(STM) ->
+ stopped = gen_statem:call(STM, stop),
+ check_stopped(STM).
+
+
+check_stopped(STM) ->
+ Call = there_you_are,
+ {_,{gen_statem,call,[_,Call,infinity]}} =
+ ?EXPECT_FAILURE(gen_statem:call(STM, Call), Reason),
+ ok.
+
+
+do_func_test(STM) ->
+ ok = gen_statem:cast(STM, {'alive?',self()}),
+ wfor(yes),
+ ok = do_connect(STM),
+ ok = gen_statem:cast(STM, {'alive?',self()}),
+ wfor(yes),
+ ?t:do_times(3, ?MODULE, do_msg, [STM]),
+ ok = gen_statem:cast(STM, {'alive?',self()}),
+ wfor(yes),
+ ok = do_disconnect(STM),
+ ok = gen_statem:cast(STM, {'alive?',self()}),
+ wfor(yes),
+ ok.
+
+
+do_connect(STM) ->
+ check_state(STM, idle),
+ gen_statem:cast(STM, {connect,self()}),
+ wfor(accept),
+ check_state(STM, wfor_conf),
+ Tag = make_ref(),
+ gen_statem:cast(STM, {ping,self(),Tag}),
+ gen_statem:cast(STM, confirm),
+ wfor({pong,Tag}),
+ check_state(STM, connected),
+ ok.
+
+do_msg(STM) ->
+ check_state(STM, connected),
+ R = make_ref(),
+ ok = gen_statem:cast(STM, {msg,self(),R}),
+ wfor({ack,R}).
+
+
+do_disconnect(STM) ->
+ ok = gen_statem:cast(STM, disconnect),
+ check_state(STM, idle).
+
+check_state(STM, State) ->
+ case gen_statem:call(STM, get) of
+ {state, State, _} -> ok
+ end.
+
+do_sync_func_test(STM) ->
+ yes = gen_statem:call(STM, 'alive?'),
+ ok = do_sync_connect(STM),
+ yes = gen_statem:call(STM, 'alive?'),
+ ?t:do_times(3, ?MODULE, do_sync_msg, [STM]),
+ yes = gen_statem:call(STM, 'alive?'),
+ ok = do_sync_disconnect(STM),
+ yes = gen_statem:call(STM, 'alive?'),
+ check_state(STM, idle),
+ ok = gen_statem:call(STM, {timeout,200}),
+ yes = gen_statem:call(STM, 'alive?'),
+ check_state(STM, idle),
+ ok.
+
+
+do_sync_connect(STM) ->
+ check_state(STM, idle),
+ accept = gen_statem:call(STM, connect),
+ check_state(STM, wfor_conf),
+ Tag = make_ref(),
+ gen_statem:cast(STM, {ping,self(),Tag}),
+ yes = gen_statem:call(STM, confirm),
+ wfor({pong,Tag}),
+ check_state(STM, connected),
+ ok.
+
+do_sync_msg(STM) ->
+ check_state(STM, connected),
+ R = make_ref(),
+ {ack,R} = gen_statem:call(STM, {msg,R}),
+ ok.
+
+do_sync_disconnect(STM) ->
+ yes = gen_statem:call(STM, disconnect),
+ check_state(STM, idle).
+
+
+verify_empty_msgq() ->
+ [] = flush(),
+ ok.
+
+start_arg(Config, Arg) ->
+ case lists:keyfind(callback_mode, 1, Config) of
+ {_,CallbackMode} ->
+ {callback_mode,CallbackMode,Arg};
+ false ->
+ Arg
+ end.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%% The State Machine
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+init(ignore) ->
+ ignore;
+init(stop) ->
+ {stop,stopped};
+init(stop_shutdown) ->
+ {stop,shutdown};
+init(sleep) ->
+ ?t:sleep(1000),
+ {state_functions,idle,data};
+init(hiber) ->
+ {state_functions,hiber_idle,[]};
+init(hiber_now) ->
+ {state_functions,hiber_idle,[],[hibernate]};
+init({data, Data}) ->
+ {state_functions,idle,Data};
+init({callback_mode,CallbackMode,Arg}) ->
+ case init(Arg) of
+ {_,State,Data,Ops} ->
+ {CallbackMode,State,Data,Ops};
+ {_,State,Data} ->
+ {CallbackMode,State,Data};
+ Other ->
+ Other
+ end;
+init({map_statem,#{init := Init}=Machine}) ->
+ case Init() of
+ {ok,State,Data,Ops} ->
+ {handle_event_function,State,[Data|Machine],Ops};
+ {ok,State,Data} ->
+ {handle_event_function,State,[Data|Machine]};
+ Other ->
+ Other
+ end;
+init([]) ->
+ {state_functions,idle,data}.
+
+terminate(_, _State, crash_terminate) ->
+ exit({crash,terminate});
+terminate({From,stopped}, State, _Data) ->
+ From ! {self(),{stopped,State}},
+ ok;
+terminate(_Reason, _State, _Data) ->
+ ok.
+
+
+%% State functions
+
+idle(cast, {connect,Pid}, Data) ->
+ Pid ! accept,
+ {next_state,wfor_conf,Data,infinity}; % NoOp timeout just to test API
+idle({call,From}, connect, Data) ->
+ gen_statem:reply(From, accept),
+ {next_state,wfor_conf,Data,infinity}; % NoOp timeout just to test API
+idle(cast, badreturn, _Data) ->
+ badreturn;
+idle({call,_From}, badreturn, _Data) ->
+ badreturn;
+idle({call,From}, {delayed_answer,T}, Data) ->
+ receive
+ after T ->
+ gen_statem:reply({reply,From,delayed}),
+ throw({keep_state,Data})
+ end;
+idle({call,From}, {timeout,Time}, _Data) ->
+ {next_state,timeout,{From,Time},
+ {timeout,Time,idle}};
+idle(cast, next_event, _Data) ->
+ {next_state,next_events,[a,b,c],
+ [{next_event,internal,a},
+ {next_event,internal,b},
+ {next_event,internal,c}]};
+idle(Type, Content, Data) ->
+ case handle_common_events(Type, Content, idle, Data) of
+ undefined ->
+ case Type of
+ {call,From} ->
+ throw({keep_state,Data,[{reply,From,'eh?'}]});
+ _ ->
+ throw(
+ {stop,{unexpected,idle,Type,Content}})
+ end;
+ Result ->
+ Result
+ end.
+
+timeout(timeout, idle, {From,Time}) ->
+ TRef = erlang:start_timer(Time, self(), ok),
+ {keep_state,{From,TRef},0}; % Immediate timeout 0
+timeout(timeout, 0, {From,TRef}) ->
+ {next_state,timeout2,{From,TRef},
+ [{timeout,1,should_be_cancelled},
+ postpone]}; % Should cancel state timeout
+timeout(_, _, _) ->
+ keep_state_and_data.
+
+timeout2(timeout, 0, _) ->
+ keep_state_and_data;
+timeout2(timeout, Reason, _) ->
+ {stop,Reason};
+timeout2(info, {timeout,TRef,Result}, {From,TRef}) ->
+ gen_statem:reply([{reply,From,Result}]),
+ {next_state,idle,state};
+timeout2(_, _, _) ->
+ {keep_state_and_data,[]}.
+
+wfor_conf({call,From}, confirm, Data) ->
+ {next_state,connected,Data,
+ {reply,From,yes}};
+wfor_conf(cast, {ping,_,_}, _) ->
+ {keep_state_and_data,[postpone]};
+wfor_conf(cast, confirm, Data) ->
+ {next_state,connected,Data};
+wfor_conf(Type, Content, Data) ->
+ case handle_common_events(Type, Content, wfor_conf, Data) of
+ undefined ->
+ case Type of
+ {call,From} ->
+ {next_state,idle,Data,
+ [{reply,From,'eh?'}]};
+ _ ->
+ throw(keep_state_and_data)
+ end;
+ Result ->
+ Result
+ end.
+
+connected({call,From}, {msg,Ref}, Data) ->
+ {keep_state,Data,
+ {reply,From,{ack,Ref}}};
+connected(cast, {msg,From,Ref}, Data) ->
+ From ! {ack,Ref},
+ {keep_state,Data};
+connected({call,From}, disconnect, Data) ->
+ {next_state,idle,Data,
+ [{reply,From,yes}]};
+connected(cast, disconnect, Data) ->
+ {next_state,idle,Data};
+connected(cast, {ping,Pid,Tag}, Data) ->
+ Pid ! {pong,Tag},
+ {keep_state,Data};
+connected(Type, Content, Data) ->
+ case handle_common_events(Type, Content, connected, Data) of
+ undefined ->
+ case Type of
+ {call,From} ->
+ {keep_state,Data,
+ [{reply,From,'eh?'}]};
+ _ ->
+ {keep_state,Data}
+ end;
+ Result ->
+ Result
+ end.
+
+state0({call,From}, stop, Data) ->
+ {stop_and_reply,normal,[{reply,From,stopped}],Data};
+state0(Type, Content, Data) ->
+ case handle_common_events(Type, Content, state0, Data) of
+ undefined ->
+ {keep_state,Data};
+ Result ->
+ Result
+ end.
+
+hiber_idle({call,From}, 'alive?', Data) ->
+ {keep_state,Data,
+ [{reply,From,'alive!'}]};
+hiber_idle({call,From}, hibernate_sync, Data) ->
+ {next_state,hiber_wakeup,Data,
+ [{reply,From,hibernating},
+ hibernate]};
+hiber_idle(info, hibernate_later, _) ->
+ Tref = erlang:start_timer(1000, self(), hibernate),
+ {keep_state,Tref};
+hiber_idle(info, hibernate_now, Data) ->
+ {keep_state,Data,
+ [hibernate]};
+hiber_idle(info, {timeout,Tref,hibernate}, Tref) ->
+ {keep_state,[],
+ [hibernate]};
+hiber_idle(cast, hibernate_async, Data) ->
+ {next_state,hiber_wakeup,Data,
+ [hibernate]};
+hiber_idle(Type, Content, Data) ->
+ case handle_common_events(Type, Content, hiber_idle, Data) of
+ undefined ->
+ {keep_state,Data};
+ Result ->
+ Result
+ end.
+
+hiber_wakeup({call,From}, wakeup_sync, Data) ->
+ {next_state,hiber_idle,Data,
+ [{reply,From,good_morning}]};
+hiber_wakeup({call,From}, snooze_sync, Data) ->
+ {keep_state,Data,
+ [{reply,From,please_just_five_more},
+ hibernate]};
+hiber_wakeup(cast, wakeup_async, Data) ->
+ {next_state,hiber_idle,Data};
+hiber_wakeup(cast, snooze_async, Data) ->
+ {keep_state,Data,
+ [hibernate]};
+hiber_wakeup(Type, Content, Data) ->
+ case handle_common_events(Type, Content, hiber_wakeup, Data) of
+ undefined ->
+ {keep_state,Data};
+ Result ->
+ Result
+ end.
+
+next_events(internal, Msg, [Msg|Msgs]) ->
+ {keep_state,Msgs};
+next_events(Type, Content, Data) ->
+ case handle_common_events(Type, Content, next_events, Data) of
+ undefined ->
+ {keep_state,Data};
+ Result ->
+ Result
+ end.
+
+
+handle_common_events({call,From}, get_callback_mode, _, _) ->
+ {keep_state_and_data,{reply,From,state_functions}};
+handle_common_events({call,From}, get, State, Data) ->
+ {keep_state,Data,
+ [{reply,From,{state,State,Data}}]};
+handle_common_events(cast, {get,Pid}, State, Data) ->
+ Pid ! {state,State,Data},
+ {keep_state,Data};
+handle_common_events({call,From}, stop, _, Data) ->
+ {stop_and_reply,normal,[{reply,From,stopped}],Data};
+handle_common_events(cast, stop, _, _) ->
+ stop;
+handle_common_events({call,From}, {stop,Reason}, _, Data) ->
+ {stop_and_reply,Reason,{reply,From,stopped},Data};
+handle_common_events(cast, {stop,Reason}, _, _) ->
+ {stop,Reason};
+handle_common_events({call,From}, 'alive?', _, Data) ->
+ {keep_state,Data,
+ [{reply,From,yes}]};
+handle_common_events(cast, {'alive?',Pid}, _, Data) ->
+ Pid ! yes,
+ {keep_state,Data};
+handle_common_events(_, _, _, _) ->
+ undefined.
+
+handle_event({call,From}, get_callback_mode, _, _) ->
+ {keep_state_and_data,{reply,From,handle_event_function}};
+%% Wrapper state machine that uses a map state machine spec
+handle_event(
+ Type, Event, State, [Data|Machine])
+ when is_map(Machine) ->
+ #{State := HandleEvent} = Machine,
+ case
+ try HandleEvent(Type, Event, Data) of
+ Result ->
+ Result
+ catch
+ Result ->
+ Result
+ end of
+ {stop,Reason,NewData} ->
+ {stop,Reason,[NewData|Machine]};
+ {next_state,NewState,NewData} ->
+ {next_state,NewState,[NewData|Machine]};
+ {next_state,NewState,NewData,Ops} ->
+ {next_state,NewState,[NewData|Machine],Ops};
+ {keep_state,NewData} ->
+ {keep_state,[NewData|Machine]};
+ {keep_state,NewData,Ops} ->
+ {keep_state,[NewData|Machine],Ops};
+ Other ->
+ Other
+ end;
+%%
+%% Dispatcher to test callback_mode handle_event_function
+%%
+%% Wrap the state in a 1 element list just to test non-atom
+%% states. Note that the state from init/1 is not wrapped
+%% so both atom and non-atom states are tested.
+handle_event(Type, Event, State, Data) ->
+ StateName = unwrap_state(State),
+ try ?MODULE:StateName(Type, Event, Data) of
+ Result ->
+ wrap_result(Result)
+ catch
+ throw:Result ->
+ erlang:raise(
+ throw, wrap_result(Result), erlang:get_stacktrace())
+ end.
+
+unwrap_state([State]) ->
+ State;
+unwrap_state(State) ->
+ State.
+
+wrap_result(Result) ->
+ case Result of
+ {next_state,NewState,NewData} ->
+ {next_state,[NewState],NewData};
+ {next_state,NewState,NewData,StateOps} ->
+ {next_state,[NewState],NewData,StateOps};
+ Other ->
+ Other
+ end.
+
+
+
+code_change(OldVsn, State, Data, CallbackMode) ->
+ {CallbackMode,State,{OldVsn,Data,CallbackMode}}.
+
+format_status(terminate, [_Pdict,State,Data]) ->
+ {formatted,State,Data};
+format_status(normal, [_Pdict,_State,_Data]) ->
+ [format_status_called].
+
+flush() ->
+ receive
+ Msg ->
+ [Msg|flush()]
+ after 500 ->
+ []
+ end.
diff --git a/lib/stdlib/test/id_transform_SUITE.erl b/lib/stdlib/test/id_transform_SUITE.erl
index aaa6a758d5..54f452825f 100644
--- a/lib/stdlib/test/id_transform_SUITE.erl
+++ b/lib/stdlib/test/id_transform_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/id_transform_SUITE_data/External.hrl b/lib/stdlib/test/id_transform_SUITE_data/External.hrl
index 48f9cf7a01..447c12dbc1 100644
--- a/lib/stdlib/test/id_transform_SUITE_data/External.hrl
+++ b/lib/stdlib/test/id_transform_SUITE_data/External.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/id_transform_SUITE_data/m.hrl b/lib/stdlib/test/id_transform_SUITE_data/m.hrl
index 88fa280c14..6a7c08a92f 100644
--- a/lib/stdlib/test/id_transform_SUITE_data/m.hrl
+++ b/lib/stdlib/test/id_transform_SUITE_data/m.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/id_transform_SUITE_data/m_i.hrl b/lib/stdlib/test/id_transform_SUITE_data/m_i.hrl
index 48ae978cd3..cc6d18acc0 100644
--- a/lib/stdlib/test/id_transform_SUITE_data/m_i.hrl
+++ b/lib/stdlib/test/id_transform_SUITE_data/m_i.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/id_transform_SUITE_data/oe_ex.hrl b/lib/stdlib/test/id_transform_SUITE_data/oe_ex.hrl
index a3a892dba1..6878337ae9 100644
--- a/lib/stdlib/test/id_transform_SUITE_data/oe_ex.hrl
+++ b/lib/stdlib/test/id_transform_SUITE_data/oe_ex.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/io_SUITE.erl b/lib/stdlib/test/io_SUITE.erl
index ddc55b1466..be6b470ca7 100644
--- a/lib/stdlib/test/io_SUITE.erl
+++ b/lib/stdlib/test/io_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/io_proto_SUITE.erl b/lib/stdlib/test/io_proto_SUITE.erl
index ecd0d44db9..4e39f011f6 100644
--- a/lib/stdlib/test/io_proto_SUITE.erl
+++ b/lib/stdlib/test/io_proto_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/lists_SUITE.erl b/lib/stdlib/test/lists_SUITE.erl
index b21eb37ee3..531e97e8d6 100644
--- a/lib/stdlib/test/lists_SUITE.erl
+++ b/lib/stdlib/test/lists_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -55,6 +55,7 @@
ufunsort_error/1,
zip_unzip/1, zip_unzip3/1, zipwith/1, zipwith3/1,
filter_partition/1,
+ join/1,
otp_5939/1, otp_6023/1, otp_6606/1, otp_7230/1,
suffix/1, subtract/1, droplast/1, hof/1]).
@@ -119,7 +120,7 @@ groups() ->
{tickets, [parallel], [otp_5939, otp_6023, otp_6606, otp_7230]},
{zip, [parallel], [zip_unzip, zip_unzip3, zipwith, zipwith3]},
{misc, [parallel], [reverse, member, dropwhile, takewhile,
- filter_partition, suffix, subtract,
+ filter_partition, suffix, subtract, join,
hof]}
].
@@ -2413,6 +2414,19 @@ zipwith3(Config) when is_list(Config) ->
ok.
+%% Test lists:join/2
+join(Config) when is_list(Config) ->
+ A = [a,b,c],
+ Sep = x,
+ [a,x,b,x,c] = lists:join(Sep, A),
+
+ B = [b],
+ [b] = lists:join(Sep, B),
+
+ C = [],
+ [] = lists:join(Sep, C),
+ ok.
+
%% Test lists:filter/2, lists:partition/2.
filter_partition(Config) when is_list(Config) ->
F = fun(I) -> I rem 2 =:= 0 end,
diff --git a/lib/stdlib/test/log_mf_h_SUITE.erl b/lib/stdlib/test/log_mf_h_SUITE.erl
index 9b543aa37c..894500dd79 100644
--- a/lib/stdlib/test/log_mf_h_SUITE.erl
+++ b/lib/stdlib/test/log_mf_h_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/maps_SUITE.erl b/lib/stdlib/test/maps_SUITE.erl
index 7f94b7bcb1..42e669a799 100644
--- a/lib/stdlib/test/maps_SUITE.erl
+++ b/lib/stdlib/test/maps_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -25,15 +25,10 @@
-include_lib("common_test/include/ct.hrl").
-%% Test server specific exports
--export([all/0]).
--export([suite/0]).
--export([init_per_suite/1]).
--export([end_per_suite/1]).
--export([init_per_testcase/2]).
--export([end_per_testcase/2]).
+-export([all/0, suite/0]).
--export([t_get_3/1, t_filter_2/1,
+-export([t_update_with_3/1, t_update_with_4/1,
+ t_get_3/1, t_filter_2/1,
t_fold_3/1,t_map_2/1,t_size_1/1,
t_with_2/1,t_without_2/1]).
@@ -41,29 +36,56 @@
%%-define(badarg(F,Args), {'EXIT', {badarg, [{maps,F,Args,_}|_]}}).
%% silly broken hipe
-define(badmap(V,F,_Args), {'EXIT', {{badmap,V}, [{maps,F,_,_}|_]}}).
+-define(badkey(K,F,_Args), {'EXIT', {{badkey,K}, [{maps,F,_,_}|_]}}).
-define(badarg(F,_Args), {'EXIT', {badarg, [{maps,F,_,_}|_]}}).
suite() ->
- [{ct_hooks, [ts_install_cth]},
+ [{ct_hooks,[ts_install_cth]},
{timetrap,{minutes,1}}].
all() ->
- [t_get_3,t_filter_2,
+ [t_update_with_3,t_update_with_4,
+ t_get_3,t_filter_2,
t_fold_3,t_map_2,t_size_1,
t_with_2,t_without_2].
-init_per_suite(Config) ->
- Config.
+t_update_with_3(Config) when is_list(Config) ->
+ V1 = value1,
+ V2 = <<"value2">>,
+ V3 = "value3",
+ Map = #{ key1 => V1, key2 => V2, "key3" => V3 },
+ Fun = fun(V) -> [V,V,{V,V}] end,
-end_per_suite(_Config) ->
+ #{ key1 := [V1,V1,{V1,V1}] } = maps:update_with(key1,Fun,Map),
+ #{ key2 := [V2,V2,{V2,V2}] } = maps:update_with(key2,Fun,Map),
+ #{ "key3" := [V3,V3,{V3,V3}] } = maps:update_with("key3",Fun,Map),
+
+ %% error case
+ ?badmap(b,update_with,[[a,b],a,b]) = (catch maps:update_with([a,b],id(a),b)),
+ ?badarg(update_with,[[a,b],a,#{}]) = (catch maps:update_with([a,b],id(a),#{})),
+ ?badkey([a,b],update_with,[[a,b],Fun,#{}]) = (catch maps:update_with([a,b],Fun,#{})),
ok.
-init_per_testcase(_Case, Config) ->
- Config.
+t_update_with_4(Config) when is_list(Config) ->
+ V1 = value1,
+ V2 = <<"value2">>,
+ V3 = "value3",
+ Map = #{ key1 => V1, key2 => V2, "key3" => V3 },
+ Fun = fun(V) -> [V,V,{V,V}] end,
+ Init = 3,
+
+ #{ key1 := [V1,V1,{V1,V1}] } = maps:update_with(key1,Fun,Init,Map),
+ #{ key2 := [V2,V2,{V2,V2}] } = maps:update_with(key2,Fun,Init,Map),
+ #{ "key3" := [V3,V3,{V3,V3}] } = maps:update_with("key3",Fun,Init,Map),
-end_per_testcase(_Case, _Config) ->
+ #{ key3 := Init } = maps:update_with(key3,Fun,Init,Map),
+
+ %% error case
+ ?badmap(b,update_with,[[a,b],a,b]) = (catch maps:update_with([a,b],id(a),b)),
+ ?badarg(update_with,[[a,b],a,#{}]) = (catch maps:update_with([a,b],id(a),#{})),
ok.
+
t_get_3(Config) when is_list(Config) ->
Map = #{ key1 => value1, key2 => value2 },
DefaultValue = "Default value",
diff --git a/lib/stdlib/test/ms_transform_SUITE.erl b/lib/stdlib/test/ms_transform_SUITE.erl
index a8bd90de84..1c5faa960b 100644
--- a/lib/stdlib/test/ms_transform_SUITE.erl
+++ b/lib/stdlib/test/ms_transform_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/naughty_child.erl b/lib/stdlib/test/naughty_child.erl
index 0ea8f81d38..e159af5c01 100644
--- a/lib/stdlib/test/naughty_child.erl
+++ b/lib/stdlib/test/naughty_child.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/proc_lib_SUITE.erl b/lib/stdlib/test/proc_lib_SUITE.erl
index ebce74545a..416650e27e 100644
--- a/lib/stdlib/test/proc_lib_SUITE.erl
+++ b/lib/stdlib/test/proc_lib_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/qlc_SUITE.erl b/lib/stdlib/test/qlc_SUITE.erl
index 75971bcf11..2bd940020c 100644
--- a/lib/stdlib/test/qlc_SUITE.erl
+++ b/lib/stdlib/test/qlc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/qlc_SUITE_data/join_info_compat.erl b/lib/stdlib/test/qlc_SUITE_data/join_info_compat.erl
index d0cbc65d26..369101ab6c 100644
--- a/lib/stdlib/test/qlc_SUITE_data/join_info_compat.erl
+++ b/lib/stdlib/test/qlc_SUITE_data/join_info_compat.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/queue_SUITE.erl b/lib/stdlib/test/queue_SUITE.erl
index cd3f8e6e2f..569953dd9f 100644
--- a/lib/stdlib/test/queue_SUITE.erl
+++ b/lib/stdlib/test/queue_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/rand_SUITE.erl b/lib/stdlib/test/rand_SUITE.erl
index 6830101e96..1bcdc3ccd0 100644
--- a/lib/stdlib/test/rand_SUITE.erl
+++ b/lib/stdlib/test/rand_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -377,7 +377,7 @@ crypto_seed() ->
crypto_next(<<Num:64, Bin/binary>>) ->
{Num, Bin};
crypto_next(_) ->
- crypto_next(crypto:rand_bytes((64 div 8)*100)).
+ crypto_next(crypto:strong_rand_bytes((64 div 8)*100)).
crypto_uniform({Api, Data0}) ->
{Int, Data} = crypto_next(Data0),
diff --git a/lib/stdlib/test/random_SUITE.erl b/lib/stdlib/test/random_SUITE.erl
index 34b350e132..e9aa00dac8 100644
--- a/lib/stdlib/test/random_SUITE.erl
+++ b/lib/stdlib/test/random_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/random_iolist.erl b/lib/stdlib/test/random_iolist.erl
index 6da7da04de..555f063e0a 100644
--- a/lib/stdlib/test/random_iolist.erl
+++ b/lib/stdlib/test/random_iolist.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/random_unicode_list.erl b/lib/stdlib/test/random_unicode_list.erl
index 3bc86a8430..8db2fa8b56 100644
--- a/lib/stdlib/test/random_unicode_list.erl
+++ b/lib/stdlib/test/random_unicode_list.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/re_SUITE.erl b/lib/stdlib/test/re_SUITE.erl
index a937e7b1cf..52d3a9f797 100644
--- a/lib/stdlib/test/re_SUITE.erl
+++ b/lib/stdlib/test/re_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/re_testoutput1_replacement_test.erl b/lib/stdlib/test/re_testoutput1_replacement_test.erl
index 9081a18cd2..a40800d760 100644
--- a/lib/stdlib/test/re_testoutput1_replacement_test.erl
+++ b/lib/stdlib/test/re_testoutput1_replacement_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/re_testoutput1_split_test.erl b/lib/stdlib/test/re_testoutput1_split_test.erl
index 71728607bc..02987971fa 100644
--- a/lib/stdlib/test/re_testoutput1_split_test.erl
+++ b/lib/stdlib/test/re_testoutput1_split_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/run_pcre_tests.erl b/lib/stdlib/test/run_pcre_tests.erl
index 8b0373d062..ae56db59d6 100644
--- a/lib/stdlib/test/run_pcre_tests.erl
+++ b/lib/stdlib/test/run_pcre_tests.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/select_SUITE.erl b/lib/stdlib/test/select_SUITE.erl
index b7e86377c4..e999d040c9 100644
--- a/lib/stdlib/test/select_SUITE.erl
+++ b/lib/stdlib/test/select_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/sets_SUITE.erl b/lib/stdlib/test/sets_SUITE.erl
index b866cb62e0..bec38000b2 100644
--- a/lib/stdlib/test/sets_SUITE.erl
+++ b/lib/stdlib/test/sets_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/shell_SUITE.erl b/lib/stdlib/test/shell_SUITE.erl
index af735218b9..dc82e92876 100644
--- a/lib/stdlib/test/shell_SUITE.erl
+++ b/lib/stdlib/test/shell_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/slave_SUITE.erl b/lib/stdlib/test/slave_SUITE.erl
index dc14e4735a..25b706e81f 100644
--- a/lib/stdlib/test/slave_SUITE.erl
+++ b/lib/stdlib/test/slave_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/sofs_SUITE.erl b/lib/stdlib/test/sofs_SUITE.erl
index 2277b2d6fb..13c12ad2f2 100644
--- a/lib/stdlib/test/sofs_SUITE.erl
+++ b/lib/stdlib/test/sofs_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/stdlib_SUITE.erl b/lib/stdlib/test/stdlib_SUITE.erl
index f7064c4169..d55635a735 100644
--- a/lib/stdlib/test/stdlib_SUITE.erl
+++ b/lib/stdlib/test/stdlib_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/string_SUITE.erl b/lib/stdlib/test/string_SUITE.erl
index b5d221732e..836f9e5142 100644
--- a/lib/stdlib/test/string_SUITE.erl
+++ b/lib/stdlib/test/string_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/supervisor_1.erl b/lib/stdlib/test/supervisor_1.erl
index 7a74f51429..419026749b 100644
--- a/lib/stdlib/test/supervisor_1.erl
+++ b/lib/stdlib/test/supervisor_1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/supervisor_2.erl b/lib/stdlib/test/supervisor_2.erl
index e3767c1fd4..0c15f253b3 100644
--- a/lib/stdlib/test/supervisor_2.erl
+++ b/lib/stdlib/test/supervisor_2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/supervisor_3.erl b/lib/stdlib/test/supervisor_3.erl
index 9ff7df2503..082cdf2153 100644
--- a/lib/stdlib/test/supervisor_3.erl
+++ b/lib/stdlib/test/supervisor_3.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/supervisor_SUITE.erl b/lib/stdlib/test/supervisor_SUITE.erl
index 9de5a57e7f..3f1aa0e7a3 100644
--- a/lib/stdlib/test/supervisor_SUITE.erl
+++ b/lib/stdlib/test/supervisor_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/supervisor_bridge_SUITE.erl b/lib/stdlib/test/supervisor_bridge_SUITE.erl
index 029cb3fd7f..279ae91cdc 100644
--- a/lib/stdlib/test/supervisor_bridge_SUITE.erl
+++ b/lib/stdlib/test/supervisor_bridge_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/sys_SUITE.erl b/lib/stdlib/test/sys_SUITE.erl
index 39bc835824..b44df0fbda 100644
--- a/lib/stdlib/test/sys_SUITE.erl
+++ b/lib/stdlib/test/sys_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/sys_sp1.erl b/lib/stdlib/test/sys_sp1.erl
index b99914f4b7..571d0f3ed4 100644
--- a/lib/stdlib/test/sys_sp1.erl
+++ b/lib/stdlib/test/sys_sp1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/sys_sp2.erl b/lib/stdlib/test/sys_sp2.erl
index e2784dc3ff..610665f8fe 100644
--- a/lib/stdlib/test/sys_sp2.erl
+++ b/lib/stdlib/test/sys_sp2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/tar_SUITE.erl b/lib/stdlib/test/tar_SUITE.erl
index 7f20851445..64dd41e75a 100644
--- a/lib/stdlib/test/tar_SUITE.erl
+++ b/lib/stdlib/test/tar_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/timer_SUITE.erl b/lib/stdlib/test/timer_SUITE.erl
index d4bbd39d50..5fc95b16a6 100644
--- a/lib/stdlib/test/timer_SUITE.erl
+++ b/lib/stdlib/test/timer_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/timer_simple_SUITE.erl b/lib/stdlib/test/timer_simple_SUITE.erl
index 64fce2a4b2..ff5116b8b6 100644
--- a/lib/stdlib/test/timer_simple_SUITE.erl
+++ b/lib/stdlib/test/timer_simple_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/unicode_SUITE.erl b/lib/stdlib/test/unicode_SUITE.erl
index d2ee5d19a4..81a591f433 100644
--- a/lib/stdlib/test/unicode_SUITE.erl
+++ b/lib/stdlib/test/unicode_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/win32reg_SUITE.erl b/lib/stdlib/test/win32reg_SUITE.erl
index 62619dff47..5e44e16ddc 100644
--- a/lib/stdlib/test/win32reg_SUITE.erl
+++ b/lib/stdlib/test/win32reg_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/y2k_SUITE.erl b/lib/stdlib/test/y2k_SUITE.erl
index 7828eb26ed..129a279c28 100644
--- a/lib/stdlib/test/y2k_SUITE.erl
+++ b/lib/stdlib/test/y2k_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/test/zip_SUITE.erl b/lib/stdlib/test/zip_SUITE.erl
index 57ad869f24..2add5a39a2 100644
--- a/lib/stdlib/test/zip_SUITE.erl
+++ b/lib/stdlib/test/zip_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/stdlib/vsn.mk b/lib/stdlib/vsn.mk
index 5bac4be9d7..46e3ceac03 100644
--- a/lib/stdlib/vsn.mk
+++ b/lib/stdlib/vsn.mk
@@ -1 +1 @@
-STDLIB_VSN = 2.8
+STDLIB_VSN = 3.0
diff --git a/lib/syntax_tools/doc/src/Makefile b/lib/syntax_tools/doc/src/Makefile
index 6aca06424d..ff4f3f78ff 100644
--- a/lib/syntax_tools/doc/src/Makefile
+++ b/lib/syntax_tools/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2012. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/syntax_tools/doc/src/book.xml b/lib/syntax_tools/doc/src/book.xml
index fb64a7dd21..5f9481374f 100644
--- a/lib/syntax_tools/doc/src/book.xml
+++ b/lib/syntax_tools/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/syntax_tools/doc/src/notes.xml b/lib/syntax_tools/doc/src/notes.xml
index 9f803264a2..406a6c071b 100644
--- a/lib/syntax_tools/doc/src/notes.xml
+++ b/lib/syntax_tools/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2007</year><year>2013</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/syntax_tools/doc/src/part.xml b/lib/syntax_tools/doc/src/part.xml
index c111b045da..a20efbc02e 100644
--- a/lib/syntax_tools/doc/src/part.xml
+++ b/lib/syntax_tools/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/syntax_tools/doc/src/part_notes.xml b/lib/syntax_tools/doc/src/part_notes.xml
index 308cf62915..e02ffddcb2 100644
--- a/lib/syntax_tools/doc/src/part_notes.xml
+++ b/lib/syntax_tools/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2007</year><year>2013</year>
+ <year>2007</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/syntax_tools/doc/src/ref_man.xml b/lib/syntax_tools/doc/src/ref_man.xml
index 65b1725163..774a431db7 100644
--- a/lib/syntax_tools/doc/src/ref_man.xml
+++ b/lib/syntax_tools/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/syntax_tools/src/erl_prettypr.erl b/lib/syntax_tools/src/erl_prettypr.erl
index 81272e62de..119d375746 100644
--- a/lib/syntax_tools/src/erl_prettypr.erl
+++ b/lib/syntax_tools/src/erl_prettypr.erl
@@ -38,7 +38,7 @@
follow/3, empty/0]).
-import(erl_parse, [preop_prec/1, inop_prec/1, func_prec/0,
- max_prec/0]).
+ max_prec/0, type_inop_prec/1, type_preop_prec/1]).
-define(PADDING, 2).
-define(PAPER, 80).
@@ -50,7 +50,8 @@
| fun((erl_syntax:syntaxTree(), _, _) -> prettypr:document()).
-type clause_t() :: 'case_expr' | 'cond_expr' | 'fun_expr'
| 'if_expr' | 'receive_expr' | 'try_expr'
- | {'function', prettypr:document()}.
+ | {'function', prettypr:document()}
+ | 'spec'.
-record(ctxt, {prec = 0 :: integer(),
sub_indent = 2 :: non_neg_integer(),
@@ -535,9 +536,6 @@ lay_2(Node, Ctxt) ->
As = seq(erl_syntax:application_arguments(Node),
floating(text(",")), reset_prec(Ctxt),
fun lay/2),
-%% D1 = beside(D, beside(text("("),
-%% beside(par(As),
-%% floating(text(")"))))),
D1 = beside(D, beside(text("("),
beside(par(As),
floating(text(")"))))),
@@ -651,7 +649,7 @@ lay_2(Node, Ctxt) ->
beside(D1, beside(text(":"), D2));
%%
- %% The rest is in alphabetical order
+ %% The rest is in alphabetical order (except map and types)
%%
arity_qualifier ->
@@ -666,18 +664,67 @@ lay_2(Node, Ctxt) ->
%% a period. If the arguments is `none', we only output the
%% attribute name, without following parentheses.
Ctxt1 = reset_prec(Ctxt),
- N = erl_syntax:attribute_name(Node),
- D = case erl_syntax:attribute_arguments(Node) of
- none ->
+ Args = erl_syntax:attribute_arguments(Node),
+ N = erl_syntax:attribute_name(Node),
+ D = case attribute_type(Node) of
+ spec ->
+ [SpecTuple] = Args,
+ [FuncName, FuncTypes] =
+ erl_syntax:tuple_elements(SpecTuple),
+ Name =
+ case erl_syntax:type(FuncName) of
+ tuple ->
+ case erl_syntax:tuple_elements(FuncName) of
+ [F0, _] ->
+ F0;
+ [M0, F0, _] ->
+ erl_syntax:module_qualifier(M0,
+ F0);
+ _ ->
+ FuncName
+ end;
+ _ ->
+ FuncName
+ end,
+ Types = dodge_macros(FuncTypes),
+ D1 = lay_clauses(erl_syntax:concrete(Types),
+ spec, Ctxt1),
+ beside(follow(lay(N, Ctxt1),
+ lay(Name, Ctxt1),
+ Ctxt1#ctxt.break_indent),
+ D1);
+ type ->
+ [TypeTuple] = Args,
+ [Name, Type0, Elements] =
+ erl_syntax:tuple_elements(TypeTuple),
+ TypeName = dodge_macros(Name),
+ Type = dodge_macros(Type0),
+ As0 = dodge_macros(Elements),
+ As = erl_syntax:concrete(As0),
+ D1 = lay_type_application(TypeName, As, Ctxt1),
+ D2 = lay(erl_syntax:concrete(Type), Ctxt1),
+ beside(follow(lay(N, Ctxt1),
+ beside(D1, floating(text(" :: "))),
+ Ctxt1#ctxt.break_indent),
+ D2);
+ Tag when Tag =:= export_type;
+ Tag =:= optional_callbacks ->
+ [FuncNs] = Args,
+ FuncNames = erl_syntax:concrete(dodge_macros(FuncNs)),
+ As = unfold_function_names(FuncNames),
+ beside(lay(N, Ctxt1),
+ beside(text("("),
+ beside(lay(As, Ctxt1),
+ floating(text(")")))));
+ _ when Args =:= none ->
lay(N, Ctxt1);
- Args ->
- As = seq(Args, floating(text(",")), Ctxt1,
- fun lay/2),
+ _ ->
+ D1 = par(seq(Args, floating(text(",")), Ctxt1,
+ fun lay/2)),
beside(lay(N, Ctxt1),
beside(text("("),
- beside(par(As),
- floating(text(")")))))
- end,
+ beside(D1, floating(text(")")))))
+ end,
beside(floating(text("-")), beside(D, floating(text("."))));
binary ->
@@ -928,6 +975,16 @@ lay_2(Node, Ctxt) ->
text ->
text(erl_syntax:text_string(Node));
+ typed_record_field ->
+ {_, Prec, _} = type_inop_prec('::'),
+ Ctxt1 = reset_prec(Ctxt),
+ D1 = lay(erl_syntax:typed_record_field_body(Node), Ctxt1),
+ D2 = lay(erl_syntax:typed_record_field_type(Node),
+ set_prec(Ctxt, Prec)),
+ D3 = par([D1, floating(text(" ::")), D2],
+ Ctxt1#ctxt.break_indent),
+ maybe_parentheses(D3, Prec, Ctxt);
+
try_expr ->
Ctxt1 = reset_prec(Ctxt),
D1 = sep(seq(erl_syntax:try_expr_body(Node),
@@ -965,9 +1022,236 @@ lay_2(Node, Ctxt) ->
warning_marker ->
E = erl_syntax:warning_marker_info(Node),
beside(text("%% WARNING: "),
- lay_error_info(E, reset_prec(Ctxt)))
+ lay_error_info(E, reset_prec(Ctxt)));
+
+ %%
+ %% Types
+ %%
+
+ annotated_type ->
+ {_, Prec, _} = type_inop_prec('::'),
+ D1 = lay(erl_syntax:annotated_type_name(Node),
+ reset_prec(Ctxt)),
+ D2 = lay(erl_syntax:annotated_type_body(Node),
+ set_prec(Ctxt, Prec)),
+ D3 = follow(beside(D1, floating(text(" ::"))), D2,
+ Ctxt#ctxt.break_indent),
+ maybe_parentheses(D3, Prec, Ctxt);
+
+ type_application ->
+ Name = erl_syntax:type_application_name(Node),
+ Arguments = erl_syntax:type_application_arguments(Node),
+ %% Prefer shorthand notation.
+ case erl_syntax_lib:analyze_type_application(Node) of
+ {nil, 0} ->
+ text("[]");
+ {list, 1} ->
+ [A] = Arguments,
+ D1 = lay(A, reset_prec(Ctxt)),
+ beside(text("["), beside(D1, text("]")));
+ {nonempty_list, 1} ->
+ [A] = Arguments,
+ D1 = lay(A, reset_prec(Ctxt)),
+ beside(text("["), beside(D1, text(", ...]")));
+ _ ->
+ lay_type_application(Name, Arguments, Ctxt)
+ end;
+
+ bitstring_type ->
+ Ctxt1 = set_prec(Ctxt, max_prec()),
+ M = erl_syntax:bitstring_type_m(Node),
+ N = erl_syntax:bitstring_type_n(Node),
+ D1 = [beside(text("_:"), lay(M, Ctxt1)) ||
+ (erl_syntax:type(M) =/= integer orelse
+ erl_syntax:integer_value(M) =/= 0)],
+ D2 = [beside(text("_:_*"), lay(N, Ctxt1)) ||
+ (erl_syntax:type(N) =/= integer orelse
+ erl_syntax:integer_value(N) =/= 0)],
+ F = fun(D, _) -> D end,
+ D = seq(D1 ++ D2, floating(text(",")), Ctxt1, F),
+ beside(floating(text("<<")),
+ beside(par(D), floating(text(">>"))));
+
+ fun_type ->
+ text("fun()");
+
+ constrained_function_type ->
+ Ctxt1 = reset_prec(Ctxt),
+ D1 = lay(erl_syntax:constrained_function_type_body(Node),
+ Ctxt1),
+ D2 = lay(erl_syntax:constrained_function_type_argument(Node),
+ Ctxt1),
+ beside(D1,
+ beside(floating(text(" when ")), D2));
+
+ function_type ->
+ {Before, After} = case Ctxt#ctxt.clause of
+ spec ->
+ {"", ""};
+ _ ->
+ {"fun(", ")"}
+ end,
+ Ctxt1 = reset_prec(Ctxt),
+ D1 = case erl_syntax:function_type_arguments(Node) of
+ any_arity ->
+ text("(...)");
+ Arguments ->
+ As = seq(Arguments,
+ floating(text(",")), Ctxt1,
+ fun lay/2),
+ beside(text("("),
+ beside(par(As),
+ floating(text(")"))))
+ end,
+ D2 = lay(erl_syntax:function_type_return(Node), Ctxt1),
+ beside(floating(text(Before)),
+ beside(D1,
+ beside(floating(text(" -> ")),
+ beside(D2, floating(text(After))))));
+
+ constraint ->
+ Name = erl_syntax:constraint_argument(Node),
+ Args = erl_syntax:constraint_body(Node),
+ case is_subtype(Name, Args) of
+ true ->
+ [Var, Type] = Args,
+ {PrecL, Prec, PrecR} = type_inop_prec('::'),
+ D1 = lay(Var, set_prec(Ctxt, PrecL)),
+ D2 = lay(Type, set_prec(Ctxt, PrecR)),
+ D3 = follow(beside(D1, floating(text(" ::"))), D2,
+ Ctxt#ctxt.break_indent),
+ maybe_parentheses(D3, Prec, Ctxt);
+ false ->
+ lay_type_application(Name, Args, Ctxt)
+ end;
+
+ map_type ->
+ case erl_syntax:map_type_fields(Node) of
+ any_size ->
+ text("map()");
+ Fs ->
+ {Prec, _PrecR} = type_preop_prec('#'),
+ Es = lay_map_fields(Fs,
+ floating(text(",")),
+ reset_prec(Ctxt)),
+ D = beside(floating(text("#{")),
+ beside(par(Es),
+ floating(text("}")))),
+ maybe_parentheses(D, Prec, Ctxt)
+ end;
+
+ map_type_assoc ->
+ Name = erl_syntax:map_type_assoc_name(Node),
+ Value = erl_syntax:map_type_assoc_value(Node),
+ lay_type_assoc(Name, Value, Ctxt);
+
+ map_type_exact ->
+ Ctxt1 = reset_prec(Ctxt),
+ D1 = lay(erl_syntax:map_type_exact_name(Node), Ctxt1),
+ D2 = lay(erl_syntax:map_type_exact_value(Node), Ctxt1),
+ par([D1, floating(text(":=")), D2], Ctxt1#ctxt.break_indent);
+
+ integer_range_type ->
+ {PrecL, Prec, PrecR} = type_inop_prec('..'),
+ D1 = lay(erl_syntax:integer_range_type_low(Node),
+ set_prec(Ctxt, PrecL)),
+ D2 = lay(erl_syntax:integer_range_type_high(Node),
+ set_prec(Ctxt, PrecR)),
+ D3 = beside(D1, beside(text(".."), D2)),
+ maybe_parentheses(D3, Prec, Ctxt);
+
+ record_type ->
+ {Prec, _PrecR} = type_preop_prec('#'),
+ D1 = beside(text("#"),
+ lay(erl_syntax:record_type_name(Node),
+ reset_prec(Ctxt))),
+ Es = seq(erl_syntax:record_type_fields(Node),
+ floating(text(",")), reset_prec(Ctxt),
+ fun lay/2),
+ D2 = beside(D1,
+ beside(text("{"),
+ beside(par(Es),
+ floating(text("}"))))),
+ maybe_parentheses(D2, Prec, Ctxt);
+
+ record_type_field ->
+ Ctxt1 = reset_prec(Ctxt),
+ D1 = lay(erl_syntax:record_type_field_name(Node), Ctxt1),
+ D2 = lay(erl_syntax:record_type_field_type(Node), Ctxt1),
+ par([D1, floating(text("::")), D2], Ctxt1#ctxt.break_indent);
+
+ tuple_type ->
+ case erl_syntax:tuple_type_elements(Node) of
+ any_size ->
+ text("tuple()");
+ Elements ->
+ Es = seq(Elements,
+ floating(text(",")), reset_prec(Ctxt),
+ fun lay/2),
+ beside(floating(text("{")),
+ beside(par(Es), floating(text("}"))))
+ end;
+
+ type_union ->
+ {_, Prec, PrecR} = type_inop_prec('|'),
+ Es = par(seq(erl_syntax:type_union_types(Node),
+ floating(text(" |")), set_prec(Ctxt, PrecR),
+ fun lay/2)),
+ maybe_parentheses(Es, Prec, Ctxt);
+
+ user_type_application ->
+ lay_type_application(erl_syntax:user_type_application_name(Node),
+ erl_syntax:user_type_application_arguments(Node),
+ Ctxt)
+
+ end.
+
+attribute_type(Node) ->
+ N = erl_syntax:attribute_name(Node),
+ case catch erl_syntax:concrete(N) of
+ opaque ->
+ type;
+ spec ->
+ spec;
+ callback ->
+ spec;
+ type ->
+ type;
+ export_type ->
+ export_type;
+ optional_callbacks ->
+ optional_callbacks;
+ _ ->
+ N
end.
+is_subtype(Name, [Var, _]) ->
+ (erl_syntax:is_atom(Name, is_subtype) andalso
+ erl_syntax:type(Var) =:= variable);
+is_subtype(_, _) -> false.
+
+unfold_function_names(Ns) ->
+ F = fun ({Atom, Arity}) ->
+ erl_syntax:arity_qualifier(erl_syntax:atom(Atom),
+ erl_syntax:integer(Arity))
+ end,
+ erl_syntax:list([F(N) || N <- Ns]).
+
+%% Macros are not handled well.
+dodge_macros(Type) ->
+ F = fun (T) ->
+ case erl_syntax:type(T) of
+ macro ->
+ Var = erl_syntax:macro_name(T),
+ VarName0 = erl_syntax:variable_name(Var),
+ VarName = list_to_atom("?"++atom_to_list(VarName0)),
+ Atom = erl_syntax:atom(VarName),
+ Atom;
+ _ -> T
+ end
+ end,
+ erl_syntax_lib:map(F, Type).
+
lay_parentheses(D, _Ctxt) ->
beside(floating(text("(")), beside(D, floating(text(")")))).
@@ -1020,6 +1304,8 @@ split_string_1([], _N, _L, As) ->
split_string_2([$^, X | Xs], N, L, As) ->
split_string_1(Xs, N - 2, L - 2, [X, $^ | As]);
+split_string_2([$x, ${ | Xs], N, L, As) ->
+ split_string_3(Xs, N - 2, L - 2, [${, $x | As]);
split_string_2([X1, X2, X3 | Xs], N, L, As) when
X1 >= $0, X1 =< $7, X2 >= $0, X2 =< $7, X3 >= $0, X3 =< $7 ->
split_string_1(Xs, N - 3, L - 3, [X3, X2, X1 | As]);
@@ -1029,6 +1315,15 @@ split_string_2([X1, X2 | Xs], N, L, As) when
split_string_2([X | Xs], N, L, As) ->
split_string_1(Xs, N - 1, L - 1, [X | As]).
+split_string_3([$} | Xs], N, L, As) ->
+ split_string_1(Xs, N - 1, L - 1, [$} | As]);
+split_string_3([X | Xs], N, L, As) when
+ X >= $0, X =< $9; X >= $a, X =< $z; X >= $A, X =< $Z ->
+ split_string_3(Xs, N - 1, L -1, [X | As]);
+split_string_3([X | Xs], N, L, As) when
+ X >= $0, X =< $9 ->
+ split_string_1(Xs, N - 1, L -1, [X | As]).
+
%% Note that there is nothing in `lay_clauses' that actually requires
%% that the elements have type `clause'; it just sets up the proper
%% context and arranges the elements suitably for clauses.
@@ -1105,6 +1400,53 @@ lay_error_info(T, Ctxt) ->
lay_concrete(T, Ctxt) ->
lay(erl_syntax:abstract(T), Ctxt).
+lay_map_fields([H | T], Separator, Ctxt) ->
+ case T of
+ [] ->
+ [case erl_syntax:type(H) of
+ map_type_assoc ->
+ lay_last_type_assoc(H, Ctxt);
+ _ ->
+ lay(H, Ctxt)
+ end];
+ _ ->
+ [maybe_append(Separator, lay(H, Ctxt))
+ | lay_map_fields(T, Separator, Ctxt)]
+ end;
+lay_map_fields([], _, _) ->
+ [empty()].
+
+lay_last_type_assoc(Node, Ctxt) ->
+ Name = erl_syntax:map_type_assoc_name(Node),
+ Value = erl_syntax:map_type_assoc_value(Node),
+ IsAny = fun({type,_,any,[]}) -> true;
+ %% ({var,_,'_'}) -> true;
+ (_) -> false
+ end,
+ case IsAny(Name) andalso IsAny(Value) of
+ true ->
+ text("...");
+ false ->
+ lay_type_assoc(Name, Value, Ctxt)
+ end.
+
+lay_type_assoc(Name, Value, Ctxt) ->
+ Ctxt1 = reset_prec(Ctxt),
+ D1 = lay(Name, Ctxt1),
+ D2 = lay(Value, Ctxt1),
+ par([D1, floating(text("=>")), D2], Ctxt1#ctxt.break_indent).
+
+lay_type_application(Name, Arguments, Ctxt) ->
+ {PrecL, Prec} = func_prec(), %
+ D1 = lay(Name, set_prec(Ctxt, PrecL)),
+ As = seq(Arguments,
+ floating(text(",")), reset_prec(Ctxt),
+ fun lay/2),
+ D = beside(D1, beside(text("("),
+ beside(par(As),
+ floating(text(")"))))),
+ maybe_parentheses(D, Prec, Ctxt).
+
seq([H | T], Separator, Ctxt, Fun) ->
case T of
[] ->
diff --git a/lib/syntax_tools/src/erl_syntax.erl b/lib/syntax_tools/src/erl_syntax.erl
index 97b5797b06..f4cda814fc 100644
--- a/lib/syntax_tools/src/erl_syntax.erl
+++ b/lib/syntax_tools/src/erl_syntax.erl
@@ -120,6 +120,9 @@
normalize_list/1,
compact_list/1,
+ annotated_type/2,
+ annotated_type_name/1,
+ annotated_type_body/1,
application/2,
application/3,
application_arguments/1,
@@ -150,6 +153,9 @@
binary_generator/2,
binary_generator_body/1,
binary_generator_pattern/1,
+ bitstring_type/2,
+ bitstring_type_m/1,
+ bitstring_type_n/1,
block_expr/1,
block_expr_body/1,
case_expr/2,
@@ -175,6 +181,12 @@
cond_expr_clauses/1,
conjunction/1,
conjunction_body/1,
+ constrained_function_type/2,
+ constrained_function_type_body/1,
+ constrained_function_type_argument/1,
+ constraint/2,
+ constraint_argument/1,
+ constraint_body/1,
disjunction/1,
disjunction_body/1,
eof_marker/0,
@@ -188,10 +200,15 @@
fun_expr/1,
fun_expr_arity/1,
fun_expr_clauses/1,
+ fun_type/0,
function/2,
function_arity/1,
function_clauses/1,
function_name/1,
+ function_type/1,
+ function_type/2,
+ function_type_arguments/1,
+ function_type_return/1,
generator/2,
generator_body/1,
generator_pattern/1,
@@ -209,6 +226,9 @@
is_integer/2,
integer_value/1,
integer_literal/1,
+ integer_range_type/2,
+ integer_range_type_low/1,
+ integer_range_type_high/1,
list/1,
list/2,
list_comp/2,
@@ -230,6 +250,15 @@
map_field_exact/2,
map_field_exact_name/1,
map_field_exact_value/1,
+ map_type/0,
+ map_type/1,
+ map_type_fields/1,
+ map_type_assoc/2,
+ map_type_assoc_name/1,
+ map_type_assoc_value/1,
+ map_type_exact/2,
+ map_type_exact_name/1,
+ map_type_exact_value/1,
match_expr/2,
match_expr_body/1,
match_expr_pattern/1,
@@ -270,6 +299,12 @@
record_index_expr/2,
record_index_expr_field/1,
record_index_expr_type/1,
+ record_type/2,
+ record_type_name/1,
+ record_type_fields/1,
+ record_type_field/2,
+ record_type_field_name/1,
+ record_type_field_type/1,
size_qualifier/2,
size_qualifier_argument/1,
size_qualifier_body/1,
@@ -288,6 +323,18 @@
try_expr_clauses/1,
try_expr_handlers/1,
try_expr_after/1,
+ tuple_type/0,
+ tuple_type/1,
+ tuple_type_elements/1,
+ type_application/2,
+ type_application/3,
+ type_application_name/1,
+ type_application_arguments/1,
+ type_union/1,
+ type_union_types/1,
+ typed_record_field/2,
+ typed_record_field_body/1,
+ typed_record_field_type/1,
class_qualifier/2,
class_qualifier_argument/1,
class_qualifier_body/1,
@@ -295,6 +342,9 @@
tuple_elements/1,
tuple_size/1,
underscore/0,
+ user_type_application/2,
+ user_type_application_name/1,
+ user_type_application_arguments/1,
variable/1,
variable_name/1,
variable_literal/1,
@@ -412,23 +462,28 @@
%% <center><table border="1">
%% <tr>
%% <td>application</td>
+%% <td>annotated_type</td>
%% <td>arity_qualifier</td>
%% <td>atom</td>
-%% <td>attribute</td>
%% </tr><tr>
+%% <td>attribute</td>
%% <td>binary</td>
%% <td>binary_field</td>
+%% <td>bitstring_type</td>
+%% </tr><tr>
%% <td>block_expr</td>
%% <td>case_expr</td>
-%% </tr><tr>
%% <td>catch_expr</td>
%% <td>char</td>
+%% </tr><tr>
%% <td>class_qualifier</td>
%% <td>clause</td>
-%% </tr><tr>
%% <td>comment</td>
%% <td>cond_expr</td>
+%% </tr><tr>
%% <td>conjunction</td>
+%% <td>constrained_function_type</td>
+%% <td>constraint</td>
%% <td>disjunction</td>
%% </tr><tr>
%% <td>eof_marker</td>
@@ -437,43 +492,58 @@
%% <td>form_list</td>
%% </tr><tr>
%% <td>fun_expr</td>
+%% <td>fun_type</td>
%% <td>function</td>
+%% <td>function_type</td>
+%% </tr><tr>
%% <td>generator</td>
%% <td>if_expr</td>
-%% </tr><tr>
%% <td>implicit_fun</td>
%% <td>infix_expr</td>
+%% </tr><tr>
%% <td>integer</td>
+%% <td>integer_range_type</td>
%% <td>list</td>
-%% </tr><tr>
%% <td>list_comp</td>
+%% </tr><tr>
%% <td>macro</td>
%% <td>map_expr</td>
%% <td>map_field_assoc</td>
-%% </tr><tr>
%% <td>map_field_exact</td>
+%% </tr><tr>
+%% <td>map_type</td>
+%% <td>map_type_assoc</td>
+%% <td>map_type_exact</td>
%% <td>match_expr</td>
%% <td>module_qualifier</td>
-%% <td>named_fun_expr</td>
%% </tr><tr>
+%% <td>named_fun_expr</td>
%% <td>nil</td>
%% <td>operator</td>
%% <td>parentheses</td>
-%% <td>prefix_expr</td>
%% </tr><tr>
+%% <td>prefix_expr</td>
%% <td>receive_expr</td>
%% <td>record_access</td>
%% <td>record_expr</td>
-%% <td>record_field</td>
%% </tr><tr>
+%% <td>record_field</td>
%% <td>record_index_expr</td>
+%% <td>record_type</td>
+%% <td>record_type_field</td>
+%% </tr><tr>
%% <td>size_qualifier</td>
%% <td>string</td>
%% <td>text</td>
-%% </tr><tr>
%% <td>try_expr</td>
+%% </tr><tr>
%% <td>tuple</td>
+%% <td>tuple_type</td>
+%% <td>typed_record_field</td>
+%% <td>type_application</td>
+%% <td>type_union</td>
%% <td>underscore</td>
+%% <td>user_type_application</td>
%% <td>variable</td>
%% </tr><tr>
%% <td>warning_marker</td>
@@ -487,12 +557,14 @@
%% always have the same name as the node type itself.
%%
%% @see tree/2
+%% @see annotated_type/2
%% @see application/3
%% @see arity_qualifier/2
%% @see atom/1
%% @see attribute/2
%% @see binary/1
%% @see binary_field/2
+%% @see bitstring_type/2
%% @see block_expr/1
%% @see case_expr/2
%% @see catch_expr/1
@@ -502,24 +574,34 @@
%% @see comment/2
%% @see cond_expr/1
%% @see conjunction/1
+%% @see constrained_function_type/2
+%% @see constraint/2
%% @see disjunction/1
%% @see eof_marker/0
%% @see error_marker/1
%% @see float/1
%% @see form_list/1
%% @see fun_expr/1
+%% @see fun_type/0
%% @see function/2
+%% @see function_type/1
+%% @see function_type/2
%% @see generator/2
%% @see if_expr/1
%% @see implicit_fun/2
%% @see infix_expr/3
%% @see integer/1
+%% @see integer_range_type/2
%% @see list/2
%% @see list_comp/2
%% @see macro/2
%% @see map_expr/2
%% @see map_field_assoc/2
%% @see map_field_exact/2
+%% @see map_type/0
+%% @see map_type/1
+%% @see map_type_assoc/2
+%% @see map_type_exact/2
%% @see match_expr/2
%% @see module_qualifier/2
%% @see named_fun_expr/2
@@ -532,12 +614,20 @@
%% @see record_expr/2
%% @see record_field/2
%% @see record_index_expr/2
+%% @see record_type/2
+%% @see record_type_field/2
%% @see size_qualifier/2
%% @see string/1
%% @see text/1
%% @see try_expr/3
%% @see tuple/1
+%% @see tuple_type/0
+%% @see tuple_type/1
+%% @see typed_record_field/2
+%% @see type_application/2
+%% @see type_union/1
%% @see underscore/0
+%% @see user_type_application/2
%% @see variable/1
%% @see warning_marker/1
@@ -602,6 +692,25 @@ type(Node) ->
{remote, _, _, _} -> module_qualifier;
{'try', _, _, _, _, _} -> try_expr;
{tuple, _, _} -> tuple;
+
+ %% Type types
+ {ann_type, _, _} -> annotated_type;
+ {remote_type, _, _} -> type_application;
+ {type, _, binary, [_, _]} -> bitstring_type;
+ {type, _, bounded_fun, [_, _]} -> constrained_function_type;
+ {type, _, constraint, [_, _]} -> constraint;
+ {type, _, 'fun', []} -> fun_type;
+ {type, _, 'fun', [_, _]} -> function_type;
+ {type, _, map, _} -> map_type;
+ {type, _, map_field_assoc, _} -> map_type_assoc;
+ {type, _, map_field_exact, _} -> map_type_exact;
+ {type, _, record, _} -> record_type;
+ {type, _, field_type, _} -> record_type_field;
+ {type, _, range, _} -> integer_range_type;
+ {type, _, tuple, _} -> tuple_type;
+ {type, _, union, _} -> type_union;
+ {type, _, _, _} -> type_application;
+ {user_type, _, _, _} -> user_type_application;
_ ->
erlang:error({badarg, Node})
end.
@@ -621,6 +730,7 @@ type(Node) ->
%% <td>`error_marker'</td>
%% </tr><tr>
%% <td>`float'</td>
+%% <td>`fun_type'</td>
%% <td>`integer'</td>
%% <td>`nil'</td>
%% <td>`operator'</td>
@@ -633,7 +743,13 @@ type(Node) ->
%% </tr>
%% </table></center>
%%
+%% A node of type `map_expr' is a leaf node if and only if it has no
+%% argument and no fields.
+%% A node of type `map_type' is a leaf node if and only if it has no
+%% fields (`any_size').
%% A node of type `tuple' is a leaf node if and only if its arity is zero.
+%% A node of type `tuple_type' is a leaf node if and only if it has no
+%% elements (`any_size').
%%
%% Note: not all literals are leaf nodes, and vice versa. E.g.,
%% tuples with nonzero arity and nonempty lists may be literals, but are
@@ -653,6 +769,7 @@ is_leaf(Node) ->
eof_marker -> true;
error_marker -> true;
float -> true;
+ fun_type -> true;
integer -> true;
nil -> true;
operator -> true; % nonstandard type
@@ -661,7 +778,9 @@ is_leaf(Node) ->
map_expr ->
map_expr_fields(Node) =:= [] andalso
map_expr_argument(Node) =:= none;
+ map_type -> map_type_fields(Node) =:= any_size;
tuple -> tuple_elements(Node) =:= [];
+ tuple_type -> tuple_type_elements(Node) =:= any_size;
underscore -> true;
variable -> true;
warning_marker -> true;
@@ -3114,6 +3233,39 @@ attribute(Name) ->
%% `Imports' is `{Module, [{A1, N1}, ..., {Ak, Nk}]}', or
%% `-import(A1.....An).', if `Imports' is `[A1, ..., An]'.
%%
+%% {attribute, Pos, export_type, ExportedTypes}
+%%
+%% ExportedTypes = [{atom(), integer()}]
+%%
+%% Representing `-export_type([N1/A1, ..., Nk/Ak]).',
+%% if `ExportedTypes' is `[{N1, A1}, ..., {Nk, Ak}]'.
+%%
+%% {attribute, Pos, optional_callbacks, OptionalCallbacks}
+%%
+%% OptionalCallbacks = [{atom(), integer()}]
+%%
+%% Representing `-optional_callbacks([A1/N1, ..., Ak/Nk]).',
+%% if `OptionalCallbacks' is `[{A1, N1}, ..., {Ak, Nk}]'.
+%%
+%% {attribute, Pos, SpecTag, {FuncSpec, FuncType}}
+%%
+%% SpecTag = spec | callback
+%% FuncSpec = {module(), atom(), arity()} | {atom(), arity()}
+%% FuncType = a (possibly constrained) function type
+%%
+%% Representing `-SpecTag M:F/A Ft1; ...; Ftk.' or
+%% `-SpecTag F/A Ft1; ...; Ftk.', if `FuncTypes' is
+%% `[Ft1, ..., Ftk]'.
+%%
+%% {attribute, Pos, TypeTag, {Name, Type, Parameters}}
+%%
+%% TypeTag = type | opaque
+%% Type = a type
+%% Parameters = [Variable]
+%%
+%% Representing `-TypeTag Name(V1, ..., Vk) :: Type .'
+%% if `Parameters' is `[V1, ..., Vk]'.
+%%
%% {attribute, Pos, file, Position}
%%
%% Position = {filename(), integer()}
@@ -3125,13 +3277,19 @@ attribute(Name) ->
%%
%% Info = {Name, [Entries]}
%% Name = atom()
-%% Entries = {record_field, Pos, atom()}
-%% | {record_field, Pos, atom(), erl_parse()}
%%
-%% Representing `-record(Name, {<F1>, ..., <Fn>}).', if `Info' is
+%% Entries = UntypedEntries
+%% | {typed_record_field, UntypedEntries, Type}
+%% UntypedEntries = {record_field, Pos, atom()}
+%% | {record_field, Pos, atom(), erl_parse()}
+%%
+%% Representing `-record(Name, {<F1>, ..., <Fn>}).', if `Info' is
%% `{Name, [D1, ..., D1]}', where each `Fi' is either `Ai = <Ei>',
%% if the corresponding `Di' is `{record_field, Pos, Ai, Ei}', or
-%% otherwise simply `Ai', if `Di' is `{record_field, Pos, Ai}'.
+%% otherwise simply `Ai', if `Di' is `{record_field, Pos, Ai}', or
+%% `Ai = <Ei> :: <Ti>', if `Di' is `{typed_record_field,
+%% {record_field, Pos, Ai, Ei}, Ti}', or `Ai :: <Ti>', if `Di' is
+%% `{typed_record_field, {record_field, Pos, Ai}, Ti}'.
%%
%% {attribute, L, Name, Term}
%%
@@ -3309,11 +3467,6 @@ attribute_arguments(Node) ->
[set_pos(
list(unfold_function_names(Data, Pos)),
Pos)];
- optional_callbacks ->
- D = try list(unfold_function_names(Data, Pos))
- catch _:_ -> abstract(Data)
- end,
- [set_pos(D, Pos)];
import ->
{Module, Imports} = Data,
[set_pos(atom(Module), Pos),
@@ -4183,7 +4336,8 @@ record_field(Name) ->
%% type(Node) = record_field
%% data(Node) = #record_field{name :: Name, value :: Value}
%%
-%% Name = Value = syntaxTree()
+%% Name = syntaxTree()
+%% Value = none | syntaxTree()
-spec record_field(syntaxTree(), 'none' | syntaxTree()) -> syntaxTree().
@@ -4568,7 +4722,7 @@ application(Module, Name, Arguments) ->
%%
%% `erl_parse' representation:
%%
-%% {call, Pos, Fun, Args}
+%% {call, Pos, Operator, Args}
%%
%% Operator = erl_parse()
%% Arguments = [erl_parse()]
@@ -4623,6 +4777,1095 @@ application_arguments(Node) ->
(data(Node1))#application.arguments
end.
+%% =====================================================================
+%% @doc Creates an abstract annotated type expression. The result
+%% represents "<code><em>Name</em> :: <em>Type</em></code>".
+%%
+%% @see annotated_type_name/1
+%% @see annotated_type_body/1
+
+-record(annotated_type, {name :: syntaxTree(), body :: syntaxTree()}).
+
+%% type(Node) = annotated_type
+%% data(Node) = #annotated_type{name :: Name,
+%% body :: Type}
+%%
+%% Name = syntaxTree()
+%% Type = syntaxTree()
+%%
+%% `erl_parse' representation:
+%%
+%% {ann_type, Pos, [Name, Type]}
+%%
+%% Name = erl_parse()
+%% Type = erl_parse()
+
+-spec annotated_type(syntaxTree(), syntaxTree()) -> syntaxTree().
+
+annotated_type(Name, Type) ->
+ tree(annotated_type, #annotated_type{name = Name, body = Type}).
+
+revert_annotated_type(Node) ->
+ Pos = get_pos(Node),
+ Name = annotated_type_name(Node),
+ Type = annotated_type_body(Node),
+ {ann_type, Pos, [Name, Type]}.
+
+
+%% =====================================================================
+%% @doc Returns the name subtree of an `annotated_type' node.
+%%
+%% @see annotated_type/2
+
+-spec annotated_type_name(syntaxTree()) -> syntaxTree().
+
+annotated_type_name(Node) ->
+ case unwrap(Node) of
+ {ann_type, _, [Name, _]} ->
+ Name;
+ Node1 ->
+ (data(Node1))#annotated_type.name
+ end.
+
+
+%% =====================================================================
+%% @doc Returns the type subtrees of an `annotated_type' node.
+%%
+%% @see annotated_type/2
+
+-spec annotated_type_body(syntaxTree()) -> syntaxTree().
+
+annotated_type_body(Node) ->
+ case unwrap(Node) of
+ {ann_type, _, [_, Type]} ->
+ Type;
+ Node1 ->
+ (data(Node1))#annotated_type.body
+ end.
+
+
+%% =====================================================================
+%% @doc Creates an abstract fun of any type. The result represents
+%% "<code>fun()</code>".
+
+%% type(Node) = fun_type
+%%
+%% `erl_parse' representation:
+%%
+%% {type, Pos, 'fun', []}
+
+-spec fun_type() -> syntaxTree().
+
+fun_type() ->
+ tree(fun_type).
+
+revert_fun_type(Node) ->
+ Pos = get_pos(Node),
+ {type, Pos, 'fun', []}.
+
+
+%% =====================================================================
+%% @doc Creates an abstract type application expression. If
+%% `Module' is `none', this is call is equivalent
+%% to `type_application(TypeName, Arguments)', otherwise it is
+%% equivalent to `type_application(module_qualifier(Module, TypeName),
+%% Arguments)'.
+%%
+%% (This is a utility function.)
+%%
+%% @see type_application/2
+%% @see module_qualifier/2
+
+-spec type_application('none' | syntaxTree(), syntaxTree(), [syntaxTree()]) ->
+ syntaxTree().
+
+type_application(none, TypeName, Arguments) ->
+ type_application(TypeName, Arguments);
+type_application(Module, TypeName, Arguments) ->
+ type_application(module_qualifier(Module, TypeName), Arguments).
+
+
+%% =====================================================================
+%% @doc Creates an abstract type application expression. If `Arguments' is
+%% `[T1, ..., Tn]', the result represents
+%% "<code><em>TypeName</em>(<em>T1</em>, ...<em>Tn</em>)</code>".
+%%
+%% @see user_type_application/2
+%% @see type_application/3
+%% @see type_application_name/1
+%% @see type_application_arguments/1
+
+-record(type_application, {type_name :: syntaxTree(),
+ arguments :: [syntaxTree()]}).
+
+%% type(Node) = type_application
+%% data(Node) = #type_application{type_name :: TypeName,
+%% arguments :: Arguments}
+%%
+%% TypeName = syntaxTree()
+%% Arguments = [syntaxTree()]
+%%
+%% `erl_parse' representation:
+%%
+%% {remote, Pos, [Module, Name, Arguments]} |
+%% {type, Pos, Name, Arguments}
+%%
+%% Module = erl_parse()
+%% Name = atom()
+%% Arguments = [erl_parse()]
+
+-spec type_application(syntaxTree(), [syntaxTree()]) -> syntaxTree().
+
+type_application(TypeName, Arguments) ->
+ tree(type_application,
+ #type_application{type_name = TypeName, arguments = Arguments}).
+
+revert_type_application(Node) ->
+ Pos = get_pos(Node),
+ TypeName = type_application_name(Node),
+ Arguments = type_application_arguments(Node),
+ case type(TypeName) of
+ module_qualifier ->
+ Module = module_qualifier_argument(TypeName),
+ Name = module_qualifier_body(TypeName),
+ {remote_type, Pos, [Module, Name, Arguments]};
+ atom ->
+ {type, Pos, atom_value(TypeName), Arguments}
+ end.
+
+
+%% =====================================================================
+%% @doc Returns the type name subtree of a `type_application' node.
+%%
+%% @see type_application/2
+
+-spec type_application_name(syntaxTree()) -> syntaxTree().
+
+type_application_name(Node) ->
+ case unwrap(Node) of
+ {remote_type, _, [Module, Name, _]} ->
+ module_qualifier(Module, Name);
+ {type, Pos, Name, _} ->
+ set_pos(atom(Name), Pos);
+ Node1 ->
+ (data(Node1))#type_application.type_name
+ end.
+
+
+%% =====================================================================
+%% @doc Returns the arguments subtrees of a `type_application' node.
+%%
+%% @see type_application/2
+
+-spec type_application_arguments(syntaxTree()) -> [syntaxTree()].
+
+type_application_arguments(Node) ->
+ case unwrap(Node) of
+ {remote_type, _, [_, _, Arguments]} ->
+ Arguments;
+ {type, _, _, Arguments} ->
+ Arguments;
+ Node1 ->
+ (data(Node1))#type_application.arguments
+ end.
+
+
+%% =====================================================================
+%% @doc Creates an abstract bitstring type. The result represents
+%% "<code><em>&lt;&lt;_:M, _:_*N&gt;&gt;</em></code>".
+%%
+%% @see bitstring_type_m/1
+%% @see bitstring_type_n/1
+
+-record(bitstring_type, {m :: syntaxTree(), n :: syntaxTree()}).
+
+%% type(Node) = bitstring_type
+%% data(Node) = #bitstring_type{m :: M, n :: N}
+%%
+%% M = syntaxTree()
+%% N = syntaxTree()
+%%
+
+-spec bitstring_type(syntaxTree(), syntaxTree()) -> syntaxTree().
+
+bitstring_type(M, N) ->
+ tree(bitstring_type, #bitstring_type{m = M, n =N}).
+
+revert_bitstring_type(Node) ->
+ Pos = get_pos(Node),
+ M = bitstring_type_m(Node),
+ N = bitstring_type_n(Node),
+ {type, Pos, binary, [M, N]}.
+
+%% =====================================================================
+%% @doc Returns the number of start bits, `M', of a `bitstring_type' node.
+%%
+%% @see bitstring_type/2
+
+-spec bitstring_type_m(syntaxTree()) -> syntaxTree().
+
+bitstring_type_m(Node) ->
+ case unwrap(Node) of
+ {type, _, binary, [M, _]} ->
+ M;
+ Node1 ->
+ (data(Node1))#bitstring_type.m
+ end.
+
+%% =====================================================================
+%% @doc Returns the segment size, `N', of a `bitstring_type' node.
+%%
+%% @see bitstring_type/2
+
+-spec bitstring_type_n(syntaxTree()) -> syntaxTree().
+
+bitstring_type_n(Node) ->
+ case unwrap(Node) of
+ {type, _, binary, [_, N]} ->
+ N;
+ Node1 ->
+ (data(Node1))#bitstring_type.n
+ end.
+
+
+%% =====================================================================
+%% @doc Creates an abstract constrained function type.
+%% If `FunctionConstraint' is `[C1, ..., Cn]', the result represents
+%% "<code><em>FunctionType</em> when <em>C1</em>, ...<em>Cn</em></code>".
+%%
+%% @see constrained_function_type_body/1
+%% @see constrained_function_type_argument/1
+
+-record(constrained_function_type, {body :: syntaxTree(),
+ argument :: syntaxTree()}).
+
+%% type(Node) = constrained_function_type
+%% data(Node) = #constrained_function_type{body :: FunctionType,
+%% argument :: FunctionConstraint}
+%%
+%% FunctionType = syntaxTree()
+%% FunctionConstraint = syntaxTree()
+%%
+%% `erl_parse' representation:
+%%
+%% {type, Pos, bounded_fun, [FunctionType, FunctionConstraint]}
+%%
+%% FunctionType = erl_parse()
+%% FunctionConstraint = [erl_parse()]
+
+-spec constrained_function_type(syntaxTree(), [syntaxTree()]) -> syntaxTree().
+
+constrained_function_type(FunctionType, FunctionConstraint) ->
+ Conj = conjunction(FunctionConstraint),
+ tree(constrained_function_type,
+ #constrained_function_type{body = FunctionType,
+ argument = Conj}).
+
+revert_constrained_function_type(Node) ->
+ Pos = get_pos(Node),
+ FunctionType = constrained_function_type_body(Node),
+ FunctionConstraint =
+ conjunction_body(constrained_function_type_argument(Node)),
+ {type, Pos, bounded_fun, [FunctionType, FunctionConstraint]}.
+
+
+%% =====================================================================
+%% @doc Returns the function type subtree of a
+%% `constrained_function_type' node.
+%%
+%% @see constrained_function_type/2
+
+-spec constrained_function_type_body(syntaxTree()) -> syntaxTree().
+
+constrained_function_type_body(Node) ->
+ case unwrap(Node) of
+ {type, _, bounded_fun, [FunctionType, _]} ->
+ FunctionType;
+ Node1 ->
+ (data(Node1))#constrained_function_type.body
+ end.
+
+%% =====================================================================
+%% @doc Returns the function constraint subtree of a
+%% `constrained_function_type' node.
+%%
+%% @see constrained_function_type/2
+
+-spec constrained_function_type_argument(syntaxTree()) -> syntaxTree().
+
+constrained_function_type_argument(Node) ->
+ case unwrap(Node) of
+ {type, _, bounded_fun, [_, FunctionConstraint]} ->
+ conjunction(FunctionConstraint);
+ Node1 ->
+ (data(Node1))#constrained_function_type.argument
+ end.
+
+
+%% =====================================================================
+%% @equiv function_type(any_arity, Type)
+
+function_type(Type) ->
+ function_type(any_arity, Type).
+
+%% =====================================================================
+%% @doc Creates an abstract function type. If `Arguments' is
+%% `[T1, ..., Tn]', then if it occurs within a function
+%% specification, the result represents
+%% "<code>(<em>T1</em>, ...<em>Tn</em>) -> <em>Return</em></code>"; otherwise
+%% it represents
+%% "<code>fun((<em>T1</em>, ...<em>Tn</em>) -> <em>Return</em>)</code>".
+%% If `Arguments' is `any_arity', it represents
+%% "<code>fun((...) -> <em>Return</em>)</code>".
+%%
+%% Note that the `erl_parse' representation is identical for
+%% "<code><em>FunctionType</em></code>" and
+%% "<code>fun(<em>FunctionType</em>)</code>".
+%%
+%% @see function_type_arguments/1
+%% @see function_type_return/1
+
+-record(function_type, {arguments :: any_arity | [syntaxTree()],
+ return :: syntaxTree()}).
+
+%% type(Node) = function_type
+%% data(Node) = #function_type{arguments :: any | Arguments,
+%% return :: Type}
+%%
+%% Arguments = [syntaxTree()]
+%% Type = syntaxTree()
+%%
+%% `erl_parse' representation:
+%%
+%% {type, Pos, 'fun', [{type, Pos, product, Arguments}, Type]}
+%% {type, Pos, 'fun', [{type, Pos, any}, Type]}
+%%
+%% Arguments = [erl_parse()]
+%% Type = erl_parse()
+
+-spec function_type('any_arity' | syntaxTree(), syntaxTree()) -> syntaxTree().
+
+function_type(Arguments, Return) ->
+ tree(function_type,
+ #function_type{arguments = Arguments, return = Return}).
+
+revert_function_type(Node) ->
+ Pos = get_pos(Node),
+ Type = function_type_return(Node),
+ case function_type_arguments(Node) of
+ any_arity ->
+ {type, Pos, 'fun', [{type, Pos, any}, Type]};
+ Arguments ->
+ {type, Pos, 'fun', [{type, Pos, product, Arguments}, Type]}
+ end.
+
+
+%% =====================================================================
+%% @doc Returns the argument types subtrees of a `function_type' node.
+%% If `Node' represents "<code>fun((...) -> <em>Return</em>)</code>",
+%% `any_arity' is returned; otherwise, if `Node' represents
+%% "<code>(<em>T1</em>, ...<em>Tn</em>) -> <em>Return</em></code>" or
+%% "<code>fun((<em>T1</em>, ...<em>Tn</em>) -> <em>Return</em>)</code>",
+%% `[T1, ..., Tn]' is returned.
+
+%%
+%% @see function_type/1
+%% @see function_type/2
+
+-spec function_type_arguments(syntaxTree()) -> any_arity | [syntaxTree()].
+
+function_type_arguments(Node) ->
+ case unwrap(Node) of
+ {type, _, 'fun', [{type, _, any}, _]} ->
+ any_arity;
+ {type, _, 'fun', [{type, _, product, Arguments}, _]} ->
+ Arguments;
+ Node1 ->
+ (data(Node1))#function_type.arguments
+ end.
+
+%% =====================================================================
+%% @doc Returns the return type subtrees of a `function_type' node.
+%%
+%% @see function_type/1
+%% @see function_type/2
+
+-spec function_type_return(syntaxTree()) -> syntaxTree().
+
+function_type_return(Node) ->
+ case unwrap(Node) of
+ {type, _, 'fun', [_, Type]} ->
+ Type;
+ Node1 ->
+ (data(Node1))#function_type.return
+ end.
+
+
+%% =====================================================================
+%% @doc Creates an abstract (subtype) constraint. The result represents
+%% "<code><em>Name</em> :: <em>Type</em></code>".
+%%
+%% @see constraint_argument/1
+%% @see constraint_body/1
+
+-record(constraint, {name :: syntaxTree(),
+ types :: [syntaxTree()]}).
+
+%% type(Node) = constraint
+%% data(Node) = #constraint{name :: Name,
+%% types :: [Type]}
+%%
+%% Name = syntaxTree()
+%% Type = syntaxTree()
+%%
+%% `erl_parse' representation:
+%%
+%% {type, Pos, constraint, [Name, [Var, Type]]}
+%%
+%% Name = {atom, Pos, is_subtype}
+%% Var = erl_parse()
+%% Type = erl_parse()
+
+-spec constraint(syntaxTree(), [syntaxTree()]) -> syntaxTree().
+
+constraint(Name, Types) ->
+ tree(constraint,
+ #constraint{name = Name, types = Types}).
+
+revert_constraint(Node) ->
+ Pos = get_pos(Node),
+ Name = constraint_argument(Node),
+ Types = constraint_body(Node),
+ {type, Pos, constraint, [Name, Types]}.
+
+
+%% =====================================================================
+%% @doc Returns the name subtree of a `constraint' node.
+%%
+%% @see constraint/2
+
+-spec constraint_argument(syntaxTree()) -> syntaxTree().
+
+constraint_argument(Node) ->
+ case unwrap(Node) of
+ {type, _, constraint, [Name, _]} ->
+ Name;
+ Node1 ->
+ (data(Node1))#constraint.name
+ end.
+
+%% =====================================================================
+%% @doc Returns the type subtree of a `constraint' node.
+%%
+%% @see constraint/2
+
+-spec constraint_body(syntaxTree()) -> [syntaxTree()].
+
+constraint_body(Node) ->
+ case unwrap(Node) of
+ {type, _, constraint, [_, Types]} ->
+ Types;
+ Node1 ->
+ (data(Node1))#constraint.types
+ end.
+
+
+%% =====================================================================
+%% @doc Creates an abstract map type assoc field. The result represents
+%% "<code><em>Name</em> => <em>Value</em></code>".
+%%
+%% @see map_type_assoc_name/1
+%% @see map_type_assoc_value/1
+%% @see map_type/1
+
+-record(map_type_assoc, {name :: syntaxTree(), value :: syntaxTree()}).
+
+%% `erl_parse' representation:
+%%
+%% {type, Pos, map_field_assoc, [Name, Value]}
+
+-spec map_type_assoc(syntaxTree(), syntaxTree()) -> syntaxTree().
+
+map_type_assoc(Name, Value) ->
+ tree(map_type_assoc, #map_type_assoc{name = Name, value = Value}).
+
+revert_map_type_assoc(Node) ->
+ Pos = get_pos(Node),
+ Name = map_type_assoc_name(Node),
+ Value = map_type_assoc_value(Node),
+ {type, Pos, map_type_assoc, [Name, Value]}.
+
+
+%% =====================================================================
+%% @doc Returns the name subtree of a `map_type_assoc' node.
+%%
+%% @see map_type_assoc/2
+
+-spec map_type_assoc_name(syntaxTree()) -> syntaxTree().
+
+map_type_assoc_name(Node) ->
+ case Node of
+ {type, _, map_field_assoc, [Name, _]} ->
+ Name;
+ _ ->
+ (data(Node))#map_type_assoc.name
+ end.
+
+
+%% =====================================================================
+%% @doc Returns the value subtree of a `map_type_assoc' node.
+%%
+%% @see map_type_assoc/2
+
+-spec map_type_assoc_value(syntaxTree()) -> syntaxTree().
+
+map_type_assoc_value(Node) ->
+ case Node of
+ {type, _, map_field_assoc, [_, Value]} ->
+ Value;
+ _ ->
+ (data(Node))#map_type_assoc.value
+ end.
+
+
+%% =====================================================================
+%% @doc Creates an abstract map type exact field. The result represents
+%% "<code><em>Name</em> := <em>Value</em></code>".
+%%
+%% @see map_type_exact_name/1
+%% @see map_type_exact_value/1
+%% @see map_type/1
+
+-record(map_type_exact, {name :: syntaxTree(), value :: syntaxTree()}).
+
+%% `erl_parse' representation:
+%%
+%% {type, Pos, map_field_exact, [Name, Value]}
+
+-spec map_type_exact(syntaxTree(), syntaxTree()) -> syntaxTree().
+
+map_type_exact(Name, Value) ->
+ tree(map_type_exact, #map_type_exact{name = Name, value = Value}).
+
+revert_map_type_exact(Node) ->
+ Pos = get_pos(Node),
+ Name = map_type_exact_name(Node),
+ Value = map_type_exact_value(Node),
+ {type, Pos, map_type_exact, [Name, Value]}.
+
+
+%% =====================================================================
+%% @doc Returns the name subtree of a `map_type_exact' node.
+%%
+%% @see map_type_exact/2
+
+-spec map_type_exact_name(syntaxTree()) -> syntaxTree().
+
+map_type_exact_name(Node) ->
+ case Node of
+ {type, _, map_field_exact, [Name, _]} ->
+ Name;
+ _ ->
+ (data(Node))#map_type_exact.name
+ end.
+
+
+%% =====================================================================
+%% @doc Returns the value subtree of a `map_type_exact' node.
+%%
+%% @see map_type_exact/2
+
+-spec map_type_exact_value(syntaxTree()) -> syntaxTree().
+
+map_type_exact_value(Node) ->
+ case Node of
+ {type, _, map_field_exact, [_, Value]} ->
+ Value;
+ _ ->
+ (data(Node))#map_type_exact.value
+ end.
+
+
+%% =====================================================================
+%% @equiv map_type(any_size)
+
+map_type() ->
+ map_type(any_size).
+
+%% =====================================================================
+%% @doc Creates an abstract type map. If `Fields' is
+%% `[F1, ..., Fn]', the result represents
+%% "<code>#{<em>F1</em>, ..., <em>Fn</em>}</code>";
+%% otherwise, if `Fields' is `any_size', it represents
+%% "<code>map()</code>".
+%%
+%% @see map_type_fields/1
+
+%% type(Node) = map_type
+%% data(Node) = Fields
+%%
+%% Fields = any_size | [syntaxTree()]
+%%
+%% `erl_parse' representation:
+%%
+%% {type, Pos, map, [Field]}
+%% {type, Pos, map, any}
+%%
+%% Field = erl_parse()
+
+-spec map_type('any_size' | [syntaxTree()]) -> syntaxTree().
+
+map_type(Fields) ->
+ tree(map_type, Fields).
+
+revert_map_type(Node) ->
+ Pos = get_pos(Node),
+ {type, Pos, map, map_type_fields(Node)}.
+
+
+%% =====================================================================
+%% @doc Returns the list of field subtrees of a `map_type' node.
+%% If `Node' represents "<code>map()</code>", `any_size' is returned;
+%% otherwise, if `Node' represents
+%% "<code>#{<em>F1</em>, ..., <em>Fn</em>}</code>",
+%% `[F1, ..., Fn]' is returned.
+%%
+%% @see map_type/0
+%% @see map_type/1
+
+-spec map_type_fields(syntaxTree()) -> 'any_size' | [syntaxTree()].
+
+map_type_fields(Node) ->
+ case unwrap(Node) of
+ {type, _, map, Fields} when is_list(Fields) ->
+ Fields;
+ {type, _, map, any} ->
+ any_size;
+ Node1 ->
+ data(Node1)
+ end.
+
+
+%% =====================================================================
+%% @doc Creates an abstract range type. The result represents
+%% "<code><em>Low</em> .. <em>High</em></code>".
+%%
+%% @see integer_range_type_low/1
+%% @see integer_range_type_high/1
+
+-record(integer_range_type, {low :: syntaxTree(),
+ high :: syntaxTree()}).
+
+%% type(Node) = integer_range_type
+%% data(Node) = #integer_range_type{low :: Low, high :: High}
+%%
+%% Low = syntaxTree()
+%% High = syntaxTree()
+%%
+%% `erl_parse' representation:
+%%
+%% {type, Pos, range, [Low, High]}
+%%
+%% Low = erl_parse()
+%% High = erl_parse()
+
+-spec integer_range_type(syntaxTree(), syntaxTree()) -> syntaxTree().
+
+integer_range_type(Low, High) ->
+ tree(integer_range_type, #integer_range_type{low = Low, high = High}).
+
+revert_integer_range_type(Node) ->
+ Pos = get_pos(Node),
+ Low = integer_range_type_low(Node),
+ High = integer_range_type_high(Node),
+ {type, Pos, range, [Low, High]}.
+
+
+%% =====================================================================
+%% @doc Returns the low limit of an `integer_range_type' node.
+%%
+%% @see integer_range_type/2
+
+-spec integer_range_type_low(syntaxTree()) -> syntaxTree().
+
+integer_range_type_low(Node) ->
+ case unwrap(Node) of
+ {type, _, range, [Low, _]} ->
+ Low;
+ Node1 ->
+ (data(Node1))#integer_range_type.low
+ end.
+
+%% =====================================================================
+%% @doc Returns the high limit of an `integer_range_type' node.
+%%
+%% @see integer_range_type/2
+
+-spec integer_range_type_high(syntaxTree()) -> syntaxTree().
+
+integer_range_type_high(Node) ->
+ case unwrap(Node) of
+ {type, _, range, [_, High]} ->
+ High;
+ Node1 ->
+ (data(Node1))#integer_range_type.high
+ end.
+
+
+%% =====================================================================
+%% @doc Creates an abstract record type. If `Fields' is
+%% `[F1, ..., Fn]', the result represents
+%% "<code>#<em>Name</em>{<em>F1</em>, ..., <em>Fn</em>}</code>".
+%%
+%% @see record_type_name/1
+%% @see record_type_fields/1
+
+-record(record_type, {name :: syntaxTree(),
+ fields :: [syntaxTree()]}).
+
+%% type(Node) = record_type
+%% data(Node) = #record_type{name = Name, fields = Fields}
+%%
+%% Name = syntaxTree()
+%% Fields = [syntaxTree()]
+%%
+%% `erl_parse' representation:
+%%
+%% {type, Pos, record, [Name|Fields]}
+%%
+%% Name = erl_parse()
+%% Fields = [erl_parse()]
+
+-spec record_type(syntaxTree(), [syntaxTree()]) -> syntaxTree().
+
+record_type(Name, Fields) ->
+ tree(record_type, #record_type{name = Name, fields = Fields}).
+
+revert_record_type(Node) ->
+ Pos = get_pos(Node),
+ Name = record_type_name(Node),
+ Fields = record_type_fields(Node),
+ {type, Pos, record, [Name | Fields]}.
+
+
+%% =====================================================================
+%% @doc Returns the name subtree of a `record_type' node.
+%%
+%% @see record_type/2
+
+-spec record_type_name(syntaxTree()) -> syntaxTree().
+
+record_type_name(Node) ->
+ case unwrap(Node) of
+ {type, _, record, [Name|_]} ->
+ Name;
+ Node1 ->
+ (data(Node1))#record_type.name
+ end.
+
+%% =====================================================================
+%% @doc Returns the fields subtree of a `record_type' node.
+%%
+%% @see record_type/2
+
+-spec record_type_fields(syntaxTree()) -> [syntaxTree()].
+
+record_type_fields(Node) ->
+ case unwrap(Node) of
+ {type, _, record, [_|Fields]} ->
+ Fields;
+ Node1 ->
+ (data(Node1))#record_type.fields
+ end.
+
+
+%% =====================================================================
+%% @doc Creates an abstract record type field. The result represents
+%% "<code><em>Name</em> :: <em>Type</em></code>".
+%%
+%% @see record_type_field_name/1
+%% @see record_type_field_type/1
+
+-record(record_type_field, {name :: syntaxTree(),
+ type :: syntaxTree()}).
+
+%% type(Node) = record_type_field
+%% data(Node) = #record_type_field{name = Name, type = Type}
+%%
+%% Name = syntaxTree()
+%% Type = syntaxTree()
+%%
+%% `erl_parse' representation:
+%%
+%% {type, Pos, field_type, [Name, Type]}
+%%
+%% Name = erl_parse()
+%% Type = erl_parse()
+
+-spec record_type_field(syntaxTree(), syntaxTree()) -> syntaxTree().
+
+record_type_field(Name, Type) ->
+ tree(record_type_field, #record_type_field{name = Name, type = Type}).
+
+revert_record_type_field(Node) ->
+ Pos = get_pos(Node),
+ Name = record_type_field_name(Node),
+ Type = record_type_field_type(Node),
+ {type, Pos, field_type, [Name, Type]}.
+
+
+%% =====================================================================
+%% @doc Returns the name subtree of a `record_type_field' node.
+%%
+%% @see record_type_field/2
+
+-spec record_type_field_name(syntaxTree()) -> syntaxTree().
+
+record_type_field_name(Node) ->
+ case unwrap(Node) of
+ {type, _, field_type, [Name, _]} ->
+ Name;
+ Node1 ->
+ (data(Node1))#record_type_field.name
+ end.
+
+%% =====================================================================
+%% @doc Returns the type subtree of a `record_type_field' node.
+%%
+%% @see record_type_field/2
+
+-spec record_type_field_type(syntaxTree()) -> syntaxTree().
+
+record_type_field_type(Node) ->
+ case unwrap(Node) of
+ {type, _, field_type, [_, Type]} ->
+ Type;
+ Node1 ->
+ (data(Node1))#record_type_field.type
+ end.
+
+
+%% =====================================================================
+%% @equiv tuple_type(any_size)
+
+tuple_type() ->
+ tuple_type(any_size).
+
+%% =====================================================================
+%% @doc Creates an abstract type tuple. If `Elements' is
+%% `[T1, ..., Tn]', the result represents
+%% "<code>{<em>T1</em>, ..., <em>Tn</em>}</code>";
+%% otherwise, if `Elements' is `any_size', it represents
+%% "<code>tuple()</code>".
+%%
+%% @see tuple_type_elements/1
+
+%% type(Node) = tuple_type
+%% data(Node) = Elements
+%%
+%% Elements = any_size | [syntaxTree()]
+%%
+%% `erl_parse' representation:
+%%
+%% {type, Pos, tuple, [Element]}
+%% {type, Pos, tuple, any}
+%%
+%% Element = erl_parse()
+
+-spec tuple_type(any_size | [syntaxTree()]) -> syntaxTree().
+
+tuple_type(Elements) ->
+ tree(tuple_type, Elements).
+
+revert_tuple_type(Node) ->
+ Pos = get_pos(Node),
+ {type, Pos, tuple, tuple_type_elements(Node)}.
+
+
+%% =====================================================================
+%% @doc Returns the list of type element subtrees of a `tuple_type' node.
+%% If `Node' represents "<code>tuple()</code>", `any_size' is returned;
+%% otherwise, if `Node' represents
+%% "<code>{<em>T1</em>, ..., <em>Tn</em>}</code>",
+%% `[T1, ..., Tn]' is returned.
+%%
+%% @see tuple_type/0
+%% @see tuple_type/1
+
+-spec tuple_type_elements(syntaxTree()) -> 'any_size' | [syntaxTree()].
+
+tuple_type_elements(Node) ->
+ case unwrap(Node) of
+ {type, _, tuple, Elements} when is_list(Elements) ->
+ Elements;
+ {type, _, tuple, any} ->
+ any_size;
+ Node1 ->
+ data(Node1)
+ end.
+
+
+%% =====================================================================
+%% @doc Creates an abstract type union. If `Types' is
+%% `[T1, ..., Tn]', the result represents
+%% "<code><em>T1</em> | ... | <em>Tn</em></code>".
+%%
+%% @see type_union_types/1
+
+%% type(Node) = type_union
+%% data(Node) = Types
+%%
+%% Types = [syntaxTree()]
+%%
+%% `erl_parse' representation:
+%%
+%% {type, Pos, union, Elements}
+%%
+%% Elements = [erl_parse()]
+
+-spec type_union([syntaxTree()]) -> syntaxTree().
+
+type_union(Types) ->
+ tree(type_union, Types).
+
+revert_type_union(Node) ->
+ Pos = get_pos(Node),
+ {type, Pos, union, type_union_types(Node)}.
+
+
+%% =====================================================================
+%% @doc Returns the list of type subtrees of a `type_union' node.
+%%
+%% @see type_union/1
+
+-spec type_union_types(syntaxTree()) -> [syntaxTree()].
+
+type_union_types(Node) ->
+ case unwrap(Node) of
+ {type, _, union, Types} when is_list(Types) ->
+ Types;
+ Node1 ->
+ data(Node1)
+ end.
+
+
+%% =====================================================================
+%% @doc Creates an abstract user type. If `Arguments' is
+%% `[T1, ..., Tn]', the result represents
+%% "<code><em>TypeName</em>(<em>T1</em>, ...<em>Tn</em>)</code>".
+%%
+%% @see type_application/2
+%% @see user_type_application_name/1
+%% @see user_type_application_arguments/1
+
+-record(user_type_application, {type_name :: syntaxTree(),
+ arguments :: [syntaxTree()]}).
+
+%% type(Node) = user_type_application
+%% data(Node) = #user_type_application{type_name :: TypeName,
+%% arguments :: Arguments}
+%%
+%% TypeName = syntaxTree()
+%% Arguments = [syntaxTree()]
+%%
+%% `erl_parse' representation:
+%%
+%% {user_type, Pos, Name, Arguments}
+%%
+%% Name = erl_parse()
+%% Arguments = [Type]
+%% Type = erl_parse()
+
+-spec user_type_application(syntaxTree(), [syntaxTree()]) -> syntaxTree().
+
+user_type_application(TypeName, Arguments) ->
+ tree(user_type_application,
+ #user_type_application{type_name = TypeName, arguments = Arguments}).
+
+revert_user_type_application(Node) ->
+ Pos = get_pos(Node),
+ TypeName = user_type_application_name(Node),
+ Arguments = user_type_application_arguments(Node),
+ {user_type, Pos, atom_value(TypeName), Arguments}.
+
+
+%% =====================================================================
+%% @doc Returns the type name subtree of a `user_type_application' node.
+%%
+%% @see user_type_application/2
+
+-spec user_type_application_name(syntaxTree()) -> syntaxTree().
+
+user_type_application_name(Node) ->
+ case unwrap(Node) of
+ {user_type, Pos, Name, _} ->
+ set_pos(atom(Name), Pos);
+ Node1 ->
+ (data(Node1))#user_type_application.type_name
+ end.
+
+
+%% =====================================================================
+%% @doc Returns the arguments subtrees of a `user_type_application' node.
+%%
+%% @see user_type_application/2
+
+-spec user_type_application_arguments(syntaxTree()) -> [syntaxTree()].
+
+user_type_application_arguments(Node) ->
+ case unwrap(Node) of
+ {user_type, _, _, Arguments} ->
+ Arguments;
+ Node1 ->
+ (data(Node1))#user_type_application.arguments
+ end.
+
+
+%% =====================================================================
+%% @doc Creates an abstract typed record field specification. The
+%% result represents "<code><em>Field</em> :: <em>Type</em></code>".
+%%
+%% @see typed_record_field_body/1
+%% @see typed_record_field_type/1
+
+-record(typed_record_field, {body :: syntaxTree(),
+ type :: syntaxTree()}).
+
+%% type(Node) = typed_record_field
+%% data(Node) = #typed_record_field{body :: Field
+%% type = Type}
+%%
+%% Field = syntaxTree()
+%% Type = syntaxTree()
+
+-spec typed_record_field(syntaxTree(), syntaxTree()) -> syntaxTree().
+
+typed_record_field(Field, Type) ->
+ tree(typed_record_field,
+ #typed_record_field{body = Field, type = Type}).
+
+
+%% =====================================================================
+%% @doc Returns the field subtree of a `typed_record_field' node.
+%%
+%% @see typed_record_field/2
+
+-spec typed_record_field_body(syntaxTree()) -> syntaxTree().
+
+typed_record_field_body(Node) ->
+ (data(Node))#typed_record_field.body.
+
+
+%% =====================================================================
+%% @doc Returns the type subtree of a `typed_record_field' node.
+%%
+%% @see typed_record_field/2
+
+-spec typed_record_field_type(syntaxTree()) -> syntaxTree().
+
+typed_record_field_type(Node) ->
+ (data(Node))#typed_record_field.type.
+
%% =====================================================================
%% @doc Creates an abstract list comprehension. If `Body' is
@@ -6168,6 +7411,8 @@ revert(Node) ->
revert_root(Node) ->
case type(Node) of
+ annotated_type ->
+ revert_annotated_type(Node);
application ->
revert_application(Node);
atom ->
@@ -6182,6 +7427,8 @@ revert_root(Node) ->
revert_binary_field(Node);
binary_generator ->
revert_binary_generator(Node);
+ bitstring_type ->
+ revert_bitstring_type(Node);
block_expr ->
revert_block_expr(Node);
case_expr ->
@@ -6194,6 +7441,10 @@ revert_root(Node) ->
revert_clause(Node);
cond_expr ->
revert_cond_expr(Node);
+ constrained_function_type ->
+ revert_constrained_function_type(Node);
+ constraint ->
+ revert_constraint(Node);
eof_marker ->
revert_eof_marker(Node);
error_marker ->
@@ -6202,8 +7453,12 @@ revert_root(Node) ->
revert_float(Node);
fun_expr ->
revert_fun_expr(Node);
+ fun_type ->
+ revert_fun_type(Node);
function ->
revert_function(Node);
+ function_type ->
+ revert_function_type(Node);
generator ->
revert_generator(Node);
if_expr ->
@@ -6214,6 +7469,8 @@ revert_root(Node) ->
revert_infix_expr(Node);
integer ->
revert_integer(Node);
+ integer_range_type ->
+ revert_integer_range_type(Node);
list ->
revert_list(Node);
list_comp ->
@@ -6224,6 +7481,12 @@ revert_root(Node) ->
revert_map_field_assoc(Node);
map_field_exact ->
revert_map_field_exact(Node);
+ map_type ->
+ revert_map_type(Node);
+ map_type_assoc ->
+ revert_map_type_assoc(Node);
+ map_type_exact ->
+ revert_map_type_exact(Node);
match_expr ->
revert_match_expr(Node);
module_qualifier ->
@@ -6244,14 +7507,26 @@ revert_root(Node) ->
revert_record_expr(Node);
record_index_expr ->
revert_record_index_expr(Node);
+ record_type ->
+ revert_record_type(Node);
+ record_type_field ->
+ revert_record_type_field(Node);
+ type_application ->
+ revert_type_application(Node);
+ type_union ->
+ revert_type_union(Node);
string ->
revert_string(Node);
try_expr ->
revert_try_expr(Node);
tuple ->
revert_tuple(Node);
+ tuple_type ->
+ revert_tuple_type(Node);
underscore ->
revert_underscore(Node);
+ user_type_application ->
+ revert_user_type_application(Node);
variable ->
revert_variable(Node);
warning_marker ->
@@ -6379,6 +7654,9 @@ subtrees(T) ->
[];
false ->
case type(T) of
+ annotated_type ->
+ [[annotated_type_name(T)],
+ [annotated_type_body(T)]];
application ->
[[application_operator(T)],
application_arguments(T)];
@@ -6407,6 +7685,9 @@ subtrees(T) ->
binary_generator ->
[[binary_generator_pattern(T)],
[binary_generator_body(T)]];
+ bitstring_type ->
+ [[bitstring_type_m(T)],
+ [bitstring_type_n(T)]];
block_expr ->
[block_expr_body(T)];
case_expr ->
@@ -6429,14 +7710,30 @@ subtrees(T) ->
[cond_expr_clauses(T)];
conjunction ->
[conjunction_body(T)];
+ constrained_function_type ->
+ C = constrained_function_type_argument(T),
+ [[constrained_function_type_body(T)],
+ conjunction_body(C)];
+ constraint ->
+ [[constraint_argument(T)],
+ constraint_body(T)];
disjunction ->
[disjunction_body(T)];
form_list ->
[form_list_elements(T)];
fun_expr ->
[fun_expr_clauses(T)];
+ fun_type ->
+ [];
function ->
[[function_name(T)], function_clauses(T)];
+ function_type ->
+ case function_type_arguments(T) of
+ any_arity ->
+ [[function_type_return(T)]];
+ As ->
+ [As,[function_type_return(T)]]
+ end;
generator ->
[[generator_pattern(T)], [generator_body(T)]];
if_expr ->
@@ -6447,6 +7744,9 @@ subtrees(T) ->
[[infix_expr_left(T)],
[infix_expr_operator(T)],
[infix_expr_right(T)]];
+ integer_range_type ->
+ [[integer_range_type_low(T)],
+ [integer_range_type_high(T)]];
list ->
case list_suffix(T) of
none ->
@@ -6476,6 +7776,14 @@ subtrees(T) ->
map_field_exact ->
[[map_field_exact_name(T)],
[map_field_exact_value(T)]];
+ map_type ->
+ [map_type_fields(T)];
+ map_type_assoc ->
+ [[map_type_assoc_name(T)],
+ [map_type_assoc_value(T)]];
+ map_type_exact ->
+ [[map_type_exact_name(T)],
+ [map_type_exact_value(T)]];
match_expr ->
[[match_expr_pattern(T)],
[match_expr_body(T)]];
@@ -6523,6 +7831,12 @@ subtrees(T) ->
record_index_expr ->
[[record_index_expr_type(T)],
[record_index_expr_field(T)]];
+ record_type ->
+ [[record_type_name(T)],
+ record_type_fields(T)];
+ record_type_field ->
+ [[record_type_field_name(T)],
+ [record_type_field_type(T)]];
size_qualifier ->
[[size_qualifier_body(T)],
[size_qualifier_argument(T)]];
@@ -6532,7 +7846,20 @@ subtrees(T) ->
try_expr_handlers(T),
try_expr_after(T)];
tuple ->
- [tuple_elements(T)]
+ [tuple_elements(T)];
+ tuple_type ->
+ [tuple_type_elements(T)];
+ type_application ->
+ [[type_application_name(T)],
+ type_application_arguments(T)];
+ type_union ->
+ [type_union_types(T)];
+ typed_record_field ->
+ [[typed_record_field_body(T)],
+ [typed_record_field_type(T)]];
+ user_type_application ->
+ [[user_type_application_name(T)],
+ user_type_application_arguments(T)]
end
end.
@@ -6576,6 +7903,7 @@ update_tree(Node, Groups) ->
-spec make_tree(atom(), [[syntaxTree()]]) -> syntaxTree().
+make_tree(annotated_type, [[N], [T]]) -> annotated_type(N, T);
make_tree(application, [[F], A]) -> application(F, A);
make_tree(arity_qualifier, [[N], [A]]) -> arity_qualifier(N, A);
make_tree(attribute, [[N]]) -> attribute(N);
@@ -6585,6 +7913,7 @@ make_tree(binary_comp, [[T], B]) -> binary_comp(T, B);
make_tree(binary_field, [[B]]) -> binary_field(B);
make_tree(binary_field, [[B], Ts]) -> binary_field(B, Ts);
make_tree(binary_generator, [[P], [E]]) -> binary_generator(P, E);
+make_tree(bitstring_type, [[M], [N]]) -> bitstring_type(M, N);
make_tree(block_expr, [B]) -> block_expr(B);
make_tree(case_expr, [[A], C]) -> case_expr(A, C);
make_tree(catch_expr, [[B]]) -> catch_expr(B);
@@ -6593,14 +7922,20 @@ make_tree(clause, [P, B]) -> clause(P, none, B);
make_tree(clause, [P, [G], B]) -> clause(P, G, B);
make_tree(cond_expr, [C]) -> cond_expr(C);
make_tree(conjunction, [E]) -> conjunction(E);
+make_tree(constrained_function_type, [[F],C]) ->
+ constrained_function_type(F, C);
+make_tree(constraint, [[N], Ts]) -> constraint(N, Ts);
make_tree(disjunction, [E]) -> disjunction(E);
make_tree(form_list, [E]) -> form_list(E);
make_tree(fun_expr, [C]) -> fun_expr(C);
make_tree(function, [[N], C]) -> function(N, C);
+make_tree(function_type, [[T]]) -> function_type(T);
+make_tree(function_type, [A,[T]]) -> function_type(A, T);
make_tree(generator, [[P], [E]]) -> generator(P, E);
make_tree(if_expr, [C]) -> if_expr(C);
make_tree(implicit_fun, [[N]]) -> implicit_fun(N);
make_tree(infix_expr, [[L], [F], [R]]) -> infix_expr(L, F, R);
+make_tree(integer_range_type, [[L],[H]]) -> integer_range_type(L, H);
make_tree(list, [P]) -> list(P);
make_tree(list, [P, [S]]) -> list(P, S);
make_tree(list_comp, [[T], B]) -> list_comp(T, B);
@@ -6610,6 +7945,9 @@ make_tree(map_expr, [Fs]) -> map_expr(Fs);
make_tree(map_expr, [[E], Fs]) -> map_expr(E, Fs);
make_tree(map_field_assoc, [[K], [V]]) -> map_field_assoc(K, V);
make_tree(map_field_exact, [[K], [V]]) -> map_field_exact(K, V);
+make_tree(map_type, [Fs]) -> map_type(Fs);
+make_tree(map_type_assoc, [[N],[V]]) -> map_type_assoc(N, V);
+make_tree(map_type_exact, [[N],[V]]) -> map_type_exact(N, V);
make_tree(match_expr, [[P], [E]]) -> match_expr(P, E);
make_tree(named_fun_expr, [[N], C]) -> named_fun_expr(N, C);
make_tree(module_qualifier, [[M], [N]]) -> module_qualifier(M, N);
@@ -6625,9 +7963,16 @@ make_tree(record_field, [[N]]) -> record_field(N);
make_tree(record_field, [[N], [E]]) -> record_field(N, E);
make_tree(record_index_expr, [[T], [F]]) ->
record_index_expr(T, F);
+make_tree(record_type, [[N],Fs]) -> record_type(N, Fs);
+make_tree(record_type_field, [[N],[T]]) -> record_type_field(N, T);
make_tree(size_qualifier, [[N], [A]]) -> size_qualifier(N, A);
make_tree(try_expr, [B, C, H, A]) -> try_expr(B, C, H, A);
-make_tree(tuple, [E]) -> tuple(E).
+make_tree(tuple, [E]) -> tuple(E);
+make_tree(tuple_type, [Es]) -> tuple_type(Es);
+make_tree(type_application, [[N], Ts]) -> type_application(N, Ts);
+make_tree(type_union, [Es]) -> type_union(Es);
+make_tree(typed_record_field, [[F],[T]]) -> typed_record_field(F, T);
+make_tree(user_type_application, [[N], Ts]) -> user_type_application(N, Ts).
%% =====================================================================
@@ -6954,6 +8299,7 @@ fold_variable_names(Vs) ->
unfold_variable_names(Vs, Pos) ->
[set_pos(variable(V), Pos) || V <- Vs].
+
%% Support functions for transforming lists of record field definitions.
%%
%% There is no unique representation for field definitions in the
@@ -6968,6 +8314,16 @@ fold_record_fields(Fs) ->
[fold_record_field(F) || F <- Fs].
fold_record_field(F) ->
+ case type(F) of
+ typed_record_field ->
+ Field = fold_record_field_1(typed_record_field_body(F)),
+ Type = typed_record_field_type(F),
+ {typed_record_field, Field, Type};
+ record_field ->
+ fold_record_field_1(F)
+ end.
+
+fold_record_field_1(F) ->
Pos = get_pos(F),
Name = record_field_name(F),
case record_field_value(F) of
@@ -6980,10 +8336,11 @@ fold_record_field(F) ->
unfold_record_fields(Fs) ->
[unfold_record_field(F) || F <- Fs].
-unfold_record_field({typed_record_field, Field, _Type}) ->
- unfold_record_field_1(Field);
+unfold_record_field({typed_record_field, Field, Type}) ->
+ F = unfold_record_field_1(Field),
+ set_pos(typed_record_field(F, Type), get_pos(F));
unfold_record_field(Field) ->
- unfold_record_field_1(Field).
+ unfold_record_field_1(Field).
unfold_record_field_1({record_field, Pos, Name}) ->
set_pos(record_field(Name), Pos);
@@ -7010,5 +8367,4 @@ unfold_binary_field_type({Type, Size}, Pos) ->
unfold_binary_field_type(Type, Pos) ->
set_pos(atom(Type), Pos).
-
%% =====================================================================
diff --git a/lib/syntax_tools/src/erl_syntax_lib.erl b/lib/syntax_tools/src/erl_syntax_lib.erl
index 58c4cc5244..9815559779 100644
--- a/lib/syntax_tools/src/erl_syntax_lib.erl
+++ b/lib/syntax_tools/src/erl_syntax_lib.erl
@@ -36,6 +36,7 @@
analyze_import_attribute/1, analyze_module_attribute/1,
analyze_record_attribute/1, analyze_record_expr/1,
analyze_record_field/1, analyze_wild_attribute/1, annotate_bindings/1,
+ analyze_type_application/1, analyze_type_name/1,
annotate_bindings/2, fold/3, fold_subtrees/3, foldl_listlist/3,
function_name_expansions/1, is_fail_expr/1, limit/2, limit/3,
map/2, map_subtrees/2, mapfold/3, mapfold_subtrees/3,
@@ -1029,14 +1030,17 @@ is_fail_expr(E) ->
%% <dt>`{records, Records}'</dt>
%% <dd><ul>
%% <li>`Records = [{atom(), Fields}]'</li>
-%% <li>`Fields = [{atom(), Default}]'</li>
+%% <li>`Fields = [{atom(), {Default, Type}}]'</li>
%% <li>`Default = none | syntaxTree()'</li>
+%% <li>`Type = none | syntaxTree()'</li>
%% </ul>
%% `Records' is a list of pairs representing the names
%% and corresponding field declarations of all record declaration
%% attributes occurring in `Forms'. For fields declared
%% without a default value, the corresponding value for
-%% `Default' is the atom `none' (cf.
+%% `Default' is the atom `none'. Similarly, for fields declared
+%% without a type, the corresponding value for `Type' is the
+%% atom `none' (cf.
%% `analyze_record_attribute/1'). We do not guarantee
%% that each record name occurs at most once in the list. The
%% order of listing is not defined.</dd>
@@ -1055,9 +1059,9 @@ is_fail_expr(E) ->
%%
%% @see analyze_wild_attribute/1
%% @see analyze_export_attribute/1
+%% @see analyze_function/1
%% @see analyze_import_attribute/1
%% @see analyze_record_attribute/1
-%% @see analyze_function/1
%% @see erl_syntax:error_marker_info/1
%% @see erl_syntax:warning_marker_info/1
@@ -1102,8 +1106,6 @@ collect_attribute(file, _, Info) ->
Info;
collect_attribute(record, {R, L}, Info) ->
finfo_add_record(R, L, Info);
-collect_attribute(spec, _, Info) ->
- Info;
collect_attribute(_, {N, V}, Info) ->
finfo_add_attribute(N, V, Info).
@@ -1114,12 +1116,15 @@ collect_attribute(_, {N, V}, Info) ->
module_imports = [] :: [atom()],
imports = [] :: [{atom(), [{atom(), arity()}]}],
attributes = [] :: [{atom(), term()}],
- records = [] :: [{atom(), [{atom(), field_default()}]}],
+ records = [] :: [{atom(), [{atom(),
+ field_default(),
+ field_type()}]}],
errors = [] :: [term()],
warnings = [] :: [term()],
functions = [] :: [{atom(), arity()}]}).
-type field_default() :: 'none' | erl_syntax:syntaxTree().
+-type field_type() :: 'none' | erl_syntax:syntaxTree().
new_finfo() ->
#forms{}.
@@ -1326,8 +1331,6 @@ analyze_attribute(file, Node) ->
analyze_file_attribute(Node);
analyze_attribute(record, Node) ->
analyze_record_attribute(Node);
-analyze_attribute(spec, _Node) ->
- spec;
analyze_attribute(_, Node) ->
%% A "wild" attribute (such as e.g. a `compile' directive).
analyze_wild_attribute(Node).
@@ -1523,6 +1526,55 @@ analyze_import_attribute(Node) ->
%% =====================================================================
+%% @spec analyze_type_name(Node::syntaxTree()) -> TypeName
+%%
+%% TypeName = atom()
+%% | {atom(), integer()}
+%% | {ModuleName, {atom(), integer()}}
+%% ModuleName = atom()
+%%
+%% @doc Returns the type name represented by a syntax tree. If
+%% `Node' represents a type name, such as
+%% "`foo/1'" or "`bloggs:fred/2'", a uniform
+%% representation of that name is returned.
+%%
+%% The evaluation throws `syntax_error' if
+%% `Node' does not represent a well-formed type name.
+
+-spec analyze_type_name(erl_syntax:syntaxTree()) -> typeName().
+
+analyze_type_name(Node) ->
+ case erl_syntax:type(Node) of
+ atom ->
+ erl_syntax:atom_value(Node);
+ arity_qualifier ->
+ A = erl_syntax:arity_qualifier_argument(Node),
+ N = erl_syntax:arity_qualifier_body(Node),
+
+ case ((erl_syntax:type(A) =:= integer)
+ and (erl_syntax:type(N) =:= atom))
+ of
+ true ->
+ append_arity(erl_syntax:integer_value(A),
+ erl_syntax:atom_value(N));
+ _ ->
+ throw(syntax_error)
+ end;
+ module_qualifier ->
+ M = erl_syntax:module_qualifier_argument(Node),
+ case erl_syntax:type(M) of
+ atom ->
+ N = erl_syntax:module_qualifier_body(Node),
+ N1 = analyze_type_name(N),
+ {erl_syntax:atom_value(M), N1};
+ _ ->
+ throw(syntax_error)
+ end;
+ _ ->
+ throw(syntax_error)
+ end.
+
+%% =====================================================================
%% @spec analyze_wild_attribute(Node::syntaxTree()) -> {atom(), term()}
%%
%% @doc Returns the name and value of a "wild" attribute. The result is
@@ -1547,6 +1599,7 @@ analyze_wild_attribute(Node) ->
atom ->
case erl_syntax:attribute_arguments(Node) of
[V] ->
+ %% Note: does not work well with macros.
case catch {ok, erl_syntax:concrete(V)} of
{ok, Val} ->
{erl_syntax:atom_value(N), Val};
@@ -1568,17 +1621,22 @@ analyze_wild_attribute(Node) ->
%% @spec analyze_record_attribute(Node::syntaxTree()) ->
%% {atom(), Fields}
%%
-%% Fields = [{atom(), none | syntaxTree()}]
+%% Fields = [{atom(), {Default, Type}}]
+%% Default = none | syntaxTree()
+%% Type = none | syntaxTree()
%%
%% @doc Returns the name and the list of fields of a record declaration
%% attribute. The result is a pair `{Name, Fields}', if
%% `Node' represents "`-record(Name, {...}).'",
%% where `Fields' is a list of pairs `{Label,
-%% Default}' for each field "`Label'" or "`Label =
-%% <em>Default</em>'" in the declaration, listed in left-to-right
+%% {Default, Type}}' for each field "`Label'", "`Label =
+%% <em>Default</em>'", "`Label :: <em>Type</em>'", or
+%% "`Label = <em>Default</em> :: <em>Type</em>'" in the declaration,
+%% listed in left-to-right
%% order. If the field has no default-value declaration, the value for
-%% `Default' will be the atom `none'. We do not
-%% guarantee that each label occurs at most one in the list.
+%% `Default' will be the atom `none'. If the field has no type declaration,
+%% the value for `Type' will be the atom `none'. We do not
+%% guarantee that each label occurs at most once in the list.
%%
%% The evaluation throws `syntax_error' if
%% `Node' does not represent a well-formed record declaration
@@ -1587,7 +1645,9 @@ analyze_wild_attribute(Node) ->
%% @see analyze_attribute/1
%% @see analyze_record_field/1
--type fields() :: [{atom(), 'none' | erl_syntax:syntaxTree()}].
+-type field() :: {atom(), {field_default(), field_type()}}.
+
+-type fields() :: [field()].
-spec analyze_record_attribute(erl_syntax:syntaxTree()) -> {atom(), fields()}.
@@ -1625,7 +1685,7 @@ analyze_record_attribute_tuple(Node) ->
%% {atom(), Info} | atom()
%%
%% Info = {atom(), [{atom(), Value}]} | {atom(), atom()} | atom()
-%% Value = none | syntaxTree()
+%% Value = syntaxTree()
%%
%% @doc Returns the record name and field name/names of a record
%% expression. If `Node' has type `record_expr',
@@ -1645,9 +1705,9 @@ analyze_record_attribute_tuple(Node) ->
%%
%% For a `record_expr' node, `Info' represents
%% the record name and the list of descriptors for the involved fields,
-%% listed in the order they appear. (See
-%% `analyze_record_field/1' for details on the field
-%% descriptors). For a `record_access' node,
+%% listed in the order they appear. A field descriptor is a pair
+%% `{Label, Value}', if `Node' represents "`Label = <em>Value</em>'".
+%% For a `record_access' node,
%% `Info' represents the record name and the field name. For a
%% `record_index_expr' node, `Info' represents the
%% record name and the name field name.
@@ -1659,7 +1719,7 @@ analyze_record_attribute_tuple(Node) ->
%% @see analyze_record_attribute/1
%% @see analyze_record_field/1
--type info() :: {atom(), [{atom(), 'none' | erl_syntax:syntaxTree()}]}
+-type info() :: {atom(), [{atom(), erl_syntax:syntaxTree()}]}
| {atom(), atom()} | atom().
-spec analyze_record_expr(erl_syntax:syntaxTree()) -> {atom(), info()} | atom().
@@ -1670,8 +1730,9 @@ analyze_record_expr(Node) ->
A = erl_syntax:record_expr_type(Node),
case erl_syntax:type(A) of
atom ->
- Fs = [analyze_record_field(F)
- || F <- erl_syntax:record_expr_fields(Node)],
+ Fs0 = [analyze_record_field(F)
+ || F <- erl_syntax:record_expr_fields(Node)],
+ Fs = [{N, D} || {N, {D, _T}} <- Fs0],
{record_expr, {erl_syntax:atom_value(A), Fs}};
_ ->
throw(syntax_error)
@@ -1713,16 +1774,19 @@ analyze_record_expr(Node) ->
end.
%% =====================================================================
-%% @spec analyze_record_field(Node::syntaxTree()) -> {atom(), Value}
+%% @spec analyze_record_field(Node::syntaxTree()) -> {atom(), {Default, Type}}
%%
-%% Value = none | syntaxTree()
+%% Default = none | syntaxTree()
+%% Type = none | syntaxTree()
%%
-%% @doc Returns the label and value-expression of a record field
-%% specifier. The result is a pair `{Label, Value}', if
-%% `Node' represents "`Label = <em>Value</em>'" or
-%% "`Label'", where in the first case, `Value' is
-%% a syntax tree, and in the second case `Value' is
-%% `none'.
+%% @doc Returns the label, value-expression, and type of a record field
+%% specifier. The result is a pair `{Label, {Default, Type}}', if
+%% `Node' represents "`Label'", "`Label = <em>Default</em>'",
+%% "`Label :: <em>Type</em>'", or
+%% "`Label = <em>Default</em> :: <em>Type</em>'".
+%% If the field has no value-expression, the value for
+%% `Default' will be the atom `none'. If the field has no type,
+%% the value for `Type' will be the atom `none'.
%%
%% The evaluation throws `syntax_error' if
%% `Node' does not represent a well-formed record field
@@ -1731,8 +1795,7 @@ analyze_record_expr(Node) ->
%% @see analyze_record_attribute/1
%% @see analyze_record_expr/1
--spec analyze_record_field(erl_syntax:syntaxTree()) ->
- {atom(), 'none' | erl_syntax:syntaxTree()}.
+-spec analyze_record_field(erl_syntax:syntaxTree()) -> field().
analyze_record_field(Node) ->
case erl_syntax:type(Node) of
@@ -1741,10 +1804,15 @@ analyze_record_field(Node) ->
case erl_syntax:type(A) of
atom ->
T = erl_syntax:record_field_value(Node),
- {erl_syntax:atom_value(A), T};
+ {erl_syntax:atom_value(A), {T, none}};
_ ->
throw(syntax_error)
end;
+ typed_record_field ->
+ F = erl_syntax:typed_record_field_body(Node),
+ {N, {V, _none}} = analyze_record_field(F),
+ T = erl_syntax:typed_record_field_type(Node),
+ {N, {V, T}};
_ ->
throw(syntax_error)
end.
@@ -1887,6 +1955,55 @@ analyze_application(Node) ->
%% =====================================================================
+%% @spec analyze_type_application(Node::syntaxTree()) -> typeName()
+%%
+%% TypeName = {atom(), integer()}
+%% | {ModuleName, {atom(), integer()}}
+%% ModuleName = atom()
+%%
+%% @doc Returns the name of a used type. The result is a
+%% representation of the name of the used pre-defined or local type `N/A',
+%% if `Node' represents a local (user) type application
+%% "`<em>N</em>(<em>T_1</em>, ..., <em>T_A</em>)'", or
+%% a representation of the name of the used remote type `M:N/A'
+%% if `Node' represents a remote user type application
+%% "`<em>M</em>:<em>N</em>(<em>T_1</em>, ..., <em>T_A</em>)'".
+%%
+%% The evaluation throws `syntax_error' if `Node' does not represent a
+%% well-formed (user) type application expression.
+%%
+%% @see analyze_type_name/1
+
+-type typeName() :: atom() | {module(), atom(), arity()} | {atom(), arity()}.
+
+-spec analyze_type_application(erl_syntax:syntaxTree()) -> typeName().
+
+analyze_type_application(Node) ->
+ case erl_syntax:type(Node) of
+ type_application ->
+ A = length(erl_syntax:type_application_arguments(Node)),
+ N = erl_syntax:type_application_name(Node),
+ case catch {ok, analyze_type_name(N)} of
+ {ok, TypeName} ->
+ append_arity(A, TypeName);
+ _ ->
+ throw(syntax_error)
+ end;
+ user_type_application ->
+ A = length(erl_syntax:user_type_application_arguments(Node)),
+ N = erl_syntax:user_type_application_name(Node),
+ case catch {ok, analyze_type_name(N)} of
+ {ok, TypeName} ->
+ append_arity(A, TypeName);
+ _ ->
+ throw(syntax_error)
+ end;
+ _ ->
+ throw(syntax_error)
+ end.
+
+
+%% =====================================================================
%% @spec function_name_expansions(Names::[Name]) -> [{ShortName, Name}]
%%
%% Name = ShortName | {atom(), Name}
diff --git a/lib/syntax_tools/src/igor.erl b/lib/syntax_tools/src/igor.erl
index 4557678f9d..1d14bd7c3a 100644
--- a/lib/syntax_tools/src/igor.erl
+++ b/lib/syntax_tools/src/igor.erl
@@ -2612,6 +2612,19 @@ get_module_info(Forms) ->
fold_record_fields(Rs) ->
[{N, [fold_record_field(F) || F <- Fs]} || {N, Fs} <- Rs].
+fold_record_field({_Name, {none, _Type}} = None) ->
+ None;
+fold_record_field({Name, {F, Type}}) ->
+ case erl_syntax:is_literal(F) of
+ true ->
+ {Name, {value, erl_syntax:concrete(F)}, Type};
+ false ->
+ %% The default value for the field is not a constant, so we
+ %% represent it by a hash value instead. (We don't want to
+ %% do this in the general case.)
+ {Name, {hash, erlang:phash(F, 16#ffffff)}, Type}
+ end;
+%% The following two clauses handle code before Erlang/OTP 19.0.
fold_record_field({_Name, none} = None) ->
None;
fold_record_field({Name, F}) ->
diff --git a/lib/syntax_tools/src/syntax_tools.app.src b/lib/syntax_tools/src/syntax_tools.app.src
index dd4ac46055..5c6008a5f0 100644
--- a/lib/syntax_tools/src/syntax_tools.app.src
+++ b/lib/syntax_tools/src/syntax_tools.app.src
@@ -18,4 +18,4 @@
{applications, [stdlib]},
{env, []},
{runtime_dependencies,
- ["compiler-6.0","erts-6.0","kernel-3.0","stdlib-2.5"]}]}.
+ ["compiler-7.0","erts-8.0","kernel-5.0","stdlib-3.0"]}]}.
diff --git a/lib/syntax_tools/src/syntax_tools.appup.src b/lib/syntax_tools/src/syntax_tools.appup.src
index 59d591a01f..0dad228ca3 100644
--- a/lib/syntax_tools/src/syntax_tools.appup.src
+++ b/lib/syntax_tools/src/syntax_tools.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/syntax_tools/test/syntax_tools_SUITE.erl b/lib/syntax_tools/test/syntax_tools_SUITE.erl
index eb52cce6af..b935d42bb7 100644
--- a/lib/syntax_tools/test/syntax_tools_SUITE.erl
+++ b/lib/syntax_tools/test/syntax_tools_SUITE.erl
@@ -61,7 +61,7 @@ appup_test(Config) when is_list(Config) ->
smoke_test(Config) when is_list(Config) ->
Dog = ?t:timetrap(?t:minutes(12)),
Wc = filename:join([code:lib_dir(),"*","src","*.erl"]),
- Fs = filelib:wildcard(Wc),
+ Fs = filelib:wildcard(Wc) ++ test_files(Config),
io:format("~p files\n", [length(Fs)]),
case p_run(fun smoke_test_file/1, Fs) of
0 -> ok;
@@ -93,7 +93,7 @@ print_error_markers(F, File) ->
revert(Config) when is_list(Config) ->
Dog = ?t:timetrap(?t:minutes(12)),
Wc = filename:join([code:lib_dir("stdlib"),"src","*.erl"]),
- Fs = filelib:wildcard(Wc),
+ Fs = filelib:wildcard(Wc) ++ test_files(Config),
Path = [filename:join(code:lib_dir(stdlib), "include"),
filename:join(code:lib_dir(kernel), "include")],
io:format("~p files\n", [length(Fs)]),
@@ -203,18 +203,25 @@ t_erl_parse_type(Config) when is_list(Config) ->
t_epp_dodger(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
PrivDir = ?config(priv_dir, Config),
- Filenames = ["syntax_tools_SUITE_test_module.erl",
- "syntax_tools_test.erl"],
+ Filenames = test_files(),
ok = test_epp_dodger(Filenames,DataDir,PrivDir),
ok.
t_comment_scan(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
- Filenames = ["syntax_tools_SUITE_test_module.erl",
- "syntax_tools_test.erl"],
+ Filenames = test_files(),
ok = test_comment_scan(Filenames,DataDir),
ok.
+test_files(Config) ->
+ DataDir = ?config(data_dir, Config),
+ [ filename:join(DataDir,Filename) || Filename <- test_files() ].
+
+test_files() ->
+ ["syntax_tools_SUITE_test_module.erl",
+ "syntax_tools_test.erl",
+ "type_specs.erl"].
+
t_igor(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
PrivDir = ?config(priv_dir, Config),
@@ -222,6 +229,12 @@ t_igor(Config) when is_list(Config) ->
FileM2 = filename:join(DataDir,"m2.erl"),
["m.erl",_]=R = igor:merge(m,[FileM1,FileM2],[{outdir,PrivDir}]),
io:format("igor:merge/3 = ~p~n", [R]),
+
+ FileTypeSpecs = filename:join(DataDir,"igor_type_specs.erl"),
+ Empty = filename:join(DataDir,"empty.erl"),
+ ["n.erl",_]=R2 = igor:merge(n,[FileTypeSpecs,Empty],[{outdir,PrivDir}]),
+ io:format("igor:merge/3 = ~p~n", [R2]),
+
ok.
test_comment_scan([],_) -> ok;
diff --git a/lib/syntax_tools/test/syntax_tools_SUITE_data/empty.erl b/lib/syntax_tools/test/syntax_tools_SUITE_data/empty.erl
new file mode 100644
index 0000000000..877ff66013
--- /dev/null
+++ b/lib/syntax_tools/test/syntax_tools_SUITE_data/empty.erl
@@ -0,0 +1 @@
+-module(empty).
diff --git a/lib/syntax_tools/test/syntax_tools_SUITE_data/igor_type_specs.erl b/lib/syntax_tools/test/syntax_tools_SUITE_data/igor_type_specs.erl
new file mode 100644
index 0000000000..5a156c7fa3
--- /dev/null
+++ b/lib/syntax_tools/test/syntax_tools_SUITE_data/igor_type_specs.erl
@@ -0,0 +1,80 @@
+%% Same as ./type_specs.erl, but without macros.
+-module(igor_type_specs).
+
+-include_lib("syntax_tools/include/merl.hrl").
+
+-export([f/1, b/0, c/2]).
+
+-export_type([t/0, ot/2, ff2/0]).
+
+-type aa() :: _.
+
+-type t() :: integer().
+
+-type ff(A) :: ot(A, A) | tuple() | 1..3 | map() | {}.
+-type ff1() :: ff(bin()) | foo:bar().
+-type ff2() :: {list(), [_], list(integer()),
+ nonempty_list(), nonempty_list(atom()), [ff1(), ...],
+ nil(), []}.
+-type bin() :: <<>>
+ | <<_:(+4)>>
+ | <<_:_*8>>
+ | <<_:12, _:_*16>>
+ | <<_:16, _:_*(0)>> % same as "<<_:16>>"
+ | <<_:16, _:_*(+0)>>.
+
+-callback cb() -> t().
+
+-optional_callbacks([cb/0]).
+
+-opaque ot(A, B) :: {A, B}.
+
+-type f1() :: fun().
+-type f2() :: fun((...) -> t()).
+-type f3() :: fun(() -> t()).
+-type f4() :: fun((t(), t()) -> t()).
+
+-wild(attribute).
+
+-record(par, {a :: undefined | igor_type_specs}).
+
+-record(r0, {}).
+
+-record(r,
+ {f1 :: integer(),
+ f2 = a :: atom(),
+ f3 :: fun(),
+ f4 = 7}).
+
+-type r0() :: #r0{} | #r{f1 :: 3} | #r{f1 :: 3, f2 :: 'sju'}.
+
+-type m1() :: #{}.
+-type m2() :: #{a => m1(), b => #{} | fy:m2()}.
+-type b1() :: B1 :: binary() | (BitString :: bitstring()).
+
+-define(PAIR(A, B), {(A), (B)}).
+
+-spec igor_type_specs:f({r0(), r0()}) -> {t(), t()}.
+
+f({R, R}) ->
+ _ = "igor_type_specs" ++ "hej",
+ _ = <<"foo">>,
+ _ = R#r.f1,
+ _ = R#r{f1 = 17, f2 = b},
+ {1, 1}.
+
+-spec igor_type_specs:b() -> integer() | fun().
+
+b() ->
+ case foo:bar() of
+ #{a := 2} -> 19
+ end.
+
+-spec c(Atom :: atom(), Integer :: integer()) -> {atom(), integer()};
+ (X, Y) -> {atom(), float()} when X :: atom(),
+ is_subtype(Y, float());
+ (integer(), atom()) -> {integer(), atom()}.
+
+c(A, B) ->
+ _ = integer,
+ {A, B}.
diff --git a/lib/syntax_tools/test/syntax_tools_SUITE_data/type_specs.erl b/lib/syntax_tools/test/syntax_tools_SUITE_data/type_specs.erl
new file mode 100644
index 0000000000..5621d3a293
--- /dev/null
+++ b/lib/syntax_tools/test/syntax_tools_SUITE_data/type_specs.erl
@@ -0,0 +1,84 @@
+-module(type_specs).
+
+-include_lib("syntax_tools/include/merl.hrl").
+
+-export([f/1, b/0, c/2]).
+
+-export_type([t/0, ot/2, ff2/0]).
+
+-type aa() :: _.
+
+-type t() :: integer().
+
+-type ff(A) :: ot(A, A) | tuple() | 1..3 | map() | {}.
+-type ff1() :: ff(bin()) | foo:bar().
+-type ff2() :: {list(), [_], list(integer()),
+ nonempty_list(), nonempty_list(atom()), [ff1(), ...],
+ nil(), []}.
+-type bin() :: <<>>
+ | <<_:(+4)>>
+ | <<_:_*8>>
+ | <<_:12, _:_*16>>
+ | <<_:16, _:_*(0)>> % same as "<<_:16>>"
+ | <<_:16, _:_*(+0)>>.
+
+-callback cb() -> t().
+
+-optional_callbacks([cb/0]).
+
+-opaque ot(A, B) :: {A, B}.
+
+-type f1() :: fun().
+-type f2() :: fun((...) -> t()).
+-type f3() :: fun(() -> t()).
+-type f4() :: fun((t(), t()) -> t()).
+
+-wild(attribute).
+
+-record(par, {a :: undefined | ?MODULE}).
+
+-record(r0, {}).
+
+-record(r,
+ {f1 :: integer(),
+ f2 = a :: atom(),
+ f3 :: fun(),
+ f4 = 7}).
+
+-type r0() :: #r0{} | #r{f1 :: 3} | #r{f1 :: 3, f2 :: 'sju'}.
+
+-type m1() :: #{} | map().
+-type m2() :: #{a := m1(), b => #{} | fy:m2()}.
+-type m3() :: #{...}.
+-type m4() :: #{_ => _, ...}.
+-type m5() :: #{any() => any(), ...}. % Currently printed as `#{..., ...}'.
+-type b1() :: B1 :: binary() | (BitString :: bitstring()).
+
+-define(PAIR(A, B), {(A), (B)}).
+
+-spec ?MODULE:f(?PAIR(r0(), r0())) -> ?PAIR(t(), t()).
+
+f({R, R}) ->
+ _ = ?MODULE_STRING ++ "hej",
+ _ = <<"foo">>,
+ _ = R#r.f1,
+ _ = R#r{f1 = 17, f2 = b},
+ {1, 1}.
+
+-spec ?MODULE:b() -> integer() | fun().
+
+b() ->
+ case foo:bar() of
+ #{a := 2} -> 19
+ end.
+
+-define(I, integer).
+
+-spec c(Atom :: atom(), Integer :: ?I()) -> {atom(), integer()};
+ (X, Y) -> {atom(), float()} when X :: atom(),
+ is_subtype(Y, float());
+ (integer(), atom()) -> {integer(), atom()}.
+
+c(A, B) ->
+ _ = ?I,
+ {A, B}.
diff --git a/lib/tools/Makefile b/lib/tools/Makefile
index fef33743c0..e17e9cfd1e 100644
--- a/lib/tools/Makefile
+++ b/lib/tools/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/tools/c_src/Makefile.in b/lib/tools/c_src/Makefile.in
index e8bce149b1..cfe91917f8 100644
--- a/lib/tools/c_src/Makefile.in
+++ b/lib/tools/c_src/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/tools/c_src/erl_memory.c b/lib/tools/c_src/erl_memory.c
index d3a96884db..13a3fccc6d 100644
--- a/lib/tools/c_src/erl_memory.c
+++ b/lib/tools/c_src/erl_memory.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/tools/doc/src/Makefile b/lib/tools/doc/src/Makefile
index c44c9ef4df..d9c3b0ad2a 100644
--- a/lib/tools/doc/src/Makefile
+++ b/lib/tools/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/tools/doc/src/book.xml b/lib/tools/doc/src/book.xml
index 03afa1fc37..38d0408156 100644
--- a/lib/tools/doc/src/book.xml
+++ b/lib/tools/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/cover_chapter.xml b/lib/tools/doc/src/cover_chapter.xml
index c3f1570477..3847adbe59 100644
--- a/lib/tools/doc/src/cover_chapter.xml
+++ b/lib/tools/doc/src/cover_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/cprof.xml b/lib/tools/doc/src/cprof.xml
index d3be276d28..df0acbe617 100644
--- a/lib/tools/doc/src/cprof.xml
+++ b/lib/tools/doc/src/cprof.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2002</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/cprof_chapter.xml b/lib/tools/doc/src/cprof_chapter.xml
index 0e83dbbfb5..ba1e7432fd 100644
--- a/lib/tools/doc/src/cprof_chapter.xml
+++ b/lib/tools/doc/src/cprof_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/eprof.xml b/lib/tools/doc/src/eprof.xml
index 8e37d49c99..f098b7d39e 100644
--- a/lib/tools/doc/src/eprof.xml
+++ b/lib/tools/doc/src/eprof.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/erlang_mode.xml b/lib/tools/doc/src/erlang_mode.xml
index 4ecb8feadd..00cf5196b4 100644
--- a/lib/tools/doc/src/erlang_mode.xml
+++ b/lib/tools/doc/src/erlang_mode.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -252,6 +252,7 @@
behavior</item>
<item>gen_event - skeleton for the OTP gen_event behavior</item>
<item>gen_fsm - skeleton for the OTP gen_fsm behavior</item>
+ <item>gen_statem - skeleton for the OTP gen_statem behavior</item>
<item>Library module - skeleton for a module that does not
implement a process.</item>
<item>Corba callback - skeleton for a Corba callback module.</item>
diff --git a/lib/tools/doc/src/erlang_mode_chapter.xml b/lib/tools/doc/src/erlang_mode_chapter.xml
index e07e7a8176..b4e30d883b 100644
--- a/lib/tools/doc/src/erlang_mode_chapter.xml
+++ b/lib/tools/doc/src/erlang_mode_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/fprof.xml b/lib/tools/doc/src/fprof.xml
index 2dfc77fdfc..4c9e48045e 100644
--- a/lib/tools/doc/src/fprof.xml
+++ b/lib/tools/doc/src/fprof.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/fprof_chapter.xml b/lib/tools/doc/src/fprof_chapter.xml
index ecd8f385a5..5a2a5ad47c 100644
--- a/lib/tools/doc/src/fprof_chapter.xml
+++ b/lib/tools/doc/src/fprof_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/instrument.xml b/lib/tools/doc/src/instrument.xml
index 76583cd03b..bb6f9b6100 100644
--- a/lib/tools/doc/src/instrument.xml
+++ b/lib/tools/doc/src/instrument.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/lcnt.xml b/lib/tools/doc/src/lcnt.xml
index c381488f85..9c8ce148e9 100644
--- a/lib/tools/doc/src/lcnt.xml
+++ b/lib/tools/doc/src/lcnt.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2009</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/lcnt_chapter.xml b/lib/tools/doc/src/lcnt_chapter.xml
index 060559c954..6cfdb5cf1b 100644
--- a/lib/tools/doc/src/lcnt_chapter.xml
+++ b/lib/tools/doc/src/lcnt_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2009</year><year>2013</year>
+ <year>2009</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/make.xml b/lib/tools/doc/src/make.xml
index 5c2e5e5d62..fddf5ebd7b 100644
--- a/lib/tools/doc/src/make.xml
+++ b/lib/tools/doc/src/make.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1996</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/notes.xml b/lib/tools/doc/src/notes.xml
index c62b0607ee..3a6ac37eef 100644
--- a/lib/tools/doc/src/notes.xml
+++ b/lib/tools/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/notes_history.xml b/lib/tools/doc/src/notes_history.xml
index d19aac4d4e..d955cbde69 100644
--- a/lib/tools/doc/src/notes_history.xml
+++ b/lib/tools/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/part.xml b/lib/tools/doc/src/part.xml
index b96586041a..796047fe8d 100644
--- a/lib/tools/doc/src/part.xml
+++ b/lib/tools/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/part_notes.xml b/lib/tools/doc/src/part_notes.xml
index c990e973a2..c4c6fa4d7d 100644
--- a/lib/tools/doc/src/part_notes.xml
+++ b/lib/tools/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/part_notes_history.xml b/lib/tools/doc/src/part_notes_history.xml
index dd9c27e872..a34e35fc56 100644
--- a/lib/tools/doc/src/part_notes_history.xml
+++ b/lib/tools/doc/src/part_notes_history.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2006</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/ref_man.xml b/lib/tools/doc/src/ref_man.xml
index 2d9ca7660a..d2131e7a93 100644
--- a/lib/tools/doc/src/ref_man.xml
+++ b/lib/tools/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/tags.xml b/lib/tools/doc/src/tags.xml
index b089f0674b..ea0ae5cc4d 100644
--- a/lib/tools/doc/src/tags.xml
+++ b/lib/tools/doc/src/tags.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1998</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/xref.xml b/lib/tools/doc/src/xref.xml
index ebf9139f06..8c49f3a206 100644
--- a/lib/tools/doc/src/xref.xml
+++ b/lib/tools/doc/src/xref.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/doc/src/xref_chapter.xml b/lib/tools/doc/src/xref_chapter.xml
index e7186b9209..8b14e03064 100644
--- a/lib/tools/doc/src/xref_chapter.xml
+++ b/lib/tools/doc/src/xref_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/tools/emacs/erlang-eunit.el b/lib/tools/emacs/erlang-eunit.el
index a3c29c520c..3b85e6680a 100644
--- a/lib/tools/emacs/erlang-eunit.el
+++ b/lib/tools/emacs/erlang-eunit.el
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2009-2010. All Rights Reserved.
+;; Copyright Ericsson AB 2009-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
diff --git a/lib/tools/emacs/erlang-skels-old.el b/lib/tools/emacs/erlang-skels-old.el
index d0b2bfd97f..4087bc3013 100644
--- a/lib/tools/emacs/erlang-skels-old.el
+++ b/lib/tools/emacs/erlang-skels-old.el
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2010. All Rights Reserved.
+;; Copyright Ericsson AB 2010-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
diff --git a/lib/tools/emacs/erlang-skels.el b/lib/tools/emacs/erlang-skels.el
index ac37ff2ee5..ce26c83295 100644
--- a/lib/tools/emacs/erlang-skels.el
+++ b/lib/tools/emacs/erlang-skels.el
@@ -1,7 +1,7 @@
;;
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 2010-2014. All Rights Reserved.
+;; Copyright Ericsson AB 2010-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
@@ -56,6 +56,8 @@
erlang-skel-gen-event erlang-skel-header)
("gen_fsm" "gen-fsm"
erlang-skel-gen-fsm erlang-skel-header)
+ ("gen_statem" "gen-statem"
+ erlang-skel-gen-statem erlang-skel-header)
("wx_object" "wx-object"
erlang-skel-wx-object erlang-skel-header)
("Library module" "gen-lib"
@@ -858,6 +860,122 @@ Please see the function `tempo-define-template'.")
"*The template of a gen_fsm.
Please see the function `tempo-define-template'.")
+(defvar erlang-skel-gen-statem
+ '((erlang-skel-include erlang-skel-large-header)
+ "-behaviour(gen_statem)." n n
+
+ "%% API" n
+ "-export([start_link/0])." n
+ n
+ "%% gen_statem callbacks" n
+ "-export([init/1, terminate/3, code_change/4])." n
+ "-export([state_name/3])." n
+ "-export([handle_event/4])." n
+ n
+ "-define(SERVER, ?MODULE)." n
+ n
+ "-record(data, {})." n
+ n
+ (erlang-skel-double-separator-start 3)
+ "%%% API" n
+ (erlang-skel-double-separator-end 3) n
+ (erlang-skel-separator-start 2)
+ "%% @doc" n
+ "%% Creates a gen_statem process which calls Module:init/1 to" n
+ "%% initialize. To ensure a synchronized start-up procedure, this" n
+ "%% function does not return until Module:init/1 has returned." n
+ "%%" n
+ (erlang-skel-separator-end 2)
+ "-spec start_link() ->" n>
+ "{ok, Pid :: pid()} |" n>
+ "ignore |" n>
+ "{error, Error :: term()}." n
+ "start_link() ->" n>
+ "gen_statem:start_link({local, ?SERVER}, ?MODULE, [], [])." n
+ n
+ (erlang-skel-double-separator-start 3)
+ "%%% gen_statem callbacks" n
+ (erlang-skel-double-separator-end 3) n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Whenever a gen_statem is started using gen_statem:start/[3,4] or" n
+ "%% gen_statem:start_link/[3,4], this function is called by the new" n
+ "%% process to initialize." n
+ (erlang-skel-separator-end 2)
+ "-spec init(Args :: term()) -> " n>
+ "{gen_statem:callback_mode()," n>
+ "State :: term(), Data :: term()} |" n>
+ "{gen_statem:callback_mode()," n>
+ "State :: term(), Data :: term()," n>
+ "[gen_statem:action()] | gen_statem:action()} |" n>
+ "ignore |" n>
+ "{stop, Reason :: term()}." n
+ "init([]) ->" n>
+ "{state_functions, state_name, #data{}}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% If the gen_statem runs with CallbackMode =:= state_functions" n
+ "%% there should be one instance of this function for each possible" n
+ "%% state name. Whenever a gen_statem receives an event," n
+ "%% the instance of this function with the same name" n
+ "%% as the current state name StateName is called to" n
+ "%% handle the event." n
+ (erlang-skel-separator-end 2)
+ "-spec state_name(" n>
+ "gen_statem:event_type(), Msg :: term()," n>
+ "Data :: term()) ->" n>
+ "gen_statem:state_function_result(). " n
+ "state_name({call,Caller}, _Msg, Data) ->" n>
+ "{next_state, state_name, Data, [{reply,Caller,ok}]}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% If the gen_statem runs with CallbackMode =:= handle_event_function" n
+ "%% this function is called for every event a gen_statem receives." n
+ (erlang-skel-separator-end 2)
+ "-spec handle_event(" n>
+ "gen_statem:event_type(), Msg :: term()," n>
+ "State :: term(), Data :: term()) ->" n>
+ "gen_statem:handle_event_result(). " n
+ "handle_event({call,From}, _Msg, State, Data) ->" n>
+ "{next_state, State, Data, [{reply,From,ok}]}." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% This function is called by a gen_statem when it is about to" n
+ "%% terminate. It should be the opposite of Module:init/1 and do any" n
+ "%% necessary cleaning up. When it returns, the gen_statem terminates with" n
+ "%% Reason. The return value is ignored." n
+ (erlang-skel-separator-end 2)
+ "-spec terminate(Reason :: term(), State :: term(), Data :: term()) ->" n>
+ "any()." n
+ "terminate(_Reason, _State, _Data) ->" n>
+ "void." n
+ n
+ (erlang-skel-separator-start 2)
+ "%% @private" n
+ "%% @doc" n
+ "%% Convert process state when code is changed" n
+ (erlang-skel-separator-end 2)
+ "-spec code_change(" n>
+ "OldVsn :: term() | {down,term()}," n>
+ "State :: term(), Data :: term(), Extra :: term()) ->" n>
+ "{ok, NewState :: term(), NewData :: term()}." n
+ "code_change(_OldVsn, State, Data, _Extra) ->" n>
+ "{ok, State, Data}." n
+ n
+ (erlang-skel-double-separator-start 3)
+ "%%% Internal functions" n
+ (erlang-skel-double-separator-end 3)
+ )
+ "*The template of a gen_statem.
+Please see the function `tempo-define-template'.")
+
(defvar erlang-skel-wx-object
'((erlang-skel-include erlang-skel-large-header)
"-behaviour(wx_object)." n n
diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el
index 2ff14dea02..0a3fc0ddff 100644
--- a/lib/tools/emacs/erlang.el
+++ b/lib/tools/emacs/erlang.el
@@ -7,7 +7,7 @@
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 1996-2014. All Rights Reserved.
+;; Copyright Ericsson AB 1996-2016. All Rights Reserved.
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
@@ -1345,7 +1345,7 @@ Lock syntax table. The effect is that `apply' in the atom
;;;###autoload
-(defun erlang-mode ()
+(define-derived-mode erlang-mode prog-mode "Erlang"
"Major mode for editing Erlang source files in Emacs.
It knows about syntax and comment, it can indent code, it is capable
of fontifying the source file, the TAGS commands are aware of Erlang
@@ -1404,12 +1404,9 @@ and examples of hooks.
Other commands:
\\{erlang-mode-map}"
- (interactive)
- (kill-all-local-variables)
- (setq major-mode 'erlang-mode)
- (setq mode-name "Erlang")
+ ;; Use our own syntax table function
+ :syntax-table nil
(erlang-syntax-table-init)
- (use-local-map erlang-mode-map)
(erlang-electric-init)
(erlang-menu-init)
(erlang-mode-variables)
@@ -1419,12 +1416,8 @@ Other commands:
(erlang-font-lock-init)
(erlang-skel-init)
(tempo-use-tag-list 'erlang-tempo-tags)
- (run-hooks 'erlang-mode-hook)
(if (zerop (buffer-size))
- (run-hooks 'erlang-new-file-hook))
- ;; Doesn't exist in Emacs v21.4; required by Emacs v23.
- (if (boundp 'after-change-major-mode-hook)
- (run-hooks 'after-change-major-mode-hook)))
+ (run-hooks 'erlang-new-file-hook)))
;;;###autoload
(dolist (r '("\\.erl$" "\\.app\\.src$" "\\.escript"
diff --git a/lib/tools/emacs/test.erl.indented b/lib/tools/emacs/test.erl.indented
index 1986acadf1..6913068133 100644
--- a/lib/tools/emacs/test.erl.indented
+++ b/lib/tools/emacs/test.erl.indented
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/tools/emacs/test.erl.orig b/lib/tools/emacs/test.erl.orig
index 7e8ad23412..621948cbe1 100644
--- a/lib/tools/emacs/test.erl.orig
+++ b/lib/tools/emacs/test.erl.orig
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/tools/src/Makefile b/lib/tools/src/Makefile
index 7301ff856a..032bd612db 100644
--- a/lib/tools/src/Makefile
+++ b/lib/tools/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2013. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl
index 87de31919f..69331732bf 100644
--- a/lib/tools/src/cover.erl
+++ b/lib/tools/src/cover.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/tools/src/eprof.erl b/lib/tools/src/eprof.erl
index 0357e46a50..07e995993b 100644
--- a/lib/tools/src/eprof.erl
+++ b/lib/tools/src/eprof.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/tools/src/fprof.erl b/lib/tools/src/fprof.erl
index c5c24c8eb3..b21eedc625 100644
--- a/lib/tools/src/fprof.erl
+++ b/lib/tools/src/fprof.erl
@@ -1567,13 +1567,20 @@ trace_handler({trace_ts, Pid, return_to, {_M, _F, Args} = MFArgs, TS} = Trace,
trace_return_to(Table, Pid, Func, TS),
TS;
%%
-%% spawn
+%% spawn, only needed (and reliable) prior to 19.0
trace_handler({trace_ts, Pid, spawn, Child, MFArgs, TS} = Trace,
Table, _, Dump) ->
dump_stack(Dump, get(Pid), Trace),
trace_spawn(Table, Child, MFArgs, TS, Pid),
TS;
%%
+%% spawned, added in 19.0
+trace_handler({trace_ts, Pid, spawned, Parent, MFArgs, TS} = Trace,
+ Table, _, Dump) ->
+ dump_stack(Dump, get(Pid), Trace),
+ trace_spawn(Table, Pid, MFArgs, TS, Parent),
+ TS;
+%%
%% exit
trace_handler({trace_ts, Pid, exit, _Reason, TS} = Trace,
Table, _, Dump) ->
@@ -1622,15 +1629,24 @@ trace_handler({trace_ts, Pid, in, {_M, _F, Args} = MFArgs, TS} = Trace,
TS;
%%
%% gc_start
-trace_handler({trace_ts, Pid, gc_start, _Func, TS} = Trace,
- Table, _, Dump) ->
+trace_handler({trace_ts, Pid, gc_minor_start, _Func, TS} = Trace, Table, _, Dump) ->
+ dump_stack(Dump, get(Pid), Trace),
+ trace_gc_start(Table, Pid, TS),
+ TS;
+
+trace_handler({trace_ts, Pid, gc_major_start, _Func, TS} = Trace, Table, _, Dump) ->
dump_stack(Dump, get(Pid), Trace),
trace_gc_start(Table, Pid, TS),
TS;
+
%%
%% gc_end
-trace_handler({trace_ts, Pid, gc_end, _Func, TS} = Trace,
- Table, _, Dump) ->
+trace_handler({trace_ts, Pid, gc_minor_end, _Func, TS} = Trace, Table, _, Dump) ->
+ dump_stack(Dump, get(Pid), Trace),
+ trace_gc_end(Table, Pid, TS),
+ TS;
+
+trace_handler({trace_ts, Pid, gc_major_end, _Func, TS} = Trace, Table, _, Dump) ->
dump_stack(Dump, get(Pid), Trace),
trace_gc_end(Table, Pid, TS),
TS;
@@ -2014,8 +2030,10 @@ trace_spawn(Table, Pid, MFArgs, TS, Parent) ->
ets:insert(Table, #proc{id = Pid, parent = Parent,
spawned_as = MFArgs});
_ ->
- throw({inconsistent_trace_data, ?MODULE, ?LINE,
- [Pid, MFArgs, TS, Parent, Stack]})
+ %% In 19.0 we get both a spawn and spawned event,
+ %% however we do not know the order so we just ignore
+ %% the second event that comes
+ ok
end.
diff --git a/lib/tools/src/instrument.erl b/lib/tools/src/instrument.erl
index 34c5ba04cc..055f4a7afb 100644
--- a/lib/tools/src/instrument.erl
+++ b/lib/tools/src/instrument.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/tools/src/lcnt.erl b/lib/tools/src/lcnt.erl
index d552d5b46e..78407a651a 100644
--- a/lib/tools/src/lcnt.erl
+++ b/lib/tools/src/lcnt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/tools/src/tools.appup.src b/lib/tools/src/tools.appup.src
index 9eee8df184..fa48fa4219 100644
--- a/lib/tools/src/tools.appup.src
+++ b/lib/tools/src/tools.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/tools/src/xref.erl b/lib/tools/src/xref.erl
index 64add7afbb..32efa36fa2 100644
--- a/lib/tools/src/xref.erl
+++ b/lib/tools/src/xref.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/tools/src/xref_base.erl b/lib/tools/src/xref_base.erl
index 88031f6e77..70eb107781 100644
--- a/lib/tools/src/xref_base.erl
+++ b/lib/tools/src/xref_base.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/tools/src/xref_parser.yrl b/lib/tools/src/xref_parser.yrl
index 48602bb120..0711da79e2 100644
--- a/lib/tools/src/xref_parser.yrl
+++ b/lib/tools/src/xref_parser.yrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/tools/test/Makefile b/lib/tools/test/Makefile
index 8768413dc1..84c4e56aff 100644
--- a/lib/tools/test/Makefile
+++ b/lib/tools/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl
index d4b346c407..b4c9264b30 100644
--- a/lib/tools/test/cover_SUITE.erl
+++ b/lib/tools/test/cover_SUITE.erl
@@ -23,51 +23,43 @@
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]}].
all() ->
NoStartStop = [eif,otp_5305,otp_5418,otp_7095,otp_8273,
otp_8340,otp_8188,compile_beam_opts,eep37,
- analyse_no_beam, line_0, compile_beam_no_file,
+ analyse_no_beam, line_0, compile_beam_no_file,
otp_13277, otp_13289],
StartStop = [start, compile, analyse, misc, stop,
- distribution, reconnect, die_and_reconnect,
- dont_reconnect_after_stop, stop_node_after_disconnect,
- export_import, otp_5031, otp_6115,
- otp_8270, otp_10979_hanging_node],
+ distribution, reconnect, die_and_reconnect,
+ dont_reconnect_after_stop, stop_node_after_disconnect,
+ export_import, otp_5031, otp_6115,
+ otp_8270, otp_10979_hanging_node],
case whereis(cover_server) of
- undefined ->
- [coverage,StartStop ++ NoStartStop];
- _pid ->
- [coverage|NoStartStop++[coverage_analysis]]
+ undefined ->
+ [coverage,StartStop ++ NoStartStop];
+ _pid ->
+ [coverage|NoStartStop++[coverage_analysis]]
end.
-groups() ->
- [].
-
init_per_suite(Config) ->
[{ct_is_running_cover,whereis(cover_server) =/= undefined}|Config].
end_per_suite(_Config) ->
ok.
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
init_per_testcase(TC, Config) when TC =:= misc;
- TC =:= compile;
- TC =:= analyse;
- TC =:= distribution;
- TC =:= otp_5031;
- TC =:= stop ->
+ TC =:= compile;
+ TC =:= analyse;
+ TC =:= distribution;
+ TC =:= otp_5031;
+ TC =:= stop ->
case code:which(crypto) of
- Path when is_list(Path) ->
- init_per_testcase(dummy_tc, Config);
- _Else ->
- {skip, "No crypto file to test with"}
+ Path when is_list(Path) ->
+ init_per_testcase(dummy_tc, Config);
+ _Else ->
+ {skip, "No crypto file to test with"}
end;
init_per_testcase(_TestCase, Config) ->
Config.
@@ -75,10 +67,10 @@ init_per_testcase(_TestCase, Config) ->
end_per_testcase(TestCase, Config) ->
NoStop = [start,compile,analyse,misc],
DontStop = proplists:get_bool(ct_is_running_cover, Config) orelse
- lists:member(TestCase, NoStop),
+ lists:member(TestCase, NoStop),
case DontStop of
- true -> ok;
- false -> cover:stop()
+ true -> ok;
+ false -> cover:stop()
end,
ok.
@@ -87,7 +79,7 @@ coverage(Config) when is_list(Config) ->
?MODULE:do_coverage(Config).
do_coverage(Config) ->
- Outdir = ?config(priv_dir, Config),
+ Outdir = proplists:get_value(priv_dir, Config),
ExportFile = filename:join(Outdir, "export"),
ok = cover:export(ExportFile, ?MODULE),
{error,{already_started,_}} = cover:start(),
@@ -100,16 +92,16 @@ do_coverage(Config) ->
%% Cover escaping of '&' in HTML files.
case proplists:get_bool(ct_is_running_cover, Config) of
- false ->
- %% Cover server was implicitly started when this module
- %% was cover-compiled. We must stop the cover server, but
- %% we must ensure that this module is not on the call
- %% stack when it is unloaded. Therefore, the call that
- %% follows MUST be tail-recursive.
- cover:stop();
- true ->
- %% Cover server was started by common_test; don't stop it.
- ok
+ false ->
+ %% Cover server was implicitly started when this module
+ %% was cover-compiled. We must stop the cover server, but
+ %% we must ensure that this module is not on the call
+ %% stack when it is unloaded. Therefore, the call that
+ %% follows MUST be tail-recursive.
+ cover:stop();
+ true ->
+ %% Cover server was started by common_test; don't stop it.
+ ok
end.
%% This test case will only be run when common_test is running cover.
@@ -120,7 +112,7 @@ coverage_analysis(Config) when is_list(Config) ->
io:format("~p\n", [Analysis2]),
{ok,_Analysis3} = cover:analyze(?MODULE, calls, line),
- Outdir = ?config(priv_dir, Config),
+ Outdir = proplists:get_value(priv_dir, Config),
Outfile = filename:join(Outdir, ?MODULE),
{ok,Outfile} = cover:analyze_to_file(?MODULE, Outfile),
@@ -130,92 +122,90 @@ coverage_analysis(Config) when is_list(Config) ->
{ok,Outfile} = cover:analyze_to_file(?MODULE, Outfile, [html]),
ok.
-start(suite) -> [];
start(Config) when is_list(Config) ->
- ?line ok = file:set_cwd(?config(data_dir, Config)),
+ ok = file:set_cwd(proplists:get_value(data_dir, Config)),
- ?line Files = lsfiles(),
- ?line remove(files(Files, ".out")),
+ Files = lsfiles(),
+ remove(files(Files, ".out")),
- ?line {ok, Pid} = cover:start(),
- ?line {error, {already_started, Pid}} = cover:start().
+ {ok, Pid} = cover:start(),
+ {error, {already_started, Pid}} = cover:start().
-compile(suite) -> [];
compile(Config) when is_list(Config) ->
- ?line ok = file:set_cwd(?config(data_dir, Config)),
+ ok = file:set_cwd(proplists:get_value(data_dir, Config)),
- ?line Result1 = cover:compile_directory(),
- ?line SortedResult = lists:sort(Result1),
- ?line {ok, CWD} = file:get_cwd(),
- ?line Result2 = cover:compile_directory(CWD),
- ?line SortedResult = lists:sort(Result2),
- ?line [{error,DFile},{ok,a},{ok,b},{ok,cc},{ok,f}] = SortedResult,
- ?line [{ok,e}] = cover:compile_directory("d1"),
- ?line {error,enoent} = cover:compile_directory("d2"),
+ Result1 = cover:compile_directory(),
+ SortedResult = lists:sort(Result1),
+ {ok, CWD} = file:get_cwd(),
+ Result2 = cover:compile_directory(CWD),
+ SortedResult = lists:sort(Result2),
+ [{error,DFile},{ok,a},{ok,b},{ok,cc},{ok,f}] = SortedResult,
+ [{ok,e}] = cover:compile_directory("d1"),
+ {error,enoent} = cover:compile_directory("d2"),
[] = cover:compile([]),
Result21 = cover:compile([a,b,"cc.erl",d,"f"]),
SortedResult21 = lists:sort(Result21),
[{error,DFile},{ok,a},{ok,b},{ok,cc},{ok,f}] = SortedResult21,
- ?line {ok,a} = cover:compile(a),
- ?line {ok,b} = compile:file(b),
- ?line code:purge(b),
- ?line {module,b} = code:load_file(b),
- ?line {ok,d} = cover:compile("d.erl", [{d,'AGE',42}]),
- ?line {error,_BBFile} = cover:compile(bb),
+ {ok,a} = cover:compile(a),
+ {ok,b} = compile:file(b),
+ code:purge(b),
+ {module,b} = code:load_file(b),
+ {ok,d} = cover:compile("d.erl", [{d,'AGE',42}]),
+ {error,_BBFile} = cover:compile(bb),
- ?line StdlibDir = code:lib_dir(stdlib),
- ?line Lists = filename:join([StdlibDir, "src", "lists.erl"]),
- ?line {error, Lists} = cover:compile(Lists),
+ StdlibDir = code:lib_dir(stdlib),
+ Lists = filename:join([StdlibDir, "src", "lists.erl"]),
+ {error, Lists} = cover:compile(Lists),
%% For compiling beam: using dummy files v,w,x,y and z
- ?line file:set_cwd("compile_beam"),
- ?line {ok,_} = compile:file(v,[debug_info,report]),
- ?line {ok,_} = compile:file(w,[debug_info,report]),
- ?line {ok,_} = compile:file(x),
- ?line {ok,_} = compile:file("d/y",[debug_info,{outdir,"d"},report]),
- ?line Key = "A Krypto Key",
+ file:set_cwd("compile_beam"),
+ {ok,_} = compile:file(v,[debug_info,report]),
+ {ok,_} = compile:file(w,[debug_info,report]),
+ {ok,_} = compile:file(x),
+ {ok,_} = compile:file("d/y",[debug_info,{outdir,"d"},report]),
+ Key = "A Krypto Key",
CryptoWorks = crypto_works(),
case CryptoWorks of
- false ->
- {ok,_} = compile:file(crypt, [debug_info,report]),
- {ok,crypt} = cover:compile_beam("crypt.beam");
- true ->
- {ok,_} = compile:file(crypt, [{debug_info_key,Key},report]),
- {error,{encrypted_abstract_code,_}} =
- cover:compile_beam("crypt.beam"),
- ok = beam_lib:crypto_key_fun(simple_crypto_fun(Key)),
- {ok,crypt} = cover:compile_beam("crypt.beam")
+ false ->
+ {ok,_} = compile:file(crypt, [debug_info,report]),
+ {ok,crypt} = cover:compile_beam("crypt.beam");
+ true ->
+ {ok,_} = compile:file(crypt, [{debug_info_key,Key},report]),
+ {error,{encrypted_abstract_code,_}} =
+ cover:compile_beam("crypt.beam"),
+ ok = beam_lib:crypto_key_fun(simple_crypto_fun(Key)),
+ {ok,crypt} = cover:compile_beam("crypt.beam")
end,
- Path = filename:join([?config(data_dir, Config), "compile_beam", "v.erl"]),
- ?line {ok,v} = cover:compile_beam(v),
+ Path = filename:join([proplists:get_value(data_dir, Config), "compile_beam", "v.erl"]),
+ {ok,v} = cover:compile_beam(v),
{source,Path} = lists:keyfind(source, 1, v:module_info(compile)),
- ?line {ok,w} = cover:compile_beam("w.beam"),
- ?line {error,{no_abstract_code,"./x.beam"}} = cover:compile_beam(x),
- ?line {error,{already_cover_compiled,no_beam_found,a}}=cover:compile_beam(a),
- ?line {error,non_existing} = cover:compile_beam(z),
- ?line [{ok,y}] = cover:compile_beam_directory("d"),
- ?line Result3 = lists:sort(cover:compile_beam_directory()),
- ?line [{error,{no_abstract_code,XBeam}},{ok,crypt},{ok,v},{ok,w}] = Result3,
- ?line {error,enoent} = cover:compile_beam_directory("d2"),
+ {ok,w} = cover:compile_beam("w.beam"),
+ {error,{no_abstract_code,"./x.beam"}} = cover:compile_beam(x),
+ {error,{already_cover_compiled,no_beam_found,a}}=cover:compile_beam(a),
+ {error,non_existing} = cover:compile_beam(z),
+ [{ok,y}] = cover:compile_beam_directory("d"),
+ Result3 = lists:sort(cover:compile_beam_directory()),
+ [{error,{no_abstract_code,XBeam}},{ok,crypt},{ok,v},{ok,w}] = Result3,
+ {error,enoent} = cover:compile_beam_directory("d2"),
[] = cover:compile_beam([]),
Result31 = cover:compile_beam([crypt,"v.beam",w,"x"]),
SortedResult31 = lists:sort(Result31),
[{error,{no_abstract_code,XBeam}},{ok,crypt},{ok,v},{ok,w}] = SortedResult31,
- ?line decompile([v,w,y]),
- ?line Files = lsfiles(),
- ?line remove(files(Files, ".beam")).
+ decompile([v,w,y]),
+ Files = lsfiles(),
+ remove(files(Files, ".beam")).
crypto_works() ->
try crypto:start() of
- {error,{already_started,crypto}} -> true;
- ok -> true
+ {error,{already_started,crypto}} -> true;
+ ok -> true
catch
- error:_ ->
- false
+ error:_ ->
+ false
end.
simple_crypto_fun(Key) ->
@@ -223,90 +213,89 @@ simple_crypto_fun(Key) ->
({debug_info, des3_cbc, crypt, _}) -> Key
end.
-analyse(suite) -> [];
analyse(Config) when is_list(Config) ->
- ?line ok = file:set_cwd(?config(data_dir, Config)),
+ ok = file:set_cwd(proplists:get_value(data_dir, Config)),
- ?line done = a:start(5),
+ done = a:start(5),
{ok, {a,{17,2}}=ACovMod} = cover:analyse(a, coverage, module),
{ok, [{{a,exit_kalle,0},{1,0}},
- {{a,loop,3},{5,1}},
- {{a,pong,1},{1,0}},
- {{a,start,1},{6,0}},
- {{a,stop,1},{0,1}},
- {{a,trycatch,1},{4,0}}]=ACovFunc} =
- cover:analyse(a, coverage, function),
+ {{a,loop,3},{5,1}},
+ {{a,pong,1},{1,0}},
+ {{a,start,1},{6,0}},
+ {{a,stop,1},{0,1}},
+ {{a,trycatch,1},{4,0}}]=ACovFunc} =
+ cover:analyse(a, coverage, function),
{ok, [{{a,exit_kalle,0,1},{1,0}},
- {{a,loop,3,1},{3,1}},
- {{a,loop,3,2},{2,0}},
- {{a,pong,1,1},{1,0}},
- {{a,start,1,1},{6,0}},
- {{a,stop,1,1},{0,1}},
- {{a,trycatch,1,1},{4,0}}]=ACovClause} =
- cover:analyse(a, coverage, clause),
- ?line {ok, [{{a,9},{1,0}},
- {{a,10},{1,0}},
- {{a,11},{1,0}},
- {{a,13},{1,0}},
- {{a,14},{1,0}},
- {{a,15},{1,0}},
- {{a,21},{0,1}},
- {{a,26},{1,0}},
- {{a,31},{1,0}},
- {{a,32},{1,0}},
- {{a,34},{1,0}},
- {{a,36},{0,1}},
- {{a,39},{1,0}},
- {{a,40},{1,0}},
- {{a,44},{1,0}},
- {{a,47},{1,0}},
- {{a,49},{1,0}},
- {{a,51},{1,0}},
- {{a,55},{1,0}}]=ACovLine} = cover:analyse(a, coverage, line),
+ {{a,loop,3,1},{3,1}},
+ {{a,loop,3,2},{2,0}},
+ {{a,pong,1,1},{1,0}},
+ {{a,start,1,1},{6,0}},
+ {{a,stop,1,1},{0,1}},
+ {{a,trycatch,1,1},{4,0}}]=ACovClause} =
+ cover:analyse(a, coverage, clause),
+ {ok, [{{a,9},{1,0}},
+ {{a,10},{1,0}},
+ {{a,11},{1,0}},
+ {{a,13},{1,0}},
+ {{a,14},{1,0}},
+ {{a,15},{1,0}},
+ {{a,21},{0,1}},
+ {{a,26},{1,0}},
+ {{a,31},{1,0}},
+ {{a,32},{1,0}},
+ {{a,34},{1,0}},
+ {{a,36},{0,1}},
+ {{a,39},{1,0}},
+ {{a,40},{1,0}},
+ {{a,44},{1,0}},
+ {{a,47},{1,0}},
+ {{a,49},{1,0}},
+ {{a,51},{1,0}},
+ {{a,55},{1,0}}]=ACovLine} = cover:analyse(a, coverage, line),
{ok, {a,15}=ACallsMod} = cover:analyse(a, calls, module),
{ok, [{{a,exit_kalle,0},1},
- {{a,loop,3},6},
- {{a,pong,1},5},
- {{a,start,1},1},
- {{a,stop,1},0},
- {{a,trycatch,1},2}]=ACallsFunc} = cover:analyse(a, calls, function),
+ {{a,loop,3},6},
+ {{a,pong,1},5},
+ {{a,start,1},1},
+ {{a,stop,1},0},
+ {{a,trycatch,1},2}]=ACallsFunc} = cover:analyse(a, calls, function),
{ok, [{{a,exit_kalle,0,1},1},
- {{a,loop,3,1},5},
- {{a,loop,3,2},1},
- {{a,pong,1,1},5},
- {{a,start,1,1},1},
- {{a,stop,1,1},0},
- {{a,trycatch,1,1},2}]=ACallsClause} = cover:analyse(a, calls, clause),
- ?line {ok, [{{a,9},1},
- {{a,10},1},
- {{a,11},1},
- {{a,13},1},
- {{a,14},1},
- {{a,15},1},
- {{a,21},0},
- {{a,26},5},
- {{a,31},5},
- {{a,32},5},
- {{a,34},5},
- {{a,36},0},
- {{a,39},1},
- {{a,40},1},
- {{a,44},2},
- {{a,47},1},
- {{a,49},1},
- {{a,51},2},
- {{a,55},1}]=ACallsLine} = cover:analyse(a, calls, line),
+ {{a,loop,3,1},5},
+ {{a,loop,3,2},1},
+ {{a,pong,1,1},5},
+ {{a,start,1,1},1},
+ {{a,stop,1,1},0},
+ {{a,trycatch,1,1},2}]=ACallsClause} = cover:analyse(a, calls, clause),
+ {ok, [{{a,9},1},
+ {{a,10},1},
+ {{a,11},1},
+ {{a,13},1},
+ {{a,14},1},
+ {{a,15},1},
+ {{a,21},0},
+ {{a,26},5},
+ {{a,31},5},
+ {{a,32},5},
+ {{a,34},5},
+ {{a,36},0},
+ {{a,39},1},
+ {{a,40},1},
+ {{a,44},2},
+ {{a,47},1},
+ {{a,49},1},
+ {{a,51},2},
+ {{a,55},1}]=ACallsLine} = cover:analyse(a, calls, line),
{ok,ACovFunc} = cover:analyse(a),
{ok,ACovMod} = cover:analyse(a, module),
{ok,ACallsFunc} = cover:analyse(a, calls),
- ?line {ok, "a.COVER.out"} = cover:analyse_to_file(a),
- ?line {ok, "e.COVER.out"} = cover:analyse_to_file(e),
- ?line {ok, "a.COVER.html"} = cover:analyse_to_file(a,[html]),
- ?line {ok, "e.COVER.html"} = cover:analyse_to_file(e,[html]),
+ {ok, "a.COVER.out"} = cover:analyse_to_file(a),
+ {ok, "e.COVER.out"} = cover:analyse_to_file(e),
+ {ok, "a.COVER.html"} = cover:analyse_to_file(a,[html]),
+ {ok, "e.COVER.html"} = cover:analyse_to_file(e,[html]),
%% Analyse all modules
Modules = cover:modules(),
@@ -355,7 +344,7 @@ analyse(Config) when is_list(Config) ->
{result,CovClause1,[]} = cover:analyse(Modules,coverage,clause),
true = lists:sort(CovClause) == lists:sort(CovClause1),
-
+
{result,CovLine1,[]} = cover:analyse(Modules,coverage,line),
true = lists:sort(CovLine) == lists:sort(CovLine1),
@@ -377,18 +366,18 @@ analyse(Config) when is_list(Config) ->
true = lists:sort(AllToFileHtml) == lists:sort(AllToFileHtml1),
%% analyse_to_file of file which is compiled from beam
- ?line {ok,f} = compile:file(f,[debug_info]),
- ?line code:purge(f),
- ?line {module,f} = code:load_file(f),
- ?line {ok,f} = cover:compile_beam(f),
- ?line f:f2(),
- ?line {ok, "f.COVER.out"} = cover:analyse_to_file(f),
+ {ok,f} = compile:file(f,[debug_info]),
+ code:purge(f),
+ {module,f} = code:load_file(f),
+ {ok,f} = cover:compile_beam(f),
+ f:f2(),
+ {ok, "f.COVER.out"} = cover:analyse_to_file(f),
%% Source code can be found via source
- ?line {ok,v} = compile:file("compile_beam/v",[debug_info]),
- ?line code:purge(v),
- ?line {module,v} = code:load_file(v),
- ?line {ok,v} = cover:compile_beam(v),
+ {ok,v} = compile:file("compile_beam/v",[debug_info]),
+ code:purge(v),
+ {module,v} = code:load_file(v),
+ {ok,v} = cover:compile_beam(v),
{ok,"v.COVER.out"} = cover:analyse_to_file(v),
%% Source code cannot be found
@@ -403,163 +392,161 @@ analyse(Config) when is_list(Config) ->
code:purge(z),
code:delete(z),
- ?line {error,{not_cover_compiled,b}} = cover:analyse(b),
- ?line {error,{not_cover_compiled,g}} = cover:analyse(g),
+ {error,{not_cover_compiled,b}} = cover:analyse(b),
+ {error,{not_cover_compiled,g}} = cover:analyse(g),
{result,[],[{not_cover_compiled,b}]} = cover:analyse([b]),
- ?line {error,{not_cover_compiled,b}} = cover:analyse_to_file(b),
+ {error,{not_cover_compiled,b}} = cover:analyse_to_file(b),
{error,{not_cover_compiled,g}} = cover:analyse_to_file(g),
{result,[],[{not_cover_compiled,g}]} = cover:analyse_to_file([g]).
-misc(suite) -> [];
misc(Config) when is_list(Config) ->
- ?line ok = file:set_cwd(?config(data_dir, Config)),
+ ok = file:set_cwd(proplists:get_value(data_dir, Config)),
- ?line [a,cc,crypt,d,e,f,v] = lists:sort(cover:modules()),
+ [a,cc,crypt,d,e,f,v] = lists:sort(cover:modules()),
- ?line {ok,cc} = compile:file(cc),
- ?line code:purge(cc),
- ?line {module,cc} = code:load_file(cc),
- ?line [a,crypt,d,e,f,v] = lists:sort(cover:modules()),
+ {ok,cc} = compile:file(cc),
+ code:purge(cc),
+ {module,cc} = code:load_file(cc),
+ [a,crypt,d,e,f,v] = lists:sort(cover:modules()),
- ?line {file, _File} = cover:is_compiled(a),
- ?line false = cover:is_compiled(b),
- ?line false = cover:is_compiled(g),
+ {file, _File} = cover:is_compiled(a),
+ false = cover:is_compiled(b),
+ false = cover:is_compiled(g),
- ?line ok = cover:reset(a),
- ?line {ok, {a,{0,19}}} = cover:analyse(a, module),
- ?line ok = cover:reset().
+ ok = cover:reset(a),
+ {ok, {a,{0,19}}} = cover:analyse(a, module),
+ ok = cover:reset().
-stop(suite) -> [];
stop(Config) when is_list(Config) ->
- ?line ok = file:set_cwd(?config(data_dir, Config)),
-
- ?line cover_compiled = code:which(a),
- ?line {ok,d} = compile:file(d, [{d,'AGE',42}]),
- ?line code:purge(d),
- ?line {module,d} = code:load_file(d),
- ?line ok = cover:stop(),
- ?line Beam = code:which(a),
- ?line true = is_unloaded(Beam),
-
- ?line Files = lsfiles(),
- ?line remove(files(Files, ".out")),
- ?line remove(files(Files, ".html")),
- ?line remove(files(Files, ".beam")).
-
-distribution(suite) -> [];
+ ok = file:set_cwd(proplists:get_value(data_dir, Config)),
+
+ cover_compiled = code:which(a),
+ {ok,d} = compile:file(d, [{d,'AGE',42}]),
+ code:purge(d),
+ {module,d} = code:load_file(d),
+ ok = cover:stop(),
+ Beam = code:which(a),
+ true = is_unloaded(Beam),
+
+ Files = lsfiles(),
+ remove(files(Files, ".out")),
+ remove(files(Files, ".html")),
+ remove(files(Files, ".beam")).
+
distribution(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line ok = file:set_cwd(DataDir),
+ DataDir = proplists:get_value(data_dir, Config),
+ ok = file:set_cwd(DataDir),
- ?line {ok,N1} = ?t:start_node(cover_SUITE_distribution1,slave,[]),
- ?line {ok,N2} = ?t:start_node(cover_SUITE_distribution2,slave,[]),
- ?line {ok,N3} = ?t:start_node(cover_SUITE_distribution3,slave,[]),
- ?line {ok,N4} = ?t:start_node(cover_SUITE_distribution4,slave,[]),
+ {ok,N1} = test_server:start_node(cover_SUITE_distribution1,slave,[]),
+ {ok,N2} = test_server:start_node(cover_SUITE_distribution2,slave,[]),
+ {ok,N3} = test_server:start_node(cover_SUITE_distribution3,slave,[]),
+ {ok,N4} = test_server:start_node(cover_SUITE_distribution4,slave,[]),
%% Check that an already compiled module is loaded on new nodes
- ?line {ok,f} = cover:compile(f),
- ?line {ok,[_,_,_,_]} = cover:start(nodes()),
- ?line cover_compiled = code:which(f),
- ?line cover_compiled = rpc:call(N1,code,which,[f]),
- ?line cover_compiled = rpc:call(N2,code,which,[f]),
- ?line cover_compiled = rpc:call(N3,code,which,[f]),
- ?line cover_compiled = rpc:call(N4,code,which,[f]),
+ {ok,f} = cover:compile(f),
+ {ok,[_,_,_,_]} = cover:start(nodes()),
+ cover_compiled = code:which(f),
+ cover_compiled = rpc:call(N1,code,which,[f]),
+ cover_compiled = rpc:call(N2,code,which,[f]),
+ cover_compiled = rpc:call(N3,code,which,[f]),
+ cover_compiled = rpc:call(N4,code,which,[f]),
%% Check that a node cannot be started twice
- ?line {ok,[]} = cover:start(N2),
+ {ok,[]} = cover:start(N2),
%% Check that the current node (i.e. the main node) is not started with
%% start/1 and not stopped with stop/1
- ?line {ok,[]} = cover:start(node()),
- ?line ok = cover:stop(node()),
- ?line true = is_pid(whereis(cover_server)),
+ {ok,[]} = cover:start(node()),
+ ok = cover:stop(node()),
+ true = is_pid(whereis(cover_server)),
%% Check that a new compiled module is loaded on all existing nodes
- ?line compile:file("compile_beam/v",[debug_info]),
- ?line {ok,v} = cover:compile_beam(v),
- ?line cover_compiled = code:which(v),
- ?line cover_compiled = rpc:call(N1,code,which,[v]),
- ?line cover_compiled = rpc:call(N2,code,which,[v]),
- ?line cover_compiled = rpc:call(N3,code,which,[v]),
- ?line cover_compiled = rpc:call(N4,code,which,[v]),
-
+ compile:file("compile_beam/v",[debug_info]),
+ {ok,v} = cover:compile_beam(v),
+ cover_compiled = code:which(v),
+ cover_compiled = rpc:call(N1,code,which,[v]),
+ cover_compiled = rpc:call(N2,code,which,[v]),
+ cover_compiled = rpc:call(N3,code,which,[v]),
+ cover_compiled = rpc:call(N4,code,which,[v]),
+
%% this is lost when the node is killed
- ?line rpc:call(N3,f,f2,[]),
- ?line rpc:call(N3,erlang,halt,[]),
+ rpc:call(N3,f,f2,[]),
+ rpc:call(N3,erlang,halt,[]),
%% this should be visible in analyse
- ?line rpc:call(N1,f,f1,[]),
+ rpc:call(N1,f,f1,[]),
%% Check that data is collected from remote node when stopped
- ?line ok = cover:stop(N1),
- ?line N1Beam = rpc:call(N1,code,which,[f]),
- ?line true = is_unloaded(N1Beam),
- ?line check_f_calls(1,0),
+ ok = cover:stop(N1),
+ N1Beam = rpc:call(N1,code,which,[f]),
+ true = is_unloaded(N1Beam),
+ check_f_calls(1,0),
%% Call f:f1() again on another node and check that number of calls is
%% accumulated.
- ?line f:f1(),
- ?line check_f_calls(2,0),
-
+ f:f1(),
+ check_f_calls(2,0),
+
%% Check that reset works on all nodes
- ?line f:f1(),
- ?line rpc:call(N2,f,f1,[]),
- ?line ok = cover:reset(f),
- ?line check_f_calls(0,0),
-
+ f:f1(),
+ rpc:call(N2,f,f1,[]),
+ ok = cover:reset(f),
+ check_f_calls(0,0),
+
%% Check that data is collected from all nodes
- ?line rpc:call(N2,f,f1,[]),
- ?line f:f2(),
- ?line check_f_calls(1,1),
+ rpc:call(N2,f,f1,[]),
+ f:f2(),
+ check_f_calls(1,1),
%% Check that same data is not fetched again (i.e. that analyse does
%% reset on the remote node(s))
- ?line check_f_calls(1,1),
+ check_f_calls(1,1),
%% Another checn that data is not fetched twice, i.e. when flushed
%% then analyse should not add the same data again.
- ?line rpc:call(N4,f,f2,[]),
- ?line ok = cover:flush(N4),
- ?line check_f_calls(1,2),
+ rpc:call(N4,f,f2,[]),
+ ok = cover:flush(N4),
+ check_f_calls(1,2),
%% Check that flush collects data so calls are not lost if node is killed
- ?line rpc:call(N4,f,f2,[]),
- ?line ok = cover:flush(N4),
- ?line rpc:call(N4,erlang,halt,[]),
- ?line check_f_calls(1,3),
+ rpc:call(N4,f,f2,[]),
+ ok = cover:flush(N4),
+ rpc:call(N4,erlang,halt,[]),
+ check_f_calls(1,3),
%% Check that stop() unloads on all nodes
- ?line ok = cover:stop(),
- ?line timer:sleep(100), %% Give nodes time to unload on slow machines.
- ?line LocalBeam = code:which(f),
- ?line N2Beam = rpc:call(N2,code,which,[f]),
- ?line true = is_unloaded(LocalBeam),
- ?line true = is_unloaded(N2Beam),
+ ok = cover:stop(),
+ timer:sleep(100), %% Give nodes time to unload on slow machines.
+ LocalBeam = code:which(f),
+ N2Beam = rpc:call(N2,code,which,[f]),
+ true = is_unloaded(LocalBeam),
+ true = is_unloaded(N2Beam),
%% Check that cover_server on remote node does not die if main node dies
- ?line {ok,[N1]} = cover:start(N1),
- ?line true = is_pid(N1Server = rpc:call(N1,erlang,whereis,[cover_server])),
- ?line exit(whereis(cover_server),kill),
- ?line timer:sleep(100),
- ?line N1Server = rpc:call(N1,erlang,whereis,[cover_server]),
+ {ok,[N1]} = cover:start(N1),
+ true = is_pid(N1Server = rpc:call(N1,erlang,whereis,[cover_server])),
+ exit(whereis(cover_server),kill),
+ timer:sleep(100),
+ N1Server = rpc:call(N1,erlang,whereis,[cover_server]),
%% Cleanup
- ?line Files = lsfiles(),
- ?line remove(files(Files, ".beam")),
- ?line ?t:stop_node(N1),
- ?line ?t:stop_node(N2).
+ Files = lsfiles(),
+ remove(files(Files, ".beam")),
+ test_server:stop_node(N1),
+ test_server:stop_node(N2).
%% Test that a lost node is reconnected
reconnect(Config) ->
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
ok = file:set_cwd(DataDir),
{ok,a} = compile:file(a),
{ok,b} = compile:file(b),
{ok,f} = compile:file(f),
- {ok,N1} = ?t:start_node(cover_SUITE_reconnect,peer,
- [{args," -pa " ++ DataDir},{start_cover,false}]),
+ {ok,N1} = test_server:start_node(cover_SUITE_reconnect,peer,
+ [{args," -pa " ++ DataDir},
+ {start_cover,false}]),
{ok,a} = cover:compile(a),
{ok,f} = cover:compile(f),
{ok,[N1]} = cover:start(nodes()),
@@ -600,19 +587,20 @@ reconnect(Config) ->
check_f_calls(2,1),
cover:stop(),
- ?t:stop_node(N1),
+ test_server:stop_node(N1),
ok.
%% Test that a lost node is reconnected - also if it has been dead
die_and_reconnect(Config) ->
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
ok = file:set_cwd(DataDir),
{ok,f} = compile:file(f),
NodeName = cover_SUITE_die_and_reconnect,
- {ok,N1} = ?t:start_node(NodeName,peer,
- [{args," -pa " ++ DataDir},{start_cover,false}]),
+ {ok,N1} = test_server:start_node(NodeName,peer,
+ [{args," -pa " ++ DataDir},
+ {start_cover,false}]),
%% {ok,a} = cover:compile(a),
{ok,f} = cover:compile(f),
{ok,[N1]} = cover:start(nodes()),
@@ -629,8 +617,9 @@ die_and_reconnect(Config) ->
check_f_calls(1,0), % only the first call - before the flush
%% Restart the node and check that cover reconnects
- {ok,N1} = ?t:start_node(NodeName,peer,
- [{args," -pa " ++ DataDir},{start_cover,false}]),
+ {ok,N1} = test_server:start_node(NodeName,peer,
+ [{args," -pa " ++ DataDir},
+ {start_cover,false}]),
timer:sleep(100),
[N1] = cover:which_nodes(), % we are reconnected
cover_compiled = rpc:call(N1,code,which,[f]),
@@ -642,20 +631,21 @@ die_and_reconnect(Config) ->
check_f_calls(2,0),
cover:stop(),
- ?t:stop_node(N1),
+ test_server:stop_node(N1),
ok.
%% Test that a stopped node is not marked as lost, i.e. that it is not
%% reconnected if it is restarted (OTP-10638)
dont_reconnect_after_stop(Config) ->
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
ok = file:set_cwd(DataDir),
{ok,f} = compile:file(f),
NodeName = cover_SUITE_dont_reconnect_after_stop,
- {ok,N1} = ?t:start_node(NodeName,peer,
- [{args," -pa " ++ DataDir},{start_cover,false}]),
+ {ok,N1} = test_server:start_node(NodeName,peer,
+ [{args," -pa " ++ DataDir},
+ {start_cover,false}]),
{ok,f} = cover:compile(f),
{ok,[N1]} = cover:start(nodes()),
@@ -670,8 +660,9 @@ dont_reconnect_after_stop(Config) ->
check_f_calls(1,0),
%% Restart the node and check that cover does not reconnect
- {ok,N1} = ?t:start_node(NodeName,peer,
- [{args," -pa " ++ DataDir},{start_cover,false}]),
+ {ok,N1} = test_server:start_node(NodeName,peer,
+ [{args," -pa " ++ DataDir},
+ {start_cover,false}]),
timer:sleep(300),
cover_which_nodes([]),
Beam = rpc:call(N1,code,which,[f]),
@@ -685,20 +676,21 @@ dont_reconnect_after_stop(Config) ->
check_f_calls(1,0),
cover:stop(),
- ?t:stop_node(N1),
+ test_server:stop_node(N1),
ok.
%% Test that a node which is stopped while it is marked as lost is not
%% reconnected if it is restarted (OTP-10638)
stop_node_after_disconnect(Config) ->
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
ok = file:set_cwd(DataDir),
{ok,f} = compile:file(f),
NodeName = cover_SUITE_stop_node_after_disconnect,
- {ok,N1} = ?t:start_node(NodeName,peer,
- [{args," -pa " ++ DataDir},{start_cover,false}]),
+ {ok,N1} = test_server:start_node(NodeName,peer,
+ [{args," -pa " ++ DataDir},
+ {start_cover,false}]),
{ok,f} = cover:compile(f),
{ok,[N1]} = cover:start(nodes()),
@@ -715,8 +707,9 @@ stop_node_after_disconnect(Config) ->
cover:stop(N1),
%% Restart the node and check that cover does not reconnect
- {ok,N1} = ?t:start_node(NodeName,peer,
- [{args," -pa " ++ DataDir},{start_cover,false}]),
+ {ok,N1} = test_server:start_node(NodeName,peer,
+ [{args," -pa " ++ DataDir},
+ {start_cover,false}]),
timer:sleep(300),
cover_which_nodes([]),
Beam = rpc:call(N1,code,which,[f]),
@@ -730,11 +723,11 @@ stop_node_after_disconnect(Config) ->
check_f_calls(1,0),
cover:stop(),
- ?t:stop_node(N1),
+ test_server:stop_node(N1),
ok.
distribution_performance(Config) ->
- PrivDir = ?config(priv_dir,Config),
+ PrivDir = proplists:get_value(priv_dir,Config),
Dir = filename:join(PrivDir,"distribution_performance"),
AllFiles = filename:join(Dir,"*"),
ok = filelib:ensure_dir(AllFiles),
@@ -744,16 +737,16 @@ distribution_performance(Config) ->
C = 10, % and each function of C clauses
Mods = generate_modules(M,F,C,Dir),
-% ?t:break(""),
+ % test_server:break(""),
NodeName = cover_SUITE_distribution_performance,
- {ok,N1} = ?t:start_node(NodeName,peer,[{start_cover,false}]),
+ {ok,N1} = test_server:start_node(NodeName,peer,[{start_cover,false}]),
%% CFun = fun() ->
%% [{ok,_} = cover:compile_beam(Mod) || Mod <- Mods]
%% end,
CFun = fun() -> cover:compile_beam(Mods) end,
{CT,_CA} = timer:tc(CFun),
-% erlang:display(_CA),
+ % erlang:display(_CA),
erlang:display({compile,CT}),
{SNT,_} = timer:tc(fun() -> {ok,[N1]} = cover:start(nodes()) end),
@@ -761,27 +754,27 @@ distribution_performance(Config) ->
[1 = rpc:call(N1,Mod,f1,[1]) || Mod <- Mods],
-% Fun = fun() -> [cover:analyse(Mod,calls,function) || Mod<-Mods] end,
-% Fun = fun() -> analyse_all(Mods,calls,function) end,
-% Fun = fun() -> cover:analyse('_',calls,function) end,
+ % Fun = fun() -> [cover:analyse(Mod,calls,function) || Mod<-Mods] end,
+ % Fun = fun() -> analyse_all(Mods,calls,function) end,
+ % Fun = fun() -> cover:analyse('_',calls,function) end,
Fun = fun() -> cover:analyse(Mods,calls,function) end,
-% Fun = fun() -> [begin cover:analyse_to_file(Mod,[html]) end || Mod<-Mods] end,
-% Fun = fun() -> analyse_all_to_file(Mods,[html]) end,
-% Fun = fun() -> cover:analyse_to_file(Mods,[html]) end,
-% Fun = fun() -> cover:analyse_to_file([html]) end,
+ % Fun = fun() -> [begin cover:analyse_to_file(Mod,[html]) end || Mod<-Mods] end,
+ % Fun = fun() -> analyse_all_to_file(Mods,[html]) end,
+ % Fun = fun() -> cover:analyse_to_file(Mods,[html]) end,
+ % Fun = fun() -> cover:analyse_to_file([html]) end,
-% Fun = fun() -> cover:reset() end,
+ % Fun = fun() -> cover:reset() end,
{AT,_A} = timer:tc(Fun),
erlang:display({analyse,AT}),
-% erlang:display(lists:sort([X || X={_MFA,N} <- lists:append([L || {ok,L}<-A]), N=/=0])),
+ % erlang:display(lists:sort([X || X={_MFA,N} <- lists:append([L || {ok,L}<-A]), N=/=0])),
%% fprof:apply(Fun, [],[{procs,[whereis(cover_server)]}]),
%% fprof:profile(),
%% fprof:analyse(dest,[]),
- {SNT2,_} = timer:tc(fun() -> ?t:stop_node(N1) end),
+ {SNT2,_} = timer:tc(fun() -> test_server:stop_node(N1) end),
erlang:display({stop_node,SNT2}),
code:del_path(Dir),
@@ -793,10 +786,10 @@ distribution_performance(Config) ->
%% Run analysis in parallel
analyse_all(Mods,Analysis,Level) ->
Pids = [begin
- Pid = spawn(fun() ->
- {ok,A} = cover:analyse(Mod,Analysis,Level),
- exit(A)
- end),
+ Pid = spawn(fun() ->
+ {ok,A} = cover:analyse(Mod,Analysis,Level),
+ exit(A)
+ end),
erlang:monitor(process,Pid),
Pid
end || Mod <- Mods],
@@ -804,18 +797,18 @@ analyse_all(Mods,Analysis,Level) ->
analyse_all_to_file(Mods,Opts) ->
Pids = [begin
- Pid = cover:async_analyse_to_file(Mod,Opts),
- erlang:monitor(process,Pid),
- Pid
- end || Mod <- Mods],
+ Pid = cover:async_analyse_to_file(Mod,Opts),
+ erlang:monitor(process,Pid),
+ Pid
+ end || Mod <- Mods],
get_downs(Pids,[]).
get_downs([],Acc) ->
Acc;
get_downs(Pids,Acc) ->
receive
- {'DOWN', _Ref, _Type, Pid, A} ->
- get_downs(lists:delete(Pid,Pids),[A|Acc])
+ {'DOWN', _Ref, _Type, Pid, A} ->
+ get_downs(lists:delete(Pid,Pids),[A|Acc])
end.
generate_modules(0,_,_,_) ->
@@ -824,8 +817,8 @@ generate_modules(M,F,C,Dir) ->
ModStr = "m" ++ integer_to_list(M),
Mod = list_to_atom(ModStr),
Src = ["-module(",ModStr,").\n"
- "-compile(export_all).\n" |
- generate_functions(F,C)],
+ "-compile(export_all).\n" |
+ generate_functions(F,C)],
Erl = filename:join(Dir,ModStr++".erl"),
ok = file:write_file(Erl,Src),
{ok,Mod} = compile:file(Erl,[{outdir,Dir},debug_info,report]),
@@ -846,143 +839,133 @@ generate_clauses(C,Func) ->
generate_clauses(C-1,Func)].
-export_import(suite) -> [];
export_import(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line ok = file:set_cwd(DataDir),
- ?line PortCount = length(erlang:ports()),
+ DataDir = proplists:get_value(data_dir, Config),
+ ok = file:set_cwd(DataDir),
+ PortCount = length(erlang:ports()),
%% Export one module
- ?line {ok,f} = cover:compile(f),
- ?line f:f1(),
+ {ok,f} = cover:compile(f),
+ f:f1(),
%% check that no info is written about where data comes from when no
%% files are imported
- ?line ?t:capture_start(),
- ?line check_f_calls(1,0),
- ?line [] = ?t:capture_get(),
- ?line ?t:capture_stop(),
- ?line ok = cover:export("f_exported",f),
- ?line check_f_calls(1,0),
- ?line ok = cover:stop(),
-
+ test_server:capture_start(),
+ check_f_calls(1,0),
+ [] = test_server:capture_get(),
+ test_server:capture_stop(),
+ ok = cover:export("f_exported",f),
+ check_f_calls(1,0),
+ ok = cover:stop(),
+
%% Check that same data exists after import and that info is written about
%% data comming from imported file
- ?line ok = cover:import("f_exported"),
- ?line ?t:capture_start(),
- ?line check_f_calls(1,0),
- ?line [Text1] = ?t:capture_get(),
- ?line "Analysis includes data from imported files"++_ = lists:flatten(Text1),
- ?line ?t:capture_stop(),
+ ok = cover:import("f_exported"),
+ test_server:capture_start(),
+ check_f_calls(1,0),
+ [Text1] = test_server:capture_get(),
+ "Analysis includes data from imported files"++_ = lists:flatten(Text1),
+ test_server:capture_stop(),
%% Export all modules
- ?line {ok,a} = cover:compile(a),
- ?line ?t:capture_start(),
- ?line ok = cover:export("all_exported"),
- ?line [] = ?t:capture_get(),
-% ?line "Export includes data from imported files"++_ = lists:flatten(Text2),
- ?line ?t:capture_stop(),
- ?line ok = cover:stop(),
- ?line ok = cover:import("all_exported"),
- ?line check_f_calls(1,0),
+ {ok,a} = cover:compile(a),
+ test_server:capture_start(),
+ ok = cover:export("all_exported"),
+ [] = test_server:capture_get(),
+ % "Export includes data from imported files"++_ = lists:flatten(Text2),
+ test_server:capture_stop(),
+ ok = cover:stop(),
+ ok = cover:import("all_exported"),
+ check_f_calls(1,0),
%% Check that data is reset when module is compiled again, and that
%% warning is written when data is deleted for imported module.
- ?line ?t:capture_start(),
- ?line {ok,f} = cover:compile(f),
- ?line timer:sleep(10), % capture needs some time
- ?line [Text3] = ?t:capture_get(),
- ?line "WARNING: Deleting data for module f imported from" ++ _ =
- lists:flatten(Text3),
- ?line ?t:capture_stop(),
- ?line check_f_calls(0,0),
-
+ test_server:capture_start(),
+ {ok,f} = cover:compile(f),
+ timer:sleep(10), % capture needs some time
+ [Text3] = test_server:capture_get(),
+ "WARNING: Deleting data for module f imported from" ++ _ = lists:flatten(Text3),
+ test_server:capture_stop(),
+ check_f_calls(0,0),
+
%% Check that data is summed up when first compiled and then imported
%% The module which has been compiled (f) is loaded from the file
%% all_exported again (since it has been reset during cover compiling),
%% but the other module (a) is not loaded since it is already loaded
- ?line f:f1(),
- ?line f:f2(),
- ?line ok = cover:import("f_exported"),
- ?line ?t:capture_start(),
- ?line ok = cover:import("all_exported"),
- ?line [Text4] = ?t:capture_get(), % a is not loaded again
- ?line "WARNING: Module a already imported from " ++ _ = lists:flatten(Text4),
- ?line ?t:capture_stop(),
- ?line check_f_calls(3,1),
+ f:f1(),
+ f:f2(),
+ ok = cover:import("f_exported"),
+ test_server:capture_start(),
+ ok = cover:import("all_exported"),
+ [Text4] = test_server:capture_get(), % a is not loaded again
+ "WARNING: Module a already imported from " ++ _ = lists:flatten(Text4),
+ test_server:capture_stop(),
+ check_f_calls(3,1),
%% Check that warning is written when same file is imported twice,
%% and that data is not imported again
- ?line ?t:capture_start(),
- ?line ok = cover:import("all_exported"),
- ?line [Text5,Text6] = ?t:capture_get(),
- ?line "WARNING: Module f already imported from " ++ _ = lists:flatten(Text5),
- ?line "WARNING: Module a already imported from " ++ _ = lists:flatten(Text6),
- ?line ?t:capture_stop(),
- ?line check_f_calls(3,1),
+ test_server:capture_start(),
+ ok = cover:import("all_exported"),
+ [Text5,Text6] = test_server:capture_get(),
+ "WARNING: Module f already imported from " ++ _ = lists:flatten(Text5),
+ "WARNING: Module a already imported from " ++ _ = lists:flatten(Text6),
+ test_server:capture_stop(),
+ check_f_calls(3,1),
%% Check that reset removes all data and that the file which has been
%% reset can be imported again with no warning
- ?line cover:reset(f),
- ?line check_f_calls(0,0),
- ?line ?t:capture_start(),
- ?line ok = cover:import("all_exported"),
- ?line [Text7] = ?t:capture_get(), % warning only on mod a
- ?line "WARNING: Module a already imported from " ++ _ = lists:flatten(Text7),
- ?line ?t:capture_stop(),
- ?line check_f_calls(1,0),
+ cover:reset(f),
+ check_f_calls(0,0),
+ test_server:capture_start(),
+ ok = cover:import("all_exported"),
+ [Text7] = test_server:capture_get(), % warning only on mod a
+ "WARNING: Module a already imported from " ++ _ = lists:flatten(Text7),
+ test_server:capture_stop(),
+ check_f_calls(1,0),
%% same as above - only reset all
- ?line cover:reset(),
- ?line check_f_calls(0,0),
- ?line ?t:capture_start(),
- ?line ok = cover:import("all_exported"),
- ?line [] = ?t:capture_get(), % no warnings
- ?line ?t:capture_stop(),
- ?line check_f_calls(1,0),
+ cover:reset(),
+ check_f_calls(0,0),
+ test_server:capture_start(),
+ ok = cover:import("all_exported"),
+ [] = test_server:capture_get(), % no warnings
+ test_server:capture_stop(),
+ check_f_calls(1,0),
%% Check no raw files are left open
- ?line PortCount = length(erlang:ports()),
+ PortCount = length(erlang:ports()),
%% Cleanup
- ?line ok = cover:stop(),
- ?line Files = lsfiles(),
- ?line remove(["f_exported","all_exported"|files(Files, ".beam")]).
+ ok = cover:stop(),
+ Files = lsfiles(),
+ remove(["f_exported","all_exported"|files(Files, ".beam")]).
-otp_5031(suite) -> [];
otp_5031(Config) when is_list(Config) ->
+ ct:timetrap({seconds, 10}),
- Dog = ?t:timetrap(?t:seconds(10)),
-
- {ok,N1} = ?t:start_node(cover_SUITE_otp_5031,slave,[]),
- ?line {ok,[N1]} = cover:start(N1),
- ?line {error,not_main_node} = rpc:call(N1,cover,modules,[]),
- ?line cover:stop(),
- ?t:stop_node(N1),
-
- ?t:timetrap_cancel(Dog),
+ {ok,N1} = test_server:start_node(cover_SUITE_otp_5031,slave,[]),
+ {ok,[N1]} = cover:start(N1),
+ {error,not_main_node} = rpc:call(N1,cover,modules,[]),
+ cover:stop(),
+ test_server:stop_node(N1),
ok.
-eif(doc) ->
- ["Test the \'Exclude Included Functions\' functionality"];
-eif(suite) ->
- [];
+%% Test the \'Exclude Included Functions\' functionality
eif(Config) when is_list(Config) ->
- ?line ok = file:set_cwd(filename:join(?config(data_dir, Config),
- "included_functions")),
- ?line {ok, cover_inc} = compile:file(cover_inc,[debug_info]),
- ?line {ok, cover_inc} = cover:compile_beam(cover_inc),
+ ok = file:set_cwd(filename:join(proplists:get_value(data_dir, Config),
+ "included_functions")),
+ {ok, cover_inc} = compile:file(cover_inc,[debug_info]),
+ {ok, cover_inc} = cover:compile_beam(cover_inc),
%% This function will cause an included function to be executed.
%% The analysis should only show the lines that actually exist
%% in cover_inc.beam - not the ones from the included file.
- ?line cover_inc:func(),
- ?line {ok, [_, _]} = cover:analyse(cover_inc, line),
+ cover_inc:func(),
+ {ok, [_, _]} = cover:analyse(cover_inc, line),
ok.
-
-otp_5305(suite) -> [];
+
otp_5305(Config) when is_list(Config) ->
- ?line ok = file:set_cwd(?config(priv_dir, Config)),
+ ok = file:set_cwd(proplists:get_value(priv_dir, Config)),
File = "t.erl",
Test = <<"-module(t).
@@ -991,35 +974,32 @@ otp_5305(Config) when is_list(Config) ->
t() ->
ets:fun2ms(fun(X) -> X end).
">>,
- ?line ok = file:write_file(File, Test),
- ?line {ok, t} = cover:compile(File),
- ?line ok = file:delete(File),
-
+ ok = file:write_file(File, Test),
+ {ok, t} = cover:compile(File),
+ ok = file:delete(File),
ok.
-otp_5418(suite) -> [];
otp_5418(Config) when is_list(Config) ->
- ?line ok = file:set_cwd(?config(priv_dir, Config)),
+ ok = file:set_cwd(proplists:get_value(priv_dir, Config)),
File = "t.erl",
Test = <<"-module(t).
">>,
- ?line ok = file:write_file(File, Test),
- ?line {ok, t} = cover:compile(File),
- ?line {ok,{t,{0,0}}} = cover:analyse(t, module),
- ?line ok = file:delete(File),
-
+ ok = file:write_file(File, Test),
+ {ok, t} = cover:compile(File),
+ {ok,{t,{0,0}}} = cover:analyse(t, module),
+ ok = file:delete(File),
ok.
otp_6115(Config) when is_list(Config) ->
- ?line {ok, CWD} = file:get_cwd(),
- ?line Dir = filename:join(?config(data_dir, Config), otp_6115),
- ?line ok = file:set_cwd(Dir),
- ?line {ok, f1} = compile:file(f1, [debug_info]),
- ?line {ok, f2} = compile:file(f2, [debug_info]),
+ {ok, CWD} = file:get_cwd(),
+ Dir = filename:join(proplists:get_value(data_dir, Config), otp_6115),
+ ok = file:set_cwd(Dir),
+ {ok, f1} = compile:file(f1, [debug_info]),
+ {ok, f2} = compile:file(f2, [debug_info]),
%% Cover compile f1, but not f2
- ?line {ok, f1} = cover:compile(f1),
+ {ok, f1} = cover:compile(f1),
%% If f1 is cover compiled, a process P is started with a
%% reference to the fun created in start_fail/0, and cover:stop() is
@@ -1033,39 +1013,37 @@ otp_6115(Config) when is_list(Config) ->
Pid2 = f1:start_b(),
%% Now stop cover
- ?line cover:stop(),
-
+ cover:stop(),
+
%% Ensure that f1 is loaded (and not cover compiled), and that
%% both Pid1 and Pid2 are dead.
case code:which(f1) of
- Beam when is_list(Beam) ->
- ok;
- Other ->
- ?line ?t:fail({"f1 is not reloaded", Other})
+ Beam when is_list(Beam) ->
+ ok;
+ Other ->
+ ct:fail({"f1 is not reloaded", Other})
end,
case process_info(Pid1) of
- undefined ->
- ok;
- _PI1 ->
- RefToOldP1 = erlang:check_process_code(Pid1, f1),
- ?t:fail({"Pid1 still alive", RefToOldP1})
+ undefined ->
+ ok;
+ _PI1 ->
+ RefToOldP1 = erlang:check_process_code(Pid1, f1),
+ ct:fail({"Pid1 still alive", RefToOldP1})
end,
case process_info(Pid2) of
- undefined ->
- ok;
- _PI2 ->
- RefToOldP2 = erlang:check_process_code(Pid1, f2),
- ?t:fail({"Pid2 still alive", RefToOldP2})
+ undefined ->
+ ok;
+ _PI2 ->
+ RefToOldP2 = erlang:check_process_code(Pid1, f2),
+ ct:fail({"Pid2 still alive", RefToOldP2})
end,
- ?line file:set_cwd(CWD),
+ file:set_cwd(CWD),
ok.
-otp_7095(doc) ->
- ["andalso/orelse"];
-otp_7095(suite) -> [];
+%% andalso/orelse
otp_7095(Config) when is_list(Config) ->
- ?line ok = file:set_cwd(?config(priv_dir, Config)),
+ ok = file:set_cwd(proplists:get_value(priv_dir, Config)),
File = "t.erl",
Test = <<"-module(t).
@@ -1151,90 +1129,84 @@ otp_7095(Config) when is_list(Config) ->
add_one(T) ->
put(T, get(T) + 1). % 82
">>,
- ?line ok = file:write_file(File, Test),
- ?line {ok, t} = cover:compile(File),
- ?line ok = t:t(),
- ?line {ok,[{{t,4},1},{{t,5},1},{{t,6},1},{{t,7},1},{{t,8},1},{{t,9},1},
- {{t,10},1},{{t,11},1},{{t,12},1},{{t,13},1},{{t,14},1},
- {{t,15},1},{{t,16},1},{{t,17},1},
- {{t,20},1},{{t,22},0},
- {{t,25},1},{{t,27},1},
- {{t,30},1},{{t,32},1},
- {{t,35},1},{{t,37},0},
- {{t,40},1},{{t,42},1},{{t,44},1},
- {{t,47},1},{{t,48},1},
- {{t,51},1},{{t,53},1},{{t,55},0},
- {{t,58},1},{{t,60},1},{{t,62},1},{{t,64},0},
- {{t,67},1},{{t,69},1},{{t,71},1},{{t,74},1},
- {{t,76},0},{{t,78},1},
- {{t,82},2}]} = cover:analyse(t, calls, line),
- ?line ok = file:delete(File),
-
+ ok = file:write_file(File, Test),
+ {ok, t} = cover:compile(File),
+ ok = t:t(),
+ {ok,[{{t,4},1},{{t,5},1},{{t,6},1},{{t,7},1},{{t,8},1},{{t,9},1},
+ {{t,10},1},{{t,11},1},{{t,12},1},{{t,13},1},{{t,14},1},
+ {{t,15},1},{{t,16},1},{{t,17},1},
+ {{t,20},1},{{t,22},0},
+ {{t,25},1},{{t,27},1},
+ {{t,30},1},{{t,32},1},
+ {{t,35},1},{{t,37},0},
+ {{t,40},1},{{t,42},1},{{t,44},1},
+ {{t,47},1},{{t,48},1},
+ {{t,51},1},{{t,53},1},{{t,55},0},
+ {{t,58},1},{{t,60},1},{{t,62},1},{{t,64},0},
+ {{t,67},1},{{t,69},1},{{t,71},1},{{t,74},1},
+ {{t,76},0},{{t,78},1},
+ {{t,82},2}]} = cover:analyse(t, calls, line),
+ ok = file:delete(File),
ok.
-otp_8270(doc) ->
- ["OTP-8270. Bug."];
-otp_8270(suite) -> [];
+%% OTP-8270. Bug.
otp_8270(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line ok = file:set_cwd(DataDir),
+ DataDir = proplists:get_value(data_dir, Config),
+ ok = file:set_cwd(DataDir),
- ?line PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
As = [{args," -pa " ++ PrivDir}],
- ?line {ok,N1} = ?t:start_node(cover_n1,slave,As),
- ?line {ok,N2} = ?t:start_node(cover_n2,slave,As),
- ?line {ok,N3} = ?t:start_node(cover_n3,slave,As),
-
+ {ok,N1} = test_server:start_node(cover_n1,slave,As),
+ {ok,N2} = test_server:start_node(cover_n2,slave,As),
+ {ok,N3} = test_server:start_node(cover_n3,slave,As),
+
timer:sleep(500),
{ok,[_,_,_]} = cover:start(nodes()),
- Test = <<
- "-module(m).\n"
- "-compile(export_all).\n"
- "t() -> t(0).\n"
- "l() ->\n"
- " catch ets:tab2list(cover_internal_data_table).\n"
- "t(Sz) ->\n"
- " case ets:info(cover_internal_data_table, size) of\n"
- " Sz ->\n"
- " m:t(Sz); % Not a local call! Newly loaded code is entered.\n"
- " NSz ->\n"
- " % error_logger:info_msg(\"~p: ~p ~p change~n L1 ~p~n\", \n"
- " % [node(), Sz, NSz, l()]),\n"
- " m:t(NSz)\n"
- " end.\n">>,
- ?line _File = c_mod(m, Test, Config),
+ Test = <<"-module(m).\n"
+ "-compile(export_all).\n"
+ "t() -> t(0).\n"
+ "l() ->\n"
+ " catch ets:tab2list(cover_internal_data_table).\n"
+ "t(Sz) ->\n"
+ " case ets:info(cover_internal_data_table, size) of\n"
+ " Sz ->\n"
+ " m:t(Sz); % Not a local call! Newly loaded code is entered.\n"
+ " NSz ->\n"
+ " % error_logger:info_msg(\"~p: ~p ~p change~n L1 ~p~n\", \n"
+ " % [node(), Sz, NSz, l()]),\n"
+ " m:t(NSz)\n"
+ " end.\n">>,
+ _File = c_mod(m, Test, Config),
Fun = fun m:t/0,
- ?line Pid1 = spawn(Fun),
- ?line Pid2 = spawn(N1, Fun),
- ?line Pid3 = spawn(N2, Fun),
- ?line Pid4 = spawn(N3, Fun),
+ Pid1 = spawn(Fun),
+ Pid2 = spawn(N1, Fun),
+ Pid3 = spawn(N2, Fun),
+ Pid4 = spawn(N3, Fun),
- ?line {ok, m} = cover:compile_beam(m),
+ {ok, m} = cover:compile_beam(m),
timer:sleep(1000),
- ?line Info = erlang:process_info(Pid1),
- ?line N1_info = rpc:call(N1, erlang, process_info, [Pid2]),
- ?line N2_info = rpc:call(N2, erlang, process_info, [Pid3]),
- ?line N3_info = rpc:call(N3, erlang, process_info, [Pid4]),
+ Info = erlang:process_info(Pid1),
+ N1_info = rpc:call(N1, erlang, process_info, [Pid2]),
+ N2_info = rpc:call(N2, erlang, process_info, [Pid3]),
+ N3_info = rpc:call(N3, erlang, process_info, [Pid4]),
- ?line true = is_list(Info),
- ?line {N1,true} = {N1,is_list(N1_info)},
- ?line {N2,true} = {N2,is_list(N2_info)},
- ?line {N3,true} = {N3,is_list(N3_info)},
+ true = is_list(Info),
+ {N1,true} = {N1,is_list(N1_info)},
+ {N2,true} = {N2,is_list(N2_info)},
+ {N3,true} = {N3,is_list(N3_info)},
exit(Pid1,kill),
- ?line ?t:stop_node(N1),
- ?line ?t:stop_node(N2),
- ?line ?t:stop_node(N3),
+ test_server:stop_node(N1),
+ test_server:stop_node(N2),
+ test_server:stop_node(N3),
ok.
-otp_8273(doc) ->
- ["OTP-8273. Bug."];
-otp_8273(suite) -> [];
+%% OTP-8273. Bug.
otp_8273(Config) when is_list(Config) ->
Test = <<"-module(t).
-export([t/0]).
@@ -1243,27 +1215,22 @@ otp_8273(Config) when is_list(Config) ->
bar = false orelse bar,
ok.
">>,
- ?line File = cc_mod(t, Test, Config),
- ?line ok = t:t(),
- ?line ok = file:delete(File),
+ File = cc_mod(t, Test, Config),
+ ok = t:t(),
+ ok = file:delete(File),
ok.
-otp_8340(doc) ->
- ["OTP-8340. Bug."];
-otp_8340(suite) -> [];
+%% OTP-8340. Bug.
otp_8340(Config) when is_list(Config) ->
[{{t,1},1},{{t,2},1},{{t,4},1}] =
- analyse_expr(<<"<< \n"
- " <<3:2, \n"
- " SeqId:62>> \n"
- " || SeqId <- [64] >>">>, Config),
-
+ analyse_expr(<<"<< \n"
+ " <<3:2, \n"
+ " SeqId:62>> \n"
+ " || SeqId <- [64] >>">>, Config),
ok.
-otp_8188(doc) ->
- ["Clauses on the same line."];
-otp_8188(suite) -> [];
+%% Clauses on the same line.
otp_8188(Config) when is_list(Config) ->
%% This example covers the bug report:
Test = <<"-module(t).
@@ -1279,10 +1246,10 @@ otp_8188(Config) when is_list(Config) ->
_Res =
?FOOBAR(X).
">>,
- ?line File = cc_mod(t, Test, Config),
- ?line false = t:test(nok),
- ?line {ok,[{{t,11},1},{{t,12},1}]} = cover:analyse(t, calls, line),
- ?line ok = file:delete(File),
+ File = cc_mod(t, Test, Config),
+ false = t:test(nok),
+ {ok,[{{t,11},1},{{t,12},1}]} = cover:analyse(t, calls, line),
+ ok = file:delete(File),
%% Bit string comprehensions are now traversed;
%% the handling of list comprehensions has been improved:
@@ -1293,39 +1260,39 @@ otp_8188(Config) when is_list(Config) ->
ok.
bug_8188(Cf) ->
- ?line [{{t,1},1},{{t,2},1},{{t,3},1}] =
- analyse_expr(<<"A = 3,\n" % 1
- " case A of\n" % 1
- " 2 -> two; 3 -> three end, A + 2">>, % 1
- Cf),
-
- ?line [{{t,1},1},
- {{t,2},0},
- {{t,3},1},
- {{t,4},1},
- {{t,5},1},
- {{t,6},0},
- {{t,7},1},
- {{t,9},2}] =
- analyse_expr(<<"case two() of\n" % 1
- " 1 -> 2;\n" % 0
- " _ -> begin 3 end\n" % 1
- " +\n" % 1
- " begin 4 end end, case two() of\n" % 1
- " 1 -> a;\n" % 0
- " 2 -> b; 3 -> c\n" % 1
- " end.\n"
- "two() -> 2">>, Cf), % 2
-
- ?line [{{t,1},1}, {{t,2},1}, {{t,3},1},
- {{t,4},1}, {{t,5},1}, {{t,6},0}] =
- analyse_expr(<<" self() ! 1,\n"
- " receive \n"
- " X=1 -> a;\n"
- " X=2 -> b end, case X of \n"
- " 1 -> a;\n"
- " 2 -> b\n"
- " end">>, Cf),
+ [{{t,1},1},{{t,2},1},{{t,3},1}] =
+ analyse_expr(<<"A = 3,\n" % 1
+ " case A of\n" % 1
+ " 2 -> two; 3 -> three end, A + 2">>, % 1
+ Cf),
+
+ [{{t,1},1},
+ {{t,2},0},
+ {{t,3},1},
+ {{t,4},1},
+ {{t,5},1},
+ {{t,6},0},
+ {{t,7},1},
+ {{t,9},2}] =
+ analyse_expr(<<"case two() of\n" % 1
+ " 1 -> 2;\n" % 0
+ " _ -> begin 3 end\n" % 1
+ " +\n" % 1
+ " begin 4 end end, case two() of\n" % 1
+ " 1 -> a;\n" % 0
+ " 2 -> b; 3 -> c\n" % 1
+ " end.\n"
+ "two() -> 2">>, Cf), % 2
+
+ [{{t,1},1}, {{t,2},1}, {{t,3},1},
+ {{t,4},1}, {{t,5},1}, {{t,6},0}] =
+ analyse_expr(<<" self() ! 1,\n"
+ " receive \n"
+ " X=1 -> a;\n"
+ " X=2 -> b end, case X of \n"
+ " 1 -> a;\n"
+ " 2 -> b\n"
+ " end">>, Cf),
T0 = <<"t1(X) ->\n "
"case X of\n"
@@ -1339,42 +1306,42 @@ bug_8188(Cf) ->
" end">>,
T1 = [<<"a = t1(1). ">>,T0],
- ?line [{{t,1},1}, {{t,2},1}, {{t,3},1}, {{t,4},0},
- {{t,5},0}, {{t,6},1}, {{t,7},1}, {{t,8},0}, {{t,9},0}] =
- analyse_expr(T1, Cf),
+ [{{t,1},1}, {{t,2},1}, {{t,3},1}, {{t,4},0},
+ {{t,5},0}, {{t,6},1}, {{t,7},1}, {{t,8},0}, {{t,9},0}] =
+ analyse_expr(T1, Cf),
T2 = [<<"b = t1(2). ">>,T0],
- ?line [{{t,1},1}, {{t,2},1}, {{t,3},0}, {{t,4},1},
- {{t,5},0}, {{t,6},1}, {{t,7},0}, {{t,8},1}, {{t,9},0}] =
- analyse_expr(T2, Cf),
+ [{{t,1},1}, {{t,2},1}, {{t,3},0}, {{t,4},1},
+ {{t,5},0}, {{t,6},1}, {{t,7},0}, {{t,8},1}, {{t,9},0}] =
+ analyse_expr(T2, Cf),
T3 = [<<"c = t1(3). ">>,T0],
- ?line [{{t,1},1}, {{t,2},1}, {{t,3},0}, {{t,4},1},
- {{t,5},1}, {{t,6},1}, {{t,7},0}, {{t,8},1}, {{t,9},0}] =
- analyse_expr(T3, Cf),
+ [{{t,1},1}, {{t,2},1}, {{t,3},0}, {{t,4},1},
+ {{t,5},1}, {{t,6},1}, {{t,7},0}, {{t,8},1}, {{t,9},0}] =
+ analyse_expr(T3, Cf),
T4 = [<<"d = t1(4). ">>,T0],
- ?line [{{t,1},1}, {{t,2},1}, {{t,3},0}, {{t,4},0},
- {{t,5},0}, {{t,6},1}, {{t,7},0}, {{t,8},0}, {{t,9},1}] =
- analyse_expr(T4, Cf),
-
- ?line [{{t,1},1},{{t,2},1},{{t,3},1},{{t,4},1},{{t,5},1}] =
- analyse_expr(
- <<"2 = x3(1). "
- "x3(X) ->\n"
- " case X of \n"
- " 1 -> case X of\n"
- " 1 -> a, Y = 2;\n"
- " 2 -> b, Y = 3 end, Y; 2 -> Y = 4 end, Y">>, Cf),
-
- ?line [{{t,1},1},{{t,2},1},{{t,3},1},{{t,4},1}] =
- analyse_expr(
- <<"1 = x4(1). "
- "x4(X) ->\n"
- " case X of\n"
- " 1 -> case X of\n"
- " 1 -> Y = 1 end, case X of 1 -> Y = 1 end, Y end">>,
- Cf),
+ [{{t,1},1}, {{t,2},1}, {{t,3},0}, {{t,4},0},
+ {{t,5},0}, {{t,6},1}, {{t,7},0}, {{t,8},0}, {{t,9},1}] =
+ analyse_expr(T4, Cf),
+
+ [{{t,1},1},{{t,2},1},{{t,3},1},{{t,4},1},{{t,5},1}] =
+ analyse_expr(
+ <<"2 = x3(1). "
+ "x3(X) ->\n"
+ " case X of \n"
+ " 1 -> case X of\n"
+ " 1 -> a, Y = 2;\n"
+ " 2 -> b, Y = 3 end, Y; 2 -> Y = 4 end, Y">>, Cf),
+
+ [{{t,1},1},{{t,2},1},{{t,3},1},{{t,4},1}] =
+ analyse_expr(
+ <<"1 = x4(1). "
+ "x4(X) ->\n"
+ " case X of\n"
+ " 1 -> case X of\n"
+ " 1 -> Y = 1 end, case X of 1 -> Y = 1 end, Y end">>,
+ Cf),
T10 = <<"t1(X) ->\n"
"if\n"
@@ -1386,19 +1353,16 @@ bug_8188(Cf) ->
" 2 -> b; 3 -> c\n"
" end">>,
T11 = [<<"a = t1(1). ">>,T10],
- ?line [{{t,1},1}, {{t,2},1}, {{t,3},1}, {{t,4},1},
- {{t,5},1}, {{t,6},1}, {{t,7},1}, {{t,8},0}] =
- analyse_expr(T11, Cf),
+ [{{t,1},1}, {{t,2},1}, {{t,3},1}, {{t,4},1},
+ {{t,5},1}, {{t,6},1}, {{t,7},1}, {{t,8},0}] = analyse_expr(T11, Cf),
T12 = [<<"b = t1(2). ">>,T10],
- ?line [{{t,1},1}, {{t,2},1}, {{t,3},0}, {{t,4},1},
- {{t,5},0}, {{t,6},1}, {{t,7},0}, {{t,8},1}] =
- analyse_expr(T12, Cf),
+ [{{t,1},1}, {{t,2},1}, {{t,3},0}, {{t,4},1},
+ {{t,5},0}, {{t,6},1}, {{t,7},0}, {{t,8},1}] = analyse_expr(T12, Cf),
T13 = [<<"c = t1(3). ">>,T10],
- ?line [{{t,1},1}, {{t,2},1}, {{t,3},0}, {{t,4},1},
- {{t,5},0}, {{t,6},1}, {{t,7},0}, {{t,8},1}] =
- analyse_expr(T13, Cf),
+ [{{t,1},1}, {{t,2},1}, {{t,3},0}, {{t,4},1},
+ {{t,5},0}, {{t,6},1}, {{t,7},0}, {{t,8},1}] = analyse_expr(T13, Cf),
T20 = <<"t1(X) ->\n"
"case X of\n"
@@ -1411,204 +1375,185 @@ bug_8188(Cf) ->
" end">>,
T21 = [<<"a = t1(1). ">>,T20],
- ?line [{{t,1},1}, {{t,2},1}, {{t,3},1}, {{t,4},0},
- {{t,5},0}, {{t,6},1}, {{t,7},1}, {{t,8},0}] =
- analyse_expr(T21, Cf),
+ [{{t,1},1}, {{t,2},1}, {{t,3},1}, {{t,4},0},
+ {{t,5},0}, {{t,6},1}, {{t,7},1}, {{t,8},0}] = analyse_expr(T21, Cf),
T22 = [<<"b = t1(2). ">>,T20],
- ?line [{{t,1},1}, {{t,2},1}, {{t,3},0}, {{t,4},1},
- {{t,5},0}, {{t,6},1}, {{t,7},0}, {{t,8},1}] =
- analyse_expr(T22, Cf),
+ [{{t,1},1}, {{t,2},1}, {{t,3},0}, {{t,4},1},
+ {{t,5},0}, {{t,6},1}, {{t,7},0}, {{t,8},1}] = analyse_expr(T22, Cf),
T23 = [<<"c = t1(3). ">>,T20],
- ?line [{{t,1},1}, {{t,2},1}, {{t,3},0}, {{t,4},1},
- {{t,5},0}, {{t,6},1}, {{t,7},0}, {{t,8},1}] =
- analyse_expr(T23, Cf),
+ [{{t,1},1}, {{t,2},1}, {{t,3},0}, {{t,4},1},
+ {{t,5},0}, {{t,6},1}, {{t,7},0}, {{t,8},1}] = analyse_expr(T23, Cf),
T30 = <<
- "t1(X) ->\n"
- "case X of\n"
- " 1 -> a;\n"
- " 2 -> b; 3 -> case X of 1 -> a; 2 -> b; 3 -> c end end, case X of\n"
- " 1 -> a;\n"
- " 2 -> b; 3 -> c\n"
- " end\n">>,
+ "t1(X) ->\n"
+ "case X of\n"
+ " 1 -> a;\n"
+ " 2 -> b; 3 -> case X of 1 -> a; 2 -> b; 3 -> c end end, case X of\n"
+ " 1 -> a;\n"
+ " 2 -> b; 3 -> c\n"
+ " end\n">>,
T31 = [<<"a = t1(1). ">>,T30],
- ?line [{{t,1},1}, {{t,2},1}, {{t,3},1},
- {{t,4},1}, {{t,5},1}, {{t,6},0}] =
- analyse_expr(T31, Cf),
+ [{{t,1},1}, {{t,2},1}, {{t,3},1},
+ {{t,4},1}, {{t,5},1}, {{t,6},0}] = analyse_expr(T31, Cf),
T32 = [<<"b = t1(2). ">>,T30],
- ?line [{{t,1},1}, {{t,2},1}, {{t,3},0},
- {{t,4},1}, {{t,5},0}, {{t,6},1}] =
- analyse_expr(T32, Cf),
+ [{{t,1},1}, {{t,2},1}, {{t,3},0},
+ {{t,4},1}, {{t,5},0}, {{t,6},1}] = analyse_expr(T32, Cf),
T33 = [<<"c = t1(3). ">>,T30],
- ?line [{{t,1},1}, {{t,2},1}, {{t,3},0},
- {{t,4},1}, {{t,5},0}, {{t,6},1}] =
- analyse_expr(T33, Cf),
+ [{{t,1},1}, {{t,2},1}, {{t,3},0},
+ {{t,4},1}, {{t,5},0}, {{t,6},1}] = analyse_expr(T33, Cf),
%% 'try' now traverses the body as a body...
- ?line [{{t,1},1},{{t,2},1},{{t,3},1},{{t,4},0},{{t,6},1}] =
- analyse_expr(<<"try \n"
- " B = 2, \n"
- " C = erlang:error(foo), \n"
- " {B,C} \n"
- "catch _:_ -> \n"
- " foo \n"
- "end">>, Cf),
+ [{{t,1},1},{{t,2},1},{{t,3},1},{{t,4},0},{{t,6},1}] =
+ analyse_expr(<<"try \n"
+ " B = 2, \n"
+ " C = erlang:error(foo), \n"
+ " {B,C} \n"
+ "catch _:_ -> \n"
+ " foo \n"
+ "end">>, Cf),
%% receive after:
- ?line [{{t,1},1},{{t,2},0},{{t,3},1}] =
- analyse_expr(<<"receive \n"
- " X=1 -> a; \n"
- " X=2 -> b after begin 10 end -> X=3 end">>, Cf),
- ?line [{{t,1},1},{{t,2},0},{{t,3},1}] =
- analyse_expr(<<"receive \n"
- " X=1 -> a; \n"
- " X=2 -> b after 10 -> begin X=3 end end">>, Cf),
+ [{{t,1},1},{{t,2},0},{{t,3},1}] =
+ analyse_expr(<<"receive \n"
+ " X=1 -> a; \n"
+ " X=2 -> b after begin 10 end -> X=3 end">>, Cf),
+ [{{t,1},1},{{t,2},0},{{t,3},1}] =
+ analyse_expr(<<"receive \n"
+ " X=1 -> a; \n"
+ " X=2 -> b after 10 -> begin X=3 end end">>, Cf),
ok.
comprehension_8188(Cf) ->
- ?line [{{t,1},1}] =
- analyse_expr(<<"[begin X end || X <- [1,2,3], X > 1]">>, Cf),
- ?line [{{t,1},1},{{t,2},1}] =
- analyse_expr(<<"[begin X end || \n"
- " X <- [1,2,3], X > 1]">>, Cf),
- ?line [{{t,1},1},{{t,2},1},{{t,3},3}] =
- analyse_expr(<<"[begin X end || \n "
- " X <- [1,2,3], \n "
- " X > 1]">>, Cf),
- ?line [{{t,1},1},{{t,3},1},{{t,4},3}] =
- analyse_expr(<<"[begin X end || \n "
- " X <- \n "
- " [1,2,3], \n "
- " X > 1]">>, Cf),
- ?line [{{t,1},1},{{t,2},2}] =
- analyse_expr(<<"[ \n "
- " X || X <- [1,2,3], X > 1]">>, Cf),
- ?line [{{t,1},1},{{t,2},2},{{t,3},3}] =
- analyse_expr(<<"[ \n"
- " X || X <- [1,2,3], \n"
- " X > 1]">>, Cf),
- ?line [{{t,1},1},{{t,2},1},{{t,3},2}] =
- analyse_expr(<<"[ \n "
- " X || X <- [1,2,3], X > 1, \n"
- " X > 2]">>, Cf),
-
- ?line [{{t,1},1},
- {{t,3},2},
- {{t,5},1},
- {{t,7},1},
- {{t,8},0},
- {{t,12},3},
- {{t,15},2},
- {{t,17},2},
- {{t,18},1}] =
- analyse_expr(<<"[ \n" % 1
- " begin\n"
- " X * 2\n" % 2
- " end ||\n"
- " X <- [1,\n" % 1
- " case two() of\n"
- " 2 -> 2;\n" % 1
- " _ -> two\n" % 0
- " end,\n"
- " 3],\n"
- " begin\n"
- " math:sqrt(X) > 1.0\n" % 3
- " end,\n"
- " begin\n"
- " true\n" % 2
- " end,\n"
- " true]. \n" % 2
- " two() -> 2">>, Cf), % 1
-
- ?line [{{t,1},1},
- {{t,2},2},
- {{t,3},1},
- {{t,5},1},
- {{t,6},0},
- {{t,9},3},
- {{t,10},2},
- {{t,11},2},
- {{t,12},1}] =
- analyse_expr(<<"[ \n"
- " X * 2 || \n" % 2
- " X <- [1,\n" % 1
- " case two() of\n"
- " 2 -> 2;\n" % 1
- " _ -> two\n" % 0
- " end,\n"
- " 3],\n"
- " math:sqrt(X) > 1.0,\n" % 3
- " true,\n" % 2
- " true]. \n" % 2
- " two() -> 2">>, Cf), % 1
-
- ?line [{{t,1},1},
- {{t,2},2},
- {{t,3},1},
- {{t,4},1},
- {{t,5},0},
- {{t,8},1},
- {{t,9},0},
- {{t,12},3},
- {{t,13},2},
- {{t,14},2}] =
- analyse_expr(<<"<< \n" % 1
- " << (X*2) >> || \n" % 2
- " <<X>> <= << (case two() of\n"
- " 2 -> 1;\n" % 1
- " _ -> 2\n" % 0
- " end)/integer,\n"
- " (case two() of \n"
- " 2 -> 2;\n" % 1
- " _ -> two\n" % 0
- " end)/integer,\n"
- " 3 >>, \n"
- " math:sqrt(X) > 1.0,\n" % 3
- " true >>.\n" % 2
- "two() -> 2">>, Cf),
-
- ?line [{{t,1},1},
- {{t,2},4},
- {{t,4},1},
- {{t,6},1},
- {{t,7},0},
- {{t,10},3},
- {{t,11},2},
- {{t,12},4},
- {{t,13},1}] =
- analyse_expr(<<"<< \n" % 1
- " << (2)\n" % 4
- " :(8) >> || \n"
- " <<X>> <= << 1,\n" % 1
- " (case two() of \n"
- " 2 -> 2;\n" % 1
- " _ -> two\n" % 0
- " end)/integer,\n"
- " 3 >>, \n"
- " math:sqrt(X) > 1.0,\n" % 3
- " <<_>> <= << 1, 2 >>,\n" % 2
- " true >>.\n" % 4
- "two() -> 2">>, Cf), % 1
-
+ [{{t,1},1}] = analyse_expr(<<"[begin X end || X <- [1,2,3], X > 1]">>, Cf),
+ [{{t,1},1},{{t,2},1}] = analyse_expr(<<"[begin X end || \n"
+ " X <- [1,2,3], X > 1]">>, Cf),
+ [{{t,1},1},{{t,2},1},{{t,3},3}] = analyse_expr(<<"[begin X end || \n "
+ " X <- [1,2,3], \n "
+ " X > 1]">>, Cf),
+ [{{t,1},1},{{t,3},1},{{t,4},3}] = analyse_expr(<<"[begin X end || \n "
+ " X <- \n "
+ " [1,2,3], \n "
+ " X > 1]">>, Cf),
+ [{{t,1},1},{{t,2},2}] = analyse_expr(<<"[ \n "
+ " X || X <- [1,2,3], X > 1]">>, Cf),
+ [{{t,1},1},{{t,2},2},{{t,3},3}] = analyse_expr(<<"[ \n"
+ " X || X <- [1,2,3], \n"
+ " X > 1]">>, Cf),
+ [{{t,1},1},{{t,2},1},{{t,3},2}] = analyse_expr(<<"[ \n "
+ " X || X <- [1,2,3], X > 1, \n"
+ " X > 2]">>, Cf),
+
+ [{{t,1},1},
+ {{t,3},2},
+ {{t,5},1},
+ {{t,7},1},
+ {{t,8},0},
+ {{t,12},3},
+ {{t,15},2},
+ {{t,17},2},
+ {{t,18},1}] = analyse_expr(<<"[ \n" % 1
+ " begin\n"
+ " X * 2\n" % 2
+ " end ||\n"
+ " X <- [1,\n" % 1
+ " case two() of\n"
+ " 2 -> 2;\n" % 1
+ " _ -> two\n" % 0
+ " end,\n"
+ " 3],\n"
+ " begin\n"
+ " math:sqrt(X) > 1.0\n" % 3
+ " end,\n"
+ " begin\n"
+ " true\n" % 2
+ " end,\n"
+ " true]. \n" % 2
+ " two() -> 2">>, Cf), % 1
+
+ [{{t,1},1},
+ {{t,2},2},
+ {{t,3},1},
+ {{t,5},1},
+ {{t,6},0},
+ {{t,9},3},
+ {{t,10},2},
+ {{t,11},2},
+ {{t,12},1}] = analyse_expr(<<"[ \n"
+ " X * 2 || \n" % 2
+ " X <- [1,\n" % 1
+ " case two() of\n"
+ " 2 -> 2;\n" % 1
+ " _ -> two\n" % 0
+ " end,\n"
+ " 3],\n"
+ " math:sqrt(X) > 1.0,\n" % 3
+ " true,\n" % 2
+ " true]. \n" % 2
+ " two() -> 2">>, Cf), % 1
+
+ [{{t,1},1},
+ {{t,2},2},
+ {{t,3},1},
+ {{t,4},1},
+ {{t,5},0},
+ {{t,8},1},
+ {{t,9},0},
+ {{t,12},3},
+ {{t,13},2},
+ {{t,14},2}] = analyse_expr(<<"<< \n" % 1
+ " << (X*2) >> || \n" % 2
+ " <<X>> <= << (case two() of\n"
+ " 2 -> 1;\n" % 1
+ " _ -> 2\n" % 0
+ " end)/integer,\n"
+ " (case two() of \n"
+ " 2 -> 2;\n" % 1
+ " _ -> two\n" % 0
+ " end)/integer,\n"
+ " 3 >>, \n"
+ " math:sqrt(X) > 1.0,\n" % 3
+ " true >>.\n" % 2
+ "two() -> 2">>, Cf),
+ [{{t,1},1},
+ {{t,2},4},
+ {{t,4},1},
+ {{t,6},1},
+ {{t,7},0},
+ {{t,10},3},
+ {{t,11},2},
+ {{t,12},4},
+ {{t,13},1}] = analyse_expr(<<"<< \n" % 1
+ " << (2)\n" % 4
+ " :(8) >> || \n"
+ " <<X>> <= << 1,\n" % 1
+ " (case two() of \n"
+ " 2 -> 2;\n" % 1
+ " _ -> two\n" % 0
+ " end)/integer,\n"
+ " 3 >>, \n"
+ " math:sqrt(X) > 1.0,\n" % 3
+ " <<_>> <= << 1, 2 >>,\n" % 2
+ " true >>.\n" % 4
+ "two() -> 2">>, Cf), % 1
ok.
eep37(Config) when is_list(Config) ->
[{{t,1},1},{{t,2},1},{{t,4},6},{{t,6},1},{{t,8},1}] =
- analyse_expr(<<"begin\n" % 1
- " F =\n" % 1
- " fun Fact(N) when N > 0 ->\n"
- " N * Fact(N - 1);\n" % 6
- " Fact(0) ->\n"
- " 1\n" % 1
- " end,\n"
- " F(6)\n" % 1
- "end\n">>,
- Config),
+ analyse_expr(<<"begin\n" % 1
+ " F =\n" % 1
+ " fun Fact(N) when N > 0 ->\n"
+ " N * Fact(N - 1);\n" % 6
+ " Fact(0) ->\n"
+ " 1\n" % 1
+ " end,\n"
+ " F(6)\n" % 1
+ "end\n">>,
+ Config),
ok.
otp_10979_hanging_node(_Config) ->
@@ -1621,42 +1566,40 @@ otp_10979_hanging_node(_Config) ->
P2 = processes(),
case P2--P1 of
- [] ->
- ok;
- New ->
- [io:format("New: ~p, ~p~n",[P,process_info(P)]) || P<-New],
- ct:fail(hanging_process)
+ [] ->
+ ok;
+ New ->
+ [io:format("New: ~p, ~p~n",[P,process_info(P)]) || P<-New],
+ ct:fail(hanging_process)
end,
ok.
-compile_beam_opts(doc) ->
- ["Take compiler options from beam in cover:compile_beam"];
-compile_beam_opts(suite) -> [];
+%% Take compiler options from beam in cover:compile_beam
compile_beam_opts(Config) when is_list(Config) ->
{ok, Cwd} = file:get_cwd(),
- ok = file:set_cwd(?config(priv_dir, Config)),
- IncDir = filename:join(?config(data_dir, Config),
- "included_functions"),
- File = filename:join([?config(data_dir, Config), "otp_11439", "t.erl"]),
+ ok = file:set_cwd(proplists:get_value(priv_dir, Config)),
+ IncDir = filename:join(proplists:get_value(data_dir, Config),
+ "included_functions"),
+ File = filename:join([proplists:get_value(data_dir, Config), "otp_11439", "t.erl"]),
%% use all compiler options allowed by cover:filter_options
%% i and d don't make sense when compiling from beam though
{ok, t} =
- compile:file(File, [{i, IncDir},
- {d, 'BOOL'},
- {d, 'MACRO', macro_defined},
- export_all,
- debug_info,
- return_errors]),
+ compile:file(File, [{i, IncDir},
+ {d, 'BOOL'},
+ {d, 'MACRO', macro_defined},
+ export_all,
+ debug_info,
+ return_errors]),
code:purge(t),
code:delete(t),
Exports =
- [{func1,0},
- {macro, 0},
- {exported,0},
- {nonexported,0},
- {module_info,0},
- {module_info,1}],
+ [{func1,0},
+ {macro, 0},
+ {exported,0},
+ {nonexported,0},
+ {module_info,0},
+ {module_info,1}],
Exports = t:module_info(exports),
{ok, t} = cover:compile_beam("t"),
Exports = t:module_info(exports),
@@ -1664,12 +1607,10 @@ compile_beam_opts(Config) when is_list(Config) ->
ok = file:set_cwd(Cwd),
ok.
-analyse_no_beam(doc) ->
- ["Don't crash if beam is not available"];
-analyse_no_beam(suite) -> [];
+%% Don't crash if beam is not available
analyse_no_beam(Config) when is_list(Config) ->
{ok, Cwd} = file:get_cwd(),
- ok = file:set_cwd(?config(data_dir, Config)),
+ ok = file:set_cwd(proplists:get_value(data_dir, Config)),
code:purge(t),
code:delete(t),
@@ -1707,8 +1648,8 @@ analyse_no_beam(Config) when is_list(Config) ->
%% file in this situation. The test below tests that this bug is
%% corrected.
line_0(Config) ->
- ok = file:set_cwd(filename:join(?config(data_dir, Config),
- "include_eunit_hrl")),
+ ok = file:set_cwd(filename:join(proplists:get_value(data_dir, Config),
+ "include_eunit_hrl")),
{ok, cover_inc_eunit} = compile:file(cover_inc_eunit,[debug_info]),
{ok, cover_inc_eunit} = cover:compile_beam(cover_inc_eunit),
{ok, CovOut} = cover:analyse_to_file(cover_inc_eunit),
@@ -1723,14 +1664,14 @@ line_0(Config) ->
%% OTP-13200: Return error instead of crashing when trying to compile
%% a beam which has no 'file' attribute.
compile_beam_no_file(Config) ->
- PrivDir = ?config(priv_dir,Config),
+ PrivDir = proplists:get_value(priv_dir,Config),
Dir = filename:join(PrivDir,"compile_beam_no_file"),
ok = filelib:ensure_dir(filename:join(Dir,"*")),
code:add_patha(Dir),
Str = lists:concat(
- ["-module(nofile).\n"
- "-compile(export_all).\n"
- "foo() -> ok.\n"]),
+ ["-module(nofile).\n"
+ "-compile(export_all).\n"
+ "foo() -> ok.\n"]),
TT = do_scan(Str),
Forms = [ begin {ok,Y} = erl_parse:parse_form(X),Y end || X <- TT ],
{ok,_,Bin} = compile:forms(Forms,[debug_info]),
@@ -1746,8 +1687,7 @@ do_scan(Str) ->
{done,{ok,T,_},C} = erl_scan:tokens([],Str,0),
[ T | do_scan(C) ].
-otp_13277(doc) ->
- ["PR 856. Fix a bc bug."];
+%% PR 856. Fix a bc bug.
otp_13277(Config) ->
Test = <<"-module(t).
-export([t/0]).
@@ -1759,9 +1699,9 @@ otp_13277(Config) ->
t() ->
pad(<<\"hi\">>, 2).
">>,
- ?line File = cc_mod(t, Test, Config),
- ?line <<"hi##">> = t:t(),
- ?line ok = file:delete(File),
+ File = cc_mod(t, Test, Config),
+ <<"hi##">> = t:t(),
+ ok = file:delete(File),
ok.
%% Test general expressions in a binary comprehension.
@@ -1793,7 +1733,7 @@ analyse_expr(Expr, Config) ->
cc_mod(M, Binary, Config) ->
{ok, Dir} = file:get_cwd(),
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
ok = file:set_cwd(PrivDir),
File = atom_to_list(M) ++ ".erl",
try
@@ -1805,7 +1745,7 @@ cc_mod(M, Binary, Config) ->
c_mod(M, Binary, Config) ->
{ok, Dir} = file:get_cwd(),
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
ok = file:set_cwd(PrivDir),
File = atom_to_list(M) ++ ".erl",
try
@@ -1828,12 +1768,12 @@ lsfiles(Dir) ->
files(Files, Ext) ->
lists:filter(fun(File) ->
- case filename:extension(File) of
- Ext -> true;
- _ -> false
- end
- end,
- Files).
+ case filename:extension(File) of
+ Ext -> true;
+ _ -> false
+ end
+ end,
+ Files).
remove([File|Files]) ->
ok = file:delete(File),
@@ -1850,9 +1790,9 @@ decompile([]) ->
is_unloaded(What) ->
if
- is_list(What) -> true;
- What==non_existing -> true;
- true -> false
+ is_list(What) -> true;
+ What==non_existing -> true;
+ true -> false
end.
check_f_calls(F1,F2) ->
@@ -1862,18 +1802,18 @@ check_f_calls(F1,F2) ->
cover_which_nodes(Expected) ->
case cover:which_nodes() of
- Expected ->
- ok;
- Other ->
- {Time,ok} = timer:tc(fun Retry() ->
- case cover:which_nodes() of
- Expected -> ok;
- _ ->
- ?t:sleep(100),
- Retry()
- end
- end),
- io:format("~p ms before cover:which_nodes() returned ~p",
- [Time,Expected]),
- Expected = Other
+ Expected ->
+ ok;
+ Other ->
+ {Time,ok} = timer:tc(fun Retry() ->
+ case cover:which_nodes() of
+ Expected -> ok;
+ _ ->
+ timer:sleep(100),
+ Retry()
+ end
+ end),
+ io:format("~p ms before cover:which_nodes() returned ~p",
+ [Time,Expected]),
+ Expected = Other
end.
diff --git a/lib/tools/test/cprof_SUITE.erl b/lib/tools/test/cprof_SUITE.erl
index 8beaf4f399..9cbc27fb17 100644
--- a/lib/tools/test/cprof_SUITE.erl
+++ b/lib/tools/test/cprof_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@
-else.
-include_lib("common_test/include/ct.hrl").
-endif.
-
+
-ifdef(debug).
-ifdef(STANDALONE).
-define(line, erlang:display({?MODULE,?LINE}), ).
@@ -56,7 +56,7 @@
-endif.
-define(dbgformat(A,B),noop).
-endif.
-
+
-ifdef(STANDALONE).
config(priv_dir, _) ->
".";
@@ -64,69 +64,43 @@ config(data_dir, _) ->
"cprof_SUITE_data".
-else.
%% When run in test server.
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- init_per_testcase/2, end_per_testcase/2,
- not_run/1]).
+-export([all/0, suite/0,
+ init_per_testcase/2, end_per_testcase/2,
+ not_run/1]).
-export([basic/1, on_load/1, modules/1]).
-
+
init_per_testcase(_Case, Config) ->
- ?line Dog=test_server:timetrap(test_server:seconds(30)),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
+end_per_testcase(_Case, _Config) ->
erlang:trace_pattern({'_','_','_'}, false, [local,meta,call_count]),
erlang:trace_pattern(on_load, false, [local,meta,call_count]),
erlang:trace(all, false, [all]),
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{seconds,30}}].
all() ->
case test_server:is_native(cprof_SUITE) of
- true -> [not_run];
- false -> [basic, on_load, modules]
+ true -> [not_run];
+ false -> [basic, on_load, modules]
end.
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
not_run(Config) when is_list(Config) ->
{skipped,"Native code"}.
-basic(suite) ->
- [];
-basic(doc) ->
- ["Tests basic profiling"];
+%% Tests basic profiling
basic(Config) when is_list(Config) ->
basic_test().
-on_load(suite) ->
- [];
-on_load(doc) ->
- ["Tests profiling of unloaded module"];
+%% Tests profiling of unloaded module
on_load(Config) when is_list(Config) ->
on_load_test(Config).
-modules(suite) ->
- [];
-modules(doc) ->
- ["Tests profiling of several modules"];
+%% Tests profiling of several modules
modules(Config) when is_list(Config) ->
modules_test(Config).
@@ -137,164 +111,163 @@ modules(Config) when is_list(Config) ->
%%%
basic_test() ->
- ?line M = 1000,
+ M = 1000,
%%
- ?line M2 = M*2,
- ?line M3 = M*3,
- ?line M2__1 = M2 + 1,
- ?line M3__1 = M3 + 1,
- ?line N = cprof:stop(),
+ M2 = M*2,
+ M3 = M*3,
+ M2__1 = M2 + 1,
+ M3__1 = M3 + 1,
+ N = cprof:stop(),
%%
- ?line 2 = cprof:start(?MODULE, seq_r),
- ?line 1 = cprof:start(?MODULE, seq, 3),
- ?line L = seq(1, M, fun succ/1),
- ?line Lr = seq_r(1, M, fun succ/1),
- ?line L = lists:reverse(Lr),
+ 2 = cprof:start(?MODULE, seq_r),
+ 1 = cprof:start(?MODULE, seq, 3),
+ L = seq(1, M, fun succ/1),
+ Lr = seq_r(1, M, fun succ/1),
+ L = lists:reverse(Lr),
%%
- ?line io:format("~p~n~p~n~p~n",
- [erlang:trace_info({?MODULE,sec_r,3}, all),
- erlang:trace_info({?MODULE,sec_r,4}, all),
- erlang:trace_info({?MODULE,sec,3}, all)]),
+ io:format("~p~n~p~n~p~n",
+ [erlang:trace_info({?MODULE,sec_r,3}, all),
+ erlang:trace_info({?MODULE,sec_r,4}, all),
+ erlang:trace_info({?MODULE,sec,3}, all)]),
%%
- ?line ModAna1 = {?MODULE,M2__1,[{{?MODULE,seq_r,4},M},
- {{?MODULE,seq,3},M},
- {{?MODULE,seq_r,3},1}]},
- ?line ModAna1 = cprof:analyse(?MODULE,0),
- ?line {M2__1, [ModAna1]} = cprof:analyse(),
- ?line ModAna1 = cprof:analyse(?MODULE, 1),
- ?line {M2__1, [ModAna1]} = cprof:analyse(1),
+ ModAna1 = {?MODULE,M2__1,[{{?MODULE,seq_r,4},M},
+ {{?MODULE,seq,3},M},
+ {{?MODULE,seq_r,3},1}]},
+ ModAna1 = cprof:analyse(?MODULE,0),
+ {M2__1, [ModAna1]} = cprof:analyse(),
+ ModAna1 = cprof:analyse(?MODULE, 1),
+ {M2__1, [ModAna1]} = cprof:analyse(1),
%%
- ?line ModAna2 = {?MODULE,M2__1,[{{?MODULE,seq_r,4},M},
- {{?MODULE,seq,3},M}]},
- ?line ModAna2 = cprof:analyse(?MODULE, 2),
- ?line {M2__1, [ModAna2]} = cprof:analyse(2),
+ ModAna2 = {?MODULE,M2__1,[{{?MODULE,seq_r,4},M},
+ {{?MODULE,seq,3},M}]},
+ ModAna2 = cprof:analyse(?MODULE, 2),
+ {M2__1, [ModAna2]} = cprof:analyse(2),
%%
2 = cprof:pause(?MODULE, seq_r),
- ?line L = seq(1, M, fun succ/1),
- ?line Lr = seq_r(1, M, fun succ/1),
+ L = seq(1, M, fun succ/1),
+ Lr = seq_r(1, M, fun succ/1),
%%
- ?line ModAna3 = {?MODULE,M3__1,[{{?MODULE,seq,3},M2},
- {{?MODULE,seq_r,4},M},
- {{?MODULE,seq_r,3},1}]},
- ?line ModAna3 = cprof:analyse(?MODULE),
+ ModAna3 = {?MODULE,M3__1,[{{?MODULE,seq,3},M2},
+ {{?MODULE,seq_r,4},M},
+ {{?MODULE,seq_r,3},1}]},
+ ModAna3 = cprof:analyse(?MODULE),
%%
- ?line N = cprof:pause(),
- ?line L = seq(1, M, fun succ/1),
- ?line Lr = seq_r(1, M, fun succ/1),
+ N = cprof:pause(),
+ L = seq(1, M, fun succ/1),
+ Lr = seq_r(1, M, fun succ/1),
%%
- ?line {M3__1, [ModAna3]} = cprof:analyse(),
+ {M3__1, [ModAna3]} = cprof:analyse(),
%%
- ?line N = cprof:restart(),
- ?line L = seq(1, M, fun succ/1),
- ?line Lr = seq_r(1, M, fun succ/1),
+ N = cprof:restart(),
+ L = seq(1, M, fun succ/1),
+ Lr = seq_r(1, M, fun succ/1),
%%
- ?line ModAna1 = cprof:analyse(?MODULE),
+ ModAna1 = cprof:analyse(?MODULE),
%%
- ?line N = cprof:stop(),
- ?line {?MODULE,0,[]} = cprof:analyse(?MODULE),
- ?line {0,[]} = cprof:analyse(),
+ N = cprof:stop(),
+ {?MODULE,0,[]} = cprof:analyse(?MODULE),
+ {0,[]} = cprof:analyse(),
ok.
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
on_load_test(Config) ->
- ?line Priv = ?config(priv_dir, Config),
- ?line Data = ?config(data_dir, Config),
- ?line File = filename:join(Data, "cprof_SUITE_test"),
- ?line Module = cprof_SUITE_test,
- ?line M = 1000,
+ Priv = proplists:get_value(priv_dir, Config),
+ Data = proplists:get_value(data_dir, Config),
+ File = filename:join(Data, "cprof_SUITE_test"),
+ Module = cprof_SUITE_test,
+ M = 1000,
%%
- ?line M2 = M*2,
- ?line M2__1 = M2 + 1,
- ?line N1 = cprof:start(),
+ M2 = M*2,
+ M2__1 = M2 + 1,
+ N1 = cprof:start(),
- ?line {ok,Module} = c:c(File, [{outdir,Priv}]),
+ {ok,Module} = c:c(File, [{outdir,Priv}]),
%% If this system is hipe-enabled, the loader may have called module_info/1
%% when Module was loaded above. Reset the call count to avoid seeing
%% the call in the analysis below.
- ?line 1 = cprof:restart(Module, module_info, 1),
-
- ?line L = Module:seq(1, M, fun succ/1),
- ?line Lr = Module:seq_r(1, M, fun succ/1),
- ?line Lr = lists:reverse(L),
- ?line N2 = cprof:pause(),
- ?line N3 = cprof:pause(Module),
- ?line {Module,M2__1,[{{Module,seq_r,4},M},
- {{Module,seq,3},M},
- {{Module,seq_r,3},1}]} = cprof:analyse(Module),
- ?line io:format("~p ~p ~p~n", [N1, N2, N3]),
- ?line code:purge(Module),
- ?line code:delete(Module),
- ?line N4 = N2 - N3,
+ 1 = cprof:restart(Module, module_info, 1),
+
+ L = Module:seq(1, M, fun succ/1),
+ Lr = Module:seq_r(1, M, fun succ/1),
+ Lr = lists:reverse(L),
+ N2 = cprof:pause(),
+ N3 = cprof:pause(Module),
+ {Module,M2__1,[{{Module,seq_r,4},M},
+ {{Module,seq,3},M},
+ {{Module,seq_r,3},1}]} = cprof:analyse(Module),
+ io:format("~p ~p ~p~n", [N1, N2, N3]),
+ code:purge(Module),
+ code:delete(Module),
+ N4 = N2 - N3,
%%
- ?line N4 = cprof:restart(),
- ?line {ok,Module} = c:c(File, [{outdir,Priv}]),
- ?line L = Module:seq(1, M, fun succ/1),
- ?line Lr = Module:seq_r(1, M, fun succ/1),
- ?line L = seq(1, M, fun succ/1),
- ?line Lr = seq_r(1, M, fun succ/1),
- ?line N2 = cprof:pause(),
- ?line {Module,0,[]} = cprof:analyse(Module),
- ?line M_1 = M - 1,
- ?line M4__4 = M*4 - 4,
- ?line M10_7 = M*10 - 7,
- ?line {?MODULE,M10_7,[{{?MODULE,succ,1},M4__4},
- {{?MODULE,seq_r,4},M},
- {{?MODULE,seq,3},M},
- {{?MODULE,'-on_load_test/1-fun-5-',1},M_1},
- {{?MODULE,'-on_load_test/1-fun-4-',1},M_1},
- {{?MODULE,'-on_load_test/1-fun-3-',1},M_1},
- {{?MODULE,'-on_load_test/1-fun-2-',1},M_1},
- {{?MODULE,seq_r,3},1}]}
- = cprof:analyse(?MODULE),
- ?line N2 = cprof:stop(),
+ N4 = cprof:restart(),
+ {ok,Module} = c:c(File, [{outdir,Priv}]),
+ L = Module:seq(1, M, fun succ/1),
+ Lr = Module:seq_r(1, M, fun succ/1),
+ L = seq(1, M, fun succ/1),
+ Lr = seq_r(1, M, fun succ/1),
+ N2 = cprof:pause(),
+ {Module,0,[]} = cprof:analyse(Module),
+ M_1 = M - 1,
+ M4__4 = M*4 - 4,
+ M10_7 = M*10 - 7,
+ {?MODULE,M10_7,[{{?MODULE,succ,1},M4__4},
+ {{?MODULE,seq_r,4},M},
+ {{?MODULE,seq,3},M},
+ {{?MODULE,'-on_load_test/1-fun-5-',1},M_1},
+ {{?MODULE,'-on_load_test/1-fun-4-',1},M_1},
+ {{?MODULE,'-on_load_test/1-fun-3-',1},M_1},
+ {{?MODULE,'-on_load_test/1-fun-2-',1},M_1},
+ {{?MODULE,seq_r,3},1}]}
+ = cprof:analyse(?MODULE),
+ N2 = cprof:stop(),
ok.
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
modules_test(Config) ->
- ?line Priv = ?config(priv_dir, Config),
- ?line Data = ?config(data_dir, Config),
- ?line File = filename:join(Data, "cprof_SUITE_test"),
- ?line Module = cprof_SUITE_test,
- ?line {ok,Module} = c:c(File, [{outdir,Priv}]),
- ?line M = 10,
+ Priv = proplists:get_value(priv_dir, Config),
+ Data = proplists:get_value(data_dir, Config),
+ File = filename:join(Data, "cprof_SUITE_test"),
+ Module = cprof_SUITE_test,
+ {ok,Module} = c:c(File, [{outdir,Priv}]),
+ M = 10,
%%
- ?line M2 = M*2,
- ?line M2__1 = M2 + 1,
- ?line erlang:yield(),
- ?line N = cprof:start(),
- ?line L = Module:seq(1, M, fun succ/1),
- ?line Lr = Module:seq_r(1, M, fun succ/1),
- ?line L = seq(1, M, fun succ/1),
- ?line Lr = seq_r(1, M, fun succ/1),
- ?line N = cprof:pause(),
- ?line Lr = lists:reverse(L),
- ?line M_1 = M - 1,
- ?line M4_4 = M*4 - 4,
- ?line M10_7 = M*10 - 7,
- ?line M2__1 = M*2 + 1,
- ?line {Tot,ModList} = cprof:analyse(),
- ?line {value,{?MODULE,M10_7,[{{?MODULE,succ,1},M4_4},
- {{?MODULE,seq_r,4},M},
- {{?MODULE,seq,3},M},
- {{?MODULE,'-modules_test/1-fun-3-',1},M_1},
- {{?MODULE,'-modules_test/1-fun-2-',1},M_1},
- {{?MODULE,'-modules_test/1-fun-1-',1},M_1},
- {{?MODULE,'-modules_test/1-fun-0-',1},M_1},
- {{?MODULE,seq_r,3},1}]}} =
- lists:keysearch(?MODULE, 1, ModList),
- ?line {value,{Module,M2__1,[{{Module,seq_r,4},M},
- {{Module,seq,3},M},
- {{Module,seq_r,3},1}]}} =
- lists:keysearch(Module, 1, ModList),
- ?line Tot = lists:foldl(fun ({_,C,_}, A) -> C+A end, 0, ModList),
- ?line {cprof,_,Prof} = cprof:analyse(cprof),
- ?line {value,{{cprof,pause,0},1}} =
- lists:keysearch({cprof,pause,0}, 1, Prof),
- ?line N = cprof:stop(),
+ M2 = M*2,
+ M2__1 = M2 + 1,
+ erlang:yield(),
+ N = cprof:start(),
+ L = Module:seq(1, M, fun succ/1),
+ Lr = Module:seq_r(1, M, fun succ/1),
+ L = seq(1, M, fun succ/1),
+ Lr = seq_r(1, M, fun succ/1),
+ N = cprof:pause(),
+ Lr = lists:reverse(L),
+ M_1 = M - 1,
+ M4_4 = M*4 - 4,
+ M10_7 = M*10 - 7,
+ M2__1 = M*2 + 1,
+ {Tot,ModList} = cprof:analyse(),
+ {value,{?MODULE,M10_7,[{{?MODULE,succ,1},M4_4},
+ {{?MODULE,seq_r,4},M},
+ {{?MODULE,seq,3},M},
+ {{?MODULE,'-modules_test/1-fun-3-',1},M_1},
+ {{?MODULE,'-modules_test/1-fun-2-',1},M_1},
+ {{?MODULE,'-modules_test/1-fun-1-',1},M_1},
+ {{?MODULE,'-modules_test/1-fun-0-',1},M_1},
+ {{?MODULE,seq_r,3},1}]}} =
+ lists:keysearch(?MODULE, 1, ModList),
+ {value,{Module,M2__1,[{{Module,seq_r,4},M},
+ {{Module,seq,3},M},
+ {{Module,seq_r,3},1}]}} =
+ lists:keysearch(Module, 1, ModList),
+ Tot = lists:foldl(fun ({_,C,_}, A) -> C+A end, 0, ModList),
+ {cprof,_,Prof} = cprof:analyse(cprof),
+ {value,{{cprof,pause,0},1}} = lists:keysearch({cprof,pause,0}, 1, Prof),
+ N = cprof:stop(),
ok.
@@ -303,7 +276,6 @@ modules_test(Config) ->
%% Local helpers
-
%% Stack recursive seq
seq(Stop, Stop, Succ) when is_function(Succ) ->
[Stop];
@@ -322,6 +294,5 @@ seq_r(Start, Stop, Succ, R) ->
seq_r(Succ(Start), Stop, Succ, [Start | R]).
-
%% Successor
succ(X) -> X+1.
diff --git a/lib/tools/test/emacs_SUITE.erl b/lib/tools/test/emacs_SUITE.erl
index 0c2d077e5d..77a8813db5 100644
--- a/lib/tools/test/emacs_SUITE.erl
+++ b/lib/tools/test/emacs_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/tools/test/emem_SUITE.erl b/lib/tools/test/emem_SUITE.erl
index 93d21623ce..6dca7f6739 100644
--- a/lib/tools/test/emem_SUITE.erl
+++ b/lib/tools/test/emem_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -19,15 +19,11 @@
%%
-module(emem_SUITE).
-%%-define(line_trace, 1).
-
--export([init_per_suite/1, end_per_suite/1,
+-export([all/0, suite/0,
+ init_per_testcase/2, end_per_testcase/2,
+ init_per_suite/1, end_per_suite/1,
receive_and_save_trace/2, send_trace/2]).
-
--export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,
- init_per_testcase/2, end_per_testcase/2]).
-
-export([live_node/1,
'sparc_sunos5.8_32b_emt2.0'/1,
'pc_win2000_32b_emt2.0'/1,
@@ -42,11 +38,8 @@
'sparc_sunos5.8_64b_emt1.0'/1]).
-include_lib("kernel/include/file.hrl").
-
-include_lib("common_test/include/ct.hrl").
--define(DEFAULT_TIMEOUT, ?t:minutes(5)).
-
-define(EMEM_64_32_COMMENT,
"64 bit trace; this build of emem can only handle 32 bit traces").
@@ -62,28 +55,19 @@
exit_code}).
%%
-%%
%% Exported suite functions
%%
-%%
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,5}}].
all() ->
- case is_debug_compiled() of
- true -> {skip, "Not run when debug compiled"};
- false -> test_cases()
+ case test_server:is_debug() of
+ true -> {skip, "Not run when debug compiled"};
+ false -> test_cases()
end.
-groups() ->
- [].
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
test_cases() ->
[live_node, 'sparc_sunos5.8_32b_emt2.0',
@@ -99,31 +83,26 @@ test_cases() ->
init_per_testcase(Case, Config) when is_list(Config) ->
case maybe_skip(Config) of
- {skip, _}=Skip -> Skip;
+ {skip, _}=Skip ->
+ Skip;
ok ->
- Dog = ?t:timetrap(?DEFAULT_TIMEOUT),
-
%% Until emem is completely stable we run these tests in a working
%% directory with an ignore_core_files file which will make the
%% search for core files ignore cores generated by this suite.
- ignore_cores:setup(?MODULE,
- Case,
- [{watchdog, Dog}, {testcase, Case} | Config])
+ ignore_cores:setup(?MODULE, Case, [{testcase, Case}|Config])
end.
end_per_testcase(_Case, Config) when is_list(Config) ->
ignore_cores:restore(Config),
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
ok.
maybe_skip(Config) ->
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
case filelib:is_dir(DataDir) of
false ->
{skip, "No data directory"};
true ->
- case ?config(emem, Config) of
+ case proplists:get_value(emem, Config) of
undefined ->
{skip, "emem not found"};
_ ->
@@ -159,13 +138,11 @@ end_per_suite(Config) when is_list(Config) ->
%%
%%
-live_node(doc) -> [];
-live_node(suite) -> [];
live_node(Config) when is_list(Config) ->
- ?line {ok, EmuFlag, Port} = start_emem(Config),
- ?line Nodename = mk_nodename(Config),
- ?line {ok, Node} = start_node(Nodename, EmuFlag),
- ?line NP = spawn(Node,
+ {ok, EmuFlag, Port} = start_emem(Config),
+ Nodename = mk_nodename(Config),
+ {ok, Node} = start_node(Nodename, EmuFlag),
+ NP = spawn(Node,
fun () ->
receive go -> ok end,
I = spawn(fun () -> ignorer end),
@@ -187,246 +164,216 @@ live_node(Config) when is_list(Config) ->
GC(),
GC()
end),
- ?line MRef = erlang:monitor(process, NP),
+ MRef = erlang:monitor(process, NP),
NP ! go,
- ?line receive
+ receive
{'DOWN', MRef, process, NP, Reason} ->
- ?line spawn(Node, fun () -> halt(17) end),
- ?line normal = Reason
+ spawn(Node, fun () -> halt(17) end),
+ normal = Reason
end,
- ?line Res = get_emem_result(Port),
- ?line {ok, Hostname} = inet:gethostname(),
- ?line ShortHostname = short_hostname(Hostname),
- ?line {true, _} = has_prefix(Nodename, Res#emem_res.nodename),
- ?line ShortHostname = short_hostname(Res#emem_res.hostname),
- ?line Bits = case erlang:system_info(wordsize) of
- 4 -> ?line "32 bits";
- 8 -> ?line "64 bits"
+ Res = get_emem_result(Port),
+ {ok, Hostname} = inet:gethostname(),
+ ShortHostname = short_hostname(Hostname),
+ {true, _} = has_prefix(Nodename, Res#emem_res.nodename),
+ ShortHostname = short_hostname(Res#emem_res.hostname),
+ Bits = case erlang:system_info(wordsize) of
+ 4 -> "32 bits";
+ 8 -> "64 bits"
end,
- ?line Bits = Res#emem_res.word_size,
- ?line "17" = Res#emem_res.exit_code,
- ?line emem_comment(Config).
+ Bits = Res#emem_res.word_size,
+ "17" = Res#emem_res.exit_code,
+ emem_comment(Config).
-'sparc_sunos5.8_32b_emt2.0'(doc) -> [];
-'sparc_sunos5.8_32b_emt2.0'(suite) -> [];
'sparc_sunos5.8_32b_emt2.0'(Config) when is_list(Config) ->
- ?line Res = run_emem_on_casefile(Config),
- ?line "test_server" = Res#emem_res.nodename,
- ?line "gorbag" = Res#emem_res.hostname,
- ?line "17074" = Res#emem_res.pid,
- ?line "2005-01-14 17:28:37.881980" = Res#emem_res.start_time,
- ?line "2.0" = Res#emem_res.trace_version,
- ?line "32 bits" = Res#emem_res.word_size,
- ?line ["15",
- "2665739", "8992", "548986", "16131", "539994",
- "4334192", "1", "99", "15", "98",
- "0", "0", "49", "0", "49"] = Res#emem_res.last_values,
- ?line ["5972061", "9662",
- "7987824", "5",
- "2375680", "3"] = Res#emem_res.maximum,
- ?line "0" = Res#emem_res.exit_code,
- ?line emem_comment(Config).
-
-'pc_win2000_32b_emt2.0'(doc) -> [];
-'pc_win2000_32b_emt2.0'(suite) -> [];
+ Res = run_emem_on_casefile(Config),
+ "test_server" = Res#emem_res.nodename,
+ "gorbag" = Res#emem_res.hostname,
+ "17074" = Res#emem_res.pid,
+ "2005-01-14 17:28:37.881980" = Res#emem_res.start_time,
+ "2.0" = Res#emem_res.trace_version,
+ "32 bits" = Res#emem_res.word_size,
+ ["15", "2665739", "8992", "548986", "16131", "539994",
+ "4334192", "1", "99", "15", "98",
+ "0", "0", "49", "0", "49"] = Res#emem_res.last_values,
+ ["5972061", "9662", "7987824", "5",
+ "2375680", "3"] = Res#emem_res.maximum,
+ "0" = Res#emem_res.exit_code,
+ emem_comment(Config).
+
'pc_win2000_32b_emt2.0'(Config) when is_list(Config) ->
- ?line Res = run_emem_on_casefile(Config),
- ?line "test_server" = Res#emem_res.nodename,
- ?line "E-788FCF5191B54" = Res#emem_res.hostname,
- ?line "504" = Res#emem_res.pid,
- ?line "2005-01-24 17:27:28.224000" = Res#emem_res.start_time,
- ?line "2.0" = Res#emem_res.trace_version,
- ?line "32 bits" = Res#emem_res.word_size,
- ?line ["11",
- "2932575", "8615", "641087", "68924", "632472"]
+ Res = run_emem_on_casefile(Config),
+ "test_server" = Res#emem_res.nodename,
+ "E-788FCF5191B54" = Res#emem_res.hostname,
+ "504" = Res#emem_res.pid,
+ "2005-01-24 17:27:28.224000" = Res#emem_res.start_time,
+ "2.0" = Res#emem_res.trace_version,
+ "32 bits" = Res#emem_res.word_size,
+ ["11", "2932575", "8615", "641087", "68924", "632472"]
= Res#emem_res.last_values,
- ?line ["5434206", "9285"] = Res#emem_res.maximum,
- ?line "0" = Res#emem_res.exit_code,
- ?line emem_comment(Config).
+ ["5434206", "9285"] = Res#emem_res.maximum,
+ "0" = Res#emem_res.exit_code,
+ emem_comment(Config).
-'pc.smp_linux2.2.19pre17_32b_emt2.0'(doc) -> [];
-'pc.smp_linux2.2.19pre17_32b_emt2.0'(suite) -> [];
'pc.smp_linux2.2.19pre17_32b_emt2.0'(Config) when is_list(Config) ->
- ?line Res = run_emem_on_casefile(Config),
- ?line "test_server" = Res#emem_res.nodename,
- ?line "four-roses" = Res#emem_res.hostname,
- ?line "20689" = Res#emem_res.pid,
- ?line "2005-01-20 13:11:26.143077" = Res#emem_res.start_time,
- ?line "2.0" = Res#emem_res.trace_version,
- ?line "32 bits" = Res#emem_res.word_size,
- ?line ["49",
- "2901817", "9011", "521610", "10875", "512599",
- "5392096", "2", "120", "10", "118",
- "0", "0", "59", "0", "59"] = Res#emem_res.last_values,
- ?line ["6182918", "9681",
- "9062112", "6",
- "2322432", "3"] = Res#emem_res.maximum,
- ?line "0" = Res#emem_res.exit_code,
- ?line emem_comment(Config).
-
-
-'powerpc_darwin7.7.0_32b_emt2.0'(doc) -> [];
-'powerpc_darwin7.7.0_32b_emt2.0'(suite) -> [];
+ Res = run_emem_on_casefile(Config),
+ "test_server" = Res#emem_res.nodename,
+ "four-roses" = Res#emem_res.hostname,
+ "20689" = Res#emem_res.pid,
+ "2005-01-20 13:11:26.143077" = Res#emem_res.start_time,
+ "2.0" = Res#emem_res.trace_version,
+ "32 bits" = Res#emem_res.word_size,
+ ["49", "2901817", "9011", "521610", "10875", "512599",
+ "5392096", "2", "120", "10", "118",
+ "0", "0", "59", "0", "59"] = Res#emem_res.last_values,
+ ["6182918", "9681",
+ "9062112", "6",
+ "2322432", "3"] = Res#emem_res.maximum,
+ "0" = Res#emem_res.exit_code,
+ emem_comment(Config).
+
+
'powerpc_darwin7.7.0_32b_emt2.0'(Config) when is_list(Config) ->
- ?line Res = run_emem_on_casefile(Config),
- ?line "test_server" = Res#emem_res.nodename,
- ?line "grima" = Res#emem_res.hostname,
- ?line "13021" = Res#emem_res.pid,
- ?line "2005-01-20 15:08:17.568668" = Res#emem_res.start_time,
- ?line "2.0" = Res#emem_res.trace_version,
- ?line "32 bits" = Res#emem_res.word_size,
- ?line ["9",
- "2784323", "8641", "531105", "15893", "522464"]
+ Res = run_emem_on_casefile(Config),
+ "test_server" = Res#emem_res.nodename,
+ "grima" = Res#emem_res.hostname,
+ "13021" = Res#emem_res.pid,
+ "2005-01-20 15:08:17.568668" = Res#emem_res.start_time,
+ "2.0" = Res#emem_res.trace_version,
+ "32 bits" = Res#emem_res.word_size,
+ ["9", "2784323", "8641", "531105", "15893", "522464"]
= Res#emem_res.last_values,
- ?line ["6150376", "9311"] = Res#emem_res.maximum,
- ?line "0" = Res#emem_res.exit_code,
- ?line emem_comment(Config).
+ ["6150376", "9311"] = Res#emem_res.maximum,
+ "0" = Res#emem_res.exit_code,
+ emem_comment(Config).
-'alpha_osf1v5.1_64b_emt2.0'(doc) -> [];
-'alpha_osf1v5.1_64b_emt2.0'(suite) -> [];
'alpha_osf1v5.1_64b_emt2.0'(Config) when is_list(Config) ->
- ?line Res = run_emem_on_casefile(Config),
- ?line "test_server" = Res#emem_res.nodename,
- ?line "thorin" = Res#emem_res.hostname,
- ?line "224630" = Res#emem_res.pid,
- ?line "2005-01-20 22:38:01.299632" = Res#emem_res.start_time,
- ?line "2.0" = Res#emem_res.trace_version,
- ?line "64 bits" = Res#emem_res.word_size,
- ?line case Res#emem_res.max_word_size of
- "32 bits" ->
- ?line emem_comment(Config, ?EMEM_64_32_COMMENT);
- "64 bits" ->
- ?line ["22",
- "6591992", "8625", "516785", "14805", "508160",
- "11429184", "5", "127", "254", "122",
- "0", "0", "61", "0", "61"] = Res#emem_res.last_values,
- ?line ["7041775", "9295",
- "11593024", "7",
- "2097152", "3"] = Res#emem_res.maximum,
- ?line "0" = Res#emem_res.exit_code,
- ?line emem_comment(Config)
- end.
-
-'sparc_sunos5.8_64b_emt2.0'(doc) -> [];
-'sparc_sunos5.8_64b_emt2.0'(suite) -> [];
+ Res = run_emem_on_casefile(Config),
+ "test_server" = Res#emem_res.nodename,
+ "thorin" = Res#emem_res.hostname,
+ "224630" = Res#emem_res.pid,
+ "2005-01-20 22:38:01.299632" = Res#emem_res.start_time,
+ "2.0" = Res#emem_res.trace_version,
+ "64 bits" = Res#emem_res.word_size,
+ case Res#emem_res.max_word_size of
+ "32 bits" ->
+ emem_comment(Config, ?EMEM_64_32_COMMENT);
+ "64 bits" ->
+ ["22",
+ "6591992", "8625", "516785", "14805", "508160",
+ "11429184", "5", "127", "254", "122",
+ "0", "0", "61", "0", "61"] = Res#emem_res.last_values,
+ ["7041775", "9295",
+ "11593024", "7",
+ "2097152", "3"] = Res#emem_res.maximum,
+ "0" = Res#emem_res.exit_code,
+ emem_comment(Config)
+ end.
+
'sparc_sunos5.8_64b_emt2.0'(Config) when is_list(Config) ->
- ?line Res = run_emem_on_casefile(Config),
- ?line "test_server" = Res#emem_res.nodename,
- ?line "gorbag" = Res#emem_res.hostname,
- ?line "10907" = Res#emem_res.pid,
- ?line "2005-01-20 13:48:34.677068" = Res#emem_res.start_time,
- ?line "2.0" = Res#emem_res.trace_version,
- ?line "64 bits" = Res#emem_res.word_size,
- ?line case Res#emem_res.max_word_size of
- "32 bits" ->
- ?line emem_comment(Config, ?EMEM_64_32_COMMENT);
- "64 bits" ->
- ?line ["16",
- "5032887", "8657", "530635", "14316", "521978",
- "8627140", "5", "139", "19", "134",
- "0", "0", "67", "0", "67"] = Res#emem_res.last_values,
- ?line ["11695070", "9324",
- "16360388", "10",
- "4136960", "3"] = Res#emem_res.maximum,
- ?line "0" = Res#emem_res.exit_code,
- ?line emem_comment(Config)
- end.
-
-'sparc_sunos5.8_32b_emt1.0'(doc) -> [];
-'sparc_sunos5.8_32b_emt1.0'(suite) -> [];
+ Res = run_emem_on_casefile(Config),
+ "test_server" = Res#emem_res.nodename,
+ "gorbag" = Res#emem_res.hostname,
+ "10907" = Res#emem_res.pid,
+ "2005-01-20 13:48:34.677068" = Res#emem_res.start_time,
+ "2.0" = Res#emem_res.trace_version,
+ "64 bits" = Res#emem_res.word_size,
+ case Res#emem_res.max_word_size of
+ "32 bits" ->
+ emem_comment(Config, ?EMEM_64_32_COMMENT);
+ "64 bits" ->
+ ["16",
+ "5032887", "8657", "530635", "14316", "521978",
+ "8627140", "5", "139", "19", "134",
+ "0", "0", "67", "0", "67"] = Res#emem_res.last_values,
+ ["11695070", "9324",
+ "16360388", "10",
+ "4136960", "3"] = Res#emem_res.maximum,
+ "0" = Res#emem_res.exit_code,
+ emem_comment(Config)
+ end.
+
'sparc_sunos5.8_32b_emt1.0'(Config) when is_list(Config) ->
- ?line Res = run_emem_on_casefile(Config),
- ?line "" = Res#emem_res.nodename,
- ?line "" = Res#emem_res.hostname,
- ?line "" = Res#emem_res.pid,
- ?line "" = Res#emem_res.start_time,
- ?line "1.0" = Res#emem_res.trace_version,
- ?line "32 bits" = Res#emem_res.word_size,
- ?line ["11",
- "2558261", "8643", "560610", "15325", "551967"]
+ Res = run_emem_on_casefile(Config),
+ "" = Res#emem_res.nodename,
+ "" = Res#emem_res.hostname,
+ "" = Res#emem_res.pid,
+ "" = Res#emem_res.start_time,
+ "1.0" = Res#emem_res.trace_version,
+ "32 bits" = Res#emem_res.word_size,
+ ["11", "2558261", "8643", "560610", "15325", "551967"]
= Res#emem_res.last_values,
- ?line ["2791121", "9317"] = Res#emem_res.maximum,
- ?line "0" = Res#emem_res.exit_code,
- ?line emem_comment(Config).
+ ["2791121", "9317"] = Res#emem_res.maximum,
+ "0" = Res#emem_res.exit_code,
+ emem_comment(Config).
-'pc_win2000_32b_emt1.0'(doc) -> [];
-'pc_win2000_32b_emt1.0'(suite) -> [];
'pc_win2000_32b_emt1.0'(Config) when is_list(Config) ->
- ?line Res = run_emem_on_casefile(Config),
- ?line "" = Res#emem_res.nodename,
- ?line "" = Res#emem_res.hostname,
- ?line "" = Res#emem_res.pid,
- ?line "" = Res#emem_res.start_time,
- ?line "1.0" = Res#emem_res.trace_version,
- ?line "32 bits" = Res#emem_res.word_size,
- ?line ["6",
- "2965248", "8614", "640897", "68903", "632283"]
+ Res = run_emem_on_casefile(Config),
+ "" = Res#emem_res.nodename,
+ "" = Res#emem_res.hostname,
+ "" = Res#emem_res.pid,
+ "" = Res#emem_res.start_time,
+ "1.0" = Res#emem_res.trace_version,
+ "32 bits" = Res#emem_res.word_size,
+ ["6", "2965248", "8614", "640897", "68903", "632283"]
= Res#emem_res.last_values,
- ?line ["3147090", "9283"] = Res#emem_res.maximum,
- ?line "0" = Res#emem_res.exit_code,
- ?line emem_comment(Config).
+ ["3147090", "9283"] = Res#emem_res.maximum,
+ "0" = Res#emem_res.exit_code,
+ emem_comment(Config).
-'powerpc_darwin7.7.0_32b_emt1.0'(doc) -> [];
-'powerpc_darwin7.7.0_32b_emt1.0'(suite) -> [];
'powerpc_darwin7.7.0_32b_emt1.0'(Config) when is_list(Config) ->
- ?line Res = run_emem_on_casefile(Config),
- ?line "" = Res#emem_res.nodename,
- ?line "" = Res#emem_res.hostname,
- ?line "" = Res#emem_res.pid,
- ?line "" = Res#emem_res.start_time,
- ?line "1.0" = Res#emem_res.trace_version,
- ?line "32 bits" = Res#emem_res.word_size,
- ?line ["8",
- "2852991", "8608", "529662", "15875", "521054"]
+ Res = run_emem_on_casefile(Config),
+ "" = Res#emem_res.nodename,
+ "" = Res#emem_res.hostname,
+ "" = Res#emem_res.pid,
+ "" = Res#emem_res.start_time,
+ "1.0" = Res#emem_res.trace_version,
+ "32 bits" = Res#emem_res.word_size,
+ ["8", "2852991", "8608", "529662", "15875", "521054"]
= Res#emem_res.last_values,
- ?line ["3173335", "9278"] = Res#emem_res.maximum,
- ?line "0" = Res#emem_res.exit_code,
- ?line emem_comment(Config).
+ ["3173335", "9278"] = Res#emem_res.maximum,
+ "0" = Res#emem_res.exit_code,
+ emem_comment(Config).
-'alpha_osf1v5.1_64b_emt1.0'(doc) -> [];
-'alpha_osf1v5.1_64b_emt1.0'(suite) -> [];
'alpha_osf1v5.1_64b_emt1.0'(Config) when is_list(Config) ->
- ?line Res = run_emem_on_casefile(Config),
- ?line "" = Res#emem_res.nodename,
- ?line "" = Res#emem_res.hostname,
- ?line "" = Res#emem_res.pid,
- ?line "" = Res#emem_res.start_time,
- ?line "1.0" = Res#emem_res.trace_version,
- ?line "64 bits" = Res#emem_res.word_size,
- ?line case Res#emem_res.max_word_size of
- "32 bits" ->
- ?line emem_comment(Config, ?EMEM_64_32_COMMENT);
- "64 bits" ->
- ?line ["22",
- "6820094", "8612", "515518", "14812", "506906"]
- = Res#emem_res.last_values,
- ?line ["7292413", "9282"] = Res#emem_res.maximum,
- ?line "0" = Res#emem_res.exit_code,
- ?line emem_comment(Config)
- end.
-
-'sparc_sunos5.8_64b_emt1.0'(doc) -> [];
-'sparc_sunos5.8_64b_emt1.0'(suite) -> [];
+ Res = run_emem_on_casefile(Config),
+ "" = Res#emem_res.nodename,
+ "" = Res#emem_res.hostname,
+ "" = Res#emem_res.pid,
+ "" = Res#emem_res.start_time,
+ "1.0" = Res#emem_res.trace_version,
+ "64 bits" = Res#emem_res.word_size,
+ case Res#emem_res.max_word_size of
+ "32 bits" ->
+ emem_comment(Config, ?EMEM_64_32_COMMENT);
+ "64 bits" ->
+ ["22",
+ "6820094", "8612", "515518", "14812", "506906"]
+ = Res#emem_res.last_values,
+ ["7292413", "9282"] = Res#emem_res.maximum,
+ "0" = Res#emem_res.exit_code,
+ emem_comment(Config)
+ end.
+
'sparc_sunos5.8_64b_emt1.0'(Config) when is_list(Config) ->
- ?line Res = run_emem_on_casefile(Config),
- ?line "" = Res#emem_res.nodename,
- ?line "" = Res#emem_res.hostname,
- ?line "" = Res#emem_res.pid,
- ?line "" = Res#emem_res.start_time,
- ?line "1.0" = Res#emem_res.trace_version,
- ?line "64 bits" = Res#emem_res.word_size,
- ?line case Res#emem_res.max_word_size of
- "32 bits" ->
- ?line emem_comment(Config, ?EMEM_64_32_COMMENT);
- "64 bits" ->
- ?line ["15",
- "4965746", "8234", "543940", "14443", "535706"]
- = Res#emem_res.last_values,
- ?line ["11697645", "8908"] = Res#emem_res.maximum,
- ?line "0" = Res#emem_res.exit_code,
- ?line emem_comment(Config)
- end.
+ Res = run_emem_on_casefile(Config),
+ "" = Res#emem_res.nodename,
+ "" = Res#emem_res.hostname,
+ "" = Res#emem_res.pid,
+ "" = Res#emem_res.start_time,
+ "1.0" = Res#emem_res.trace_version,
+ "64 bits" = Res#emem_res.word_size,
+ case Res#emem_res.max_word_size of
+ "32 bits" ->
+ emem_comment(Config, ?EMEM_64_32_COMMENT);
+ "64 bits" ->
+ ["15",
+ "4965746", "8234", "543940", "14443", "535706"]
+ = Res#emem_res.last_values,
+ ["11697645", "8908"] = Res#emem_res.maximum,
+ "0" = Res#emem_res.exit_code,
+ emem_comment(Config)
+ end.
%%
%%
@@ -444,84 +391,84 @@ receive_and_save_trace(PortNumber, FileName) when is_integer(PortNumber),
receive_loop(Socket, File) ->
receive
- {tcp, Socket, Data} ->
- ok = file:write(File, Data),
- receive_loop(Socket, File);
- {tcp_closed, Socket} ->
- file:close(File),
- ok;
- {tcp_error, Socket, Reason} ->
- file:close(File),
- {error, Reason}
+ {tcp, Socket, Data} ->
+ ok = file:write(File, Data),
+ receive_loop(Socket, File);
+ {tcp_closed, Socket} ->
+ file:close(File),
+ ok;
+ {tcp_error, Socket, Reason} ->
+ file:close(File),
+ {error, Reason}
end.
send_trace({Host, PortNumber}, FileName) when is_list(Host),
is_integer(PortNumber),
is_list(FileName) ->
- ?line {ok, F} = file:open(FileName, [read, compressed]),
- ?line {ok, S} = gen_tcp:connect(Host, PortNumber, [inet,{packet, 0}]),
- ?line send_loop(S, F);
+ {ok, F} = file:open(FileName, [read, compressed]),
+ {ok, S} = gen_tcp:connect(Host, PortNumber, [inet,{packet, 0}]),
+ send_loop(S, F);
send_trace(EmuFlag, FileName) when is_list(EmuFlag),
is_list(FileName) ->
- ?line ["+Mit", IpAddrStr, PortNoStr] = string:tokens(EmuFlag, " :"),
- ?line send_trace({IpAddrStr, list_to_integer(PortNoStr)}, FileName).
+ ["+Mit", IpAddrStr, PortNoStr] = string:tokens(EmuFlag, " :"),
+ send_trace({IpAddrStr, list_to_integer(PortNoStr)}, FileName).
send_loop(Socket, File) ->
- ?line case file:read(File, 128) of
- {ok, Data} ->
- ?line case gen_tcp:send(Socket, Data) of
- ok -> ?line send_loop(Socket, File);
- Error ->
- ?line gen_tcp:close(Socket),
- ?line file:close(File),
- Error
- end;
- eof ->
- ?line gen_tcp:close(Socket),
- ?line file:close(File),
- ?line ok;
- Error ->
- ?line gen_tcp:close(Socket),
- ?line file:close(File),
- ?line Error
- end.
+ case file:read(File, 128) of
+ {ok, Data} ->
+ case gen_tcp:send(Socket, Data) of
+ ok -> send_loop(Socket, File);
+ Error ->
+ gen_tcp:close(Socket),
+ file:close(File),
+ Error
+ end;
+ eof ->
+ gen_tcp:close(Socket),
+ file:close(File),
+ ok;
+ Error ->
+ gen_tcp:close(Socket),
+ file:close(File),
+ Error
+ end.
check_emem(Dir, Type) when is_atom(Type) ->
- ExeSuffix = case ?t:os_type() of
- {win32, _} -> ".exe";
- _ -> ""
- end,
+ ExeSuffix = case os:type() of
+ {win32, _} -> ".exe";
+ _ -> ""
+ end,
TypeSuffix = case Type of
- opt -> "";
- _ -> "." ++ atom_to_list(Type)
- end,
+ opt -> "";
+ _ -> "." ++ atom_to_list(Type)
+ end,
Emem = "emem" ++ TypeSuffix ++ ExeSuffix,
case check_file(filename:join([Dir, Emem])) of
- not_found -> ok;
- File ->
- Comment = case Type of
- opt -> "";
- _ -> "[emem " ++ atom_to_list(Type) ++ " compiled]"
- end,
- throw([{emem, File}, {emem_comment, Comment}])
+ not_found -> ok;
+ File ->
+ Comment = case Type of
+ opt -> "";
+ _ -> "[emem " ++ atom_to_list(Type) ++ " compiled]"
+ end,
+ throw([{emem, File}, {emem_comment, Comment}])
end.
check_dir(DirName) ->
case file:read_file_info(DirName) of
- {ok, #file_info {type = directory, access = A}} when A == read;
- A == read_write ->
- DirName;
- _ ->
- not_found
+ {ok, #file_info {type = directory, access = A}} when A == read;
+ A == read_write ->
+ DirName;
+ _ ->
+ not_found
end.
check_file(FileName) ->
case file:read_file_info(FileName) of
- {ok, #file_info {type = regular, access = A}} when A == read;
- A == read_write ->
- ?line FileName;
- _ ->
- ?line not_found
+ {ok, #file_info {type = regular, access = A}} when A == read;
+ A == read_write ->
+ FileName;
+ _ ->
+ not_found
end.
emem_comment(Config) when is_list(Config) ->
@@ -529,158 +476,158 @@ emem_comment(Config) when is_list(Config) ->
emem_comment(Config, ExtraComment)
when is_list(Config), is_list(ExtraComment) ->
- case {?config(emem_comment, Config), ExtraComment} of
- {"", ""} -> ?line ok;
- {"", XC} -> ?line {comment, XC};
- {EmemC, ""} -> ?line {comment, EmemC};
- {EmemC, XC} -> ?line {comment, EmemC ++ " " ++ XC}
+ case {proplists:get_value(emem_comment, Config), ExtraComment} of
+ {"", ""} -> ok;
+ {"", XC} -> {comment, XC};
+ {EmemC, ""} -> {comment, EmemC};
+ {EmemC, XC} -> {comment, EmemC ++ " " ++ XC}
end.
run_emem_on_casefile(Config) ->
- CaseName = atom_to_list(?config(testcase, Config)),
- ?line File = filename:join([?config(data_dir, Config), CaseName ++ ".gz"]),
- ?line case check_file(File) of
- not_found ->
- ?line ?t:fail({error, {filenotfound, File}});
- _ ->
- ?line ok
- end,
- ?line {ok, EmuFlag, Port} = start_emem(Config),
- ?line Parent = self(),
- ?line Ref = make_ref(),
- ?line spawn_link(fun () ->
- SRes = send_trace(EmuFlag, File),
- Parent ! {Ref, SRes}
- end),
- ?line Res = get_emem_result(Port),
- ?line receive
- {Ref, ok} ->
- ?line ok;
- {Ref, SendError} ->
- ?line ?t:format("Send result: ~p~n", [SendError])
- end,
- ?line Res.
+ CaseName = atom_to_list(proplists:get_value(testcase, Config)),
+ File = filename:join([proplists:get_value(data_dir, Config), CaseName ++ ".gz"]),
+ case check_file(File) of
+ not_found ->
+ ct:fail({error, {filenotfound, File}});
+ _ ->
+ ok
+ end,
+ {ok, EmuFlag, Port} = start_emem(Config),
+ Parent = self(),
+ Ref = make_ref(),
+ spawn_link(fun () ->
+ SRes = send_trace(EmuFlag, File),
+ Parent ! {Ref, SRes}
+ end),
+ Res = get_emem_result(Port),
+ receive
+ {Ref, ok} ->
+ ok;
+ {Ref, SendError} ->
+ io:format("Send result: ~p~n", [SendError])
+ end,
+ Res.
get_emem_result(Port) ->
- ?line {Res, LV} = get_emem_result(Port, {#emem_res{}, []}),
- ?line Res#emem_res{last_values = string:tokens(LV, " ")}.
+ {Res, LV} = get_emem_result(Port, {#emem_res{}, []}),
+ Res#emem_res{last_values = string:tokens(LV, " ")}.
get_emem_result(Port, {_EmemRes, _LastValues} = Res) ->
- ?line case get_emem_line(Port) of
- eof ->
- ?line Res;
- Line ->
- ?line get_emem_result(Port, parse_emem_line(Line, Res))
- end.
+ case get_emem_line(Port) of
+ eof ->
+ Res;
+ Line ->
+ get_emem_result(Port, parse_emem_line(Line, Res))
+ end.
parse_emem_main_header_footer_line(Line, {ER, LV} = Res) ->
%% Header
- ?line case has_prefix("> Nodename:", Line) of
- {true, NN} ->
- ?line throw({ER#emem_res{nodename = strip(NN)}, LV});
- false -> ?line ok
- end,
- ?line case has_prefix("> Hostname:", Line) of
- {true, HN} ->
- ?line throw({ER#emem_res{hostname = strip(HN)}, LV});
- false -> ?line ok
- end,
- ?line case has_prefix("> Pid:", Line) of
- {true, P} ->
- ?line throw({ER#emem_res{pid = strip(P)}, LV});
- false -> ?line ok
- end,
- ?line case has_prefix("> Start time (UTC):", Line) of
- {true, ST} ->
- ?line throw({ER#emem_res{start_time = strip(ST)}, LV});
- false -> ?line ok
- end,
- ?line case has_prefix("> Actual trace version:", Line) of
- {true, TV} ->
- ?line throw({ER#emem_res{trace_version = strip(TV)}, LV});
- false -> ?line ok
- end,
- ?line case has_prefix("> Maximum trace word size:", Line) of
- {true, MWS} ->
- ?line throw({ER#emem_res{max_word_size = strip(MWS)}, LV});
- false -> ?line ok
- end,
- ?line case has_prefix("> Actual trace word size:", Line) of
- {true, WS} ->
- ?line throw({ER#emem_res{word_size = strip(WS)}, LV});
- false -> ?line ok
- end,
+ case has_prefix("> Nodename:", Line) of
+ {true, NN} ->
+ throw({ER#emem_res{nodename = strip(NN)}, LV});
+ false -> ok
+ end,
+ case has_prefix("> Hostname:", Line) of
+ {true, HN} ->
+ throw({ER#emem_res{hostname = strip(HN)}, LV});
+ false -> ok
+ end,
+ case has_prefix("> Pid:", Line) of
+ {true, P} ->
+ throw({ER#emem_res{pid = strip(P)}, LV});
+ false -> ok
+ end,
+ case has_prefix("> Start time (UTC):", Line) of
+ {true, ST} ->
+ throw({ER#emem_res{start_time = strip(ST)}, LV});
+ false -> ok
+ end,
+ case has_prefix("> Actual trace version:", Line) of
+ {true, TV} ->
+ throw({ER#emem_res{trace_version = strip(TV)}, LV});
+ false -> ok
+ end,
+ case has_prefix("> Maximum trace word size:", Line) of
+ {true, MWS} ->
+ throw({ER#emem_res{max_word_size = strip(MWS)}, LV});
+ false -> ok
+ end,
+ case has_prefix("> Actual trace word size:", Line) of
+ {true, WS} ->
+ throw({ER#emem_res{word_size = strip(WS)}, LV});
+ false -> ok
+ end,
%% Footer
- ?line case has_prefix("> Maximum:", Line) of
- {true, M} ->
- ?line throw({ER#emem_res{maximum = string:tokens(M," ")}, LV});
- false -> ?line ok
- end,
- ?line case has_prefix("> Emulator exited with code:", Line) of
- {true, EC} ->
- ?line throw({ER#emem_res{exit_code = strip(EC)}, LV});
- false -> ?line ok
- end,
- ?line Res.
+ case has_prefix("> Maximum:", Line) of
+ {true, M} ->
+ throw({ER#emem_res{maximum = string:tokens(M," ")}, LV});
+ false -> ok
+ end,
+ case has_prefix("> Emulator exited with code:", Line) of
+ {true, EC} ->
+ throw({ER#emem_res{exit_code = strip(EC)}, LV});
+ false -> ok
+ end,
+ Res.
parse_emem_header_line(_Line, {_ER, _LV} = Res) ->
- ?line Res.
-
+ Res.
+
parse_emem_value_line(Line, {EmemRes, _OldLastValues}) ->
- ?line {EmemRes, Line}.
+ {EmemRes, Line}.
parse_emem_line("", Res) ->
- ?line Res;
+ Res;
parse_emem_line(Line, Res) ->
- ?line [Prefix | _] = Line,
+ [Prefix | _] = Line,
case Prefix of
- $> -> ?line catch parse_emem_main_header_footer_line(Line, Res);
- $| -> ?line catch parse_emem_header_line(Line, Res);
- _ -> ?line catch parse_emem_value_line(Line, Res)
+ $> -> catch parse_emem_main_header_footer_line(Line, Res);
+ $| -> catch parse_emem_header_line(Line, Res);
+ _ -> catch parse_emem_value_line(Line, Res)
end.
start_emem(Config) when is_list(Config) ->
- ?line Emem = ?config(emem, Config),
- ?line Cd = case ignore_cores:dir(Config) of
- false -> [];
- Dir -> [{cd, Dir}]
- end,
- ?line case open_port({spawn, Emem ++ " -t -n -o -i 1"},
- Cd ++ [{line, 1024}, eof]) of
- Port when is_port(Port) -> ?line {ok, read_emu_flag(Port), Port};
- Error -> ?line ?t:fail(Error)
- end.
+ Emem = proplists:get_value(emem, Config),
+ Cd = case ignore_cores:dir(Config) of
+ false -> [];
+ Dir -> [{cd, Dir}]
+ end,
+ case open_port({spawn, Emem ++ " -t -n -o -i 1"},
+ Cd ++ [{line, 1024}, eof]) of
+ Port when is_port(Port) -> {ok, read_emu_flag(Port), Port};
+ Error -> ct:fail(Error)
+ end.
read_emu_flag(Port) ->
- ?line Line = case get_emem_line(Port) of
- eof -> ?line ?t:fail(unexpected_end_of_file);
- L -> ?line L
- end,
- ?line case has_prefix("> Emulator command line argument:", Line) of
- {true, EmuFlag} -> EmuFlag;
- false -> ?line read_emu_flag(Port)
- end.
+ Line = case get_emem_line(Port) of
+ eof -> ct:fail(unexpected_end_of_file);
+ L -> L
+ end,
+ case has_prefix("> Emulator command line argument:", Line) of
+ {true, EmuFlag} -> EmuFlag;
+ false -> read_emu_flag(Port)
+ end.
get_emem_line(Port, Acc) ->
- ?line receive
- {Port, {data, {eol, Data}}} ->
- ?line Res = case Acc of
- [] -> ?line Data;
- _ -> ?line lists:flatten([Acc|Data])
- end,
- ?line ?t:format("~s", [Res]),
- ?line Res;
- {Port, {data, {noeol, Data}}} ->
- ?line get_emem_line(Port, [Acc|Data]);
- {Port, eof} ->
- ?line port_close(Port),
- ?line eof
- end.
+ receive
+ {Port, {data, {eol, Data}}} ->
+ Res = case Acc of
+ [] -> Data;
+ _ -> lists:flatten([Acc|Data])
+ end,
+ io:format("~s", [Res]),
+ Res;
+ {Port, {data, {noeol, Data}}} ->
+ get_emem_line(Port, [Acc|Data]);
+ {Port, eof} ->
+ port_close(Port),
+ eof
+ end.
get_emem_line(Port) ->
- ?line get_emem_line(Port, []).
+ get_emem_line(Port, []).
short_hostname([]) ->
[];
@@ -697,28 +644,13 @@ has_prefix(_, _) ->
false.
strip(Str) -> string:strip(Str).
-
+
mk_nodename(Config) ->
- {A, B, C} = now(),
+ Us = erlang:monotonic_time(),
atom_to_list(?MODULE)
- ++ "-" ++ atom_to_list(?config(testcase, Config))
- ++ "-" ++ integer_to_list(A*1000000000000 + B*1000000 + C).
+ ++ "-" ++ atom_to_list(proplists:get_value(testcase, Config))
+ ++ integer_to_list(Us).
start_node(Name, Args) ->
- ?line Pa = filename:dirname(code:which(?MODULE)),
- ?line ?t:start_node(Name, peer, [{args, Args ++ " -pa " ++ Pa}]).
-
-% stop_node(Node) ->
-% ?t:stop_node(Node).
-
-is_debug_compiled() ->
-is_debug_compiled(erlang:system_info(system_version)).
-
-is_debug_compiled([$d,$e,$b,$u,$g | _]) ->
- true;
-is_debug_compiled([ _, _, _, _]) ->
- false;
-is_debug_compiled([]) ->
- false;
-is_debug_compiled([_|Rest]) ->
- is_debug_compiled(Rest).
+ Pa = filename:dirname(code:which(?MODULE)),
+ test_server:start_node(Name, peer, [{args, Args ++ " -pa " ++ Pa}]).
diff --git a/lib/tools/test/eprof_SUITE.erl b/lib/tools/test/eprof_SUITE.erl
index 6274eabc37..e908413315 100644
--- a/lib/tools/test/eprof_SUITE.erl
+++ b/lib/tools/test/eprof_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -21,40 +21,23 @@
-include_lib("common_test/include/ct.hrl").
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2]).
-
+-export([all/0, suite/0]).
-export([tiny/1,eed/1,basic/1,basic_option/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{seconds,60}}].
all() ->
[basic, basic_option, tiny, eed].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
-basic(suite) -> [];
basic(Config) when is_list(Config) ->
%% load eprof_test and change directory
{ok, OldCurDir} = file:get_cwd(),
- Datadir = ?config(data_dir, Config),
- Privdir = ?config(priv_dir, Config),
+ Datadir = proplists:get_value(data_dir, Config),
+ Privdir = proplists:get_value(priv_dir, Config),
{ok,eprof_test} = compile:file(filename:join(Datadir, "eprof_test"),
[trace,{outdir, Privdir}]),
ok = file:set_cwd(Privdir),
@@ -98,9 +81,6 @@ basic(Config) when is_list(Config) ->
%% error case
- error = eprof:profile([Pid], fun() -> eprof_test:go(10) end),
- Pid = whereis(eprof),
- error = eprof:profile([Pid], fun() -> eprof_test:go(10) end),
A = spawn(fun() -> receive _ -> ok end end),
profiling = eprof:profile([A]),
true = exit(A, kill_it),
@@ -139,8 +119,8 @@ basic_option_1(Config) ->
%% load eprof_test and change directory
{ok, OldCurDir} = file:get_cwd(),
- Datadir = ?config(data_dir, Config),
- Privdir = ?config(priv_dir, Config),
+ Datadir = proplists:get_value(data_dir, Config),
+ Privdir = proplists:get_value(priv_dir, Config),
{ok,eprof_test} = compile:file(filename:join(Datadir, "eprof_test"),
[trace,{outdir, Privdir}]),
ok = file:set_cwd(Privdir),
@@ -178,13 +158,11 @@ basic_option_1(Config) ->
stopped = eprof:stop(),
ok.
-tiny(suite) -> [];
tiny(Config) when is_list(Config) ->
ensure_eprof_stopped(),
{ok, OldCurDir} = file:get_cwd(),
- Datadir = ?config(data_dir, Config),
- Privdir = ?config(priv_dir, Config),
- TTrap=?t:timetrap(60*1000),
+ Datadir = proplists:get_value(data_dir, Config),
+ Privdir = proplists:get_value(priv_dir, Config),
% (Trace)Compile to priv_dir and make sure the correct version is loaded.
{ok,eprof_suite_test} = compile:file(filename:join(Datadir,
"eprof_suite_test"),
@@ -200,16 +178,14 @@ tiny(Config) when is_list(Config) ->
ok = eprof:analyze(total),
ok = eprof:log("eprof_SUITE_logfile"),
stopped = eprof:stop(),
- ?t:timetrap_cancel(TTrap),
ok = file:set_cwd(OldCurDir),
ok.
-eed(suite) -> [];
eed(Config) when is_list(Config) ->
ensure_eprof_stopped(),
- Datadir = ?config(data_dir, Config),
- Privdir = ?config(priv_dir, Config),
- TTrap=?t:timetrap(5*60*1000),
+ Datadir = proplists:get_value(data_dir, Config),
+ Privdir = proplists:get_value(priv_dir, Config),
+ ct:timetrap({minutes, 5}),
%% (Trace)Compile to priv_dir and make sure the correct version is loaded.
code:purge(eed),
@@ -236,7 +212,6 @@ eed(Config) when is_list(Config) ->
ok = eprof:analyze(total),
ok = eprof:log("eprof_SUITE_logfile"),
stopped = eprof:stop(),
- ?t:timetrap_cancel(TTrap),
try
S = lists:flatten(io_lib:format("~p times slower",
[10*(T3-T2)/(T2-T1)])),
diff --git a/lib/tools/test/fprof_SUITE.erl b/lib/tools/test/fprof_SUITE.erl
index d1a673d6b7..affb45b7a6 100644
--- a/lib/tools/test/fprof_SUITE.erl
+++ b/lib/tools/test/fprof_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -22,25 +22,20 @@
-include_lib("common_test/include/ct.hrl").
%% Test server framework exports
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2, not_run/1]).
+-export([all/0, suite/0, not_run/1]).
%% Test suites
-export([stack_seq/1, tail_seq/1, create_file_slow/1, spawn_simple/1,
- imm_tail_seq/1, imm_create_file_slow/1, imm_compile/1,
- cpu_create_file_slow/1]).
+ imm_tail_seq/1, imm_create_file_slow/1, imm_compile/1,
+ cpu_create_file_slow/1]).
%% Other exports
-export([create_file_slow/2]).
-
%% Debug exports
-export([parse/1, verify/2]).
-export([spawn_simple_test/3]).
-
--define(line_trace,true).
-
%-define(debug,true).
-ifdef(debug).
-define(dbg(Str,Args), io:format(Str,Args)).
@@ -49,553 +44,495 @@
-endif.
-
%%%---------------------------------------------------------------------
%%% Test suites
%%%---------------------------------------------------------------------
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{seconds,60}}].
all() ->
case test_server:is_native(fprof_SUITE) of
- true -> [not_run];
- false ->
- [stack_seq, tail_seq, create_file_slow, spawn_simple,
- imm_tail_seq, imm_create_file_slow, imm_compile,
- cpu_create_file_slow]
+ true -> [not_run];
+ false ->
+ [stack_seq, tail_seq, create_file_slow, spawn_simple,
+ imm_tail_seq, imm_create_file_slow, imm_compile,
+ cpu_create_file_slow]
end.
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
not_run(Config) when is_list(Config) ->
{skipped, "Native code"}.
%%%---------------------------------------------------------------------
-stack_seq(doc) ->
- ["Tests a stack recursive variant of lists:seq/3"];
-stack_seq(suite) ->
- [];
+%% Tests a stack recursive variant of lists:seq/3
stack_seq(Config) when is_list(Config) ->
- ?line Timetrap = ?t:timetrap(?t:seconds(20)),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line TraceFile =
- filename:join(PrivDir, ?MODULE_STRING"_stack_seq.trace"),
- ?line AnalysisFile =
- filename:join(PrivDir, ?MODULE_STRING"_stack_seq.analysis"),
- ?line Start = 1,
- ?line Stop = 1000,
- ?line Succ = fun (X) -> X + 1 end,
- ?line ok = fprof:stop(kill),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ TraceFile = filename:join(PrivDir,
+ ?MODULE_STRING"_stack_seq.trace"),
+ AnalysisFile = filename:join(PrivDir,
+ ?MODULE_STRING"_stack_seq.analysis"),
+ Start = 1,
+ Stop = 1000,
+ Succ = fun (X) -> X + 1 end,
+ ok = fprof:stop(kill),
%%
- ?line TS0 = erlang:now(),
- ?line R0 = fprof:apply(fun seq/3, [Start, Stop, Succ], [{file, TraceFile}]),
- ?line TS1 = erlang:now(),
- ?line R = seq(Start, Stop, Succ),
- ?line TS2 = erlang:now(),
- ?line ok = fprof:profile(file, TraceFile),
- ?line ok = fprof:analyse(),
- ?line ok = fprof:analyse(dest, AnalysisFile),
- ?line ok = fprof:stop(),
- ?line R = R0,
+ TS0 = erlang:monotonic_time(),
+ R0 = fprof:apply(fun seq/3, [Start, Stop, Succ], [{file, TraceFile}]),
+ TS1 = erlang:monotonic_time(),
+ R = seq(Start, Stop, Succ),
+ TS2 = erlang:monotonic_time(),
+ ok = fprof:profile(file, TraceFile),
+ ok = fprof:analyse(),
+ ok = fprof:analyse(dest, AnalysisFile),
+ ok = fprof:stop(),
+ R = R0,
%%
- ?line {ok, [T, P]} = parse(AnalysisFile),
- ?line io:format("~p~n~n~p~n", [P, ets:tab2list(T)]),
- ?line ok = (catch verify(T, P)),
- ?line Proc = pid_to_list(self()),
- ?line case P of
- [{analysis_options, _},
- [{totals, _, Acc, _}],
- [{Proc, _, undefined, _} | _]] ->
- ok
- end,
+ {ok, [T, P]} = parse(AnalysisFile),
+ io:format("~p~n~n~p~n", [P, ets:tab2list(T)]),
+ ok = (catch verify(T, P)),
+ Proc = pid_to_list(self()),
+ case P of
+ [{analysis_options, _},
+ [{totals, _, Acc, _}],
+ [{Proc, _, undefined, _} | _]] ->
+ ok
+ end,
%%
- ?line check_own_and_acc(TraceFile,AnalysisFile),
+ check_own_and_acc(TraceFile,AnalysisFile),
%%
- ?line ets:delete(T),
- ?line file:delete(TraceFile),
- ?line file:delete(AnalysisFile),
- ?line ?t:timetrap_cancel(Timetrap),
- ?line Acc1 = ts_sub(TS1, TS0),
- ?line Acc2 = ts_sub(TS2, TS1),
- ?line io:format("ts:~w, fprof:~w, bare:~w.~n", [Acc, Acc1, Acc2]),
- {comment, io_lib:format("~p times slower", [Acc1/Acc2])}.
+ ets:delete(T),
+ file:delete(TraceFile),
+ file:delete(AnalysisFile),
+ Acc1 = TS1 - TS0,
+ Acc2 = TS2 - TS1,
+ io:format("ts:~w, fprof:~w, bare:~w.~n", [Acc, Acc1, Acc2]),
+ {comment, io_lib:format("~p times slower", [divide(Acc1,Acc2)])}.
%%%---------------------------------------------------------------------
-tail_seq(doc) ->
- ["Tests a tail recursive variant of lists:seq/3"];
-tail_seq(suite) ->
- [];
+%% Tests a tail recursive variant of lists:seq/3
tail_seq(Config) when is_list(Config) ->
- ?line Timetrap = ?t:timetrap(?t:seconds(10)),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line TraceFile =
- filename:join(PrivDir, ?MODULE_STRING"_tail_seq.trace"),
- ?line AnalysisFile =
- filename:join(PrivDir, ?MODULE_STRING"_tail_seq.analysis"),
- ?line Start = 1,
- ?line Stop = 1000,
- ?line Succ = fun (X) -> X + 1 end,
- ?line ok = fprof:stop(kill),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ TraceFile = filename:join(PrivDir,
+ ?MODULE_STRING"_tail_seq.trace"),
+ AnalysisFile = filename:join(PrivDir,
+ ?MODULE_STRING"_tail_seq.analysis"),
+ Start = 1,
+ Stop = 1000,
+ Succ = fun (X) -> X + 1 end,
+ ok = fprof:stop(kill),
%%
- ?line TS0 = erlang:now(),
- ?line R = seq_r(Start, Stop, Succ),
- ?line TS1 = erlang:now(),
+ TS0 = erlang:monotonic_time(),
+ R = seq_r(Start, Stop, Succ),
+ TS1 = erlang:monotonic_time(),
%%
- ?line R1 = fprof:apply(fun seq_r/3, [Start, Stop, Succ],
- [{file, TraceFile}]),
- ?line TS2 = erlang:now(),
- ?line ok = fprof:profile([{file,TraceFile}]),
- ?line ok = fprof:analyse(),
- ?line ok = fprof:analyse(dest, AnalysisFile),
- ?line ok = fprof:stop(),
- ?line R = R1,
+ R1 = fprof:apply(fun seq_r/3, [Start, Stop, Succ],
+ [{file, TraceFile}]),
+ TS2 = erlang:monotonic_time(),
+ ok = fprof:profile([{file,TraceFile}]),
+ ok = fprof:analyse(),
+ ok = fprof:analyse(dest, AnalysisFile),
+ ok = fprof:stop(),
+ R = R1,
%%
- ?line {ok, [T, P]} = parse(AnalysisFile),
- ?line io:format("~p~n~n~p~n", [P, ets:tab2list(T)]),
- ?line ok = verify(T, P),
- ?line Proc = pid_to_list(self()),
- ?line case P of
- [{analysis_options, _},
- [{totals, _, Acc, _}],
- [{Proc, _, undefined, _} | _]] ->
- ok
- end,
+ {ok, [T, P]} = parse(AnalysisFile),
+ io:format("~p~n~n~p~n", [P, ets:tab2list(T)]),
+ ok = verify(T, P),
+ Proc = pid_to_list(self()),
+ case P of
+ [{analysis_options, _},
+ [{totals, _, Acc, _}],
+ [{Proc, _, undefined, _} | _]] ->
+ ok
+ end,
%%
- ?line check_own_and_acc(TraceFile,AnalysisFile),
+ check_own_and_acc(TraceFile,AnalysisFile),
%%
- ?line ets:delete(T),
- ?line file:delete(TraceFile),
- ?line file:delete(AnalysisFile),
- ?line ?t:timetrap_cancel(Timetrap),
- ?line Acc1 = ts_sub(TS1, TS0),
- ?line Acc2 = ts_sub(TS2, TS1),
- ?line io:format("ts:~w, fprof:~w, bare:~w.~n", [Acc, Acc2, Acc1]),
- {comment, io_lib:format("~p times slower", [Acc2/Acc1])}.
+ ets:delete(T),
+ file:delete(TraceFile),
+ file:delete(AnalysisFile),
+ Acc1 = TS1 - TS0,
+ Acc2 = TS2 - TS1,
+ io:format("ts:~w, fprof:~w, bare:~w.~n", [Acc, Acc2, Acc1]),
+ {comment, io_lib:format("~p times slower", [divide(Acc2,Acc1)])}.
%%%---------------------------------------------------------------------
%% Tests the create_file_slow benchmark.
create_file_slow(Config) ->
case test_server:is_native(lists) orelse
- test_server:is_native(file) of
- true ->
- {skip,"Native libs -- tracing does not work"};
- false ->
- do_create_file_slow(Config)
+ test_server:is_native(file) of
+ true ->
+ {skip,"Native libs -- tracing does not work"};
+ false ->
+ do_create_file_slow(Config)
end.
do_create_file_slow(Config) ->
- ?line Timetrap = ?t:timetrap(?t:seconds(40)),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line TraceFile =
- filename:join(PrivDir, ?MODULE_STRING"_create_file_slow.trace"),
- ?line AnalysisFile =
- filename:join(PrivDir, ?MODULE_STRING"_create_file_slow.analysis"),
- ?line DataFile =
- filename:join(PrivDir, ?MODULE_STRING"_create_file_slow.data"),
- ?line ok = fprof:stop(kill),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ TraceFile = filename:join(PrivDir,
+ ?MODULE_STRING"_create_file_slow.trace"),
+ AnalysisFile = filename:join(PrivDir,
+ ?MODULE_STRING"_create_file_slow.analysis"),
+ DataFile = filename:join(PrivDir,
+ ?MODULE_STRING"_create_file_slow.data"),
+ ok = fprof:stop(kill),
%%
- ?line TS0 = erlang:now(),
- ?line ok = create_file_slow(DataFile, 1024),
- ?line TS1 = erlang:now(),
+ TS0 = erlang:monotonic_time(),
+ ok = create_file_slow(DataFile, 1024),
+ TS1 = erlang:monotonic_time(),
%%
- ?line ok = file:delete(DataFile),
- ?line TS2 = erlang:now(),
- ?line ok = fprof:apply(?MODULE, create_file_slow, [DataFile, 1024],
- [{file, TraceFile}]),
- ?line TS3 = erlang:now(),
- ?line ok = fprof:profile(file, TraceFile),
- ?line ok = fprof:analyse(),
- ?line ok = fprof:analyse(dest, AnalysisFile),
- ?line ok = fprof:stop(),
+ ok = file:delete(DataFile),
+ TS2 = erlang:monotonic_time(),
+ ok = fprof:apply(?MODULE, create_file_slow, [DataFile, 1024],
+ [{file, TraceFile}]),
+ TS3 = erlang:monotonic_time(),
+ ok = fprof:profile(file, TraceFile),
+ ok = fprof:analyse(),
+ ok = fprof:analyse(dest, AnalysisFile),
+ ok = fprof:stop(),
%%
- ?line {ok, [T, P]} = parse(AnalysisFile),
- ?line io:format("~p~n~n~p~n", [P, ets:tab2list(T)]),
- ?line ok = verify(T, P),
- ?line Proc = pid_to_list(self()),
- ?line case P of
- [{analysis_options, _},
- [{totals, _, Acc, _}],
- [{Proc, _, undefined, _} | _]] ->
- ok
- end,
+ {ok, [T, P]} = parse(AnalysisFile),
+ io:format("~p~n~n~p~n", [P, ets:tab2list(T)]),
+ ok = verify(T, P),
+ Proc = pid_to_list(self()),
+ case P of
+ [{analysis_options, _},
+ [{totals, _, Acc, _}],
+ [{Proc, _, undefined, _} | _]] ->
+ ok
+ end,
%%
- ?line check_own_and_acc(TraceFile,AnalysisFile),
+ check_own_and_acc(TraceFile,AnalysisFile),
%%
- ?line ets:delete(T),
- ?line file:delete(DataFile),
- ?line file:delete(TraceFile),
- ?line file:delete(AnalysisFile),
- ?line ?t:timetrap_cancel(Timetrap),
- ?line Acc1 = ts_sub(TS1, TS0),
- ?line Acc3 = ts_sub(TS3, TS2),
- ?line io:format("ts:~w, fprof:~w, bare:~w.~n", [Acc, Acc3, Acc1]),
- {comment, io_lib:format("~p times slower", [Acc3/Acc1])}.
+ ets:delete(T),
+ file:delete(DataFile),
+ file:delete(TraceFile),
+ file:delete(AnalysisFile),
+ Acc1 = TS1 - TS0,
+ Acc3 = TS3 - TS2,
+ io:format("ts:~w, fprof:~w, bare:~w.~n", [Acc, Acc3, Acc1]),
+ {comment, io_lib:format("~p times slower", [divide(Acc3,Acc1)])}.
%%%---------------------------------------------------------------------
-spawn_simple(doc) ->
- ["Tests process spawn"];
-spawn_simple(suite) ->
- [];
+%% Tests process spawn
spawn_simple(Config) when is_list(Config) ->
- ?line Timetrap = ?t:timetrap(?t:seconds(30)),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line TraceFile =
- filename:join(PrivDir, ?MODULE_STRING"_spawn_simple.trace"),
- ?line AnalysisFile =
- filename:join(PrivDir, ?MODULE_STRING"_spawn_simple.analysis"),
- ?line Start = 1,
- ?line Stop = 1000,
- ?line Succ = fun (X) -> X + 1 end,
- ?line ok = fprof:stop(kill),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ TraceFile = filename:join(PrivDir,
+ ?MODULE_STRING"_spawn_simple.trace"),
+ AnalysisFile = filename:join(PrivDir,
+ ?MODULE_STRING"_spawn_simple.analysis"),
+ Start = 1,
+ Stop = 1000,
+ Succ = fun (X) -> X + 1 end,
+ ok = fprof:stop(kill),
%%
- ?line TS0 = erlang:now(),
- ?line {{_, R1}, {_, R2}} = spawn_simple_test(Start, Stop, Succ),
- ?line TS1 = erlang:now(),
+ TS0 = erlang:monotonic_time(),
+ {{_, R1}, {_, R2}} = spawn_simple_test(Start, Stop, Succ),
+ TS1 = erlang:monotonic_time(),
%%
- ?line ok = fprof:trace(start, TraceFile),
- ?line {{P1, R3}, {P2, R4}} = spawn_simple_test(Start, Stop, Succ),
- ?line ok = fprof:trace(stop),
- ?line TS2 = erlang:now(),
- ?line ok = fprof:profile(file, TraceFile),
- ?line ok = fprof:analyse(),
- ?line ok = fprof:analyse(dest, AnalysisFile),
- ?line ok = fprof:stop(),
- ?line R1 = R3,
- ?line R2 = R4,
+ ok = fprof:trace(start, TraceFile),
+ {{P1, R3}, {P2, R4}} = spawn_simple_test(Start, Stop, Succ),
+ ok = fprof:trace(stop),
+ TS2 = erlang:monotonic_time(),
+ ok = fprof:profile(file, TraceFile),
+ ok = fprof:analyse(),
+ ok = fprof:analyse(dest, AnalysisFile),
+ ok = fprof:stop(),
+ R1 = R3,
+ R2 = R4,
%%
- ?line {ok, [T, P]} = parse(AnalysisFile),
- ?line io:format("~p~n~n~p~n", [P, ets:tab2list(T)]),
- ?line ok = verify(T, P),
- ?line Proc1 = pid_to_list(P1),
- ?line Proc2 = pid_to_list(P2),
- ?line Proc0 = pid_to_list(self()),
- ?line io:format("~p~n ~p ~p ~p~n", [P, Proc0, Proc1, Proc2]),
- ?line [{analysis_options, _}, [{totals, _, Acc, _}] | Procs] = P,
- ?line [[{Proc0, _, undefined, _} | _]] =
- lists:filter(fun ([Pt | _]) when element(1, Pt) == Proc0 -> true;
- (_) -> false
- end, Procs),
- ?line [[{Proc1, _, undefined, _},
- {spawned_by, Proc0},
- {spawned_as, {erlang, apply, ["#Fun"++_, []]}},
- {initial_calls, [{erlang, apply, 2},
- {?MODULE, '-spawn_simple_test/3-fun-0-', 4}]}
- | _]] =
- lists:filter(fun ([Pt | _]) when element(1, Pt) == Proc1 -> true;
- (_) -> false
- end, Procs),
- ?line [[{Proc2, _, undefined, _},
- {spawned_by, Proc0},
- {spawned_as, {erlang, apply, ["#Fun"++_, []]}},
- {initial_calls, [{erlang, apply, 2},
- {?MODULE, '-spawn_simple_test/3-fun-1-', 4}]}
- | _]] =
- lists:filter(fun ([Pt | _]) when element(1, Pt) == Proc2 -> true;
- (_) -> false
- end, Procs),
- ?line 3 = length(Procs),
- ?line R1 = lists:reverse(R2),
+ {ok, [T, P]} = parse(AnalysisFile),
+ io:format("~p~n~n~p~n", [P, ets:tab2list(T)]),
+ ok = verify(T, P),
+ Proc1 = pid_to_list(P1),
+ Proc2 = pid_to_list(P2),
+ Proc0 = pid_to_list(self()),
+ io:format("~p~n ~p ~p ~p~n", [P, Proc0, Proc1, Proc2]),
+ [{analysis_options, _}, [{totals, _, Acc, _}] | Procs] = P,
+ [[{Proc0, _, undefined, _} | _]] = lists:filter(
+ fun ([Pt | _]) when element(1, Pt) == Proc0 -> true;
+ (_) -> false
+ end, Procs),
+ [[{Proc1, _, undefined, _},
+ {spawned_by, Proc0},
+ {spawned_as, {erlang, apply, ["#Fun"++_, []]}},
+ {initial_calls, [{erlang, apply, 2},
+ {?MODULE, '-spawn_simple_test/3-fun-0-', 4}]}
+ | _]] = lists:filter(fun ([Pt | _]) when element(1, Pt) == Proc1 -> true;
+ (_) -> false
+ end, Procs),
+ [[{Proc2, _, undefined, _},
+ {spawned_by, Proc0},
+ {spawned_as, {erlang, apply, ["#Fun"++_, []]}},
+ {initial_calls, [{erlang, apply, 2},
+ {?MODULE, '-spawn_simple_test/3-fun-1-', 4}]}
+ | _]] = lists:filter(fun ([Pt | _]) when element(1, Pt) == Proc2 -> true;
+ (_) -> false
+ end, Procs),
+ 3 = length(Procs),
+ R1 = lists:reverse(R2),
%%
- ?line check_own_and_acc(TraceFile,AnalysisFile),
+ check_own_and_acc(TraceFile,AnalysisFile),
%%
- ?line ets:delete(T),
- ?line file:delete(TraceFile),
- ?line file:delete(AnalysisFile),
- ?line ?t:timetrap_cancel(Timetrap),
- ?line Acc1 = ts_sub(TS1, TS0),
- ?line Acc2 = ts_sub(TS2, TS1),
- ?line io:format("ts:~w, fprof:~w, bare:~w.~n", [Acc, Acc2, Acc1]),
- {comment, io_lib:format("~p times slower", [Acc2/Acc1])}.
+ ets:delete(T),
+ file:delete(TraceFile),
+ file:delete(AnalysisFile),
+ Acc1 = TS1 - TS0,
+ Acc2 = TS2 - TS1,
+ io:format("ts:~w, fprof:~w, bare:~w.~n", [Acc, Acc2, Acc1]),
+ {comment, io_lib:format("~p times slower", [divide(Acc2,Acc1)])}.
spawn_simple_test(Start, Stop, Succ) ->
Parent = self(),
- Seq =
- spawn_link(
- fun () ->
- Parent ! {self(), seq(Start, Stop, Succ)}
- end),
- SeqR =
- spawn_link(
- fun () ->
- Parent ! {self(), seq_r(Start, Stop, Succ)}
- end),
- receive {Seq, SeqResult} ->
- receive {SeqR, SeqRResult} ->
- {{Seq, SeqResult}, {SeqR, SeqRResult}}
- end
+ Seq = spawn_link(fun() ->
+ Parent ! {self(), seq(Start, Stop, Succ)}
+ end),
+
+ SeqR = spawn_link(fun() ->
+ Parent ! {self(), seq_r(Start, Stop, Succ)}
+ end),
+ receive
+ {Seq, SeqResult} ->
+ receive
+ {SeqR, SeqRResult} ->
+ {{Seq, SeqResult}, {SeqR, SeqRResult}}
+ end
end.
%%%---------------------------------------------------------------------
-imm_tail_seq(doc) ->
- ["Tests a tail recursive variant of lists:seq/3 ",
- "with immediate trace to profile"];
-imm_tail_seq(suite) ->
- [];
+%% Tests a tail recursive variant of lists:seq/3
+%% with immediate trace to profile
imm_tail_seq(Config) when is_list(Config) ->
- ?line Timetrap = ?t:timetrap(?t:seconds(10)),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line AnalysisFile =
- filename:join(PrivDir, ?MODULE_STRING"_imm_tail_seq.analysis"),
- ?line Start = 1,
- ?line Stop = 1000,
- ?line Succ = fun (X) -> X + 1 end,
- ?line ok = fprof:stop(kill),
- ?line catch eprof:stop(),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ AnalysisFile = filename:join(PrivDir,
+ ?MODULE_STRING"_imm_tail_seq.analysis"),
+ Start = 1,
+ Stop = 1000,
+ Succ = fun (X) -> X + 1 end,
+ ok = fprof:stop(kill),
+ catch eprof:stop(),
%%
- ?line TS0 = erlang:now(),
- ?line R0 = seq_r(Start, Stop, Succ),
- ?line TS1 = erlang:now(),
+ TS0 = erlang:monotonic_time(),
+ R0 = seq_r(Start, Stop, Succ),
+ TS1 = erlang:monotonic_time(),
%%
- ?line profiling = eprof:start_profiling([self()]),
- ?line TS2 = erlang:now(),
- ?line R2 = seq_r(Start, Stop, Succ),
- ?line TS3 = erlang:now(),
- ?line profiling_stopped = eprof:stop_profiling(),
- ?line R2 = R0,
+ profiling = eprof:start_profiling([self()]),
+ TS2 = erlang:monotonic_time(),
+ R2 = seq_r(Start, Stop, Succ),
+ TS3 = erlang:monotonic_time(),
+ profiling_stopped = eprof:stop_profiling(),
+ R2 = R0,
%%
- ?line eprof:analyze(),
- ?line stopped = eprof:stop(),
+ eprof:analyze(),
+ stopped = eprof:stop(),
%%
- ?line {ok, Tracer} = fprof:profile(start),
- ?line ok = fprof:trace([start, {tracer, Tracer}]),
- ?line TS4 = erlang:now(),
- ?line R4 = seq_r(Start, Stop, Succ),
- ?line TS5 = erlang:now(),
- ?line ok = fprof:trace(stop),
- ?line ok = fprof:analyse(),
- ?line ok = fprof:analyse(dest, AnalysisFile),
- ?line ok = fprof:stop(),
- ?line R4 = R0,
+ {ok, Tracer} = fprof:profile(start),
+ ok = fprof:trace([start, {tracer, Tracer}]),
+ TS4 = erlang:monotonic_time(),
+ R4 = seq_r(Start, Stop, Succ),
+ TS5 = erlang:monotonic_time(),
+ ok = fprof:trace(stop),
+ ok = fprof:analyse(),
+ ok = fprof:analyse(dest, AnalysisFile),
+ ok = fprof:stop(),
+ R4 = R0,
%%
- ?line {ok, [T, P]} = parse(AnalysisFile),
- ?line io:format("~p~n~n~p~n", [P, ets:tab2list(T)]),
- ?line ok = verify(T, P),
- ?line Proc = pid_to_list(self()),
- ?line case P of
- [{analysis_options, _},
- [{totals, _, Acc, _}],
- [{Proc, _, undefined, _} | _]] ->
- ok
- end,
+ {ok, [T, P]} = parse(AnalysisFile),
+ io:format("~p~n~n~p~n", [P, ets:tab2list(T)]),
+ ok = verify(T, P),
+ Proc = pid_to_list(self()),
+ case P of
+ [{analysis_options, _},
+ [{totals, _, Acc, _}],
+ [{Proc, _, undefined, _} | _]] -> ok
+ end,
%%
- ?line ets:delete(T),
- ?line file:delete(AnalysisFile),
- ?line ?t:timetrap_cancel(Timetrap),
- ?line Acc1 = ts_sub(TS1, TS0),
- ?line Acc3 = ts_sub(TS3, TS2),
- ?line Acc5 = ts_sub(TS5, TS4),
- ?line io:format("~p (plain), ~p (eprof), ~p (fprof), ~p (cpu)~n",
- [Acc1/1000, Acc3/1000, Acc5/1000, Acc/1000]),
+ ets:delete(T),
+ file:delete(AnalysisFile),
+ Acc1 = TS1 - TS0,
+ Acc3 = TS3 - TS2,
+ Acc5 = TS5 - TS4,
+ io:format("~p (plain), ~p (eprof), ~p (fprof), ~p (cpu)~n",
+ [Acc1/1000, Acc3/1000, Acc5/1000, Acc/1000]),
{comment, io_lib:format("~p/~p (fprof/eprof) times slower",
- [Acc5/Acc1, Acc3/Acc1])}.
+ [divide(Acc5,Acc1), divide(Acc3,Acc1)])}.
%%%---------------------------------------------------------------------
-imm_create_file_slow(doc) ->
- ["Tests a tail recursive variant of lists:seq/3 ",
- "with immediate trace to profile"];
-imm_create_file_slow(suite) ->
- [];
+%% Tests a tail recursive variant of lists:seq/3
+%% with immediate trace to profile
imm_create_file_slow(Config) when is_list(Config) ->
- ?line Timetrap = ?t:timetrap(?t:seconds(60)),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line DataFile =
- filename:join(PrivDir, ?MODULE_STRING"_imm_create_file_slow.data"),
- ?line AnalysisFile =
- filename:join(PrivDir, ?MODULE_STRING"_imm_create_file_slow.analysis"),
- ?line ok = fprof:stop(kill),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ DataFile = filename:join(PrivDir,
+ ?MODULE_STRING"_imm_create_file_slow.data"),
+ AnalysisFile = filename:join(PrivDir,
+ ?MODULE_STRING"_imm_create_file_slow.analysis"),
+ ok = fprof:stop(kill),
%%
- ?line TS0 = erlang:now(),
- ?line ok = create_file_slow(DataFile, 1024),
- ?line TS1 = erlang:now(),
- ?line ok = file:delete(DataFile),
+ TS0 = erlang:monotonic_time(),
+ ok = create_file_slow(DataFile, 1024),
+ TS1 = erlang:monotonic_time(),
+ ok = file:delete(DataFile),
%%
- ?line {ok, Tracer} = fprof:profile(start),
- ?line TS2 = erlang:now(),
- ?line ok = fprof:apply(?MODULE, create_file_slow, [DataFile, 1024],
- [{tracer, Tracer}, continue]),
- ?line TS3 = erlang:now(),
- ?line ok = fprof:profile(stop),
- ?line ok = fprof:analyse(),
- ?line ok = fprof:analyse(dest, AnalysisFile),
- ?line ok = fprof:stop(),
+ {ok, Tracer} = fprof:profile(start),
+ TS2 = erlang:monotonic_time(),
+ ok = fprof:apply(?MODULE, create_file_slow, [DataFile, 1024],
+ [{tracer, Tracer}, continue]),
+ TS3 = erlang:monotonic_time(),
+ ok = fprof:profile(stop),
+ ok = fprof:analyse(),
+ ok = fprof:analyse(dest, AnalysisFile),
+ ok = fprof:stop(),
%%
- ?line {ok, [T, P]} = parse(AnalysisFile),
- ?line io:format("~p~n~n~p~n", [P, ets:tab2list(T)]),
- ?line ok = verify(T, P),
- ?line Proc = pid_to_list(self()),
- ?line case P of
- [{analysis_options, _},
- [{totals, _, Acc, _}],
- [{Proc, _, undefined, _} | _]] ->
- ok
- end,
+ {ok, [T, P]} = parse(AnalysisFile),
+ io:format("~p~n~n~p~n", [P, ets:tab2list(T)]),
+ ok = verify(T, P),
+ Proc = pid_to_list(self()),
+ case P of
+ [{analysis_options, _},
+ [{totals, _, Acc, _}],
+ [{Proc, _, undefined, _} | _]] ->
+ ok
+ end,
%%
- ?line ets:delete(T),
- ?line file:delete(DataFile),
- ?line file:delete(AnalysisFile),
- ?line ?t:timetrap_cancel(Timetrap),
- ?line Acc1 = ts_sub(TS1, TS0),
- ?line Acc3 = ts_sub(TS3, TS2),
- ?line io:format("ts:~w, fprof:~w, bare:~w.~n", [Acc, Acc3, Acc1]),
- {comment, io_lib:format("~p times slower", [Acc3/Acc1])}.
+ ets:delete(T),
+ file:delete(DataFile),
+ file:delete(AnalysisFile),
+ Acc1 = TS1 - TS0,
+ Acc3 = TS3 - TS2,
+ io:format("ts:~w, fprof:~w, bare:~w.~n", [Acc, Acc3, Acc1]),
+ {comment, io_lib:format("~p times slower", [divide(Acc3,Acc1)])}.
%%%---------------------------------------------------------------------
-imm_compile(doc) ->
- ["Tests to compile a small source file ",
- "with immediate trace to profile"];
-imm_compile(suite) ->
- [];
+%% Tests to compile a small source file with immediate trace to profile
imm_compile(Config) when is_list(Config) ->
- ?line Timetrap = ?t:timetrap(?t:minutes(20)),
- ?line DataDir = ?config(data_dir, Config),
- ?line SourceFile = filename:join(DataDir, "foo.erl"),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line AnalysisFile =
- filename:join(PrivDir, ?MODULE_STRING"_imm_compile.analysis"),
- ?line ok = fprof:stop(kill),
- ?line catch eprof:stop(),
+ ct:timetrap({minutes, 20}),
+ DataDir = proplists:get_value(data_dir, Config),
+ SourceFile = filename:join(DataDir, "foo.erl"),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ AnalysisFile = filename:join(PrivDir,
+ ?MODULE_STRING"_imm_compile.analysis"),
+ ok = fprof:stop(kill),
+ catch eprof:stop(),
%%
- ?line {ok, foo, _} = compile:file(SourceFile, [binary]),
- ?line TS0 = erlang:now(),
- ?line {ok, foo, _} = compile:file(SourceFile, [binary]),
- ?line TS1 = erlang:now(),
+ {ok, foo, _} = compile:file(SourceFile, [binary]),
+ TS0 = erlang:monotonic_time(),
+ {ok, foo, _} = compile:file(SourceFile, [binary]),
+ TS1 = erlang:monotonic_time(),
%%
- ?line profiling = eprof:start_profiling([self()]),
- ?line TS2 = erlang:now(),
- ?line {ok, foo, _} = compile:file(SourceFile, [binary]),
- ?line TS3 = erlang:now(),
- ?line profiling_stopped = eprof:stop_profiling(),
+ profiling = eprof:start_profiling([self()]),
+ TS2 = erlang:monotonic_time(),
+ {ok, foo, _} = compile:file(SourceFile, [binary]),
+ TS3 = erlang:monotonic_time(),
+ profiling_stopped = eprof:stop_profiling(),
%%
- ?line eprof:analyze(),
- ?line stopped = eprof:stop(),
+ eprof:analyze(),
+ stopped = eprof:stop(),
%%
- ?line {ok, Tracer} = fprof:profile(start),
- ?line ok = fprof:trace([start, {tracer, Tracer}]),
- ?line TS4 = erlang:now(),
- ?line {ok, foo, _} = compile:file(SourceFile, [binary]),
- ?line TS5 = erlang:now(),
- ?line ok = fprof:trace(stop),
+ {ok, Tracer} = fprof:profile(start),
+ ok = fprof:trace([start, {tracer, Tracer}]),
+ TS4 = erlang:monotonic_time(),
+ {ok, foo, _} = compile:file(SourceFile, [binary]),
+ TS5 = erlang:monotonic_time(),
+ ok = fprof:trace(stop),
%%
- ?line io:format("Analysing...~n"),
- ?line ok = fprof:analyse(dest, AnalysisFile),
- ?line ok = fprof:stop(),
+ io:format("Analysing...~n"),
+ ok = fprof:analyse(dest, AnalysisFile),
+ ok = fprof:stop(),
%%
- ?line {ok, [T, P]} = parse(AnalysisFile),
- ?line io:format("~p~n", [P]),
- ?line Acc1 = ts_sub(TS1, TS0),
- ?line Acc3 = ts_sub(TS3, TS2),
- ?line Acc5 = ts_sub(TS5, TS4),
- ?line io:format("Verifying...~n"),
- ?line ok = verify(T, P),
- ?line case P of
- [{analysis_options, _},
- [{totals, _, Acc, _}] | _] ->
- ok
- end,
+ {ok, [T, P]} = parse(AnalysisFile),
+ io:format("~p~n", [P]),
+ Acc1 = TS1 - TS0,
+ Acc3 = TS3 - TS2,
+ Acc5 = TS5 - TS4,
+ io:format("Verifying...~n"),
+ ok = verify(T, P),
+ case P of
+ [{analysis_options, _},
+ [{totals, _, Acc, _}] | _] ->
+ ok
+ end,
%%
- ?line ets:delete(T),
- ?line file:delete(AnalysisFile),
- ?line ?t:timetrap_cancel(Timetrap),
- ?line io:format("~p (plain), ~p (eprof), ~p (fprof), ~p(cpu)~n",
- [Acc1/1000, Acc3/1000, Acc5/1000, Acc/1000]),
+ ets:delete(T),
+ file:delete(AnalysisFile),
+ io:format("~p (plain), ~p (eprof), ~p (fprof), ~p(cpu)~n",
+ [Acc1/1000, Acc3/1000, Acc5/1000, Acc/1000]),
{comment, io_lib:format("~p/~p (fprof/eprof) times slower",
- [Acc5/Acc1, Acc3/Acc1])}.
+ [divide(Acc5,Acc1), divide(Acc3,Acc1)])}.
%%%---------------------------------------------------------------------
-cpu_create_file_slow(doc) ->
- ["Tests the create_file_slow benchmark using cpu_time"];
-cpu_create_file_slow(suite) ->
- [];
+%% Tests the create_file_slow benchmark using cpu_time
cpu_create_file_slow(Config) when is_list(Config) ->
- ?line Timetrap = ?t:timetrap(?t:seconds(40)),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line TraceFile =
- filename:join(PrivDir, ?MODULE_STRING"_cpu_create_file_slow.trace"),
- ?line AnalysisFile =
- filename:join(PrivDir, ?MODULE_STRING"_cpu_create_file_slow.analysis"),
- ?line DataFile =
- filename:join(PrivDir, ?MODULE_STRING"_cpu_create_file_slow.data"),
- ?line ok = fprof:stop(kill),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ TraceFile =
+ filename:join(PrivDir, ?MODULE_STRING"_cpu_create_file_slow.trace"),
+ AnalysisFile =
+ filename:join(PrivDir, ?MODULE_STRING"_cpu_create_file_slow.analysis"),
+ DataFile =
+ filename:join(PrivDir, ?MODULE_STRING"_cpu_create_file_slow.data"),
+ ok = fprof:stop(kill),
%%
- ?line TS0 = erlang:now(),
- ?line Result = (catch fprof:apply(?MODULE, create_file_slow,
- [DataFile, 1024],
- [{file, TraceFile}, cpu_time])),
- ?line TS1 = erlang:now(),
- ?line TestResult =
- case Result of
- ok ->
- ?line ok = fprof:profile(file, TraceFile),
- ?line ok = fprof:analyse(),
- ?line ok = fprof:analyse(dest, AnalysisFile),
- ?line ok = fprof:stop(),
- %%
- ?line {ok, [T, P]} = parse(AnalysisFile),
- ?line io:format("~p~n~n~p~n", [P, ets:tab2list(T)]),
- ?line ok = verify(T, P),
- ?line Proc = pid_to_list(self()),
- ?line case P of
- [{analysis_options, _},
- [{totals, _, Acc, _}],
- [{Proc, _, undefined, _} | _]] ->
- ok
- end,
- %%
- ?line check_own_and_acc(TraceFile,AnalysisFile),
- %%
- ?line ets:delete(T),
- ?line file:delete(DataFile),
- ?line file:delete(TraceFile),
- ?line file:delete(AnalysisFile),
- ?line Acc1 = ts_sub(TS1, TS0),
- ?line io:format("cpu_ts:~w, fprof:~w~n", [Acc, Acc1]),
- {comment, io_lib:format("~p% cpu utilization",
- [100*Acc/Acc1])};
- {'EXIT', not_supported} ->
- case {os:type(), os:version()} of
- {{unix, sunos}, {Major, Minor, _}}
- when Major >= 5, Minor >= 7 ->
- test_server:fail(Result);
- _ ->
- {skipped, "not_supported"}
- end;
- _ ->
- test_server:fail(Result)
- end,
- ?line ?t:timetrap_cancel(Timetrap),
+ TS0 = erlang:monotonic_time(),
+ Result = (catch fprof:apply(?MODULE, create_file_slow,
+ [DataFile, 1024],
+ [{file, TraceFile}, cpu_time])),
+ TS1 = erlang:monotonic_time(),
+ TestResult =
+ case Result of
+ ok ->
+ ok = fprof:profile(file, TraceFile),
+ ok = fprof:analyse(),
+ ok = fprof:analyse(dest, AnalysisFile),
+ ok = fprof:stop(),
+ %%
+ {ok, [T, P]} = parse(AnalysisFile),
+ io:format("~p~n~n~p~n", [P, ets:tab2list(T)]),
+ ok = verify(T, P),
+ Proc = pid_to_list(self()),
+ case P of
+ [{analysis_options, _},
+ [{totals, _, Acc, _}],
+ [{Proc, _, undefined, _} | _]] ->
+ ok
+ end,
+ %%
+ check_own_and_acc(TraceFile,AnalysisFile),
+ %%
+ ets:delete(T),
+ file:delete(DataFile),
+ file:delete(TraceFile),
+ file:delete(AnalysisFile),
+ Acc1 = TS1 - TS0,
+ io:format("cpu_ts:~w, fprof:~w~n", [Acc, Acc1]),
+ {comment, io_lib:format("~p% cpu utilization", [100*divide(Acc,Acc1)])};
+ {'EXIT', not_supported} ->
+ case {os:type(), os:version()} of
+ {{unix, sunos}, {Major, Minor, _}}
+ when Major >= 5, Minor >= 7 ->
+ ct:fail(Result);
+ _ ->
+ {skipped, "not_supported"}
+ end;
+ _ ->
+ ct:fail(Result)
+ end,
TestResult.
-
%%%---------------------------------------------------------------------
%%% Functions to test
%%%---------------------------------------------------------------------
@@ -623,14 +560,14 @@ seq_r(Start, Stop, Succ, R) ->
create_file_slow(Name, N) when is_integer(N), N >= 0 ->
{ok, FD} =
- file:open(Name, [raw, write, delayed_write, binary]),
+ file:open(Name, [raw, write, delayed_write, binary]),
if N > 256 ->
- ok = file:write(FD,
- lists:map(fun (X) -> <<X:32/unsigned>> end,
- lists:seq(0, 255))),
- ok = create_file_slow(FD, 256, N);
+ ok = file:write(FD,
+ lists:map(fun (X) -> <<X:32/unsigned>> end,
+ lists:seq(0, 255))),
+ ok = create_file_slow(FD, 256, N);
true ->
- ok = create_file_slow(FD, 0, N)
+ ok = create_file_slow(FD, 0, N)
end,
ok = file:close(FD).
@@ -647,46 +584,44 @@ create_file_slow(FD, M, N) ->
%%%---------------------------------------------------------------------
-
verify(Tab, [{analysis_options, _},
- [{totals, Cnt, Acc, Own} | _] | Processes]) ->
+ [{totals, Cnt, Acc, Own} | _] | Processes]) ->
Processes_1 =
- lists:map(
- fun ([{Proc, Cnt_P, undefined, Own_P} | _]) ->
- case sum_process(Tab, Proc) of
- {Proc, Cnt_P, Acc_P, Own_P} = Clocks
- when Acc_P >= Own_P ->
- Clocks;
- Weird ->
- throw({error, [?MODULE, ?LINE, Weird]})
- end
- end,
- Processes),
+ lists:map(
+ fun ([{Proc, Cnt_P, undefined, Own_P} | _]) ->
+ case sum_process(Tab, Proc) of
+ {Proc, Cnt_P, Acc_P, Own_P} = Clocks
+ when Acc_P >= Own_P ->
+ Clocks;
+ Weird ->
+ throw({error, [?MODULE, ?LINE, Weird]})
+ end
+ end,
+ Processes),
case lists:foldl(
- fun ({_, Cnt_P2, Acc_P2, Own_P2},
- {totals, Cnt_T, Acc_T, Own_T}) ->
- {totals, Cnt_P2+Cnt_T, Acc_P2+Acc_T, Own_P2+Own_T}
- end,
- {totals, 0, 0, 0},
- Processes_1) of
- {totals, Cnt, Acc_T, Own} when Acc_T >= Acc ->
- ok;
- Weird ->
- throw({error, [?MODULE, ?LINE, Weird]})
+ fun ({_, Cnt_P2, Acc_P2, Own_P2},
+ {totals, Cnt_T, Acc_T, Own_T}) ->
+ {totals, Cnt_P2+Cnt_T, Acc_P2+Acc_T, Own_P2+Own_T}
+ end,
+ {totals, 0, 0, 0},
+ Processes_1) of
+ {totals, Cnt, Acc_T, Own} when Acc_T >= Acc ->
+ ok;
+ Weird ->
+ throw({error, [?MODULE, ?LINE, Weird]})
end.
-
sum_process(Tab, Proc) ->
ets_select_fold(
Tab, [{{{Proc, '_'}, '_'}, [], ['$_']}], 100,
fun ({{P, MFA}, {Callers, {MFA, Cnt, Acc, Own}, Called}},
- {P, Cnt_P, Acc_P, Own_P}) when P == Proc ->
- ok = verify_callers(Tab, Proc, MFA, Callers),
- ok = verify_called(Tab, Proc, MFA, Called),
- {P, Cnt+Cnt_P, Acc+Acc_P, Own+Own_P};
- (Weird, Clocks) ->
- throw({error, [?MODULE, ?LINE, Weird, Clocks]})
+ {P, Cnt_P, Acc_P, Own_P}) when P == Proc ->
+ ok = verify_callers(Tab, Proc, MFA, Callers),
+ ok = verify_called(Tab, Proc, MFA, Called),
+ {P, Cnt+Cnt_P, Acc+Acc_P, Own+Own_P};
+ (Weird, Clocks) ->
+ throw({error, [?MODULE, ?LINE, Weird, Clocks]})
end,
{Proc, 0, 0, 0}).
@@ -695,31 +630,31 @@ verify_callers(_, _, _, []) ->
verify_callers(Tab, Proc, MFA, [{Caller, Cnt, Acc, Own} | Tail]) ->
Id = {Proc, Caller},
case ets:lookup(Tab, Id) of
- [{Id, {_, {Caller, _, _, _}, Called}}] ->
- case lists:keysearch(MFA, 1, Called) of
- {value, {MFA, Cnt, Acc, Own}} ->
- verify_callers(Tab, Proc, MFA, Tail);
- false ->
- throw({error, [?MODULE, ?LINE, MFA, Id]})
- end;
- Weird ->
- throw({error, [?MODULE, ?LINE, Weird]})
+ [{Id, {_, {Caller, _, _, _}, Called}}] ->
+ case lists:keysearch(MFA, 1, Called) of
+ {value, {MFA, Cnt, Acc, Own}} ->
+ verify_callers(Tab, Proc, MFA, Tail);
+ false ->
+ throw({error, [?MODULE, ?LINE, MFA, Id]})
+ end;
+ Weird ->
+ throw({error, [?MODULE, ?LINE, Weird]})
end.
-
+
verify_called(_, _, _, []) ->
ok;
verify_called(Tab, Proc, MFA, [{Called, Cnt, Acc, Own} | Tail]) ->
Id = {Proc, Called},
case ets:lookup(Tab, Id) of
- [{Id, {Callers, {Called, _, _, _}, _}}] ->
- case lists:keysearch(MFA, 1, Callers) of
- {value, {MFA, Cnt, Acc, Own}} ->
- verify_called(Tab, Proc, MFA, Tail);
- false ->
- throw({error, [?MODULE, ?LINE, MFA, Id]})
- end;
- Weird ->
- throw({error, [?MODULE, ?LINE, Weird]})
+ [{Id, {Callers, {Called, _, _, _}, _}}] ->
+ case lists:keysearch(MFA, 1, Callers) of
+ {value, {MFA, Cnt, Acc, Own}} ->
+ verify_called(Tab, Proc, MFA, Tail);
+ false ->
+ throw({error, [?MODULE, ?LINE, MFA, Id]})
+ end;
+ Weird ->
+ throw({error, [?MODULE, ?LINE, Weird]})
end.
@@ -729,12 +664,12 @@ verify_called(Tab, Proc, MFA, [{Called, Cnt, Acc, Own} | Tail]) ->
%% entries when they are read.
parse(Filename) ->
case file:open(Filename, [read]) of
- {ok, FD} ->
- Result = parse_stream(FD),
- file:close(FD),
- Result;
- Error ->
- Error
+ {ok, FD} ->
+ Result = parse_stream(FD),
+ file:close(FD),
+ Result;
+ Error ->
+ Error
end.
parse_stream(FD) ->
@@ -743,31 +678,31 @@ parse_stream(FD) ->
parse_stream(FD, Tab, R, Proc) ->
case catch io:read(FD, '') of
- {'EXIT', _} ->
- {error, [?MODULE, ?LINE]};
- {ok, Term} ->
- case parse_term(Term) of
- {ok, {analysis_options, _} = Term_1}
- when Proc == void ->
- parse_stream(FD, Tab, [Term_1 | R], analysis_options);
- {ok, [{totals, _, _, _} | _] = Term_1}
- when Proc == analysis_options ->
- parse_stream(FD, Tab, [Term_1 | R], totals);
- {ok, [{P, _, _, _} | _] = Term_1} ->
- parse_stream(FD, Tab, [Term_1 | R], P);
- {ok, {_Callers, {MFA, _, _, _}, _Called} = Term_1}
- when Proc == totals; is_list(Proc) ->
- ets:insert(Tab, {{Proc, MFA}, Term_1}),
- parse_stream(FD, Tab, R, Proc);
- {ok, Term_1} ->
- {error, [?MODULE, ?LINE, Term_1]};
- E ->
- E
- end;
- eof ->
- {ok, [Tab, lists:reverse(R)]};
- Error ->
- Error
+ {'EXIT', _} ->
+ {error, [?MODULE, ?LINE]};
+ {ok, Term} ->
+ case parse_term(Term) of
+ {ok, {analysis_options, _} = Term_1}
+ when Proc == void ->
+ parse_stream(FD, Tab, [Term_1 | R], analysis_options);
+ {ok, [{totals, _, _, _} | _] = Term_1}
+ when Proc == analysis_options ->
+ parse_stream(FD, Tab, [Term_1 | R], totals);
+ {ok, [{P, _, _, _} | _] = Term_1} ->
+ parse_stream(FD, Tab, [Term_1 | R], P);
+ {ok, {_Callers, {MFA, _, _, _}, _Called} = Term_1}
+ when Proc == totals; is_list(Proc) ->
+ ets:insert(Tab, {{Proc, MFA}, Term_1}),
+ parse_stream(FD, Tab, R, Proc);
+ {ok, Term_1} ->
+ {error, [?MODULE, ?LINE, Term_1]};
+ E ->
+ E
+ end;
+ eof ->
+ {ok, [Tab, lists:reverse(R)]};
+ Error ->
+ Error
end.
parse_term({Callers, Func, Called})
@@ -777,10 +712,10 @@ parse_term({Callers, Func, Called})
Called_1 = lists:map(fun parse_clocks/1, Called),
Result = {Callers_1, Func_1, Called_1},
case chk_invariant(Result) of
- ok ->
- {ok, Result};
- Error ->
- Error
+ ok ->
+ {ok, Result};
+ Error ->
+ Error
end;
parse_term([{_, _, _, _} = Clocks | Tail]) ->
{ok, [parse_clocks(Clocks) | Tail]};
@@ -798,41 +733,41 @@ parse_clocks(Clocks) ->
chk_invariant({Callers, {MFA, Cnt, Acc, Own}, Called} = Term) ->
{_, Callers_Cnt, Callers_Acc, Callers_Own} = Callers_Sum = sum(Callers),
-% {_, Called_Cnt, Called_Acc, Called_Own} = Called_Sum = sum(Called),
+ % {_, Called_Cnt, Called_Acc, Called_Own} = Called_Sum = sum(Called),
case {MFA,
- lists:keymember(suspend, 1, Callers),
- lists:keymember(garbage_collect, 1, Callers),
- Called} of
- {suspend, false, _, []} ->
- ok;
- {suspend, _, _, _} = Weird ->
- {error, [?MODULE, ?LINE, Weird, Term]};
- {garbage_collect, false, false, []} ->
- ok;
- {garbage_collect, false, false, [{suspend, _, _, _}]} ->
- ok;
- {garbage_collect, _, _, _} = Weird ->
- {error, [?MODULE, ?LINE, Weird, Term]};
- {undefined, false, false, _}
- when Callers == [], Cnt == 0, Acc == 0, Own == 0 ->
- ok;
- {undefined, _, _, _} = Weird ->
- {error, [?MODULE, ?LINE, Weird, Term]};
- {_, _, _, _} ->
- case chk_self_call(Term) of
- true when Callers_Cnt /= Cnt; Callers_Acc /= Acc;
- Callers_Own /= Own ->
- {error, [?MODULE, ?LINE, Callers_Sum, Term]};
-% true when Called_Acc + Own /= Acc ->
-% io:format("WARNING: ~p:~p, ~p, ~p.~n",
-% [?MODULE, ?LINE, Term, Called_Sum]),
-% {error, [?MODULE, ?LINE, Term, Called_Sum]};
-% ok;
- true ->
- ok;
- false ->
- {error, [?MODULE, ?LINE, Term]}
- end
+ lists:keymember(suspend, 1, Callers),
+ lists:keymember(garbage_collect, 1, Callers),
+ Called} of
+ {suspend, false, _, []} ->
+ ok;
+ {suspend, _, _, _} = Weird ->
+ {error, [?MODULE, ?LINE, Weird, Term]};
+ {garbage_collect, false, false, []} ->
+ ok;
+ {garbage_collect, false, false, [{suspend, _, _, _}]} ->
+ ok;
+ {garbage_collect, _, _, _} = Weird ->
+ {error, [?MODULE, ?LINE, Weird, Term]};
+ {undefined, false, false, _}
+ when Callers == [], Cnt == 0, Acc == 0, Own == 0 ->
+ ok;
+ {undefined, _, _, _} = Weird ->
+ {error, [?MODULE, ?LINE, Weird, Term]};
+ {_, _, _, _} ->
+ case chk_self_call(Term) of
+ true when Callers_Cnt /= Cnt; Callers_Acc /= Acc;
+ Callers_Own /= Own ->
+ {error, [?MODULE, ?LINE, Callers_Sum, Term]};
+ % true when Called_Acc + Own /= Acc ->
+ % io:format("WARNING: ~p:~p, ~p, ~p.~n",
+ % [?MODULE, ?LINE, Term, Called_Sum]),
+ % {error, [?MODULE, ?LINE, Term, Called_Sum]};
+ % ok;
+ true ->
+ ok;
+ false ->
+ {error, [?MODULE, ?LINE, Term]}
+ end
end.
ts_sub({A, B, C}, {A0, B0, C0}) ->
@@ -840,28 +775,28 @@ ts_sub({A, B, C}, {A0, B0, C0}) ->
sum(Funcs) ->
{sum, _Cnt, _Acc, _Own} =
- lists:foldl(
- fun ({_, C1, A1, O1}, {sum, C2, A2, O2}) ->
- {sum, C1+C2, A1+A2, O1+O2}
- end,
- {sum, 0, 0, 0},
- Funcs).
+ lists:foldl(
+ fun ({_, C1, A1, O1}, {sum, C2, A2, O2}) ->
+ {sum, C1+C2, A1+A2, O1+O2}
+ end,
+ {sum, 0, 0, 0},
+ Funcs).
chk_self_call({Callers, {MFA, _Cnt, _Acc, _Own}, Called}) ->
case lists:keysearch(MFA, 1, Callers) of
- false ->
- true;
- {value, {MFA, C, 0, O}} ->
- case lists:keysearch(MFA, 1, Called) of
- false ->
- false;
- {value, {MFA, C, 0, O}} ->
- true;
- {value, _} ->
- false
- end;
- {value, _} ->
- false
+ false ->
+ true;
+ {value, {MFA, C, 0, O}} ->
+ case lists:keysearch(MFA, 1, Called) of
+ false ->
+ false;
+ {value, {MFA, C, 0, O}} ->
+ true;
+ {value, _} ->
+ false
+ end;
+ {value, _} ->
+ false
end.
@@ -879,9 +814,8 @@ ets_select_fold_1('$end_of_table', _, Acc) ->
Acc;
ets_select_fold_1({Matches, Continuation}, Fun, Acc) ->
ets_select_fold_1(ets:select(Continuation),
- Fun,
- lists:foldl(Fun, Acc, Matches)).
-
+ Fun,
+ lists:foldl(Fun, Acc, Matches)).
% ets_select_foreach(Table, MatchSpec, Limit, Fun) ->
@@ -910,7 +844,7 @@ check_own_and_acc(TraceFile, AnalysisFile) ->
check_own_and_acc(TraceFile, AnalysisFile, HandlerFun) ->
dbg:trace_client(file,TraceFile,{HandlerFun,{init,self()}}),
receive {result,Result} ->
- compare(Result,get_own_and_acc_from_analysis(AnalysisFile))
+ compare(Result,get_own_and_acc_from_analysis(AnalysisFile))
end.
%% handle_trace_traced(Trace, Msg) ->
@@ -924,21 +858,21 @@ handle_trace(Trace,{init,Parent}) ->
handle_trace({trace_ts,Pid,in,MFA,TS},P) ->
?dbg("~p",[{{in,Pid,MFA},get(Pid)}]),
case get(Pid) of
- [suspend|[suspend|_]=NewStack] ->
- T = ts_sub(TS,get({Pid,last_ts})),
- update_acc(Pid,NewStack,T),
- put(Pid,NewStack);
- [suspend|NewStack] = Stack ->
- T = ts_sub(TS,get({Pid,last_ts})),
- update_acc(Pid,Stack,T),
- put(Pid,NewStack);
- [] ->
- put(Pid,[MFA]),
- insert(Pid,MFA);
- undefined ->
- put(first_ts,TS),
- put(Pid,[MFA]),
- insert(Pid,MFA)
+ [suspend|[suspend|_]=NewStack] ->
+ T = ts_sub(TS,get({Pid,last_ts})),
+ update_acc(Pid,NewStack,T),
+ put(Pid,NewStack);
+ [suspend|NewStack] = Stack ->
+ T = ts_sub(TS,get({Pid,last_ts})),
+ update_acc(Pid,Stack,T),
+ put(Pid,NewStack);
+ [] ->
+ put(Pid,[MFA]),
+ insert(Pid,MFA);
+ undefined ->
+ put(first_ts,TS),
+ put(Pid,[MFA]),
+ insert(Pid,MFA)
end,
put({Pid,last_ts},TS),
P;
@@ -946,17 +880,17 @@ handle_trace({trace_ts,Pid,out,_MfaOrZero,TS},P) ->
?dbg("~p",[{{out,Pid,_MfaOrZero},get(Pid)}]),
T = ts_sub(TS,get({Pid,last_ts})),
case get(Pid) of
- [suspend|S] = Stack ->
- update_acc(Pid,S,T),
- put(Pid,[suspend|Stack]);
- [MFA|_] = Stack ->
- insert(Pid,suspend),
- update_own(Pid,MFA,T),
- update_acc(Pid,Stack,T),
- put(Pid,[suspend|Stack]);
- [] ->
- insert(Pid,suspend),
- put(Pid,[suspend])
+ [suspend|S] = Stack ->
+ update_acc(Pid,S,T),
+ put(Pid,[suspend|Stack]);
+ [MFA|_] = Stack ->
+ insert(Pid,suspend),
+ update_own(Pid,MFA,T),
+ update_acc(Pid,Stack,T),
+ put(Pid,[suspend|Stack]);
+ [] ->
+ insert(Pid,suspend),
+ put(Pid,[suspend])
end,
put({Pid,last_ts},TS),
P;
@@ -964,26 +898,26 @@ handle_trace({trace_ts,Pid,call,MFA,{cp,Caller},TS},P) ->
?dbg("~p",[{{call,Pid,MFA},get(Pid)}]),
T = ts_sub(TS,get({Pid,last_ts})),
case get(Pid) of
- [MFA|_] = Stack ->
- %% recursive
- update_own(Pid,MFA,T),
- update_acc(Pid,Stack,T);
- [CallingMFA|_] = Stack when Caller==undefined ->
- insert(Pid,MFA),
- update_own(Pid,CallingMFA,T),
- update_acc(Pid,Stack,T),
- put(Pid,[MFA|Stack]);
- [] when Caller==undefined ->
- insert(Pid,MFA),
- insert(Pid,MFA),
- put(Pid,[MFA]);
- Stack0 ->
- Stack = [CallingMFA|_] = insert_caller(Caller,Stack0,[]),
- insert(Pid,MFA),
- insert(Pid,Caller),
- update_own(Pid,CallingMFA,T),
- update_acc(Pid,Stack,T),
- put(Pid,[MFA|Stack])
+ [MFA|_] = Stack ->
+ %% recursive
+ update_own(Pid,MFA,T),
+ update_acc(Pid,Stack,T);
+ [CallingMFA|_] = Stack when Caller==undefined ->
+ insert(Pid,MFA),
+ update_own(Pid,CallingMFA,T),
+ update_acc(Pid,Stack,T),
+ put(Pid,[MFA|Stack]);
+ [] when Caller==undefined ->
+ insert(Pid,MFA),
+ insert(Pid,MFA),
+ put(Pid,[MFA]);
+ Stack0 ->
+ Stack = [CallingMFA|_] = insert_caller(Caller,Stack0,[]),
+ insert(Pid,MFA),
+ insert(Pid,Caller),
+ update_own(Pid,CallingMFA,T),
+ update_acc(Pid,Stack,T),
+ put(Pid,[MFA|Stack])
end,
put({Pid,last_ts},TS),
P;
@@ -991,59 +925,91 @@ handle_trace({trace_ts,Pid,return_to,MFA,TS},P) ->
?dbg("~p",[{{return_to,Pid,MFA},get(Pid)}]),
T = ts_sub(TS,get({Pid,last_ts})),
case get(Pid) of
- [MFA|_] = Stack ->
- %% recursive
- update_own(Pid,MFA,T),
- update_acc(Pid,Stack,T),
- put(Pid,Stack);
- [ReturnFromMFA,MFA|RestOfStack] = Stack ->
- update_own(Pid,ReturnFromMFA,T),
- update_acc(Pid,Stack,T),
- put(Pid,[MFA|RestOfStack]);
- [ReturnFromMFA|RestOfStack] = Stack ->
- update_own(Pid,ReturnFromMFA,T),
- update_acc(Pid,Stack,T),
- case find_return_to(MFA,RestOfStack) of
- [] when MFA==undefined ->
- put(Pid,[]);
- [] ->
- insert(Pid,MFA),
- put(Pid,[MFA]);
- NewStack ->
- put(Pid,NewStack)
- end
+ [MFA|_] = Stack ->
+ %% recursive
+ update_own(Pid,MFA,T),
+ update_acc(Pid,Stack,T),
+ put(Pid,Stack);
+ [ReturnFromMFA,MFA|RestOfStack] = Stack ->
+ update_own(Pid,ReturnFromMFA,T),
+ update_acc(Pid,Stack,T),
+ put(Pid,[MFA|RestOfStack]);
+ [ReturnFromMFA|RestOfStack] = Stack ->
+ update_own(Pid,ReturnFromMFA,T),
+ update_acc(Pid,Stack,T),
+ case find_return_to(MFA,RestOfStack) of
+ [] when MFA==undefined ->
+ put(Pid,[]);
+ [] ->
+ insert(Pid,MFA),
+ put(Pid,[MFA]);
+ NewStack ->
+ put(Pid,NewStack)
+ end
end,
put({Pid,last_ts},TS),
P;
-handle_trace({trace_ts,Pid,gc_start,_,TS},P) ->
- ?dbg("~p",[{{gc_start,Pid},get(Pid)}]),
+handle_trace({trace_ts,Pid,gc_minor_start,_,TS},P) ->
+ ?dbg("~p",[{{gc_minor_start,Pid},get(Pid)}]),
case get(Pid) of
- [suspend|_] = Stack ->
- T = ts_sub(TS,get({Pid,last_ts})),
- insert(Pid,garbage_collect),
- update_acc(Pid,Stack,T),
- put(Pid,[garbage_collect|Stack]);
- [CallingMFA|_] = Stack ->
- T = ts_sub(TS,get({Pid,last_ts})),
- insert(Pid,garbage_collect),
- update_own(Pid,CallingMFA,T),
- update_acc(Pid,Stack,T),
- put(Pid,[garbage_collect|Stack]);
- undefined ->
- put(first_ts,TS),
- put(Pid,[garbage_collect]),
- insert(Pid,garbage_collect)
+ [suspend|_] = Stack ->
+ T = ts_sub(TS,get({Pid,last_ts})),
+ insert(Pid,garbage_collect),
+ update_acc(Pid,Stack,T),
+ put(Pid,[garbage_collect|Stack]);
+ [CallingMFA|_] = Stack ->
+ T = ts_sub(TS,get({Pid,last_ts})),
+ insert(Pid,garbage_collect),
+ update_own(Pid,CallingMFA,T),
+ update_acc(Pid,Stack,T),
+ put(Pid,[garbage_collect|Stack]);
+ undefined ->
+ put(first_ts,TS),
+ put(Pid,[garbage_collect]),
+ insert(Pid,garbage_collect)
end,
put({Pid,last_ts},TS),
P;
-handle_trace({trace_ts,Pid,gc_end,_,TS},P) ->
- ?dbg("~p",[{{gc_end,Pid},get(Pid)}]),
+handle_trace({trace_ts,Pid,gc_major_start,_,TS},P) ->
+ ?dbg("~p",[{{gc_minor_start,Pid},get(Pid)}]),
+ case get(Pid) of
+ [suspend|_] = Stack ->
+ T = ts_sub(TS,get({Pid,last_ts})),
+ insert(Pid,garbage_collect),
+ update_acc(Pid,Stack,T),
+ put(Pid,[garbage_collect|Stack]);
+ [CallingMFA|_] = Stack ->
+ T = ts_sub(TS,get({Pid,last_ts})),
+ insert(Pid,garbage_collect),
+ update_own(Pid,CallingMFA,T),
+ update_acc(Pid,Stack,T),
+ put(Pid,[garbage_collect|Stack]);
+ undefined ->
+ put(first_ts,TS),
+ put(Pid,[garbage_collect]),
+ insert(Pid,garbage_collect)
+ end,
+ put({Pid,last_ts},TS),
+ P;
+handle_trace({trace_ts,Pid,gc_minor_end,_,TS},P) ->
+ ?dbg("~p",[{{gc_minor_end,Pid},get(Pid)}]),
T = ts_sub(TS,get({Pid,last_ts})),
case get(Pid) of
- [garbage_collect|RestOfStack] = Stack ->
- update_own(Pid,garbage_collect,T),
- update_acc(Pid,Stack,T),
- put(Pid,RestOfStack)
+ [garbage_collect|RestOfStack] = Stack ->
+ update_own(Pid,garbage_collect,T),
+ update_acc(Pid,Stack,T),
+ put(Pid,RestOfStack)
+ end,
+ put({Pid,last_ts},TS),
+ P;
+handle_trace({trace_ts,Pid,gc_major_end,_,TS},P) ->
+ ?dbg("~p",[{{gc_major_end,Pid},get(Pid)}]),
+ T = ts_sub(TS,get({Pid,last_ts})),
+ case get(Pid) of
+ [garbage_collect|RestOfStack] = Stack ->
+ update_own(Pid,garbage_collect,T),
+ update_acc(Pid,Stack,T),
+ put(Pid,RestOfStack)
end,
put({Pid,last_ts},TS),
P;
@@ -1051,27 +1017,45 @@ handle_trace({trace_ts,Pid,spawn,NewPid,{M,F,Args},TS},P) ->
MFA = {M,F,length(Args)},
?dbg("~p",[{{spawn,Pid,NewPid,MFA},get(Pid)}]),
T = ts_sub(TS,get({Pid,last_ts})),
- put({NewPid,last_ts},TS),
- put(NewPid,[suspend,MFA]),
- insert(NewPid,suspend),
- insert(NewPid,MFA),
+ case get(NewPid) of
+ undefined ->
+ put({NewPid,last_ts},TS),
+ put(NewPid,[suspend,MFA]),
+ insert(NewPid,suspend),
+ insert(NewPid,MFA);
+ _Else ->
+ ok
+ end,
case get(Pid) of
- [SpawningMFA|_] = Stack ->
- update_own(Pid,SpawningMFA,T),
- update_acc(Pid,Stack,T)
+ [SpawningMFA|_] = Stack ->
+ update_own(Pid,SpawningMFA,T),
+ update_acc(Pid,Stack,T)
end,
put({Pid,last_ts},TS),
P;
+handle_trace({trace_ts,NewPid,spawned,Pid,{M,F,Args},TS},P) ->
+ MFA = {M,F,length(Args)},
+ ?dbg("~p",[{{spawned,NewPid,Pid,MFA},get(NewPid)}]),
+ case get(NewPid) of
+ undefined ->
+ put({NewPid,last_ts},TS),
+ put(NewPid,[suspend,MFA]),
+ insert(NewPid,suspend),
+ insert(NewPid,MFA);
+ _Else ->
+ ok
+ end,
+ P;
handle_trace({trace_ts,Pid,exit,_Reason,TS},P) ->
?dbg("~p",[{{exit,Pid,_Reason},get(Pid)}]),
T = ts_sub(TS,get({Pid,last_ts})),
case get(Pid) of
- [DyingMFA|_] = Stack ->
- update_own(Pid,DyingMFA,T),
- update_acc(Pid,Stack,T),
- put(Pid,[]);
- [] ->
- ok
+ [DyingMFA|_] = Stack ->
+ update_own(Pid,DyingMFA,T),
+ update_acc(Pid,Stack,T),
+ put(Pid,[]);
+ [] ->
+ ok
end,
put({Pid,last_ts},TS),
P;
@@ -1089,6 +1073,7 @@ handle_trace(end_of_trace,P) ->
P ! {result,[{totals,TotAcc,TotOwn}|ProcOwns]++Result},
P;
handle_trace(Other,_P) ->
+ ct:log("Got unexpected trace message: ~p",[Other]),
exit({unexpected,Other}).
find_return_to(MFA,[MFA|_]=Stack) ->
@@ -1107,10 +1092,10 @@ insert_caller(MFA,[],Result) ->
insert(Pid,MFA) ->
case ets:member(fprof_verify_tab,{Pid,MFA}) of
- false ->
- ets:insert(fprof_verify_tab,{{Pid,MFA},0,0});
- true ->
- ok
+ false ->
+ ets:insert(fprof_verify_tab,{{Pid,MFA},0,0});
+ true ->
+ ok
end.
update_own(Pid,MFA,T) ->
@@ -1118,11 +1103,11 @@ update_own(Pid,MFA,T) ->
update_acc(Pid,[MFA|Rest],T) ->
case lists:member(MFA,Rest) of
- true ->
- %% Only charge one time for recursive functions
- ok;
- false ->
- ets:update_counter(fprof_verify_tab,{Pid,MFA},{2,T})
+ true ->
+ %% Only charge one time for recursive functions
+ ok;
+ false ->
+ ets:update_counter(fprof_verify_tab,{Pid,MFA},{2,T})
end,
update_acc(Pid,Rest,T);
update_acc(_Pid,[],_T) ->
@@ -1140,63 +1125,63 @@ get_last_ts([],Last) ->
get_proc_owns([{{Pid,_MFA},_Acc,Own}|Rest],Result,Sum) ->
NewResult =
- case lists:keysearch(Pid,1,Result) of
- {value,{Pid,undefined,PidOwn}} ->
- lists:keyreplace(Pid,1,Result,{Pid,undefined,PidOwn+Own});
- false ->
- [{Pid,undefined,Own}|Result]
+ case lists:keysearch(Pid,1,Result) of
+ {value,{Pid,undefined,PidOwn}} ->
+ lists:keyreplace(Pid,1,Result,{Pid,undefined,PidOwn+Own});
+ false ->
+ [{Pid,undefined,Own}|Result]
end,
get_proc_owns(Rest,NewResult,Sum+Own);
get_proc_owns([],Result,Sum) ->
{Sum,Result}.
-
+
compare([X|Rest],FprofResult) ->
FprofResult1 =
- case lists:member(X,FprofResult) of
- true ->
- ?dbg("~p",[X]),
- lists:delete(X,FprofResult);
- false ->
- case lists:keysearch(element(1,X),1,FprofResult) of
- {value,Fprof} ->
- put(compare_error,true),
- io:format("Error: Different values\n"
- "Fprof: ~p\n"
- "Simulator: ~p",[Fprof,X]),
- lists:delete(Fprof,FprofResult);
- false ->
- put(compare_error,true),
- io:format("Error: Missing in fprof: ~p",[X]),
- FprofResult
- end
- end,
+ case lists:member(X,FprofResult) of
+ true ->
+ ?dbg("~p",[X]),
+ lists:delete(X,FprofResult);
+ false ->
+ case lists:keysearch(element(1,X),1,FprofResult) of
+ {value,Fprof} ->
+ put(compare_error,true),
+ io:format("Error: Different values\n"
+ "Fprof: ~p\n"
+ "Simulator: ~p",[Fprof,X]),
+ lists:delete(Fprof,FprofResult);
+ false ->
+ put(compare_error,true),
+ io:format("Error: Missing in fprof: ~p",[X]),
+ FprofResult
+ end
+ end,
compare(Rest,FprofResult1);
compare([],Rest) ->
case {remove_undefined(Rest,[]),get(compare_error)} of
- {[],undefined} -> ok;
- {Error,_} ->
- case Error of
- [] -> ok;
- _ -> io:format("\nMissing in simulator results:\n~p\n",[Error])
- end,
- ?t:fail({error,mismatch_between_simulator_and_fprof})
+ {[],undefined} -> ok;
+ {Error,_} ->
+ case Error of
+ [] -> ok;
+ _ -> io:format("\nMissing in simulator results:\n~p\n",[Error])
+ end,
+ ct:fail({error,mismatch_between_simulator_and_fprof})
end.
-
+
remove_undefined([{{_Pid,undefined},_,_}|Rest],Result) ->
remove_undefined(Rest,Result);
remove_undefined([X|Rest],Result) ->
remove_undefined(Rest,[X|Result]);
remove_undefined([],Result) ->
Result.
-
+
get_own_and_acc_from_analysis(Log) ->
case file:consult(Log) of
- {ok,[_Options,[{totals,_,TotAcc,TotOwn}]|Rest]} ->
- get_own_and_acc(undefined,Rest,
- [{totals,m1000(TotAcc),m1000(TotOwn)}]);
- Error ->
- exit({error,{cant_open,Log,Error}})
+ {ok,[_Options,[{totals,_,TotAcc,TotOwn}]|Rest]} ->
+ get_own_and_acc(undefined,Rest,
+ [{totals,m1000(TotAcc),m1000(TotOwn)}]);
+ Error ->
+ exit({error,{cant_open,Log,Error}})
end.
get_own_and_acc(_,[[{PidStr,_,Acc,Own}|_]|Rest],Result) ->
@@ -1212,3 +1197,5 @@ m1000(undefined) ->
m1000(X) ->
round(X*1000).
+divide(_,0) -> inf;
+divide(A,B) -> A / B.
diff --git a/lib/tools/test/ignore_cores.erl b/lib/tools/test/ignore_cores.erl
index e40b91392c..25dce346b9 100644
--- a/lib/tools/test/ignore_cores.erl
+++ b/lib/tools/test/ignore_cores.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ init(Config) ->
fini(Config) ->
#ignore_cores{org_cwd = OrgCWD,
org_path = OrgPath,
- org_pwd_env = OrgPWD} = ?config(ignore_cores, Config),
+ org_pwd_env = OrgPWD} = proplists:get_value(ignore_cores, Config),
ok = file:set_cwd(OrgCWD),
true = code:set_path(OrgPath),
case OrgPWD of
@@ -70,10 +70,10 @@ setup(Suite, Testcase, Config, SetCwd) when is_atom(Suite),
is_list(Config) ->
#ignore_cores{org_cwd = OrgCWD,
org_path = OrgPath,
- org_pwd_env = OrgPWD} = ?config(ignore_cores, Config),
+ org_pwd_env = OrgPWD} = proplists:get_value(ignore_cores, Config),
Path = lists:map(fun (".") -> OrgCWD; (Dir) -> Dir end, OrgPath),
true = code:set_path(Path),
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
IgnDir = filename:join([PrivDir,
atom_to_list(Suite)
++ "_"
@@ -94,7 +94,7 @@ setup(Suite, Testcase, Config, SetCwd) when is_atom(Suite),
end,
ok = file:write_file(filename:join([IgnDir, "ignore_core_files"]), <<>>),
%% cores are dumped in /cores on MacOS X
- CoresDir = case {?t:os_type(), filelib:is_dir("/cores")} of
+ CoresDir = case {os:type(), filelib:is_dir("/cores")} of
{{unix,darwin}, true} ->
filelib:fold_files("/cores",
"^core.*$",
@@ -119,7 +119,7 @@ restore(Config) ->
org_path = OrgPath,
org_pwd_env = OrgPWD,
ign_dir = IgnDir,
- cores_dir = CoresDir} = ?config(ignore_cores, Config),
+ cores_dir = CoresDir} = proplists:get_value(ignore_cores, Config),
try
case CoresDir of
false ->
@@ -155,5 +155,5 @@ restore(Config) ->
dir(Config) ->
- #ignore_cores{ign_dir = Dir} = ?config(ignore_cores, Config),
+ #ignore_cores{ign_dir = Dir} = proplists:get_value(ignore_cores, Config),
Dir.
diff --git a/lib/tools/test/instrument_SUITE.erl b/lib/tools/test/instrument_SUITE.erl
index 773d805cd0..f37d28c277 100644
--- a/lib/tools/test/instrument_SUITE.erl
+++ b/lib/tools/test/instrument_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -19,133 +19,99 @@
%%
-module(instrument_SUITE).
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- init_per_testcase/2,end_per_testcase/2]).
-
+-export([all/0, suite/0]).
-export(['+Mim true'/1, '+Mis true'/1]).
-include_lib("common_test/include/ct.hrl").
-init_per_testcase(_Case, Config) ->
- ?line Dog=?t:timetrap(10000),
- [{watchdog, Dog}|Config].
-
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
- ok.
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{seconds,10}}].
all() ->
['+Mim true', '+Mis true'].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-'+Mim true'(doc) -> ["Check that memory data can be read and processed"];
-'+Mim true'(suite) -> [];
+%% Check that memory data can be read and processed
'+Mim true'(Config) when is_list(Config) ->
- ?line Node = start_slave("+Mim true"),
- ?line MD = rpc:call(Node, instrument, memory_data, []),
- ?line [{total,[{sizes,S1,S2,S3},{blocks,B1,B2,B3}]}]
+ Node = start_slave("+Mim true"),
+ MD = rpc:call(Node, instrument, memory_data, []),
+ [{total,[{sizes,S1,S2,S3},{blocks,B1,B2,B3}]}]
= rpc:call(Node, instrument, memory_status, [total]),
- ?line stop_slave(Node),
- ?line true = S1 =< S2,
- ?line true = S2 =< S3,
- ?line true = B1 =< B2,
- ?line true = B2 =< B3,
- ?line MDS = instrument:sort(MD),
- ?line {Low, High} = instrument:mem_limits(MDS),
- ?line true = Low < High,
- ?line {_, AL} = MDS,
- ?line SumBlocks = instrument:sum_blocks(MD),
- ?line case SumBlocks of
- N when is_integer(N) ->
- ?line N = lists:foldl(fun ({_,_,Size,_}, Sum) ->
- Size+Sum
- end,
- 0,
- AL),
- ?line N =< S3;
- Other ->
- ?line ?t:fail(Other)
- end,
- ?line lists:foldl(
- fun ({TDescr,Addr,Size,Proc}, MinAddr) ->
- ?line true = TDescr /= invalid_type,
- ?line true = is_integer(TDescr),
- ?line true = is_integer(Addr),
- ?line true = is_integer(Size),
- ?line true = Addr >= MinAddr,
- ?line case Proc of
- {0, Number, Serial} ->
- ?line true = is_integer(Number),
- ?line true = is_integer(Serial);
- undefined ->
- ok;
- BadProc ->
- ?line ?t:fail({badproc, BadProc})
- end,
- ?line NextMinAddr = Addr+Size,
- ?line true = NextMinAddr =< High,
- ?line NextMinAddr
- end,
- Low,
- AL),
- ?line {_, DAL} = instrument:descr(MDS),
- ?line lists:foreach(
- fun ({TDescr,_,_,Proc}) ->
- ?line true = TDescr /= invalid_type,
- ?line true = is_atom(TDescr) orelse is_list(TDescr),
- ?line true = is_pid(Proc) orelse Proc == undefined
- end,
- DAL),
- ?line ASL = lists:map(fun ({_,A,S,_}) -> {A,S} end, AL),
- ?line ASL = lists:map(fun ({_,A,S,_}) -> {A,S} end, DAL),
- ?line instrument:holes(MDS),
- ?line {comment,
- "total status - sum of blocks = " ++ integer_to_list(S1-SumBlocks)}.
-
-'+Mis true'(doc) -> ["Check that memory data can be read and processed"];
-'+Mis true'(suite) -> [];
+ stop_slave(Node),
+ true = S1 =< S2,
+ true = S2 =< S3,
+ true = B1 =< B2,
+ true = B2 =< B3,
+ MDS = instrument:sort(MD),
+ {Low, High} = instrument:mem_limits(MDS),
+ true = Low < High,
+ {_, AL} = MDS,
+ SumBlocks = instrument:sum_blocks(MD),
+ case SumBlocks of
+ N when is_integer(N) ->
+ N = lists:foldl(fun ({_,_,Size,_}, Sum) ->
+ Size+Sum
+ end, 0, AL),
+ true = N =< S3;
+ Other ->
+ ct:fail(Other)
+ end,
+ lists:foldl(
+ fun ({TDescr,Addr,Size,Proc}, MinAddr) ->
+ true = TDescr /= invalid_type,
+ true = is_integer(TDescr),
+ true = is_integer(Addr),
+ true = is_integer(Size),
+ true = Addr >= MinAddr,
+ case Proc of
+ {0, Number, Serial} ->
+ true = is_integer(Number),
+ true = is_integer(Serial);
+ undefined ->
+ ok;
+ BadProc ->
+ ct:fail({badproc, BadProc})
+ end,
+ NextMinAddr = Addr+Size,
+ true = NextMinAddr =< High,
+ NextMinAddr
+ end, Low, AL),
+ {_, DAL} = instrument:descr(MDS),
+ lists:foreach(
+ fun ({TDescr,_,_,Proc}) ->
+ true = TDescr /= invalid_type,
+ true = is_atom(TDescr) orelse is_list(TDescr),
+ true = is_pid(Proc) orelse Proc == undefined
+ end, DAL),
+ ASL = lists:map(fun ({_,A,S,_}) -> {A,S} end, AL),
+ ASL = lists:map(fun ({_,A,S,_}) -> {A,S} end, DAL),
+ instrument:holes(MDS),
+ {comment, "total status - sum of blocks = " ++ integer_to_list(S1-SumBlocks)}.
+
+%% Check that memory data can be read and processed
'+Mis true'(Config) when is_list(Config) ->
- ?line Node = start_slave("+Mis true"),
- ?line [{total,[{sizes,S1,S2,S3},{blocks,B1,B2,B3}]}]
+ Node = start_slave("+Mis true"),
+ [{total,[{sizes,S1,S2,S3},{blocks,B1,B2,B3}]}]
= rpc:call(Node, instrument, memory_status, [total]),
- ?line true = S1 =< S2,
- ?line true = S2 =< S3,
- ?line true = B1 =< B2,
- ?line true = B2 =< B3,
- ?line true = is_list(rpc:call(Node,instrument,memory_status,[allocators])),
- ?line true = is_list(rpc:call(Node,instrument,memory_status,[classes])),
- ?line true = is_list(rpc:call(Node,instrument,memory_status,[types])),
- ?line ok.
+ true = S1 =< S2,
+ true = S2 =< S3,
+ true = B1 =< B2,
+ true = B2 =< B3,
+ true = is_list(rpc:call(Node,instrument,memory_status,[allocators])),
+ true = is_list(rpc:call(Node,instrument,memory_status,[classes])),
+ true = is_list(rpc:call(Node,instrument,memory_status,[types])),
+ ok.
start_slave(Args) ->
- ?line {A, B, C} = now(),
- ?line MicroSecs = A*1000000000000 + B*1000000 + C,
- ?line Name = "instr_" ++ integer_to_list(MicroSecs),
- ?line Pa = filename:dirname(code:which(?MODULE)),
- ?line {ok, Node} = ?t:start_node(list_to_atom(Name),
- slave,
- [{args, "-pa " ++ Pa ++ " " ++ Args}]),
- ?line Node.
+ MicroSecs = erlang:monotonic_time(),
+ Name = "instr" ++ integer_to_list(MicroSecs),
+ Pa = filename:dirname(code:which(?MODULE)),
+ {ok, Node} = test_server:start_node(list_to_atom(Name),
+ slave,
+ [{args, "-pa " ++ Pa ++ " " ++ Args}]),
+ Node.
stop_slave(Node) ->
- ?line true = ?t:stop_node(Node).
+ true = test_server:stop_node(Node).
diff --git a/lib/tools/test/lcnt_SUITE.erl b/lib/tools/test/lcnt_SUITE.erl
index 47b8031bee..d39a5deeab 100644
--- a/lib/tools/test/lcnt_SUITE.erl
+++ b/lib/tools/test/lcnt_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -22,56 +22,36 @@
-include_lib("common_test/include/ct.hrl").
%% Test server specific exports
--export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]).
--export([init_per_suite/1, end_per_suite/1]).
+-export([all/0, suite/0]).
-export([init_per_testcase/2, end_per_testcase/2]).
%% Test cases
--export([
- t_load/1,
- t_conflicts/1,
- t_locations/1,
- t_swap_keys/1
- ]).
-
-%% Default timetrap timeout (set in init_per_testcase)
--define(default_timeout, ?t:minutes(4)).
-
-init_per_suite(Config) when is_list(Config) ->
- Config.
-
-end_per_suite(Config) when is_list(Config) ->
- Config.
+-export([t_load/1,
+ t_conflicts/1,
+ t_locations/1,
+ t_swap_keys/1]).
init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?default_timeout),
- [{watchdog,Dog} | Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
catch lcnt:stop(),
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
-
-all() -> [t_load, t_conflicts, t_locations, t_swap_keys].
-
-groups() -> [].
-
-init_per_group(_GroupName, Config) -> Config.
-
-end_per_group(_GroupName, Config) -> Config.
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,4}}].
+all() ->
+ [t_load, t_conflicts, t_locations, t_swap_keys].
%%----------------------------------------------------------------------
%% Tests
%%----------------------------------------------------------------------
-t_load(suite) -> [];
-t_load(doc) -> ["Load data from file."];
+%% Load data from file.
t_load(Config) when is_list(Config) ->
- Path = ?config(data_dir, Config),
+ Path = proplists:get_value(data_dir, Config),
Files = [filename:join([Path,"big_bang_40.lcnt"]),
filename:join([Path,"ehb_3_3_hist.lcnt"])],
ok = t_load_file(Files),
@@ -84,10 +64,9 @@ t_load_file([File|Files]) ->
ok = lcnt:stop(),
t_load_file(Files).
-t_conflicts(suite) -> [];
-t_conflicts(doc) -> ["API: conflicts"];
+%% API: conflicts
t_conflicts(Config) when is_list(Config) ->
- Path = ?config(data_dir, Config),
+ Path = proplists:get_value(data_dir, Config),
Files = [filename:join([Path,"big_bang_40.lcnt"]),
filename:join([Path,"ehb_3_3_hist.lcnt"])],
ok = t_conflicts_file(Files),
@@ -118,10 +97,9 @@ test_conflicts_opts([Opt|Opts]) ->
ok = lcnt:conflicts(Opt),
test_conflicts_opts(Opts).
-t_locations(suite) -> [];
-t_locations(doc) -> ["API: locations"];
+%% API: locations
t_locations(Config) when is_list(Config) ->
- Path = ?config(data_dir, Config),
+ Path = proplists:get_value(data_dir, Config),
Files = [filename:join([Path,"big_bang_40.lcnt"]),
filename:join([Path,"ehb_3_3_hist.lcnt"])],
ok = t_locations_file(Files),
@@ -151,10 +129,9 @@ test_locations_opts([Opt|Opts]) ->
ok = lcnt:locations(Opt),
test_locations_opts(Opts).
-t_swap_keys(suite) -> [];
-t_swap_keys(doc) -> ["Test interchanging port/process id with class"];
+%% Test interchanging port/process id with class
t_swap_keys(Config) when is_list(Config) ->
- Path = ?config(data_dir, Config),
+ Path = proplists:get_value(data_dir, Config),
Files = [filename:join([Path,"big_bang_40.lcnt"]),
filename:join([Path,"ehb_3_3_hist.lcnt"])],
ok = t_swap_keys_file(Files),
@@ -169,12 +146,3 @@ t_swap_keys_file([File|Files]) ->
ok = lcnt:conflicts(),
ok = lcnt:stop(),
t_swap_keys_file(Files).
-
-
-%%----------------------------------------------------------------------
-%% Auxiliary tests
-%%----------------------------------------------------------------------
-
-%%----------------------------------------------------------------------
-%% Auxiliary
-%%----------------------------------------------------------------------
diff --git a/lib/tools/test/make_SUITE.erl b/lib/tools/test/make_SUITE.erl
index fdcc310df1..e6284db8b8 100644
--- a/lib/tools/test/make_SUITE.erl
+++ b/lib/tools/test/make_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -20,10 +20,10 @@
-module(make_SUITE).
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2, make_all/1, make_files/1]).
+ init_per_group/2,end_per_group/2, make_all/1, make_files/1]).
-export([otp_6057_init/1,
- otp_6057_a/1, otp_6057_b/1, otp_6057_c/1,
- otp_6057_end/1]).
+ otp_6057_a/1, otp_6057_b/1, otp_6057_c/1,
+ otp_6057_end/1]).
-include_lib("common_test/include/ct.hrl").
@@ -44,7 +44,7 @@ all() ->
groups() ->
[{otp_6057,[],[otp_6057_a, otp_6057_b,
- otp_6057_c]}].
+ otp_6057_c]}].
init_per_suite(Config) ->
Config.
@@ -61,52 +61,50 @@ end_per_group(_GroupName, Config) ->
test_files() -> ["test1", "test2", "test3", "test4"].
-make_all(suite) -> [];
make_all(Config) when is_list(Config) ->
- ?line Current = prepare_data_dir(Config),
- ?line up_to_date = make:all(),
- ?line ok = ensure_exists(test_files()),
- ?line ok = ensure_exists(["test5"],".S"), % Emakefile: [{test5,['S']}
- ?line file:set_cwd(Current),
- ?line ensure_no_messages(),
+ Current = prepare_data_dir(Config),
+ up_to_date = make:all(),
+ ok = ensure_exists(test_files()),
+ ok = ensure_exists(["test5"],".S"), % Emakefile: [{test5,['S']}
+ file:set_cwd(Current),
+ ensure_no_messages(),
ok.
-make_files(suite) -> [];
make_files(Config) when is_list(Config) ->
- ?line Current = prepare_data_dir(Config),
+ Current = prepare_data_dir(Config),
%% Make files that exist.
- ?line Files = [test1, test2],
- ?line up_to_date = make:files(Files), % ok files
- ?line ok = ensure_exists(Files),
+ Files = [test1, test2],
+ up_to_date = make:files(Files), % ok files
+ ok = ensure_exists(Files),
- ?line error = make:files([test1,test7]), % non existing file
- ?line up_to_date = make:files([test1,test2],[debug_info]), % with option
+ error = make:files([test1,test7]), % non existing file
+ up_to_date = make:files([test1,test2],[debug_info]), % with option
- ?line file:set_cwd(Current),
- ?line ensure_no_messages(),
+ file:set_cwd(Current),
+ ensure_no_messages(),
ok.
%% Moves to the data directory of this suite, clean it from any object
%% files (*.jam for a JAM emulator). Returns the previous directory.
prepare_data_dir(Config) ->
- ?line {ok, Current} = file:get_cwd(),
- ?line {value, {data_dir, Dir}} = lists:keysearch(data_dir, 1, Config),
- ?line file:set_cwd(Dir),
- ?line {ok, Files} = file:list_dir("."),
- ?line delete_obj(Files, code:objfile_extension()),
- ?line ensure_no_messages(),
+ {ok, Current} = file:get_cwd(),
+ {value, {data_dir, Dir}} = lists:keysearch(data_dir, 1, Config),
+ file:set_cwd(Dir),
+ {ok, Files} = file:list_dir("."),
+ delete_obj(Files, code:objfile_extension()),
+ ensure_no_messages(),
Current.
delete_obj([File|Rest], ObjExt) ->
- ?line case filename:extension(File) of
- ObjExt -> file:delete(File);
- ".S" -> file:delete(File);
- _ -> ok
- end,
- ?line delete_obj(Rest, ObjExt);
+ case filename:extension(File) of
+ ObjExt -> file:delete(File);
+ ".S" -> file:delete(File);
+ _ -> ok
+ end,
+ delete_obj(Rest, ObjExt);
delete_obj([], _) ->
ok.
@@ -120,26 +118,26 @@ ensure_exists([Name|Rest], ObjExt) when is_atom(Name) ->
ensure_exists([atom_to_list(Name)|Rest], ObjExt);
ensure_exists([Name|Rest], ObjExt) ->
case filelib:is_regular(Name++ObjExt) of
- true ->
- ensure_exists(Rest, ObjExt);
- false ->
- Name++ObjExt
+ true ->
+ ensure_exists(Rest, ObjExt);
+ false ->
+ Name++ObjExt
end;
ensure_exists([], _) ->
ok.
otp_6057_init(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line PrivDir = ?config(priv_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
%% Create the directories PrivDir/otp_6057/src1, /src2 and /ebin
Src1 = filename:join([PrivDir, otp_6057, src1]),
Src2 = filename:join([PrivDir, otp_6057, src2]),
Ebin = filename:join([PrivDir, otp_6057, ebin]),
- ?line ok = file:make_dir(filename:join(PrivDir, otp_6057)),
- ?line ok = file:make_dir(Src1),
- ?line ok = file:make_dir(Src2),
- ?line ok = file:make_dir(Ebin),
+ ok = file:make_dir(filename:join(PrivDir, otp_6057)),
+ ok = file:make_dir(Src1),
+ ok = file:make_dir(Src2),
+ ok = file:make_dir(Ebin),
%% Copy test1.erl and test2.erl to src1, and test3.erl to src2
Test1orig = filename:join(DataDir, "test1.erl"),
@@ -148,35 +146,32 @@ otp_6057_init(Config) when is_list(Config) ->
Test1 = filename:join(Src1, "test1.erl"),
Test2 = filename:join(Src1, "test2.erl"),
Test3 = filename:join(Src2, "test3.erl"),
- ?line {ok, _} = file:copy(Test1orig, Test1),
- ?line {ok, _} = file:copy(Test2orig, Test2),
- ?line {ok, _} = file:copy(Test3orig, Test3),
+ {ok, _} = file:copy(Test1orig, Test1),
+ {ok, _} = file:copy(Test2orig, Test2),
+ {ok, _} = file:copy(Test3orig, Test3),
%% Create an Emakefile in src1
Emakefile = filename:join(Src1, "Emakefile"),
- ?line {ok, Fd} = file:open(Emakefile, write),
- ?line ok = io:write(Fd, {["test1.erl","test2","../src2/test3"],
- [{outdir,"../ebin"}]}),
- ?line ok = io:fwrite(Fd, ".~n", []),
- ?line ok = file:close(Fd),
+ {ok, Fd} = file:open(Emakefile, write),
+ ok = io:write(Fd, {["test1.erl","test2","../src2/test3"],
+ [{outdir,"../ebin"}]}),
+ ok = io:fwrite(Fd, ".~n", []),
+ ok = file:close(Fd),
- ?line ensure_no_messages(),
+ ensure_no_messages(),
Config.
-otp_6057_a(suite) ->
- [];
-otp_6057_a(doc) ->
- ["Test that make:all/0, suite/0 looks for object file in correct place"];
+%% Test that make:all/0, suite/0 looks for object file in correct place
otp_6057_a(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
%% Go to src1, saving old CWD
- ?line {ok, CWD} = file:get_cwd(),
+ {ok, CWD} = file:get_cwd(),
Src1 = filename:join([PrivDir, otp_6057, src1]),
- ?line ok = file:set_cwd(Src1),
+ ok = file:set_cwd(Src1),
%% Call make:all()
- ?line up_to_date = make:all(),
+ up_to_date = make:all(),
%% Ensure that all beam files are created in the ebin directory
Ebin = filename:join([PrivDir, otp_6057, ebin]),
@@ -184,109 +179,103 @@ otp_6057_a(Config) when is_list(Config) ->
Test2 = filename:join(Ebin, test2),
Test3 = filename:join(Ebin, test3),
case ensure_exists([Test1, Test2, Test3]) of
- ok -> ok;
- Missing ->
- ?line ?t:fail({"missing beam file", Missing})
+ ok -> ok;
+ Missing ->
+ ct:fail({"missing beam file", Missing})
end,
%% Check creation date of test1.beam and make sure it is not
%% recompiled if make:all() is called again.
%% (Sleep a while, if the file is recompiled within a second then
%% mtime will be the same).
- ?line {ok, FileInfo1} = file:read_file_info(Test1++".beam"),
+ {ok, FileInfo1} = file:read_file_info(Test1++".beam"),
Date1 = FileInfo1#file_info.mtime,
- ?t:sleep(?t:seconds(2)),
- ?line up_to_date = make:all(),
- ?line {ok, FileInfo2} = file:read_file_info(Test1++".beam"),
+ timer:sleep(2000),
+ up_to_date = make:all(),
+ {ok, FileInfo2} = file:read_file_info(Test1++".beam"),
case FileInfo2#file_info.mtime of
- Date1 -> ok;
- _Date2 ->
- ?line ?t:fail({"recompiled beam file", Test1++".beam"})
+ Date1 -> ok;
+ _Date2 ->
+ ct:fail({"recompiled beam file", Test1++".beam"})
end,
%% Remove the beam files
- ?line ok =
- ensure_removed([Test1++".beam",Test2++".beam",Test2++".beam"]),
+ ok =
+ ensure_removed([Test1++".beam",Test2++".beam",Test2++".beam"]),
%% Return to original CWD
- ?line ok = file:set_cwd(CWD),
+ ok = file:set_cwd(CWD),
- ?line ensure_no_messages(),
+ ensure_no_messages(),
ok.
-otp_6057_b(suite) ->
- [];
-otp_6057_b(doc) ->
- ["Test that make:files/1 can handle a file in another directory"];
+%% Test that make:files/1 can handle a file in another directory
otp_6057_b(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
%% Go to src1, saving old CWD
- ?line {ok, CWD} = file:get_cwd(),
+ {ok, CWD} = file:get_cwd(),
Src1 = filename:join([PrivDir, otp_6057, src1]),
- ?line ok = file:set_cwd(Src1),
+ ok = file:set_cwd(Src1),
%% Ensure there is no beam file already
Ebin = filename:join([PrivDir, otp_6057, ebin]),
Test3 = filename:join(Ebin, "test3"),
- ?line ok = ensure_removed([Test3++".beam"]),
+ ok = ensure_removed([Test3++".beam"]),
%% Call make:files/1
- ?line up_to_date = make:files(["../src2/test3"]),
-
+ up_to_date = make:files(["../src2/test3"]),
+
%% Ensure that the beam file is created in the ebin directory
case ensure_exists([Test3]) of
- ok -> ok;
- Missing ->
- ?line ?t:fail({"missing beam file", Missing})
+ ok -> ok;
+ Missing ->
+ ct:fail({"missing beam file", Missing})
end,
%% Remove the beam file
- ?line ok = ensure_removed([Test3++".beam"]),
+ ok = ensure_removed([Test3++".beam"]),
%% Return to original CWD
- ?line ok = file:set_cwd(CWD),
+ ok = file:set_cwd(CWD),
- ?line ensure_no_messages(),
+ ensure_no_messages(),
ok.
-otp_6057_c(suite) ->
- [];
-otp_6057_c(doc) ->
- ["Test that make:files/1 find options in Emakefile if a file is "
- "given with the .erl extension there"];
+%% Test that make:files/1 find options in Emakefile if a file is
+%% given with the .erl extension there
otp_6057_c(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
%% Go to src1, saving old CWD
- ?line {ok, CWD} = file:get_cwd(),
+ {ok, CWD} = file:get_cwd(),
Src1 = filename:join([PrivDir, otp_6057, src1]),
- ?line ok = file:set_cwd(Src1),
+ ok = file:set_cwd(Src1),
%% Ensure there are no beam files already
Ebin = filename:join([PrivDir, otp_6057, ebin]),
Test1 = filename:join(Ebin, "test1"),
Test2 = filename:join(Ebin, "test2"),
- ?line ok = ensure_removed([Test1++".beam",Test2++".beam"]),
+ ok = ensure_removed([Test1++".beam",Test2++".beam"]),
%% Call make:files/1
- ?line up_to_date = make:files([test1, test2]),
-
+ up_to_date = make:files([test1, test2]),
+
%% Ensure that the beam files are created in the ebin directory
Ebin = filename:join([PrivDir, otp_6057, ebin]),
case ensure_exists([Test1, Test2]) of
- ok -> ok;
- Missing ->
- ?line ?t:fail({"missing beam file", Missing})
+ ok -> ok;
+ Missing ->
+ ct:fail({"missing beam file", Missing})
end,
%% Remove the beam files
- ?line ok = ensure_removed([Test1++".beam", Test2++".beam"]),
+ ok = ensure_removed([Test1++".beam", Test2++".beam"]),
%% Return to original CWD
- ?line ok = file:set_cwd(CWD),
+ ok = file:set_cwd(CWD),
- ?line ensure_no_messages(),
+ ensure_no_messages(),
ok.
otp_6057_end(Config) when is_list(Config) ->
@@ -303,13 +292,12 @@ ensure_no_messages() ->
ensure_no_messages(N) ->
receive
- Any ->
- io:format("Unexpected message: ~p", [Any]),
- ensure_no_messages(N+1)
+ Any ->
+ io:format("Unexpected message: ~p", [Any]),
+ ensure_no_messages(N+1)
after 0 ->
- case N of
- 0 -> ok;
- N -> ?t:fail()
- end
+ case N of
+ 0 -> ok;
+ N -> ct:fail(failed)
+ end
end.
-
diff --git a/lib/tools/test/tools_SUITE.erl b/lib/tools/test/tools_SUITE.erl
index ae2a69305b..b50f67a06a 100644
--- a/lib/tools/test/tools_SUITE.erl
+++ b/lib/tools/test/tools_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -21,58 +21,29 @@
-include_lib("common_test/include/ct.hrl").
-%% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
-define(application, tools).
%% Test server specific exports
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2]).
--export([init_per_testcase/2, end_per_testcase/2]).
+-export([all/0, suite/0]).
%% Test cases must be exported.
-export([app_test/1, appup_test/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[app_test, appup_test].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
-init_per_testcase(_Case, Config) ->
- ?line Dog=test_server:timetrap(?default_timeout),
- [{watchdog, Dog}|Config].
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
- ok.
-
%%%
%%% Test cases starts here.
%%%
-app_test(doc) ->
- ["Test that the .app file does not contain any `basic' errors"];
-app_test(suite) ->
- [];
+%% Test that the .app file does not contain any `basic' errors
app_test(Config) when is_list(Config) ->
- ?line ?t:app_test(tools, tolerant).
+ test_server:app_test(tools, tolerant).
%% Test that the .appup file does not contain any `basic' errors
appup_test(Config) when is_list(Config) ->
- ok = ?t:appup_test(tools).
+ ok = test_server:appup_test(tools).
diff --git a/lib/tools/test/xref_SUITE.erl b/lib/tools/test/xref_SUITE.erl
index 53aa80d2a3..ce30fb711a 100644
--- a/lib/tools/test/xref_SUITE.erl
+++ b/lib/tools/test/xref_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -32,46 +32,41 @@
-else.
-include_lib("common_test/include/ct.hrl").
-define(format(S, A), ok).
--define(datadir, ?config(data_dir, Conf)).
--define(privdir, ?config(priv_dir, Conf)).
--define(copydir, ?config(copy_dir, Conf)).
+-define(datadir, proplists:get_value(data_dir, Conf)).
+-define(privdir, proplists:get_value(priv_dir, Conf)).
+-define(copydir, proplists:get_value(copy_dir, Conf)).
-endif.
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2, init/1, fini/1]).
+-export([all/0, suite/0, groups/0,
+ init_per_suite/1, end_per_suite/1]).
--export([
- addrem/1, convert/1, intergraph/1, lines/1, loops/1,
- no_data/1, modules/1]).
+-export([addrem/1, convert/1, intergraph/1, lines/1, loops/1,
+ no_data/1, modules/1]).
--export([
- add/1, default/1, info/1, lib/1, read/1, read2/1, remove/1,
- replace/1, update/1, deprecated/1, trycatch/1,
+-export([add/1, default/1, info/1, lib/1, read/1, read2/1, remove/1,
+ replace/1, update/1, deprecated/1, trycatch/1,
fun_mfa/1, fun_mfa_r14/1,
- fun_mfa_vars/1, qlc/1]).
+ fun_mfa_vars/1, qlc/1]).
--export([
- analyze/1, basic/1, md/1, q/1, variables/1, unused_locals/1]).
+-export([analyze/1, basic/1, md/1, q/1, variables/1, unused_locals/1]).
--export([
- format_error/1, otp_7423/1, otp_7831/1, otp_10192/1]).
+-export([format_error/1, otp_7423/1, otp_7831/1, otp_10192/1]).
-import(lists, [append/2, flatten/1, keysearch/3, member/2, sort/1, usort/1]).
-import(sofs, [converse/1, from_term/1, intersection/2, is_sofs_set/1,
- range/1, relation_to_family/1, set/1, to_external/1,
- union/2]).
-
--export([init_per_testcase/2, end_per_testcase/2]).
+ range/1, relation_to_family/1, set/1, to_external/1,
+ union/2]).
%% Checks some info counters of a server and some relations that should hold.
-export([check_count/1, check_state/1]).
-include_lib("kernel/include/file.hrl").
-
-include_lib("tools/src/xref.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[{group, xref}, {group, files}, {group, analyses},
@@ -89,48 +84,24 @@ groups() ->
[analyze, basic, md, q, variables, unused_locals]},
{misc, [], [format_error, otp_7423, otp_7831, otp_10192]}].
-init_per_suite(Config) ->
- init(Config).
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-init(Conf) when is_list(Conf) ->
+init_per_suite(Conf) when is_list(Conf) ->
DataDir = ?datadir,
PrivDir = ?privdir,
- ?line CopyDir = fname(PrivDir, "datacopy"),
- ?line TarFile = fname(PrivDir, "datacopy.tgz"),
- ?line {ok, Tar} = erl_tar:open(TarFile, [write, compressed]),
- ?line ok = erl_tar:add(Tar, DataDir, CopyDir, [compressed]),
- ?line ok = erl_tar:close(Tar),
- ?line ok = erl_tar:extract(TarFile, [compressed]),
- ?line ok = file:delete(TarFile),
- [{copy_dir, CopyDir} | Conf].
-
-fini(Conf) when is_list(Conf) ->
- %% Nothing.
- Conf.
-
-init_per_testcase(_Case, Config) ->
- Dog=?t:timetrap(?t:minutes(2)),
- [{watchdog, Dog}|Config].
-
-end_per_testcase(_Case, _Config) ->
- Dog=?config(watchdog, _Config),
- test_server:timetrap_cancel(Dog),
+ CopyDir = fname(PrivDir, "datacopy"),
+ TarFile = fname(PrivDir, "datacopy.tgz"),
+ {ok, Tar} = erl_tar:open(TarFile, [write, compressed]),
+ ok = erl_tar:add(Tar, DataDir, CopyDir, [compressed]),
+ ok = erl_tar:close(Tar),
+ ok = erl_tar:extract(TarFile, [compressed]),
+ ok = file:delete(TarFile),
+ [{copy_dir, CopyDir}|Conf].
+
+end_per_suite(Conf) when is_list(Conf) ->
ok.
-
%% Seems a bit short...
-addrem(suite) -> [];
-addrem(doc) -> ["Simple test of removing modules"];
+%% Simple test of removing modules
addrem(Conf) when is_list(Conf) ->
S0 = new(),
@@ -149,8 +120,8 @@ addrem(Conf) when is_list(Conf) ->
LCallAt_m1 = [],
XCallAt_m1 = [{E1,13}],
Info1 = #xref_mod{name = m1, app_name = [a1]},
- ?line S1 = add_module(S0, Info1, DefAt_m1, X_m1, LCallAt_m1, XCallAt_m1,
- XC_m1, LC_m1),
+ S1 = add_module(S0, Info1, DefAt_m1, X_m1, LCallAt_m1, XCallAt_m1,
+ XC_m1, LC_m1),
D2 = {F2,7},
DefAt_m2 = [D2],
@@ -161,26 +132,25 @@ addrem(Conf) when is_list(Conf) ->
LCallAt_m2 = [],
XCallAt_m2 = [{E2,96}],
Info2 = #xref_mod{name = m2, app_name = [a2]},
- ?line S2 = add_module(S1, Info2, DefAt_m2, X_m2, LCallAt_m2, XCallAt_m2,
- XC_m2, LC_m2),
-
- ?line S5 = set_up(S2),
-
- ?line {ok, XMod1, S6} = remove_module(S5, m1),
- ?line [a1] = XMod1#xref_mod.app_name,
- ?line {ok, XMod2, S6a} = remove_module(S6, m2),
- ?line [a2] = XMod2#xref_mod.app_name,
- ?line S7 = set_up(S6a),
-
- ?line AppInfo1 = #xref_app{name = a1, rel_name = [r1]},
- ?line S9 = add_application(S7, AppInfo1),
- ?line S10 = set_up(S9),
- ?line AppInfo2 = #xref_app{name = a2, rel_name = [r1]},
- ?line _S11 = add_application(S10, AppInfo2),
+ S2 = add_module(S1, Info2, DefAt_m2, X_m2, LCallAt_m2, XCallAt_m2,
+ XC_m2, LC_m2),
+
+ S5 = set_up(S2),
+
+ {ok, XMod1, S6} = remove_module(S5, m1),
+ [a1] = XMod1#xref_mod.app_name,
+ {ok, XMod2, S6a} = remove_module(S6, m2),
+ [a2] = XMod2#xref_mod.app_name,
+ S7 = set_up(S6a),
+
+ AppInfo1 = #xref_app{name = a1, rel_name = [r1]},
+ S9 = add_application(S7, AppInfo1),
+ S10 = set_up(S9),
+ AppInfo2 = #xref_app{name = a2, rel_name = [r1]},
+ _S11 = add_application(S10, AppInfo2),
ok.
-convert(suite) -> [];
-convert(doc) -> ["Coercion of data"];
+%% Coercion of data
convert(Conf) when is_list(Conf) ->
S0 = new(),
@@ -215,8 +185,8 @@ convert(Conf) when is_list(Conf) ->
LCallAt_m1 = [],
XCallAt_m1 = [{E1,13},{E2,17},{E4,7}],
Info1 = #xref_mod{name = m1, app_name = [a1]},
- ?line S1 = add_module(S0, Info1, DefAt_m1, X_m1, LCallAt_m1, XCallAt_m1,
- XC_m1, LC_m1),
+ S1 = add_module(S0, Info1, DefAt_m1, X_m1, LCallAt_m1, XCallAt_m1,
+ XC_m1, LC_m1),
D2 = {F2,7},
D3 = {F3,9},
@@ -229,8 +199,8 @@ convert(Conf) when is_list(Conf) ->
LCallAt_m2 = [],
XCallAt_m2 = [{E3,96},{E6,12},{UE1,77}],
Info2 = #xref_mod{name = m2, app_name = [a2]},
- ?line S2 = add_module(S1, Info2, DefAt_m2, X_m2, LCallAt_m2, XCallAt_m2,
- XC_m2, LC_m2),
+ S2 = add_module(S1, Info2, DefAt_m2, X_m2, LCallAt_m2, XCallAt_m2,
+ XC_m2, LC_m2),
D4 = {F4,6},
D5 = {F5,97},
@@ -242,74 +212,74 @@ convert(Conf) when is_list(Conf) ->
LCallAt_m3 = [{E5,19}],
XCallAt_m3 = [{UE2,22}],
Info3 = #xref_mod{name = m3, app_name = [a3]},
- ?line S3 = add_module(S2, Info3, DefAt_m3, X_m3, LCallAt_m3, XCallAt_m3,
- XC_m3, LC_m3),
+ S3 = add_module(S2, Info3, DefAt_m3, X_m3, LCallAt_m3, XCallAt_m3,
+ XC_m3, LC_m3),
Info4 = #xref_mod{name = m4, app_name = [a2]},
- ?line S4 = add_module(S3, Info4, [], [], [], [], [], []),
+ S4 = add_module(S3, Info4, [], [], [], [], [], []),
AppInfo1 = #xref_app{name = a1, rel_name = [r1]},
- ?line S9 = add_application(S4, AppInfo1),
+ S9 = add_application(S4, AppInfo1),
AppInfo2 = #xref_app{name = a2, rel_name = [r1]},
- ?line S10 = add_application(S9, AppInfo2),
+ S10 = add_application(S9, AppInfo2),
AppInfo3 = #xref_app{name = a3, rel_name = [r2]},
- ?line S11 = add_application(S10, AppInfo3),
+ S11 = add_application(S10, AppInfo3),
RelInfo1 = #xref_rel{name = r1},
- ?line S12 = add_release(S11, RelInfo1),
+ S12 = add_release(S11, RelInfo1),
RelInfo2 = #xref_rel{name = r2},
- ?line S13 = add_release(S12, RelInfo2),
+ S13 = add_release(S12, RelInfo2),
- ?line S = set_up(S13),
+ S = set_up(S13),
- ?line {ok, _} = eval("(Lin)(m1->m1:Mod) * m1->m1", type_error, S),
- ?line {ok, _} = eval("(XXL)(Lin)(m1->m1:Mod) * m1->m1", type_error, S),
+ {ok, _} = eval("(Lin)(m1->m1:Mod) * m1->m1", type_error, S),
+ {ok, _} = eval("(XXL)(Lin)(m1->m1:Mod) * m1->m1", type_error, S),
- ?line AllDefAt = eval("(Lin) M", S),
- ?line AllV = eval("(Fun) M", S),
- ?line AllCallAt = eval("(XXL)(Lin) E", S),
- ?line AllE = eval("E", S),
+ AllDefAt = eval("(Lin) M", S),
+ AllV = eval("(Fun) M", S),
+ AllCallAt = eval("(XXL)(Lin) E", S),
+ AllE = eval("E", S),
- ?line AM = eval("AM", S),
- ?line A = eval("A", S),
- ?line R = eval("R", S),
+ AM = eval("AM", S),
+ A = eval("A", S),
+ R = eval("R", S),
% vertices
% general 1 step
- ?line {ok, _} = eval("(Fun) (Lin) M", AllV, S),
- ?line {ok, _} = eval("(Fun) (Lin) (Lin) M", AllV, S),
- ?line {ok, _} = eval(f("(Fun) (Lin) ~p", [[F1, F3]]), [F1,F3], S),
- ?line {ok, _} = eval(f("(Mod) ~p", [AllV]), [m1,m17,m2,m3], S),
- ?line {ok, _} = eval(f("(Mod) ~p", [[F1,F3,F6]]), [m1,m2], S),
- ?line {ok, _} = eval("(App) M", A, S),
- ?line {ok, _} = eval(f("(App) ~p", [[m1,m2,m4]]), [a1,a2], S),
- ?line {ok, _} = eval(f("(Rel) ~p", [A]), R, S),
- ?line {ok, _} = eval(f("(Rel) ~p", [[a1,a2,a2]]), [r1], S),
+ {ok, _} = eval("(Fun) (Lin) M", AllV, S),
+ {ok, _} = eval("(Fun) (Lin) (Lin) M", AllV, S),
+ {ok, _} = eval(f("(Fun) (Lin) ~p", [[F1, F3]]), [F1,F3], S),
+ {ok, _} = eval(f("(Mod) ~p", [AllV]), [m1,m17,m2,m3], S),
+ {ok, _} = eval(f("(Mod) ~p", [[F1,F3,F6]]), [m1,m2], S),
+ {ok, _} = eval("(App) M", A, S),
+ {ok, _} = eval(f("(App) ~p", [[m1,m2,m4]]), [a1,a2], S),
+ {ok, _} = eval(f("(Rel) ~p", [A]), R, S),
+ {ok, _} = eval(f("(Rel) ~p", [[a1,a2,a2]]), [r1], S),
% general 2 steps
- ?line {ok, _} = eval("(Mod) (Lin) M", [m1,m17,m2,m3], S),
- ?line {ok, _} = eval(f("(App) ~p", [AllV]), [a1,a2,a3], S),
- ?line {ok, _} = eval("(Rel) M", R, S),
+ {ok, _} = eval("(Mod) (Lin) M", [m1,m17,m2,m3], S),
+ {ok, _} = eval(f("(App) ~p", [AllV]), [a1,a2,a3], S),
+ {ok, _} = eval("(Rel) M", R, S),
% general 4 steps
- ?line {ok, _} = eval("(Rel) (Lin) M", [r1,r2], S),
+ {ok, _} = eval("(Rel) (Lin) M", [r1,r2], S),
% special 1 step
- ?line {ok, _} = eval(f("(Lin) ~p", [AllV]), AllDefAt, S),
- ?line {ok, _} = eval(f("(Lin) ~p", [[F1,F3]]), [{F1,12},{F3,9}], S),
- ?line {ok, _} = eval("(Fun) M", AllV, S),
- ?line {ok, _} = eval(f("(Fun) ~p", [[m1,m2]]), [F1,F2,F3,F6,F7,UF1], S),
- ?line {ok, _} = eval(f("(Mod) ~p", [A]), AM, S),
- ?line {ok, _} = eval(f("(Mod) ~p", [[a1,a2]]), [m1,m2,m4], S),
- ?line {ok, _} = eval(f("(App) ~p", [R]), A, S),
- ?line {ok, _} = eval(f("(App) ~p", [[r1]]), [a1,a2], S),
+ {ok, _} = eval(f("(Lin) ~p", [AllV]), AllDefAt, S),
+ {ok, _} = eval(f("(Lin) ~p", [[F1,F3]]), [{F1,12},{F3,9}], S),
+ {ok, _} = eval("(Fun) M", AllV, S),
+ {ok, _} = eval(f("(Fun) ~p", [[m1,m2]]), [F1,F2,F3,F6,F7,UF1], S),
+ {ok, _} = eval(f("(Mod) ~p", [A]), AM, S),
+ {ok, _} = eval(f("(Mod) ~p", [[a1,a2]]), [m1,m2,m4], S),
+ {ok, _} = eval(f("(App) ~p", [R]), A, S),
+ {ok, _} = eval(f("(App) ~p", [[r1]]), [a1,a2], S),
% special 2 steps
- ?line {ok, _} = eval("(Lin) M", AllDefAt, S),
- ?line AnalyzedV = eval("(Fun) AM", S),
- ?line {ok, _} = eval(f("(Fun) ~p", [A]), AnalyzedV, S),
- ?line {ok, _} = eval(f("(Mod) ~p", [R]), AM, S),
+ {ok, _} = eval("(Lin) M", AllDefAt, S),
+ AnalyzedV = eval("(Fun) AM", S),
+ {ok, _} = eval(f("(Fun) ~p", [A]), AnalyzedV, S),
+ {ok, _} = eval(f("(Mod) ~p", [R]), AM, S),
% special 4 steps
- ?line AnalyzedAllDefAt = eval("(Lin) AM", S),
- ?line {ok, _} = eval("(Lin) R", AnalyzedAllDefAt, S),
+ AnalyzedAllDefAt = eval("(Lin) AM", S),
+ {ok, _} = eval("(Lin) R", AnalyzedAllDefAt, S),
% edges
Ms = [{m1,m2},{m1,m3},{m2,m1},{m2,m3},{m3,m3}],
@@ -319,31 +289,30 @@ convert(Conf) when is_list(Conf) ->
Rs = [{r1,r1},{r1,r2},{r2,r2}],
% general 1 step
- ?line {ok, _} = eval("(Fun) (Lin) E", AllE, S),
- ?line {ok, _} = eval(f("(Fun)(Lin) ~p", [[E1, E6]]), [E1, E6], S),
- ?line {ok, _} = eval("(Mod) E", AllMs, S),
- ?line {ok, _} = eval(f("(Mod) ~p", [[E1, E6]]), [{m1,m2},{m2,m3}], S),
- ?line {ok, _} = eval(f("(App) ~p", [As]), As, S),
- ?line {ok, _} = eval("(App) [m1->m2,m2->m3]", [{a1,a2},{a2,a3}], S),
- ?line {ok, _} = eval(f("(Rel) ~p", [As]), Rs, S),
- ?line {ok, _} = eval("(Rel) a1->a2", [{r1,r1}], S),
+ {ok, _} = eval("(Fun) (Lin) E", AllE, S),
+ {ok, _} = eval(f("(Fun)(Lin) ~p", [[E1, E6]]), [E1, E6], S),
+ {ok, _} = eval("(Mod) E", AllMs, S),
+ {ok, _} = eval(f("(Mod) ~p", [[E1, E6]]), [{m1,m2},{m2,m3}], S),
+ {ok, _} = eval(f("(App) ~p", [As]), As, S),
+ {ok, _} = eval("(App) [m1->m2,m2->m3]", [{a1,a2},{a2,a3}], S),
+ {ok, _} = eval(f("(Rel) ~p", [As]), Rs, S),
+ {ok, _} = eval("(Rel) a1->a2", [{r1,r1}], S),
% special 1 step
- ?line {ok, _} = eval("(XXL) (Lin) (Fun) E", AllCallAt, S),
- ?line {ok, _} = eval("(XXL) (XXL) (Lin) (Fun) E", AllCallAt, S),
-
- ?line {ok, _} = eval(f("(XXL) (Lin) ~p", [[E1, E6]]),
- [{{D1,D3},[13]}, {{D7,D4},[12]}], S),
- ?line {ok, _} = eval(f("(Fun) ~p", [AllMs]), AllE, S),
- ?line {ok, _} = eval("(Fun) [m1->m2,m2->m3]", [E1,E2,E6], S),
- ?line {ok, _} = eval(f("(Mod) ~p", [As]), Ms, S),
- ?line {ok, _} = eval("(Mod) [a1->a2,a2->a3]", [{m1,m2},{m2,m3}], S),
- ?line {ok, _} = eval(f("(App) ~p", [Rs]), As, S),
- ?line {ok, _} = eval("(App) r1->r1", [{a1,a2},{a2,a1}], S),
+ {ok, _} = eval("(XXL) (Lin) (Fun) E", AllCallAt, S),
+ {ok, _} = eval("(XXL) (XXL) (Lin) (Fun) E", AllCallAt, S),
+
+ {ok, _} = eval(f("(XXL) (Lin) ~p", [[E1, E6]]),
+ [{{D1,D3},[13]}, {{D7,D4},[12]}], S),
+ {ok, _} = eval(f("(Fun) ~p", [AllMs]), AllE, S),
+ {ok, _} = eval("(Fun) [m1->m2,m2->m3]", [E1,E2,E6], S),
+ {ok, _} = eval(f("(Mod) ~p", [As]), Ms, S),
+ {ok, _} = eval("(Mod) [a1->a2,a2->a3]", [{m1,m2},{m2,m3}], S),
+ {ok, _} = eval(f("(App) ~p", [Rs]), As, S),
+ {ok, _} = eval("(App) r1->r1", [{a1,a2},{a2,a1}], S),
ok.
-intergraph(suite) -> [];
-intergraph(doc) -> ["Inter Call Graph"];
+%% Inter Call Graph
intergraph(Conf) when is_list(Conf) ->
S0 = new(),
@@ -392,8 +361,8 @@ intergraph(Conf) when is_list(Conf) ->
LCallAt_m1 = [{E1,1},{E2,2},{E3,3},{E5,5},{E6,6},{E7,7}],
XCallAt_m1 = [{E1,4}],
Info1 = #xref_mod{name = m1, app_name = [a1]},
- ?line S1 = add_module(S0, Info1, DefAt_m1, X_m1, LCallAt_m1, XCallAt_m1,
- XC_m1, LC_m1),
+ S1 = add_module(S0, Info1, DefAt_m1, X_m1, LCallAt_m1, XCallAt_m1,
+ XC_m1, LC_m1),
D6 = {F6,6},
D7 = {F7,7},
@@ -409,73 +378,72 @@ intergraph(Conf) when is_list(Conf) ->
LCallAt_m2 = [{E8,8},{E9,9},{E11,11},{E12,12},{E13,13},{E14,14}],
XCallAt_m2 = [{E10,10},{E15,15}],
Info2 = #xref_mod{name = m2, app_name = [a2]},
- ?line S2 = add_module(S1, Info2, DefAt_m2, X_m2, LCallAt_m2, XCallAt_m2,
- XC_m2, LC_m2),
+ S2 = add_module(S1, Info2, DefAt_m2, X_m2, LCallAt_m2, XCallAt_m2,
+ XC_m2, LC_m2),
AppInfo1 = #xref_app{name = a1, rel_name = [r1]},
- ?line S5 = add_application(S2, AppInfo1),
+ S5 = add_application(S2, AppInfo1),
AppInfo2 = #xref_app{name = a2, rel_name = [r1]},
- ?line S6 = add_application(S5, AppInfo2),
+ S6 = add_application(S5, AppInfo2),
RelInfo = #xref_rel{name = r1},
- ?line S7 = add_release(S6, RelInfo),
+ S7 = add_release(S6, RelInfo),
- ?line S = set_up(S7),
+ S = set_up(S7),
- ?line {ok, _} = eval("EE | m1", [E1,E5,E6,E7], S),
- ?line {ok, _} = eval("EE | m2", [{F6,F1}], S),
- ?line {ok, _} = eval("EE | m2 + EE | m2", [{F6,F1}], S),
+ {ok, _} = eval("EE | m1", [E1,E5,E6,E7], S),
+ {ok, _} = eval("EE | m2", [{F6,F1}], S),
+ {ok, _} = eval("EE | m2 + EE | m2", [{F6,F1}], S),
- ?line {ok, _} = eval("(Fun)(Lin)(E | m1)",
- to_external(union(set(XC_m1), set(LC_m1))), S),
- ?line {ok, _} = eval("(XXL)(ELin) (EE | m1)",
- [{{D2,D1},[1,2,4]},{{D4,D2},[5]},{{D5,D4},[6]},{{D4,D5},[7]}],
- S),
- ?line {ok, _} = eval("(XXL)(ELin)(EE | m2)", [{{D6,D1},[8,11,12]}], S),
- ?line {ok, _} = eval("(XXL)(ELin)(ELin)(EE | m2)",
- [{{D6,D1},[8,11,12]}], S),
+ {ok, _} = eval("(Fun)(Lin)(E | m1)",
+ to_external(union(set(XC_m1), set(LC_m1))), S),
+ {ok, _} = eval("(XXL)(ELin) (EE | m1)",
+ [{{D2,D1},[1,2,4]},{{D4,D2},[5]},{{D5,D4},[6]},{{D4,D5},[7]}],
+ S),
+ {ok, _} = eval("(XXL)(ELin)(EE | m2)", [{{D6,D1},[8,11,12]}], S),
+ {ok, _} = eval("(XXL)(ELin)(ELin)(EE | m2)",
+ [{{D6,D1},[8,11,12]}], S),
%% Combining graphs (equal or different):
- ?line {ok, _} = eval("(XXL)(ELin)(EE | m2 + EE | m2)",
- [{{D6,D1},[8,11,12]}], S),
- ?line {ok, _} = eval("(XXL)(ELin)(EE | m2 * EE | m2)",
- [{{D6,D1},[8,11,12]}], S),
- ?line {ok, _} = eval("(XXL)(ELin)(EE | m2 - EE | m1)",
- [{{D6,D1},[8,11,12]}], S),
- ?line {ok, _} = eval("(XXL)(ELin)(EE | m2 - E | m2)",
- [{{D6,D1},[8,11,12]}], S),
- ?line {ok, _} = eval("(XXL)(ELin)(Fun)(ELin)(EE | m2)",
- [{{D6,D1},[8,11,12]}], S),
- ?line {ok, _} = eval("EE | m1 + E | m1", LC_m1, S),
- ?line {ok, _} = eval(f("EE | ~p + E | ~p", [F2, F2]), [E1,E2], S),
+ {ok, _} = eval("(XXL)(ELin)(EE | m2 + EE | m2)",
+ [{{D6,D1},[8,11,12]}], S),
+ {ok, _} = eval("(XXL)(ELin)(EE | m2 * EE | m2)",
+ [{{D6,D1},[8,11,12]}], S),
+ {ok, _} = eval("(XXL)(ELin)(EE | m2 - EE | m1)",
+ [{{D6,D1},[8,11,12]}], S),
+ {ok, _} = eval("(XXL)(ELin)(EE | m2 - E | m2)",
+ [{{D6,D1},[8,11,12]}], S),
+ {ok, _} = eval("(XXL)(ELin)(Fun)(ELin)(EE | m2)",
+ [{{D6,D1},[8,11,12]}], S),
+ {ok, _} = eval("EE | m1 + E | m1", LC_m1, S),
+ {ok, _} = eval(f("EE | ~p + E | ~p", [F2, F2]), [E1,E2], S),
%% [1,4] from 'calls' is a subset of [1,2,4] from Inter Call Graph:
- ?line {ok, _} = eval(f("(XXL)(Lin) (E | ~p)", [F2]),
- [{{D2,D1},[1,4]},{{D2,D3},[2]}], S),
-
- ?line {ok, _} = eval(f("(XXL)(ELin) (EE | ~p)", [F2]),
- [{{D2,D1},[1,2,4]}], S),
- ?line {ok, _} = eval(f("(XXL)((ELin)(EE | ~p) + (Lin)(E | ~p))", [F2, F2]),
- [{{D2,D1},[1,2,4]},{{D2,D3},[2]}], S),
- ?line {ok, _} =
- eval(f("(XXL)((ELin) ~p + (Lin) ~p)", [{F2, F1}, {F2, F1}]),
- [{{D2,D1},[1,2,4]}], S),
- ?line {ok, _} = eval(f("(Fun)(Lin) ~p", [{F2, F1}]), [E1], S),
+ {ok, _} = eval(f("(XXL)(Lin) (E | ~p)", [F2]),
+ [{{D2,D1},[1,4]},{{D2,D3},[2]}], S),
+
+ {ok, _} = eval(f("(XXL)(ELin) (EE | ~p)", [F2]),
+ [{{D2,D1},[1,2,4]}], S),
+ {ok, _} = eval(f("(XXL)((ELin)(EE | ~p) + (Lin)(E | ~p))", [F2, F2]),
+ [{{D2,D1},[1,2,4]},{{D2,D3},[2]}], S),
+ {ok, _} =
+ eval(f("(XXL)((ELin) ~p + (Lin) ~p)", [{F2, F1}, {F2, F1}]),
+ [{{D2,D1},[1,2,4]}], S),
+ {ok, _} = eval(f("(Fun)(Lin) ~p", [{F2, F1}]), [E1], S),
%% The external call E4 is included in the reply:
- ?line {ok, _} = eval("(XXL)(Lin)(LC | m1)",
- [{{D2,D1},[1,4]},{{D2,D3},[2]},{{D3,D1},[3]},
- {{D4,D2},[5]},{{D4,D5},[7]},{{D5,D4},[6]}], S),
+ {ok, _} = eval("(XXL)(Lin)(LC | m1)",
+ [{{D2,D1},[1,4]},{{D2,D3},[2]},{{D3,D1},[3]},
+ {{D4,D2},[5]},{{D4,D5},[7]},{{D5,D4},[6]}], S),
%% The local call E1 is included in the reply:
- ?line {ok, _} = eval("(XXL)(Lin)(XC | m1)", [{{D2,D1},[1,4]}], S),
+ {ok, _} = eval("(XXL)(Lin)(XC | m1)", [{{D2,D1},[1,4]}], S),
- ?line {ok, _} = eval(f("(LLin) (E | ~p || ~p) + (XLin) (E | ~p || ~p)",
- [F2, F1, F2, F1]), [{E4,[1,4]}], S),
+ {ok, _} = eval(f("(LLin) (E | ~p || ~p) + (XLin) (E | ~p || ~p)",
+ [F2, F1, F2, F1]), [{E4,[1,4]}], S),
- ?line {ok, _} = eval("# (ELin) E", 6, S),
+ {ok, _} = eval("# (ELin) E", 6, S),
ok.
-lines(suite) -> [];
-lines(doc) -> ["More test of Inter Call Graph, and regular expressions"];
+%% More test of Inter Call Graph, and regular expressions
lines(Conf) when is_list(Conf) ->
S0 = new(),
@@ -509,8 +477,8 @@ lines(Conf) when is_list(Conf) ->
LCallAt_m1 = [{E1,1},{E3,3},{E6,6}],
XCallAt_m1 = [{E2,2},{E4,4},{E5,5},{E7,7}],
Info1 = #xref_mod{name = m1, app_name = [a1]},
- ?line S1 = add_module(S0, Info1, DefAt_m1, X_m1, LCallAt_m1, XCallAt_m1,
- XC_m1, LC_m1),
+ S1 = add_module(S0, Info1, DefAt_m1, X_m1, LCallAt_m1, XCallAt_m1,
+ XC_m1, LC_m1),
DefAt_m2 = [D4],
X_m2 = [F4],
@@ -520,81 +488,80 @@ lines(Conf) when is_list(Conf) ->
LCallAt_m2 = [],
XCallAt_m2 = [],
Info2 = #xref_mod{name = m2, app_name = [a2]},
- ?line S2 = add_module(S1, Info2, DefAt_m2, X_m2, LCallAt_m2, XCallAt_m2,
- XC_m2, LC_m2),
+ S2 = add_module(S1, Info2, DefAt_m2, X_m2, LCallAt_m2, XCallAt_m2,
+ XC_m2, LC_m2),
AppInfo1 = #xref_app{name = a1, rel_name = [r1]},
- ?line S5 = add_application(S2, AppInfo1),
+ S5 = add_application(S2, AppInfo1),
AppInfo2 = #xref_app{name = a2, rel_name = [r1]},
- ?line S6 = add_application(S5, AppInfo2),
+ S6 = add_application(S5, AppInfo2),
RelInfo = #xref_rel{name = r1},
- ?line S7 = add_release(S6, RelInfo),
-
- ?line S = set_up(S7),
-
- ?line {ok, _} = eval("(XXL) (ELin) (EE | m1)",
- [{{D1,D1},[1]},{{D1,D4},[1,4]},{{D3,D1},[3]},{{D3,D4},[3]},
- {{D5,D4},[6]}], S),
- ?line {ok, _} = eval("(XXL)(Lin) (E | m1)",
- [{{D1,D2},[1]},{{D1,D4},[4]},{{D2,D1},[2]},
- {{D2,D4},[5]},{{D3,D2},[3]},{{D5,D6},[6]},{{D6,D4},[7]}],
- S),
- ?line {ok, _} = eval("(E | m1) + (EE | m1)",
- [E1,E2,E3,E4,E5,E6,E7,{F1,F1},{F3,F1},{F3,F4},{F5,F4}],
- S),
- ?line {ok, _} = eval("(Lin)(E | m1)",
- [{E4,[4]},{E1,[1]},{E2,[2]},{E5,[5]},
- {E3,[3]},{E7,[7]},{E6,[6]}], S),
- ?line {ok, _} = eval("(ELin)(EE | m1)",
- [{{F1,F1},[1]},{{F1,F4},[1,4]},{{F3,F1},[3]},{{F3,F4},[3]},
- {{F5,F4},[6]}], S),
- ?line {ok, _} = eval("(Lin)(E | m1) + (ELin)(EE | m1)",
- [{E4,[1,4]},{E1,[1]},{E2,[2]},{E5,[5]},
- {E3,[3]},{E7,[7]},{E6,[6]},
- {{F1,F1},[1]},{{F3,F1},[3]},{{F3,F4},[3]},
- {{F5,F4},[6]}], S),
- ?line {ok, _} = eval("(Lin)(E | m1) - (ELin)(EE | m1)",
- [{E1,[1]},{E2,[2]},{E5,[5]},
- {E3,[3]},{E7,[7]},{E6,[6]}], S),
- ?line {ok, _} = eval("(Lin)(E | m1) * (ELin)(EE | m1)",
- [{E4,[4]}], S),
- ?line {ok, _} = eval("(XXL)(Lin) (E | m1)",
- [{{D1,D4},[4]},{{D1,D2},[1]},{{D2,D1},[2]},{{D2,D4},[5]},
- {{D3,D2},[3]},{{D6,D4},[7]},{{D5,D6},[6]}], S),
- ?line {ok, _} = eval("(XXL)(ELin) (EE | m1)",
- [{{D1,D1},[1]},{{D1,D4},[1,4]},{{D3,D1},[3]},{{D3,D4},[3]},
- {{D5,D4},[6]}], S),
- ?line {ok, _} = eval("(XXL)(Lin)(Fun)(Lin) (E | m1)",
- [{{D1,D4},[4]},{{D1,D2},[1]},{{D2,D1},[2]},{{D2,D4},[5]},
- {{D3,D2},[3]},{{D6,D4},[7]},{{D5,D6},[6]}], S),
- ?line {ok, _} = eval("(XXL)(ELin)(Fun)(ELin) (EE | m1)",
- [{{D1,D1},[1]},{{D1,D4},[1,4]},{{D3,D1},[3]},{{D3,D4},[3]},
- {{D5,D4},[6]}], S),
+ S7 = add_release(S6, RelInfo),
+
+ S = set_up(S7),
+
+ {ok, _} = eval("(XXL) (ELin) (EE | m1)",
+ [{{D1,D1},[1]},{{D1,D4},[1,4]},{{D3,D1},[3]},{{D3,D4},[3]},
+ {{D5,D4},[6]}], S),
+ {ok, _} = eval("(XXL)(Lin) (E | m1)",
+ [{{D1,D2},[1]},{{D1,D4},[4]},{{D2,D1},[2]},
+ {{D2,D4},[5]},{{D3,D2},[3]},{{D5,D6},[6]},{{D6,D4},[7]}],
+ S),
+ {ok, _} = eval("(E | m1) + (EE | m1)",
+ [E1,E2,E3,E4,E5,E6,E7,{F1,F1},{F3,F1},{F3,F4},{F5,F4}],
+ S),
+ {ok, _} = eval("(Lin)(E | m1)",
+ [{E4,[4]},{E1,[1]},{E2,[2]},{E5,[5]},
+ {E3,[3]},{E7,[7]},{E6,[6]}], S),
+ {ok, _} = eval("(ELin)(EE | m1)",
+ [{{F1,F1},[1]},{{F1,F4},[1,4]},{{F3,F1},[3]},{{F3,F4},[3]},
+ {{F5,F4},[6]}], S),
+ {ok, _} = eval("(Lin)(E | m1) + (ELin)(EE | m1)",
+ [{E4,[1,4]},{E1,[1]},{E2,[2]},{E5,[5]},
+ {E3,[3]},{E7,[7]},{E6,[6]},
+ {{F1,F1},[1]},{{F3,F1},[3]},{{F3,F4},[3]},
+ {{F5,F4},[6]}], S),
+ {ok, _} = eval("(Lin)(E | m1) - (ELin)(EE | m1)",
+ [{E1,[1]},{E2,[2]},{E5,[5]},
+ {E3,[3]},{E7,[7]},{E6,[6]}], S),
+ {ok, _} = eval("(Lin)(E | m1) * (ELin)(EE | m1)",
+ [{E4,[4]}], S),
+ {ok, _} = eval("(XXL)(Lin) (E | m1)",
+ [{{D1,D4},[4]},{{D1,D2},[1]},{{D2,D1},[2]},{{D2,D4},[5]},
+ {{D3,D2},[3]},{{D6,D4},[7]},{{D5,D6},[6]}], S),
+ {ok, _} = eval("(XXL)(ELin) (EE | m1)",
+ [{{D1,D1},[1]},{{D1,D4},[1,4]},{{D3,D1},[3]},{{D3,D4},[3]},
+ {{D5,D4},[6]}], S),
+ {ok, _} = eval("(XXL)(Lin)(Fun)(Lin) (E | m1)",
+ [{{D1,D4},[4]},{{D1,D2},[1]},{{D2,D1},[2]},{{D2,D4},[5]},
+ {{D3,D2},[3]},{{D6,D4},[7]},{{D5,D6},[6]}], S),
+ {ok, _} = eval("(XXL)(ELin)(Fun)(ELin) (EE | m1)",
+ [{{D1,D1},[1]},{{D1,D4},[1,4]},{{D3,D1},[3]},{{D3,D4},[3]},
+ {{D5,D4},[6]}], S),
%% A few tests on regexp.
- ?line {ok, _} = eval("\"(foo\":Mod", parse_error, S),
- ?line {ok, _} = eval("_Foo:_/_", parse_error, S),
- ?line {ok, _} = eval("\".*foo\"", parse_error, S),
- ?line {ok, _} = eval("_:_/_:Lin", parse_error, S),
- ?line {ok, _} = eval("_:_/_:Mod", parse_error, S),
- ?line {ok, _} = eval("_:_/_:App", parse_error, S),
- ?line {ok, _} = eval("_:_/_:Rel", parse_error, S),
- ?line {ok, _} = eval("m2:_/4", [F4], S),
- ?line {ok, _} = eval("m2:_/4:Fun", [F4], S),
- ?line {ok, _} = eval("\"m.?\":\"f.*\"/\"6\"", [F6], S),
- ?line {ok, _} = eval("_:_/6", [F6], S),
- ?line {ok, _} = eval("m1:\"f1\"/_", [F1], S),
- ?line {ok, _} = eval("\"m1\":f1/_", [F1], S),
- ?line {ok, _} = eval("\"m1\":Mod", [m1], S),
- ?line {ok, _} = eval("\"a1\":App", [a1], S),
- ?line {ok, _} = eval("\"r1\":Rel", [r1], S),
- ?line {ok, _} = eval("_:_/-1", [], S),
+ {ok, _} = eval("\"(foo\":Mod", parse_error, S),
+ {ok, _} = eval("_Foo:_/_", parse_error, S),
+ {ok, _} = eval("\".*foo\"", parse_error, S),
+ {ok, _} = eval("_:_/_:Lin", parse_error, S),
+ {ok, _} = eval("_:_/_:Mod", parse_error, S),
+ {ok, _} = eval("_:_/_:App", parse_error, S),
+ {ok, _} = eval("_:_/_:Rel", parse_error, S),
+ {ok, _} = eval("m2:_/4", [F4], S),
+ {ok, _} = eval("m2:_/4:Fun", [F4], S),
+ {ok, _} = eval("\"m.?\":\"f.*\"/\"6\"", [F6], S),
+ {ok, _} = eval("_:_/6", [F6], S),
+ {ok, _} = eval("m1:\"f1\"/_", [F1], S),
+ {ok, _} = eval("\"m1\":f1/_", [F1], S),
+ {ok, _} = eval("\"m1\":Mod", [m1], S),
+ {ok, _} = eval("\"a1\":App", [a1], S),
+ {ok, _} = eval("\"r1\":Rel", [r1], S),
+ {ok, _} = eval("_:_/-1", [], S),
ok.
-loops(suite) -> [];
-loops(doc) -> ["More Inter Call Graph, loops and \"unusual\" cases"];
+%% More Inter Call Graph, loops and "unusual" cases
loops(Conf) when is_list(Conf) ->
S0 = new(),
@@ -627,51 +594,49 @@ loops(Conf) when is_list(Conf) ->
LCallAt_m1 = [{E2,2},{E3,3},{E4,4}],
XCallAt_m1 = [{E1,1},{E5,5}],
Info1 = #xref_mod{name = m1, app_name = [a1]},
- ?line S1 = add_module(S0, Info1, DefAt_m1, X_m1, LCallAt_m1, XCallAt_m1,
- XC_m1, LC_m1),
+ S1 = add_module(S0, Info1, DefAt_m1, X_m1, LCallAt_m1, XCallAt_m1,
+ XC_m1, LC_m1),
- ?line S = set_up(S1),
+ S = set_up(S1),
% Neither F6 nor F7 is included. Perhaps one should change that?
- ?line {ok, _} = eval("EE | m1", [E1,E2,{F3,F3}], S),
- ?line {ok, _} = eval(f("(XXL)(ELin) (EE | ~p)", [F3]), [{{D3,D3},[3]}], S),
+ {ok, _} = eval("EE | m1", [E1,E2,{F3,F3}], S),
+ {ok, _} = eval(f("(XXL)(ELin) (EE | ~p)", [F3]), [{{D3,D3},[3]}], S),
- ?line {ok, _} = eval("m1->m1 | m1->m1", type_error, S),
- ?line {ok, _} = eval(f("~p | ~p", [F2, F1]), type_error, S),
+ {ok, _} = eval("m1->m1 | m1->m1", type_error, S),
+ {ok, _} = eval(f("~p | ~p", [F2, F1]), type_error, S),
- ?line {ok, _} = eval(f("range (closure EE | ~p)", [F1]), [F1], S),
- ?line {ok, _} = eval(f("domain (closure EE || ~p)", [F3]), [F3], S),
+ {ok, _} = eval(f("range (closure EE | ~p)", [F1]), [F1], S),
+ {ok, _} = eval(f("domain (closure EE || ~p)", [F3]), [F3], S),
- ?line {ok, _} = eval(f("domain (closure E || ~p)", [F3]), [F3,F4,F5], S),
+ {ok, _} = eval(f("domain (closure E || ~p)", [F3]), [F3,F4,F5], S),
- ?line {ok, _} = eval("components E", [[F1],[F2],[F3,F4,F5]], S),
- ?line {ok, _} = eval("components EE", [[F1],[F2],[F3]], S),
+ {ok, _} = eval("components E", [[F1],[F2],[F3,F4,F5]], S),
+ {ok, _} = eval("components EE", [[F1],[F2],[F3]], S),
ok.
-no_data(suite) -> [];
-no_data(doc) -> ["Simple tests when there is no data"];
+%% Simple tests when there is no data
no_data(Conf) when is_list(Conf) ->
S0 = new(),
- ?line S1 = set_up(S0),
- ?line {ok, _} = eval("M", [], S1),
- ?line {ok, _} = eval("A", [], S1),
- ?line {ok, _} = eval("R", [], S1),
+ S1 = set_up(S0),
+ {ok, _} = eval("M", [], S1),
+ {ok, _} = eval("A", [], S1),
+ {ok, _} = eval("R", [], S1),
ModInfo = #xref_mod{name = m, app_name = []},
- ?line S2 = add_module(S1, ModInfo, [], [], [], [], [], []),
+ S2 = add_module(S1, ModInfo, [], [], [], [], [], []),
AppInfo = #xref_app{name = a, rel_name = []},
- ?line S3 = add_application(S2, AppInfo),
+ S3 = add_application(S2, AppInfo),
RelInfo = #xref_rel{name = r, dir = ""},
- ?line S4 = add_release(S3, RelInfo),
- ?line S5 = set_up(S4),
- ?line {ok, _} = eval("M", [m], S5),
- ?line {ok, _} = eval("A", [a], S5),
- ?line {ok, _} = eval("R", [r], S5),
+ S4 = add_release(S3, RelInfo),
+ S5 = set_up(S4),
+ {ok, _} = eval("M", [m], S5),
+ {ok, _} = eval("A", [a], S5),
+ {ok, _} = eval("R", [r], S5),
ok.
-modules(suite) -> [];
-modules(doc) -> ["Modules mode"];
+%% Modules mode
modules(Conf) when is_list(Conf) ->
CopyDir = ?copydir,
Dir = fname(CopyDir, "rel2"),
@@ -684,34 +649,33 @@ modules(Conf) when is_list(Conf) ->
Xbeam = fname(EB2, "x.beam"),
Ybeam = fname(EB1_1, "y.beam"),
- ?line {ok, x} = compile:file(X, [debug_info, {outdir,EB2}]),
- ?line {ok, y} = compile:file(Y, [debug_info, {outdir,EB1_1}]),
-
- ?line {ok, S0} = xref_base:new([{xref_mode, modules}]),
- ?line {ok, release2, S1} =
- xref_base:add_release(S0, Dir, [{name,release2}]),
- ?line S = set_up(S1),
- ?line {{error, _, {unavailable_analysis, undefined_function_calls}}, _} =
- xref_base:analyze(S, undefined_function_calls),
- ?line {{error, _, {unavailable_analysis, locals_not_used}}, _} =
- xref_base:analyze(S, locals_not_used),
- ?line {{error, _, {unavailable_analysis, {call, foo}}}, _} =
- xref_base:analyze(S, {call, foo}),
- ?line {{error, _, {unavailable_analysis, {use, foo}}}, _} =
- xref_base:analyze(S, {use, foo}),
- ?line analyze(undefined_functions, [{x,undef,0}], S),
- ?line 5 = length(xref_base:info(S)),
+ {ok, x} = compile:file(X, [debug_info, {outdir,EB2}]),
+ {ok, y} = compile:file(Y, [debug_info, {outdir,EB1_1}]),
+
+ {ok, S0} = xref_base:new([{xref_mode, modules}]),
+ {ok, release2, S1} =
+ xref_base:add_release(S0, Dir, [{name,release2}]),
+ S = set_up(S1),
+ {{error, _, {unavailable_analysis, undefined_function_calls}}, _} =
+ xref_base:analyze(S, undefined_function_calls),
+ {{error, _, {unavailable_analysis, locals_not_used}}, _} =
+ xref_base:analyze(S, locals_not_used),
+ {{error, _, {unavailable_analysis, {call, foo}}}, _} =
+ xref_base:analyze(S, {call, foo}),
+ {{error, _, {unavailable_analysis, {use, foo}}}, _} =
+ xref_base:analyze(S, {use, foo}),
+ analyze(undefined_functions, [{x,undef,0}], S),
+ 5 = length(xref_base:info(S)),
%% More: all info, conversions.
- ?line ok = file:delete(Xbeam),
- ?line ok = file:delete(Ybeam),
- ?line ok = xref_base:delete(S),
+ ok = file:delete(Xbeam),
+ ok = file:delete(Ybeam),
+ ok = xref_base:delete(S),
ok.
-add(suite) -> [];
-add(doc) -> ["Add modules, applications, releases, directories"];
+%% Add modules, applications, releases, directories
add(Conf) when is_list(Conf) ->
CopyDir = ?copydir,
Dir = fname(CopyDir, "rel2"),
@@ -727,116 +691,114 @@ add(Conf) when is_list(Conf) ->
Xbeam = fname(EB2, "x.beam"),
Ybeam = fname(EB1_1, "y.beam"),
- ?line {ok, x} = compile:file(X, [debug_info, {outdir,EB2}]),
- ?line {ok, y} = compile:file(Y, [debug_info, {outdir,EB1_1}]),
-
- ?line case os:type() of
- {unix, _} ->
- ?line make_udir(UDir),
- ?line make_ufile(UFile);
- _ ->
- true
- end,
-
- ?line {error, _, {invalid_options,[not_an_option] }} =
- xref_base:new([not_an_option]),
- ?line {error, _, {invalid_options,[{verbose,not_a_value}] }} =
- xref_base:new([{verbose,not_a_value}]),
- ?line S = new(),
- ?line {error, _, {invalid_options,[not_an_option]}} =
- xref_base:set_up(S, [not_an_option]),
- ?line {error, _, {invalid_options,[{builtins,true},not_an_option]}} =
- xref_base:add_directory(S, foo, [{builtins,true},not_an_option]),
- ?line {error, _, {invalid_options,[{builtins,not_a_value}]}} =
- xref_base:add_directory(S, foo, [{builtins,not_a_value}]),
- ?line {error, _, {invalid_filename,{foo,bar}}} =
- xref_base:add_directory(S, {foo,bar}, []),
- ?line {error, _, {invalid_options,[{builtins,true},not_an_option]}} =
- xref_base:add_module(S, foo, [{builtins,true},not_an_option]),
- ?line {error, _, {invalid_options,[{builtins,not_a_value}]}} =
- xref_base:add_module(S, foo, [{builtins,not_a_value}]),
- ?line {error, _, {invalid_filename,{foo,bar}}} =
- xref_base:add_module(S, {foo,bar}, []),
- ?line {error, _, {invalid_options,[{builtins,true},not_an_option]}} =
- xref_base:add_application(S, foo, [{builtins,true},not_an_option]),
- ?line {error, _, {invalid_options,[{builtins,not_a_value}]}} =
- xref_base:add_application(S, foo, [{builtins,not_a_value}]),
- ?line {error, _, {invalid_filename,{foo,bar}}} =
- xref_base:add_application(S, {foo,bar}, []),
- ?line {error, _, {invalid_options,[not_an_option]}} =
- xref_base:add_release(S, foo, [not_an_option]),
- ?line {error, _, {invalid_options,[{builtins,not_a_value}]}} =
- xref_base:add_release(S, foo, [{builtins,not_a_value}]),
- ?line {error, _, {invalid_filename,{foo,bar}}} =
- xref_base:add_release(S, {foo,bar}, []),
- ?line {ok, S1} =
- xref_base:set_default(S, [{verbose,false}, {warnings, false}]),
- ?line case os:type() of
- {unix, _} ->
- ?line {error, _, {file_error, _, _}} =
- xref_base:add_release(S, UDir);
- _ ->
- true
- end,
- ?line {error, _, {file_error, _, _}} =
- xref_base:add_release(S, fname(["/a/b/c/d/e/f","__foo"])),
- ?line {ok, release2, S2} =
- xref_base:add_release(S1, Dir, [{name,release2}]),
- ?line {error, _, {module_clash, {x, _, _}}} =
- xref_base:add_module(S2, Xbeam),
- ?line {ok, S3} = xref_base:remove_release(S2, release2),
- ?line {ok, rel2, S4} = xref_base:add_release(S3, Dir),
- ?line {error, _, {release_clash, {rel2, _, _}}} =
- xref_base:add_release(S4, Dir),
- ?line {ok, S5} = xref_base:remove_release(S4, rel2),
+ {ok, x} = compile:file(X, [debug_info, {outdir,EB2}]),
+ {ok, y} = compile:file(Y, [debug_info, {outdir,EB1_1}]),
+
+ case os:type() of
+ {unix, _} ->
+ make_udir(UDir),
+ make_ufile(UFile);
+ _ ->
+ true
+ end,
+
+ {error, _, {invalid_options,[not_an_option] }} =
+ xref_base:new([not_an_option]),
+ {error, _, {invalid_options,[{verbose,not_a_value}] }} =
+ xref_base:new([{verbose,not_a_value}]),
+ S = new(),
+ {error, _, {invalid_options,[not_an_option]}} =
+ xref_base:set_up(S, [not_an_option]),
+ {error, _, {invalid_options,[{builtins,true},not_an_option]}} =
+ xref_base:add_directory(S, foo, [{builtins,true},not_an_option]),
+ {error, _, {invalid_options,[{builtins,not_a_value}]}} =
+ xref_base:add_directory(S, foo, [{builtins,not_a_value}]),
+ {error, _, {invalid_filename,{foo,bar}}} =
+ xref_base:add_directory(S, {foo,bar}, []),
+ {error, _, {invalid_options,[{builtins,true},not_an_option]}} =
+ xref_base:add_module(S, foo, [{builtins,true},not_an_option]),
+ {error, _, {invalid_options,[{builtins,not_a_value}]}} =
+ xref_base:add_module(S, foo, [{builtins,not_a_value}]),
+ {error, _, {invalid_filename,{foo,bar}}} =
+ xref_base:add_module(S, {foo,bar}, []),
+ {error, _, {invalid_options,[{builtins,true},not_an_option]}} =
+ xref_base:add_application(S, foo, [{builtins,true},not_an_option]),
+ {error, _, {invalid_options,[{builtins,not_a_value}]}} =
+ xref_base:add_application(S, foo, [{builtins,not_a_value}]),
+ {error, _, {invalid_filename,{foo,bar}}} =
+ xref_base:add_application(S, {foo,bar}, []),
+ {error, _, {invalid_options,[not_an_option]}} =
+ xref_base:add_release(S, foo, [not_an_option]),
+ {error, _, {invalid_options,[{builtins,not_a_value}]}} =
+ xref_base:add_release(S, foo, [{builtins,not_a_value}]),
+ {error, _, {invalid_filename,{foo,bar}}} =
+ xref_base:add_release(S, {foo,bar}, []),
+ {ok, S1} =
+ xref_base:set_default(S, [{verbose,false}, {warnings, false}]),
+ case os:type() of
+ {unix, _} ->
+ {error, _, {file_error, _, _}} =
+ xref_base:add_release(S, UDir);
+ _ ->
+ true
+ end,
+ {error, _, {file_error, _, _}} =
+ xref_base:add_release(S, fname(["/a/b/c/d/e/f","__foo"])),
+ {ok, release2, S2} =
+ xref_base:add_release(S1, Dir, [{name,release2}]),
+ {error, _, {module_clash, {x, _, _}}} =
+ xref_base:add_module(S2, Xbeam),
+ {ok, S3} = xref_base:remove_release(S2, release2),
+ {ok, rel2, S4} = xref_base:add_release(S3, Dir),
+ {error, _, {release_clash, {rel2, _, _}}} =
+ xref_base:add_release(S4, Dir),
+ {ok, S5} = xref_base:remove_release(S4, rel2),
%% One unreadable file and one JAM file found (no verification here):
- ?line {ok, [], S6} = xref_base:add_directory(S5, fname(CopyDir,"dir"),
- [{recurse,true}, {warnings,true}]),
- ?line case os:type() of
- {unix, _} ->
- ?line {error, _, {file_error, _, _}} =
- xref_base:add_directory(S6, UDir);
- _ ->
- true
- end,
- ?line {ok, app1, S7} = xref_base:add_application(S6, A1_1),
- ?line {error, _, {application_clash, {app1, _, _}}} =
- xref_base:add_application(S7, A1_1),
- ?line {ok, S8} = xref_base:remove_application(S7, app1),
- ?line ok = xref_base:delete(S8),
- ?line ok = file:delete(Xbeam),
- ?line ok = file:delete(Ybeam),
- ?line case os:type() of
- {unix, _} ->
- ?line ok = file:del_dir(UDir),
- ?line ok = file:delete(UFile);
- _ ->
- true
- end,
+ {ok, [], S6} = xref_base:add_directory(S5, fname(CopyDir,"dir"),
+ [{recurse,true}, {warnings,true}]),
+ case os:type() of
+ {unix, _} ->
+ {error, _, {file_error, _, _}} =
+ xref_base:add_directory(S6, UDir);
+ _ ->
+ true
+ end,
+ {ok, app1, S7} = xref_base:add_application(S6, A1_1),
+ {error, _, {application_clash, {app1, _, _}}} =
+ xref_base:add_application(S7, A1_1),
+ {ok, S8} = xref_base:remove_application(S7, app1),
+ ok = xref_base:delete(S8),
+ ok = file:delete(Xbeam),
+ ok = file:delete(Ybeam),
+ case os:type() of
+ {unix, _} ->
+ ok = file:del_dir(UDir),
+ ok = file:delete(UFile);
+ _ ->
+ true
+ end,
ok.
-default(suite) -> [];
-default(doc) -> ["Default values of options"];
+%% Default values of options
default(Conf) when is_list(Conf) ->
S = new(),
- ?line {error, _, {invalid_options,[not_an_option]}} =
- xref_base:set_default(S, not_an_option, true),
- ?line {error, _, {invalid_options,[{builtins, not_a_value}]}} =
- xref_base:set_default(S, builtins, not_a_value),
- ?line {error, _, {invalid_options,[not_an_option]}} =
- xref_base:get_default(S, not_an_option),
- ?line {error, _, {invalid_options,[not_an_option]}} =
- xref_base:set_default(S, [not_an_option]),
-
- ?line D = xref_base:get_default(S),
- ?line [{builtins,false},{recurse,false},{verbose,false},{warnings,true}] =
- D,
-
- ?line ok = xref_base:delete(S),
+ {error, _, {invalid_options,[not_an_option]}} =
+ xref_base:set_default(S, not_an_option, true),
+ {error, _, {invalid_options,[{builtins, not_a_value}]}} =
+ xref_base:set_default(S, builtins, not_a_value),
+ {error, _, {invalid_options,[not_an_option]}} =
+ xref_base:get_default(S, not_an_option),
+ {error, _, {invalid_options,[not_an_option]}} =
+ xref_base:set_default(S, [not_an_option]),
+
+ D = xref_base:get_default(S),
+ [{builtins,false},{recurse,false},{verbose,false},{warnings,true}] =
+ D,
+
+ ok = xref_base:delete(S),
ok.
-info(suite) -> [];
-info(doc) -> ["The info functions"];
+%% The info functions
info(Conf) when is_list(Conf) ->
CopyDir = ?copydir,
Dir = fname(CopyDir,"rel2"),
@@ -850,197 +812,195 @@ info(Conf) when is_list(Conf) ->
Xbeam = fname(EB2, "x.beam"),
Ybeam = fname(EB1_1, "y.beam"),
- ?line {ok, x} = compile:file(X, [debug_info, {outdir,EB2}]),
- ?line {ok, y} = compile:file(Y, [debug_info, {outdir,EB1_1}]),
-
- ?line {ok, _} = start(s),
- ?line {error, _, {no_such_info, release}} = xref:info(s, release),
- ?line {error, _, {no_such_info, release}} = xref:info(s, release, rel),
- ?line {error, _, {no_such_module, mod}} = xref:info(s, modules, mod),
- ?line {error, _, {no_such_application, app}} =
- xref:info(s, applications, app),
- ?line {error, _, {no_such_release, rel}} = xref:info(s, releases, rel),
- ?line ok = xref:set_default(s, [{verbose,false}, {warnings, false}]),
- ?line {ok, rel2} = xref:add_release(s, Dir),
- ?line 9 = length(xref:info(s)),
- ?line [{x,_}, {y, _}] = xref:info(s, modules),
- ?line [{app1,_}, {app2, _}] = xref:info(s, applications),
- ?line [{rel2,_}] = xref:info(s, releases),
- ?line [] = xref:info(s, libraries),
- ?line [{x,_}] = xref:info(s, modules, x),
- ?line [{rel2,_}] = xref:info(s, releases, rel2),
- ?line {error, _, {no_such_library, foo}} = xref:info(s, libraries, [foo]),
-
- ?line {ok, lib1} =
- compile:file(fname(LDir,lib1),[debug_info,{outdir,LDir}]),
- ?line {ok, lib2} =
- compile:file(fname(LDir,lib2),[debug_info,{outdir,LDir}]),
- ?line ok = xref:set_library_path(s, [LDir], [{verbose,false}]),
- ?line [{lib1,_}, {lib2, _}] = xref:info(s, libraries),
- ?line [{lib1,_}, {lib2, _}] = xref:info(s, libraries, [lib1,lib2]),
- ?line ok = file:delete(fname(LDir, "lib1.beam")),
- ?line ok = file:delete(fname(LDir, "lib2.beam")),
-
- ?line check_state(s),
-
- ?line xref:stop(s),
-
- ?line ok = file:delete(Xbeam),
- ?line ok = file:delete(Ybeam),
+ {ok, x} = compile:file(X, [debug_info, {outdir,EB2}]),
+ {ok, y} = compile:file(Y, [debug_info, {outdir,EB1_1}]),
+
+ {ok, _} = start(s),
+ {error, _, {no_such_info, release}} = xref:info(s, release),
+ {error, _, {no_such_info, release}} = xref:info(s, release, rel),
+ {error, _, {no_such_module, mod}} = xref:info(s, modules, mod),
+ {error, _, {no_such_application, app}} =
+ xref:info(s, applications, app),
+ {error, _, {no_such_release, rel}} = xref:info(s, releases, rel),
+ ok = xref:set_default(s, [{verbose,false}, {warnings, false}]),
+ {ok, rel2} = xref:add_release(s, Dir),
+ 9 = length(xref:info(s)),
+ [{x,_}, {y, _}] = xref:info(s, modules),
+ [{app1,_}, {app2, _}] = xref:info(s, applications),
+ [{rel2,_}] = xref:info(s, releases),
+ [] = xref:info(s, libraries),
+ [{x,_}] = xref:info(s, modules, x),
+ [{rel2,_}] = xref:info(s, releases, rel2),
+ {error, _, {no_such_library, foo}} = xref:info(s, libraries, [foo]),
+
+ {ok, lib1} =
+ compile:file(fname(LDir,lib1),[debug_info,{outdir,LDir}]),
+ {ok, lib2} =
+ compile:file(fname(LDir,lib2),[debug_info,{outdir,LDir}]),
+ ok = xref:set_library_path(s, [LDir], [{verbose,false}]),
+ [{lib1,_}, {lib2, _}] = xref:info(s, libraries),
+ [{lib1,_}, {lib2, _}] = xref:info(s, libraries, [lib1,lib2]),
+ ok = file:delete(fname(LDir, "lib1.beam")),
+ ok = file:delete(fname(LDir, "lib2.beam")),
+
+ check_state(s),
+
+ xref:stop(s),
+
+ ok = file:delete(Xbeam),
+ ok = file:delete(Ybeam),
ok.
-lib(suite) -> [];
-lib(doc) -> ["Library modules"];
+%% Library modules
lib(Conf) when is_list(Conf) ->
CopyDir = ?copydir,
Dir = fname(CopyDir,"lib_test"),
UDir = fname([CopyDir,"dir","non_existent"]),
- ?line {ok, lib1} = compile:file(fname(Dir,lib1),[debug_info,{outdir,Dir}]),
- ?line {ok, lib2} = compile:file(fname(Dir,lib2),[debug_info,{outdir,Dir}]),
- ?line {ok, lib3} = compile:file(fname(Dir,lib3),[debug_info,{outdir,Dir}]),
- ?line {ok, t} = compile:file(fname(Dir,t),[debug_info,{outdir,Dir}]),
-
- ?line {ok, _} = start(s),
- ?line ok = xref:set_default(s, [{verbose,false}, {warnings, false}]),
- ?line {ok, t} = xref:add_module(s, fname(Dir,"t.beam")),
- ?line {error, _, {invalid_options,[not_an_option]}} =
- xref:set_library_path(s, ["foo"], [not_an_option]),
- ?line {error, _, {invalid_path,otp}} = xref:set_library_path(s,otp),
- ?line {error, _, {invalid_path,[""]}} = xref:set_library_path(s,[""]),
- ?line {error, _, {invalid_path,[[$a | $b]]}} =
- xref:set_library_path(s,[[$a | $b]]),
- ?line {error, _, {invalid_path,[otp]}} = xref:set_library_path(s,[otp]),
- ?line {ok, []} = xref:get_library_path(s),
- ?line ok = xref:set_library_path(s, [Dir], [{verbose,false}]),
- ?line {ok, UnknownFunctions} = xref:q(s, "U"),
- ?line [{lib1,unknown,0}, {lib2,local,0},
- {lib2,unknown,0}, {unknown,unknown,0}]
- = UnknownFunctions,
- ?line {ok, [{lib2,f,0},{lib3,f,0}]} = xref:q(s, "DF"),
- ?line {ok, []} = xref:q(s, "DF_1"),
- ?line {ok, [{lib2,f,0}]} = xref:q(s, "DF_2"),
- ?line {ok, [{lib2,f,0}]} = xref:q(s, "DF_3"),
-
- ?line {ok, [unknown]} = xref:q(s, "UM"),
- ?line {ok, UnknownDefAt} = xref:q(s, "(Lin)U"),
- ?line [{{lib1,unknown,0},0},{{lib2,local,0},0}, {{lib2,unknown,0},0},
- {{unknown,unknown,0},0}] = UnknownDefAt,
- ?line {ok, LibFuns} = xref:q(s, "X * LM"),
- ?line [{lib2,f,0},{lib3,f,0}] = LibFuns,
- ?line {ok, LibMods} = xref:q(s, "LM"),
- ?line [lib1,lib2,lib3] = LibMods,
- ?line {ok, [{{lib2,f,0},0},{{lib3,f,0},0}]} = xref:q(s, "(Lin) (LM * X)"),
- ?line {ok, [{{lib1,unknown,0},0}, {{lib2,f,0},0}, {{lib2,local,0},0},
- {{lib2,unknown,0},0}, {{lib3,f,0},0}]} = xref:q(s,"(Lin)LM"),
- ?line {ok,[lib1,lib2,lib3,t,unknown]} = xref:q(s,"M"),
- ?line {ok,[{lib2,f,0},{lib3,f,0},{t,t,0}]} = xref:q(s,"X * M"),
- ?line check_state(s),
-
- ?line copy_file(fname(Dir, "lib1.erl"), fname(Dir,"lib1.beam")),
- ?line ok = xref:set_library_path(s, [Dir]),
- ?line {error, _, _} = xref:q(s, "U"),
+ {ok, lib1} = compile:file(fname(Dir,lib1),[debug_info,{outdir,Dir}]),
+ {ok, lib2} = compile:file(fname(Dir,lib2),[debug_info,{outdir,Dir}]),
+ {ok, lib3} = compile:file(fname(Dir,lib3),[debug_info,{outdir,Dir}]),
+ {ok, t} = compile:file(fname(Dir,t),[debug_info,{outdir,Dir}]),
+
+ {ok, _} = start(s),
+ ok = xref:set_default(s, [{verbose,false}, {warnings, false}]),
+ {ok, t} = xref:add_module(s, fname(Dir,"t.beam")),
+ {error, _, {invalid_options,[not_an_option]}} =
+ xref:set_library_path(s, ["foo"], [not_an_option]),
+ {error, _, {invalid_path,otp}} = xref:set_library_path(s,otp),
+ {error, _, {invalid_path,[""]}} = xref:set_library_path(s,[""]),
+ {error, _, {invalid_path,[[$a | $b]]}} =
+ xref:set_library_path(s,[[$a | $b]]),
+ {error, _, {invalid_path,[otp]}} = xref:set_library_path(s,[otp]),
+ {ok, []} = xref:get_library_path(s),
+ ok = xref:set_library_path(s, [Dir], [{verbose,false}]),
+ {ok, UnknownFunctions} = xref:q(s, "U"),
+ [{lib1,unknown,0}, {lib2,local,0},
+ {lib2,unknown,0}, {unknown,unknown,0}]
+ = UnknownFunctions,
+ {ok, [{lib2,f,0},{lib3,f,0}]} = xref:q(s, "DF"),
+ {ok, []} = xref:q(s, "DF_1"),
+ {ok, [{lib2,f,0}]} = xref:q(s, "DF_2"),
+ {ok, [{lib2,f,0}]} = xref:q(s, "DF_3"),
+
+ {ok, [unknown]} = xref:q(s, "UM"),
+ {ok, UnknownDefAt} = xref:q(s, "(Lin)U"),
+ [{{lib1,unknown,0},0},{{lib2,local,0},0}, {{lib2,unknown,0},0},
+ {{unknown,unknown,0},0}] = UnknownDefAt,
+ {ok, LibFuns} = xref:q(s, "X * LM"),
+ [{lib2,f,0},{lib3,f,0}] = LibFuns,
+ {ok, LibMods} = xref:q(s, "LM"),
+ [lib1,lib2,lib3] = LibMods,
+ {ok, [{{lib2,f,0},0},{{lib3,f,0},0}]} = xref:q(s, "(Lin) (LM * X)"),
+ {ok, [{{lib1,unknown,0},0}, {{lib2,f,0},0}, {{lib2,local,0},0},
+ {{lib2,unknown,0},0}, {{lib3,f,0},0}]} = xref:q(s,"(Lin)LM"),
+ {ok,[lib1,lib2,lib3,t,unknown]} = xref:q(s,"M"),
+ {ok,[{lib2,f,0},{lib3,f,0},{t,t,0}]} = xref:q(s,"X * M"),
+ check_state(s),
+
+ copy_file(fname(Dir, "lib1.erl"), fname(Dir,"lib1.beam")),
+ ok = xref:set_library_path(s, [Dir]),
+ {error, _, _} = xref:q(s, "U"),
%% OTP-3921. AM and LM not always disjoint.
- ?line {ok, lib1} = compile:file(fname(Dir,lib1),[debug_info,{outdir,Dir}]),
- ?line {ok, lib1} = xref:add_module(s, fname(Dir,"lib1.beam")),
- ?line check_state(s),
-
- ?line {error, _, {file_error, _, _}} = xref:set_library_path(s, [UDir]),
-
- ?line xref:stop(s),
- ?line ok = file:delete(fname(Dir, "lib1.beam")),
- ?line ok = file:delete(fname(Dir, "lib2.beam")),
- ?line ok = file:delete(fname(Dir, "lib3.beam")),
- ?line ok = file:delete(fname(Dir, "t.beam")),
-
- ?line {ok, cp} = compile:file(fname(Dir,cp),[debug_info,{outdir,Dir}]),
- ?line {ok, _} = start(s),
- ?line ok = xref:set_default(s, [{verbose,false}, {warnings, false}]),
- ?line {ok, cp} = xref:add_module(s, fname(Dir,"cp.beam")),
- ?line {ok, [{lists, sort, 1}]} = xref:q(s, "U"),
- ?line ok = xref:set_library_path(s, code_path),
- ?line {ok, []} = xref:q(s, "U"),
- ?line check_state(s),
- ?line xref:stop(s),
- ?line ok = file:delete(fname(Dir, "cp.beam")),
+ {ok, lib1} = compile:file(fname(Dir,lib1),[debug_info,{outdir,Dir}]),
+ {ok, lib1} = xref:add_module(s, fname(Dir,"lib1.beam")),
+ check_state(s),
+
+ {error, _, {file_error, _, _}} = xref:set_library_path(s, [UDir]),
+
+ xref:stop(s),
+ ok = file:delete(fname(Dir, "lib1.beam")),
+ ok = file:delete(fname(Dir, "lib2.beam")),
+ ok = file:delete(fname(Dir, "lib3.beam")),
+ ok = file:delete(fname(Dir, "t.beam")),
+
+ {ok, cp} = compile:file(fname(Dir,cp),[debug_info,{outdir,Dir}]),
+ {ok, _} = start(s),
+ ok = xref:set_default(s, [{verbose,false}, {warnings, false}]),
+ {ok, cp} = xref:add_module(s, fname(Dir,"cp.beam")),
+ {ok, [{lists, sort, 1}]} = xref:q(s, "U"),
+ ok = xref:set_library_path(s, code_path),
+ {ok, []} = xref:q(s, "U"),
+ check_state(s),
+ xref:stop(s),
+ ok = file:delete(fname(Dir, "cp.beam")),
ok.
-read(suite) -> [];
-read(doc) -> ["Data read from the Abstract Code"];
+%% Data read from the Abstract Code
read(Conf) when is_list(Conf) ->
CopyDir = ?copydir,
Dir = fname(CopyDir,"read"),
File = fname(Dir, "read"),
Beam = fname(Dir, "read.beam"),
- ?line {ok, read} = compile:file(File, [debug_info,{outdir,Dir}]),
- ?line do_read(File, abstract_v2),
- ?line copy_file(fname(Dir, "read.beam.v1"), Beam),
- ?line do_read(File, abstract_v1),
- ?line ok = file:delete(Beam),
+ {ok, read} = compile:file(File, [debug_info,{outdir,Dir}]),
+ do_read(File, abstract_v2),
+ copy_file(fname(Dir, "read.beam.v1"), Beam),
+ do_read(File, abstract_v1),
+ ok = file:delete(Beam),
ok.
do_read(File, Version) ->
- ?line {ok, _} = start(s),
- ?line ok = xref:set_default(s, [{verbose,false}, {warnings, false}]),
- ?line {ok, read} = xref:add_module(s, File),
+ {ok, _} = start(s),
+ ok = xref:set_default(s, [{verbose,false}, {warnings, false}]),
+ {ok, read} = xref:add_module(s, File),
- ?line {U, OK, OKB} = read_expected(Version),
+ {U, OK, OKB} = read_expected(Version),
%% {ok, UC} = xref:q(s, "(Lin) UC"),
%% RR = to_external(converse(family_to_relation(family(UC)))),
%% lists:foreach(fun(X) -> io:format("~w~n", [X]) end, RR),
Unres = to_external(relation_to_family(converse(from_term(U)))),
- ?line {ok, Unres} = xref:q(s, "(Lin) UC"),
+ {ok, Unres} = xref:q(s, "(Lin) UC"),
%% {ok, EE} = xref:q(s, "(Lin) (E - UC)"),
%% AA = to_external(converse(family_to_relation(family(EE)))),
%% lists:foreach(fun(X) -> io:format("~w~n", [X]) end, AA),
Calls = to_external(relation_to_family(converse(from_term(OK)))),
- ?line {ok, Calls} = xref:q(s, "(Lin) (E - UC) "),
-
- ?line ok = check_state(s),
- ?line {ok, UM} = xref:q(s, "UM"),
- ?line true = member('$M_EXPR', UM),
-
- ?line {ok, X} = xref:q(s, "X"),
- ?line true = member({read, module_info, 0}, X),
- ?line false = member({foo, module_info, 0}, X),
- ?line false = member({erlang, module_info, 0}, X),
- ?line {ok, Unknowns} = xref:q(s, "U"),
- ?line false = member({read, module_info, 0}, Unknowns),
- ?line true = member({foo, module_info, 0}, Unknowns),
- ?line true = member({erlang, module_info, 0}, Unknowns),
- ?line {ok, LC} = xref:q(s, "LC"),
- ?line true = member({{read,bi,0},{read,bi,0}}, LC),
-
- ?line ok = xref:set_library_path(s, add_erts_code_path(fname(code:lib_dir(kernel),ebin))),
- ?line io:format("~p~n",[(catch xref:get_library_path(s))]),
- ?line {ok, X2} = xref:q(s, "X"),
- ?line ok = check_state(s),
- ?line true = member({read, module_info, 0}, X2),
- ?line false = member({foo, module_info, 0}, X2),
- ?line true = member({erlang, module_info, 0}, X2),
- ?line {ok, Unknowns2} = xref:q(s, "U"),
- ?line false = member({read, module_info, 0}, Unknowns2),
- ?line true = member({foo, module_info, 0}, Unknowns2),
- ?line false = member({erlang, module_info, 0}, Unknowns2),
-
- ?line ok = xref:remove_module(s, read),
- ?line {ok, read} = xref:add_module(s, File, [{builtins,true}]),
+ {ok, Calls} = xref:q(s, "(Lin) (E - UC) "),
+
+ ok = check_state(s),
+ {ok, UM} = xref:q(s, "UM"),
+ true = member('$M_EXPR', UM),
+
+ {ok, X} = xref:q(s, "X"),
+ true = member({read, module_info, 0}, X),
+ false = member({foo, module_info, 0}, X),
+ false = member({erlang, module_info, 0}, X),
+ {ok, Unknowns} = xref:q(s, "U"),
+ false = member({read, module_info, 0}, Unknowns),
+ true = member({foo, module_info, 0}, Unknowns),
+ true = member({erlang, module_info, 0}, Unknowns),
+ {ok, LC} = xref:q(s, "LC"),
+ true = member({{read,bi,0},{read,bi,0}}, LC),
+
+ ok = xref:set_library_path(s, add_erts_code_path(fname(code:lib_dir(kernel),ebin))),
+ io:format("~p~n",[(catch xref:get_library_path(s))]),
+ {ok, X2} = xref:q(s, "X"),
+ ok = check_state(s),
+ true = member({read, module_info, 0}, X2),
+ false = member({foo, module_info, 0}, X2),
+ true = member({erlang, module_info, 0}, X2),
+ {ok, Unknowns2} = xref:q(s, "U"),
+ false = member({read, module_info, 0}, Unknowns2),
+ true = member({foo, module_info, 0}, Unknowns2),
+ false = member({erlang, module_info, 0}, Unknowns2),
+
+ ok = xref:remove_module(s, read),
+ {ok, read} = xref:add_module(s, File, [{builtins,true}]),
UnresB = to_external(relation_to_family(converse(from_term(U)))),
- ?line {ok, UnresB} = xref:q(s, "(Lin) UC"),
+ {ok, UnresB} = xref:q(s, "(Lin) UC"),
CallsB = to_external(relation_to_family(converse(from_term(OKB)))),
- ?line {ok, CallsB} = xref:q(s, "(Lin) (E - UC) "),
- ?line ok = check_state(s),
- ?line {ok, XU} = xref:q(s, "XU"),
- ?line Erl = set([{erlang,length,1},{erlang,integer,1},
- {erlang,binary_to_term,1}]),
- ?line [{erlang,binary_to_term,1},{erlang,length,1}] =
- to_external(intersection(set(XU), Erl)),
- ?line xref:stop(s).
+ {ok, CallsB} = xref:q(s, "(Lin) (E - UC) "),
+ ok = check_state(s),
+ {ok, XU} = xref:q(s, "XU"),
+ Erl = set([{erlang,length,1},{erlang,integer,1},
+ {erlang,binary_to_term,1}]),
+ [{erlang,binary_to_term,1},{erlang,length,1}] =
+ to_external(intersection(set(XU), Erl)),
+ xref:stop(s).
%% What is expected when xref_SUITE_data/read/read.erl is added:
read_expected(Version) ->
@@ -1052,172 +1012,172 @@ read_expected(Version) ->
FF = {read,funfuns,0},
U = [{POS1+5,{FF,{dist,'$F_EXPR',0}}},
- {POS1+8,{FF,{dist,'$F_EXPR',0}}},
- {POS2+8,{{read,funfuns,0},{expr,'$F_EXPR',1}}},
- {POS3+4,{FF,{expr,'$F_EXPR',2}}},
- {POS4+2,{FF,{modul,'$F_EXPR',1}}},
- {POS4+4,{FF,{spm,'$F_EXPR',1}}},
- {POS4+6,{FF,{spm,'$F_EXPR',1}}},
- {POS4+8,{FF,{spm,'$F_EXPR',1}}},
- {POS5+1,{FF,{'$M_EXPR','$F_EXPR',0}}},
- {POS5+2,{FF,{'$M_EXPR','$F_EXPR',0}}},
- {POS5+3,{FF,{'$M_EXPR','$F_EXPR',0}}},
- {POS6+1,{FF,{'$M_EXPR','$F_EXPR',0}}},
- {POS6+2,{FF,{'$M_EXPR','$F_EXPR',0}}},
- {POS6+4,{FF,{n,'$F_EXPR',-1}}},
- {POS7+1,{FF,{'$M_EXPR',f,1}}},
- {POS7+2,{FF,{'$M_EXPR',f,1}}},
- {POS8+2,{FF,{hej,'$F_EXPR',1}}},
- {POS8+3,{FF,{t,'$F_EXPR',1}}},
- {POS8+5,{FF,{a,'$F_EXPR',1}}},
- {POS8+7,{FF,{m,'$F_EXPR',1}}},
- {POS9+1,{FF,{'$M_EXPR',f,1}}},
- {POS9+3,{FF,{a,'$F_EXPR',1}}},
- {POS10+1,{FF,{'$M_EXPR',foo,1}}},
- {POS10+2,{FF,{'$M_EXPR','$F_EXPR',1}}},
- {POS10+3,{FF,{'$M_EXPR','$F_EXPR',2}}},
- {POS10+4,{FF,{'$M_EXPR','$F_EXPR',1}}},
- {POS10+5,{FF,{'$M_EXPR',san,1}}},
- {POS10+6,{FF,{'$M_EXPR','$F_EXPR',1}}},
- {POS11+1,{FF,{'$M_EXPR','$F_EXPR',1}}},
- {POS11+2,{FF,{'$M_EXPR','$F_EXPR',-1}}},
- {POS11+3,{FF,{m,f,-1}}},
- {POS11+4,{FF,{m,f,-1}}},
- {POS11+5,{FF,{'$M_EXPR','$F_EXPR',1}}},
- {POS11+6,{FF,{'$M_EXPR','$F_EXPR',1}}},
- {POS12+1,{FF,{'$M_EXPR','$F_EXPR',-1}}},
- {POS12+4,{FF,{'$M_EXPR','$F_EXPR',2}}},
- {POS12+7,{FF,{'$M_EXPR','$F_EXPR',-1}}},
- {POS12+8,{FF,{m4,f4,-1}}},
- {POS13+2,{FF,{debug,'$F_EXPR',0}}},
- {POS13+3,{FF,{'$M_EXPR','$F_EXPR',-1}}},
- {POS14+8,{{read,bi,0},{'$M_EXPR','$F_EXPR',1}}}],
+ {POS1+8,{FF,{dist,'$F_EXPR',0}}},
+ {POS2+8,{{read,funfuns,0},{expr,'$F_EXPR',1}}},
+ {POS3+4,{FF,{expr,'$F_EXPR',2}}},
+ {POS4+2,{FF,{modul,'$F_EXPR',1}}},
+ {POS4+4,{FF,{spm,'$F_EXPR',1}}},
+ {POS4+6,{FF,{spm,'$F_EXPR',1}}},
+ {POS4+8,{FF,{spm,'$F_EXPR',1}}},
+ {POS5+1,{FF,{'$M_EXPR','$F_EXPR',0}}},
+ {POS5+2,{FF,{'$M_EXPR','$F_EXPR',0}}},
+ {POS5+3,{FF,{'$M_EXPR','$F_EXPR',0}}},
+ {POS6+1,{FF,{'$M_EXPR','$F_EXPR',0}}},
+ {POS6+2,{FF,{'$M_EXPR','$F_EXPR',0}}},
+ {POS6+4,{FF,{n,'$F_EXPR',-1}}},
+ {POS7+1,{FF,{'$M_EXPR',f,1}}},
+ {POS7+2,{FF,{'$M_EXPR',f,1}}},
+ {POS8+2,{FF,{hej,'$F_EXPR',1}}},
+ {POS8+3,{FF,{t,'$F_EXPR',1}}},
+ {POS8+5,{FF,{a,'$F_EXPR',1}}},
+ {POS8+7,{FF,{m,'$F_EXPR',1}}},
+ {POS9+1,{FF,{'$M_EXPR',f,1}}},
+ {POS9+3,{FF,{a,'$F_EXPR',1}}},
+ {POS10+1,{FF,{'$M_EXPR',foo,1}}},
+ {POS10+2,{FF,{'$M_EXPR','$F_EXPR',1}}},
+ {POS10+3,{FF,{'$M_EXPR','$F_EXPR',2}}},
+ {POS10+4,{FF,{'$M_EXPR','$F_EXPR',1}}},
+ {POS10+5,{FF,{'$M_EXPR',san,1}}},
+ {POS10+6,{FF,{'$M_EXPR','$F_EXPR',1}}},
+ {POS11+1,{FF,{'$M_EXPR','$F_EXPR',1}}},
+ {POS11+2,{FF,{'$M_EXPR','$F_EXPR',-1}}},
+ {POS11+3,{FF,{m,f,-1}}},
+ {POS11+4,{FF,{m,f,-1}}},
+ {POS11+5,{FF,{'$M_EXPR','$F_EXPR',1}}},
+ {POS11+6,{FF,{'$M_EXPR','$F_EXPR',1}}},
+ {POS12+1,{FF,{'$M_EXPR','$F_EXPR',-1}}},
+ {POS12+4,{FF,{'$M_EXPR','$F_EXPR',2}}},
+ {POS12+7,{FF,{'$M_EXPR','$F_EXPR',-1}}},
+ {POS12+8,{FF,{m4,f4,-1}}},
+ {POS13+2,{FF,{debug,'$F_EXPR',0}}},
+ {POS13+3,{FF,{'$M_EXPR','$F_EXPR',-1}}},
+ {POS14+8,{{read,bi,0},{'$M_EXPR','$F_EXPR',1}}}],
O1 = [{20,{{read,lc,0},{ets,new,0}}},
- {21,{{read,lc,0},{ets,tab2list,1}}},
- {POS1+1,{FF,{erlang,spawn,1}}},
- {POS1+1,{FF,{mod17,fun17,0}}},
- {POS1+2,{FF,{erlang,spawn,1}}},
- {POS1+2,{FF,{read,local,0}}},
- {POS1+3,{FF,{erlang,spawn,1}}},
- {POS1+4,{FF,{dist,func,0}}},
- {POS1+4,{FF,{erlang,spawn,1}}},
- {POS1+5,{FF,{erlang,spawn,1}}},
- {POS1+6,{FF,{erlang,spawn_link,1}}},
- {POS1+6,{FF,{mod17,fun17,0}}},
- {POS1+7,{FF,{dist,func,0}}},
- {POS1+7,{FF,{erlang,spawn_link,1}}},
- {POS1+8,{FF,{erlang,spawn_link,1}}},
- {POS2+1,{FF,{d,f,0}}},
- {POS2+1,{FF,{dist,func,2}}},
- {POS2+1,{FF,{erlang,spawn,2}}},
- {POS2+2,{FF,{dist,func,2}}},
- {POS2+2,{FF,{erlang,spawn,2}}},
- {POS2+2,{FF,{mod42,func,0}}},
- {POS2+3,{FF,{d,f,0}}},
- {POS2+3,{FF,{dist,func,2}}},
- {POS2+3,{FF,{erlang,spawn_link,2}}},
- {POS2+4,{FF,{dist,func,2}}},
- {POS2+4,{FF,{erlang,spawn_link,2}}},
- {POS2+4,{FF,{mod42,func,0}}},
- {POS3+1,{FF,{dist,func,2}}},
- {POS3+3,{FF,{dist,func,2}}},
- {POS4+1,{FF,{erlang,spawn,4}}},
- {POS4+1,{FF,{modul,function,0}}},
- {POS4+2,{FF,{erlang,spawn,4}}},
- {POS4+3,{FF,{dist,func,2}}},
- {POS4+3,{FF,{erlang,spawn,4}}},
- {POS4+3,{FF,{spm,spf,2}}},
- {POS4+4,{FF,{dist,func,2}}},
- {POS4+4,{FF,{erlang,spawn,4}}},
- {POS4+5,{FF,{dist,func,2}}},
- {POS4+5,{FF,{erlang,spawn_link,4}}},
- {POS4+5,{FF,{spm,spf,2}}},
- {POS4+6,{FF,{dist,func,2}}},
- {POS4+6,{FF,{erlang,spawn_link,4}}},
- {POS4+7,{FF,{erlang,spawn_opt,4}}},
- {POS4+7,{FF,{read,bi,0}}},
- {POS4+7,{FF,{spm,spf,2}}},
- {POS4+8,{FF,{erlang,spawn_opt,4}}},
- {POS4+8,{FF,{read,bi,0}}},
- {POS5+1,{FF,{erlang,spawn,1}}},
- {POS5+2,{FF,{erlang,spawn,1}}},
- {POS5+3,{FF,{erlang,spawn_link,1}}},
- {POS6+1,{FF,{erlang,spawn,2}}},
- {POS6+2,{FF,{erlang,spawn_link,2}}},
- {POS7+1,{FF,{erlang,spawn,4}}},
- {POS7+2,{FF,{erlang,spawn_opt,4}}},
- {POS8+1,{FF,{hej,san,1}}},
- {POS8+4,{FF,{a,b,1}}},
- {POS8+4,{FF,{erlang,apply,2}}},
- {POS8+5,{FF,{erlang,apply,2}}},
- {POS8+6,{FF,{m,f,1}}},
- {POS9+1,{FF,{read,bi,0}}},
- {POS9+2,{FF,{a,b,1}}},
- {POS9+2,{FF,{erlang,apply,2}}},
- {POS9+3,{FF,{erlang,apply,2}}},
- {POS9+4,{FF,{erlang,apply,2}}},
- {POS9+4,{FF,{erlang,not_a_function,1}}},
- {POS9+5,{FF,{mod,func,2}}},
- {POS9+6,{FF,{erlang,apply,1}}},
- {POS9+7,{FF,{erlang,apply,2}}},
- {POS9+7,{FF,{math,add3,1}}},
- {POS9+8,{FF,{q,f,1}}},
- {POS10+4,{FF,{erlang,apply,2}}},
- {POS10+5,{FF,{mod1,fun1,1}}},
- {POS11+6,{FF,{erlang,apply,2}}},
- {POS12+1,{FF,{erlang,apply,2}}},
- {POS12+4,{FF,{erlang,apply,2}}},
- {POS12+5,{FF,{m3,f3,2}}},
- {POS12+7,{FF,{erlang,apply,2}}},
- {POS13+1,{FF,{dm,df,1}}},
- {POS13+6,{{read,bi,0},{foo,module_info,0}}},
- {POS13+7,{{read,bi,0},{read,module_info,0}}},
- {POS13+9,{{read,bi,0},{t,foo,1}}},
- {POS14+11,{{read,bi,0},{erlang,module_info,0}}},
- {POS14+17,{{read,bi,0},{read,bi,0}}}],
+ {21,{{read,lc,0},{ets,tab2list,1}}},
+ {POS1+1,{FF,{erlang,spawn,1}}},
+ {POS1+1,{FF,{mod17,fun17,0}}},
+ {POS1+2,{FF,{erlang,spawn,1}}},
+ {POS1+2,{FF,{read,local,0}}},
+ {POS1+3,{FF,{erlang,spawn,1}}},
+ {POS1+4,{FF,{dist,func,0}}},
+ {POS1+4,{FF,{erlang,spawn,1}}},
+ {POS1+5,{FF,{erlang,spawn,1}}},
+ {POS1+6,{FF,{erlang,spawn_link,1}}},
+ {POS1+6,{FF,{mod17,fun17,0}}},
+ {POS1+7,{FF,{dist,func,0}}},
+ {POS1+7,{FF,{erlang,spawn_link,1}}},
+ {POS1+8,{FF,{erlang,spawn_link,1}}},
+ {POS2+1,{FF,{d,f,0}}},
+ {POS2+1,{FF,{dist,func,2}}},
+ {POS2+1,{FF,{erlang,spawn,2}}},
+ {POS2+2,{FF,{dist,func,2}}},
+ {POS2+2,{FF,{erlang,spawn,2}}},
+ {POS2+2,{FF,{mod42,func,0}}},
+ {POS2+3,{FF,{d,f,0}}},
+ {POS2+3,{FF,{dist,func,2}}},
+ {POS2+3,{FF,{erlang,spawn_link,2}}},
+ {POS2+4,{FF,{dist,func,2}}},
+ {POS2+4,{FF,{erlang,spawn_link,2}}},
+ {POS2+4,{FF,{mod42,func,0}}},
+ {POS3+1,{FF,{dist,func,2}}},
+ {POS3+3,{FF,{dist,func,2}}},
+ {POS4+1,{FF,{erlang,spawn,4}}},
+ {POS4+1,{FF,{modul,function,0}}},
+ {POS4+2,{FF,{erlang,spawn,4}}},
+ {POS4+3,{FF,{dist,func,2}}},
+ {POS4+3,{FF,{erlang,spawn,4}}},
+ {POS4+3,{FF,{spm,spf,2}}},
+ {POS4+4,{FF,{dist,func,2}}},
+ {POS4+4,{FF,{erlang,spawn,4}}},
+ {POS4+5,{FF,{dist,func,2}}},
+ {POS4+5,{FF,{erlang,spawn_link,4}}},
+ {POS4+5,{FF,{spm,spf,2}}},
+ {POS4+6,{FF,{dist,func,2}}},
+ {POS4+6,{FF,{erlang,spawn_link,4}}},
+ {POS4+7,{FF,{erlang,spawn_opt,4}}},
+ {POS4+7,{FF,{read,bi,0}}},
+ {POS4+7,{FF,{spm,spf,2}}},
+ {POS4+8,{FF,{erlang,spawn_opt,4}}},
+ {POS4+8,{FF,{read,bi,0}}},
+ {POS5+1,{FF,{erlang,spawn,1}}},
+ {POS5+2,{FF,{erlang,spawn,1}}},
+ {POS5+3,{FF,{erlang,spawn_link,1}}},
+ {POS6+1,{FF,{erlang,spawn,2}}},
+ {POS6+2,{FF,{erlang,spawn_link,2}}},
+ {POS7+1,{FF,{erlang,spawn,4}}},
+ {POS7+2,{FF,{erlang,spawn_opt,4}}},
+ {POS8+1,{FF,{hej,san,1}}},
+ {POS8+4,{FF,{a,b,1}}},
+ {POS8+4,{FF,{erlang,apply,2}}},
+ {POS8+5,{FF,{erlang,apply,2}}},
+ {POS8+6,{FF,{m,f,1}}},
+ {POS9+1,{FF,{read,bi,0}}},
+ {POS9+2,{FF,{a,b,1}}},
+ {POS9+2,{FF,{erlang,apply,2}}},
+ {POS9+3,{FF,{erlang,apply,2}}},
+ {POS9+4,{FF,{erlang,apply,2}}},
+ {POS9+4,{FF,{erlang,not_a_function,1}}},
+ {POS9+5,{FF,{mod,func,2}}},
+ {POS9+6,{FF,{erlang,apply,1}}},
+ {POS9+7,{FF,{erlang,apply,2}}},
+ {POS9+7,{FF,{math,add3,1}}},
+ {POS9+8,{FF,{q,f,1}}},
+ {POS10+4,{FF,{erlang,apply,2}}},
+ {POS10+5,{FF,{mod1,fun1,1}}},
+ {POS11+6,{FF,{erlang,apply,2}}},
+ {POS12+1,{FF,{erlang,apply,2}}},
+ {POS12+4,{FF,{erlang,apply,2}}},
+ {POS12+5,{FF,{m3,f3,2}}},
+ {POS12+7,{FF,{erlang,apply,2}}},
+ {POS13+1,{FF,{dm,df,1}}},
+ {POS13+6,{{read,bi,0},{foo,module_info,0}}},
+ {POS13+7,{{read,bi,0},{read,module_info,0}}},
+ {POS13+9,{{read,bi,0},{t,foo,1}}},
+ {POS14+11,{{read,bi,0},{erlang,module_info,0}}},
+ {POS14+17,{{read,bi,0},{read,bi,0}}}],
OK = case Version of
- abstract_v1 ->
+ abstract_v1 ->
[{0,{FF,{read,'$F_EXPR',178}}},
{0,{FF,{modul,'$F_EXPR',179}}}]
++ O1;
- _ ->
+ _ ->
[{16,{FF,{read,'$F_EXPR',178}}},
{17,{FF,{modul,'$F_EXPR',179}}}]
++
O1
- end,
+ end,
%% When builtins =:= true:
OKB1 = [{POS13+1,{FF,{erts_debug,apply,4}}},
{POS13+2,{FF,{erts_debug,apply,4}}},
{POS13+3,{FF,{erts_debug,apply,4}}},
- {POS1+3, {FF,{erlang,binary_to_term,1}}},
+ {POS1+3, {FF,{erlang,binary_to_term,1}}},
{POS3+1, {FF,{erlang,spawn,3}}},
{POS3+2, {FF,{erlang,spawn,3}}},
{POS3+3, {FF,{erlang,spawn_link,3}}},
{POS3+4, {FF,{erlang,spawn_link,3}}},
{POS6+4, {FF,{erlang,spawn,3}}},
- {POS8+6,{FF,{erlang,apply,3}}},
- {POS8+7,{FF,{erlang,apply,3}}},
- {POS9+1,{FF,{erlang,apply,3}}},
- {POS9+5,{FF,{erlang,apply,3}}},
- {POS11+1,{FF,{erlang,apply,3}}},
- {POS11+2,{FF,{erlang,apply,3}}},
- {POS11+3,{FF,{erlang,apply,3}}},
- {POS11+4,{FF,{erlang,apply,3}}},
- {POS12+5,{FF,{erlang,apply,3}}},
- {POS12+8,{FF,{erlang,apply,3}}},
+ {POS8+6,{FF,{erlang,apply,3}}},
+ {POS8+7,{FF,{erlang,apply,3}}},
+ {POS9+1,{FF,{erlang,apply,3}}},
+ {POS9+5,{FF,{erlang,apply,3}}},
+ {POS11+1,{FF,{erlang,apply,3}}},
+ {POS11+2,{FF,{erlang,apply,3}}},
+ {POS11+3,{FF,{erlang,apply,3}}},
+ {POS11+4,{FF,{erlang,apply,3}}},
+ {POS12+5,{FF,{erlang,apply,3}}},
+ {POS12+8,{FF,{erlang,apply,3}}},
{POS13+5, {{read,bi,0},{erlang,length,1}}},
{POS14+3, {{read,bi,0},{erlang,length,1}}}],
%% Operators (OTP-8647):
OKB = case Version of
abstract_v1 ->
- [{POS8+3, {FF,{erlang,apply,3}}},
- {POS10+1, {FF,{erlang,apply,3}}},
- {POS10+6, {FF,{erlang,apply,3}}}];
+ [{POS8+3, {FF,{erlang,apply,3}}},
+ {POS10+1, {FF,{erlang,apply,3}}},
+ {POS10+6, {FF,{erlang,apply,3}}}];
_ ->
[{POS13+16, {{read,bi,0},{erlang,'!',2}}},
{POS13+16, {{read,bi,0},{erlang,'-',1}}},
@@ -1227,18 +1187,17 @@ read_expected(Version) ->
{POS15+2, {{read,bi,0},{erlang,'*',2}}},
{POS15+8, {{read,bi,0},{erlang,'/',2}}}]
end
- ++ [{POS14+19, {{read,bi,0},{erlang,'+',2}}},
- {POS14+21, {{read,bi,0},{erlang,'+',2}}},
- {POS13+16, {{read,bi,0},{erlang,'==',2}}},
- {POS14+15, {{read,bi,0},{erlang,'==',2}}},
- {POS13+5, {{read,bi,0},{erlang,'>',2}}},
- {POS14+3, {{read,bi,0},{erlang,'>',2}}}]
- ++ OKB1 ++ OK,
+ ++ [{POS14+19, {{read,bi,0},{erlang,'+',2}}},
+ {POS14+21, {{read,bi,0},{erlang,'+',2}}},
+ {POS13+16, {{read,bi,0},{erlang,'==',2}}},
+ {POS14+15, {{read,bi,0},{erlang,'==',2}}},
+ {POS13+5, {{read,bi,0},{erlang,'>',2}}},
+ {POS14+3, {{read,bi,0},{erlang,'>',2}}}]
+ ++ OKB1 ++ OK,
{U, OK, OKB}.
-read2(suite) -> [];
-read2(doc) -> ["Data read from the Abstract Code (cont)"];
+%% Data read from the Abstract Code (cont)
read2(Conf) when is_list(Conf) ->
%% Handles the spawn_opt versions added in R9 (OTP-4180).
%% Expected augmentations: try/catch, cond.
@@ -1248,40 +1207,40 @@ read2(Conf) when is_list(Conf) ->
MFile = fname(Dir, "read2"),
Beam = fname(Dir, "read2.beam"),
Test = <<"-module(read2).
- -compile(export_all).
-
- f() ->
- spawn_opt({read2,f}, % POS2
- [f()]),
- spawn_opt(fun() -> foo end, [link]),
- spawn_opt(f(),
- {read2,f}, [{min_heap_size,1000}]),
- spawn_opt(f(),
- fun() -> f() end, [flopp]),
- spawn_opt(f(),
- read2, f, [], []);
- f() ->
- %% Duplicated unresolved calls are ignored:
- (f())(foo,bar),(f())(foo,bar). % POS1
+ -compile(export_all).
+
+ f() ->
+ spawn_opt({read2,f}, % POS2
+ [f()]),
+ spawn_opt(fun() -> foo end, [link]),
+ spawn_opt(f(),
+ {read2,f}, [{min_heap_size,1000}]),
+ spawn_opt(f(),
+ fun() -> f() end, [flopp]),
+ spawn_opt(f(),
+ read2, f, [], []);
+ f() ->
+ %% Duplicated unresolved calls are ignored:
+ (f())(foo,bar),(f())(foo,bar). % POS1
">>,
- ?line ok = file:write_file(File, Test),
- ?line {ok, read2} = compile:file(File, [debug_info,{outdir,Dir}]),
+ ok = file:write_file(File, Test),
+ {ok, read2} = compile:file(File, [debug_info,{outdir,Dir}]),
- ?line {ok, _} = xref:start(s),
- ?line {ok, read2} = xref:add_module(s, MFile),
- ?line {U0, OK0} = read2_expected(),
+ {ok, _} = xref:start(s),
+ {ok, read2} = xref:add_module(s, MFile),
+ {U0, OK0} = read2_expected(),
U = to_external(relation_to_family(converse(from_term(U0)))),
OK = to_external(relation_to_family(converse(from_term(OK0)))),
- ?line {ok, U2} = xref:q(s, "(Lin) UC"),
- ?line {ok, OK2} = xref:q(s, "(Lin) (E - UC)"),
- ?line true = U =:= U2,
- ?line true = OK =:= OK2,
- ?line ok = check_state(s),
- ?line xref:stop(s),
-
- ?line ok = file:delete(File),
- ?line ok = file:delete(Beam),
+ {ok, U2} = xref:q(s, "(Lin) UC"),
+ {ok, OK2} = xref:q(s, "(Lin) (E - UC)"),
+ true = U =:= U2,
+ true = OK =:= OK2,
+ ok = check_state(s),
+ xref:stop(s),
+
+ ok = file:delete(File),
+ ok = file:delete(Beam),
ok.
@@ -1291,36 +1250,34 @@ read2_expected() ->
FF = {read2,f,0},
U = [{POS1,{FF,{'$M_EXPR','$F_EXPR',2}}}],
OK = [{POS2,{FF,{erlang,spawn_opt,2}}},
- {POS2,{FF,FF}},
- {POS2+1,{FF,FF}},
- {POS2+2,{FF,{erlang,spawn_opt,2}}},
- {POS2+3,{FF,{erlang,spawn_opt,3}}},
- {POS2+3,{FF,FF}},
- {POS2+3,{FF,FF}},
- {POS2+5,{FF,{erlang,spawn_opt,3}}},
- {POS2+5,{FF,FF}},
- {POS2+6,{FF,FF}},
- {POS2+7,{FF,{erlang,spawn_opt,5}}},
- {POS2+7,{FF,FF}},
- {POS2+7,{FF,FF}},
- {POS1,{FF,FF}}],
+ {POS2,{FF,FF}},
+ {POS2+1,{FF,FF}},
+ {POS2+2,{FF,{erlang,spawn_opt,2}}},
+ {POS2+3,{FF,{erlang,spawn_opt,3}}},
+ {POS2+3,{FF,FF}},
+ {POS2+3,{FF,FF}},
+ {POS2+5,{FF,{erlang,spawn_opt,3}}},
+ {POS2+5,{FF,FF}},
+ {POS2+6,{FF,FF}},
+ {POS2+7,{FF,{erlang,spawn_opt,5}}},
+ {POS2+7,{FF,FF}},
+ {POS2+7,{FF,FF}},
+ {POS1,{FF,FF}}],
{U, OK}.
-remove(suite) -> [];
-remove(doc) -> ["Remove modules, applications, releases"];
+%% Remove modules, applications, releases
remove(Conf) when is_list(Conf) ->
S = new(),
- ?line {error, _, {no_such_module, mod}} =
- xref_base:remove_module(S, mod),
- ?line {error, _, {no_such_application, app}} =
- xref_base:remove_application(S, app),
- ?line {error, _, {no_such_release, rel}} =
- xref_base:remove_release(S, rel),
- ?line ok = xref_base:delete(S),
+ {error, _, {no_such_module, mod}} =
+ xref_base:remove_module(S, mod),
+ {error, _, {no_such_application, app}} =
+ xref_base:remove_application(S, app),
+ {error, _, {no_such_release, rel}} =
+ xref_base:remove_release(S, rel),
+ ok = xref_base:delete(S),
ok.
-replace(suite) -> [];
-replace(doc) -> ["Replace modules, applications, releases"];
+%% Replace modules, applications, releases
replace(Conf) when is_list(Conf) ->
CopyDir = ?copydir,
Dir = fname(CopyDir,"rel2"),
@@ -1334,105 +1291,103 @@ replace(Conf) when is_list(Conf) ->
Xbeam = fname(EB1_1, "x.beam"),
Ybeam = fname(EB1_1, "y.beam"),
- ?line {ok, x} = compile:file(X, [debug_info, {outdir,EB1_0}]),
- ?line {ok, x} = compile:file(X, [debug_info, {outdir,EB1_1}]),
- ?line {ok, y} = compile:file(Y, [debug_info, {outdir,EB1_1}]),
-
- ?line {ok, _} = start(s),
- ?line {ok, false} = xref:set_default(s, verbose, false),
- ?line {ok, true} = xref:set_default(s, warnings, false),
- ?line {ok, rel2} = xref:add_release(s, Dir, []),
- ?line {error, _, _} = xref:replace_application(s, app1, "no_data"),
- ?line {error, _, {no_such_application, app12}} =
- xref:replace_application(s, app12, A1_0, []),
- ?line {error, _, {invalid_filename,{foo,bar}}} =
- xref:replace_application(s, app1, {foo,bar}, []),
- ?line {error, _, {invalid_options,[not_an_option]}} =
- xref:replace_application(s, foo, bar, [not_an_option]),
- ?line {error, _, {invalid_options,[{builtins,not_a_value}]}} =
- xref:replace_application(s, foo, bar, [{builtins,not_a_value}]),
- ?line {ok, app1} =
- xref:replace_application(s, app1, A1_0),
- ?line [{_, AppInfo}] = xref:info(s, applications, app1),
- ?line {value, {release, [rel2]}} = keysearch(release, 1, AppInfo),
-
- ?line {error, _, {no_such_module, xx}} =
- xref:replace_module(s, xx, Xbeam, []),
- ?line {error, _, {invalid_options,[{builtins,true},not_an_option]}} =
- xref:replace_module(s, foo, bar,[{builtins,true},not_an_option]),
- ?line {error, _, {invalid_options,[{builtins,not_a_value}]}} =
- xref:replace_module(s, foo, bar, [{builtins,not_a_value}]),
- ?line {error, _, {invalid_filename,{foo,bar}}} =
- xref:replace_module(s, x, {foo,bar}),
- ?line {ok, x} = xref:replace_module(s, x, Xbeam),
- ?line [{x, ModInfo}] = xref:info(s, modules, x),
- ?line {value, {application, [app1]}} =
- keysearch(application, 1, ModInfo),
-
- ?line {ok, x} = compile:file(X, [no_debug_info, {outdir,EB1_1}]),
- ?line {error, _, {no_debug_info, _}} = xref:replace_module(s, x, Xbeam),
- ?line {error, _, {module_mismatch, x,y}} =
- xref:replace_module(s, x, Ybeam),
- ?line case os:type() of
- {unix, _} ->
- ?line hide_file(Ybeam),
- ?line {error, _, {file_error, _, _}} =
- xref:replace_module(s, x, Ybeam);
- _ ->
- true
- end,
- ?line ok = xref:remove_module(s, x),
- ?line {error, _, {no_debug_info, _}} = xref:add_module(s, Xbeam),
+ {ok, x} = compile:file(X, [debug_info, {outdir,EB1_0}]),
+ {ok, x} = compile:file(X, [debug_info, {outdir,EB1_1}]),
+ {ok, y} = compile:file(Y, [debug_info, {outdir,EB1_1}]),
+
+ {ok, _} = start(s),
+ {ok, false} = xref:set_default(s, verbose, false),
+ {ok, true} = xref:set_default(s, warnings, false),
+ {ok, rel2} = xref:add_release(s, Dir, []),
+ {error, _, _} = xref:replace_application(s, app1, "no_data"),
+ {error, _, {no_such_application, app12}} =
+ xref:replace_application(s, app12, A1_0, []),
+ {error, _, {invalid_filename,{foo,bar}}} =
+ xref:replace_application(s, app1, {foo,bar}, []),
+ {error, _, {invalid_options,[not_an_option]}} =
+ xref:replace_application(s, foo, bar, [not_an_option]),
+ {error, _, {invalid_options,[{builtins,not_a_value}]}} =
+ xref:replace_application(s, foo, bar, [{builtins,not_a_value}]),
+ {ok, app1} =
+ xref:replace_application(s, app1, A1_0),
+ [{_, AppInfo}] = xref:info(s, applications, app1),
+ {value, {release, [rel2]}} = keysearch(release, 1, AppInfo),
+
+ {error, _, {no_such_module, xx}} =
+ xref:replace_module(s, xx, Xbeam, []),
+ {error, _, {invalid_options,[{builtins,true},not_an_option]}} =
+ xref:replace_module(s, foo, bar,[{builtins,true},not_an_option]),
+ {error, _, {invalid_options,[{builtins,not_a_value}]}} =
+ xref:replace_module(s, foo, bar, [{builtins,not_a_value}]),
+ {error, _, {invalid_filename,{foo,bar}}} =
+ xref:replace_module(s, x, {foo,bar}),
+ {ok, x} = xref:replace_module(s, x, Xbeam),
+ [{x, ModInfo}] = xref:info(s, modules, x),
+ {value, {application, [app1]}} =
+ keysearch(application, 1, ModInfo),
+
+ {ok, x} = compile:file(X, [no_debug_info, {outdir,EB1_1}]),
+ {error, _, {no_debug_info, _}} = xref:replace_module(s, x, Xbeam),
+ {error, _, {module_mismatch, x,y}} =
+ xref:replace_module(s, x, Ybeam),
+ case os:type() of
+ {unix, _} ->
+ hide_file(Ybeam),
+ {error, _, {file_error, _, _}} =
+ xref:replace_module(s, x, Ybeam);
+ _ ->
+ true
+ end,
+ ok = xref:remove_module(s, x),
+ {error, _, {no_debug_info, _}} = xref:add_module(s, Xbeam),
%% "app2" is ignored, the old application name is kept
- ?line {ok, app1} = xref:replace_application(s, app1, A2),
+ {ok, app1} = xref:replace_application(s, app1, A2),
- ?line xref:stop(s),
- ?line ok = file:delete(fname(EB1_0, "x.beam")),
- ?line ok = file:delete(Xbeam),
- ?line ok = file:delete(Ybeam),
+ xref:stop(s),
+ ok = file:delete(fname(EB1_0, "x.beam")),
+ ok = file:delete(Xbeam),
+ ok = file:delete(Ybeam),
ok.
-update(suite) -> [];
-update(doc) -> ["The update() function"];
+%% The update() function
update(Conf) when is_list(Conf) ->
CopyDir = ?copydir,
Dir = fname(CopyDir,"update"),
Source = fname(Dir, "x.erl"),
Beam = fname(Dir, "x.beam"),
- ?line copy_file(fname(Dir, "x.erl.1"), Source),
- ?line {ok, x} = compile:file(Source, [debug_info, {outdir,Dir}]),
-
- ?line {ok, _} = start(s),
- ?line ok = xref:set_default(s, [{verbose,false}, {warnings, false}]),
- ?line {ok, [x]} = xref:add_directory(s, Dir, [{builtins,true}]),
- ?line {error, _, {invalid_options,[not_an_option]}} =
- xref:update(s, [not_an_option]),
- ?line {ok, []} = xref:update(s),
- ?line {ok, [{erlang,atom_to_list,1}]} = xref:q(s, "XU"),
-
- ?line [{x, ModInfo}] = xref:info(s, modules, x),
- ?line case keysearch(directory, 1, ModInfo) of
- {value, {directory, Dir}} -> ok
- end,
+ copy_file(fname(Dir, "x.erl.1"), Source),
+ {ok, x} = compile:file(Source, [debug_info, {outdir,Dir}]),
+
+ {ok, _} = start(s),
+ ok = xref:set_default(s, [{verbose,false}, {warnings, false}]),
+ {ok, [x]} = xref:add_directory(s, Dir, [{builtins,true}]),
+ {error, _, {invalid_options,[not_an_option]}} =
+ xref:update(s, [not_an_option]),
+ {ok, []} = xref:update(s),
+ {ok, [{erlang,atom_to_list,1}]} = xref:q(s, "XU"),
+
+ [{x, ModInfo}] = xref:info(s, modules, x),
+ case keysearch(directory, 1, ModInfo) of
+ {value, {directory, Dir}} -> ok
+ end,
timer:sleep(2000), % make sure modification time has changed
- ?line copy_file(fname(Dir, "x.erl.2"), Source),
- ?line {ok, x} = compile:file(Source, [debug_info, {outdir,Dir}]),
- ?line {ok, [x]} = xref:update(s, []),
- ?line {ok, [{erlang,list_to_atom,1}]} = xref:q(s, "XU"),
+ copy_file(fname(Dir, "x.erl.2"), Source),
+ {ok, x} = compile:file(Source, [debug_info, {outdir,Dir}]),
+ {ok, [x]} = xref:update(s, []),
+ {ok, [{erlang,list_to_atom,1}]} = xref:q(s, "XU"),
timer:sleep(2000),
- ?line {ok, x} = compile:file(Source, [no_debug_info,{outdir,Dir}]),
- ?line {error, _, {no_debug_info, _}} = xref:update(s),
+ {ok, x} = compile:file(Source, [no_debug_info,{outdir,Dir}]),
+ {error, _, {no_debug_info, _}} = xref:update(s),
- ?line xref:stop(s),
- ?line ok = file:delete(Beam),
- ?line ok = file:delete(Source),
+ xref:stop(s),
+ ok = file:delete(Beam),
+ ok = file:delete(Source),
ok.
-deprecated(suite) -> [];
-deprecated(doc) -> ["OTP-4695: Deprecated functions."];
+%% OTP-4695: Deprecated functions.
deprecated(Conf) when is_list(Conf) ->
Dir = ?copydir,
File = fname(Dir, "depr.erl"),
@@ -1442,79 +1397,79 @@ deprecated(Conf) when is_list(Conf) ->
%% This file has been compiled to ?datadir/depr_r9c.beam
%% using the R9C compiler. From R10B and onwards the linter
%% checks the 'deprecated' attribute as well.
-% Test = <<"-module(depr).
+ % Test = <<"-module(depr).
-% -export([t/0,f/1,bar/2,f/2,g/3]).
+ % -export([t/0,f/1,bar/2,f/2,g/3]).
-% -deprecated([{f,1}, % DF
-% {bar,2,eventually}]). % DF_3
-% -deprecated([{f,1,next_major_release}]). % DF_2 (again)
-% -deprecated([{frutt,0,next_version}]). % message...
-% -deprecated([{f,2,next_major_release}, % DF_2
-% {g,3,next_version}, % DF_1
-% {ignored,10,100}]). % message...
-% -deprecated([{does_not_exist,1}]). % message...
+ % -deprecated([{f,1}, % DF
+ % {bar,2,eventually}]). % DF_3
+ % -deprecated([{f,1,next_major_release}]). % DF_2 (again)
+ % -deprecated([{frutt,0,next_version}]). % message...
+ % -deprecated([{f,2,next_major_release}, % DF_2
+ % {g,3,next_version}, % DF_1
+ % {ignored,10,100}]). % message...
+ % -deprecated([{does_not_exist,1}]). % message...
-% -deprecated(foo). % message...
+ % -deprecated(foo). % message...
-% t() ->
-% frutt(1),
-% g(1,2, 3),
-% ?MODULE:f(10).
+ % t() ->
+ % frutt(1),
+ % g(1,2, 3),
+ % ?MODULE:f(10).
-% f(A) ->
-% ?MODULE:f(A,A).
+ % f(A) ->
+ % ?MODULE:f(A,A).
-% f(X, Y) ->
-% ?MODULE:g(X, Y, X).
+ % f(X, Y) ->
+ % ?MODULE:g(X, Y, X).
-% g(F, G, H) ->
-% ?MODULE:bar(F, {G,H}).
+ % g(F, G, H) ->
+ % ?MODULE:bar(F, {G,H}).
-% bar(_, _) ->
-% true.
+ % bar(_, _) ->
+ % true.
-% frutt(_) ->
-% frutt().
+ % frutt(_) ->
+ % frutt().
-% frutt() ->
-% true.
-% ">>,
+ % frutt() ->
+ % true.
+ % ">>,
-% ?line ok = file:write_file(File, Test),
-% ?line {ok, depr_r9c} = compile:file(File, [debug_info,{outdir,Dir}]),
+ % ok = file:write_file(File, Test),
+ % {ok, depr_r9c} = compile:file(File, [debug_info,{outdir,Dir}]),
- ?line {ok, _} = xref:start(s),
- ?line {ok, depr_r9c} = xref:add_module(s, MFile_r9c),
+ {ok, _} = xref:start(s),
+ {ok, depr_r9c} = xref:add_module(s, MFile_r9c),
M9 = depr_r9c,
DF_1 = usort([{{M9,f,2},{M9,g,3}}]),
DF_2 = usort(DF_1++[{{M9,f,1},{M9,f,2}},{{M9,t,0},{M9,f,1}}]),
DF_3 = usort(DF_2++[{{M9,g,3},{M9,bar,2}}]),
DF = usort(DF_3++[{{M9,t,0},{M9,f,1}}]),
- ?line {ok,DF} = xref:analyze(s, deprecated_function_calls),
- ?line {ok,DF_1} =
- xref:analyze(s, {deprecated_function_calls,next_version}),
- ?line {ok,DF_2} =
- xref:analyze(s, {deprecated_function_calls,next_major_release}),
- ?line {ok,DF_3} =
- xref:analyze(s, {deprecated_function_calls,eventually}),
+ {ok,DF} = xref:analyze(s, deprecated_function_calls),
+ {ok,DF_1} =
+ xref:analyze(s, {deprecated_function_calls,next_version}),
+ {ok,DF_2} =
+ xref:analyze(s, {deprecated_function_calls,next_major_release}),
+ {ok,DF_3} =
+ xref:analyze(s, {deprecated_function_calls,eventually}),
D = to_external(range(from_term(DF))),
D_1 = to_external(range(from_term(DF_1))),
D_2 = to_external(range(from_term(DF_2))),
D_3 = to_external(range(from_term(DF_3))),
- ?line {ok,D} = xref:analyze(s, deprecated_functions),
- ?line {ok,D_1} =
- xref:analyze(s, {deprecated_functions,next_version}),
- ?line {ok,D_2} =
- xref:analyze(s, {deprecated_functions,next_major_release}),
- ?line {ok,D_3} =
- xref:analyze(s, {deprecated_functions,eventually}),
+ {ok,D} = xref:analyze(s, deprecated_functions),
+ {ok,D_1} =
+ xref:analyze(s, {deprecated_functions,next_version}),
+ {ok,D_2} =
+ xref:analyze(s, {deprecated_functions,next_major_release}),
+ {ok,D_3} =
+ xref:analyze(s, {deprecated_functions,eventually}),
- ?line ok = check_state(s),
- ?line xref:stop(s),
+ ok = check_state(s),
+ xref:stop(s),
Test2= <<"-module(depr).
@@ -1542,11 +1497,11 @@ deprecated(Conf) when is_list(Conf) ->
?MODULE:t().
">>,
- ?line ok = file:write_file(File, Test2),
- ?line {ok, depr} = compile:file(File, [debug_info,{outdir,Dir}]),
+ ok = file:write_file(File, Test2),
+ {ok, depr} = compile:file(File, [debug_info,{outdir,Dir}]),
- ?line {ok, _} = xref:start(s),
- ?line {ok, depr} = xref:add_module(s, MFile),
+ {ok, _} = xref:start(s),
+ {ok, depr} = xref:add_module(s, MFile),
M = depr,
DFa_1 = usort([{{M,f,2},{M,g,3}}]),
@@ -1554,16 +1509,16 @@ deprecated(Conf) when is_list(Conf) ->
DFa_3 = usort(DFa_2++[{{M,bar,2},{M,t,0}},{{M,g,3},{M,bar,2}}]),
DFa = DFa_3,
- ?line {ok,DFa} = xref:analyze(s, deprecated_function_calls),
- ?line {ok,DFa_1} =
- xref:analyze(s, {deprecated_function_calls,next_version}),
- ?line {ok,DFa_2} =
- xref:analyze(s, {deprecated_function_calls,next_major_release}),
- ?line {ok,DFa_3} =
- xref:analyze(s, {deprecated_function_calls,eventually}),
+ {ok,DFa} = xref:analyze(s, deprecated_function_calls),
+ {ok,DFa_1} =
+ xref:analyze(s, {deprecated_function_calls,next_version}),
+ {ok,DFa_2} =
+ xref:analyze(s, {deprecated_function_calls,next_major_release}),
+ {ok,DFa_3} =
+ xref:analyze(s, {deprecated_function_calls,eventually}),
- ?line ok = check_state(s),
- ?line xref:stop(s),
+ ok = check_state(s),
+ xref:stop(s),
%% All of the module is deprecated.
Test3= <<"-module(depr).
@@ -1591,35 +1546,34 @@ deprecated(Conf) when is_list(Conf) ->
?MODULE:t().
">>,
- ?line ok = file:write_file(File, Test3),
- ?line {ok, depr} = compile:file(File, [debug_info,{outdir,Dir}]),
+ ok = file:write_file(File, Test3),
+ {ok, depr} = compile:file(File, [debug_info,{outdir,Dir}]),
- ?line {ok, _} = xref:start(s),
- ?line {ok, depr} = xref:add_module(s, MFile),
+ {ok, _} = xref:start(s),
+ {ok, depr} = xref:add_module(s, MFile),
DFb_1 = usort([{{M,f,2},{M,g,3}}]),
DFb_2 = usort(DFb_1++[{{M,f,1},{M,f,2}},{{M,t,0},{M,f,1}}]),
DFb_3 = DFb_2,
DFb = usort(DFb_2++[{{M,bar,2},{M,t,0}},{{M,g,3},{M,bar,2}}]),
- ?line {ok,DFb} = xref:analyze(s, deprecated_function_calls),
- ?line {ok,DFb_1} =
- xref:analyze(s, {deprecated_function_calls,next_version}),
- ?line {ok,DFb_2} =
- xref:analyze(s, {deprecated_function_calls,next_major_release}),
- ?line {ok,DFb_3} =
- xref:analyze(s, {deprecated_function_calls,eventually}),
+ {ok,DFb} = xref:analyze(s, deprecated_function_calls),
+ {ok,DFb_1} =
+ xref:analyze(s, {deprecated_function_calls,next_version}),
+ {ok,DFb_2} =
+ xref:analyze(s, {deprecated_function_calls,next_major_release}),
+ {ok,DFb_3} =
+ xref:analyze(s, {deprecated_function_calls,eventually}),
- ?line ok = check_state(s),
- ?line xref:stop(s),
+ ok = check_state(s),
+ xref:stop(s),
- ?line ok = file:delete(File),
- ?line ok = file:delete(Beam),
+ ok = file:delete(File),
+ ok = file:delete(Beam),
ok.
-trycatch(suite) -> [];
-trycatch(doc) -> ["OTP-5152: try/catch, final (?) version."];
+%% OTP-5152: try/catch, final (?) version.
trycatch(Conf) when is_list(Conf) ->
Dir = ?copydir,
File = fname(Dir, "trycatch.erl"),
@@ -1643,11 +1597,11 @@ trycatch(Conf) when is_list(Conf) ->
end.
">>,
- ?line ok = file:write_file(File, Test),
- ?line {ok, trycatch} = compile:file(File, [debug_info,{outdir,Dir}]),
+ ok = file:write_file(File, Test),
+ {ok, trycatch} = compile:file(File, [debug_info,{outdir,Dir}]),
- ?line {ok, _} = xref:start(s),
- ?line {ok, trycatch} = xref:add_module(s, MFile),
+ {ok, _} = xref:start(s),
+ {ok, trycatch} = xref:add_module(s, MFile),
A = trycatch,
{ok,[{{{A,A,0},{bar,bar,0}},[10]},
{{{A,A,0},{bar,foo,0}},[8]},
@@ -1656,18 +1610,17 @@ trycatch(Conf) when is_list(Conf) ->
{{{A,A,0},{fini,shed,0}},[15]},
{{{A,A,0},{foo,bar,0}},[7]},
{{{A,A,0},{foo,foo,0}},[9]}]} =
- xref:q(s, "(Lin) (E | trycatch:trycatch/0)"),
+ xref:q(s, "(Lin) (E | trycatch:trycatch/0)"),
- ?line ok = check_state(s),
- ?line xref:stop(s),
+ ok = check_state(s),
+ xref:stop(s),
- ?line ok = file:delete(File),
- ?line ok = file:delete(Beam),
+ ok = file:delete(File),
+ ok = file:delete(Beam),
ok.
-fun_mfa(suite) -> [];
-fun_mfa(doc) -> ["OTP-5653: fun M:F/A."];
+%% OTP-5653: fun M:F/A.
fun_mfa(Conf) when is_list(Conf) ->
Dir = ?copydir,
File = fname(Dir, "fun_mfa.erl"),
@@ -1692,42 +1645,42 @@ fun_mfa(Conf) when is_list(Conf) ->
fun t3/0().
">>,
- ?line ok = file:write_file(File, Test),
+ ok = file:write_file(File, Test),
A = fun_mfa,
- ?line {ok, A} = compile:file(File, [debug_info,{outdir,Dir}]),
- ?line {ok, _} = xref:start(s),
- ?line {ok, A} = xref:add_module(s, MFile, {warnings,false}),
- ?line {ok, [{{{A,t,0},{'$M_EXPR','$F_EXPR',0}},[7]},
- {{{A,t,0},{A,t,0}},[6]},
- {{{A,t1,0},{'$M_EXPR','$F_EXPR',0}},[11]},
- {{{A,t1,0},{A,t,0}},[10]},
- {{{A,t2,0},{A,t,0}},[14]},
- {{{A,t3,0},{fun_mfa,t3,0}},[17]}]} =
- xref:q(s, "(Lin) E"),
-
- ?line ok = check_state(s),
- ?line xref:stop(s),
-
- ?line ok = file:delete(File),
- ?line ok = file:delete(Beam),
+ {ok, A} = compile:file(File, [debug_info,{outdir,Dir}]),
+ {ok, _} = xref:start(s),
+ {ok, A} = xref:add_module(s, MFile, {warnings,false}),
+ {ok, [{{{A,t,0},{'$M_EXPR','$F_EXPR',0}},[7]},
+ {{{A,t,0},{A,t,0}},[6]},
+ {{{A,t1,0},{'$M_EXPR','$F_EXPR',0}},[11]},
+ {{{A,t1,0},{A,t,0}},[10]},
+ {{{A,t2,0},{A,t,0}},[14]},
+ {{{A,t3,0},{fun_mfa,t3,0}},[17]}]} =
+ xref:q(s, "(Lin) E"),
+
+ ok = check_state(s),
+ xref:stop(s),
+
+ ok = file:delete(File),
+ ok = file:delete(Beam),
ok.
%% Same as the previous test case, except that we use a BEAM file
%% that was compiled by an R14 compiler to test backward compatibility.
fun_mfa_r14(Conf) when is_list(Conf) ->
- Dir = ?config(data_dir, Conf),
+ Dir = proplists:get_value(data_dir, Conf),
MFile = fname(Dir, "fun_mfa_r14"),
A = fun_mfa_r14,
{ok, _} = xref:start(s),
{ok, A} = xref:add_module(s, MFile, {warnings,false}),
{ok, [{{{A,t,0},{'$M_EXPR','$F_EXPR',0}},[7]},
- {{{A,t,0},{A,t,0}},[6]},
- {{{A,t1,0},{'$M_EXPR','$F_EXPR',0}},[11]},
- {{{A,t1,0},{A,t,0}},[10]},
- {{{A,t2,0},{A,t,0}},[14]},
- {{{A,t3,0},{A,t3,0}},[17]}]} =
- xref:q(s, "(Lin) E"),
+ {{{A,t,0},{A,t,0}},[6]},
+ {{{A,t1,0},{'$M_EXPR','$F_EXPR',0}},[11]},
+ {{{A,t1,0},{A,t,0}},[10]},
+ {{{A,t2,0},{A,t,0}},[14]},
+ {{{A,t3,0},{A,t3,0}},[17]}]} =
+ xref:q(s, "(Lin) E"),
ok = check_state(s),
xref:stop(s),
@@ -1775,17 +1728,17 @@ fun_mfa_vars(Conf) when is_list(Conf) ->
{ok, _} = xref:start(s),
{ok, A} = xref:add_module(s, MFile, {warnings,false}),
{ok, [{{{A,t,1},{'$M_EXPR','$F_EXPR',2}},[7]},
- {{{A,t,1},{'$M_EXPR',bar,2}},[6]},
- {{{A,t1,1},{'$M_EXPR','$F_EXPR',1}},[11]},
- {{{A,t1,1},{A,'$F_EXPR',1}},[10]},
- {{{A,t2,3},{'$M_EXPR','$F_EXPR',-1}},[14]},
- {{{A,t2,3},{'$M_EXPR','$F_EXPR',1}},[15]},
- {{{A,t3,1},{'$M_EXPR','$F_EXPR',3}},[19]},
- {{{A,t3,1},{fun_mfa_vars,t,-1}},[18]},
- {{{A,t4,2},{'$M_EXPR','$F_EXPR',3}},[22,23]},
- {{{A,t5,2},{'$M_EXPR','$F_EXPR',0}},[27]},
- {{{A,t5,2},{'$M_EXPR',t,-1}},[26]}]} =
- xref:q(s, "(Lin) E"),
+ {{{A,t,1},{'$M_EXPR',bar,2}},[6]},
+ {{{A,t1,1},{'$M_EXPR','$F_EXPR',1}},[11]},
+ {{{A,t1,1},{A,'$F_EXPR',1}},[10]},
+ {{{A,t2,3},{'$M_EXPR','$F_EXPR',-1}},[14]},
+ {{{A,t2,3},{'$M_EXPR','$F_EXPR',1}},[15]},
+ {{{A,t3,1},{'$M_EXPR','$F_EXPR',3}},[19]},
+ {{{A,t3,1},{fun_mfa_vars,t,-1}},[18]},
+ {{{A,t4,2},{'$M_EXPR','$F_EXPR',3}},[22,23]},
+ {{{A,t5,2},{'$M_EXPR','$F_EXPR',0}},[27]},
+ {{{A,t5,2},{'$M_EXPR',t,-1}},[26]}]} =
+ xref:q(s, "(Lin) E"),
ok = check_state(s),
xref:stop(s),
@@ -1794,8 +1747,7 @@ fun_mfa_vars(Conf) when is_list(Conf) ->
ok = file:delete(Beam),
ok.
-qlc(suite) -> [];
-qlc(doc) -> ["OTP-5195: A bug fix when using qlc:q/1,2."];
+%% OTP-5195: A bug fix when using qlc:q/1,2.
qlc(Conf) when is_list(Conf) ->
Dir = ?copydir,
File = fname(Dir, "qlc.erl"),
@@ -1820,32 +1772,31 @@ qlc(Conf) when is_list(Conf) ->
ok.
">>,
- ?line ok = file:write_file(File, Test),
+ ok = file:write_file(File, Test),
A = qlc,
- ?line {ok, A} = compile:file(File, [debug_info,{outdir,Dir}]),
- ?line {ok, _} = xref:start(s),
- ?line {ok, A} = xref:add_module(s, MFile, {warnings,false}),
- ?line {ok, _} = xref:q(s, "(Lin) E"), % is can be loaded
+ {ok, A} = compile:file(File, [debug_info,{outdir,Dir}]),
+ {ok, _} = xref:start(s),
+ {ok, A} = xref:add_module(s, MFile, {warnings,false}),
+ {ok, _} = xref:q(s, "(Lin) E"), % is can be loaded
- ?line ok = check_state(s),
- ?line xref:stop(s),
+ ok = check_state(s),
+ xref:stop(s),
- ?line ok = file:delete(File),
- ?line ok = file:delete(Beam),
+ ok = file:delete(File),
+ ok = file:delete(Beam),
ok.
-analyze(suite) -> [];
-analyze(doc) -> ["Simple analyses"];
+%% Simple analyses
analyze(Conf) when is_list(Conf) ->
S0 = new(),
- ?line {{error, _, {invalid_options,[not_an_option]}}, _} =
- xref_base:analyze(S0, undefined_function_calls, [not_an_option]),
- ?line {{error, _, {invalid_query,{q}}}, _} = xref_base:q(S0,{q}),
- ?line {{error, _, {unknown_analysis,foo}}, _} = xref_base:analyze(S0, foo),
- ?line {{error, _, {unknown_constant,"foo:bar/-1"}}, _} =
- xref_base:analyze(S0, {use,{foo,bar,-1}}),
+ {{error, _, {invalid_options,[not_an_option]}}, _} =
+ xref_base:analyze(S0, undefined_function_calls, [not_an_option]),
+ {{error, _, {invalid_query,{q}}}, _} = xref_base:q(S0,{q}),
+ {{error, _, {unknown_analysis,foo}}, _} = xref_base:analyze(S0, foo),
+ {{error, _, {unknown_constant,"foo:bar/-1"}}, _} =
+ xref_base:analyze(S0, {use,{foo,bar,-1}}),
CopyDir = ?copydir,
Dir = fname(CopyDir,"rel2"),
@@ -1858,57 +1809,50 @@ analyze(Conf) when is_list(Conf) ->
Xbeam = fname(EB2, "x.beam"),
Ybeam = fname(EB1_1, "y.beam"),
- ?line {ok, x} = compile:file(X, [debug_info, {outdir,EB2}]),
- ?line {ok, y} = compile:file(Y, [debug_info, {outdir,EB1_1}]),
-
- ?line {ok, rel2, S1} = xref_base:add_release(S0, Dir, [{verbose,false}]),
- ?line S = set_up(S1),
-
- ?line {ok, _} =
- analyze(undefined_function_calls, [{{x,xx,0},{x,undef,0}}], S),
- ?line {ok, _} = analyze(undefined_functions, [{x,undef,0}], S),
- ?line {ok, _} = analyze(locals_not_used, [{x,l,0},{x,l1,0}], S),
- ?line {ok, _} = analyze(exports_not_used, [{x,xx,0},{y,t,0}], S),
-
- ?line {ok, _} =
- analyze(deprecated_function_calls, [{{y,t,0},{x,t,0}}], S),
- ?line {ok, _} = analyze({deprecated_function_calls,next_version}, [], S),
- ?line {ok, _} =
- analyze({deprecated_function_calls,next_major_release}, [], S),
- ?line {ok, _} = analyze({deprecated_function_calls,eventually},
- [{{y,t,0},{x,t,0}}], S),
- ?line {ok, _} = analyze(deprecated_functions, [{x,t,0}], S),
- ?line {ok, _} = analyze({deprecated_functions,next_version}, [], S),
- ?line {ok, _} =
- analyze({deprecated_functions,next_major_release}, [], S),
- ?line {ok, _} = analyze({deprecated_functions,eventually}, [{x,t,0}], S),
-
- ?line {ok, _} = analyze({call, {x,xx,0}}, [{x,undef,0}], S),
- ?line {ok, _} =
- analyze({call, [{x,xx,0},{x,l,0}]}, [{x,l1,0},{x,undef,0}], S),
- ?line {ok, _} = analyze({use, {x,l,0}}, [{x,l1,0}], S),
- ?line {ok, _} =
- analyze({use, [{x,l,0},{x,l1,0}]}, [{x,l,0},{x,l1,0}], S),
-
- ?line {ok, _} = analyze({module_call, x}, [x], S),
- ?line {ok, _} = analyze({module_call, [x,y]}, [x], S),
- ?line {ok, _} = analyze({module_use, x}, [x,y], S),
- ?line {ok, _} = analyze({module_use, [x,y]}, [x,y], S),
-
- ?line {ok, _} = analyze({application_call, app1}, [app2], S),
- ?line {ok, _} = analyze({application_call, [app1,app2]}, [app2], S),
- ?line {ok, _} = analyze({application_use, app2}, [app1,app2], S),
- ?line {ok, _} = analyze({application_use, [app1,app2]}, [app1,app2], S),
-
- ?line ok = xref_base:delete(S),
- ?line ok = file:delete(Xbeam),
- ?line ok = file:delete(Ybeam),
+ {ok, x} = compile:file(X, [debug_info, {outdir,EB2}]),
+ {ok, y} = compile:file(Y, [debug_info, {outdir,EB1_1}]),
+
+ {ok, rel2, S1} = xref_base:add_release(S0, Dir, [{verbose,false}]),
+ S = set_up(S1),
+
+ {ok, _} = analyze(undefined_function_calls, [{{x,xx,0},{x,undef,0}}], S),
+ {ok, _} = analyze(undefined_functions, [{x,undef,0}], S),
+ {ok, _} = analyze(locals_not_used, [{x,l,0},{x,l1,0}], S),
+ {ok, _} = analyze(exports_not_used, [{x,xx,0},{y,t,0}], S),
+
+ {ok, _} = analyze(deprecated_function_calls, [{{y,t,0},{x,t,0}}], S),
+ {ok, _} = analyze({deprecated_function_calls,next_version}, [], S),
+ {ok, _} = analyze({deprecated_function_calls,next_major_release}, [], S),
+ {ok, _} = analyze({deprecated_function_calls,eventually},
+ [{{y,t,0},{x,t,0}}], S),
+ {ok, _} = analyze(deprecated_functions, [{x,t,0}], S),
+ {ok, _} = analyze({deprecated_functions,next_version}, [], S),
+ {ok, _} = analyze({deprecated_functions,next_major_release}, [], S),
+ {ok, _} = analyze({deprecated_functions,eventually}, [{x,t,0}], S),
+
+ {ok, _} = analyze({call, {x,xx,0}}, [{x,undef,0}], S),
+ {ok, _} = analyze({call, [{x,xx,0},{x,l,0}]}, [{x,l1,0},{x,undef,0}], S),
+ {ok, _} = analyze({use, {x,l,0}}, [{x,l1,0}], S),
+ {ok, _} = analyze({use, [{x,l,0},{x,l1,0}]}, [{x,l,0},{x,l1,0}], S),
+
+ {ok, _} = analyze({module_call, x}, [x], S),
+ {ok, _} = analyze({module_call, [x,y]}, [x], S),
+ {ok, _} = analyze({module_use, x}, [x,y], S),
+ {ok, _} = analyze({module_use, [x,y]}, [x,y], S),
+
+ {ok, _} = analyze({application_call, app1}, [app2], S),
+ {ok, _} = analyze({application_call, [app1,app2]}, [app2], S),
+ {ok, _} = analyze({application_use, app2}, [app1,app2], S),
+ {ok, _} = analyze({application_use, [app1,app2]}, [app1,app2], S),
+
+ ok = xref_base:delete(S),
+ ok = file:delete(Xbeam),
+ ok = file:delete(Ybeam),
ok.
-basic(suite) -> [];
-basic(doc) -> ["Use of operators"];
+%% Use of operators
basic(Conf) when is_list(Conf) ->
- ?line S0 = new(),
+ S0 = new(),
F1 = {m1,f1,1},
F6 = {m1,f2,6}, % X
@@ -1942,8 +1886,8 @@ basic(Conf) when is_list(Conf) ->
LCallAt_m1 = [{E7,12}],
XCallAt_m1 = [{E1,13},{E2,17},{E4,7}],
Info1 = #xref_mod{name = m1, app_name = [a1]},
- ?line S1 = add_module(S0, Info1, DefAt_m1, X_m1, LCallAt_m1, XCallAt_m1,
- XC_m1, LC_m1),
+ S1 = add_module(S0, Info1, DefAt_m1, X_m1, LCallAt_m1, XCallAt_m1,
+ XC_m1, LC_m1),
D2 = {F2,7},
D3 = {F3,9},
@@ -1956,8 +1900,8 @@ basic(Conf) when is_list(Conf) ->
LCallAt_m2 = [],
XCallAt_m2 = [{E3,96},{E6,12},{UE1,77}],
Info2 = #xref_mod{name = m2, app_name = [a2]},
- ?line S2 = add_module(S1, Info2, DefAt_m2, X_m2, LCallAt_m2, XCallAt_m2,
- XC_m2, LC_m2),
+ S2 = add_module(S1, Info2, DefAt_m2, X_m2, LCallAt_m2, XCallAt_m2,
+ XC_m2, LC_m2),
D4 = {F4,6},
D5 = {F5,97},
@@ -1969,186 +1913,185 @@ basic(Conf) when is_list(Conf) ->
LCallAt_m3 = [{E5,19}],
XCallAt_m3 = [{UE2,22}],
Info3 = #xref_mod{name = m3, app_name = [a3]},
- ?line S3 = add_module(S2, Info3, DefAt_m3, X_m3, LCallAt_m3, XCallAt_m3,
- XC_m3, LC_m3),
+ S3 = add_module(S2, Info3, DefAt_m3, X_m3, LCallAt_m3, XCallAt_m3,
+ XC_m3, LC_m3),
Info4 = #xref_mod{name = m4, app_name = [a2]},
- ?line S4 = add_module(S3, Info4, [], [], [], [], [], []),
+ S4 = add_module(S3, Info4, [], [], [], [], [], []),
AppInfo1 = #xref_app{name = a1, rel_name = [r1]},
- ?line S9 = add_application(S4, AppInfo1),
+ S9 = add_application(S4, AppInfo1),
AppInfo2 = #xref_app{name = a2, rel_name = [r1]},
- ?line S10 = add_application(S9, AppInfo2),
+ S10 = add_application(S9, AppInfo2),
AppInfo3 = #xref_app{name = a3, rel_name = [r2]},
- ?line S11 = add_application(S10, AppInfo3),
+ S11 = add_application(S10, AppInfo3),
RelInfo1 = #xref_rel{name = r1},
- ?line S12 = add_release(S11, RelInfo1),
+ S12 = add_release(S11, RelInfo1),
RelInfo2 = #xref_rel{name = r2},
- ?line S13 = add_release(S12, RelInfo2),
+ S13 = add_release(S12, RelInfo2),
- ?line S = set_up(S13),
+ S = set_up(S13),
- ?line {ok, _} = eval("[m1,m2] + m:f/1", unknown_constant, S),
- ?line {ok, _} = eval("[m1, m2, m:f/1]", type_mismatch, S),
+ {ok, _} = eval("[m1,m2] + m:f/1", unknown_constant, S),
+ {ok, _} = eval("[m1, m2, m:f/1]", type_mismatch, S),
- ?line {ok, _} = eval("[m1, m1->m2]", type_mismatch, S),
- ?line {ok, _} = eval("components:f/1", unknown_constant, S),
- ?line {ok, _} = eval("'of':f/1", unknown_constant, S),
- ?line {ok, _} = eval("of:f/1", parse_error, S),
- ?line {ok, _} = eval("components", unknown_constant, S),
- ?line {ok, _} = eval("[components, of, closure]", parse_error, S),
- ?line {ok, _} = eval("[components, 'of', closure]", unknown_constant, S),
+ {ok, _} = eval("[m1, m1->m2]", type_mismatch, S),
+ {ok, _} = eval("components:f/1", unknown_constant, S),
+ {ok, _} = eval("'of':f/1", unknown_constant, S),
+ {ok, _} = eval("of:f/1", parse_error, S),
+ {ok, _} = eval("components", unknown_constant, S),
+ {ok, _} = eval("[components, of, closure]", parse_error, S),
+ {ok, _} = eval("[components, 'of', closure]", unknown_constant, S),
- ?line {ok, _} = eval("[a1->a2,m1->m2]", type_mismatch, S),
- ?line {ok, _} = eval("a1->a2,m1->m2", parse_error, S),
+ {ok, _} = eval("[a1->a2,m1->m2]", type_mismatch, S),
+ {ok, _} = eval("a1->a2,m1->m2", parse_error, S),
- ?line {ok, _} = eval("m1->a1", type_mismatch, S),
- ?line {ok, _} = eval("[{m1,f1,1}] : App", parse_error, S),
- ?line {ok, _} = eval("[{m1,f1,1}] : Fun", [F1], S),
- ?line {ok, _} = eval("range X", type_error, S),
- ?line {ok, _} = eval("domain X", type_error, S),
- ?line {ok, _} = eval("range M", type_error, S),
- ?line {ok, _} = eval("domain M", type_error, S),
+ {ok, _} = eval("m1->a1", type_mismatch, S),
+ {ok, _} = eval("[{m1,f1,1}] : App", parse_error, S),
+ {ok, _} = eval("[{m1,f1,1}] : Fun", [F1], S),
+ {ok, _} = eval("range X", type_error, S),
+ {ok, _} = eval("domain X", type_error, S),
+ {ok, _} = eval("range M", type_error, S),
+ {ok, _} = eval("domain M", type_error, S),
% Misc.
- ?line {ok, _} = eval("not_a_prefix_operator m1", parse_error, S),
- ?line {ok, _} = eval(f("(Mod) ~p", [[F1,F6,F5]]), [m1,m3], S),
- ?line {ok, _} = eval("(Lin) M - (Lin) m1",
- [{F2,7},{F3,9},{F7,19},{F4,6},{F5,97},{UF2,0}], S),
- ?line {ok, _} = eval(f("(Lin) M * (Lin) ~p", [[F1,F6]]),
- [{F1,12},{F6,3}], S),
-
- ?line {ok, _} = eval(f("X * ~p", [[F1, F2, F3, F4, F5]]), [F3, F4], S),
- ?line {ok, _} = eval("X", [F6,F3,F7,F4], S),
- ?line {ok, _} = eval("X * AM", [F6,F3,F7,F4], S),
- ?line {ok, _} = eval("X * a2", [F3,F7], S),
-
- ?line {ok, _} = eval("L * r1", [F1,F2], S),
- ?line {ok, _} = eval("U", [UF1, UF2], S),
- ?line {ok, _} = eval("U * AM", [UF1], S),
- ?line {ok, _} = eval("U * UM", [UF2], S),
- ?line {ok, _} = eval("XU * [m1, m2]", [F6,F3,F7,UF1], S),
- ?line {ok, _} = eval("LU * [m3, m4]", [F5], S),
- ?line {ok, _} = eval("UU", [F1,F2], S),
-
- ?line {ok, _} = eval("XC | m1", [E1,E2,E4], S),
- ?line {ok, _} = eval(f("XC | ~p", [F1]), [E1,E4], S),
- ?line {ok, _} = eval(f("(XXL) (Lin) (XC | ~p)", [F1]),
- [{{D1,D3},[13]},{{D1,D4},[7]}],S),
- ?line {ok, _} = eval(f("XC | (~p + ~p)", [F1, F2]), [E1,E4,E3,UE1], S),
- ?line {ok, _} = eval(f("(XXL) (Lin) (XC | ~p)", [F1]),
- [{{D1,D3},[13]},{{D1,D4},[7]}], S),
- ?line {ok, _} = eval("LC | m3", [E5], S),
- ?line {ok, _} = eval(f("LC | ~p", [F1]), [E7], S),
- ?line {ok, _} = eval(f("LC | (~p + ~p)", [F1, F4]), [E7, E5], S),
- ?line {ok, _} = eval("E | m1", [E1,E2,E4,E7], S),
- ?line {ok, _} = eval(f("E | ~p", [F1]), [E1,E7,E4], S),
- ?line {ok, _} = eval(f("E | (~p + ~p)", [F1, F2]), [E1,E7,E4,E3,UE1], S),
-
- ?line {ok, _} = eval("XC || m1", [E3,UE2], S),
- ?line {ok, _} = eval(f("XC || ~p", [F6]), [E3], S),
- ?line {ok, _} = eval(f("XC || (~p + ~p)", [F4, UF2]), [UE1,E4,E6], S),
- ?line {ok, _} = eval("LC || m3", [E5], S),
- ?line {ok, _} = eval(f("LC || ~p", [F1]), [], S),
- ?line {ok, _} = eval(f("LC || ~p", [F6]), [E7], S),
- ?line {ok, _} = eval(f("LC || (~p + ~p)", [F5, F6]), [E7,E5], S),
- ?line {ok, _} = eval("E || m1", [E3,UE2,E7], S),
- ?line {ok, _} = eval(f("E || ~p", [F6]), [E3,E7], S),
- ?line {ok, _} = eval(f("E || (~p + ~p)", [F3,F4]), [E1,E4,E6], S),
-
- ?line {ok, _} = eval(f("~p + ~p", [F1,F2]), [F1,F2], S),
- ?line {ok, _} = eval(f("~p * ~p", [m1,[F1,F6,F2]]), [F1,F6], S),
- ?line {ok, _} = eval(f("~p * ~p", [F1,F2]), [], S),
+ {ok, _} = eval("not_a_prefix_operator m1", parse_error, S),
+ {ok, _} = eval(f("(Mod) ~p", [[F1,F6,F5]]), [m1,m3], S),
+ {ok, _} = eval("(Lin) M - (Lin) m1",
+ [{F2,7},{F3,9},{F7,19},{F4,6},{F5,97},{UF2,0}], S),
+ {ok, _} = eval(f("(Lin) M * (Lin) ~p", [[F1,F6]]),
+ [{F1,12},{F6,3}], S),
+
+ {ok, _} = eval(f("X * ~p", [[F1, F2, F3, F4, F5]]), [F3, F4], S),
+ {ok, _} = eval("X", [F6,F3,F7,F4], S),
+ {ok, _} = eval("X * AM", [F6,F3,F7,F4], S),
+ {ok, _} = eval("X * a2", [F3,F7], S),
+
+ {ok, _} = eval("L * r1", [F1,F2], S),
+ {ok, _} = eval("U", [UF1, UF2], S),
+ {ok, _} = eval("U * AM", [UF1], S),
+ {ok, _} = eval("U * UM", [UF2], S),
+ {ok, _} = eval("XU * [m1, m2]", [F6,F3,F7,UF1], S),
+ {ok, _} = eval("LU * [m3, m4]", [F5], S),
+ {ok, _} = eval("UU", [F1,F2], S),
+
+ {ok, _} = eval("XC | m1", [E1,E2,E4], S),
+ {ok, _} = eval(f("XC | ~p", [F1]), [E1,E4], S),
+ {ok, _} = eval(f("(XXL) (Lin) (XC | ~p)", [F1]),
+ [{{D1,D3},[13]},{{D1,D4},[7]}],S),
+ {ok, _} = eval(f("XC | (~p + ~p)", [F1, F2]), [E1,E4,E3,UE1], S),
+ {ok, _} = eval(f("(XXL) (Lin) (XC | ~p)", [F1]),
+ [{{D1,D3},[13]},{{D1,D4},[7]}], S),
+ {ok, _} = eval("LC | m3", [E5], S),
+ {ok, _} = eval(f("LC | ~p", [F1]), [E7], S),
+ {ok, _} = eval(f("LC | (~p + ~p)", [F1, F4]), [E7, E5], S),
+ {ok, _} = eval("E | m1", [E1,E2,E4,E7], S),
+ {ok, _} = eval(f("E | ~p", [F1]), [E1,E7,E4], S),
+ {ok, _} = eval(f("E | (~p + ~p)", [F1, F2]), [E1,E7,E4,E3,UE1], S),
+
+ {ok, _} = eval("XC || m1", [E3,UE2], S),
+ {ok, _} = eval(f("XC || ~p", [F6]), [E3], S),
+ {ok, _} = eval(f("XC || (~p + ~p)", [F4, UF2]), [UE1,E4,E6], S),
+ {ok, _} = eval("LC || m3", [E5], S),
+ {ok, _} = eval(f("LC || ~p", [F1]), [], S),
+ {ok, _} = eval(f("LC || ~p", [F6]), [E7], S),
+ {ok, _} = eval(f("LC || (~p + ~p)", [F5, F6]), [E7,E5], S),
+ {ok, _} = eval("E || m1", [E3,UE2,E7], S),
+ {ok, _} = eval(f("E || ~p", [F6]), [E3,E7], S),
+ {ok, _} = eval(f("E || (~p + ~p)", [F3,F4]), [E1,E4,E6], S),
+
+ {ok, _} = eval(f("~p + ~p", [F1,F2]), [F1,F2], S),
+ {ok, _} = eval(f("~p * ~p", [m1,[F1,F6,F2]]), [F1,F6], S),
+ {ok, _} = eval(f("~p * ~p", [F1,F2]), [], S),
%% range, domain
- ?line {ok, _} = eval("range (E || m1)", [F6,UF1], S),
- ?line {ok, _} = eval("domain (E || m1)", [F1,F2,F5], S),
- ?line {ok, _} = eval(f("E | domain ~p", [[E1, {F2,F4}]]),
- [E1,E7,E4,E3,UE1], S),
+ {ok, _} = eval("range (E || m1)", [F6,UF1], S),
+ {ok, _} = eval("domain (E || m1)", [F1,F2,F5], S),
+ {ok, _} = eval(f("E | domain ~p", [[E1, {F2,F4}]]),
+ [E1,E7,E4,E3,UE1], S),
%% components, condensation, use, call
- ?line {ok, _} = eval("(Lin) components E", type_error, S),
- ?line {ok, _} = eval("components (Lin) E", type_error, S),
- ?line {ok, _} = eval("components V", type_error, S),
- ?line {ok, _} = eval("components E + components E", type_error, S),
-
- ?line {ok, _} = eval(f("range (closure E | ~p)", [[F1,F2]]),
- [F6,F3,F7,F4,F5,UF1,UF2], S),
- ?line {ok, _} =
- eval(f("domain (closure E || ~p)", [[UF2,F7]]), [F1,F2,F6], S),
- ?line {ok, _} = eval("components E", [], S),
- ?line {ok, _} = eval("components (Mod) E", [[m1,m2,m3]], S),
- ?line {ok, _} = eval("components closure (Mod) E", [[m1,m2,m3]], S),
- ?line {ok, _} = eval("condensation (Mod) E",
- [{[m1,m2,m3],[m17]}], S),
- ?line {ok, _} = eval("condensation closure (Mod) E",
- [{[m1,m2,m3],[m17]}], S),
- ?line {ok, _} = eval("condensation closure closure closure (Mod) E",
- [{[m1,m2,m3],[m17]}], S),
- ?line {ok, _} = eval("weak condensation (Mod) E",
- [{[m1,m2,m3],[m1,m2,m3]},{[m1,m2,m3],[m17]},{[m17],[m17]}], S),
- ?line {ok, _} = eval("strict condensation (Mod) E",
- [{[m1,m2,m3],[m17]}], S),
- ?line {ok, _} = eval("range condensation (Mod) E",
- [[m17]], S),
- ?line {ok, _} = eval("domain condensation (Mod) E",
- [[m1,m2,m3]], S),
+ {ok, _} = eval("(Lin) components E", type_error, S),
+ {ok, _} = eval("components (Lin) E", type_error, S),
+ {ok, _} = eval("components V", type_error, S),
+ {ok, _} = eval("components E + components E", type_error, S),
+
+ {ok, _} = eval(f("range (closure E | ~p)", [[F1,F2]]),
+ [F6,F3,F7,F4,F5,UF1,UF2], S),
+ {ok, _} =
+ eval(f("domain (closure E || ~p)", [[UF2,F7]]), [F1,F2,F6], S),
+ {ok, _} = eval("components E", [], S),
+ {ok, _} = eval("components (Mod) E", [[m1,m2,m3]], S),
+ {ok, _} = eval("components closure (Mod) E", [[m1,m2,m3]], S),
+ {ok, _} = eval("condensation (Mod) E",
+ [{[m1,m2,m3],[m17]}], S),
+ {ok, _} = eval("condensation closure (Mod) E",
+ [{[m1,m2,m3],[m17]}], S),
+ {ok, _} = eval("condensation closure closure closure (Mod) E",
+ [{[m1,m2,m3],[m17]}], S),
+ {ok, _} = eval("weak condensation (Mod) E",
+ [{[m1,m2,m3],[m1,m2,m3]},{[m1,m2,m3],[m17]},{[m17],[m17]}], S),
+ {ok, _} = eval("strict condensation (Mod) E",
+ [{[m1,m2,m3],[m17]}], S),
+ {ok, _} = eval("range condensation (Mod) E",
+ [[m17]], S),
+ {ok, _} = eval("domain condensation (Mod) E",
+ [[m1,m2,m3]], S),
%% |, ||, |||
- ?line {ok, _} = eval("(Lin) E || V", type_error, S),
- ?line {ok, _} = eval("E ||| (Lin) V", type_error, S),
- ?line {ok, _} = eval("E ||| m1", [E7], S),
- ?line {ok, _} = eval("closure E ||| m1", [E7,{F1,UF1},{F6,UF1}], S),
- ?line {ok, _} = eval("closure E ||| [m1,m2]",
- [{F1,UF1},{F2,F7},{F1,F7},{F6,UF1},{F2,UF1},{F7,UF1},E7,E1,E2,E3], S),
- ?line {ok, _} = eval("AE | a1", [{a1,a1},{a1,a2},{a1,a3}], S),
+ {ok, _} = eval("(Lin) E || V", type_error, S),
+ {ok, _} = eval("E ||| (Lin) V", type_error, S),
+ {ok, _} = eval("E ||| m1", [E7], S),
+ {ok, _} = eval("closure E ||| m1", [E7,{F1,UF1},{F6,UF1}], S),
+ {ok, _} = eval("closure E ||| [m1,m2]",
+ [{F1,UF1},{F2,F7},{F1,F7},{F6,UF1},{F2,UF1},{F7,UF1},E7,E1,E2,E3], S),
+ {ok, _} = eval("AE | a1", [{a1,a1},{a1,a2},{a1,a3}], S),
%% path ('of')
- ?line {ok, _} = eval("(Lin) {m1,m2} of E", type_error, S),
- ?line {ok, _} = eval("{m1,m2} of (Lin) E", type_error, S),
- ?line [m1,m2] = eval("{m1,m2} of {m1,m2}", S),
- ?line {ok, _} = eval("{m1,m2} of m1", type_error, S),
- ?line {ok, _} = eval("{a3,m1} of ME", type_mismatch, S),
- ?line [m1,m1] = eval("{m1} of ME", S),
- ?line [m1,m1] = eval("{m1} of closure closure ME", S),
- ?line false = eval("{m17} of ME", S),
- ?line [m2,m1,m2] = eval("{m2} : Mod of ME", S),
- ?line [m1,m2,m17] = eval("{m1, m17} of ME", S),
- ?line [m1,m2,m17] = eval("m1 -> m17 of ME", S),
- ?line {ok, _} = eval("[m1->m17,m17->m1] of ME", type_error, S),
- ?line case eval(f("~p of E", [{F1,F7,UF1}]), S) of
- [F1,F6,F7,F4,F5,UF1] -> ok
- end,
- ?line [a2,a1,a2] = eval("{a2} of AE", S),
+ {ok, _} = eval("(Lin) {m1,m2} of E", type_error, S),
+ {ok, _} = eval("{m1,m2} of (Lin) E", type_error, S),
+ [m1,m2] = eval("{m1,m2} of {m1,m2}", S),
+ {ok, _} = eval("{m1,m2} of m1", type_error, S),
+ {ok, _} = eval("{a3,m1} of ME", type_mismatch, S),
+ [m1,m1] = eval("{m1} of ME", S),
+ [m1,m1] = eval("{m1} of closure closure ME", S),
+ false = eval("{m17} of ME", S),
+ [m2,m1,m2] = eval("{m2} : Mod of ME", S),
+ [m1,m2,m17] = eval("{m1, m17} of ME", S),
+ [m1,m2,m17] = eval("m1 -> m17 of ME", S),
+ {ok, _} = eval("[m1->m17,m17->m1] of ME", type_error, S),
+ case eval(f("~p of E", [{F1,F7,UF1}]), S) of
+ [F1,F6,F7,F4,F5,UF1] -> ok
+ end,
+ [a2,a1,a2] = eval("{a2} of AE", S),
%% weak/strict
- ?line {ok, _} = eval("weak {m1,m2}", [{m1,m1},{m1,m2},{m2,m2}], S),
- ?line {ok, _} = eval("strict [{m1,m1},{m1,m2},{m2,m2}]", [{m1,m2}], S),
- ?line {ok, _} = eval("range weak [{m1,m2}] : Mod", [m1,m2], S),
- ?line {ok, _} = eval("domain strict [{m1,m1},{m1,m2},{m2,m2}]", [m1], S),
+ {ok, _} = eval("weak {m1,m2}", [{m1,m1},{m1,m2},{m2,m2}], S),
+ {ok, _} = eval("strict [{m1,m1},{m1,m2},{m2,m2}]", [{m1,m2}], S),
+ {ok, _} = eval("range weak [{m1,m2}] : Mod", [m1,m2], S),
+ {ok, _} = eval("domain strict [{m1,m1},{m1,m2},{m2,m2}]", [m1], S),
%% #, number of
- ?line {ok, _} = eval("# [{r1,r2}] : Rel", 1, S),
- ?line {ok, _} = eval("# [{a3,a1}] : App", 1, S),
- ?line {ok, _} = eval("# AE", 7, S),
- ?line {ok, _} = eval("# ME", 8, S),
- ?line {ok, _} = eval("# AE + # ME", 15, S),
- ?line {ok, _} = eval("# AE * # ME", 56, S),
- ?line {ok, _} = eval("# AE - # ME", -1, S),
- ?line {ok, _} = eval("# E", 9, S),
- ?line {ok, _} = eval("# V", 9, S),
- ?line {ok, _} = eval("# (Lin) E", 9, S),
- ?line {ok, _} = eval("# (ELin) E", 7, S),
- ?line {ok, _} = eval("# closure E", type_error, S),
- ?line {ok, _} = eval("# weak {m1,m2}", 3, S),
- ?line {ok, _} = eval("#strict condensation (Mod) E", 1, S),
- ?line {ok, _} = eval("#components closure (Mod) E", 1, S),
- ?line {ok, _} = eval("# range strict condensation (Mod) E", 1, S),
+ {ok, _} = eval("# [{r1,r2}] : Rel", 1, S),
+ {ok, _} = eval("# [{a3,a1}] : App", 1, S),
+ {ok, _} = eval("# AE", 7, S),
+ {ok, _} = eval("# ME", 8, S),
+ {ok, _} = eval("# AE + # ME", 15, S),
+ {ok, _} = eval("# AE * # ME", 56, S),
+ {ok, _} = eval("# AE - # ME", -1, S),
+ {ok, _} = eval("# E", 9, S),
+ {ok, _} = eval("# V", 9, S),
+ {ok, _} = eval("# (Lin) E", 9, S),
+ {ok, _} = eval("# (ELin) E", 7, S),
+ {ok, _} = eval("# closure E", type_error, S),
+ {ok, _} = eval("# weak {m1,m2}", 3, S),
+ {ok, _} = eval("#strict condensation (Mod) E", 1, S),
+ {ok, _} = eval("#components closure (Mod) E", 1, S),
+ {ok, _} = eval("# range strict condensation (Mod) E", 1, S),
ok.
-md(suite) -> [];
-md(doc) -> ["The xref:m() and xref:d() functions"];
+%% The xref:m() and xref:d() functions
md(Conf) when is_list(Conf) ->
CopyDir = ?copydir,
Dir = fname(CopyDir,"md"),
@@ -2157,63 +2100,61 @@ md(Conf) when is_list(Conf) ->
Xbeam = fname(Dir, "x__x.beam"),
Ybeam = fname(Dir, "y__y.beam"),
- ?line {error, _, {invalid_filename,{foo,bar}}} = xref:m({foo,bar}),
- ?line {error, _, {invalid_filename,{foo,bar}}} = xref:d({foo,bar}),
+ {error, _, {invalid_filename,{foo,bar}}} = xref:m({foo,bar}),
+ {error, _, {invalid_filename,{foo,bar}}} = xref:d({foo,bar}),
- ?line {ok, x__x} = compile:file(X, [debug_info, {outdir,Dir}]),
- ?line {ok, y__y} = compile:file(Y, [debug_info, {outdir,Dir}]),
+ {ok, x__x} = compile:file(X, [debug_info, {outdir,Dir}]),
+ {ok, y__y} = compile:file(Y, [debug_info, {outdir,Dir}]),
- ?line {error, _, {no_such_module, foo_bar}} = xref:m(foo_bar),
- ?line OldPath = code:get_path(),
- ?line true = code:set_path([Dir | OldPath]),
- ?line MInfo = xref:m(x__x),
- ?line [{{x__x,t,1},{y__y,t,2}}] = info_tag(MInfo, undefined),
- ?line [] = info_tag(MInfo, unused),
- ?line [] = info_tag(MInfo, deprecated),
- ?line DInfo = xref:d(Dir),
- ?line [{{x__x,t,1},{y__y,t,2}}] = info_tag(DInfo, undefined),
- ?line [{y__y,l,0},{y__y,l1,0}] = info_tag(DInfo, unused),
- ?line [] = info_tag(MInfo, deprecated),
+ {error, _, {no_such_module, foo_bar}} = xref:m(foo_bar),
+ OldPath = code:get_path(),
+ true = code:set_path([Dir | OldPath]),
+ MInfo = xref:m(x__x),
+ [{{x__x,t,1},{y__y,t,2}}] = info_tag(MInfo, undefined),
+ [] = info_tag(MInfo, unused),
+ [] = info_tag(MInfo, deprecated),
+ DInfo = xref:d(Dir),
+ [{{x__x,t,1},{y__y,t,2}}] = info_tag(DInfo, undefined),
+ [{y__y,l,0},{y__y,l1,0}] = info_tag(DInfo, unused),
+ [] = info_tag(MInfo, deprecated),
%% Switch from 'functions' mode to 'modules' mode.
- ?line {ok, x__x} = compile:file(X, [no_debug_info, {outdir,Dir}]),
- ?line {ok, y__y} = compile:file(Y, [no_debug_info, {outdir,Dir}]),
- ?line MInfoMod = xref:m(x__x),
- ?line [{y__y,t,2}] = info_tag(MInfoMod, undefined),
- ?line [] = info_tag(MInfo, deprecated),
- ?line DInfoMod = xref:d(Dir),
- ?line [{y__y,t,2}] = info_tag(DInfoMod, undefined),
- ?line [] = info_tag(MInfo, deprecated),
-
- ?line true = code:set_path(OldPath),
- ?line ok = file:delete(Xbeam),
- ?line ok = file:delete(Ybeam),
+ {ok, x__x} = compile:file(X, [no_debug_info, {outdir,Dir}]),
+ {ok, y__y} = compile:file(Y, [no_debug_info, {outdir,Dir}]),
+ MInfoMod = xref:m(x__x),
+ [{y__y,t,2}] = info_tag(MInfoMod, undefined),
+ [] = info_tag(MInfo, deprecated),
+ DInfoMod = xref:d(Dir),
+ [{y__y,t,2}] = info_tag(DInfoMod, undefined),
+ [] = info_tag(MInfo, deprecated),
+
+ true = code:set_path(OldPath),
+ ok = file:delete(Xbeam),
+ ok = file:delete(Ybeam),
ok.
-q(suite) -> [];
-q(doc) -> ["User queries"];
+%% User queries
q(Conf) when is_list(Conf) ->
- ?line S0 = new(),
- ?line {ok, _} = eval("'foo", parse_error, S0),
- ?line {ok, _} = eval("TT = E, TT = V", variable_reassigned, S0),
- ?line {ok, _} = eval("TT = E, TTT", unknown_variable, S0),
- ?line {ok, S} = eval("TT := E", [], S0),
- ?line {ok, S1} = eval("TT * TT * TT", [], S),
- ?line {ok, _S2} = xref_base:forget(S1, 'TT'),
+ S0 = new(),
+ {ok, _} = eval("'foo", parse_error, S0),
+ {ok, _} = eval("TT = E, TT = V", variable_reassigned, S0),
+ {ok, _} = eval("TT = E, TTT", unknown_variable, S0),
+ {ok, S} = eval("TT := E", [], S0),
+ {ok, S1} = eval("TT * TT * TT", [], S),
+ {ok, _S2} = xref_base:forget(S1, 'TT'),
ok.
-variables(suite) -> [];
-variables(doc) -> ["Setting and getting values of query variables"];
+%% Setting and getting values of query variables
variables(Conf) when is_list(Conf) ->
- ?line Sa = new(),
- ?line {{error, _, {invalid_options,[not_an_option]}}, _} =
- xref_base:variables(Sa, [not_an_option]),
- ?line {error, _, {not_user_variable,foo}} = xref_base:forget(Sa, foo),
- ?line Sa1 = set_up(Sa),
- ?line {error, _, {not_user_variable,foo}} = xref_base:forget(Sa1, foo),
- ?line ok = xref_base:delete(Sa1),
+ Sa = new(),
+ {{error, _, {invalid_options,[not_an_option]}}, _} =
+ xref_base:variables(Sa, [not_an_option]),
+ {error, _, {not_user_variable,foo}} = xref_base:forget(Sa, foo),
+ Sa1 = set_up(Sa),
+ {error, _, {not_user_variable,foo}} = xref_base:forget(Sa1, foo),
+ ok = xref_base:delete(Sa1),
- ?line S0 = new(),
+ S0 = new(),
F1 = {m1,f1,1},
F2 = {m2,f1,2},
@@ -2232,8 +2173,8 @@ variables(Conf) when is_list(Conf) ->
LCallAt_m1 = [],
XCallAt_m1 = [{E1,13},{E3,17}],
Info1 = #xref_mod{name = m1, app_name = [a1]},
- ?line S1 = add_module(S0, Info1, DefAt_m1, X_m1, LCallAt_m1, XCallAt_m1,
- XC_m1, LC_m1),
+ S1 = add_module(S0, Info1, DefAt_m1, X_m1, LCallAt_m1, XCallAt_m1,
+ XC_m1, LC_m1),
D2 = {F2,7},
DefAt_m2 = [D2],
@@ -2244,66 +2185,65 @@ variables(Conf) when is_list(Conf) ->
LCallAt_m2 = [],
XCallAt_m2 = [{E2,96}],
Info2 = #xref_mod{name = m2, app_name = [a2]},
- ?line S2 = add_module(S1, Info2, DefAt_m2, X_m2, LCallAt_m2, XCallAt_m2,
- XC_m2, LC_m2),
-
- ?line S = set_up(S2),
-
- ?line eval("T1=E, T2=E*T1, T3 = T2*T2, T4=range T3, T5=T3|T4, T5",
- [E1,E2,E3], S),
- ?line eval("((E*E)*(E*E)) | (range ((E*E)*(E*E)))",
- [E1,E2,E3], S),
- ?line eval("T1=V*V,T2=T1*V,T3=V*V*V,T3",
- [F1,F2,Lib], S),
- ?line eval("T1=V*V, T2=V*V, T1*T2",
- [F1,F2,Lib], S),
-
- ?line {ok, S100} = eval("T0 := E", [E1, E2, E3], S),
- ?line {ok, S101} = eval("T1 := E | m1", [E1, E3], S100),
- ?line {ok, S102} = eval("T2 := E | m2", [E2], S101),
- ?line {{ok, [{user, ['T0', 'T1', 'T2']}]}, _} = xref_base:variables(S102),
- ?line {ok, S103} = xref_base:forget(S102, 'T0'),
- ?line {{ok, [{user, ['T1', 'T2']}]}, S104} =
- xref_base:variables(S103, [user]),
- ?line {ok, S105} = xref_base:forget(S104),
- ?line {{ok, [{user, []}]}, S106} = xref_base:variables(S105),
- ?line {{ok, [{predefined,_}]}, S107_0} =
- xref_base:variables(S106, [predefined]),
-
- ?line {ok, S107_1} =
- eval("TT := E, TT2 := V, TT1 := TT * TT", [E1,E2,E3], S107_0),
- ?line {{ok, [{user, ['TT', 'TT1', 'TT2']}]}, _} =
- xref_base:variables(S107_1),
- ?line {ok, S107} = xref_base:forget(S107_1),
+ S2 = add_module(S1, Info2, DefAt_m2, X_m2, LCallAt_m2, XCallAt_m2,
+ XC_m2, LC_m2),
+
+ S = set_up(S2),
+
+ eval("T1=E, T2=E*T1, T3 = T2*T2, T4=range T3, T5=T3|T4, T5",
+ [E1,E2,E3], S),
+ eval("((E*E)*(E*E)) | (range ((E*E)*(E*E)))",
+ [E1,E2,E3], S),
+ eval("T1=V*V,T2=T1*V,T3=V*V*V,T3",
+ [F1,F2,Lib], S),
+ eval("T1=V*V, T2=V*V, T1*T2",
+ [F1,F2,Lib], S),
+
+ {ok, S100} = eval("T0 := E", [E1, E2, E3], S),
+ {ok, S101} = eval("T1 := E | m1", [E1, E3], S100),
+ {ok, S102} = eval("T2 := E | m2", [E2], S101),
+ {{ok, [{user, ['T0', 'T1', 'T2']}]}, _} = xref_base:variables(S102),
+ {ok, S103} = xref_base:forget(S102, 'T0'),
+ {{ok, [{user, ['T1', 'T2']}]}, S104} =
+ xref_base:variables(S103, [user]),
+ {ok, S105} = xref_base:forget(S104),
+ {{ok, [{user, []}]}, S106} = xref_base:variables(S105),
+ {{ok, [{predefined,_}]}, S107_0} =
+ xref_base:variables(S106, [predefined]),
+
+ {ok, S107_1} =
+ eval("TT := E, TT2 := V, TT1 := TT * TT", [E1,E2,E3], S107_0),
+ {{ok, [{user, ['TT', 'TT1', 'TT2']}]}, _} =
+ xref_base:variables(S107_1),
+ {ok, S107} = xref_base:forget(S107_1),
CopyDir = ?copydir,
- ?line Dir = fname(CopyDir,"lib_test"),
+ Dir = fname(CopyDir,"lib_test"),
Beam = fname(Dir, "lib1.beam"),
- ?line copy_file(fname(Dir, "lib1.erl"), Beam),
- ?line {ok, S108} =
- xref_base:set_library_path(S107, [Dir], [{verbose,false}]),
- ?line {{error, _, _}, _} = xref_base:variables(S108, [{verbose,false}]),
- ?line {ok, S109} = xref_base:set_library_path(S108, [], [{verbose,false}]),
+ copy_file(fname(Dir, "lib1.erl"), Beam),
+ {ok, S108} =
+ xref_base:set_library_path(S107, [Dir], [{verbose,false}]),
+ {{error, _, _}, _} = xref_base:variables(S108, [{verbose,false}]),
+ {ok, S109} = xref_base:set_library_path(S108, [], [{verbose,false}]),
- ?line Tabs = length(ets:all()),
+ Tabs = length(ets:all()),
- ?line {ok, S110} = eval("Eplus := closure E, TT := Eplus",
- 'closure()', S109),
- ?line {{ok, [{user, ['Eplus','TT']}]}, S111} = xref_base:variables(S110),
- ?line {ok, S112} = xref_base:forget(S111, ['TT','Eplus']),
- ?line true = Tabs =:= length(ets:all()),
+ {ok, S110} = eval("Eplus := closure E, TT := Eplus",
+ 'closure()', S109),
+ {{ok, [{user, ['Eplus','TT']}]}, S111} = xref_base:variables(S110),
+ {ok, S112} = xref_base:forget(S111, ['TT','Eplus']),
+ true = Tabs =:= length(ets:all()),
- ?line {ok, NS0} = eval("Eplus := closure E", 'closure()', S112),
- ?line {{ok, [{user, ['Eplus']}]}, NS} = xref_base:variables(NS0),
- ?line ok = xref_base:delete(NS),
- ?line true = Tabs =:= length(ets:all()),
+ {ok, NS0} = eval("Eplus := closure E", 'closure()', S112),
+ {{ok, [{user, ['Eplus']}]}, NS} = xref_base:variables(NS0),
+ ok = xref_base:delete(NS),
+ true = Tabs =:= length(ets:all()),
- ?line ok = file:delete(Beam),
+ ok = file:delete(Beam),
ok.
-unused_locals(suite) -> [];
-unused_locals(doc) -> ["OTP-5071. Too many unused functions."];
+%% OTP-5071. Too many unused functions.
unused_locals(Conf) when is_list(Conf) ->
Dir = ?copydir,
@@ -2324,8 +2264,8 @@ unused_locals(Conf) when is_list(Conf) ->
start(M, F, A) ->
spawn(M, F, A).
">>,
- ?line ok = file:write_file(File1, Test1),
- ?line {ok, a} = compile:file(File1, [debug_info,{outdir,Dir}]),
+ ok = file:write_file(File1, Test1),
+ {ok, a} = compile:file(File1, [debug_info,{outdir,Dir}]),
File2 = fname(Dir, "b.erl"),
MFile2 = fname(Dir, "b"),
@@ -2341,123 +2281,109 @@ unused_locals(Conf) when is_list(Conf) ->
apply(a, g, [X, Y]).
">>,
- ?line ok = file:write_file(File2, Test2),
- ?line {ok, b} = compile:file(File2, [debug_info,{outdir,Dir}]),
+ ok = file:write_file(File2, Test2),
+ {ok, b} = compile:file(File2, [debug_info,{outdir,Dir}]),
- ?line {ok, _} = xref:start(s),
- ?line {ok, a} = xref:add_module(s, MFile1),
- ?line {ok, b} = xref:add_module(s, MFile2),
- ?line {ok, []} = xref:analyse(s, locals_not_used),
- ?line ok = check_state(s),
- ?line xref:stop(s),
+ {ok, _} = xref:start(s),
+ {ok, a} = xref:add_module(s, MFile1),
+ {ok, b} = xref:add_module(s, MFile2),
+ {ok, []} = xref:analyse(s, locals_not_used),
+ ok = check_state(s),
+ xref:stop(s),
- ?line ok = file:delete(File1),
- ?line ok = file:delete(Beam1),
- ?line ok = file:delete(File2),
- ?line ok = file:delete(Beam2),
+ ok = file:delete(File1),
+ ok = file:delete(Beam1),
+ ok = file:delete(File2),
+ ok = file:delete(Beam2),
ok.
-format_error(suite) -> [];
-format_error(doc) -> ["Format error messages"];
+%% Format error messages
format_error(Conf) when is_list(Conf) ->
- ?line {ok, _Pid} = start(s),
- ?line ok = xref:set_default(s, [{verbose,false}, {warnings, false}]),
+ {ok, _Pid} = start(s),
+ ok = xref:set_default(s, [{verbose,false}, {warnings, false}]),
%% Parse error messages.
- ?line "Invalid regular expression \"add(\"" ++ _ =
- fstring(xref:q(s,'"add("')),
- ?line 'Invalid operator foo\n' =
- fatom(xref:q(s,'foo E')),
- ?line 'Invalid wildcard variable \'_Var\' (only \'_\' is allowed)\n'
- = fatom(xref:q(s,"module:function/_Var")),
- ?line 'Missing type of regular expression ".*"\n'
- = fatom(xref:q(s,'".*"')),
- ?line 'Type does not match structure of constant: \'M\' : Fun\n'
- = fatom(xref:q(s,"'M' : Fun")),
- ?line 'Type does not match structure of constant: ".*" : Fun\n'
- = fatom(xref:q(s,'".*" : Fun')),
- ?line 'Type does not match structure of constant: [m:f/1, m1:f2/3] : App\n'
- = fatom(xref:q(s,"[m:f/1,m1:f2/3] : App")),
- ?line 'Parse error on line 1: syntax error before: \'-\'\n' =
- fatom(xref:q(s,"E + -")),
- ?line "Parse error on line 1: unterminated atom starting with 'foo'\n"
- = flatten(xref:format_error(xref:q(s,"'foo"))),
- ?line 'Parse error at end of string: syntax error before: \n' =
- fatom(xref:q(s,"E +")),
- ?line 'Parse error on line 1: syntax error before: \'Lin\'\n' =
- fatom(xref:q(s,"Lin")),
+ "Invalid regular expression \"add(\"" ++ _ = fstring(xref:q(s,'"add("')),
+ 'Invalid operator foo\n' = fatom(xref:q(s,'foo E')),
+ 'Invalid wildcard variable \'_Var\' (only \'_\' is allowed)\n'
+ = fatom(xref:q(s,"module:function/_Var")),
+ 'Missing type of regular expression ".*"\n'
+ = fatom(xref:q(s,'".*"')),
+ 'Type does not match structure of constant: \'M\' : Fun\n'
+ = fatom(xref:q(s,"'M' : Fun")),
+ 'Type does not match structure of constant: ".*" : Fun\n'
+ = fatom(xref:q(s,'".*" : Fun')),
+ 'Type does not match structure of constant: [m:f/1, m1:f2/3] : App\n'
+ = fatom(xref:q(s,"[m:f/1,m1:f2/3] : App")),
+ 'Parse error on line 1: syntax error before: \'-\'\n'
+ = fatom(xref:q(s,"E + -")),
+ "Parse error on line 1: unterminated atom starting with 'foo'\n"
+ = flatten(xref:format_error(xref:q(s,"'foo"))),
+ 'Parse error at end of string: syntax error before: \n'
+ = fatom(xref:q(s,"E +")),
+ 'Parse error on line 1: syntax error before: \'Lin\'\n'
+ = fatom(xref:q(s,"Lin")),
%% Other messages
- ?line 'Variable \'QQ\' used before set\n' =
- fatom(xref:q(s,"QQ")),
- ?line 'Unknown constant a\n' =
- fatom(xref:q(s,"{a} of E")),
+ 'Variable \'QQ\' used before set\n' = fatom(xref:q(s,"QQ")),
+ 'Unknown constant a\n' = fatom(xref:q(s,"{a} of E")),
%% Testing xref_parser:t2s/1.
- ?line 'Variable assigned more than once: E := E + E\n' =
- fatom(xref:q(s,"E:=E + E")),
- ?line 'Variable assigned more than once: E = E + E\n' =
- fatom(xref:q(s,"E=E + E")),
- ?line "Operator applied to argument(s) of different or invalid type(s): "
- "E + V * V\n" =
- flatten(xref:format_error(xref:q(s,"E + (V * V)"))),
- ?line {error,xref_compiler,{type_error,"(V + V) * E"}} =
- xref:q(s,"(V + V) * E"),
- ?line "Type does not match structure of constant: [m:f/3 -> g:h/17] : "
- "App\n" =
- flatten(xref:format_error(xref:q(s,"[{{m,f,3},{g,h,17}}] : App"))),
- ?line 'Type does not match structure of constant: [m -> f, g -> h] : Fun\n'
- = fatom(xref:q(s,"[{m,f},g->h] : Fun")),
- ?line 'Type does not match structure of constant: {m, n, o} : Fun\n' =
- fatom(xref:q(s,"{m,n,o} : Fun")),
- ?line {error,xref_compiler,{type_error,"range (Lin) V"}} =
- xref:q(s,"range ((Lin) V)"),
- ?line {error,xref_compiler,{type_error,"condensation range E"}} =
- xref:q(s,"condensation (range E)"),
- ?line {error,xref_compiler,{type_error,"condensation (# E + # V)"}} =
- xref:q(s,"condensation (# E + # V)"),
- ?line {error,xref_compiler,{type_error,"range (# E + # E)"}} =
- xref:q(s,"range (#E + #E)"),
- ?line {error,xref_compiler,{type_error,"range (# E)"}} =
- xref:q(s,"range #E"), % Hm...
- ?line {error,xref_compiler,{type_error,"E + # E"}} =
- xref:q(s,"E + #E + #E"), % Hm...
- ?line {error,xref_compiler,{type_error,"V * E || V | V"}} =
- xref:q(s,"V * (E || V) | V"),
- ?line {error,xref_compiler,{type_error,"E || (E | V)"}} =
- xref:q(s,"V * E || (E | V)"),
- ?line {error,xref_compiler,{type_error,"E * \"m\" : Mod"}} =
- xref:q(s,'E * "m" : Mod'),
- ?line {error,xref_compiler,{type_error,"E * (\"m\":f/_ + m:\"f\"/3)"}} =
- xref:q(s,'E * ("m":f/_ + m:"f"/3)'),
-
- ?line xref:stop(s),
+ 'Variable assigned more than once: E := E + E\n' = fatom(xref:q(s,"E:=E + E")),
+ 'Variable assigned more than once: E = E + E\n' = fatom(xref:q(s,"E=E + E")),
+ "Operator applied to argument(s) of different or invalid type(s): "
+ "E + V * V\n" = flatten(xref:format_error(xref:q(s,"E + (V * V)"))),
+ {error,xref_compiler,{type_error,"(V + V) * E"}} = xref:q(s,"(V + V) * E"),
+ "Type does not match structure of constant: [m:f/3 -> g:h/17] : "
+ "App\n" = flatten(xref:format_error(xref:q(s,"[{{m,f,3},{g,h,17}}] : App"))),
+ 'Type does not match structure of constant: [m -> f, g -> h] : Fun\n'
+ = fatom(xref:q(s,"[{m,f},g->h] : Fun")),
+ 'Type does not match structure of constant: {m, n, o} : Fun\n' =
+ fatom(xref:q(s,"{m,n,o} : Fun")),
+ {error,xref_compiler,{type_error,"range (Lin) V"}} =
+ xref:q(s,"range ((Lin) V)"),
+ {error,xref_compiler,{type_error,"condensation range E"}} =
+ xref:q(s,"condensation (range E)"),
+ {error,xref_compiler,{type_error,"condensation (# E + # V)"}} =
+ xref:q(s,"condensation (# E + # V)"),
+ {error,xref_compiler,{type_error,"range (# E + # E)"}} =
+ xref:q(s,"range (#E + #E)"),
+ {error,xref_compiler,{type_error,"range (# E)"}} =
+ xref:q(s,"range #E"), % Hm...
+ {error,xref_compiler,{type_error,"E + # E"}} =
+ xref:q(s,"E + #E + #E"), % Hm...
+ {error,xref_compiler,{type_error,"V * E || V | V"}} =
+ xref:q(s,"V * (E || V) | V"),
+ {error,xref_compiler,{type_error,"E || (E | V)"}} =
+ xref:q(s,"V * E || (E | V)"),
+ {error,xref_compiler,{type_error,"E * \"m\" : Mod"}} =
+ xref:q(s,'E * "m" : Mod'),
+ {error,xref_compiler,{type_error,"E * (\"m\":f/_ + m:\"f\"/3)"}} =
+ xref:q(s,'E * ("m":f/_ + m:"f"/3)'),
+
+ xref:stop(s),
ok.
-otp_7423(suite) -> [];
-otp_7423(doc) -> ["OTP-7423. Xref scanner bug."];
+%% OTP-7423. Xref scanner bug.
otp_7423(Conf) when is_list(Conf) ->
- ?line {ok, _Pid} = start(s),
+ {ok, _Pid} = start(s),
S = "E | [compiler] : App || [{erlang,
size,
1}] : Fun",
- ?line {error,xref_compiler,{unknown_constant,"compiler"}} = xref:q(s,S),
- ?line xref:stop(s),
+ {error,xref_compiler,{unknown_constant,"compiler"}} = xref:q(s,S),
+ xref:stop(s),
ok.
-otp_7831(suite) -> [];
-otp_7831(doc) -> ["OTP-7831. Allow anonymous Xref processes."];
+%% OTP-7831. Allow anonymous Xref processes.
otp_7831(Conf) when is_list(Conf) ->
- ?line {ok, Pid1} = xref:start([]),
- ?line xref:stop(Pid1),
- ?line {ok, Pid2} = xref:start([{xref_mode, modules}]),
- ?line xref:stop(Pid2),
+ {ok, Pid1} = xref:start([]),
+ xref:stop(Pid1),
+ {ok, Pid2} = xref:start([{xref_mode, modules}]),
+ xref:stop(Pid2),
ok.
-otp_10192(suite) -> [];
-otp_10192(doc) ->
- ["OTP-10192. Allow filenames with character codes greater than 126."];
+%% OTP-10192. Allow filenames with character codes greater than 126.
otp_10192(Conf) when is_list(Conf) ->
PrivDir = ?privdir,
{ok, _Pid} = xref:start(s),
@@ -2481,59 +2407,59 @@ fname(Dir, Basename) ->
filename:join(Dir, Basename).
new() ->
- ?line {ok, S} = xref_base:new(),
+ {ok, S} = xref_base:new(),
S.
set_up(S) ->
- ?line {ok, S1} = xref_base:set_up(S, [{verbose, false}]),
+ {ok, S1} = xref_base:set_up(S, [{verbose, false}]),
S1.
eval(Query, E, S) ->
?format("------------------------------~n", []),
?format("Evaluating ~p~n", [Query]),
- ?line {Answer, NewState} = xref_base:q(S, Query, [{verbose, false}]),
+ {Answer, NewState} = xref_base:q(S, Query, [{verbose, false}]),
{Reply, Expected} =
- case Answer of
- {ok, R} when is_list(E) ->
- {unsetify(R), sort(E)};
- {ok, R} ->
- {unsetify(R), E};
- {error, _Module, Reason} ->
- {element(1, Reason), E}
- end,
+ case Answer of
+ {ok, R} when is_list(E) ->
+ {unsetify(R), sort(E)};
+ {ok, R} ->
+ {unsetify(R), E};
+ {error, _Module, Reason} ->
+ {element(1, Reason), E}
+ end,
if
- Reply =:= Expected ->
- ?format("As expected, got ~n~p~n", [Expected]),
- {ok, NewState};
- true ->
- ?format("Expected ~n~p~nbut got ~n~p~n", [Expected, Reply]),
- not_ok
+ Reply =:= Expected ->
+ ?format("As expected, got ~n~p~n", [Expected]),
+ {ok, NewState};
+ true ->
+ ?format("Expected ~n~p~nbut got ~n~p~n", [Expected, Reply]),
+ not_ok
end.
analyze(Query, E, S) ->
?format("------------------------------~n", []),
?format("Evaluating ~p~n", [Query]),
- ?line {{ok, L}, NewState} =
- xref_base:analyze(S, Query, [{verbose, false}]),
+ {{ok, L}, NewState} =
+ xref_base:analyze(S, Query, [{verbose, false}]),
case {unsetify(L), sort(E)} of
- {X,X} ->
- ?format("As was expected, got ~n~p~n", [X]),
- {ok, NewState};
- {_R,_X} ->
- ?format("Expected ~n~p~nbut got ~n~p~n", [_X, _R]),
- not_ok
+ {X,X} ->
+ ?format("As was expected, got ~n~p~n", [X]),
+ {ok, NewState};
+ {_R,_X} ->
+ ?format("Expected ~n~p~nbut got ~n~p~n", [_X, _R]),
+ not_ok
end.
unsetify(S) ->
case is_sofs_set(S) of
- true -> to_external(S);
- false -> S
+ true -> to_external(S);
+ false -> S
end.
%% Note: assumes S has been set up; the new state is not returned
eval(Query, S) ->
- ?line {{ok, Answer}, _NewState} =
- xref_base:q(S, Query, [{verbose, false}]),
+ {{ok, Answer}, _NewState} =
+ xref_base:q(S, Query, [{verbose, false}]),
unsetify(Answer).
add_module(S, XMod, DefAt, X, LCallAt, XCallAt, XC, LC) ->
@@ -2543,159 +2469,159 @@ add_module(S, XMod, DefAt, X, LCallAt, XCallAt, XC, LC) ->
Depr = {Depr0,DBad},
Data = {DefAt, LCallAt, XCallAt, LC, XC, X, Attr, Depr},
Unres = [],
- ?line {ok, _Module, _Bad, State} =
- xref_base:do_add_module(S, XMod, Unres, Data),
+ {ok, _Module, _Bad, State} =
+ xref_base:do_add_module(S, XMod, Unres, Data),
State.
add_application(S, XApp) ->
- ?line xref_base:do_add_application(S, XApp).
+ xref_base:do_add_application(S, XApp).
add_release(S, XRel) ->
- ?line xref_base:do_add_release(S, XRel).
+ xref_base:do_add_release(S, XRel).
remove_module(S, M) ->
- ?line xref_base:do_remove_module(S, M).
+ xref_base:do_remove_module(S, M).
info_tag(Info, Tag) ->
{value, {_Tag, Value}} = lists:keysearch(Tag, 1, Info),
Value.
make_ufile(FileName) ->
- ?line ok = file:write_file(FileName, term_to_binary(foo)),
- ?line hide_file(FileName).
+ ok = file:write_file(FileName, term_to_binary(foo)),
+ hide_file(FileName).
make_udir(Dir) ->
- ?line ok = file:make_dir(Dir),
- ?line hide_file(Dir).
+ ok = file:make_dir(Dir),
+ hide_file(Dir).
hide_file(FileName) ->
- ?line {ok, FileInfo} = file:read_file_info(FileName),
- ?line NewFileInfo = FileInfo#file_info{mode = 0},
- ?line ok = file:write_file_info(FileName, NewFileInfo).
+ {ok, FileInfo} = file:read_file_info(FileName),
+ NewFileInfo = FileInfo#file_info{mode = 0},
+ ok = file:write_file_info(FileName, NewFileInfo).
%% Note that S has to be set up before calling this checking function.
check_state(S) ->
- ?line Info = xref:info(S),
+ Info = xref:info(S),
- ?line modules_mode_check(S, Info),
+ modules_mode_check(S, Info),
case info(Info, mode) of
- modules ->
- ok;
- functions ->
- functions_mode_check(S, Info)
+ modules ->
+ ok;
+ functions ->
+ functions_mode_check(S, Info)
end.
%% The manual mentions some facts that should always hold.
%% Here they are again.
functions_mode_check(S, Info) ->
%% F = L + X,
- ?line {ok, F} = xref:q(S, "F"),
- ?line {ok, F} = xref:q(S, "L + X"),
+ {ok, F} = xref:q(S, "F"),
+ {ok, F} = xref:q(S, "L + X"),
%% V = X + L + B + U,
- ?line {ok, V} = xref:q(S, "V"),
- ?line {ok, V} = xref:q(S, "X + L + B + U"),
+ {ok, V} = xref:q(S, "V"),
+ {ok, V} = xref:q(S, "X + L + B + U"),
%% X, L, B and U are disjoint.
- ?line {ok, []} =
- xref:q(S, "X * L + X * B + X * U + L * B + L * U + B * U"),
+ {ok, []} =
+ xref:q(S, "X * L + X * B + X * U + L * B + L * U + B * U"),
%% V = UU + XU + LU,
- ?line {ok, V} = xref:q(S, "UU + XU + LU"),
+ {ok, V} = xref:q(S, "UU + XU + LU"),
%% E = LC + XC
- ?line {ok, E} = xref:q(S, "E"),
- ?line {ok, E} = xref:q(S, "LC + XC"),
+ {ok, E} = xref:q(S, "E"),
+ {ok, E} = xref:q(S, "LC + XC"),
%% U subset of XU,
- ?line {ok, []} = xref:q(S, "U - XU"),
+ {ok, []} = xref:q(S, "U - XU"),
%% LU = range LC
- ?line {ok, []} = xref:q(S, "(LU - range LC) + (range LC - LU)"),
+ {ok, []} = xref:q(S, "(LU - range LC) + (range LC - LU)"),
%% XU = range XC
- ?line {ok, []} = xref:q(S, "(XU - range XC) + (range XC - XU)"),
+ {ok, []} = xref:q(S, "(XU - range XC) + (range XC - XU)"),
%% LU subset F
- ?line {ok, []} = xref:q(S, "LU - F"),
+ {ok, []} = xref:q(S, "LU - F"),
%% UU subset F
- ?line {ok, []} = xref:q(S, "UU - F"),
+ {ok, []} = xref:q(S, "UU - F"),
%% ME = (Mod) E
- ?line {ok, ME} = xref:q(S, "ME"),
- ?line {ok, ME} = xref:q(S, "(Mod) E"),
+ {ok, ME} = xref:q(S, "ME"),
+ {ok, ME} = xref:q(S, "(Mod) E"),
%% AE = (App) E
- ?line {ok, AE} = xref:q(S, "AE"),
- ?line {ok, AE} = xref:q(S, "(App) E"),
+ {ok, AE} = xref:q(S, "AE"),
+ {ok, AE} = xref:q(S, "(App) E"),
%% RE = (Rel) E
- ?line {ok, RE} = xref:q(S, "RE"),
- ?line {ok, RE} = xref:q(S, "(Rel) E"),
+ {ok, RE} = xref:q(S, "RE"),
+ {ok, RE} = xref:q(S, "(Rel) E"),
%% (Mod) V subset of M
- ?line {ok, []} = xref:q(S, "(Mod) V - M"),
+ {ok, []} = xref:q(S, "(Mod) V - M"),
%% range UC subset of U
- ?line {ok, []} = xref:q(S, "range UC - U"),
+ {ok, []} = xref:q(S, "range UC - U"),
%% Some checks on the numbers returned by the info functions.
- ?line {Resolved, Unresolved} = info(Info, no_calls),
- ?line AllCalls = Resolved + Unresolved,
- ?line {ok, AllCalls} = xref:q(S, "# (XLin) E + # (LLin) E"),
+ {Resolved, Unresolved} = info(Info, no_calls),
+ AllCalls = Resolved + Unresolved,
+ {ok, AllCalls} = xref:q(S, "# (XLin) E + # (LLin) E"),
- ?line {Local, Exported} = info(Info, no_functions),
- ?line LX = Local+Exported,
- ?line {ok, LXs} = xref:q(S, 'Extra = _:module_info/"(0|1)" + LM,
- # (F - Extra)'),
- ?line true = LX =:= LXs,
+ {Local, Exported} = info(Info, no_functions),
+ LX = Local+Exported,
+ {ok, LXs} = xref:q(S, 'Extra = _:module_info/"(0|1)" + LM,
+ # (F - Extra)'),
+ true = LX =:= LXs,
- ?line {LocalCalls, ExternalCalls, UnresCalls} =
- info(Info, no_function_calls),
- ?line LEU = LocalCalls + ExternalCalls + UnresCalls,
- ?line {ok, LEU} = xref:q(S, "# LC + # XC"),
+ {LocalCalls, ExternalCalls, UnresCalls} =
+ info(Info, no_function_calls),
+ LEU = LocalCalls + ExternalCalls + UnresCalls,
+ {ok, LEU} = xref:q(S, "# LC + # XC"),
- ?line InterFunctionCalls = info(Info, no_inter_function_calls),
- ?line {ok, InterFunctionCalls} = xref:q(S, "# EE"),
+ InterFunctionCalls = info(Info, no_inter_function_calls),
+ {ok, InterFunctionCalls} = xref:q(S, "# EE"),
%% And some more checks on counters...
- ?line check_count(S),
+ check_count(S),
%% ... and more
- ?line {ok, []} = xref:q(S, "LM - X - U - B"),
+ {ok, []} = xref:q(S, "LM - X - U - B"),
ok.
modules_mode_check(S, Info) ->
%% B subset of XU,
- ?line {ok, []} = xref:q(S, "B - XU"),
+ {ok, []} = xref:q(S, "B - XU"),
%% M = AM + LM + UM
- ?line {ok, M} = xref:q(S, "M"),
- ?line {ok, M} = xref:q(S, "AM + LM + UM"),
+ {ok, M} = xref:q(S, "M"),
+ {ok, M} = xref:q(S, "AM + LM + UM"),
%% DF is a subset of X U B, etc.
- ?line {ok, []} = xref:q(S, "DF - X - B"),
- ?line {ok, []} = xref:q(S, "DF_3 - DF"),
- ?line {ok, []} = xref:q(S, "DF_2 - DF_3"),
- ?line {ok, []} = xref:q(S, "DF_1 - DF_2"),
+ {ok, []} = xref:q(S, "DF - X - B"),
+ {ok, []} = xref:q(S, "DF_3 - DF"),
+ {ok, []} = xref:q(S, "DF_2 - DF_3"),
+ {ok, []} = xref:q(S, "DF_1 - DF_2"),
%% AM, LM and UM are disjoint.
- ?line {ok, []} = xref:q(S, "AM * LM + AM * UM + LM * UM"),
+ {ok, []} = xref:q(S, "AM * LM + AM * UM + LM * UM"),
%% (App) M subset of A
- ?line {ok, []} = xref:q(S, "(App) M - A"),
+ {ok, []} = xref:q(S, "(App) M - A"),
- ?line AM = info(Info, no_analyzed_modules),
- ?line {ok, AM} = xref:q(S, "# AM"),
+ AM = info(Info, no_analyzed_modules),
+ {ok, AM} = xref:q(S, "# AM"),
- ?line A = info(Info, no_applications),
- ?line {ok, A} = xref:q(S, "# A"),
+ A = info(Info, no_applications),
+ {ok, A} = xref:q(S, "# A"),
- ?line NoR = info(Info, no_releases),
- ?line {ok, NoR} = xref:q(S, "# R"),
+ NoR = info(Info, no_releases),
+ {ok, NoR} = xref:q(S, "# R"),
ok.
@@ -2707,7 +2633,7 @@ check_count(S) ->
{ok, M} = xref:q(S, 'AM'),
{ok, _} = xref:q(S,
- "Extra := _:module_info/\"(0|1)\" + LM"),
+ "Extra := _:module_info/\"(0|1)\" + LM"),
%% info/1:
{ok, NoR} = xref:q(S, '# R'),
@@ -2742,7 +2668,7 @@ check_count(S) ->
info_module([M | Ms], S) ->
{ok, NoCalls} = per_module("T = (E | ~p : Mod), # (XLin) T + # (LLin) T",
- M, S),
+ M, S),
{ok, NoFunCalls} = per_module("# (E | ~p : Mod)", M, S),
{ok, NoXCalls} = per_module("# (XC | ~p : Mod)", M, S),
{ok, NoLCalls} = per_module("# (LC | ~p : Mod)", M, S),
@@ -2782,40 +2708,38 @@ fstring(R) ->
flatten(xref:format_error(R)).
start(Server) ->
- ?line case xref:start(Server) of
- {error, {already_started, _Pid}} ->
- ?line xref:stop(Server),
- ?line xref:start(Server);
- R -> R
- end.
+ case xref:start(Server) of
+ {error, {already_started, _Pid}} ->
+ xref:stop(Server),
+ xref:start(Server);
+ R -> R
+ end.
add_erts_code_path(KernelPath) ->
VersionDirs =
- filelib:is_dir(
- filename:join(
- [code:lib_dir(),
- lists:flatten(
- ["kernel-",
- [X ||
- {kernel,_,X} <-
- application_controller:which_applications()]])])),
+ filelib:is_dir(
+ filename:join(
+ [code:lib_dir(),
+ lists:flatten(
+ ["kernel-",
+ [X ||
+ {kernel,_,X} <-
+ application_controller:which_applications()]])])),
case VersionDirs of
- true ->
- case code:lib_dir(erts) of
- String when is_list(String) ->
- [KernelPath, fname(String,"ebin")];
- _Other1 ->
- [KernelPath]
- end;
- false ->
- % Clearcase?
- PrelPath = filename:join([code:lib_dir(),"..","erts","preloaded"]),
- case filelib:is_dir(PrelPath) of
- true ->
- [KernelPath, fname(PrelPath,"ebin")];
- false ->
- [KernelPath]
- end
+ true ->
+ case code:lib_dir(erts) of
+ String when is_list(String) ->
+ [KernelPath, fname(String,"ebin")];
+ _Other1 ->
+ [KernelPath]
+ end;
+ false ->
+ % Clearcase?
+ PrelPath = filename:join([code:lib_dir(),"..","erts","preloaded"]),
+ case filelib:is_dir(PrelPath) of
+ true ->
+ [KernelPath, fname(PrelPath,"ebin")];
+ false ->
+ [KernelPath]
+ end
end.
-
-
diff --git a/lib/typer/Makefile b/lib/typer/Makefile
index dee9805005..bd1b6458a8 100644
--- a/lib/typer/Makefile
+++ b/lib/typer/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2009. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/typer/doc/Makefile b/lib/typer/doc/Makefile
index 822f8f5d03..1015ca78eb 100644
--- a/lib/typer/doc/Makefile
+++ b/lib/typer/doc/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2012. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/typer/doc/src/Makefile b/lib/typer/doc/src/Makefile
index 161fbd0752..3724a2e4d1 100644
--- a/lib/typer/doc/src/Makefile
+++ b/lib/typer/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2012. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/typer/doc/src/book.xml b/lib/typer/doc/src/book.xml
index fd2bccc0a9..20da44ae04 100644
--- a/lib/typer/doc/src/book.xml
+++ b/lib/typer/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/typer/doc/src/notes.xml b/lib/typer/doc/src/notes.xml
index 21a2a6d597..d6d545d0e4 100644
--- a/lib/typer/doc/src/notes.xml
+++ b/lib/typer/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2014</year>
+ <year>2014</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/typer/doc/src/part_notes.xml b/lib/typer/doc/src/part_notes.xml
index 63086f82c5..3234f0903e 100644
--- a/lib/typer/doc/src/part_notes.xml
+++ b/lib/typer/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2006</year><year>2013</year>
+ <year>2006</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/typer/doc/src/ref_man.xml b/lib/typer/doc/src/ref_man.xml
index f50d79b385..c793207443 100644
--- a/lib/typer/doc/src/ref_man.xml
+++ b/lib/typer/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2014</year>
+ <year>2014</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/typer/doc/src/typer_app.xml b/lib/typer/doc/src/typer_app.xml
index 2618f4a380..d52df5d0da 100644
--- a/lib/typer/doc/src/typer_app.xml
+++ b/lib/typer/doc/src/typer_app.xml
@@ -4,7 +4,7 @@
<appref>
<header>
<copyright>
- <year>2014</year>
+ <year>2014</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/typer/src/Makefile b/lib/typer/src/Makefile
index 620ca21827..6c5d8b0726 100644
--- a/lib/typer/src/Makefile
+++ b/lib/typer/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2012. All Rights Reserved.
+# Copyright Ericsson AB 2006-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/typer/src/typer.appup.src b/lib/typer/src/typer.appup.src
index 46132dba48..3b7464a97c 100644
--- a/lib/typer/src/typer.appup.src
+++ b/lib/typer/src/typer.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/Makefile b/lib/wx/Makefile
index b3b7aaa8aa..2397950925 100644
--- a/lib/wx/Makefile
+++ b/lib/wx/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2012. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/wx/api_gen/Makefile b/lib/wx/api_gen/Makefile
index 3fa8f1feee..e3580de2d5 100644
--- a/lib/wx/api_gen/Makefile
+++ b/lib/wx/api_gen/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2014. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/wx/api_gen/gen_util.erl b/lib/wx/api_gen/gen_util.erl
index ff245a6359..cd42ad2d96 100644
--- a/lib/wx/api_gen/gen_util.erl
+++ b/lib/wx/api_gen/gen_util.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/api_gen/gl_gen.erl b/lib/wx/api_gen/gl_gen.erl
index ab8f842d31..0473b7d771 100644
--- a/lib/wx/api_gen/gl_gen.erl
+++ b/lib/wx/api_gen/gl_gen.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/api_gen/gl_gen_c.erl b/lib/wx/api_gen/gl_gen_c.erl
index f06772dbb2..c6d4f3a520 100644
--- a/lib/wx/api_gen/gl_gen_c.erl
+++ b/lib/wx/api_gen/gl_gen_c.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/api_gen/gl_gen_erl.erl b/lib/wx/api_gen/gl_gen_erl.erl
index 84e9600bc0..c96df4f8f2 100644
--- a/lib/wx/api_gen/gl_gen_erl.erl
+++ b/lib/wx/api_gen/gl_gen_erl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/api_gen/gl_scan_doc.erl b/lib/wx/api_gen/gl_scan_doc.erl
index d8bad02abf..0a1c25ae13 100644
--- a/lib/wx/api_gen/gl_scan_doc.erl
+++ b/lib/wx/api_gen/gl_scan_doc.erl
@@ -2,7 +2,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2012-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2012-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/api_gen/wx_extra/wxEvtHandler.c_src b/lib/wx/api_gen/wx_extra/wxEvtHandler.c_src
index 08fef1c2ff..b9cb4f08cc 100644
--- a/lib/wx/api_gen/wx_extra/wxEvtHandler.c_src
+++ b/lib/wx/api_gen/wx_extra/wxEvtHandler.c_src
@@ -43,7 +43,7 @@ case 101: { // wxEvtHandler::Disconnect
int eventType = wxeEventTypeFromAtom(bp); bp += *eventTypeLen;
if(eventType > 0) {
if(recurse_level > 1) {
- delayed_delete->Append(Ecmd.Save());
+ delayed_delete->Append(Ecmd.Save(op));
} else {
bool Result = This->Disconnect((int) *winid,(int) *lastId,eventType,
(wxObjectEventFunction)(wxEventFunction)
diff --git a/lib/wx/api_gen/wx_extra/wxListCtrl.c_src b/lib/wx/api_gen/wx_extra/wxListCtrl.c_src
index 545d5c1c0d..7bf9a481de 100644
--- a/lib/wx/api_gen/wx_extra/wxListCtrl.c_src
+++ b/lib/wx/api_gen/wx_extra/wxListCtrl.c_src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/api_gen/wx_extra/wxListCtrl.erl b/lib/wx/api_gen/wx_extra/wxListCtrl.erl
index a2ce547f00..acdb69fdeb 100644
--- a/lib/wx/api_gen/wx_extra/wxListCtrl.erl
+++ b/lib/wx/api_gen/wx_extra/wxListCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/api_gen/wx_extra/wxPrintout.erl b/lib/wx/api_gen/wx_extra/wxPrintout.erl
index 0552b5aa1a..ba42c737b4 100644
--- a/lib/wx/api_gen/wx_extra/wxPrintout.erl
+++ b/lib/wx/api_gen/wx_extra/wxPrintout.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/api_gen/wx_extra/wxTreeCtrl.c_src b/lib/wx/api_gen/wx_extra/wxTreeCtrl.c_src
index a82ebcc46b..a21f74e798 100644
--- a/lib/wx/api_gen/wx_extra/wxTreeCtrl.c_src
+++ b/lib/wx/api_gen/wx_extra/wxTreeCtrl.c_src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/api_gen/wx_extra/wxXmlResource.erl b/lib/wx/api_gen/wx_extra/wxXmlResource.erl
index 2100bbd010..7700e2333e 100644
--- a/lib/wx/api_gen/wx_extra/wxXmlResource.erl
+++ b/lib/wx/api_gen/wx_extra/wxXmlResource.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/api_gen/wx_gen.erl b/lib/wx/api_gen/wx_gen.erl
index ec2c35cc0e..cfae2197f8 100644
--- a/lib/wx/api_gen/wx_gen.erl
+++ b/lib/wx/api_gen/wx_gen.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/api_gen/wx_gen.hrl b/lib/wx/api_gen/wx_gen.hrl
index 6aa4ed3796..4b7a7f3bb8 100644
--- a/lib/wx/api_gen/wx_gen.hrl
+++ b/lib/wx/api_gen/wx_gen.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl
index 71b2038c56..55c179142d 100644
--- a/lib/wx/api_gen/wx_gen_cpp.erl
+++ b/lib/wx/api_gen/wx_gen_cpp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -195,11 +195,13 @@ gen_funcs(Defs) ->
w("void WxeApp::wxe_dispatch(wxeCommand& Ecmd)~n{~n"),
w(" char * bp = Ecmd.buffer;~n"),
+ w(" int op = Ecmd.op;~n"),
+ w(" Ecmd.op = -1;~n"),
w(" wxeMemEnv *memenv = getMemEnv(Ecmd.port);~n"),
%% w(" wxMBConvUTF32 UTFconverter;~n"),
- w(" wxeReturn rt = wxeReturn(WXE_DRV_PORT, Ecmd.caller, true);~n"),
+ w(" wxeReturn rt = wxeReturn(WXE_DRV_PORT, Ecmd.caller, true);~n"),
w(" try {~n"),
- w(" switch (Ecmd.op)~n{~n"),
+ w(" switch (op)~n{~n"),
%% w(" case WXE_CREATE_PORT:~n", []),
%% w(" { newMemEnv(Ecmd.port); } break;~n", []),
%% w(" case WXE_REMOVE_PORT:~n", []),
@@ -209,7 +211,7 @@ gen_funcs(Defs) ->
w(" wxeRefData *refd = getRefData(This);~n"),
w(" if(This && refd) {~n"),
w(" if(recurse_level > 1 && refd->type != 4) {~n"),
- w(" delayed_delete->Append(Ecmd.Save());~n"),
+ w(" delayed_delete->Append(Ecmd.Save(op));~n"),
w(" } else {~n"),
w(" delete_object(This, refd);~n"),
w(" ((WxeApp *) wxTheApp)->clearPtr(This);}~n"),
@@ -228,7 +230,7 @@ gen_funcs(Defs) ->
w(" default: {~n"),
w(" wxeReturn error = wxeReturn(WXE_DRV_PORT, Ecmd.caller, false);"),
w(" error.addAtom(\"_wxe_error_\");~n"),
- w(" error.addInt((int) Ecmd.op);~n"),
+ w(" error.addInt((int) op);~n"),
w(" error.addAtom(\"not_supported\");~n"),
w(" error.addTupleCount(3);~n"),
w(" error.send();~n"),
@@ -239,7 +241,7 @@ gen_funcs(Defs) ->
w("} catch (wxe_badarg badarg) { // try~n"),
w(" wxeReturn error = wxeReturn(WXE_DRV_PORT, Ecmd.caller, false);"),
w(" error.addAtom(\"_wxe_error_\");~n"),
- w(" error.addInt((int) Ecmd.op);~n"),
+ w(" error.addInt((int) op);~n"),
w(" error.addAtom(\"badarg\");~n"),
w(" error.addInt((int) badarg.ref);~n"),
w(" error.addTupleCount(2);~n"),
diff --git a/lib/wx/api_gen/wx_gen_erl.erl b/lib/wx/api_gen/wx_gen_erl.erl
index c28b9238dc..2e14fd272d 100644
--- a/lib/wx/api_gen/wx_gen_erl.erl
+++ b/lib/wx/api_gen/wx_gen_erl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1089,7 +1089,7 @@ gen_enums_ints() ->
%% open_write("../include/wx.hrl"), opened in gen_event_recs
w("~n%% Hardcoded Records~n", []),
w("-record(wxMouseState, {x :: integer(), y :: integer(),~n"
- " leftDown :: boolean(), middleDown :: boolean, rightDown :: boolean, ~n"
+ " leftDown :: boolean(), middleDown :: boolean(), rightDown :: boolean(), ~n"
" controlDown :: boolean(), shiftDown :: boolean(),~n"
" altDown :: boolean(), metaDown :: boolean(), cmdDown :: boolean()~n"
" }).~n", []),
diff --git a/lib/wx/api_gen/wxapi.conf b/lib/wx/api_gen/wxapi.conf
index b8458e901b..786e536f93 100644
--- a/lib/wx/api_gen/wxapi.conf
+++ b/lib/wx/api_gen/wxapi.conf
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -802,9 +802,9 @@
'CanRedo','CanUndo','Copy','Cut','GetInsertionPoint','GetLastPosition',
'GetValue','Paste','Redo','Replace','Remove','SetInsertionPoint',
'SetInsertionPointEnd','SetSelection','SetValue','Undo']}.
-{class, wxGauge, wxControl, [],
- ['wxGauge','~wxGauge','Create','GetBezelFace','GetRange','GetShadowWidth',
- 'GetValue','IsVertical','SetBezelFace','SetRange','SetShadowWidth','SetValue',
+{class, wxGauge, wxControl, [],
+ ['wxGauge','~wxGauge','Create','GetRange',
+ 'GetValue','IsVertical','SetRange','SetValue',
'Pulse']}.
{class, wxGenericDirCtrl, wxControl, [],
['wxGenericDirCtrl','~wxGenericDirCtrl','Create','Init','CollapseTree',
@@ -844,7 +844,7 @@
'GetItemSpacing','GetItemState',
'GetItemText','GetItemTextColour',
'GetNextItem','GetSelectedItemCount','GetTextColour','GetTopItem',
- 'GetViewRect',{'HitTest',[{"pSubItem",nowhere}, {"flags", in}]},
+ 'GetViewRect',{'HitTest',[{"pSubItem",out}]},
'InsertColumn','InsertItem',
%%'OnGetItemAttr', 'OnGetItemImage','OnGetItemText',
'RefreshItem','RefreshItems','ScrollList',
diff --git a/lib/wx/c_src/Makefile.in b/lib/wx/c_src/Makefile.in
index 09e3390846..daa8afce83 100644
--- a/lib/wx/c_src/Makefile.in
+++ b/lib/wx/c_src/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2014. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/egl_impl.cpp b/lib/wx/c_src/egl_impl.cpp
index 6c7c26f284..61e05ee6f1 100644
--- a/lib/wx/c_src/egl_impl.cpp
+++ b/lib/wx/c_src/egl_impl.cpp
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/egl_impl.h b/lib/wx/c_src/egl_impl.h
index 8562ae7d96..719b4926db 100644
--- a/lib/wx/c_src/egl_impl.h
+++ b/lib/wx/c_src/egl_impl.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/gen/gl_fdefs.h b/lib/wx/c_src/gen/gl_fdefs.h
index 3a8ac7287e..6719a288b8 100644
--- a/lib/wx/c_src/gen/gl_fdefs.h
+++ b/lib/wx/c_src/gen/gl_fdefs.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/gen/gl_finit.h b/lib/wx/c_src/gen/gl_finit.h
index 53e6666c67..297a26d4c7 100644
--- a/lib/wx/c_src/gen/gl_finit.h
+++ b/lib/wx/c_src/gen/gl_finit.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/gen/gl_funcs.cpp b/lib/wx/c_src/gen/gl_funcs.cpp
index 1abd601da9..4dd3ad44ef 100644
--- a/lib/wx/c_src/gen/gl_funcs.cpp
+++ b/lib/wx/c_src/gen/gl_funcs.cpp
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/gen/glu_finit.h b/lib/wx/c_src/gen/glu_finit.h
index 5685cc633a..afd16d781f 100644
--- a/lib/wx/c_src/gen/glu_finit.h
+++ b/lib/wx/c_src/gen/glu_finit.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/gen/wxe_funcs.cpp b/lib/wx/c_src/gen/wxe_funcs.cpp
index 03b0baf875..942baf7c7f 100644
--- a/lib/wx/c_src/gen/wxe_funcs.cpp
+++ b/lib/wx/c_src/gen/wxe_funcs.cpp
@@ -40,17 +40,19 @@
void WxeApp::wxe_dispatch(wxeCommand& Ecmd)
{
char * bp = Ecmd.buffer;
+ int op = Ecmd.op;
+ Ecmd.op = -1;
wxeMemEnv *memenv = getMemEnv(Ecmd.port);
- wxeReturn rt = wxeReturn(WXE_DRV_PORT, Ecmd.caller, true);
+ wxeReturn rt = wxeReturn(WXE_DRV_PORT, Ecmd.caller, true);
try {
- switch (Ecmd.op)
+ switch (op)
{
case DESTROY_OBJECT: {
void *This = getPtr(bp,memenv);
wxeRefData *refd = getRefData(This);
if(This && refd) {
if(recurse_level > 1 && refd->type != 4) {
- delayed_delete->Append(Ecmd.Save());
+ delayed_delete->Append(Ecmd.Save(op));
} else {
delete_object(This, refd);
((WxeApp *) wxTheApp)->clearPtr(This);}
@@ -114,7 +116,7 @@ case 101: { // wxEvtHandler::Disconnect
int eventType = wxeEventTypeFromAtom(bp); bp += *eventTypeLen;
if(eventType > 0) {
if(recurse_level > 1) {
- delayed_delete->Append(Ecmd.Save());
+ delayed_delete->Append(Ecmd.Save(op));
} else {
bool Result = This->Disconnect((int) *winid,(int) *lastId,eventType,
(wxObjectEventFunction)(wxEventFunction)
@@ -14628,13 +14630,6 @@ validator = (wxValidator *) getPtr(bp,memenv); bp += 4;
rt.addBool(Result);
break;
}
-case wxGauge_GetBezelFace: { // wxGauge::GetBezelFace
- wxGauge *This = (wxGauge *) getPtr(bp,memenv); bp += 4;
- if(!This) throw wxe_badarg(0);
- int Result = This->GetBezelFace();
- rt.addInt(Result);
- break;
-}
case wxGauge_GetRange: { // wxGauge::GetRange
wxGauge *This = (wxGauge *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
@@ -14642,13 +14637,6 @@ case wxGauge_GetRange: { // wxGauge::GetRange
rt.addInt(Result);
break;
}
-case wxGauge_GetShadowWidth: { // wxGauge::GetShadowWidth
- wxGauge *This = (wxGauge *) getPtr(bp,memenv); bp += 4;
- if(!This) throw wxe_badarg(0);
- int Result = This->GetShadowWidth();
- rt.addInt(Result);
- break;
-}
case wxGauge_GetValue: { // wxGauge::GetValue
wxGauge *This = (wxGauge *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
@@ -14663,13 +14651,6 @@ case wxGauge_IsVertical: { // wxGauge::IsVertical
rt.addBool(Result);
break;
}
-case wxGauge_SetBezelFace: { // wxGauge::SetBezelFace
- wxGauge *This = (wxGauge *) getPtr(bp,memenv); bp += 4;
- int * w = (int *) bp; bp += 4;
- if(!This) throw wxe_badarg(0);
- This->SetBezelFace(*w);
- break;
-}
case wxGauge_SetRange: { // wxGauge::SetRange
wxGauge *This = (wxGauge *) getPtr(bp,memenv); bp += 4;
int * r = (int *) bp; bp += 4;
@@ -14677,13 +14658,6 @@ case wxGauge_SetRange: { // wxGauge::SetRange
This->SetRange(*r);
break;
}
-case wxGauge_SetShadowWidth: { // wxGauge::SetShadowWidth
- wxGauge *This = (wxGauge *) getPtr(bp,memenv); bp += 4;
- int * w = (int *) bp; bp += 4;
- if(!This) throw wxe_badarg(0);
- This->SetShadowWidth(*w);
- break;
-}
case wxGauge_SetValue: { // wxGauge::SetValue
wxGauge *This = (wxGauge *) getPtr(bp,memenv); bp += 4;
int * pos = (int *) bp; bp += 4;
@@ -15631,14 +15605,18 @@ case wxListCtrl_GetViewRect: { // wxListCtrl::GetViewRect
break;
}
case wxListCtrl_HitTest: { // wxListCtrl::HitTest
+ int flags;
+ long pSubItem;
wxListCtrl *This = (wxListCtrl *) getPtr(bp,memenv); bp += 4;
int * pointX = (int *) bp; bp += 4;
int * pointY = (int *) bp; bp += 4;
wxPoint point = wxPoint(*pointX,*pointY);
- int * flags = (int *) bp; bp += 4;
if(!This) throw wxe_badarg(0);
- long Result = This->HitTest(point,*flags);
+ long Result = This->HitTest(point,flags,&pSubItem);
rt.addInt(Result);
+ rt.addInt(flags);
+ rt.addInt(pSubItem);
+ rt.addTupleCount(3);
break;
}
case wxListCtrl_InsertColumn_2: { // wxListCtrl::InsertColumn
@@ -32073,7 +32051,7 @@ case wxDCOverlay_Clear: { // wxDCOverlay::Clear
}
default: {
wxeReturn error = wxeReturn(WXE_DRV_PORT, Ecmd.caller, false); error.addAtom("_wxe_error_");
- error.addInt((int) Ecmd.op);
+ error.addInt((int) op);
error.addAtom("not_supported");
error.addTupleCount(3);
error.send();
@@ -32083,7 +32061,7 @@ case wxDCOverlay_Clear: { // wxDCOverlay::Clear
rt.send();
} catch (wxe_badarg badarg) { // try
wxeReturn error = wxeReturn(WXE_DRV_PORT, Ecmd.caller, false); error.addAtom("_wxe_error_");
- error.addInt((int) Ecmd.op);
+ error.addInt((int) op);
error.addAtom("badarg");
error.addInt((int) badarg.ref);
error.addTupleCount(2);
diff --git a/lib/wx/c_src/gen/wxe_macros.h b/lib/wx/c_src/gen/wxe_macros.h
index 0d3b79b7f9..82b39b49cd 100644
--- a/lib/wx/c_src/gen/wxe_macros.h
+++ b/lib/wx/c_src/gen/wxe_macros.h
@@ -1506,1924 +1506,1920 @@
#define wxGauge_new_0 1602
#define wxGauge_new_4 1603
#define wxGauge_Create 1604
-#define wxGauge_GetBezelFace 1605
-#define wxGauge_GetRange 1606
-#define wxGauge_GetShadowWidth 1607
-#define wxGauge_GetValue 1608
-#define wxGauge_IsVertical 1609
-#define wxGauge_SetBezelFace 1610
-#define wxGauge_SetRange 1611
-#define wxGauge_SetShadowWidth 1612
-#define wxGauge_SetValue 1613
-#define wxGauge_Pulse 1614
-#define wxGauge_destroy 1615
-#define wxGenericDirCtrl_new_0 1616
-#define wxGenericDirCtrl_new_2 1617
-#define wxGenericDirCtrl_destruct 1618
-#define wxGenericDirCtrl_Create 1619
-#define wxGenericDirCtrl_Init 1620
-#define wxGenericDirCtrl_CollapseTree 1621
-#define wxGenericDirCtrl_ExpandPath 1622
-#define wxGenericDirCtrl_GetDefaultPath 1623
-#define wxGenericDirCtrl_GetPath 1624
-#define wxGenericDirCtrl_GetFilePath 1625
-#define wxGenericDirCtrl_GetFilter 1626
-#define wxGenericDirCtrl_GetFilterIndex 1627
-#define wxGenericDirCtrl_GetRootId 1628
-#define wxGenericDirCtrl_GetTreeCtrl 1629
-#define wxGenericDirCtrl_ReCreateTree 1630
-#define wxGenericDirCtrl_SetDefaultPath 1631
-#define wxGenericDirCtrl_SetFilter 1632
-#define wxGenericDirCtrl_SetFilterIndex 1633
-#define wxGenericDirCtrl_SetPath 1634
-#define wxStaticBox_new_4 1636
-#define wxStaticBox_new_0 1637
-#define wxStaticBox_Create 1638
-#define wxStaticBox_destroy 1639
-#define wxStaticLine_new_2 1641
-#define wxStaticLine_new_0 1642
-#define wxStaticLine_Create 1643
-#define wxStaticLine_IsVertical 1644
-#define wxStaticLine_GetDefaultSize 1645
-#define wxStaticLine_destroy 1646
-#define wxListBox_new_3 1649
-#define wxListBox_new_0 1650
-#define wxListBox_destruct 1652
-#define wxListBox_Create 1654
-#define wxListBox_Deselect 1655
-#define wxListBox_GetSelections 1656
-#define wxListBox_InsertItems 1657
-#define wxListBox_IsSelected 1658
-#define wxListBox_Set 1659
-#define wxListBox_HitTest 1660
-#define wxListBox_SetFirstItem_1_0 1661
-#define wxListBox_SetFirstItem_1_1 1662
-#define wxListCtrl_new_0 1663
-#define wxListCtrl_new_2 1664
-#define wxListCtrl_Arrange 1665
-#define wxListCtrl_AssignImageList 1666
-#define wxListCtrl_ClearAll 1667
-#define wxListCtrl_Create 1668
-#define wxListCtrl_DeleteAllItems 1669
-#define wxListCtrl_DeleteColumn 1670
-#define wxListCtrl_DeleteItem 1671
-#define wxListCtrl_EditLabel 1672
-#define wxListCtrl_EnsureVisible 1673
-#define wxListCtrl_FindItem_3_0 1674
-#define wxListCtrl_FindItem_3_1 1675
-#define wxListCtrl_GetColumn 1676
-#define wxListCtrl_GetColumnCount 1677
-#define wxListCtrl_GetColumnWidth 1678
-#define wxListCtrl_GetCountPerPage 1679
-#define wxListCtrl_GetEditControl 1680
-#define wxListCtrl_GetImageList 1681
-#define wxListCtrl_GetItem 1682
-#define wxListCtrl_GetItemBackgroundColour 1683
-#define wxListCtrl_GetItemCount 1684
-#define wxListCtrl_GetItemData 1685
-#define wxListCtrl_GetItemFont 1686
-#define wxListCtrl_GetItemPosition 1687
-#define wxListCtrl_GetItemRect 1688
-#define wxListCtrl_GetItemSpacing 1689
-#define wxListCtrl_GetItemState 1690
-#define wxListCtrl_GetItemText 1691
-#define wxListCtrl_GetItemTextColour 1692
-#define wxListCtrl_GetNextItem 1693
-#define wxListCtrl_GetSelectedItemCount 1694
-#define wxListCtrl_GetTextColour 1695
-#define wxListCtrl_GetTopItem 1696
-#define wxListCtrl_GetViewRect 1697
-#define wxListCtrl_HitTest 1698
-#define wxListCtrl_InsertColumn_2 1699
-#define wxListCtrl_InsertColumn_3 1700
-#define wxListCtrl_InsertItem_1 1701
-#define wxListCtrl_InsertItem_2_1 1702
-#define wxListCtrl_InsertItem_2_0 1703
-#define wxListCtrl_InsertItem_3 1704
-#define wxListCtrl_RefreshItem 1705
-#define wxListCtrl_RefreshItems 1706
-#define wxListCtrl_ScrollList 1707
-#define wxListCtrl_SetBackgroundColour 1708
-#define wxListCtrl_SetColumn 1709
-#define wxListCtrl_SetColumnWidth 1710
-#define wxListCtrl_SetImageList 1711
-#define wxListCtrl_SetItem_1 1712
-#define wxListCtrl_SetItem_4 1713
-#define wxListCtrl_SetItemBackgroundColour 1714
-#define wxListCtrl_SetItemCount 1715
-#define wxListCtrl_SetItemData 1716
-#define wxListCtrl_SetItemFont 1717
-#define wxListCtrl_SetItemImage 1718
-#define wxListCtrl_SetItemColumnImage 1719
-#define wxListCtrl_SetItemPosition 1720
-#define wxListCtrl_SetItemState 1721
-#define wxListCtrl_SetItemText 1722
-#define wxListCtrl_SetItemTextColour 1723
-#define wxListCtrl_SetSingleStyle 1724
-#define wxListCtrl_SetTextColour 1725
-#define wxListCtrl_SetWindowStyleFlag 1726
-#define wxListCtrl_SortItems 1727
-#define wxListCtrl_destroy 1728
-#define wxListView_ClearColumnImage 1729
-#define wxListView_Focus 1730
-#define wxListView_GetFirstSelected 1731
-#define wxListView_GetFocusedItem 1732
-#define wxListView_GetNextSelected 1733
-#define wxListView_IsSelected 1734
-#define wxListView_Select 1735
-#define wxListView_SetColumnImage 1736
-#define wxListItem_new_0 1737
-#define wxListItem_new_1 1738
-#define wxListItem_destruct 1739
-#define wxListItem_Clear 1740
-#define wxListItem_GetAlign 1741
-#define wxListItem_GetBackgroundColour 1742
-#define wxListItem_GetColumn 1743
-#define wxListItem_GetFont 1744
-#define wxListItem_GetId 1745
-#define wxListItem_GetImage 1746
-#define wxListItem_GetMask 1747
-#define wxListItem_GetState 1748
-#define wxListItem_GetText 1749
-#define wxListItem_GetTextColour 1750
-#define wxListItem_GetWidth 1751
-#define wxListItem_SetAlign 1752
-#define wxListItem_SetBackgroundColour 1753
-#define wxListItem_SetColumn 1754
-#define wxListItem_SetFont 1755
-#define wxListItem_SetId 1756
-#define wxListItem_SetImage 1757
-#define wxListItem_SetMask 1758
-#define wxListItem_SetState 1759
-#define wxListItem_SetStateMask 1760
-#define wxListItem_SetText 1761
-#define wxListItem_SetTextColour 1762
-#define wxListItem_SetWidth 1763
-#define wxListItemAttr_new_0 1764
-#define wxListItemAttr_new_3 1765
-#define wxListItemAttr_GetBackgroundColour 1766
-#define wxListItemAttr_GetFont 1767
-#define wxListItemAttr_GetTextColour 1768
-#define wxListItemAttr_HasBackgroundColour 1769
-#define wxListItemAttr_HasFont 1770
-#define wxListItemAttr_HasTextColour 1771
-#define wxListItemAttr_SetBackgroundColour 1772
-#define wxListItemAttr_SetFont 1773
-#define wxListItemAttr_SetTextColour 1774
-#define wxListItemAttr_destroy 1775
-#define wxImageList_new_0 1776
-#define wxImageList_new_3 1777
-#define wxImageList_Add_1 1778
-#define wxImageList_Add_2_0 1779
-#define wxImageList_Add_2_1 1780
-#define wxImageList_Create 1781
-#define wxImageList_Draw 1783
-#define wxImageList_GetBitmap 1784
-#define wxImageList_GetIcon 1785
-#define wxImageList_GetImageCount 1786
-#define wxImageList_GetSize 1787
-#define wxImageList_Remove 1788
-#define wxImageList_RemoveAll 1789
-#define wxImageList_Replace_2 1790
-#define wxImageList_Replace_3 1791
-#define wxImageList_destroy 1792
-#define wxTextAttr_new_0 1793
-#define wxTextAttr_new_2 1794
-#define wxTextAttr_GetAlignment 1795
-#define wxTextAttr_GetBackgroundColour 1796
-#define wxTextAttr_GetFont 1797
-#define wxTextAttr_GetLeftIndent 1798
-#define wxTextAttr_GetLeftSubIndent 1799
-#define wxTextAttr_GetRightIndent 1800
-#define wxTextAttr_GetTabs 1801
-#define wxTextAttr_GetTextColour 1802
-#define wxTextAttr_HasBackgroundColour 1803
-#define wxTextAttr_HasFont 1804
-#define wxTextAttr_HasTextColour 1805
-#define wxTextAttr_GetFlags 1806
-#define wxTextAttr_IsDefault 1807
-#define wxTextAttr_SetAlignment 1808
-#define wxTextAttr_SetBackgroundColour 1809
-#define wxTextAttr_SetFlags 1810
-#define wxTextAttr_SetFont 1811
-#define wxTextAttr_SetLeftIndent 1812
-#define wxTextAttr_SetRightIndent 1813
-#define wxTextAttr_SetTabs 1814
-#define wxTextAttr_SetTextColour 1815
-#define wxTextAttr_destroy 1816
-#define wxTextCtrl_new_3 1818
-#define wxTextCtrl_new_0 1819
-#define wxTextCtrl_destruct 1821
-#define wxTextCtrl_AppendText 1822
-#define wxTextCtrl_CanCopy 1823
-#define wxTextCtrl_CanCut 1824
-#define wxTextCtrl_CanPaste 1825
-#define wxTextCtrl_CanRedo 1826
-#define wxTextCtrl_CanUndo 1827
-#define wxTextCtrl_Clear 1828
-#define wxTextCtrl_Copy 1829
-#define wxTextCtrl_Create 1830
-#define wxTextCtrl_Cut 1831
-#define wxTextCtrl_DiscardEdits 1832
-#define wxTextCtrl_ChangeValue 1833
-#define wxTextCtrl_EmulateKeyPress 1834
-#define wxTextCtrl_GetDefaultStyle 1835
-#define wxTextCtrl_GetInsertionPoint 1836
-#define wxTextCtrl_GetLastPosition 1837
-#define wxTextCtrl_GetLineLength 1838
-#define wxTextCtrl_GetLineText 1839
-#define wxTextCtrl_GetNumberOfLines 1840
-#define wxTextCtrl_GetRange 1841
-#define wxTextCtrl_GetSelection 1842
-#define wxTextCtrl_GetStringSelection 1843
-#define wxTextCtrl_GetStyle 1844
-#define wxTextCtrl_GetValue 1845
-#define wxTextCtrl_IsEditable 1846
-#define wxTextCtrl_IsModified 1847
-#define wxTextCtrl_IsMultiLine 1848
-#define wxTextCtrl_IsSingleLine 1849
-#define wxTextCtrl_LoadFile 1850
-#define wxTextCtrl_MarkDirty 1851
-#define wxTextCtrl_Paste 1852
-#define wxTextCtrl_PositionToXY 1853
-#define wxTextCtrl_Redo 1854
-#define wxTextCtrl_Remove 1855
-#define wxTextCtrl_Replace 1856
-#define wxTextCtrl_SaveFile 1857
-#define wxTextCtrl_SetDefaultStyle 1858
-#define wxTextCtrl_SetEditable 1859
-#define wxTextCtrl_SetInsertionPoint 1860
-#define wxTextCtrl_SetInsertionPointEnd 1861
-#define wxTextCtrl_SetMaxLength 1863
-#define wxTextCtrl_SetSelection 1864
-#define wxTextCtrl_SetStyle 1865
-#define wxTextCtrl_SetValue 1866
-#define wxTextCtrl_ShowPosition 1867
-#define wxTextCtrl_Undo 1868
-#define wxTextCtrl_WriteText 1869
-#define wxTextCtrl_XYToPosition 1870
-#define wxNotebook_new_0 1873
-#define wxNotebook_new_3 1874
-#define wxNotebook_destruct 1875
-#define wxNotebook_AddPage 1876
-#define wxNotebook_AdvanceSelection 1877
-#define wxNotebook_AssignImageList 1878
-#define wxNotebook_Create 1879
-#define wxNotebook_DeleteAllPages 1880
-#define wxNotebook_DeletePage 1881
-#define wxNotebook_RemovePage 1882
-#define wxNotebook_GetCurrentPage 1883
-#define wxNotebook_GetImageList 1884
-#define wxNotebook_GetPage 1886
-#define wxNotebook_GetPageCount 1887
-#define wxNotebook_GetPageImage 1888
-#define wxNotebook_GetPageText 1889
-#define wxNotebook_GetRowCount 1890
-#define wxNotebook_GetSelection 1891
-#define wxNotebook_GetThemeBackgroundColour 1892
-#define wxNotebook_HitTest 1894
-#define wxNotebook_InsertPage 1896
-#define wxNotebook_SetImageList 1897
-#define wxNotebook_SetPadding 1898
-#define wxNotebook_SetPageSize 1899
-#define wxNotebook_SetPageImage 1900
-#define wxNotebook_SetPageText 1901
-#define wxNotebook_SetSelection 1902
-#define wxNotebook_ChangeSelection 1903
-#define wxChoicebook_new_0 1904
-#define wxChoicebook_new_3 1905
-#define wxChoicebook_AddPage 1906
-#define wxChoicebook_AdvanceSelection 1907
-#define wxChoicebook_AssignImageList 1908
-#define wxChoicebook_Create 1909
-#define wxChoicebook_DeleteAllPages 1910
-#define wxChoicebook_DeletePage 1911
-#define wxChoicebook_RemovePage 1912
-#define wxChoicebook_GetCurrentPage 1913
-#define wxChoicebook_GetImageList 1914
-#define wxChoicebook_GetPage 1916
-#define wxChoicebook_GetPageCount 1917
-#define wxChoicebook_GetPageImage 1918
-#define wxChoicebook_GetPageText 1919
-#define wxChoicebook_GetSelection 1920
-#define wxChoicebook_HitTest 1921
-#define wxChoicebook_InsertPage 1922
-#define wxChoicebook_SetImageList 1923
-#define wxChoicebook_SetPageSize 1924
-#define wxChoicebook_SetPageImage 1925
-#define wxChoicebook_SetPageText 1926
-#define wxChoicebook_SetSelection 1927
-#define wxChoicebook_ChangeSelection 1928
-#define wxChoicebook_destroy 1929
-#define wxToolbook_new_0 1930
-#define wxToolbook_new_3 1931
-#define wxToolbook_AddPage 1932
-#define wxToolbook_AdvanceSelection 1933
-#define wxToolbook_AssignImageList 1934
-#define wxToolbook_Create 1935
-#define wxToolbook_DeleteAllPages 1936
-#define wxToolbook_DeletePage 1937
-#define wxToolbook_RemovePage 1938
-#define wxToolbook_GetCurrentPage 1939
-#define wxToolbook_GetImageList 1940
-#define wxToolbook_GetPage 1942
-#define wxToolbook_GetPageCount 1943
-#define wxToolbook_GetPageImage 1944
-#define wxToolbook_GetPageText 1945
-#define wxToolbook_GetSelection 1946
-#define wxToolbook_HitTest 1948
-#define wxToolbook_InsertPage 1949
-#define wxToolbook_SetImageList 1950
-#define wxToolbook_SetPageSize 1951
-#define wxToolbook_SetPageImage 1952
-#define wxToolbook_SetPageText 1953
-#define wxToolbook_SetSelection 1954
-#define wxToolbook_ChangeSelection 1955
-#define wxToolbook_destroy 1956
-#define wxListbook_new_0 1957
-#define wxListbook_new_3 1958
-#define wxListbook_AddPage 1959
-#define wxListbook_AdvanceSelection 1960
-#define wxListbook_AssignImageList 1961
-#define wxListbook_Create 1962
-#define wxListbook_DeleteAllPages 1963
-#define wxListbook_DeletePage 1964
-#define wxListbook_RemovePage 1965
-#define wxListbook_GetCurrentPage 1966
-#define wxListbook_GetImageList 1967
-#define wxListbook_GetPage 1969
-#define wxListbook_GetPageCount 1970
-#define wxListbook_GetPageImage 1971
-#define wxListbook_GetPageText 1972
-#define wxListbook_GetSelection 1973
-#define wxListbook_HitTest 1975
-#define wxListbook_InsertPage 1976
-#define wxListbook_SetImageList 1977
-#define wxListbook_SetPageSize 1978
-#define wxListbook_SetPageImage 1979
-#define wxListbook_SetPageText 1980
-#define wxListbook_SetSelection 1981
-#define wxListbook_ChangeSelection 1982
-#define wxListbook_destroy 1983
-#define wxTreebook_new_0 1984
-#define wxTreebook_new_3 1985
-#define wxTreebook_AddPage 1986
-#define wxTreebook_AdvanceSelection 1987
-#define wxTreebook_AssignImageList 1988
-#define wxTreebook_Create 1989
-#define wxTreebook_DeleteAllPages 1990
-#define wxTreebook_DeletePage 1991
-#define wxTreebook_RemovePage 1992
-#define wxTreebook_GetCurrentPage 1993
-#define wxTreebook_GetImageList 1994
-#define wxTreebook_GetPage 1996
-#define wxTreebook_GetPageCount 1997
-#define wxTreebook_GetPageImage 1998
-#define wxTreebook_GetPageText 1999
-#define wxTreebook_GetSelection 2000
-#define wxTreebook_ExpandNode 2001
-#define wxTreebook_IsNodeExpanded 2002
-#define wxTreebook_HitTest 2004
-#define wxTreebook_InsertPage 2005
-#define wxTreebook_InsertSubPage 2006
-#define wxTreebook_SetImageList 2007
-#define wxTreebook_SetPageSize 2008
-#define wxTreebook_SetPageImage 2009
-#define wxTreebook_SetPageText 2010
-#define wxTreebook_SetSelection 2011
-#define wxTreebook_ChangeSelection 2012
-#define wxTreebook_destroy 2013
-#define wxTreeCtrl_new_2 2016
-#define wxTreeCtrl_new_0 2017
-#define wxTreeCtrl_destruct 2019
-#define wxTreeCtrl_AddRoot 2020
-#define wxTreeCtrl_AppendItem 2021
-#define wxTreeCtrl_AssignImageList 2022
-#define wxTreeCtrl_AssignStateImageList 2023
-#define wxTreeCtrl_Collapse 2024
-#define wxTreeCtrl_CollapseAndReset 2025
-#define wxTreeCtrl_Create 2026
-#define wxTreeCtrl_Delete 2027
-#define wxTreeCtrl_DeleteAllItems 2028
-#define wxTreeCtrl_DeleteChildren 2029
-#define wxTreeCtrl_EditLabel 2030
-#define wxTreeCtrl_EnsureVisible 2031
-#define wxTreeCtrl_Expand 2032
-#define wxTreeCtrl_GetBoundingRect 2033
-#define wxTreeCtrl_GetChildrenCount 2035
-#define wxTreeCtrl_GetCount 2036
-#define wxTreeCtrl_GetEditControl 2037
-#define wxTreeCtrl_GetFirstChild 2038
-#define wxTreeCtrl_GetNextChild 2039
-#define wxTreeCtrl_GetFirstVisibleItem 2040
-#define wxTreeCtrl_GetImageList 2041
-#define wxTreeCtrl_GetIndent 2042
-#define wxTreeCtrl_GetItemBackgroundColour 2043
-#define wxTreeCtrl_GetItemData 2044
-#define wxTreeCtrl_GetItemFont 2045
-#define wxTreeCtrl_GetItemImage_1 2046
-#define wxTreeCtrl_GetItemImage_2 2047
-#define wxTreeCtrl_GetItemText 2048
-#define wxTreeCtrl_GetItemTextColour 2049
-#define wxTreeCtrl_GetLastChild 2050
-#define wxTreeCtrl_GetNextSibling 2051
-#define wxTreeCtrl_GetNextVisible 2052
-#define wxTreeCtrl_GetItemParent 2053
-#define wxTreeCtrl_GetPrevSibling 2054
-#define wxTreeCtrl_GetPrevVisible 2055
-#define wxTreeCtrl_GetRootItem 2056
-#define wxTreeCtrl_GetSelection 2057
-#define wxTreeCtrl_GetSelections 2058
-#define wxTreeCtrl_GetStateImageList 2059
-#define wxTreeCtrl_HitTest 2060
-#define wxTreeCtrl_InsertItem 2062
-#define wxTreeCtrl_IsBold 2063
-#define wxTreeCtrl_IsExpanded 2064
-#define wxTreeCtrl_IsSelected 2065
-#define wxTreeCtrl_IsVisible 2066
-#define wxTreeCtrl_ItemHasChildren 2067
-#define wxTreeCtrl_IsTreeItemIdOk 2068
-#define wxTreeCtrl_PrependItem 2069
-#define wxTreeCtrl_ScrollTo 2070
-#define wxTreeCtrl_SelectItem_1 2071
-#define wxTreeCtrl_SelectItem_2 2072
-#define wxTreeCtrl_SetIndent 2073
-#define wxTreeCtrl_SetImageList 2074
-#define wxTreeCtrl_SetItemBackgroundColour 2075
-#define wxTreeCtrl_SetItemBold 2076
-#define wxTreeCtrl_SetItemData 2077
-#define wxTreeCtrl_SetItemDropHighlight 2078
-#define wxTreeCtrl_SetItemFont 2079
-#define wxTreeCtrl_SetItemHasChildren 2080
-#define wxTreeCtrl_SetItemImage_2 2081
-#define wxTreeCtrl_SetItemImage_3 2082
-#define wxTreeCtrl_SetItemText 2083
-#define wxTreeCtrl_SetItemTextColour 2084
-#define wxTreeCtrl_SetStateImageList 2085
-#define wxTreeCtrl_SetWindowStyle 2086
-#define wxTreeCtrl_SortChildren 2087
-#define wxTreeCtrl_Toggle 2088
-#define wxTreeCtrl_ToggleItemSelection 2089
-#define wxTreeCtrl_Unselect 2090
-#define wxTreeCtrl_UnselectAll 2091
-#define wxTreeCtrl_UnselectItem 2092
-#define wxScrollBar_new_0 2093
-#define wxScrollBar_new_3 2094
-#define wxScrollBar_destruct 2095
-#define wxScrollBar_Create 2096
-#define wxScrollBar_GetRange 2097
-#define wxScrollBar_GetPageSize 2098
-#define wxScrollBar_GetThumbPosition 2099
-#define wxScrollBar_GetThumbSize 2100
-#define wxScrollBar_SetThumbPosition 2101
-#define wxScrollBar_SetScrollbar 2102
-#define wxSpinButton_new_2 2104
-#define wxSpinButton_new_0 2105
-#define wxSpinButton_Create 2106
-#define wxSpinButton_GetMax 2107
-#define wxSpinButton_GetMin 2108
-#define wxSpinButton_GetValue 2109
-#define wxSpinButton_SetRange 2110
-#define wxSpinButton_SetValue 2111
-#define wxSpinButton_destroy 2112
-#define wxSpinCtrl_new_0 2113
-#define wxSpinCtrl_new_2 2114
-#define wxSpinCtrl_Create 2116
-#define wxSpinCtrl_SetValue_1_1 2119
-#define wxSpinCtrl_SetValue_1_0 2120
-#define wxSpinCtrl_GetValue 2122
-#define wxSpinCtrl_SetRange 2124
-#define wxSpinCtrl_SetSelection 2125
-#define wxSpinCtrl_GetMin 2127
-#define wxSpinCtrl_GetMax 2129
-#define wxSpinCtrl_destroy 2130
-#define wxStaticText_new_0 2131
-#define wxStaticText_new_4 2132
-#define wxStaticText_Create 2133
-#define wxStaticText_GetLabel 2134
-#define wxStaticText_SetLabel 2135
-#define wxStaticText_Wrap 2136
-#define wxStaticText_destroy 2137
-#define wxStaticBitmap_new_0 2138
-#define wxStaticBitmap_new_4 2139
-#define wxStaticBitmap_Create 2140
-#define wxStaticBitmap_GetBitmap 2141
-#define wxStaticBitmap_SetBitmap 2142
-#define wxStaticBitmap_destroy 2143
-#define wxRadioBox_new 2144
-#define wxRadioBox_destruct 2146
-#define wxRadioBox_Create 2147
-#define wxRadioBox_Enable_2 2148
-#define wxRadioBox_Enable_1 2149
-#define wxRadioBox_GetSelection 2150
-#define wxRadioBox_GetString 2151
-#define wxRadioBox_SetSelection 2152
-#define wxRadioBox_Show_2 2153
-#define wxRadioBox_Show_1 2154
-#define wxRadioBox_GetColumnCount 2155
-#define wxRadioBox_GetItemHelpText 2156
-#define wxRadioBox_GetItemToolTip 2157
-#define wxRadioBox_GetItemFromPoint 2159
-#define wxRadioBox_GetRowCount 2160
-#define wxRadioBox_IsItemEnabled 2161
-#define wxRadioBox_IsItemShown 2162
-#define wxRadioBox_SetItemHelpText 2163
-#define wxRadioBox_SetItemToolTip 2164
-#define wxRadioButton_new_0 2165
-#define wxRadioButton_new_4 2166
-#define wxRadioButton_Create 2167
-#define wxRadioButton_GetValue 2168
-#define wxRadioButton_SetValue 2169
-#define wxRadioButton_destroy 2170
-#define wxSlider_new_6 2172
-#define wxSlider_new_0 2173
-#define wxSlider_Create 2174
-#define wxSlider_GetLineSize 2175
-#define wxSlider_GetMax 2176
-#define wxSlider_GetMin 2177
-#define wxSlider_GetPageSize 2178
-#define wxSlider_GetThumbLength 2179
-#define wxSlider_GetValue 2180
-#define wxSlider_SetLineSize 2181
-#define wxSlider_SetPageSize 2182
-#define wxSlider_SetRange 2183
-#define wxSlider_SetThumbLength 2184
-#define wxSlider_SetValue 2185
-#define wxSlider_destroy 2186
-#define wxDialog_new_4 2188
-#define wxDialog_new_0 2189
-#define wxDialog_destruct 2191
-#define wxDialog_Create 2192
-#define wxDialog_CreateButtonSizer 2193
-#define wxDialog_CreateStdDialogButtonSizer 2194
-#define wxDialog_EndModal 2195
-#define wxDialog_GetAffirmativeId 2196
-#define wxDialog_GetReturnCode 2197
-#define wxDialog_IsModal 2198
-#define wxDialog_SetAffirmativeId 2199
-#define wxDialog_SetReturnCode 2200
-#define wxDialog_Show 2201
-#define wxDialog_ShowModal 2202
-#define wxColourDialog_new_0 2203
-#define wxColourDialog_new_2 2204
-#define wxColourDialog_destruct 2205
-#define wxColourDialog_Create 2206
-#define wxColourDialog_GetColourData 2207
-#define wxColourData_new_0 2208
-#define wxColourData_new_1 2209
-#define wxColourData_destruct 2210
-#define wxColourData_GetChooseFull 2211
-#define wxColourData_GetColour 2212
-#define wxColourData_GetCustomColour 2214
-#define wxColourData_SetChooseFull 2215
-#define wxColourData_SetColour 2216
-#define wxColourData_SetCustomColour 2217
-#define wxPalette_new_0 2218
-#define wxPalette_new_4 2219
-#define wxPalette_destruct 2221
-#define wxPalette_Create 2222
-#define wxPalette_GetColoursCount 2223
-#define wxPalette_GetPixel 2224
-#define wxPalette_GetRGB 2225
-#define wxPalette_IsOk 2226
-#define wxDirDialog_new 2230
-#define wxDirDialog_destruct 2231
-#define wxDirDialog_GetPath 2232
-#define wxDirDialog_GetMessage 2233
-#define wxDirDialog_SetMessage 2234
-#define wxDirDialog_SetPath 2235
-#define wxFileDialog_new 2239
-#define wxFileDialog_destruct 2240
-#define wxFileDialog_GetDirectory 2241
-#define wxFileDialog_GetFilename 2242
-#define wxFileDialog_GetFilenames 2243
-#define wxFileDialog_GetFilterIndex 2244
-#define wxFileDialog_GetMessage 2245
-#define wxFileDialog_GetPath 2246
-#define wxFileDialog_GetPaths 2247
-#define wxFileDialog_GetWildcard 2248
-#define wxFileDialog_SetDirectory 2249
-#define wxFileDialog_SetFilename 2250
-#define wxFileDialog_SetFilterIndex 2251
-#define wxFileDialog_SetMessage 2252
-#define wxFileDialog_SetPath 2253
-#define wxFileDialog_SetWildcard 2254
-#define wxPickerBase_SetInternalMargin 2255
-#define wxPickerBase_GetInternalMargin 2256
-#define wxPickerBase_SetTextCtrlProportion 2257
-#define wxPickerBase_SetPickerCtrlProportion 2258
-#define wxPickerBase_GetTextCtrlProportion 2259
-#define wxPickerBase_GetPickerCtrlProportion 2260
-#define wxPickerBase_HasTextCtrl 2261
-#define wxPickerBase_GetTextCtrl 2262
-#define wxPickerBase_IsTextCtrlGrowable 2263
-#define wxPickerBase_SetPickerCtrlGrowable 2264
-#define wxPickerBase_SetTextCtrlGrowable 2265
-#define wxPickerBase_IsPickerCtrlGrowable 2266
-#define wxFilePickerCtrl_new_0 2267
-#define wxFilePickerCtrl_new_3 2268
-#define wxFilePickerCtrl_Create 2269
-#define wxFilePickerCtrl_GetPath 2270
-#define wxFilePickerCtrl_SetPath 2271
-#define wxFilePickerCtrl_destroy 2272
-#define wxDirPickerCtrl_new_0 2273
-#define wxDirPickerCtrl_new_3 2274
-#define wxDirPickerCtrl_Create 2275
-#define wxDirPickerCtrl_GetPath 2276
-#define wxDirPickerCtrl_SetPath 2277
-#define wxDirPickerCtrl_destroy 2278
-#define wxColourPickerCtrl_new_0 2279
-#define wxColourPickerCtrl_new_3 2280
-#define wxColourPickerCtrl_Create 2281
-#define wxColourPickerCtrl_GetColour 2282
-#define wxColourPickerCtrl_SetColour_1_1 2283
-#define wxColourPickerCtrl_SetColour_1_0 2284
-#define wxColourPickerCtrl_destroy 2285
-#define wxDatePickerCtrl_new_0 2286
-#define wxDatePickerCtrl_new_3 2287
-#define wxDatePickerCtrl_GetRange 2288
-#define wxDatePickerCtrl_GetValue 2289
-#define wxDatePickerCtrl_SetRange 2290
-#define wxDatePickerCtrl_SetValue 2291
-#define wxDatePickerCtrl_destroy 2292
-#define wxFontPickerCtrl_new_0 2293
-#define wxFontPickerCtrl_new_3 2294
-#define wxFontPickerCtrl_Create 2295
-#define wxFontPickerCtrl_GetSelectedFont 2296
-#define wxFontPickerCtrl_SetSelectedFont 2297
-#define wxFontPickerCtrl_GetMaxPointSize 2298
-#define wxFontPickerCtrl_SetMaxPointSize 2299
-#define wxFontPickerCtrl_destroy 2300
-#define wxFindReplaceDialog_new_0 2303
-#define wxFindReplaceDialog_new_4 2304
-#define wxFindReplaceDialog_destruct 2305
-#define wxFindReplaceDialog_Create 2306
-#define wxFindReplaceDialog_GetData 2307
-#define wxFindReplaceData_new_0 2308
-#define wxFindReplaceData_new_1 2309
-#define wxFindReplaceData_GetFindString 2310
-#define wxFindReplaceData_GetReplaceString 2311
-#define wxFindReplaceData_GetFlags 2312
-#define wxFindReplaceData_SetFlags 2313
-#define wxFindReplaceData_SetFindString 2314
-#define wxFindReplaceData_SetReplaceString 2315
-#define wxFindReplaceData_destroy 2316
-#define wxMultiChoiceDialog_new_0 2317
-#define wxMultiChoiceDialog_new_5 2319
-#define wxMultiChoiceDialog_GetSelections 2320
-#define wxMultiChoiceDialog_SetSelections 2321
-#define wxMultiChoiceDialog_destroy 2322
-#define wxSingleChoiceDialog_new_0 2323
-#define wxSingleChoiceDialog_new_5 2325
-#define wxSingleChoiceDialog_GetSelection 2326
-#define wxSingleChoiceDialog_GetStringSelection 2327
-#define wxSingleChoiceDialog_SetSelection 2328
-#define wxSingleChoiceDialog_destroy 2329
-#define wxTextEntryDialog_new 2330
-#define wxTextEntryDialog_GetValue 2331
-#define wxTextEntryDialog_SetValue 2332
-#define wxTextEntryDialog_destroy 2333
-#define wxPasswordEntryDialog_new 2334
-#define wxPasswordEntryDialog_destroy 2335
-#define wxFontData_new_0 2336
-#define wxFontData_new_1 2337
-#define wxFontData_destruct 2338
-#define wxFontData_EnableEffects 2339
-#define wxFontData_GetAllowSymbols 2340
-#define wxFontData_GetColour 2341
-#define wxFontData_GetChosenFont 2342
-#define wxFontData_GetEnableEffects 2343
-#define wxFontData_GetInitialFont 2344
-#define wxFontData_GetShowHelp 2345
-#define wxFontData_SetAllowSymbols 2346
-#define wxFontData_SetChosenFont 2347
-#define wxFontData_SetColour 2348
-#define wxFontData_SetInitialFont 2349
-#define wxFontData_SetRange 2350
-#define wxFontData_SetShowHelp 2351
-#define wxFontDialog_new_0 2355
-#define wxFontDialog_new_2 2357
-#define wxFontDialog_Create 2359
-#define wxFontDialog_GetFontData 2360
-#define wxFontDialog_destroy 2362
-#define wxProgressDialog_new 2363
-#define wxProgressDialog_destruct 2364
-#define wxProgressDialog_Resume 2365
-#define wxProgressDialog_Update_2 2366
-#define wxProgressDialog_Update_0 2367
-#define wxMessageDialog_new 2368
-#define wxMessageDialog_destruct 2369
-#define wxPageSetupDialog_new 2370
-#define wxPageSetupDialog_destruct 2371
-#define wxPageSetupDialog_GetPageSetupData 2372
-#define wxPageSetupDialog_ShowModal 2373
-#define wxPageSetupDialogData_new_0 2374
-#define wxPageSetupDialogData_new_1_0 2375
-#define wxPageSetupDialogData_new_1_1 2376
-#define wxPageSetupDialogData_destruct 2377
-#define wxPageSetupDialogData_EnableHelp 2378
-#define wxPageSetupDialogData_EnableMargins 2379
-#define wxPageSetupDialogData_EnableOrientation 2380
-#define wxPageSetupDialogData_EnablePaper 2381
-#define wxPageSetupDialogData_EnablePrinter 2382
-#define wxPageSetupDialogData_GetDefaultMinMargins 2383
-#define wxPageSetupDialogData_GetEnableMargins 2384
-#define wxPageSetupDialogData_GetEnableOrientation 2385
-#define wxPageSetupDialogData_GetEnablePaper 2386
-#define wxPageSetupDialogData_GetEnablePrinter 2387
-#define wxPageSetupDialogData_GetEnableHelp 2388
-#define wxPageSetupDialogData_GetDefaultInfo 2389
-#define wxPageSetupDialogData_GetMarginTopLeft 2390
-#define wxPageSetupDialogData_GetMarginBottomRight 2391
-#define wxPageSetupDialogData_GetMinMarginTopLeft 2392
-#define wxPageSetupDialogData_GetMinMarginBottomRight 2393
-#define wxPageSetupDialogData_GetPaperId 2394
-#define wxPageSetupDialogData_GetPaperSize 2395
-#define wxPageSetupDialogData_GetPrintData 2397
-#define wxPageSetupDialogData_IsOk 2398
-#define wxPageSetupDialogData_SetDefaultInfo 2399
-#define wxPageSetupDialogData_SetDefaultMinMargins 2400
-#define wxPageSetupDialogData_SetMarginTopLeft 2401
-#define wxPageSetupDialogData_SetMarginBottomRight 2402
-#define wxPageSetupDialogData_SetMinMarginTopLeft 2403
-#define wxPageSetupDialogData_SetMinMarginBottomRight 2404
-#define wxPageSetupDialogData_SetPaperId 2405
-#define wxPageSetupDialogData_SetPaperSize_1_1 2406
-#define wxPageSetupDialogData_SetPaperSize_1_0 2407
-#define wxPageSetupDialogData_SetPrintData 2408
-#define wxPrintDialog_new_2_0 2409
-#define wxPrintDialog_new_2_1 2410
-#define wxPrintDialog_destruct 2411
-#define wxPrintDialog_GetPrintDialogData 2412
-#define wxPrintDialog_GetPrintDC 2413
-#define wxPrintDialogData_new_0 2414
-#define wxPrintDialogData_new_1_1 2415
-#define wxPrintDialogData_new_1_0 2416
-#define wxPrintDialogData_destruct 2417
-#define wxPrintDialogData_EnableHelp 2418
-#define wxPrintDialogData_EnablePageNumbers 2419
-#define wxPrintDialogData_EnablePrintToFile 2420
-#define wxPrintDialogData_EnableSelection 2421
-#define wxPrintDialogData_GetAllPages 2422
-#define wxPrintDialogData_GetCollate 2423
-#define wxPrintDialogData_GetFromPage 2424
-#define wxPrintDialogData_GetMaxPage 2425
-#define wxPrintDialogData_GetMinPage 2426
-#define wxPrintDialogData_GetNoCopies 2427
-#define wxPrintDialogData_GetPrintData 2428
-#define wxPrintDialogData_GetPrintToFile 2429
-#define wxPrintDialogData_GetSelection 2430
-#define wxPrintDialogData_GetToPage 2431
-#define wxPrintDialogData_IsOk 2432
-#define wxPrintDialogData_SetCollate 2433
-#define wxPrintDialogData_SetFromPage 2434
-#define wxPrintDialogData_SetMaxPage 2435
-#define wxPrintDialogData_SetMinPage 2436
-#define wxPrintDialogData_SetNoCopies 2437
-#define wxPrintDialogData_SetPrintData 2438
-#define wxPrintDialogData_SetPrintToFile 2439
-#define wxPrintDialogData_SetSelection 2440
-#define wxPrintDialogData_SetToPage 2441
-#define wxPrintData_new_0 2442
-#define wxPrintData_new_1 2443
-#define wxPrintData_destruct 2444
-#define wxPrintData_GetCollate 2445
-#define wxPrintData_GetBin 2446
-#define wxPrintData_GetColour 2447
-#define wxPrintData_GetDuplex 2448
-#define wxPrintData_GetNoCopies 2449
-#define wxPrintData_GetOrientation 2450
-#define wxPrintData_GetPaperId 2451
-#define wxPrintData_GetPrinterName 2452
-#define wxPrintData_GetQuality 2453
-#define wxPrintData_IsOk 2454
-#define wxPrintData_SetBin 2455
-#define wxPrintData_SetCollate 2456
-#define wxPrintData_SetColour 2457
-#define wxPrintData_SetDuplex 2458
-#define wxPrintData_SetNoCopies 2459
-#define wxPrintData_SetOrientation 2460
-#define wxPrintData_SetPaperId 2461
-#define wxPrintData_SetPrinterName 2462
-#define wxPrintData_SetQuality 2463
-#define wxPrintPreview_new_2 2466
-#define wxPrintPreview_new_3 2467
-#define wxPrintPreview_destruct 2469
-#define wxPrintPreview_GetCanvas 2470
-#define wxPrintPreview_GetCurrentPage 2471
-#define wxPrintPreview_GetFrame 2472
-#define wxPrintPreview_GetMaxPage 2473
-#define wxPrintPreview_GetMinPage 2474
-#define wxPrintPreview_GetPrintout 2475
-#define wxPrintPreview_GetPrintoutForPrinting 2476
-#define wxPrintPreview_IsOk 2477
-#define wxPrintPreview_PaintPage 2478
-#define wxPrintPreview_Print 2479
-#define wxPrintPreview_RenderPage 2480
-#define wxPrintPreview_SetCanvas 2481
-#define wxPrintPreview_SetCurrentPage 2482
-#define wxPrintPreview_SetFrame 2483
-#define wxPrintPreview_SetPrintout 2484
-#define wxPrintPreview_SetZoom 2485
-#define wxPreviewFrame_new 2486
-#define wxPreviewFrame_destruct 2487
-#define wxPreviewFrame_CreateControlBar 2488
-#define wxPreviewFrame_CreateCanvas 2489
-#define wxPreviewFrame_Initialize 2490
-#define wxPreviewFrame_OnCloseWindow 2491
-#define wxPreviewControlBar_new 2492
-#define wxPreviewControlBar_destruct 2493
-#define wxPreviewControlBar_CreateButtons 2494
-#define wxPreviewControlBar_GetPrintPreview 2495
-#define wxPreviewControlBar_GetZoomControl 2496
-#define wxPreviewControlBar_SetZoomControl 2497
-#define wxPrinter_new 2499
-#define wxPrinter_CreateAbortWindow 2500
-#define wxPrinter_GetAbort 2501
-#define wxPrinter_GetLastError 2502
-#define wxPrinter_GetPrintDialogData 2503
-#define wxPrinter_Print 2504
-#define wxPrinter_PrintDialog 2505
-#define wxPrinter_ReportError 2506
-#define wxPrinter_Setup 2507
-#define wxPrinter_destroy 2508
-#define wxXmlResource_new_1 2509
-#define wxXmlResource_new_2 2510
-#define wxXmlResource_destruct 2511
-#define wxXmlResource_AttachUnknownControl 2512
-#define wxXmlResource_ClearHandlers 2513
-#define wxXmlResource_CompareVersion 2514
-#define wxXmlResource_Get 2515
-#define wxXmlResource_GetFlags 2516
-#define wxXmlResource_GetVersion 2517
-#define wxXmlResource_GetXRCID 2518
-#define wxXmlResource_InitAllHandlers 2519
-#define wxXmlResource_Load 2520
-#define wxXmlResource_LoadBitmap 2521
-#define wxXmlResource_LoadDialog_2 2522
-#define wxXmlResource_LoadDialog_3 2523
-#define wxXmlResource_LoadFrame_2 2524
-#define wxXmlResource_LoadFrame_3 2525
-#define wxXmlResource_LoadIcon 2526
-#define wxXmlResource_LoadMenu 2527
-#define wxXmlResource_LoadMenuBar_2 2528
-#define wxXmlResource_LoadMenuBar_1 2529
-#define wxXmlResource_LoadPanel_2 2530
-#define wxXmlResource_LoadPanel_3 2531
-#define wxXmlResource_LoadToolBar 2532
-#define wxXmlResource_Set 2533
-#define wxXmlResource_SetFlags 2534
-#define wxXmlResource_Unload 2535
-#define wxXmlResource_xrcctrl 2536
-#define wxHtmlEasyPrinting_new 2537
-#define wxHtmlEasyPrinting_destruct 2538
-#define wxHtmlEasyPrinting_GetPrintData 2539
-#define wxHtmlEasyPrinting_GetPageSetupData 2540
-#define wxHtmlEasyPrinting_PreviewFile 2541
-#define wxHtmlEasyPrinting_PreviewText 2542
-#define wxHtmlEasyPrinting_PrintFile 2543
-#define wxHtmlEasyPrinting_PrintText 2544
-#define wxHtmlEasyPrinting_PageSetup 2545
-#define wxHtmlEasyPrinting_SetFonts 2546
-#define wxHtmlEasyPrinting_SetHeader 2547
-#define wxHtmlEasyPrinting_SetFooter 2548
-#define wxGLCanvas_new_2 2550
-#define wxGLCanvas_new_3_1 2551
-#define wxGLCanvas_new_3_0 2552
-#define wxGLCanvas_GetContext 2553
-#define wxGLCanvas_SetCurrent 2555
-#define wxGLCanvas_SwapBuffers 2556
-#define wxGLCanvas_destroy 2557
-#define wxAuiManager_new 2558
-#define wxAuiManager_destruct 2559
-#define wxAuiManager_AddPane_2_1 2560
-#define wxAuiManager_AddPane_3 2561
-#define wxAuiManager_AddPane_2_0 2562
-#define wxAuiManager_DetachPane 2563
-#define wxAuiManager_GetAllPanes 2564
-#define wxAuiManager_GetArtProvider 2565
-#define wxAuiManager_GetDockSizeConstraint 2566
-#define wxAuiManager_GetFlags 2567
-#define wxAuiManager_GetManagedWindow 2568
-#define wxAuiManager_GetManager 2569
-#define wxAuiManager_GetPane_1_1 2570
-#define wxAuiManager_GetPane_1_0 2571
-#define wxAuiManager_HideHint 2572
-#define wxAuiManager_InsertPane 2573
-#define wxAuiManager_LoadPaneInfo 2574
-#define wxAuiManager_LoadPerspective 2575
-#define wxAuiManager_SavePaneInfo 2576
-#define wxAuiManager_SavePerspective 2577
-#define wxAuiManager_SetArtProvider 2578
-#define wxAuiManager_SetDockSizeConstraint 2579
-#define wxAuiManager_SetFlags 2580
-#define wxAuiManager_SetManagedWindow 2581
-#define wxAuiManager_ShowHint 2582
-#define wxAuiManager_UnInit 2583
-#define wxAuiManager_Update 2584
-#define wxAuiPaneInfo_new_0 2585
-#define wxAuiPaneInfo_new_1 2586
-#define wxAuiPaneInfo_destruct 2587
-#define wxAuiPaneInfo_BestSize_1 2588
-#define wxAuiPaneInfo_BestSize_2 2589
-#define wxAuiPaneInfo_Bottom 2590
-#define wxAuiPaneInfo_BottomDockable 2591
-#define wxAuiPaneInfo_Caption 2592
-#define wxAuiPaneInfo_CaptionVisible 2593
-#define wxAuiPaneInfo_Centre 2594
-#define wxAuiPaneInfo_CentrePane 2595
-#define wxAuiPaneInfo_CloseButton 2596
-#define wxAuiPaneInfo_DefaultPane 2597
-#define wxAuiPaneInfo_DestroyOnClose 2598
-#define wxAuiPaneInfo_Direction 2599
-#define wxAuiPaneInfo_Dock 2600
-#define wxAuiPaneInfo_Dockable 2601
-#define wxAuiPaneInfo_Fixed 2602
-#define wxAuiPaneInfo_Float 2603
-#define wxAuiPaneInfo_Floatable 2604
-#define wxAuiPaneInfo_FloatingPosition_1 2605
-#define wxAuiPaneInfo_FloatingPosition_2 2606
-#define wxAuiPaneInfo_FloatingSize_1 2607
-#define wxAuiPaneInfo_FloatingSize_2 2608
-#define wxAuiPaneInfo_Gripper 2609
-#define wxAuiPaneInfo_GripperTop 2610
-#define wxAuiPaneInfo_HasBorder 2611
-#define wxAuiPaneInfo_HasCaption 2612
-#define wxAuiPaneInfo_HasCloseButton 2613
-#define wxAuiPaneInfo_HasFlag 2614
-#define wxAuiPaneInfo_HasGripper 2615
-#define wxAuiPaneInfo_HasGripperTop 2616
-#define wxAuiPaneInfo_HasMaximizeButton 2617
-#define wxAuiPaneInfo_HasMinimizeButton 2618
-#define wxAuiPaneInfo_HasPinButton 2619
-#define wxAuiPaneInfo_Hide 2620
-#define wxAuiPaneInfo_IsBottomDockable 2621
-#define wxAuiPaneInfo_IsDocked 2622
-#define wxAuiPaneInfo_IsFixed 2623
-#define wxAuiPaneInfo_IsFloatable 2624
-#define wxAuiPaneInfo_IsFloating 2625
-#define wxAuiPaneInfo_IsLeftDockable 2626
-#define wxAuiPaneInfo_IsMovable 2627
-#define wxAuiPaneInfo_IsOk 2628
-#define wxAuiPaneInfo_IsResizable 2629
-#define wxAuiPaneInfo_IsRightDockable 2630
-#define wxAuiPaneInfo_IsShown 2631
-#define wxAuiPaneInfo_IsToolbar 2632
-#define wxAuiPaneInfo_IsTopDockable 2633
-#define wxAuiPaneInfo_Layer 2634
-#define wxAuiPaneInfo_Left 2635
-#define wxAuiPaneInfo_LeftDockable 2636
-#define wxAuiPaneInfo_MaxSize_1 2637
-#define wxAuiPaneInfo_MaxSize_2 2638
-#define wxAuiPaneInfo_MaximizeButton 2639
-#define wxAuiPaneInfo_MinSize_1 2640
-#define wxAuiPaneInfo_MinSize_2 2641
-#define wxAuiPaneInfo_MinimizeButton 2642
-#define wxAuiPaneInfo_Movable 2643
-#define wxAuiPaneInfo_Name 2644
-#define wxAuiPaneInfo_PaneBorder 2645
-#define wxAuiPaneInfo_PinButton 2646
-#define wxAuiPaneInfo_Position 2647
-#define wxAuiPaneInfo_Resizable 2648
-#define wxAuiPaneInfo_Right 2649
-#define wxAuiPaneInfo_RightDockable 2650
-#define wxAuiPaneInfo_Row 2651
-#define wxAuiPaneInfo_SafeSet 2652
-#define wxAuiPaneInfo_SetFlag 2653
-#define wxAuiPaneInfo_Show 2654
-#define wxAuiPaneInfo_ToolbarPane 2655
-#define wxAuiPaneInfo_Top 2656
-#define wxAuiPaneInfo_TopDockable 2657
-#define wxAuiPaneInfo_Window 2658
-#define wxAuiPaneInfo_GetWindow 2659
-#define wxAuiPaneInfo_GetFrame 2660
-#define wxAuiPaneInfo_GetDirection 2661
-#define wxAuiPaneInfo_GetLayer 2662
-#define wxAuiPaneInfo_GetRow 2663
-#define wxAuiPaneInfo_GetPosition 2664
-#define wxAuiPaneInfo_GetFloatingPosition 2665
-#define wxAuiPaneInfo_GetFloatingSize 2666
-#define wxAuiNotebook_new_0 2667
-#define wxAuiNotebook_new_2 2668
-#define wxAuiNotebook_AddPage 2669
-#define wxAuiNotebook_Create 2670
-#define wxAuiNotebook_DeletePage 2671
-#define wxAuiNotebook_GetArtProvider 2672
-#define wxAuiNotebook_GetPage 2673
-#define wxAuiNotebook_GetPageBitmap 2674
-#define wxAuiNotebook_GetPageCount 2675
-#define wxAuiNotebook_GetPageIndex 2676
-#define wxAuiNotebook_GetPageText 2677
-#define wxAuiNotebook_GetSelection 2678
-#define wxAuiNotebook_InsertPage 2679
-#define wxAuiNotebook_RemovePage 2680
-#define wxAuiNotebook_SetArtProvider 2681
-#define wxAuiNotebook_SetFont 2682
-#define wxAuiNotebook_SetPageBitmap 2683
-#define wxAuiNotebook_SetPageText 2684
-#define wxAuiNotebook_SetSelection 2685
-#define wxAuiNotebook_SetTabCtrlHeight 2686
-#define wxAuiNotebook_SetUniformBitmapSize 2687
-#define wxAuiNotebook_destroy 2688
-#define wxAuiTabArt_SetFlags 2689
-#define wxAuiTabArt_SetMeasuringFont 2690
-#define wxAuiTabArt_SetNormalFont 2691
-#define wxAuiTabArt_SetSelectedFont 2692
-#define wxAuiTabArt_SetColour 2693
-#define wxAuiTabArt_SetActiveColour 2694
-#define wxAuiDockArt_GetColour 2695
-#define wxAuiDockArt_GetFont 2696
-#define wxAuiDockArt_GetMetric 2697
-#define wxAuiDockArt_SetColour 2698
-#define wxAuiDockArt_SetFont 2699
-#define wxAuiDockArt_SetMetric 2700
-#define wxAuiSimpleTabArt_new 2701
-#define wxAuiSimpleTabArt_destroy 2702
-#define wxMDIParentFrame_new_0 2703
-#define wxMDIParentFrame_new_4 2704
-#define wxMDIParentFrame_destruct 2705
-#define wxMDIParentFrame_ActivateNext 2706
-#define wxMDIParentFrame_ActivatePrevious 2707
-#define wxMDIParentFrame_ArrangeIcons 2708
-#define wxMDIParentFrame_Cascade 2709
-#define wxMDIParentFrame_Create 2710
-#define wxMDIParentFrame_GetActiveChild 2711
-#define wxMDIParentFrame_GetClientWindow 2712
-#define wxMDIParentFrame_Tile 2713
-#define wxMDIChildFrame_new_0 2714
-#define wxMDIChildFrame_new_4 2715
-#define wxMDIChildFrame_destruct 2716
-#define wxMDIChildFrame_Activate 2717
-#define wxMDIChildFrame_Create 2718
-#define wxMDIChildFrame_Maximize 2719
-#define wxMDIChildFrame_Restore 2720
-#define wxMDIClientWindow_new_0 2721
-#define wxMDIClientWindow_new_2 2722
-#define wxMDIClientWindow_destruct 2723
-#define wxMDIClientWindow_CreateClient 2724
-#define wxLayoutAlgorithm_new 2725
-#define wxLayoutAlgorithm_LayoutFrame 2726
-#define wxLayoutAlgorithm_LayoutMDIFrame 2727
-#define wxLayoutAlgorithm_LayoutWindow 2728
-#define wxLayoutAlgorithm_destroy 2729
-#define wxEvent_GetId 2730
-#define wxEvent_GetSkipped 2731
-#define wxEvent_GetTimestamp 2732
-#define wxEvent_IsCommandEvent 2733
-#define wxEvent_ResumePropagation 2734
-#define wxEvent_ShouldPropagate 2735
-#define wxEvent_Skip 2736
-#define wxEvent_StopPropagation 2737
-#define wxCommandEvent_getClientData 2738
-#define wxCommandEvent_GetExtraLong 2739
-#define wxCommandEvent_GetInt 2740
-#define wxCommandEvent_GetSelection 2741
-#define wxCommandEvent_GetString 2742
-#define wxCommandEvent_IsChecked 2743
-#define wxCommandEvent_IsSelection 2744
-#define wxCommandEvent_SetInt 2745
-#define wxCommandEvent_SetString 2746
-#define wxScrollEvent_GetOrientation 2747
-#define wxScrollEvent_GetPosition 2748
-#define wxScrollWinEvent_GetOrientation 2749
-#define wxScrollWinEvent_GetPosition 2750
-#define wxMouseEvent_AltDown 2751
-#define wxMouseEvent_Button 2752
-#define wxMouseEvent_ButtonDClick 2753
-#define wxMouseEvent_ButtonDown 2754
-#define wxMouseEvent_ButtonUp 2755
-#define wxMouseEvent_CmdDown 2756
-#define wxMouseEvent_ControlDown 2757
-#define wxMouseEvent_Dragging 2758
-#define wxMouseEvent_Entering 2759
-#define wxMouseEvent_GetButton 2760
-#define wxMouseEvent_GetPosition 2763
-#define wxMouseEvent_GetLogicalPosition 2764
-#define wxMouseEvent_GetLinesPerAction 2765
-#define wxMouseEvent_GetWheelRotation 2766
-#define wxMouseEvent_GetWheelDelta 2767
-#define wxMouseEvent_GetX 2768
-#define wxMouseEvent_GetY 2769
-#define wxMouseEvent_IsButton 2770
-#define wxMouseEvent_IsPageScroll 2771
-#define wxMouseEvent_Leaving 2772
-#define wxMouseEvent_LeftDClick 2773
-#define wxMouseEvent_LeftDown 2774
-#define wxMouseEvent_LeftIsDown 2775
-#define wxMouseEvent_LeftUp 2776
-#define wxMouseEvent_MetaDown 2777
-#define wxMouseEvent_MiddleDClick 2778
-#define wxMouseEvent_MiddleDown 2779
-#define wxMouseEvent_MiddleIsDown 2780
-#define wxMouseEvent_MiddleUp 2781
-#define wxMouseEvent_Moving 2782
-#define wxMouseEvent_RightDClick 2783
-#define wxMouseEvent_RightDown 2784
-#define wxMouseEvent_RightIsDown 2785
-#define wxMouseEvent_RightUp 2786
-#define wxMouseEvent_ShiftDown 2787
-#define wxSetCursorEvent_GetCursor 2788
-#define wxSetCursorEvent_GetX 2789
-#define wxSetCursorEvent_GetY 2790
-#define wxSetCursorEvent_HasCursor 2791
-#define wxSetCursorEvent_SetCursor 2792
-#define wxKeyEvent_AltDown 2793
-#define wxKeyEvent_CmdDown 2794
-#define wxKeyEvent_ControlDown 2795
-#define wxKeyEvent_GetKeyCode 2796
-#define wxKeyEvent_GetModifiers 2797
-#define wxKeyEvent_GetPosition 2800
-#define wxKeyEvent_GetRawKeyCode 2801
-#define wxKeyEvent_GetRawKeyFlags 2802
-#define wxKeyEvent_GetUnicodeKey 2803
-#define wxKeyEvent_GetX 2804
-#define wxKeyEvent_GetY 2805
-#define wxKeyEvent_HasModifiers 2806
-#define wxKeyEvent_MetaDown 2807
-#define wxKeyEvent_ShiftDown 2808
-#define wxSizeEvent_GetSize 2809
-#define wxMoveEvent_GetPosition 2810
-#define wxEraseEvent_GetDC 2811
-#define wxFocusEvent_GetWindow 2812
-#define wxChildFocusEvent_GetWindow 2813
-#define wxMenuEvent_GetMenu 2814
-#define wxMenuEvent_GetMenuId 2815
-#define wxMenuEvent_IsPopup 2816
-#define wxCloseEvent_CanVeto 2817
-#define wxCloseEvent_GetLoggingOff 2818
-#define wxCloseEvent_SetCanVeto 2819
-#define wxCloseEvent_SetLoggingOff 2820
-#define wxCloseEvent_Veto 2821
-#define wxShowEvent_SetShow 2822
-#define wxShowEvent_GetShow 2823
-#define wxIconizeEvent_Iconized 2824
-#define wxJoystickEvent_ButtonDown 2825
-#define wxJoystickEvent_ButtonIsDown 2826
-#define wxJoystickEvent_ButtonUp 2827
-#define wxJoystickEvent_GetButtonChange 2828
-#define wxJoystickEvent_GetButtonState 2829
-#define wxJoystickEvent_GetJoystick 2830
-#define wxJoystickEvent_GetPosition 2831
-#define wxJoystickEvent_GetZPosition 2832
-#define wxJoystickEvent_IsButton 2833
-#define wxJoystickEvent_IsMove 2834
-#define wxJoystickEvent_IsZMove 2835
-#define wxUpdateUIEvent_CanUpdate 2836
-#define wxUpdateUIEvent_Check 2837
-#define wxUpdateUIEvent_Enable 2838
-#define wxUpdateUIEvent_Show 2839
-#define wxUpdateUIEvent_GetChecked 2840
-#define wxUpdateUIEvent_GetEnabled 2841
-#define wxUpdateUIEvent_GetShown 2842
-#define wxUpdateUIEvent_GetSetChecked 2843
-#define wxUpdateUIEvent_GetSetEnabled 2844
-#define wxUpdateUIEvent_GetSetShown 2845
-#define wxUpdateUIEvent_GetSetText 2846
-#define wxUpdateUIEvent_GetText 2847
-#define wxUpdateUIEvent_GetMode 2848
-#define wxUpdateUIEvent_GetUpdateInterval 2849
-#define wxUpdateUIEvent_ResetUpdateTime 2850
-#define wxUpdateUIEvent_SetMode 2851
-#define wxUpdateUIEvent_SetText 2852
-#define wxUpdateUIEvent_SetUpdateInterval 2853
-#define wxMouseCaptureChangedEvent_GetCapturedWindow 2854
-#define wxPaletteChangedEvent_SetChangedWindow 2855
-#define wxPaletteChangedEvent_GetChangedWindow 2856
-#define wxQueryNewPaletteEvent_SetPaletteRealized 2857
-#define wxQueryNewPaletteEvent_GetPaletteRealized 2858
-#define wxNavigationKeyEvent_GetDirection 2859
-#define wxNavigationKeyEvent_SetDirection 2860
-#define wxNavigationKeyEvent_IsWindowChange 2861
-#define wxNavigationKeyEvent_SetWindowChange 2862
-#define wxNavigationKeyEvent_IsFromTab 2863
-#define wxNavigationKeyEvent_SetFromTab 2864
-#define wxNavigationKeyEvent_GetCurrentFocus 2865
-#define wxNavigationKeyEvent_SetCurrentFocus 2866
-#define wxHelpEvent_GetOrigin 2867
-#define wxHelpEvent_GetPosition 2868
-#define wxHelpEvent_SetOrigin 2869
-#define wxHelpEvent_SetPosition 2870
-#define wxContextMenuEvent_GetPosition 2871
-#define wxContextMenuEvent_SetPosition 2872
-#define wxIdleEvent_CanSend 2873
-#define wxIdleEvent_GetMode 2874
-#define wxIdleEvent_RequestMore 2875
-#define wxIdleEvent_MoreRequested 2876
-#define wxIdleEvent_SetMode 2877
-#define wxGridEvent_AltDown 2878
-#define wxGridEvent_ControlDown 2879
-#define wxGridEvent_GetCol 2880
-#define wxGridEvent_GetPosition 2881
-#define wxGridEvent_GetRow 2882
-#define wxGridEvent_MetaDown 2883
-#define wxGridEvent_Selecting 2884
-#define wxGridEvent_ShiftDown 2885
-#define wxNotifyEvent_Allow 2886
-#define wxNotifyEvent_IsAllowed 2887
-#define wxNotifyEvent_Veto 2888
-#define wxSashEvent_GetEdge 2889
-#define wxSashEvent_GetDragRect 2890
-#define wxSashEvent_GetDragStatus 2891
-#define wxListEvent_GetCacheFrom 2892
-#define wxListEvent_GetCacheTo 2893
-#define wxListEvent_GetKeyCode 2894
-#define wxListEvent_GetIndex 2895
-#define wxListEvent_GetColumn 2896
-#define wxListEvent_GetPoint 2897
-#define wxListEvent_GetLabel 2898
-#define wxListEvent_GetText 2899
-#define wxListEvent_GetImage 2900
-#define wxListEvent_GetData 2901
-#define wxListEvent_GetMask 2902
-#define wxListEvent_GetItem 2903
-#define wxListEvent_IsEditCancelled 2904
-#define wxDateEvent_GetDate 2905
-#define wxCalendarEvent_GetWeekDay 2906
-#define wxFileDirPickerEvent_GetPath 2907
-#define wxColourPickerEvent_GetColour 2908
-#define wxFontPickerEvent_GetFont 2909
-#define wxStyledTextEvent_GetPosition 2910
-#define wxStyledTextEvent_GetKey 2911
-#define wxStyledTextEvent_GetModifiers 2912
-#define wxStyledTextEvent_GetModificationType 2913
-#define wxStyledTextEvent_GetText 2914
-#define wxStyledTextEvent_GetLength 2915
-#define wxStyledTextEvent_GetLinesAdded 2916
-#define wxStyledTextEvent_GetLine 2917
-#define wxStyledTextEvent_GetFoldLevelNow 2918
-#define wxStyledTextEvent_GetFoldLevelPrev 2919
-#define wxStyledTextEvent_GetMargin 2920
-#define wxStyledTextEvent_GetMessage 2921
-#define wxStyledTextEvent_GetWParam 2922
-#define wxStyledTextEvent_GetLParam 2923
-#define wxStyledTextEvent_GetListType 2924
-#define wxStyledTextEvent_GetX 2925
-#define wxStyledTextEvent_GetY 2926
-#define wxStyledTextEvent_GetDragText 2927
-#define wxStyledTextEvent_GetDragAllowMove 2928
-#define wxStyledTextEvent_GetDragResult 2929
-#define wxStyledTextEvent_GetShift 2930
-#define wxStyledTextEvent_GetControl 2931
-#define wxStyledTextEvent_GetAlt 2932
-#define utils_wxGetKeyState 2933
-#define utils_wxGetMousePosition 2934
-#define utils_wxGetMouseState 2935
-#define utils_wxSetDetectableAutoRepeat 2936
-#define utils_wxBell 2937
-#define utils_wxFindMenuItemId 2938
-#define utils_wxGenericFindWindowAtPoint 2939
-#define utils_wxFindWindowAtPoint 2940
-#define utils_wxBeginBusyCursor 2941
-#define utils_wxEndBusyCursor 2942
-#define utils_wxIsBusy 2943
-#define utils_wxShutdown 2944
-#define utils_wxShell 2945
-#define utils_wxLaunchDefaultBrowser 2946
-#define utils_wxGetEmailAddress 2947
-#define utils_wxGetUserId 2948
-#define utils_wxGetHomeDir 2949
-#define utils_wxNewId 2950
-#define utils_wxRegisterId 2951
-#define utils_wxGetCurrentId 2952
-#define utils_wxGetOsDescription 2953
-#define utils_wxIsPlatformLittleEndian 2954
-#define utils_wxIsPlatform64Bit 2955
-#define gdicmn_wxDisplaySize 2956
-#define gdicmn_wxSetCursor 2957
-#define wxPrintout_new 2958
-#define wxPrintout_destruct 2959
-#define wxPrintout_GetDC 2960
-#define wxPrintout_GetPageSizeMM 2961
-#define wxPrintout_GetPageSizePixels 2962
-#define wxPrintout_GetPaperRectPixels 2963
-#define wxPrintout_GetPPIPrinter 2964
-#define wxPrintout_GetPPIScreen 2965
-#define wxPrintout_GetTitle 2966
-#define wxPrintout_IsPreview 2967
-#define wxPrintout_FitThisSizeToPaper 2968
-#define wxPrintout_FitThisSizeToPage 2969
-#define wxPrintout_FitThisSizeToPageMargins 2970
-#define wxPrintout_MapScreenSizeToPaper 2971
-#define wxPrintout_MapScreenSizeToPage 2972
-#define wxPrintout_MapScreenSizeToPageMargins 2973
-#define wxPrintout_MapScreenSizeToDevice 2974
-#define wxPrintout_GetLogicalPaperRect 2975
-#define wxPrintout_GetLogicalPageRect 2976
-#define wxPrintout_GetLogicalPageMarginsRect 2977
-#define wxPrintout_SetLogicalOrigin 2978
-#define wxPrintout_OffsetLogicalOrigin 2979
-#define wxStyledTextCtrl_new_2 2980
-#define wxStyledTextCtrl_new_0 2981
-#define wxStyledTextCtrl_destruct 2982
-#define wxStyledTextCtrl_Create 2983
-#define wxStyledTextCtrl_AddText 2984
-#define wxStyledTextCtrl_AddStyledText 2985
-#define wxStyledTextCtrl_InsertText 2986
-#define wxStyledTextCtrl_ClearAll 2987
-#define wxStyledTextCtrl_ClearDocumentStyle 2988
-#define wxStyledTextCtrl_GetLength 2989
-#define wxStyledTextCtrl_GetCharAt 2990
-#define wxStyledTextCtrl_GetCurrentPos 2991
-#define wxStyledTextCtrl_GetAnchor 2992
-#define wxStyledTextCtrl_GetStyleAt 2993
-#define wxStyledTextCtrl_Redo 2994
-#define wxStyledTextCtrl_SetUndoCollection 2995
-#define wxStyledTextCtrl_SelectAll 2996
-#define wxStyledTextCtrl_SetSavePoint 2997
-#define wxStyledTextCtrl_GetStyledText 2998
-#define wxStyledTextCtrl_CanRedo 2999
-#define wxStyledTextCtrl_MarkerLineFromHandle 3000
-#define wxStyledTextCtrl_MarkerDeleteHandle 3001
-#define wxStyledTextCtrl_GetUndoCollection 3002
-#define wxStyledTextCtrl_GetViewWhiteSpace 3003
-#define wxStyledTextCtrl_SetViewWhiteSpace 3004
-#define wxStyledTextCtrl_PositionFromPoint 3005
-#define wxStyledTextCtrl_PositionFromPointClose 3006
-#define wxStyledTextCtrl_GotoLine 3007
-#define wxStyledTextCtrl_GotoPos 3008
-#define wxStyledTextCtrl_SetAnchor 3009
-#define wxStyledTextCtrl_GetCurLine 3010
-#define wxStyledTextCtrl_GetEndStyled 3011
-#define wxStyledTextCtrl_ConvertEOLs 3012
-#define wxStyledTextCtrl_GetEOLMode 3013
-#define wxStyledTextCtrl_SetEOLMode 3014
-#define wxStyledTextCtrl_StartStyling 3015
-#define wxStyledTextCtrl_SetStyling 3016
-#define wxStyledTextCtrl_GetBufferedDraw 3017
-#define wxStyledTextCtrl_SetBufferedDraw 3018
-#define wxStyledTextCtrl_SetTabWidth 3019
-#define wxStyledTextCtrl_GetTabWidth 3020
-#define wxStyledTextCtrl_SetCodePage 3021
-#define wxStyledTextCtrl_MarkerDefine 3022
-#define wxStyledTextCtrl_MarkerSetForeground 3023
-#define wxStyledTextCtrl_MarkerSetBackground 3024
-#define wxStyledTextCtrl_MarkerAdd 3025
-#define wxStyledTextCtrl_MarkerDelete 3026
-#define wxStyledTextCtrl_MarkerDeleteAll 3027
-#define wxStyledTextCtrl_MarkerGet 3028
-#define wxStyledTextCtrl_MarkerNext 3029
-#define wxStyledTextCtrl_MarkerPrevious 3030
-#define wxStyledTextCtrl_MarkerDefineBitmap 3031
-#define wxStyledTextCtrl_MarkerAddSet 3032
-#define wxStyledTextCtrl_MarkerSetAlpha 3033
-#define wxStyledTextCtrl_SetMarginType 3034
-#define wxStyledTextCtrl_GetMarginType 3035
-#define wxStyledTextCtrl_SetMarginWidth 3036
-#define wxStyledTextCtrl_GetMarginWidth 3037
-#define wxStyledTextCtrl_SetMarginMask 3038
-#define wxStyledTextCtrl_GetMarginMask 3039
-#define wxStyledTextCtrl_SetMarginSensitive 3040
-#define wxStyledTextCtrl_GetMarginSensitive 3041
-#define wxStyledTextCtrl_StyleClearAll 3042
-#define wxStyledTextCtrl_StyleSetForeground 3043
-#define wxStyledTextCtrl_StyleSetBackground 3044
-#define wxStyledTextCtrl_StyleSetBold 3045
-#define wxStyledTextCtrl_StyleSetItalic 3046
-#define wxStyledTextCtrl_StyleSetSize 3047
-#define wxStyledTextCtrl_StyleSetFaceName 3048
-#define wxStyledTextCtrl_StyleSetEOLFilled 3049
-#define wxStyledTextCtrl_StyleResetDefault 3050
-#define wxStyledTextCtrl_StyleSetUnderline 3051
-#define wxStyledTextCtrl_StyleSetCase 3052
-#define wxStyledTextCtrl_StyleSetHotSpot 3053
-#define wxStyledTextCtrl_SetSelForeground 3054
-#define wxStyledTextCtrl_SetSelBackground 3055
-#define wxStyledTextCtrl_GetSelAlpha 3056
-#define wxStyledTextCtrl_SetSelAlpha 3057
-#define wxStyledTextCtrl_SetCaretForeground 3058
-#define wxStyledTextCtrl_CmdKeyAssign 3059
-#define wxStyledTextCtrl_CmdKeyClear 3060
-#define wxStyledTextCtrl_CmdKeyClearAll 3061
-#define wxStyledTextCtrl_SetStyleBytes 3062
-#define wxStyledTextCtrl_StyleSetVisible 3063
-#define wxStyledTextCtrl_GetCaretPeriod 3064
-#define wxStyledTextCtrl_SetCaretPeriod 3065
-#define wxStyledTextCtrl_SetWordChars 3066
-#define wxStyledTextCtrl_BeginUndoAction 3067
-#define wxStyledTextCtrl_EndUndoAction 3068
-#define wxStyledTextCtrl_IndicatorSetStyle 3069
-#define wxStyledTextCtrl_IndicatorGetStyle 3070
-#define wxStyledTextCtrl_IndicatorSetForeground 3071
-#define wxStyledTextCtrl_IndicatorGetForeground 3072
-#define wxStyledTextCtrl_SetWhitespaceForeground 3073
-#define wxStyledTextCtrl_SetWhitespaceBackground 3074
-#define wxStyledTextCtrl_GetStyleBits 3075
-#define wxStyledTextCtrl_SetLineState 3076
-#define wxStyledTextCtrl_GetLineState 3077
-#define wxStyledTextCtrl_GetMaxLineState 3078
-#define wxStyledTextCtrl_GetCaretLineVisible 3079
-#define wxStyledTextCtrl_SetCaretLineVisible 3080
-#define wxStyledTextCtrl_GetCaretLineBackground 3081
-#define wxStyledTextCtrl_SetCaretLineBackground 3082
-#define wxStyledTextCtrl_AutoCompShow 3083
-#define wxStyledTextCtrl_AutoCompCancel 3084
-#define wxStyledTextCtrl_AutoCompActive 3085
-#define wxStyledTextCtrl_AutoCompPosStart 3086
-#define wxStyledTextCtrl_AutoCompComplete 3087
-#define wxStyledTextCtrl_AutoCompStops 3088
-#define wxStyledTextCtrl_AutoCompSetSeparator 3089
-#define wxStyledTextCtrl_AutoCompGetSeparator 3090
-#define wxStyledTextCtrl_AutoCompSelect 3091
-#define wxStyledTextCtrl_AutoCompSetCancelAtStart 3092
-#define wxStyledTextCtrl_AutoCompGetCancelAtStart 3093
-#define wxStyledTextCtrl_AutoCompSetFillUps 3094
-#define wxStyledTextCtrl_AutoCompSetChooseSingle 3095
-#define wxStyledTextCtrl_AutoCompGetChooseSingle 3096
-#define wxStyledTextCtrl_AutoCompSetIgnoreCase 3097
-#define wxStyledTextCtrl_AutoCompGetIgnoreCase 3098
-#define wxStyledTextCtrl_UserListShow 3099
-#define wxStyledTextCtrl_AutoCompSetAutoHide 3100
-#define wxStyledTextCtrl_AutoCompGetAutoHide 3101
-#define wxStyledTextCtrl_AutoCompSetDropRestOfWord 3102
-#define wxStyledTextCtrl_AutoCompGetDropRestOfWord 3103
-#define wxStyledTextCtrl_RegisterImage 3104
-#define wxStyledTextCtrl_ClearRegisteredImages 3105
-#define wxStyledTextCtrl_AutoCompGetTypeSeparator 3106
-#define wxStyledTextCtrl_AutoCompSetTypeSeparator 3107
-#define wxStyledTextCtrl_AutoCompSetMaxWidth 3108
-#define wxStyledTextCtrl_AutoCompGetMaxWidth 3109
-#define wxStyledTextCtrl_AutoCompSetMaxHeight 3110
-#define wxStyledTextCtrl_AutoCompGetMaxHeight 3111
-#define wxStyledTextCtrl_SetIndent 3112
-#define wxStyledTextCtrl_GetIndent 3113
-#define wxStyledTextCtrl_SetUseTabs 3114
-#define wxStyledTextCtrl_GetUseTabs 3115
-#define wxStyledTextCtrl_SetLineIndentation 3116
-#define wxStyledTextCtrl_GetLineIndentation 3117
-#define wxStyledTextCtrl_GetLineIndentPosition 3118
-#define wxStyledTextCtrl_GetColumn 3119
-#define wxStyledTextCtrl_SetUseHorizontalScrollBar 3120
-#define wxStyledTextCtrl_GetUseHorizontalScrollBar 3121
-#define wxStyledTextCtrl_SetIndentationGuides 3122
-#define wxStyledTextCtrl_GetIndentationGuides 3123
-#define wxStyledTextCtrl_SetHighlightGuide 3124
-#define wxStyledTextCtrl_GetHighlightGuide 3125
-#define wxStyledTextCtrl_GetLineEndPosition 3126
-#define wxStyledTextCtrl_GetCodePage 3127
-#define wxStyledTextCtrl_GetCaretForeground 3128
-#define wxStyledTextCtrl_GetReadOnly 3129
-#define wxStyledTextCtrl_SetCurrentPos 3130
-#define wxStyledTextCtrl_SetSelectionStart 3131
-#define wxStyledTextCtrl_GetSelectionStart 3132
-#define wxStyledTextCtrl_SetSelectionEnd 3133
-#define wxStyledTextCtrl_GetSelectionEnd 3134
-#define wxStyledTextCtrl_SetPrintMagnification 3135
-#define wxStyledTextCtrl_GetPrintMagnification 3136
-#define wxStyledTextCtrl_SetPrintColourMode 3137
-#define wxStyledTextCtrl_GetPrintColourMode 3138
-#define wxStyledTextCtrl_FindText 3139
-#define wxStyledTextCtrl_FormatRange 3140
-#define wxStyledTextCtrl_GetFirstVisibleLine 3141
-#define wxStyledTextCtrl_GetLine 3142
-#define wxStyledTextCtrl_GetLineCount 3143
-#define wxStyledTextCtrl_SetMarginLeft 3144
-#define wxStyledTextCtrl_GetMarginLeft 3145
-#define wxStyledTextCtrl_SetMarginRight 3146
-#define wxStyledTextCtrl_GetMarginRight 3147
-#define wxStyledTextCtrl_GetModify 3148
-#define wxStyledTextCtrl_SetSelection 3149
-#define wxStyledTextCtrl_GetSelectedText 3150
-#define wxStyledTextCtrl_GetTextRange 3151
-#define wxStyledTextCtrl_HideSelection 3152
-#define wxStyledTextCtrl_LineFromPosition 3153
-#define wxStyledTextCtrl_PositionFromLine 3154
-#define wxStyledTextCtrl_LineScroll 3155
-#define wxStyledTextCtrl_EnsureCaretVisible 3156
-#define wxStyledTextCtrl_ReplaceSelection 3157
-#define wxStyledTextCtrl_SetReadOnly 3158
-#define wxStyledTextCtrl_CanPaste 3159
-#define wxStyledTextCtrl_CanUndo 3160
-#define wxStyledTextCtrl_EmptyUndoBuffer 3161
-#define wxStyledTextCtrl_Undo 3162
-#define wxStyledTextCtrl_Cut 3163
-#define wxStyledTextCtrl_Copy 3164
-#define wxStyledTextCtrl_Paste 3165
-#define wxStyledTextCtrl_Clear 3166
-#define wxStyledTextCtrl_SetText 3167
-#define wxStyledTextCtrl_GetText 3168
-#define wxStyledTextCtrl_GetTextLength 3169
-#define wxStyledTextCtrl_GetOvertype 3170
-#define wxStyledTextCtrl_SetCaretWidth 3171
-#define wxStyledTextCtrl_GetCaretWidth 3172
-#define wxStyledTextCtrl_SetTargetStart 3173
-#define wxStyledTextCtrl_GetTargetStart 3174
-#define wxStyledTextCtrl_SetTargetEnd 3175
-#define wxStyledTextCtrl_GetTargetEnd 3176
-#define wxStyledTextCtrl_ReplaceTarget 3177
-#define wxStyledTextCtrl_SearchInTarget 3178
-#define wxStyledTextCtrl_SetSearchFlags 3179
-#define wxStyledTextCtrl_GetSearchFlags 3180
-#define wxStyledTextCtrl_CallTipShow 3181
-#define wxStyledTextCtrl_CallTipCancel 3182
-#define wxStyledTextCtrl_CallTipActive 3183
-#define wxStyledTextCtrl_CallTipPosAtStart 3184
-#define wxStyledTextCtrl_CallTipSetHighlight 3185
-#define wxStyledTextCtrl_CallTipSetBackground 3186
-#define wxStyledTextCtrl_CallTipSetForeground 3187
-#define wxStyledTextCtrl_CallTipSetForegroundHighlight 3188
-#define wxStyledTextCtrl_CallTipUseStyle 3189
-#define wxStyledTextCtrl_VisibleFromDocLine 3190
-#define wxStyledTextCtrl_DocLineFromVisible 3191
-#define wxStyledTextCtrl_WrapCount 3192
-#define wxStyledTextCtrl_SetFoldLevel 3193
-#define wxStyledTextCtrl_GetFoldLevel 3194
-#define wxStyledTextCtrl_GetLastChild 3195
-#define wxStyledTextCtrl_GetFoldParent 3196
-#define wxStyledTextCtrl_ShowLines 3197
-#define wxStyledTextCtrl_HideLines 3198
-#define wxStyledTextCtrl_GetLineVisible 3199
-#define wxStyledTextCtrl_SetFoldExpanded 3200
-#define wxStyledTextCtrl_GetFoldExpanded 3201
-#define wxStyledTextCtrl_ToggleFold 3202
-#define wxStyledTextCtrl_EnsureVisible 3203
-#define wxStyledTextCtrl_SetFoldFlags 3204
-#define wxStyledTextCtrl_EnsureVisibleEnforcePolicy 3205
-#define wxStyledTextCtrl_SetTabIndents 3206
-#define wxStyledTextCtrl_GetTabIndents 3207
-#define wxStyledTextCtrl_SetBackSpaceUnIndents 3208
-#define wxStyledTextCtrl_GetBackSpaceUnIndents 3209
-#define wxStyledTextCtrl_SetMouseDwellTime 3210
-#define wxStyledTextCtrl_GetMouseDwellTime 3211
-#define wxStyledTextCtrl_WordStartPosition 3212
-#define wxStyledTextCtrl_WordEndPosition 3213
-#define wxStyledTextCtrl_SetWrapMode 3214
-#define wxStyledTextCtrl_GetWrapMode 3215
-#define wxStyledTextCtrl_SetWrapVisualFlags 3216
-#define wxStyledTextCtrl_GetWrapVisualFlags 3217
-#define wxStyledTextCtrl_SetWrapVisualFlagsLocation 3218
-#define wxStyledTextCtrl_GetWrapVisualFlagsLocation 3219
-#define wxStyledTextCtrl_SetWrapStartIndent 3220
-#define wxStyledTextCtrl_GetWrapStartIndent 3221
-#define wxStyledTextCtrl_SetLayoutCache 3222
-#define wxStyledTextCtrl_GetLayoutCache 3223
-#define wxStyledTextCtrl_SetScrollWidth 3224
-#define wxStyledTextCtrl_GetScrollWidth 3225
-#define wxStyledTextCtrl_TextWidth 3226
-#define wxStyledTextCtrl_GetEndAtLastLine 3227
-#define wxStyledTextCtrl_TextHeight 3228
-#define wxStyledTextCtrl_SetUseVerticalScrollBar 3229
-#define wxStyledTextCtrl_GetUseVerticalScrollBar 3230
-#define wxStyledTextCtrl_AppendText 3231
-#define wxStyledTextCtrl_GetTwoPhaseDraw 3232
-#define wxStyledTextCtrl_SetTwoPhaseDraw 3233
-#define wxStyledTextCtrl_TargetFromSelection 3234
-#define wxStyledTextCtrl_LinesJoin 3235
-#define wxStyledTextCtrl_LinesSplit 3236
-#define wxStyledTextCtrl_SetFoldMarginColour 3237
-#define wxStyledTextCtrl_SetFoldMarginHiColour 3238
-#define wxStyledTextCtrl_LineDown 3239
-#define wxStyledTextCtrl_LineDownExtend 3240
-#define wxStyledTextCtrl_LineUp 3241
-#define wxStyledTextCtrl_LineUpExtend 3242
-#define wxStyledTextCtrl_CharLeft 3243
-#define wxStyledTextCtrl_CharLeftExtend 3244
-#define wxStyledTextCtrl_CharRight 3245
-#define wxStyledTextCtrl_CharRightExtend 3246
-#define wxStyledTextCtrl_WordLeft 3247
-#define wxStyledTextCtrl_WordLeftExtend 3248
-#define wxStyledTextCtrl_WordRight 3249
-#define wxStyledTextCtrl_WordRightExtend 3250
-#define wxStyledTextCtrl_Home 3251
-#define wxStyledTextCtrl_HomeExtend 3252
-#define wxStyledTextCtrl_LineEnd 3253
-#define wxStyledTextCtrl_LineEndExtend 3254
-#define wxStyledTextCtrl_DocumentStart 3255
-#define wxStyledTextCtrl_DocumentStartExtend 3256
-#define wxStyledTextCtrl_DocumentEnd 3257
-#define wxStyledTextCtrl_DocumentEndExtend 3258
-#define wxStyledTextCtrl_PageUp 3259
-#define wxStyledTextCtrl_PageUpExtend 3260
-#define wxStyledTextCtrl_PageDown 3261
-#define wxStyledTextCtrl_PageDownExtend 3262
-#define wxStyledTextCtrl_EditToggleOvertype 3263
-#define wxStyledTextCtrl_Cancel 3264
-#define wxStyledTextCtrl_DeleteBack 3265
-#define wxStyledTextCtrl_Tab 3266
-#define wxStyledTextCtrl_BackTab 3267
-#define wxStyledTextCtrl_NewLine 3268
-#define wxStyledTextCtrl_FormFeed 3269
-#define wxStyledTextCtrl_VCHome 3270
-#define wxStyledTextCtrl_VCHomeExtend 3271
-#define wxStyledTextCtrl_ZoomIn 3272
-#define wxStyledTextCtrl_ZoomOut 3273
-#define wxStyledTextCtrl_DelWordLeft 3274
-#define wxStyledTextCtrl_DelWordRight 3275
-#define wxStyledTextCtrl_LineCut 3276
-#define wxStyledTextCtrl_LineDelete 3277
-#define wxStyledTextCtrl_LineTranspose 3278
-#define wxStyledTextCtrl_LineDuplicate 3279
-#define wxStyledTextCtrl_LowerCase 3280
-#define wxStyledTextCtrl_UpperCase 3281
-#define wxStyledTextCtrl_LineScrollDown 3282
-#define wxStyledTextCtrl_LineScrollUp 3283
-#define wxStyledTextCtrl_DeleteBackNotLine 3284
-#define wxStyledTextCtrl_HomeDisplay 3285
-#define wxStyledTextCtrl_HomeDisplayExtend 3286
-#define wxStyledTextCtrl_LineEndDisplay 3287
-#define wxStyledTextCtrl_LineEndDisplayExtend 3288
-#define wxStyledTextCtrl_HomeWrapExtend 3289
-#define wxStyledTextCtrl_LineEndWrap 3290
-#define wxStyledTextCtrl_LineEndWrapExtend 3291
-#define wxStyledTextCtrl_VCHomeWrap 3292
-#define wxStyledTextCtrl_VCHomeWrapExtend 3293
-#define wxStyledTextCtrl_LineCopy 3294
-#define wxStyledTextCtrl_MoveCaretInsideView 3295
-#define wxStyledTextCtrl_LineLength 3296
-#define wxStyledTextCtrl_BraceHighlight 3297
-#define wxStyledTextCtrl_BraceBadLight 3298
-#define wxStyledTextCtrl_BraceMatch 3299
-#define wxStyledTextCtrl_GetViewEOL 3300
-#define wxStyledTextCtrl_SetViewEOL 3301
-#define wxStyledTextCtrl_SetModEventMask 3302
-#define wxStyledTextCtrl_GetEdgeColumn 3303
-#define wxStyledTextCtrl_SetEdgeColumn 3304
-#define wxStyledTextCtrl_SetEdgeMode 3305
-#define wxStyledTextCtrl_GetEdgeMode 3306
-#define wxStyledTextCtrl_GetEdgeColour 3307
-#define wxStyledTextCtrl_SetEdgeColour 3308
-#define wxStyledTextCtrl_SearchAnchor 3309
-#define wxStyledTextCtrl_SearchNext 3310
-#define wxStyledTextCtrl_SearchPrev 3311
-#define wxStyledTextCtrl_LinesOnScreen 3312
-#define wxStyledTextCtrl_UsePopUp 3313
-#define wxStyledTextCtrl_SelectionIsRectangle 3314
-#define wxStyledTextCtrl_SetZoom 3315
-#define wxStyledTextCtrl_GetZoom 3316
-#define wxStyledTextCtrl_GetModEventMask 3317
-#define wxStyledTextCtrl_SetSTCFocus 3318
-#define wxStyledTextCtrl_GetSTCFocus 3319
-#define wxStyledTextCtrl_SetStatus 3320
-#define wxStyledTextCtrl_GetStatus 3321
-#define wxStyledTextCtrl_SetMouseDownCaptures 3322
-#define wxStyledTextCtrl_GetMouseDownCaptures 3323
-#define wxStyledTextCtrl_SetSTCCursor 3324
-#define wxStyledTextCtrl_GetSTCCursor 3325
-#define wxStyledTextCtrl_SetControlCharSymbol 3326
-#define wxStyledTextCtrl_GetControlCharSymbol 3327
-#define wxStyledTextCtrl_WordPartLeft 3328
-#define wxStyledTextCtrl_WordPartLeftExtend 3329
-#define wxStyledTextCtrl_WordPartRight 3330
-#define wxStyledTextCtrl_WordPartRightExtend 3331
-#define wxStyledTextCtrl_SetVisiblePolicy 3332
-#define wxStyledTextCtrl_DelLineLeft 3333
-#define wxStyledTextCtrl_DelLineRight 3334
-#define wxStyledTextCtrl_GetXOffset 3335
-#define wxStyledTextCtrl_ChooseCaretX 3336
-#define wxStyledTextCtrl_SetXCaretPolicy 3337
-#define wxStyledTextCtrl_SetYCaretPolicy 3338
-#define wxStyledTextCtrl_GetPrintWrapMode 3339
-#define wxStyledTextCtrl_SetHotspotActiveForeground 3340
-#define wxStyledTextCtrl_SetHotspotActiveBackground 3341
-#define wxStyledTextCtrl_SetHotspotActiveUnderline 3342
-#define wxStyledTextCtrl_SetHotspotSingleLine 3343
-#define wxStyledTextCtrl_ParaDownExtend 3344
-#define wxStyledTextCtrl_ParaUp 3345
-#define wxStyledTextCtrl_ParaUpExtend 3346
-#define wxStyledTextCtrl_PositionBefore 3347
-#define wxStyledTextCtrl_PositionAfter 3348
-#define wxStyledTextCtrl_CopyRange 3349
-#define wxStyledTextCtrl_CopyText 3350
-#define wxStyledTextCtrl_SetSelectionMode 3351
-#define wxStyledTextCtrl_GetSelectionMode 3352
-#define wxStyledTextCtrl_LineDownRectExtend 3353
-#define wxStyledTextCtrl_LineUpRectExtend 3354
-#define wxStyledTextCtrl_CharLeftRectExtend 3355
-#define wxStyledTextCtrl_CharRightRectExtend 3356
-#define wxStyledTextCtrl_HomeRectExtend 3357
-#define wxStyledTextCtrl_VCHomeRectExtend 3358
-#define wxStyledTextCtrl_LineEndRectExtend 3359
-#define wxStyledTextCtrl_PageUpRectExtend 3360
-#define wxStyledTextCtrl_PageDownRectExtend 3361
-#define wxStyledTextCtrl_StutteredPageUp 3362
-#define wxStyledTextCtrl_StutteredPageUpExtend 3363
-#define wxStyledTextCtrl_StutteredPageDown 3364
-#define wxStyledTextCtrl_StutteredPageDownExtend 3365
-#define wxStyledTextCtrl_WordLeftEnd 3366
-#define wxStyledTextCtrl_WordLeftEndExtend 3367
-#define wxStyledTextCtrl_WordRightEnd 3368
-#define wxStyledTextCtrl_WordRightEndExtend 3369
-#define wxStyledTextCtrl_SetWhitespaceChars 3370
-#define wxStyledTextCtrl_SetCharsDefault 3371
-#define wxStyledTextCtrl_AutoCompGetCurrent 3372
-#define wxStyledTextCtrl_Allocate 3373
-#define wxStyledTextCtrl_FindColumn 3374
-#define wxStyledTextCtrl_GetCaretSticky 3375
-#define wxStyledTextCtrl_SetCaretSticky 3376
-#define wxStyledTextCtrl_ToggleCaretSticky 3377
-#define wxStyledTextCtrl_SetPasteConvertEndings 3378
-#define wxStyledTextCtrl_GetPasteConvertEndings 3379
-#define wxStyledTextCtrl_SelectionDuplicate 3380
-#define wxStyledTextCtrl_SetCaretLineBackAlpha 3381
-#define wxStyledTextCtrl_GetCaretLineBackAlpha 3382
-#define wxStyledTextCtrl_StartRecord 3383
-#define wxStyledTextCtrl_StopRecord 3384
-#define wxStyledTextCtrl_SetLexer 3385
-#define wxStyledTextCtrl_GetLexer 3386
-#define wxStyledTextCtrl_Colourise 3387
-#define wxStyledTextCtrl_SetProperty 3388
-#define wxStyledTextCtrl_SetKeyWords 3389
-#define wxStyledTextCtrl_SetLexerLanguage 3390
-#define wxStyledTextCtrl_GetProperty 3391
-#define wxStyledTextCtrl_GetStyleBitsNeeded 3392
-#define wxStyledTextCtrl_GetCurrentLine 3393
-#define wxStyledTextCtrl_StyleSetSpec 3394
-#define wxStyledTextCtrl_StyleSetFont 3395
-#define wxStyledTextCtrl_StyleSetFontAttr 3396
-#define wxStyledTextCtrl_StyleSetCharacterSet 3397
-#define wxStyledTextCtrl_StyleSetFontEncoding 3398
-#define wxStyledTextCtrl_CmdKeyExecute 3399
-#define wxStyledTextCtrl_SetMargins 3400
-#define wxStyledTextCtrl_GetSelection 3401
-#define wxStyledTextCtrl_PointFromPosition 3402
-#define wxStyledTextCtrl_ScrollToLine 3403
-#define wxStyledTextCtrl_ScrollToColumn 3404
-#define wxStyledTextCtrl_SetVScrollBar 3405
-#define wxStyledTextCtrl_SetHScrollBar 3406
-#define wxStyledTextCtrl_GetLastKeydownProcessed 3407
-#define wxStyledTextCtrl_SetLastKeydownProcessed 3408
-#define wxStyledTextCtrl_SaveFile 3409
-#define wxStyledTextCtrl_LoadFile 3410
-#define wxStyledTextCtrl_DoDragOver 3411
-#define wxStyledTextCtrl_DoDropText 3412
-#define wxStyledTextCtrl_GetUseAntiAliasing 3413
-#define wxStyledTextCtrl_AddTextRaw 3414
-#define wxStyledTextCtrl_InsertTextRaw 3415
-#define wxStyledTextCtrl_GetCurLineRaw 3416
-#define wxStyledTextCtrl_GetLineRaw 3417
-#define wxStyledTextCtrl_GetSelectedTextRaw 3418
-#define wxStyledTextCtrl_GetTextRangeRaw 3419
-#define wxStyledTextCtrl_SetTextRaw 3420
-#define wxStyledTextCtrl_GetTextRaw 3421
-#define wxStyledTextCtrl_AppendTextRaw 3422
-#define wxArtProvider_GetBitmap 3423
-#define wxArtProvider_GetIcon 3424
-#define wxTreeEvent_GetKeyCode 3425
-#define wxTreeEvent_GetItem 3426
-#define wxTreeEvent_GetKeyEvent 3427
-#define wxTreeEvent_GetLabel 3428
-#define wxTreeEvent_GetOldItem 3429
-#define wxTreeEvent_GetPoint 3430
-#define wxTreeEvent_IsEditCancelled 3431
-#define wxTreeEvent_SetToolTip 3432
-#define wxNotebookEvent_GetOldSelection 3433
-#define wxNotebookEvent_GetSelection 3434
-#define wxNotebookEvent_SetOldSelection 3435
-#define wxNotebookEvent_SetSelection 3436
-#define wxFileDataObject_new 3437
-#define wxFileDataObject_AddFile 3438
-#define wxFileDataObject_GetFilenames 3439
-#define wxFileDataObject_destroy 3440
-#define wxTextDataObject_new 3441
-#define wxTextDataObject_GetTextLength 3442
-#define wxTextDataObject_GetText 3443
-#define wxTextDataObject_SetText 3444
-#define wxTextDataObject_destroy 3445
-#define wxBitmapDataObject_new_1_1 3446
-#define wxBitmapDataObject_new_1_0 3447
-#define wxBitmapDataObject_GetBitmap 3448
-#define wxBitmapDataObject_SetBitmap 3449
-#define wxBitmapDataObject_destroy 3450
-#define wxClipboard_new 3452
-#define wxClipboard_destruct 3453
-#define wxClipboard_AddData 3454
-#define wxClipboard_Clear 3455
-#define wxClipboard_Close 3456
-#define wxClipboard_Flush 3457
-#define wxClipboard_GetData 3458
-#define wxClipboard_IsOpened 3459
-#define wxClipboard_Open 3460
-#define wxClipboard_SetData 3461
-#define wxClipboard_UsePrimarySelection 3463
-#define wxClipboard_IsSupported 3464
-#define wxClipboard_Get 3465
-#define wxSpinEvent_GetPosition 3466
-#define wxSpinEvent_SetPosition 3467
-#define wxSplitterWindow_new_0 3468
-#define wxSplitterWindow_new_2 3469
-#define wxSplitterWindow_destruct 3470
-#define wxSplitterWindow_Create 3471
-#define wxSplitterWindow_GetMinimumPaneSize 3472
-#define wxSplitterWindow_GetSashGravity 3473
-#define wxSplitterWindow_GetSashPosition 3474
-#define wxSplitterWindow_GetSplitMode 3475
-#define wxSplitterWindow_GetWindow1 3476
-#define wxSplitterWindow_GetWindow2 3477
-#define wxSplitterWindow_Initialize 3478
-#define wxSplitterWindow_IsSplit 3479
-#define wxSplitterWindow_ReplaceWindow 3480
-#define wxSplitterWindow_SetSashGravity 3481
-#define wxSplitterWindow_SetSashPosition 3482
-#define wxSplitterWindow_SetSashSize 3483
-#define wxSplitterWindow_SetMinimumPaneSize 3484
-#define wxSplitterWindow_SetSplitMode 3485
-#define wxSplitterWindow_SplitHorizontally 3486
-#define wxSplitterWindow_SplitVertically 3487
-#define wxSplitterWindow_Unsplit 3488
-#define wxSplitterWindow_UpdateSize 3489
-#define wxSplitterEvent_GetSashPosition 3490
-#define wxSplitterEvent_GetX 3491
-#define wxSplitterEvent_GetY 3492
-#define wxSplitterEvent_GetWindowBeingRemoved 3493
-#define wxSplitterEvent_SetSashPosition 3494
-#define wxHtmlWindow_new_0 3495
-#define wxHtmlWindow_new_2 3496
-#define wxHtmlWindow_AppendToPage 3497
-#define wxHtmlWindow_GetOpenedAnchor 3498
-#define wxHtmlWindow_GetOpenedPage 3499
-#define wxHtmlWindow_GetOpenedPageTitle 3500
-#define wxHtmlWindow_GetRelatedFrame 3501
-#define wxHtmlWindow_HistoryBack 3502
-#define wxHtmlWindow_HistoryCanBack 3503
-#define wxHtmlWindow_HistoryCanForward 3504
-#define wxHtmlWindow_HistoryClear 3505
-#define wxHtmlWindow_HistoryForward 3506
-#define wxHtmlWindow_LoadFile 3507
-#define wxHtmlWindow_LoadPage 3508
-#define wxHtmlWindow_SelectAll 3509
-#define wxHtmlWindow_SelectionToText 3510
-#define wxHtmlWindow_SelectLine 3511
-#define wxHtmlWindow_SelectWord 3512
-#define wxHtmlWindow_SetBorders 3513
-#define wxHtmlWindow_SetFonts 3514
-#define wxHtmlWindow_SetPage 3515
-#define wxHtmlWindow_SetRelatedFrame 3516
-#define wxHtmlWindow_SetRelatedStatusBar 3517
-#define wxHtmlWindow_ToText 3518
-#define wxHtmlWindow_destroy 3519
-#define wxHtmlLinkEvent_GetLinkInfo 3520
-#define wxSystemSettings_GetColour 3521
-#define wxSystemSettings_GetFont 3522
-#define wxSystemSettings_GetMetric 3523
-#define wxSystemSettings_GetScreenType 3524
-#define wxSystemOptions_GetOption 3525
-#define wxSystemOptions_GetOptionInt 3526
-#define wxSystemOptions_HasOption 3527
-#define wxSystemOptions_IsFalse 3528
-#define wxSystemOptions_SetOption_2_1 3529
-#define wxSystemOptions_SetOption_2_0 3530
-#define wxAuiNotebookEvent_SetSelection 3531
-#define wxAuiNotebookEvent_GetSelection 3532
-#define wxAuiNotebookEvent_SetOldSelection 3533
-#define wxAuiNotebookEvent_GetOldSelection 3534
-#define wxAuiNotebookEvent_SetDragSource 3535
-#define wxAuiNotebookEvent_GetDragSource 3536
-#define wxAuiManagerEvent_SetManager 3537
-#define wxAuiManagerEvent_GetManager 3538
-#define wxAuiManagerEvent_SetPane 3539
-#define wxAuiManagerEvent_GetPane 3540
-#define wxAuiManagerEvent_SetButton 3541
-#define wxAuiManagerEvent_GetButton 3542
-#define wxAuiManagerEvent_SetDC 3543
-#define wxAuiManagerEvent_GetDC 3544
-#define wxAuiManagerEvent_Veto 3545
-#define wxAuiManagerEvent_GetVeto 3546
-#define wxAuiManagerEvent_SetCanVeto 3547
-#define wxAuiManagerEvent_CanVeto 3548
-#define wxLogNull_new 3549
-#define wxLogNull_destroy 3550
-#define wxTaskBarIcon_new 3551
-#define wxTaskBarIcon_destruct 3552
-#define wxTaskBarIcon_PopupMenu 3553
-#define wxTaskBarIcon_RemoveIcon 3554
-#define wxTaskBarIcon_SetIcon 3555
-#define wxLocale_new_0 3556
-#define wxLocale_new_2 3558
-#define wxLocale_destruct 3559
-#define wxLocale_Init 3561
-#define wxLocale_AddCatalog_1 3562
-#define wxLocale_AddCatalog_3 3563
-#define wxLocale_AddCatalogLookupPathPrefix 3564
-#define wxLocale_GetCanonicalName 3565
-#define wxLocale_GetLanguage 3566
-#define wxLocale_GetLanguageName 3567
-#define wxLocale_GetLocale 3568
-#define wxLocale_GetName 3569
-#define wxLocale_GetString_2 3570
-#define wxLocale_GetString_4 3571
-#define wxLocale_GetHeaderValue 3572
-#define wxLocale_GetSysName 3573
-#define wxLocale_GetSystemEncoding 3574
-#define wxLocale_GetSystemEncodingName 3575
-#define wxLocale_GetSystemLanguage 3576
-#define wxLocale_IsLoaded 3577
-#define wxLocale_IsOk 3578
-#define wxActivateEvent_GetActive 3579
-#define wxPopupWindow_new_2 3581
-#define wxPopupWindow_new_0 3582
-#define wxPopupWindow_destruct 3584
-#define wxPopupWindow_Create 3585
-#define wxPopupWindow_Position 3586
-#define wxPopupTransientWindow_new_0 3587
-#define wxPopupTransientWindow_new_2 3588
-#define wxPopupTransientWindow_destruct 3589
-#define wxPopupTransientWindow_Popup 3590
-#define wxPopupTransientWindow_Dismiss 3591
-#define wxOverlay_new 3592
-#define wxOverlay_destruct 3593
-#define wxOverlay_Reset 3594
-#define wxDCOverlay_new_6 3595
-#define wxDCOverlay_new_2 3596
-#define wxDCOverlay_destruct 3597
-#define wxDCOverlay_Clear 3598
+#define wxGauge_GetRange 1605
+#define wxGauge_GetValue 1606
+#define wxGauge_IsVertical 1607
+#define wxGauge_SetRange 1608
+#define wxGauge_SetValue 1609
+#define wxGauge_Pulse 1610
+#define wxGauge_destroy 1611
+#define wxGenericDirCtrl_new_0 1612
+#define wxGenericDirCtrl_new_2 1613
+#define wxGenericDirCtrl_destruct 1614
+#define wxGenericDirCtrl_Create 1615
+#define wxGenericDirCtrl_Init 1616
+#define wxGenericDirCtrl_CollapseTree 1617
+#define wxGenericDirCtrl_ExpandPath 1618
+#define wxGenericDirCtrl_GetDefaultPath 1619
+#define wxGenericDirCtrl_GetPath 1620
+#define wxGenericDirCtrl_GetFilePath 1621
+#define wxGenericDirCtrl_GetFilter 1622
+#define wxGenericDirCtrl_GetFilterIndex 1623
+#define wxGenericDirCtrl_GetRootId 1624
+#define wxGenericDirCtrl_GetTreeCtrl 1625
+#define wxGenericDirCtrl_ReCreateTree 1626
+#define wxGenericDirCtrl_SetDefaultPath 1627
+#define wxGenericDirCtrl_SetFilter 1628
+#define wxGenericDirCtrl_SetFilterIndex 1629
+#define wxGenericDirCtrl_SetPath 1630
+#define wxStaticBox_new_4 1632
+#define wxStaticBox_new_0 1633
+#define wxStaticBox_Create 1634
+#define wxStaticBox_destroy 1635
+#define wxStaticLine_new_2 1637
+#define wxStaticLine_new_0 1638
+#define wxStaticLine_Create 1639
+#define wxStaticLine_IsVertical 1640
+#define wxStaticLine_GetDefaultSize 1641
+#define wxStaticLine_destroy 1642
+#define wxListBox_new_3 1645
+#define wxListBox_new_0 1646
+#define wxListBox_destruct 1648
+#define wxListBox_Create 1650
+#define wxListBox_Deselect 1651
+#define wxListBox_GetSelections 1652
+#define wxListBox_InsertItems 1653
+#define wxListBox_IsSelected 1654
+#define wxListBox_Set 1655
+#define wxListBox_HitTest 1656
+#define wxListBox_SetFirstItem_1_0 1657
+#define wxListBox_SetFirstItem_1_1 1658
+#define wxListCtrl_new_0 1659
+#define wxListCtrl_new_2 1660
+#define wxListCtrl_Arrange 1661
+#define wxListCtrl_AssignImageList 1662
+#define wxListCtrl_ClearAll 1663
+#define wxListCtrl_Create 1664
+#define wxListCtrl_DeleteAllItems 1665
+#define wxListCtrl_DeleteColumn 1666
+#define wxListCtrl_DeleteItem 1667
+#define wxListCtrl_EditLabel 1668
+#define wxListCtrl_EnsureVisible 1669
+#define wxListCtrl_FindItem_3_0 1670
+#define wxListCtrl_FindItem_3_1 1671
+#define wxListCtrl_GetColumn 1672
+#define wxListCtrl_GetColumnCount 1673
+#define wxListCtrl_GetColumnWidth 1674
+#define wxListCtrl_GetCountPerPage 1675
+#define wxListCtrl_GetEditControl 1676
+#define wxListCtrl_GetImageList 1677
+#define wxListCtrl_GetItem 1678
+#define wxListCtrl_GetItemBackgroundColour 1679
+#define wxListCtrl_GetItemCount 1680
+#define wxListCtrl_GetItemData 1681
+#define wxListCtrl_GetItemFont 1682
+#define wxListCtrl_GetItemPosition 1683
+#define wxListCtrl_GetItemRect 1684
+#define wxListCtrl_GetItemSpacing 1685
+#define wxListCtrl_GetItemState 1686
+#define wxListCtrl_GetItemText 1687
+#define wxListCtrl_GetItemTextColour 1688
+#define wxListCtrl_GetNextItem 1689
+#define wxListCtrl_GetSelectedItemCount 1690
+#define wxListCtrl_GetTextColour 1691
+#define wxListCtrl_GetTopItem 1692
+#define wxListCtrl_GetViewRect 1693
+#define wxListCtrl_HitTest 1694
+#define wxListCtrl_InsertColumn_2 1695
+#define wxListCtrl_InsertColumn_3 1696
+#define wxListCtrl_InsertItem_1 1697
+#define wxListCtrl_InsertItem_2_1 1698
+#define wxListCtrl_InsertItem_2_0 1699
+#define wxListCtrl_InsertItem_3 1700
+#define wxListCtrl_RefreshItem 1701
+#define wxListCtrl_RefreshItems 1702
+#define wxListCtrl_ScrollList 1703
+#define wxListCtrl_SetBackgroundColour 1704
+#define wxListCtrl_SetColumn 1705
+#define wxListCtrl_SetColumnWidth 1706
+#define wxListCtrl_SetImageList 1707
+#define wxListCtrl_SetItem_1 1708
+#define wxListCtrl_SetItem_4 1709
+#define wxListCtrl_SetItemBackgroundColour 1710
+#define wxListCtrl_SetItemCount 1711
+#define wxListCtrl_SetItemData 1712
+#define wxListCtrl_SetItemFont 1713
+#define wxListCtrl_SetItemImage 1714
+#define wxListCtrl_SetItemColumnImage 1715
+#define wxListCtrl_SetItemPosition 1716
+#define wxListCtrl_SetItemState 1717
+#define wxListCtrl_SetItemText 1718
+#define wxListCtrl_SetItemTextColour 1719
+#define wxListCtrl_SetSingleStyle 1720
+#define wxListCtrl_SetTextColour 1721
+#define wxListCtrl_SetWindowStyleFlag 1722
+#define wxListCtrl_SortItems 1723
+#define wxListCtrl_destroy 1724
+#define wxListView_ClearColumnImage 1725
+#define wxListView_Focus 1726
+#define wxListView_GetFirstSelected 1727
+#define wxListView_GetFocusedItem 1728
+#define wxListView_GetNextSelected 1729
+#define wxListView_IsSelected 1730
+#define wxListView_Select 1731
+#define wxListView_SetColumnImage 1732
+#define wxListItem_new_0 1733
+#define wxListItem_new_1 1734
+#define wxListItem_destruct 1735
+#define wxListItem_Clear 1736
+#define wxListItem_GetAlign 1737
+#define wxListItem_GetBackgroundColour 1738
+#define wxListItem_GetColumn 1739
+#define wxListItem_GetFont 1740
+#define wxListItem_GetId 1741
+#define wxListItem_GetImage 1742
+#define wxListItem_GetMask 1743
+#define wxListItem_GetState 1744
+#define wxListItem_GetText 1745
+#define wxListItem_GetTextColour 1746
+#define wxListItem_GetWidth 1747
+#define wxListItem_SetAlign 1748
+#define wxListItem_SetBackgroundColour 1749
+#define wxListItem_SetColumn 1750
+#define wxListItem_SetFont 1751
+#define wxListItem_SetId 1752
+#define wxListItem_SetImage 1753
+#define wxListItem_SetMask 1754
+#define wxListItem_SetState 1755
+#define wxListItem_SetStateMask 1756
+#define wxListItem_SetText 1757
+#define wxListItem_SetTextColour 1758
+#define wxListItem_SetWidth 1759
+#define wxListItemAttr_new_0 1760
+#define wxListItemAttr_new_3 1761
+#define wxListItemAttr_GetBackgroundColour 1762
+#define wxListItemAttr_GetFont 1763
+#define wxListItemAttr_GetTextColour 1764
+#define wxListItemAttr_HasBackgroundColour 1765
+#define wxListItemAttr_HasFont 1766
+#define wxListItemAttr_HasTextColour 1767
+#define wxListItemAttr_SetBackgroundColour 1768
+#define wxListItemAttr_SetFont 1769
+#define wxListItemAttr_SetTextColour 1770
+#define wxListItemAttr_destroy 1771
+#define wxImageList_new_0 1772
+#define wxImageList_new_3 1773
+#define wxImageList_Add_1 1774
+#define wxImageList_Add_2_0 1775
+#define wxImageList_Add_2_1 1776
+#define wxImageList_Create 1777
+#define wxImageList_Draw 1779
+#define wxImageList_GetBitmap 1780
+#define wxImageList_GetIcon 1781
+#define wxImageList_GetImageCount 1782
+#define wxImageList_GetSize 1783
+#define wxImageList_Remove 1784
+#define wxImageList_RemoveAll 1785
+#define wxImageList_Replace_2 1786
+#define wxImageList_Replace_3 1787
+#define wxImageList_destroy 1788
+#define wxTextAttr_new_0 1789
+#define wxTextAttr_new_2 1790
+#define wxTextAttr_GetAlignment 1791
+#define wxTextAttr_GetBackgroundColour 1792
+#define wxTextAttr_GetFont 1793
+#define wxTextAttr_GetLeftIndent 1794
+#define wxTextAttr_GetLeftSubIndent 1795
+#define wxTextAttr_GetRightIndent 1796
+#define wxTextAttr_GetTabs 1797
+#define wxTextAttr_GetTextColour 1798
+#define wxTextAttr_HasBackgroundColour 1799
+#define wxTextAttr_HasFont 1800
+#define wxTextAttr_HasTextColour 1801
+#define wxTextAttr_GetFlags 1802
+#define wxTextAttr_IsDefault 1803
+#define wxTextAttr_SetAlignment 1804
+#define wxTextAttr_SetBackgroundColour 1805
+#define wxTextAttr_SetFlags 1806
+#define wxTextAttr_SetFont 1807
+#define wxTextAttr_SetLeftIndent 1808
+#define wxTextAttr_SetRightIndent 1809
+#define wxTextAttr_SetTabs 1810
+#define wxTextAttr_SetTextColour 1811
+#define wxTextAttr_destroy 1812
+#define wxTextCtrl_new_3 1814
+#define wxTextCtrl_new_0 1815
+#define wxTextCtrl_destruct 1817
+#define wxTextCtrl_AppendText 1818
+#define wxTextCtrl_CanCopy 1819
+#define wxTextCtrl_CanCut 1820
+#define wxTextCtrl_CanPaste 1821
+#define wxTextCtrl_CanRedo 1822
+#define wxTextCtrl_CanUndo 1823
+#define wxTextCtrl_Clear 1824
+#define wxTextCtrl_Copy 1825
+#define wxTextCtrl_Create 1826
+#define wxTextCtrl_Cut 1827
+#define wxTextCtrl_DiscardEdits 1828
+#define wxTextCtrl_ChangeValue 1829
+#define wxTextCtrl_EmulateKeyPress 1830
+#define wxTextCtrl_GetDefaultStyle 1831
+#define wxTextCtrl_GetInsertionPoint 1832
+#define wxTextCtrl_GetLastPosition 1833
+#define wxTextCtrl_GetLineLength 1834
+#define wxTextCtrl_GetLineText 1835
+#define wxTextCtrl_GetNumberOfLines 1836
+#define wxTextCtrl_GetRange 1837
+#define wxTextCtrl_GetSelection 1838
+#define wxTextCtrl_GetStringSelection 1839
+#define wxTextCtrl_GetStyle 1840
+#define wxTextCtrl_GetValue 1841
+#define wxTextCtrl_IsEditable 1842
+#define wxTextCtrl_IsModified 1843
+#define wxTextCtrl_IsMultiLine 1844
+#define wxTextCtrl_IsSingleLine 1845
+#define wxTextCtrl_LoadFile 1846
+#define wxTextCtrl_MarkDirty 1847
+#define wxTextCtrl_Paste 1848
+#define wxTextCtrl_PositionToXY 1849
+#define wxTextCtrl_Redo 1850
+#define wxTextCtrl_Remove 1851
+#define wxTextCtrl_Replace 1852
+#define wxTextCtrl_SaveFile 1853
+#define wxTextCtrl_SetDefaultStyle 1854
+#define wxTextCtrl_SetEditable 1855
+#define wxTextCtrl_SetInsertionPoint 1856
+#define wxTextCtrl_SetInsertionPointEnd 1857
+#define wxTextCtrl_SetMaxLength 1859
+#define wxTextCtrl_SetSelection 1860
+#define wxTextCtrl_SetStyle 1861
+#define wxTextCtrl_SetValue 1862
+#define wxTextCtrl_ShowPosition 1863
+#define wxTextCtrl_Undo 1864
+#define wxTextCtrl_WriteText 1865
+#define wxTextCtrl_XYToPosition 1866
+#define wxNotebook_new_0 1869
+#define wxNotebook_new_3 1870
+#define wxNotebook_destruct 1871
+#define wxNotebook_AddPage 1872
+#define wxNotebook_AdvanceSelection 1873
+#define wxNotebook_AssignImageList 1874
+#define wxNotebook_Create 1875
+#define wxNotebook_DeleteAllPages 1876
+#define wxNotebook_DeletePage 1877
+#define wxNotebook_RemovePage 1878
+#define wxNotebook_GetCurrentPage 1879
+#define wxNotebook_GetImageList 1880
+#define wxNotebook_GetPage 1882
+#define wxNotebook_GetPageCount 1883
+#define wxNotebook_GetPageImage 1884
+#define wxNotebook_GetPageText 1885
+#define wxNotebook_GetRowCount 1886
+#define wxNotebook_GetSelection 1887
+#define wxNotebook_GetThemeBackgroundColour 1888
+#define wxNotebook_HitTest 1890
+#define wxNotebook_InsertPage 1892
+#define wxNotebook_SetImageList 1893
+#define wxNotebook_SetPadding 1894
+#define wxNotebook_SetPageSize 1895
+#define wxNotebook_SetPageImage 1896
+#define wxNotebook_SetPageText 1897
+#define wxNotebook_SetSelection 1898
+#define wxNotebook_ChangeSelection 1899
+#define wxChoicebook_new_0 1900
+#define wxChoicebook_new_3 1901
+#define wxChoicebook_AddPage 1902
+#define wxChoicebook_AdvanceSelection 1903
+#define wxChoicebook_AssignImageList 1904
+#define wxChoicebook_Create 1905
+#define wxChoicebook_DeleteAllPages 1906
+#define wxChoicebook_DeletePage 1907
+#define wxChoicebook_RemovePage 1908
+#define wxChoicebook_GetCurrentPage 1909
+#define wxChoicebook_GetImageList 1910
+#define wxChoicebook_GetPage 1912
+#define wxChoicebook_GetPageCount 1913
+#define wxChoicebook_GetPageImage 1914
+#define wxChoicebook_GetPageText 1915
+#define wxChoicebook_GetSelection 1916
+#define wxChoicebook_HitTest 1917
+#define wxChoicebook_InsertPage 1918
+#define wxChoicebook_SetImageList 1919
+#define wxChoicebook_SetPageSize 1920
+#define wxChoicebook_SetPageImage 1921
+#define wxChoicebook_SetPageText 1922
+#define wxChoicebook_SetSelection 1923
+#define wxChoicebook_ChangeSelection 1924
+#define wxChoicebook_destroy 1925
+#define wxToolbook_new_0 1926
+#define wxToolbook_new_3 1927
+#define wxToolbook_AddPage 1928
+#define wxToolbook_AdvanceSelection 1929
+#define wxToolbook_AssignImageList 1930
+#define wxToolbook_Create 1931
+#define wxToolbook_DeleteAllPages 1932
+#define wxToolbook_DeletePage 1933
+#define wxToolbook_RemovePage 1934
+#define wxToolbook_GetCurrentPage 1935
+#define wxToolbook_GetImageList 1936
+#define wxToolbook_GetPage 1938
+#define wxToolbook_GetPageCount 1939
+#define wxToolbook_GetPageImage 1940
+#define wxToolbook_GetPageText 1941
+#define wxToolbook_GetSelection 1942
+#define wxToolbook_HitTest 1944
+#define wxToolbook_InsertPage 1945
+#define wxToolbook_SetImageList 1946
+#define wxToolbook_SetPageSize 1947
+#define wxToolbook_SetPageImage 1948
+#define wxToolbook_SetPageText 1949
+#define wxToolbook_SetSelection 1950
+#define wxToolbook_ChangeSelection 1951
+#define wxToolbook_destroy 1952
+#define wxListbook_new_0 1953
+#define wxListbook_new_3 1954
+#define wxListbook_AddPage 1955
+#define wxListbook_AdvanceSelection 1956
+#define wxListbook_AssignImageList 1957
+#define wxListbook_Create 1958
+#define wxListbook_DeleteAllPages 1959
+#define wxListbook_DeletePage 1960
+#define wxListbook_RemovePage 1961
+#define wxListbook_GetCurrentPage 1962
+#define wxListbook_GetImageList 1963
+#define wxListbook_GetPage 1965
+#define wxListbook_GetPageCount 1966
+#define wxListbook_GetPageImage 1967
+#define wxListbook_GetPageText 1968
+#define wxListbook_GetSelection 1969
+#define wxListbook_HitTest 1971
+#define wxListbook_InsertPage 1972
+#define wxListbook_SetImageList 1973
+#define wxListbook_SetPageSize 1974
+#define wxListbook_SetPageImage 1975
+#define wxListbook_SetPageText 1976
+#define wxListbook_SetSelection 1977
+#define wxListbook_ChangeSelection 1978
+#define wxListbook_destroy 1979
+#define wxTreebook_new_0 1980
+#define wxTreebook_new_3 1981
+#define wxTreebook_AddPage 1982
+#define wxTreebook_AdvanceSelection 1983
+#define wxTreebook_AssignImageList 1984
+#define wxTreebook_Create 1985
+#define wxTreebook_DeleteAllPages 1986
+#define wxTreebook_DeletePage 1987
+#define wxTreebook_RemovePage 1988
+#define wxTreebook_GetCurrentPage 1989
+#define wxTreebook_GetImageList 1990
+#define wxTreebook_GetPage 1992
+#define wxTreebook_GetPageCount 1993
+#define wxTreebook_GetPageImage 1994
+#define wxTreebook_GetPageText 1995
+#define wxTreebook_GetSelection 1996
+#define wxTreebook_ExpandNode 1997
+#define wxTreebook_IsNodeExpanded 1998
+#define wxTreebook_HitTest 2000
+#define wxTreebook_InsertPage 2001
+#define wxTreebook_InsertSubPage 2002
+#define wxTreebook_SetImageList 2003
+#define wxTreebook_SetPageSize 2004
+#define wxTreebook_SetPageImage 2005
+#define wxTreebook_SetPageText 2006
+#define wxTreebook_SetSelection 2007
+#define wxTreebook_ChangeSelection 2008
+#define wxTreebook_destroy 2009
+#define wxTreeCtrl_new_2 2012
+#define wxTreeCtrl_new_0 2013
+#define wxTreeCtrl_destruct 2015
+#define wxTreeCtrl_AddRoot 2016
+#define wxTreeCtrl_AppendItem 2017
+#define wxTreeCtrl_AssignImageList 2018
+#define wxTreeCtrl_AssignStateImageList 2019
+#define wxTreeCtrl_Collapse 2020
+#define wxTreeCtrl_CollapseAndReset 2021
+#define wxTreeCtrl_Create 2022
+#define wxTreeCtrl_Delete 2023
+#define wxTreeCtrl_DeleteAllItems 2024
+#define wxTreeCtrl_DeleteChildren 2025
+#define wxTreeCtrl_EditLabel 2026
+#define wxTreeCtrl_EnsureVisible 2027
+#define wxTreeCtrl_Expand 2028
+#define wxTreeCtrl_GetBoundingRect 2029
+#define wxTreeCtrl_GetChildrenCount 2031
+#define wxTreeCtrl_GetCount 2032
+#define wxTreeCtrl_GetEditControl 2033
+#define wxTreeCtrl_GetFirstChild 2034
+#define wxTreeCtrl_GetNextChild 2035
+#define wxTreeCtrl_GetFirstVisibleItem 2036
+#define wxTreeCtrl_GetImageList 2037
+#define wxTreeCtrl_GetIndent 2038
+#define wxTreeCtrl_GetItemBackgroundColour 2039
+#define wxTreeCtrl_GetItemData 2040
+#define wxTreeCtrl_GetItemFont 2041
+#define wxTreeCtrl_GetItemImage_1 2042
+#define wxTreeCtrl_GetItemImage_2 2043
+#define wxTreeCtrl_GetItemText 2044
+#define wxTreeCtrl_GetItemTextColour 2045
+#define wxTreeCtrl_GetLastChild 2046
+#define wxTreeCtrl_GetNextSibling 2047
+#define wxTreeCtrl_GetNextVisible 2048
+#define wxTreeCtrl_GetItemParent 2049
+#define wxTreeCtrl_GetPrevSibling 2050
+#define wxTreeCtrl_GetPrevVisible 2051
+#define wxTreeCtrl_GetRootItem 2052
+#define wxTreeCtrl_GetSelection 2053
+#define wxTreeCtrl_GetSelections 2054
+#define wxTreeCtrl_GetStateImageList 2055
+#define wxTreeCtrl_HitTest 2056
+#define wxTreeCtrl_InsertItem 2058
+#define wxTreeCtrl_IsBold 2059
+#define wxTreeCtrl_IsExpanded 2060
+#define wxTreeCtrl_IsSelected 2061
+#define wxTreeCtrl_IsVisible 2062
+#define wxTreeCtrl_ItemHasChildren 2063
+#define wxTreeCtrl_IsTreeItemIdOk 2064
+#define wxTreeCtrl_PrependItem 2065
+#define wxTreeCtrl_ScrollTo 2066
+#define wxTreeCtrl_SelectItem_1 2067
+#define wxTreeCtrl_SelectItem_2 2068
+#define wxTreeCtrl_SetIndent 2069
+#define wxTreeCtrl_SetImageList 2070
+#define wxTreeCtrl_SetItemBackgroundColour 2071
+#define wxTreeCtrl_SetItemBold 2072
+#define wxTreeCtrl_SetItemData 2073
+#define wxTreeCtrl_SetItemDropHighlight 2074
+#define wxTreeCtrl_SetItemFont 2075
+#define wxTreeCtrl_SetItemHasChildren 2076
+#define wxTreeCtrl_SetItemImage_2 2077
+#define wxTreeCtrl_SetItemImage_3 2078
+#define wxTreeCtrl_SetItemText 2079
+#define wxTreeCtrl_SetItemTextColour 2080
+#define wxTreeCtrl_SetStateImageList 2081
+#define wxTreeCtrl_SetWindowStyle 2082
+#define wxTreeCtrl_SortChildren 2083
+#define wxTreeCtrl_Toggle 2084
+#define wxTreeCtrl_ToggleItemSelection 2085
+#define wxTreeCtrl_Unselect 2086
+#define wxTreeCtrl_UnselectAll 2087
+#define wxTreeCtrl_UnselectItem 2088
+#define wxScrollBar_new_0 2089
+#define wxScrollBar_new_3 2090
+#define wxScrollBar_destruct 2091
+#define wxScrollBar_Create 2092
+#define wxScrollBar_GetRange 2093
+#define wxScrollBar_GetPageSize 2094
+#define wxScrollBar_GetThumbPosition 2095
+#define wxScrollBar_GetThumbSize 2096
+#define wxScrollBar_SetThumbPosition 2097
+#define wxScrollBar_SetScrollbar 2098
+#define wxSpinButton_new_2 2100
+#define wxSpinButton_new_0 2101
+#define wxSpinButton_Create 2102
+#define wxSpinButton_GetMax 2103
+#define wxSpinButton_GetMin 2104
+#define wxSpinButton_GetValue 2105
+#define wxSpinButton_SetRange 2106
+#define wxSpinButton_SetValue 2107
+#define wxSpinButton_destroy 2108
+#define wxSpinCtrl_new_0 2109
+#define wxSpinCtrl_new_2 2110
+#define wxSpinCtrl_Create 2112
+#define wxSpinCtrl_SetValue_1_1 2115
+#define wxSpinCtrl_SetValue_1_0 2116
+#define wxSpinCtrl_GetValue 2118
+#define wxSpinCtrl_SetRange 2120
+#define wxSpinCtrl_SetSelection 2121
+#define wxSpinCtrl_GetMin 2123
+#define wxSpinCtrl_GetMax 2125
+#define wxSpinCtrl_destroy 2126
+#define wxStaticText_new_0 2127
+#define wxStaticText_new_4 2128
+#define wxStaticText_Create 2129
+#define wxStaticText_GetLabel 2130
+#define wxStaticText_SetLabel 2131
+#define wxStaticText_Wrap 2132
+#define wxStaticText_destroy 2133
+#define wxStaticBitmap_new_0 2134
+#define wxStaticBitmap_new_4 2135
+#define wxStaticBitmap_Create 2136
+#define wxStaticBitmap_GetBitmap 2137
+#define wxStaticBitmap_SetBitmap 2138
+#define wxStaticBitmap_destroy 2139
+#define wxRadioBox_new 2140
+#define wxRadioBox_destruct 2142
+#define wxRadioBox_Create 2143
+#define wxRadioBox_Enable_2 2144
+#define wxRadioBox_Enable_1 2145
+#define wxRadioBox_GetSelection 2146
+#define wxRadioBox_GetString 2147
+#define wxRadioBox_SetSelection 2148
+#define wxRadioBox_Show_2 2149
+#define wxRadioBox_Show_1 2150
+#define wxRadioBox_GetColumnCount 2151
+#define wxRadioBox_GetItemHelpText 2152
+#define wxRadioBox_GetItemToolTip 2153
+#define wxRadioBox_GetItemFromPoint 2155
+#define wxRadioBox_GetRowCount 2156
+#define wxRadioBox_IsItemEnabled 2157
+#define wxRadioBox_IsItemShown 2158
+#define wxRadioBox_SetItemHelpText 2159
+#define wxRadioBox_SetItemToolTip 2160
+#define wxRadioButton_new_0 2161
+#define wxRadioButton_new_4 2162
+#define wxRadioButton_Create 2163
+#define wxRadioButton_GetValue 2164
+#define wxRadioButton_SetValue 2165
+#define wxRadioButton_destroy 2166
+#define wxSlider_new_6 2168
+#define wxSlider_new_0 2169
+#define wxSlider_Create 2170
+#define wxSlider_GetLineSize 2171
+#define wxSlider_GetMax 2172
+#define wxSlider_GetMin 2173
+#define wxSlider_GetPageSize 2174
+#define wxSlider_GetThumbLength 2175
+#define wxSlider_GetValue 2176
+#define wxSlider_SetLineSize 2177
+#define wxSlider_SetPageSize 2178
+#define wxSlider_SetRange 2179
+#define wxSlider_SetThumbLength 2180
+#define wxSlider_SetValue 2181
+#define wxSlider_destroy 2182
+#define wxDialog_new_4 2184
+#define wxDialog_new_0 2185
+#define wxDialog_destruct 2187
+#define wxDialog_Create 2188
+#define wxDialog_CreateButtonSizer 2189
+#define wxDialog_CreateStdDialogButtonSizer 2190
+#define wxDialog_EndModal 2191
+#define wxDialog_GetAffirmativeId 2192
+#define wxDialog_GetReturnCode 2193
+#define wxDialog_IsModal 2194
+#define wxDialog_SetAffirmativeId 2195
+#define wxDialog_SetReturnCode 2196
+#define wxDialog_Show 2197
+#define wxDialog_ShowModal 2198
+#define wxColourDialog_new_0 2199
+#define wxColourDialog_new_2 2200
+#define wxColourDialog_destruct 2201
+#define wxColourDialog_Create 2202
+#define wxColourDialog_GetColourData 2203
+#define wxColourData_new_0 2204
+#define wxColourData_new_1 2205
+#define wxColourData_destruct 2206
+#define wxColourData_GetChooseFull 2207
+#define wxColourData_GetColour 2208
+#define wxColourData_GetCustomColour 2210
+#define wxColourData_SetChooseFull 2211
+#define wxColourData_SetColour 2212
+#define wxColourData_SetCustomColour 2213
+#define wxPalette_new_0 2214
+#define wxPalette_new_4 2215
+#define wxPalette_destruct 2217
+#define wxPalette_Create 2218
+#define wxPalette_GetColoursCount 2219
+#define wxPalette_GetPixel 2220
+#define wxPalette_GetRGB 2221
+#define wxPalette_IsOk 2222
+#define wxDirDialog_new 2226
+#define wxDirDialog_destruct 2227
+#define wxDirDialog_GetPath 2228
+#define wxDirDialog_GetMessage 2229
+#define wxDirDialog_SetMessage 2230
+#define wxDirDialog_SetPath 2231
+#define wxFileDialog_new 2235
+#define wxFileDialog_destruct 2236
+#define wxFileDialog_GetDirectory 2237
+#define wxFileDialog_GetFilename 2238
+#define wxFileDialog_GetFilenames 2239
+#define wxFileDialog_GetFilterIndex 2240
+#define wxFileDialog_GetMessage 2241
+#define wxFileDialog_GetPath 2242
+#define wxFileDialog_GetPaths 2243
+#define wxFileDialog_GetWildcard 2244
+#define wxFileDialog_SetDirectory 2245
+#define wxFileDialog_SetFilename 2246
+#define wxFileDialog_SetFilterIndex 2247
+#define wxFileDialog_SetMessage 2248
+#define wxFileDialog_SetPath 2249
+#define wxFileDialog_SetWildcard 2250
+#define wxPickerBase_SetInternalMargin 2251
+#define wxPickerBase_GetInternalMargin 2252
+#define wxPickerBase_SetTextCtrlProportion 2253
+#define wxPickerBase_SetPickerCtrlProportion 2254
+#define wxPickerBase_GetTextCtrlProportion 2255
+#define wxPickerBase_GetPickerCtrlProportion 2256
+#define wxPickerBase_HasTextCtrl 2257
+#define wxPickerBase_GetTextCtrl 2258
+#define wxPickerBase_IsTextCtrlGrowable 2259
+#define wxPickerBase_SetPickerCtrlGrowable 2260
+#define wxPickerBase_SetTextCtrlGrowable 2261
+#define wxPickerBase_IsPickerCtrlGrowable 2262
+#define wxFilePickerCtrl_new_0 2263
+#define wxFilePickerCtrl_new_3 2264
+#define wxFilePickerCtrl_Create 2265
+#define wxFilePickerCtrl_GetPath 2266
+#define wxFilePickerCtrl_SetPath 2267
+#define wxFilePickerCtrl_destroy 2268
+#define wxDirPickerCtrl_new_0 2269
+#define wxDirPickerCtrl_new_3 2270
+#define wxDirPickerCtrl_Create 2271
+#define wxDirPickerCtrl_GetPath 2272
+#define wxDirPickerCtrl_SetPath 2273
+#define wxDirPickerCtrl_destroy 2274
+#define wxColourPickerCtrl_new_0 2275
+#define wxColourPickerCtrl_new_3 2276
+#define wxColourPickerCtrl_Create 2277
+#define wxColourPickerCtrl_GetColour 2278
+#define wxColourPickerCtrl_SetColour_1_1 2279
+#define wxColourPickerCtrl_SetColour_1_0 2280
+#define wxColourPickerCtrl_destroy 2281
+#define wxDatePickerCtrl_new_0 2282
+#define wxDatePickerCtrl_new_3 2283
+#define wxDatePickerCtrl_GetRange 2284
+#define wxDatePickerCtrl_GetValue 2285
+#define wxDatePickerCtrl_SetRange 2286
+#define wxDatePickerCtrl_SetValue 2287
+#define wxDatePickerCtrl_destroy 2288
+#define wxFontPickerCtrl_new_0 2289
+#define wxFontPickerCtrl_new_3 2290
+#define wxFontPickerCtrl_Create 2291
+#define wxFontPickerCtrl_GetSelectedFont 2292
+#define wxFontPickerCtrl_SetSelectedFont 2293
+#define wxFontPickerCtrl_GetMaxPointSize 2294
+#define wxFontPickerCtrl_SetMaxPointSize 2295
+#define wxFontPickerCtrl_destroy 2296
+#define wxFindReplaceDialog_new_0 2299
+#define wxFindReplaceDialog_new_4 2300
+#define wxFindReplaceDialog_destruct 2301
+#define wxFindReplaceDialog_Create 2302
+#define wxFindReplaceDialog_GetData 2303
+#define wxFindReplaceData_new_0 2304
+#define wxFindReplaceData_new_1 2305
+#define wxFindReplaceData_GetFindString 2306
+#define wxFindReplaceData_GetReplaceString 2307
+#define wxFindReplaceData_GetFlags 2308
+#define wxFindReplaceData_SetFlags 2309
+#define wxFindReplaceData_SetFindString 2310
+#define wxFindReplaceData_SetReplaceString 2311
+#define wxFindReplaceData_destroy 2312
+#define wxMultiChoiceDialog_new_0 2313
+#define wxMultiChoiceDialog_new_5 2315
+#define wxMultiChoiceDialog_GetSelections 2316
+#define wxMultiChoiceDialog_SetSelections 2317
+#define wxMultiChoiceDialog_destroy 2318
+#define wxSingleChoiceDialog_new_0 2319
+#define wxSingleChoiceDialog_new_5 2321
+#define wxSingleChoiceDialog_GetSelection 2322
+#define wxSingleChoiceDialog_GetStringSelection 2323
+#define wxSingleChoiceDialog_SetSelection 2324
+#define wxSingleChoiceDialog_destroy 2325
+#define wxTextEntryDialog_new 2326
+#define wxTextEntryDialog_GetValue 2327
+#define wxTextEntryDialog_SetValue 2328
+#define wxTextEntryDialog_destroy 2329
+#define wxPasswordEntryDialog_new 2330
+#define wxPasswordEntryDialog_destroy 2331
+#define wxFontData_new_0 2332
+#define wxFontData_new_1 2333
+#define wxFontData_destruct 2334
+#define wxFontData_EnableEffects 2335
+#define wxFontData_GetAllowSymbols 2336
+#define wxFontData_GetColour 2337
+#define wxFontData_GetChosenFont 2338
+#define wxFontData_GetEnableEffects 2339
+#define wxFontData_GetInitialFont 2340
+#define wxFontData_GetShowHelp 2341
+#define wxFontData_SetAllowSymbols 2342
+#define wxFontData_SetChosenFont 2343
+#define wxFontData_SetColour 2344
+#define wxFontData_SetInitialFont 2345
+#define wxFontData_SetRange 2346
+#define wxFontData_SetShowHelp 2347
+#define wxFontDialog_new_0 2351
+#define wxFontDialog_new_2 2353
+#define wxFontDialog_Create 2355
+#define wxFontDialog_GetFontData 2356
+#define wxFontDialog_destroy 2358
+#define wxProgressDialog_new 2359
+#define wxProgressDialog_destruct 2360
+#define wxProgressDialog_Resume 2361
+#define wxProgressDialog_Update_2 2362
+#define wxProgressDialog_Update_0 2363
+#define wxMessageDialog_new 2364
+#define wxMessageDialog_destruct 2365
+#define wxPageSetupDialog_new 2366
+#define wxPageSetupDialog_destruct 2367
+#define wxPageSetupDialog_GetPageSetupData 2368
+#define wxPageSetupDialog_ShowModal 2369
+#define wxPageSetupDialogData_new_0 2370
+#define wxPageSetupDialogData_new_1_0 2371
+#define wxPageSetupDialogData_new_1_1 2372
+#define wxPageSetupDialogData_destruct 2373
+#define wxPageSetupDialogData_EnableHelp 2374
+#define wxPageSetupDialogData_EnableMargins 2375
+#define wxPageSetupDialogData_EnableOrientation 2376
+#define wxPageSetupDialogData_EnablePaper 2377
+#define wxPageSetupDialogData_EnablePrinter 2378
+#define wxPageSetupDialogData_GetDefaultMinMargins 2379
+#define wxPageSetupDialogData_GetEnableMargins 2380
+#define wxPageSetupDialogData_GetEnableOrientation 2381
+#define wxPageSetupDialogData_GetEnablePaper 2382
+#define wxPageSetupDialogData_GetEnablePrinter 2383
+#define wxPageSetupDialogData_GetEnableHelp 2384
+#define wxPageSetupDialogData_GetDefaultInfo 2385
+#define wxPageSetupDialogData_GetMarginTopLeft 2386
+#define wxPageSetupDialogData_GetMarginBottomRight 2387
+#define wxPageSetupDialogData_GetMinMarginTopLeft 2388
+#define wxPageSetupDialogData_GetMinMarginBottomRight 2389
+#define wxPageSetupDialogData_GetPaperId 2390
+#define wxPageSetupDialogData_GetPaperSize 2391
+#define wxPageSetupDialogData_GetPrintData 2393
+#define wxPageSetupDialogData_IsOk 2394
+#define wxPageSetupDialogData_SetDefaultInfo 2395
+#define wxPageSetupDialogData_SetDefaultMinMargins 2396
+#define wxPageSetupDialogData_SetMarginTopLeft 2397
+#define wxPageSetupDialogData_SetMarginBottomRight 2398
+#define wxPageSetupDialogData_SetMinMarginTopLeft 2399
+#define wxPageSetupDialogData_SetMinMarginBottomRight 2400
+#define wxPageSetupDialogData_SetPaperId 2401
+#define wxPageSetupDialogData_SetPaperSize_1_1 2402
+#define wxPageSetupDialogData_SetPaperSize_1_0 2403
+#define wxPageSetupDialogData_SetPrintData 2404
+#define wxPrintDialog_new_2_0 2405
+#define wxPrintDialog_new_2_1 2406
+#define wxPrintDialog_destruct 2407
+#define wxPrintDialog_GetPrintDialogData 2408
+#define wxPrintDialog_GetPrintDC 2409
+#define wxPrintDialogData_new_0 2410
+#define wxPrintDialogData_new_1_1 2411
+#define wxPrintDialogData_new_1_0 2412
+#define wxPrintDialogData_destruct 2413
+#define wxPrintDialogData_EnableHelp 2414
+#define wxPrintDialogData_EnablePageNumbers 2415
+#define wxPrintDialogData_EnablePrintToFile 2416
+#define wxPrintDialogData_EnableSelection 2417
+#define wxPrintDialogData_GetAllPages 2418
+#define wxPrintDialogData_GetCollate 2419
+#define wxPrintDialogData_GetFromPage 2420
+#define wxPrintDialogData_GetMaxPage 2421
+#define wxPrintDialogData_GetMinPage 2422
+#define wxPrintDialogData_GetNoCopies 2423
+#define wxPrintDialogData_GetPrintData 2424
+#define wxPrintDialogData_GetPrintToFile 2425
+#define wxPrintDialogData_GetSelection 2426
+#define wxPrintDialogData_GetToPage 2427
+#define wxPrintDialogData_IsOk 2428
+#define wxPrintDialogData_SetCollate 2429
+#define wxPrintDialogData_SetFromPage 2430
+#define wxPrintDialogData_SetMaxPage 2431
+#define wxPrintDialogData_SetMinPage 2432
+#define wxPrintDialogData_SetNoCopies 2433
+#define wxPrintDialogData_SetPrintData 2434
+#define wxPrintDialogData_SetPrintToFile 2435
+#define wxPrintDialogData_SetSelection 2436
+#define wxPrintDialogData_SetToPage 2437
+#define wxPrintData_new_0 2438
+#define wxPrintData_new_1 2439
+#define wxPrintData_destruct 2440
+#define wxPrintData_GetCollate 2441
+#define wxPrintData_GetBin 2442
+#define wxPrintData_GetColour 2443
+#define wxPrintData_GetDuplex 2444
+#define wxPrintData_GetNoCopies 2445
+#define wxPrintData_GetOrientation 2446
+#define wxPrintData_GetPaperId 2447
+#define wxPrintData_GetPrinterName 2448
+#define wxPrintData_GetQuality 2449
+#define wxPrintData_IsOk 2450
+#define wxPrintData_SetBin 2451
+#define wxPrintData_SetCollate 2452
+#define wxPrintData_SetColour 2453
+#define wxPrintData_SetDuplex 2454
+#define wxPrintData_SetNoCopies 2455
+#define wxPrintData_SetOrientation 2456
+#define wxPrintData_SetPaperId 2457
+#define wxPrintData_SetPrinterName 2458
+#define wxPrintData_SetQuality 2459
+#define wxPrintPreview_new_2 2462
+#define wxPrintPreview_new_3 2463
+#define wxPrintPreview_destruct 2465
+#define wxPrintPreview_GetCanvas 2466
+#define wxPrintPreview_GetCurrentPage 2467
+#define wxPrintPreview_GetFrame 2468
+#define wxPrintPreview_GetMaxPage 2469
+#define wxPrintPreview_GetMinPage 2470
+#define wxPrintPreview_GetPrintout 2471
+#define wxPrintPreview_GetPrintoutForPrinting 2472
+#define wxPrintPreview_IsOk 2473
+#define wxPrintPreview_PaintPage 2474
+#define wxPrintPreview_Print 2475
+#define wxPrintPreview_RenderPage 2476
+#define wxPrintPreview_SetCanvas 2477
+#define wxPrintPreview_SetCurrentPage 2478
+#define wxPrintPreview_SetFrame 2479
+#define wxPrintPreview_SetPrintout 2480
+#define wxPrintPreview_SetZoom 2481
+#define wxPreviewFrame_new 2482
+#define wxPreviewFrame_destruct 2483
+#define wxPreviewFrame_CreateControlBar 2484
+#define wxPreviewFrame_CreateCanvas 2485
+#define wxPreviewFrame_Initialize 2486
+#define wxPreviewFrame_OnCloseWindow 2487
+#define wxPreviewControlBar_new 2488
+#define wxPreviewControlBar_destruct 2489
+#define wxPreviewControlBar_CreateButtons 2490
+#define wxPreviewControlBar_GetPrintPreview 2491
+#define wxPreviewControlBar_GetZoomControl 2492
+#define wxPreviewControlBar_SetZoomControl 2493
+#define wxPrinter_new 2495
+#define wxPrinter_CreateAbortWindow 2496
+#define wxPrinter_GetAbort 2497
+#define wxPrinter_GetLastError 2498
+#define wxPrinter_GetPrintDialogData 2499
+#define wxPrinter_Print 2500
+#define wxPrinter_PrintDialog 2501
+#define wxPrinter_ReportError 2502
+#define wxPrinter_Setup 2503
+#define wxPrinter_destroy 2504
+#define wxXmlResource_new_1 2505
+#define wxXmlResource_new_2 2506
+#define wxXmlResource_destruct 2507
+#define wxXmlResource_AttachUnknownControl 2508
+#define wxXmlResource_ClearHandlers 2509
+#define wxXmlResource_CompareVersion 2510
+#define wxXmlResource_Get 2511
+#define wxXmlResource_GetFlags 2512
+#define wxXmlResource_GetVersion 2513
+#define wxXmlResource_GetXRCID 2514
+#define wxXmlResource_InitAllHandlers 2515
+#define wxXmlResource_Load 2516
+#define wxXmlResource_LoadBitmap 2517
+#define wxXmlResource_LoadDialog_2 2518
+#define wxXmlResource_LoadDialog_3 2519
+#define wxXmlResource_LoadFrame_2 2520
+#define wxXmlResource_LoadFrame_3 2521
+#define wxXmlResource_LoadIcon 2522
+#define wxXmlResource_LoadMenu 2523
+#define wxXmlResource_LoadMenuBar_2 2524
+#define wxXmlResource_LoadMenuBar_1 2525
+#define wxXmlResource_LoadPanel_2 2526
+#define wxXmlResource_LoadPanel_3 2527
+#define wxXmlResource_LoadToolBar 2528
+#define wxXmlResource_Set 2529
+#define wxXmlResource_SetFlags 2530
+#define wxXmlResource_Unload 2531
+#define wxXmlResource_xrcctrl 2532
+#define wxHtmlEasyPrinting_new 2533
+#define wxHtmlEasyPrinting_destruct 2534
+#define wxHtmlEasyPrinting_GetPrintData 2535
+#define wxHtmlEasyPrinting_GetPageSetupData 2536
+#define wxHtmlEasyPrinting_PreviewFile 2537
+#define wxHtmlEasyPrinting_PreviewText 2538
+#define wxHtmlEasyPrinting_PrintFile 2539
+#define wxHtmlEasyPrinting_PrintText 2540
+#define wxHtmlEasyPrinting_PageSetup 2541
+#define wxHtmlEasyPrinting_SetFonts 2542
+#define wxHtmlEasyPrinting_SetHeader 2543
+#define wxHtmlEasyPrinting_SetFooter 2544
+#define wxGLCanvas_new_2 2546
+#define wxGLCanvas_new_3_1 2547
+#define wxGLCanvas_new_3_0 2548
+#define wxGLCanvas_GetContext 2549
+#define wxGLCanvas_SetCurrent 2551
+#define wxGLCanvas_SwapBuffers 2552
+#define wxGLCanvas_destroy 2553
+#define wxAuiManager_new 2554
+#define wxAuiManager_destruct 2555
+#define wxAuiManager_AddPane_2_1 2556
+#define wxAuiManager_AddPane_3 2557
+#define wxAuiManager_AddPane_2_0 2558
+#define wxAuiManager_DetachPane 2559
+#define wxAuiManager_GetAllPanes 2560
+#define wxAuiManager_GetArtProvider 2561
+#define wxAuiManager_GetDockSizeConstraint 2562
+#define wxAuiManager_GetFlags 2563
+#define wxAuiManager_GetManagedWindow 2564
+#define wxAuiManager_GetManager 2565
+#define wxAuiManager_GetPane_1_1 2566
+#define wxAuiManager_GetPane_1_0 2567
+#define wxAuiManager_HideHint 2568
+#define wxAuiManager_InsertPane 2569
+#define wxAuiManager_LoadPaneInfo 2570
+#define wxAuiManager_LoadPerspective 2571
+#define wxAuiManager_SavePaneInfo 2572
+#define wxAuiManager_SavePerspective 2573
+#define wxAuiManager_SetArtProvider 2574
+#define wxAuiManager_SetDockSizeConstraint 2575
+#define wxAuiManager_SetFlags 2576
+#define wxAuiManager_SetManagedWindow 2577
+#define wxAuiManager_ShowHint 2578
+#define wxAuiManager_UnInit 2579
+#define wxAuiManager_Update 2580
+#define wxAuiPaneInfo_new_0 2581
+#define wxAuiPaneInfo_new_1 2582
+#define wxAuiPaneInfo_destruct 2583
+#define wxAuiPaneInfo_BestSize_1 2584
+#define wxAuiPaneInfo_BestSize_2 2585
+#define wxAuiPaneInfo_Bottom 2586
+#define wxAuiPaneInfo_BottomDockable 2587
+#define wxAuiPaneInfo_Caption 2588
+#define wxAuiPaneInfo_CaptionVisible 2589
+#define wxAuiPaneInfo_Centre 2590
+#define wxAuiPaneInfo_CentrePane 2591
+#define wxAuiPaneInfo_CloseButton 2592
+#define wxAuiPaneInfo_DefaultPane 2593
+#define wxAuiPaneInfo_DestroyOnClose 2594
+#define wxAuiPaneInfo_Direction 2595
+#define wxAuiPaneInfo_Dock 2596
+#define wxAuiPaneInfo_Dockable 2597
+#define wxAuiPaneInfo_Fixed 2598
+#define wxAuiPaneInfo_Float 2599
+#define wxAuiPaneInfo_Floatable 2600
+#define wxAuiPaneInfo_FloatingPosition_1 2601
+#define wxAuiPaneInfo_FloatingPosition_2 2602
+#define wxAuiPaneInfo_FloatingSize_1 2603
+#define wxAuiPaneInfo_FloatingSize_2 2604
+#define wxAuiPaneInfo_Gripper 2605
+#define wxAuiPaneInfo_GripperTop 2606
+#define wxAuiPaneInfo_HasBorder 2607
+#define wxAuiPaneInfo_HasCaption 2608
+#define wxAuiPaneInfo_HasCloseButton 2609
+#define wxAuiPaneInfo_HasFlag 2610
+#define wxAuiPaneInfo_HasGripper 2611
+#define wxAuiPaneInfo_HasGripperTop 2612
+#define wxAuiPaneInfo_HasMaximizeButton 2613
+#define wxAuiPaneInfo_HasMinimizeButton 2614
+#define wxAuiPaneInfo_HasPinButton 2615
+#define wxAuiPaneInfo_Hide 2616
+#define wxAuiPaneInfo_IsBottomDockable 2617
+#define wxAuiPaneInfo_IsDocked 2618
+#define wxAuiPaneInfo_IsFixed 2619
+#define wxAuiPaneInfo_IsFloatable 2620
+#define wxAuiPaneInfo_IsFloating 2621
+#define wxAuiPaneInfo_IsLeftDockable 2622
+#define wxAuiPaneInfo_IsMovable 2623
+#define wxAuiPaneInfo_IsOk 2624
+#define wxAuiPaneInfo_IsResizable 2625
+#define wxAuiPaneInfo_IsRightDockable 2626
+#define wxAuiPaneInfo_IsShown 2627
+#define wxAuiPaneInfo_IsToolbar 2628
+#define wxAuiPaneInfo_IsTopDockable 2629
+#define wxAuiPaneInfo_Layer 2630
+#define wxAuiPaneInfo_Left 2631
+#define wxAuiPaneInfo_LeftDockable 2632
+#define wxAuiPaneInfo_MaxSize_1 2633
+#define wxAuiPaneInfo_MaxSize_2 2634
+#define wxAuiPaneInfo_MaximizeButton 2635
+#define wxAuiPaneInfo_MinSize_1 2636
+#define wxAuiPaneInfo_MinSize_2 2637
+#define wxAuiPaneInfo_MinimizeButton 2638
+#define wxAuiPaneInfo_Movable 2639
+#define wxAuiPaneInfo_Name 2640
+#define wxAuiPaneInfo_PaneBorder 2641
+#define wxAuiPaneInfo_PinButton 2642
+#define wxAuiPaneInfo_Position 2643
+#define wxAuiPaneInfo_Resizable 2644
+#define wxAuiPaneInfo_Right 2645
+#define wxAuiPaneInfo_RightDockable 2646
+#define wxAuiPaneInfo_Row 2647
+#define wxAuiPaneInfo_SafeSet 2648
+#define wxAuiPaneInfo_SetFlag 2649
+#define wxAuiPaneInfo_Show 2650
+#define wxAuiPaneInfo_ToolbarPane 2651
+#define wxAuiPaneInfo_Top 2652
+#define wxAuiPaneInfo_TopDockable 2653
+#define wxAuiPaneInfo_Window 2654
+#define wxAuiPaneInfo_GetWindow 2655
+#define wxAuiPaneInfo_GetFrame 2656
+#define wxAuiPaneInfo_GetDirection 2657
+#define wxAuiPaneInfo_GetLayer 2658
+#define wxAuiPaneInfo_GetRow 2659
+#define wxAuiPaneInfo_GetPosition 2660
+#define wxAuiPaneInfo_GetFloatingPosition 2661
+#define wxAuiPaneInfo_GetFloatingSize 2662
+#define wxAuiNotebook_new_0 2663
+#define wxAuiNotebook_new_2 2664
+#define wxAuiNotebook_AddPage 2665
+#define wxAuiNotebook_Create 2666
+#define wxAuiNotebook_DeletePage 2667
+#define wxAuiNotebook_GetArtProvider 2668
+#define wxAuiNotebook_GetPage 2669
+#define wxAuiNotebook_GetPageBitmap 2670
+#define wxAuiNotebook_GetPageCount 2671
+#define wxAuiNotebook_GetPageIndex 2672
+#define wxAuiNotebook_GetPageText 2673
+#define wxAuiNotebook_GetSelection 2674
+#define wxAuiNotebook_InsertPage 2675
+#define wxAuiNotebook_RemovePage 2676
+#define wxAuiNotebook_SetArtProvider 2677
+#define wxAuiNotebook_SetFont 2678
+#define wxAuiNotebook_SetPageBitmap 2679
+#define wxAuiNotebook_SetPageText 2680
+#define wxAuiNotebook_SetSelection 2681
+#define wxAuiNotebook_SetTabCtrlHeight 2682
+#define wxAuiNotebook_SetUniformBitmapSize 2683
+#define wxAuiNotebook_destroy 2684
+#define wxAuiTabArt_SetFlags 2685
+#define wxAuiTabArt_SetMeasuringFont 2686
+#define wxAuiTabArt_SetNormalFont 2687
+#define wxAuiTabArt_SetSelectedFont 2688
+#define wxAuiTabArt_SetColour 2689
+#define wxAuiTabArt_SetActiveColour 2690
+#define wxAuiDockArt_GetColour 2691
+#define wxAuiDockArt_GetFont 2692
+#define wxAuiDockArt_GetMetric 2693
+#define wxAuiDockArt_SetColour 2694
+#define wxAuiDockArt_SetFont 2695
+#define wxAuiDockArt_SetMetric 2696
+#define wxAuiSimpleTabArt_new 2697
+#define wxAuiSimpleTabArt_destroy 2698
+#define wxMDIParentFrame_new_0 2699
+#define wxMDIParentFrame_new_4 2700
+#define wxMDIParentFrame_destruct 2701
+#define wxMDIParentFrame_ActivateNext 2702
+#define wxMDIParentFrame_ActivatePrevious 2703
+#define wxMDIParentFrame_ArrangeIcons 2704
+#define wxMDIParentFrame_Cascade 2705
+#define wxMDIParentFrame_Create 2706
+#define wxMDIParentFrame_GetActiveChild 2707
+#define wxMDIParentFrame_GetClientWindow 2708
+#define wxMDIParentFrame_Tile 2709
+#define wxMDIChildFrame_new_0 2710
+#define wxMDIChildFrame_new_4 2711
+#define wxMDIChildFrame_destruct 2712
+#define wxMDIChildFrame_Activate 2713
+#define wxMDIChildFrame_Create 2714
+#define wxMDIChildFrame_Maximize 2715
+#define wxMDIChildFrame_Restore 2716
+#define wxMDIClientWindow_new_0 2717
+#define wxMDIClientWindow_new_2 2718
+#define wxMDIClientWindow_destruct 2719
+#define wxMDIClientWindow_CreateClient 2720
+#define wxLayoutAlgorithm_new 2721
+#define wxLayoutAlgorithm_LayoutFrame 2722
+#define wxLayoutAlgorithm_LayoutMDIFrame 2723
+#define wxLayoutAlgorithm_LayoutWindow 2724
+#define wxLayoutAlgorithm_destroy 2725
+#define wxEvent_GetId 2726
+#define wxEvent_GetSkipped 2727
+#define wxEvent_GetTimestamp 2728
+#define wxEvent_IsCommandEvent 2729
+#define wxEvent_ResumePropagation 2730
+#define wxEvent_ShouldPropagate 2731
+#define wxEvent_Skip 2732
+#define wxEvent_StopPropagation 2733
+#define wxCommandEvent_getClientData 2734
+#define wxCommandEvent_GetExtraLong 2735
+#define wxCommandEvent_GetInt 2736
+#define wxCommandEvent_GetSelection 2737
+#define wxCommandEvent_GetString 2738
+#define wxCommandEvent_IsChecked 2739
+#define wxCommandEvent_IsSelection 2740
+#define wxCommandEvent_SetInt 2741
+#define wxCommandEvent_SetString 2742
+#define wxScrollEvent_GetOrientation 2743
+#define wxScrollEvent_GetPosition 2744
+#define wxScrollWinEvent_GetOrientation 2745
+#define wxScrollWinEvent_GetPosition 2746
+#define wxMouseEvent_AltDown 2747
+#define wxMouseEvent_Button 2748
+#define wxMouseEvent_ButtonDClick 2749
+#define wxMouseEvent_ButtonDown 2750
+#define wxMouseEvent_ButtonUp 2751
+#define wxMouseEvent_CmdDown 2752
+#define wxMouseEvent_ControlDown 2753
+#define wxMouseEvent_Dragging 2754
+#define wxMouseEvent_Entering 2755
+#define wxMouseEvent_GetButton 2756
+#define wxMouseEvent_GetPosition 2759
+#define wxMouseEvent_GetLogicalPosition 2760
+#define wxMouseEvent_GetLinesPerAction 2761
+#define wxMouseEvent_GetWheelRotation 2762
+#define wxMouseEvent_GetWheelDelta 2763
+#define wxMouseEvent_GetX 2764
+#define wxMouseEvent_GetY 2765
+#define wxMouseEvent_IsButton 2766
+#define wxMouseEvent_IsPageScroll 2767
+#define wxMouseEvent_Leaving 2768
+#define wxMouseEvent_LeftDClick 2769
+#define wxMouseEvent_LeftDown 2770
+#define wxMouseEvent_LeftIsDown 2771
+#define wxMouseEvent_LeftUp 2772
+#define wxMouseEvent_MetaDown 2773
+#define wxMouseEvent_MiddleDClick 2774
+#define wxMouseEvent_MiddleDown 2775
+#define wxMouseEvent_MiddleIsDown 2776
+#define wxMouseEvent_MiddleUp 2777
+#define wxMouseEvent_Moving 2778
+#define wxMouseEvent_RightDClick 2779
+#define wxMouseEvent_RightDown 2780
+#define wxMouseEvent_RightIsDown 2781
+#define wxMouseEvent_RightUp 2782
+#define wxMouseEvent_ShiftDown 2783
+#define wxSetCursorEvent_GetCursor 2784
+#define wxSetCursorEvent_GetX 2785
+#define wxSetCursorEvent_GetY 2786
+#define wxSetCursorEvent_HasCursor 2787
+#define wxSetCursorEvent_SetCursor 2788
+#define wxKeyEvent_AltDown 2789
+#define wxKeyEvent_CmdDown 2790
+#define wxKeyEvent_ControlDown 2791
+#define wxKeyEvent_GetKeyCode 2792
+#define wxKeyEvent_GetModifiers 2793
+#define wxKeyEvent_GetPosition 2796
+#define wxKeyEvent_GetRawKeyCode 2797
+#define wxKeyEvent_GetRawKeyFlags 2798
+#define wxKeyEvent_GetUnicodeKey 2799
+#define wxKeyEvent_GetX 2800
+#define wxKeyEvent_GetY 2801
+#define wxKeyEvent_HasModifiers 2802
+#define wxKeyEvent_MetaDown 2803
+#define wxKeyEvent_ShiftDown 2804
+#define wxSizeEvent_GetSize 2805
+#define wxMoveEvent_GetPosition 2806
+#define wxEraseEvent_GetDC 2807
+#define wxFocusEvent_GetWindow 2808
+#define wxChildFocusEvent_GetWindow 2809
+#define wxMenuEvent_GetMenu 2810
+#define wxMenuEvent_GetMenuId 2811
+#define wxMenuEvent_IsPopup 2812
+#define wxCloseEvent_CanVeto 2813
+#define wxCloseEvent_GetLoggingOff 2814
+#define wxCloseEvent_SetCanVeto 2815
+#define wxCloseEvent_SetLoggingOff 2816
+#define wxCloseEvent_Veto 2817
+#define wxShowEvent_SetShow 2818
+#define wxShowEvent_GetShow 2819
+#define wxIconizeEvent_Iconized 2820
+#define wxJoystickEvent_ButtonDown 2821
+#define wxJoystickEvent_ButtonIsDown 2822
+#define wxJoystickEvent_ButtonUp 2823
+#define wxJoystickEvent_GetButtonChange 2824
+#define wxJoystickEvent_GetButtonState 2825
+#define wxJoystickEvent_GetJoystick 2826
+#define wxJoystickEvent_GetPosition 2827
+#define wxJoystickEvent_GetZPosition 2828
+#define wxJoystickEvent_IsButton 2829
+#define wxJoystickEvent_IsMove 2830
+#define wxJoystickEvent_IsZMove 2831
+#define wxUpdateUIEvent_CanUpdate 2832
+#define wxUpdateUIEvent_Check 2833
+#define wxUpdateUIEvent_Enable 2834
+#define wxUpdateUIEvent_Show 2835
+#define wxUpdateUIEvent_GetChecked 2836
+#define wxUpdateUIEvent_GetEnabled 2837
+#define wxUpdateUIEvent_GetShown 2838
+#define wxUpdateUIEvent_GetSetChecked 2839
+#define wxUpdateUIEvent_GetSetEnabled 2840
+#define wxUpdateUIEvent_GetSetShown 2841
+#define wxUpdateUIEvent_GetSetText 2842
+#define wxUpdateUIEvent_GetText 2843
+#define wxUpdateUIEvent_GetMode 2844
+#define wxUpdateUIEvent_GetUpdateInterval 2845
+#define wxUpdateUIEvent_ResetUpdateTime 2846
+#define wxUpdateUIEvent_SetMode 2847
+#define wxUpdateUIEvent_SetText 2848
+#define wxUpdateUIEvent_SetUpdateInterval 2849
+#define wxMouseCaptureChangedEvent_GetCapturedWindow 2850
+#define wxPaletteChangedEvent_SetChangedWindow 2851
+#define wxPaletteChangedEvent_GetChangedWindow 2852
+#define wxQueryNewPaletteEvent_SetPaletteRealized 2853
+#define wxQueryNewPaletteEvent_GetPaletteRealized 2854
+#define wxNavigationKeyEvent_GetDirection 2855
+#define wxNavigationKeyEvent_SetDirection 2856
+#define wxNavigationKeyEvent_IsWindowChange 2857
+#define wxNavigationKeyEvent_SetWindowChange 2858
+#define wxNavigationKeyEvent_IsFromTab 2859
+#define wxNavigationKeyEvent_SetFromTab 2860
+#define wxNavigationKeyEvent_GetCurrentFocus 2861
+#define wxNavigationKeyEvent_SetCurrentFocus 2862
+#define wxHelpEvent_GetOrigin 2863
+#define wxHelpEvent_GetPosition 2864
+#define wxHelpEvent_SetOrigin 2865
+#define wxHelpEvent_SetPosition 2866
+#define wxContextMenuEvent_GetPosition 2867
+#define wxContextMenuEvent_SetPosition 2868
+#define wxIdleEvent_CanSend 2869
+#define wxIdleEvent_GetMode 2870
+#define wxIdleEvent_RequestMore 2871
+#define wxIdleEvent_MoreRequested 2872
+#define wxIdleEvent_SetMode 2873
+#define wxGridEvent_AltDown 2874
+#define wxGridEvent_ControlDown 2875
+#define wxGridEvent_GetCol 2876
+#define wxGridEvent_GetPosition 2877
+#define wxGridEvent_GetRow 2878
+#define wxGridEvent_MetaDown 2879
+#define wxGridEvent_Selecting 2880
+#define wxGridEvent_ShiftDown 2881
+#define wxNotifyEvent_Allow 2882
+#define wxNotifyEvent_IsAllowed 2883
+#define wxNotifyEvent_Veto 2884
+#define wxSashEvent_GetEdge 2885
+#define wxSashEvent_GetDragRect 2886
+#define wxSashEvent_GetDragStatus 2887
+#define wxListEvent_GetCacheFrom 2888
+#define wxListEvent_GetCacheTo 2889
+#define wxListEvent_GetKeyCode 2890
+#define wxListEvent_GetIndex 2891
+#define wxListEvent_GetColumn 2892
+#define wxListEvent_GetPoint 2893
+#define wxListEvent_GetLabel 2894
+#define wxListEvent_GetText 2895
+#define wxListEvent_GetImage 2896
+#define wxListEvent_GetData 2897
+#define wxListEvent_GetMask 2898
+#define wxListEvent_GetItem 2899
+#define wxListEvent_IsEditCancelled 2900
+#define wxDateEvent_GetDate 2901
+#define wxCalendarEvent_GetWeekDay 2902
+#define wxFileDirPickerEvent_GetPath 2903
+#define wxColourPickerEvent_GetColour 2904
+#define wxFontPickerEvent_GetFont 2905
+#define wxStyledTextEvent_GetPosition 2906
+#define wxStyledTextEvent_GetKey 2907
+#define wxStyledTextEvent_GetModifiers 2908
+#define wxStyledTextEvent_GetModificationType 2909
+#define wxStyledTextEvent_GetText 2910
+#define wxStyledTextEvent_GetLength 2911
+#define wxStyledTextEvent_GetLinesAdded 2912
+#define wxStyledTextEvent_GetLine 2913
+#define wxStyledTextEvent_GetFoldLevelNow 2914
+#define wxStyledTextEvent_GetFoldLevelPrev 2915
+#define wxStyledTextEvent_GetMargin 2916
+#define wxStyledTextEvent_GetMessage 2917
+#define wxStyledTextEvent_GetWParam 2918
+#define wxStyledTextEvent_GetLParam 2919
+#define wxStyledTextEvent_GetListType 2920
+#define wxStyledTextEvent_GetX 2921
+#define wxStyledTextEvent_GetY 2922
+#define wxStyledTextEvent_GetDragText 2923
+#define wxStyledTextEvent_GetDragAllowMove 2924
+#define wxStyledTextEvent_GetDragResult 2925
+#define wxStyledTextEvent_GetShift 2926
+#define wxStyledTextEvent_GetControl 2927
+#define wxStyledTextEvent_GetAlt 2928
+#define utils_wxGetKeyState 2929
+#define utils_wxGetMousePosition 2930
+#define utils_wxGetMouseState 2931
+#define utils_wxSetDetectableAutoRepeat 2932
+#define utils_wxBell 2933
+#define utils_wxFindMenuItemId 2934
+#define utils_wxGenericFindWindowAtPoint 2935
+#define utils_wxFindWindowAtPoint 2936
+#define utils_wxBeginBusyCursor 2937
+#define utils_wxEndBusyCursor 2938
+#define utils_wxIsBusy 2939
+#define utils_wxShutdown 2940
+#define utils_wxShell 2941
+#define utils_wxLaunchDefaultBrowser 2942
+#define utils_wxGetEmailAddress 2943
+#define utils_wxGetUserId 2944
+#define utils_wxGetHomeDir 2945
+#define utils_wxNewId 2946
+#define utils_wxRegisterId 2947
+#define utils_wxGetCurrentId 2948
+#define utils_wxGetOsDescription 2949
+#define utils_wxIsPlatformLittleEndian 2950
+#define utils_wxIsPlatform64Bit 2951
+#define gdicmn_wxDisplaySize 2952
+#define gdicmn_wxSetCursor 2953
+#define wxPrintout_new 2954
+#define wxPrintout_destruct 2955
+#define wxPrintout_GetDC 2956
+#define wxPrintout_GetPageSizeMM 2957
+#define wxPrintout_GetPageSizePixels 2958
+#define wxPrintout_GetPaperRectPixels 2959
+#define wxPrintout_GetPPIPrinter 2960
+#define wxPrintout_GetPPIScreen 2961
+#define wxPrintout_GetTitle 2962
+#define wxPrintout_IsPreview 2963
+#define wxPrintout_FitThisSizeToPaper 2964
+#define wxPrintout_FitThisSizeToPage 2965
+#define wxPrintout_FitThisSizeToPageMargins 2966
+#define wxPrintout_MapScreenSizeToPaper 2967
+#define wxPrintout_MapScreenSizeToPage 2968
+#define wxPrintout_MapScreenSizeToPageMargins 2969
+#define wxPrintout_MapScreenSizeToDevice 2970
+#define wxPrintout_GetLogicalPaperRect 2971
+#define wxPrintout_GetLogicalPageRect 2972
+#define wxPrintout_GetLogicalPageMarginsRect 2973
+#define wxPrintout_SetLogicalOrigin 2974
+#define wxPrintout_OffsetLogicalOrigin 2975
+#define wxStyledTextCtrl_new_2 2976
+#define wxStyledTextCtrl_new_0 2977
+#define wxStyledTextCtrl_destruct 2978
+#define wxStyledTextCtrl_Create 2979
+#define wxStyledTextCtrl_AddText 2980
+#define wxStyledTextCtrl_AddStyledText 2981
+#define wxStyledTextCtrl_InsertText 2982
+#define wxStyledTextCtrl_ClearAll 2983
+#define wxStyledTextCtrl_ClearDocumentStyle 2984
+#define wxStyledTextCtrl_GetLength 2985
+#define wxStyledTextCtrl_GetCharAt 2986
+#define wxStyledTextCtrl_GetCurrentPos 2987
+#define wxStyledTextCtrl_GetAnchor 2988
+#define wxStyledTextCtrl_GetStyleAt 2989
+#define wxStyledTextCtrl_Redo 2990
+#define wxStyledTextCtrl_SetUndoCollection 2991
+#define wxStyledTextCtrl_SelectAll 2992
+#define wxStyledTextCtrl_SetSavePoint 2993
+#define wxStyledTextCtrl_GetStyledText 2994
+#define wxStyledTextCtrl_CanRedo 2995
+#define wxStyledTextCtrl_MarkerLineFromHandle 2996
+#define wxStyledTextCtrl_MarkerDeleteHandle 2997
+#define wxStyledTextCtrl_GetUndoCollection 2998
+#define wxStyledTextCtrl_GetViewWhiteSpace 2999
+#define wxStyledTextCtrl_SetViewWhiteSpace 3000
+#define wxStyledTextCtrl_PositionFromPoint 3001
+#define wxStyledTextCtrl_PositionFromPointClose 3002
+#define wxStyledTextCtrl_GotoLine 3003
+#define wxStyledTextCtrl_GotoPos 3004
+#define wxStyledTextCtrl_SetAnchor 3005
+#define wxStyledTextCtrl_GetCurLine 3006
+#define wxStyledTextCtrl_GetEndStyled 3007
+#define wxStyledTextCtrl_ConvertEOLs 3008
+#define wxStyledTextCtrl_GetEOLMode 3009
+#define wxStyledTextCtrl_SetEOLMode 3010
+#define wxStyledTextCtrl_StartStyling 3011
+#define wxStyledTextCtrl_SetStyling 3012
+#define wxStyledTextCtrl_GetBufferedDraw 3013
+#define wxStyledTextCtrl_SetBufferedDraw 3014
+#define wxStyledTextCtrl_SetTabWidth 3015
+#define wxStyledTextCtrl_GetTabWidth 3016
+#define wxStyledTextCtrl_SetCodePage 3017
+#define wxStyledTextCtrl_MarkerDefine 3018
+#define wxStyledTextCtrl_MarkerSetForeground 3019
+#define wxStyledTextCtrl_MarkerSetBackground 3020
+#define wxStyledTextCtrl_MarkerAdd 3021
+#define wxStyledTextCtrl_MarkerDelete 3022
+#define wxStyledTextCtrl_MarkerDeleteAll 3023
+#define wxStyledTextCtrl_MarkerGet 3024
+#define wxStyledTextCtrl_MarkerNext 3025
+#define wxStyledTextCtrl_MarkerPrevious 3026
+#define wxStyledTextCtrl_MarkerDefineBitmap 3027
+#define wxStyledTextCtrl_MarkerAddSet 3028
+#define wxStyledTextCtrl_MarkerSetAlpha 3029
+#define wxStyledTextCtrl_SetMarginType 3030
+#define wxStyledTextCtrl_GetMarginType 3031
+#define wxStyledTextCtrl_SetMarginWidth 3032
+#define wxStyledTextCtrl_GetMarginWidth 3033
+#define wxStyledTextCtrl_SetMarginMask 3034
+#define wxStyledTextCtrl_GetMarginMask 3035
+#define wxStyledTextCtrl_SetMarginSensitive 3036
+#define wxStyledTextCtrl_GetMarginSensitive 3037
+#define wxStyledTextCtrl_StyleClearAll 3038
+#define wxStyledTextCtrl_StyleSetForeground 3039
+#define wxStyledTextCtrl_StyleSetBackground 3040
+#define wxStyledTextCtrl_StyleSetBold 3041
+#define wxStyledTextCtrl_StyleSetItalic 3042
+#define wxStyledTextCtrl_StyleSetSize 3043
+#define wxStyledTextCtrl_StyleSetFaceName 3044
+#define wxStyledTextCtrl_StyleSetEOLFilled 3045
+#define wxStyledTextCtrl_StyleResetDefault 3046
+#define wxStyledTextCtrl_StyleSetUnderline 3047
+#define wxStyledTextCtrl_StyleSetCase 3048
+#define wxStyledTextCtrl_StyleSetHotSpot 3049
+#define wxStyledTextCtrl_SetSelForeground 3050
+#define wxStyledTextCtrl_SetSelBackground 3051
+#define wxStyledTextCtrl_GetSelAlpha 3052
+#define wxStyledTextCtrl_SetSelAlpha 3053
+#define wxStyledTextCtrl_SetCaretForeground 3054
+#define wxStyledTextCtrl_CmdKeyAssign 3055
+#define wxStyledTextCtrl_CmdKeyClear 3056
+#define wxStyledTextCtrl_CmdKeyClearAll 3057
+#define wxStyledTextCtrl_SetStyleBytes 3058
+#define wxStyledTextCtrl_StyleSetVisible 3059
+#define wxStyledTextCtrl_GetCaretPeriod 3060
+#define wxStyledTextCtrl_SetCaretPeriod 3061
+#define wxStyledTextCtrl_SetWordChars 3062
+#define wxStyledTextCtrl_BeginUndoAction 3063
+#define wxStyledTextCtrl_EndUndoAction 3064
+#define wxStyledTextCtrl_IndicatorSetStyle 3065
+#define wxStyledTextCtrl_IndicatorGetStyle 3066
+#define wxStyledTextCtrl_IndicatorSetForeground 3067
+#define wxStyledTextCtrl_IndicatorGetForeground 3068
+#define wxStyledTextCtrl_SetWhitespaceForeground 3069
+#define wxStyledTextCtrl_SetWhitespaceBackground 3070
+#define wxStyledTextCtrl_GetStyleBits 3071
+#define wxStyledTextCtrl_SetLineState 3072
+#define wxStyledTextCtrl_GetLineState 3073
+#define wxStyledTextCtrl_GetMaxLineState 3074
+#define wxStyledTextCtrl_GetCaretLineVisible 3075
+#define wxStyledTextCtrl_SetCaretLineVisible 3076
+#define wxStyledTextCtrl_GetCaretLineBackground 3077
+#define wxStyledTextCtrl_SetCaretLineBackground 3078
+#define wxStyledTextCtrl_AutoCompShow 3079
+#define wxStyledTextCtrl_AutoCompCancel 3080
+#define wxStyledTextCtrl_AutoCompActive 3081
+#define wxStyledTextCtrl_AutoCompPosStart 3082
+#define wxStyledTextCtrl_AutoCompComplete 3083
+#define wxStyledTextCtrl_AutoCompStops 3084
+#define wxStyledTextCtrl_AutoCompSetSeparator 3085
+#define wxStyledTextCtrl_AutoCompGetSeparator 3086
+#define wxStyledTextCtrl_AutoCompSelect 3087
+#define wxStyledTextCtrl_AutoCompSetCancelAtStart 3088
+#define wxStyledTextCtrl_AutoCompGetCancelAtStart 3089
+#define wxStyledTextCtrl_AutoCompSetFillUps 3090
+#define wxStyledTextCtrl_AutoCompSetChooseSingle 3091
+#define wxStyledTextCtrl_AutoCompGetChooseSingle 3092
+#define wxStyledTextCtrl_AutoCompSetIgnoreCase 3093
+#define wxStyledTextCtrl_AutoCompGetIgnoreCase 3094
+#define wxStyledTextCtrl_UserListShow 3095
+#define wxStyledTextCtrl_AutoCompSetAutoHide 3096
+#define wxStyledTextCtrl_AutoCompGetAutoHide 3097
+#define wxStyledTextCtrl_AutoCompSetDropRestOfWord 3098
+#define wxStyledTextCtrl_AutoCompGetDropRestOfWord 3099
+#define wxStyledTextCtrl_RegisterImage 3100
+#define wxStyledTextCtrl_ClearRegisteredImages 3101
+#define wxStyledTextCtrl_AutoCompGetTypeSeparator 3102
+#define wxStyledTextCtrl_AutoCompSetTypeSeparator 3103
+#define wxStyledTextCtrl_AutoCompSetMaxWidth 3104
+#define wxStyledTextCtrl_AutoCompGetMaxWidth 3105
+#define wxStyledTextCtrl_AutoCompSetMaxHeight 3106
+#define wxStyledTextCtrl_AutoCompGetMaxHeight 3107
+#define wxStyledTextCtrl_SetIndent 3108
+#define wxStyledTextCtrl_GetIndent 3109
+#define wxStyledTextCtrl_SetUseTabs 3110
+#define wxStyledTextCtrl_GetUseTabs 3111
+#define wxStyledTextCtrl_SetLineIndentation 3112
+#define wxStyledTextCtrl_GetLineIndentation 3113
+#define wxStyledTextCtrl_GetLineIndentPosition 3114
+#define wxStyledTextCtrl_GetColumn 3115
+#define wxStyledTextCtrl_SetUseHorizontalScrollBar 3116
+#define wxStyledTextCtrl_GetUseHorizontalScrollBar 3117
+#define wxStyledTextCtrl_SetIndentationGuides 3118
+#define wxStyledTextCtrl_GetIndentationGuides 3119
+#define wxStyledTextCtrl_SetHighlightGuide 3120
+#define wxStyledTextCtrl_GetHighlightGuide 3121
+#define wxStyledTextCtrl_GetLineEndPosition 3122
+#define wxStyledTextCtrl_GetCodePage 3123
+#define wxStyledTextCtrl_GetCaretForeground 3124
+#define wxStyledTextCtrl_GetReadOnly 3125
+#define wxStyledTextCtrl_SetCurrentPos 3126
+#define wxStyledTextCtrl_SetSelectionStart 3127
+#define wxStyledTextCtrl_GetSelectionStart 3128
+#define wxStyledTextCtrl_SetSelectionEnd 3129
+#define wxStyledTextCtrl_GetSelectionEnd 3130
+#define wxStyledTextCtrl_SetPrintMagnification 3131
+#define wxStyledTextCtrl_GetPrintMagnification 3132
+#define wxStyledTextCtrl_SetPrintColourMode 3133
+#define wxStyledTextCtrl_GetPrintColourMode 3134
+#define wxStyledTextCtrl_FindText 3135
+#define wxStyledTextCtrl_FormatRange 3136
+#define wxStyledTextCtrl_GetFirstVisibleLine 3137
+#define wxStyledTextCtrl_GetLine 3138
+#define wxStyledTextCtrl_GetLineCount 3139
+#define wxStyledTextCtrl_SetMarginLeft 3140
+#define wxStyledTextCtrl_GetMarginLeft 3141
+#define wxStyledTextCtrl_SetMarginRight 3142
+#define wxStyledTextCtrl_GetMarginRight 3143
+#define wxStyledTextCtrl_GetModify 3144
+#define wxStyledTextCtrl_SetSelection 3145
+#define wxStyledTextCtrl_GetSelectedText 3146
+#define wxStyledTextCtrl_GetTextRange 3147
+#define wxStyledTextCtrl_HideSelection 3148
+#define wxStyledTextCtrl_LineFromPosition 3149
+#define wxStyledTextCtrl_PositionFromLine 3150
+#define wxStyledTextCtrl_LineScroll 3151
+#define wxStyledTextCtrl_EnsureCaretVisible 3152
+#define wxStyledTextCtrl_ReplaceSelection 3153
+#define wxStyledTextCtrl_SetReadOnly 3154
+#define wxStyledTextCtrl_CanPaste 3155
+#define wxStyledTextCtrl_CanUndo 3156
+#define wxStyledTextCtrl_EmptyUndoBuffer 3157
+#define wxStyledTextCtrl_Undo 3158
+#define wxStyledTextCtrl_Cut 3159
+#define wxStyledTextCtrl_Copy 3160
+#define wxStyledTextCtrl_Paste 3161
+#define wxStyledTextCtrl_Clear 3162
+#define wxStyledTextCtrl_SetText 3163
+#define wxStyledTextCtrl_GetText 3164
+#define wxStyledTextCtrl_GetTextLength 3165
+#define wxStyledTextCtrl_GetOvertype 3166
+#define wxStyledTextCtrl_SetCaretWidth 3167
+#define wxStyledTextCtrl_GetCaretWidth 3168
+#define wxStyledTextCtrl_SetTargetStart 3169
+#define wxStyledTextCtrl_GetTargetStart 3170
+#define wxStyledTextCtrl_SetTargetEnd 3171
+#define wxStyledTextCtrl_GetTargetEnd 3172
+#define wxStyledTextCtrl_ReplaceTarget 3173
+#define wxStyledTextCtrl_SearchInTarget 3174
+#define wxStyledTextCtrl_SetSearchFlags 3175
+#define wxStyledTextCtrl_GetSearchFlags 3176
+#define wxStyledTextCtrl_CallTipShow 3177
+#define wxStyledTextCtrl_CallTipCancel 3178
+#define wxStyledTextCtrl_CallTipActive 3179
+#define wxStyledTextCtrl_CallTipPosAtStart 3180
+#define wxStyledTextCtrl_CallTipSetHighlight 3181
+#define wxStyledTextCtrl_CallTipSetBackground 3182
+#define wxStyledTextCtrl_CallTipSetForeground 3183
+#define wxStyledTextCtrl_CallTipSetForegroundHighlight 3184
+#define wxStyledTextCtrl_CallTipUseStyle 3185
+#define wxStyledTextCtrl_VisibleFromDocLine 3186
+#define wxStyledTextCtrl_DocLineFromVisible 3187
+#define wxStyledTextCtrl_WrapCount 3188
+#define wxStyledTextCtrl_SetFoldLevel 3189
+#define wxStyledTextCtrl_GetFoldLevel 3190
+#define wxStyledTextCtrl_GetLastChild 3191
+#define wxStyledTextCtrl_GetFoldParent 3192
+#define wxStyledTextCtrl_ShowLines 3193
+#define wxStyledTextCtrl_HideLines 3194
+#define wxStyledTextCtrl_GetLineVisible 3195
+#define wxStyledTextCtrl_SetFoldExpanded 3196
+#define wxStyledTextCtrl_GetFoldExpanded 3197
+#define wxStyledTextCtrl_ToggleFold 3198
+#define wxStyledTextCtrl_EnsureVisible 3199
+#define wxStyledTextCtrl_SetFoldFlags 3200
+#define wxStyledTextCtrl_EnsureVisibleEnforcePolicy 3201
+#define wxStyledTextCtrl_SetTabIndents 3202
+#define wxStyledTextCtrl_GetTabIndents 3203
+#define wxStyledTextCtrl_SetBackSpaceUnIndents 3204
+#define wxStyledTextCtrl_GetBackSpaceUnIndents 3205
+#define wxStyledTextCtrl_SetMouseDwellTime 3206
+#define wxStyledTextCtrl_GetMouseDwellTime 3207
+#define wxStyledTextCtrl_WordStartPosition 3208
+#define wxStyledTextCtrl_WordEndPosition 3209
+#define wxStyledTextCtrl_SetWrapMode 3210
+#define wxStyledTextCtrl_GetWrapMode 3211
+#define wxStyledTextCtrl_SetWrapVisualFlags 3212
+#define wxStyledTextCtrl_GetWrapVisualFlags 3213
+#define wxStyledTextCtrl_SetWrapVisualFlagsLocation 3214
+#define wxStyledTextCtrl_GetWrapVisualFlagsLocation 3215
+#define wxStyledTextCtrl_SetWrapStartIndent 3216
+#define wxStyledTextCtrl_GetWrapStartIndent 3217
+#define wxStyledTextCtrl_SetLayoutCache 3218
+#define wxStyledTextCtrl_GetLayoutCache 3219
+#define wxStyledTextCtrl_SetScrollWidth 3220
+#define wxStyledTextCtrl_GetScrollWidth 3221
+#define wxStyledTextCtrl_TextWidth 3222
+#define wxStyledTextCtrl_GetEndAtLastLine 3223
+#define wxStyledTextCtrl_TextHeight 3224
+#define wxStyledTextCtrl_SetUseVerticalScrollBar 3225
+#define wxStyledTextCtrl_GetUseVerticalScrollBar 3226
+#define wxStyledTextCtrl_AppendText 3227
+#define wxStyledTextCtrl_GetTwoPhaseDraw 3228
+#define wxStyledTextCtrl_SetTwoPhaseDraw 3229
+#define wxStyledTextCtrl_TargetFromSelection 3230
+#define wxStyledTextCtrl_LinesJoin 3231
+#define wxStyledTextCtrl_LinesSplit 3232
+#define wxStyledTextCtrl_SetFoldMarginColour 3233
+#define wxStyledTextCtrl_SetFoldMarginHiColour 3234
+#define wxStyledTextCtrl_LineDown 3235
+#define wxStyledTextCtrl_LineDownExtend 3236
+#define wxStyledTextCtrl_LineUp 3237
+#define wxStyledTextCtrl_LineUpExtend 3238
+#define wxStyledTextCtrl_CharLeft 3239
+#define wxStyledTextCtrl_CharLeftExtend 3240
+#define wxStyledTextCtrl_CharRight 3241
+#define wxStyledTextCtrl_CharRightExtend 3242
+#define wxStyledTextCtrl_WordLeft 3243
+#define wxStyledTextCtrl_WordLeftExtend 3244
+#define wxStyledTextCtrl_WordRight 3245
+#define wxStyledTextCtrl_WordRightExtend 3246
+#define wxStyledTextCtrl_Home 3247
+#define wxStyledTextCtrl_HomeExtend 3248
+#define wxStyledTextCtrl_LineEnd 3249
+#define wxStyledTextCtrl_LineEndExtend 3250
+#define wxStyledTextCtrl_DocumentStart 3251
+#define wxStyledTextCtrl_DocumentStartExtend 3252
+#define wxStyledTextCtrl_DocumentEnd 3253
+#define wxStyledTextCtrl_DocumentEndExtend 3254
+#define wxStyledTextCtrl_PageUp 3255
+#define wxStyledTextCtrl_PageUpExtend 3256
+#define wxStyledTextCtrl_PageDown 3257
+#define wxStyledTextCtrl_PageDownExtend 3258
+#define wxStyledTextCtrl_EditToggleOvertype 3259
+#define wxStyledTextCtrl_Cancel 3260
+#define wxStyledTextCtrl_DeleteBack 3261
+#define wxStyledTextCtrl_Tab 3262
+#define wxStyledTextCtrl_BackTab 3263
+#define wxStyledTextCtrl_NewLine 3264
+#define wxStyledTextCtrl_FormFeed 3265
+#define wxStyledTextCtrl_VCHome 3266
+#define wxStyledTextCtrl_VCHomeExtend 3267
+#define wxStyledTextCtrl_ZoomIn 3268
+#define wxStyledTextCtrl_ZoomOut 3269
+#define wxStyledTextCtrl_DelWordLeft 3270
+#define wxStyledTextCtrl_DelWordRight 3271
+#define wxStyledTextCtrl_LineCut 3272
+#define wxStyledTextCtrl_LineDelete 3273
+#define wxStyledTextCtrl_LineTranspose 3274
+#define wxStyledTextCtrl_LineDuplicate 3275
+#define wxStyledTextCtrl_LowerCase 3276
+#define wxStyledTextCtrl_UpperCase 3277
+#define wxStyledTextCtrl_LineScrollDown 3278
+#define wxStyledTextCtrl_LineScrollUp 3279
+#define wxStyledTextCtrl_DeleteBackNotLine 3280
+#define wxStyledTextCtrl_HomeDisplay 3281
+#define wxStyledTextCtrl_HomeDisplayExtend 3282
+#define wxStyledTextCtrl_LineEndDisplay 3283
+#define wxStyledTextCtrl_LineEndDisplayExtend 3284
+#define wxStyledTextCtrl_HomeWrapExtend 3285
+#define wxStyledTextCtrl_LineEndWrap 3286
+#define wxStyledTextCtrl_LineEndWrapExtend 3287
+#define wxStyledTextCtrl_VCHomeWrap 3288
+#define wxStyledTextCtrl_VCHomeWrapExtend 3289
+#define wxStyledTextCtrl_LineCopy 3290
+#define wxStyledTextCtrl_MoveCaretInsideView 3291
+#define wxStyledTextCtrl_LineLength 3292
+#define wxStyledTextCtrl_BraceHighlight 3293
+#define wxStyledTextCtrl_BraceBadLight 3294
+#define wxStyledTextCtrl_BraceMatch 3295
+#define wxStyledTextCtrl_GetViewEOL 3296
+#define wxStyledTextCtrl_SetViewEOL 3297
+#define wxStyledTextCtrl_SetModEventMask 3298
+#define wxStyledTextCtrl_GetEdgeColumn 3299
+#define wxStyledTextCtrl_SetEdgeColumn 3300
+#define wxStyledTextCtrl_SetEdgeMode 3301
+#define wxStyledTextCtrl_GetEdgeMode 3302
+#define wxStyledTextCtrl_GetEdgeColour 3303
+#define wxStyledTextCtrl_SetEdgeColour 3304
+#define wxStyledTextCtrl_SearchAnchor 3305
+#define wxStyledTextCtrl_SearchNext 3306
+#define wxStyledTextCtrl_SearchPrev 3307
+#define wxStyledTextCtrl_LinesOnScreen 3308
+#define wxStyledTextCtrl_UsePopUp 3309
+#define wxStyledTextCtrl_SelectionIsRectangle 3310
+#define wxStyledTextCtrl_SetZoom 3311
+#define wxStyledTextCtrl_GetZoom 3312
+#define wxStyledTextCtrl_GetModEventMask 3313
+#define wxStyledTextCtrl_SetSTCFocus 3314
+#define wxStyledTextCtrl_GetSTCFocus 3315
+#define wxStyledTextCtrl_SetStatus 3316
+#define wxStyledTextCtrl_GetStatus 3317
+#define wxStyledTextCtrl_SetMouseDownCaptures 3318
+#define wxStyledTextCtrl_GetMouseDownCaptures 3319
+#define wxStyledTextCtrl_SetSTCCursor 3320
+#define wxStyledTextCtrl_GetSTCCursor 3321
+#define wxStyledTextCtrl_SetControlCharSymbol 3322
+#define wxStyledTextCtrl_GetControlCharSymbol 3323
+#define wxStyledTextCtrl_WordPartLeft 3324
+#define wxStyledTextCtrl_WordPartLeftExtend 3325
+#define wxStyledTextCtrl_WordPartRight 3326
+#define wxStyledTextCtrl_WordPartRightExtend 3327
+#define wxStyledTextCtrl_SetVisiblePolicy 3328
+#define wxStyledTextCtrl_DelLineLeft 3329
+#define wxStyledTextCtrl_DelLineRight 3330
+#define wxStyledTextCtrl_GetXOffset 3331
+#define wxStyledTextCtrl_ChooseCaretX 3332
+#define wxStyledTextCtrl_SetXCaretPolicy 3333
+#define wxStyledTextCtrl_SetYCaretPolicy 3334
+#define wxStyledTextCtrl_GetPrintWrapMode 3335
+#define wxStyledTextCtrl_SetHotspotActiveForeground 3336
+#define wxStyledTextCtrl_SetHotspotActiveBackground 3337
+#define wxStyledTextCtrl_SetHotspotActiveUnderline 3338
+#define wxStyledTextCtrl_SetHotspotSingleLine 3339
+#define wxStyledTextCtrl_ParaDownExtend 3340
+#define wxStyledTextCtrl_ParaUp 3341
+#define wxStyledTextCtrl_ParaUpExtend 3342
+#define wxStyledTextCtrl_PositionBefore 3343
+#define wxStyledTextCtrl_PositionAfter 3344
+#define wxStyledTextCtrl_CopyRange 3345
+#define wxStyledTextCtrl_CopyText 3346
+#define wxStyledTextCtrl_SetSelectionMode 3347
+#define wxStyledTextCtrl_GetSelectionMode 3348
+#define wxStyledTextCtrl_LineDownRectExtend 3349
+#define wxStyledTextCtrl_LineUpRectExtend 3350
+#define wxStyledTextCtrl_CharLeftRectExtend 3351
+#define wxStyledTextCtrl_CharRightRectExtend 3352
+#define wxStyledTextCtrl_HomeRectExtend 3353
+#define wxStyledTextCtrl_VCHomeRectExtend 3354
+#define wxStyledTextCtrl_LineEndRectExtend 3355
+#define wxStyledTextCtrl_PageUpRectExtend 3356
+#define wxStyledTextCtrl_PageDownRectExtend 3357
+#define wxStyledTextCtrl_StutteredPageUp 3358
+#define wxStyledTextCtrl_StutteredPageUpExtend 3359
+#define wxStyledTextCtrl_StutteredPageDown 3360
+#define wxStyledTextCtrl_StutteredPageDownExtend 3361
+#define wxStyledTextCtrl_WordLeftEnd 3362
+#define wxStyledTextCtrl_WordLeftEndExtend 3363
+#define wxStyledTextCtrl_WordRightEnd 3364
+#define wxStyledTextCtrl_WordRightEndExtend 3365
+#define wxStyledTextCtrl_SetWhitespaceChars 3366
+#define wxStyledTextCtrl_SetCharsDefault 3367
+#define wxStyledTextCtrl_AutoCompGetCurrent 3368
+#define wxStyledTextCtrl_Allocate 3369
+#define wxStyledTextCtrl_FindColumn 3370
+#define wxStyledTextCtrl_GetCaretSticky 3371
+#define wxStyledTextCtrl_SetCaretSticky 3372
+#define wxStyledTextCtrl_ToggleCaretSticky 3373
+#define wxStyledTextCtrl_SetPasteConvertEndings 3374
+#define wxStyledTextCtrl_GetPasteConvertEndings 3375
+#define wxStyledTextCtrl_SelectionDuplicate 3376
+#define wxStyledTextCtrl_SetCaretLineBackAlpha 3377
+#define wxStyledTextCtrl_GetCaretLineBackAlpha 3378
+#define wxStyledTextCtrl_StartRecord 3379
+#define wxStyledTextCtrl_StopRecord 3380
+#define wxStyledTextCtrl_SetLexer 3381
+#define wxStyledTextCtrl_GetLexer 3382
+#define wxStyledTextCtrl_Colourise 3383
+#define wxStyledTextCtrl_SetProperty 3384
+#define wxStyledTextCtrl_SetKeyWords 3385
+#define wxStyledTextCtrl_SetLexerLanguage 3386
+#define wxStyledTextCtrl_GetProperty 3387
+#define wxStyledTextCtrl_GetStyleBitsNeeded 3388
+#define wxStyledTextCtrl_GetCurrentLine 3389
+#define wxStyledTextCtrl_StyleSetSpec 3390
+#define wxStyledTextCtrl_StyleSetFont 3391
+#define wxStyledTextCtrl_StyleSetFontAttr 3392
+#define wxStyledTextCtrl_StyleSetCharacterSet 3393
+#define wxStyledTextCtrl_StyleSetFontEncoding 3394
+#define wxStyledTextCtrl_CmdKeyExecute 3395
+#define wxStyledTextCtrl_SetMargins 3396
+#define wxStyledTextCtrl_GetSelection 3397
+#define wxStyledTextCtrl_PointFromPosition 3398
+#define wxStyledTextCtrl_ScrollToLine 3399
+#define wxStyledTextCtrl_ScrollToColumn 3400
+#define wxStyledTextCtrl_SetVScrollBar 3401
+#define wxStyledTextCtrl_SetHScrollBar 3402
+#define wxStyledTextCtrl_GetLastKeydownProcessed 3403
+#define wxStyledTextCtrl_SetLastKeydownProcessed 3404
+#define wxStyledTextCtrl_SaveFile 3405
+#define wxStyledTextCtrl_LoadFile 3406
+#define wxStyledTextCtrl_DoDragOver 3407
+#define wxStyledTextCtrl_DoDropText 3408
+#define wxStyledTextCtrl_GetUseAntiAliasing 3409
+#define wxStyledTextCtrl_AddTextRaw 3410
+#define wxStyledTextCtrl_InsertTextRaw 3411
+#define wxStyledTextCtrl_GetCurLineRaw 3412
+#define wxStyledTextCtrl_GetLineRaw 3413
+#define wxStyledTextCtrl_GetSelectedTextRaw 3414
+#define wxStyledTextCtrl_GetTextRangeRaw 3415
+#define wxStyledTextCtrl_SetTextRaw 3416
+#define wxStyledTextCtrl_GetTextRaw 3417
+#define wxStyledTextCtrl_AppendTextRaw 3418
+#define wxArtProvider_GetBitmap 3419
+#define wxArtProvider_GetIcon 3420
+#define wxTreeEvent_GetKeyCode 3421
+#define wxTreeEvent_GetItem 3422
+#define wxTreeEvent_GetKeyEvent 3423
+#define wxTreeEvent_GetLabel 3424
+#define wxTreeEvent_GetOldItem 3425
+#define wxTreeEvent_GetPoint 3426
+#define wxTreeEvent_IsEditCancelled 3427
+#define wxTreeEvent_SetToolTip 3428
+#define wxNotebookEvent_GetOldSelection 3429
+#define wxNotebookEvent_GetSelection 3430
+#define wxNotebookEvent_SetOldSelection 3431
+#define wxNotebookEvent_SetSelection 3432
+#define wxFileDataObject_new 3433
+#define wxFileDataObject_AddFile 3434
+#define wxFileDataObject_GetFilenames 3435
+#define wxFileDataObject_destroy 3436
+#define wxTextDataObject_new 3437
+#define wxTextDataObject_GetTextLength 3438
+#define wxTextDataObject_GetText 3439
+#define wxTextDataObject_SetText 3440
+#define wxTextDataObject_destroy 3441
+#define wxBitmapDataObject_new_1_1 3442
+#define wxBitmapDataObject_new_1_0 3443
+#define wxBitmapDataObject_GetBitmap 3444
+#define wxBitmapDataObject_SetBitmap 3445
+#define wxBitmapDataObject_destroy 3446
+#define wxClipboard_new 3448
+#define wxClipboard_destruct 3449
+#define wxClipboard_AddData 3450
+#define wxClipboard_Clear 3451
+#define wxClipboard_Close 3452
+#define wxClipboard_Flush 3453
+#define wxClipboard_GetData 3454
+#define wxClipboard_IsOpened 3455
+#define wxClipboard_Open 3456
+#define wxClipboard_SetData 3457
+#define wxClipboard_UsePrimarySelection 3459
+#define wxClipboard_IsSupported 3460
+#define wxClipboard_Get 3461
+#define wxSpinEvent_GetPosition 3462
+#define wxSpinEvent_SetPosition 3463
+#define wxSplitterWindow_new_0 3464
+#define wxSplitterWindow_new_2 3465
+#define wxSplitterWindow_destruct 3466
+#define wxSplitterWindow_Create 3467
+#define wxSplitterWindow_GetMinimumPaneSize 3468
+#define wxSplitterWindow_GetSashGravity 3469
+#define wxSplitterWindow_GetSashPosition 3470
+#define wxSplitterWindow_GetSplitMode 3471
+#define wxSplitterWindow_GetWindow1 3472
+#define wxSplitterWindow_GetWindow2 3473
+#define wxSplitterWindow_Initialize 3474
+#define wxSplitterWindow_IsSplit 3475
+#define wxSplitterWindow_ReplaceWindow 3476
+#define wxSplitterWindow_SetSashGravity 3477
+#define wxSplitterWindow_SetSashPosition 3478
+#define wxSplitterWindow_SetSashSize 3479
+#define wxSplitterWindow_SetMinimumPaneSize 3480
+#define wxSplitterWindow_SetSplitMode 3481
+#define wxSplitterWindow_SplitHorizontally 3482
+#define wxSplitterWindow_SplitVertically 3483
+#define wxSplitterWindow_Unsplit 3484
+#define wxSplitterWindow_UpdateSize 3485
+#define wxSplitterEvent_GetSashPosition 3486
+#define wxSplitterEvent_GetX 3487
+#define wxSplitterEvent_GetY 3488
+#define wxSplitterEvent_GetWindowBeingRemoved 3489
+#define wxSplitterEvent_SetSashPosition 3490
+#define wxHtmlWindow_new_0 3491
+#define wxHtmlWindow_new_2 3492
+#define wxHtmlWindow_AppendToPage 3493
+#define wxHtmlWindow_GetOpenedAnchor 3494
+#define wxHtmlWindow_GetOpenedPage 3495
+#define wxHtmlWindow_GetOpenedPageTitle 3496
+#define wxHtmlWindow_GetRelatedFrame 3497
+#define wxHtmlWindow_HistoryBack 3498
+#define wxHtmlWindow_HistoryCanBack 3499
+#define wxHtmlWindow_HistoryCanForward 3500
+#define wxHtmlWindow_HistoryClear 3501
+#define wxHtmlWindow_HistoryForward 3502
+#define wxHtmlWindow_LoadFile 3503
+#define wxHtmlWindow_LoadPage 3504
+#define wxHtmlWindow_SelectAll 3505
+#define wxHtmlWindow_SelectionToText 3506
+#define wxHtmlWindow_SelectLine 3507
+#define wxHtmlWindow_SelectWord 3508
+#define wxHtmlWindow_SetBorders 3509
+#define wxHtmlWindow_SetFonts 3510
+#define wxHtmlWindow_SetPage 3511
+#define wxHtmlWindow_SetRelatedFrame 3512
+#define wxHtmlWindow_SetRelatedStatusBar 3513
+#define wxHtmlWindow_ToText 3514
+#define wxHtmlWindow_destroy 3515
+#define wxHtmlLinkEvent_GetLinkInfo 3516
+#define wxSystemSettings_GetColour 3517
+#define wxSystemSettings_GetFont 3518
+#define wxSystemSettings_GetMetric 3519
+#define wxSystemSettings_GetScreenType 3520
+#define wxSystemOptions_GetOption 3521
+#define wxSystemOptions_GetOptionInt 3522
+#define wxSystemOptions_HasOption 3523
+#define wxSystemOptions_IsFalse 3524
+#define wxSystemOptions_SetOption_2_1 3525
+#define wxSystemOptions_SetOption_2_0 3526
+#define wxAuiNotebookEvent_SetSelection 3527
+#define wxAuiNotebookEvent_GetSelection 3528
+#define wxAuiNotebookEvent_SetOldSelection 3529
+#define wxAuiNotebookEvent_GetOldSelection 3530
+#define wxAuiNotebookEvent_SetDragSource 3531
+#define wxAuiNotebookEvent_GetDragSource 3532
+#define wxAuiManagerEvent_SetManager 3533
+#define wxAuiManagerEvent_GetManager 3534
+#define wxAuiManagerEvent_SetPane 3535
+#define wxAuiManagerEvent_GetPane 3536
+#define wxAuiManagerEvent_SetButton 3537
+#define wxAuiManagerEvent_GetButton 3538
+#define wxAuiManagerEvent_SetDC 3539
+#define wxAuiManagerEvent_GetDC 3540
+#define wxAuiManagerEvent_Veto 3541
+#define wxAuiManagerEvent_GetVeto 3542
+#define wxAuiManagerEvent_SetCanVeto 3543
+#define wxAuiManagerEvent_CanVeto 3544
+#define wxLogNull_new 3545
+#define wxLogNull_destroy 3546
+#define wxTaskBarIcon_new 3547
+#define wxTaskBarIcon_destruct 3548
+#define wxTaskBarIcon_PopupMenu 3549
+#define wxTaskBarIcon_RemoveIcon 3550
+#define wxTaskBarIcon_SetIcon 3551
+#define wxLocale_new_0 3552
+#define wxLocale_new_2 3554
+#define wxLocale_destruct 3555
+#define wxLocale_Init 3557
+#define wxLocale_AddCatalog_1 3558
+#define wxLocale_AddCatalog_3 3559
+#define wxLocale_AddCatalogLookupPathPrefix 3560
+#define wxLocale_GetCanonicalName 3561
+#define wxLocale_GetLanguage 3562
+#define wxLocale_GetLanguageName 3563
+#define wxLocale_GetLocale 3564
+#define wxLocale_GetName 3565
+#define wxLocale_GetString_2 3566
+#define wxLocale_GetString_4 3567
+#define wxLocale_GetHeaderValue 3568
+#define wxLocale_GetSysName 3569
+#define wxLocale_GetSystemEncoding 3570
+#define wxLocale_GetSystemEncodingName 3571
+#define wxLocale_GetSystemLanguage 3572
+#define wxLocale_IsLoaded 3573
+#define wxLocale_IsOk 3574
+#define wxActivateEvent_GetActive 3575
+#define wxPopupWindow_new_2 3577
+#define wxPopupWindow_new_0 3578
+#define wxPopupWindow_destruct 3580
+#define wxPopupWindow_Create 3581
+#define wxPopupWindow_Position 3582
+#define wxPopupTransientWindow_new_0 3583
+#define wxPopupTransientWindow_new_2 3584
+#define wxPopupTransientWindow_destruct 3585
+#define wxPopupTransientWindow_Popup 3586
+#define wxPopupTransientWindow_Dismiss 3587
+#define wxOverlay_new 3588
+#define wxOverlay_destruct 3589
+#define wxOverlay_Reset 3590
+#define wxDCOverlay_new_6 3591
+#define wxDCOverlay_new_2 3592
+#define wxDCOverlay_destruct 3593
+#define wxDCOverlay_Clear 3594
diff --git a/lib/wx/c_src/wxe_callback_impl.cpp b/lib/wx/c_src/wxe_callback_impl.cpp
index eae8e99a95..77359e9256 100644
--- a/lib/wx/c_src/wxe_callback_impl.cpp
+++ b/lib/wx/c_src/wxe_callback_impl.cpp
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/wxe_callback_impl.h b/lib/wx/c_src/wxe_callback_impl.h
index 829a60af0d..bebe8ad7da 100644
--- a/lib/wx/c_src/wxe_callback_impl.h
+++ b/lib/wx/c_src/wxe_callback_impl.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2014. All Rights Reserved.
+ * Copyright Ericsson AB 2014-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/wxe_driver.c b/lib/wx/c_src/wxe_driver.c
index 6f027ea25b..5da71818e5 100644
--- a/lib/wx/c_src/wxe_driver.c
+++ b/lib/wx/c_src/wxe_driver.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/wxe_driver.h b/lib/wx/c_src/wxe_driver.h
index 925078962e..f9bca049c8 100644
--- a/lib/wx/c_src/wxe_driver.h
+++ b/lib/wx/c_src/wxe_driver.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/wxe_events.h b/lib/wx/c_src/wxe_events.h
index 0908541812..0301bc5d7b 100644
--- a/lib/wx/c_src/wxe_events.h
+++ b/lib/wx/c_src/wxe_events.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/wxe_gl.cpp b/lib/wx/c_src/wxe_gl.cpp
index 7f2e767a6b..f27ac70dc2 100644
--- a/lib/wx/c_src/wxe_gl.cpp
+++ b/lib/wx/c_src/wxe_gl.cpp
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/wxe_gl.h b/lib/wx/c_src/wxe_gl.h
index 45a2a1ac23..38a1087723 100644
--- a/lib/wx/c_src/wxe_gl.h
+++ b/lib/wx/c_src/wxe_gl.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/wxe_helpers.cpp b/lib/wx/c_src/wxe_helpers.cpp
index 1696b8bd50..4798e605e8 100644
--- a/lib/wx/c_src/wxe_helpers.cpp
+++ b/lib/wx/c_src/wxe_helpers.cpp
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2014. All Rights Reserved.
+ * Copyright Ericsson AB 2014-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,8 +47,8 @@ void wxeCommand::Delete()
if(len > 64)
driver_free(buffer);
buffer = NULL;
- op = -1;
}
+ op = -1;
}
/* ****************************************************************************
@@ -226,7 +226,7 @@ unsigned int wxeFifo::Cleanup(unsigned int def)
// Realloced we need to start from the beginning
return 0;
} else {
- return def;
+ return def < cb_start? def : cb_start;
}
}
diff --git a/lib/wx/c_src/wxe_helpers.h b/lib/wx/c_src/wxe_helpers.h
index ff949e332b..70ffccdc13 100644
--- a/lib/wx/c_src/wxe_helpers.h
+++ b/lib/wx/c_src/wxe_helpers.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2014. All Rights Reserved.
+ * Copyright Ericsson AB 2014-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -46,7 +46,7 @@ class wxeCommand
wxeCommand();
virtual ~wxeCommand(); // Use Delete()
- wxeCommand * Save() { return this; };
+ wxeCommand * Save(int Op) { op = Op; return this; };
void Delete();
ErlDrvTermData caller;
diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp
index f81d0bbbd9..175bcfce54 100644
--- a/lib/wx/c_src/wxe_impl.cpp
+++ b/lib/wx/c_src/wxe_impl.cpp
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -238,9 +238,10 @@ void WxeApp::dispatch_cmds()
if(wxe_status != WXE_INITIATED)
return;
recurse_level++;
- // fprintf(stderr, "\r\ndispatch_normal %d\r\n", level);fflush(stderr);
+ // fprintf(stderr, "\r\ndispatch_normal %d\r\n", recurse_level);fflush(stderr);
+ wxe_queue->cb_start = 0;
dispatch(wxe_queue);
- // fprintf(stderr, "\r\ndispatch_done \r\n");fflush(stderr);
+ // fprintf(stderr, "\r\ndispatch_done %d\r\n", recurse_level);fflush(stderr);
recurse_level--;
// Cleanup old memenv's and deleted objects
diff --git a/lib/wx/c_src/wxe_impl.h b/lib/wx/c_src/wxe_impl.h
index fd25296c73..57dac997ab 100644
--- a/lib/wx/c_src/wxe_impl.h
+++ b/lib/wx/c_src/wxe_impl.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2014. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/wxe_main.cpp b/lib/wx/c_src/wxe_main.cpp
index 1d732554ea..6fcde42eb5 100644
--- a/lib/wx/c_src/wxe_main.cpp
+++ b/lib/wx/c_src/wxe_main.cpp
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2014. All Rights Reserved.
+ * Copyright Ericsson AB 2014-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -125,8 +125,8 @@ void *wxe_main_loop(void *vpdl)
{
int result;
int argc = 1;
- char * temp = (char *) "Erlang";
- char * argv[] = {temp,NULL};
+ const wxChar temp[10] = L"Erlang";
+ wxChar * argv[] = {(wxChar *)temp, NULL};
ErlDrvPDL pdl = (ErlDrvPDL) vpdl;
driver_pdl_inc_refc(pdl);
diff --git a/lib/wx/c_src/wxe_memory.h b/lib/wx/c_src/wxe_memory.h
index 2dae424cf8..455e9696d3 100644
--- a/lib/wx/c_src/wxe_memory.h
+++ b/lib/wx/c_src/wxe_memory.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2014. All Rights Reserved.
+ * Copyright Ericsson AB 2014-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/wxe_ps_init.c b/lib/wx/c_src/wxe_ps_init.c
index 7a5b2fabc0..e6b677d469 100644
--- a/lib/wx/c_src/wxe_ps_init.c
+++ b/lib/wx/c_src/wxe_ps_init.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/wxe_return.cpp b/lib/wx/c_src/wxe_return.cpp
index 2dd7a8478b..0a034be489 100644
--- a/lib/wx/c_src/wxe_return.cpp
+++ b/lib/wx/c_src/wxe_return.cpp
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/c_src/wxe_return.h b/lib/wx/c_src/wxe_return.h
index 6c38ae32e1..7c712ea424 100644
--- a/lib/wx/c_src/wxe_return.h
+++ b/lib/wx/c_src/wxe_return.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2013. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/lib/wx/config.mk.in b/lib/wx/config.mk.in
index 0e98545240..2fa09209d2 100644
--- a/lib/wx/config.mk.in
+++ b/lib/wx/config.mk.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/wx/configure.in b/lib/wx/configure.in
index bf27b72aa7..dbe237cd74 100644
--- a/lib/wx/configure.in
+++ b/lib/wx/configure.in
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. -*-m4-*-
dnl %CopyrightBegin%
dnl
-dnl Copyright Ericsson AB 2008-2013. All Rights Reserved.
+dnl Copyright Ericsson AB 2008-2016. All Rights Reserved.
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
diff --git a/lib/wx/doc/src/Makefile b/lib/wx/doc/src/Makefile
index a0684d112d..cae2f9fe4e 100644
--- a/lib/wx/doc/src/Makefile
+++ b/lib/wx/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2012. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/wx/doc/src/book.xml b/lib/wx/doc/src/book.xml
index d438e08749..555c2a9625 100644
--- a/lib/wx/doc/src/book.xml
+++ b/lib/wx/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2009</year><year>2013</year>
+ <year>2009</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/wx/doc/src/notes.xml b/lib/wx/doc/src/notes.xml
index f895540b25..c7400206ab 100644
--- a/lib/wx/doc/src/notes.xml
+++ b/lib/wx/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2009</year><year>2013</year>
+ <year>2009</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/wx/doc/src/part.xml b/lib/wx/doc/src/part.xml
index 7823c5312b..cab7dfbc68 100644
--- a/lib/wx/doc/src/part.xml
+++ b/lib/wx/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2009</year><year>2013</year>
+ <year>2009</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/wx/doc/src/part_notes.xml b/lib/wx/doc/src/part_notes.xml
index d3bdacb432..5a5a6494c1 100644
--- a/lib/wx/doc/src/part_notes.xml
+++ b/lib/wx/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2009</year><year>2013</year>
+ <year>2009</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/wx/doc/src/ref_man.xml.src b/lib/wx/doc/src/ref_man.xml.src
index 2c843fa593..14d64f5b35 100644
--- a/lib/wx/doc/src/ref_man.xml.src
+++ b/lib/wx/doc/src/ref_man.xml.src
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2009</year><year>2013</year>
+ <year>2009</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/wx/examples/Makefile b/lib/wx/examples/Makefile
index 997c3be6ec..fa4576928a 100644
--- a/lib/wx/examples/Makefile
+++ b/lib/wx/examples/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/Makefile b/lib/wx/examples/demo/Makefile
index cdd2e1385b..7b5de2253b 100644
--- a/lib/wx/examples/demo/Makefile
+++ b/lib/wx/examples/demo/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/demo.erl b/lib/wx/examples/demo/demo.erl
index ed826dd3f0..99c28b3177 100644
--- a/lib/wx/examples/demo/demo.erl
+++ b/lib/wx/examples/demo/demo.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_aui.erl b/lib/wx/examples/demo/ex_aui.erl
index 7fbf841d16..d8fc0021f1 100644
--- a/lib/wx/examples/demo/ex_aui.erl
+++ b/lib/wx/examples/demo/ex_aui.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_button.erl b/lib/wx/examples/demo/ex_button.erl
index bfa7f785c2..a2086b0506 100644
--- a/lib/wx/examples/demo/ex_button.erl
+++ b/lib/wx/examples/demo/ex_button.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_canvas.erl b/lib/wx/examples/demo/ex_canvas.erl
index acc94743d6..b00ce81993 100644
--- a/lib/wx/examples/demo/ex_canvas.erl
+++ b/lib/wx/examples/demo/ex_canvas.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -136,11 +136,14 @@ handle_event(#wx{event = #wxCommand{type = command_button_clicked}},
{noreply, State};
handle_event(#wx{event = #wxSize{size={W,H}}},
State = #state{bitmap=Prev, canvas=Canvas}) ->
- Bitmap = wxBitmap:new(W,H),
- draw(Canvas, Bitmap, fun(DC) -> wxDC:clear(DC) end),
- wxBitmap:destroy(Prev),
- {noreply, State#state{bitmap = Bitmap}};
-
+ if W > 0 andalso H > 0 ->
+ Bitmap = wxBitmap:new(W,H),
+ draw(Canvas, Bitmap, fun(DC) -> wxDC:clear(DC) end),
+ wxBitmap:destroy(Prev),
+ {noreply, State#state{bitmap = Bitmap}};
+ true ->
+ {noreply, State}
+ end;
handle_event(#wx{event = #wxMouse{type=left_down, x=X, y=Y}}, State) ->
{noreply, State#state{pos={X,Y}}};
handle_event(#wx{event = #wxMouse{type=motion, x=X1, y=Y1}},
diff --git a/lib/wx/examples/demo/ex_canvas_paint.erl b/lib/wx/examples/demo/ex_canvas_paint.erl
index 90638fcf5b..75eb840b04 100644
--- a/lib/wx/examples/demo/ex_canvas_paint.erl
+++ b/lib/wx/examples/demo/ex_canvas_paint.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -157,10 +157,15 @@ handle_event(#wx{event = #wxMouse{type = motion, x = X, y = Y}},
{noreply, State#state{old_pos = {X,Y}}};
%% Resize event
handle_event(#wx{event = #wxSize{size = {W,H}}}, State = #state{bitmap=Prev}) ->
- wxBitmap:destroy(Prev),
- Bitmap = wxBitmap:new(W,H),
- draw(State#state.canvas, Bitmap, fun(DC) -> wxDC:clear(DC) end),
- {noreply, State#state{bitmap=Bitmap}};
+ case W > 0 andalso H > 0 of
+ true ->
+ wxBitmap:destroy(Prev),
+ Bitmap = wxBitmap:new(W,H),
+ draw(State#state.canvas, Bitmap, fun(DC) -> wxDC:clear(DC) end),
+ {noreply, State#state{bitmap=Bitmap}};
+ false ->
+ {noreply, State}
+ end;
handle_event(#wx{event = #wxMouse{type = left_dclick,x = X,y = Y}}, State = #state{}) ->
wxPanel:connect(State#state.canvas, motion),
{noreply, State#state{old_pos = {X,Y}}};
@@ -235,11 +240,10 @@ draw(Canvas, Bitmap, Fun) ->
CDC = wxClientDC:new(Canvas),
Fun(MemoryDC),
-
wxDC:blit(CDC, {0,0},
{wxBitmap:getWidth(Bitmap), wxBitmap:getHeight(Bitmap)},
MemoryDC, {0,0}),
-
+
wxClientDC:destroy(CDC),
wxMemoryDC:destroy(MemoryDC).
diff --git a/lib/wx/examples/demo/ex_choices.erl b/lib/wx/examples/demo/ex_choices.erl
index 31857e45f1..6cba2ffe87 100644
--- a/lib/wx/examples/demo/ex_choices.erl
+++ b/lib/wx/examples/demo/ex_choices.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_cursor.erl b/lib/wx/examples/demo/ex_cursor.erl
index 207973af96..1b0c71156f 100644
--- a/lib/wx/examples/demo/ex_cursor.erl
+++ b/lib/wx/examples/demo/ex_cursor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_dialogs.erl b/lib/wx/examples/demo/ex_dialogs.erl
index 03792b2e8d..1a90812958 100644
--- a/lib/wx/examples/demo/ex_dialogs.erl
+++ b/lib/wx/examples/demo/ex_dialogs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_frame_utils.erl b/lib/wx/examples/demo/ex_frame_utils.erl
index 68eda8b6b7..7f5c928617 100644
--- a/lib/wx/examples/demo/ex_frame_utils.erl
+++ b/lib/wx/examples/demo/ex_frame_utils.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_gauge.erl b/lib/wx/examples/demo/ex_gauge.erl
index 9ee9134be1..6312e3cc0c 100644
--- a/lib/wx/examples/demo/ex_gauge.erl
+++ b/lib/wx/examples/demo/ex_gauge.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_gl.erl b/lib/wx/examples/demo/ex_gl.erl
index 2693654136..3137b72161 100644
--- a/lib/wx/examples/demo/ex_gl.erl
+++ b/lib/wx/examples/demo/ex_gl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_graphicsContext.erl b/lib/wx/examples/demo/ex_graphicsContext.erl
index 3cb6f8a139..d883ddfc5c 100644
--- a/lib/wx/examples/demo/ex_graphicsContext.erl
+++ b/lib/wx/examples/demo/ex_graphicsContext.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_grid.erl b/lib/wx/examples/demo/ex_grid.erl
index c062b7bff5..57bae6ae4d 100644
--- a/lib/wx/examples/demo/ex_grid.erl
+++ b/lib/wx/examples/demo/ex_grid.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_htmlWindow.erl b/lib/wx/examples/demo/ex_htmlWindow.erl
index d9fa5310ef..5b39fe47fc 100644
--- a/lib/wx/examples/demo/ex_htmlWindow.erl
+++ b/lib/wx/examples/demo/ex_htmlWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_listCtrl.erl b/lib/wx/examples/demo/ex_listCtrl.erl
index e5eb898f29..598df0d115 100644
--- a/lib/wx/examples/demo/ex_listCtrl.erl
+++ b/lib/wx/examples/demo/ex_listCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_notebook.erl b/lib/wx/examples/demo/ex_notebook.erl
index 1b6a1a0ee4..5b49e634db 100644
--- a/lib/wx/examples/demo/ex_notebook.erl
+++ b/lib/wx/examples/demo/ex_notebook.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_pickers.erl b/lib/wx/examples/demo/ex_pickers.erl
index 8c07609f9d..016e70c8c7 100644
--- a/lib/wx/examples/demo/ex_pickers.erl
+++ b/lib/wx/examples/demo/ex_pickers.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_popupMenu.erl b/lib/wx/examples/demo/ex_popupMenu.erl
index 976c51cd20..c4b025201c 100644
--- a/lib/wx/examples/demo/ex_popupMenu.erl
+++ b/lib/wx/examples/demo/ex_popupMenu.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_radioBox.erl b/lib/wx/examples/demo/ex_radioBox.erl
index 004bbb5290..893cd70e96 100644
--- a/lib/wx/examples/demo/ex_radioBox.erl
+++ b/lib/wx/examples/demo/ex_radioBox.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_sashWindow.erl b/lib/wx/examples/demo/ex_sashWindow.erl
index 7d0473ab8f..63528f65d1 100644
--- a/lib/wx/examples/demo/ex_sashWindow.erl
+++ b/lib/wx/examples/demo/ex_sashWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_sizers.erl b/lib/wx/examples/demo/ex_sizers.erl
index 07dbaa4c65..800f17f014 100644
--- a/lib/wx/examples/demo/ex_sizers.erl
+++ b/lib/wx/examples/demo/ex_sizers.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_slider.erl b/lib/wx/examples/demo/ex_slider.erl
index 839af56aec..32d48d44e3 100644
--- a/lib/wx/examples/demo/ex_slider.erl
+++ b/lib/wx/examples/demo/ex_slider.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_splitterWindow.erl b/lib/wx/examples/demo/ex_splitterWindow.erl
index 932027863f..14f63600a3 100644
--- a/lib/wx/examples/demo/ex_splitterWindow.erl
+++ b/lib/wx/examples/demo/ex_splitterWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_static.erl b/lib/wx/examples/demo/ex_static.erl
index 2f36732aed..c0a6a0b054 100644
--- a/lib/wx/examples/demo/ex_static.erl
+++ b/lib/wx/examples/demo/ex_static.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_textCtrl.erl b/lib/wx/examples/demo/ex_textCtrl.erl
index 0674b5ef1c..99492259cb 100644
--- a/lib/wx/examples/demo/ex_textCtrl.erl
+++ b/lib/wx/examples/demo/ex_textCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/demo/ex_treeCtrl.erl b/lib/wx/examples/demo/ex_treeCtrl.erl
index 4c69c7091c..fc0d9ba117 100644
--- a/lib/wx/examples/demo/ex_treeCtrl.erl
+++ b/lib/wx/examples/demo/ex_treeCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/simple/Makefile b/lib/wx/examples/simple/Makefile
index 997913f036..22986ee696 100644
--- a/lib/wx/examples/simple/Makefile
+++ b/lib/wx/examples/simple/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/simple/hello.erl b/lib/wx/examples/simple/hello.erl
index 1dde9b1fd2..36bce56329 100644
--- a/lib/wx/examples/simple/hello.erl
+++ b/lib/wx/examples/simple/hello.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/simple/hello2.erl b/lib/wx/examples/simple/hello2.erl
index ac919c7668..671b23d892 100644
--- a/lib/wx/examples/simple/hello2.erl
+++ b/lib/wx/examples/simple/hello2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/simple/menu.erl b/lib/wx/examples/simple/menu.erl
index 3851e7ca7e..479df1ef98 100644
--- a/lib/wx/examples/simple/menu.erl
+++ b/lib/wx/examples/simple/menu.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/simple/minimal.erl b/lib/wx/examples/simple/minimal.erl
index fb0eb3c3d9..9f6365e008 100644
--- a/lib/wx/examples/simple/minimal.erl
+++ b/lib/wx/examples/simple/minimal.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/sudoku/Makefile b/lib/wx/examples/sudoku/Makefile
index 56186a8b14..e6f35c689a 100644
--- a/lib/wx/examples/sudoku/Makefile
+++ b/lib/wx/examples/sudoku/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/sudoku/sudoku.erl b/lib/wx/examples/sudoku/sudoku.erl
index 0a0cf10d32..97f35870de 100644
--- a/lib/wx/examples/sudoku/sudoku.erl
+++ b/lib/wx/examples/sudoku/sudoku.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/sudoku/sudoku.hrl b/lib/wx/examples/sudoku/sudoku.hrl
index 026b2054c9..f8358274bd 100644
--- a/lib/wx/examples/sudoku/sudoku.hrl
+++ b/lib/wx/examples/sudoku/sudoku.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/sudoku/sudoku_board.erl b/lib/wx/examples/sudoku/sudoku_board.erl
index 50b539afa0..2e25c1a486 100644
--- a/lib/wx/examples/sudoku/sudoku_board.erl
+++ b/lib/wx/examples/sudoku/sudoku_board.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/sudoku/sudoku_game.erl b/lib/wx/examples/sudoku/sudoku_game.erl
index 8bb5fe4d38..1e579a7c88 100644
--- a/lib/wx/examples/sudoku/sudoku_game.erl
+++ b/lib/wx/examples/sudoku/sudoku_game.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/sudoku/sudoku_gui.erl b/lib/wx/examples/sudoku/sudoku_gui.erl
index a5d24fa604..81d20814e1 100644
--- a/lib/wx/examples/sudoku/sudoku_gui.erl
+++ b/lib/wx/examples/sudoku/sudoku_gui.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/xrc/Makefile b/lib/wx/examples/xrc/Makefile
index 2028958fa1..446afa0b26 100644
--- a/lib/wx/examples/xrc/Makefile
+++ b/lib/wx/examples/xrc/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/wx/examples/xrc/xrc.erl b/lib/wx/examples/xrc/xrc.erl
index 7f9519a69d..729f4ad0db 100644
--- a/lib/wx/examples/xrc/xrc.erl
+++ b/lib/wx/examples/xrc/xrc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/include/gl.hrl b/lib/wx/include/gl.hrl
index a7dc2f2495..39cd474fcb 100644
--- a/lib/wx/include/gl.hrl
+++ b/lib/wx/include/gl.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/include/glu.hrl b/lib/wx/include/glu.hrl
index e1ba0099b6..4dcc73c523 100644
--- a/lib/wx/include/glu.hrl
+++ b/lib/wx/include/glu.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/include/wx.hrl b/lib/wx/include/wx.hrl
index 333ceca50c..44df57898a 100644
--- a/lib/wx/include/wx.hrl
+++ b/lib/wx/include/wx.hrl
@@ -353,7 +353,7 @@
%% Hardcoded Records
-record(wxMouseState, {x :: integer(), y :: integer(),
- leftDown :: boolean(), middleDown :: boolean, rightDown :: boolean,
+ leftDown :: boolean(), middleDown :: boolean(), rightDown :: boolean(),
controlDown :: boolean(), shiftDown :: boolean(),
altDown :: boolean(), metaDown :: boolean(), cmdDown :: boolean()
}).
diff --git a/lib/wx/src/Makefile b/lib/wx/src/Makefile
index b345e34684..21b45af2c4 100644
--- a/lib/wx/src/Makefile
+++ b/lib/wx/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2012. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxAcceleratorEntry.erl b/lib/wx/src/gen/wxAcceleratorEntry.erl
index b4ad3adcca..0885c25371 100644
--- a/lib/wx/src/gen/wxAcceleratorEntry.erl
+++ b/lib/wx/src/gen/wxAcceleratorEntry.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxAcceleratorTable.erl b/lib/wx/src/gen/wxAcceleratorTable.erl
index 3edfee7709..3ed419b057 100644
--- a/lib/wx/src/gen/wxAcceleratorTable.erl
+++ b/lib/wx/src/gen/wxAcceleratorTable.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxActivateEvent.erl b/lib/wx/src/gen/wxActivateEvent.erl
index 157b25f05a..06c5d47746 100644
--- a/lib/wx/src/gen/wxActivateEvent.erl
+++ b/lib/wx/src/gen/wxActivateEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxArtProvider.erl b/lib/wx/src/gen/wxArtProvider.erl
index 7dc170beff..c85c0b5457 100644
--- a/lib/wx/src/gen/wxArtProvider.erl
+++ b/lib/wx/src/gen/wxArtProvider.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxAuiNotebookEvent.erl b/lib/wx/src/gen/wxAuiNotebookEvent.erl
index 33509e3269..4ebe408cef 100644
--- a/lib/wx/src/gen/wxAuiNotebookEvent.erl
+++ b/lib/wx/src/gen/wxAuiNotebookEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxBitmap.erl b/lib/wx/src/gen/wxBitmap.erl
index 988dc5b1af..9bf2f8eee0 100644
--- a/lib/wx/src/gen/wxBitmap.erl
+++ b/lib/wx/src/gen/wxBitmap.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxBitmapDataObject.erl b/lib/wx/src/gen/wxBitmapDataObject.erl
index 9fcbb4df41..2c90498880 100644
--- a/lib/wx/src/gen/wxBitmapDataObject.erl
+++ b/lib/wx/src/gen/wxBitmapDataObject.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxBoxSizer.erl b/lib/wx/src/gen/wxBoxSizer.erl
index 04f26f95d9..1a19b264d9 100644
--- a/lib/wx/src/gen/wxBoxSizer.erl
+++ b/lib/wx/src/gen/wxBoxSizer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxBrush.erl b/lib/wx/src/gen/wxBrush.erl
index 3d6112a351..bc1956c1f7 100644
--- a/lib/wx/src/gen/wxBrush.erl
+++ b/lib/wx/src/gen/wxBrush.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxBufferedDC.erl b/lib/wx/src/gen/wxBufferedDC.erl
index 5959a3c3ab..67b851a84e 100644
--- a/lib/wx/src/gen/wxBufferedDC.erl
+++ b/lib/wx/src/gen/wxBufferedDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxBufferedPaintDC.erl b/lib/wx/src/gen/wxBufferedPaintDC.erl
index a45ec6540b..0601caf300 100644
--- a/lib/wx/src/gen/wxBufferedPaintDC.erl
+++ b/lib/wx/src/gen/wxBufferedPaintDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxCalendarDateAttr.erl b/lib/wx/src/gen/wxCalendarDateAttr.erl
index 4fde4ddbda..175b03cfdd 100644
--- a/lib/wx/src/gen/wxCalendarDateAttr.erl
+++ b/lib/wx/src/gen/wxCalendarDateAttr.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxCalendarEvent.erl b/lib/wx/src/gen/wxCalendarEvent.erl
index d0573e584f..c4bd8fcf49 100644
--- a/lib/wx/src/gen/wxCalendarEvent.erl
+++ b/lib/wx/src/gen/wxCalendarEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxCaret.erl b/lib/wx/src/gen/wxCaret.erl
index 0e648e4e56..9da832aa67 100644
--- a/lib/wx/src/gen/wxCaret.erl
+++ b/lib/wx/src/gen/wxCaret.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxChildFocusEvent.erl b/lib/wx/src/gen/wxChildFocusEvent.erl
index d97c4b3565..8d9718e4c5 100644
--- a/lib/wx/src/gen/wxChildFocusEvent.erl
+++ b/lib/wx/src/gen/wxChildFocusEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxClientDC.erl b/lib/wx/src/gen/wxClientDC.erl
index 35ad2cc16b..3e9bcd33dd 100644
--- a/lib/wx/src/gen/wxClientDC.erl
+++ b/lib/wx/src/gen/wxClientDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxClipboard.erl b/lib/wx/src/gen/wxClipboard.erl
index 71bc43a791..cbf9e63067 100644
--- a/lib/wx/src/gen/wxClipboard.erl
+++ b/lib/wx/src/gen/wxClipboard.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxClipboardTextEvent.erl b/lib/wx/src/gen/wxClipboardTextEvent.erl
index 659419b73f..afcc9932d1 100644
--- a/lib/wx/src/gen/wxClipboardTextEvent.erl
+++ b/lib/wx/src/gen/wxClipboardTextEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxCloseEvent.erl b/lib/wx/src/gen/wxCloseEvent.erl
index 2b2a927fc1..b02a578b9e 100644
--- a/lib/wx/src/gen/wxCloseEvent.erl
+++ b/lib/wx/src/gen/wxCloseEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxColourData.erl b/lib/wx/src/gen/wxColourData.erl
index 16569cd490..7379592298 100644
--- a/lib/wx/src/gen/wxColourData.erl
+++ b/lib/wx/src/gen/wxColourData.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxColourPickerEvent.erl b/lib/wx/src/gen/wxColourPickerEvent.erl
index 933dd1ffae..a4e09fb066 100644
--- a/lib/wx/src/gen/wxColourPickerEvent.erl
+++ b/lib/wx/src/gen/wxColourPickerEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxCommandEvent.erl b/lib/wx/src/gen/wxCommandEvent.erl
index acd0d9e2d9..a36aa3aa95 100644
--- a/lib/wx/src/gen/wxCommandEvent.erl
+++ b/lib/wx/src/gen/wxCommandEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxContextMenuEvent.erl b/lib/wx/src/gen/wxContextMenuEvent.erl
index 4e0729922b..94a7a2948d 100644
--- a/lib/wx/src/gen/wxContextMenuEvent.erl
+++ b/lib/wx/src/gen/wxContextMenuEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxCursor.erl b/lib/wx/src/gen/wxCursor.erl
index ee5fec7d4a..7f32b140e6 100644
--- a/lib/wx/src/gen/wxCursor.erl
+++ b/lib/wx/src/gen/wxCursor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxDC.erl b/lib/wx/src/gen/wxDC.erl
index dad4126493..263ad76526 100644
--- a/lib/wx/src/gen/wxDC.erl
+++ b/lib/wx/src/gen/wxDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxDataObject.erl b/lib/wx/src/gen/wxDataObject.erl
index 7d47c0cad4..00a5dad4cc 100644
--- a/lib/wx/src/gen/wxDataObject.erl
+++ b/lib/wx/src/gen/wxDataObject.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxDateEvent.erl b/lib/wx/src/gen/wxDateEvent.erl
index 6b01c71ade..e15cb62cb2 100644
--- a/lib/wx/src/gen/wxDateEvent.erl
+++ b/lib/wx/src/gen/wxDateEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxDisplayChangedEvent.erl b/lib/wx/src/gen/wxDisplayChangedEvent.erl
index b5cd85a10a..763d6aa0a4 100644
--- a/lib/wx/src/gen/wxDisplayChangedEvent.erl
+++ b/lib/wx/src/gen/wxDisplayChangedEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxEraseEvent.erl b/lib/wx/src/gen/wxEraseEvent.erl
index 638f36a14b..0cc7ee0441 100644
--- a/lib/wx/src/gen/wxEraseEvent.erl
+++ b/lib/wx/src/gen/wxEraseEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxEvent.erl b/lib/wx/src/gen/wxEvent.erl
index 285ed6ecbb..b896c938c2 100644
--- a/lib/wx/src/gen/wxEvent.erl
+++ b/lib/wx/src/gen/wxEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxEvtHandler.erl b/lib/wx/src/gen/wxEvtHandler.erl
index 2d0a87f4dd..d330075101 100644
--- a/lib/wx/src/gen/wxEvtHandler.erl
+++ b/lib/wx/src/gen/wxEvtHandler.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxFileDataObject.erl b/lib/wx/src/gen/wxFileDataObject.erl
index b132e2291b..15f7d149e1 100644
--- a/lib/wx/src/gen/wxFileDataObject.erl
+++ b/lib/wx/src/gen/wxFileDataObject.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxFileDirPickerEvent.erl b/lib/wx/src/gen/wxFileDirPickerEvent.erl
index f2e834f2cb..81e485021b 100644
--- a/lib/wx/src/gen/wxFileDirPickerEvent.erl
+++ b/lib/wx/src/gen/wxFileDirPickerEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxFindReplaceData.erl b/lib/wx/src/gen/wxFindReplaceData.erl
index c31f945d73..851ad2d76f 100644
--- a/lib/wx/src/gen/wxFindReplaceData.erl
+++ b/lib/wx/src/gen/wxFindReplaceData.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxFlexGridSizer.erl b/lib/wx/src/gen/wxFlexGridSizer.erl
index 3e191c8f7b..84a9b619ac 100644
--- a/lib/wx/src/gen/wxFlexGridSizer.erl
+++ b/lib/wx/src/gen/wxFlexGridSizer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxFocusEvent.erl b/lib/wx/src/gen/wxFocusEvent.erl
index 07e1115ee4..ae113ce21c 100644
--- a/lib/wx/src/gen/wxFocusEvent.erl
+++ b/lib/wx/src/gen/wxFocusEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxFont.erl b/lib/wx/src/gen/wxFont.erl
index 5b949260a0..9b98f8b06e 100644
--- a/lib/wx/src/gen/wxFont.erl
+++ b/lib/wx/src/gen/wxFont.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxFontData.erl b/lib/wx/src/gen/wxFontData.erl
index a3c1f729ab..066367862f 100644
--- a/lib/wx/src/gen/wxFontData.erl
+++ b/lib/wx/src/gen/wxFontData.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxFontPickerEvent.erl b/lib/wx/src/gen/wxFontPickerEvent.erl
index 70485149e1..20fd1f9546 100644
--- a/lib/wx/src/gen/wxFontPickerEvent.erl
+++ b/lib/wx/src/gen/wxFontPickerEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGBSizerItem.erl b/lib/wx/src/gen/wxGBSizerItem.erl
index 6498a78626..eb4d3e68e6 100644
--- a/lib/wx/src/gen/wxGBSizerItem.erl
+++ b/lib/wx/src/gen/wxGBSizerItem.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGauge.erl b/lib/wx/src/gen/wxGauge.erl
index 51c35145c4..2745e251b4 100644
--- a/lib/wx/src/gen/wxGauge.erl
+++ b/lib/wx/src/gen/wxGauge.erl
@@ -30,9 +30,8 @@
-module(wxGauge).
-include("wxe.hrl").
--export([create/4,create/5,destroy/1,getBezelFace/1,getRange/1,getShadowWidth/1,
- getValue/1,isVertical/1,new/0,new/3,new/4,pulse/1,setBezelFace/2,setRange/2,
- setShadowWidth/2,setValue/2]).
+-export([create/4,create/5,destroy/1,getRange/1,getValue/1,isVertical/1,new/0,
+ new/3,new/4,pulse/1,setRange/2,setValue/2]).
%% inherited exports
-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
@@ -142,14 +141,6 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Ra
wxe_util:call(?wxGauge_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,Range:32/?UI, BinOpt/binary>>).
-%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgauge.html#wxgaugegetbezelface">external documentation</a>.
--spec getBezelFace(This) -> integer() when
- This::wxGauge().
-getBezelFace(#wx_ref{type=ThisT,ref=ThisRef}) ->
- ?CLASS(ThisT,wxGauge),
- wxe_util:call(?wxGauge_GetBezelFace,
- <<ThisRef:32/?UI>>).
-
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgauge.html#wxgaugegetrange">external documentation</a>.
-spec getRange(This) -> integer() when
This::wxGauge().
@@ -158,14 +149,6 @@ getRange(#wx_ref{type=ThisT,ref=ThisRef}) ->
wxe_util:call(?wxGauge_GetRange,
<<ThisRef:32/?UI>>).
-%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgauge.html#wxgaugegetshadowwidth">external documentation</a>.
--spec getShadowWidth(This) -> integer() when
- This::wxGauge().
-getShadowWidth(#wx_ref{type=ThisT,ref=ThisRef}) ->
- ?CLASS(ThisT,wxGauge),
- wxe_util:call(?wxGauge_GetShadowWidth,
- <<ThisRef:32/?UI>>).
-
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgauge.html#wxgaugegetvalue">external documentation</a>.
-spec getValue(This) -> integer() when
This::wxGauge().
@@ -182,15 +165,6 @@ isVertical(#wx_ref{type=ThisT,ref=ThisRef}) ->
wxe_util:call(?wxGauge_IsVertical,
<<ThisRef:32/?UI>>).
-%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgauge.html#wxgaugesetbezelface">external documentation</a>.
--spec setBezelFace(This, W) -> ok when
- This::wxGauge(), W::integer().
-setBezelFace(#wx_ref{type=ThisT,ref=ThisRef},W)
- when is_integer(W) ->
- ?CLASS(ThisT,wxGauge),
- wxe_util:cast(?wxGauge_SetBezelFace,
- <<ThisRef:32/?UI,W:32/?UI>>).
-
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgauge.html#wxgaugesetrange">external documentation</a>.
-spec setRange(This, R) -> ok when
This::wxGauge(), R::integer().
@@ -200,15 +174,6 @@ setRange(#wx_ref{type=ThisT,ref=ThisRef},R)
wxe_util:cast(?wxGauge_SetRange,
<<ThisRef:32/?UI,R:32/?UI>>).
-%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgauge.html#wxgaugesetshadowwidth">external documentation</a>.
--spec setShadowWidth(This, W) -> ok when
- This::wxGauge(), W::integer().
-setShadowWidth(#wx_ref{type=ThisT,ref=ThisRef},W)
- when is_integer(W) ->
- ?CLASS(ThisT,wxGauge),
- wxe_util:cast(?wxGauge_SetShadowWidth,
- <<ThisRef:32/?UI,W:32/?UI>>).
-
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxgauge.html#wxgaugesetvalue">external documentation</a>.
-spec setValue(This, Pos) -> ok when
This::wxGauge(), Pos::integer().
diff --git a/lib/wx/src/gen/wxGraphicsBrush.erl b/lib/wx/src/gen/wxGraphicsBrush.erl
index d8c2dc680f..f8093e984a 100644
--- a/lib/wx/src/gen/wxGraphicsBrush.erl
+++ b/lib/wx/src/gen/wxGraphicsBrush.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGraphicsContext.erl b/lib/wx/src/gen/wxGraphicsContext.erl
index 4fc62f87fb..bbb2cfc0ca 100644
--- a/lib/wx/src/gen/wxGraphicsContext.erl
+++ b/lib/wx/src/gen/wxGraphicsContext.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGraphicsFont.erl b/lib/wx/src/gen/wxGraphicsFont.erl
index b41d018269..d3832b4cdf 100644
--- a/lib/wx/src/gen/wxGraphicsFont.erl
+++ b/lib/wx/src/gen/wxGraphicsFont.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGraphicsMatrix.erl b/lib/wx/src/gen/wxGraphicsMatrix.erl
index c513b99954..b22e667fed 100644
--- a/lib/wx/src/gen/wxGraphicsMatrix.erl
+++ b/lib/wx/src/gen/wxGraphicsMatrix.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGraphicsObject.erl b/lib/wx/src/gen/wxGraphicsObject.erl
index abb4d6dc2d..f0e4d94785 100644
--- a/lib/wx/src/gen/wxGraphicsObject.erl
+++ b/lib/wx/src/gen/wxGraphicsObject.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGraphicsPath.erl b/lib/wx/src/gen/wxGraphicsPath.erl
index 6d65093775..b2f7cd1785 100644
--- a/lib/wx/src/gen/wxGraphicsPath.erl
+++ b/lib/wx/src/gen/wxGraphicsPath.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGraphicsPen.erl b/lib/wx/src/gen/wxGraphicsPen.erl
index 48f995e887..fa6283539e 100644
--- a/lib/wx/src/gen/wxGraphicsPen.erl
+++ b/lib/wx/src/gen/wxGraphicsPen.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGraphicsRenderer.erl b/lib/wx/src/gen/wxGraphicsRenderer.erl
index b4f50e35fe..c28222fe24 100644
--- a/lib/wx/src/gen/wxGraphicsRenderer.erl
+++ b/lib/wx/src/gen/wxGraphicsRenderer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGridBagSizer.erl b/lib/wx/src/gen/wxGridBagSizer.erl
index adbc66adca..521bf7d5de 100644
--- a/lib/wx/src/gen/wxGridBagSizer.erl
+++ b/lib/wx/src/gen/wxGridBagSizer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGridCellAttr.erl b/lib/wx/src/gen/wxGridCellAttr.erl
index 4880c1fab2..8d55155c5c 100644
--- a/lib/wx/src/gen/wxGridCellAttr.erl
+++ b/lib/wx/src/gen/wxGridCellAttr.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGridCellBoolEditor.erl b/lib/wx/src/gen/wxGridCellBoolEditor.erl
index 1308ab84ae..93a05e2959 100644
--- a/lib/wx/src/gen/wxGridCellBoolEditor.erl
+++ b/lib/wx/src/gen/wxGridCellBoolEditor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGridCellBoolRenderer.erl b/lib/wx/src/gen/wxGridCellBoolRenderer.erl
index 55f54100f3..ce576a3c1d 100644
--- a/lib/wx/src/gen/wxGridCellBoolRenderer.erl
+++ b/lib/wx/src/gen/wxGridCellBoolRenderer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGridCellChoiceEditor.erl b/lib/wx/src/gen/wxGridCellChoiceEditor.erl
index 8aa4420ffb..3e24ea21a0 100644
--- a/lib/wx/src/gen/wxGridCellChoiceEditor.erl
+++ b/lib/wx/src/gen/wxGridCellChoiceEditor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGridCellEditor.erl b/lib/wx/src/gen/wxGridCellEditor.erl
index 253868300e..03b196e5a2 100644
--- a/lib/wx/src/gen/wxGridCellEditor.erl
+++ b/lib/wx/src/gen/wxGridCellEditor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGridCellFloatEditor.erl b/lib/wx/src/gen/wxGridCellFloatEditor.erl
index 6dd8ec7647..e4f8b81fef 100644
--- a/lib/wx/src/gen/wxGridCellFloatEditor.erl
+++ b/lib/wx/src/gen/wxGridCellFloatEditor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGridCellFloatRenderer.erl b/lib/wx/src/gen/wxGridCellFloatRenderer.erl
index c0f4157970..c5ddf78c44 100644
--- a/lib/wx/src/gen/wxGridCellFloatRenderer.erl
+++ b/lib/wx/src/gen/wxGridCellFloatRenderer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGridCellNumberEditor.erl b/lib/wx/src/gen/wxGridCellNumberEditor.erl
index e08cade3e0..fb42faaf24 100644
--- a/lib/wx/src/gen/wxGridCellNumberEditor.erl
+++ b/lib/wx/src/gen/wxGridCellNumberEditor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGridCellNumberRenderer.erl b/lib/wx/src/gen/wxGridCellNumberRenderer.erl
index 437654f2bb..815640f6da 100644
--- a/lib/wx/src/gen/wxGridCellNumberRenderer.erl
+++ b/lib/wx/src/gen/wxGridCellNumberRenderer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGridCellRenderer.erl b/lib/wx/src/gen/wxGridCellRenderer.erl
index 0821f3b632..00f553b71a 100644
--- a/lib/wx/src/gen/wxGridCellRenderer.erl
+++ b/lib/wx/src/gen/wxGridCellRenderer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGridCellStringRenderer.erl b/lib/wx/src/gen/wxGridCellStringRenderer.erl
index c9d7474988..fce72cf02b 100644
--- a/lib/wx/src/gen/wxGridCellStringRenderer.erl
+++ b/lib/wx/src/gen/wxGridCellStringRenderer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGridCellTextEditor.erl b/lib/wx/src/gen/wxGridCellTextEditor.erl
index 303f1e90b6..e6d3f508b7 100644
--- a/lib/wx/src/gen/wxGridCellTextEditor.erl
+++ b/lib/wx/src/gen/wxGridCellTextEditor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGridEvent.erl b/lib/wx/src/gen/wxGridEvent.erl
index e1fb27bc5b..c459d7fdbf 100644
--- a/lib/wx/src/gen/wxGridEvent.erl
+++ b/lib/wx/src/gen/wxGridEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxGridSizer.erl b/lib/wx/src/gen/wxGridSizer.erl
index 78fe5b16ed..5cfede3e9c 100644
--- a/lib/wx/src/gen/wxGridSizer.erl
+++ b/lib/wx/src/gen/wxGridSizer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxHelpEvent.erl b/lib/wx/src/gen/wxHelpEvent.erl
index 20affab33d..ec5107a3dc 100644
--- a/lib/wx/src/gen/wxHelpEvent.erl
+++ b/lib/wx/src/gen/wxHelpEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxHtmlEasyPrinting.erl b/lib/wx/src/gen/wxHtmlEasyPrinting.erl
index 0a3d79caee..b445fc01ab 100644
--- a/lib/wx/src/gen/wxHtmlEasyPrinting.erl
+++ b/lib/wx/src/gen/wxHtmlEasyPrinting.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxHtmlLinkEvent.erl b/lib/wx/src/gen/wxHtmlLinkEvent.erl
index 08594c95f0..ad1bf4e1bc 100644
--- a/lib/wx/src/gen/wxHtmlLinkEvent.erl
+++ b/lib/wx/src/gen/wxHtmlLinkEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxIcon.erl b/lib/wx/src/gen/wxIcon.erl
index 82042b0ba2..a14d76e270 100644
--- a/lib/wx/src/gen/wxIcon.erl
+++ b/lib/wx/src/gen/wxIcon.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxIconBundle.erl b/lib/wx/src/gen/wxIconBundle.erl
index acf98d0a12..8edfdc48b8 100644
--- a/lib/wx/src/gen/wxIconBundle.erl
+++ b/lib/wx/src/gen/wxIconBundle.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxIconizeEvent.erl b/lib/wx/src/gen/wxIconizeEvent.erl
index 495f636946..c53a4cc406 100644
--- a/lib/wx/src/gen/wxIconizeEvent.erl
+++ b/lib/wx/src/gen/wxIconizeEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxIdleEvent.erl b/lib/wx/src/gen/wxIdleEvent.erl
index 4b83b5f50a..bcccf713f3 100644
--- a/lib/wx/src/gen/wxIdleEvent.erl
+++ b/lib/wx/src/gen/wxIdleEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxImage.erl b/lib/wx/src/gen/wxImage.erl
index 05d1038eee..884e49eabf 100644
--- a/lib/wx/src/gen/wxImage.erl
+++ b/lib/wx/src/gen/wxImage.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxImageList.erl b/lib/wx/src/gen/wxImageList.erl
index 89e0b2cd41..dcd508d05b 100644
--- a/lib/wx/src/gen/wxImageList.erl
+++ b/lib/wx/src/gen/wxImageList.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxInitDialogEvent.erl b/lib/wx/src/gen/wxInitDialogEvent.erl
index 3ab90b947c..54e344616e 100644
--- a/lib/wx/src/gen/wxInitDialogEvent.erl
+++ b/lib/wx/src/gen/wxInitDialogEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxJoystickEvent.erl b/lib/wx/src/gen/wxJoystickEvent.erl
index 5d82b629c3..d26eb42fe8 100644
--- a/lib/wx/src/gen/wxJoystickEvent.erl
+++ b/lib/wx/src/gen/wxJoystickEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxKeyEvent.erl b/lib/wx/src/gen/wxKeyEvent.erl
index 6a3b5de502..8f215c6eb7 100644
--- a/lib/wx/src/gen/wxKeyEvent.erl
+++ b/lib/wx/src/gen/wxKeyEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxLayoutAlgorithm.erl b/lib/wx/src/gen/wxLayoutAlgorithm.erl
index 6a3e77b3de..344af3dc0d 100644
--- a/lib/wx/src/gen/wxLayoutAlgorithm.erl
+++ b/lib/wx/src/gen/wxLayoutAlgorithm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxListCtrl.erl b/lib/wx/src/gen/wxListCtrl.erl
index 6750931fdb..ed997710c8 100644
--- a/lib/wx/src/gen/wxListCtrl.erl
+++ b/lib/wx/src/gen/wxListCtrl.erl
@@ -38,7 +38,7 @@
getItemData/2,getItemFont/2,getItemPosition/2,getItemRect/2,getItemRect/3,
getItemSpacing/1,getItemState/3,getItemText/2,getItemTextColour/2,
getNextItem/2,getNextItem/3,getSelectedItemCount/1,getTextColour/1,
- getTopItem/1,getViewRect/1,hitTest/3,insertColumn/3,insertColumn/4,
+ getTopItem/1,getViewRect/1,hitTest/2,insertColumn/3,insertColumn/4,
insertItem/2,insertItem/3,insertItem/4,refreshItem/2,refreshItems/3,
scrollList/3,setBackgroundColour/2,setColumn/3,setColumnWidth/3,setImageList/3,
setItem/2,setItem/4,setItem/5,setItemBackgroundColour/3,setItemColumnImage/4,
@@ -516,13 +516,14 @@ getViewRect(#wx_ref{type=ThisT,ref=ThisRef}) ->
<<ThisRef:32/?UI>>).
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxlistctrl.html#wxlistctrlhittest">external documentation</a>.
--spec hitTest(This, Point, Flags) -> integer() when
- This::wxListCtrl(), Point::{X::integer(), Y::integer()}, Flags::integer().
-hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PointX,PointY},Flags)
- when is_integer(PointX),is_integer(PointY),is_integer(Flags) ->
+-spec hitTest(This, Point) -> Result when
+ Result ::{Res ::integer(), Flags::integer(), PSubItem::integer()},
+ This::wxListCtrl(), Point::{X::integer(), Y::integer()}.
+hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PointX,PointY})
+ when is_integer(PointX),is_integer(PointY) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_HitTest,
- <<ThisRef:32/?UI,PointX:32/?UI,PointY:32/?UI,Flags:32/?UI>>).
+ <<ThisRef:32/?UI,PointX:32/?UI,PointY:32/?UI>>).
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxlistctrl.html#wxlistctrlinsertcolumn">external documentation</a>.
%% <br /> Also:<br />
diff --git a/lib/wx/src/gen/wxListEvent.erl b/lib/wx/src/gen/wxListEvent.erl
index b989f9233c..b66773fcc7 100644
--- a/lib/wx/src/gen/wxListEvent.erl
+++ b/lib/wx/src/gen/wxListEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxListItem.erl b/lib/wx/src/gen/wxListItem.erl
index 568eba4c6a..0dcad246d0 100644
--- a/lib/wx/src/gen/wxListItem.erl
+++ b/lib/wx/src/gen/wxListItem.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxListItemAttr.erl b/lib/wx/src/gen/wxListItemAttr.erl
index 0c594ede8f..c581292358 100644
--- a/lib/wx/src/gen/wxListItemAttr.erl
+++ b/lib/wx/src/gen/wxListItemAttr.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxLocale.erl b/lib/wx/src/gen/wxLocale.erl
index c0488022e0..7d208b9823 100644
--- a/lib/wx/src/gen/wxLocale.erl
+++ b/lib/wx/src/gen/wxLocale.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxLogNull.erl b/lib/wx/src/gen/wxLogNull.erl
index aa45245cd0..a071dffb95 100644
--- a/lib/wx/src/gen/wxLogNull.erl
+++ b/lib/wx/src/gen/wxLogNull.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxMask.erl b/lib/wx/src/gen/wxMask.erl
index 343f8e4938..98c96277dd 100644
--- a/lib/wx/src/gen/wxMask.erl
+++ b/lib/wx/src/gen/wxMask.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxMaximizeEvent.erl b/lib/wx/src/gen/wxMaximizeEvent.erl
index 32abc5536c..ae23757810 100644
--- a/lib/wx/src/gen/wxMaximizeEvent.erl
+++ b/lib/wx/src/gen/wxMaximizeEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxMemoryDC.erl b/lib/wx/src/gen/wxMemoryDC.erl
index 7fddaa7bf1..8a59be7ad2 100644
--- a/lib/wx/src/gen/wxMemoryDC.erl
+++ b/lib/wx/src/gen/wxMemoryDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxMenu.erl b/lib/wx/src/gen/wxMenu.erl
index a9911e7ded..59feef7b19 100644
--- a/lib/wx/src/gen/wxMenu.erl
+++ b/lib/wx/src/gen/wxMenu.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxMenuEvent.erl b/lib/wx/src/gen/wxMenuEvent.erl
index e30906fb3d..422c97e980 100644
--- a/lib/wx/src/gen/wxMenuEvent.erl
+++ b/lib/wx/src/gen/wxMenuEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxMenuItem.erl b/lib/wx/src/gen/wxMenuItem.erl
index 94f160c02e..9325f47d90 100644
--- a/lib/wx/src/gen/wxMenuItem.erl
+++ b/lib/wx/src/gen/wxMenuItem.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxMirrorDC.erl b/lib/wx/src/gen/wxMirrorDC.erl
index 459205e18b..20d51a2374 100644
--- a/lib/wx/src/gen/wxMirrorDC.erl
+++ b/lib/wx/src/gen/wxMirrorDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxMouseCaptureChangedEvent.erl b/lib/wx/src/gen/wxMouseCaptureChangedEvent.erl
index d9d4ab9ba4..7a0c3c43b8 100644
--- a/lib/wx/src/gen/wxMouseCaptureChangedEvent.erl
+++ b/lib/wx/src/gen/wxMouseCaptureChangedEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxMouseEvent.erl b/lib/wx/src/gen/wxMouseEvent.erl
index 8fcdc79620..8728770693 100644
--- a/lib/wx/src/gen/wxMouseEvent.erl
+++ b/lib/wx/src/gen/wxMouseEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxMoveEvent.erl b/lib/wx/src/gen/wxMoveEvent.erl
index bbab536400..dbd45bccd4 100644
--- a/lib/wx/src/gen/wxMoveEvent.erl
+++ b/lib/wx/src/gen/wxMoveEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxNavigationKeyEvent.erl b/lib/wx/src/gen/wxNavigationKeyEvent.erl
index 58b465fdd5..8a483f2ccf 100644
--- a/lib/wx/src/gen/wxNavigationKeyEvent.erl
+++ b/lib/wx/src/gen/wxNavigationKeyEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxNotebookEvent.erl b/lib/wx/src/gen/wxNotebookEvent.erl
index 931313008d..063cab68ea 100644
--- a/lib/wx/src/gen/wxNotebookEvent.erl
+++ b/lib/wx/src/gen/wxNotebookEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxNotifyEvent.erl b/lib/wx/src/gen/wxNotifyEvent.erl
index f43d72db3c..0befce0e77 100644
--- a/lib/wx/src/gen/wxNotifyEvent.erl
+++ b/lib/wx/src/gen/wxNotifyEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxPageSetupDialog.erl b/lib/wx/src/gen/wxPageSetupDialog.erl
index e6e6412d2c..41897064b5 100644
--- a/lib/wx/src/gen/wxPageSetupDialog.erl
+++ b/lib/wx/src/gen/wxPageSetupDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxPageSetupDialogData.erl b/lib/wx/src/gen/wxPageSetupDialogData.erl
index bcfd55d8bc..6aa8865e32 100644
--- a/lib/wx/src/gen/wxPageSetupDialogData.erl
+++ b/lib/wx/src/gen/wxPageSetupDialogData.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxPaintDC.erl b/lib/wx/src/gen/wxPaintDC.erl
index b2f2d6a977..77efd2c4ba 100644
--- a/lib/wx/src/gen/wxPaintDC.erl
+++ b/lib/wx/src/gen/wxPaintDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxPaintEvent.erl b/lib/wx/src/gen/wxPaintEvent.erl
index 20885bf69c..8df874b34c 100644
--- a/lib/wx/src/gen/wxPaintEvent.erl
+++ b/lib/wx/src/gen/wxPaintEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxPalette.erl b/lib/wx/src/gen/wxPalette.erl
index 9883283828..8ac0833e01 100644
--- a/lib/wx/src/gen/wxPalette.erl
+++ b/lib/wx/src/gen/wxPalette.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxPaletteChangedEvent.erl b/lib/wx/src/gen/wxPaletteChangedEvent.erl
index 80e15af0ec..ab49719f6e 100644
--- a/lib/wx/src/gen/wxPaletteChangedEvent.erl
+++ b/lib/wx/src/gen/wxPaletteChangedEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxPen.erl b/lib/wx/src/gen/wxPen.erl
index cd6fa9884c..761b885006 100644
--- a/lib/wx/src/gen/wxPen.erl
+++ b/lib/wx/src/gen/wxPen.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxPostScriptDC.erl b/lib/wx/src/gen/wxPostScriptDC.erl
index 2af3b53cf0..28f8a757ed 100644
--- a/lib/wx/src/gen/wxPostScriptDC.erl
+++ b/lib/wx/src/gen/wxPostScriptDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxPrintData.erl b/lib/wx/src/gen/wxPrintData.erl
index 757685c36b..a8a72c52f4 100644
--- a/lib/wx/src/gen/wxPrintData.erl
+++ b/lib/wx/src/gen/wxPrintData.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxPrintDialogData.erl b/lib/wx/src/gen/wxPrintDialogData.erl
index 3ed49808e6..b93af1151b 100644
--- a/lib/wx/src/gen/wxPrintDialogData.erl
+++ b/lib/wx/src/gen/wxPrintDialogData.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxPrintPreview.erl b/lib/wx/src/gen/wxPrintPreview.erl
index cb3ccccbbe..162d259530 100644
--- a/lib/wx/src/gen/wxPrintPreview.erl
+++ b/lib/wx/src/gen/wxPrintPreview.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxPrinter.erl b/lib/wx/src/gen/wxPrinter.erl
index ec27b3cab9..5f3122d32c 100644
--- a/lib/wx/src/gen/wxPrinter.erl
+++ b/lib/wx/src/gen/wxPrinter.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxPrintout.erl b/lib/wx/src/gen/wxPrintout.erl
index 45ca116251..7f2b59bbe7 100644
--- a/lib/wx/src/gen/wxPrintout.erl
+++ b/lib/wx/src/gen/wxPrintout.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxQueryNewPaletteEvent.erl b/lib/wx/src/gen/wxQueryNewPaletteEvent.erl
index 11ca65923d..2473fe5f61 100644
--- a/lib/wx/src/gen/wxQueryNewPaletteEvent.erl
+++ b/lib/wx/src/gen/wxQueryNewPaletteEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxRegion.erl b/lib/wx/src/gen/wxRegion.erl
index 63662eb163..7a21baee92 100644
--- a/lib/wx/src/gen/wxRegion.erl
+++ b/lib/wx/src/gen/wxRegion.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxSashEvent.erl b/lib/wx/src/gen/wxSashEvent.erl
index e4d31043e0..3bd8b92ff6 100644
--- a/lib/wx/src/gen/wxSashEvent.erl
+++ b/lib/wx/src/gen/wxSashEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxScreenDC.erl b/lib/wx/src/gen/wxScreenDC.erl
index 2766d8d397..24028a000f 100644
--- a/lib/wx/src/gen/wxScreenDC.erl
+++ b/lib/wx/src/gen/wxScreenDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxScrollEvent.erl b/lib/wx/src/gen/wxScrollEvent.erl
index d8b29dfa2d..6a79fd0cdc 100644
--- a/lib/wx/src/gen/wxScrollEvent.erl
+++ b/lib/wx/src/gen/wxScrollEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxScrollWinEvent.erl b/lib/wx/src/gen/wxScrollWinEvent.erl
index a5bfb101f0..4c344a411b 100644
--- a/lib/wx/src/gen/wxScrollWinEvent.erl
+++ b/lib/wx/src/gen/wxScrollWinEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxSetCursorEvent.erl b/lib/wx/src/gen/wxSetCursorEvent.erl
index 0e2fbc5cba..b7473d4d17 100644
--- a/lib/wx/src/gen/wxSetCursorEvent.erl
+++ b/lib/wx/src/gen/wxSetCursorEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxShowEvent.erl b/lib/wx/src/gen/wxShowEvent.erl
index 3723213ebd..962a880f61 100644
--- a/lib/wx/src/gen/wxShowEvent.erl
+++ b/lib/wx/src/gen/wxShowEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxSizeEvent.erl b/lib/wx/src/gen/wxSizeEvent.erl
index 5bef3a845d..bc881817ad 100644
--- a/lib/wx/src/gen/wxSizeEvent.erl
+++ b/lib/wx/src/gen/wxSizeEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxSizer.erl b/lib/wx/src/gen/wxSizer.erl
index 06f6fa7463..723625f85e 100644
--- a/lib/wx/src/gen/wxSizer.erl
+++ b/lib/wx/src/gen/wxSizer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxSizerFlags.erl b/lib/wx/src/gen/wxSizerFlags.erl
index 1cbe38426f..08fbaca3af 100644
--- a/lib/wx/src/gen/wxSizerFlags.erl
+++ b/lib/wx/src/gen/wxSizerFlags.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxSizerItem.erl b/lib/wx/src/gen/wxSizerItem.erl
index 807941df5a..9eebe15cd0 100644
--- a/lib/wx/src/gen/wxSizerItem.erl
+++ b/lib/wx/src/gen/wxSizerItem.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxSpinEvent.erl b/lib/wx/src/gen/wxSpinEvent.erl
index 21ebdd500f..da3111e5f5 100644
--- a/lib/wx/src/gen/wxSpinEvent.erl
+++ b/lib/wx/src/gen/wxSpinEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxSplitterEvent.erl b/lib/wx/src/gen/wxSplitterEvent.erl
index e8001ec540..3daef5cdc1 100644
--- a/lib/wx/src/gen/wxSplitterEvent.erl
+++ b/lib/wx/src/gen/wxSplitterEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxStaticBoxSizer.erl b/lib/wx/src/gen/wxStaticBoxSizer.erl
index 9edf495679..76dde099b6 100644
--- a/lib/wx/src/gen/wxStaticBoxSizer.erl
+++ b/lib/wx/src/gen/wxStaticBoxSizer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxStdDialogButtonSizer.erl b/lib/wx/src/gen/wxStdDialogButtonSizer.erl
index 2843eaf98b..97beee6f14 100644
--- a/lib/wx/src/gen/wxStdDialogButtonSizer.erl
+++ b/lib/wx/src/gen/wxStdDialogButtonSizer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxStyledTextEvent.erl b/lib/wx/src/gen/wxStyledTextEvent.erl
index d794673f69..bee5ffd04c 100644
--- a/lib/wx/src/gen/wxStyledTextEvent.erl
+++ b/lib/wx/src/gen/wxStyledTextEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxSysColourChangedEvent.erl b/lib/wx/src/gen/wxSysColourChangedEvent.erl
index 308b399198..bd7a4276a4 100644
--- a/lib/wx/src/gen/wxSysColourChangedEvent.erl
+++ b/lib/wx/src/gen/wxSysColourChangedEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxSystemOptions.erl b/lib/wx/src/gen/wxSystemOptions.erl
index fe2e1c98cd..9db137b6a1 100644
--- a/lib/wx/src/gen/wxSystemOptions.erl
+++ b/lib/wx/src/gen/wxSystemOptions.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxSystemSettings.erl b/lib/wx/src/gen/wxSystemSettings.erl
index 57fcf455dc..234b2414c0 100644
--- a/lib/wx/src/gen/wxSystemSettings.erl
+++ b/lib/wx/src/gen/wxSystemSettings.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxTaskBarIcon.erl b/lib/wx/src/gen/wxTaskBarIcon.erl
index aab41f4645..0f336c6e4c 100644
--- a/lib/wx/src/gen/wxTaskBarIcon.erl
+++ b/lib/wx/src/gen/wxTaskBarIcon.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxTaskBarIconEvent.erl b/lib/wx/src/gen/wxTaskBarIconEvent.erl
index 199e4930c3..82def18484 100644
--- a/lib/wx/src/gen/wxTaskBarIconEvent.erl
+++ b/lib/wx/src/gen/wxTaskBarIconEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxTextAttr.erl b/lib/wx/src/gen/wxTextAttr.erl
index 9d4361f742..bcc2abf73e 100644
--- a/lib/wx/src/gen/wxTextAttr.erl
+++ b/lib/wx/src/gen/wxTextAttr.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxTextDataObject.erl b/lib/wx/src/gen/wxTextDataObject.erl
index 89e51b24cb..a1893eed1c 100644
--- a/lib/wx/src/gen/wxTextDataObject.erl
+++ b/lib/wx/src/gen/wxTextDataObject.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxToolTip.erl b/lib/wx/src/gen/wxToolTip.erl
index b462dac72a..78831de8c5 100644
--- a/lib/wx/src/gen/wxToolTip.erl
+++ b/lib/wx/src/gen/wxToolTip.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxTreeEvent.erl b/lib/wx/src/gen/wxTreeEvent.erl
index 54cdf9ef66..5200a7a8e9 100644
--- a/lib/wx/src/gen/wxTreeEvent.erl
+++ b/lib/wx/src/gen/wxTreeEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxUpdateUIEvent.erl b/lib/wx/src/gen/wxUpdateUIEvent.erl
index 5d4fb6e2b0..db126eec40 100644
--- a/lib/wx/src/gen/wxUpdateUIEvent.erl
+++ b/lib/wx/src/gen/wxUpdateUIEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxWindowCreateEvent.erl b/lib/wx/src/gen/wxWindowCreateEvent.erl
index d5b1c0d256..ded8d51a65 100644
--- a/lib/wx/src/gen/wxWindowCreateEvent.erl
+++ b/lib/wx/src/gen/wxWindowCreateEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxWindowDC.erl b/lib/wx/src/gen/wxWindowDC.erl
index 96f932d3d5..176580a9bf 100644
--- a/lib/wx/src/gen/wxWindowDC.erl
+++ b/lib/wx/src/gen/wxWindowDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxWindowDestroyEvent.erl b/lib/wx/src/gen/wxWindowDestroyEvent.erl
index d8e15397f7..0fd3724ad3 100644
--- a/lib/wx/src/gen/wxWindowDestroyEvent.erl
+++ b/lib/wx/src/gen/wxWindowDestroyEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxXmlResource.erl b/lib/wx/src/gen/wxXmlResource.erl
index fec9a5b4a9..b4d08fbbd5 100644
--- a/lib/wx/src/gen/wxXmlResource.erl
+++ b/lib/wx/src/gen/wxXmlResource.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wx_misc.erl b/lib/wx/src/gen/wx_misc.erl
index 44a9309f7e..5db6ceb036 100644
--- a/lib/wx/src/gen/wx_misc.erl
+++ b/lib/wx/src/gen/wx_misc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/gen/wxe_debug.hrl b/lib/wx/src/gen/wxe_debug.hrl
index a2462a6fb2..78c6577439 100644
--- a/lib/wx/src/gen/wxe_debug.hrl
+++ b/lib/wx/src/gen/wxe_debug.hrl
@@ -1457,1925 +1457,1921 @@ wxdebug_table() ->
{1602, {wxGauge, new_0, 0}},
{1603, {wxGauge, new_4, 4}},
{1604, {wxGauge, create, 4}},
- {1605, {wxGauge, getBezelFace, 0}},
- {1606, {wxGauge, getRange, 0}},
- {1607, {wxGauge, getShadowWidth, 0}},
- {1608, {wxGauge, getValue, 0}},
- {1609, {wxGauge, isVertical, 0}},
- {1610, {wxGauge, setBezelFace, 1}},
- {1611, {wxGauge, setRange, 1}},
- {1612, {wxGauge, setShadowWidth, 1}},
- {1613, {wxGauge, setValue, 1}},
- {1614, {wxGauge, pulse, 0}},
- {1615, {wxGauge, 'Destroy', undefined}},
- {1616, {wxGenericDirCtrl, new_0, 0}},
- {1617, {wxGenericDirCtrl, new_2, 2}},
- {1618, {wxGenericDirCtrl, destruct, 0}},
- {1619, {wxGenericDirCtrl, create, 2}},
- {1620, {wxGenericDirCtrl, init, 0}},
- {1621, {wxGenericDirCtrl, collapseTree, 0}},
- {1622, {wxGenericDirCtrl, expandPath, 1}},
- {1623, {wxGenericDirCtrl, getDefaultPath, 0}},
- {1624, {wxGenericDirCtrl, getPath, 0}},
- {1625, {wxGenericDirCtrl, getFilePath, 0}},
- {1626, {wxGenericDirCtrl, getFilter, 0}},
- {1627, {wxGenericDirCtrl, getFilterIndex, 0}},
- {1628, {wxGenericDirCtrl, getRootId, 0}},
- {1629, {wxGenericDirCtrl, getTreeCtrl, 0}},
- {1630, {wxGenericDirCtrl, reCreateTree, 0}},
- {1631, {wxGenericDirCtrl, setDefaultPath, 1}},
- {1632, {wxGenericDirCtrl, setFilter, 1}},
- {1633, {wxGenericDirCtrl, setFilterIndex, 1}},
- {1634, {wxGenericDirCtrl, setPath, 1}},
- {1636, {wxStaticBox, new_4, 4}},
- {1637, {wxStaticBox, new_0, 0}},
- {1638, {wxStaticBox, create, 4}},
- {1639, {wxStaticBox, 'Destroy', undefined}},
- {1641, {wxStaticLine, new_2, 2}},
- {1642, {wxStaticLine, new_0, 0}},
- {1643, {wxStaticLine, create, 2}},
- {1644, {wxStaticLine, isVertical, 0}},
- {1645, {wxStaticLine, getDefaultSize, 0}},
- {1646, {wxStaticLine, 'Destroy', undefined}},
- {1649, {wxListBox, new_3, 3}},
- {1650, {wxListBox, new_0, 0}},
- {1652, {wxListBox, destruct, 0}},
- {1654, {wxListBox, create, 6}},
- {1655, {wxListBox, deselect, 1}},
- {1656, {wxListBox, getSelections, 1}},
- {1657, {wxListBox, insertItems, 2}},
- {1658, {wxListBox, isSelected, 1}},
- {1659, {wxListBox, set, 1}},
- {1660, {wxListBox, hitTest, 1}},
- {1661, {wxListBox, setFirstItem_1_0, 1}},
- {1662, {wxListBox, setFirstItem_1_1, 1}},
- {1663, {wxListCtrl, new_0, 0}},
- {1664, {wxListCtrl, new_2, 2}},
- {1665, {wxListCtrl, arrange, 1}},
- {1666, {wxListCtrl, assignImageList, 2}},
- {1667, {wxListCtrl, clearAll, 0}},
- {1668, {wxListCtrl, create, 2}},
- {1669, {wxListCtrl, deleteAllItems, 0}},
- {1670, {wxListCtrl, deleteColumn, 1}},
- {1671, {wxListCtrl, deleteItem, 1}},
- {1672, {wxListCtrl, editLabel, 1}},
- {1673, {wxListCtrl, ensureVisible, 1}},
- {1674, {wxListCtrl, findItem_3_0, 3}},
- {1675, {wxListCtrl, findItem_3_1, 3}},
- {1676, {wxListCtrl, getColumn, 2}},
- {1677, {wxListCtrl, getColumnCount, 0}},
- {1678, {wxListCtrl, getColumnWidth, 1}},
- {1679, {wxListCtrl, getCountPerPage, 0}},
- {1680, {wxListCtrl, getEditControl, 0}},
- {1681, {wxListCtrl, getImageList, 1}},
- {1682, {wxListCtrl, getItem, 1}},
- {1683, {wxListCtrl, getItemBackgroundColour, 1}},
- {1684, {wxListCtrl, getItemCount, 0}},
- {1685, {wxListCtrl, getItemData, 1}},
- {1686, {wxListCtrl, getItemFont, 1}},
- {1687, {wxListCtrl, getItemPosition, 2}},
- {1688, {wxListCtrl, getItemRect, 3}},
- {1689, {wxListCtrl, getItemSpacing, 0}},
- {1690, {wxListCtrl, getItemState, 2}},
- {1691, {wxListCtrl, getItemText, 1}},
- {1692, {wxListCtrl, getItemTextColour, 1}},
- {1693, {wxListCtrl, getNextItem, 2}},
- {1694, {wxListCtrl, getSelectedItemCount, 0}},
- {1695, {wxListCtrl, getTextColour, 0}},
- {1696, {wxListCtrl, getTopItem, 0}},
- {1697, {wxListCtrl, getViewRect, 0}},
- {1698, {wxListCtrl, hitTest, 2}},
- {1699, {wxListCtrl, insertColumn_2, 2}},
- {1700, {wxListCtrl, insertColumn_3, 3}},
- {1701, {wxListCtrl, insertItem_1, 1}},
- {1702, {wxListCtrl, insertItem_2_1, 2}},
- {1703, {wxListCtrl, insertItem_2_0, 2}},
- {1704, {wxListCtrl, insertItem_3, 3}},
- {1705, {wxListCtrl, refreshItem, 1}},
- {1706, {wxListCtrl, refreshItems, 2}},
- {1707, {wxListCtrl, scrollList, 2}},
- {1708, {wxListCtrl, setBackgroundColour, 1}},
- {1709, {wxListCtrl, setColumn, 2}},
- {1710, {wxListCtrl, setColumnWidth, 2}},
- {1711, {wxListCtrl, setImageList, 2}},
- {1712, {wxListCtrl, setItem_1, 1}},
- {1713, {wxListCtrl, setItem_4, 4}},
- {1714, {wxListCtrl, setItemBackgroundColour, 2}},
- {1715, {wxListCtrl, setItemCount, 1}},
- {1716, {wxListCtrl, setItemData, 2}},
- {1717, {wxListCtrl, setItemFont, 2}},
- {1718, {wxListCtrl, setItemImage, 3}},
- {1719, {wxListCtrl, setItemColumnImage, 3}},
- {1720, {wxListCtrl, setItemPosition, 2}},
- {1721, {wxListCtrl, setItemState, 3}},
- {1722, {wxListCtrl, setItemText, 2}},
- {1723, {wxListCtrl, setItemTextColour, 2}},
- {1724, {wxListCtrl, setSingleStyle, 2}},
- {1725, {wxListCtrl, setTextColour, 1}},
- {1726, {wxListCtrl, setWindowStyleFlag, 1}},
- {1727, {wxListCtrl, sortItems, 2}},
- {1728, {wxListCtrl, 'Destroy', undefined}},
- {1729, {wxListView, clearColumnImage, 1}},
- {1730, {wxListView, focus, 1}},
- {1731, {wxListView, getFirstSelected, 0}},
- {1732, {wxListView, getFocusedItem, 0}},
- {1733, {wxListView, getNextSelected, 1}},
- {1734, {wxListView, isSelected, 1}},
- {1735, {wxListView, select, 2}},
- {1736, {wxListView, setColumnImage, 2}},
- {1737, {wxListItem, new_0, 0}},
- {1738, {wxListItem, new_1, 1}},
- {1739, {wxListItem, destruct, 0}},
- {1740, {wxListItem, clear, 0}},
- {1741, {wxListItem, getAlign, 0}},
- {1742, {wxListItem, getBackgroundColour, 0}},
- {1743, {wxListItem, getColumn, 0}},
- {1744, {wxListItem, getFont, 0}},
- {1745, {wxListItem, getId, 0}},
- {1746, {wxListItem, getImage, 0}},
- {1747, {wxListItem, getMask, 0}},
- {1748, {wxListItem, getState, 0}},
- {1749, {wxListItem, getText, 0}},
- {1750, {wxListItem, getTextColour, 0}},
- {1751, {wxListItem, getWidth, 0}},
- {1752, {wxListItem, setAlign, 1}},
- {1753, {wxListItem, setBackgroundColour, 1}},
- {1754, {wxListItem, setColumn, 1}},
- {1755, {wxListItem, setFont, 1}},
- {1756, {wxListItem, setId, 1}},
- {1757, {wxListItem, setImage, 1}},
- {1758, {wxListItem, setMask, 1}},
- {1759, {wxListItem, setState, 1}},
- {1760, {wxListItem, setStateMask, 1}},
- {1761, {wxListItem, setText, 1}},
- {1762, {wxListItem, setTextColour, 1}},
- {1763, {wxListItem, setWidth, 1}},
- {1764, {wxListItemAttr, new_0, 0}},
- {1765, {wxListItemAttr, new_3, 3}},
- {1766, {wxListItemAttr, getBackgroundColour, 0}},
- {1767, {wxListItemAttr, getFont, 0}},
- {1768, {wxListItemAttr, getTextColour, 0}},
- {1769, {wxListItemAttr, hasBackgroundColour, 0}},
- {1770, {wxListItemAttr, hasFont, 0}},
- {1771, {wxListItemAttr, hasTextColour, 0}},
- {1772, {wxListItemAttr, setBackgroundColour, 1}},
- {1773, {wxListItemAttr, setFont, 1}},
- {1774, {wxListItemAttr, setTextColour, 1}},
- {1775, {wxListItemAttr, 'Destroy', undefined}},
- {1776, {wxImageList, new_0, 0}},
- {1777, {wxImageList, new_3, 3}},
- {1778, {wxImageList, add_1, 1}},
- {1779, {wxImageList, add_2_0, 2}},
- {1780, {wxImageList, add_2_1, 2}},
- {1781, {wxImageList, create, 3}},
- {1783, {wxImageList, draw, 5}},
- {1784, {wxImageList, getBitmap, 1}},
- {1785, {wxImageList, getIcon, 1}},
- {1786, {wxImageList, getImageCount, 0}},
- {1787, {wxImageList, getSize, 3}},
- {1788, {wxImageList, remove, 1}},
- {1789, {wxImageList, removeAll, 0}},
- {1790, {wxImageList, replace_2, 2}},
- {1791, {wxImageList, replace_3, 3}},
- {1792, {wxImageList, 'Destroy', undefined}},
- {1793, {wxTextAttr, new_0, 0}},
- {1794, {wxTextAttr, new_2, 2}},
- {1795, {wxTextAttr, getAlignment, 0}},
- {1796, {wxTextAttr, getBackgroundColour, 0}},
- {1797, {wxTextAttr, getFont, 0}},
- {1798, {wxTextAttr, getLeftIndent, 0}},
- {1799, {wxTextAttr, getLeftSubIndent, 0}},
- {1800, {wxTextAttr, getRightIndent, 0}},
- {1801, {wxTextAttr, getTabs, 0}},
- {1802, {wxTextAttr, getTextColour, 0}},
- {1803, {wxTextAttr, hasBackgroundColour, 0}},
- {1804, {wxTextAttr, hasFont, 0}},
- {1805, {wxTextAttr, hasTextColour, 0}},
- {1806, {wxTextAttr, getFlags, 0}},
- {1807, {wxTextAttr, isDefault, 0}},
- {1808, {wxTextAttr, setAlignment, 1}},
- {1809, {wxTextAttr, setBackgroundColour, 1}},
- {1810, {wxTextAttr, setFlags, 1}},
- {1811, {wxTextAttr, setFont, 2}},
- {1812, {wxTextAttr, setLeftIndent, 2}},
- {1813, {wxTextAttr, setRightIndent, 1}},
- {1814, {wxTextAttr, setTabs, 1}},
- {1815, {wxTextAttr, setTextColour, 1}},
- {1816, {wxTextAttr, 'Destroy', undefined}},
- {1818, {wxTextCtrl, new_3, 3}},
- {1819, {wxTextCtrl, new_0, 0}},
- {1821, {wxTextCtrl, destruct, 0}},
- {1822, {wxTextCtrl, appendText, 1}},
- {1823, {wxTextCtrl, canCopy, 0}},
- {1824, {wxTextCtrl, canCut, 0}},
- {1825, {wxTextCtrl, canPaste, 0}},
- {1826, {wxTextCtrl, canRedo, 0}},
- {1827, {wxTextCtrl, canUndo, 0}},
- {1828, {wxTextCtrl, clear, 0}},
- {1829, {wxTextCtrl, copy, 0}},
- {1830, {wxTextCtrl, create, 3}},
- {1831, {wxTextCtrl, cut, 0}},
- {1832, {wxTextCtrl, discardEdits, 0}},
- {1833, {wxTextCtrl, changeValue, 1}},
- {1834, {wxTextCtrl, emulateKeyPress, 1}},
- {1835, {wxTextCtrl, getDefaultStyle, 0}},
- {1836, {wxTextCtrl, getInsertionPoint, 0}},
- {1837, {wxTextCtrl, getLastPosition, 0}},
- {1838, {wxTextCtrl, getLineLength, 1}},
- {1839, {wxTextCtrl, getLineText, 1}},
- {1840, {wxTextCtrl, getNumberOfLines, 0}},
- {1841, {wxTextCtrl, getRange, 2}},
- {1842, {wxTextCtrl, getSelection, 2}},
- {1843, {wxTextCtrl, getStringSelection, 0}},
- {1844, {wxTextCtrl, getStyle, 2}},
- {1845, {wxTextCtrl, getValue, 0}},
- {1846, {wxTextCtrl, isEditable, 0}},
- {1847, {wxTextCtrl, isModified, 0}},
- {1848, {wxTextCtrl, isMultiLine, 0}},
- {1849, {wxTextCtrl, isSingleLine, 0}},
- {1850, {wxTextCtrl, loadFile, 2}},
- {1851, {wxTextCtrl, markDirty, 0}},
- {1852, {wxTextCtrl, paste, 0}},
- {1853, {wxTextCtrl, positionToXY, 3}},
- {1854, {wxTextCtrl, redo, 0}},
- {1855, {wxTextCtrl, remove, 2}},
- {1856, {wxTextCtrl, replace, 3}},
- {1857, {wxTextCtrl, saveFile, 1}},
- {1858, {wxTextCtrl, setDefaultStyle, 1}},
- {1859, {wxTextCtrl, setEditable, 1}},
- {1860, {wxTextCtrl, setInsertionPoint, 1}},
- {1861, {wxTextCtrl, setInsertionPointEnd, 0}},
- {1863, {wxTextCtrl, setMaxLength, 1}},
- {1864, {wxTextCtrl, setSelection, 2}},
- {1865, {wxTextCtrl, setStyle, 3}},
- {1866, {wxTextCtrl, setValue, 1}},
- {1867, {wxTextCtrl, showPosition, 1}},
- {1868, {wxTextCtrl, undo, 0}},
- {1869, {wxTextCtrl, writeText, 1}},
- {1870, {wxTextCtrl, xYToPosition, 2}},
- {1873, {wxNotebook, new_0, 0}},
- {1874, {wxNotebook, new_3, 3}},
- {1875, {wxNotebook, destruct, 0}},
- {1876, {wxNotebook, addPage, 3}},
- {1877, {wxNotebook, advanceSelection, 1}},
- {1878, {wxNotebook, assignImageList, 1}},
- {1879, {wxNotebook, create, 3}},
- {1880, {wxNotebook, deleteAllPages, 0}},
- {1881, {wxNotebook, deletePage, 1}},
- {1882, {wxNotebook, removePage, 1}},
- {1883, {wxNotebook, getCurrentPage, 0}},
- {1884, {wxNotebook, getImageList, 0}},
- {1886, {wxNotebook, getPage, 1}},
- {1887, {wxNotebook, getPageCount, 0}},
- {1888, {wxNotebook, getPageImage, 1}},
- {1889, {wxNotebook, getPageText, 1}},
- {1890, {wxNotebook, getRowCount, 0}},
- {1891, {wxNotebook, getSelection, 0}},
- {1892, {wxNotebook, getThemeBackgroundColour, 0}},
- {1894, {wxNotebook, hitTest, 2}},
- {1896, {wxNotebook, insertPage, 4}},
- {1897, {wxNotebook, setImageList, 1}},
- {1898, {wxNotebook, setPadding, 1}},
- {1899, {wxNotebook, setPageSize, 1}},
- {1900, {wxNotebook, setPageImage, 2}},
- {1901, {wxNotebook, setPageText, 2}},
- {1902, {wxNotebook, setSelection, 1}},
- {1903, {wxNotebook, changeSelection, 1}},
- {1904, {wxChoicebook, new_0, 0}},
- {1905, {wxChoicebook, new_3, 3}},
- {1906, {wxChoicebook, addPage, 3}},
- {1907, {wxChoicebook, advanceSelection, 1}},
- {1908, {wxChoicebook, assignImageList, 1}},
- {1909, {wxChoicebook, create, 3}},
- {1910, {wxChoicebook, deleteAllPages, 0}},
- {1911, {wxChoicebook, deletePage, 1}},
- {1912, {wxChoicebook, removePage, 1}},
- {1913, {wxChoicebook, getCurrentPage, 0}},
- {1914, {wxChoicebook, getImageList, 0}},
- {1916, {wxChoicebook, getPage, 1}},
- {1917, {wxChoicebook, getPageCount, 0}},
- {1918, {wxChoicebook, getPageImage, 1}},
- {1919, {wxChoicebook, getPageText, 1}},
- {1920, {wxChoicebook, getSelection, 0}},
- {1921, {wxChoicebook, hitTest, 2}},
- {1922, {wxChoicebook, insertPage, 4}},
- {1923, {wxChoicebook, setImageList, 1}},
- {1924, {wxChoicebook, setPageSize, 1}},
- {1925, {wxChoicebook, setPageImage, 2}},
- {1926, {wxChoicebook, setPageText, 2}},
- {1927, {wxChoicebook, setSelection, 1}},
- {1928, {wxChoicebook, changeSelection, 1}},
- {1929, {wxChoicebook, 'Destroy', undefined}},
- {1930, {wxToolbook, new_0, 0}},
- {1931, {wxToolbook, new_3, 3}},
- {1932, {wxToolbook, addPage, 3}},
- {1933, {wxToolbook, advanceSelection, 1}},
- {1934, {wxToolbook, assignImageList, 1}},
- {1935, {wxToolbook, create, 3}},
- {1936, {wxToolbook, deleteAllPages, 0}},
- {1937, {wxToolbook, deletePage, 1}},
- {1938, {wxToolbook, removePage, 1}},
- {1939, {wxToolbook, getCurrentPage, 0}},
- {1940, {wxToolbook, getImageList, 0}},
- {1942, {wxToolbook, getPage, 1}},
- {1943, {wxToolbook, getPageCount, 0}},
- {1944, {wxToolbook, getPageImage, 1}},
- {1945, {wxToolbook, getPageText, 1}},
- {1946, {wxToolbook, getSelection, 0}},
- {1948, {wxToolbook, hitTest, 2}},
- {1949, {wxToolbook, insertPage, 4}},
- {1950, {wxToolbook, setImageList, 1}},
- {1951, {wxToolbook, setPageSize, 1}},
- {1952, {wxToolbook, setPageImage, 2}},
- {1953, {wxToolbook, setPageText, 2}},
- {1954, {wxToolbook, setSelection, 1}},
- {1955, {wxToolbook, changeSelection, 1}},
- {1956, {wxToolbook, 'Destroy', undefined}},
- {1957, {wxListbook, new_0, 0}},
- {1958, {wxListbook, new_3, 3}},
- {1959, {wxListbook, addPage, 3}},
- {1960, {wxListbook, advanceSelection, 1}},
- {1961, {wxListbook, assignImageList, 1}},
- {1962, {wxListbook, create, 3}},
- {1963, {wxListbook, deleteAllPages, 0}},
- {1964, {wxListbook, deletePage, 1}},
- {1965, {wxListbook, removePage, 1}},
- {1966, {wxListbook, getCurrentPage, 0}},
- {1967, {wxListbook, getImageList, 0}},
- {1969, {wxListbook, getPage, 1}},
- {1970, {wxListbook, getPageCount, 0}},
- {1971, {wxListbook, getPageImage, 1}},
- {1972, {wxListbook, getPageText, 1}},
- {1973, {wxListbook, getSelection, 0}},
- {1975, {wxListbook, hitTest, 2}},
- {1976, {wxListbook, insertPage, 4}},
- {1977, {wxListbook, setImageList, 1}},
- {1978, {wxListbook, setPageSize, 1}},
- {1979, {wxListbook, setPageImage, 2}},
- {1980, {wxListbook, setPageText, 2}},
- {1981, {wxListbook, setSelection, 1}},
- {1982, {wxListbook, changeSelection, 1}},
- {1983, {wxListbook, 'Destroy', undefined}},
- {1984, {wxTreebook, new_0, 0}},
- {1985, {wxTreebook, new_3, 3}},
- {1986, {wxTreebook, addPage, 3}},
- {1987, {wxTreebook, advanceSelection, 1}},
- {1988, {wxTreebook, assignImageList, 1}},
- {1989, {wxTreebook, create, 3}},
- {1990, {wxTreebook, deleteAllPages, 0}},
- {1991, {wxTreebook, deletePage, 1}},
- {1992, {wxTreebook, removePage, 1}},
- {1993, {wxTreebook, getCurrentPage, 0}},
- {1994, {wxTreebook, getImageList, 0}},
- {1996, {wxTreebook, getPage, 1}},
- {1997, {wxTreebook, getPageCount, 0}},
- {1998, {wxTreebook, getPageImage, 1}},
- {1999, {wxTreebook, getPageText, 1}},
- {2000, {wxTreebook, getSelection, 0}},
- {2001, {wxTreebook, expandNode, 2}},
- {2002, {wxTreebook, isNodeExpanded, 1}},
- {2004, {wxTreebook, hitTest, 2}},
- {2005, {wxTreebook, insertPage, 4}},
- {2006, {wxTreebook, insertSubPage, 4}},
- {2007, {wxTreebook, setImageList, 1}},
- {2008, {wxTreebook, setPageSize, 1}},
- {2009, {wxTreebook, setPageImage, 2}},
- {2010, {wxTreebook, setPageText, 2}},
- {2011, {wxTreebook, setSelection, 1}},
- {2012, {wxTreebook, changeSelection, 1}},
- {2013, {wxTreebook, 'Destroy', undefined}},
- {2016, {wxTreeCtrl, new_2, 2}},
- {2017, {wxTreeCtrl, new_0, 0}},
- {2019, {wxTreeCtrl, destruct, 0}},
- {2020, {wxTreeCtrl, addRoot, 2}},
- {2021, {wxTreeCtrl, appendItem, 3}},
- {2022, {wxTreeCtrl, assignImageList, 1}},
- {2023, {wxTreeCtrl, assignStateImageList, 1}},
- {2024, {wxTreeCtrl, collapse, 1}},
- {2025, {wxTreeCtrl, collapseAndReset, 1}},
- {2026, {wxTreeCtrl, create, 2}},
- {2027, {wxTreeCtrl, delete, 1}},
- {2028, {wxTreeCtrl, deleteAllItems, 0}},
- {2029, {wxTreeCtrl, deleteChildren, 1}},
- {2030, {wxTreeCtrl, editLabel, 1}},
- {2031, {wxTreeCtrl, ensureVisible, 1}},
- {2032, {wxTreeCtrl, expand, 1}},
- {2033, {wxTreeCtrl, getBoundingRect, 3}},
- {2035, {wxTreeCtrl, getChildrenCount, 2}},
- {2036, {wxTreeCtrl, getCount, 0}},
- {2037, {wxTreeCtrl, getEditControl, 0}},
- {2038, {wxTreeCtrl, getFirstChild, 2}},
- {2039, {wxTreeCtrl, getNextChild, 2}},
- {2040, {wxTreeCtrl, getFirstVisibleItem, 0}},
- {2041, {wxTreeCtrl, getImageList, 0}},
- {2042, {wxTreeCtrl, getIndent, 0}},
- {2043, {wxTreeCtrl, getItemBackgroundColour, 1}},
- {2044, {wxTreeCtrl, getItemData, 1}},
- {2045, {wxTreeCtrl, getItemFont, 1}},
- {2046, {wxTreeCtrl, getItemImage_1, 1}},
- {2047, {wxTreeCtrl, getItemImage_2, 2}},
- {2048, {wxTreeCtrl, getItemText, 1}},
- {2049, {wxTreeCtrl, getItemTextColour, 1}},
- {2050, {wxTreeCtrl, getLastChild, 1}},
- {2051, {wxTreeCtrl, getNextSibling, 1}},
- {2052, {wxTreeCtrl, getNextVisible, 1}},
- {2053, {wxTreeCtrl, getItemParent, 1}},
- {2054, {wxTreeCtrl, getPrevSibling, 1}},
- {2055, {wxTreeCtrl, getPrevVisible, 1}},
- {2056, {wxTreeCtrl, getRootItem, 0}},
- {2057, {wxTreeCtrl, getSelection, 0}},
- {2058, {wxTreeCtrl, getSelections, 1}},
- {2059, {wxTreeCtrl, getStateImageList, 0}},
- {2060, {wxTreeCtrl, hitTest, 2}},
- {2062, {wxTreeCtrl, insertItem, 4}},
- {2063, {wxTreeCtrl, isBold, 1}},
- {2064, {wxTreeCtrl, isExpanded, 1}},
- {2065, {wxTreeCtrl, isSelected, 1}},
- {2066, {wxTreeCtrl, isVisible, 1}},
- {2067, {wxTreeCtrl, itemHasChildren, 1}},
- {2068, {wxTreeCtrl, isTreeItemIdOk, 1}},
- {2069, {wxTreeCtrl, prependItem, 3}},
- {2070, {wxTreeCtrl, scrollTo, 1}},
- {2071, {wxTreeCtrl, selectItem_1, 1}},
- {2072, {wxTreeCtrl, selectItem_2, 2}},
- {2073, {wxTreeCtrl, setIndent, 1}},
- {2074, {wxTreeCtrl, setImageList, 1}},
- {2075, {wxTreeCtrl, setItemBackgroundColour, 2}},
- {2076, {wxTreeCtrl, setItemBold, 2}},
- {2077, {wxTreeCtrl, setItemData, 2}},
- {2078, {wxTreeCtrl, setItemDropHighlight, 2}},
- {2079, {wxTreeCtrl, setItemFont, 2}},
- {2080, {wxTreeCtrl, setItemHasChildren, 2}},
- {2081, {wxTreeCtrl, setItemImage_2, 2}},
- {2082, {wxTreeCtrl, setItemImage_3, 3}},
- {2083, {wxTreeCtrl, setItemText, 2}},
- {2084, {wxTreeCtrl, setItemTextColour, 2}},
- {2085, {wxTreeCtrl, setStateImageList, 1}},
- {2086, {wxTreeCtrl, setWindowStyle, 1}},
- {2087, {wxTreeCtrl, sortChildren, 1}},
- {2088, {wxTreeCtrl, toggle, 1}},
- {2089, {wxTreeCtrl, toggleItemSelection, 1}},
- {2090, {wxTreeCtrl, unselect, 0}},
- {2091, {wxTreeCtrl, unselectAll, 0}},
- {2092, {wxTreeCtrl, unselectItem, 1}},
- {2093, {wxScrollBar, new_0, 0}},
- {2094, {wxScrollBar, new_3, 3}},
- {2095, {wxScrollBar, destruct, 0}},
- {2096, {wxScrollBar, create, 3}},
- {2097, {wxScrollBar, getRange, 0}},
- {2098, {wxScrollBar, getPageSize, 0}},
- {2099, {wxScrollBar, getThumbPosition, 0}},
- {2100, {wxScrollBar, getThumbSize, 0}},
- {2101, {wxScrollBar, setThumbPosition, 1}},
- {2102, {wxScrollBar, setScrollbar, 5}},
- {2104, {wxSpinButton, new_2, 2}},
- {2105, {wxSpinButton, new_0, 0}},
- {2106, {wxSpinButton, create, 2}},
- {2107, {wxSpinButton, getMax, 0}},
- {2108, {wxSpinButton, getMin, 0}},
- {2109, {wxSpinButton, getValue, 0}},
- {2110, {wxSpinButton, setRange, 2}},
- {2111, {wxSpinButton, setValue, 1}},
- {2112, {wxSpinButton, 'Destroy', undefined}},
- {2113, {wxSpinCtrl, new_0, 0}},
- {2114, {wxSpinCtrl, new_2, 2}},
- {2116, {wxSpinCtrl, create, 2}},
- {2119, {wxSpinCtrl, setValue_1_1, 1}},
- {2120, {wxSpinCtrl, setValue_1_0, 1}},
- {2122, {wxSpinCtrl, getValue, 0}},
- {2124, {wxSpinCtrl, setRange, 2}},
- {2125, {wxSpinCtrl, setSelection, 2}},
- {2127, {wxSpinCtrl, getMin, 0}},
- {2129, {wxSpinCtrl, getMax, 0}},
- {2130, {wxSpinCtrl, 'Destroy', undefined}},
- {2131, {wxStaticText, new_0, 0}},
- {2132, {wxStaticText, new_4, 4}},
- {2133, {wxStaticText, create, 4}},
- {2134, {wxStaticText, getLabel, 0}},
- {2135, {wxStaticText, setLabel, 1}},
- {2136, {wxStaticText, wrap, 1}},
- {2137, {wxStaticText, 'Destroy', undefined}},
- {2138, {wxStaticBitmap, new_0, 0}},
- {2139, {wxStaticBitmap, new_4, 4}},
- {2140, {wxStaticBitmap, create, 4}},
- {2141, {wxStaticBitmap, getBitmap, 0}},
- {2142, {wxStaticBitmap, setBitmap, 1}},
- {2143, {wxStaticBitmap, 'Destroy', undefined}},
- {2144, {wxRadioBox, new, 7}},
- {2146, {wxRadioBox, destruct, 0}},
- {2147, {wxRadioBox, create, 7}},
- {2148, {wxRadioBox, enable_2, 2}},
- {2149, {wxRadioBox, enable_1, 1}},
- {2150, {wxRadioBox, getSelection, 0}},
- {2151, {wxRadioBox, getString, 1}},
- {2152, {wxRadioBox, setSelection, 1}},
- {2153, {wxRadioBox, show_2, 2}},
- {2154, {wxRadioBox, show_1, 1}},
- {2155, {wxRadioBox, getColumnCount, 0}},
- {2156, {wxRadioBox, getItemHelpText, 1}},
- {2157, {wxRadioBox, getItemToolTip, 1}},
- {2159, {wxRadioBox, getItemFromPoint, 1}},
- {2160, {wxRadioBox, getRowCount, 0}},
- {2161, {wxRadioBox, isItemEnabled, 1}},
- {2162, {wxRadioBox, isItemShown, 1}},
- {2163, {wxRadioBox, setItemHelpText, 2}},
- {2164, {wxRadioBox, setItemToolTip, 2}},
- {2165, {wxRadioButton, new_0, 0}},
- {2166, {wxRadioButton, new_4, 4}},
- {2167, {wxRadioButton, create, 4}},
- {2168, {wxRadioButton, getValue, 0}},
- {2169, {wxRadioButton, setValue, 1}},
- {2170, {wxRadioButton, 'Destroy', undefined}},
- {2172, {wxSlider, new_6, 6}},
- {2173, {wxSlider, new_0, 0}},
- {2174, {wxSlider, create, 6}},
- {2175, {wxSlider, getLineSize, 0}},
- {2176, {wxSlider, getMax, 0}},
- {2177, {wxSlider, getMin, 0}},
- {2178, {wxSlider, getPageSize, 0}},
- {2179, {wxSlider, getThumbLength, 0}},
- {2180, {wxSlider, getValue, 0}},
- {2181, {wxSlider, setLineSize, 1}},
- {2182, {wxSlider, setPageSize, 1}},
- {2183, {wxSlider, setRange, 2}},
- {2184, {wxSlider, setThumbLength, 1}},
- {2185, {wxSlider, setValue, 1}},
- {2186, {wxSlider, 'Destroy', undefined}},
- {2188, {wxDialog, new_4, 4}},
- {2189, {wxDialog, new_0, 0}},
- {2191, {wxDialog, destruct, 0}},
- {2192, {wxDialog, create, 4}},
- {2193, {wxDialog, createButtonSizer, 1}},
- {2194, {wxDialog, createStdDialogButtonSizer, 1}},
- {2195, {wxDialog, endModal, 1}},
- {2196, {wxDialog, getAffirmativeId, 0}},
- {2197, {wxDialog, getReturnCode, 0}},
- {2198, {wxDialog, isModal, 0}},
- {2199, {wxDialog, setAffirmativeId, 1}},
- {2200, {wxDialog, setReturnCode, 1}},
- {2201, {wxDialog, show, 1}},
- {2202, {wxDialog, showModal, 0}},
- {2203, {wxColourDialog, new_0, 0}},
- {2204, {wxColourDialog, new_2, 2}},
- {2205, {wxColourDialog, destruct, 0}},
- {2206, {wxColourDialog, create, 2}},
- {2207, {wxColourDialog, getColourData, 0}},
- {2208, {wxColourData, new_0, 0}},
- {2209, {wxColourData, new_1, 1}},
- {2210, {wxColourData, destruct, 0}},
- {2211, {wxColourData, getChooseFull, 0}},
- {2212, {wxColourData, getColour, 0}},
- {2214, {wxColourData, getCustomColour, 1}},
- {2215, {wxColourData, setChooseFull, 1}},
- {2216, {wxColourData, setColour, 1}},
- {2217, {wxColourData, setCustomColour, 2}},
- {2218, {wxPalette, new_0, 0}},
- {2219, {wxPalette, new_4, 4}},
- {2221, {wxPalette, destruct, 0}},
- {2222, {wxPalette, create, 4}},
- {2223, {wxPalette, getColoursCount, 0}},
- {2224, {wxPalette, getPixel, 3}},
- {2225, {wxPalette, getRGB, 4}},
- {2226, {wxPalette, isOk, 0}},
- {2230, {wxDirDialog, new, 2}},
- {2231, {wxDirDialog, destruct, 0}},
- {2232, {wxDirDialog, getPath, 0}},
- {2233, {wxDirDialog, getMessage, 0}},
- {2234, {wxDirDialog, setMessage, 1}},
- {2235, {wxDirDialog, setPath, 1}},
- {2239, {wxFileDialog, new, 2}},
- {2240, {wxFileDialog, destruct, 0}},
- {2241, {wxFileDialog, getDirectory, 0}},
- {2242, {wxFileDialog, getFilename, 0}},
- {2243, {wxFileDialog, getFilenames, 1}},
- {2244, {wxFileDialog, getFilterIndex, 0}},
- {2245, {wxFileDialog, getMessage, 0}},
- {2246, {wxFileDialog, getPath, 0}},
- {2247, {wxFileDialog, getPaths, 1}},
- {2248, {wxFileDialog, getWildcard, 0}},
- {2249, {wxFileDialog, setDirectory, 1}},
- {2250, {wxFileDialog, setFilename, 1}},
- {2251, {wxFileDialog, setFilterIndex, 1}},
- {2252, {wxFileDialog, setMessage, 1}},
- {2253, {wxFileDialog, setPath, 1}},
- {2254, {wxFileDialog, setWildcard, 1}},
- {2255, {wxPickerBase, setInternalMargin, 1}},
- {2256, {wxPickerBase, getInternalMargin, 0}},
- {2257, {wxPickerBase, setTextCtrlProportion, 1}},
- {2258, {wxPickerBase, setPickerCtrlProportion, 1}},
- {2259, {wxPickerBase, getTextCtrlProportion, 0}},
- {2260, {wxPickerBase, getPickerCtrlProportion, 0}},
- {2261, {wxPickerBase, hasTextCtrl, 0}},
- {2262, {wxPickerBase, getTextCtrl, 0}},
- {2263, {wxPickerBase, isTextCtrlGrowable, 0}},
- {2264, {wxPickerBase, setPickerCtrlGrowable, 1}},
- {2265, {wxPickerBase, setTextCtrlGrowable, 1}},
- {2266, {wxPickerBase, isPickerCtrlGrowable, 0}},
- {2267, {wxFilePickerCtrl, new_0, 0}},
- {2268, {wxFilePickerCtrl, new_3, 3}},
- {2269, {wxFilePickerCtrl, create, 3}},
- {2270, {wxFilePickerCtrl, getPath, 0}},
- {2271, {wxFilePickerCtrl, setPath, 1}},
- {2272, {wxFilePickerCtrl, 'Destroy', undefined}},
- {2273, {wxDirPickerCtrl, new_0, 0}},
- {2274, {wxDirPickerCtrl, new_3, 3}},
- {2275, {wxDirPickerCtrl, create, 3}},
- {2276, {wxDirPickerCtrl, getPath, 0}},
- {2277, {wxDirPickerCtrl, setPath, 1}},
- {2278, {wxDirPickerCtrl, 'Destroy', undefined}},
- {2279, {wxColourPickerCtrl, new_0, 0}},
- {2280, {wxColourPickerCtrl, new_3, 3}},
- {2281, {wxColourPickerCtrl, create, 3}},
- {2282, {wxColourPickerCtrl, getColour, 0}},
- {2283, {wxColourPickerCtrl, setColour_1_1, 1}},
- {2284, {wxColourPickerCtrl, setColour_1_0, 1}},
- {2285, {wxColourPickerCtrl, 'Destroy', undefined}},
- {2286, {wxDatePickerCtrl, new_0, 0}},
- {2287, {wxDatePickerCtrl, new_3, 3}},
- {2288, {wxDatePickerCtrl, getRange, 2}},
- {2289, {wxDatePickerCtrl, getValue, 0}},
- {2290, {wxDatePickerCtrl, setRange, 2}},
- {2291, {wxDatePickerCtrl, setValue, 1}},
- {2292, {wxDatePickerCtrl, 'Destroy', undefined}},
- {2293, {wxFontPickerCtrl, new_0, 0}},
- {2294, {wxFontPickerCtrl, new_3, 3}},
- {2295, {wxFontPickerCtrl, create, 3}},
- {2296, {wxFontPickerCtrl, getSelectedFont, 0}},
- {2297, {wxFontPickerCtrl, setSelectedFont, 1}},
- {2298, {wxFontPickerCtrl, getMaxPointSize, 0}},
- {2299, {wxFontPickerCtrl, setMaxPointSize, 1}},
- {2300, {wxFontPickerCtrl, 'Destroy', undefined}},
- {2303, {wxFindReplaceDialog, new_0, 0}},
- {2304, {wxFindReplaceDialog, new_4, 4}},
- {2305, {wxFindReplaceDialog, destruct, 0}},
- {2306, {wxFindReplaceDialog, create, 4}},
- {2307, {wxFindReplaceDialog, getData, 0}},
- {2308, {wxFindReplaceData, new_0, 0}},
- {2309, {wxFindReplaceData, new_1, 1}},
- {2310, {wxFindReplaceData, getFindString, 0}},
- {2311, {wxFindReplaceData, getReplaceString, 0}},
- {2312, {wxFindReplaceData, getFlags, 0}},
- {2313, {wxFindReplaceData, setFlags, 1}},
- {2314, {wxFindReplaceData, setFindString, 1}},
- {2315, {wxFindReplaceData, setReplaceString, 1}},
- {2316, {wxFindReplaceData, 'Destroy', undefined}},
- {2317, {wxMultiChoiceDialog, new_0, 0}},
- {2319, {wxMultiChoiceDialog, new_5, 5}},
- {2320, {wxMultiChoiceDialog, getSelections, 0}},
- {2321, {wxMultiChoiceDialog, setSelections, 1}},
- {2322, {wxMultiChoiceDialog, 'Destroy', undefined}},
- {2323, {wxSingleChoiceDialog, new_0, 0}},
- {2325, {wxSingleChoiceDialog, new_5, 5}},
- {2326, {wxSingleChoiceDialog, getSelection, 0}},
- {2327, {wxSingleChoiceDialog, getStringSelection, 0}},
- {2328, {wxSingleChoiceDialog, setSelection, 1}},
- {2329, {wxSingleChoiceDialog, 'Destroy', undefined}},
- {2330, {wxTextEntryDialog, new, 3}},
- {2331, {wxTextEntryDialog, getValue, 0}},
- {2332, {wxTextEntryDialog, setValue, 1}},
- {2333, {wxTextEntryDialog, 'Destroy', undefined}},
- {2334, {wxPasswordEntryDialog, new, 3}},
- {2335, {wxPasswordEntryDialog, 'Destroy', undefined}},
- {2336, {wxFontData, new_0, 0}},
- {2337, {wxFontData, new_1, 1}},
- {2338, {wxFontData, destruct, 0}},
- {2339, {wxFontData, enableEffects, 1}},
- {2340, {wxFontData, getAllowSymbols, 0}},
- {2341, {wxFontData, getColour, 0}},
- {2342, {wxFontData, getChosenFont, 0}},
- {2343, {wxFontData, getEnableEffects, 0}},
- {2344, {wxFontData, getInitialFont, 0}},
- {2345, {wxFontData, getShowHelp, 0}},
- {2346, {wxFontData, setAllowSymbols, 1}},
- {2347, {wxFontData, setChosenFont, 1}},
- {2348, {wxFontData, setColour, 1}},
- {2349, {wxFontData, setInitialFont, 1}},
- {2350, {wxFontData, setRange, 2}},
- {2351, {wxFontData, setShowHelp, 1}},
- {2355, {wxFontDialog, new_0, 0}},
- {2357, {wxFontDialog, new_2, 2}},
- {2359, {wxFontDialog, create, 2}},
- {2360, {wxFontDialog, getFontData, 0}},
- {2362, {wxFontDialog, 'Destroy', undefined}},
- {2363, {wxProgressDialog, new, 3}},
- {2364, {wxProgressDialog, destruct, 0}},
- {2365, {wxProgressDialog, resume, 0}},
- {2366, {wxProgressDialog, update_2, 2}},
- {2367, {wxProgressDialog, update_0, 0}},
- {2368, {wxMessageDialog, new, 3}},
- {2369, {wxMessageDialog, destruct, 0}},
- {2370, {wxPageSetupDialog, new, 2}},
- {2371, {wxPageSetupDialog, destruct, 0}},
- {2372, {wxPageSetupDialog, getPageSetupData, 0}},
- {2373, {wxPageSetupDialog, showModal, 0}},
- {2374, {wxPageSetupDialogData, new_0, 0}},
- {2375, {wxPageSetupDialogData, new_1_0, 1}},
- {2376, {wxPageSetupDialogData, new_1_1, 1}},
- {2377, {wxPageSetupDialogData, destruct, 0}},
- {2378, {wxPageSetupDialogData, enableHelp, 1}},
- {2379, {wxPageSetupDialogData, enableMargins, 1}},
- {2380, {wxPageSetupDialogData, enableOrientation, 1}},
- {2381, {wxPageSetupDialogData, enablePaper, 1}},
- {2382, {wxPageSetupDialogData, enablePrinter, 1}},
- {2383, {wxPageSetupDialogData, getDefaultMinMargins, 0}},
- {2384, {wxPageSetupDialogData, getEnableMargins, 0}},
- {2385, {wxPageSetupDialogData, getEnableOrientation, 0}},
- {2386, {wxPageSetupDialogData, getEnablePaper, 0}},
- {2387, {wxPageSetupDialogData, getEnablePrinter, 0}},
- {2388, {wxPageSetupDialogData, getEnableHelp, 0}},
- {2389, {wxPageSetupDialogData, getDefaultInfo, 0}},
- {2390, {wxPageSetupDialogData, getMarginTopLeft, 0}},
- {2391, {wxPageSetupDialogData, getMarginBottomRight, 0}},
- {2392, {wxPageSetupDialogData, getMinMarginTopLeft, 0}},
- {2393, {wxPageSetupDialogData, getMinMarginBottomRight, 0}},
- {2394, {wxPageSetupDialogData, getPaperId, 0}},
- {2395, {wxPageSetupDialogData, getPaperSize, 0}},
- {2397, {wxPageSetupDialogData, getPrintData, 0}},
- {2398, {wxPageSetupDialogData, isOk, 0}},
- {2399, {wxPageSetupDialogData, setDefaultInfo, 1}},
- {2400, {wxPageSetupDialogData, setDefaultMinMargins, 1}},
- {2401, {wxPageSetupDialogData, setMarginTopLeft, 1}},
- {2402, {wxPageSetupDialogData, setMarginBottomRight, 1}},
- {2403, {wxPageSetupDialogData, setMinMarginTopLeft, 1}},
- {2404, {wxPageSetupDialogData, setMinMarginBottomRight, 1}},
- {2405, {wxPageSetupDialogData, setPaperId, 1}},
- {2406, {wxPageSetupDialogData, setPaperSize_1_1, 1}},
- {2407, {wxPageSetupDialogData, setPaperSize_1_0, 1}},
- {2408, {wxPageSetupDialogData, setPrintData, 1}},
- {2409, {wxPrintDialog, new_2_0, 2}},
- {2410, {wxPrintDialog, new_2_1, 2}},
- {2411, {wxPrintDialog, destruct, 0}},
- {2412, {wxPrintDialog, getPrintDialogData, 0}},
- {2413, {wxPrintDialog, getPrintDC, 0}},
- {2414, {wxPrintDialogData, new_0, 0}},
- {2415, {wxPrintDialogData, new_1_1, 1}},
- {2416, {wxPrintDialogData, new_1_0, 1}},
- {2417, {wxPrintDialogData, destruct, 0}},
- {2418, {wxPrintDialogData, enableHelp, 1}},
- {2419, {wxPrintDialogData, enablePageNumbers, 1}},
- {2420, {wxPrintDialogData, enablePrintToFile, 1}},
- {2421, {wxPrintDialogData, enableSelection, 1}},
- {2422, {wxPrintDialogData, getAllPages, 0}},
- {2423, {wxPrintDialogData, getCollate, 0}},
- {2424, {wxPrintDialogData, getFromPage, 0}},
- {2425, {wxPrintDialogData, getMaxPage, 0}},
- {2426, {wxPrintDialogData, getMinPage, 0}},
- {2427, {wxPrintDialogData, getNoCopies, 0}},
- {2428, {wxPrintDialogData, getPrintData, 0}},
- {2429, {wxPrintDialogData, getPrintToFile, 0}},
- {2430, {wxPrintDialogData, getSelection, 0}},
- {2431, {wxPrintDialogData, getToPage, 0}},
- {2432, {wxPrintDialogData, isOk, 0}},
- {2433, {wxPrintDialogData, setCollate, 1}},
- {2434, {wxPrintDialogData, setFromPage, 1}},
- {2435, {wxPrintDialogData, setMaxPage, 1}},
- {2436, {wxPrintDialogData, setMinPage, 1}},
- {2437, {wxPrintDialogData, setNoCopies, 1}},
- {2438, {wxPrintDialogData, setPrintData, 1}},
- {2439, {wxPrintDialogData, setPrintToFile, 1}},
- {2440, {wxPrintDialogData, setSelection, 1}},
- {2441, {wxPrintDialogData, setToPage, 1}},
- {2442, {wxPrintData, new_0, 0}},
- {2443, {wxPrintData, new_1, 1}},
- {2444, {wxPrintData, destruct, 0}},
- {2445, {wxPrintData, getCollate, 0}},
- {2446, {wxPrintData, getBin, 0}},
- {2447, {wxPrintData, getColour, 0}},
- {2448, {wxPrintData, getDuplex, 0}},
- {2449, {wxPrintData, getNoCopies, 0}},
- {2450, {wxPrintData, getOrientation, 0}},
- {2451, {wxPrintData, getPaperId, 0}},
- {2452, {wxPrintData, getPrinterName, 0}},
- {2453, {wxPrintData, getQuality, 0}},
- {2454, {wxPrintData, isOk, 0}},
- {2455, {wxPrintData, setBin, 1}},
- {2456, {wxPrintData, setCollate, 1}},
- {2457, {wxPrintData, setColour, 1}},
- {2458, {wxPrintData, setDuplex, 1}},
- {2459, {wxPrintData, setNoCopies, 1}},
- {2460, {wxPrintData, setOrientation, 1}},
- {2461, {wxPrintData, setPaperId, 1}},
- {2462, {wxPrintData, setPrinterName, 1}},
- {2463, {wxPrintData, setQuality, 1}},
- {2466, {wxPrintPreview, new_2, 2}},
- {2467, {wxPrintPreview, new_3, 3}},
- {2469, {wxPrintPreview, destruct, 0}},
- {2470, {wxPrintPreview, getCanvas, 0}},
- {2471, {wxPrintPreview, getCurrentPage, 0}},
- {2472, {wxPrintPreview, getFrame, 0}},
- {2473, {wxPrintPreview, getMaxPage, 0}},
- {2474, {wxPrintPreview, getMinPage, 0}},
- {2475, {wxPrintPreview, getPrintout, 0}},
- {2476, {wxPrintPreview, getPrintoutForPrinting, 0}},
- {2477, {wxPrintPreview, isOk, 0}},
- {2478, {wxPrintPreview, paintPage, 2}},
- {2479, {wxPrintPreview, print, 1}},
- {2480, {wxPrintPreview, renderPage, 1}},
- {2481, {wxPrintPreview, setCanvas, 1}},
- {2482, {wxPrintPreview, setCurrentPage, 1}},
- {2483, {wxPrintPreview, setFrame, 1}},
- {2484, {wxPrintPreview, setPrintout, 1}},
- {2485, {wxPrintPreview, setZoom, 1}},
- {2486, {wxPreviewFrame, new, 3}},
- {2487, {wxPreviewFrame, destruct, 0}},
- {2488, {wxPreviewFrame, createControlBar, 0}},
- {2489, {wxPreviewFrame, createCanvas, 0}},
- {2490, {wxPreviewFrame, initialize, 0}},
- {2491, {wxPreviewFrame, onCloseWindow, 1}},
- {2492, {wxPreviewControlBar, new, 4}},
- {2493, {wxPreviewControlBar, destruct, 0}},
- {2494, {wxPreviewControlBar, createButtons, 0}},
- {2495, {wxPreviewControlBar, getPrintPreview, 0}},
- {2496, {wxPreviewControlBar, getZoomControl, 0}},
- {2497, {wxPreviewControlBar, setZoomControl, 1}},
- {2499, {wxPrinter, new, 1}},
- {2500, {wxPrinter, createAbortWindow, 2}},
- {2501, {wxPrinter, getAbort, 0}},
- {2502, {wxPrinter, getLastError, 0}},
- {2503, {wxPrinter, getPrintDialogData, 0}},
- {2504, {wxPrinter, print, 3}},
- {2505, {wxPrinter, printDialog, 1}},
- {2506, {wxPrinter, reportError, 3}},
- {2507, {wxPrinter, setup, 1}},
- {2508, {wxPrinter, 'Destroy', undefined}},
- {2509, {wxXmlResource, new_1, 1}},
- {2510, {wxXmlResource, new_2, 2}},
- {2511, {wxXmlResource, destruct, 0}},
- {2512, {wxXmlResource, attachUnknownControl, 3}},
- {2513, {wxXmlResource, clearHandlers, 0}},
- {2514, {wxXmlResource, compareVersion, 4}},
- {2515, {wxXmlResource, get, 0}},
- {2516, {wxXmlResource, getFlags, 0}},
- {2517, {wxXmlResource, getVersion, 0}},
- {2518, {wxXmlResource, getXRCID, 2}},
- {2519, {wxXmlResource, initAllHandlers, 0}},
- {2520, {wxXmlResource, load, 1}},
- {2521, {wxXmlResource, loadBitmap, 1}},
- {2522, {wxXmlResource, loadDialog_2, 2}},
- {2523, {wxXmlResource, loadDialog_3, 3}},
- {2524, {wxXmlResource, loadFrame_2, 2}},
- {2525, {wxXmlResource, loadFrame_3, 3}},
- {2526, {wxXmlResource, loadIcon, 1}},
- {2527, {wxXmlResource, loadMenu, 1}},
- {2528, {wxXmlResource, loadMenuBar_2, 2}},
- {2529, {wxXmlResource, loadMenuBar_1, 1}},
- {2530, {wxXmlResource, loadPanel_2, 2}},
- {2531, {wxXmlResource, loadPanel_3, 3}},
- {2532, {wxXmlResource, loadToolBar, 2}},
- {2533, {wxXmlResource, set, 1}},
- {2534, {wxXmlResource, setFlags, 1}},
- {2535, {wxXmlResource, unload, 1}},
- {2536, {wxXmlResource, xrcctrl, 3}},
- {2537, {wxHtmlEasyPrinting, new, 1}},
- {2538, {wxHtmlEasyPrinting, destruct, 0}},
- {2539, {wxHtmlEasyPrinting, getPrintData, 0}},
- {2540, {wxHtmlEasyPrinting, getPageSetupData, 0}},
- {2541, {wxHtmlEasyPrinting, previewFile, 1}},
- {2542, {wxHtmlEasyPrinting, previewText, 2}},
- {2543, {wxHtmlEasyPrinting, printFile, 1}},
- {2544, {wxHtmlEasyPrinting, printText, 2}},
- {2545, {wxHtmlEasyPrinting, pageSetup, 0}},
- {2546, {wxHtmlEasyPrinting, setFonts, 3}},
- {2547, {wxHtmlEasyPrinting, setHeader, 2}},
- {2548, {wxHtmlEasyPrinting, setFooter, 2}},
- {2550, {wxGLCanvas, new_2, 2}},
- {2551, {wxGLCanvas, new_3_1, 3}},
- {2552, {wxGLCanvas, new_3_0, 3}},
- {2553, {wxGLCanvas, getContext, 0}},
- {2555, {wxGLCanvas, setCurrent, 0}},
- {2556, {wxGLCanvas, swapBuffers, 0}},
- {2557, {wxGLCanvas, 'Destroy', undefined}},
- {2558, {wxAuiManager, new, 1}},
- {2559, {wxAuiManager, destruct, 0}},
- {2560, {wxAuiManager, addPane_2_1, 2}},
- {2561, {wxAuiManager, addPane_3, 3}},
- {2562, {wxAuiManager, addPane_2_0, 2}},
- {2563, {wxAuiManager, detachPane, 1}},
- {2564, {wxAuiManager, getAllPanes, 0}},
- {2565, {wxAuiManager, getArtProvider, 0}},
- {2566, {wxAuiManager, getDockSizeConstraint, 2}},
- {2567, {wxAuiManager, getFlags, 0}},
- {2568, {wxAuiManager, getManagedWindow, 0}},
- {2569, {wxAuiManager, getManager, 1}},
- {2570, {wxAuiManager, getPane_1_1, 1}},
- {2571, {wxAuiManager, getPane_1_0, 1}},
- {2572, {wxAuiManager, hideHint, 0}},
- {2573, {wxAuiManager, insertPane, 3}},
- {2574, {wxAuiManager, loadPaneInfo, 2}},
- {2575, {wxAuiManager, loadPerspective, 2}},
- {2576, {wxAuiManager, savePaneInfo, 1}},
- {2577, {wxAuiManager, savePerspective, 0}},
- {2578, {wxAuiManager, setArtProvider, 1}},
- {2579, {wxAuiManager, setDockSizeConstraint, 2}},
- {2580, {wxAuiManager, setFlags, 1}},
- {2581, {wxAuiManager, setManagedWindow, 1}},
- {2582, {wxAuiManager, showHint, 1}},
- {2583, {wxAuiManager, unInit, 0}},
- {2584, {wxAuiManager, update, 0}},
- {2585, {wxAuiPaneInfo, new_0, 0}},
- {2586, {wxAuiPaneInfo, new_1, 1}},
- {2587, {wxAuiPaneInfo, destruct, 0}},
- {2588, {wxAuiPaneInfo, bestSize_1, 1}},
- {2589, {wxAuiPaneInfo, bestSize_2, 2}},
- {2590, {wxAuiPaneInfo, bottom, 0}},
- {2591, {wxAuiPaneInfo, bottomDockable, 1}},
- {2592, {wxAuiPaneInfo, caption, 1}},
- {2593, {wxAuiPaneInfo, captionVisible, 1}},
- {2594, {wxAuiPaneInfo, centre, 0}},
- {2595, {wxAuiPaneInfo, centrePane, 0}},
- {2596, {wxAuiPaneInfo, closeButton, 1}},
- {2597, {wxAuiPaneInfo, defaultPane, 0}},
- {2598, {wxAuiPaneInfo, destroyOnClose, 1}},
- {2599, {wxAuiPaneInfo, direction, 1}},
- {2600, {wxAuiPaneInfo, dock, 0}},
- {2601, {wxAuiPaneInfo, dockable, 1}},
- {2602, {wxAuiPaneInfo, fixed, 0}},
- {2603, {wxAuiPaneInfo, float, 0}},
- {2604, {wxAuiPaneInfo, floatable, 1}},
- {2605, {wxAuiPaneInfo, floatingPosition_1, 1}},
- {2606, {wxAuiPaneInfo, floatingPosition_2, 2}},
- {2607, {wxAuiPaneInfo, floatingSize_1, 1}},
- {2608, {wxAuiPaneInfo, floatingSize_2, 2}},
- {2609, {wxAuiPaneInfo, gripper, 1}},
- {2610, {wxAuiPaneInfo, gripperTop, 1}},
- {2611, {wxAuiPaneInfo, hasBorder, 0}},
- {2612, {wxAuiPaneInfo, hasCaption, 0}},
- {2613, {wxAuiPaneInfo, hasCloseButton, 0}},
- {2614, {wxAuiPaneInfo, hasFlag, 1}},
- {2615, {wxAuiPaneInfo, hasGripper, 0}},
- {2616, {wxAuiPaneInfo, hasGripperTop, 0}},
- {2617, {wxAuiPaneInfo, hasMaximizeButton, 0}},
- {2618, {wxAuiPaneInfo, hasMinimizeButton, 0}},
- {2619, {wxAuiPaneInfo, hasPinButton, 0}},
- {2620, {wxAuiPaneInfo, hide, 0}},
- {2621, {wxAuiPaneInfo, isBottomDockable, 0}},
- {2622, {wxAuiPaneInfo, isDocked, 0}},
- {2623, {wxAuiPaneInfo, isFixed, 0}},
- {2624, {wxAuiPaneInfo, isFloatable, 0}},
- {2625, {wxAuiPaneInfo, isFloating, 0}},
- {2626, {wxAuiPaneInfo, isLeftDockable, 0}},
- {2627, {wxAuiPaneInfo, isMovable, 0}},
- {2628, {wxAuiPaneInfo, isOk, 0}},
- {2629, {wxAuiPaneInfo, isResizable, 0}},
- {2630, {wxAuiPaneInfo, isRightDockable, 0}},
- {2631, {wxAuiPaneInfo, isShown, 0}},
- {2632, {wxAuiPaneInfo, isToolbar, 0}},
- {2633, {wxAuiPaneInfo, isTopDockable, 0}},
- {2634, {wxAuiPaneInfo, layer, 1}},
- {2635, {wxAuiPaneInfo, left, 0}},
- {2636, {wxAuiPaneInfo, leftDockable, 1}},
- {2637, {wxAuiPaneInfo, maxSize_1, 1}},
- {2638, {wxAuiPaneInfo, maxSize_2, 2}},
- {2639, {wxAuiPaneInfo, maximizeButton, 1}},
- {2640, {wxAuiPaneInfo, minSize_1, 1}},
- {2641, {wxAuiPaneInfo, minSize_2, 2}},
- {2642, {wxAuiPaneInfo, minimizeButton, 1}},
- {2643, {wxAuiPaneInfo, movable, 1}},
- {2644, {wxAuiPaneInfo, name, 1}},
- {2645, {wxAuiPaneInfo, paneBorder, 1}},
- {2646, {wxAuiPaneInfo, pinButton, 1}},
- {2647, {wxAuiPaneInfo, position, 1}},
- {2648, {wxAuiPaneInfo, resizable, 1}},
- {2649, {wxAuiPaneInfo, right, 0}},
- {2650, {wxAuiPaneInfo, rightDockable, 1}},
- {2651, {wxAuiPaneInfo, row, 1}},
- {2652, {wxAuiPaneInfo, safeSet, 1}},
- {2653, {wxAuiPaneInfo, setFlag, 2}},
- {2654, {wxAuiPaneInfo, show, 1}},
- {2655, {wxAuiPaneInfo, toolbarPane, 0}},
- {2656, {wxAuiPaneInfo, top, 0}},
- {2657, {wxAuiPaneInfo, topDockable, 1}},
- {2658, {wxAuiPaneInfo, window, 1}},
- {2659, {wxAuiPaneInfo, getWindow, 0}},
- {2660, {wxAuiPaneInfo, getFrame, 0}},
- {2661, {wxAuiPaneInfo, getDirection, 0}},
- {2662, {wxAuiPaneInfo, getLayer, 0}},
- {2663, {wxAuiPaneInfo, getRow, 0}},
- {2664, {wxAuiPaneInfo, getPosition, 0}},
- {2665, {wxAuiPaneInfo, getFloatingPosition, 0}},
- {2666, {wxAuiPaneInfo, getFloatingSize, 0}},
- {2667, {wxAuiNotebook, new_0, 0}},
- {2668, {wxAuiNotebook, new_2, 2}},
- {2669, {wxAuiNotebook, addPage, 3}},
- {2670, {wxAuiNotebook, create, 2}},
- {2671, {wxAuiNotebook, deletePage, 1}},
- {2672, {wxAuiNotebook, getArtProvider, 0}},
- {2673, {wxAuiNotebook, getPage, 1}},
- {2674, {wxAuiNotebook, getPageBitmap, 1}},
- {2675, {wxAuiNotebook, getPageCount, 0}},
- {2676, {wxAuiNotebook, getPageIndex, 1}},
- {2677, {wxAuiNotebook, getPageText, 1}},
- {2678, {wxAuiNotebook, getSelection, 0}},
- {2679, {wxAuiNotebook, insertPage, 4}},
- {2680, {wxAuiNotebook, removePage, 1}},
- {2681, {wxAuiNotebook, setArtProvider, 1}},
- {2682, {wxAuiNotebook, setFont, 1}},
- {2683, {wxAuiNotebook, setPageBitmap, 2}},
- {2684, {wxAuiNotebook, setPageText, 2}},
- {2685, {wxAuiNotebook, setSelection, 1}},
- {2686, {wxAuiNotebook, setTabCtrlHeight, 1}},
- {2687, {wxAuiNotebook, setUniformBitmapSize, 1}},
- {2688, {wxAuiNotebook, 'Destroy', undefined}},
- {2689, {wxAuiTabArt, setFlags, 1}},
- {2690, {wxAuiTabArt, setMeasuringFont, 1}},
- {2691, {wxAuiTabArt, setNormalFont, 1}},
- {2692, {wxAuiTabArt, setSelectedFont, 1}},
- {2693, {wxAuiTabArt, setColour, 1}},
- {2694, {wxAuiTabArt, setActiveColour, 1}},
- {2695, {wxAuiDockArt, getColour, 1}},
- {2696, {wxAuiDockArt, getFont, 1}},
- {2697, {wxAuiDockArt, getMetric, 1}},
- {2698, {wxAuiDockArt, setColour, 2}},
- {2699, {wxAuiDockArt, setFont, 2}},
- {2700, {wxAuiDockArt, setMetric, 2}},
- {2701, {wxAuiSimpleTabArt, new, 0}},
- {2702, {wxAuiSimpleTabArt, 'Destroy', undefined}},
- {2703, {wxMDIParentFrame, new_0, 0}},
- {2704, {wxMDIParentFrame, new_4, 4}},
- {2705, {wxMDIParentFrame, destruct, 0}},
- {2706, {wxMDIParentFrame, activateNext, 0}},
- {2707, {wxMDIParentFrame, activatePrevious, 0}},
- {2708, {wxMDIParentFrame, arrangeIcons, 0}},
- {2709, {wxMDIParentFrame, cascade, 0}},
- {2710, {wxMDIParentFrame, create, 4}},
- {2711, {wxMDIParentFrame, getActiveChild, 0}},
- {2712, {wxMDIParentFrame, getClientWindow, 0}},
- {2713, {wxMDIParentFrame, tile, 1}},
- {2714, {wxMDIChildFrame, new_0, 0}},
- {2715, {wxMDIChildFrame, new_4, 4}},
- {2716, {wxMDIChildFrame, destruct, 0}},
- {2717, {wxMDIChildFrame, activate, 0}},
- {2718, {wxMDIChildFrame, create, 4}},
- {2719, {wxMDIChildFrame, maximize, 1}},
- {2720, {wxMDIChildFrame, restore, 0}},
- {2721, {wxMDIClientWindow, new_0, 0}},
- {2722, {wxMDIClientWindow, new_2, 2}},
- {2723, {wxMDIClientWindow, destruct, 0}},
- {2724, {wxMDIClientWindow, createClient, 2}},
- {2725, {wxLayoutAlgorithm, new, 0}},
- {2726, {wxLayoutAlgorithm, layoutFrame, 2}},
- {2727, {wxLayoutAlgorithm, layoutMDIFrame, 2}},
- {2728, {wxLayoutAlgorithm, layoutWindow, 2}},
- {2729, {wxLayoutAlgorithm, 'Destroy', undefined}},
- {2730, {wxEvent, getId, 0}},
- {2731, {wxEvent, getSkipped, 0}},
- {2732, {wxEvent, getTimestamp, 0}},
- {2733, {wxEvent, isCommandEvent, 0}},
- {2734, {wxEvent, resumePropagation, 1}},
- {2735, {wxEvent, shouldPropagate, 0}},
- {2736, {wxEvent, skip, 1}},
- {2737, {wxEvent, stopPropagation, 0}},
- {2738, {wxCommandEvent, getClientData, 0}},
- {2739, {wxCommandEvent, getExtraLong, 0}},
- {2740, {wxCommandEvent, getInt, 0}},
- {2741, {wxCommandEvent, getSelection, 0}},
- {2742, {wxCommandEvent, getString, 0}},
- {2743, {wxCommandEvent, isChecked, 0}},
- {2744, {wxCommandEvent, isSelection, 0}},
- {2745, {wxCommandEvent, setInt, 1}},
- {2746, {wxCommandEvent, setString, 1}},
- {2747, {wxScrollEvent, getOrientation, 0}},
- {2748, {wxScrollEvent, getPosition, 0}},
- {2749, {wxScrollWinEvent, getOrientation, 0}},
- {2750, {wxScrollWinEvent, getPosition, 0}},
- {2751, {wxMouseEvent, altDown, 0}},
- {2752, {wxMouseEvent, button, 1}},
- {2753, {wxMouseEvent, buttonDClick, 1}},
- {2754, {wxMouseEvent, buttonDown, 1}},
- {2755, {wxMouseEvent, buttonUp, 1}},
- {2756, {wxMouseEvent, cmdDown, 0}},
- {2757, {wxMouseEvent, controlDown, 0}},
- {2758, {wxMouseEvent, dragging, 0}},
- {2759, {wxMouseEvent, entering, 0}},
- {2760, {wxMouseEvent, getButton, 0}},
- {2763, {wxMouseEvent, getPosition, 0}},
- {2764, {wxMouseEvent, getLogicalPosition, 1}},
- {2765, {wxMouseEvent, getLinesPerAction, 0}},
- {2766, {wxMouseEvent, getWheelRotation, 0}},
- {2767, {wxMouseEvent, getWheelDelta, 0}},
- {2768, {wxMouseEvent, getX, 0}},
- {2769, {wxMouseEvent, getY, 0}},
- {2770, {wxMouseEvent, isButton, 0}},
- {2771, {wxMouseEvent, isPageScroll, 0}},
- {2772, {wxMouseEvent, leaving, 0}},
- {2773, {wxMouseEvent, leftDClick, 0}},
- {2774, {wxMouseEvent, leftDown, 0}},
- {2775, {wxMouseEvent, leftIsDown, 0}},
- {2776, {wxMouseEvent, leftUp, 0}},
- {2777, {wxMouseEvent, metaDown, 0}},
- {2778, {wxMouseEvent, middleDClick, 0}},
- {2779, {wxMouseEvent, middleDown, 0}},
- {2780, {wxMouseEvent, middleIsDown, 0}},
- {2781, {wxMouseEvent, middleUp, 0}},
- {2782, {wxMouseEvent, moving, 0}},
- {2783, {wxMouseEvent, rightDClick, 0}},
- {2784, {wxMouseEvent, rightDown, 0}},
- {2785, {wxMouseEvent, rightIsDown, 0}},
- {2786, {wxMouseEvent, rightUp, 0}},
- {2787, {wxMouseEvent, shiftDown, 0}},
- {2788, {wxSetCursorEvent, getCursor, 0}},
- {2789, {wxSetCursorEvent, getX, 0}},
- {2790, {wxSetCursorEvent, getY, 0}},
- {2791, {wxSetCursorEvent, hasCursor, 0}},
- {2792, {wxSetCursorEvent, setCursor, 1}},
- {2793, {wxKeyEvent, altDown, 0}},
- {2794, {wxKeyEvent, cmdDown, 0}},
- {2795, {wxKeyEvent, controlDown, 0}},
- {2796, {wxKeyEvent, getKeyCode, 0}},
- {2797, {wxKeyEvent, getModifiers, 0}},
- {2800, {wxKeyEvent, getPosition, 0}},
- {2801, {wxKeyEvent, getRawKeyCode, 0}},
- {2802, {wxKeyEvent, getRawKeyFlags, 0}},
- {2803, {wxKeyEvent, getUnicodeKey, 0}},
- {2804, {wxKeyEvent, getX, 0}},
- {2805, {wxKeyEvent, getY, 0}},
- {2806, {wxKeyEvent, hasModifiers, 0}},
- {2807, {wxKeyEvent, metaDown, 0}},
- {2808, {wxKeyEvent, shiftDown, 0}},
- {2809, {wxSizeEvent, getSize, 0}},
- {2810, {wxMoveEvent, getPosition, 0}},
- {2811, {wxEraseEvent, getDC, 0}},
- {2812, {wxFocusEvent, getWindow, 0}},
- {2813, {wxChildFocusEvent, getWindow, 0}},
- {2814, {wxMenuEvent, getMenu, 0}},
- {2815, {wxMenuEvent, getMenuId, 0}},
- {2816, {wxMenuEvent, isPopup, 0}},
- {2817, {wxCloseEvent, canVeto, 0}},
- {2818, {wxCloseEvent, getLoggingOff, 0}},
- {2819, {wxCloseEvent, setCanVeto, 1}},
- {2820, {wxCloseEvent, setLoggingOff, 1}},
- {2821, {wxCloseEvent, veto, 1}},
- {2822, {wxShowEvent, setShow, 1}},
- {2823, {wxShowEvent, getShow, 0}},
- {2824, {wxIconizeEvent, iconized, 0}},
- {2825, {wxJoystickEvent, buttonDown, 1}},
- {2826, {wxJoystickEvent, buttonIsDown, 1}},
- {2827, {wxJoystickEvent, buttonUp, 1}},
- {2828, {wxJoystickEvent, getButtonChange, 0}},
- {2829, {wxJoystickEvent, getButtonState, 0}},
- {2830, {wxJoystickEvent, getJoystick, 0}},
- {2831, {wxJoystickEvent, getPosition, 0}},
- {2832, {wxJoystickEvent, getZPosition, 0}},
- {2833, {wxJoystickEvent, isButton, 0}},
- {2834, {wxJoystickEvent, isMove, 0}},
- {2835, {wxJoystickEvent, isZMove, 0}},
- {2836, {wxUpdateUIEvent, canUpdate, 1}},
- {2837, {wxUpdateUIEvent, check, 1}},
- {2838, {wxUpdateUIEvent, enable, 1}},
- {2839, {wxUpdateUIEvent, show, 1}},
- {2840, {wxUpdateUIEvent, getChecked, 0}},
- {2841, {wxUpdateUIEvent, getEnabled, 0}},
- {2842, {wxUpdateUIEvent, getShown, 0}},
- {2843, {wxUpdateUIEvent, getSetChecked, 0}},
- {2844, {wxUpdateUIEvent, getSetEnabled, 0}},
- {2845, {wxUpdateUIEvent, getSetShown, 0}},
- {2846, {wxUpdateUIEvent, getSetText, 0}},
- {2847, {wxUpdateUIEvent, getText, 0}},
- {2848, {wxUpdateUIEvent, getMode, 0}},
- {2849, {wxUpdateUIEvent, getUpdateInterval, 0}},
- {2850, {wxUpdateUIEvent, resetUpdateTime, 0}},
- {2851, {wxUpdateUIEvent, setMode, 1}},
- {2852, {wxUpdateUIEvent, setText, 1}},
- {2853, {wxUpdateUIEvent, setUpdateInterval, 1}},
- {2854, {wxMouseCaptureChangedEvent, getCapturedWindow, 0}},
- {2855, {wxPaletteChangedEvent, setChangedWindow, 1}},
- {2856, {wxPaletteChangedEvent, getChangedWindow, 0}},
- {2857, {wxQueryNewPaletteEvent, setPaletteRealized, 1}},
- {2858, {wxQueryNewPaletteEvent, getPaletteRealized, 0}},
- {2859, {wxNavigationKeyEvent, getDirection, 0}},
- {2860, {wxNavigationKeyEvent, setDirection, 1}},
- {2861, {wxNavigationKeyEvent, isWindowChange, 0}},
- {2862, {wxNavigationKeyEvent, setWindowChange, 1}},
- {2863, {wxNavigationKeyEvent, isFromTab, 0}},
- {2864, {wxNavigationKeyEvent, setFromTab, 1}},
- {2865, {wxNavigationKeyEvent, getCurrentFocus, 0}},
- {2866, {wxNavigationKeyEvent, setCurrentFocus, 1}},
- {2867, {wxHelpEvent, getOrigin, 0}},
- {2868, {wxHelpEvent, getPosition, 0}},
- {2869, {wxHelpEvent, setOrigin, 1}},
- {2870, {wxHelpEvent, setPosition, 1}},
- {2871, {wxContextMenuEvent, getPosition, 0}},
- {2872, {wxContextMenuEvent, setPosition, 1}},
- {2873, {wxIdleEvent, canSend, 1}},
- {2874, {wxIdleEvent, getMode, 0}},
- {2875, {wxIdleEvent, requestMore, 1}},
- {2876, {wxIdleEvent, moreRequested, 0}},
- {2877, {wxIdleEvent, setMode, 1}},
- {2878, {wxGridEvent, altDown, 0}},
- {2879, {wxGridEvent, controlDown, 0}},
- {2880, {wxGridEvent, getCol, 0}},
- {2881, {wxGridEvent, getPosition, 0}},
- {2882, {wxGridEvent, getRow, 0}},
- {2883, {wxGridEvent, metaDown, 0}},
- {2884, {wxGridEvent, selecting, 0}},
- {2885, {wxGridEvent, shiftDown, 0}},
- {2886, {wxNotifyEvent, allow, 0}},
- {2887, {wxNotifyEvent, isAllowed, 0}},
- {2888, {wxNotifyEvent, veto, 0}},
- {2889, {wxSashEvent, getEdge, 0}},
- {2890, {wxSashEvent, getDragRect, 0}},
- {2891, {wxSashEvent, getDragStatus, 0}},
- {2892, {wxListEvent, getCacheFrom, 0}},
- {2893, {wxListEvent, getCacheTo, 0}},
- {2894, {wxListEvent, getKeyCode, 0}},
- {2895, {wxListEvent, getIndex, 0}},
- {2896, {wxListEvent, getColumn, 0}},
- {2897, {wxListEvent, getPoint, 0}},
- {2898, {wxListEvent, getLabel, 0}},
- {2899, {wxListEvent, getText, 0}},
- {2900, {wxListEvent, getImage, 0}},
- {2901, {wxListEvent, getData, 0}},
- {2902, {wxListEvent, getMask, 0}},
- {2903, {wxListEvent, getItem, 0}},
- {2904, {wxListEvent, isEditCancelled, 0}},
- {2905, {wxDateEvent, getDate, 0}},
- {2906, {wxCalendarEvent, getWeekDay, 0}},
- {2907, {wxFileDirPickerEvent, getPath, 0}},
- {2908, {wxColourPickerEvent, getColour, 0}},
- {2909, {wxFontPickerEvent, getFont, 0}},
- {2910, {wxStyledTextEvent, getPosition, 0}},
- {2911, {wxStyledTextEvent, getKey, 0}},
- {2912, {wxStyledTextEvent, getModifiers, 0}},
- {2913, {wxStyledTextEvent, getModificationType, 0}},
- {2914, {wxStyledTextEvent, getText, 0}},
- {2915, {wxStyledTextEvent, getLength, 0}},
- {2916, {wxStyledTextEvent, getLinesAdded, 0}},
- {2917, {wxStyledTextEvent, getLine, 0}},
- {2918, {wxStyledTextEvent, getFoldLevelNow, 0}},
- {2919, {wxStyledTextEvent, getFoldLevelPrev, 0}},
- {2920, {wxStyledTextEvent, getMargin, 0}},
- {2921, {wxStyledTextEvent, getMessage, 0}},
- {2922, {wxStyledTextEvent, getWParam, 0}},
- {2923, {wxStyledTextEvent, getLParam, 0}},
- {2924, {wxStyledTextEvent, getListType, 0}},
- {2925, {wxStyledTextEvent, getX, 0}},
- {2926, {wxStyledTextEvent, getY, 0}},
- {2927, {wxStyledTextEvent, getDragText, 0}},
- {2928, {wxStyledTextEvent, getDragAllowMove, 0}},
- {2929, {wxStyledTextEvent, getDragResult, 0}},
- {2930, {wxStyledTextEvent, getShift, 0}},
- {2931, {wxStyledTextEvent, getControl, 0}},
- {2932, {wxStyledTextEvent, getAlt, 0}},
- {2933, {utils, getKeyState, 1}},
- {2934, {utils, getMousePosition, 2}},
- {2935, {utils, getMouseState, 0}},
- {2936, {utils, setDetectableAutoRepeat, 1}},
- {2937, {utils, bell, 0}},
- {2938, {utils, findMenuItemId, 3}},
- {2939, {utils, genericFindWindowAtPoint, 1}},
- {2940, {utils, findWindowAtPoint, 1}},
- {2941, {utils, beginBusyCursor, 1}},
- {2942, {utils, endBusyCursor, 0}},
- {2943, {utils, isBusy, 0}},
- {2944, {utils, shutdown, 1}},
- {2945, {utils, shell, 1}},
- {2946, {utils, launchDefaultBrowser, 2}},
- {2947, {utils, getEmailAddress, 0}},
- {2948, {utils, getUserId, 0}},
- {2949, {utils, getHomeDir, 0}},
- {2950, {utils, newId, 0}},
- {2951, {utils, registerId, 1}},
- {2952, {utils, getCurrentId, 0}},
- {2953, {utils, getOsDescription, 0}},
- {2954, {utils, isPlatformLittleEndian, 0}},
- {2955, {utils, isPlatform64Bit, 0}},
- {2956, {gdicmn, displaySize, 2}},
- {2957, {gdicmn, setCursor, 1}},
- {2958, {wxPrintout, new, 1}},
- {2959, {wxPrintout, destruct, 0}},
- {2960, {wxPrintout, getDC, 0}},
- {2961, {wxPrintout, getPageSizeMM, 2}},
- {2962, {wxPrintout, getPageSizePixels, 2}},
- {2963, {wxPrintout, getPaperRectPixels, 0}},
- {2964, {wxPrintout, getPPIPrinter, 2}},
- {2965, {wxPrintout, getPPIScreen, 2}},
- {2966, {wxPrintout, getTitle, 0}},
- {2967, {wxPrintout, isPreview, 0}},
- {2968, {wxPrintout, fitThisSizeToPaper, 1}},
- {2969, {wxPrintout, fitThisSizeToPage, 1}},
- {2970, {wxPrintout, fitThisSizeToPageMargins, 2}},
- {2971, {wxPrintout, mapScreenSizeToPaper, 0}},
- {2972, {wxPrintout, mapScreenSizeToPage, 0}},
- {2973, {wxPrintout, mapScreenSizeToPageMargins, 1}},
- {2974, {wxPrintout, mapScreenSizeToDevice, 0}},
- {2975, {wxPrintout, getLogicalPaperRect, 0}},
- {2976, {wxPrintout, getLogicalPageRect, 0}},
- {2977, {wxPrintout, getLogicalPageMarginsRect, 1}},
- {2978, {wxPrintout, setLogicalOrigin, 2}},
- {2979, {wxPrintout, offsetLogicalOrigin, 2}},
- {2980, {wxStyledTextCtrl, new_2, 2}},
- {2981, {wxStyledTextCtrl, new_0, 0}},
- {2982, {wxStyledTextCtrl, destruct, 0}},
- {2983, {wxStyledTextCtrl, create, 2}},
- {2984, {wxStyledTextCtrl, addText, 1}},
- {2985, {wxStyledTextCtrl, addStyledText, 1}},
- {2986, {wxStyledTextCtrl, insertText, 2}},
- {2987, {wxStyledTextCtrl, clearAll, 0}},
- {2988, {wxStyledTextCtrl, clearDocumentStyle, 0}},
- {2989, {wxStyledTextCtrl, getLength, 0}},
- {2990, {wxStyledTextCtrl, getCharAt, 1}},
- {2991, {wxStyledTextCtrl, getCurrentPos, 0}},
- {2992, {wxStyledTextCtrl, getAnchor, 0}},
- {2993, {wxStyledTextCtrl, getStyleAt, 1}},
- {2994, {wxStyledTextCtrl, redo, 0}},
- {2995, {wxStyledTextCtrl, setUndoCollection, 1}},
- {2996, {wxStyledTextCtrl, selectAll, 0}},
- {2997, {wxStyledTextCtrl, setSavePoint, 0}},
- {2998, {wxStyledTextCtrl, getStyledText, 2}},
- {2999, {wxStyledTextCtrl, canRedo, 0}},
- {3000, {wxStyledTextCtrl, markerLineFromHandle, 1}},
- {3001, {wxStyledTextCtrl, markerDeleteHandle, 1}},
- {3002, {wxStyledTextCtrl, getUndoCollection, 0}},
- {3003, {wxStyledTextCtrl, getViewWhiteSpace, 0}},
- {3004, {wxStyledTextCtrl, setViewWhiteSpace, 1}},
- {3005, {wxStyledTextCtrl, positionFromPoint, 1}},
- {3006, {wxStyledTextCtrl, positionFromPointClose, 2}},
- {3007, {wxStyledTextCtrl, gotoLine, 1}},
- {3008, {wxStyledTextCtrl, gotoPos, 1}},
- {3009, {wxStyledTextCtrl, setAnchor, 1}},
- {3010, {wxStyledTextCtrl, getCurLine, 1}},
- {3011, {wxStyledTextCtrl, getEndStyled, 0}},
- {3012, {wxStyledTextCtrl, convertEOLs, 1}},
- {3013, {wxStyledTextCtrl, getEOLMode, 0}},
- {3014, {wxStyledTextCtrl, setEOLMode, 1}},
- {3015, {wxStyledTextCtrl, startStyling, 2}},
- {3016, {wxStyledTextCtrl, setStyling, 2}},
- {3017, {wxStyledTextCtrl, getBufferedDraw, 0}},
- {3018, {wxStyledTextCtrl, setBufferedDraw, 1}},
- {3019, {wxStyledTextCtrl, setTabWidth, 1}},
- {3020, {wxStyledTextCtrl, getTabWidth, 0}},
- {3021, {wxStyledTextCtrl, setCodePage, 1}},
- {3022, {wxStyledTextCtrl, markerDefine, 3}},
- {3023, {wxStyledTextCtrl, markerSetForeground, 2}},
- {3024, {wxStyledTextCtrl, markerSetBackground, 2}},
- {3025, {wxStyledTextCtrl, markerAdd, 2}},
- {3026, {wxStyledTextCtrl, markerDelete, 2}},
- {3027, {wxStyledTextCtrl, markerDeleteAll, 1}},
- {3028, {wxStyledTextCtrl, markerGet, 1}},
- {3029, {wxStyledTextCtrl, markerNext, 2}},
- {3030, {wxStyledTextCtrl, markerPrevious, 2}},
- {3031, {wxStyledTextCtrl, markerDefineBitmap, 2}},
- {3032, {wxStyledTextCtrl, markerAddSet, 2}},
- {3033, {wxStyledTextCtrl, markerSetAlpha, 2}},
- {3034, {wxStyledTextCtrl, setMarginType, 2}},
- {3035, {wxStyledTextCtrl, getMarginType, 1}},
- {3036, {wxStyledTextCtrl, setMarginWidth, 2}},
- {3037, {wxStyledTextCtrl, getMarginWidth, 1}},
- {3038, {wxStyledTextCtrl, setMarginMask, 2}},
- {3039, {wxStyledTextCtrl, getMarginMask, 1}},
- {3040, {wxStyledTextCtrl, setMarginSensitive, 2}},
- {3041, {wxStyledTextCtrl, getMarginSensitive, 1}},
- {3042, {wxStyledTextCtrl, styleClearAll, 0}},
- {3043, {wxStyledTextCtrl, styleSetForeground, 2}},
- {3044, {wxStyledTextCtrl, styleSetBackground, 2}},
- {3045, {wxStyledTextCtrl, styleSetBold, 2}},
- {3046, {wxStyledTextCtrl, styleSetItalic, 2}},
- {3047, {wxStyledTextCtrl, styleSetSize, 2}},
- {3048, {wxStyledTextCtrl, styleSetFaceName, 2}},
- {3049, {wxStyledTextCtrl, styleSetEOLFilled, 2}},
- {3050, {wxStyledTextCtrl, styleResetDefault, 0}},
- {3051, {wxStyledTextCtrl, styleSetUnderline, 2}},
- {3052, {wxStyledTextCtrl, styleSetCase, 2}},
- {3053, {wxStyledTextCtrl, styleSetHotSpot, 2}},
- {3054, {wxStyledTextCtrl, setSelForeground, 2}},
- {3055, {wxStyledTextCtrl, setSelBackground, 2}},
- {3056, {wxStyledTextCtrl, getSelAlpha, 0}},
- {3057, {wxStyledTextCtrl, setSelAlpha, 1}},
- {3058, {wxStyledTextCtrl, setCaretForeground, 1}},
- {3059, {wxStyledTextCtrl, cmdKeyAssign, 3}},
- {3060, {wxStyledTextCtrl, cmdKeyClear, 2}},
- {3061, {wxStyledTextCtrl, cmdKeyClearAll, 0}},
- {3062, {wxStyledTextCtrl, setStyleBytes, 2}},
- {3063, {wxStyledTextCtrl, styleSetVisible, 2}},
- {3064, {wxStyledTextCtrl, getCaretPeriod, 0}},
- {3065, {wxStyledTextCtrl, setCaretPeriod, 1}},
- {3066, {wxStyledTextCtrl, setWordChars, 1}},
- {3067, {wxStyledTextCtrl, beginUndoAction, 0}},
- {3068, {wxStyledTextCtrl, endUndoAction, 0}},
- {3069, {wxStyledTextCtrl, indicatorSetStyle, 2}},
- {3070, {wxStyledTextCtrl, indicatorGetStyle, 1}},
- {3071, {wxStyledTextCtrl, indicatorSetForeground, 2}},
- {3072, {wxStyledTextCtrl, indicatorGetForeground, 1}},
- {3073, {wxStyledTextCtrl, setWhitespaceForeground, 2}},
- {3074, {wxStyledTextCtrl, setWhitespaceBackground, 2}},
- {3075, {wxStyledTextCtrl, getStyleBits, 0}},
- {3076, {wxStyledTextCtrl, setLineState, 2}},
- {3077, {wxStyledTextCtrl, getLineState, 1}},
- {3078, {wxStyledTextCtrl, getMaxLineState, 0}},
- {3079, {wxStyledTextCtrl, getCaretLineVisible, 0}},
- {3080, {wxStyledTextCtrl, setCaretLineVisible, 1}},
- {3081, {wxStyledTextCtrl, getCaretLineBackground, 0}},
- {3082, {wxStyledTextCtrl, setCaretLineBackground, 1}},
- {3083, {wxStyledTextCtrl, autoCompShow, 2}},
- {3084, {wxStyledTextCtrl, autoCompCancel, 0}},
- {3085, {wxStyledTextCtrl, autoCompActive, 0}},
- {3086, {wxStyledTextCtrl, autoCompPosStart, 0}},
- {3087, {wxStyledTextCtrl, autoCompComplete, 0}},
- {3088, {wxStyledTextCtrl, autoCompStops, 1}},
- {3089, {wxStyledTextCtrl, autoCompSetSeparator, 1}},
- {3090, {wxStyledTextCtrl, autoCompGetSeparator, 0}},
- {3091, {wxStyledTextCtrl, autoCompSelect, 1}},
- {3092, {wxStyledTextCtrl, autoCompSetCancelAtStart, 1}},
- {3093, {wxStyledTextCtrl, autoCompGetCancelAtStart, 0}},
- {3094, {wxStyledTextCtrl, autoCompSetFillUps, 1}},
- {3095, {wxStyledTextCtrl, autoCompSetChooseSingle, 1}},
- {3096, {wxStyledTextCtrl, autoCompGetChooseSingle, 0}},
- {3097, {wxStyledTextCtrl, autoCompSetIgnoreCase, 1}},
- {3098, {wxStyledTextCtrl, autoCompGetIgnoreCase, 0}},
- {3099, {wxStyledTextCtrl, userListShow, 2}},
- {3100, {wxStyledTextCtrl, autoCompSetAutoHide, 1}},
- {3101, {wxStyledTextCtrl, autoCompGetAutoHide, 0}},
- {3102, {wxStyledTextCtrl, autoCompSetDropRestOfWord, 1}},
- {3103, {wxStyledTextCtrl, autoCompGetDropRestOfWord, 0}},
- {3104, {wxStyledTextCtrl, registerImage, 2}},
- {3105, {wxStyledTextCtrl, clearRegisteredImages, 0}},
- {3106, {wxStyledTextCtrl, autoCompGetTypeSeparator, 0}},
- {3107, {wxStyledTextCtrl, autoCompSetTypeSeparator, 1}},
- {3108, {wxStyledTextCtrl, autoCompSetMaxWidth, 1}},
- {3109, {wxStyledTextCtrl, autoCompGetMaxWidth, 0}},
- {3110, {wxStyledTextCtrl, autoCompSetMaxHeight, 1}},
- {3111, {wxStyledTextCtrl, autoCompGetMaxHeight, 0}},
- {3112, {wxStyledTextCtrl, setIndent, 1}},
- {3113, {wxStyledTextCtrl, getIndent, 0}},
- {3114, {wxStyledTextCtrl, setUseTabs, 1}},
- {3115, {wxStyledTextCtrl, getUseTabs, 0}},
- {3116, {wxStyledTextCtrl, setLineIndentation, 2}},
- {3117, {wxStyledTextCtrl, getLineIndentation, 1}},
- {3118, {wxStyledTextCtrl, getLineIndentPosition, 1}},
- {3119, {wxStyledTextCtrl, getColumn, 1}},
- {3120, {wxStyledTextCtrl, setUseHorizontalScrollBar, 1}},
- {3121, {wxStyledTextCtrl, getUseHorizontalScrollBar, 0}},
- {3122, {wxStyledTextCtrl, setIndentationGuides, 1}},
- {3123, {wxStyledTextCtrl, getIndentationGuides, 0}},
- {3124, {wxStyledTextCtrl, setHighlightGuide, 1}},
- {3125, {wxStyledTextCtrl, getHighlightGuide, 0}},
- {3126, {wxStyledTextCtrl, getLineEndPosition, 1}},
- {3127, {wxStyledTextCtrl, getCodePage, 0}},
- {3128, {wxStyledTextCtrl, getCaretForeground, 0}},
- {3129, {wxStyledTextCtrl, getReadOnly, 0}},
- {3130, {wxStyledTextCtrl, setCurrentPos, 1}},
- {3131, {wxStyledTextCtrl, setSelectionStart, 1}},
- {3132, {wxStyledTextCtrl, getSelectionStart, 0}},
- {3133, {wxStyledTextCtrl, setSelectionEnd, 1}},
- {3134, {wxStyledTextCtrl, getSelectionEnd, 0}},
- {3135, {wxStyledTextCtrl, setPrintMagnification, 1}},
- {3136, {wxStyledTextCtrl, getPrintMagnification, 0}},
- {3137, {wxStyledTextCtrl, setPrintColourMode, 1}},
- {3138, {wxStyledTextCtrl, getPrintColourMode, 0}},
- {3139, {wxStyledTextCtrl, findText, 4}},
- {3140, {wxStyledTextCtrl, formatRange, 7}},
- {3141, {wxStyledTextCtrl, getFirstVisibleLine, 0}},
- {3142, {wxStyledTextCtrl, getLine, 1}},
- {3143, {wxStyledTextCtrl, getLineCount, 0}},
- {3144, {wxStyledTextCtrl, setMarginLeft, 1}},
- {3145, {wxStyledTextCtrl, getMarginLeft, 0}},
- {3146, {wxStyledTextCtrl, setMarginRight, 1}},
- {3147, {wxStyledTextCtrl, getMarginRight, 0}},
- {3148, {wxStyledTextCtrl, getModify, 0}},
- {3149, {wxStyledTextCtrl, setSelection, 2}},
- {3150, {wxStyledTextCtrl, getSelectedText, 0}},
- {3151, {wxStyledTextCtrl, getTextRange, 2}},
- {3152, {wxStyledTextCtrl, hideSelection, 1}},
- {3153, {wxStyledTextCtrl, lineFromPosition, 1}},
- {3154, {wxStyledTextCtrl, positionFromLine, 1}},
- {3155, {wxStyledTextCtrl, lineScroll, 2}},
- {3156, {wxStyledTextCtrl, ensureCaretVisible, 0}},
- {3157, {wxStyledTextCtrl, replaceSelection, 1}},
- {3158, {wxStyledTextCtrl, setReadOnly, 1}},
- {3159, {wxStyledTextCtrl, canPaste, 0}},
- {3160, {wxStyledTextCtrl, canUndo, 0}},
- {3161, {wxStyledTextCtrl, emptyUndoBuffer, 0}},
- {3162, {wxStyledTextCtrl, undo, 0}},
- {3163, {wxStyledTextCtrl, cut, 0}},
- {3164, {wxStyledTextCtrl, copy, 0}},
- {3165, {wxStyledTextCtrl, paste, 0}},
- {3166, {wxStyledTextCtrl, clear, 0}},
- {3167, {wxStyledTextCtrl, setText, 1}},
- {3168, {wxStyledTextCtrl, getText, 0}},
- {3169, {wxStyledTextCtrl, getTextLength, 0}},
- {3170, {wxStyledTextCtrl, getOvertype, 0}},
- {3171, {wxStyledTextCtrl, setCaretWidth, 1}},
- {3172, {wxStyledTextCtrl, getCaretWidth, 0}},
- {3173, {wxStyledTextCtrl, setTargetStart, 1}},
- {3174, {wxStyledTextCtrl, getTargetStart, 0}},
- {3175, {wxStyledTextCtrl, setTargetEnd, 1}},
- {3176, {wxStyledTextCtrl, getTargetEnd, 0}},
- {3177, {wxStyledTextCtrl, replaceTarget, 1}},
- {3178, {wxStyledTextCtrl, searchInTarget, 1}},
- {3179, {wxStyledTextCtrl, setSearchFlags, 1}},
- {3180, {wxStyledTextCtrl, getSearchFlags, 0}},
- {3181, {wxStyledTextCtrl, callTipShow, 2}},
- {3182, {wxStyledTextCtrl, callTipCancel, 0}},
- {3183, {wxStyledTextCtrl, callTipActive, 0}},
- {3184, {wxStyledTextCtrl, callTipPosAtStart, 0}},
- {3185, {wxStyledTextCtrl, callTipSetHighlight, 2}},
- {3186, {wxStyledTextCtrl, callTipSetBackground, 1}},
- {3187, {wxStyledTextCtrl, callTipSetForeground, 1}},
- {3188, {wxStyledTextCtrl, callTipSetForegroundHighlight, 1}},
- {3189, {wxStyledTextCtrl, callTipUseStyle, 1}},
- {3190, {wxStyledTextCtrl, visibleFromDocLine, 1}},
- {3191, {wxStyledTextCtrl, docLineFromVisible, 1}},
- {3192, {wxStyledTextCtrl, wrapCount, 1}},
- {3193, {wxStyledTextCtrl, setFoldLevel, 2}},
- {3194, {wxStyledTextCtrl, getFoldLevel, 1}},
- {3195, {wxStyledTextCtrl, getLastChild, 2}},
- {3196, {wxStyledTextCtrl, getFoldParent, 1}},
- {3197, {wxStyledTextCtrl, showLines, 2}},
- {3198, {wxStyledTextCtrl, hideLines, 2}},
- {3199, {wxStyledTextCtrl, getLineVisible, 1}},
- {3200, {wxStyledTextCtrl, setFoldExpanded, 2}},
- {3201, {wxStyledTextCtrl, getFoldExpanded, 1}},
- {3202, {wxStyledTextCtrl, toggleFold, 1}},
- {3203, {wxStyledTextCtrl, ensureVisible, 1}},
- {3204, {wxStyledTextCtrl, setFoldFlags, 1}},
- {3205, {wxStyledTextCtrl, ensureVisibleEnforcePolicy, 1}},
- {3206, {wxStyledTextCtrl, setTabIndents, 1}},
- {3207, {wxStyledTextCtrl, getTabIndents, 0}},
- {3208, {wxStyledTextCtrl, setBackSpaceUnIndents, 1}},
- {3209, {wxStyledTextCtrl, getBackSpaceUnIndents, 0}},
- {3210, {wxStyledTextCtrl, setMouseDwellTime, 1}},
- {3211, {wxStyledTextCtrl, getMouseDwellTime, 0}},
- {3212, {wxStyledTextCtrl, wordStartPosition, 2}},
- {3213, {wxStyledTextCtrl, wordEndPosition, 2}},
- {3214, {wxStyledTextCtrl, setWrapMode, 1}},
- {3215, {wxStyledTextCtrl, getWrapMode, 0}},
- {3216, {wxStyledTextCtrl, setWrapVisualFlags, 1}},
- {3217, {wxStyledTextCtrl, getWrapVisualFlags, 0}},
- {3218, {wxStyledTextCtrl, setWrapVisualFlagsLocation, 1}},
- {3219, {wxStyledTextCtrl, getWrapVisualFlagsLocation, 0}},
- {3220, {wxStyledTextCtrl, setWrapStartIndent, 1}},
- {3221, {wxStyledTextCtrl, getWrapStartIndent, 0}},
- {3222, {wxStyledTextCtrl, setLayoutCache, 1}},
- {3223, {wxStyledTextCtrl, getLayoutCache, 0}},
- {3224, {wxStyledTextCtrl, setScrollWidth, 1}},
- {3225, {wxStyledTextCtrl, getScrollWidth, 0}},
- {3226, {wxStyledTextCtrl, textWidth, 2}},
- {3227, {wxStyledTextCtrl, getEndAtLastLine, 0}},
- {3228, {wxStyledTextCtrl, textHeight, 1}},
- {3229, {wxStyledTextCtrl, setUseVerticalScrollBar, 1}},
- {3230, {wxStyledTextCtrl, getUseVerticalScrollBar, 0}},
- {3231, {wxStyledTextCtrl, appendText, 1}},
- {3232, {wxStyledTextCtrl, getTwoPhaseDraw, 0}},
- {3233, {wxStyledTextCtrl, setTwoPhaseDraw, 1}},
- {3234, {wxStyledTextCtrl, targetFromSelection, 0}},
- {3235, {wxStyledTextCtrl, linesJoin, 0}},
- {3236, {wxStyledTextCtrl, linesSplit, 1}},
- {3237, {wxStyledTextCtrl, setFoldMarginColour, 2}},
- {3238, {wxStyledTextCtrl, setFoldMarginHiColour, 2}},
- {3239, {wxStyledTextCtrl, lineDown, 0}},
- {3240, {wxStyledTextCtrl, lineDownExtend, 0}},
- {3241, {wxStyledTextCtrl, lineUp, 0}},
- {3242, {wxStyledTextCtrl, lineUpExtend, 0}},
- {3243, {wxStyledTextCtrl, charLeft, 0}},
- {3244, {wxStyledTextCtrl, charLeftExtend, 0}},
- {3245, {wxStyledTextCtrl, charRight, 0}},
- {3246, {wxStyledTextCtrl, charRightExtend, 0}},
- {3247, {wxStyledTextCtrl, wordLeft, 0}},
- {3248, {wxStyledTextCtrl, wordLeftExtend, 0}},
- {3249, {wxStyledTextCtrl, wordRight, 0}},
- {3250, {wxStyledTextCtrl, wordRightExtend, 0}},
- {3251, {wxStyledTextCtrl, home, 0}},
- {3252, {wxStyledTextCtrl, homeExtend, 0}},
- {3253, {wxStyledTextCtrl, lineEnd, 0}},
- {3254, {wxStyledTextCtrl, lineEndExtend, 0}},
- {3255, {wxStyledTextCtrl, documentStart, 0}},
- {3256, {wxStyledTextCtrl, documentStartExtend, 0}},
- {3257, {wxStyledTextCtrl, documentEnd, 0}},
- {3258, {wxStyledTextCtrl, documentEndExtend, 0}},
- {3259, {wxStyledTextCtrl, pageUp, 0}},
- {3260, {wxStyledTextCtrl, pageUpExtend, 0}},
- {3261, {wxStyledTextCtrl, pageDown, 0}},
- {3262, {wxStyledTextCtrl, pageDownExtend, 0}},
- {3263, {wxStyledTextCtrl, editToggleOvertype, 0}},
- {3264, {wxStyledTextCtrl, cancel, 0}},
- {3265, {wxStyledTextCtrl, deleteBack, 0}},
- {3266, {wxStyledTextCtrl, tab, 0}},
- {3267, {wxStyledTextCtrl, backTab, 0}},
- {3268, {wxStyledTextCtrl, newLine, 0}},
- {3269, {wxStyledTextCtrl, formFeed, 0}},
- {3270, {wxStyledTextCtrl, vCHome, 0}},
- {3271, {wxStyledTextCtrl, vCHomeExtend, 0}},
- {3272, {wxStyledTextCtrl, zoomIn, 0}},
- {3273, {wxStyledTextCtrl, zoomOut, 0}},
- {3274, {wxStyledTextCtrl, delWordLeft, 0}},
- {3275, {wxStyledTextCtrl, delWordRight, 0}},
- {3276, {wxStyledTextCtrl, lineCut, 0}},
- {3277, {wxStyledTextCtrl, lineDelete, 0}},
- {3278, {wxStyledTextCtrl, lineTranspose, 0}},
- {3279, {wxStyledTextCtrl, lineDuplicate, 0}},
- {3280, {wxStyledTextCtrl, lowerCase, 0}},
- {3281, {wxStyledTextCtrl, upperCase, 0}},
- {3282, {wxStyledTextCtrl, lineScrollDown, 0}},
- {3283, {wxStyledTextCtrl, lineScrollUp, 0}},
- {3284, {wxStyledTextCtrl, deleteBackNotLine, 0}},
- {3285, {wxStyledTextCtrl, homeDisplay, 0}},
- {3286, {wxStyledTextCtrl, homeDisplayExtend, 0}},
- {3287, {wxStyledTextCtrl, lineEndDisplay, 0}},
- {3288, {wxStyledTextCtrl, lineEndDisplayExtend, 0}},
- {3289, {wxStyledTextCtrl, homeWrapExtend, 0}},
- {3290, {wxStyledTextCtrl, lineEndWrap, 0}},
- {3291, {wxStyledTextCtrl, lineEndWrapExtend, 0}},
- {3292, {wxStyledTextCtrl, vCHomeWrap, 0}},
- {3293, {wxStyledTextCtrl, vCHomeWrapExtend, 0}},
- {3294, {wxStyledTextCtrl, lineCopy, 0}},
- {3295, {wxStyledTextCtrl, moveCaretInsideView, 0}},
- {3296, {wxStyledTextCtrl, lineLength, 1}},
- {3297, {wxStyledTextCtrl, braceHighlight, 2}},
- {3298, {wxStyledTextCtrl, braceBadLight, 1}},
- {3299, {wxStyledTextCtrl, braceMatch, 1}},
- {3300, {wxStyledTextCtrl, getViewEOL, 0}},
- {3301, {wxStyledTextCtrl, setViewEOL, 1}},
- {3302, {wxStyledTextCtrl, setModEventMask, 1}},
- {3303, {wxStyledTextCtrl, getEdgeColumn, 0}},
- {3304, {wxStyledTextCtrl, setEdgeColumn, 1}},
- {3305, {wxStyledTextCtrl, setEdgeMode, 1}},
- {3306, {wxStyledTextCtrl, getEdgeMode, 0}},
- {3307, {wxStyledTextCtrl, getEdgeColour, 0}},
- {3308, {wxStyledTextCtrl, setEdgeColour, 1}},
- {3309, {wxStyledTextCtrl, searchAnchor, 0}},
- {3310, {wxStyledTextCtrl, searchNext, 2}},
- {3311, {wxStyledTextCtrl, searchPrev, 2}},
- {3312, {wxStyledTextCtrl, linesOnScreen, 0}},
- {3313, {wxStyledTextCtrl, usePopUp, 1}},
- {3314, {wxStyledTextCtrl, selectionIsRectangle, 0}},
- {3315, {wxStyledTextCtrl, setZoom, 1}},
- {3316, {wxStyledTextCtrl, getZoom, 0}},
- {3317, {wxStyledTextCtrl, getModEventMask, 0}},
- {3318, {wxStyledTextCtrl, setSTCFocus, 1}},
- {3319, {wxStyledTextCtrl, getSTCFocus, 0}},
- {3320, {wxStyledTextCtrl, setStatus, 1}},
- {3321, {wxStyledTextCtrl, getStatus, 0}},
- {3322, {wxStyledTextCtrl, setMouseDownCaptures, 1}},
- {3323, {wxStyledTextCtrl, getMouseDownCaptures, 0}},
- {3324, {wxStyledTextCtrl, setSTCCursor, 1}},
- {3325, {wxStyledTextCtrl, getSTCCursor, 0}},
- {3326, {wxStyledTextCtrl, setControlCharSymbol, 1}},
- {3327, {wxStyledTextCtrl, getControlCharSymbol, 0}},
- {3328, {wxStyledTextCtrl, wordPartLeft, 0}},
- {3329, {wxStyledTextCtrl, wordPartLeftExtend, 0}},
- {3330, {wxStyledTextCtrl, wordPartRight, 0}},
- {3331, {wxStyledTextCtrl, wordPartRightExtend, 0}},
- {3332, {wxStyledTextCtrl, setVisiblePolicy, 2}},
- {3333, {wxStyledTextCtrl, delLineLeft, 0}},
- {3334, {wxStyledTextCtrl, delLineRight, 0}},
- {3335, {wxStyledTextCtrl, getXOffset, 0}},
- {3336, {wxStyledTextCtrl, chooseCaretX, 0}},
- {3337, {wxStyledTextCtrl, setXCaretPolicy, 2}},
- {3338, {wxStyledTextCtrl, setYCaretPolicy, 2}},
- {3339, {wxStyledTextCtrl, getPrintWrapMode, 0}},
- {3340, {wxStyledTextCtrl, setHotspotActiveForeground, 2}},
- {3341, {wxStyledTextCtrl, setHotspotActiveBackground, 2}},
- {3342, {wxStyledTextCtrl, setHotspotActiveUnderline, 1}},
- {3343, {wxStyledTextCtrl, setHotspotSingleLine, 1}},
- {3344, {wxStyledTextCtrl, paraDownExtend, 0}},
- {3345, {wxStyledTextCtrl, paraUp, 0}},
- {3346, {wxStyledTextCtrl, paraUpExtend, 0}},
- {3347, {wxStyledTextCtrl, positionBefore, 1}},
- {3348, {wxStyledTextCtrl, positionAfter, 1}},
- {3349, {wxStyledTextCtrl, copyRange, 2}},
- {3350, {wxStyledTextCtrl, copyText, 2}},
- {3351, {wxStyledTextCtrl, setSelectionMode, 1}},
- {3352, {wxStyledTextCtrl, getSelectionMode, 0}},
- {3353, {wxStyledTextCtrl, lineDownRectExtend, 0}},
- {3354, {wxStyledTextCtrl, lineUpRectExtend, 0}},
- {3355, {wxStyledTextCtrl, charLeftRectExtend, 0}},
- {3356, {wxStyledTextCtrl, charRightRectExtend, 0}},
- {3357, {wxStyledTextCtrl, homeRectExtend, 0}},
- {3358, {wxStyledTextCtrl, vCHomeRectExtend, 0}},
- {3359, {wxStyledTextCtrl, lineEndRectExtend, 0}},
- {3360, {wxStyledTextCtrl, pageUpRectExtend, 0}},
- {3361, {wxStyledTextCtrl, pageDownRectExtend, 0}},
- {3362, {wxStyledTextCtrl, stutteredPageUp, 0}},
- {3363, {wxStyledTextCtrl, stutteredPageUpExtend, 0}},
- {3364, {wxStyledTextCtrl, stutteredPageDown, 0}},
- {3365, {wxStyledTextCtrl, stutteredPageDownExtend, 0}},
- {3366, {wxStyledTextCtrl, wordLeftEnd, 0}},
- {3367, {wxStyledTextCtrl, wordLeftEndExtend, 0}},
- {3368, {wxStyledTextCtrl, wordRightEnd, 0}},
- {3369, {wxStyledTextCtrl, wordRightEndExtend, 0}},
- {3370, {wxStyledTextCtrl, setWhitespaceChars, 1}},
- {3371, {wxStyledTextCtrl, setCharsDefault, 0}},
- {3372, {wxStyledTextCtrl, autoCompGetCurrent, 0}},
- {3373, {wxStyledTextCtrl, allocate, 1}},
- {3374, {wxStyledTextCtrl, findColumn, 2}},
- {3375, {wxStyledTextCtrl, getCaretSticky, 0}},
- {3376, {wxStyledTextCtrl, setCaretSticky, 1}},
- {3377, {wxStyledTextCtrl, toggleCaretSticky, 0}},
- {3378, {wxStyledTextCtrl, setPasteConvertEndings, 1}},
- {3379, {wxStyledTextCtrl, getPasteConvertEndings, 0}},
- {3380, {wxStyledTextCtrl, selectionDuplicate, 0}},
- {3381, {wxStyledTextCtrl, setCaretLineBackAlpha, 1}},
- {3382, {wxStyledTextCtrl, getCaretLineBackAlpha, 0}},
- {3383, {wxStyledTextCtrl, startRecord, 0}},
- {3384, {wxStyledTextCtrl, stopRecord, 0}},
- {3385, {wxStyledTextCtrl, setLexer, 1}},
- {3386, {wxStyledTextCtrl, getLexer, 0}},
- {3387, {wxStyledTextCtrl, colourise, 2}},
- {3388, {wxStyledTextCtrl, setProperty, 2}},
- {3389, {wxStyledTextCtrl, setKeyWords, 2}},
- {3390, {wxStyledTextCtrl, setLexerLanguage, 1}},
- {3391, {wxStyledTextCtrl, getProperty, 1}},
- {3392, {wxStyledTextCtrl, getStyleBitsNeeded, 0}},
- {3393, {wxStyledTextCtrl, getCurrentLine, 0}},
- {3394, {wxStyledTextCtrl, styleSetSpec, 2}},
- {3395, {wxStyledTextCtrl, styleSetFont, 2}},
- {3396, {wxStyledTextCtrl, styleSetFontAttr, 7}},
- {3397, {wxStyledTextCtrl, styleSetCharacterSet, 2}},
- {3398, {wxStyledTextCtrl, styleSetFontEncoding, 2}},
- {3399, {wxStyledTextCtrl, cmdKeyExecute, 1}},
- {3400, {wxStyledTextCtrl, setMargins, 2}},
- {3401, {wxStyledTextCtrl, getSelection, 2}},
- {3402, {wxStyledTextCtrl, pointFromPosition, 1}},
- {3403, {wxStyledTextCtrl, scrollToLine, 1}},
- {3404, {wxStyledTextCtrl, scrollToColumn, 1}},
- {3405, {wxStyledTextCtrl, setVScrollBar, 1}},
- {3406, {wxStyledTextCtrl, setHScrollBar, 1}},
- {3407, {wxStyledTextCtrl, getLastKeydownProcessed, 0}},
- {3408, {wxStyledTextCtrl, setLastKeydownProcessed, 1}},
- {3409, {wxStyledTextCtrl, saveFile, 1}},
- {3410, {wxStyledTextCtrl, loadFile, 1}},
- {3411, {wxStyledTextCtrl, doDragOver, 3}},
- {3412, {wxStyledTextCtrl, doDropText, 3}},
- {3413, {wxStyledTextCtrl, getUseAntiAliasing, 0}},
- {3414, {wxStyledTextCtrl, addTextRaw, 1}},
- {3415, {wxStyledTextCtrl, insertTextRaw, 2}},
- {3416, {wxStyledTextCtrl, getCurLineRaw, 1}},
- {3417, {wxStyledTextCtrl, getLineRaw, 1}},
- {3418, {wxStyledTextCtrl, getSelectedTextRaw, 0}},
- {3419, {wxStyledTextCtrl, getTextRangeRaw, 2}},
- {3420, {wxStyledTextCtrl, setTextRaw, 1}},
- {3421, {wxStyledTextCtrl, getTextRaw, 0}},
- {3422, {wxStyledTextCtrl, appendTextRaw, 1}},
- {3423, {wxArtProvider, getBitmap, 2}},
- {3424, {wxArtProvider, getIcon, 2}},
- {3425, {wxTreeEvent, getKeyCode, 0}},
- {3426, {wxTreeEvent, getItem, 0}},
- {3427, {wxTreeEvent, getKeyEvent, 0}},
- {3428, {wxTreeEvent, getLabel, 0}},
- {3429, {wxTreeEvent, getOldItem, 0}},
- {3430, {wxTreeEvent, getPoint, 0}},
- {3431, {wxTreeEvent, isEditCancelled, 0}},
- {3432, {wxTreeEvent, setToolTip, 1}},
- {3433, {wxNotebookEvent, getOldSelection, 0}},
- {3434, {wxNotebookEvent, getSelection, 0}},
- {3435, {wxNotebookEvent, setOldSelection, 1}},
- {3436, {wxNotebookEvent, setSelection, 1}},
- {3437, {wxFileDataObject, new, 0}},
- {3438, {wxFileDataObject, addFile, 1}},
- {3439, {wxFileDataObject, getFilenames, 0}},
- {3440, {wxFileDataObject, 'Destroy', undefined}},
- {3441, {wxTextDataObject, new, 1}},
- {3442, {wxTextDataObject, getTextLength, 0}},
- {3443, {wxTextDataObject, getText, 0}},
- {3444, {wxTextDataObject, setText, 1}},
- {3445, {wxTextDataObject, 'Destroy', undefined}},
- {3446, {wxBitmapDataObject, new_1_1, 1}},
- {3447, {wxBitmapDataObject, new_1_0, 1}},
- {3448, {wxBitmapDataObject, getBitmap, 0}},
- {3449, {wxBitmapDataObject, setBitmap, 1}},
- {3450, {wxBitmapDataObject, 'Destroy', undefined}},
- {3452, {wxClipboard, new, 0}},
- {3453, {wxClipboard, destruct, 0}},
- {3454, {wxClipboard, addData, 1}},
- {3455, {wxClipboard, clear, 0}},
- {3456, {wxClipboard, close, 0}},
- {3457, {wxClipboard, flush, 0}},
- {3458, {wxClipboard, getData, 1}},
- {3459, {wxClipboard, isOpened, 0}},
- {3460, {wxClipboard, open, 0}},
- {3461, {wxClipboard, setData, 1}},
- {3463, {wxClipboard, usePrimarySelection, 1}},
- {3464, {wxClipboard, isSupported, 1}},
- {3465, {wxClipboard, get, 0}},
- {3466, {wxSpinEvent, getPosition, 0}},
- {3467, {wxSpinEvent, setPosition, 1}},
- {3468, {wxSplitterWindow, new_0, 0}},
- {3469, {wxSplitterWindow, new_2, 2}},
- {3470, {wxSplitterWindow, destruct, 0}},
- {3471, {wxSplitterWindow, create, 2}},
- {3472, {wxSplitterWindow, getMinimumPaneSize, 0}},
- {3473, {wxSplitterWindow, getSashGravity, 0}},
- {3474, {wxSplitterWindow, getSashPosition, 0}},
- {3475, {wxSplitterWindow, getSplitMode, 0}},
- {3476, {wxSplitterWindow, getWindow1, 0}},
- {3477, {wxSplitterWindow, getWindow2, 0}},
- {3478, {wxSplitterWindow, initialize, 1}},
- {3479, {wxSplitterWindow, isSplit, 0}},
- {3480, {wxSplitterWindow, replaceWindow, 2}},
- {3481, {wxSplitterWindow, setSashGravity, 1}},
- {3482, {wxSplitterWindow, setSashPosition, 2}},
- {3483, {wxSplitterWindow, setSashSize, 1}},
- {3484, {wxSplitterWindow, setMinimumPaneSize, 1}},
- {3485, {wxSplitterWindow, setSplitMode, 1}},
- {3486, {wxSplitterWindow, splitHorizontally, 3}},
- {3487, {wxSplitterWindow, splitVertically, 3}},
- {3488, {wxSplitterWindow, unsplit, 1}},
- {3489, {wxSplitterWindow, updateSize, 0}},
- {3490, {wxSplitterEvent, getSashPosition, 0}},
- {3491, {wxSplitterEvent, getX, 0}},
- {3492, {wxSplitterEvent, getY, 0}},
- {3493, {wxSplitterEvent, getWindowBeingRemoved, 0}},
- {3494, {wxSplitterEvent, setSashPosition, 1}},
- {3495, {wxHtmlWindow, new_0, 0}},
- {3496, {wxHtmlWindow, new_2, 2}},
- {3497, {wxHtmlWindow, appendToPage, 1}},
- {3498, {wxHtmlWindow, getOpenedAnchor, 0}},
- {3499, {wxHtmlWindow, getOpenedPage, 0}},
- {3500, {wxHtmlWindow, getOpenedPageTitle, 0}},
- {3501, {wxHtmlWindow, getRelatedFrame, 0}},
- {3502, {wxHtmlWindow, historyBack, 0}},
- {3503, {wxHtmlWindow, historyCanBack, 0}},
- {3504, {wxHtmlWindow, historyCanForward, 0}},
- {3505, {wxHtmlWindow, historyClear, 0}},
- {3506, {wxHtmlWindow, historyForward, 0}},
- {3507, {wxHtmlWindow, loadFile, 1}},
- {3508, {wxHtmlWindow, loadPage, 1}},
- {3509, {wxHtmlWindow, selectAll, 0}},
- {3510, {wxHtmlWindow, selectionToText, 0}},
- {3511, {wxHtmlWindow, selectLine, 1}},
- {3512, {wxHtmlWindow, selectWord, 1}},
- {3513, {wxHtmlWindow, setBorders, 1}},
- {3514, {wxHtmlWindow, setFonts, 3}},
- {3515, {wxHtmlWindow, setPage, 1}},
- {3516, {wxHtmlWindow, setRelatedFrame, 2}},
- {3517, {wxHtmlWindow, setRelatedStatusBar, 1}},
- {3518, {wxHtmlWindow, toText, 0}},
- {3519, {wxHtmlWindow, 'Destroy', undefined}},
- {3520, {wxHtmlLinkEvent, getLinkInfo, 0}},
- {3521, {wxSystemSettings, getColour, 1}},
- {3522, {wxSystemSettings, getFont, 1}},
- {3523, {wxSystemSettings, getMetric, 2}},
- {3524, {wxSystemSettings, getScreenType, 0}},
- {3525, {wxSystemOptions, getOption, 1}},
- {3526, {wxSystemOptions, getOptionInt, 1}},
- {3527, {wxSystemOptions, hasOption, 1}},
- {3528, {wxSystemOptions, isFalse, 1}},
- {3529, {wxSystemOptions, setOption_2_1, 2}},
- {3530, {wxSystemOptions, setOption_2_0, 2}},
- {3531, {wxAuiNotebookEvent, setSelection, 1}},
- {3532, {wxAuiNotebookEvent, getSelection, 0}},
- {3533, {wxAuiNotebookEvent, setOldSelection, 1}},
- {3534, {wxAuiNotebookEvent, getOldSelection, 0}},
- {3535, {wxAuiNotebookEvent, setDragSource, 1}},
- {3536, {wxAuiNotebookEvent, getDragSource, 0}},
- {3537, {wxAuiManagerEvent, setManager, 1}},
- {3538, {wxAuiManagerEvent, getManager, 0}},
- {3539, {wxAuiManagerEvent, setPane, 1}},
- {3540, {wxAuiManagerEvent, getPane, 0}},
- {3541, {wxAuiManagerEvent, setButton, 1}},
- {3542, {wxAuiManagerEvent, getButton, 0}},
- {3543, {wxAuiManagerEvent, setDC, 1}},
- {3544, {wxAuiManagerEvent, getDC, 0}},
- {3545, {wxAuiManagerEvent, veto, 1}},
- {3546, {wxAuiManagerEvent, getVeto, 0}},
- {3547, {wxAuiManagerEvent, setCanVeto, 1}},
- {3548, {wxAuiManagerEvent, canVeto, 0}},
- {3549, {wxLogNull, new, 0}},
- {3550, {wxLogNull, 'Destroy', undefined}},
- {3551, {wxTaskBarIcon, new, 0}},
- {3552, {wxTaskBarIcon, destruct, 0}},
- {3553, {wxTaskBarIcon, popupMenu, 1}},
- {3554, {wxTaskBarIcon, removeIcon, 0}},
- {3555, {wxTaskBarIcon, setIcon, 2}},
- {3556, {wxLocale, new_0, 0}},
- {3558, {wxLocale, new_2, 2}},
- {3559, {wxLocale, destruct, 0}},
- {3561, {wxLocale, init, 1}},
- {3562, {wxLocale, addCatalog_1, 1}},
- {3563, {wxLocale, addCatalog_3, 3}},
- {3564, {wxLocale, addCatalogLookupPathPrefix, 1}},
- {3565, {wxLocale, getCanonicalName, 0}},
- {3566, {wxLocale, getLanguage, 0}},
- {3567, {wxLocale, getLanguageName, 1}},
- {3568, {wxLocale, getLocale, 0}},
- {3569, {wxLocale, getName, 0}},
- {3570, {wxLocale, getString_2, 2}},
- {3571, {wxLocale, getString_4, 4}},
- {3572, {wxLocale, getHeaderValue, 2}},
- {3573, {wxLocale, getSysName, 0}},
- {3574, {wxLocale, getSystemEncoding, 0}},
- {3575, {wxLocale, getSystemEncodingName, 0}},
- {3576, {wxLocale, getSystemLanguage, 0}},
- {3577, {wxLocale, isLoaded, 1}},
- {3578, {wxLocale, isOk, 0}},
- {3579, {wxActivateEvent, getActive, 0}},
- {3581, {wxPopupWindow, new_2, 2}},
- {3582, {wxPopupWindow, new_0, 0}},
- {3584, {wxPopupWindow, destruct, 0}},
- {3585, {wxPopupWindow, create, 2}},
- {3586, {wxPopupWindow, position, 2}},
- {3587, {wxPopupTransientWindow, new_0, 0}},
- {3588, {wxPopupTransientWindow, new_2, 2}},
- {3589, {wxPopupTransientWindow, destruct, 0}},
- {3590, {wxPopupTransientWindow, popup, 1}},
- {3591, {wxPopupTransientWindow, dismiss, 0}},
- {3592, {wxOverlay, new, 0}},
- {3593, {wxOverlay, destruct, 0}},
- {3594, {wxOverlay, reset, 0}},
- {3595, {wxDCOverlay, new_6, 6}},
- {3596, {wxDCOverlay, new_2, 2}},
- {3597, {wxDCOverlay, destruct, 0}},
- {3598, {wxDCOverlay, clear, 0}},
+ {1605, {wxGauge, getRange, 0}},
+ {1606, {wxGauge, getValue, 0}},
+ {1607, {wxGauge, isVertical, 0}},
+ {1608, {wxGauge, setRange, 1}},
+ {1609, {wxGauge, setValue, 1}},
+ {1610, {wxGauge, pulse, 0}},
+ {1611, {wxGauge, 'Destroy', undefined}},
+ {1612, {wxGenericDirCtrl, new_0, 0}},
+ {1613, {wxGenericDirCtrl, new_2, 2}},
+ {1614, {wxGenericDirCtrl, destruct, 0}},
+ {1615, {wxGenericDirCtrl, create, 2}},
+ {1616, {wxGenericDirCtrl, init, 0}},
+ {1617, {wxGenericDirCtrl, collapseTree, 0}},
+ {1618, {wxGenericDirCtrl, expandPath, 1}},
+ {1619, {wxGenericDirCtrl, getDefaultPath, 0}},
+ {1620, {wxGenericDirCtrl, getPath, 0}},
+ {1621, {wxGenericDirCtrl, getFilePath, 0}},
+ {1622, {wxGenericDirCtrl, getFilter, 0}},
+ {1623, {wxGenericDirCtrl, getFilterIndex, 0}},
+ {1624, {wxGenericDirCtrl, getRootId, 0}},
+ {1625, {wxGenericDirCtrl, getTreeCtrl, 0}},
+ {1626, {wxGenericDirCtrl, reCreateTree, 0}},
+ {1627, {wxGenericDirCtrl, setDefaultPath, 1}},
+ {1628, {wxGenericDirCtrl, setFilter, 1}},
+ {1629, {wxGenericDirCtrl, setFilterIndex, 1}},
+ {1630, {wxGenericDirCtrl, setPath, 1}},
+ {1632, {wxStaticBox, new_4, 4}},
+ {1633, {wxStaticBox, new_0, 0}},
+ {1634, {wxStaticBox, create, 4}},
+ {1635, {wxStaticBox, 'Destroy', undefined}},
+ {1637, {wxStaticLine, new_2, 2}},
+ {1638, {wxStaticLine, new_0, 0}},
+ {1639, {wxStaticLine, create, 2}},
+ {1640, {wxStaticLine, isVertical, 0}},
+ {1641, {wxStaticLine, getDefaultSize, 0}},
+ {1642, {wxStaticLine, 'Destroy', undefined}},
+ {1645, {wxListBox, new_3, 3}},
+ {1646, {wxListBox, new_0, 0}},
+ {1648, {wxListBox, destruct, 0}},
+ {1650, {wxListBox, create, 6}},
+ {1651, {wxListBox, deselect, 1}},
+ {1652, {wxListBox, getSelections, 1}},
+ {1653, {wxListBox, insertItems, 2}},
+ {1654, {wxListBox, isSelected, 1}},
+ {1655, {wxListBox, set, 1}},
+ {1656, {wxListBox, hitTest, 1}},
+ {1657, {wxListBox, setFirstItem_1_0, 1}},
+ {1658, {wxListBox, setFirstItem_1_1, 1}},
+ {1659, {wxListCtrl, new_0, 0}},
+ {1660, {wxListCtrl, new_2, 2}},
+ {1661, {wxListCtrl, arrange, 1}},
+ {1662, {wxListCtrl, assignImageList, 2}},
+ {1663, {wxListCtrl, clearAll, 0}},
+ {1664, {wxListCtrl, create, 2}},
+ {1665, {wxListCtrl, deleteAllItems, 0}},
+ {1666, {wxListCtrl, deleteColumn, 1}},
+ {1667, {wxListCtrl, deleteItem, 1}},
+ {1668, {wxListCtrl, editLabel, 1}},
+ {1669, {wxListCtrl, ensureVisible, 1}},
+ {1670, {wxListCtrl, findItem_3_0, 3}},
+ {1671, {wxListCtrl, findItem_3_1, 3}},
+ {1672, {wxListCtrl, getColumn, 2}},
+ {1673, {wxListCtrl, getColumnCount, 0}},
+ {1674, {wxListCtrl, getColumnWidth, 1}},
+ {1675, {wxListCtrl, getCountPerPage, 0}},
+ {1676, {wxListCtrl, getEditControl, 0}},
+ {1677, {wxListCtrl, getImageList, 1}},
+ {1678, {wxListCtrl, getItem, 1}},
+ {1679, {wxListCtrl, getItemBackgroundColour, 1}},
+ {1680, {wxListCtrl, getItemCount, 0}},
+ {1681, {wxListCtrl, getItemData, 1}},
+ {1682, {wxListCtrl, getItemFont, 1}},
+ {1683, {wxListCtrl, getItemPosition, 2}},
+ {1684, {wxListCtrl, getItemRect, 3}},
+ {1685, {wxListCtrl, getItemSpacing, 0}},
+ {1686, {wxListCtrl, getItemState, 2}},
+ {1687, {wxListCtrl, getItemText, 1}},
+ {1688, {wxListCtrl, getItemTextColour, 1}},
+ {1689, {wxListCtrl, getNextItem, 2}},
+ {1690, {wxListCtrl, getSelectedItemCount, 0}},
+ {1691, {wxListCtrl, getTextColour, 0}},
+ {1692, {wxListCtrl, getTopItem, 0}},
+ {1693, {wxListCtrl, getViewRect, 0}},
+ {1694, {wxListCtrl, hitTest, 3}},
+ {1695, {wxListCtrl, insertColumn_2, 2}},
+ {1696, {wxListCtrl, insertColumn_3, 3}},
+ {1697, {wxListCtrl, insertItem_1, 1}},
+ {1698, {wxListCtrl, insertItem_2_1, 2}},
+ {1699, {wxListCtrl, insertItem_2_0, 2}},
+ {1700, {wxListCtrl, insertItem_3, 3}},
+ {1701, {wxListCtrl, refreshItem, 1}},
+ {1702, {wxListCtrl, refreshItems, 2}},
+ {1703, {wxListCtrl, scrollList, 2}},
+ {1704, {wxListCtrl, setBackgroundColour, 1}},
+ {1705, {wxListCtrl, setColumn, 2}},
+ {1706, {wxListCtrl, setColumnWidth, 2}},
+ {1707, {wxListCtrl, setImageList, 2}},
+ {1708, {wxListCtrl, setItem_1, 1}},
+ {1709, {wxListCtrl, setItem_4, 4}},
+ {1710, {wxListCtrl, setItemBackgroundColour, 2}},
+ {1711, {wxListCtrl, setItemCount, 1}},
+ {1712, {wxListCtrl, setItemData, 2}},
+ {1713, {wxListCtrl, setItemFont, 2}},
+ {1714, {wxListCtrl, setItemImage, 3}},
+ {1715, {wxListCtrl, setItemColumnImage, 3}},
+ {1716, {wxListCtrl, setItemPosition, 2}},
+ {1717, {wxListCtrl, setItemState, 3}},
+ {1718, {wxListCtrl, setItemText, 2}},
+ {1719, {wxListCtrl, setItemTextColour, 2}},
+ {1720, {wxListCtrl, setSingleStyle, 2}},
+ {1721, {wxListCtrl, setTextColour, 1}},
+ {1722, {wxListCtrl, setWindowStyleFlag, 1}},
+ {1723, {wxListCtrl, sortItems, 2}},
+ {1724, {wxListCtrl, 'Destroy', undefined}},
+ {1725, {wxListView, clearColumnImage, 1}},
+ {1726, {wxListView, focus, 1}},
+ {1727, {wxListView, getFirstSelected, 0}},
+ {1728, {wxListView, getFocusedItem, 0}},
+ {1729, {wxListView, getNextSelected, 1}},
+ {1730, {wxListView, isSelected, 1}},
+ {1731, {wxListView, select, 2}},
+ {1732, {wxListView, setColumnImage, 2}},
+ {1733, {wxListItem, new_0, 0}},
+ {1734, {wxListItem, new_1, 1}},
+ {1735, {wxListItem, destruct, 0}},
+ {1736, {wxListItem, clear, 0}},
+ {1737, {wxListItem, getAlign, 0}},
+ {1738, {wxListItem, getBackgroundColour, 0}},
+ {1739, {wxListItem, getColumn, 0}},
+ {1740, {wxListItem, getFont, 0}},
+ {1741, {wxListItem, getId, 0}},
+ {1742, {wxListItem, getImage, 0}},
+ {1743, {wxListItem, getMask, 0}},
+ {1744, {wxListItem, getState, 0}},
+ {1745, {wxListItem, getText, 0}},
+ {1746, {wxListItem, getTextColour, 0}},
+ {1747, {wxListItem, getWidth, 0}},
+ {1748, {wxListItem, setAlign, 1}},
+ {1749, {wxListItem, setBackgroundColour, 1}},
+ {1750, {wxListItem, setColumn, 1}},
+ {1751, {wxListItem, setFont, 1}},
+ {1752, {wxListItem, setId, 1}},
+ {1753, {wxListItem, setImage, 1}},
+ {1754, {wxListItem, setMask, 1}},
+ {1755, {wxListItem, setState, 1}},
+ {1756, {wxListItem, setStateMask, 1}},
+ {1757, {wxListItem, setText, 1}},
+ {1758, {wxListItem, setTextColour, 1}},
+ {1759, {wxListItem, setWidth, 1}},
+ {1760, {wxListItemAttr, new_0, 0}},
+ {1761, {wxListItemAttr, new_3, 3}},
+ {1762, {wxListItemAttr, getBackgroundColour, 0}},
+ {1763, {wxListItemAttr, getFont, 0}},
+ {1764, {wxListItemAttr, getTextColour, 0}},
+ {1765, {wxListItemAttr, hasBackgroundColour, 0}},
+ {1766, {wxListItemAttr, hasFont, 0}},
+ {1767, {wxListItemAttr, hasTextColour, 0}},
+ {1768, {wxListItemAttr, setBackgroundColour, 1}},
+ {1769, {wxListItemAttr, setFont, 1}},
+ {1770, {wxListItemAttr, setTextColour, 1}},
+ {1771, {wxListItemAttr, 'Destroy', undefined}},
+ {1772, {wxImageList, new_0, 0}},
+ {1773, {wxImageList, new_3, 3}},
+ {1774, {wxImageList, add_1, 1}},
+ {1775, {wxImageList, add_2_0, 2}},
+ {1776, {wxImageList, add_2_1, 2}},
+ {1777, {wxImageList, create, 3}},
+ {1779, {wxImageList, draw, 5}},
+ {1780, {wxImageList, getBitmap, 1}},
+ {1781, {wxImageList, getIcon, 1}},
+ {1782, {wxImageList, getImageCount, 0}},
+ {1783, {wxImageList, getSize, 3}},
+ {1784, {wxImageList, remove, 1}},
+ {1785, {wxImageList, removeAll, 0}},
+ {1786, {wxImageList, replace_2, 2}},
+ {1787, {wxImageList, replace_3, 3}},
+ {1788, {wxImageList, 'Destroy', undefined}},
+ {1789, {wxTextAttr, new_0, 0}},
+ {1790, {wxTextAttr, new_2, 2}},
+ {1791, {wxTextAttr, getAlignment, 0}},
+ {1792, {wxTextAttr, getBackgroundColour, 0}},
+ {1793, {wxTextAttr, getFont, 0}},
+ {1794, {wxTextAttr, getLeftIndent, 0}},
+ {1795, {wxTextAttr, getLeftSubIndent, 0}},
+ {1796, {wxTextAttr, getRightIndent, 0}},
+ {1797, {wxTextAttr, getTabs, 0}},
+ {1798, {wxTextAttr, getTextColour, 0}},
+ {1799, {wxTextAttr, hasBackgroundColour, 0}},
+ {1800, {wxTextAttr, hasFont, 0}},
+ {1801, {wxTextAttr, hasTextColour, 0}},
+ {1802, {wxTextAttr, getFlags, 0}},
+ {1803, {wxTextAttr, isDefault, 0}},
+ {1804, {wxTextAttr, setAlignment, 1}},
+ {1805, {wxTextAttr, setBackgroundColour, 1}},
+ {1806, {wxTextAttr, setFlags, 1}},
+ {1807, {wxTextAttr, setFont, 2}},
+ {1808, {wxTextAttr, setLeftIndent, 2}},
+ {1809, {wxTextAttr, setRightIndent, 1}},
+ {1810, {wxTextAttr, setTabs, 1}},
+ {1811, {wxTextAttr, setTextColour, 1}},
+ {1812, {wxTextAttr, 'Destroy', undefined}},
+ {1814, {wxTextCtrl, new_3, 3}},
+ {1815, {wxTextCtrl, new_0, 0}},
+ {1817, {wxTextCtrl, destruct, 0}},
+ {1818, {wxTextCtrl, appendText, 1}},
+ {1819, {wxTextCtrl, canCopy, 0}},
+ {1820, {wxTextCtrl, canCut, 0}},
+ {1821, {wxTextCtrl, canPaste, 0}},
+ {1822, {wxTextCtrl, canRedo, 0}},
+ {1823, {wxTextCtrl, canUndo, 0}},
+ {1824, {wxTextCtrl, clear, 0}},
+ {1825, {wxTextCtrl, copy, 0}},
+ {1826, {wxTextCtrl, create, 3}},
+ {1827, {wxTextCtrl, cut, 0}},
+ {1828, {wxTextCtrl, discardEdits, 0}},
+ {1829, {wxTextCtrl, changeValue, 1}},
+ {1830, {wxTextCtrl, emulateKeyPress, 1}},
+ {1831, {wxTextCtrl, getDefaultStyle, 0}},
+ {1832, {wxTextCtrl, getInsertionPoint, 0}},
+ {1833, {wxTextCtrl, getLastPosition, 0}},
+ {1834, {wxTextCtrl, getLineLength, 1}},
+ {1835, {wxTextCtrl, getLineText, 1}},
+ {1836, {wxTextCtrl, getNumberOfLines, 0}},
+ {1837, {wxTextCtrl, getRange, 2}},
+ {1838, {wxTextCtrl, getSelection, 2}},
+ {1839, {wxTextCtrl, getStringSelection, 0}},
+ {1840, {wxTextCtrl, getStyle, 2}},
+ {1841, {wxTextCtrl, getValue, 0}},
+ {1842, {wxTextCtrl, isEditable, 0}},
+ {1843, {wxTextCtrl, isModified, 0}},
+ {1844, {wxTextCtrl, isMultiLine, 0}},
+ {1845, {wxTextCtrl, isSingleLine, 0}},
+ {1846, {wxTextCtrl, loadFile, 2}},
+ {1847, {wxTextCtrl, markDirty, 0}},
+ {1848, {wxTextCtrl, paste, 0}},
+ {1849, {wxTextCtrl, positionToXY, 3}},
+ {1850, {wxTextCtrl, redo, 0}},
+ {1851, {wxTextCtrl, remove, 2}},
+ {1852, {wxTextCtrl, replace, 3}},
+ {1853, {wxTextCtrl, saveFile, 1}},
+ {1854, {wxTextCtrl, setDefaultStyle, 1}},
+ {1855, {wxTextCtrl, setEditable, 1}},
+ {1856, {wxTextCtrl, setInsertionPoint, 1}},
+ {1857, {wxTextCtrl, setInsertionPointEnd, 0}},
+ {1859, {wxTextCtrl, setMaxLength, 1}},
+ {1860, {wxTextCtrl, setSelection, 2}},
+ {1861, {wxTextCtrl, setStyle, 3}},
+ {1862, {wxTextCtrl, setValue, 1}},
+ {1863, {wxTextCtrl, showPosition, 1}},
+ {1864, {wxTextCtrl, undo, 0}},
+ {1865, {wxTextCtrl, writeText, 1}},
+ {1866, {wxTextCtrl, xYToPosition, 2}},
+ {1869, {wxNotebook, new_0, 0}},
+ {1870, {wxNotebook, new_3, 3}},
+ {1871, {wxNotebook, destruct, 0}},
+ {1872, {wxNotebook, addPage, 3}},
+ {1873, {wxNotebook, advanceSelection, 1}},
+ {1874, {wxNotebook, assignImageList, 1}},
+ {1875, {wxNotebook, create, 3}},
+ {1876, {wxNotebook, deleteAllPages, 0}},
+ {1877, {wxNotebook, deletePage, 1}},
+ {1878, {wxNotebook, removePage, 1}},
+ {1879, {wxNotebook, getCurrentPage, 0}},
+ {1880, {wxNotebook, getImageList, 0}},
+ {1882, {wxNotebook, getPage, 1}},
+ {1883, {wxNotebook, getPageCount, 0}},
+ {1884, {wxNotebook, getPageImage, 1}},
+ {1885, {wxNotebook, getPageText, 1}},
+ {1886, {wxNotebook, getRowCount, 0}},
+ {1887, {wxNotebook, getSelection, 0}},
+ {1888, {wxNotebook, getThemeBackgroundColour, 0}},
+ {1890, {wxNotebook, hitTest, 2}},
+ {1892, {wxNotebook, insertPage, 4}},
+ {1893, {wxNotebook, setImageList, 1}},
+ {1894, {wxNotebook, setPadding, 1}},
+ {1895, {wxNotebook, setPageSize, 1}},
+ {1896, {wxNotebook, setPageImage, 2}},
+ {1897, {wxNotebook, setPageText, 2}},
+ {1898, {wxNotebook, setSelection, 1}},
+ {1899, {wxNotebook, changeSelection, 1}},
+ {1900, {wxChoicebook, new_0, 0}},
+ {1901, {wxChoicebook, new_3, 3}},
+ {1902, {wxChoicebook, addPage, 3}},
+ {1903, {wxChoicebook, advanceSelection, 1}},
+ {1904, {wxChoicebook, assignImageList, 1}},
+ {1905, {wxChoicebook, create, 3}},
+ {1906, {wxChoicebook, deleteAllPages, 0}},
+ {1907, {wxChoicebook, deletePage, 1}},
+ {1908, {wxChoicebook, removePage, 1}},
+ {1909, {wxChoicebook, getCurrentPage, 0}},
+ {1910, {wxChoicebook, getImageList, 0}},
+ {1912, {wxChoicebook, getPage, 1}},
+ {1913, {wxChoicebook, getPageCount, 0}},
+ {1914, {wxChoicebook, getPageImage, 1}},
+ {1915, {wxChoicebook, getPageText, 1}},
+ {1916, {wxChoicebook, getSelection, 0}},
+ {1917, {wxChoicebook, hitTest, 2}},
+ {1918, {wxChoicebook, insertPage, 4}},
+ {1919, {wxChoicebook, setImageList, 1}},
+ {1920, {wxChoicebook, setPageSize, 1}},
+ {1921, {wxChoicebook, setPageImage, 2}},
+ {1922, {wxChoicebook, setPageText, 2}},
+ {1923, {wxChoicebook, setSelection, 1}},
+ {1924, {wxChoicebook, changeSelection, 1}},
+ {1925, {wxChoicebook, 'Destroy', undefined}},
+ {1926, {wxToolbook, new_0, 0}},
+ {1927, {wxToolbook, new_3, 3}},
+ {1928, {wxToolbook, addPage, 3}},
+ {1929, {wxToolbook, advanceSelection, 1}},
+ {1930, {wxToolbook, assignImageList, 1}},
+ {1931, {wxToolbook, create, 3}},
+ {1932, {wxToolbook, deleteAllPages, 0}},
+ {1933, {wxToolbook, deletePage, 1}},
+ {1934, {wxToolbook, removePage, 1}},
+ {1935, {wxToolbook, getCurrentPage, 0}},
+ {1936, {wxToolbook, getImageList, 0}},
+ {1938, {wxToolbook, getPage, 1}},
+ {1939, {wxToolbook, getPageCount, 0}},
+ {1940, {wxToolbook, getPageImage, 1}},
+ {1941, {wxToolbook, getPageText, 1}},
+ {1942, {wxToolbook, getSelection, 0}},
+ {1944, {wxToolbook, hitTest, 2}},
+ {1945, {wxToolbook, insertPage, 4}},
+ {1946, {wxToolbook, setImageList, 1}},
+ {1947, {wxToolbook, setPageSize, 1}},
+ {1948, {wxToolbook, setPageImage, 2}},
+ {1949, {wxToolbook, setPageText, 2}},
+ {1950, {wxToolbook, setSelection, 1}},
+ {1951, {wxToolbook, changeSelection, 1}},
+ {1952, {wxToolbook, 'Destroy', undefined}},
+ {1953, {wxListbook, new_0, 0}},
+ {1954, {wxListbook, new_3, 3}},
+ {1955, {wxListbook, addPage, 3}},
+ {1956, {wxListbook, advanceSelection, 1}},
+ {1957, {wxListbook, assignImageList, 1}},
+ {1958, {wxListbook, create, 3}},
+ {1959, {wxListbook, deleteAllPages, 0}},
+ {1960, {wxListbook, deletePage, 1}},
+ {1961, {wxListbook, removePage, 1}},
+ {1962, {wxListbook, getCurrentPage, 0}},
+ {1963, {wxListbook, getImageList, 0}},
+ {1965, {wxListbook, getPage, 1}},
+ {1966, {wxListbook, getPageCount, 0}},
+ {1967, {wxListbook, getPageImage, 1}},
+ {1968, {wxListbook, getPageText, 1}},
+ {1969, {wxListbook, getSelection, 0}},
+ {1971, {wxListbook, hitTest, 2}},
+ {1972, {wxListbook, insertPage, 4}},
+ {1973, {wxListbook, setImageList, 1}},
+ {1974, {wxListbook, setPageSize, 1}},
+ {1975, {wxListbook, setPageImage, 2}},
+ {1976, {wxListbook, setPageText, 2}},
+ {1977, {wxListbook, setSelection, 1}},
+ {1978, {wxListbook, changeSelection, 1}},
+ {1979, {wxListbook, 'Destroy', undefined}},
+ {1980, {wxTreebook, new_0, 0}},
+ {1981, {wxTreebook, new_3, 3}},
+ {1982, {wxTreebook, addPage, 3}},
+ {1983, {wxTreebook, advanceSelection, 1}},
+ {1984, {wxTreebook, assignImageList, 1}},
+ {1985, {wxTreebook, create, 3}},
+ {1986, {wxTreebook, deleteAllPages, 0}},
+ {1987, {wxTreebook, deletePage, 1}},
+ {1988, {wxTreebook, removePage, 1}},
+ {1989, {wxTreebook, getCurrentPage, 0}},
+ {1990, {wxTreebook, getImageList, 0}},
+ {1992, {wxTreebook, getPage, 1}},
+ {1993, {wxTreebook, getPageCount, 0}},
+ {1994, {wxTreebook, getPageImage, 1}},
+ {1995, {wxTreebook, getPageText, 1}},
+ {1996, {wxTreebook, getSelection, 0}},
+ {1997, {wxTreebook, expandNode, 2}},
+ {1998, {wxTreebook, isNodeExpanded, 1}},
+ {2000, {wxTreebook, hitTest, 2}},
+ {2001, {wxTreebook, insertPage, 4}},
+ {2002, {wxTreebook, insertSubPage, 4}},
+ {2003, {wxTreebook, setImageList, 1}},
+ {2004, {wxTreebook, setPageSize, 1}},
+ {2005, {wxTreebook, setPageImage, 2}},
+ {2006, {wxTreebook, setPageText, 2}},
+ {2007, {wxTreebook, setSelection, 1}},
+ {2008, {wxTreebook, changeSelection, 1}},
+ {2009, {wxTreebook, 'Destroy', undefined}},
+ {2012, {wxTreeCtrl, new_2, 2}},
+ {2013, {wxTreeCtrl, new_0, 0}},
+ {2015, {wxTreeCtrl, destruct, 0}},
+ {2016, {wxTreeCtrl, addRoot, 2}},
+ {2017, {wxTreeCtrl, appendItem, 3}},
+ {2018, {wxTreeCtrl, assignImageList, 1}},
+ {2019, {wxTreeCtrl, assignStateImageList, 1}},
+ {2020, {wxTreeCtrl, collapse, 1}},
+ {2021, {wxTreeCtrl, collapseAndReset, 1}},
+ {2022, {wxTreeCtrl, create, 2}},
+ {2023, {wxTreeCtrl, delete, 1}},
+ {2024, {wxTreeCtrl, deleteAllItems, 0}},
+ {2025, {wxTreeCtrl, deleteChildren, 1}},
+ {2026, {wxTreeCtrl, editLabel, 1}},
+ {2027, {wxTreeCtrl, ensureVisible, 1}},
+ {2028, {wxTreeCtrl, expand, 1}},
+ {2029, {wxTreeCtrl, getBoundingRect, 3}},
+ {2031, {wxTreeCtrl, getChildrenCount, 2}},
+ {2032, {wxTreeCtrl, getCount, 0}},
+ {2033, {wxTreeCtrl, getEditControl, 0}},
+ {2034, {wxTreeCtrl, getFirstChild, 2}},
+ {2035, {wxTreeCtrl, getNextChild, 2}},
+ {2036, {wxTreeCtrl, getFirstVisibleItem, 0}},
+ {2037, {wxTreeCtrl, getImageList, 0}},
+ {2038, {wxTreeCtrl, getIndent, 0}},
+ {2039, {wxTreeCtrl, getItemBackgroundColour, 1}},
+ {2040, {wxTreeCtrl, getItemData, 1}},
+ {2041, {wxTreeCtrl, getItemFont, 1}},
+ {2042, {wxTreeCtrl, getItemImage_1, 1}},
+ {2043, {wxTreeCtrl, getItemImage_2, 2}},
+ {2044, {wxTreeCtrl, getItemText, 1}},
+ {2045, {wxTreeCtrl, getItemTextColour, 1}},
+ {2046, {wxTreeCtrl, getLastChild, 1}},
+ {2047, {wxTreeCtrl, getNextSibling, 1}},
+ {2048, {wxTreeCtrl, getNextVisible, 1}},
+ {2049, {wxTreeCtrl, getItemParent, 1}},
+ {2050, {wxTreeCtrl, getPrevSibling, 1}},
+ {2051, {wxTreeCtrl, getPrevVisible, 1}},
+ {2052, {wxTreeCtrl, getRootItem, 0}},
+ {2053, {wxTreeCtrl, getSelection, 0}},
+ {2054, {wxTreeCtrl, getSelections, 1}},
+ {2055, {wxTreeCtrl, getStateImageList, 0}},
+ {2056, {wxTreeCtrl, hitTest, 2}},
+ {2058, {wxTreeCtrl, insertItem, 4}},
+ {2059, {wxTreeCtrl, isBold, 1}},
+ {2060, {wxTreeCtrl, isExpanded, 1}},
+ {2061, {wxTreeCtrl, isSelected, 1}},
+ {2062, {wxTreeCtrl, isVisible, 1}},
+ {2063, {wxTreeCtrl, itemHasChildren, 1}},
+ {2064, {wxTreeCtrl, isTreeItemIdOk, 1}},
+ {2065, {wxTreeCtrl, prependItem, 3}},
+ {2066, {wxTreeCtrl, scrollTo, 1}},
+ {2067, {wxTreeCtrl, selectItem_1, 1}},
+ {2068, {wxTreeCtrl, selectItem_2, 2}},
+ {2069, {wxTreeCtrl, setIndent, 1}},
+ {2070, {wxTreeCtrl, setImageList, 1}},
+ {2071, {wxTreeCtrl, setItemBackgroundColour, 2}},
+ {2072, {wxTreeCtrl, setItemBold, 2}},
+ {2073, {wxTreeCtrl, setItemData, 2}},
+ {2074, {wxTreeCtrl, setItemDropHighlight, 2}},
+ {2075, {wxTreeCtrl, setItemFont, 2}},
+ {2076, {wxTreeCtrl, setItemHasChildren, 2}},
+ {2077, {wxTreeCtrl, setItemImage_2, 2}},
+ {2078, {wxTreeCtrl, setItemImage_3, 3}},
+ {2079, {wxTreeCtrl, setItemText, 2}},
+ {2080, {wxTreeCtrl, setItemTextColour, 2}},
+ {2081, {wxTreeCtrl, setStateImageList, 1}},
+ {2082, {wxTreeCtrl, setWindowStyle, 1}},
+ {2083, {wxTreeCtrl, sortChildren, 1}},
+ {2084, {wxTreeCtrl, toggle, 1}},
+ {2085, {wxTreeCtrl, toggleItemSelection, 1}},
+ {2086, {wxTreeCtrl, unselect, 0}},
+ {2087, {wxTreeCtrl, unselectAll, 0}},
+ {2088, {wxTreeCtrl, unselectItem, 1}},
+ {2089, {wxScrollBar, new_0, 0}},
+ {2090, {wxScrollBar, new_3, 3}},
+ {2091, {wxScrollBar, destruct, 0}},
+ {2092, {wxScrollBar, create, 3}},
+ {2093, {wxScrollBar, getRange, 0}},
+ {2094, {wxScrollBar, getPageSize, 0}},
+ {2095, {wxScrollBar, getThumbPosition, 0}},
+ {2096, {wxScrollBar, getThumbSize, 0}},
+ {2097, {wxScrollBar, setThumbPosition, 1}},
+ {2098, {wxScrollBar, setScrollbar, 5}},
+ {2100, {wxSpinButton, new_2, 2}},
+ {2101, {wxSpinButton, new_0, 0}},
+ {2102, {wxSpinButton, create, 2}},
+ {2103, {wxSpinButton, getMax, 0}},
+ {2104, {wxSpinButton, getMin, 0}},
+ {2105, {wxSpinButton, getValue, 0}},
+ {2106, {wxSpinButton, setRange, 2}},
+ {2107, {wxSpinButton, setValue, 1}},
+ {2108, {wxSpinButton, 'Destroy', undefined}},
+ {2109, {wxSpinCtrl, new_0, 0}},
+ {2110, {wxSpinCtrl, new_2, 2}},
+ {2112, {wxSpinCtrl, create, 2}},
+ {2115, {wxSpinCtrl, setValue_1_1, 1}},
+ {2116, {wxSpinCtrl, setValue_1_0, 1}},
+ {2118, {wxSpinCtrl, getValue, 0}},
+ {2120, {wxSpinCtrl, setRange, 2}},
+ {2121, {wxSpinCtrl, setSelection, 2}},
+ {2123, {wxSpinCtrl, getMin, 0}},
+ {2125, {wxSpinCtrl, getMax, 0}},
+ {2126, {wxSpinCtrl, 'Destroy', undefined}},
+ {2127, {wxStaticText, new_0, 0}},
+ {2128, {wxStaticText, new_4, 4}},
+ {2129, {wxStaticText, create, 4}},
+ {2130, {wxStaticText, getLabel, 0}},
+ {2131, {wxStaticText, setLabel, 1}},
+ {2132, {wxStaticText, wrap, 1}},
+ {2133, {wxStaticText, 'Destroy', undefined}},
+ {2134, {wxStaticBitmap, new_0, 0}},
+ {2135, {wxStaticBitmap, new_4, 4}},
+ {2136, {wxStaticBitmap, create, 4}},
+ {2137, {wxStaticBitmap, getBitmap, 0}},
+ {2138, {wxStaticBitmap, setBitmap, 1}},
+ {2139, {wxStaticBitmap, 'Destroy', undefined}},
+ {2140, {wxRadioBox, new, 7}},
+ {2142, {wxRadioBox, destruct, 0}},
+ {2143, {wxRadioBox, create, 7}},
+ {2144, {wxRadioBox, enable_2, 2}},
+ {2145, {wxRadioBox, enable_1, 1}},
+ {2146, {wxRadioBox, getSelection, 0}},
+ {2147, {wxRadioBox, getString, 1}},
+ {2148, {wxRadioBox, setSelection, 1}},
+ {2149, {wxRadioBox, show_2, 2}},
+ {2150, {wxRadioBox, show_1, 1}},
+ {2151, {wxRadioBox, getColumnCount, 0}},
+ {2152, {wxRadioBox, getItemHelpText, 1}},
+ {2153, {wxRadioBox, getItemToolTip, 1}},
+ {2155, {wxRadioBox, getItemFromPoint, 1}},
+ {2156, {wxRadioBox, getRowCount, 0}},
+ {2157, {wxRadioBox, isItemEnabled, 1}},
+ {2158, {wxRadioBox, isItemShown, 1}},
+ {2159, {wxRadioBox, setItemHelpText, 2}},
+ {2160, {wxRadioBox, setItemToolTip, 2}},
+ {2161, {wxRadioButton, new_0, 0}},
+ {2162, {wxRadioButton, new_4, 4}},
+ {2163, {wxRadioButton, create, 4}},
+ {2164, {wxRadioButton, getValue, 0}},
+ {2165, {wxRadioButton, setValue, 1}},
+ {2166, {wxRadioButton, 'Destroy', undefined}},
+ {2168, {wxSlider, new_6, 6}},
+ {2169, {wxSlider, new_0, 0}},
+ {2170, {wxSlider, create, 6}},
+ {2171, {wxSlider, getLineSize, 0}},
+ {2172, {wxSlider, getMax, 0}},
+ {2173, {wxSlider, getMin, 0}},
+ {2174, {wxSlider, getPageSize, 0}},
+ {2175, {wxSlider, getThumbLength, 0}},
+ {2176, {wxSlider, getValue, 0}},
+ {2177, {wxSlider, setLineSize, 1}},
+ {2178, {wxSlider, setPageSize, 1}},
+ {2179, {wxSlider, setRange, 2}},
+ {2180, {wxSlider, setThumbLength, 1}},
+ {2181, {wxSlider, setValue, 1}},
+ {2182, {wxSlider, 'Destroy', undefined}},
+ {2184, {wxDialog, new_4, 4}},
+ {2185, {wxDialog, new_0, 0}},
+ {2187, {wxDialog, destruct, 0}},
+ {2188, {wxDialog, create, 4}},
+ {2189, {wxDialog, createButtonSizer, 1}},
+ {2190, {wxDialog, createStdDialogButtonSizer, 1}},
+ {2191, {wxDialog, endModal, 1}},
+ {2192, {wxDialog, getAffirmativeId, 0}},
+ {2193, {wxDialog, getReturnCode, 0}},
+ {2194, {wxDialog, isModal, 0}},
+ {2195, {wxDialog, setAffirmativeId, 1}},
+ {2196, {wxDialog, setReturnCode, 1}},
+ {2197, {wxDialog, show, 1}},
+ {2198, {wxDialog, showModal, 0}},
+ {2199, {wxColourDialog, new_0, 0}},
+ {2200, {wxColourDialog, new_2, 2}},
+ {2201, {wxColourDialog, destruct, 0}},
+ {2202, {wxColourDialog, create, 2}},
+ {2203, {wxColourDialog, getColourData, 0}},
+ {2204, {wxColourData, new_0, 0}},
+ {2205, {wxColourData, new_1, 1}},
+ {2206, {wxColourData, destruct, 0}},
+ {2207, {wxColourData, getChooseFull, 0}},
+ {2208, {wxColourData, getColour, 0}},
+ {2210, {wxColourData, getCustomColour, 1}},
+ {2211, {wxColourData, setChooseFull, 1}},
+ {2212, {wxColourData, setColour, 1}},
+ {2213, {wxColourData, setCustomColour, 2}},
+ {2214, {wxPalette, new_0, 0}},
+ {2215, {wxPalette, new_4, 4}},
+ {2217, {wxPalette, destruct, 0}},
+ {2218, {wxPalette, create, 4}},
+ {2219, {wxPalette, getColoursCount, 0}},
+ {2220, {wxPalette, getPixel, 3}},
+ {2221, {wxPalette, getRGB, 4}},
+ {2222, {wxPalette, isOk, 0}},
+ {2226, {wxDirDialog, new, 2}},
+ {2227, {wxDirDialog, destruct, 0}},
+ {2228, {wxDirDialog, getPath, 0}},
+ {2229, {wxDirDialog, getMessage, 0}},
+ {2230, {wxDirDialog, setMessage, 1}},
+ {2231, {wxDirDialog, setPath, 1}},
+ {2235, {wxFileDialog, new, 2}},
+ {2236, {wxFileDialog, destruct, 0}},
+ {2237, {wxFileDialog, getDirectory, 0}},
+ {2238, {wxFileDialog, getFilename, 0}},
+ {2239, {wxFileDialog, getFilenames, 1}},
+ {2240, {wxFileDialog, getFilterIndex, 0}},
+ {2241, {wxFileDialog, getMessage, 0}},
+ {2242, {wxFileDialog, getPath, 0}},
+ {2243, {wxFileDialog, getPaths, 1}},
+ {2244, {wxFileDialog, getWildcard, 0}},
+ {2245, {wxFileDialog, setDirectory, 1}},
+ {2246, {wxFileDialog, setFilename, 1}},
+ {2247, {wxFileDialog, setFilterIndex, 1}},
+ {2248, {wxFileDialog, setMessage, 1}},
+ {2249, {wxFileDialog, setPath, 1}},
+ {2250, {wxFileDialog, setWildcard, 1}},
+ {2251, {wxPickerBase, setInternalMargin, 1}},
+ {2252, {wxPickerBase, getInternalMargin, 0}},
+ {2253, {wxPickerBase, setTextCtrlProportion, 1}},
+ {2254, {wxPickerBase, setPickerCtrlProportion, 1}},
+ {2255, {wxPickerBase, getTextCtrlProportion, 0}},
+ {2256, {wxPickerBase, getPickerCtrlProportion, 0}},
+ {2257, {wxPickerBase, hasTextCtrl, 0}},
+ {2258, {wxPickerBase, getTextCtrl, 0}},
+ {2259, {wxPickerBase, isTextCtrlGrowable, 0}},
+ {2260, {wxPickerBase, setPickerCtrlGrowable, 1}},
+ {2261, {wxPickerBase, setTextCtrlGrowable, 1}},
+ {2262, {wxPickerBase, isPickerCtrlGrowable, 0}},
+ {2263, {wxFilePickerCtrl, new_0, 0}},
+ {2264, {wxFilePickerCtrl, new_3, 3}},
+ {2265, {wxFilePickerCtrl, create, 3}},
+ {2266, {wxFilePickerCtrl, getPath, 0}},
+ {2267, {wxFilePickerCtrl, setPath, 1}},
+ {2268, {wxFilePickerCtrl, 'Destroy', undefined}},
+ {2269, {wxDirPickerCtrl, new_0, 0}},
+ {2270, {wxDirPickerCtrl, new_3, 3}},
+ {2271, {wxDirPickerCtrl, create, 3}},
+ {2272, {wxDirPickerCtrl, getPath, 0}},
+ {2273, {wxDirPickerCtrl, setPath, 1}},
+ {2274, {wxDirPickerCtrl, 'Destroy', undefined}},
+ {2275, {wxColourPickerCtrl, new_0, 0}},
+ {2276, {wxColourPickerCtrl, new_3, 3}},
+ {2277, {wxColourPickerCtrl, create, 3}},
+ {2278, {wxColourPickerCtrl, getColour, 0}},
+ {2279, {wxColourPickerCtrl, setColour_1_1, 1}},
+ {2280, {wxColourPickerCtrl, setColour_1_0, 1}},
+ {2281, {wxColourPickerCtrl, 'Destroy', undefined}},
+ {2282, {wxDatePickerCtrl, new_0, 0}},
+ {2283, {wxDatePickerCtrl, new_3, 3}},
+ {2284, {wxDatePickerCtrl, getRange, 2}},
+ {2285, {wxDatePickerCtrl, getValue, 0}},
+ {2286, {wxDatePickerCtrl, setRange, 2}},
+ {2287, {wxDatePickerCtrl, setValue, 1}},
+ {2288, {wxDatePickerCtrl, 'Destroy', undefined}},
+ {2289, {wxFontPickerCtrl, new_0, 0}},
+ {2290, {wxFontPickerCtrl, new_3, 3}},
+ {2291, {wxFontPickerCtrl, create, 3}},
+ {2292, {wxFontPickerCtrl, getSelectedFont, 0}},
+ {2293, {wxFontPickerCtrl, setSelectedFont, 1}},
+ {2294, {wxFontPickerCtrl, getMaxPointSize, 0}},
+ {2295, {wxFontPickerCtrl, setMaxPointSize, 1}},
+ {2296, {wxFontPickerCtrl, 'Destroy', undefined}},
+ {2299, {wxFindReplaceDialog, new_0, 0}},
+ {2300, {wxFindReplaceDialog, new_4, 4}},
+ {2301, {wxFindReplaceDialog, destruct, 0}},
+ {2302, {wxFindReplaceDialog, create, 4}},
+ {2303, {wxFindReplaceDialog, getData, 0}},
+ {2304, {wxFindReplaceData, new_0, 0}},
+ {2305, {wxFindReplaceData, new_1, 1}},
+ {2306, {wxFindReplaceData, getFindString, 0}},
+ {2307, {wxFindReplaceData, getReplaceString, 0}},
+ {2308, {wxFindReplaceData, getFlags, 0}},
+ {2309, {wxFindReplaceData, setFlags, 1}},
+ {2310, {wxFindReplaceData, setFindString, 1}},
+ {2311, {wxFindReplaceData, setReplaceString, 1}},
+ {2312, {wxFindReplaceData, 'Destroy', undefined}},
+ {2313, {wxMultiChoiceDialog, new_0, 0}},
+ {2315, {wxMultiChoiceDialog, new_5, 5}},
+ {2316, {wxMultiChoiceDialog, getSelections, 0}},
+ {2317, {wxMultiChoiceDialog, setSelections, 1}},
+ {2318, {wxMultiChoiceDialog, 'Destroy', undefined}},
+ {2319, {wxSingleChoiceDialog, new_0, 0}},
+ {2321, {wxSingleChoiceDialog, new_5, 5}},
+ {2322, {wxSingleChoiceDialog, getSelection, 0}},
+ {2323, {wxSingleChoiceDialog, getStringSelection, 0}},
+ {2324, {wxSingleChoiceDialog, setSelection, 1}},
+ {2325, {wxSingleChoiceDialog, 'Destroy', undefined}},
+ {2326, {wxTextEntryDialog, new, 3}},
+ {2327, {wxTextEntryDialog, getValue, 0}},
+ {2328, {wxTextEntryDialog, setValue, 1}},
+ {2329, {wxTextEntryDialog, 'Destroy', undefined}},
+ {2330, {wxPasswordEntryDialog, new, 3}},
+ {2331, {wxPasswordEntryDialog, 'Destroy', undefined}},
+ {2332, {wxFontData, new_0, 0}},
+ {2333, {wxFontData, new_1, 1}},
+ {2334, {wxFontData, destruct, 0}},
+ {2335, {wxFontData, enableEffects, 1}},
+ {2336, {wxFontData, getAllowSymbols, 0}},
+ {2337, {wxFontData, getColour, 0}},
+ {2338, {wxFontData, getChosenFont, 0}},
+ {2339, {wxFontData, getEnableEffects, 0}},
+ {2340, {wxFontData, getInitialFont, 0}},
+ {2341, {wxFontData, getShowHelp, 0}},
+ {2342, {wxFontData, setAllowSymbols, 1}},
+ {2343, {wxFontData, setChosenFont, 1}},
+ {2344, {wxFontData, setColour, 1}},
+ {2345, {wxFontData, setInitialFont, 1}},
+ {2346, {wxFontData, setRange, 2}},
+ {2347, {wxFontData, setShowHelp, 1}},
+ {2351, {wxFontDialog, new_0, 0}},
+ {2353, {wxFontDialog, new_2, 2}},
+ {2355, {wxFontDialog, create, 2}},
+ {2356, {wxFontDialog, getFontData, 0}},
+ {2358, {wxFontDialog, 'Destroy', undefined}},
+ {2359, {wxProgressDialog, new, 3}},
+ {2360, {wxProgressDialog, destruct, 0}},
+ {2361, {wxProgressDialog, resume, 0}},
+ {2362, {wxProgressDialog, update_2, 2}},
+ {2363, {wxProgressDialog, update_0, 0}},
+ {2364, {wxMessageDialog, new, 3}},
+ {2365, {wxMessageDialog, destruct, 0}},
+ {2366, {wxPageSetupDialog, new, 2}},
+ {2367, {wxPageSetupDialog, destruct, 0}},
+ {2368, {wxPageSetupDialog, getPageSetupData, 0}},
+ {2369, {wxPageSetupDialog, showModal, 0}},
+ {2370, {wxPageSetupDialogData, new_0, 0}},
+ {2371, {wxPageSetupDialogData, new_1_0, 1}},
+ {2372, {wxPageSetupDialogData, new_1_1, 1}},
+ {2373, {wxPageSetupDialogData, destruct, 0}},
+ {2374, {wxPageSetupDialogData, enableHelp, 1}},
+ {2375, {wxPageSetupDialogData, enableMargins, 1}},
+ {2376, {wxPageSetupDialogData, enableOrientation, 1}},
+ {2377, {wxPageSetupDialogData, enablePaper, 1}},
+ {2378, {wxPageSetupDialogData, enablePrinter, 1}},
+ {2379, {wxPageSetupDialogData, getDefaultMinMargins, 0}},
+ {2380, {wxPageSetupDialogData, getEnableMargins, 0}},
+ {2381, {wxPageSetupDialogData, getEnableOrientation, 0}},
+ {2382, {wxPageSetupDialogData, getEnablePaper, 0}},
+ {2383, {wxPageSetupDialogData, getEnablePrinter, 0}},
+ {2384, {wxPageSetupDialogData, getEnableHelp, 0}},
+ {2385, {wxPageSetupDialogData, getDefaultInfo, 0}},
+ {2386, {wxPageSetupDialogData, getMarginTopLeft, 0}},
+ {2387, {wxPageSetupDialogData, getMarginBottomRight, 0}},
+ {2388, {wxPageSetupDialogData, getMinMarginTopLeft, 0}},
+ {2389, {wxPageSetupDialogData, getMinMarginBottomRight, 0}},
+ {2390, {wxPageSetupDialogData, getPaperId, 0}},
+ {2391, {wxPageSetupDialogData, getPaperSize, 0}},
+ {2393, {wxPageSetupDialogData, getPrintData, 0}},
+ {2394, {wxPageSetupDialogData, isOk, 0}},
+ {2395, {wxPageSetupDialogData, setDefaultInfo, 1}},
+ {2396, {wxPageSetupDialogData, setDefaultMinMargins, 1}},
+ {2397, {wxPageSetupDialogData, setMarginTopLeft, 1}},
+ {2398, {wxPageSetupDialogData, setMarginBottomRight, 1}},
+ {2399, {wxPageSetupDialogData, setMinMarginTopLeft, 1}},
+ {2400, {wxPageSetupDialogData, setMinMarginBottomRight, 1}},
+ {2401, {wxPageSetupDialogData, setPaperId, 1}},
+ {2402, {wxPageSetupDialogData, setPaperSize_1_1, 1}},
+ {2403, {wxPageSetupDialogData, setPaperSize_1_0, 1}},
+ {2404, {wxPageSetupDialogData, setPrintData, 1}},
+ {2405, {wxPrintDialog, new_2_0, 2}},
+ {2406, {wxPrintDialog, new_2_1, 2}},
+ {2407, {wxPrintDialog, destruct, 0}},
+ {2408, {wxPrintDialog, getPrintDialogData, 0}},
+ {2409, {wxPrintDialog, getPrintDC, 0}},
+ {2410, {wxPrintDialogData, new_0, 0}},
+ {2411, {wxPrintDialogData, new_1_1, 1}},
+ {2412, {wxPrintDialogData, new_1_0, 1}},
+ {2413, {wxPrintDialogData, destruct, 0}},
+ {2414, {wxPrintDialogData, enableHelp, 1}},
+ {2415, {wxPrintDialogData, enablePageNumbers, 1}},
+ {2416, {wxPrintDialogData, enablePrintToFile, 1}},
+ {2417, {wxPrintDialogData, enableSelection, 1}},
+ {2418, {wxPrintDialogData, getAllPages, 0}},
+ {2419, {wxPrintDialogData, getCollate, 0}},
+ {2420, {wxPrintDialogData, getFromPage, 0}},
+ {2421, {wxPrintDialogData, getMaxPage, 0}},
+ {2422, {wxPrintDialogData, getMinPage, 0}},
+ {2423, {wxPrintDialogData, getNoCopies, 0}},
+ {2424, {wxPrintDialogData, getPrintData, 0}},
+ {2425, {wxPrintDialogData, getPrintToFile, 0}},
+ {2426, {wxPrintDialogData, getSelection, 0}},
+ {2427, {wxPrintDialogData, getToPage, 0}},
+ {2428, {wxPrintDialogData, isOk, 0}},
+ {2429, {wxPrintDialogData, setCollate, 1}},
+ {2430, {wxPrintDialogData, setFromPage, 1}},
+ {2431, {wxPrintDialogData, setMaxPage, 1}},
+ {2432, {wxPrintDialogData, setMinPage, 1}},
+ {2433, {wxPrintDialogData, setNoCopies, 1}},
+ {2434, {wxPrintDialogData, setPrintData, 1}},
+ {2435, {wxPrintDialogData, setPrintToFile, 1}},
+ {2436, {wxPrintDialogData, setSelection, 1}},
+ {2437, {wxPrintDialogData, setToPage, 1}},
+ {2438, {wxPrintData, new_0, 0}},
+ {2439, {wxPrintData, new_1, 1}},
+ {2440, {wxPrintData, destruct, 0}},
+ {2441, {wxPrintData, getCollate, 0}},
+ {2442, {wxPrintData, getBin, 0}},
+ {2443, {wxPrintData, getColour, 0}},
+ {2444, {wxPrintData, getDuplex, 0}},
+ {2445, {wxPrintData, getNoCopies, 0}},
+ {2446, {wxPrintData, getOrientation, 0}},
+ {2447, {wxPrintData, getPaperId, 0}},
+ {2448, {wxPrintData, getPrinterName, 0}},
+ {2449, {wxPrintData, getQuality, 0}},
+ {2450, {wxPrintData, isOk, 0}},
+ {2451, {wxPrintData, setBin, 1}},
+ {2452, {wxPrintData, setCollate, 1}},
+ {2453, {wxPrintData, setColour, 1}},
+ {2454, {wxPrintData, setDuplex, 1}},
+ {2455, {wxPrintData, setNoCopies, 1}},
+ {2456, {wxPrintData, setOrientation, 1}},
+ {2457, {wxPrintData, setPaperId, 1}},
+ {2458, {wxPrintData, setPrinterName, 1}},
+ {2459, {wxPrintData, setQuality, 1}},
+ {2462, {wxPrintPreview, new_2, 2}},
+ {2463, {wxPrintPreview, new_3, 3}},
+ {2465, {wxPrintPreview, destruct, 0}},
+ {2466, {wxPrintPreview, getCanvas, 0}},
+ {2467, {wxPrintPreview, getCurrentPage, 0}},
+ {2468, {wxPrintPreview, getFrame, 0}},
+ {2469, {wxPrintPreview, getMaxPage, 0}},
+ {2470, {wxPrintPreview, getMinPage, 0}},
+ {2471, {wxPrintPreview, getPrintout, 0}},
+ {2472, {wxPrintPreview, getPrintoutForPrinting, 0}},
+ {2473, {wxPrintPreview, isOk, 0}},
+ {2474, {wxPrintPreview, paintPage, 2}},
+ {2475, {wxPrintPreview, print, 1}},
+ {2476, {wxPrintPreview, renderPage, 1}},
+ {2477, {wxPrintPreview, setCanvas, 1}},
+ {2478, {wxPrintPreview, setCurrentPage, 1}},
+ {2479, {wxPrintPreview, setFrame, 1}},
+ {2480, {wxPrintPreview, setPrintout, 1}},
+ {2481, {wxPrintPreview, setZoom, 1}},
+ {2482, {wxPreviewFrame, new, 3}},
+ {2483, {wxPreviewFrame, destruct, 0}},
+ {2484, {wxPreviewFrame, createControlBar, 0}},
+ {2485, {wxPreviewFrame, createCanvas, 0}},
+ {2486, {wxPreviewFrame, initialize, 0}},
+ {2487, {wxPreviewFrame, onCloseWindow, 1}},
+ {2488, {wxPreviewControlBar, new, 4}},
+ {2489, {wxPreviewControlBar, destruct, 0}},
+ {2490, {wxPreviewControlBar, createButtons, 0}},
+ {2491, {wxPreviewControlBar, getPrintPreview, 0}},
+ {2492, {wxPreviewControlBar, getZoomControl, 0}},
+ {2493, {wxPreviewControlBar, setZoomControl, 1}},
+ {2495, {wxPrinter, new, 1}},
+ {2496, {wxPrinter, createAbortWindow, 2}},
+ {2497, {wxPrinter, getAbort, 0}},
+ {2498, {wxPrinter, getLastError, 0}},
+ {2499, {wxPrinter, getPrintDialogData, 0}},
+ {2500, {wxPrinter, print, 3}},
+ {2501, {wxPrinter, printDialog, 1}},
+ {2502, {wxPrinter, reportError, 3}},
+ {2503, {wxPrinter, setup, 1}},
+ {2504, {wxPrinter, 'Destroy', undefined}},
+ {2505, {wxXmlResource, new_1, 1}},
+ {2506, {wxXmlResource, new_2, 2}},
+ {2507, {wxXmlResource, destruct, 0}},
+ {2508, {wxXmlResource, attachUnknownControl, 3}},
+ {2509, {wxXmlResource, clearHandlers, 0}},
+ {2510, {wxXmlResource, compareVersion, 4}},
+ {2511, {wxXmlResource, get, 0}},
+ {2512, {wxXmlResource, getFlags, 0}},
+ {2513, {wxXmlResource, getVersion, 0}},
+ {2514, {wxXmlResource, getXRCID, 2}},
+ {2515, {wxXmlResource, initAllHandlers, 0}},
+ {2516, {wxXmlResource, load, 1}},
+ {2517, {wxXmlResource, loadBitmap, 1}},
+ {2518, {wxXmlResource, loadDialog_2, 2}},
+ {2519, {wxXmlResource, loadDialog_3, 3}},
+ {2520, {wxXmlResource, loadFrame_2, 2}},
+ {2521, {wxXmlResource, loadFrame_3, 3}},
+ {2522, {wxXmlResource, loadIcon, 1}},
+ {2523, {wxXmlResource, loadMenu, 1}},
+ {2524, {wxXmlResource, loadMenuBar_2, 2}},
+ {2525, {wxXmlResource, loadMenuBar_1, 1}},
+ {2526, {wxXmlResource, loadPanel_2, 2}},
+ {2527, {wxXmlResource, loadPanel_3, 3}},
+ {2528, {wxXmlResource, loadToolBar, 2}},
+ {2529, {wxXmlResource, set, 1}},
+ {2530, {wxXmlResource, setFlags, 1}},
+ {2531, {wxXmlResource, unload, 1}},
+ {2532, {wxXmlResource, xrcctrl, 3}},
+ {2533, {wxHtmlEasyPrinting, new, 1}},
+ {2534, {wxHtmlEasyPrinting, destruct, 0}},
+ {2535, {wxHtmlEasyPrinting, getPrintData, 0}},
+ {2536, {wxHtmlEasyPrinting, getPageSetupData, 0}},
+ {2537, {wxHtmlEasyPrinting, previewFile, 1}},
+ {2538, {wxHtmlEasyPrinting, previewText, 2}},
+ {2539, {wxHtmlEasyPrinting, printFile, 1}},
+ {2540, {wxHtmlEasyPrinting, printText, 2}},
+ {2541, {wxHtmlEasyPrinting, pageSetup, 0}},
+ {2542, {wxHtmlEasyPrinting, setFonts, 3}},
+ {2543, {wxHtmlEasyPrinting, setHeader, 2}},
+ {2544, {wxHtmlEasyPrinting, setFooter, 2}},
+ {2546, {wxGLCanvas, new_2, 2}},
+ {2547, {wxGLCanvas, new_3_1, 3}},
+ {2548, {wxGLCanvas, new_3_0, 3}},
+ {2549, {wxGLCanvas, getContext, 0}},
+ {2551, {wxGLCanvas, setCurrent, 0}},
+ {2552, {wxGLCanvas, swapBuffers, 0}},
+ {2553, {wxGLCanvas, 'Destroy', undefined}},
+ {2554, {wxAuiManager, new, 1}},
+ {2555, {wxAuiManager, destruct, 0}},
+ {2556, {wxAuiManager, addPane_2_1, 2}},
+ {2557, {wxAuiManager, addPane_3, 3}},
+ {2558, {wxAuiManager, addPane_2_0, 2}},
+ {2559, {wxAuiManager, detachPane, 1}},
+ {2560, {wxAuiManager, getAllPanes, 0}},
+ {2561, {wxAuiManager, getArtProvider, 0}},
+ {2562, {wxAuiManager, getDockSizeConstraint, 2}},
+ {2563, {wxAuiManager, getFlags, 0}},
+ {2564, {wxAuiManager, getManagedWindow, 0}},
+ {2565, {wxAuiManager, getManager, 1}},
+ {2566, {wxAuiManager, getPane_1_1, 1}},
+ {2567, {wxAuiManager, getPane_1_0, 1}},
+ {2568, {wxAuiManager, hideHint, 0}},
+ {2569, {wxAuiManager, insertPane, 3}},
+ {2570, {wxAuiManager, loadPaneInfo, 2}},
+ {2571, {wxAuiManager, loadPerspective, 2}},
+ {2572, {wxAuiManager, savePaneInfo, 1}},
+ {2573, {wxAuiManager, savePerspective, 0}},
+ {2574, {wxAuiManager, setArtProvider, 1}},
+ {2575, {wxAuiManager, setDockSizeConstraint, 2}},
+ {2576, {wxAuiManager, setFlags, 1}},
+ {2577, {wxAuiManager, setManagedWindow, 1}},
+ {2578, {wxAuiManager, showHint, 1}},
+ {2579, {wxAuiManager, unInit, 0}},
+ {2580, {wxAuiManager, update, 0}},
+ {2581, {wxAuiPaneInfo, new_0, 0}},
+ {2582, {wxAuiPaneInfo, new_1, 1}},
+ {2583, {wxAuiPaneInfo, destruct, 0}},
+ {2584, {wxAuiPaneInfo, bestSize_1, 1}},
+ {2585, {wxAuiPaneInfo, bestSize_2, 2}},
+ {2586, {wxAuiPaneInfo, bottom, 0}},
+ {2587, {wxAuiPaneInfo, bottomDockable, 1}},
+ {2588, {wxAuiPaneInfo, caption, 1}},
+ {2589, {wxAuiPaneInfo, captionVisible, 1}},
+ {2590, {wxAuiPaneInfo, centre, 0}},
+ {2591, {wxAuiPaneInfo, centrePane, 0}},
+ {2592, {wxAuiPaneInfo, closeButton, 1}},
+ {2593, {wxAuiPaneInfo, defaultPane, 0}},
+ {2594, {wxAuiPaneInfo, destroyOnClose, 1}},
+ {2595, {wxAuiPaneInfo, direction, 1}},
+ {2596, {wxAuiPaneInfo, dock, 0}},
+ {2597, {wxAuiPaneInfo, dockable, 1}},
+ {2598, {wxAuiPaneInfo, fixed, 0}},
+ {2599, {wxAuiPaneInfo, float, 0}},
+ {2600, {wxAuiPaneInfo, floatable, 1}},
+ {2601, {wxAuiPaneInfo, floatingPosition_1, 1}},
+ {2602, {wxAuiPaneInfo, floatingPosition_2, 2}},
+ {2603, {wxAuiPaneInfo, floatingSize_1, 1}},
+ {2604, {wxAuiPaneInfo, floatingSize_2, 2}},
+ {2605, {wxAuiPaneInfo, gripper, 1}},
+ {2606, {wxAuiPaneInfo, gripperTop, 1}},
+ {2607, {wxAuiPaneInfo, hasBorder, 0}},
+ {2608, {wxAuiPaneInfo, hasCaption, 0}},
+ {2609, {wxAuiPaneInfo, hasCloseButton, 0}},
+ {2610, {wxAuiPaneInfo, hasFlag, 1}},
+ {2611, {wxAuiPaneInfo, hasGripper, 0}},
+ {2612, {wxAuiPaneInfo, hasGripperTop, 0}},
+ {2613, {wxAuiPaneInfo, hasMaximizeButton, 0}},
+ {2614, {wxAuiPaneInfo, hasMinimizeButton, 0}},
+ {2615, {wxAuiPaneInfo, hasPinButton, 0}},
+ {2616, {wxAuiPaneInfo, hide, 0}},
+ {2617, {wxAuiPaneInfo, isBottomDockable, 0}},
+ {2618, {wxAuiPaneInfo, isDocked, 0}},
+ {2619, {wxAuiPaneInfo, isFixed, 0}},
+ {2620, {wxAuiPaneInfo, isFloatable, 0}},
+ {2621, {wxAuiPaneInfo, isFloating, 0}},
+ {2622, {wxAuiPaneInfo, isLeftDockable, 0}},
+ {2623, {wxAuiPaneInfo, isMovable, 0}},
+ {2624, {wxAuiPaneInfo, isOk, 0}},
+ {2625, {wxAuiPaneInfo, isResizable, 0}},
+ {2626, {wxAuiPaneInfo, isRightDockable, 0}},
+ {2627, {wxAuiPaneInfo, isShown, 0}},
+ {2628, {wxAuiPaneInfo, isToolbar, 0}},
+ {2629, {wxAuiPaneInfo, isTopDockable, 0}},
+ {2630, {wxAuiPaneInfo, layer, 1}},
+ {2631, {wxAuiPaneInfo, left, 0}},
+ {2632, {wxAuiPaneInfo, leftDockable, 1}},
+ {2633, {wxAuiPaneInfo, maxSize_1, 1}},
+ {2634, {wxAuiPaneInfo, maxSize_2, 2}},
+ {2635, {wxAuiPaneInfo, maximizeButton, 1}},
+ {2636, {wxAuiPaneInfo, minSize_1, 1}},
+ {2637, {wxAuiPaneInfo, minSize_2, 2}},
+ {2638, {wxAuiPaneInfo, minimizeButton, 1}},
+ {2639, {wxAuiPaneInfo, movable, 1}},
+ {2640, {wxAuiPaneInfo, name, 1}},
+ {2641, {wxAuiPaneInfo, paneBorder, 1}},
+ {2642, {wxAuiPaneInfo, pinButton, 1}},
+ {2643, {wxAuiPaneInfo, position, 1}},
+ {2644, {wxAuiPaneInfo, resizable, 1}},
+ {2645, {wxAuiPaneInfo, right, 0}},
+ {2646, {wxAuiPaneInfo, rightDockable, 1}},
+ {2647, {wxAuiPaneInfo, row, 1}},
+ {2648, {wxAuiPaneInfo, safeSet, 1}},
+ {2649, {wxAuiPaneInfo, setFlag, 2}},
+ {2650, {wxAuiPaneInfo, show, 1}},
+ {2651, {wxAuiPaneInfo, toolbarPane, 0}},
+ {2652, {wxAuiPaneInfo, top, 0}},
+ {2653, {wxAuiPaneInfo, topDockable, 1}},
+ {2654, {wxAuiPaneInfo, window, 1}},
+ {2655, {wxAuiPaneInfo, getWindow, 0}},
+ {2656, {wxAuiPaneInfo, getFrame, 0}},
+ {2657, {wxAuiPaneInfo, getDirection, 0}},
+ {2658, {wxAuiPaneInfo, getLayer, 0}},
+ {2659, {wxAuiPaneInfo, getRow, 0}},
+ {2660, {wxAuiPaneInfo, getPosition, 0}},
+ {2661, {wxAuiPaneInfo, getFloatingPosition, 0}},
+ {2662, {wxAuiPaneInfo, getFloatingSize, 0}},
+ {2663, {wxAuiNotebook, new_0, 0}},
+ {2664, {wxAuiNotebook, new_2, 2}},
+ {2665, {wxAuiNotebook, addPage, 3}},
+ {2666, {wxAuiNotebook, create, 2}},
+ {2667, {wxAuiNotebook, deletePage, 1}},
+ {2668, {wxAuiNotebook, getArtProvider, 0}},
+ {2669, {wxAuiNotebook, getPage, 1}},
+ {2670, {wxAuiNotebook, getPageBitmap, 1}},
+ {2671, {wxAuiNotebook, getPageCount, 0}},
+ {2672, {wxAuiNotebook, getPageIndex, 1}},
+ {2673, {wxAuiNotebook, getPageText, 1}},
+ {2674, {wxAuiNotebook, getSelection, 0}},
+ {2675, {wxAuiNotebook, insertPage, 4}},
+ {2676, {wxAuiNotebook, removePage, 1}},
+ {2677, {wxAuiNotebook, setArtProvider, 1}},
+ {2678, {wxAuiNotebook, setFont, 1}},
+ {2679, {wxAuiNotebook, setPageBitmap, 2}},
+ {2680, {wxAuiNotebook, setPageText, 2}},
+ {2681, {wxAuiNotebook, setSelection, 1}},
+ {2682, {wxAuiNotebook, setTabCtrlHeight, 1}},
+ {2683, {wxAuiNotebook, setUniformBitmapSize, 1}},
+ {2684, {wxAuiNotebook, 'Destroy', undefined}},
+ {2685, {wxAuiTabArt, setFlags, 1}},
+ {2686, {wxAuiTabArt, setMeasuringFont, 1}},
+ {2687, {wxAuiTabArt, setNormalFont, 1}},
+ {2688, {wxAuiTabArt, setSelectedFont, 1}},
+ {2689, {wxAuiTabArt, setColour, 1}},
+ {2690, {wxAuiTabArt, setActiveColour, 1}},
+ {2691, {wxAuiDockArt, getColour, 1}},
+ {2692, {wxAuiDockArt, getFont, 1}},
+ {2693, {wxAuiDockArt, getMetric, 1}},
+ {2694, {wxAuiDockArt, setColour, 2}},
+ {2695, {wxAuiDockArt, setFont, 2}},
+ {2696, {wxAuiDockArt, setMetric, 2}},
+ {2697, {wxAuiSimpleTabArt, new, 0}},
+ {2698, {wxAuiSimpleTabArt, 'Destroy', undefined}},
+ {2699, {wxMDIParentFrame, new_0, 0}},
+ {2700, {wxMDIParentFrame, new_4, 4}},
+ {2701, {wxMDIParentFrame, destruct, 0}},
+ {2702, {wxMDIParentFrame, activateNext, 0}},
+ {2703, {wxMDIParentFrame, activatePrevious, 0}},
+ {2704, {wxMDIParentFrame, arrangeIcons, 0}},
+ {2705, {wxMDIParentFrame, cascade, 0}},
+ {2706, {wxMDIParentFrame, create, 4}},
+ {2707, {wxMDIParentFrame, getActiveChild, 0}},
+ {2708, {wxMDIParentFrame, getClientWindow, 0}},
+ {2709, {wxMDIParentFrame, tile, 1}},
+ {2710, {wxMDIChildFrame, new_0, 0}},
+ {2711, {wxMDIChildFrame, new_4, 4}},
+ {2712, {wxMDIChildFrame, destruct, 0}},
+ {2713, {wxMDIChildFrame, activate, 0}},
+ {2714, {wxMDIChildFrame, create, 4}},
+ {2715, {wxMDIChildFrame, maximize, 1}},
+ {2716, {wxMDIChildFrame, restore, 0}},
+ {2717, {wxMDIClientWindow, new_0, 0}},
+ {2718, {wxMDIClientWindow, new_2, 2}},
+ {2719, {wxMDIClientWindow, destruct, 0}},
+ {2720, {wxMDIClientWindow, createClient, 2}},
+ {2721, {wxLayoutAlgorithm, new, 0}},
+ {2722, {wxLayoutAlgorithm, layoutFrame, 2}},
+ {2723, {wxLayoutAlgorithm, layoutMDIFrame, 2}},
+ {2724, {wxLayoutAlgorithm, layoutWindow, 2}},
+ {2725, {wxLayoutAlgorithm, 'Destroy', undefined}},
+ {2726, {wxEvent, getId, 0}},
+ {2727, {wxEvent, getSkipped, 0}},
+ {2728, {wxEvent, getTimestamp, 0}},
+ {2729, {wxEvent, isCommandEvent, 0}},
+ {2730, {wxEvent, resumePropagation, 1}},
+ {2731, {wxEvent, shouldPropagate, 0}},
+ {2732, {wxEvent, skip, 1}},
+ {2733, {wxEvent, stopPropagation, 0}},
+ {2734, {wxCommandEvent, getClientData, 0}},
+ {2735, {wxCommandEvent, getExtraLong, 0}},
+ {2736, {wxCommandEvent, getInt, 0}},
+ {2737, {wxCommandEvent, getSelection, 0}},
+ {2738, {wxCommandEvent, getString, 0}},
+ {2739, {wxCommandEvent, isChecked, 0}},
+ {2740, {wxCommandEvent, isSelection, 0}},
+ {2741, {wxCommandEvent, setInt, 1}},
+ {2742, {wxCommandEvent, setString, 1}},
+ {2743, {wxScrollEvent, getOrientation, 0}},
+ {2744, {wxScrollEvent, getPosition, 0}},
+ {2745, {wxScrollWinEvent, getOrientation, 0}},
+ {2746, {wxScrollWinEvent, getPosition, 0}},
+ {2747, {wxMouseEvent, altDown, 0}},
+ {2748, {wxMouseEvent, button, 1}},
+ {2749, {wxMouseEvent, buttonDClick, 1}},
+ {2750, {wxMouseEvent, buttonDown, 1}},
+ {2751, {wxMouseEvent, buttonUp, 1}},
+ {2752, {wxMouseEvent, cmdDown, 0}},
+ {2753, {wxMouseEvent, controlDown, 0}},
+ {2754, {wxMouseEvent, dragging, 0}},
+ {2755, {wxMouseEvent, entering, 0}},
+ {2756, {wxMouseEvent, getButton, 0}},
+ {2759, {wxMouseEvent, getPosition, 0}},
+ {2760, {wxMouseEvent, getLogicalPosition, 1}},
+ {2761, {wxMouseEvent, getLinesPerAction, 0}},
+ {2762, {wxMouseEvent, getWheelRotation, 0}},
+ {2763, {wxMouseEvent, getWheelDelta, 0}},
+ {2764, {wxMouseEvent, getX, 0}},
+ {2765, {wxMouseEvent, getY, 0}},
+ {2766, {wxMouseEvent, isButton, 0}},
+ {2767, {wxMouseEvent, isPageScroll, 0}},
+ {2768, {wxMouseEvent, leaving, 0}},
+ {2769, {wxMouseEvent, leftDClick, 0}},
+ {2770, {wxMouseEvent, leftDown, 0}},
+ {2771, {wxMouseEvent, leftIsDown, 0}},
+ {2772, {wxMouseEvent, leftUp, 0}},
+ {2773, {wxMouseEvent, metaDown, 0}},
+ {2774, {wxMouseEvent, middleDClick, 0}},
+ {2775, {wxMouseEvent, middleDown, 0}},
+ {2776, {wxMouseEvent, middleIsDown, 0}},
+ {2777, {wxMouseEvent, middleUp, 0}},
+ {2778, {wxMouseEvent, moving, 0}},
+ {2779, {wxMouseEvent, rightDClick, 0}},
+ {2780, {wxMouseEvent, rightDown, 0}},
+ {2781, {wxMouseEvent, rightIsDown, 0}},
+ {2782, {wxMouseEvent, rightUp, 0}},
+ {2783, {wxMouseEvent, shiftDown, 0}},
+ {2784, {wxSetCursorEvent, getCursor, 0}},
+ {2785, {wxSetCursorEvent, getX, 0}},
+ {2786, {wxSetCursorEvent, getY, 0}},
+ {2787, {wxSetCursorEvent, hasCursor, 0}},
+ {2788, {wxSetCursorEvent, setCursor, 1}},
+ {2789, {wxKeyEvent, altDown, 0}},
+ {2790, {wxKeyEvent, cmdDown, 0}},
+ {2791, {wxKeyEvent, controlDown, 0}},
+ {2792, {wxKeyEvent, getKeyCode, 0}},
+ {2793, {wxKeyEvent, getModifiers, 0}},
+ {2796, {wxKeyEvent, getPosition, 0}},
+ {2797, {wxKeyEvent, getRawKeyCode, 0}},
+ {2798, {wxKeyEvent, getRawKeyFlags, 0}},
+ {2799, {wxKeyEvent, getUnicodeKey, 0}},
+ {2800, {wxKeyEvent, getX, 0}},
+ {2801, {wxKeyEvent, getY, 0}},
+ {2802, {wxKeyEvent, hasModifiers, 0}},
+ {2803, {wxKeyEvent, metaDown, 0}},
+ {2804, {wxKeyEvent, shiftDown, 0}},
+ {2805, {wxSizeEvent, getSize, 0}},
+ {2806, {wxMoveEvent, getPosition, 0}},
+ {2807, {wxEraseEvent, getDC, 0}},
+ {2808, {wxFocusEvent, getWindow, 0}},
+ {2809, {wxChildFocusEvent, getWindow, 0}},
+ {2810, {wxMenuEvent, getMenu, 0}},
+ {2811, {wxMenuEvent, getMenuId, 0}},
+ {2812, {wxMenuEvent, isPopup, 0}},
+ {2813, {wxCloseEvent, canVeto, 0}},
+ {2814, {wxCloseEvent, getLoggingOff, 0}},
+ {2815, {wxCloseEvent, setCanVeto, 1}},
+ {2816, {wxCloseEvent, setLoggingOff, 1}},
+ {2817, {wxCloseEvent, veto, 1}},
+ {2818, {wxShowEvent, setShow, 1}},
+ {2819, {wxShowEvent, getShow, 0}},
+ {2820, {wxIconizeEvent, iconized, 0}},
+ {2821, {wxJoystickEvent, buttonDown, 1}},
+ {2822, {wxJoystickEvent, buttonIsDown, 1}},
+ {2823, {wxJoystickEvent, buttonUp, 1}},
+ {2824, {wxJoystickEvent, getButtonChange, 0}},
+ {2825, {wxJoystickEvent, getButtonState, 0}},
+ {2826, {wxJoystickEvent, getJoystick, 0}},
+ {2827, {wxJoystickEvent, getPosition, 0}},
+ {2828, {wxJoystickEvent, getZPosition, 0}},
+ {2829, {wxJoystickEvent, isButton, 0}},
+ {2830, {wxJoystickEvent, isMove, 0}},
+ {2831, {wxJoystickEvent, isZMove, 0}},
+ {2832, {wxUpdateUIEvent, canUpdate, 1}},
+ {2833, {wxUpdateUIEvent, check, 1}},
+ {2834, {wxUpdateUIEvent, enable, 1}},
+ {2835, {wxUpdateUIEvent, show, 1}},
+ {2836, {wxUpdateUIEvent, getChecked, 0}},
+ {2837, {wxUpdateUIEvent, getEnabled, 0}},
+ {2838, {wxUpdateUIEvent, getShown, 0}},
+ {2839, {wxUpdateUIEvent, getSetChecked, 0}},
+ {2840, {wxUpdateUIEvent, getSetEnabled, 0}},
+ {2841, {wxUpdateUIEvent, getSetShown, 0}},
+ {2842, {wxUpdateUIEvent, getSetText, 0}},
+ {2843, {wxUpdateUIEvent, getText, 0}},
+ {2844, {wxUpdateUIEvent, getMode, 0}},
+ {2845, {wxUpdateUIEvent, getUpdateInterval, 0}},
+ {2846, {wxUpdateUIEvent, resetUpdateTime, 0}},
+ {2847, {wxUpdateUIEvent, setMode, 1}},
+ {2848, {wxUpdateUIEvent, setText, 1}},
+ {2849, {wxUpdateUIEvent, setUpdateInterval, 1}},
+ {2850, {wxMouseCaptureChangedEvent, getCapturedWindow, 0}},
+ {2851, {wxPaletteChangedEvent, setChangedWindow, 1}},
+ {2852, {wxPaletteChangedEvent, getChangedWindow, 0}},
+ {2853, {wxQueryNewPaletteEvent, setPaletteRealized, 1}},
+ {2854, {wxQueryNewPaletteEvent, getPaletteRealized, 0}},
+ {2855, {wxNavigationKeyEvent, getDirection, 0}},
+ {2856, {wxNavigationKeyEvent, setDirection, 1}},
+ {2857, {wxNavigationKeyEvent, isWindowChange, 0}},
+ {2858, {wxNavigationKeyEvent, setWindowChange, 1}},
+ {2859, {wxNavigationKeyEvent, isFromTab, 0}},
+ {2860, {wxNavigationKeyEvent, setFromTab, 1}},
+ {2861, {wxNavigationKeyEvent, getCurrentFocus, 0}},
+ {2862, {wxNavigationKeyEvent, setCurrentFocus, 1}},
+ {2863, {wxHelpEvent, getOrigin, 0}},
+ {2864, {wxHelpEvent, getPosition, 0}},
+ {2865, {wxHelpEvent, setOrigin, 1}},
+ {2866, {wxHelpEvent, setPosition, 1}},
+ {2867, {wxContextMenuEvent, getPosition, 0}},
+ {2868, {wxContextMenuEvent, setPosition, 1}},
+ {2869, {wxIdleEvent, canSend, 1}},
+ {2870, {wxIdleEvent, getMode, 0}},
+ {2871, {wxIdleEvent, requestMore, 1}},
+ {2872, {wxIdleEvent, moreRequested, 0}},
+ {2873, {wxIdleEvent, setMode, 1}},
+ {2874, {wxGridEvent, altDown, 0}},
+ {2875, {wxGridEvent, controlDown, 0}},
+ {2876, {wxGridEvent, getCol, 0}},
+ {2877, {wxGridEvent, getPosition, 0}},
+ {2878, {wxGridEvent, getRow, 0}},
+ {2879, {wxGridEvent, metaDown, 0}},
+ {2880, {wxGridEvent, selecting, 0}},
+ {2881, {wxGridEvent, shiftDown, 0}},
+ {2882, {wxNotifyEvent, allow, 0}},
+ {2883, {wxNotifyEvent, isAllowed, 0}},
+ {2884, {wxNotifyEvent, veto, 0}},
+ {2885, {wxSashEvent, getEdge, 0}},
+ {2886, {wxSashEvent, getDragRect, 0}},
+ {2887, {wxSashEvent, getDragStatus, 0}},
+ {2888, {wxListEvent, getCacheFrom, 0}},
+ {2889, {wxListEvent, getCacheTo, 0}},
+ {2890, {wxListEvent, getKeyCode, 0}},
+ {2891, {wxListEvent, getIndex, 0}},
+ {2892, {wxListEvent, getColumn, 0}},
+ {2893, {wxListEvent, getPoint, 0}},
+ {2894, {wxListEvent, getLabel, 0}},
+ {2895, {wxListEvent, getText, 0}},
+ {2896, {wxListEvent, getImage, 0}},
+ {2897, {wxListEvent, getData, 0}},
+ {2898, {wxListEvent, getMask, 0}},
+ {2899, {wxListEvent, getItem, 0}},
+ {2900, {wxListEvent, isEditCancelled, 0}},
+ {2901, {wxDateEvent, getDate, 0}},
+ {2902, {wxCalendarEvent, getWeekDay, 0}},
+ {2903, {wxFileDirPickerEvent, getPath, 0}},
+ {2904, {wxColourPickerEvent, getColour, 0}},
+ {2905, {wxFontPickerEvent, getFont, 0}},
+ {2906, {wxStyledTextEvent, getPosition, 0}},
+ {2907, {wxStyledTextEvent, getKey, 0}},
+ {2908, {wxStyledTextEvent, getModifiers, 0}},
+ {2909, {wxStyledTextEvent, getModificationType, 0}},
+ {2910, {wxStyledTextEvent, getText, 0}},
+ {2911, {wxStyledTextEvent, getLength, 0}},
+ {2912, {wxStyledTextEvent, getLinesAdded, 0}},
+ {2913, {wxStyledTextEvent, getLine, 0}},
+ {2914, {wxStyledTextEvent, getFoldLevelNow, 0}},
+ {2915, {wxStyledTextEvent, getFoldLevelPrev, 0}},
+ {2916, {wxStyledTextEvent, getMargin, 0}},
+ {2917, {wxStyledTextEvent, getMessage, 0}},
+ {2918, {wxStyledTextEvent, getWParam, 0}},
+ {2919, {wxStyledTextEvent, getLParam, 0}},
+ {2920, {wxStyledTextEvent, getListType, 0}},
+ {2921, {wxStyledTextEvent, getX, 0}},
+ {2922, {wxStyledTextEvent, getY, 0}},
+ {2923, {wxStyledTextEvent, getDragText, 0}},
+ {2924, {wxStyledTextEvent, getDragAllowMove, 0}},
+ {2925, {wxStyledTextEvent, getDragResult, 0}},
+ {2926, {wxStyledTextEvent, getShift, 0}},
+ {2927, {wxStyledTextEvent, getControl, 0}},
+ {2928, {wxStyledTextEvent, getAlt, 0}},
+ {2929, {utils, getKeyState, 1}},
+ {2930, {utils, getMousePosition, 2}},
+ {2931, {utils, getMouseState, 0}},
+ {2932, {utils, setDetectableAutoRepeat, 1}},
+ {2933, {utils, bell, 0}},
+ {2934, {utils, findMenuItemId, 3}},
+ {2935, {utils, genericFindWindowAtPoint, 1}},
+ {2936, {utils, findWindowAtPoint, 1}},
+ {2937, {utils, beginBusyCursor, 1}},
+ {2938, {utils, endBusyCursor, 0}},
+ {2939, {utils, isBusy, 0}},
+ {2940, {utils, shutdown, 1}},
+ {2941, {utils, shell, 1}},
+ {2942, {utils, launchDefaultBrowser, 2}},
+ {2943, {utils, getEmailAddress, 0}},
+ {2944, {utils, getUserId, 0}},
+ {2945, {utils, getHomeDir, 0}},
+ {2946, {utils, newId, 0}},
+ {2947, {utils, registerId, 1}},
+ {2948, {utils, getCurrentId, 0}},
+ {2949, {utils, getOsDescription, 0}},
+ {2950, {utils, isPlatformLittleEndian, 0}},
+ {2951, {utils, isPlatform64Bit, 0}},
+ {2952, {gdicmn, displaySize, 2}},
+ {2953, {gdicmn, setCursor, 1}},
+ {2954, {wxPrintout, new, 1}},
+ {2955, {wxPrintout, destruct, 0}},
+ {2956, {wxPrintout, getDC, 0}},
+ {2957, {wxPrintout, getPageSizeMM, 2}},
+ {2958, {wxPrintout, getPageSizePixels, 2}},
+ {2959, {wxPrintout, getPaperRectPixels, 0}},
+ {2960, {wxPrintout, getPPIPrinter, 2}},
+ {2961, {wxPrintout, getPPIScreen, 2}},
+ {2962, {wxPrintout, getTitle, 0}},
+ {2963, {wxPrintout, isPreview, 0}},
+ {2964, {wxPrintout, fitThisSizeToPaper, 1}},
+ {2965, {wxPrintout, fitThisSizeToPage, 1}},
+ {2966, {wxPrintout, fitThisSizeToPageMargins, 2}},
+ {2967, {wxPrintout, mapScreenSizeToPaper, 0}},
+ {2968, {wxPrintout, mapScreenSizeToPage, 0}},
+ {2969, {wxPrintout, mapScreenSizeToPageMargins, 1}},
+ {2970, {wxPrintout, mapScreenSizeToDevice, 0}},
+ {2971, {wxPrintout, getLogicalPaperRect, 0}},
+ {2972, {wxPrintout, getLogicalPageRect, 0}},
+ {2973, {wxPrintout, getLogicalPageMarginsRect, 1}},
+ {2974, {wxPrintout, setLogicalOrigin, 2}},
+ {2975, {wxPrintout, offsetLogicalOrigin, 2}},
+ {2976, {wxStyledTextCtrl, new_2, 2}},
+ {2977, {wxStyledTextCtrl, new_0, 0}},
+ {2978, {wxStyledTextCtrl, destruct, 0}},
+ {2979, {wxStyledTextCtrl, create, 2}},
+ {2980, {wxStyledTextCtrl, addText, 1}},
+ {2981, {wxStyledTextCtrl, addStyledText, 1}},
+ {2982, {wxStyledTextCtrl, insertText, 2}},
+ {2983, {wxStyledTextCtrl, clearAll, 0}},
+ {2984, {wxStyledTextCtrl, clearDocumentStyle, 0}},
+ {2985, {wxStyledTextCtrl, getLength, 0}},
+ {2986, {wxStyledTextCtrl, getCharAt, 1}},
+ {2987, {wxStyledTextCtrl, getCurrentPos, 0}},
+ {2988, {wxStyledTextCtrl, getAnchor, 0}},
+ {2989, {wxStyledTextCtrl, getStyleAt, 1}},
+ {2990, {wxStyledTextCtrl, redo, 0}},
+ {2991, {wxStyledTextCtrl, setUndoCollection, 1}},
+ {2992, {wxStyledTextCtrl, selectAll, 0}},
+ {2993, {wxStyledTextCtrl, setSavePoint, 0}},
+ {2994, {wxStyledTextCtrl, getStyledText, 2}},
+ {2995, {wxStyledTextCtrl, canRedo, 0}},
+ {2996, {wxStyledTextCtrl, markerLineFromHandle, 1}},
+ {2997, {wxStyledTextCtrl, markerDeleteHandle, 1}},
+ {2998, {wxStyledTextCtrl, getUndoCollection, 0}},
+ {2999, {wxStyledTextCtrl, getViewWhiteSpace, 0}},
+ {3000, {wxStyledTextCtrl, setViewWhiteSpace, 1}},
+ {3001, {wxStyledTextCtrl, positionFromPoint, 1}},
+ {3002, {wxStyledTextCtrl, positionFromPointClose, 2}},
+ {3003, {wxStyledTextCtrl, gotoLine, 1}},
+ {3004, {wxStyledTextCtrl, gotoPos, 1}},
+ {3005, {wxStyledTextCtrl, setAnchor, 1}},
+ {3006, {wxStyledTextCtrl, getCurLine, 1}},
+ {3007, {wxStyledTextCtrl, getEndStyled, 0}},
+ {3008, {wxStyledTextCtrl, convertEOLs, 1}},
+ {3009, {wxStyledTextCtrl, getEOLMode, 0}},
+ {3010, {wxStyledTextCtrl, setEOLMode, 1}},
+ {3011, {wxStyledTextCtrl, startStyling, 2}},
+ {3012, {wxStyledTextCtrl, setStyling, 2}},
+ {3013, {wxStyledTextCtrl, getBufferedDraw, 0}},
+ {3014, {wxStyledTextCtrl, setBufferedDraw, 1}},
+ {3015, {wxStyledTextCtrl, setTabWidth, 1}},
+ {3016, {wxStyledTextCtrl, getTabWidth, 0}},
+ {3017, {wxStyledTextCtrl, setCodePage, 1}},
+ {3018, {wxStyledTextCtrl, markerDefine, 3}},
+ {3019, {wxStyledTextCtrl, markerSetForeground, 2}},
+ {3020, {wxStyledTextCtrl, markerSetBackground, 2}},
+ {3021, {wxStyledTextCtrl, markerAdd, 2}},
+ {3022, {wxStyledTextCtrl, markerDelete, 2}},
+ {3023, {wxStyledTextCtrl, markerDeleteAll, 1}},
+ {3024, {wxStyledTextCtrl, markerGet, 1}},
+ {3025, {wxStyledTextCtrl, markerNext, 2}},
+ {3026, {wxStyledTextCtrl, markerPrevious, 2}},
+ {3027, {wxStyledTextCtrl, markerDefineBitmap, 2}},
+ {3028, {wxStyledTextCtrl, markerAddSet, 2}},
+ {3029, {wxStyledTextCtrl, markerSetAlpha, 2}},
+ {3030, {wxStyledTextCtrl, setMarginType, 2}},
+ {3031, {wxStyledTextCtrl, getMarginType, 1}},
+ {3032, {wxStyledTextCtrl, setMarginWidth, 2}},
+ {3033, {wxStyledTextCtrl, getMarginWidth, 1}},
+ {3034, {wxStyledTextCtrl, setMarginMask, 2}},
+ {3035, {wxStyledTextCtrl, getMarginMask, 1}},
+ {3036, {wxStyledTextCtrl, setMarginSensitive, 2}},
+ {3037, {wxStyledTextCtrl, getMarginSensitive, 1}},
+ {3038, {wxStyledTextCtrl, styleClearAll, 0}},
+ {3039, {wxStyledTextCtrl, styleSetForeground, 2}},
+ {3040, {wxStyledTextCtrl, styleSetBackground, 2}},
+ {3041, {wxStyledTextCtrl, styleSetBold, 2}},
+ {3042, {wxStyledTextCtrl, styleSetItalic, 2}},
+ {3043, {wxStyledTextCtrl, styleSetSize, 2}},
+ {3044, {wxStyledTextCtrl, styleSetFaceName, 2}},
+ {3045, {wxStyledTextCtrl, styleSetEOLFilled, 2}},
+ {3046, {wxStyledTextCtrl, styleResetDefault, 0}},
+ {3047, {wxStyledTextCtrl, styleSetUnderline, 2}},
+ {3048, {wxStyledTextCtrl, styleSetCase, 2}},
+ {3049, {wxStyledTextCtrl, styleSetHotSpot, 2}},
+ {3050, {wxStyledTextCtrl, setSelForeground, 2}},
+ {3051, {wxStyledTextCtrl, setSelBackground, 2}},
+ {3052, {wxStyledTextCtrl, getSelAlpha, 0}},
+ {3053, {wxStyledTextCtrl, setSelAlpha, 1}},
+ {3054, {wxStyledTextCtrl, setCaretForeground, 1}},
+ {3055, {wxStyledTextCtrl, cmdKeyAssign, 3}},
+ {3056, {wxStyledTextCtrl, cmdKeyClear, 2}},
+ {3057, {wxStyledTextCtrl, cmdKeyClearAll, 0}},
+ {3058, {wxStyledTextCtrl, setStyleBytes, 2}},
+ {3059, {wxStyledTextCtrl, styleSetVisible, 2}},
+ {3060, {wxStyledTextCtrl, getCaretPeriod, 0}},
+ {3061, {wxStyledTextCtrl, setCaretPeriod, 1}},
+ {3062, {wxStyledTextCtrl, setWordChars, 1}},
+ {3063, {wxStyledTextCtrl, beginUndoAction, 0}},
+ {3064, {wxStyledTextCtrl, endUndoAction, 0}},
+ {3065, {wxStyledTextCtrl, indicatorSetStyle, 2}},
+ {3066, {wxStyledTextCtrl, indicatorGetStyle, 1}},
+ {3067, {wxStyledTextCtrl, indicatorSetForeground, 2}},
+ {3068, {wxStyledTextCtrl, indicatorGetForeground, 1}},
+ {3069, {wxStyledTextCtrl, setWhitespaceForeground, 2}},
+ {3070, {wxStyledTextCtrl, setWhitespaceBackground, 2}},
+ {3071, {wxStyledTextCtrl, getStyleBits, 0}},
+ {3072, {wxStyledTextCtrl, setLineState, 2}},
+ {3073, {wxStyledTextCtrl, getLineState, 1}},
+ {3074, {wxStyledTextCtrl, getMaxLineState, 0}},
+ {3075, {wxStyledTextCtrl, getCaretLineVisible, 0}},
+ {3076, {wxStyledTextCtrl, setCaretLineVisible, 1}},
+ {3077, {wxStyledTextCtrl, getCaretLineBackground, 0}},
+ {3078, {wxStyledTextCtrl, setCaretLineBackground, 1}},
+ {3079, {wxStyledTextCtrl, autoCompShow, 2}},
+ {3080, {wxStyledTextCtrl, autoCompCancel, 0}},
+ {3081, {wxStyledTextCtrl, autoCompActive, 0}},
+ {3082, {wxStyledTextCtrl, autoCompPosStart, 0}},
+ {3083, {wxStyledTextCtrl, autoCompComplete, 0}},
+ {3084, {wxStyledTextCtrl, autoCompStops, 1}},
+ {3085, {wxStyledTextCtrl, autoCompSetSeparator, 1}},
+ {3086, {wxStyledTextCtrl, autoCompGetSeparator, 0}},
+ {3087, {wxStyledTextCtrl, autoCompSelect, 1}},
+ {3088, {wxStyledTextCtrl, autoCompSetCancelAtStart, 1}},
+ {3089, {wxStyledTextCtrl, autoCompGetCancelAtStart, 0}},
+ {3090, {wxStyledTextCtrl, autoCompSetFillUps, 1}},
+ {3091, {wxStyledTextCtrl, autoCompSetChooseSingle, 1}},
+ {3092, {wxStyledTextCtrl, autoCompGetChooseSingle, 0}},
+ {3093, {wxStyledTextCtrl, autoCompSetIgnoreCase, 1}},
+ {3094, {wxStyledTextCtrl, autoCompGetIgnoreCase, 0}},
+ {3095, {wxStyledTextCtrl, userListShow, 2}},
+ {3096, {wxStyledTextCtrl, autoCompSetAutoHide, 1}},
+ {3097, {wxStyledTextCtrl, autoCompGetAutoHide, 0}},
+ {3098, {wxStyledTextCtrl, autoCompSetDropRestOfWord, 1}},
+ {3099, {wxStyledTextCtrl, autoCompGetDropRestOfWord, 0}},
+ {3100, {wxStyledTextCtrl, registerImage, 2}},
+ {3101, {wxStyledTextCtrl, clearRegisteredImages, 0}},
+ {3102, {wxStyledTextCtrl, autoCompGetTypeSeparator, 0}},
+ {3103, {wxStyledTextCtrl, autoCompSetTypeSeparator, 1}},
+ {3104, {wxStyledTextCtrl, autoCompSetMaxWidth, 1}},
+ {3105, {wxStyledTextCtrl, autoCompGetMaxWidth, 0}},
+ {3106, {wxStyledTextCtrl, autoCompSetMaxHeight, 1}},
+ {3107, {wxStyledTextCtrl, autoCompGetMaxHeight, 0}},
+ {3108, {wxStyledTextCtrl, setIndent, 1}},
+ {3109, {wxStyledTextCtrl, getIndent, 0}},
+ {3110, {wxStyledTextCtrl, setUseTabs, 1}},
+ {3111, {wxStyledTextCtrl, getUseTabs, 0}},
+ {3112, {wxStyledTextCtrl, setLineIndentation, 2}},
+ {3113, {wxStyledTextCtrl, getLineIndentation, 1}},
+ {3114, {wxStyledTextCtrl, getLineIndentPosition, 1}},
+ {3115, {wxStyledTextCtrl, getColumn, 1}},
+ {3116, {wxStyledTextCtrl, setUseHorizontalScrollBar, 1}},
+ {3117, {wxStyledTextCtrl, getUseHorizontalScrollBar, 0}},
+ {3118, {wxStyledTextCtrl, setIndentationGuides, 1}},
+ {3119, {wxStyledTextCtrl, getIndentationGuides, 0}},
+ {3120, {wxStyledTextCtrl, setHighlightGuide, 1}},
+ {3121, {wxStyledTextCtrl, getHighlightGuide, 0}},
+ {3122, {wxStyledTextCtrl, getLineEndPosition, 1}},
+ {3123, {wxStyledTextCtrl, getCodePage, 0}},
+ {3124, {wxStyledTextCtrl, getCaretForeground, 0}},
+ {3125, {wxStyledTextCtrl, getReadOnly, 0}},
+ {3126, {wxStyledTextCtrl, setCurrentPos, 1}},
+ {3127, {wxStyledTextCtrl, setSelectionStart, 1}},
+ {3128, {wxStyledTextCtrl, getSelectionStart, 0}},
+ {3129, {wxStyledTextCtrl, setSelectionEnd, 1}},
+ {3130, {wxStyledTextCtrl, getSelectionEnd, 0}},
+ {3131, {wxStyledTextCtrl, setPrintMagnification, 1}},
+ {3132, {wxStyledTextCtrl, getPrintMagnification, 0}},
+ {3133, {wxStyledTextCtrl, setPrintColourMode, 1}},
+ {3134, {wxStyledTextCtrl, getPrintColourMode, 0}},
+ {3135, {wxStyledTextCtrl, findText, 4}},
+ {3136, {wxStyledTextCtrl, formatRange, 7}},
+ {3137, {wxStyledTextCtrl, getFirstVisibleLine, 0}},
+ {3138, {wxStyledTextCtrl, getLine, 1}},
+ {3139, {wxStyledTextCtrl, getLineCount, 0}},
+ {3140, {wxStyledTextCtrl, setMarginLeft, 1}},
+ {3141, {wxStyledTextCtrl, getMarginLeft, 0}},
+ {3142, {wxStyledTextCtrl, setMarginRight, 1}},
+ {3143, {wxStyledTextCtrl, getMarginRight, 0}},
+ {3144, {wxStyledTextCtrl, getModify, 0}},
+ {3145, {wxStyledTextCtrl, setSelection, 2}},
+ {3146, {wxStyledTextCtrl, getSelectedText, 0}},
+ {3147, {wxStyledTextCtrl, getTextRange, 2}},
+ {3148, {wxStyledTextCtrl, hideSelection, 1}},
+ {3149, {wxStyledTextCtrl, lineFromPosition, 1}},
+ {3150, {wxStyledTextCtrl, positionFromLine, 1}},
+ {3151, {wxStyledTextCtrl, lineScroll, 2}},
+ {3152, {wxStyledTextCtrl, ensureCaretVisible, 0}},
+ {3153, {wxStyledTextCtrl, replaceSelection, 1}},
+ {3154, {wxStyledTextCtrl, setReadOnly, 1}},
+ {3155, {wxStyledTextCtrl, canPaste, 0}},
+ {3156, {wxStyledTextCtrl, canUndo, 0}},
+ {3157, {wxStyledTextCtrl, emptyUndoBuffer, 0}},
+ {3158, {wxStyledTextCtrl, undo, 0}},
+ {3159, {wxStyledTextCtrl, cut, 0}},
+ {3160, {wxStyledTextCtrl, copy, 0}},
+ {3161, {wxStyledTextCtrl, paste, 0}},
+ {3162, {wxStyledTextCtrl, clear, 0}},
+ {3163, {wxStyledTextCtrl, setText, 1}},
+ {3164, {wxStyledTextCtrl, getText, 0}},
+ {3165, {wxStyledTextCtrl, getTextLength, 0}},
+ {3166, {wxStyledTextCtrl, getOvertype, 0}},
+ {3167, {wxStyledTextCtrl, setCaretWidth, 1}},
+ {3168, {wxStyledTextCtrl, getCaretWidth, 0}},
+ {3169, {wxStyledTextCtrl, setTargetStart, 1}},
+ {3170, {wxStyledTextCtrl, getTargetStart, 0}},
+ {3171, {wxStyledTextCtrl, setTargetEnd, 1}},
+ {3172, {wxStyledTextCtrl, getTargetEnd, 0}},
+ {3173, {wxStyledTextCtrl, replaceTarget, 1}},
+ {3174, {wxStyledTextCtrl, searchInTarget, 1}},
+ {3175, {wxStyledTextCtrl, setSearchFlags, 1}},
+ {3176, {wxStyledTextCtrl, getSearchFlags, 0}},
+ {3177, {wxStyledTextCtrl, callTipShow, 2}},
+ {3178, {wxStyledTextCtrl, callTipCancel, 0}},
+ {3179, {wxStyledTextCtrl, callTipActive, 0}},
+ {3180, {wxStyledTextCtrl, callTipPosAtStart, 0}},
+ {3181, {wxStyledTextCtrl, callTipSetHighlight, 2}},
+ {3182, {wxStyledTextCtrl, callTipSetBackground, 1}},
+ {3183, {wxStyledTextCtrl, callTipSetForeground, 1}},
+ {3184, {wxStyledTextCtrl, callTipSetForegroundHighlight, 1}},
+ {3185, {wxStyledTextCtrl, callTipUseStyle, 1}},
+ {3186, {wxStyledTextCtrl, visibleFromDocLine, 1}},
+ {3187, {wxStyledTextCtrl, docLineFromVisible, 1}},
+ {3188, {wxStyledTextCtrl, wrapCount, 1}},
+ {3189, {wxStyledTextCtrl, setFoldLevel, 2}},
+ {3190, {wxStyledTextCtrl, getFoldLevel, 1}},
+ {3191, {wxStyledTextCtrl, getLastChild, 2}},
+ {3192, {wxStyledTextCtrl, getFoldParent, 1}},
+ {3193, {wxStyledTextCtrl, showLines, 2}},
+ {3194, {wxStyledTextCtrl, hideLines, 2}},
+ {3195, {wxStyledTextCtrl, getLineVisible, 1}},
+ {3196, {wxStyledTextCtrl, setFoldExpanded, 2}},
+ {3197, {wxStyledTextCtrl, getFoldExpanded, 1}},
+ {3198, {wxStyledTextCtrl, toggleFold, 1}},
+ {3199, {wxStyledTextCtrl, ensureVisible, 1}},
+ {3200, {wxStyledTextCtrl, setFoldFlags, 1}},
+ {3201, {wxStyledTextCtrl, ensureVisibleEnforcePolicy, 1}},
+ {3202, {wxStyledTextCtrl, setTabIndents, 1}},
+ {3203, {wxStyledTextCtrl, getTabIndents, 0}},
+ {3204, {wxStyledTextCtrl, setBackSpaceUnIndents, 1}},
+ {3205, {wxStyledTextCtrl, getBackSpaceUnIndents, 0}},
+ {3206, {wxStyledTextCtrl, setMouseDwellTime, 1}},
+ {3207, {wxStyledTextCtrl, getMouseDwellTime, 0}},
+ {3208, {wxStyledTextCtrl, wordStartPosition, 2}},
+ {3209, {wxStyledTextCtrl, wordEndPosition, 2}},
+ {3210, {wxStyledTextCtrl, setWrapMode, 1}},
+ {3211, {wxStyledTextCtrl, getWrapMode, 0}},
+ {3212, {wxStyledTextCtrl, setWrapVisualFlags, 1}},
+ {3213, {wxStyledTextCtrl, getWrapVisualFlags, 0}},
+ {3214, {wxStyledTextCtrl, setWrapVisualFlagsLocation, 1}},
+ {3215, {wxStyledTextCtrl, getWrapVisualFlagsLocation, 0}},
+ {3216, {wxStyledTextCtrl, setWrapStartIndent, 1}},
+ {3217, {wxStyledTextCtrl, getWrapStartIndent, 0}},
+ {3218, {wxStyledTextCtrl, setLayoutCache, 1}},
+ {3219, {wxStyledTextCtrl, getLayoutCache, 0}},
+ {3220, {wxStyledTextCtrl, setScrollWidth, 1}},
+ {3221, {wxStyledTextCtrl, getScrollWidth, 0}},
+ {3222, {wxStyledTextCtrl, textWidth, 2}},
+ {3223, {wxStyledTextCtrl, getEndAtLastLine, 0}},
+ {3224, {wxStyledTextCtrl, textHeight, 1}},
+ {3225, {wxStyledTextCtrl, setUseVerticalScrollBar, 1}},
+ {3226, {wxStyledTextCtrl, getUseVerticalScrollBar, 0}},
+ {3227, {wxStyledTextCtrl, appendText, 1}},
+ {3228, {wxStyledTextCtrl, getTwoPhaseDraw, 0}},
+ {3229, {wxStyledTextCtrl, setTwoPhaseDraw, 1}},
+ {3230, {wxStyledTextCtrl, targetFromSelection, 0}},
+ {3231, {wxStyledTextCtrl, linesJoin, 0}},
+ {3232, {wxStyledTextCtrl, linesSplit, 1}},
+ {3233, {wxStyledTextCtrl, setFoldMarginColour, 2}},
+ {3234, {wxStyledTextCtrl, setFoldMarginHiColour, 2}},
+ {3235, {wxStyledTextCtrl, lineDown, 0}},
+ {3236, {wxStyledTextCtrl, lineDownExtend, 0}},
+ {3237, {wxStyledTextCtrl, lineUp, 0}},
+ {3238, {wxStyledTextCtrl, lineUpExtend, 0}},
+ {3239, {wxStyledTextCtrl, charLeft, 0}},
+ {3240, {wxStyledTextCtrl, charLeftExtend, 0}},
+ {3241, {wxStyledTextCtrl, charRight, 0}},
+ {3242, {wxStyledTextCtrl, charRightExtend, 0}},
+ {3243, {wxStyledTextCtrl, wordLeft, 0}},
+ {3244, {wxStyledTextCtrl, wordLeftExtend, 0}},
+ {3245, {wxStyledTextCtrl, wordRight, 0}},
+ {3246, {wxStyledTextCtrl, wordRightExtend, 0}},
+ {3247, {wxStyledTextCtrl, home, 0}},
+ {3248, {wxStyledTextCtrl, homeExtend, 0}},
+ {3249, {wxStyledTextCtrl, lineEnd, 0}},
+ {3250, {wxStyledTextCtrl, lineEndExtend, 0}},
+ {3251, {wxStyledTextCtrl, documentStart, 0}},
+ {3252, {wxStyledTextCtrl, documentStartExtend, 0}},
+ {3253, {wxStyledTextCtrl, documentEnd, 0}},
+ {3254, {wxStyledTextCtrl, documentEndExtend, 0}},
+ {3255, {wxStyledTextCtrl, pageUp, 0}},
+ {3256, {wxStyledTextCtrl, pageUpExtend, 0}},
+ {3257, {wxStyledTextCtrl, pageDown, 0}},
+ {3258, {wxStyledTextCtrl, pageDownExtend, 0}},
+ {3259, {wxStyledTextCtrl, editToggleOvertype, 0}},
+ {3260, {wxStyledTextCtrl, cancel, 0}},
+ {3261, {wxStyledTextCtrl, deleteBack, 0}},
+ {3262, {wxStyledTextCtrl, tab, 0}},
+ {3263, {wxStyledTextCtrl, backTab, 0}},
+ {3264, {wxStyledTextCtrl, newLine, 0}},
+ {3265, {wxStyledTextCtrl, formFeed, 0}},
+ {3266, {wxStyledTextCtrl, vCHome, 0}},
+ {3267, {wxStyledTextCtrl, vCHomeExtend, 0}},
+ {3268, {wxStyledTextCtrl, zoomIn, 0}},
+ {3269, {wxStyledTextCtrl, zoomOut, 0}},
+ {3270, {wxStyledTextCtrl, delWordLeft, 0}},
+ {3271, {wxStyledTextCtrl, delWordRight, 0}},
+ {3272, {wxStyledTextCtrl, lineCut, 0}},
+ {3273, {wxStyledTextCtrl, lineDelete, 0}},
+ {3274, {wxStyledTextCtrl, lineTranspose, 0}},
+ {3275, {wxStyledTextCtrl, lineDuplicate, 0}},
+ {3276, {wxStyledTextCtrl, lowerCase, 0}},
+ {3277, {wxStyledTextCtrl, upperCase, 0}},
+ {3278, {wxStyledTextCtrl, lineScrollDown, 0}},
+ {3279, {wxStyledTextCtrl, lineScrollUp, 0}},
+ {3280, {wxStyledTextCtrl, deleteBackNotLine, 0}},
+ {3281, {wxStyledTextCtrl, homeDisplay, 0}},
+ {3282, {wxStyledTextCtrl, homeDisplayExtend, 0}},
+ {3283, {wxStyledTextCtrl, lineEndDisplay, 0}},
+ {3284, {wxStyledTextCtrl, lineEndDisplayExtend, 0}},
+ {3285, {wxStyledTextCtrl, homeWrapExtend, 0}},
+ {3286, {wxStyledTextCtrl, lineEndWrap, 0}},
+ {3287, {wxStyledTextCtrl, lineEndWrapExtend, 0}},
+ {3288, {wxStyledTextCtrl, vCHomeWrap, 0}},
+ {3289, {wxStyledTextCtrl, vCHomeWrapExtend, 0}},
+ {3290, {wxStyledTextCtrl, lineCopy, 0}},
+ {3291, {wxStyledTextCtrl, moveCaretInsideView, 0}},
+ {3292, {wxStyledTextCtrl, lineLength, 1}},
+ {3293, {wxStyledTextCtrl, braceHighlight, 2}},
+ {3294, {wxStyledTextCtrl, braceBadLight, 1}},
+ {3295, {wxStyledTextCtrl, braceMatch, 1}},
+ {3296, {wxStyledTextCtrl, getViewEOL, 0}},
+ {3297, {wxStyledTextCtrl, setViewEOL, 1}},
+ {3298, {wxStyledTextCtrl, setModEventMask, 1}},
+ {3299, {wxStyledTextCtrl, getEdgeColumn, 0}},
+ {3300, {wxStyledTextCtrl, setEdgeColumn, 1}},
+ {3301, {wxStyledTextCtrl, setEdgeMode, 1}},
+ {3302, {wxStyledTextCtrl, getEdgeMode, 0}},
+ {3303, {wxStyledTextCtrl, getEdgeColour, 0}},
+ {3304, {wxStyledTextCtrl, setEdgeColour, 1}},
+ {3305, {wxStyledTextCtrl, searchAnchor, 0}},
+ {3306, {wxStyledTextCtrl, searchNext, 2}},
+ {3307, {wxStyledTextCtrl, searchPrev, 2}},
+ {3308, {wxStyledTextCtrl, linesOnScreen, 0}},
+ {3309, {wxStyledTextCtrl, usePopUp, 1}},
+ {3310, {wxStyledTextCtrl, selectionIsRectangle, 0}},
+ {3311, {wxStyledTextCtrl, setZoom, 1}},
+ {3312, {wxStyledTextCtrl, getZoom, 0}},
+ {3313, {wxStyledTextCtrl, getModEventMask, 0}},
+ {3314, {wxStyledTextCtrl, setSTCFocus, 1}},
+ {3315, {wxStyledTextCtrl, getSTCFocus, 0}},
+ {3316, {wxStyledTextCtrl, setStatus, 1}},
+ {3317, {wxStyledTextCtrl, getStatus, 0}},
+ {3318, {wxStyledTextCtrl, setMouseDownCaptures, 1}},
+ {3319, {wxStyledTextCtrl, getMouseDownCaptures, 0}},
+ {3320, {wxStyledTextCtrl, setSTCCursor, 1}},
+ {3321, {wxStyledTextCtrl, getSTCCursor, 0}},
+ {3322, {wxStyledTextCtrl, setControlCharSymbol, 1}},
+ {3323, {wxStyledTextCtrl, getControlCharSymbol, 0}},
+ {3324, {wxStyledTextCtrl, wordPartLeft, 0}},
+ {3325, {wxStyledTextCtrl, wordPartLeftExtend, 0}},
+ {3326, {wxStyledTextCtrl, wordPartRight, 0}},
+ {3327, {wxStyledTextCtrl, wordPartRightExtend, 0}},
+ {3328, {wxStyledTextCtrl, setVisiblePolicy, 2}},
+ {3329, {wxStyledTextCtrl, delLineLeft, 0}},
+ {3330, {wxStyledTextCtrl, delLineRight, 0}},
+ {3331, {wxStyledTextCtrl, getXOffset, 0}},
+ {3332, {wxStyledTextCtrl, chooseCaretX, 0}},
+ {3333, {wxStyledTextCtrl, setXCaretPolicy, 2}},
+ {3334, {wxStyledTextCtrl, setYCaretPolicy, 2}},
+ {3335, {wxStyledTextCtrl, getPrintWrapMode, 0}},
+ {3336, {wxStyledTextCtrl, setHotspotActiveForeground, 2}},
+ {3337, {wxStyledTextCtrl, setHotspotActiveBackground, 2}},
+ {3338, {wxStyledTextCtrl, setHotspotActiveUnderline, 1}},
+ {3339, {wxStyledTextCtrl, setHotspotSingleLine, 1}},
+ {3340, {wxStyledTextCtrl, paraDownExtend, 0}},
+ {3341, {wxStyledTextCtrl, paraUp, 0}},
+ {3342, {wxStyledTextCtrl, paraUpExtend, 0}},
+ {3343, {wxStyledTextCtrl, positionBefore, 1}},
+ {3344, {wxStyledTextCtrl, positionAfter, 1}},
+ {3345, {wxStyledTextCtrl, copyRange, 2}},
+ {3346, {wxStyledTextCtrl, copyText, 2}},
+ {3347, {wxStyledTextCtrl, setSelectionMode, 1}},
+ {3348, {wxStyledTextCtrl, getSelectionMode, 0}},
+ {3349, {wxStyledTextCtrl, lineDownRectExtend, 0}},
+ {3350, {wxStyledTextCtrl, lineUpRectExtend, 0}},
+ {3351, {wxStyledTextCtrl, charLeftRectExtend, 0}},
+ {3352, {wxStyledTextCtrl, charRightRectExtend, 0}},
+ {3353, {wxStyledTextCtrl, homeRectExtend, 0}},
+ {3354, {wxStyledTextCtrl, vCHomeRectExtend, 0}},
+ {3355, {wxStyledTextCtrl, lineEndRectExtend, 0}},
+ {3356, {wxStyledTextCtrl, pageUpRectExtend, 0}},
+ {3357, {wxStyledTextCtrl, pageDownRectExtend, 0}},
+ {3358, {wxStyledTextCtrl, stutteredPageUp, 0}},
+ {3359, {wxStyledTextCtrl, stutteredPageUpExtend, 0}},
+ {3360, {wxStyledTextCtrl, stutteredPageDown, 0}},
+ {3361, {wxStyledTextCtrl, stutteredPageDownExtend, 0}},
+ {3362, {wxStyledTextCtrl, wordLeftEnd, 0}},
+ {3363, {wxStyledTextCtrl, wordLeftEndExtend, 0}},
+ {3364, {wxStyledTextCtrl, wordRightEnd, 0}},
+ {3365, {wxStyledTextCtrl, wordRightEndExtend, 0}},
+ {3366, {wxStyledTextCtrl, setWhitespaceChars, 1}},
+ {3367, {wxStyledTextCtrl, setCharsDefault, 0}},
+ {3368, {wxStyledTextCtrl, autoCompGetCurrent, 0}},
+ {3369, {wxStyledTextCtrl, allocate, 1}},
+ {3370, {wxStyledTextCtrl, findColumn, 2}},
+ {3371, {wxStyledTextCtrl, getCaretSticky, 0}},
+ {3372, {wxStyledTextCtrl, setCaretSticky, 1}},
+ {3373, {wxStyledTextCtrl, toggleCaretSticky, 0}},
+ {3374, {wxStyledTextCtrl, setPasteConvertEndings, 1}},
+ {3375, {wxStyledTextCtrl, getPasteConvertEndings, 0}},
+ {3376, {wxStyledTextCtrl, selectionDuplicate, 0}},
+ {3377, {wxStyledTextCtrl, setCaretLineBackAlpha, 1}},
+ {3378, {wxStyledTextCtrl, getCaretLineBackAlpha, 0}},
+ {3379, {wxStyledTextCtrl, startRecord, 0}},
+ {3380, {wxStyledTextCtrl, stopRecord, 0}},
+ {3381, {wxStyledTextCtrl, setLexer, 1}},
+ {3382, {wxStyledTextCtrl, getLexer, 0}},
+ {3383, {wxStyledTextCtrl, colourise, 2}},
+ {3384, {wxStyledTextCtrl, setProperty, 2}},
+ {3385, {wxStyledTextCtrl, setKeyWords, 2}},
+ {3386, {wxStyledTextCtrl, setLexerLanguage, 1}},
+ {3387, {wxStyledTextCtrl, getProperty, 1}},
+ {3388, {wxStyledTextCtrl, getStyleBitsNeeded, 0}},
+ {3389, {wxStyledTextCtrl, getCurrentLine, 0}},
+ {3390, {wxStyledTextCtrl, styleSetSpec, 2}},
+ {3391, {wxStyledTextCtrl, styleSetFont, 2}},
+ {3392, {wxStyledTextCtrl, styleSetFontAttr, 7}},
+ {3393, {wxStyledTextCtrl, styleSetCharacterSet, 2}},
+ {3394, {wxStyledTextCtrl, styleSetFontEncoding, 2}},
+ {3395, {wxStyledTextCtrl, cmdKeyExecute, 1}},
+ {3396, {wxStyledTextCtrl, setMargins, 2}},
+ {3397, {wxStyledTextCtrl, getSelection, 2}},
+ {3398, {wxStyledTextCtrl, pointFromPosition, 1}},
+ {3399, {wxStyledTextCtrl, scrollToLine, 1}},
+ {3400, {wxStyledTextCtrl, scrollToColumn, 1}},
+ {3401, {wxStyledTextCtrl, setVScrollBar, 1}},
+ {3402, {wxStyledTextCtrl, setHScrollBar, 1}},
+ {3403, {wxStyledTextCtrl, getLastKeydownProcessed, 0}},
+ {3404, {wxStyledTextCtrl, setLastKeydownProcessed, 1}},
+ {3405, {wxStyledTextCtrl, saveFile, 1}},
+ {3406, {wxStyledTextCtrl, loadFile, 1}},
+ {3407, {wxStyledTextCtrl, doDragOver, 3}},
+ {3408, {wxStyledTextCtrl, doDropText, 3}},
+ {3409, {wxStyledTextCtrl, getUseAntiAliasing, 0}},
+ {3410, {wxStyledTextCtrl, addTextRaw, 1}},
+ {3411, {wxStyledTextCtrl, insertTextRaw, 2}},
+ {3412, {wxStyledTextCtrl, getCurLineRaw, 1}},
+ {3413, {wxStyledTextCtrl, getLineRaw, 1}},
+ {3414, {wxStyledTextCtrl, getSelectedTextRaw, 0}},
+ {3415, {wxStyledTextCtrl, getTextRangeRaw, 2}},
+ {3416, {wxStyledTextCtrl, setTextRaw, 1}},
+ {3417, {wxStyledTextCtrl, getTextRaw, 0}},
+ {3418, {wxStyledTextCtrl, appendTextRaw, 1}},
+ {3419, {wxArtProvider, getBitmap, 2}},
+ {3420, {wxArtProvider, getIcon, 2}},
+ {3421, {wxTreeEvent, getKeyCode, 0}},
+ {3422, {wxTreeEvent, getItem, 0}},
+ {3423, {wxTreeEvent, getKeyEvent, 0}},
+ {3424, {wxTreeEvent, getLabel, 0}},
+ {3425, {wxTreeEvent, getOldItem, 0}},
+ {3426, {wxTreeEvent, getPoint, 0}},
+ {3427, {wxTreeEvent, isEditCancelled, 0}},
+ {3428, {wxTreeEvent, setToolTip, 1}},
+ {3429, {wxNotebookEvent, getOldSelection, 0}},
+ {3430, {wxNotebookEvent, getSelection, 0}},
+ {3431, {wxNotebookEvent, setOldSelection, 1}},
+ {3432, {wxNotebookEvent, setSelection, 1}},
+ {3433, {wxFileDataObject, new, 0}},
+ {3434, {wxFileDataObject, addFile, 1}},
+ {3435, {wxFileDataObject, getFilenames, 0}},
+ {3436, {wxFileDataObject, 'Destroy', undefined}},
+ {3437, {wxTextDataObject, new, 1}},
+ {3438, {wxTextDataObject, getTextLength, 0}},
+ {3439, {wxTextDataObject, getText, 0}},
+ {3440, {wxTextDataObject, setText, 1}},
+ {3441, {wxTextDataObject, 'Destroy', undefined}},
+ {3442, {wxBitmapDataObject, new_1_1, 1}},
+ {3443, {wxBitmapDataObject, new_1_0, 1}},
+ {3444, {wxBitmapDataObject, getBitmap, 0}},
+ {3445, {wxBitmapDataObject, setBitmap, 1}},
+ {3446, {wxBitmapDataObject, 'Destroy', undefined}},
+ {3448, {wxClipboard, new, 0}},
+ {3449, {wxClipboard, destruct, 0}},
+ {3450, {wxClipboard, addData, 1}},
+ {3451, {wxClipboard, clear, 0}},
+ {3452, {wxClipboard, close, 0}},
+ {3453, {wxClipboard, flush, 0}},
+ {3454, {wxClipboard, getData, 1}},
+ {3455, {wxClipboard, isOpened, 0}},
+ {3456, {wxClipboard, open, 0}},
+ {3457, {wxClipboard, setData, 1}},
+ {3459, {wxClipboard, usePrimarySelection, 1}},
+ {3460, {wxClipboard, isSupported, 1}},
+ {3461, {wxClipboard, get, 0}},
+ {3462, {wxSpinEvent, getPosition, 0}},
+ {3463, {wxSpinEvent, setPosition, 1}},
+ {3464, {wxSplitterWindow, new_0, 0}},
+ {3465, {wxSplitterWindow, new_2, 2}},
+ {3466, {wxSplitterWindow, destruct, 0}},
+ {3467, {wxSplitterWindow, create, 2}},
+ {3468, {wxSplitterWindow, getMinimumPaneSize, 0}},
+ {3469, {wxSplitterWindow, getSashGravity, 0}},
+ {3470, {wxSplitterWindow, getSashPosition, 0}},
+ {3471, {wxSplitterWindow, getSplitMode, 0}},
+ {3472, {wxSplitterWindow, getWindow1, 0}},
+ {3473, {wxSplitterWindow, getWindow2, 0}},
+ {3474, {wxSplitterWindow, initialize, 1}},
+ {3475, {wxSplitterWindow, isSplit, 0}},
+ {3476, {wxSplitterWindow, replaceWindow, 2}},
+ {3477, {wxSplitterWindow, setSashGravity, 1}},
+ {3478, {wxSplitterWindow, setSashPosition, 2}},
+ {3479, {wxSplitterWindow, setSashSize, 1}},
+ {3480, {wxSplitterWindow, setMinimumPaneSize, 1}},
+ {3481, {wxSplitterWindow, setSplitMode, 1}},
+ {3482, {wxSplitterWindow, splitHorizontally, 3}},
+ {3483, {wxSplitterWindow, splitVertically, 3}},
+ {3484, {wxSplitterWindow, unsplit, 1}},
+ {3485, {wxSplitterWindow, updateSize, 0}},
+ {3486, {wxSplitterEvent, getSashPosition, 0}},
+ {3487, {wxSplitterEvent, getX, 0}},
+ {3488, {wxSplitterEvent, getY, 0}},
+ {3489, {wxSplitterEvent, getWindowBeingRemoved, 0}},
+ {3490, {wxSplitterEvent, setSashPosition, 1}},
+ {3491, {wxHtmlWindow, new_0, 0}},
+ {3492, {wxHtmlWindow, new_2, 2}},
+ {3493, {wxHtmlWindow, appendToPage, 1}},
+ {3494, {wxHtmlWindow, getOpenedAnchor, 0}},
+ {3495, {wxHtmlWindow, getOpenedPage, 0}},
+ {3496, {wxHtmlWindow, getOpenedPageTitle, 0}},
+ {3497, {wxHtmlWindow, getRelatedFrame, 0}},
+ {3498, {wxHtmlWindow, historyBack, 0}},
+ {3499, {wxHtmlWindow, historyCanBack, 0}},
+ {3500, {wxHtmlWindow, historyCanForward, 0}},
+ {3501, {wxHtmlWindow, historyClear, 0}},
+ {3502, {wxHtmlWindow, historyForward, 0}},
+ {3503, {wxHtmlWindow, loadFile, 1}},
+ {3504, {wxHtmlWindow, loadPage, 1}},
+ {3505, {wxHtmlWindow, selectAll, 0}},
+ {3506, {wxHtmlWindow, selectionToText, 0}},
+ {3507, {wxHtmlWindow, selectLine, 1}},
+ {3508, {wxHtmlWindow, selectWord, 1}},
+ {3509, {wxHtmlWindow, setBorders, 1}},
+ {3510, {wxHtmlWindow, setFonts, 3}},
+ {3511, {wxHtmlWindow, setPage, 1}},
+ {3512, {wxHtmlWindow, setRelatedFrame, 2}},
+ {3513, {wxHtmlWindow, setRelatedStatusBar, 1}},
+ {3514, {wxHtmlWindow, toText, 0}},
+ {3515, {wxHtmlWindow, 'Destroy', undefined}},
+ {3516, {wxHtmlLinkEvent, getLinkInfo, 0}},
+ {3517, {wxSystemSettings, getColour, 1}},
+ {3518, {wxSystemSettings, getFont, 1}},
+ {3519, {wxSystemSettings, getMetric, 2}},
+ {3520, {wxSystemSettings, getScreenType, 0}},
+ {3521, {wxSystemOptions, getOption, 1}},
+ {3522, {wxSystemOptions, getOptionInt, 1}},
+ {3523, {wxSystemOptions, hasOption, 1}},
+ {3524, {wxSystemOptions, isFalse, 1}},
+ {3525, {wxSystemOptions, setOption_2_1, 2}},
+ {3526, {wxSystemOptions, setOption_2_0, 2}},
+ {3527, {wxAuiNotebookEvent, setSelection, 1}},
+ {3528, {wxAuiNotebookEvent, getSelection, 0}},
+ {3529, {wxAuiNotebookEvent, setOldSelection, 1}},
+ {3530, {wxAuiNotebookEvent, getOldSelection, 0}},
+ {3531, {wxAuiNotebookEvent, setDragSource, 1}},
+ {3532, {wxAuiNotebookEvent, getDragSource, 0}},
+ {3533, {wxAuiManagerEvent, setManager, 1}},
+ {3534, {wxAuiManagerEvent, getManager, 0}},
+ {3535, {wxAuiManagerEvent, setPane, 1}},
+ {3536, {wxAuiManagerEvent, getPane, 0}},
+ {3537, {wxAuiManagerEvent, setButton, 1}},
+ {3538, {wxAuiManagerEvent, getButton, 0}},
+ {3539, {wxAuiManagerEvent, setDC, 1}},
+ {3540, {wxAuiManagerEvent, getDC, 0}},
+ {3541, {wxAuiManagerEvent, veto, 1}},
+ {3542, {wxAuiManagerEvent, getVeto, 0}},
+ {3543, {wxAuiManagerEvent, setCanVeto, 1}},
+ {3544, {wxAuiManagerEvent, canVeto, 0}},
+ {3545, {wxLogNull, new, 0}},
+ {3546, {wxLogNull, 'Destroy', undefined}},
+ {3547, {wxTaskBarIcon, new, 0}},
+ {3548, {wxTaskBarIcon, destruct, 0}},
+ {3549, {wxTaskBarIcon, popupMenu, 1}},
+ {3550, {wxTaskBarIcon, removeIcon, 0}},
+ {3551, {wxTaskBarIcon, setIcon, 2}},
+ {3552, {wxLocale, new_0, 0}},
+ {3554, {wxLocale, new_2, 2}},
+ {3555, {wxLocale, destruct, 0}},
+ {3557, {wxLocale, init, 1}},
+ {3558, {wxLocale, addCatalog_1, 1}},
+ {3559, {wxLocale, addCatalog_3, 3}},
+ {3560, {wxLocale, addCatalogLookupPathPrefix, 1}},
+ {3561, {wxLocale, getCanonicalName, 0}},
+ {3562, {wxLocale, getLanguage, 0}},
+ {3563, {wxLocale, getLanguageName, 1}},
+ {3564, {wxLocale, getLocale, 0}},
+ {3565, {wxLocale, getName, 0}},
+ {3566, {wxLocale, getString_2, 2}},
+ {3567, {wxLocale, getString_4, 4}},
+ {3568, {wxLocale, getHeaderValue, 2}},
+ {3569, {wxLocale, getSysName, 0}},
+ {3570, {wxLocale, getSystemEncoding, 0}},
+ {3571, {wxLocale, getSystemEncodingName, 0}},
+ {3572, {wxLocale, getSystemLanguage, 0}},
+ {3573, {wxLocale, isLoaded, 1}},
+ {3574, {wxLocale, isOk, 0}},
+ {3575, {wxActivateEvent, getActive, 0}},
+ {3577, {wxPopupWindow, new_2, 2}},
+ {3578, {wxPopupWindow, new_0, 0}},
+ {3580, {wxPopupWindow, destruct, 0}},
+ {3581, {wxPopupWindow, create, 2}},
+ {3582, {wxPopupWindow, position, 2}},
+ {3583, {wxPopupTransientWindow, new_0, 0}},
+ {3584, {wxPopupTransientWindow, new_2, 2}},
+ {3585, {wxPopupTransientWindow, destruct, 0}},
+ {3586, {wxPopupTransientWindow, popup, 1}},
+ {3587, {wxPopupTransientWindow, dismiss, 0}},
+ {3588, {wxOverlay, new, 0}},
+ {3589, {wxOverlay, destruct, 0}},
+ {3590, {wxOverlay, reset, 0}},
+ {3591, {wxDCOverlay, new_6, 6}},
+ {3592, {wxDCOverlay, new_2, 2}},
+ {3593, {wxDCOverlay, destruct, 0}},
+ {3594, {wxDCOverlay, clear, 0}},
{-1, {mod, func, -1}}
].
diff --git a/lib/wx/src/gen/wxe_funcs.hrl b/lib/wx/src/gen/wxe_funcs.hrl
index f5f839ac67..84fa592aaa 100644
--- a/lib/wx/src/gen/wxe_funcs.hrl
+++ b/lib/wx/src/gen/wxe_funcs.hrl
@@ -1454,1922 +1454,1918 @@
-define(wxGauge_new_0, 1602).
-define(wxGauge_new_4, 1603).
-define(wxGauge_Create, 1604).
--define(wxGauge_GetBezelFace, 1605).
--define(wxGauge_GetRange, 1606).
--define(wxGauge_GetShadowWidth, 1607).
--define(wxGauge_GetValue, 1608).
--define(wxGauge_IsVertical, 1609).
--define(wxGauge_SetBezelFace, 1610).
--define(wxGauge_SetRange, 1611).
--define(wxGauge_SetShadowWidth, 1612).
--define(wxGauge_SetValue, 1613).
--define(wxGauge_Pulse, 1614).
--define(wxGauge_destroy, 1615).
--define(wxGenericDirCtrl_new_0, 1616).
--define(wxGenericDirCtrl_new_2, 1617).
--define(wxGenericDirCtrl_destruct, 1618).
--define(wxGenericDirCtrl_Create, 1619).
--define(wxGenericDirCtrl_Init, 1620).
--define(wxGenericDirCtrl_CollapseTree, 1621).
--define(wxGenericDirCtrl_ExpandPath, 1622).
--define(wxGenericDirCtrl_GetDefaultPath, 1623).
--define(wxGenericDirCtrl_GetPath, 1624).
--define(wxGenericDirCtrl_GetFilePath, 1625).
--define(wxGenericDirCtrl_GetFilter, 1626).
--define(wxGenericDirCtrl_GetFilterIndex, 1627).
--define(wxGenericDirCtrl_GetRootId, 1628).
--define(wxGenericDirCtrl_GetTreeCtrl, 1629).
--define(wxGenericDirCtrl_ReCreateTree, 1630).
--define(wxGenericDirCtrl_SetDefaultPath, 1631).
--define(wxGenericDirCtrl_SetFilter, 1632).
--define(wxGenericDirCtrl_SetFilterIndex, 1633).
--define(wxGenericDirCtrl_SetPath, 1634).
--define(wxStaticBox_new_4, 1636).
--define(wxStaticBox_new_0, 1637).
--define(wxStaticBox_Create, 1638).
--define(wxStaticBox_destroy, 1639).
--define(wxStaticLine_new_2, 1641).
--define(wxStaticLine_new_0, 1642).
--define(wxStaticLine_Create, 1643).
--define(wxStaticLine_IsVertical, 1644).
--define(wxStaticLine_GetDefaultSize, 1645).
--define(wxStaticLine_destroy, 1646).
--define(wxListBox_new_3, 1649).
--define(wxListBox_new_0, 1650).
--define(wxListBox_destruct, 1652).
--define(wxListBox_Create, 1654).
--define(wxListBox_Deselect, 1655).
--define(wxListBox_GetSelections, 1656).
--define(wxListBox_InsertItems, 1657).
--define(wxListBox_IsSelected, 1658).
--define(wxListBox_Set, 1659).
--define(wxListBox_HitTest, 1660).
--define(wxListBox_SetFirstItem_1_0, 1661).
--define(wxListBox_SetFirstItem_1_1, 1662).
--define(wxListCtrl_new_0, 1663).
--define(wxListCtrl_new_2, 1664).
--define(wxListCtrl_Arrange, 1665).
--define(wxListCtrl_AssignImageList, 1666).
--define(wxListCtrl_ClearAll, 1667).
--define(wxListCtrl_Create, 1668).
--define(wxListCtrl_DeleteAllItems, 1669).
--define(wxListCtrl_DeleteColumn, 1670).
--define(wxListCtrl_DeleteItem, 1671).
--define(wxListCtrl_EditLabel, 1672).
--define(wxListCtrl_EnsureVisible, 1673).
--define(wxListCtrl_FindItem_3_0, 1674).
--define(wxListCtrl_FindItem_3_1, 1675).
--define(wxListCtrl_GetColumn, 1676).
--define(wxListCtrl_GetColumnCount, 1677).
--define(wxListCtrl_GetColumnWidth, 1678).
--define(wxListCtrl_GetCountPerPage, 1679).
--define(wxListCtrl_GetEditControl, 1680).
--define(wxListCtrl_GetImageList, 1681).
--define(wxListCtrl_GetItem, 1682).
--define(wxListCtrl_GetItemBackgroundColour, 1683).
--define(wxListCtrl_GetItemCount, 1684).
--define(wxListCtrl_GetItemData, 1685).
--define(wxListCtrl_GetItemFont, 1686).
--define(wxListCtrl_GetItemPosition, 1687).
--define(wxListCtrl_GetItemRect, 1688).
--define(wxListCtrl_GetItemSpacing, 1689).
--define(wxListCtrl_GetItemState, 1690).
--define(wxListCtrl_GetItemText, 1691).
--define(wxListCtrl_GetItemTextColour, 1692).
--define(wxListCtrl_GetNextItem, 1693).
--define(wxListCtrl_GetSelectedItemCount, 1694).
--define(wxListCtrl_GetTextColour, 1695).
--define(wxListCtrl_GetTopItem, 1696).
--define(wxListCtrl_GetViewRect, 1697).
--define(wxListCtrl_HitTest, 1698).
--define(wxListCtrl_InsertColumn_2, 1699).
--define(wxListCtrl_InsertColumn_3, 1700).
--define(wxListCtrl_InsertItem_1, 1701).
--define(wxListCtrl_InsertItem_2_1, 1702).
--define(wxListCtrl_InsertItem_2_0, 1703).
--define(wxListCtrl_InsertItem_3, 1704).
--define(wxListCtrl_RefreshItem, 1705).
--define(wxListCtrl_RefreshItems, 1706).
--define(wxListCtrl_ScrollList, 1707).
--define(wxListCtrl_SetBackgroundColour, 1708).
--define(wxListCtrl_SetColumn, 1709).
--define(wxListCtrl_SetColumnWidth, 1710).
--define(wxListCtrl_SetImageList, 1711).
--define(wxListCtrl_SetItem_1, 1712).
--define(wxListCtrl_SetItem_4, 1713).
--define(wxListCtrl_SetItemBackgroundColour, 1714).
--define(wxListCtrl_SetItemCount, 1715).
--define(wxListCtrl_SetItemData, 1716).
--define(wxListCtrl_SetItemFont, 1717).
--define(wxListCtrl_SetItemImage, 1718).
--define(wxListCtrl_SetItemColumnImage, 1719).
--define(wxListCtrl_SetItemPosition, 1720).
--define(wxListCtrl_SetItemState, 1721).
--define(wxListCtrl_SetItemText, 1722).
--define(wxListCtrl_SetItemTextColour, 1723).
--define(wxListCtrl_SetSingleStyle, 1724).
--define(wxListCtrl_SetTextColour, 1725).
--define(wxListCtrl_SetWindowStyleFlag, 1726).
--define(wxListCtrl_SortItems, 1727).
--define(wxListCtrl_destroy, 1728).
--define(wxListView_ClearColumnImage, 1729).
--define(wxListView_Focus, 1730).
--define(wxListView_GetFirstSelected, 1731).
--define(wxListView_GetFocusedItem, 1732).
--define(wxListView_GetNextSelected, 1733).
--define(wxListView_IsSelected, 1734).
--define(wxListView_Select, 1735).
--define(wxListView_SetColumnImage, 1736).
--define(wxListItem_new_0, 1737).
--define(wxListItem_new_1, 1738).
--define(wxListItem_destruct, 1739).
--define(wxListItem_Clear, 1740).
--define(wxListItem_GetAlign, 1741).
--define(wxListItem_GetBackgroundColour, 1742).
--define(wxListItem_GetColumn, 1743).
--define(wxListItem_GetFont, 1744).
--define(wxListItem_GetId, 1745).
--define(wxListItem_GetImage, 1746).
--define(wxListItem_GetMask, 1747).
--define(wxListItem_GetState, 1748).
--define(wxListItem_GetText, 1749).
--define(wxListItem_GetTextColour, 1750).
--define(wxListItem_GetWidth, 1751).
--define(wxListItem_SetAlign, 1752).
--define(wxListItem_SetBackgroundColour, 1753).
--define(wxListItem_SetColumn, 1754).
--define(wxListItem_SetFont, 1755).
--define(wxListItem_SetId, 1756).
--define(wxListItem_SetImage, 1757).
--define(wxListItem_SetMask, 1758).
--define(wxListItem_SetState, 1759).
--define(wxListItem_SetStateMask, 1760).
--define(wxListItem_SetText, 1761).
--define(wxListItem_SetTextColour, 1762).
--define(wxListItem_SetWidth, 1763).
--define(wxListItemAttr_new_0, 1764).
--define(wxListItemAttr_new_3, 1765).
--define(wxListItemAttr_GetBackgroundColour, 1766).
--define(wxListItemAttr_GetFont, 1767).
--define(wxListItemAttr_GetTextColour, 1768).
--define(wxListItemAttr_HasBackgroundColour, 1769).
--define(wxListItemAttr_HasFont, 1770).
--define(wxListItemAttr_HasTextColour, 1771).
--define(wxListItemAttr_SetBackgroundColour, 1772).
--define(wxListItemAttr_SetFont, 1773).
--define(wxListItemAttr_SetTextColour, 1774).
--define(wxListItemAttr_destroy, 1775).
--define(wxImageList_new_0, 1776).
--define(wxImageList_new_3, 1777).
--define(wxImageList_Add_1, 1778).
--define(wxImageList_Add_2_0, 1779).
--define(wxImageList_Add_2_1, 1780).
--define(wxImageList_Create, 1781).
--define(wxImageList_Draw, 1783).
--define(wxImageList_GetBitmap, 1784).
--define(wxImageList_GetIcon, 1785).
--define(wxImageList_GetImageCount, 1786).
--define(wxImageList_GetSize, 1787).
--define(wxImageList_Remove, 1788).
--define(wxImageList_RemoveAll, 1789).
--define(wxImageList_Replace_2, 1790).
--define(wxImageList_Replace_3, 1791).
--define(wxImageList_destroy, 1792).
--define(wxTextAttr_new_0, 1793).
--define(wxTextAttr_new_2, 1794).
--define(wxTextAttr_GetAlignment, 1795).
--define(wxTextAttr_GetBackgroundColour, 1796).
--define(wxTextAttr_GetFont, 1797).
--define(wxTextAttr_GetLeftIndent, 1798).
--define(wxTextAttr_GetLeftSubIndent, 1799).
--define(wxTextAttr_GetRightIndent, 1800).
--define(wxTextAttr_GetTabs, 1801).
--define(wxTextAttr_GetTextColour, 1802).
--define(wxTextAttr_HasBackgroundColour, 1803).
--define(wxTextAttr_HasFont, 1804).
--define(wxTextAttr_HasTextColour, 1805).
--define(wxTextAttr_GetFlags, 1806).
--define(wxTextAttr_IsDefault, 1807).
--define(wxTextAttr_SetAlignment, 1808).
--define(wxTextAttr_SetBackgroundColour, 1809).
--define(wxTextAttr_SetFlags, 1810).
--define(wxTextAttr_SetFont, 1811).
--define(wxTextAttr_SetLeftIndent, 1812).
--define(wxTextAttr_SetRightIndent, 1813).
--define(wxTextAttr_SetTabs, 1814).
--define(wxTextAttr_SetTextColour, 1815).
--define(wxTextAttr_destroy, 1816).
--define(wxTextCtrl_new_3, 1818).
--define(wxTextCtrl_new_0, 1819).
--define(wxTextCtrl_destruct, 1821).
--define(wxTextCtrl_AppendText, 1822).
--define(wxTextCtrl_CanCopy, 1823).
--define(wxTextCtrl_CanCut, 1824).
--define(wxTextCtrl_CanPaste, 1825).
--define(wxTextCtrl_CanRedo, 1826).
--define(wxTextCtrl_CanUndo, 1827).
--define(wxTextCtrl_Clear, 1828).
--define(wxTextCtrl_Copy, 1829).
--define(wxTextCtrl_Create, 1830).
--define(wxTextCtrl_Cut, 1831).
--define(wxTextCtrl_DiscardEdits, 1832).
--define(wxTextCtrl_ChangeValue, 1833).
--define(wxTextCtrl_EmulateKeyPress, 1834).
--define(wxTextCtrl_GetDefaultStyle, 1835).
--define(wxTextCtrl_GetInsertionPoint, 1836).
--define(wxTextCtrl_GetLastPosition, 1837).
--define(wxTextCtrl_GetLineLength, 1838).
--define(wxTextCtrl_GetLineText, 1839).
--define(wxTextCtrl_GetNumberOfLines, 1840).
--define(wxTextCtrl_GetRange, 1841).
--define(wxTextCtrl_GetSelection, 1842).
--define(wxTextCtrl_GetStringSelection, 1843).
--define(wxTextCtrl_GetStyle, 1844).
--define(wxTextCtrl_GetValue, 1845).
--define(wxTextCtrl_IsEditable, 1846).
--define(wxTextCtrl_IsModified, 1847).
--define(wxTextCtrl_IsMultiLine, 1848).
--define(wxTextCtrl_IsSingleLine, 1849).
--define(wxTextCtrl_LoadFile, 1850).
--define(wxTextCtrl_MarkDirty, 1851).
--define(wxTextCtrl_Paste, 1852).
--define(wxTextCtrl_PositionToXY, 1853).
--define(wxTextCtrl_Redo, 1854).
--define(wxTextCtrl_Remove, 1855).
--define(wxTextCtrl_Replace, 1856).
--define(wxTextCtrl_SaveFile, 1857).
--define(wxTextCtrl_SetDefaultStyle, 1858).
--define(wxTextCtrl_SetEditable, 1859).
--define(wxTextCtrl_SetInsertionPoint, 1860).
--define(wxTextCtrl_SetInsertionPointEnd, 1861).
--define(wxTextCtrl_SetMaxLength, 1863).
--define(wxTextCtrl_SetSelection, 1864).
--define(wxTextCtrl_SetStyle, 1865).
--define(wxTextCtrl_SetValue, 1866).
--define(wxTextCtrl_ShowPosition, 1867).
--define(wxTextCtrl_Undo, 1868).
--define(wxTextCtrl_WriteText, 1869).
--define(wxTextCtrl_XYToPosition, 1870).
--define(wxNotebook_new_0, 1873).
--define(wxNotebook_new_3, 1874).
--define(wxNotebook_destruct, 1875).
--define(wxNotebook_AddPage, 1876).
--define(wxNotebook_AdvanceSelection, 1877).
--define(wxNotebook_AssignImageList, 1878).
--define(wxNotebook_Create, 1879).
--define(wxNotebook_DeleteAllPages, 1880).
--define(wxNotebook_DeletePage, 1881).
--define(wxNotebook_RemovePage, 1882).
--define(wxNotebook_GetCurrentPage, 1883).
--define(wxNotebook_GetImageList, 1884).
--define(wxNotebook_GetPage, 1886).
--define(wxNotebook_GetPageCount, 1887).
--define(wxNotebook_GetPageImage, 1888).
--define(wxNotebook_GetPageText, 1889).
--define(wxNotebook_GetRowCount, 1890).
--define(wxNotebook_GetSelection, 1891).
--define(wxNotebook_GetThemeBackgroundColour, 1892).
--define(wxNotebook_HitTest, 1894).
--define(wxNotebook_InsertPage, 1896).
--define(wxNotebook_SetImageList, 1897).
--define(wxNotebook_SetPadding, 1898).
--define(wxNotebook_SetPageSize, 1899).
--define(wxNotebook_SetPageImage, 1900).
--define(wxNotebook_SetPageText, 1901).
--define(wxNotebook_SetSelection, 1902).
--define(wxNotebook_ChangeSelection, 1903).
--define(wxChoicebook_new_0, 1904).
--define(wxChoicebook_new_3, 1905).
--define(wxChoicebook_AddPage, 1906).
--define(wxChoicebook_AdvanceSelection, 1907).
--define(wxChoicebook_AssignImageList, 1908).
--define(wxChoicebook_Create, 1909).
--define(wxChoicebook_DeleteAllPages, 1910).
--define(wxChoicebook_DeletePage, 1911).
--define(wxChoicebook_RemovePage, 1912).
--define(wxChoicebook_GetCurrentPage, 1913).
--define(wxChoicebook_GetImageList, 1914).
--define(wxChoicebook_GetPage, 1916).
--define(wxChoicebook_GetPageCount, 1917).
--define(wxChoicebook_GetPageImage, 1918).
--define(wxChoicebook_GetPageText, 1919).
--define(wxChoicebook_GetSelection, 1920).
--define(wxChoicebook_HitTest, 1921).
--define(wxChoicebook_InsertPage, 1922).
--define(wxChoicebook_SetImageList, 1923).
--define(wxChoicebook_SetPageSize, 1924).
--define(wxChoicebook_SetPageImage, 1925).
--define(wxChoicebook_SetPageText, 1926).
--define(wxChoicebook_SetSelection, 1927).
--define(wxChoicebook_ChangeSelection, 1928).
--define(wxChoicebook_destroy, 1929).
--define(wxToolbook_new_0, 1930).
--define(wxToolbook_new_3, 1931).
--define(wxToolbook_AddPage, 1932).
--define(wxToolbook_AdvanceSelection, 1933).
--define(wxToolbook_AssignImageList, 1934).
--define(wxToolbook_Create, 1935).
--define(wxToolbook_DeleteAllPages, 1936).
--define(wxToolbook_DeletePage, 1937).
--define(wxToolbook_RemovePage, 1938).
--define(wxToolbook_GetCurrentPage, 1939).
--define(wxToolbook_GetImageList, 1940).
--define(wxToolbook_GetPage, 1942).
--define(wxToolbook_GetPageCount, 1943).
--define(wxToolbook_GetPageImage, 1944).
--define(wxToolbook_GetPageText, 1945).
--define(wxToolbook_GetSelection, 1946).
--define(wxToolbook_HitTest, 1948).
--define(wxToolbook_InsertPage, 1949).
--define(wxToolbook_SetImageList, 1950).
--define(wxToolbook_SetPageSize, 1951).
--define(wxToolbook_SetPageImage, 1952).
--define(wxToolbook_SetPageText, 1953).
--define(wxToolbook_SetSelection, 1954).
--define(wxToolbook_ChangeSelection, 1955).
--define(wxToolbook_destroy, 1956).
--define(wxListbook_new_0, 1957).
--define(wxListbook_new_3, 1958).
--define(wxListbook_AddPage, 1959).
--define(wxListbook_AdvanceSelection, 1960).
--define(wxListbook_AssignImageList, 1961).
--define(wxListbook_Create, 1962).
--define(wxListbook_DeleteAllPages, 1963).
--define(wxListbook_DeletePage, 1964).
--define(wxListbook_RemovePage, 1965).
--define(wxListbook_GetCurrentPage, 1966).
--define(wxListbook_GetImageList, 1967).
--define(wxListbook_GetPage, 1969).
--define(wxListbook_GetPageCount, 1970).
--define(wxListbook_GetPageImage, 1971).
--define(wxListbook_GetPageText, 1972).
--define(wxListbook_GetSelection, 1973).
--define(wxListbook_HitTest, 1975).
--define(wxListbook_InsertPage, 1976).
--define(wxListbook_SetImageList, 1977).
--define(wxListbook_SetPageSize, 1978).
--define(wxListbook_SetPageImage, 1979).
--define(wxListbook_SetPageText, 1980).
--define(wxListbook_SetSelection, 1981).
--define(wxListbook_ChangeSelection, 1982).
--define(wxListbook_destroy, 1983).
--define(wxTreebook_new_0, 1984).
--define(wxTreebook_new_3, 1985).
--define(wxTreebook_AddPage, 1986).
--define(wxTreebook_AdvanceSelection, 1987).
--define(wxTreebook_AssignImageList, 1988).
--define(wxTreebook_Create, 1989).
--define(wxTreebook_DeleteAllPages, 1990).
--define(wxTreebook_DeletePage, 1991).
--define(wxTreebook_RemovePage, 1992).
--define(wxTreebook_GetCurrentPage, 1993).
--define(wxTreebook_GetImageList, 1994).
--define(wxTreebook_GetPage, 1996).
--define(wxTreebook_GetPageCount, 1997).
--define(wxTreebook_GetPageImage, 1998).
--define(wxTreebook_GetPageText, 1999).
--define(wxTreebook_GetSelection, 2000).
--define(wxTreebook_ExpandNode, 2001).
--define(wxTreebook_IsNodeExpanded, 2002).
--define(wxTreebook_HitTest, 2004).
--define(wxTreebook_InsertPage, 2005).
--define(wxTreebook_InsertSubPage, 2006).
--define(wxTreebook_SetImageList, 2007).
--define(wxTreebook_SetPageSize, 2008).
--define(wxTreebook_SetPageImage, 2009).
--define(wxTreebook_SetPageText, 2010).
--define(wxTreebook_SetSelection, 2011).
--define(wxTreebook_ChangeSelection, 2012).
--define(wxTreebook_destroy, 2013).
--define(wxTreeCtrl_new_2, 2016).
--define(wxTreeCtrl_new_0, 2017).
--define(wxTreeCtrl_destruct, 2019).
--define(wxTreeCtrl_AddRoot, 2020).
--define(wxTreeCtrl_AppendItem, 2021).
--define(wxTreeCtrl_AssignImageList, 2022).
--define(wxTreeCtrl_AssignStateImageList, 2023).
--define(wxTreeCtrl_Collapse, 2024).
--define(wxTreeCtrl_CollapseAndReset, 2025).
--define(wxTreeCtrl_Create, 2026).
--define(wxTreeCtrl_Delete, 2027).
--define(wxTreeCtrl_DeleteAllItems, 2028).
--define(wxTreeCtrl_DeleteChildren, 2029).
--define(wxTreeCtrl_EditLabel, 2030).
--define(wxTreeCtrl_EnsureVisible, 2031).
--define(wxTreeCtrl_Expand, 2032).
--define(wxTreeCtrl_GetBoundingRect, 2033).
--define(wxTreeCtrl_GetChildrenCount, 2035).
--define(wxTreeCtrl_GetCount, 2036).
--define(wxTreeCtrl_GetEditControl, 2037).
--define(wxTreeCtrl_GetFirstChild, 2038).
--define(wxTreeCtrl_GetNextChild, 2039).
--define(wxTreeCtrl_GetFirstVisibleItem, 2040).
--define(wxTreeCtrl_GetImageList, 2041).
--define(wxTreeCtrl_GetIndent, 2042).
--define(wxTreeCtrl_GetItemBackgroundColour, 2043).
--define(wxTreeCtrl_GetItemData, 2044).
--define(wxTreeCtrl_GetItemFont, 2045).
--define(wxTreeCtrl_GetItemImage_1, 2046).
--define(wxTreeCtrl_GetItemImage_2, 2047).
--define(wxTreeCtrl_GetItemText, 2048).
--define(wxTreeCtrl_GetItemTextColour, 2049).
--define(wxTreeCtrl_GetLastChild, 2050).
--define(wxTreeCtrl_GetNextSibling, 2051).
--define(wxTreeCtrl_GetNextVisible, 2052).
--define(wxTreeCtrl_GetItemParent, 2053).
--define(wxTreeCtrl_GetPrevSibling, 2054).
--define(wxTreeCtrl_GetPrevVisible, 2055).
--define(wxTreeCtrl_GetRootItem, 2056).
--define(wxTreeCtrl_GetSelection, 2057).
--define(wxTreeCtrl_GetSelections, 2058).
--define(wxTreeCtrl_GetStateImageList, 2059).
--define(wxTreeCtrl_HitTest, 2060).
--define(wxTreeCtrl_InsertItem, 2062).
--define(wxTreeCtrl_IsBold, 2063).
--define(wxTreeCtrl_IsExpanded, 2064).
--define(wxTreeCtrl_IsSelected, 2065).
--define(wxTreeCtrl_IsVisible, 2066).
--define(wxTreeCtrl_ItemHasChildren, 2067).
--define(wxTreeCtrl_IsTreeItemIdOk, 2068).
--define(wxTreeCtrl_PrependItem, 2069).
--define(wxTreeCtrl_ScrollTo, 2070).
--define(wxTreeCtrl_SelectItem_1, 2071).
--define(wxTreeCtrl_SelectItem_2, 2072).
--define(wxTreeCtrl_SetIndent, 2073).
--define(wxTreeCtrl_SetImageList, 2074).
--define(wxTreeCtrl_SetItemBackgroundColour, 2075).
--define(wxTreeCtrl_SetItemBold, 2076).
--define(wxTreeCtrl_SetItemData, 2077).
--define(wxTreeCtrl_SetItemDropHighlight, 2078).
--define(wxTreeCtrl_SetItemFont, 2079).
--define(wxTreeCtrl_SetItemHasChildren, 2080).
--define(wxTreeCtrl_SetItemImage_2, 2081).
--define(wxTreeCtrl_SetItemImage_3, 2082).
--define(wxTreeCtrl_SetItemText, 2083).
--define(wxTreeCtrl_SetItemTextColour, 2084).
--define(wxTreeCtrl_SetStateImageList, 2085).
--define(wxTreeCtrl_SetWindowStyle, 2086).
--define(wxTreeCtrl_SortChildren, 2087).
--define(wxTreeCtrl_Toggle, 2088).
--define(wxTreeCtrl_ToggleItemSelection, 2089).
--define(wxTreeCtrl_Unselect, 2090).
--define(wxTreeCtrl_UnselectAll, 2091).
--define(wxTreeCtrl_UnselectItem, 2092).
--define(wxScrollBar_new_0, 2093).
--define(wxScrollBar_new_3, 2094).
--define(wxScrollBar_destruct, 2095).
--define(wxScrollBar_Create, 2096).
--define(wxScrollBar_GetRange, 2097).
--define(wxScrollBar_GetPageSize, 2098).
--define(wxScrollBar_GetThumbPosition, 2099).
--define(wxScrollBar_GetThumbSize, 2100).
--define(wxScrollBar_SetThumbPosition, 2101).
--define(wxScrollBar_SetScrollbar, 2102).
--define(wxSpinButton_new_2, 2104).
--define(wxSpinButton_new_0, 2105).
--define(wxSpinButton_Create, 2106).
--define(wxSpinButton_GetMax, 2107).
--define(wxSpinButton_GetMin, 2108).
--define(wxSpinButton_GetValue, 2109).
--define(wxSpinButton_SetRange, 2110).
--define(wxSpinButton_SetValue, 2111).
--define(wxSpinButton_destroy, 2112).
--define(wxSpinCtrl_new_0, 2113).
--define(wxSpinCtrl_new_2, 2114).
--define(wxSpinCtrl_Create, 2116).
--define(wxSpinCtrl_SetValue_1_1, 2119).
--define(wxSpinCtrl_SetValue_1_0, 2120).
--define(wxSpinCtrl_GetValue, 2122).
--define(wxSpinCtrl_SetRange, 2124).
--define(wxSpinCtrl_SetSelection, 2125).
--define(wxSpinCtrl_GetMin, 2127).
--define(wxSpinCtrl_GetMax, 2129).
--define(wxSpinCtrl_destroy, 2130).
--define(wxStaticText_new_0, 2131).
--define(wxStaticText_new_4, 2132).
--define(wxStaticText_Create, 2133).
--define(wxStaticText_GetLabel, 2134).
--define(wxStaticText_SetLabel, 2135).
--define(wxStaticText_Wrap, 2136).
--define(wxStaticText_destroy, 2137).
--define(wxStaticBitmap_new_0, 2138).
--define(wxStaticBitmap_new_4, 2139).
--define(wxStaticBitmap_Create, 2140).
--define(wxStaticBitmap_GetBitmap, 2141).
--define(wxStaticBitmap_SetBitmap, 2142).
--define(wxStaticBitmap_destroy, 2143).
--define(wxRadioBox_new, 2144).
--define(wxRadioBox_destruct, 2146).
--define(wxRadioBox_Create, 2147).
--define(wxRadioBox_Enable_2, 2148).
--define(wxRadioBox_Enable_1, 2149).
--define(wxRadioBox_GetSelection, 2150).
--define(wxRadioBox_GetString, 2151).
--define(wxRadioBox_SetSelection, 2152).
--define(wxRadioBox_Show_2, 2153).
--define(wxRadioBox_Show_1, 2154).
--define(wxRadioBox_GetColumnCount, 2155).
--define(wxRadioBox_GetItemHelpText, 2156).
--define(wxRadioBox_GetItemToolTip, 2157).
--define(wxRadioBox_GetItemFromPoint, 2159).
--define(wxRadioBox_GetRowCount, 2160).
--define(wxRadioBox_IsItemEnabled, 2161).
--define(wxRadioBox_IsItemShown, 2162).
--define(wxRadioBox_SetItemHelpText, 2163).
--define(wxRadioBox_SetItemToolTip, 2164).
--define(wxRadioButton_new_0, 2165).
--define(wxRadioButton_new_4, 2166).
--define(wxRadioButton_Create, 2167).
--define(wxRadioButton_GetValue, 2168).
--define(wxRadioButton_SetValue, 2169).
--define(wxRadioButton_destroy, 2170).
--define(wxSlider_new_6, 2172).
--define(wxSlider_new_0, 2173).
--define(wxSlider_Create, 2174).
--define(wxSlider_GetLineSize, 2175).
--define(wxSlider_GetMax, 2176).
--define(wxSlider_GetMin, 2177).
--define(wxSlider_GetPageSize, 2178).
--define(wxSlider_GetThumbLength, 2179).
--define(wxSlider_GetValue, 2180).
--define(wxSlider_SetLineSize, 2181).
--define(wxSlider_SetPageSize, 2182).
--define(wxSlider_SetRange, 2183).
--define(wxSlider_SetThumbLength, 2184).
--define(wxSlider_SetValue, 2185).
--define(wxSlider_destroy, 2186).
--define(wxDialog_new_4, 2188).
--define(wxDialog_new_0, 2189).
--define(wxDialog_destruct, 2191).
--define(wxDialog_Create, 2192).
--define(wxDialog_CreateButtonSizer, 2193).
--define(wxDialog_CreateStdDialogButtonSizer, 2194).
--define(wxDialog_EndModal, 2195).
--define(wxDialog_GetAffirmativeId, 2196).
--define(wxDialog_GetReturnCode, 2197).
--define(wxDialog_IsModal, 2198).
--define(wxDialog_SetAffirmativeId, 2199).
--define(wxDialog_SetReturnCode, 2200).
--define(wxDialog_Show, 2201).
--define(wxDialog_ShowModal, 2202).
--define(wxColourDialog_new_0, 2203).
--define(wxColourDialog_new_2, 2204).
--define(wxColourDialog_destruct, 2205).
--define(wxColourDialog_Create, 2206).
--define(wxColourDialog_GetColourData, 2207).
--define(wxColourData_new_0, 2208).
--define(wxColourData_new_1, 2209).
--define(wxColourData_destruct, 2210).
--define(wxColourData_GetChooseFull, 2211).
--define(wxColourData_GetColour, 2212).
--define(wxColourData_GetCustomColour, 2214).
--define(wxColourData_SetChooseFull, 2215).
--define(wxColourData_SetColour, 2216).
--define(wxColourData_SetCustomColour, 2217).
--define(wxPalette_new_0, 2218).
--define(wxPalette_new_4, 2219).
--define(wxPalette_destruct, 2221).
--define(wxPalette_Create, 2222).
--define(wxPalette_GetColoursCount, 2223).
--define(wxPalette_GetPixel, 2224).
--define(wxPalette_GetRGB, 2225).
--define(wxPalette_IsOk, 2226).
--define(wxDirDialog_new, 2230).
--define(wxDirDialog_destruct, 2231).
--define(wxDirDialog_GetPath, 2232).
--define(wxDirDialog_GetMessage, 2233).
--define(wxDirDialog_SetMessage, 2234).
--define(wxDirDialog_SetPath, 2235).
--define(wxFileDialog_new, 2239).
--define(wxFileDialog_destruct, 2240).
--define(wxFileDialog_GetDirectory, 2241).
--define(wxFileDialog_GetFilename, 2242).
--define(wxFileDialog_GetFilenames, 2243).
--define(wxFileDialog_GetFilterIndex, 2244).
--define(wxFileDialog_GetMessage, 2245).
--define(wxFileDialog_GetPath, 2246).
--define(wxFileDialog_GetPaths, 2247).
--define(wxFileDialog_GetWildcard, 2248).
--define(wxFileDialog_SetDirectory, 2249).
--define(wxFileDialog_SetFilename, 2250).
--define(wxFileDialog_SetFilterIndex, 2251).
--define(wxFileDialog_SetMessage, 2252).
--define(wxFileDialog_SetPath, 2253).
--define(wxFileDialog_SetWildcard, 2254).
--define(wxPickerBase_SetInternalMargin, 2255).
--define(wxPickerBase_GetInternalMargin, 2256).
--define(wxPickerBase_SetTextCtrlProportion, 2257).
--define(wxPickerBase_SetPickerCtrlProportion, 2258).
--define(wxPickerBase_GetTextCtrlProportion, 2259).
--define(wxPickerBase_GetPickerCtrlProportion, 2260).
--define(wxPickerBase_HasTextCtrl, 2261).
--define(wxPickerBase_GetTextCtrl, 2262).
--define(wxPickerBase_IsTextCtrlGrowable, 2263).
--define(wxPickerBase_SetPickerCtrlGrowable, 2264).
--define(wxPickerBase_SetTextCtrlGrowable, 2265).
--define(wxPickerBase_IsPickerCtrlGrowable, 2266).
--define(wxFilePickerCtrl_new_0, 2267).
--define(wxFilePickerCtrl_new_3, 2268).
--define(wxFilePickerCtrl_Create, 2269).
--define(wxFilePickerCtrl_GetPath, 2270).
--define(wxFilePickerCtrl_SetPath, 2271).
--define(wxFilePickerCtrl_destroy, 2272).
--define(wxDirPickerCtrl_new_0, 2273).
--define(wxDirPickerCtrl_new_3, 2274).
--define(wxDirPickerCtrl_Create, 2275).
--define(wxDirPickerCtrl_GetPath, 2276).
--define(wxDirPickerCtrl_SetPath, 2277).
--define(wxDirPickerCtrl_destroy, 2278).
--define(wxColourPickerCtrl_new_0, 2279).
--define(wxColourPickerCtrl_new_3, 2280).
--define(wxColourPickerCtrl_Create, 2281).
--define(wxColourPickerCtrl_GetColour, 2282).
--define(wxColourPickerCtrl_SetColour_1_1, 2283).
--define(wxColourPickerCtrl_SetColour_1_0, 2284).
--define(wxColourPickerCtrl_destroy, 2285).
--define(wxDatePickerCtrl_new_0, 2286).
--define(wxDatePickerCtrl_new_3, 2287).
--define(wxDatePickerCtrl_GetRange, 2288).
--define(wxDatePickerCtrl_GetValue, 2289).
--define(wxDatePickerCtrl_SetRange, 2290).
--define(wxDatePickerCtrl_SetValue, 2291).
--define(wxDatePickerCtrl_destroy, 2292).
--define(wxFontPickerCtrl_new_0, 2293).
--define(wxFontPickerCtrl_new_3, 2294).
--define(wxFontPickerCtrl_Create, 2295).
--define(wxFontPickerCtrl_GetSelectedFont, 2296).
--define(wxFontPickerCtrl_SetSelectedFont, 2297).
--define(wxFontPickerCtrl_GetMaxPointSize, 2298).
--define(wxFontPickerCtrl_SetMaxPointSize, 2299).
--define(wxFontPickerCtrl_destroy, 2300).
--define(wxFindReplaceDialog_new_0, 2303).
--define(wxFindReplaceDialog_new_4, 2304).
--define(wxFindReplaceDialog_destruct, 2305).
--define(wxFindReplaceDialog_Create, 2306).
--define(wxFindReplaceDialog_GetData, 2307).
--define(wxFindReplaceData_new_0, 2308).
--define(wxFindReplaceData_new_1, 2309).
--define(wxFindReplaceData_GetFindString, 2310).
--define(wxFindReplaceData_GetReplaceString, 2311).
--define(wxFindReplaceData_GetFlags, 2312).
--define(wxFindReplaceData_SetFlags, 2313).
--define(wxFindReplaceData_SetFindString, 2314).
--define(wxFindReplaceData_SetReplaceString, 2315).
--define(wxFindReplaceData_destroy, 2316).
--define(wxMultiChoiceDialog_new_0, 2317).
--define(wxMultiChoiceDialog_new_5, 2319).
--define(wxMultiChoiceDialog_GetSelections, 2320).
--define(wxMultiChoiceDialog_SetSelections, 2321).
--define(wxMultiChoiceDialog_destroy, 2322).
--define(wxSingleChoiceDialog_new_0, 2323).
--define(wxSingleChoiceDialog_new_5, 2325).
--define(wxSingleChoiceDialog_GetSelection, 2326).
--define(wxSingleChoiceDialog_GetStringSelection, 2327).
--define(wxSingleChoiceDialog_SetSelection, 2328).
--define(wxSingleChoiceDialog_destroy, 2329).
--define(wxTextEntryDialog_new, 2330).
--define(wxTextEntryDialog_GetValue, 2331).
--define(wxTextEntryDialog_SetValue, 2332).
--define(wxTextEntryDialog_destroy, 2333).
--define(wxPasswordEntryDialog_new, 2334).
--define(wxPasswordEntryDialog_destroy, 2335).
--define(wxFontData_new_0, 2336).
--define(wxFontData_new_1, 2337).
--define(wxFontData_destruct, 2338).
--define(wxFontData_EnableEffects, 2339).
--define(wxFontData_GetAllowSymbols, 2340).
--define(wxFontData_GetColour, 2341).
--define(wxFontData_GetChosenFont, 2342).
--define(wxFontData_GetEnableEffects, 2343).
--define(wxFontData_GetInitialFont, 2344).
--define(wxFontData_GetShowHelp, 2345).
--define(wxFontData_SetAllowSymbols, 2346).
--define(wxFontData_SetChosenFont, 2347).
--define(wxFontData_SetColour, 2348).
--define(wxFontData_SetInitialFont, 2349).
--define(wxFontData_SetRange, 2350).
--define(wxFontData_SetShowHelp, 2351).
--define(wxFontDialog_new_0, 2355).
--define(wxFontDialog_new_2, 2357).
--define(wxFontDialog_Create, 2359).
--define(wxFontDialog_GetFontData, 2360).
--define(wxFontDialog_destroy, 2362).
--define(wxProgressDialog_new, 2363).
--define(wxProgressDialog_destruct, 2364).
--define(wxProgressDialog_Resume, 2365).
--define(wxProgressDialog_Update_2, 2366).
--define(wxProgressDialog_Update_0, 2367).
--define(wxMessageDialog_new, 2368).
--define(wxMessageDialog_destruct, 2369).
--define(wxPageSetupDialog_new, 2370).
--define(wxPageSetupDialog_destruct, 2371).
--define(wxPageSetupDialog_GetPageSetupData, 2372).
--define(wxPageSetupDialog_ShowModal, 2373).
--define(wxPageSetupDialogData_new_0, 2374).
--define(wxPageSetupDialogData_new_1_0, 2375).
--define(wxPageSetupDialogData_new_1_1, 2376).
--define(wxPageSetupDialogData_destruct, 2377).
--define(wxPageSetupDialogData_EnableHelp, 2378).
--define(wxPageSetupDialogData_EnableMargins, 2379).
--define(wxPageSetupDialogData_EnableOrientation, 2380).
--define(wxPageSetupDialogData_EnablePaper, 2381).
--define(wxPageSetupDialogData_EnablePrinter, 2382).
--define(wxPageSetupDialogData_GetDefaultMinMargins, 2383).
--define(wxPageSetupDialogData_GetEnableMargins, 2384).
--define(wxPageSetupDialogData_GetEnableOrientation, 2385).
--define(wxPageSetupDialogData_GetEnablePaper, 2386).
--define(wxPageSetupDialogData_GetEnablePrinter, 2387).
--define(wxPageSetupDialogData_GetEnableHelp, 2388).
--define(wxPageSetupDialogData_GetDefaultInfo, 2389).
--define(wxPageSetupDialogData_GetMarginTopLeft, 2390).
--define(wxPageSetupDialogData_GetMarginBottomRight, 2391).
--define(wxPageSetupDialogData_GetMinMarginTopLeft, 2392).
--define(wxPageSetupDialogData_GetMinMarginBottomRight, 2393).
--define(wxPageSetupDialogData_GetPaperId, 2394).
--define(wxPageSetupDialogData_GetPaperSize, 2395).
--define(wxPageSetupDialogData_GetPrintData, 2397).
--define(wxPageSetupDialogData_IsOk, 2398).
--define(wxPageSetupDialogData_SetDefaultInfo, 2399).
--define(wxPageSetupDialogData_SetDefaultMinMargins, 2400).
--define(wxPageSetupDialogData_SetMarginTopLeft, 2401).
--define(wxPageSetupDialogData_SetMarginBottomRight, 2402).
--define(wxPageSetupDialogData_SetMinMarginTopLeft, 2403).
--define(wxPageSetupDialogData_SetMinMarginBottomRight, 2404).
--define(wxPageSetupDialogData_SetPaperId, 2405).
--define(wxPageSetupDialogData_SetPaperSize_1_1, 2406).
--define(wxPageSetupDialogData_SetPaperSize_1_0, 2407).
--define(wxPageSetupDialogData_SetPrintData, 2408).
--define(wxPrintDialog_new_2_0, 2409).
--define(wxPrintDialog_new_2_1, 2410).
--define(wxPrintDialog_destruct, 2411).
--define(wxPrintDialog_GetPrintDialogData, 2412).
--define(wxPrintDialog_GetPrintDC, 2413).
--define(wxPrintDialogData_new_0, 2414).
--define(wxPrintDialogData_new_1_1, 2415).
--define(wxPrintDialogData_new_1_0, 2416).
--define(wxPrintDialogData_destruct, 2417).
--define(wxPrintDialogData_EnableHelp, 2418).
--define(wxPrintDialogData_EnablePageNumbers, 2419).
--define(wxPrintDialogData_EnablePrintToFile, 2420).
--define(wxPrintDialogData_EnableSelection, 2421).
--define(wxPrintDialogData_GetAllPages, 2422).
--define(wxPrintDialogData_GetCollate, 2423).
--define(wxPrintDialogData_GetFromPage, 2424).
--define(wxPrintDialogData_GetMaxPage, 2425).
--define(wxPrintDialogData_GetMinPage, 2426).
--define(wxPrintDialogData_GetNoCopies, 2427).
--define(wxPrintDialogData_GetPrintData, 2428).
--define(wxPrintDialogData_GetPrintToFile, 2429).
--define(wxPrintDialogData_GetSelection, 2430).
--define(wxPrintDialogData_GetToPage, 2431).
--define(wxPrintDialogData_IsOk, 2432).
--define(wxPrintDialogData_SetCollate, 2433).
--define(wxPrintDialogData_SetFromPage, 2434).
--define(wxPrintDialogData_SetMaxPage, 2435).
--define(wxPrintDialogData_SetMinPage, 2436).
--define(wxPrintDialogData_SetNoCopies, 2437).
--define(wxPrintDialogData_SetPrintData, 2438).
--define(wxPrintDialogData_SetPrintToFile, 2439).
--define(wxPrintDialogData_SetSelection, 2440).
--define(wxPrintDialogData_SetToPage, 2441).
--define(wxPrintData_new_0, 2442).
--define(wxPrintData_new_1, 2443).
--define(wxPrintData_destruct, 2444).
--define(wxPrintData_GetCollate, 2445).
--define(wxPrintData_GetBin, 2446).
--define(wxPrintData_GetColour, 2447).
--define(wxPrintData_GetDuplex, 2448).
--define(wxPrintData_GetNoCopies, 2449).
--define(wxPrintData_GetOrientation, 2450).
--define(wxPrintData_GetPaperId, 2451).
--define(wxPrintData_GetPrinterName, 2452).
--define(wxPrintData_GetQuality, 2453).
--define(wxPrintData_IsOk, 2454).
--define(wxPrintData_SetBin, 2455).
--define(wxPrintData_SetCollate, 2456).
--define(wxPrintData_SetColour, 2457).
--define(wxPrintData_SetDuplex, 2458).
--define(wxPrintData_SetNoCopies, 2459).
--define(wxPrintData_SetOrientation, 2460).
--define(wxPrintData_SetPaperId, 2461).
--define(wxPrintData_SetPrinterName, 2462).
--define(wxPrintData_SetQuality, 2463).
--define(wxPrintPreview_new_2, 2466).
--define(wxPrintPreview_new_3, 2467).
--define(wxPrintPreview_destruct, 2469).
--define(wxPrintPreview_GetCanvas, 2470).
--define(wxPrintPreview_GetCurrentPage, 2471).
--define(wxPrintPreview_GetFrame, 2472).
--define(wxPrintPreview_GetMaxPage, 2473).
--define(wxPrintPreview_GetMinPage, 2474).
--define(wxPrintPreview_GetPrintout, 2475).
--define(wxPrintPreview_GetPrintoutForPrinting, 2476).
--define(wxPrintPreview_IsOk, 2477).
--define(wxPrintPreview_PaintPage, 2478).
--define(wxPrintPreview_Print, 2479).
--define(wxPrintPreview_RenderPage, 2480).
--define(wxPrintPreview_SetCanvas, 2481).
--define(wxPrintPreview_SetCurrentPage, 2482).
--define(wxPrintPreview_SetFrame, 2483).
--define(wxPrintPreview_SetPrintout, 2484).
--define(wxPrintPreview_SetZoom, 2485).
--define(wxPreviewFrame_new, 2486).
--define(wxPreviewFrame_destruct, 2487).
--define(wxPreviewFrame_CreateControlBar, 2488).
--define(wxPreviewFrame_CreateCanvas, 2489).
--define(wxPreviewFrame_Initialize, 2490).
--define(wxPreviewFrame_OnCloseWindow, 2491).
--define(wxPreviewControlBar_new, 2492).
--define(wxPreviewControlBar_destruct, 2493).
--define(wxPreviewControlBar_CreateButtons, 2494).
--define(wxPreviewControlBar_GetPrintPreview, 2495).
--define(wxPreviewControlBar_GetZoomControl, 2496).
--define(wxPreviewControlBar_SetZoomControl, 2497).
--define(wxPrinter_new, 2499).
--define(wxPrinter_CreateAbortWindow, 2500).
--define(wxPrinter_GetAbort, 2501).
--define(wxPrinter_GetLastError, 2502).
--define(wxPrinter_GetPrintDialogData, 2503).
--define(wxPrinter_Print, 2504).
--define(wxPrinter_PrintDialog, 2505).
--define(wxPrinter_ReportError, 2506).
--define(wxPrinter_Setup, 2507).
--define(wxPrinter_destroy, 2508).
--define(wxXmlResource_new_1, 2509).
--define(wxXmlResource_new_2, 2510).
--define(wxXmlResource_destruct, 2511).
--define(wxXmlResource_AttachUnknownControl, 2512).
--define(wxXmlResource_ClearHandlers, 2513).
--define(wxXmlResource_CompareVersion, 2514).
--define(wxXmlResource_Get, 2515).
--define(wxXmlResource_GetFlags, 2516).
--define(wxXmlResource_GetVersion, 2517).
--define(wxXmlResource_GetXRCID, 2518).
--define(wxXmlResource_InitAllHandlers, 2519).
--define(wxXmlResource_Load, 2520).
--define(wxXmlResource_LoadBitmap, 2521).
--define(wxXmlResource_LoadDialog_2, 2522).
--define(wxXmlResource_LoadDialog_3, 2523).
--define(wxXmlResource_LoadFrame_2, 2524).
--define(wxXmlResource_LoadFrame_3, 2525).
--define(wxXmlResource_LoadIcon, 2526).
--define(wxXmlResource_LoadMenu, 2527).
--define(wxXmlResource_LoadMenuBar_2, 2528).
--define(wxXmlResource_LoadMenuBar_1, 2529).
--define(wxXmlResource_LoadPanel_2, 2530).
--define(wxXmlResource_LoadPanel_3, 2531).
--define(wxXmlResource_LoadToolBar, 2532).
--define(wxXmlResource_Set, 2533).
--define(wxXmlResource_SetFlags, 2534).
--define(wxXmlResource_Unload, 2535).
--define(wxXmlResource_xrcctrl, 2536).
--define(wxHtmlEasyPrinting_new, 2537).
--define(wxHtmlEasyPrinting_destruct, 2538).
--define(wxHtmlEasyPrinting_GetPrintData, 2539).
--define(wxHtmlEasyPrinting_GetPageSetupData, 2540).
--define(wxHtmlEasyPrinting_PreviewFile, 2541).
--define(wxHtmlEasyPrinting_PreviewText, 2542).
--define(wxHtmlEasyPrinting_PrintFile, 2543).
--define(wxHtmlEasyPrinting_PrintText, 2544).
--define(wxHtmlEasyPrinting_PageSetup, 2545).
--define(wxHtmlEasyPrinting_SetFonts, 2546).
--define(wxHtmlEasyPrinting_SetHeader, 2547).
--define(wxHtmlEasyPrinting_SetFooter, 2548).
--define(wxGLCanvas_new_2, 2550).
--define(wxGLCanvas_new_3_1, 2551).
--define(wxGLCanvas_new_3_0, 2552).
--define(wxGLCanvas_GetContext, 2553).
--define(wxGLCanvas_SetCurrent, 2555).
--define(wxGLCanvas_SwapBuffers, 2556).
--define(wxGLCanvas_destroy, 2557).
--define(wxAuiManager_new, 2558).
--define(wxAuiManager_destruct, 2559).
--define(wxAuiManager_AddPane_2_1, 2560).
--define(wxAuiManager_AddPane_3, 2561).
--define(wxAuiManager_AddPane_2_0, 2562).
--define(wxAuiManager_DetachPane, 2563).
--define(wxAuiManager_GetAllPanes, 2564).
--define(wxAuiManager_GetArtProvider, 2565).
--define(wxAuiManager_GetDockSizeConstraint, 2566).
--define(wxAuiManager_GetFlags, 2567).
--define(wxAuiManager_GetManagedWindow, 2568).
--define(wxAuiManager_GetManager, 2569).
--define(wxAuiManager_GetPane_1_1, 2570).
--define(wxAuiManager_GetPane_1_0, 2571).
--define(wxAuiManager_HideHint, 2572).
--define(wxAuiManager_InsertPane, 2573).
--define(wxAuiManager_LoadPaneInfo, 2574).
--define(wxAuiManager_LoadPerspective, 2575).
--define(wxAuiManager_SavePaneInfo, 2576).
--define(wxAuiManager_SavePerspective, 2577).
--define(wxAuiManager_SetArtProvider, 2578).
--define(wxAuiManager_SetDockSizeConstraint, 2579).
--define(wxAuiManager_SetFlags, 2580).
--define(wxAuiManager_SetManagedWindow, 2581).
--define(wxAuiManager_ShowHint, 2582).
--define(wxAuiManager_UnInit, 2583).
--define(wxAuiManager_Update, 2584).
--define(wxAuiPaneInfo_new_0, 2585).
--define(wxAuiPaneInfo_new_1, 2586).
--define(wxAuiPaneInfo_destruct, 2587).
--define(wxAuiPaneInfo_BestSize_1, 2588).
--define(wxAuiPaneInfo_BestSize_2, 2589).
--define(wxAuiPaneInfo_Bottom, 2590).
--define(wxAuiPaneInfo_BottomDockable, 2591).
--define(wxAuiPaneInfo_Caption, 2592).
--define(wxAuiPaneInfo_CaptionVisible, 2593).
--define(wxAuiPaneInfo_Centre, 2594).
--define(wxAuiPaneInfo_CentrePane, 2595).
--define(wxAuiPaneInfo_CloseButton, 2596).
--define(wxAuiPaneInfo_DefaultPane, 2597).
--define(wxAuiPaneInfo_DestroyOnClose, 2598).
--define(wxAuiPaneInfo_Direction, 2599).
--define(wxAuiPaneInfo_Dock, 2600).
--define(wxAuiPaneInfo_Dockable, 2601).
--define(wxAuiPaneInfo_Fixed, 2602).
--define(wxAuiPaneInfo_Float, 2603).
--define(wxAuiPaneInfo_Floatable, 2604).
--define(wxAuiPaneInfo_FloatingPosition_1, 2605).
--define(wxAuiPaneInfo_FloatingPosition_2, 2606).
--define(wxAuiPaneInfo_FloatingSize_1, 2607).
--define(wxAuiPaneInfo_FloatingSize_2, 2608).
--define(wxAuiPaneInfo_Gripper, 2609).
--define(wxAuiPaneInfo_GripperTop, 2610).
--define(wxAuiPaneInfo_HasBorder, 2611).
--define(wxAuiPaneInfo_HasCaption, 2612).
--define(wxAuiPaneInfo_HasCloseButton, 2613).
--define(wxAuiPaneInfo_HasFlag, 2614).
--define(wxAuiPaneInfo_HasGripper, 2615).
--define(wxAuiPaneInfo_HasGripperTop, 2616).
--define(wxAuiPaneInfo_HasMaximizeButton, 2617).
--define(wxAuiPaneInfo_HasMinimizeButton, 2618).
--define(wxAuiPaneInfo_HasPinButton, 2619).
--define(wxAuiPaneInfo_Hide, 2620).
--define(wxAuiPaneInfo_IsBottomDockable, 2621).
--define(wxAuiPaneInfo_IsDocked, 2622).
--define(wxAuiPaneInfo_IsFixed, 2623).
--define(wxAuiPaneInfo_IsFloatable, 2624).
--define(wxAuiPaneInfo_IsFloating, 2625).
--define(wxAuiPaneInfo_IsLeftDockable, 2626).
--define(wxAuiPaneInfo_IsMovable, 2627).
--define(wxAuiPaneInfo_IsOk, 2628).
--define(wxAuiPaneInfo_IsResizable, 2629).
--define(wxAuiPaneInfo_IsRightDockable, 2630).
--define(wxAuiPaneInfo_IsShown, 2631).
--define(wxAuiPaneInfo_IsToolbar, 2632).
--define(wxAuiPaneInfo_IsTopDockable, 2633).
--define(wxAuiPaneInfo_Layer, 2634).
--define(wxAuiPaneInfo_Left, 2635).
--define(wxAuiPaneInfo_LeftDockable, 2636).
--define(wxAuiPaneInfo_MaxSize_1, 2637).
--define(wxAuiPaneInfo_MaxSize_2, 2638).
--define(wxAuiPaneInfo_MaximizeButton, 2639).
--define(wxAuiPaneInfo_MinSize_1, 2640).
--define(wxAuiPaneInfo_MinSize_2, 2641).
--define(wxAuiPaneInfo_MinimizeButton, 2642).
--define(wxAuiPaneInfo_Movable, 2643).
--define(wxAuiPaneInfo_Name, 2644).
--define(wxAuiPaneInfo_PaneBorder, 2645).
--define(wxAuiPaneInfo_PinButton, 2646).
--define(wxAuiPaneInfo_Position, 2647).
--define(wxAuiPaneInfo_Resizable, 2648).
--define(wxAuiPaneInfo_Right, 2649).
--define(wxAuiPaneInfo_RightDockable, 2650).
--define(wxAuiPaneInfo_Row, 2651).
--define(wxAuiPaneInfo_SafeSet, 2652).
--define(wxAuiPaneInfo_SetFlag, 2653).
--define(wxAuiPaneInfo_Show, 2654).
--define(wxAuiPaneInfo_ToolbarPane, 2655).
--define(wxAuiPaneInfo_Top, 2656).
--define(wxAuiPaneInfo_TopDockable, 2657).
--define(wxAuiPaneInfo_Window, 2658).
--define(wxAuiPaneInfo_GetWindow, 2659).
--define(wxAuiPaneInfo_GetFrame, 2660).
--define(wxAuiPaneInfo_GetDirection, 2661).
--define(wxAuiPaneInfo_GetLayer, 2662).
--define(wxAuiPaneInfo_GetRow, 2663).
--define(wxAuiPaneInfo_GetPosition, 2664).
--define(wxAuiPaneInfo_GetFloatingPosition, 2665).
--define(wxAuiPaneInfo_GetFloatingSize, 2666).
--define(wxAuiNotebook_new_0, 2667).
--define(wxAuiNotebook_new_2, 2668).
--define(wxAuiNotebook_AddPage, 2669).
--define(wxAuiNotebook_Create, 2670).
--define(wxAuiNotebook_DeletePage, 2671).
--define(wxAuiNotebook_GetArtProvider, 2672).
--define(wxAuiNotebook_GetPage, 2673).
--define(wxAuiNotebook_GetPageBitmap, 2674).
--define(wxAuiNotebook_GetPageCount, 2675).
--define(wxAuiNotebook_GetPageIndex, 2676).
--define(wxAuiNotebook_GetPageText, 2677).
--define(wxAuiNotebook_GetSelection, 2678).
--define(wxAuiNotebook_InsertPage, 2679).
--define(wxAuiNotebook_RemovePage, 2680).
--define(wxAuiNotebook_SetArtProvider, 2681).
--define(wxAuiNotebook_SetFont, 2682).
--define(wxAuiNotebook_SetPageBitmap, 2683).
--define(wxAuiNotebook_SetPageText, 2684).
--define(wxAuiNotebook_SetSelection, 2685).
--define(wxAuiNotebook_SetTabCtrlHeight, 2686).
--define(wxAuiNotebook_SetUniformBitmapSize, 2687).
--define(wxAuiNotebook_destroy, 2688).
--define(wxAuiTabArt_SetFlags, 2689).
--define(wxAuiTabArt_SetMeasuringFont, 2690).
--define(wxAuiTabArt_SetNormalFont, 2691).
--define(wxAuiTabArt_SetSelectedFont, 2692).
--define(wxAuiTabArt_SetColour, 2693).
--define(wxAuiTabArt_SetActiveColour, 2694).
--define(wxAuiDockArt_GetColour, 2695).
--define(wxAuiDockArt_GetFont, 2696).
--define(wxAuiDockArt_GetMetric, 2697).
--define(wxAuiDockArt_SetColour, 2698).
--define(wxAuiDockArt_SetFont, 2699).
--define(wxAuiDockArt_SetMetric, 2700).
--define(wxAuiSimpleTabArt_new, 2701).
--define(wxAuiSimpleTabArt_destroy, 2702).
--define(wxMDIParentFrame_new_0, 2703).
--define(wxMDIParentFrame_new_4, 2704).
--define(wxMDIParentFrame_destruct, 2705).
--define(wxMDIParentFrame_ActivateNext, 2706).
--define(wxMDIParentFrame_ActivatePrevious, 2707).
--define(wxMDIParentFrame_ArrangeIcons, 2708).
--define(wxMDIParentFrame_Cascade, 2709).
--define(wxMDIParentFrame_Create, 2710).
--define(wxMDIParentFrame_GetActiveChild, 2711).
--define(wxMDIParentFrame_GetClientWindow, 2712).
--define(wxMDIParentFrame_Tile, 2713).
--define(wxMDIChildFrame_new_0, 2714).
--define(wxMDIChildFrame_new_4, 2715).
--define(wxMDIChildFrame_destruct, 2716).
--define(wxMDIChildFrame_Activate, 2717).
--define(wxMDIChildFrame_Create, 2718).
--define(wxMDIChildFrame_Maximize, 2719).
--define(wxMDIChildFrame_Restore, 2720).
--define(wxMDIClientWindow_new_0, 2721).
--define(wxMDIClientWindow_new_2, 2722).
--define(wxMDIClientWindow_destruct, 2723).
--define(wxMDIClientWindow_CreateClient, 2724).
--define(wxLayoutAlgorithm_new, 2725).
--define(wxLayoutAlgorithm_LayoutFrame, 2726).
--define(wxLayoutAlgorithm_LayoutMDIFrame, 2727).
--define(wxLayoutAlgorithm_LayoutWindow, 2728).
--define(wxLayoutAlgorithm_destroy, 2729).
--define(wxEvent_GetId, 2730).
--define(wxEvent_GetSkipped, 2731).
--define(wxEvent_GetTimestamp, 2732).
--define(wxEvent_IsCommandEvent, 2733).
--define(wxEvent_ResumePropagation, 2734).
--define(wxEvent_ShouldPropagate, 2735).
--define(wxEvent_Skip, 2736).
--define(wxEvent_StopPropagation, 2737).
--define(wxCommandEvent_getClientData, 2738).
--define(wxCommandEvent_GetExtraLong, 2739).
--define(wxCommandEvent_GetInt, 2740).
--define(wxCommandEvent_GetSelection, 2741).
--define(wxCommandEvent_GetString, 2742).
--define(wxCommandEvent_IsChecked, 2743).
--define(wxCommandEvent_IsSelection, 2744).
--define(wxCommandEvent_SetInt, 2745).
--define(wxCommandEvent_SetString, 2746).
--define(wxScrollEvent_GetOrientation, 2747).
--define(wxScrollEvent_GetPosition, 2748).
--define(wxScrollWinEvent_GetOrientation, 2749).
--define(wxScrollWinEvent_GetPosition, 2750).
--define(wxMouseEvent_AltDown, 2751).
--define(wxMouseEvent_Button, 2752).
--define(wxMouseEvent_ButtonDClick, 2753).
--define(wxMouseEvent_ButtonDown, 2754).
--define(wxMouseEvent_ButtonUp, 2755).
--define(wxMouseEvent_CmdDown, 2756).
--define(wxMouseEvent_ControlDown, 2757).
--define(wxMouseEvent_Dragging, 2758).
--define(wxMouseEvent_Entering, 2759).
--define(wxMouseEvent_GetButton, 2760).
--define(wxMouseEvent_GetPosition, 2763).
--define(wxMouseEvent_GetLogicalPosition, 2764).
--define(wxMouseEvent_GetLinesPerAction, 2765).
--define(wxMouseEvent_GetWheelRotation, 2766).
--define(wxMouseEvent_GetWheelDelta, 2767).
--define(wxMouseEvent_GetX, 2768).
--define(wxMouseEvent_GetY, 2769).
--define(wxMouseEvent_IsButton, 2770).
--define(wxMouseEvent_IsPageScroll, 2771).
--define(wxMouseEvent_Leaving, 2772).
--define(wxMouseEvent_LeftDClick, 2773).
--define(wxMouseEvent_LeftDown, 2774).
--define(wxMouseEvent_LeftIsDown, 2775).
--define(wxMouseEvent_LeftUp, 2776).
--define(wxMouseEvent_MetaDown, 2777).
--define(wxMouseEvent_MiddleDClick, 2778).
--define(wxMouseEvent_MiddleDown, 2779).
--define(wxMouseEvent_MiddleIsDown, 2780).
--define(wxMouseEvent_MiddleUp, 2781).
--define(wxMouseEvent_Moving, 2782).
--define(wxMouseEvent_RightDClick, 2783).
--define(wxMouseEvent_RightDown, 2784).
--define(wxMouseEvent_RightIsDown, 2785).
--define(wxMouseEvent_RightUp, 2786).
--define(wxMouseEvent_ShiftDown, 2787).
--define(wxSetCursorEvent_GetCursor, 2788).
--define(wxSetCursorEvent_GetX, 2789).
--define(wxSetCursorEvent_GetY, 2790).
--define(wxSetCursorEvent_HasCursor, 2791).
--define(wxSetCursorEvent_SetCursor, 2792).
--define(wxKeyEvent_AltDown, 2793).
--define(wxKeyEvent_CmdDown, 2794).
--define(wxKeyEvent_ControlDown, 2795).
--define(wxKeyEvent_GetKeyCode, 2796).
--define(wxKeyEvent_GetModifiers, 2797).
--define(wxKeyEvent_GetPosition, 2800).
--define(wxKeyEvent_GetRawKeyCode, 2801).
--define(wxKeyEvent_GetRawKeyFlags, 2802).
--define(wxKeyEvent_GetUnicodeKey, 2803).
--define(wxKeyEvent_GetX, 2804).
--define(wxKeyEvent_GetY, 2805).
--define(wxKeyEvent_HasModifiers, 2806).
--define(wxKeyEvent_MetaDown, 2807).
--define(wxKeyEvent_ShiftDown, 2808).
--define(wxSizeEvent_GetSize, 2809).
--define(wxMoveEvent_GetPosition, 2810).
--define(wxEraseEvent_GetDC, 2811).
--define(wxFocusEvent_GetWindow, 2812).
--define(wxChildFocusEvent_GetWindow, 2813).
--define(wxMenuEvent_GetMenu, 2814).
--define(wxMenuEvent_GetMenuId, 2815).
--define(wxMenuEvent_IsPopup, 2816).
--define(wxCloseEvent_CanVeto, 2817).
--define(wxCloseEvent_GetLoggingOff, 2818).
--define(wxCloseEvent_SetCanVeto, 2819).
--define(wxCloseEvent_SetLoggingOff, 2820).
--define(wxCloseEvent_Veto, 2821).
--define(wxShowEvent_SetShow, 2822).
--define(wxShowEvent_GetShow, 2823).
--define(wxIconizeEvent_Iconized, 2824).
--define(wxJoystickEvent_ButtonDown, 2825).
--define(wxJoystickEvent_ButtonIsDown, 2826).
--define(wxJoystickEvent_ButtonUp, 2827).
--define(wxJoystickEvent_GetButtonChange, 2828).
--define(wxJoystickEvent_GetButtonState, 2829).
--define(wxJoystickEvent_GetJoystick, 2830).
--define(wxJoystickEvent_GetPosition, 2831).
--define(wxJoystickEvent_GetZPosition, 2832).
--define(wxJoystickEvent_IsButton, 2833).
--define(wxJoystickEvent_IsMove, 2834).
--define(wxJoystickEvent_IsZMove, 2835).
--define(wxUpdateUIEvent_CanUpdate, 2836).
--define(wxUpdateUIEvent_Check, 2837).
--define(wxUpdateUIEvent_Enable, 2838).
--define(wxUpdateUIEvent_Show, 2839).
--define(wxUpdateUIEvent_GetChecked, 2840).
--define(wxUpdateUIEvent_GetEnabled, 2841).
--define(wxUpdateUIEvent_GetShown, 2842).
--define(wxUpdateUIEvent_GetSetChecked, 2843).
--define(wxUpdateUIEvent_GetSetEnabled, 2844).
--define(wxUpdateUIEvent_GetSetShown, 2845).
--define(wxUpdateUIEvent_GetSetText, 2846).
--define(wxUpdateUIEvent_GetText, 2847).
--define(wxUpdateUIEvent_GetMode, 2848).
--define(wxUpdateUIEvent_GetUpdateInterval, 2849).
--define(wxUpdateUIEvent_ResetUpdateTime, 2850).
--define(wxUpdateUIEvent_SetMode, 2851).
--define(wxUpdateUIEvent_SetText, 2852).
--define(wxUpdateUIEvent_SetUpdateInterval, 2853).
--define(wxMouseCaptureChangedEvent_GetCapturedWindow, 2854).
--define(wxPaletteChangedEvent_SetChangedWindow, 2855).
--define(wxPaletteChangedEvent_GetChangedWindow, 2856).
--define(wxQueryNewPaletteEvent_SetPaletteRealized, 2857).
--define(wxQueryNewPaletteEvent_GetPaletteRealized, 2858).
--define(wxNavigationKeyEvent_GetDirection, 2859).
--define(wxNavigationKeyEvent_SetDirection, 2860).
--define(wxNavigationKeyEvent_IsWindowChange, 2861).
--define(wxNavigationKeyEvent_SetWindowChange, 2862).
--define(wxNavigationKeyEvent_IsFromTab, 2863).
--define(wxNavigationKeyEvent_SetFromTab, 2864).
--define(wxNavigationKeyEvent_GetCurrentFocus, 2865).
--define(wxNavigationKeyEvent_SetCurrentFocus, 2866).
--define(wxHelpEvent_GetOrigin, 2867).
--define(wxHelpEvent_GetPosition, 2868).
--define(wxHelpEvent_SetOrigin, 2869).
--define(wxHelpEvent_SetPosition, 2870).
--define(wxContextMenuEvent_GetPosition, 2871).
--define(wxContextMenuEvent_SetPosition, 2872).
--define(wxIdleEvent_CanSend, 2873).
--define(wxIdleEvent_GetMode, 2874).
--define(wxIdleEvent_RequestMore, 2875).
--define(wxIdleEvent_MoreRequested, 2876).
--define(wxIdleEvent_SetMode, 2877).
--define(wxGridEvent_AltDown, 2878).
--define(wxGridEvent_ControlDown, 2879).
--define(wxGridEvent_GetCol, 2880).
--define(wxGridEvent_GetPosition, 2881).
--define(wxGridEvent_GetRow, 2882).
--define(wxGridEvent_MetaDown, 2883).
--define(wxGridEvent_Selecting, 2884).
--define(wxGridEvent_ShiftDown, 2885).
--define(wxNotifyEvent_Allow, 2886).
--define(wxNotifyEvent_IsAllowed, 2887).
--define(wxNotifyEvent_Veto, 2888).
--define(wxSashEvent_GetEdge, 2889).
--define(wxSashEvent_GetDragRect, 2890).
--define(wxSashEvent_GetDragStatus, 2891).
--define(wxListEvent_GetCacheFrom, 2892).
--define(wxListEvent_GetCacheTo, 2893).
--define(wxListEvent_GetKeyCode, 2894).
--define(wxListEvent_GetIndex, 2895).
--define(wxListEvent_GetColumn, 2896).
--define(wxListEvent_GetPoint, 2897).
--define(wxListEvent_GetLabel, 2898).
--define(wxListEvent_GetText, 2899).
--define(wxListEvent_GetImage, 2900).
--define(wxListEvent_GetData, 2901).
--define(wxListEvent_GetMask, 2902).
--define(wxListEvent_GetItem, 2903).
--define(wxListEvent_IsEditCancelled, 2904).
--define(wxDateEvent_GetDate, 2905).
--define(wxCalendarEvent_GetWeekDay, 2906).
--define(wxFileDirPickerEvent_GetPath, 2907).
--define(wxColourPickerEvent_GetColour, 2908).
--define(wxFontPickerEvent_GetFont, 2909).
--define(wxStyledTextEvent_GetPosition, 2910).
--define(wxStyledTextEvent_GetKey, 2911).
--define(wxStyledTextEvent_GetModifiers, 2912).
--define(wxStyledTextEvent_GetModificationType, 2913).
--define(wxStyledTextEvent_GetText, 2914).
--define(wxStyledTextEvent_GetLength, 2915).
--define(wxStyledTextEvent_GetLinesAdded, 2916).
--define(wxStyledTextEvent_GetLine, 2917).
--define(wxStyledTextEvent_GetFoldLevelNow, 2918).
--define(wxStyledTextEvent_GetFoldLevelPrev, 2919).
--define(wxStyledTextEvent_GetMargin, 2920).
--define(wxStyledTextEvent_GetMessage, 2921).
--define(wxStyledTextEvent_GetWParam, 2922).
--define(wxStyledTextEvent_GetLParam, 2923).
--define(wxStyledTextEvent_GetListType, 2924).
--define(wxStyledTextEvent_GetX, 2925).
--define(wxStyledTextEvent_GetY, 2926).
--define(wxStyledTextEvent_GetDragText, 2927).
--define(wxStyledTextEvent_GetDragAllowMove, 2928).
--define(wxStyledTextEvent_GetDragResult, 2929).
--define(wxStyledTextEvent_GetShift, 2930).
--define(wxStyledTextEvent_GetControl, 2931).
--define(wxStyledTextEvent_GetAlt, 2932).
--define(utils_wxGetKeyState, 2933).
--define(utils_wxGetMousePosition, 2934).
--define(utils_wxGetMouseState, 2935).
--define(utils_wxSetDetectableAutoRepeat, 2936).
--define(utils_wxBell, 2937).
--define(utils_wxFindMenuItemId, 2938).
--define(utils_wxGenericFindWindowAtPoint, 2939).
--define(utils_wxFindWindowAtPoint, 2940).
--define(utils_wxBeginBusyCursor, 2941).
--define(utils_wxEndBusyCursor, 2942).
--define(utils_wxIsBusy, 2943).
--define(utils_wxShutdown, 2944).
--define(utils_wxShell, 2945).
--define(utils_wxLaunchDefaultBrowser, 2946).
--define(utils_wxGetEmailAddress, 2947).
--define(utils_wxGetUserId, 2948).
--define(utils_wxGetHomeDir, 2949).
--define(utils_wxNewId, 2950).
--define(utils_wxRegisterId, 2951).
--define(utils_wxGetCurrentId, 2952).
--define(utils_wxGetOsDescription, 2953).
--define(utils_wxIsPlatformLittleEndian, 2954).
--define(utils_wxIsPlatform64Bit, 2955).
--define(gdicmn_wxDisplaySize, 2956).
--define(gdicmn_wxSetCursor, 2957).
--define(wxPrintout_new, 2958).
--define(wxPrintout_destruct, 2959).
--define(wxPrintout_GetDC, 2960).
--define(wxPrintout_GetPageSizeMM, 2961).
--define(wxPrintout_GetPageSizePixels, 2962).
--define(wxPrintout_GetPaperRectPixels, 2963).
--define(wxPrintout_GetPPIPrinter, 2964).
--define(wxPrintout_GetPPIScreen, 2965).
--define(wxPrintout_GetTitle, 2966).
--define(wxPrintout_IsPreview, 2967).
--define(wxPrintout_FitThisSizeToPaper, 2968).
--define(wxPrintout_FitThisSizeToPage, 2969).
--define(wxPrintout_FitThisSizeToPageMargins, 2970).
--define(wxPrintout_MapScreenSizeToPaper, 2971).
--define(wxPrintout_MapScreenSizeToPage, 2972).
--define(wxPrintout_MapScreenSizeToPageMargins, 2973).
--define(wxPrintout_MapScreenSizeToDevice, 2974).
--define(wxPrintout_GetLogicalPaperRect, 2975).
--define(wxPrintout_GetLogicalPageRect, 2976).
--define(wxPrintout_GetLogicalPageMarginsRect, 2977).
--define(wxPrintout_SetLogicalOrigin, 2978).
--define(wxPrintout_OffsetLogicalOrigin, 2979).
--define(wxStyledTextCtrl_new_2, 2980).
--define(wxStyledTextCtrl_new_0, 2981).
--define(wxStyledTextCtrl_destruct, 2982).
--define(wxStyledTextCtrl_Create, 2983).
--define(wxStyledTextCtrl_AddText, 2984).
--define(wxStyledTextCtrl_AddStyledText, 2985).
--define(wxStyledTextCtrl_InsertText, 2986).
--define(wxStyledTextCtrl_ClearAll, 2987).
--define(wxStyledTextCtrl_ClearDocumentStyle, 2988).
--define(wxStyledTextCtrl_GetLength, 2989).
--define(wxStyledTextCtrl_GetCharAt, 2990).
--define(wxStyledTextCtrl_GetCurrentPos, 2991).
--define(wxStyledTextCtrl_GetAnchor, 2992).
--define(wxStyledTextCtrl_GetStyleAt, 2993).
--define(wxStyledTextCtrl_Redo, 2994).
--define(wxStyledTextCtrl_SetUndoCollection, 2995).
--define(wxStyledTextCtrl_SelectAll, 2996).
--define(wxStyledTextCtrl_SetSavePoint, 2997).
--define(wxStyledTextCtrl_GetStyledText, 2998).
--define(wxStyledTextCtrl_CanRedo, 2999).
--define(wxStyledTextCtrl_MarkerLineFromHandle, 3000).
--define(wxStyledTextCtrl_MarkerDeleteHandle, 3001).
--define(wxStyledTextCtrl_GetUndoCollection, 3002).
--define(wxStyledTextCtrl_GetViewWhiteSpace, 3003).
--define(wxStyledTextCtrl_SetViewWhiteSpace, 3004).
--define(wxStyledTextCtrl_PositionFromPoint, 3005).
--define(wxStyledTextCtrl_PositionFromPointClose, 3006).
--define(wxStyledTextCtrl_GotoLine, 3007).
--define(wxStyledTextCtrl_GotoPos, 3008).
--define(wxStyledTextCtrl_SetAnchor, 3009).
--define(wxStyledTextCtrl_GetCurLine, 3010).
--define(wxStyledTextCtrl_GetEndStyled, 3011).
--define(wxStyledTextCtrl_ConvertEOLs, 3012).
--define(wxStyledTextCtrl_GetEOLMode, 3013).
--define(wxStyledTextCtrl_SetEOLMode, 3014).
--define(wxStyledTextCtrl_StartStyling, 3015).
--define(wxStyledTextCtrl_SetStyling, 3016).
--define(wxStyledTextCtrl_GetBufferedDraw, 3017).
--define(wxStyledTextCtrl_SetBufferedDraw, 3018).
--define(wxStyledTextCtrl_SetTabWidth, 3019).
--define(wxStyledTextCtrl_GetTabWidth, 3020).
--define(wxStyledTextCtrl_SetCodePage, 3021).
--define(wxStyledTextCtrl_MarkerDefine, 3022).
--define(wxStyledTextCtrl_MarkerSetForeground, 3023).
--define(wxStyledTextCtrl_MarkerSetBackground, 3024).
--define(wxStyledTextCtrl_MarkerAdd, 3025).
--define(wxStyledTextCtrl_MarkerDelete, 3026).
--define(wxStyledTextCtrl_MarkerDeleteAll, 3027).
--define(wxStyledTextCtrl_MarkerGet, 3028).
--define(wxStyledTextCtrl_MarkerNext, 3029).
--define(wxStyledTextCtrl_MarkerPrevious, 3030).
--define(wxStyledTextCtrl_MarkerDefineBitmap, 3031).
--define(wxStyledTextCtrl_MarkerAddSet, 3032).
--define(wxStyledTextCtrl_MarkerSetAlpha, 3033).
--define(wxStyledTextCtrl_SetMarginType, 3034).
--define(wxStyledTextCtrl_GetMarginType, 3035).
--define(wxStyledTextCtrl_SetMarginWidth, 3036).
--define(wxStyledTextCtrl_GetMarginWidth, 3037).
--define(wxStyledTextCtrl_SetMarginMask, 3038).
--define(wxStyledTextCtrl_GetMarginMask, 3039).
--define(wxStyledTextCtrl_SetMarginSensitive, 3040).
--define(wxStyledTextCtrl_GetMarginSensitive, 3041).
--define(wxStyledTextCtrl_StyleClearAll, 3042).
--define(wxStyledTextCtrl_StyleSetForeground, 3043).
--define(wxStyledTextCtrl_StyleSetBackground, 3044).
--define(wxStyledTextCtrl_StyleSetBold, 3045).
--define(wxStyledTextCtrl_StyleSetItalic, 3046).
--define(wxStyledTextCtrl_StyleSetSize, 3047).
--define(wxStyledTextCtrl_StyleSetFaceName, 3048).
--define(wxStyledTextCtrl_StyleSetEOLFilled, 3049).
--define(wxStyledTextCtrl_StyleResetDefault, 3050).
--define(wxStyledTextCtrl_StyleSetUnderline, 3051).
--define(wxStyledTextCtrl_StyleSetCase, 3052).
--define(wxStyledTextCtrl_StyleSetHotSpot, 3053).
--define(wxStyledTextCtrl_SetSelForeground, 3054).
--define(wxStyledTextCtrl_SetSelBackground, 3055).
--define(wxStyledTextCtrl_GetSelAlpha, 3056).
--define(wxStyledTextCtrl_SetSelAlpha, 3057).
--define(wxStyledTextCtrl_SetCaretForeground, 3058).
--define(wxStyledTextCtrl_CmdKeyAssign, 3059).
--define(wxStyledTextCtrl_CmdKeyClear, 3060).
--define(wxStyledTextCtrl_CmdKeyClearAll, 3061).
--define(wxStyledTextCtrl_SetStyleBytes, 3062).
--define(wxStyledTextCtrl_StyleSetVisible, 3063).
--define(wxStyledTextCtrl_GetCaretPeriod, 3064).
--define(wxStyledTextCtrl_SetCaretPeriod, 3065).
--define(wxStyledTextCtrl_SetWordChars, 3066).
--define(wxStyledTextCtrl_BeginUndoAction, 3067).
--define(wxStyledTextCtrl_EndUndoAction, 3068).
--define(wxStyledTextCtrl_IndicatorSetStyle, 3069).
--define(wxStyledTextCtrl_IndicatorGetStyle, 3070).
--define(wxStyledTextCtrl_IndicatorSetForeground, 3071).
--define(wxStyledTextCtrl_IndicatorGetForeground, 3072).
--define(wxStyledTextCtrl_SetWhitespaceForeground, 3073).
--define(wxStyledTextCtrl_SetWhitespaceBackground, 3074).
--define(wxStyledTextCtrl_GetStyleBits, 3075).
--define(wxStyledTextCtrl_SetLineState, 3076).
--define(wxStyledTextCtrl_GetLineState, 3077).
--define(wxStyledTextCtrl_GetMaxLineState, 3078).
--define(wxStyledTextCtrl_GetCaretLineVisible, 3079).
--define(wxStyledTextCtrl_SetCaretLineVisible, 3080).
--define(wxStyledTextCtrl_GetCaretLineBackground, 3081).
--define(wxStyledTextCtrl_SetCaretLineBackground, 3082).
--define(wxStyledTextCtrl_AutoCompShow, 3083).
--define(wxStyledTextCtrl_AutoCompCancel, 3084).
--define(wxStyledTextCtrl_AutoCompActive, 3085).
--define(wxStyledTextCtrl_AutoCompPosStart, 3086).
--define(wxStyledTextCtrl_AutoCompComplete, 3087).
--define(wxStyledTextCtrl_AutoCompStops, 3088).
--define(wxStyledTextCtrl_AutoCompSetSeparator, 3089).
--define(wxStyledTextCtrl_AutoCompGetSeparator, 3090).
--define(wxStyledTextCtrl_AutoCompSelect, 3091).
--define(wxStyledTextCtrl_AutoCompSetCancelAtStart, 3092).
--define(wxStyledTextCtrl_AutoCompGetCancelAtStart, 3093).
--define(wxStyledTextCtrl_AutoCompSetFillUps, 3094).
--define(wxStyledTextCtrl_AutoCompSetChooseSingle, 3095).
--define(wxStyledTextCtrl_AutoCompGetChooseSingle, 3096).
--define(wxStyledTextCtrl_AutoCompSetIgnoreCase, 3097).
--define(wxStyledTextCtrl_AutoCompGetIgnoreCase, 3098).
--define(wxStyledTextCtrl_UserListShow, 3099).
--define(wxStyledTextCtrl_AutoCompSetAutoHide, 3100).
--define(wxStyledTextCtrl_AutoCompGetAutoHide, 3101).
--define(wxStyledTextCtrl_AutoCompSetDropRestOfWord, 3102).
--define(wxStyledTextCtrl_AutoCompGetDropRestOfWord, 3103).
--define(wxStyledTextCtrl_RegisterImage, 3104).
--define(wxStyledTextCtrl_ClearRegisteredImages, 3105).
--define(wxStyledTextCtrl_AutoCompGetTypeSeparator, 3106).
--define(wxStyledTextCtrl_AutoCompSetTypeSeparator, 3107).
--define(wxStyledTextCtrl_AutoCompSetMaxWidth, 3108).
--define(wxStyledTextCtrl_AutoCompGetMaxWidth, 3109).
--define(wxStyledTextCtrl_AutoCompSetMaxHeight, 3110).
--define(wxStyledTextCtrl_AutoCompGetMaxHeight, 3111).
--define(wxStyledTextCtrl_SetIndent, 3112).
--define(wxStyledTextCtrl_GetIndent, 3113).
--define(wxStyledTextCtrl_SetUseTabs, 3114).
--define(wxStyledTextCtrl_GetUseTabs, 3115).
--define(wxStyledTextCtrl_SetLineIndentation, 3116).
--define(wxStyledTextCtrl_GetLineIndentation, 3117).
--define(wxStyledTextCtrl_GetLineIndentPosition, 3118).
--define(wxStyledTextCtrl_GetColumn, 3119).
--define(wxStyledTextCtrl_SetUseHorizontalScrollBar, 3120).
--define(wxStyledTextCtrl_GetUseHorizontalScrollBar, 3121).
--define(wxStyledTextCtrl_SetIndentationGuides, 3122).
--define(wxStyledTextCtrl_GetIndentationGuides, 3123).
--define(wxStyledTextCtrl_SetHighlightGuide, 3124).
--define(wxStyledTextCtrl_GetHighlightGuide, 3125).
--define(wxStyledTextCtrl_GetLineEndPosition, 3126).
--define(wxStyledTextCtrl_GetCodePage, 3127).
--define(wxStyledTextCtrl_GetCaretForeground, 3128).
--define(wxStyledTextCtrl_GetReadOnly, 3129).
--define(wxStyledTextCtrl_SetCurrentPos, 3130).
--define(wxStyledTextCtrl_SetSelectionStart, 3131).
--define(wxStyledTextCtrl_GetSelectionStart, 3132).
--define(wxStyledTextCtrl_SetSelectionEnd, 3133).
--define(wxStyledTextCtrl_GetSelectionEnd, 3134).
--define(wxStyledTextCtrl_SetPrintMagnification, 3135).
--define(wxStyledTextCtrl_GetPrintMagnification, 3136).
--define(wxStyledTextCtrl_SetPrintColourMode, 3137).
--define(wxStyledTextCtrl_GetPrintColourMode, 3138).
--define(wxStyledTextCtrl_FindText, 3139).
--define(wxStyledTextCtrl_FormatRange, 3140).
--define(wxStyledTextCtrl_GetFirstVisibleLine, 3141).
--define(wxStyledTextCtrl_GetLine, 3142).
--define(wxStyledTextCtrl_GetLineCount, 3143).
--define(wxStyledTextCtrl_SetMarginLeft, 3144).
--define(wxStyledTextCtrl_GetMarginLeft, 3145).
--define(wxStyledTextCtrl_SetMarginRight, 3146).
--define(wxStyledTextCtrl_GetMarginRight, 3147).
--define(wxStyledTextCtrl_GetModify, 3148).
--define(wxStyledTextCtrl_SetSelection, 3149).
--define(wxStyledTextCtrl_GetSelectedText, 3150).
--define(wxStyledTextCtrl_GetTextRange, 3151).
--define(wxStyledTextCtrl_HideSelection, 3152).
--define(wxStyledTextCtrl_LineFromPosition, 3153).
--define(wxStyledTextCtrl_PositionFromLine, 3154).
--define(wxStyledTextCtrl_LineScroll, 3155).
--define(wxStyledTextCtrl_EnsureCaretVisible, 3156).
--define(wxStyledTextCtrl_ReplaceSelection, 3157).
--define(wxStyledTextCtrl_SetReadOnly, 3158).
--define(wxStyledTextCtrl_CanPaste, 3159).
--define(wxStyledTextCtrl_CanUndo, 3160).
--define(wxStyledTextCtrl_EmptyUndoBuffer, 3161).
--define(wxStyledTextCtrl_Undo, 3162).
--define(wxStyledTextCtrl_Cut, 3163).
--define(wxStyledTextCtrl_Copy, 3164).
--define(wxStyledTextCtrl_Paste, 3165).
--define(wxStyledTextCtrl_Clear, 3166).
--define(wxStyledTextCtrl_SetText, 3167).
--define(wxStyledTextCtrl_GetText, 3168).
--define(wxStyledTextCtrl_GetTextLength, 3169).
--define(wxStyledTextCtrl_GetOvertype, 3170).
--define(wxStyledTextCtrl_SetCaretWidth, 3171).
--define(wxStyledTextCtrl_GetCaretWidth, 3172).
--define(wxStyledTextCtrl_SetTargetStart, 3173).
--define(wxStyledTextCtrl_GetTargetStart, 3174).
--define(wxStyledTextCtrl_SetTargetEnd, 3175).
--define(wxStyledTextCtrl_GetTargetEnd, 3176).
--define(wxStyledTextCtrl_ReplaceTarget, 3177).
--define(wxStyledTextCtrl_SearchInTarget, 3178).
--define(wxStyledTextCtrl_SetSearchFlags, 3179).
--define(wxStyledTextCtrl_GetSearchFlags, 3180).
--define(wxStyledTextCtrl_CallTipShow, 3181).
--define(wxStyledTextCtrl_CallTipCancel, 3182).
--define(wxStyledTextCtrl_CallTipActive, 3183).
--define(wxStyledTextCtrl_CallTipPosAtStart, 3184).
--define(wxStyledTextCtrl_CallTipSetHighlight, 3185).
--define(wxStyledTextCtrl_CallTipSetBackground, 3186).
--define(wxStyledTextCtrl_CallTipSetForeground, 3187).
--define(wxStyledTextCtrl_CallTipSetForegroundHighlight, 3188).
--define(wxStyledTextCtrl_CallTipUseStyle, 3189).
--define(wxStyledTextCtrl_VisibleFromDocLine, 3190).
--define(wxStyledTextCtrl_DocLineFromVisible, 3191).
--define(wxStyledTextCtrl_WrapCount, 3192).
--define(wxStyledTextCtrl_SetFoldLevel, 3193).
--define(wxStyledTextCtrl_GetFoldLevel, 3194).
--define(wxStyledTextCtrl_GetLastChild, 3195).
--define(wxStyledTextCtrl_GetFoldParent, 3196).
--define(wxStyledTextCtrl_ShowLines, 3197).
--define(wxStyledTextCtrl_HideLines, 3198).
--define(wxStyledTextCtrl_GetLineVisible, 3199).
--define(wxStyledTextCtrl_SetFoldExpanded, 3200).
--define(wxStyledTextCtrl_GetFoldExpanded, 3201).
--define(wxStyledTextCtrl_ToggleFold, 3202).
--define(wxStyledTextCtrl_EnsureVisible, 3203).
--define(wxStyledTextCtrl_SetFoldFlags, 3204).
--define(wxStyledTextCtrl_EnsureVisibleEnforcePolicy, 3205).
--define(wxStyledTextCtrl_SetTabIndents, 3206).
--define(wxStyledTextCtrl_GetTabIndents, 3207).
--define(wxStyledTextCtrl_SetBackSpaceUnIndents, 3208).
--define(wxStyledTextCtrl_GetBackSpaceUnIndents, 3209).
--define(wxStyledTextCtrl_SetMouseDwellTime, 3210).
--define(wxStyledTextCtrl_GetMouseDwellTime, 3211).
--define(wxStyledTextCtrl_WordStartPosition, 3212).
--define(wxStyledTextCtrl_WordEndPosition, 3213).
--define(wxStyledTextCtrl_SetWrapMode, 3214).
--define(wxStyledTextCtrl_GetWrapMode, 3215).
--define(wxStyledTextCtrl_SetWrapVisualFlags, 3216).
--define(wxStyledTextCtrl_GetWrapVisualFlags, 3217).
--define(wxStyledTextCtrl_SetWrapVisualFlagsLocation, 3218).
--define(wxStyledTextCtrl_GetWrapVisualFlagsLocation, 3219).
--define(wxStyledTextCtrl_SetWrapStartIndent, 3220).
--define(wxStyledTextCtrl_GetWrapStartIndent, 3221).
--define(wxStyledTextCtrl_SetLayoutCache, 3222).
--define(wxStyledTextCtrl_GetLayoutCache, 3223).
--define(wxStyledTextCtrl_SetScrollWidth, 3224).
--define(wxStyledTextCtrl_GetScrollWidth, 3225).
--define(wxStyledTextCtrl_TextWidth, 3226).
--define(wxStyledTextCtrl_GetEndAtLastLine, 3227).
--define(wxStyledTextCtrl_TextHeight, 3228).
--define(wxStyledTextCtrl_SetUseVerticalScrollBar, 3229).
--define(wxStyledTextCtrl_GetUseVerticalScrollBar, 3230).
--define(wxStyledTextCtrl_AppendText, 3231).
--define(wxStyledTextCtrl_GetTwoPhaseDraw, 3232).
--define(wxStyledTextCtrl_SetTwoPhaseDraw, 3233).
--define(wxStyledTextCtrl_TargetFromSelection, 3234).
--define(wxStyledTextCtrl_LinesJoin, 3235).
--define(wxStyledTextCtrl_LinesSplit, 3236).
--define(wxStyledTextCtrl_SetFoldMarginColour, 3237).
--define(wxStyledTextCtrl_SetFoldMarginHiColour, 3238).
--define(wxStyledTextCtrl_LineDown, 3239).
--define(wxStyledTextCtrl_LineDownExtend, 3240).
--define(wxStyledTextCtrl_LineUp, 3241).
--define(wxStyledTextCtrl_LineUpExtend, 3242).
--define(wxStyledTextCtrl_CharLeft, 3243).
--define(wxStyledTextCtrl_CharLeftExtend, 3244).
--define(wxStyledTextCtrl_CharRight, 3245).
--define(wxStyledTextCtrl_CharRightExtend, 3246).
--define(wxStyledTextCtrl_WordLeft, 3247).
--define(wxStyledTextCtrl_WordLeftExtend, 3248).
--define(wxStyledTextCtrl_WordRight, 3249).
--define(wxStyledTextCtrl_WordRightExtend, 3250).
--define(wxStyledTextCtrl_Home, 3251).
--define(wxStyledTextCtrl_HomeExtend, 3252).
--define(wxStyledTextCtrl_LineEnd, 3253).
--define(wxStyledTextCtrl_LineEndExtend, 3254).
--define(wxStyledTextCtrl_DocumentStart, 3255).
--define(wxStyledTextCtrl_DocumentStartExtend, 3256).
--define(wxStyledTextCtrl_DocumentEnd, 3257).
--define(wxStyledTextCtrl_DocumentEndExtend, 3258).
--define(wxStyledTextCtrl_PageUp, 3259).
--define(wxStyledTextCtrl_PageUpExtend, 3260).
--define(wxStyledTextCtrl_PageDown, 3261).
--define(wxStyledTextCtrl_PageDownExtend, 3262).
--define(wxStyledTextCtrl_EditToggleOvertype, 3263).
--define(wxStyledTextCtrl_Cancel, 3264).
--define(wxStyledTextCtrl_DeleteBack, 3265).
--define(wxStyledTextCtrl_Tab, 3266).
--define(wxStyledTextCtrl_BackTab, 3267).
--define(wxStyledTextCtrl_NewLine, 3268).
--define(wxStyledTextCtrl_FormFeed, 3269).
--define(wxStyledTextCtrl_VCHome, 3270).
--define(wxStyledTextCtrl_VCHomeExtend, 3271).
--define(wxStyledTextCtrl_ZoomIn, 3272).
--define(wxStyledTextCtrl_ZoomOut, 3273).
--define(wxStyledTextCtrl_DelWordLeft, 3274).
--define(wxStyledTextCtrl_DelWordRight, 3275).
--define(wxStyledTextCtrl_LineCut, 3276).
--define(wxStyledTextCtrl_LineDelete, 3277).
--define(wxStyledTextCtrl_LineTranspose, 3278).
--define(wxStyledTextCtrl_LineDuplicate, 3279).
--define(wxStyledTextCtrl_LowerCase, 3280).
--define(wxStyledTextCtrl_UpperCase, 3281).
--define(wxStyledTextCtrl_LineScrollDown, 3282).
--define(wxStyledTextCtrl_LineScrollUp, 3283).
--define(wxStyledTextCtrl_DeleteBackNotLine, 3284).
--define(wxStyledTextCtrl_HomeDisplay, 3285).
--define(wxStyledTextCtrl_HomeDisplayExtend, 3286).
--define(wxStyledTextCtrl_LineEndDisplay, 3287).
--define(wxStyledTextCtrl_LineEndDisplayExtend, 3288).
--define(wxStyledTextCtrl_HomeWrapExtend, 3289).
--define(wxStyledTextCtrl_LineEndWrap, 3290).
--define(wxStyledTextCtrl_LineEndWrapExtend, 3291).
--define(wxStyledTextCtrl_VCHomeWrap, 3292).
--define(wxStyledTextCtrl_VCHomeWrapExtend, 3293).
--define(wxStyledTextCtrl_LineCopy, 3294).
--define(wxStyledTextCtrl_MoveCaretInsideView, 3295).
--define(wxStyledTextCtrl_LineLength, 3296).
--define(wxStyledTextCtrl_BraceHighlight, 3297).
--define(wxStyledTextCtrl_BraceBadLight, 3298).
--define(wxStyledTextCtrl_BraceMatch, 3299).
--define(wxStyledTextCtrl_GetViewEOL, 3300).
--define(wxStyledTextCtrl_SetViewEOL, 3301).
--define(wxStyledTextCtrl_SetModEventMask, 3302).
--define(wxStyledTextCtrl_GetEdgeColumn, 3303).
--define(wxStyledTextCtrl_SetEdgeColumn, 3304).
--define(wxStyledTextCtrl_SetEdgeMode, 3305).
--define(wxStyledTextCtrl_GetEdgeMode, 3306).
--define(wxStyledTextCtrl_GetEdgeColour, 3307).
--define(wxStyledTextCtrl_SetEdgeColour, 3308).
--define(wxStyledTextCtrl_SearchAnchor, 3309).
--define(wxStyledTextCtrl_SearchNext, 3310).
--define(wxStyledTextCtrl_SearchPrev, 3311).
--define(wxStyledTextCtrl_LinesOnScreen, 3312).
--define(wxStyledTextCtrl_UsePopUp, 3313).
--define(wxStyledTextCtrl_SelectionIsRectangle, 3314).
--define(wxStyledTextCtrl_SetZoom, 3315).
--define(wxStyledTextCtrl_GetZoom, 3316).
--define(wxStyledTextCtrl_GetModEventMask, 3317).
--define(wxStyledTextCtrl_SetSTCFocus, 3318).
--define(wxStyledTextCtrl_GetSTCFocus, 3319).
--define(wxStyledTextCtrl_SetStatus, 3320).
--define(wxStyledTextCtrl_GetStatus, 3321).
--define(wxStyledTextCtrl_SetMouseDownCaptures, 3322).
--define(wxStyledTextCtrl_GetMouseDownCaptures, 3323).
--define(wxStyledTextCtrl_SetSTCCursor, 3324).
--define(wxStyledTextCtrl_GetSTCCursor, 3325).
--define(wxStyledTextCtrl_SetControlCharSymbol, 3326).
--define(wxStyledTextCtrl_GetControlCharSymbol, 3327).
--define(wxStyledTextCtrl_WordPartLeft, 3328).
--define(wxStyledTextCtrl_WordPartLeftExtend, 3329).
--define(wxStyledTextCtrl_WordPartRight, 3330).
--define(wxStyledTextCtrl_WordPartRightExtend, 3331).
--define(wxStyledTextCtrl_SetVisiblePolicy, 3332).
--define(wxStyledTextCtrl_DelLineLeft, 3333).
--define(wxStyledTextCtrl_DelLineRight, 3334).
--define(wxStyledTextCtrl_GetXOffset, 3335).
--define(wxStyledTextCtrl_ChooseCaretX, 3336).
--define(wxStyledTextCtrl_SetXCaretPolicy, 3337).
--define(wxStyledTextCtrl_SetYCaretPolicy, 3338).
--define(wxStyledTextCtrl_GetPrintWrapMode, 3339).
--define(wxStyledTextCtrl_SetHotspotActiveForeground, 3340).
--define(wxStyledTextCtrl_SetHotspotActiveBackground, 3341).
--define(wxStyledTextCtrl_SetHotspotActiveUnderline, 3342).
--define(wxStyledTextCtrl_SetHotspotSingleLine, 3343).
--define(wxStyledTextCtrl_ParaDownExtend, 3344).
--define(wxStyledTextCtrl_ParaUp, 3345).
--define(wxStyledTextCtrl_ParaUpExtend, 3346).
--define(wxStyledTextCtrl_PositionBefore, 3347).
--define(wxStyledTextCtrl_PositionAfter, 3348).
--define(wxStyledTextCtrl_CopyRange, 3349).
--define(wxStyledTextCtrl_CopyText, 3350).
--define(wxStyledTextCtrl_SetSelectionMode, 3351).
--define(wxStyledTextCtrl_GetSelectionMode, 3352).
--define(wxStyledTextCtrl_LineDownRectExtend, 3353).
--define(wxStyledTextCtrl_LineUpRectExtend, 3354).
--define(wxStyledTextCtrl_CharLeftRectExtend, 3355).
--define(wxStyledTextCtrl_CharRightRectExtend, 3356).
--define(wxStyledTextCtrl_HomeRectExtend, 3357).
--define(wxStyledTextCtrl_VCHomeRectExtend, 3358).
--define(wxStyledTextCtrl_LineEndRectExtend, 3359).
--define(wxStyledTextCtrl_PageUpRectExtend, 3360).
--define(wxStyledTextCtrl_PageDownRectExtend, 3361).
--define(wxStyledTextCtrl_StutteredPageUp, 3362).
--define(wxStyledTextCtrl_StutteredPageUpExtend, 3363).
--define(wxStyledTextCtrl_StutteredPageDown, 3364).
--define(wxStyledTextCtrl_StutteredPageDownExtend, 3365).
--define(wxStyledTextCtrl_WordLeftEnd, 3366).
--define(wxStyledTextCtrl_WordLeftEndExtend, 3367).
--define(wxStyledTextCtrl_WordRightEnd, 3368).
--define(wxStyledTextCtrl_WordRightEndExtend, 3369).
--define(wxStyledTextCtrl_SetWhitespaceChars, 3370).
--define(wxStyledTextCtrl_SetCharsDefault, 3371).
--define(wxStyledTextCtrl_AutoCompGetCurrent, 3372).
--define(wxStyledTextCtrl_Allocate, 3373).
--define(wxStyledTextCtrl_FindColumn, 3374).
--define(wxStyledTextCtrl_GetCaretSticky, 3375).
--define(wxStyledTextCtrl_SetCaretSticky, 3376).
--define(wxStyledTextCtrl_ToggleCaretSticky, 3377).
--define(wxStyledTextCtrl_SetPasteConvertEndings, 3378).
--define(wxStyledTextCtrl_GetPasteConvertEndings, 3379).
--define(wxStyledTextCtrl_SelectionDuplicate, 3380).
--define(wxStyledTextCtrl_SetCaretLineBackAlpha, 3381).
--define(wxStyledTextCtrl_GetCaretLineBackAlpha, 3382).
--define(wxStyledTextCtrl_StartRecord, 3383).
--define(wxStyledTextCtrl_StopRecord, 3384).
--define(wxStyledTextCtrl_SetLexer, 3385).
--define(wxStyledTextCtrl_GetLexer, 3386).
--define(wxStyledTextCtrl_Colourise, 3387).
--define(wxStyledTextCtrl_SetProperty, 3388).
--define(wxStyledTextCtrl_SetKeyWords, 3389).
--define(wxStyledTextCtrl_SetLexerLanguage, 3390).
--define(wxStyledTextCtrl_GetProperty, 3391).
--define(wxStyledTextCtrl_GetStyleBitsNeeded, 3392).
--define(wxStyledTextCtrl_GetCurrentLine, 3393).
--define(wxStyledTextCtrl_StyleSetSpec, 3394).
--define(wxStyledTextCtrl_StyleSetFont, 3395).
--define(wxStyledTextCtrl_StyleSetFontAttr, 3396).
--define(wxStyledTextCtrl_StyleSetCharacterSet, 3397).
--define(wxStyledTextCtrl_StyleSetFontEncoding, 3398).
--define(wxStyledTextCtrl_CmdKeyExecute, 3399).
--define(wxStyledTextCtrl_SetMargins, 3400).
--define(wxStyledTextCtrl_GetSelection, 3401).
--define(wxStyledTextCtrl_PointFromPosition, 3402).
--define(wxStyledTextCtrl_ScrollToLine, 3403).
--define(wxStyledTextCtrl_ScrollToColumn, 3404).
--define(wxStyledTextCtrl_SetVScrollBar, 3405).
--define(wxStyledTextCtrl_SetHScrollBar, 3406).
--define(wxStyledTextCtrl_GetLastKeydownProcessed, 3407).
--define(wxStyledTextCtrl_SetLastKeydownProcessed, 3408).
--define(wxStyledTextCtrl_SaveFile, 3409).
--define(wxStyledTextCtrl_LoadFile, 3410).
--define(wxStyledTextCtrl_DoDragOver, 3411).
--define(wxStyledTextCtrl_DoDropText, 3412).
--define(wxStyledTextCtrl_GetUseAntiAliasing, 3413).
--define(wxStyledTextCtrl_AddTextRaw, 3414).
--define(wxStyledTextCtrl_InsertTextRaw, 3415).
--define(wxStyledTextCtrl_GetCurLineRaw, 3416).
--define(wxStyledTextCtrl_GetLineRaw, 3417).
--define(wxStyledTextCtrl_GetSelectedTextRaw, 3418).
--define(wxStyledTextCtrl_GetTextRangeRaw, 3419).
--define(wxStyledTextCtrl_SetTextRaw, 3420).
--define(wxStyledTextCtrl_GetTextRaw, 3421).
--define(wxStyledTextCtrl_AppendTextRaw, 3422).
--define(wxArtProvider_GetBitmap, 3423).
--define(wxArtProvider_GetIcon, 3424).
--define(wxTreeEvent_GetKeyCode, 3425).
--define(wxTreeEvent_GetItem, 3426).
--define(wxTreeEvent_GetKeyEvent, 3427).
--define(wxTreeEvent_GetLabel, 3428).
--define(wxTreeEvent_GetOldItem, 3429).
--define(wxTreeEvent_GetPoint, 3430).
--define(wxTreeEvent_IsEditCancelled, 3431).
--define(wxTreeEvent_SetToolTip, 3432).
--define(wxNotebookEvent_GetOldSelection, 3433).
--define(wxNotebookEvent_GetSelection, 3434).
--define(wxNotebookEvent_SetOldSelection, 3435).
--define(wxNotebookEvent_SetSelection, 3436).
--define(wxFileDataObject_new, 3437).
--define(wxFileDataObject_AddFile, 3438).
--define(wxFileDataObject_GetFilenames, 3439).
--define(wxFileDataObject_destroy, 3440).
--define(wxTextDataObject_new, 3441).
--define(wxTextDataObject_GetTextLength, 3442).
--define(wxTextDataObject_GetText, 3443).
--define(wxTextDataObject_SetText, 3444).
--define(wxTextDataObject_destroy, 3445).
--define(wxBitmapDataObject_new_1_1, 3446).
--define(wxBitmapDataObject_new_1_0, 3447).
--define(wxBitmapDataObject_GetBitmap, 3448).
--define(wxBitmapDataObject_SetBitmap, 3449).
--define(wxBitmapDataObject_destroy, 3450).
--define(wxClipboard_new, 3452).
--define(wxClipboard_destruct, 3453).
--define(wxClipboard_AddData, 3454).
--define(wxClipboard_Clear, 3455).
--define(wxClipboard_Close, 3456).
--define(wxClipboard_Flush, 3457).
--define(wxClipboard_GetData, 3458).
--define(wxClipboard_IsOpened, 3459).
--define(wxClipboard_Open, 3460).
--define(wxClipboard_SetData, 3461).
--define(wxClipboard_UsePrimarySelection, 3463).
--define(wxClipboard_IsSupported, 3464).
--define(wxClipboard_Get, 3465).
--define(wxSpinEvent_GetPosition, 3466).
--define(wxSpinEvent_SetPosition, 3467).
--define(wxSplitterWindow_new_0, 3468).
--define(wxSplitterWindow_new_2, 3469).
--define(wxSplitterWindow_destruct, 3470).
--define(wxSplitterWindow_Create, 3471).
--define(wxSplitterWindow_GetMinimumPaneSize, 3472).
--define(wxSplitterWindow_GetSashGravity, 3473).
--define(wxSplitterWindow_GetSashPosition, 3474).
--define(wxSplitterWindow_GetSplitMode, 3475).
--define(wxSplitterWindow_GetWindow1, 3476).
--define(wxSplitterWindow_GetWindow2, 3477).
--define(wxSplitterWindow_Initialize, 3478).
--define(wxSplitterWindow_IsSplit, 3479).
--define(wxSplitterWindow_ReplaceWindow, 3480).
--define(wxSplitterWindow_SetSashGravity, 3481).
--define(wxSplitterWindow_SetSashPosition, 3482).
--define(wxSplitterWindow_SetSashSize, 3483).
--define(wxSplitterWindow_SetMinimumPaneSize, 3484).
--define(wxSplitterWindow_SetSplitMode, 3485).
--define(wxSplitterWindow_SplitHorizontally, 3486).
--define(wxSplitterWindow_SplitVertically, 3487).
--define(wxSplitterWindow_Unsplit, 3488).
--define(wxSplitterWindow_UpdateSize, 3489).
--define(wxSplitterEvent_GetSashPosition, 3490).
--define(wxSplitterEvent_GetX, 3491).
--define(wxSplitterEvent_GetY, 3492).
--define(wxSplitterEvent_GetWindowBeingRemoved, 3493).
--define(wxSplitterEvent_SetSashPosition, 3494).
--define(wxHtmlWindow_new_0, 3495).
--define(wxHtmlWindow_new_2, 3496).
--define(wxHtmlWindow_AppendToPage, 3497).
--define(wxHtmlWindow_GetOpenedAnchor, 3498).
--define(wxHtmlWindow_GetOpenedPage, 3499).
--define(wxHtmlWindow_GetOpenedPageTitle, 3500).
--define(wxHtmlWindow_GetRelatedFrame, 3501).
--define(wxHtmlWindow_HistoryBack, 3502).
--define(wxHtmlWindow_HistoryCanBack, 3503).
--define(wxHtmlWindow_HistoryCanForward, 3504).
--define(wxHtmlWindow_HistoryClear, 3505).
--define(wxHtmlWindow_HistoryForward, 3506).
--define(wxHtmlWindow_LoadFile, 3507).
--define(wxHtmlWindow_LoadPage, 3508).
--define(wxHtmlWindow_SelectAll, 3509).
--define(wxHtmlWindow_SelectionToText, 3510).
--define(wxHtmlWindow_SelectLine, 3511).
--define(wxHtmlWindow_SelectWord, 3512).
--define(wxHtmlWindow_SetBorders, 3513).
--define(wxHtmlWindow_SetFonts, 3514).
--define(wxHtmlWindow_SetPage, 3515).
--define(wxHtmlWindow_SetRelatedFrame, 3516).
--define(wxHtmlWindow_SetRelatedStatusBar, 3517).
--define(wxHtmlWindow_ToText, 3518).
--define(wxHtmlWindow_destroy, 3519).
--define(wxHtmlLinkEvent_GetLinkInfo, 3520).
--define(wxSystemSettings_GetColour, 3521).
--define(wxSystemSettings_GetFont, 3522).
--define(wxSystemSettings_GetMetric, 3523).
--define(wxSystemSettings_GetScreenType, 3524).
--define(wxSystemOptions_GetOption, 3525).
--define(wxSystemOptions_GetOptionInt, 3526).
--define(wxSystemOptions_HasOption, 3527).
--define(wxSystemOptions_IsFalse, 3528).
--define(wxSystemOptions_SetOption_2_1, 3529).
--define(wxSystemOptions_SetOption_2_0, 3530).
--define(wxAuiNotebookEvent_SetSelection, 3531).
--define(wxAuiNotebookEvent_GetSelection, 3532).
--define(wxAuiNotebookEvent_SetOldSelection, 3533).
--define(wxAuiNotebookEvent_GetOldSelection, 3534).
--define(wxAuiNotebookEvent_SetDragSource, 3535).
--define(wxAuiNotebookEvent_GetDragSource, 3536).
--define(wxAuiManagerEvent_SetManager, 3537).
--define(wxAuiManagerEvent_GetManager, 3538).
--define(wxAuiManagerEvent_SetPane, 3539).
--define(wxAuiManagerEvent_GetPane, 3540).
--define(wxAuiManagerEvent_SetButton, 3541).
--define(wxAuiManagerEvent_GetButton, 3542).
--define(wxAuiManagerEvent_SetDC, 3543).
--define(wxAuiManagerEvent_GetDC, 3544).
--define(wxAuiManagerEvent_Veto, 3545).
--define(wxAuiManagerEvent_GetVeto, 3546).
--define(wxAuiManagerEvent_SetCanVeto, 3547).
--define(wxAuiManagerEvent_CanVeto, 3548).
--define(wxLogNull_new, 3549).
--define(wxLogNull_destroy, 3550).
--define(wxTaskBarIcon_new, 3551).
--define(wxTaskBarIcon_destruct, 3552).
--define(wxTaskBarIcon_PopupMenu, 3553).
--define(wxTaskBarIcon_RemoveIcon, 3554).
--define(wxTaskBarIcon_SetIcon, 3555).
--define(wxLocale_new_0, 3556).
--define(wxLocale_new_2, 3558).
--define(wxLocale_destruct, 3559).
--define(wxLocale_Init, 3561).
--define(wxLocale_AddCatalog_1, 3562).
--define(wxLocale_AddCatalog_3, 3563).
--define(wxLocale_AddCatalogLookupPathPrefix, 3564).
--define(wxLocale_GetCanonicalName, 3565).
--define(wxLocale_GetLanguage, 3566).
--define(wxLocale_GetLanguageName, 3567).
--define(wxLocale_GetLocale, 3568).
--define(wxLocale_GetName, 3569).
--define(wxLocale_GetString_2, 3570).
--define(wxLocale_GetString_4, 3571).
--define(wxLocale_GetHeaderValue, 3572).
--define(wxLocale_GetSysName, 3573).
--define(wxLocale_GetSystemEncoding, 3574).
--define(wxLocale_GetSystemEncodingName, 3575).
--define(wxLocale_GetSystemLanguage, 3576).
--define(wxLocale_IsLoaded, 3577).
--define(wxLocale_IsOk, 3578).
--define(wxActivateEvent_GetActive, 3579).
--define(wxPopupWindow_new_2, 3581).
--define(wxPopupWindow_new_0, 3582).
--define(wxPopupWindow_destruct, 3584).
--define(wxPopupWindow_Create, 3585).
--define(wxPopupWindow_Position, 3586).
--define(wxPopupTransientWindow_new_0, 3587).
--define(wxPopupTransientWindow_new_2, 3588).
--define(wxPopupTransientWindow_destruct, 3589).
--define(wxPopupTransientWindow_Popup, 3590).
--define(wxPopupTransientWindow_Dismiss, 3591).
--define(wxOverlay_new, 3592).
--define(wxOverlay_destruct, 3593).
--define(wxOverlay_Reset, 3594).
--define(wxDCOverlay_new_6, 3595).
--define(wxDCOverlay_new_2, 3596).
--define(wxDCOverlay_destruct, 3597).
--define(wxDCOverlay_Clear, 3598).
+-define(wxGauge_GetRange, 1605).
+-define(wxGauge_GetValue, 1606).
+-define(wxGauge_IsVertical, 1607).
+-define(wxGauge_SetRange, 1608).
+-define(wxGauge_SetValue, 1609).
+-define(wxGauge_Pulse, 1610).
+-define(wxGauge_destroy, 1611).
+-define(wxGenericDirCtrl_new_0, 1612).
+-define(wxGenericDirCtrl_new_2, 1613).
+-define(wxGenericDirCtrl_destruct, 1614).
+-define(wxGenericDirCtrl_Create, 1615).
+-define(wxGenericDirCtrl_Init, 1616).
+-define(wxGenericDirCtrl_CollapseTree, 1617).
+-define(wxGenericDirCtrl_ExpandPath, 1618).
+-define(wxGenericDirCtrl_GetDefaultPath, 1619).
+-define(wxGenericDirCtrl_GetPath, 1620).
+-define(wxGenericDirCtrl_GetFilePath, 1621).
+-define(wxGenericDirCtrl_GetFilter, 1622).
+-define(wxGenericDirCtrl_GetFilterIndex, 1623).
+-define(wxGenericDirCtrl_GetRootId, 1624).
+-define(wxGenericDirCtrl_GetTreeCtrl, 1625).
+-define(wxGenericDirCtrl_ReCreateTree, 1626).
+-define(wxGenericDirCtrl_SetDefaultPath, 1627).
+-define(wxGenericDirCtrl_SetFilter, 1628).
+-define(wxGenericDirCtrl_SetFilterIndex, 1629).
+-define(wxGenericDirCtrl_SetPath, 1630).
+-define(wxStaticBox_new_4, 1632).
+-define(wxStaticBox_new_0, 1633).
+-define(wxStaticBox_Create, 1634).
+-define(wxStaticBox_destroy, 1635).
+-define(wxStaticLine_new_2, 1637).
+-define(wxStaticLine_new_0, 1638).
+-define(wxStaticLine_Create, 1639).
+-define(wxStaticLine_IsVertical, 1640).
+-define(wxStaticLine_GetDefaultSize, 1641).
+-define(wxStaticLine_destroy, 1642).
+-define(wxListBox_new_3, 1645).
+-define(wxListBox_new_0, 1646).
+-define(wxListBox_destruct, 1648).
+-define(wxListBox_Create, 1650).
+-define(wxListBox_Deselect, 1651).
+-define(wxListBox_GetSelections, 1652).
+-define(wxListBox_InsertItems, 1653).
+-define(wxListBox_IsSelected, 1654).
+-define(wxListBox_Set, 1655).
+-define(wxListBox_HitTest, 1656).
+-define(wxListBox_SetFirstItem_1_0, 1657).
+-define(wxListBox_SetFirstItem_1_1, 1658).
+-define(wxListCtrl_new_0, 1659).
+-define(wxListCtrl_new_2, 1660).
+-define(wxListCtrl_Arrange, 1661).
+-define(wxListCtrl_AssignImageList, 1662).
+-define(wxListCtrl_ClearAll, 1663).
+-define(wxListCtrl_Create, 1664).
+-define(wxListCtrl_DeleteAllItems, 1665).
+-define(wxListCtrl_DeleteColumn, 1666).
+-define(wxListCtrl_DeleteItem, 1667).
+-define(wxListCtrl_EditLabel, 1668).
+-define(wxListCtrl_EnsureVisible, 1669).
+-define(wxListCtrl_FindItem_3_0, 1670).
+-define(wxListCtrl_FindItem_3_1, 1671).
+-define(wxListCtrl_GetColumn, 1672).
+-define(wxListCtrl_GetColumnCount, 1673).
+-define(wxListCtrl_GetColumnWidth, 1674).
+-define(wxListCtrl_GetCountPerPage, 1675).
+-define(wxListCtrl_GetEditControl, 1676).
+-define(wxListCtrl_GetImageList, 1677).
+-define(wxListCtrl_GetItem, 1678).
+-define(wxListCtrl_GetItemBackgroundColour, 1679).
+-define(wxListCtrl_GetItemCount, 1680).
+-define(wxListCtrl_GetItemData, 1681).
+-define(wxListCtrl_GetItemFont, 1682).
+-define(wxListCtrl_GetItemPosition, 1683).
+-define(wxListCtrl_GetItemRect, 1684).
+-define(wxListCtrl_GetItemSpacing, 1685).
+-define(wxListCtrl_GetItemState, 1686).
+-define(wxListCtrl_GetItemText, 1687).
+-define(wxListCtrl_GetItemTextColour, 1688).
+-define(wxListCtrl_GetNextItem, 1689).
+-define(wxListCtrl_GetSelectedItemCount, 1690).
+-define(wxListCtrl_GetTextColour, 1691).
+-define(wxListCtrl_GetTopItem, 1692).
+-define(wxListCtrl_GetViewRect, 1693).
+-define(wxListCtrl_HitTest, 1694).
+-define(wxListCtrl_InsertColumn_2, 1695).
+-define(wxListCtrl_InsertColumn_3, 1696).
+-define(wxListCtrl_InsertItem_1, 1697).
+-define(wxListCtrl_InsertItem_2_1, 1698).
+-define(wxListCtrl_InsertItem_2_0, 1699).
+-define(wxListCtrl_InsertItem_3, 1700).
+-define(wxListCtrl_RefreshItem, 1701).
+-define(wxListCtrl_RefreshItems, 1702).
+-define(wxListCtrl_ScrollList, 1703).
+-define(wxListCtrl_SetBackgroundColour, 1704).
+-define(wxListCtrl_SetColumn, 1705).
+-define(wxListCtrl_SetColumnWidth, 1706).
+-define(wxListCtrl_SetImageList, 1707).
+-define(wxListCtrl_SetItem_1, 1708).
+-define(wxListCtrl_SetItem_4, 1709).
+-define(wxListCtrl_SetItemBackgroundColour, 1710).
+-define(wxListCtrl_SetItemCount, 1711).
+-define(wxListCtrl_SetItemData, 1712).
+-define(wxListCtrl_SetItemFont, 1713).
+-define(wxListCtrl_SetItemImage, 1714).
+-define(wxListCtrl_SetItemColumnImage, 1715).
+-define(wxListCtrl_SetItemPosition, 1716).
+-define(wxListCtrl_SetItemState, 1717).
+-define(wxListCtrl_SetItemText, 1718).
+-define(wxListCtrl_SetItemTextColour, 1719).
+-define(wxListCtrl_SetSingleStyle, 1720).
+-define(wxListCtrl_SetTextColour, 1721).
+-define(wxListCtrl_SetWindowStyleFlag, 1722).
+-define(wxListCtrl_SortItems, 1723).
+-define(wxListCtrl_destroy, 1724).
+-define(wxListView_ClearColumnImage, 1725).
+-define(wxListView_Focus, 1726).
+-define(wxListView_GetFirstSelected, 1727).
+-define(wxListView_GetFocusedItem, 1728).
+-define(wxListView_GetNextSelected, 1729).
+-define(wxListView_IsSelected, 1730).
+-define(wxListView_Select, 1731).
+-define(wxListView_SetColumnImage, 1732).
+-define(wxListItem_new_0, 1733).
+-define(wxListItem_new_1, 1734).
+-define(wxListItem_destruct, 1735).
+-define(wxListItem_Clear, 1736).
+-define(wxListItem_GetAlign, 1737).
+-define(wxListItem_GetBackgroundColour, 1738).
+-define(wxListItem_GetColumn, 1739).
+-define(wxListItem_GetFont, 1740).
+-define(wxListItem_GetId, 1741).
+-define(wxListItem_GetImage, 1742).
+-define(wxListItem_GetMask, 1743).
+-define(wxListItem_GetState, 1744).
+-define(wxListItem_GetText, 1745).
+-define(wxListItem_GetTextColour, 1746).
+-define(wxListItem_GetWidth, 1747).
+-define(wxListItem_SetAlign, 1748).
+-define(wxListItem_SetBackgroundColour, 1749).
+-define(wxListItem_SetColumn, 1750).
+-define(wxListItem_SetFont, 1751).
+-define(wxListItem_SetId, 1752).
+-define(wxListItem_SetImage, 1753).
+-define(wxListItem_SetMask, 1754).
+-define(wxListItem_SetState, 1755).
+-define(wxListItem_SetStateMask, 1756).
+-define(wxListItem_SetText, 1757).
+-define(wxListItem_SetTextColour, 1758).
+-define(wxListItem_SetWidth, 1759).
+-define(wxListItemAttr_new_0, 1760).
+-define(wxListItemAttr_new_3, 1761).
+-define(wxListItemAttr_GetBackgroundColour, 1762).
+-define(wxListItemAttr_GetFont, 1763).
+-define(wxListItemAttr_GetTextColour, 1764).
+-define(wxListItemAttr_HasBackgroundColour, 1765).
+-define(wxListItemAttr_HasFont, 1766).
+-define(wxListItemAttr_HasTextColour, 1767).
+-define(wxListItemAttr_SetBackgroundColour, 1768).
+-define(wxListItemAttr_SetFont, 1769).
+-define(wxListItemAttr_SetTextColour, 1770).
+-define(wxListItemAttr_destroy, 1771).
+-define(wxImageList_new_0, 1772).
+-define(wxImageList_new_3, 1773).
+-define(wxImageList_Add_1, 1774).
+-define(wxImageList_Add_2_0, 1775).
+-define(wxImageList_Add_2_1, 1776).
+-define(wxImageList_Create, 1777).
+-define(wxImageList_Draw, 1779).
+-define(wxImageList_GetBitmap, 1780).
+-define(wxImageList_GetIcon, 1781).
+-define(wxImageList_GetImageCount, 1782).
+-define(wxImageList_GetSize, 1783).
+-define(wxImageList_Remove, 1784).
+-define(wxImageList_RemoveAll, 1785).
+-define(wxImageList_Replace_2, 1786).
+-define(wxImageList_Replace_3, 1787).
+-define(wxImageList_destroy, 1788).
+-define(wxTextAttr_new_0, 1789).
+-define(wxTextAttr_new_2, 1790).
+-define(wxTextAttr_GetAlignment, 1791).
+-define(wxTextAttr_GetBackgroundColour, 1792).
+-define(wxTextAttr_GetFont, 1793).
+-define(wxTextAttr_GetLeftIndent, 1794).
+-define(wxTextAttr_GetLeftSubIndent, 1795).
+-define(wxTextAttr_GetRightIndent, 1796).
+-define(wxTextAttr_GetTabs, 1797).
+-define(wxTextAttr_GetTextColour, 1798).
+-define(wxTextAttr_HasBackgroundColour, 1799).
+-define(wxTextAttr_HasFont, 1800).
+-define(wxTextAttr_HasTextColour, 1801).
+-define(wxTextAttr_GetFlags, 1802).
+-define(wxTextAttr_IsDefault, 1803).
+-define(wxTextAttr_SetAlignment, 1804).
+-define(wxTextAttr_SetBackgroundColour, 1805).
+-define(wxTextAttr_SetFlags, 1806).
+-define(wxTextAttr_SetFont, 1807).
+-define(wxTextAttr_SetLeftIndent, 1808).
+-define(wxTextAttr_SetRightIndent, 1809).
+-define(wxTextAttr_SetTabs, 1810).
+-define(wxTextAttr_SetTextColour, 1811).
+-define(wxTextAttr_destroy, 1812).
+-define(wxTextCtrl_new_3, 1814).
+-define(wxTextCtrl_new_0, 1815).
+-define(wxTextCtrl_destruct, 1817).
+-define(wxTextCtrl_AppendText, 1818).
+-define(wxTextCtrl_CanCopy, 1819).
+-define(wxTextCtrl_CanCut, 1820).
+-define(wxTextCtrl_CanPaste, 1821).
+-define(wxTextCtrl_CanRedo, 1822).
+-define(wxTextCtrl_CanUndo, 1823).
+-define(wxTextCtrl_Clear, 1824).
+-define(wxTextCtrl_Copy, 1825).
+-define(wxTextCtrl_Create, 1826).
+-define(wxTextCtrl_Cut, 1827).
+-define(wxTextCtrl_DiscardEdits, 1828).
+-define(wxTextCtrl_ChangeValue, 1829).
+-define(wxTextCtrl_EmulateKeyPress, 1830).
+-define(wxTextCtrl_GetDefaultStyle, 1831).
+-define(wxTextCtrl_GetInsertionPoint, 1832).
+-define(wxTextCtrl_GetLastPosition, 1833).
+-define(wxTextCtrl_GetLineLength, 1834).
+-define(wxTextCtrl_GetLineText, 1835).
+-define(wxTextCtrl_GetNumberOfLines, 1836).
+-define(wxTextCtrl_GetRange, 1837).
+-define(wxTextCtrl_GetSelection, 1838).
+-define(wxTextCtrl_GetStringSelection, 1839).
+-define(wxTextCtrl_GetStyle, 1840).
+-define(wxTextCtrl_GetValue, 1841).
+-define(wxTextCtrl_IsEditable, 1842).
+-define(wxTextCtrl_IsModified, 1843).
+-define(wxTextCtrl_IsMultiLine, 1844).
+-define(wxTextCtrl_IsSingleLine, 1845).
+-define(wxTextCtrl_LoadFile, 1846).
+-define(wxTextCtrl_MarkDirty, 1847).
+-define(wxTextCtrl_Paste, 1848).
+-define(wxTextCtrl_PositionToXY, 1849).
+-define(wxTextCtrl_Redo, 1850).
+-define(wxTextCtrl_Remove, 1851).
+-define(wxTextCtrl_Replace, 1852).
+-define(wxTextCtrl_SaveFile, 1853).
+-define(wxTextCtrl_SetDefaultStyle, 1854).
+-define(wxTextCtrl_SetEditable, 1855).
+-define(wxTextCtrl_SetInsertionPoint, 1856).
+-define(wxTextCtrl_SetInsertionPointEnd, 1857).
+-define(wxTextCtrl_SetMaxLength, 1859).
+-define(wxTextCtrl_SetSelection, 1860).
+-define(wxTextCtrl_SetStyle, 1861).
+-define(wxTextCtrl_SetValue, 1862).
+-define(wxTextCtrl_ShowPosition, 1863).
+-define(wxTextCtrl_Undo, 1864).
+-define(wxTextCtrl_WriteText, 1865).
+-define(wxTextCtrl_XYToPosition, 1866).
+-define(wxNotebook_new_0, 1869).
+-define(wxNotebook_new_3, 1870).
+-define(wxNotebook_destruct, 1871).
+-define(wxNotebook_AddPage, 1872).
+-define(wxNotebook_AdvanceSelection, 1873).
+-define(wxNotebook_AssignImageList, 1874).
+-define(wxNotebook_Create, 1875).
+-define(wxNotebook_DeleteAllPages, 1876).
+-define(wxNotebook_DeletePage, 1877).
+-define(wxNotebook_RemovePage, 1878).
+-define(wxNotebook_GetCurrentPage, 1879).
+-define(wxNotebook_GetImageList, 1880).
+-define(wxNotebook_GetPage, 1882).
+-define(wxNotebook_GetPageCount, 1883).
+-define(wxNotebook_GetPageImage, 1884).
+-define(wxNotebook_GetPageText, 1885).
+-define(wxNotebook_GetRowCount, 1886).
+-define(wxNotebook_GetSelection, 1887).
+-define(wxNotebook_GetThemeBackgroundColour, 1888).
+-define(wxNotebook_HitTest, 1890).
+-define(wxNotebook_InsertPage, 1892).
+-define(wxNotebook_SetImageList, 1893).
+-define(wxNotebook_SetPadding, 1894).
+-define(wxNotebook_SetPageSize, 1895).
+-define(wxNotebook_SetPageImage, 1896).
+-define(wxNotebook_SetPageText, 1897).
+-define(wxNotebook_SetSelection, 1898).
+-define(wxNotebook_ChangeSelection, 1899).
+-define(wxChoicebook_new_0, 1900).
+-define(wxChoicebook_new_3, 1901).
+-define(wxChoicebook_AddPage, 1902).
+-define(wxChoicebook_AdvanceSelection, 1903).
+-define(wxChoicebook_AssignImageList, 1904).
+-define(wxChoicebook_Create, 1905).
+-define(wxChoicebook_DeleteAllPages, 1906).
+-define(wxChoicebook_DeletePage, 1907).
+-define(wxChoicebook_RemovePage, 1908).
+-define(wxChoicebook_GetCurrentPage, 1909).
+-define(wxChoicebook_GetImageList, 1910).
+-define(wxChoicebook_GetPage, 1912).
+-define(wxChoicebook_GetPageCount, 1913).
+-define(wxChoicebook_GetPageImage, 1914).
+-define(wxChoicebook_GetPageText, 1915).
+-define(wxChoicebook_GetSelection, 1916).
+-define(wxChoicebook_HitTest, 1917).
+-define(wxChoicebook_InsertPage, 1918).
+-define(wxChoicebook_SetImageList, 1919).
+-define(wxChoicebook_SetPageSize, 1920).
+-define(wxChoicebook_SetPageImage, 1921).
+-define(wxChoicebook_SetPageText, 1922).
+-define(wxChoicebook_SetSelection, 1923).
+-define(wxChoicebook_ChangeSelection, 1924).
+-define(wxChoicebook_destroy, 1925).
+-define(wxToolbook_new_0, 1926).
+-define(wxToolbook_new_3, 1927).
+-define(wxToolbook_AddPage, 1928).
+-define(wxToolbook_AdvanceSelection, 1929).
+-define(wxToolbook_AssignImageList, 1930).
+-define(wxToolbook_Create, 1931).
+-define(wxToolbook_DeleteAllPages, 1932).
+-define(wxToolbook_DeletePage, 1933).
+-define(wxToolbook_RemovePage, 1934).
+-define(wxToolbook_GetCurrentPage, 1935).
+-define(wxToolbook_GetImageList, 1936).
+-define(wxToolbook_GetPage, 1938).
+-define(wxToolbook_GetPageCount, 1939).
+-define(wxToolbook_GetPageImage, 1940).
+-define(wxToolbook_GetPageText, 1941).
+-define(wxToolbook_GetSelection, 1942).
+-define(wxToolbook_HitTest, 1944).
+-define(wxToolbook_InsertPage, 1945).
+-define(wxToolbook_SetImageList, 1946).
+-define(wxToolbook_SetPageSize, 1947).
+-define(wxToolbook_SetPageImage, 1948).
+-define(wxToolbook_SetPageText, 1949).
+-define(wxToolbook_SetSelection, 1950).
+-define(wxToolbook_ChangeSelection, 1951).
+-define(wxToolbook_destroy, 1952).
+-define(wxListbook_new_0, 1953).
+-define(wxListbook_new_3, 1954).
+-define(wxListbook_AddPage, 1955).
+-define(wxListbook_AdvanceSelection, 1956).
+-define(wxListbook_AssignImageList, 1957).
+-define(wxListbook_Create, 1958).
+-define(wxListbook_DeleteAllPages, 1959).
+-define(wxListbook_DeletePage, 1960).
+-define(wxListbook_RemovePage, 1961).
+-define(wxListbook_GetCurrentPage, 1962).
+-define(wxListbook_GetImageList, 1963).
+-define(wxListbook_GetPage, 1965).
+-define(wxListbook_GetPageCount, 1966).
+-define(wxListbook_GetPageImage, 1967).
+-define(wxListbook_GetPageText, 1968).
+-define(wxListbook_GetSelection, 1969).
+-define(wxListbook_HitTest, 1971).
+-define(wxListbook_InsertPage, 1972).
+-define(wxListbook_SetImageList, 1973).
+-define(wxListbook_SetPageSize, 1974).
+-define(wxListbook_SetPageImage, 1975).
+-define(wxListbook_SetPageText, 1976).
+-define(wxListbook_SetSelection, 1977).
+-define(wxListbook_ChangeSelection, 1978).
+-define(wxListbook_destroy, 1979).
+-define(wxTreebook_new_0, 1980).
+-define(wxTreebook_new_3, 1981).
+-define(wxTreebook_AddPage, 1982).
+-define(wxTreebook_AdvanceSelection, 1983).
+-define(wxTreebook_AssignImageList, 1984).
+-define(wxTreebook_Create, 1985).
+-define(wxTreebook_DeleteAllPages, 1986).
+-define(wxTreebook_DeletePage, 1987).
+-define(wxTreebook_RemovePage, 1988).
+-define(wxTreebook_GetCurrentPage, 1989).
+-define(wxTreebook_GetImageList, 1990).
+-define(wxTreebook_GetPage, 1992).
+-define(wxTreebook_GetPageCount, 1993).
+-define(wxTreebook_GetPageImage, 1994).
+-define(wxTreebook_GetPageText, 1995).
+-define(wxTreebook_GetSelection, 1996).
+-define(wxTreebook_ExpandNode, 1997).
+-define(wxTreebook_IsNodeExpanded, 1998).
+-define(wxTreebook_HitTest, 2000).
+-define(wxTreebook_InsertPage, 2001).
+-define(wxTreebook_InsertSubPage, 2002).
+-define(wxTreebook_SetImageList, 2003).
+-define(wxTreebook_SetPageSize, 2004).
+-define(wxTreebook_SetPageImage, 2005).
+-define(wxTreebook_SetPageText, 2006).
+-define(wxTreebook_SetSelection, 2007).
+-define(wxTreebook_ChangeSelection, 2008).
+-define(wxTreebook_destroy, 2009).
+-define(wxTreeCtrl_new_2, 2012).
+-define(wxTreeCtrl_new_0, 2013).
+-define(wxTreeCtrl_destruct, 2015).
+-define(wxTreeCtrl_AddRoot, 2016).
+-define(wxTreeCtrl_AppendItem, 2017).
+-define(wxTreeCtrl_AssignImageList, 2018).
+-define(wxTreeCtrl_AssignStateImageList, 2019).
+-define(wxTreeCtrl_Collapse, 2020).
+-define(wxTreeCtrl_CollapseAndReset, 2021).
+-define(wxTreeCtrl_Create, 2022).
+-define(wxTreeCtrl_Delete, 2023).
+-define(wxTreeCtrl_DeleteAllItems, 2024).
+-define(wxTreeCtrl_DeleteChildren, 2025).
+-define(wxTreeCtrl_EditLabel, 2026).
+-define(wxTreeCtrl_EnsureVisible, 2027).
+-define(wxTreeCtrl_Expand, 2028).
+-define(wxTreeCtrl_GetBoundingRect, 2029).
+-define(wxTreeCtrl_GetChildrenCount, 2031).
+-define(wxTreeCtrl_GetCount, 2032).
+-define(wxTreeCtrl_GetEditControl, 2033).
+-define(wxTreeCtrl_GetFirstChild, 2034).
+-define(wxTreeCtrl_GetNextChild, 2035).
+-define(wxTreeCtrl_GetFirstVisibleItem, 2036).
+-define(wxTreeCtrl_GetImageList, 2037).
+-define(wxTreeCtrl_GetIndent, 2038).
+-define(wxTreeCtrl_GetItemBackgroundColour, 2039).
+-define(wxTreeCtrl_GetItemData, 2040).
+-define(wxTreeCtrl_GetItemFont, 2041).
+-define(wxTreeCtrl_GetItemImage_1, 2042).
+-define(wxTreeCtrl_GetItemImage_2, 2043).
+-define(wxTreeCtrl_GetItemText, 2044).
+-define(wxTreeCtrl_GetItemTextColour, 2045).
+-define(wxTreeCtrl_GetLastChild, 2046).
+-define(wxTreeCtrl_GetNextSibling, 2047).
+-define(wxTreeCtrl_GetNextVisible, 2048).
+-define(wxTreeCtrl_GetItemParent, 2049).
+-define(wxTreeCtrl_GetPrevSibling, 2050).
+-define(wxTreeCtrl_GetPrevVisible, 2051).
+-define(wxTreeCtrl_GetRootItem, 2052).
+-define(wxTreeCtrl_GetSelection, 2053).
+-define(wxTreeCtrl_GetSelections, 2054).
+-define(wxTreeCtrl_GetStateImageList, 2055).
+-define(wxTreeCtrl_HitTest, 2056).
+-define(wxTreeCtrl_InsertItem, 2058).
+-define(wxTreeCtrl_IsBold, 2059).
+-define(wxTreeCtrl_IsExpanded, 2060).
+-define(wxTreeCtrl_IsSelected, 2061).
+-define(wxTreeCtrl_IsVisible, 2062).
+-define(wxTreeCtrl_ItemHasChildren, 2063).
+-define(wxTreeCtrl_IsTreeItemIdOk, 2064).
+-define(wxTreeCtrl_PrependItem, 2065).
+-define(wxTreeCtrl_ScrollTo, 2066).
+-define(wxTreeCtrl_SelectItem_1, 2067).
+-define(wxTreeCtrl_SelectItem_2, 2068).
+-define(wxTreeCtrl_SetIndent, 2069).
+-define(wxTreeCtrl_SetImageList, 2070).
+-define(wxTreeCtrl_SetItemBackgroundColour, 2071).
+-define(wxTreeCtrl_SetItemBold, 2072).
+-define(wxTreeCtrl_SetItemData, 2073).
+-define(wxTreeCtrl_SetItemDropHighlight, 2074).
+-define(wxTreeCtrl_SetItemFont, 2075).
+-define(wxTreeCtrl_SetItemHasChildren, 2076).
+-define(wxTreeCtrl_SetItemImage_2, 2077).
+-define(wxTreeCtrl_SetItemImage_3, 2078).
+-define(wxTreeCtrl_SetItemText, 2079).
+-define(wxTreeCtrl_SetItemTextColour, 2080).
+-define(wxTreeCtrl_SetStateImageList, 2081).
+-define(wxTreeCtrl_SetWindowStyle, 2082).
+-define(wxTreeCtrl_SortChildren, 2083).
+-define(wxTreeCtrl_Toggle, 2084).
+-define(wxTreeCtrl_ToggleItemSelection, 2085).
+-define(wxTreeCtrl_Unselect, 2086).
+-define(wxTreeCtrl_UnselectAll, 2087).
+-define(wxTreeCtrl_UnselectItem, 2088).
+-define(wxScrollBar_new_0, 2089).
+-define(wxScrollBar_new_3, 2090).
+-define(wxScrollBar_destruct, 2091).
+-define(wxScrollBar_Create, 2092).
+-define(wxScrollBar_GetRange, 2093).
+-define(wxScrollBar_GetPageSize, 2094).
+-define(wxScrollBar_GetThumbPosition, 2095).
+-define(wxScrollBar_GetThumbSize, 2096).
+-define(wxScrollBar_SetThumbPosition, 2097).
+-define(wxScrollBar_SetScrollbar, 2098).
+-define(wxSpinButton_new_2, 2100).
+-define(wxSpinButton_new_0, 2101).
+-define(wxSpinButton_Create, 2102).
+-define(wxSpinButton_GetMax, 2103).
+-define(wxSpinButton_GetMin, 2104).
+-define(wxSpinButton_GetValue, 2105).
+-define(wxSpinButton_SetRange, 2106).
+-define(wxSpinButton_SetValue, 2107).
+-define(wxSpinButton_destroy, 2108).
+-define(wxSpinCtrl_new_0, 2109).
+-define(wxSpinCtrl_new_2, 2110).
+-define(wxSpinCtrl_Create, 2112).
+-define(wxSpinCtrl_SetValue_1_1, 2115).
+-define(wxSpinCtrl_SetValue_1_0, 2116).
+-define(wxSpinCtrl_GetValue, 2118).
+-define(wxSpinCtrl_SetRange, 2120).
+-define(wxSpinCtrl_SetSelection, 2121).
+-define(wxSpinCtrl_GetMin, 2123).
+-define(wxSpinCtrl_GetMax, 2125).
+-define(wxSpinCtrl_destroy, 2126).
+-define(wxStaticText_new_0, 2127).
+-define(wxStaticText_new_4, 2128).
+-define(wxStaticText_Create, 2129).
+-define(wxStaticText_GetLabel, 2130).
+-define(wxStaticText_SetLabel, 2131).
+-define(wxStaticText_Wrap, 2132).
+-define(wxStaticText_destroy, 2133).
+-define(wxStaticBitmap_new_0, 2134).
+-define(wxStaticBitmap_new_4, 2135).
+-define(wxStaticBitmap_Create, 2136).
+-define(wxStaticBitmap_GetBitmap, 2137).
+-define(wxStaticBitmap_SetBitmap, 2138).
+-define(wxStaticBitmap_destroy, 2139).
+-define(wxRadioBox_new, 2140).
+-define(wxRadioBox_destruct, 2142).
+-define(wxRadioBox_Create, 2143).
+-define(wxRadioBox_Enable_2, 2144).
+-define(wxRadioBox_Enable_1, 2145).
+-define(wxRadioBox_GetSelection, 2146).
+-define(wxRadioBox_GetString, 2147).
+-define(wxRadioBox_SetSelection, 2148).
+-define(wxRadioBox_Show_2, 2149).
+-define(wxRadioBox_Show_1, 2150).
+-define(wxRadioBox_GetColumnCount, 2151).
+-define(wxRadioBox_GetItemHelpText, 2152).
+-define(wxRadioBox_GetItemToolTip, 2153).
+-define(wxRadioBox_GetItemFromPoint, 2155).
+-define(wxRadioBox_GetRowCount, 2156).
+-define(wxRadioBox_IsItemEnabled, 2157).
+-define(wxRadioBox_IsItemShown, 2158).
+-define(wxRadioBox_SetItemHelpText, 2159).
+-define(wxRadioBox_SetItemToolTip, 2160).
+-define(wxRadioButton_new_0, 2161).
+-define(wxRadioButton_new_4, 2162).
+-define(wxRadioButton_Create, 2163).
+-define(wxRadioButton_GetValue, 2164).
+-define(wxRadioButton_SetValue, 2165).
+-define(wxRadioButton_destroy, 2166).
+-define(wxSlider_new_6, 2168).
+-define(wxSlider_new_0, 2169).
+-define(wxSlider_Create, 2170).
+-define(wxSlider_GetLineSize, 2171).
+-define(wxSlider_GetMax, 2172).
+-define(wxSlider_GetMin, 2173).
+-define(wxSlider_GetPageSize, 2174).
+-define(wxSlider_GetThumbLength, 2175).
+-define(wxSlider_GetValue, 2176).
+-define(wxSlider_SetLineSize, 2177).
+-define(wxSlider_SetPageSize, 2178).
+-define(wxSlider_SetRange, 2179).
+-define(wxSlider_SetThumbLength, 2180).
+-define(wxSlider_SetValue, 2181).
+-define(wxSlider_destroy, 2182).
+-define(wxDialog_new_4, 2184).
+-define(wxDialog_new_0, 2185).
+-define(wxDialog_destruct, 2187).
+-define(wxDialog_Create, 2188).
+-define(wxDialog_CreateButtonSizer, 2189).
+-define(wxDialog_CreateStdDialogButtonSizer, 2190).
+-define(wxDialog_EndModal, 2191).
+-define(wxDialog_GetAffirmativeId, 2192).
+-define(wxDialog_GetReturnCode, 2193).
+-define(wxDialog_IsModal, 2194).
+-define(wxDialog_SetAffirmativeId, 2195).
+-define(wxDialog_SetReturnCode, 2196).
+-define(wxDialog_Show, 2197).
+-define(wxDialog_ShowModal, 2198).
+-define(wxColourDialog_new_0, 2199).
+-define(wxColourDialog_new_2, 2200).
+-define(wxColourDialog_destruct, 2201).
+-define(wxColourDialog_Create, 2202).
+-define(wxColourDialog_GetColourData, 2203).
+-define(wxColourData_new_0, 2204).
+-define(wxColourData_new_1, 2205).
+-define(wxColourData_destruct, 2206).
+-define(wxColourData_GetChooseFull, 2207).
+-define(wxColourData_GetColour, 2208).
+-define(wxColourData_GetCustomColour, 2210).
+-define(wxColourData_SetChooseFull, 2211).
+-define(wxColourData_SetColour, 2212).
+-define(wxColourData_SetCustomColour, 2213).
+-define(wxPalette_new_0, 2214).
+-define(wxPalette_new_4, 2215).
+-define(wxPalette_destruct, 2217).
+-define(wxPalette_Create, 2218).
+-define(wxPalette_GetColoursCount, 2219).
+-define(wxPalette_GetPixel, 2220).
+-define(wxPalette_GetRGB, 2221).
+-define(wxPalette_IsOk, 2222).
+-define(wxDirDialog_new, 2226).
+-define(wxDirDialog_destruct, 2227).
+-define(wxDirDialog_GetPath, 2228).
+-define(wxDirDialog_GetMessage, 2229).
+-define(wxDirDialog_SetMessage, 2230).
+-define(wxDirDialog_SetPath, 2231).
+-define(wxFileDialog_new, 2235).
+-define(wxFileDialog_destruct, 2236).
+-define(wxFileDialog_GetDirectory, 2237).
+-define(wxFileDialog_GetFilename, 2238).
+-define(wxFileDialog_GetFilenames, 2239).
+-define(wxFileDialog_GetFilterIndex, 2240).
+-define(wxFileDialog_GetMessage, 2241).
+-define(wxFileDialog_GetPath, 2242).
+-define(wxFileDialog_GetPaths, 2243).
+-define(wxFileDialog_GetWildcard, 2244).
+-define(wxFileDialog_SetDirectory, 2245).
+-define(wxFileDialog_SetFilename, 2246).
+-define(wxFileDialog_SetFilterIndex, 2247).
+-define(wxFileDialog_SetMessage, 2248).
+-define(wxFileDialog_SetPath, 2249).
+-define(wxFileDialog_SetWildcard, 2250).
+-define(wxPickerBase_SetInternalMargin, 2251).
+-define(wxPickerBase_GetInternalMargin, 2252).
+-define(wxPickerBase_SetTextCtrlProportion, 2253).
+-define(wxPickerBase_SetPickerCtrlProportion, 2254).
+-define(wxPickerBase_GetTextCtrlProportion, 2255).
+-define(wxPickerBase_GetPickerCtrlProportion, 2256).
+-define(wxPickerBase_HasTextCtrl, 2257).
+-define(wxPickerBase_GetTextCtrl, 2258).
+-define(wxPickerBase_IsTextCtrlGrowable, 2259).
+-define(wxPickerBase_SetPickerCtrlGrowable, 2260).
+-define(wxPickerBase_SetTextCtrlGrowable, 2261).
+-define(wxPickerBase_IsPickerCtrlGrowable, 2262).
+-define(wxFilePickerCtrl_new_0, 2263).
+-define(wxFilePickerCtrl_new_3, 2264).
+-define(wxFilePickerCtrl_Create, 2265).
+-define(wxFilePickerCtrl_GetPath, 2266).
+-define(wxFilePickerCtrl_SetPath, 2267).
+-define(wxFilePickerCtrl_destroy, 2268).
+-define(wxDirPickerCtrl_new_0, 2269).
+-define(wxDirPickerCtrl_new_3, 2270).
+-define(wxDirPickerCtrl_Create, 2271).
+-define(wxDirPickerCtrl_GetPath, 2272).
+-define(wxDirPickerCtrl_SetPath, 2273).
+-define(wxDirPickerCtrl_destroy, 2274).
+-define(wxColourPickerCtrl_new_0, 2275).
+-define(wxColourPickerCtrl_new_3, 2276).
+-define(wxColourPickerCtrl_Create, 2277).
+-define(wxColourPickerCtrl_GetColour, 2278).
+-define(wxColourPickerCtrl_SetColour_1_1, 2279).
+-define(wxColourPickerCtrl_SetColour_1_0, 2280).
+-define(wxColourPickerCtrl_destroy, 2281).
+-define(wxDatePickerCtrl_new_0, 2282).
+-define(wxDatePickerCtrl_new_3, 2283).
+-define(wxDatePickerCtrl_GetRange, 2284).
+-define(wxDatePickerCtrl_GetValue, 2285).
+-define(wxDatePickerCtrl_SetRange, 2286).
+-define(wxDatePickerCtrl_SetValue, 2287).
+-define(wxDatePickerCtrl_destroy, 2288).
+-define(wxFontPickerCtrl_new_0, 2289).
+-define(wxFontPickerCtrl_new_3, 2290).
+-define(wxFontPickerCtrl_Create, 2291).
+-define(wxFontPickerCtrl_GetSelectedFont, 2292).
+-define(wxFontPickerCtrl_SetSelectedFont, 2293).
+-define(wxFontPickerCtrl_GetMaxPointSize, 2294).
+-define(wxFontPickerCtrl_SetMaxPointSize, 2295).
+-define(wxFontPickerCtrl_destroy, 2296).
+-define(wxFindReplaceDialog_new_0, 2299).
+-define(wxFindReplaceDialog_new_4, 2300).
+-define(wxFindReplaceDialog_destruct, 2301).
+-define(wxFindReplaceDialog_Create, 2302).
+-define(wxFindReplaceDialog_GetData, 2303).
+-define(wxFindReplaceData_new_0, 2304).
+-define(wxFindReplaceData_new_1, 2305).
+-define(wxFindReplaceData_GetFindString, 2306).
+-define(wxFindReplaceData_GetReplaceString, 2307).
+-define(wxFindReplaceData_GetFlags, 2308).
+-define(wxFindReplaceData_SetFlags, 2309).
+-define(wxFindReplaceData_SetFindString, 2310).
+-define(wxFindReplaceData_SetReplaceString, 2311).
+-define(wxFindReplaceData_destroy, 2312).
+-define(wxMultiChoiceDialog_new_0, 2313).
+-define(wxMultiChoiceDialog_new_5, 2315).
+-define(wxMultiChoiceDialog_GetSelections, 2316).
+-define(wxMultiChoiceDialog_SetSelections, 2317).
+-define(wxMultiChoiceDialog_destroy, 2318).
+-define(wxSingleChoiceDialog_new_0, 2319).
+-define(wxSingleChoiceDialog_new_5, 2321).
+-define(wxSingleChoiceDialog_GetSelection, 2322).
+-define(wxSingleChoiceDialog_GetStringSelection, 2323).
+-define(wxSingleChoiceDialog_SetSelection, 2324).
+-define(wxSingleChoiceDialog_destroy, 2325).
+-define(wxTextEntryDialog_new, 2326).
+-define(wxTextEntryDialog_GetValue, 2327).
+-define(wxTextEntryDialog_SetValue, 2328).
+-define(wxTextEntryDialog_destroy, 2329).
+-define(wxPasswordEntryDialog_new, 2330).
+-define(wxPasswordEntryDialog_destroy, 2331).
+-define(wxFontData_new_0, 2332).
+-define(wxFontData_new_1, 2333).
+-define(wxFontData_destruct, 2334).
+-define(wxFontData_EnableEffects, 2335).
+-define(wxFontData_GetAllowSymbols, 2336).
+-define(wxFontData_GetColour, 2337).
+-define(wxFontData_GetChosenFont, 2338).
+-define(wxFontData_GetEnableEffects, 2339).
+-define(wxFontData_GetInitialFont, 2340).
+-define(wxFontData_GetShowHelp, 2341).
+-define(wxFontData_SetAllowSymbols, 2342).
+-define(wxFontData_SetChosenFont, 2343).
+-define(wxFontData_SetColour, 2344).
+-define(wxFontData_SetInitialFont, 2345).
+-define(wxFontData_SetRange, 2346).
+-define(wxFontData_SetShowHelp, 2347).
+-define(wxFontDialog_new_0, 2351).
+-define(wxFontDialog_new_2, 2353).
+-define(wxFontDialog_Create, 2355).
+-define(wxFontDialog_GetFontData, 2356).
+-define(wxFontDialog_destroy, 2358).
+-define(wxProgressDialog_new, 2359).
+-define(wxProgressDialog_destruct, 2360).
+-define(wxProgressDialog_Resume, 2361).
+-define(wxProgressDialog_Update_2, 2362).
+-define(wxProgressDialog_Update_0, 2363).
+-define(wxMessageDialog_new, 2364).
+-define(wxMessageDialog_destruct, 2365).
+-define(wxPageSetupDialog_new, 2366).
+-define(wxPageSetupDialog_destruct, 2367).
+-define(wxPageSetupDialog_GetPageSetupData, 2368).
+-define(wxPageSetupDialog_ShowModal, 2369).
+-define(wxPageSetupDialogData_new_0, 2370).
+-define(wxPageSetupDialogData_new_1_0, 2371).
+-define(wxPageSetupDialogData_new_1_1, 2372).
+-define(wxPageSetupDialogData_destruct, 2373).
+-define(wxPageSetupDialogData_EnableHelp, 2374).
+-define(wxPageSetupDialogData_EnableMargins, 2375).
+-define(wxPageSetupDialogData_EnableOrientation, 2376).
+-define(wxPageSetupDialogData_EnablePaper, 2377).
+-define(wxPageSetupDialogData_EnablePrinter, 2378).
+-define(wxPageSetupDialogData_GetDefaultMinMargins, 2379).
+-define(wxPageSetupDialogData_GetEnableMargins, 2380).
+-define(wxPageSetupDialogData_GetEnableOrientation, 2381).
+-define(wxPageSetupDialogData_GetEnablePaper, 2382).
+-define(wxPageSetupDialogData_GetEnablePrinter, 2383).
+-define(wxPageSetupDialogData_GetEnableHelp, 2384).
+-define(wxPageSetupDialogData_GetDefaultInfo, 2385).
+-define(wxPageSetupDialogData_GetMarginTopLeft, 2386).
+-define(wxPageSetupDialogData_GetMarginBottomRight, 2387).
+-define(wxPageSetupDialogData_GetMinMarginTopLeft, 2388).
+-define(wxPageSetupDialogData_GetMinMarginBottomRight, 2389).
+-define(wxPageSetupDialogData_GetPaperId, 2390).
+-define(wxPageSetupDialogData_GetPaperSize, 2391).
+-define(wxPageSetupDialogData_GetPrintData, 2393).
+-define(wxPageSetupDialogData_IsOk, 2394).
+-define(wxPageSetupDialogData_SetDefaultInfo, 2395).
+-define(wxPageSetupDialogData_SetDefaultMinMargins, 2396).
+-define(wxPageSetupDialogData_SetMarginTopLeft, 2397).
+-define(wxPageSetupDialogData_SetMarginBottomRight, 2398).
+-define(wxPageSetupDialogData_SetMinMarginTopLeft, 2399).
+-define(wxPageSetupDialogData_SetMinMarginBottomRight, 2400).
+-define(wxPageSetupDialogData_SetPaperId, 2401).
+-define(wxPageSetupDialogData_SetPaperSize_1_1, 2402).
+-define(wxPageSetupDialogData_SetPaperSize_1_0, 2403).
+-define(wxPageSetupDialogData_SetPrintData, 2404).
+-define(wxPrintDialog_new_2_0, 2405).
+-define(wxPrintDialog_new_2_1, 2406).
+-define(wxPrintDialog_destruct, 2407).
+-define(wxPrintDialog_GetPrintDialogData, 2408).
+-define(wxPrintDialog_GetPrintDC, 2409).
+-define(wxPrintDialogData_new_0, 2410).
+-define(wxPrintDialogData_new_1_1, 2411).
+-define(wxPrintDialogData_new_1_0, 2412).
+-define(wxPrintDialogData_destruct, 2413).
+-define(wxPrintDialogData_EnableHelp, 2414).
+-define(wxPrintDialogData_EnablePageNumbers, 2415).
+-define(wxPrintDialogData_EnablePrintToFile, 2416).
+-define(wxPrintDialogData_EnableSelection, 2417).
+-define(wxPrintDialogData_GetAllPages, 2418).
+-define(wxPrintDialogData_GetCollate, 2419).
+-define(wxPrintDialogData_GetFromPage, 2420).
+-define(wxPrintDialogData_GetMaxPage, 2421).
+-define(wxPrintDialogData_GetMinPage, 2422).
+-define(wxPrintDialogData_GetNoCopies, 2423).
+-define(wxPrintDialogData_GetPrintData, 2424).
+-define(wxPrintDialogData_GetPrintToFile, 2425).
+-define(wxPrintDialogData_GetSelection, 2426).
+-define(wxPrintDialogData_GetToPage, 2427).
+-define(wxPrintDialogData_IsOk, 2428).
+-define(wxPrintDialogData_SetCollate, 2429).
+-define(wxPrintDialogData_SetFromPage, 2430).
+-define(wxPrintDialogData_SetMaxPage, 2431).
+-define(wxPrintDialogData_SetMinPage, 2432).
+-define(wxPrintDialogData_SetNoCopies, 2433).
+-define(wxPrintDialogData_SetPrintData, 2434).
+-define(wxPrintDialogData_SetPrintToFile, 2435).
+-define(wxPrintDialogData_SetSelection, 2436).
+-define(wxPrintDialogData_SetToPage, 2437).
+-define(wxPrintData_new_0, 2438).
+-define(wxPrintData_new_1, 2439).
+-define(wxPrintData_destruct, 2440).
+-define(wxPrintData_GetCollate, 2441).
+-define(wxPrintData_GetBin, 2442).
+-define(wxPrintData_GetColour, 2443).
+-define(wxPrintData_GetDuplex, 2444).
+-define(wxPrintData_GetNoCopies, 2445).
+-define(wxPrintData_GetOrientation, 2446).
+-define(wxPrintData_GetPaperId, 2447).
+-define(wxPrintData_GetPrinterName, 2448).
+-define(wxPrintData_GetQuality, 2449).
+-define(wxPrintData_IsOk, 2450).
+-define(wxPrintData_SetBin, 2451).
+-define(wxPrintData_SetCollate, 2452).
+-define(wxPrintData_SetColour, 2453).
+-define(wxPrintData_SetDuplex, 2454).
+-define(wxPrintData_SetNoCopies, 2455).
+-define(wxPrintData_SetOrientation, 2456).
+-define(wxPrintData_SetPaperId, 2457).
+-define(wxPrintData_SetPrinterName, 2458).
+-define(wxPrintData_SetQuality, 2459).
+-define(wxPrintPreview_new_2, 2462).
+-define(wxPrintPreview_new_3, 2463).
+-define(wxPrintPreview_destruct, 2465).
+-define(wxPrintPreview_GetCanvas, 2466).
+-define(wxPrintPreview_GetCurrentPage, 2467).
+-define(wxPrintPreview_GetFrame, 2468).
+-define(wxPrintPreview_GetMaxPage, 2469).
+-define(wxPrintPreview_GetMinPage, 2470).
+-define(wxPrintPreview_GetPrintout, 2471).
+-define(wxPrintPreview_GetPrintoutForPrinting, 2472).
+-define(wxPrintPreview_IsOk, 2473).
+-define(wxPrintPreview_PaintPage, 2474).
+-define(wxPrintPreview_Print, 2475).
+-define(wxPrintPreview_RenderPage, 2476).
+-define(wxPrintPreview_SetCanvas, 2477).
+-define(wxPrintPreview_SetCurrentPage, 2478).
+-define(wxPrintPreview_SetFrame, 2479).
+-define(wxPrintPreview_SetPrintout, 2480).
+-define(wxPrintPreview_SetZoom, 2481).
+-define(wxPreviewFrame_new, 2482).
+-define(wxPreviewFrame_destruct, 2483).
+-define(wxPreviewFrame_CreateControlBar, 2484).
+-define(wxPreviewFrame_CreateCanvas, 2485).
+-define(wxPreviewFrame_Initialize, 2486).
+-define(wxPreviewFrame_OnCloseWindow, 2487).
+-define(wxPreviewControlBar_new, 2488).
+-define(wxPreviewControlBar_destruct, 2489).
+-define(wxPreviewControlBar_CreateButtons, 2490).
+-define(wxPreviewControlBar_GetPrintPreview, 2491).
+-define(wxPreviewControlBar_GetZoomControl, 2492).
+-define(wxPreviewControlBar_SetZoomControl, 2493).
+-define(wxPrinter_new, 2495).
+-define(wxPrinter_CreateAbortWindow, 2496).
+-define(wxPrinter_GetAbort, 2497).
+-define(wxPrinter_GetLastError, 2498).
+-define(wxPrinter_GetPrintDialogData, 2499).
+-define(wxPrinter_Print, 2500).
+-define(wxPrinter_PrintDialog, 2501).
+-define(wxPrinter_ReportError, 2502).
+-define(wxPrinter_Setup, 2503).
+-define(wxPrinter_destroy, 2504).
+-define(wxXmlResource_new_1, 2505).
+-define(wxXmlResource_new_2, 2506).
+-define(wxXmlResource_destruct, 2507).
+-define(wxXmlResource_AttachUnknownControl, 2508).
+-define(wxXmlResource_ClearHandlers, 2509).
+-define(wxXmlResource_CompareVersion, 2510).
+-define(wxXmlResource_Get, 2511).
+-define(wxXmlResource_GetFlags, 2512).
+-define(wxXmlResource_GetVersion, 2513).
+-define(wxXmlResource_GetXRCID, 2514).
+-define(wxXmlResource_InitAllHandlers, 2515).
+-define(wxXmlResource_Load, 2516).
+-define(wxXmlResource_LoadBitmap, 2517).
+-define(wxXmlResource_LoadDialog_2, 2518).
+-define(wxXmlResource_LoadDialog_3, 2519).
+-define(wxXmlResource_LoadFrame_2, 2520).
+-define(wxXmlResource_LoadFrame_3, 2521).
+-define(wxXmlResource_LoadIcon, 2522).
+-define(wxXmlResource_LoadMenu, 2523).
+-define(wxXmlResource_LoadMenuBar_2, 2524).
+-define(wxXmlResource_LoadMenuBar_1, 2525).
+-define(wxXmlResource_LoadPanel_2, 2526).
+-define(wxXmlResource_LoadPanel_3, 2527).
+-define(wxXmlResource_LoadToolBar, 2528).
+-define(wxXmlResource_Set, 2529).
+-define(wxXmlResource_SetFlags, 2530).
+-define(wxXmlResource_Unload, 2531).
+-define(wxXmlResource_xrcctrl, 2532).
+-define(wxHtmlEasyPrinting_new, 2533).
+-define(wxHtmlEasyPrinting_destruct, 2534).
+-define(wxHtmlEasyPrinting_GetPrintData, 2535).
+-define(wxHtmlEasyPrinting_GetPageSetupData, 2536).
+-define(wxHtmlEasyPrinting_PreviewFile, 2537).
+-define(wxHtmlEasyPrinting_PreviewText, 2538).
+-define(wxHtmlEasyPrinting_PrintFile, 2539).
+-define(wxHtmlEasyPrinting_PrintText, 2540).
+-define(wxHtmlEasyPrinting_PageSetup, 2541).
+-define(wxHtmlEasyPrinting_SetFonts, 2542).
+-define(wxHtmlEasyPrinting_SetHeader, 2543).
+-define(wxHtmlEasyPrinting_SetFooter, 2544).
+-define(wxGLCanvas_new_2, 2546).
+-define(wxGLCanvas_new_3_1, 2547).
+-define(wxGLCanvas_new_3_0, 2548).
+-define(wxGLCanvas_GetContext, 2549).
+-define(wxGLCanvas_SetCurrent, 2551).
+-define(wxGLCanvas_SwapBuffers, 2552).
+-define(wxGLCanvas_destroy, 2553).
+-define(wxAuiManager_new, 2554).
+-define(wxAuiManager_destruct, 2555).
+-define(wxAuiManager_AddPane_2_1, 2556).
+-define(wxAuiManager_AddPane_3, 2557).
+-define(wxAuiManager_AddPane_2_0, 2558).
+-define(wxAuiManager_DetachPane, 2559).
+-define(wxAuiManager_GetAllPanes, 2560).
+-define(wxAuiManager_GetArtProvider, 2561).
+-define(wxAuiManager_GetDockSizeConstraint, 2562).
+-define(wxAuiManager_GetFlags, 2563).
+-define(wxAuiManager_GetManagedWindow, 2564).
+-define(wxAuiManager_GetManager, 2565).
+-define(wxAuiManager_GetPane_1_1, 2566).
+-define(wxAuiManager_GetPane_1_0, 2567).
+-define(wxAuiManager_HideHint, 2568).
+-define(wxAuiManager_InsertPane, 2569).
+-define(wxAuiManager_LoadPaneInfo, 2570).
+-define(wxAuiManager_LoadPerspective, 2571).
+-define(wxAuiManager_SavePaneInfo, 2572).
+-define(wxAuiManager_SavePerspective, 2573).
+-define(wxAuiManager_SetArtProvider, 2574).
+-define(wxAuiManager_SetDockSizeConstraint, 2575).
+-define(wxAuiManager_SetFlags, 2576).
+-define(wxAuiManager_SetManagedWindow, 2577).
+-define(wxAuiManager_ShowHint, 2578).
+-define(wxAuiManager_UnInit, 2579).
+-define(wxAuiManager_Update, 2580).
+-define(wxAuiPaneInfo_new_0, 2581).
+-define(wxAuiPaneInfo_new_1, 2582).
+-define(wxAuiPaneInfo_destruct, 2583).
+-define(wxAuiPaneInfo_BestSize_1, 2584).
+-define(wxAuiPaneInfo_BestSize_2, 2585).
+-define(wxAuiPaneInfo_Bottom, 2586).
+-define(wxAuiPaneInfo_BottomDockable, 2587).
+-define(wxAuiPaneInfo_Caption, 2588).
+-define(wxAuiPaneInfo_CaptionVisible, 2589).
+-define(wxAuiPaneInfo_Centre, 2590).
+-define(wxAuiPaneInfo_CentrePane, 2591).
+-define(wxAuiPaneInfo_CloseButton, 2592).
+-define(wxAuiPaneInfo_DefaultPane, 2593).
+-define(wxAuiPaneInfo_DestroyOnClose, 2594).
+-define(wxAuiPaneInfo_Direction, 2595).
+-define(wxAuiPaneInfo_Dock, 2596).
+-define(wxAuiPaneInfo_Dockable, 2597).
+-define(wxAuiPaneInfo_Fixed, 2598).
+-define(wxAuiPaneInfo_Float, 2599).
+-define(wxAuiPaneInfo_Floatable, 2600).
+-define(wxAuiPaneInfo_FloatingPosition_1, 2601).
+-define(wxAuiPaneInfo_FloatingPosition_2, 2602).
+-define(wxAuiPaneInfo_FloatingSize_1, 2603).
+-define(wxAuiPaneInfo_FloatingSize_2, 2604).
+-define(wxAuiPaneInfo_Gripper, 2605).
+-define(wxAuiPaneInfo_GripperTop, 2606).
+-define(wxAuiPaneInfo_HasBorder, 2607).
+-define(wxAuiPaneInfo_HasCaption, 2608).
+-define(wxAuiPaneInfo_HasCloseButton, 2609).
+-define(wxAuiPaneInfo_HasFlag, 2610).
+-define(wxAuiPaneInfo_HasGripper, 2611).
+-define(wxAuiPaneInfo_HasGripperTop, 2612).
+-define(wxAuiPaneInfo_HasMaximizeButton, 2613).
+-define(wxAuiPaneInfo_HasMinimizeButton, 2614).
+-define(wxAuiPaneInfo_HasPinButton, 2615).
+-define(wxAuiPaneInfo_Hide, 2616).
+-define(wxAuiPaneInfo_IsBottomDockable, 2617).
+-define(wxAuiPaneInfo_IsDocked, 2618).
+-define(wxAuiPaneInfo_IsFixed, 2619).
+-define(wxAuiPaneInfo_IsFloatable, 2620).
+-define(wxAuiPaneInfo_IsFloating, 2621).
+-define(wxAuiPaneInfo_IsLeftDockable, 2622).
+-define(wxAuiPaneInfo_IsMovable, 2623).
+-define(wxAuiPaneInfo_IsOk, 2624).
+-define(wxAuiPaneInfo_IsResizable, 2625).
+-define(wxAuiPaneInfo_IsRightDockable, 2626).
+-define(wxAuiPaneInfo_IsShown, 2627).
+-define(wxAuiPaneInfo_IsToolbar, 2628).
+-define(wxAuiPaneInfo_IsTopDockable, 2629).
+-define(wxAuiPaneInfo_Layer, 2630).
+-define(wxAuiPaneInfo_Left, 2631).
+-define(wxAuiPaneInfo_LeftDockable, 2632).
+-define(wxAuiPaneInfo_MaxSize_1, 2633).
+-define(wxAuiPaneInfo_MaxSize_2, 2634).
+-define(wxAuiPaneInfo_MaximizeButton, 2635).
+-define(wxAuiPaneInfo_MinSize_1, 2636).
+-define(wxAuiPaneInfo_MinSize_2, 2637).
+-define(wxAuiPaneInfo_MinimizeButton, 2638).
+-define(wxAuiPaneInfo_Movable, 2639).
+-define(wxAuiPaneInfo_Name, 2640).
+-define(wxAuiPaneInfo_PaneBorder, 2641).
+-define(wxAuiPaneInfo_PinButton, 2642).
+-define(wxAuiPaneInfo_Position, 2643).
+-define(wxAuiPaneInfo_Resizable, 2644).
+-define(wxAuiPaneInfo_Right, 2645).
+-define(wxAuiPaneInfo_RightDockable, 2646).
+-define(wxAuiPaneInfo_Row, 2647).
+-define(wxAuiPaneInfo_SafeSet, 2648).
+-define(wxAuiPaneInfo_SetFlag, 2649).
+-define(wxAuiPaneInfo_Show, 2650).
+-define(wxAuiPaneInfo_ToolbarPane, 2651).
+-define(wxAuiPaneInfo_Top, 2652).
+-define(wxAuiPaneInfo_TopDockable, 2653).
+-define(wxAuiPaneInfo_Window, 2654).
+-define(wxAuiPaneInfo_GetWindow, 2655).
+-define(wxAuiPaneInfo_GetFrame, 2656).
+-define(wxAuiPaneInfo_GetDirection, 2657).
+-define(wxAuiPaneInfo_GetLayer, 2658).
+-define(wxAuiPaneInfo_GetRow, 2659).
+-define(wxAuiPaneInfo_GetPosition, 2660).
+-define(wxAuiPaneInfo_GetFloatingPosition, 2661).
+-define(wxAuiPaneInfo_GetFloatingSize, 2662).
+-define(wxAuiNotebook_new_0, 2663).
+-define(wxAuiNotebook_new_2, 2664).
+-define(wxAuiNotebook_AddPage, 2665).
+-define(wxAuiNotebook_Create, 2666).
+-define(wxAuiNotebook_DeletePage, 2667).
+-define(wxAuiNotebook_GetArtProvider, 2668).
+-define(wxAuiNotebook_GetPage, 2669).
+-define(wxAuiNotebook_GetPageBitmap, 2670).
+-define(wxAuiNotebook_GetPageCount, 2671).
+-define(wxAuiNotebook_GetPageIndex, 2672).
+-define(wxAuiNotebook_GetPageText, 2673).
+-define(wxAuiNotebook_GetSelection, 2674).
+-define(wxAuiNotebook_InsertPage, 2675).
+-define(wxAuiNotebook_RemovePage, 2676).
+-define(wxAuiNotebook_SetArtProvider, 2677).
+-define(wxAuiNotebook_SetFont, 2678).
+-define(wxAuiNotebook_SetPageBitmap, 2679).
+-define(wxAuiNotebook_SetPageText, 2680).
+-define(wxAuiNotebook_SetSelection, 2681).
+-define(wxAuiNotebook_SetTabCtrlHeight, 2682).
+-define(wxAuiNotebook_SetUniformBitmapSize, 2683).
+-define(wxAuiNotebook_destroy, 2684).
+-define(wxAuiTabArt_SetFlags, 2685).
+-define(wxAuiTabArt_SetMeasuringFont, 2686).
+-define(wxAuiTabArt_SetNormalFont, 2687).
+-define(wxAuiTabArt_SetSelectedFont, 2688).
+-define(wxAuiTabArt_SetColour, 2689).
+-define(wxAuiTabArt_SetActiveColour, 2690).
+-define(wxAuiDockArt_GetColour, 2691).
+-define(wxAuiDockArt_GetFont, 2692).
+-define(wxAuiDockArt_GetMetric, 2693).
+-define(wxAuiDockArt_SetColour, 2694).
+-define(wxAuiDockArt_SetFont, 2695).
+-define(wxAuiDockArt_SetMetric, 2696).
+-define(wxAuiSimpleTabArt_new, 2697).
+-define(wxAuiSimpleTabArt_destroy, 2698).
+-define(wxMDIParentFrame_new_0, 2699).
+-define(wxMDIParentFrame_new_4, 2700).
+-define(wxMDIParentFrame_destruct, 2701).
+-define(wxMDIParentFrame_ActivateNext, 2702).
+-define(wxMDIParentFrame_ActivatePrevious, 2703).
+-define(wxMDIParentFrame_ArrangeIcons, 2704).
+-define(wxMDIParentFrame_Cascade, 2705).
+-define(wxMDIParentFrame_Create, 2706).
+-define(wxMDIParentFrame_GetActiveChild, 2707).
+-define(wxMDIParentFrame_GetClientWindow, 2708).
+-define(wxMDIParentFrame_Tile, 2709).
+-define(wxMDIChildFrame_new_0, 2710).
+-define(wxMDIChildFrame_new_4, 2711).
+-define(wxMDIChildFrame_destruct, 2712).
+-define(wxMDIChildFrame_Activate, 2713).
+-define(wxMDIChildFrame_Create, 2714).
+-define(wxMDIChildFrame_Maximize, 2715).
+-define(wxMDIChildFrame_Restore, 2716).
+-define(wxMDIClientWindow_new_0, 2717).
+-define(wxMDIClientWindow_new_2, 2718).
+-define(wxMDIClientWindow_destruct, 2719).
+-define(wxMDIClientWindow_CreateClient, 2720).
+-define(wxLayoutAlgorithm_new, 2721).
+-define(wxLayoutAlgorithm_LayoutFrame, 2722).
+-define(wxLayoutAlgorithm_LayoutMDIFrame, 2723).
+-define(wxLayoutAlgorithm_LayoutWindow, 2724).
+-define(wxLayoutAlgorithm_destroy, 2725).
+-define(wxEvent_GetId, 2726).
+-define(wxEvent_GetSkipped, 2727).
+-define(wxEvent_GetTimestamp, 2728).
+-define(wxEvent_IsCommandEvent, 2729).
+-define(wxEvent_ResumePropagation, 2730).
+-define(wxEvent_ShouldPropagate, 2731).
+-define(wxEvent_Skip, 2732).
+-define(wxEvent_StopPropagation, 2733).
+-define(wxCommandEvent_getClientData, 2734).
+-define(wxCommandEvent_GetExtraLong, 2735).
+-define(wxCommandEvent_GetInt, 2736).
+-define(wxCommandEvent_GetSelection, 2737).
+-define(wxCommandEvent_GetString, 2738).
+-define(wxCommandEvent_IsChecked, 2739).
+-define(wxCommandEvent_IsSelection, 2740).
+-define(wxCommandEvent_SetInt, 2741).
+-define(wxCommandEvent_SetString, 2742).
+-define(wxScrollEvent_GetOrientation, 2743).
+-define(wxScrollEvent_GetPosition, 2744).
+-define(wxScrollWinEvent_GetOrientation, 2745).
+-define(wxScrollWinEvent_GetPosition, 2746).
+-define(wxMouseEvent_AltDown, 2747).
+-define(wxMouseEvent_Button, 2748).
+-define(wxMouseEvent_ButtonDClick, 2749).
+-define(wxMouseEvent_ButtonDown, 2750).
+-define(wxMouseEvent_ButtonUp, 2751).
+-define(wxMouseEvent_CmdDown, 2752).
+-define(wxMouseEvent_ControlDown, 2753).
+-define(wxMouseEvent_Dragging, 2754).
+-define(wxMouseEvent_Entering, 2755).
+-define(wxMouseEvent_GetButton, 2756).
+-define(wxMouseEvent_GetPosition, 2759).
+-define(wxMouseEvent_GetLogicalPosition, 2760).
+-define(wxMouseEvent_GetLinesPerAction, 2761).
+-define(wxMouseEvent_GetWheelRotation, 2762).
+-define(wxMouseEvent_GetWheelDelta, 2763).
+-define(wxMouseEvent_GetX, 2764).
+-define(wxMouseEvent_GetY, 2765).
+-define(wxMouseEvent_IsButton, 2766).
+-define(wxMouseEvent_IsPageScroll, 2767).
+-define(wxMouseEvent_Leaving, 2768).
+-define(wxMouseEvent_LeftDClick, 2769).
+-define(wxMouseEvent_LeftDown, 2770).
+-define(wxMouseEvent_LeftIsDown, 2771).
+-define(wxMouseEvent_LeftUp, 2772).
+-define(wxMouseEvent_MetaDown, 2773).
+-define(wxMouseEvent_MiddleDClick, 2774).
+-define(wxMouseEvent_MiddleDown, 2775).
+-define(wxMouseEvent_MiddleIsDown, 2776).
+-define(wxMouseEvent_MiddleUp, 2777).
+-define(wxMouseEvent_Moving, 2778).
+-define(wxMouseEvent_RightDClick, 2779).
+-define(wxMouseEvent_RightDown, 2780).
+-define(wxMouseEvent_RightIsDown, 2781).
+-define(wxMouseEvent_RightUp, 2782).
+-define(wxMouseEvent_ShiftDown, 2783).
+-define(wxSetCursorEvent_GetCursor, 2784).
+-define(wxSetCursorEvent_GetX, 2785).
+-define(wxSetCursorEvent_GetY, 2786).
+-define(wxSetCursorEvent_HasCursor, 2787).
+-define(wxSetCursorEvent_SetCursor, 2788).
+-define(wxKeyEvent_AltDown, 2789).
+-define(wxKeyEvent_CmdDown, 2790).
+-define(wxKeyEvent_ControlDown, 2791).
+-define(wxKeyEvent_GetKeyCode, 2792).
+-define(wxKeyEvent_GetModifiers, 2793).
+-define(wxKeyEvent_GetPosition, 2796).
+-define(wxKeyEvent_GetRawKeyCode, 2797).
+-define(wxKeyEvent_GetRawKeyFlags, 2798).
+-define(wxKeyEvent_GetUnicodeKey, 2799).
+-define(wxKeyEvent_GetX, 2800).
+-define(wxKeyEvent_GetY, 2801).
+-define(wxKeyEvent_HasModifiers, 2802).
+-define(wxKeyEvent_MetaDown, 2803).
+-define(wxKeyEvent_ShiftDown, 2804).
+-define(wxSizeEvent_GetSize, 2805).
+-define(wxMoveEvent_GetPosition, 2806).
+-define(wxEraseEvent_GetDC, 2807).
+-define(wxFocusEvent_GetWindow, 2808).
+-define(wxChildFocusEvent_GetWindow, 2809).
+-define(wxMenuEvent_GetMenu, 2810).
+-define(wxMenuEvent_GetMenuId, 2811).
+-define(wxMenuEvent_IsPopup, 2812).
+-define(wxCloseEvent_CanVeto, 2813).
+-define(wxCloseEvent_GetLoggingOff, 2814).
+-define(wxCloseEvent_SetCanVeto, 2815).
+-define(wxCloseEvent_SetLoggingOff, 2816).
+-define(wxCloseEvent_Veto, 2817).
+-define(wxShowEvent_SetShow, 2818).
+-define(wxShowEvent_GetShow, 2819).
+-define(wxIconizeEvent_Iconized, 2820).
+-define(wxJoystickEvent_ButtonDown, 2821).
+-define(wxJoystickEvent_ButtonIsDown, 2822).
+-define(wxJoystickEvent_ButtonUp, 2823).
+-define(wxJoystickEvent_GetButtonChange, 2824).
+-define(wxJoystickEvent_GetButtonState, 2825).
+-define(wxJoystickEvent_GetJoystick, 2826).
+-define(wxJoystickEvent_GetPosition, 2827).
+-define(wxJoystickEvent_GetZPosition, 2828).
+-define(wxJoystickEvent_IsButton, 2829).
+-define(wxJoystickEvent_IsMove, 2830).
+-define(wxJoystickEvent_IsZMove, 2831).
+-define(wxUpdateUIEvent_CanUpdate, 2832).
+-define(wxUpdateUIEvent_Check, 2833).
+-define(wxUpdateUIEvent_Enable, 2834).
+-define(wxUpdateUIEvent_Show, 2835).
+-define(wxUpdateUIEvent_GetChecked, 2836).
+-define(wxUpdateUIEvent_GetEnabled, 2837).
+-define(wxUpdateUIEvent_GetShown, 2838).
+-define(wxUpdateUIEvent_GetSetChecked, 2839).
+-define(wxUpdateUIEvent_GetSetEnabled, 2840).
+-define(wxUpdateUIEvent_GetSetShown, 2841).
+-define(wxUpdateUIEvent_GetSetText, 2842).
+-define(wxUpdateUIEvent_GetText, 2843).
+-define(wxUpdateUIEvent_GetMode, 2844).
+-define(wxUpdateUIEvent_GetUpdateInterval, 2845).
+-define(wxUpdateUIEvent_ResetUpdateTime, 2846).
+-define(wxUpdateUIEvent_SetMode, 2847).
+-define(wxUpdateUIEvent_SetText, 2848).
+-define(wxUpdateUIEvent_SetUpdateInterval, 2849).
+-define(wxMouseCaptureChangedEvent_GetCapturedWindow, 2850).
+-define(wxPaletteChangedEvent_SetChangedWindow, 2851).
+-define(wxPaletteChangedEvent_GetChangedWindow, 2852).
+-define(wxQueryNewPaletteEvent_SetPaletteRealized, 2853).
+-define(wxQueryNewPaletteEvent_GetPaletteRealized, 2854).
+-define(wxNavigationKeyEvent_GetDirection, 2855).
+-define(wxNavigationKeyEvent_SetDirection, 2856).
+-define(wxNavigationKeyEvent_IsWindowChange, 2857).
+-define(wxNavigationKeyEvent_SetWindowChange, 2858).
+-define(wxNavigationKeyEvent_IsFromTab, 2859).
+-define(wxNavigationKeyEvent_SetFromTab, 2860).
+-define(wxNavigationKeyEvent_GetCurrentFocus, 2861).
+-define(wxNavigationKeyEvent_SetCurrentFocus, 2862).
+-define(wxHelpEvent_GetOrigin, 2863).
+-define(wxHelpEvent_GetPosition, 2864).
+-define(wxHelpEvent_SetOrigin, 2865).
+-define(wxHelpEvent_SetPosition, 2866).
+-define(wxContextMenuEvent_GetPosition, 2867).
+-define(wxContextMenuEvent_SetPosition, 2868).
+-define(wxIdleEvent_CanSend, 2869).
+-define(wxIdleEvent_GetMode, 2870).
+-define(wxIdleEvent_RequestMore, 2871).
+-define(wxIdleEvent_MoreRequested, 2872).
+-define(wxIdleEvent_SetMode, 2873).
+-define(wxGridEvent_AltDown, 2874).
+-define(wxGridEvent_ControlDown, 2875).
+-define(wxGridEvent_GetCol, 2876).
+-define(wxGridEvent_GetPosition, 2877).
+-define(wxGridEvent_GetRow, 2878).
+-define(wxGridEvent_MetaDown, 2879).
+-define(wxGridEvent_Selecting, 2880).
+-define(wxGridEvent_ShiftDown, 2881).
+-define(wxNotifyEvent_Allow, 2882).
+-define(wxNotifyEvent_IsAllowed, 2883).
+-define(wxNotifyEvent_Veto, 2884).
+-define(wxSashEvent_GetEdge, 2885).
+-define(wxSashEvent_GetDragRect, 2886).
+-define(wxSashEvent_GetDragStatus, 2887).
+-define(wxListEvent_GetCacheFrom, 2888).
+-define(wxListEvent_GetCacheTo, 2889).
+-define(wxListEvent_GetKeyCode, 2890).
+-define(wxListEvent_GetIndex, 2891).
+-define(wxListEvent_GetColumn, 2892).
+-define(wxListEvent_GetPoint, 2893).
+-define(wxListEvent_GetLabel, 2894).
+-define(wxListEvent_GetText, 2895).
+-define(wxListEvent_GetImage, 2896).
+-define(wxListEvent_GetData, 2897).
+-define(wxListEvent_GetMask, 2898).
+-define(wxListEvent_GetItem, 2899).
+-define(wxListEvent_IsEditCancelled, 2900).
+-define(wxDateEvent_GetDate, 2901).
+-define(wxCalendarEvent_GetWeekDay, 2902).
+-define(wxFileDirPickerEvent_GetPath, 2903).
+-define(wxColourPickerEvent_GetColour, 2904).
+-define(wxFontPickerEvent_GetFont, 2905).
+-define(wxStyledTextEvent_GetPosition, 2906).
+-define(wxStyledTextEvent_GetKey, 2907).
+-define(wxStyledTextEvent_GetModifiers, 2908).
+-define(wxStyledTextEvent_GetModificationType, 2909).
+-define(wxStyledTextEvent_GetText, 2910).
+-define(wxStyledTextEvent_GetLength, 2911).
+-define(wxStyledTextEvent_GetLinesAdded, 2912).
+-define(wxStyledTextEvent_GetLine, 2913).
+-define(wxStyledTextEvent_GetFoldLevelNow, 2914).
+-define(wxStyledTextEvent_GetFoldLevelPrev, 2915).
+-define(wxStyledTextEvent_GetMargin, 2916).
+-define(wxStyledTextEvent_GetMessage, 2917).
+-define(wxStyledTextEvent_GetWParam, 2918).
+-define(wxStyledTextEvent_GetLParam, 2919).
+-define(wxStyledTextEvent_GetListType, 2920).
+-define(wxStyledTextEvent_GetX, 2921).
+-define(wxStyledTextEvent_GetY, 2922).
+-define(wxStyledTextEvent_GetDragText, 2923).
+-define(wxStyledTextEvent_GetDragAllowMove, 2924).
+-define(wxStyledTextEvent_GetDragResult, 2925).
+-define(wxStyledTextEvent_GetShift, 2926).
+-define(wxStyledTextEvent_GetControl, 2927).
+-define(wxStyledTextEvent_GetAlt, 2928).
+-define(utils_wxGetKeyState, 2929).
+-define(utils_wxGetMousePosition, 2930).
+-define(utils_wxGetMouseState, 2931).
+-define(utils_wxSetDetectableAutoRepeat, 2932).
+-define(utils_wxBell, 2933).
+-define(utils_wxFindMenuItemId, 2934).
+-define(utils_wxGenericFindWindowAtPoint, 2935).
+-define(utils_wxFindWindowAtPoint, 2936).
+-define(utils_wxBeginBusyCursor, 2937).
+-define(utils_wxEndBusyCursor, 2938).
+-define(utils_wxIsBusy, 2939).
+-define(utils_wxShutdown, 2940).
+-define(utils_wxShell, 2941).
+-define(utils_wxLaunchDefaultBrowser, 2942).
+-define(utils_wxGetEmailAddress, 2943).
+-define(utils_wxGetUserId, 2944).
+-define(utils_wxGetHomeDir, 2945).
+-define(utils_wxNewId, 2946).
+-define(utils_wxRegisterId, 2947).
+-define(utils_wxGetCurrentId, 2948).
+-define(utils_wxGetOsDescription, 2949).
+-define(utils_wxIsPlatformLittleEndian, 2950).
+-define(utils_wxIsPlatform64Bit, 2951).
+-define(gdicmn_wxDisplaySize, 2952).
+-define(gdicmn_wxSetCursor, 2953).
+-define(wxPrintout_new, 2954).
+-define(wxPrintout_destruct, 2955).
+-define(wxPrintout_GetDC, 2956).
+-define(wxPrintout_GetPageSizeMM, 2957).
+-define(wxPrintout_GetPageSizePixels, 2958).
+-define(wxPrintout_GetPaperRectPixels, 2959).
+-define(wxPrintout_GetPPIPrinter, 2960).
+-define(wxPrintout_GetPPIScreen, 2961).
+-define(wxPrintout_GetTitle, 2962).
+-define(wxPrintout_IsPreview, 2963).
+-define(wxPrintout_FitThisSizeToPaper, 2964).
+-define(wxPrintout_FitThisSizeToPage, 2965).
+-define(wxPrintout_FitThisSizeToPageMargins, 2966).
+-define(wxPrintout_MapScreenSizeToPaper, 2967).
+-define(wxPrintout_MapScreenSizeToPage, 2968).
+-define(wxPrintout_MapScreenSizeToPageMargins, 2969).
+-define(wxPrintout_MapScreenSizeToDevice, 2970).
+-define(wxPrintout_GetLogicalPaperRect, 2971).
+-define(wxPrintout_GetLogicalPageRect, 2972).
+-define(wxPrintout_GetLogicalPageMarginsRect, 2973).
+-define(wxPrintout_SetLogicalOrigin, 2974).
+-define(wxPrintout_OffsetLogicalOrigin, 2975).
+-define(wxStyledTextCtrl_new_2, 2976).
+-define(wxStyledTextCtrl_new_0, 2977).
+-define(wxStyledTextCtrl_destruct, 2978).
+-define(wxStyledTextCtrl_Create, 2979).
+-define(wxStyledTextCtrl_AddText, 2980).
+-define(wxStyledTextCtrl_AddStyledText, 2981).
+-define(wxStyledTextCtrl_InsertText, 2982).
+-define(wxStyledTextCtrl_ClearAll, 2983).
+-define(wxStyledTextCtrl_ClearDocumentStyle, 2984).
+-define(wxStyledTextCtrl_GetLength, 2985).
+-define(wxStyledTextCtrl_GetCharAt, 2986).
+-define(wxStyledTextCtrl_GetCurrentPos, 2987).
+-define(wxStyledTextCtrl_GetAnchor, 2988).
+-define(wxStyledTextCtrl_GetStyleAt, 2989).
+-define(wxStyledTextCtrl_Redo, 2990).
+-define(wxStyledTextCtrl_SetUndoCollection, 2991).
+-define(wxStyledTextCtrl_SelectAll, 2992).
+-define(wxStyledTextCtrl_SetSavePoint, 2993).
+-define(wxStyledTextCtrl_GetStyledText, 2994).
+-define(wxStyledTextCtrl_CanRedo, 2995).
+-define(wxStyledTextCtrl_MarkerLineFromHandle, 2996).
+-define(wxStyledTextCtrl_MarkerDeleteHandle, 2997).
+-define(wxStyledTextCtrl_GetUndoCollection, 2998).
+-define(wxStyledTextCtrl_GetViewWhiteSpace, 2999).
+-define(wxStyledTextCtrl_SetViewWhiteSpace, 3000).
+-define(wxStyledTextCtrl_PositionFromPoint, 3001).
+-define(wxStyledTextCtrl_PositionFromPointClose, 3002).
+-define(wxStyledTextCtrl_GotoLine, 3003).
+-define(wxStyledTextCtrl_GotoPos, 3004).
+-define(wxStyledTextCtrl_SetAnchor, 3005).
+-define(wxStyledTextCtrl_GetCurLine, 3006).
+-define(wxStyledTextCtrl_GetEndStyled, 3007).
+-define(wxStyledTextCtrl_ConvertEOLs, 3008).
+-define(wxStyledTextCtrl_GetEOLMode, 3009).
+-define(wxStyledTextCtrl_SetEOLMode, 3010).
+-define(wxStyledTextCtrl_StartStyling, 3011).
+-define(wxStyledTextCtrl_SetStyling, 3012).
+-define(wxStyledTextCtrl_GetBufferedDraw, 3013).
+-define(wxStyledTextCtrl_SetBufferedDraw, 3014).
+-define(wxStyledTextCtrl_SetTabWidth, 3015).
+-define(wxStyledTextCtrl_GetTabWidth, 3016).
+-define(wxStyledTextCtrl_SetCodePage, 3017).
+-define(wxStyledTextCtrl_MarkerDefine, 3018).
+-define(wxStyledTextCtrl_MarkerSetForeground, 3019).
+-define(wxStyledTextCtrl_MarkerSetBackground, 3020).
+-define(wxStyledTextCtrl_MarkerAdd, 3021).
+-define(wxStyledTextCtrl_MarkerDelete, 3022).
+-define(wxStyledTextCtrl_MarkerDeleteAll, 3023).
+-define(wxStyledTextCtrl_MarkerGet, 3024).
+-define(wxStyledTextCtrl_MarkerNext, 3025).
+-define(wxStyledTextCtrl_MarkerPrevious, 3026).
+-define(wxStyledTextCtrl_MarkerDefineBitmap, 3027).
+-define(wxStyledTextCtrl_MarkerAddSet, 3028).
+-define(wxStyledTextCtrl_MarkerSetAlpha, 3029).
+-define(wxStyledTextCtrl_SetMarginType, 3030).
+-define(wxStyledTextCtrl_GetMarginType, 3031).
+-define(wxStyledTextCtrl_SetMarginWidth, 3032).
+-define(wxStyledTextCtrl_GetMarginWidth, 3033).
+-define(wxStyledTextCtrl_SetMarginMask, 3034).
+-define(wxStyledTextCtrl_GetMarginMask, 3035).
+-define(wxStyledTextCtrl_SetMarginSensitive, 3036).
+-define(wxStyledTextCtrl_GetMarginSensitive, 3037).
+-define(wxStyledTextCtrl_StyleClearAll, 3038).
+-define(wxStyledTextCtrl_StyleSetForeground, 3039).
+-define(wxStyledTextCtrl_StyleSetBackground, 3040).
+-define(wxStyledTextCtrl_StyleSetBold, 3041).
+-define(wxStyledTextCtrl_StyleSetItalic, 3042).
+-define(wxStyledTextCtrl_StyleSetSize, 3043).
+-define(wxStyledTextCtrl_StyleSetFaceName, 3044).
+-define(wxStyledTextCtrl_StyleSetEOLFilled, 3045).
+-define(wxStyledTextCtrl_StyleResetDefault, 3046).
+-define(wxStyledTextCtrl_StyleSetUnderline, 3047).
+-define(wxStyledTextCtrl_StyleSetCase, 3048).
+-define(wxStyledTextCtrl_StyleSetHotSpot, 3049).
+-define(wxStyledTextCtrl_SetSelForeground, 3050).
+-define(wxStyledTextCtrl_SetSelBackground, 3051).
+-define(wxStyledTextCtrl_GetSelAlpha, 3052).
+-define(wxStyledTextCtrl_SetSelAlpha, 3053).
+-define(wxStyledTextCtrl_SetCaretForeground, 3054).
+-define(wxStyledTextCtrl_CmdKeyAssign, 3055).
+-define(wxStyledTextCtrl_CmdKeyClear, 3056).
+-define(wxStyledTextCtrl_CmdKeyClearAll, 3057).
+-define(wxStyledTextCtrl_SetStyleBytes, 3058).
+-define(wxStyledTextCtrl_StyleSetVisible, 3059).
+-define(wxStyledTextCtrl_GetCaretPeriod, 3060).
+-define(wxStyledTextCtrl_SetCaretPeriod, 3061).
+-define(wxStyledTextCtrl_SetWordChars, 3062).
+-define(wxStyledTextCtrl_BeginUndoAction, 3063).
+-define(wxStyledTextCtrl_EndUndoAction, 3064).
+-define(wxStyledTextCtrl_IndicatorSetStyle, 3065).
+-define(wxStyledTextCtrl_IndicatorGetStyle, 3066).
+-define(wxStyledTextCtrl_IndicatorSetForeground, 3067).
+-define(wxStyledTextCtrl_IndicatorGetForeground, 3068).
+-define(wxStyledTextCtrl_SetWhitespaceForeground, 3069).
+-define(wxStyledTextCtrl_SetWhitespaceBackground, 3070).
+-define(wxStyledTextCtrl_GetStyleBits, 3071).
+-define(wxStyledTextCtrl_SetLineState, 3072).
+-define(wxStyledTextCtrl_GetLineState, 3073).
+-define(wxStyledTextCtrl_GetMaxLineState, 3074).
+-define(wxStyledTextCtrl_GetCaretLineVisible, 3075).
+-define(wxStyledTextCtrl_SetCaretLineVisible, 3076).
+-define(wxStyledTextCtrl_GetCaretLineBackground, 3077).
+-define(wxStyledTextCtrl_SetCaretLineBackground, 3078).
+-define(wxStyledTextCtrl_AutoCompShow, 3079).
+-define(wxStyledTextCtrl_AutoCompCancel, 3080).
+-define(wxStyledTextCtrl_AutoCompActive, 3081).
+-define(wxStyledTextCtrl_AutoCompPosStart, 3082).
+-define(wxStyledTextCtrl_AutoCompComplete, 3083).
+-define(wxStyledTextCtrl_AutoCompStops, 3084).
+-define(wxStyledTextCtrl_AutoCompSetSeparator, 3085).
+-define(wxStyledTextCtrl_AutoCompGetSeparator, 3086).
+-define(wxStyledTextCtrl_AutoCompSelect, 3087).
+-define(wxStyledTextCtrl_AutoCompSetCancelAtStart, 3088).
+-define(wxStyledTextCtrl_AutoCompGetCancelAtStart, 3089).
+-define(wxStyledTextCtrl_AutoCompSetFillUps, 3090).
+-define(wxStyledTextCtrl_AutoCompSetChooseSingle, 3091).
+-define(wxStyledTextCtrl_AutoCompGetChooseSingle, 3092).
+-define(wxStyledTextCtrl_AutoCompSetIgnoreCase, 3093).
+-define(wxStyledTextCtrl_AutoCompGetIgnoreCase, 3094).
+-define(wxStyledTextCtrl_UserListShow, 3095).
+-define(wxStyledTextCtrl_AutoCompSetAutoHide, 3096).
+-define(wxStyledTextCtrl_AutoCompGetAutoHide, 3097).
+-define(wxStyledTextCtrl_AutoCompSetDropRestOfWord, 3098).
+-define(wxStyledTextCtrl_AutoCompGetDropRestOfWord, 3099).
+-define(wxStyledTextCtrl_RegisterImage, 3100).
+-define(wxStyledTextCtrl_ClearRegisteredImages, 3101).
+-define(wxStyledTextCtrl_AutoCompGetTypeSeparator, 3102).
+-define(wxStyledTextCtrl_AutoCompSetTypeSeparator, 3103).
+-define(wxStyledTextCtrl_AutoCompSetMaxWidth, 3104).
+-define(wxStyledTextCtrl_AutoCompGetMaxWidth, 3105).
+-define(wxStyledTextCtrl_AutoCompSetMaxHeight, 3106).
+-define(wxStyledTextCtrl_AutoCompGetMaxHeight, 3107).
+-define(wxStyledTextCtrl_SetIndent, 3108).
+-define(wxStyledTextCtrl_GetIndent, 3109).
+-define(wxStyledTextCtrl_SetUseTabs, 3110).
+-define(wxStyledTextCtrl_GetUseTabs, 3111).
+-define(wxStyledTextCtrl_SetLineIndentation, 3112).
+-define(wxStyledTextCtrl_GetLineIndentation, 3113).
+-define(wxStyledTextCtrl_GetLineIndentPosition, 3114).
+-define(wxStyledTextCtrl_GetColumn, 3115).
+-define(wxStyledTextCtrl_SetUseHorizontalScrollBar, 3116).
+-define(wxStyledTextCtrl_GetUseHorizontalScrollBar, 3117).
+-define(wxStyledTextCtrl_SetIndentationGuides, 3118).
+-define(wxStyledTextCtrl_GetIndentationGuides, 3119).
+-define(wxStyledTextCtrl_SetHighlightGuide, 3120).
+-define(wxStyledTextCtrl_GetHighlightGuide, 3121).
+-define(wxStyledTextCtrl_GetLineEndPosition, 3122).
+-define(wxStyledTextCtrl_GetCodePage, 3123).
+-define(wxStyledTextCtrl_GetCaretForeground, 3124).
+-define(wxStyledTextCtrl_GetReadOnly, 3125).
+-define(wxStyledTextCtrl_SetCurrentPos, 3126).
+-define(wxStyledTextCtrl_SetSelectionStart, 3127).
+-define(wxStyledTextCtrl_GetSelectionStart, 3128).
+-define(wxStyledTextCtrl_SetSelectionEnd, 3129).
+-define(wxStyledTextCtrl_GetSelectionEnd, 3130).
+-define(wxStyledTextCtrl_SetPrintMagnification, 3131).
+-define(wxStyledTextCtrl_GetPrintMagnification, 3132).
+-define(wxStyledTextCtrl_SetPrintColourMode, 3133).
+-define(wxStyledTextCtrl_GetPrintColourMode, 3134).
+-define(wxStyledTextCtrl_FindText, 3135).
+-define(wxStyledTextCtrl_FormatRange, 3136).
+-define(wxStyledTextCtrl_GetFirstVisibleLine, 3137).
+-define(wxStyledTextCtrl_GetLine, 3138).
+-define(wxStyledTextCtrl_GetLineCount, 3139).
+-define(wxStyledTextCtrl_SetMarginLeft, 3140).
+-define(wxStyledTextCtrl_GetMarginLeft, 3141).
+-define(wxStyledTextCtrl_SetMarginRight, 3142).
+-define(wxStyledTextCtrl_GetMarginRight, 3143).
+-define(wxStyledTextCtrl_GetModify, 3144).
+-define(wxStyledTextCtrl_SetSelection, 3145).
+-define(wxStyledTextCtrl_GetSelectedText, 3146).
+-define(wxStyledTextCtrl_GetTextRange, 3147).
+-define(wxStyledTextCtrl_HideSelection, 3148).
+-define(wxStyledTextCtrl_LineFromPosition, 3149).
+-define(wxStyledTextCtrl_PositionFromLine, 3150).
+-define(wxStyledTextCtrl_LineScroll, 3151).
+-define(wxStyledTextCtrl_EnsureCaretVisible, 3152).
+-define(wxStyledTextCtrl_ReplaceSelection, 3153).
+-define(wxStyledTextCtrl_SetReadOnly, 3154).
+-define(wxStyledTextCtrl_CanPaste, 3155).
+-define(wxStyledTextCtrl_CanUndo, 3156).
+-define(wxStyledTextCtrl_EmptyUndoBuffer, 3157).
+-define(wxStyledTextCtrl_Undo, 3158).
+-define(wxStyledTextCtrl_Cut, 3159).
+-define(wxStyledTextCtrl_Copy, 3160).
+-define(wxStyledTextCtrl_Paste, 3161).
+-define(wxStyledTextCtrl_Clear, 3162).
+-define(wxStyledTextCtrl_SetText, 3163).
+-define(wxStyledTextCtrl_GetText, 3164).
+-define(wxStyledTextCtrl_GetTextLength, 3165).
+-define(wxStyledTextCtrl_GetOvertype, 3166).
+-define(wxStyledTextCtrl_SetCaretWidth, 3167).
+-define(wxStyledTextCtrl_GetCaretWidth, 3168).
+-define(wxStyledTextCtrl_SetTargetStart, 3169).
+-define(wxStyledTextCtrl_GetTargetStart, 3170).
+-define(wxStyledTextCtrl_SetTargetEnd, 3171).
+-define(wxStyledTextCtrl_GetTargetEnd, 3172).
+-define(wxStyledTextCtrl_ReplaceTarget, 3173).
+-define(wxStyledTextCtrl_SearchInTarget, 3174).
+-define(wxStyledTextCtrl_SetSearchFlags, 3175).
+-define(wxStyledTextCtrl_GetSearchFlags, 3176).
+-define(wxStyledTextCtrl_CallTipShow, 3177).
+-define(wxStyledTextCtrl_CallTipCancel, 3178).
+-define(wxStyledTextCtrl_CallTipActive, 3179).
+-define(wxStyledTextCtrl_CallTipPosAtStart, 3180).
+-define(wxStyledTextCtrl_CallTipSetHighlight, 3181).
+-define(wxStyledTextCtrl_CallTipSetBackground, 3182).
+-define(wxStyledTextCtrl_CallTipSetForeground, 3183).
+-define(wxStyledTextCtrl_CallTipSetForegroundHighlight, 3184).
+-define(wxStyledTextCtrl_CallTipUseStyle, 3185).
+-define(wxStyledTextCtrl_VisibleFromDocLine, 3186).
+-define(wxStyledTextCtrl_DocLineFromVisible, 3187).
+-define(wxStyledTextCtrl_WrapCount, 3188).
+-define(wxStyledTextCtrl_SetFoldLevel, 3189).
+-define(wxStyledTextCtrl_GetFoldLevel, 3190).
+-define(wxStyledTextCtrl_GetLastChild, 3191).
+-define(wxStyledTextCtrl_GetFoldParent, 3192).
+-define(wxStyledTextCtrl_ShowLines, 3193).
+-define(wxStyledTextCtrl_HideLines, 3194).
+-define(wxStyledTextCtrl_GetLineVisible, 3195).
+-define(wxStyledTextCtrl_SetFoldExpanded, 3196).
+-define(wxStyledTextCtrl_GetFoldExpanded, 3197).
+-define(wxStyledTextCtrl_ToggleFold, 3198).
+-define(wxStyledTextCtrl_EnsureVisible, 3199).
+-define(wxStyledTextCtrl_SetFoldFlags, 3200).
+-define(wxStyledTextCtrl_EnsureVisibleEnforcePolicy, 3201).
+-define(wxStyledTextCtrl_SetTabIndents, 3202).
+-define(wxStyledTextCtrl_GetTabIndents, 3203).
+-define(wxStyledTextCtrl_SetBackSpaceUnIndents, 3204).
+-define(wxStyledTextCtrl_GetBackSpaceUnIndents, 3205).
+-define(wxStyledTextCtrl_SetMouseDwellTime, 3206).
+-define(wxStyledTextCtrl_GetMouseDwellTime, 3207).
+-define(wxStyledTextCtrl_WordStartPosition, 3208).
+-define(wxStyledTextCtrl_WordEndPosition, 3209).
+-define(wxStyledTextCtrl_SetWrapMode, 3210).
+-define(wxStyledTextCtrl_GetWrapMode, 3211).
+-define(wxStyledTextCtrl_SetWrapVisualFlags, 3212).
+-define(wxStyledTextCtrl_GetWrapVisualFlags, 3213).
+-define(wxStyledTextCtrl_SetWrapVisualFlagsLocation, 3214).
+-define(wxStyledTextCtrl_GetWrapVisualFlagsLocation, 3215).
+-define(wxStyledTextCtrl_SetWrapStartIndent, 3216).
+-define(wxStyledTextCtrl_GetWrapStartIndent, 3217).
+-define(wxStyledTextCtrl_SetLayoutCache, 3218).
+-define(wxStyledTextCtrl_GetLayoutCache, 3219).
+-define(wxStyledTextCtrl_SetScrollWidth, 3220).
+-define(wxStyledTextCtrl_GetScrollWidth, 3221).
+-define(wxStyledTextCtrl_TextWidth, 3222).
+-define(wxStyledTextCtrl_GetEndAtLastLine, 3223).
+-define(wxStyledTextCtrl_TextHeight, 3224).
+-define(wxStyledTextCtrl_SetUseVerticalScrollBar, 3225).
+-define(wxStyledTextCtrl_GetUseVerticalScrollBar, 3226).
+-define(wxStyledTextCtrl_AppendText, 3227).
+-define(wxStyledTextCtrl_GetTwoPhaseDraw, 3228).
+-define(wxStyledTextCtrl_SetTwoPhaseDraw, 3229).
+-define(wxStyledTextCtrl_TargetFromSelection, 3230).
+-define(wxStyledTextCtrl_LinesJoin, 3231).
+-define(wxStyledTextCtrl_LinesSplit, 3232).
+-define(wxStyledTextCtrl_SetFoldMarginColour, 3233).
+-define(wxStyledTextCtrl_SetFoldMarginHiColour, 3234).
+-define(wxStyledTextCtrl_LineDown, 3235).
+-define(wxStyledTextCtrl_LineDownExtend, 3236).
+-define(wxStyledTextCtrl_LineUp, 3237).
+-define(wxStyledTextCtrl_LineUpExtend, 3238).
+-define(wxStyledTextCtrl_CharLeft, 3239).
+-define(wxStyledTextCtrl_CharLeftExtend, 3240).
+-define(wxStyledTextCtrl_CharRight, 3241).
+-define(wxStyledTextCtrl_CharRightExtend, 3242).
+-define(wxStyledTextCtrl_WordLeft, 3243).
+-define(wxStyledTextCtrl_WordLeftExtend, 3244).
+-define(wxStyledTextCtrl_WordRight, 3245).
+-define(wxStyledTextCtrl_WordRightExtend, 3246).
+-define(wxStyledTextCtrl_Home, 3247).
+-define(wxStyledTextCtrl_HomeExtend, 3248).
+-define(wxStyledTextCtrl_LineEnd, 3249).
+-define(wxStyledTextCtrl_LineEndExtend, 3250).
+-define(wxStyledTextCtrl_DocumentStart, 3251).
+-define(wxStyledTextCtrl_DocumentStartExtend, 3252).
+-define(wxStyledTextCtrl_DocumentEnd, 3253).
+-define(wxStyledTextCtrl_DocumentEndExtend, 3254).
+-define(wxStyledTextCtrl_PageUp, 3255).
+-define(wxStyledTextCtrl_PageUpExtend, 3256).
+-define(wxStyledTextCtrl_PageDown, 3257).
+-define(wxStyledTextCtrl_PageDownExtend, 3258).
+-define(wxStyledTextCtrl_EditToggleOvertype, 3259).
+-define(wxStyledTextCtrl_Cancel, 3260).
+-define(wxStyledTextCtrl_DeleteBack, 3261).
+-define(wxStyledTextCtrl_Tab, 3262).
+-define(wxStyledTextCtrl_BackTab, 3263).
+-define(wxStyledTextCtrl_NewLine, 3264).
+-define(wxStyledTextCtrl_FormFeed, 3265).
+-define(wxStyledTextCtrl_VCHome, 3266).
+-define(wxStyledTextCtrl_VCHomeExtend, 3267).
+-define(wxStyledTextCtrl_ZoomIn, 3268).
+-define(wxStyledTextCtrl_ZoomOut, 3269).
+-define(wxStyledTextCtrl_DelWordLeft, 3270).
+-define(wxStyledTextCtrl_DelWordRight, 3271).
+-define(wxStyledTextCtrl_LineCut, 3272).
+-define(wxStyledTextCtrl_LineDelete, 3273).
+-define(wxStyledTextCtrl_LineTranspose, 3274).
+-define(wxStyledTextCtrl_LineDuplicate, 3275).
+-define(wxStyledTextCtrl_LowerCase, 3276).
+-define(wxStyledTextCtrl_UpperCase, 3277).
+-define(wxStyledTextCtrl_LineScrollDown, 3278).
+-define(wxStyledTextCtrl_LineScrollUp, 3279).
+-define(wxStyledTextCtrl_DeleteBackNotLine, 3280).
+-define(wxStyledTextCtrl_HomeDisplay, 3281).
+-define(wxStyledTextCtrl_HomeDisplayExtend, 3282).
+-define(wxStyledTextCtrl_LineEndDisplay, 3283).
+-define(wxStyledTextCtrl_LineEndDisplayExtend, 3284).
+-define(wxStyledTextCtrl_HomeWrapExtend, 3285).
+-define(wxStyledTextCtrl_LineEndWrap, 3286).
+-define(wxStyledTextCtrl_LineEndWrapExtend, 3287).
+-define(wxStyledTextCtrl_VCHomeWrap, 3288).
+-define(wxStyledTextCtrl_VCHomeWrapExtend, 3289).
+-define(wxStyledTextCtrl_LineCopy, 3290).
+-define(wxStyledTextCtrl_MoveCaretInsideView, 3291).
+-define(wxStyledTextCtrl_LineLength, 3292).
+-define(wxStyledTextCtrl_BraceHighlight, 3293).
+-define(wxStyledTextCtrl_BraceBadLight, 3294).
+-define(wxStyledTextCtrl_BraceMatch, 3295).
+-define(wxStyledTextCtrl_GetViewEOL, 3296).
+-define(wxStyledTextCtrl_SetViewEOL, 3297).
+-define(wxStyledTextCtrl_SetModEventMask, 3298).
+-define(wxStyledTextCtrl_GetEdgeColumn, 3299).
+-define(wxStyledTextCtrl_SetEdgeColumn, 3300).
+-define(wxStyledTextCtrl_SetEdgeMode, 3301).
+-define(wxStyledTextCtrl_GetEdgeMode, 3302).
+-define(wxStyledTextCtrl_GetEdgeColour, 3303).
+-define(wxStyledTextCtrl_SetEdgeColour, 3304).
+-define(wxStyledTextCtrl_SearchAnchor, 3305).
+-define(wxStyledTextCtrl_SearchNext, 3306).
+-define(wxStyledTextCtrl_SearchPrev, 3307).
+-define(wxStyledTextCtrl_LinesOnScreen, 3308).
+-define(wxStyledTextCtrl_UsePopUp, 3309).
+-define(wxStyledTextCtrl_SelectionIsRectangle, 3310).
+-define(wxStyledTextCtrl_SetZoom, 3311).
+-define(wxStyledTextCtrl_GetZoom, 3312).
+-define(wxStyledTextCtrl_GetModEventMask, 3313).
+-define(wxStyledTextCtrl_SetSTCFocus, 3314).
+-define(wxStyledTextCtrl_GetSTCFocus, 3315).
+-define(wxStyledTextCtrl_SetStatus, 3316).
+-define(wxStyledTextCtrl_GetStatus, 3317).
+-define(wxStyledTextCtrl_SetMouseDownCaptures, 3318).
+-define(wxStyledTextCtrl_GetMouseDownCaptures, 3319).
+-define(wxStyledTextCtrl_SetSTCCursor, 3320).
+-define(wxStyledTextCtrl_GetSTCCursor, 3321).
+-define(wxStyledTextCtrl_SetControlCharSymbol, 3322).
+-define(wxStyledTextCtrl_GetControlCharSymbol, 3323).
+-define(wxStyledTextCtrl_WordPartLeft, 3324).
+-define(wxStyledTextCtrl_WordPartLeftExtend, 3325).
+-define(wxStyledTextCtrl_WordPartRight, 3326).
+-define(wxStyledTextCtrl_WordPartRightExtend, 3327).
+-define(wxStyledTextCtrl_SetVisiblePolicy, 3328).
+-define(wxStyledTextCtrl_DelLineLeft, 3329).
+-define(wxStyledTextCtrl_DelLineRight, 3330).
+-define(wxStyledTextCtrl_GetXOffset, 3331).
+-define(wxStyledTextCtrl_ChooseCaretX, 3332).
+-define(wxStyledTextCtrl_SetXCaretPolicy, 3333).
+-define(wxStyledTextCtrl_SetYCaretPolicy, 3334).
+-define(wxStyledTextCtrl_GetPrintWrapMode, 3335).
+-define(wxStyledTextCtrl_SetHotspotActiveForeground, 3336).
+-define(wxStyledTextCtrl_SetHotspotActiveBackground, 3337).
+-define(wxStyledTextCtrl_SetHotspotActiveUnderline, 3338).
+-define(wxStyledTextCtrl_SetHotspotSingleLine, 3339).
+-define(wxStyledTextCtrl_ParaDownExtend, 3340).
+-define(wxStyledTextCtrl_ParaUp, 3341).
+-define(wxStyledTextCtrl_ParaUpExtend, 3342).
+-define(wxStyledTextCtrl_PositionBefore, 3343).
+-define(wxStyledTextCtrl_PositionAfter, 3344).
+-define(wxStyledTextCtrl_CopyRange, 3345).
+-define(wxStyledTextCtrl_CopyText, 3346).
+-define(wxStyledTextCtrl_SetSelectionMode, 3347).
+-define(wxStyledTextCtrl_GetSelectionMode, 3348).
+-define(wxStyledTextCtrl_LineDownRectExtend, 3349).
+-define(wxStyledTextCtrl_LineUpRectExtend, 3350).
+-define(wxStyledTextCtrl_CharLeftRectExtend, 3351).
+-define(wxStyledTextCtrl_CharRightRectExtend, 3352).
+-define(wxStyledTextCtrl_HomeRectExtend, 3353).
+-define(wxStyledTextCtrl_VCHomeRectExtend, 3354).
+-define(wxStyledTextCtrl_LineEndRectExtend, 3355).
+-define(wxStyledTextCtrl_PageUpRectExtend, 3356).
+-define(wxStyledTextCtrl_PageDownRectExtend, 3357).
+-define(wxStyledTextCtrl_StutteredPageUp, 3358).
+-define(wxStyledTextCtrl_StutteredPageUpExtend, 3359).
+-define(wxStyledTextCtrl_StutteredPageDown, 3360).
+-define(wxStyledTextCtrl_StutteredPageDownExtend, 3361).
+-define(wxStyledTextCtrl_WordLeftEnd, 3362).
+-define(wxStyledTextCtrl_WordLeftEndExtend, 3363).
+-define(wxStyledTextCtrl_WordRightEnd, 3364).
+-define(wxStyledTextCtrl_WordRightEndExtend, 3365).
+-define(wxStyledTextCtrl_SetWhitespaceChars, 3366).
+-define(wxStyledTextCtrl_SetCharsDefault, 3367).
+-define(wxStyledTextCtrl_AutoCompGetCurrent, 3368).
+-define(wxStyledTextCtrl_Allocate, 3369).
+-define(wxStyledTextCtrl_FindColumn, 3370).
+-define(wxStyledTextCtrl_GetCaretSticky, 3371).
+-define(wxStyledTextCtrl_SetCaretSticky, 3372).
+-define(wxStyledTextCtrl_ToggleCaretSticky, 3373).
+-define(wxStyledTextCtrl_SetPasteConvertEndings, 3374).
+-define(wxStyledTextCtrl_GetPasteConvertEndings, 3375).
+-define(wxStyledTextCtrl_SelectionDuplicate, 3376).
+-define(wxStyledTextCtrl_SetCaretLineBackAlpha, 3377).
+-define(wxStyledTextCtrl_GetCaretLineBackAlpha, 3378).
+-define(wxStyledTextCtrl_StartRecord, 3379).
+-define(wxStyledTextCtrl_StopRecord, 3380).
+-define(wxStyledTextCtrl_SetLexer, 3381).
+-define(wxStyledTextCtrl_GetLexer, 3382).
+-define(wxStyledTextCtrl_Colourise, 3383).
+-define(wxStyledTextCtrl_SetProperty, 3384).
+-define(wxStyledTextCtrl_SetKeyWords, 3385).
+-define(wxStyledTextCtrl_SetLexerLanguage, 3386).
+-define(wxStyledTextCtrl_GetProperty, 3387).
+-define(wxStyledTextCtrl_GetStyleBitsNeeded, 3388).
+-define(wxStyledTextCtrl_GetCurrentLine, 3389).
+-define(wxStyledTextCtrl_StyleSetSpec, 3390).
+-define(wxStyledTextCtrl_StyleSetFont, 3391).
+-define(wxStyledTextCtrl_StyleSetFontAttr, 3392).
+-define(wxStyledTextCtrl_StyleSetCharacterSet, 3393).
+-define(wxStyledTextCtrl_StyleSetFontEncoding, 3394).
+-define(wxStyledTextCtrl_CmdKeyExecute, 3395).
+-define(wxStyledTextCtrl_SetMargins, 3396).
+-define(wxStyledTextCtrl_GetSelection, 3397).
+-define(wxStyledTextCtrl_PointFromPosition, 3398).
+-define(wxStyledTextCtrl_ScrollToLine, 3399).
+-define(wxStyledTextCtrl_ScrollToColumn, 3400).
+-define(wxStyledTextCtrl_SetVScrollBar, 3401).
+-define(wxStyledTextCtrl_SetHScrollBar, 3402).
+-define(wxStyledTextCtrl_GetLastKeydownProcessed, 3403).
+-define(wxStyledTextCtrl_SetLastKeydownProcessed, 3404).
+-define(wxStyledTextCtrl_SaveFile, 3405).
+-define(wxStyledTextCtrl_LoadFile, 3406).
+-define(wxStyledTextCtrl_DoDragOver, 3407).
+-define(wxStyledTextCtrl_DoDropText, 3408).
+-define(wxStyledTextCtrl_GetUseAntiAliasing, 3409).
+-define(wxStyledTextCtrl_AddTextRaw, 3410).
+-define(wxStyledTextCtrl_InsertTextRaw, 3411).
+-define(wxStyledTextCtrl_GetCurLineRaw, 3412).
+-define(wxStyledTextCtrl_GetLineRaw, 3413).
+-define(wxStyledTextCtrl_GetSelectedTextRaw, 3414).
+-define(wxStyledTextCtrl_GetTextRangeRaw, 3415).
+-define(wxStyledTextCtrl_SetTextRaw, 3416).
+-define(wxStyledTextCtrl_GetTextRaw, 3417).
+-define(wxStyledTextCtrl_AppendTextRaw, 3418).
+-define(wxArtProvider_GetBitmap, 3419).
+-define(wxArtProvider_GetIcon, 3420).
+-define(wxTreeEvent_GetKeyCode, 3421).
+-define(wxTreeEvent_GetItem, 3422).
+-define(wxTreeEvent_GetKeyEvent, 3423).
+-define(wxTreeEvent_GetLabel, 3424).
+-define(wxTreeEvent_GetOldItem, 3425).
+-define(wxTreeEvent_GetPoint, 3426).
+-define(wxTreeEvent_IsEditCancelled, 3427).
+-define(wxTreeEvent_SetToolTip, 3428).
+-define(wxNotebookEvent_GetOldSelection, 3429).
+-define(wxNotebookEvent_GetSelection, 3430).
+-define(wxNotebookEvent_SetOldSelection, 3431).
+-define(wxNotebookEvent_SetSelection, 3432).
+-define(wxFileDataObject_new, 3433).
+-define(wxFileDataObject_AddFile, 3434).
+-define(wxFileDataObject_GetFilenames, 3435).
+-define(wxFileDataObject_destroy, 3436).
+-define(wxTextDataObject_new, 3437).
+-define(wxTextDataObject_GetTextLength, 3438).
+-define(wxTextDataObject_GetText, 3439).
+-define(wxTextDataObject_SetText, 3440).
+-define(wxTextDataObject_destroy, 3441).
+-define(wxBitmapDataObject_new_1_1, 3442).
+-define(wxBitmapDataObject_new_1_0, 3443).
+-define(wxBitmapDataObject_GetBitmap, 3444).
+-define(wxBitmapDataObject_SetBitmap, 3445).
+-define(wxBitmapDataObject_destroy, 3446).
+-define(wxClipboard_new, 3448).
+-define(wxClipboard_destruct, 3449).
+-define(wxClipboard_AddData, 3450).
+-define(wxClipboard_Clear, 3451).
+-define(wxClipboard_Close, 3452).
+-define(wxClipboard_Flush, 3453).
+-define(wxClipboard_GetData, 3454).
+-define(wxClipboard_IsOpened, 3455).
+-define(wxClipboard_Open, 3456).
+-define(wxClipboard_SetData, 3457).
+-define(wxClipboard_UsePrimarySelection, 3459).
+-define(wxClipboard_IsSupported, 3460).
+-define(wxClipboard_Get, 3461).
+-define(wxSpinEvent_GetPosition, 3462).
+-define(wxSpinEvent_SetPosition, 3463).
+-define(wxSplitterWindow_new_0, 3464).
+-define(wxSplitterWindow_new_2, 3465).
+-define(wxSplitterWindow_destruct, 3466).
+-define(wxSplitterWindow_Create, 3467).
+-define(wxSplitterWindow_GetMinimumPaneSize, 3468).
+-define(wxSplitterWindow_GetSashGravity, 3469).
+-define(wxSplitterWindow_GetSashPosition, 3470).
+-define(wxSplitterWindow_GetSplitMode, 3471).
+-define(wxSplitterWindow_GetWindow1, 3472).
+-define(wxSplitterWindow_GetWindow2, 3473).
+-define(wxSplitterWindow_Initialize, 3474).
+-define(wxSplitterWindow_IsSplit, 3475).
+-define(wxSplitterWindow_ReplaceWindow, 3476).
+-define(wxSplitterWindow_SetSashGravity, 3477).
+-define(wxSplitterWindow_SetSashPosition, 3478).
+-define(wxSplitterWindow_SetSashSize, 3479).
+-define(wxSplitterWindow_SetMinimumPaneSize, 3480).
+-define(wxSplitterWindow_SetSplitMode, 3481).
+-define(wxSplitterWindow_SplitHorizontally, 3482).
+-define(wxSplitterWindow_SplitVertically, 3483).
+-define(wxSplitterWindow_Unsplit, 3484).
+-define(wxSplitterWindow_UpdateSize, 3485).
+-define(wxSplitterEvent_GetSashPosition, 3486).
+-define(wxSplitterEvent_GetX, 3487).
+-define(wxSplitterEvent_GetY, 3488).
+-define(wxSplitterEvent_GetWindowBeingRemoved, 3489).
+-define(wxSplitterEvent_SetSashPosition, 3490).
+-define(wxHtmlWindow_new_0, 3491).
+-define(wxHtmlWindow_new_2, 3492).
+-define(wxHtmlWindow_AppendToPage, 3493).
+-define(wxHtmlWindow_GetOpenedAnchor, 3494).
+-define(wxHtmlWindow_GetOpenedPage, 3495).
+-define(wxHtmlWindow_GetOpenedPageTitle, 3496).
+-define(wxHtmlWindow_GetRelatedFrame, 3497).
+-define(wxHtmlWindow_HistoryBack, 3498).
+-define(wxHtmlWindow_HistoryCanBack, 3499).
+-define(wxHtmlWindow_HistoryCanForward, 3500).
+-define(wxHtmlWindow_HistoryClear, 3501).
+-define(wxHtmlWindow_HistoryForward, 3502).
+-define(wxHtmlWindow_LoadFile, 3503).
+-define(wxHtmlWindow_LoadPage, 3504).
+-define(wxHtmlWindow_SelectAll, 3505).
+-define(wxHtmlWindow_SelectionToText, 3506).
+-define(wxHtmlWindow_SelectLine, 3507).
+-define(wxHtmlWindow_SelectWord, 3508).
+-define(wxHtmlWindow_SetBorders, 3509).
+-define(wxHtmlWindow_SetFonts, 3510).
+-define(wxHtmlWindow_SetPage, 3511).
+-define(wxHtmlWindow_SetRelatedFrame, 3512).
+-define(wxHtmlWindow_SetRelatedStatusBar, 3513).
+-define(wxHtmlWindow_ToText, 3514).
+-define(wxHtmlWindow_destroy, 3515).
+-define(wxHtmlLinkEvent_GetLinkInfo, 3516).
+-define(wxSystemSettings_GetColour, 3517).
+-define(wxSystemSettings_GetFont, 3518).
+-define(wxSystemSettings_GetMetric, 3519).
+-define(wxSystemSettings_GetScreenType, 3520).
+-define(wxSystemOptions_GetOption, 3521).
+-define(wxSystemOptions_GetOptionInt, 3522).
+-define(wxSystemOptions_HasOption, 3523).
+-define(wxSystemOptions_IsFalse, 3524).
+-define(wxSystemOptions_SetOption_2_1, 3525).
+-define(wxSystemOptions_SetOption_2_0, 3526).
+-define(wxAuiNotebookEvent_SetSelection, 3527).
+-define(wxAuiNotebookEvent_GetSelection, 3528).
+-define(wxAuiNotebookEvent_SetOldSelection, 3529).
+-define(wxAuiNotebookEvent_GetOldSelection, 3530).
+-define(wxAuiNotebookEvent_SetDragSource, 3531).
+-define(wxAuiNotebookEvent_GetDragSource, 3532).
+-define(wxAuiManagerEvent_SetManager, 3533).
+-define(wxAuiManagerEvent_GetManager, 3534).
+-define(wxAuiManagerEvent_SetPane, 3535).
+-define(wxAuiManagerEvent_GetPane, 3536).
+-define(wxAuiManagerEvent_SetButton, 3537).
+-define(wxAuiManagerEvent_GetButton, 3538).
+-define(wxAuiManagerEvent_SetDC, 3539).
+-define(wxAuiManagerEvent_GetDC, 3540).
+-define(wxAuiManagerEvent_Veto, 3541).
+-define(wxAuiManagerEvent_GetVeto, 3542).
+-define(wxAuiManagerEvent_SetCanVeto, 3543).
+-define(wxAuiManagerEvent_CanVeto, 3544).
+-define(wxLogNull_new, 3545).
+-define(wxLogNull_destroy, 3546).
+-define(wxTaskBarIcon_new, 3547).
+-define(wxTaskBarIcon_destruct, 3548).
+-define(wxTaskBarIcon_PopupMenu, 3549).
+-define(wxTaskBarIcon_RemoveIcon, 3550).
+-define(wxTaskBarIcon_SetIcon, 3551).
+-define(wxLocale_new_0, 3552).
+-define(wxLocale_new_2, 3554).
+-define(wxLocale_destruct, 3555).
+-define(wxLocale_Init, 3557).
+-define(wxLocale_AddCatalog_1, 3558).
+-define(wxLocale_AddCatalog_3, 3559).
+-define(wxLocale_AddCatalogLookupPathPrefix, 3560).
+-define(wxLocale_GetCanonicalName, 3561).
+-define(wxLocale_GetLanguage, 3562).
+-define(wxLocale_GetLanguageName, 3563).
+-define(wxLocale_GetLocale, 3564).
+-define(wxLocale_GetName, 3565).
+-define(wxLocale_GetString_2, 3566).
+-define(wxLocale_GetString_4, 3567).
+-define(wxLocale_GetHeaderValue, 3568).
+-define(wxLocale_GetSysName, 3569).
+-define(wxLocale_GetSystemEncoding, 3570).
+-define(wxLocale_GetSystemEncodingName, 3571).
+-define(wxLocale_GetSystemLanguage, 3572).
+-define(wxLocale_IsLoaded, 3573).
+-define(wxLocale_IsOk, 3574).
+-define(wxActivateEvent_GetActive, 3575).
+-define(wxPopupWindow_new_2, 3577).
+-define(wxPopupWindow_new_0, 3578).
+-define(wxPopupWindow_destruct, 3580).
+-define(wxPopupWindow_Create, 3581).
+-define(wxPopupWindow_Position, 3582).
+-define(wxPopupTransientWindow_new_0, 3583).
+-define(wxPopupTransientWindow_new_2, 3584).
+-define(wxPopupTransientWindow_destruct, 3585).
+-define(wxPopupTransientWindow_Popup, 3586).
+-define(wxPopupTransientWindow_Dismiss, 3587).
+-define(wxOverlay_new, 3588).
+-define(wxOverlay_destruct, 3589).
+-define(wxOverlay_Reset, 3590).
+-define(wxDCOverlay_new_6, 3591).
+-define(wxDCOverlay_new_2, 3592).
+-define(wxDCOverlay_destruct, 3593).
+-define(wxDCOverlay_Clear, 3594).
diff --git a/lib/wx/src/wx.app.src b/lib/wx/src/wx.app.src
index 9b9358abf6..92984f13b5 100644
--- a/lib/wx/src/wx.app.src
+++ b/lib/wx/src/wx.app.src
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/wx.appup.src b/lib/wx/src/wx.appup.src
index aea54f6814..4c7200569f 100644
--- a/lib/wx/src/wx.appup.src
+++ b/lib/wx/src/wx.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/wx.erl b/lib/wx/src/wx.erl
index e9f612edf7..6498b58cda 100644
--- a/lib/wx/src/wx.erl
+++ b/lib/wx/src/wx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -66,7 +66,7 @@
get_env/0,set_env/1, debug/1,
batch/1,foreach/2,map/2,foldl/3,foldr/3,
getObjectType/1, typeCast/2,
- null/0, is_null/1]).
+ null/0, is_null/1, equal/2]).
-export([create_memory/1, get_memory_bin/1,
retain_memory/1, release_memory/1]).
@@ -153,6 +153,10 @@ null() ->
-spec is_null(wx_object()) -> boolean().
is_null(#wx_ref{ref=NULL}) -> NULL =:= 0.
+%% @doc Returns true if both arguments references the same object, false otherwise
+-spec equal(wx_object(), wx_object()) -> boolean().
+equal(#wx_ref{ref=Ref1}, #wx_ref{ref=Ref2}) -> Ref1 =:= Ref2.
+
%% @doc Returns the object type
-spec getObjectType(wx_object()) -> atom().
getObjectType(#wx_ref{type=Type}) ->
diff --git a/lib/wx/src/wx_object.erl b/lib/wx/src/wx_object.erl
index 35069425ac..c22a083eb9 100644
--- a/lib/wx/src/wx_object.erl
+++ b/lib/wx/src/wx_object.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -107,7 +107,8 @@
call/2, call/3,
cast/2,
reply/2,
- get_pid/1
+ get_pid/1,
+ set_pid/2
]).
%% -export([behaviour_info/1]).
@@ -306,6 +307,11 @@ cast(Name, Request) when is_atom(Name) orelse is_pid(Name) ->
get_pid(#wx_ref{state=Pid}) when is_pid(Pid) ->
Pid.
+%% @spec (Ref::wxObject(), pid()) -> wxObject()
+%% @doc Sets the controlling process of the object handle.
+set_pid(#wx_ref{}=R, Pid) when is_pid(Pid) ->
+ R#wx_ref{state=Pid}.
+
%% -----------------------------------------------------------------
%% Send a reply to the client.
%% -----------------------------------------------------------------
diff --git a/lib/wx/src/wxe.hrl b/lib/wx/src/wxe.hrl
index 75bd260d38..da65cb939d 100644
--- a/lib/wx/src/wxe.hrl
+++ b/lib/wx/src/wxe.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/wxe_master.erl b/lib/wx/src/wxe_master.erl
index cdf66aa6d1..06be0367f8 100644
--- a/lib/wx/src/wxe_master.erl
+++ b/lib/wx/src/wxe_master.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/wxe_server.erl b/lib/wx/src/wxe_server.erl
index 693a008e3d..58fcaf8f23 100644
--- a/lib/wx/src/wxe_server.erl
+++ b/lib/wx/src/wxe_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/src/wxe_util.erl b/lib/wx/src/wxe_util.erl
index 398ceddd4f..3eaf6aebed 100644
--- a/lib/wx/src/wxe_util.erl
+++ b/lib/wx/src/wxe_util.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/test/Makefile b/lib/wx/test/Makefile
index 136cbd5454..9a78307be1 100644
--- a/lib/wx/test/Makefile
+++ b/lib/wx/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2012. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/wx/test/wx_app_SUITE.erl b/lib/wx/test/wx_app_SUITE.erl
index 2d128df433..3fd5bf689d 100644
--- a/lib/wx/test/wx_app_SUITE.erl
+++ b/lib/wx/test/wx_app_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -49,7 +49,7 @@ end_per_testcase(Func,Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() -> [{ct_hooks,[ts_install_cth]}, {timetrap,{minutes,5}}].
all() ->
[fields, modules, exportall, app_depend, undef_funcs, appup].
@@ -221,12 +221,10 @@ check_apps([App|Apps]) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-undef_funcs(suite) ->
- [];
-undef_funcs(doc) ->
- [];
+undef_funcs() ->
+ [{timetrap,{minutes,10}}].
+
undef_funcs(Config) when is_list(Config) ->
- catch test_server:timetrap(timer:minutes(10)),
App = wx,
AppFile = key1search(app_file, Config),
Mods = key1search(modules, AppFile),
diff --git a/lib/wx/test/wx_basic_SUITE.erl b/lib/wx/test/wx_basic_SUITE.erl
index 0b919f6254..f89f25274a 100644
--- a/lib/wx/test/wx_basic_SUITE.erl
+++ b/lib/wx/test/wx_basic_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ end_per_testcase(Func,Config) ->
wx_test_lib:end_per_testcase(Func,Config).
%% SUITE specification
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() -> [{ct_hooks,[ts_install_cth]}, {timetrap,{minutes,2}}].
all() ->
[silent_start, create_window, several_apps, wx_api, wx_misc,
@@ -344,13 +344,13 @@ data_types(_Config) ->
ImgRGB = ?mt(wxImage, wxImage:new(128, 64, Colors)),
?m(true, wxImage:ok(ImgRGB)),
?m(false, wxImage:hasAlpha(ImgRGB)),
- ?m(Colors, wxImage:getData(ImgRGB)),
+ ?m(ok, case wxImage:getData(ImgRGB) of Colors -> ok; Other -> Other end),
ImgRGBA = ?mt(wxImage, wxImage:new(128, 64, Colors, Alpha)),
?m(true, wxImage:ok(ImgRGBA)),
?m(true, wxImage:hasAlpha(ImgRGBA)),
- ?m(Colors, wxImage:getData(ImgRGBA)),
- ?m(Alpha, wxImage:getAlpha(ImgRGBA)),
+ ?m(ok, case wxImage:getData(ImgRGBA) of Colors -> ok; Other -> Other end),
+ ?m(ok, case wxImage:getAlpha(ImgRGBA) of Alpha -> ok; Other -> Other end),
wxClientDC:destroy(CDC),
%%wx_test_lib:wx_destroy(Frame,Config).
@@ -361,7 +361,8 @@ wx_object(Config) ->
wx:new(),
Me = self(),
Init = fun() ->
- Frame = wxFrame:new(wx:null(), ?wxID_ANY, "Test wx_object", [{size, {500, 400}}]),
+ Frame0 = wxFrame:new(wx:null(), ?wxID_ANY, "Test wx_object", [{size, {500, 400}}]),
+ Frame = wx_object:set_pid(Frame0, self()),
Sz = wxBoxSizer:new(?wxHORIZONTAL),
Panel = wxPanel:new(Frame),
wxSizer:add(Sz, Panel, [{flag, ?wxEXPAND}, {proportion, 1}]),
@@ -371,6 +372,7 @@ wx_object(Config) ->
{Frame, {Frame, Panel}}
end,
Frame = ?mt(wxFrame, wx_obj_test:start([{init, Init}])),
+
timer:sleep(500),
?m(ok, check_events(flush())),
@@ -378,6 +380,11 @@ wx_object(Config) ->
?m({call, foobar, {Me, _}}, wx_object:call(Frame, foobar)),
?m(ok, wx_object:cast(Frame, foobar2)),
?m([{cast, foobar2}|_], flush()),
+
+ ?m(Frame, wx_obj_test:who_are_you(Frame)),
+ {call, {Frame,Panel}, _} = wx_object:call(Frame, fun(US) -> US end),
+ ?m(false, wxWindow:getParent(Panel) =:= Frame),
+ ?m(true, wx:equal(wxWindow:getParent(Panel),Frame)),
FramePid = wx_object:get_pid(Frame),
io:format("wx_object pid ~p~n",[FramePid]),
FramePid ! foo3,
diff --git a/lib/wx/test/wx_class_SUITE.erl b/lib/wx/test/wx_class_SUITE.erl
index 876db9893f..6944a78360 100644
--- a/lib/wx/test/wx_class_SUITE.erl
+++ b/lib/wx/test/wx_class_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -46,12 +46,12 @@ end_per_testcase(Func,Config) ->
wx_test_lib:end_per_testcase(Func,Config).
%% SUITE specification
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() -> [{ct_hooks,[ts_install_cth]}, {timetrap,{minutes,2}}].
all() ->
[calendarCtrl, treeCtrl, notebook, staticBoxSizer,
clipboard, helpFrame, htmlWindow, listCtrlSort, listCtrlVirtual,
- radioBox, systemSettings, taskBarIcon, toolbar, popup].
+ radioBox, systemSettings, taskBarIcon, toolbar, popup, modal].
groups() ->
[].
@@ -621,3 +621,70 @@ lang_env() ->
format_env({match, List}) ->
[io:format(" ~ts~n",[L]) || L <- List];
format_env(nomatch) -> ok.
+
+%% Add a testcase that tests that we can recurse in showModal
+%% because it hangs in observer if object are not destroyed correctly
+%% when popping the stack
+
+modal(Config) ->
+ Wx = wx:new(),
+ case {?wxMAJOR_VERSION, ?wxMINOR_VERSION, ?wxRELEASE_NUMBER} of
+ {2, Min, Rel} when Min < 8 orelse (Min =:= 8 andalso Rel < 11) ->
+ {skip, "old wxWidgets version"};
+ _ ->
+ Frame = wxFrame:new(Wx, -1, "Test Modal windows"),
+ wxFrame:show(Frame),
+ Env = wx:get_env(),
+ Tester = self(),
+ ets:new(test_state, [named_table, public]),
+ Upd = wxUpdateUIEvent:getUpdateInterval(),
+ wxUpdateUIEvent:setUpdateInterval(500),
+ _Pid = spawn(fun() ->
+ wx:set_env(Env),
+ modal_dialog(Frame, 1, Tester)
+ end),
+ %% need to sleep so we know that the window is stuck in
+ %% the ShowModal event loop and not in an earlier event loop
+ %% wx2.8 invokes the event loop from more calls than wx-3
+ receive {dialog, M1, 1} -> timer:sleep(1200), ets:insert(test_state, {M1, ready}) end,
+ receive {dialog, M2, 2} -> timer:sleep(1200), ets:insert(test_state, {M2, ready}) end,
+
+ receive done -> ok end,
+ receive {dialog_done, M2, 2} -> M2 end,
+ receive {dialog_done, M1, 1} -> M1 end,
+
+ wxUpdateUIEvent:setUpdateInterval(Upd),
+ wx_test_lib:wx_destroy(Frame,Config)
+ end.
+
+modal_dialog(Parent, Level, Tester) when Level < 3 ->
+ M1 = wxTextEntryDialog:new(Parent, "Dialog " ++ integer_to_list(Level)),
+ io:format("Creating dialog ~p ~p~n",[Level, M1]),
+ wxDialog:connect(M1, show, [{callback, fun(#wx{event=Ev},_) ->
+ case Ev of
+ #wxShow{show=true} ->
+ Tester ! {dialog, M1, Level};
+ _ -> ignore
+ end
+ end}]),
+ DoOnce = fun(_,_) ->
+ case ets:take(test_state, M1) of
+ [] -> ignore;
+ [_] -> modal_dialog(M1, Level+1, Tester)
+ end
+ end,
+ wxDialog:connect(M1, update_ui, [{callback, DoOnce}]),
+ ?wxID_OK = wxDialog:showModal(M1),
+ wxDialog:destroy(M1),
+ case Level > 1 of
+ true ->
+ io:format("~p: End dialog ~p ~p~n",[?LINE, Level-1, Parent]),
+ wxDialog:endModal(Parent, ?wxID_OK);
+ false -> ok
+ end,
+ Tester ! {dialog_done, M1, Level},
+ ok;
+modal_dialog(Parent, Level, Tester) ->
+ io:format("~p: End dialog ~p ~p~n",[?LINE, Level-1, Parent]),
+ wxDialog:endModal(Parent, ?wxID_OK),
+ Tester ! done.
diff --git a/lib/wx/test/wx_event_SUITE.erl b/lib/wx/test/wx_event_SUITE.erl
index 516133e3e2..6512cedaf2 100644
--- a/lib/wx/test/wx_event_SUITE.erl
+++ b/lib/wx/test/wx_event_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@ end_per_testcase(Func,Config) ->
wx_test_lib:end_per_testcase(Func,Config).
%% SUITE specification
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() -> [{ct_hooks,[ts_install_cth]}, {timetrap,{minutes,2}}].
all() ->
[connect, disconnect, disconnect_cb, connect_msg_20, connect_cb_20,
diff --git a/lib/wx/test/wx_obj_test.erl b/lib/wx/test/wx_obj_test.erl
index 068e59f243..23142e28b2 100644
--- a/lib/wx/test/wx_obj_test.erl
+++ b/lib/wx/test/wx_obj_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -19,13 +19,13 @@
-module(wx_obj_test).
-include_lib("wx/include/wx.hrl").
--export([start/1, stop/1]).
+-export([start/1, stop/1, who_are_you/1]).
%% wx_object callbacks
-export([init/1, handle_info/2, terminate/2, code_change/3, handle_call/3,
handle_sync_event/3, handle_event/2, handle_cast/2]).
--record(state, {parent, opts, user_state}).
+-record(state, {parent, me, opts, user_state}).
start(Opts) ->
wx_object:start_link(?MODULE, [{parent, self()}| Opts], []).
@@ -33,12 +33,15 @@ start(Opts) ->
stop(Object) ->
wx_object:stop(Object).
+who_are_you(Object) ->
+ wx_object:call(Object, who_are_you).
+
init(Opts) ->
Parent = proplists:get_value(parent, Opts),
put(parent_pid, Parent),
Init = proplists:get_value(init, Opts),
{Obj, UserState} = Init(),
- {Obj, #state{parent=Parent, opts=Opts, user_state=UserState}}.
+ {Obj, #state{me=Obj, parent=Parent, opts=Opts, user_state=UserState}}.
handle_sync_event(Event = #wx{obj=Panel, event=#wxPaint{}},
WxEvent, #state{parent=Parent, user_state=US, opts=Opts}) ->
@@ -59,6 +62,8 @@ handle_event(Event, State = #state{parent=Parent}) ->
Parent ! {event, Event},
{noreply, State}.
+handle_call(who_are_you, _From, State = #state{me=Me}) ->
+ {reply, Me, State};
handle_call(What, From, State = #state{user_state=US}) when is_function(What) ->
Result = What(US),
{reply, {call, Result, From}, State};
diff --git a/lib/wx/test/wx_opengl_SUITE.erl b/lib/wx/test/wx_opengl_SUITE.erl
index 5d6da4240d..643a0df6a3 100644
--- a/lib/wx/test/wx_opengl_SUITE.erl
+++ b/lib/wx/test/wx_opengl_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@ end_per_testcase(Func,Config) ->
wx_test_lib:end_per_testcase(Func,Config).
%% SUITE specification
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() -> [{ct_hooks,[ts_install_cth]}, {timetrap,{minutes,2}}].
all() ->
[canvas, glu_tesselation].
diff --git a/lib/wx/test/wx_test_lib.erl b/lib/wx/test/wx_test_lib.erl
index 423e371fbb..9f26b8cb9d 100644
--- a/lib/wx/test/wx_test_lib.erl
+++ b/lib/wx/test/wx_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/test/wx_test_lib.hrl b/lib/wx/test/wx_test_lib.hrl
index d7ca98629a..68fdcf54e2 100644
--- a/lib/wx/test/wx_test_lib.hrl
+++ b/lib/wx/test/wx_test_lib.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/wx/test/wx_xtra_SUITE.erl b/lib/wx/test/wx_xtra_SUITE.erl
index 42f4fe53f6..c6268a7f46 100644
--- a/lib/wx/test/wx_xtra_SUITE.erl
+++ b/lib/wx/test/wx_xtra_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ end_per_testcase(Func,Config) ->
wx_test_lib:end_per_testcase(Func,Config).
%% SUITE specification
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() -> [{ct_hooks,[ts_install_cth]}, {timetrap,{minutes,2}}].
all() ->
[destroy_app, multiple_add_in_sizer, app_dies,
diff --git a/lib/wx/test/wxt b/lib/wx/test/wxt
index 700c0a432b..e720ed94f4 100755
--- a/lib/wx/test/wxt
+++ b/lib/wx/test/wxt
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2009. All Rights Reserved.
+# Copyright Ericsson AB 2008-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/wx/test/wxt.erl b/lib/wx/test/wxt.erl
index 57529d4876..265cd5c981 100644
--- a/lib/wx/test/wxt.erl
+++ b/lib/wx/test/wxt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -16,13 +16,9 @@
%% limitations under the License.
%%
%% %CopyrightEnd%
-%%%-------------------------------------------------------------------
-%%% File : wxt.erl
-%%% Author : Dan Gudmundsson <[email protected]>
-%%% Description : Shortcuts for starting test with wx internal test_server
-%%%
-%%% Created : 4 Nov 2008 by Dan Gudmundsson <[email protected]>
-%%%-------------------------------------------------------------------
+%%
+%% Description : Shortcuts for running tests with wx internal test_server
+%%-------------------------------------------------------------------
-module(wxt).
-compile(export_all).
@@ -40,7 +36,7 @@ t(Mod, TC) when is_atom(Mod), is_atom(TC) ->
t({Mod,TC}, []);
t(all, Config) when is_list(Config) ->
Fs = filelib:wildcard("wx_*_SUITE.erl"),
- t([list_to_atom(filename:rootname(File)) || File <- Fs], Config);
+ t([list_to_atom(filename:rootname(File)) || File <- Fs, File =/= "wx_app_SUITE.erl"], Config);
t(Test,Config) when is_list(Config) ->
Tests = resolve(Test),
write_test_case(Test),
diff --git a/lib/xmerl/doc/src/Makefile b/lib/xmerl/doc/src/Makefile
index 5c39355278..2465217e8e 100644
--- a/lib/xmerl/doc/src/Makefile
+++ b/lib/xmerl/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/doc/src/book.xml b/lib/xmerl/doc/src/book.xml
index 012a62c505..63b53f5811 100644
--- a/lib/xmerl/doc/src/book.xml
+++ b/lib/xmerl/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/xmerl/doc/src/notes.xml b/lib/xmerl/doc/src/notes.xml
index 55367eb25e..4f61d4b52c 100644
--- a/lib/xmerl/doc/src/notes.xml
+++ b/lib/xmerl/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/xmerl/doc/src/notes_history.xml b/lib/xmerl/doc/src/notes_history.xml
index 02d420c849..d4e560a336 100644
--- a/lib/xmerl/doc/src/notes_history.xml
+++ b/lib/xmerl/doc/src/notes_history.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2006</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/xmerl/doc/src/part.xml b/lib/xmerl/doc/src/part.xml
index e672bdc3f2..710a968212 100644
--- a/lib/xmerl/doc/src/part.xml
+++ b/lib/xmerl/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/xmerl/doc/src/part_notes.xml b/lib/xmerl/doc/src/part_notes.xml
index a7c89ec560..4ed441c7d4 100644
--- a/lib/xmerl/doc/src/part_notes.xml
+++ b/lib/xmerl/doc/src/part_notes.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/xmerl/doc/src/ref_man.xml b/lib/xmerl/doc/src/ref_man.xml
index 8805f04fbc..cd41243fcb 100644
--- a/lib/xmerl/doc/src/ref_man.xml
+++ b/lib/xmerl/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/xmerl/doc/src/xmerl_sax_parser.xml b/lib/xmerl/doc/src/xmerl_sax_parser.xml
index 2251be00bb..8ea197e209 100644
--- a/lib/xmerl/doc/src/xmerl_sax_parser.xml
+++ b/lib/xmerl/doc/src/xmerl_sax_parser.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2008</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/xmerl/doc/src/xmerl_ug.xmlsrc b/lib/xmerl/doc/src/xmerl_ug.xmlsrc
index 5d1408b54c..e4aeaddc78 100644
--- a/lib/xmerl/doc/src/xmerl_ug.xmlsrc
+++ b/lib/xmerl/doc/src/xmerl_ug.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/xmerl/include/xmerl.hrl b/lib/xmerl/include/xmerl.hrl
index 7d37241116..1e13255a49 100644
--- a/lib/xmerl/include/xmerl.hrl
+++ b/lib/xmerl/include/xmerl.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/Makefile b/lib/xmerl/src/Makefile
index f8f0320f46..51d9190797 100644
--- a/lib/xmerl/src/Makefile
+++ b/lib/xmerl/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2012. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl.appup.src b/lib/xmerl/src/xmerl.appup.src
index 388e4d8a86..e8012d8f36 100644
--- a/lib/xmerl/src/xmerl.appup.src
+++ b/lib/xmerl/src/xmerl.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
+%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl.erl b/lib/xmerl/src/xmerl.erl
index 7c8c6c56f4..32dad69166 100644
--- a/lib/xmerl/src/xmerl.erl
+++ b/lib/xmerl/src/xmerl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_b64Bin.yrl b/lib/xmerl/src/xmerl_b64Bin.yrl
index 46cf23ef34..7028cc079c 100644
--- a/lib/xmerl/src/xmerl_b64Bin.yrl
+++ b/lib/xmerl/src/xmerl_b64Bin.yrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_b64Bin_scan.erl b/lib/xmerl/src/xmerl_b64Bin_scan.erl
index 50ac5c05c2..9afe49fffe 100644
--- a/lib/xmerl/src/xmerl_b64Bin_scan.erl
+++ b/lib/xmerl/src/xmerl_b64Bin_scan.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_eventp.erl b/lib/xmerl/src/xmerl_eventp.erl
index 243f47f159..598d26261d 100644
--- a/lib/xmerl/src/xmerl_eventp.erl
+++ b/lib/xmerl/src/xmerl_eventp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_html.erl b/lib/xmerl/src/xmerl_html.erl
index 1c38ed111a..cb72eb4185 100644
--- a/lib/xmerl/src/xmerl_html.erl
+++ b/lib/xmerl/src/xmerl_html.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_internal.hrl b/lib/xmerl/src/xmerl_internal.hrl
index cbdfa4f673..e913159967 100644
--- a/lib/xmerl/src/xmerl_internal.hrl
+++ b/lib/xmerl/src/xmerl_internal.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_lib.erl b/lib/xmerl/src/xmerl_lib.erl
index a2d6a88c18..be0e28e62d 100644
--- a/lib/xmerl/src/xmerl_lib.erl
+++ b/lib/xmerl/src/xmerl_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_otpsgml.erl b/lib/xmerl/src/xmerl_otpsgml.erl
index bd6ac33997..cbd13263f6 100644
--- a/lib/xmerl/src/xmerl_otpsgml.erl
+++ b/lib/xmerl/src/xmerl_otpsgml.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_regexp.erl b/lib/xmerl/src/xmerl_regexp.erl
index 2b4696f8d2..fc89b80ff1 100644
--- a/lib/xmerl/src/xmerl_regexp.erl
+++ b/lib/xmerl/src/xmerl_regexp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_sax_old_dom.erl b/lib/xmerl/src/xmerl_sax_old_dom.erl
index 2a1e5f6df8..fefcf03fce 100644
--- a/lib/xmerl/src/xmerl_sax_old_dom.erl
+++ b/lib/xmerl/src/xmerl_sax_old_dom.erl
@@ -2,7 +2,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_sax_old_dom.hrl b/lib/xmerl/src/xmerl_sax_old_dom.hrl
index 04c9253e83..923b59cd10 100644
--- a/lib/xmerl/src/xmerl_sax_old_dom.hrl
+++ b/lib/xmerl/src/xmerl_sax_old_dom.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_sax_parser.erl b/lib/xmerl/src/xmerl_sax_parser.erl
index 6924db6c15..196baacda7 100644
--- a/lib/xmerl/src/xmerl_sax_parser.erl
+++ b/lib/xmerl/src/xmerl_sax_parser.erl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_sax_parser.hrl b/lib/xmerl/src/xmerl_sax_parser.hrl
index e7067e7629..932ab0cec5 100644
--- a/lib/xmerl/src/xmerl_sax_parser.hrl
+++ b/lib/xmerl/src/xmerl_sax_parser.hrl
@@ -1,7 +1,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_sax_parser_base.erlsrc b/lib/xmerl/src/xmerl_sax_parser_base.erlsrc
index 2c5caab07b..200770a7cf 100644
--- a/lib/xmerl/src/xmerl_sax_parser_base.erlsrc
+++ b/lib/xmerl/src/xmerl_sax_parser_base.erlsrc
@@ -1,7 +1,7 @@
%%-*-erlang-*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_sax_parser_latin1.erlsrc b/lib/xmerl/src/xmerl_sax_parser_latin1.erlsrc
index 3361ae837c..961806bf4c 100644
--- a/lib/xmerl/src/xmerl_sax_parser_latin1.erlsrc
+++ b/lib/xmerl/src/xmerl_sax_parser_latin1.erlsrc
@@ -2,7 +2,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_sax_parser_list.erlsrc b/lib/xmerl/src/xmerl_sax_parser_list.erlsrc
index ce0fdc4e7b..624a621d92 100644
--- a/lib/xmerl/src/xmerl_sax_parser_list.erlsrc
+++ b/lib/xmerl/src/xmerl_sax_parser_list.erlsrc
@@ -2,7 +2,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_sax_parser_utf16be.erlsrc b/lib/xmerl/src/xmerl_sax_parser_utf16be.erlsrc
index 8b1d36eae3..ff84ece97a 100644
--- a/lib/xmerl/src/xmerl_sax_parser_utf16be.erlsrc
+++ b/lib/xmerl/src/xmerl_sax_parser_utf16be.erlsrc
@@ -2,7 +2,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_sax_parser_utf16le.erlsrc b/lib/xmerl/src/xmerl_sax_parser_utf16le.erlsrc
index 63cfa11bf4..a330fce8d0 100644
--- a/lib/xmerl/src/xmerl_sax_parser_utf16le.erlsrc
+++ b/lib/xmerl/src/xmerl_sax_parser_utf16le.erlsrc
@@ -2,7 +2,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_sax_parser_utf8.erlsrc b/lib/xmerl/src/xmerl_sax_parser_utf8.erlsrc
index b827086a2e..d46d60d237 100644
--- a/lib/xmerl/src/xmerl_sax_parser_utf8.erlsrc
+++ b/lib/xmerl/src/xmerl_sax_parser_utf8.erlsrc
@@ -2,7 +2,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_sax_simple_dom.erl b/lib/xmerl/src/xmerl_sax_simple_dom.erl
index 2ce2f03827..7eb3afd499 100644
--- a/lib/xmerl/src/xmerl_sax_simple_dom.erl
+++ b/lib/xmerl/src/xmerl_sax_simple_dom.erl
@@ -2,7 +2,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_scan.erl b/lib/xmerl/src/xmerl_scan.erl
index 829716dcdb..ea487a0900 100644
--- a/lib/xmerl/src/xmerl_scan.erl
+++ b/lib/xmerl/src/xmerl_scan.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_sgml.erl b/lib/xmerl/src/xmerl_sgml.erl
index 6c0ee55448..0d73df1e02 100644
--- a/lib/xmerl/src/xmerl_sgml.erl
+++ b/lib/xmerl/src/xmerl_sgml.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_simple.erl b/lib/xmerl/src/xmerl_simple.erl
index 32479066cd..4ad939abe0 100644
--- a/lib/xmerl/src/xmerl_simple.erl
+++ b/lib/xmerl/src/xmerl_simple.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_text.erl b/lib/xmerl/src/xmerl_text.erl
index 459c7d4562..eb1df6e5d3 100644
--- a/lib/xmerl/src/xmerl_text.erl
+++ b/lib/xmerl/src/xmerl_text.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_ucs.erl b/lib/xmerl/src/xmerl_ucs.erl
index f93d1d15c4..4b1fc30089 100644
--- a/lib/xmerl/src/xmerl_ucs.erl
+++ b/lib/xmerl/src/xmerl_ucs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_uri.erl b/lib/xmerl/src/xmerl_uri.erl
index 78278fba63..aa5a09ce56 100644
--- a/lib/xmerl/src/xmerl_uri.erl
+++ b/lib/xmerl/src/xmerl_uri.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_validate.erl b/lib/xmerl/src/xmerl_validate.erl
index 87b9a43ce9..8b4f5b91a2 100644
--- a/lib/xmerl/src/xmerl_validate.erl
+++ b/lib/xmerl/src/xmerl_validate.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_xlate.erl b/lib/xmerl/src/xmerl_xlate.erl
index 6bfd9595f0..181faa343d 100644
--- a/lib/xmerl/src/xmerl_xlate.erl
+++ b/lib/xmerl/src/xmerl_xlate.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_xml.erl b/lib/xmerl/src/xmerl_xml.erl
index 914bbad6be..28802666a4 100644
--- a/lib/xmerl/src/xmerl_xml.erl
+++ b/lib/xmerl/src/xmerl_xml.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_xpath.erl b/lib/xmerl/src/xmerl_xpath.erl
index 97ae3a1971..bbebda1030 100644
--- a/lib/xmerl/src/xmerl_xpath.erl
+++ b/lib/xmerl/src/xmerl_xpath.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_xpath_lib.erl b/lib/xmerl/src/xmerl_xpath_lib.erl
index 873fc41c4b..1660d7e91f 100644
--- a/lib/xmerl/src/xmerl_xpath_lib.erl
+++ b/lib/xmerl/src/xmerl_xpath_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_xpath_parse.yrl b/lib/xmerl/src/xmerl_xpath_parse.yrl
index 14a8c27352..1926e7ee84 100644
--- a/lib/xmerl/src/xmerl_xpath_parse.yrl
+++ b/lib/xmerl/src/xmerl_xpath_parse.yrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_xpath_pred.erl b/lib/xmerl/src/xmerl_xpath_pred.erl
index 582a4e4091..7105fb8bbf 100644
--- a/lib/xmerl/src/xmerl_xpath_pred.erl
+++ b/lib/xmerl/src/xmerl_xpath_pred.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_xpath_scan.erl b/lib/xmerl/src/xmerl_xpath_scan.erl
index 53d6032475..5ef5dce737 100644
--- a/lib/xmerl/src/xmerl_xpath_scan.erl
+++ b/lib/xmerl/src/xmerl_xpath_scan.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_xs.erl b/lib/xmerl/src/xmerl_xs.erl
index 2a8e221e16..3e9f6622b8 100644
--- a/lib/xmerl/src/xmerl_xs.erl
+++ b/lib/xmerl/src/xmerl_xs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_xsd.erl b/lib/xmerl/src/xmerl_xsd.erl
index 3038a54ee6..412ef59e41 100644
--- a/lib/xmerl/src/xmerl_xsd.erl
+++ b/lib/xmerl/src/xmerl_xsd.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/src/xmerl_xsd_type.erl b/lib/xmerl/src/xmerl_xsd_type.erl
index 2cd7e85edd..14a673b0c0 100644
--- a/lib/xmerl/src/xmerl_xsd_type.erl
+++ b/lib/xmerl/src/xmerl_xsd_type.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/test/Makefile b/lib/xmerl/test/Makefile
index 14e11d5fc4..7a326e334f 100644
--- a/lib/xmerl/test/Makefile
+++ b/lib/xmerl/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2012. All Rights Reserved.
+# Copyright Ericsson AB 2004-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/test/xmerl_SUITE.erl b/lib/xmerl/test/xmerl_SUITE.erl
index 672f8a43d1..413f5c82db 100644
--- a/lib/xmerl/test/xmerl_SUITE.erl
+++ b/lib/xmerl/test/xmerl_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/test/xmerl_app_test.erl b/lib/xmerl/test/xmerl_app_test.erl
index 7b30eb260c..8dfa588826 100644
--- a/lib/xmerl/test/xmerl_app_test.erl
+++ b/lib/xmerl/test/xmerl_app_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/test/xmerl_appup_test.erl b/lib/xmerl/test/xmerl_appup_test.erl
index 506bbfcd51..cfadb66ec7 100644
--- a/lib/xmerl/test/xmerl_appup_test.erl
+++ b/lib/xmerl/test/xmerl_appup_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/test/xmerl_sax_SUITE.erl b/lib/xmerl/test/xmerl_sax_SUITE.erl
index f0e80f81d3..590ae14e23 100644
--- a/lib/xmerl/test/xmerl_sax_SUITE.erl
+++ b/lib/xmerl/test/xmerl_sax_SUITE.erl
@@ -2,7 +2,7 @@
%%----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/test/xmerl_sax_std_SUITE.erl b/lib/xmerl/test/xmerl_sax_std_SUITE.erl
index b820bd5bc2..c363a8ea8b 100644
--- a/lib/xmerl/test/xmerl_sax_std_SUITE.erl
+++ b/lib/xmerl/test/xmerl_sax_std_SUITE.erl
@@ -2,7 +2,7 @@
%%----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/test/xmerl_std_SUITE.erl b/lib/xmerl/test/xmerl_std_SUITE.erl
index d3e28353e2..ace0fb7cdb 100644
--- a/lib/xmerl/test/xmerl_std_SUITE.erl
+++ b/lib/xmerl/test/xmerl_std_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/test/xmerl_test_lib.erl b/lib/xmerl/test/xmerl_test_lib.erl
index aa8a86138a..e3246d19a4 100644
--- a/lib/xmerl/test/xmerl_test_lib.erl
+++ b/lib/xmerl/test/xmerl_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/test/xmerl_xsd_MS2002-01-16_SUITE.erl b/lib/xmerl/test/xmerl_xsd_MS2002-01-16_SUITE.erl
index 7393a878e2..84b388330f 100644
--- a/lib/xmerl/test/xmerl_xsd_MS2002-01-16_SUITE.erl
+++ b/lib/xmerl/test/xmerl_xsd_MS2002-01-16_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/test/xmerl_xsd_NIST2002-01-16_SUITE.erl b/lib/xmerl/test/xmerl_xsd_NIST2002-01-16_SUITE.erl
index 6a645b255e..11f1498f07 100644
--- a/lib/xmerl/test/xmerl_xsd_NIST2002-01-16_SUITE.erl
+++ b/lib/xmerl/test/xmerl_xsd_NIST2002-01-16_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/test/xmerl_xsd_SUITE.erl b/lib/xmerl/test/xmerl_xsd_SUITE.erl
index e1ce8525c7..5a95917b5c 100644
--- a/lib/xmerl/test/xmerl_xsd_SUITE.erl
+++ b/lib/xmerl/test/xmerl_xsd_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/test/xmerl_xsd_Sun2002-01-16_SUITE.erl b/lib/xmerl/test/xmerl_xsd_Sun2002-01-16_SUITE.erl
index 5057e70956..774950176f 100644
--- a/lib/xmerl/test/xmerl_xsd_Sun2002-01-16_SUITE.erl
+++ b/lib/xmerl/test/xmerl_xsd_Sun2002-01-16_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/xmerl/test/xmerl_xsd_lib.erl b/lib/xmerl/test/xmerl_xsd_lib.erl
index 58fb6a27cc..e008086cc6 100644
--- a/lib/xmerl/test/xmerl_xsd_lib.erl
+++ b/lib/xmerl/test/xmerl_xsd_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/otp_versions.table b/otp_versions.table
index a952e1986f..f68986d831 100644
--- a/otp_versions.table
+++ b/otp_versions.table
@@ -1,3 +1,6 @@
+OTP-18.3.3 : common_test-1.12.1 inets-6.2.3 ssl-7.3.2 # asn1-4.0.2 compiler-6.0.3 cosEvent-2.2 cosEventDomain-1.2 cosFileTransfer-1.2 cosNotification-1.2.1 cosProperty-1.2 cosTime-1.2.1 cosTransactions-1.3.1 crypto-3.6.3 debugger-4.1.2 dialyzer-2.9 diameter-1.11.2 edoc-0.7.18 eldap-1.2.1 erl_docgen-0.4.2 erl_interface-3.8.2 erts-7.3.1 et-1.5.1 eunit-2.2.13 gs-1.6 hipe-3.15 ic-4.4 jinterface-1.6.1 kernel-4.2 megaco-3.18 mnesia-4.13.4 observer-2.1.2 odbc-2.11.1 orber-3.8.1 os_mon-2.4 ose-1.1 otp_mibs-1.1 parsetools-2.1.1 percept-0.8.11 public_key-1.1.1 reltool-0.7 runtime_tools-1.9.3 sasl-2.7 snmp-5.2.2 ssh-4.2.2 stdlib-2.8 syntax_tools-1.7 test_server-3.10 tools-2.8.3 typer-0.9.10 webtool-0.9.1 wx-1.6.1 xmerl-1.3.10 :
+OTP-18.3.2 : inets-6.2.2 ssl-7.3.1 # asn1-4.0.2 common_test-1.12 compiler-6.0.3 cosEvent-2.2 cosEventDomain-1.2 cosFileTransfer-1.2 cosNotification-1.2.1 cosProperty-1.2 cosTime-1.2.1 cosTransactions-1.3.1 crypto-3.6.3 debugger-4.1.2 dialyzer-2.9 diameter-1.11.2 edoc-0.7.18 eldap-1.2.1 erl_docgen-0.4.2 erl_interface-3.8.2 erts-7.3.1 et-1.5.1 eunit-2.2.13 gs-1.6 hipe-3.15 ic-4.4 jinterface-1.6.1 kernel-4.2 megaco-3.18 mnesia-4.13.4 observer-2.1.2 odbc-2.11.1 orber-3.8.1 os_mon-2.4 ose-1.1 otp_mibs-1.1 parsetools-2.1.1 percept-0.8.11 public_key-1.1.1 reltool-0.7 runtime_tools-1.9.3 sasl-2.7 snmp-5.2.2 ssh-4.2.2 stdlib-2.8 syntax_tools-1.7 test_server-3.10 tools-2.8.3 typer-0.9.10 webtool-0.9.1 wx-1.6.1 xmerl-1.3.10 :
+OTP-18.3.1 : erts-7.3.1 inets-6.2.1 mnesia-4.13.4 # asn1-4.0.2 common_test-1.12 compiler-6.0.3 cosEvent-2.2 cosEventDomain-1.2 cosFileTransfer-1.2 cosNotification-1.2.1 cosProperty-1.2 cosTime-1.2.1 cosTransactions-1.3.1 crypto-3.6.3 debugger-4.1.2 dialyzer-2.9 diameter-1.11.2 edoc-0.7.18 eldap-1.2.1 erl_docgen-0.4.2 erl_interface-3.8.2 et-1.5.1 eunit-2.2.13 gs-1.6 hipe-3.15 ic-4.4 jinterface-1.6.1 kernel-4.2 megaco-3.18 observer-2.1.2 odbc-2.11.1 orber-3.8.1 os_mon-2.4 ose-1.1 otp_mibs-1.1 parsetools-2.1.1 percept-0.8.11 public_key-1.1.1 reltool-0.7 runtime_tools-1.9.3 sasl-2.7 snmp-5.2.2 ssh-4.2.2 ssl-7.3 stdlib-2.8 syntax_tools-1.7 test_server-3.10 tools-2.8.3 typer-0.9.10 webtool-0.9.1 wx-1.6.1 xmerl-1.3.10 :
OTP-18.3 : asn1-4.0.2 common_test-1.12 compiler-6.0.3 cosNotification-1.2.1 cosTime-1.2.1 cosTransactions-1.3.1 crypto-3.6.3 debugger-4.1.2 dialyzer-2.9 diameter-1.11.2 edoc-0.7.18 eldap-1.2.1 erl_docgen-0.4.2 erl_interface-3.8.2 erts-7.3 eunit-2.2.13 hipe-3.15 inets-6.2 kernel-4.2 mnesia-4.13.3 observer-2.1.2 orber-3.8.1 public_key-1.1.1 runtime_tools-1.9.3 sasl-2.7 snmp-5.2.2 ssh-4.2.2 ssl-7.3 stdlib-2.8 test_server-3.10 tools-2.8.3 webtool-0.9.1 wx-1.6.1 xmerl-1.3.10 # cosEvent-2.2 cosEventDomain-1.2 cosFileTransfer-1.2 cosProperty-1.2 et-1.5.1 gs-1.6 ic-4.4 jinterface-1.6.1 megaco-3.18 odbc-2.11.1 os_mon-2.4 ose-1.1 otp_mibs-1.1 parsetools-2.1.1 percept-0.8.11 reltool-0.7 syntax_tools-1.7 typer-0.9.10 :
OTP-18.2.4 : common_test-1.11.2 # asn1-4.0.1 compiler-6.0.2 cosEvent-2.2 cosEventDomain-1.2 cosFileTransfer-1.2 cosNotification-1.2 cosProperty-1.2 cosTime-1.2 cosTransactions-1.3 crypto-3.6.2 debugger-4.1.1 dialyzer-2.8.2 diameter-1.11.1 edoc-0.7.17 eldap-1.2 erl_docgen-0.4.1 erl_interface-3.8.1 erts-7.2.1 et-1.5.1 eunit-2.2.12 gs-1.6 hipe-3.14 ic-4.4 inets-6.1.1 jinterface-1.6.1 kernel-4.1.1 megaco-3.18 mnesia-4.13.2 observer-2.1.1 odbc-2.11.1 orber-3.8 os_mon-2.4 ose-1.1 otp_mibs-1.1 parsetools-2.1.1 percept-0.8.11 public_key-1.1 reltool-0.7 runtime_tools-1.9.2 sasl-2.6.1 snmp-5.2.1 ssh-4.2.1 ssl-7.2 stdlib-2.7 syntax_tools-1.7 test_server-3.9.1 tools-2.8.2 typer-0.9.10 webtool-0.9 wx-1.6 xmerl-1.3.9 :
OTP-18.2.3 : inets-6.1.1 # asn1-4.0.1 common_test-1.11.1 compiler-6.0.2 cosEvent-2.2 cosEventDomain-1.2 cosFileTransfer-1.2 cosNotification-1.2 cosProperty-1.2 cosTime-1.2 cosTransactions-1.3 crypto-3.6.2 debugger-4.1.1 dialyzer-2.8.2 diameter-1.11.1 edoc-0.7.17 eldap-1.2 erl_docgen-0.4.1 erl_interface-3.8.1 erts-7.2.1 et-1.5.1 eunit-2.2.12 gs-1.6 hipe-3.14 ic-4.4 jinterface-1.6.1 kernel-4.1.1 megaco-3.18 mnesia-4.13.2 observer-2.1.1 odbc-2.11.1 orber-3.8 os_mon-2.4 ose-1.1 otp_mibs-1.1 parsetools-2.1.1 percept-0.8.11 public_key-1.1 reltool-0.7 runtime_tools-1.9.2 sasl-2.6.1 snmp-5.2.1 ssh-4.2.1 ssl-7.2 stdlib-2.7 syntax_tools-1.7 test_server-3.9.1 tools-2.8.2 typer-0.9.10 webtool-0.9 wx-1.6 xmerl-1.3.9 :
@@ -14,6 +17,7 @@ OTP-18.0.3 : erts-7.0.3 # asn1-4.0 common_test-1.11 compiler-6.0 cosEvent-2.2 co
OTP-18.0.2 : erts-7.0.2 runtime_tools-1.9.1 # asn1-4.0 common_test-1.11 compiler-6.0 cosEvent-2.2 cosEventDomain-1.2 cosFileTransfer-1.2 cosNotification-1.2 cosProperty-1.2 cosTime-1.2 cosTransactions-1.3 crypto-3.6 debugger-4.1 dialyzer-2.8 diameter-1.10 edoc-0.7.17 eldap-1.2 erl_docgen-0.4 erl_interface-3.8 et-1.5.1 eunit-2.2.10 gs-1.6 hipe-3.12 ic-4.4 inets-6.0 jinterface-1.6 kernel-4.0 megaco-3.18 mnesia-4.13 observer-2.1 odbc-2.11 orber-3.8 os_mon-2.4 ose-1.1 otp_mibs-1.1 parsetools-2.1 percept-0.8.11 public_key-1.0 reltool-0.7 sasl-2.5 snmp-5.2 ssh-4.0 ssl-7.0 stdlib-2.5 syntax_tools-1.7 test_server-3.9 tools-2.8 typer-0.9.9 webtool-0.9 wx-1.4 xmerl-1.3.8 :
OTP-18.0.1 : erts-7.0.1 # asn1-4.0 common_test-1.11 compiler-6.0 cosEvent-2.2 cosEventDomain-1.2 cosFileTransfer-1.2 cosNotification-1.2 cosProperty-1.2 cosTime-1.2 cosTransactions-1.3 crypto-3.6 debugger-4.1 dialyzer-2.8 diameter-1.10 edoc-0.7.17 eldap-1.2 erl_docgen-0.4 erl_interface-3.8 et-1.5.1 eunit-2.2.10 gs-1.6 hipe-3.12 ic-4.4 inets-6.0 jinterface-1.6 kernel-4.0 megaco-3.18 mnesia-4.13 observer-2.1 odbc-2.11 orber-3.8 os_mon-2.4 ose-1.1 otp_mibs-1.1 parsetools-2.1 percept-0.8.11 public_key-1.0 reltool-0.7 runtime_tools-1.9 sasl-2.5 snmp-5.2 ssh-4.0 ssl-7.0 stdlib-2.5 syntax_tools-1.7 test_server-3.9 tools-2.8 typer-0.9.9 webtool-0.9 wx-1.4 xmerl-1.3.8 :
OTP-18.0 : asn1-4.0 common_test-1.11 compiler-6.0 cosEvent-2.2 cosEventDomain-1.2 cosFileTransfer-1.2 cosNotification-1.2 cosProperty-1.2 cosTime-1.2 cosTransactions-1.3 crypto-3.6 debugger-4.1 dialyzer-2.8 diameter-1.10 edoc-0.7.17 eldap-1.2 erl_docgen-0.4 erl_interface-3.8 erts-7.0 et-1.5.1 eunit-2.2.10 gs-1.6 hipe-3.12 ic-4.4 inets-6.0 jinterface-1.6 kernel-4.0 megaco-3.18 mnesia-4.13 observer-2.1 odbc-2.11 orber-3.8 os_mon-2.4 ose-1.1 otp_mibs-1.1 parsetools-2.1 percept-0.8.11 public_key-1.0 reltool-0.7 runtime_tools-1.9 sasl-2.5 snmp-5.2 ssh-4.0 ssl-7.0 stdlib-2.5 syntax_tools-1.7 test_server-3.9 tools-2.8 typer-0.9.9 webtool-0.9 wx-1.4 xmerl-1.3.8 # :
+OTP-17.5.6.9 : diameter-1.9.2.4 erts-6.4.1.6 ssl-6.0.1.2 # asn1-3.0.4 common_test-1.10.1 compiler-5.0.4 cosEvent-2.1.15 cosEventDomain-1.1.14 cosFileTransfer-1.1.16 cosNotification-1.1.21 cosProperty-1.1.17 cosTime-1.1.14 cosTransactions-1.2.14 crypto-3.5 debugger-4.0.3.1 dialyzer-2.7.4 edoc-0.7.16 eldap-1.1.1 erl_docgen-0.3.7 erl_interface-3.7.20 et-1.5 eunit-2.2.9 gs-1.5.16 hipe-3.11.3 ic-4.3.6 inets-5.10.9 jinterface-1.5.12 kernel-3.2.0.1 megaco-3.17.3 mnesia-4.12.5 observer-2.0.4 odbc-2.10.22 orber-3.7.1 os_mon-2.3.1 ose-1.0.2 otp_mibs-1.0.10 parsetools-2.0.12 percept-0.8.10 public_key-0.23 reltool-0.6.6 runtime_tools-1.8.16.1 sasl-2.4.1 snmp-5.1.2 ssh-3.2.4 stdlib-2.4 syntax_tools-1.6.18 test_server-3.8.1 tools-2.7.2 typer-0.9.8 webtool-0.8.10 wx-1.3.3 xmerl-1.3.7 :
OTP-17.5.6.8 : diameter-1.9.2.3 # asn1-3.0.4 common_test-1.10.1 compiler-5.0.4 cosEvent-2.1.15 cosEventDomain-1.1.14 cosFileTransfer-1.1.16 cosNotification-1.1.21 cosProperty-1.1.17 cosTime-1.1.14 cosTransactions-1.2.14 crypto-3.5 debugger-4.0.3.1 dialyzer-2.7.4 edoc-0.7.16 eldap-1.1.1 erl_docgen-0.3.7 erl_interface-3.7.20 erts-6.4.1.5 et-1.5 eunit-2.2.9 gs-1.5.16 hipe-3.11.3 ic-4.3.6 inets-5.10.9 jinterface-1.5.12 kernel-3.2.0.1 megaco-3.17.3 mnesia-4.12.5 observer-2.0.4 odbc-2.10.22 orber-3.7.1 os_mon-2.3.1 ose-1.0.2 otp_mibs-1.0.10 parsetools-2.0.12 percept-0.8.10 public_key-0.23 reltool-0.6.6 runtime_tools-1.8.16.1 sasl-2.4.1 snmp-5.1.2 ssh-3.2.4 ssl-6.0.1.1 stdlib-2.4 syntax_tools-1.6.18 test_server-3.8.1 tools-2.7.2 typer-0.9.8 webtool-0.8.10 wx-1.3.3 xmerl-1.3.7 :
OTP-17.5.6.7 : diameter-1.9.2.2 # asn1-3.0.4 common_test-1.10.1 compiler-5.0.4 cosEvent-2.1.15 cosEventDomain-1.1.14 cosFileTransfer-1.1.16 cosNotification-1.1.21 cosProperty-1.1.17 cosTime-1.1.14 cosTransactions-1.2.14 crypto-3.5 debugger-4.0.3.1 dialyzer-2.7.4 edoc-0.7.16 eldap-1.1.1 erl_docgen-0.3.7 erl_interface-3.7.20 erts-6.4.1.5 et-1.5 eunit-2.2.9 gs-1.5.16 hipe-3.11.3 ic-4.3.6 inets-5.10.9 jinterface-1.5.12 kernel-3.2.0.1 megaco-3.17.3 mnesia-4.12.5 observer-2.0.4 odbc-2.10.22 orber-3.7.1 os_mon-2.3.1 ose-1.0.2 otp_mibs-1.0.10 parsetools-2.0.12 percept-0.8.10 public_key-0.23 reltool-0.6.6 runtime_tools-1.8.16.1 sasl-2.4.1 snmp-5.1.2 ssh-3.2.4 ssl-6.0.1.1 stdlib-2.4 syntax_tools-1.6.18 test_server-3.8.1 tools-2.7.2 typer-0.9.8 webtool-0.8.10 wx-1.3.3 xmerl-1.3.7 :
OTP-17.5.6.6 : erts-6.4.1.5 # asn1-3.0.4 common_test-1.10.1 compiler-5.0.4 cosEvent-2.1.15 cosEventDomain-1.1.14 cosFileTransfer-1.1.16 cosNotification-1.1.21 cosProperty-1.1.17 cosTime-1.1.14 cosTransactions-1.2.14 crypto-3.5 debugger-4.0.3.1 dialyzer-2.7.4 diameter-1.9.2.1 edoc-0.7.16 eldap-1.1.1 erl_docgen-0.3.7 erl_interface-3.7.20 et-1.5 eunit-2.2.9 gs-1.5.16 hipe-3.11.3 ic-4.3.6 inets-5.10.9 jinterface-1.5.12 kernel-3.2.0.1 megaco-3.17.3 mnesia-4.12.5 observer-2.0.4 odbc-2.10.22 orber-3.7.1 os_mon-2.3.1 ose-1.0.2 otp_mibs-1.0.10 parsetools-2.0.12 percept-0.8.10 public_key-0.23 reltool-0.6.6 runtime_tools-1.8.16.1 sasl-2.4.1 snmp-5.1.2 ssh-3.2.4 ssl-6.0.1.1 stdlib-2.4 syntax_tools-1.6.18 test_server-3.8.1 tools-2.7.2 typer-0.9.8 webtool-0.8.10 wx-1.3.3 xmerl-1.3.7 :
diff --git a/system/COPYRIGHT b/system/COPYRIGHT
index 0d0668974d..ef76b66f6b 100644
--- a/system/COPYRIGHT
+++ b/system/COPYRIGHT
@@ -5,7 +5,7 @@ This software is subject to the following Copyrights and Licenses:
%CopyrightBegin%
-Copyright Ericsson AB 1997-2012. All Rights Reserved.
+Copyright Ericsson AB 1997-2016. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/system/doc/definitions/term.defs b/system/doc/definitions/term.defs
index 6091a46a20..921175a7f0 100644
--- a/system/doc/definitions/term.defs
+++ b/system/doc/definitions/term.defs
@@ -76,6 +76,7 @@ the module Erlang in the application kernel","kenneth"},
{"gen_event","gen_event","A behaviour used for programming event handling mechanisms, such as alarm handlers, error loggers, and plug-and-play handlers.","mbj"},
{"gen_fsm","gen_fsm","A behaviour used for programming finite state machines.","mbj"},
{"gen_server","gen_server","A behaviour used for programming client-server processes.","mbj"},
+{"gen_statem","gen_statem","A behaviour used for programming generic state machines.","raimo"},
{"gterm","Global Glossary Database","A glossary database used to list common acronymns and defintions etc.","jocke"},
{"xref","xref","A cross reference tool that can be used for finding dependencies between functions, modules, applications and releases. Part of the Tools application.","gunilla"},
{"GSlong","Graphics System","A library module which provides a graphics interface for Erlang.","mbj"},
diff --git a/system/doc/design_principles/Makefile b/system/doc/design_principles/Makefile
index 29df484279..937b3e28c8 100644
--- a/system/doc/design_principles/Makefile
+++ b/system/doc/design_principles/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -58,6 +58,12 @@ GIF_FILES = \
sup5.gif \
sup6.gif
+PNG_FILES = \
+ code_lock.png \
+ code_lock_2.png
+
+IMAGE_FILES = $(GIF_FILES) $(PNG_FILES)
+
XML_FILES = \
$(BOOK_FILES) $(XML_CHAPTER_FILES) \
$(XML_PART_FILES)
@@ -85,13 +91,16 @@ _create_dirs := $(shell mkdir -p $(HTMLDIR))
$(HTMLDIR)/%.gif: %.gif
$(INSTALL_DATA) $< $@
+$(HTMLDIR)/%.png: %.png
+ $(INSTALL_DATA) $< $@
+
docs: html
local_docs: PDFDIR=../../pdf
-html: $(HTML_UG_FILE) gifs
+html: $(HTML_UG_FILE) images
-gifs: $(GIF_FILES:%=$(HTMLDIR)/%)
+images: $(IMAGE_FILES:%=$(HTMLDIR)/%)
debug opt:
@@ -109,7 +118,7 @@ release_docs_spec: docs
# $(INSTALL_DIR) "$(RELEASE_PATH)/pdf"
# $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELEASE_PATH)/pdf"
$(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(GIF_FILES) $(HTMLDIR)/*.html \
+ $(INSTALL_DATA) $(IMAGE_FILES) $(HTMLDIR)/*.html \
$(RELSYSDIR)
diff --git a/system/doc/design_principles/applications.xml b/system/doc/design_principles/applications.xml
index 4d73e0fc66..0a1b65ea8e 100644
--- a/system/doc/design_principles/applications.xml
+++ b/system/doc/design_principles/applications.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2014</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/design_principles/appup_cookbook.xml b/system/doc/design_principles/appup_cookbook.xml
index 31335197d7..4f23c42c59 100644
--- a/system/doc/design_principles/appup_cookbook.xml
+++ b/system/doc/design_principles/appup_cookbook.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2014</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -50,7 +50,8 @@
<p>In a system implemented according to the OTP design principles,
all processes, except system processes and special processes,
reside in one of the behaviours <c>supervisor</c>,
- <c>gen_server</c>, <c>gen_fsm</c>, or <c>gen_event</c>. These
+ <c>gen_server</c>, <c>gen_fsm</c>,
+ <c>gen_statem</c> or <c>gen_event</c>. These
belong to the STDLIB application and upgrading/downgrading
normally requires an emulator restart.</p>
<p>OTP thus provides no support for changing residence modules except
diff --git a/system/doc/design_principles/book.xml b/system/doc/design_principles/book.xml
index 663551df2f..a734f1d1e4 100644
--- a/system/doc/design_principles/book.xml
+++ b/system/doc/design_principles/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/design_principles/code_lock.dia b/system/doc/design_principles/code_lock.dia
new file mode 100644
index 0000000000..8e6ff8a898
--- /dev/null
+++ b/system/doc/design_principles/code_lock.dia
Binary files differ
diff --git a/system/doc/design_principles/code_lock.png b/system/doc/design_principles/code_lock.png
new file mode 100644
index 0000000000..745fd91920
--- /dev/null
+++ b/system/doc/design_principles/code_lock.png
Binary files differ
diff --git a/system/doc/design_principles/code_lock_2.dia b/system/doc/design_principles/code_lock_2.dia
new file mode 100644
index 0000000000..142909a2f5
--- /dev/null
+++ b/system/doc/design_principles/code_lock_2.dia
Binary files differ
diff --git a/system/doc/design_principles/code_lock_2.png b/system/doc/design_principles/code_lock_2.png
new file mode 100644
index 0000000000..ecf7b0d799
--- /dev/null
+++ b/system/doc/design_principles/code_lock_2.png
Binary files differ
diff --git a/system/doc/design_principles/des_princ.xml b/system/doc/design_principles/des_princ.xml
index 0e087cf843..8ab8661c2d 100644
--- a/system/doc/design_principles/des_princ.xml
+++ b/system/doc/design_principles/des_princ.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -226,7 +226,9 @@ free(Ch, {Alloc, Free} = Channels) ->
<item><p><seealso marker="gen_server_concepts">gen_server</seealso></p>
<p>For implementing the server of a client-server relation</p></item>
<item><p><seealso marker="fsm">gen_fsm</seealso></p>
- <p>For implementing finite-state machines</p></item>
+ <p>For implementing finite-state machines (Old)</p></item>
+ <item><p><seealso marker="statem">gen_statem</seealso></p>
+ <p>For implementing state machines (New)</p></item>
<item><p><seealso marker="events">gen_event</seealso></p>
<p>For implementing event handling functionality</p></item>
<item><p><seealso marker="sup_princ">supervisor</seealso></p>
diff --git a/system/doc/design_principles/distributed_applications.xml b/system/doc/design_principles/distributed_applications.xml
index f1624a9ad7..a1a0149eb5 100644
--- a/system/doc/design_principles/distributed_applications.xml
+++ b/system/doc/design_principles/distributed_applications.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/design_principles/events.xml b/system/doc/design_principles/events.xml
index 3c9d0996dc..e37b8b460d 100644
--- a/system/doc/design_principles/events.xml
+++ b/system/doc/design_principles/events.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/design_principles/fsm.xml b/system/doc/design_principles/fsm.xml
index f58b50cbff..4f2b75e6e8 100644
--- a/system/doc/design_principles/fsm.xml
+++ b/system/doc/design_principles/fsm.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,6 +30,16 @@
<file>fsm.xml</file>
</header>
<marker id="gen_fsm behaviour"></marker>
+ <note>
+ <p>
+ There is a new behaviour
+ <seealso marker="statem"><c>gen_statem</c></seealso>
+ that is intended to replace <c>gen_fsm</c> for new code.
+ It has the same features and add some really useful.
+ This module will not be removed for the foreseeable future
+ to keep old state machine implementations running.
+ </p>
+ </note>
<p>This section is to be read with the <c>gen_fsm(3)</c> manual page
in STDLIB, where all interface functions and callback
functions are described in detail.</p>
diff --git a/system/doc/design_principles/gen_server_concepts.xml b/system/doc/design_principles/gen_server_concepts.xml
index f8f98918fa..c1b98189d5 100644
--- a/system/doc/design_principles/gen_server_concepts.xml
+++ b/system/doc/design_principles/gen_server_concepts.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/design_principles/included_applications.xml b/system/doc/design_principles/included_applications.xml
index 3257795e5f..34501c0296 100644
--- a/system/doc/design_principles/included_applications.xml
+++ b/system/doc/design_principles/included_applications.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/design_principles/part.xml b/system/doc/design_principles/part.xml
index 42fd3beb6a..6495211e04 100644
--- a/system/doc/design_principles/part.xml
+++ b/system/doc/design_principles/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -31,6 +31,7 @@
<xi:include href="des_princ.xml"/>
<xi:include href="gen_server_concepts.xml"/>
<xi:include href="fsm.xml"/>
+ <xi:include href="statem.xml"/>
<xi:include href="events.xml"/>
<xi:include href="sup_princ.xml"/>
<xi:include href="spec_proc.xml"/>
diff --git a/system/doc/design_principles/release_handling.xml b/system/doc/design_principles/release_handling.xml
index 20ddc3dbf5..4f71ad4437 100644
--- a/system/doc/design_principles/release_handling.xml
+++ b/system/doc/design_principles/release_handling.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2014</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -249,7 +249,7 @@
<p>If <c>Modules=dynamic</c>, which is the case for event
managers, the event manager process informs the release handler
about the list of currently installed event handlers
- (<c>gen_fsm</c>), and it is checked if the module name is in
+ (<c>gen_event</c>), and it is checked if the module name is in
this list instead.</p>
<p>The release handler suspends, asks for code change, and
resumes processes by calling the functions
diff --git a/system/doc/design_principles/release_structure.xml b/system/doc/design_principles/release_structure.xml
index 6e7ab06094..a0ab21c43f 100644
--- a/system/doc/design_principles/release_structure.xml
+++ b/system/doc/design_principles/release_structure.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/design_principles/spec_proc.xml b/system/doc/design_principles/spec_proc.xml
index 3d7a88da3f..5b156ac263 100644
--- a/system/doc/design_principles/spec_proc.xml
+++ b/system/doc/design_principles/spec_proc.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2014</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -522,9 +522,36 @@ init(Parent, Name, Module) ->
-module(db).
-behaviour(simple_server).
--export([init/0, handle_req/2, terminate/0]).
+-export([init/1, handle_req/2, terminate/0]).
...</code>
+
+ <p>The contracts specified with <c>-callback</c> attributes in
+ behaviour modules can be further refined by adding <c>-spec</c>
+ attributes in callback modules. This can be useful as
+ <c>-callback</c> contracts are usually generic. The same callback
+ module with contracts for the callbacks:</p>
+
+ <code type="none">
+-module(db).
+-behaviour(simple_server).
+
+-export([init/1, handle_req/2, terminate/0]).
+
+-record(state, {field1 :: [atom()], field2 :: integer()}).
+
+-type state() :: #state{}.
+-type request() :: {'store', term(), term()};
+ {'lookup', term()}.
+
+...
+
+-spec handle_req(request(), state()) -> {'ok', term()}.
+
+...</code>
+
+ <p>Each <c>-spec</c> contract is to be a subtype of the respective
+ <c>-callback</c> contract.</p>
+
</section>
</chapter>
-
diff --git a/system/doc/design_principles/statem.xml b/system/doc/design_principles/statem.xml
new file mode 100644
index 0000000000..585b1a35f5
--- /dev/null
+++ b/system/doc/design_principles/statem.xml
@@ -0,0 +1,1454 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE chapter SYSTEM "chapter.dtd">
+
+<chapter>
+ <header>
+ <copyright>
+ <year>2016</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>gen_statem Behavior</title>
+ <prepared></prepared>
+ <docno></docno>
+ <date></date>
+ <rev></rev>
+ <file>statem.xml</file>
+ </header>
+ <marker id="gen_statem behaviour"></marker>
+ <p>
+ This section is to be read with the
+ <seealso marker="stdlib:gen_statem"><c>gen_statem(3)</c></seealso>
+ manual page in <c>STDLIB</c>, where all interface functions and callback
+ functions are described in detail.
+ </p>
+ <note>
+ <p>
+ This is a new behavior in Erlang/OTP 19.0.
+ It has been thoroughly reviewed, is stable enough
+ to be used by at least two heavy OTP applications, and is here to stay.
+ Depending on user feedback, we do not expect
+ but can find it necessary to make minor
+ not backward compatible changes into Erlang/OTP 20.0.
+ </p>
+ </note>
+
+<!-- =================================================================== -->
+
+ <section>
+ <title>Event-Driven State Machines</title>
+ <p>
+ Established Automata theory does not deal much with
+ how a state transition is triggered,
+ but assumes that the output is a function
+ of the input (and the state) and that they are
+ some kind of values.
+ </p>
+ <p>
+ For an Event-Driven State Machine, the input is an event
+ that triggers a state transition and the output
+ is actions executed during the state transition.
+ It can analogously to the mathematical model of a
+ Finite-State Machine be described as
+ a set of relations of the following form:
+ </p>
+ <pre>
+State(S) x Event(E) -> Actions(A), State(S')</pre>
+ <p>These relations are interpreted as follows:
+ if we are in state <c>S</c> and event <c>E</c> occurs, we
+ are to perform actions <c>A</c> and make a transition to
+ state <c>S'</c>. Notice that <c>S'</c> can be equal to <c>S</c>.
+ </p>
+ <p>
+ As <c>A</c> and <c>S'</c> depend only on
+ <c>S</c> and <c>E</c>, the kind of state machine described
+ here is a Mealy Machine
+ (see, for example, the corresponding Wikipedia article).
+ </p>
+ <p>
+ Like most <c>gen_</c> behaviors, <c>gen_statem</c> keeps
+ a server <c>Data</c> besides the state. Because of this, and as
+ there is no restriction on the number of states
+ (assuming that there is enough virtual machine memory)
+ or on the number of distinct input events,
+ a state machine implemented with this behavior
+ is in fact Turing complete.
+ But it feels mostly like an Event-Driven Mealy Machine.
+ </p>
+ </section>
+
+<!-- =================================================================== -->
+
+ <section>
+ <marker id="callback_modes" />
+ <title>Callback Modes</title>
+ <p>
+ The <c>gen_statem</c> behavior supports two callback modes:
+ </p>
+ <list type="bulleted">
+ <item>
+ <p>
+ In mode
+ <seealso marker="stdlib:gen_statem#type-callback_mode"><c>state_functions</c></seealso>,
+ the state transition rules are written as some Erlang
+ functions, which conform to the following convention:
+ </p>
+ <pre>
+StateName(EventType, EventContent, Data) ->
+ .. code for actions here ...
+ {next_state, NewStateName, NewData}.</pre>
+ </item>
+ <item>
+ <p>
+ In mode
+ <seealso marker="stdlib:gen_statem#type-callback_mode"><c>handle_event_function</c></seealso>,
+ only one Erlang function provides all state transition rules:
+ </p>
+ <pre>
+handle_event(EventType, EventContent, State, Data) ->
+ .. code for actions here ...
+ {next_state, NewState, NewData}</pre>
+ </item>
+ </list>
+ <p>
+ Both these modes allow other return tuples; see
+ <seealso marker="stdlib:gen_statem#Module:StateName/3"><c>Module:StateName/3</c></seealso>
+ in the <c>gen_statem</c> manual page.
+ These other return tuples can, for example, stop the machine,
+ execute state transition actions on the machine engine itself,
+ and send replies.
+ </p>
+
+ <section>
+ <title>Choosing the Callback Mode</title>
+ <p>
+ The two
+ <seealso marker="#callback_modes">callback modes</seealso>
+ give different possibilities
+ and restrictions, but one goal remains:
+ you want to handle all possible combinations of
+ events and states.
+ </p>
+ <p>
+ This can be done, for example, by focusing on one state at the time
+ and for every state ensure that all events are handled.
+ Alternatively, you can focus on one event at the time
+ and ensure that it is handled in every state.
+ You can also use a mix of these strategies.
+ </p>
+ <p>
+ With <c>state_functions</c>, you are restricted to use
+ atom-only states, and the <c>gen_statem</c> engine dispatches
+ on state name for you. This encourages the callback module
+ to gather the implementation of all event actions particular
+ to one state in the same place in the code,
+ hence to focus on one state at the time.
+ </p>
+ <p>
+ This mode fits well when you have a regular state diagram,
+ like the ones in this chapter, which describes all events and actions
+ belonging to a state visually around that state,
+ and each state has its unique name.
+ </p>
+ <p>
+ With <c>handle_event_function</c>, you are free to mix strategies,
+ as all events and states are handled in the same callback function.
+ </p>
+ <p>
+ This mode works equally well when you want to focus on
+ one event at the time or on
+ one state at the time, but function
+ <seealso marker="stdlib:gen_statem#Module:handle_event/4"><c>Module:handle_event/4</c></seealso>
+ quickly grows too large to handle without introducing dispatching.
+ </p>
+ <p>
+ The mode enables the use of non-atom states, for example,
+ complex states or even hierarchical states.
+ If, for example, a state diagram is largely alike
+ for the client side and the server side of a protocol,
+ you can have a state <c>{StateName,server}</c> or
+ <c>{StateName,client}</c>. Also, as you do the dispatching
+ yourself, you make <c>StateName</c> decide where in the code
+ to handle most events in the state.
+ The second element of the tuple is then used to select
+ whether to handle special client-side or server-side events.
+ </p>
+ </section>
+ </section>
+
+<!-- =================================================================== -->
+
+ <section>
+ <title>Example</title>
+ <p>
+ This example starts off as equivalent to the example in section
+ <seealso marker="fsm"><c>gen_fsm</c> Behavior</seealso>.
+ In later sections, additions and tweaks are made
+ using features in <c>gen_statem</c> that <c>gen_fsm</c> does not have.
+ The end of this chapter provides the example again
+ with all the added features.
+ </p>
+ <p>
+ A door with a code lock can be seen as a state machine.
+ Initially, the door is locked. When someone presses a button,
+ an event is generated.
+ Depending on what buttons have been pressed before,
+ the sequence so far can be correct, incomplete, or wrong.
+ If correct, the door is unlocked for 10 seconds (10,000 milliseconds).
+ If incomplete, we wait for another button to be pressed. If
+ wrong, we start all over, waiting for a new button sequence.
+ </p>
+ <image file="../design_principles/code_lock.png">
+ <icaption>Code Lock State Diagram</icaption>
+ </image>
+ <p>
+ This code lock state machine can be implemented using
+ <c>gen_statem</c> with the following callback module:
+ </p>
+ <marker id="ex"></marker>
+ <code type="erl"><![CDATA[
+-module(code_lock).
+-behaviour(gen_statem).
+-define(NAME, code_lock).
+-define(CALLBACK_MODE, state_functions).
+
+-export([start_link/1]).
+-export([button/1]).
+-export([init/1,terminate/3,code_change/4]).
+-export([locked/3,open/3]).
+
+start_link(Code) ->
+ gen_statem:start_link({local,?NAME}, ?MODULE, Code, []).
+
+button(Digit) ->
+ gen_statem:cast(?NAME, {button,Digit}).
+
+init(Code) ->
+ do_lock(),
+ Data = #{code => Code, remaining => Code},
+ {?CALLBACK_MODE,locked,Data}.
+
+locked(
+ cast, {button,Digit},
+ #{code := Code, remaining := Remaining} = Data) ->
+ case Remaining of
+ [Digit] ->
+ do_unlock(),
+ {next_state,open,Data#{remaining := Code},10000};
+ [Digit|Rest] -> % Incomplete
+ {next_state,locked,Data#{remaining := Rest}};
+ _Wrong ->
+ {next_state,locked,Data#{remaining := Code}}
+ end.
+
+open(timeout, _, Data) ->
+ do_lock(),
+ {next_state,locked,Data};
+open(cast, {button,_}, Data) ->
+ do_lock(),
+ {next_state,locked,Data}.
+
+do_lock() ->
+ io:format("Lock~n", []).
+do_unlock() ->
+ io:format("Unlock~n", []).
+
+terminate(_Reason, State, _Data) ->
+ State =/= locked andalso do_lock(),
+ ok.
+code_change(_Vsn, State, Data, _Extra) ->
+ {?CALLBACK_MODE,State,Data}.
+ ]]></code>
+ <p>The code is explained in the next sections.</p>
+ </section>
+
+<!-- =================================================================== -->
+
+ <section>
+ <title>Starting gen_statem</title>
+ <p>
+ In the example in the previous section, <c>gen_statem</c> is
+ started by calling <c>code_lock:start_link(Code)</c>:
+ </p>
+ <code type="erl"><![CDATA[
+start_link(Code) ->
+ gen_statem:start_link({local,?NAME}, ?MODULE, Code, []).
+ ]]></code>
+ <p>
+ <c>start_link</c> calls function
+ <seealso marker="stdlib:gen_statem#start_link/4"><c>gen_statem:start_link/4</c></seealso>,
+ which spawns and links to a new process, a <c>gen_statem</c>.
+ </p>
+ <list type="bulleted">
+ <item>
+ <p>
+ The first argument, <c>{local,?NAME}</c>, specifies
+ the name. In this case, the <c>gen_statem</c> is locally
+ registered as <c>code_lock</c> through the macro <c>?NAME</c>.
+ </p>
+ <p>
+ If the name is omitted, the <c>gen_statem</c> is not registered.
+ Instead its pid must be used. The name can also be specified
+ as <c>{global,Name}</c>, then the <c>gen_statem</c> is
+ registered using
+ <seealso marker="kernel:global#register_name/2"><c>global:register_name/2</c></seealso>
+ in <c>Kernel</c>.
+ </p>
+ </item>
+ <item>
+ <p>
+ The second argument, <c>?MODULE</c>, is the name of
+ the callback module, that is, the module where the callback
+ functions are located, which is this module.
+ </p>
+ <p>
+ The interface functions (<c>start_link/1</c> and <c>button/1</c>)
+ are located in the same module as the callback functions
+ (<c>init/1</c>, <c>locked/3</c>, and <c>open/3</c>).
+ It is normally good programming practice to have the client-side
+ code and the server-side code contained in one module.
+ </p>
+ </item>
+ <item>
+ <p>
+ The third argument, <c>Code</c>, is a list of digits, which
+ is the correct unlock code that is passed
+ to callback function <c>init/1</c>.
+ </p>
+ </item>
+ <item>
+ <p>
+ The fourth argument, <c>[]</c>, is a list of options.
+ For the available options, see
+ <seealso marker="stdlib:gen_statem#start_link/3"><c>gen_statem:start_link/3</c></seealso>.
+ </p>
+ </item>
+ </list>
+ <p>
+ If name registration succeeds, the new <c>gen_statem</c> process
+ calls callback function <c>code_lock:init(Code)</c>.
+ This function is expected to return <c>{CallbackMode,State,Data}</c>,
+ where
+ <seealso marker="#callback_modes"><c>CallbackMode</c></seealso>
+ selects callback module state function mode, in this case
+ <seealso marker="stdlib:gen_statem#type-callback_mode"><c>state_functions</c></seealso>
+ through macro <c>?CALLBACK_MODE</c>. That is, each state
+ has got its own handler function.
+ <c>State</c> is the initial state of the <c>gen_statem</c>,
+ in this case <c>locked</c>; assuming that the door is locked to begin
+ with. <c>Data</c> is the internal server data of the <c>gen_statem</c>.
+ Here the server data is a <seealso marker="stdlib:maps">map</seealso>
+ with key <c>code</c> that stores
+ the correct button sequence, and key <c>remaining</c>
+ that stores the remaining correct button sequence
+ (the same as the <c>code</c> to begin with).
+ </p>
+ <code type="erl"><![CDATA[
+init(Code) ->
+ do_lock(),
+ Data = #{code => Code, remaining => Code},
+ {?CALLBACK_MODE,locked,Data}.
+ ]]></code>
+ <p>Function
+ <seealso marker="stdlib:gen_statem#start_link/3"><c>gen_statem:start_link</c></seealso>
+ is synchronous. It does not return until the <c>gen_statem</c>
+ is initialized and is ready to receive events.
+ </p>
+ <p>
+ Function
+ <seealso marker="stdlib:gen_statem#start_link/3"><c>gen_statem:start_link</c></seealso>
+ must be used if the <c>gen_statem</c>
+ is part of a supervision tree, that is, started by a supervisor.
+ Another function,
+ <seealso marker="stdlib:gen_statem#start/3"><c>gen_statem:start</c></seealso>
+ can be used to start a standalone <c>gen_statem</c>, that is,
+ a <c>gen_statem</c> that is not part of a supervision tree.
+ </p>
+ </section>
+
+<!-- =================================================================== -->
+
+ <section>
+ <title>Handling Events</title>
+ <p>The function notifying the code lock about a button event is
+ implemented using
+ <seealso marker="stdlib:gen_statem#cast/2"><c>gen_statem:cast/2</c></seealso>:
+ </p>
+ <code type="erl"><![CDATA[
+button(Digit) ->
+ gen_statem:cast(?NAME, {button,Digit}).
+ ]]></code>
+ <p>
+ The first argument is the name of the <c>gen_statem</c> and must
+ agree with the name used to start it. So, we use the
+ same macro <c>?NAME</c> as when starting.
+ <c>{button,Digit}</c> is the event content.
+ </p>
+ <p>
+ The event is made into a message and sent to the <c>gen_statem</c>.
+ When the event is received, the <c>gen_statem</c> calls
+ <c>StateName(cast, Event, Data)</c>, which is expected to
+ return a tuple <c>{next_state,NewStateName,NewData}</c>.
+ <c>StateName</c> is the name of the current state and
+ <c>NewStateName</c> is the name of the next state to go to.
+ <c>NewData</c> is a new value for the server data of
+ the <c>gen_statem</c>.
+ </p>
+ <code type="erl"><![CDATA[
+locked(
+ cast, {button,Digit},
+ #{code := Code, remaining := Remaining} = Data) ->
+ case Remaining of
+ [Digit] -> % Complete
+ do_unlock(),
+ {next_state,open,Data#{remaining := Code},10000};
+ [Digit|Rest] -> % Incomplete
+ {next_state,locked,Data#{remaining := Rest}};
+ [_|_] -> % Wrong
+ {next_state,locked,Data#{remaining := Code}}
+ end.
+
+open(timeout, _, Data) ->
+ do_lock(),
+ {next_state,locked,Data};
+open(cast, {button,_}, Data) ->
+ do_lock(),
+ {next_state,locked,Data}.
+ ]]></code>
+ <p>
+ If the door is locked and a button is pressed, the pressed
+ button is compared with the next correct button.
+ Depending on the result, the door is either unlocked
+ and the <c>gen_statem</c> goes to state <c>open</c>,
+ or the door remains in state <c>locked</c>.
+ </p>
+ <p>
+ If the pressed button is incorrect, the server data
+ restarts from the start of the code sequence.
+ </p>
+ <p>
+ In state <c>open</c>, any button locks the door, as
+ any event cancels the event timer, so no
+ time-out event occurs after a button event.
+ </p>
+ </section>
+
+ <section>
+ <title>Event Time-Outs</title>
+ <p>
+ When a correct code has been given, the door is unlocked and
+ the following tuple is returned from <c>locked/2</c>:
+ </p>
+ <code type="erl"><![CDATA[
+{next_state,open,Data#{remaining := Code},10000};
+ ]]></code>
+ <p>
+ 10,000 is a time-out value in milliseconds.
+ After this time (10 seconds), a time-out occurs.
+ Then, <c>StateName(timeout, 10000, Data)</c> is called.
+ The time-out occurs when the door has been in state <c>open</c>
+ for 10 seconds. After that the door is locked again:
+ </p>
+ <code type="erl"><![CDATA[
+open(timeout, _, Data) ->
+ do_lock(),
+ {next_state,locked,Data};
+ ]]></code>
+ </section>
+
+<!-- =================================================================== -->
+
+ <section>
+ <title>All State Events</title>
+ <p>
+ Sometimes events can arrive in any state of the <c>gen_statem</c>.
+ It is convenient to handle these in a common state handler function
+ that all state functions call for events not specific to the state.
+ </p>
+ <p>
+ Consider a <c>code_length/0</c> function that returns
+ the length of the correct code
+ (that should not be sensitive to reveal).
+ We dispatch all events that are not state-specific
+ to the common function <c>handle_event/3</c>:
+ </p>
+ <code type="erl"><![CDATA[
+...
+-export([button/1,code_length/0]).
+...
+
+code_length() ->
+ gen_statem:call(?NAME, code_length).
+
+...
+locked(...) -> ... ;
+locked(EventType, EventContent, Data) ->
+ handle_event(EventType, EventContent, Data).
+
+...
+open(...) -> ... ;
+open(EventType, EventContent, Data) ->
+ handle_event(EventType, EventContent, Data).
+
+handle_event({call,From}, code_length, #{code := Code} = Data) ->
+ {keep_state,Data,[{reply,From,length(Code)}]}.
+ ]]></code>
+ <p>
+ This example uses
+ <seealso marker="stdlib:gen_statem#call/2"><c>gen_statem:call/2</c></seealso>,
+ which waits for a reply from the server.
+ The reply is sent with a <c>{reply,From,Reply}</c> tuple
+ in an action list in the <c>{keep_state,...}</c> tuple
+ that retains the current state.
+ </p>
+ </section>
+
+<!-- =================================================================== -->
+
+ <section>
+ <title>One Event Handler</title>
+ <p>
+ If mode <c>handle_event_function</c> is used,
+ all events are handled in
+ <seealso marker="stdlib:gen_statem#Module:handle_event/4"><c>Module:handle_event/4</c></seealso>
+ and we can (but do not have to) use an event-centered approach
+ where we dispatch on event first and then state:
+ </p>
+ <code type="erl"><![CDATA[
+...
+-define(CALLBACK_MODE, handle_event_function).
+
+...
+-export([handle_event/4]).
+
+...
+
+handle_event(cast, {button,Digit}, State, #{code := Code} = Data) ->
+ case State of
+ locked ->
+ case maps:get(remaining, Data) of
+ [Digit] -> % Complete
+ do_unlock(),
+ {next_state,open,Data#{remaining := Code},10000};
+ [Digit|Rest] -> % Incomplete
+ {keep_state,Data#{remaining := Rest}};
+ [_|_] -> % Wrong
+ {keep_state,Data#{remaining := Code}}
+ end;
+ open ->
+ do_lock(),
+ {next_state,locked,Data}
+ end;
+handle_event(timeout, _, open, Data) ->
+ do_lock(),
+ {next_state,locked,Data}.
+
+...
+ ]]></code>
+ </section>
+
+<!-- =================================================================== -->
+
+ <section>
+ <title>Stopping</title>
+
+ <section>
+ <title>In a Supervision Tree</title>
+ <p>
+ If the <c>gen_statem</c> is part of a supervision tree,
+ no stop function is needed.
+ The <c>gen_statem</c> is automatically terminated by its supervisor.
+ Exactly how this is done is defined by a
+ <seealso marker="sup_princ#shutdown">shutdown strategy</seealso>
+ set in the supervisor.
+ </p>
+ <p>
+ If it is necessary to clean up before termination, the shutdown
+ strategy must be a time-out value and the <c>gen_statem</c> must
+ in function <c>init/1</c> set itself to trap exit signals
+ by calling
+ <seealso marker="erts:erlang#process_flag/2"><c>process_flag(trap_exit, true)</c></seealso>:
+ </p>
+ <code type="erl"><![CDATA[
+init(Args) ->
+ process_flag(trap_exit, true),
+ do_lock(),
+ ...
+ ]]></code>
+ <p>
+ When ordered to shut down, the <c>gen_statem</c> then calls
+ callback function <c>terminate(shutdown, State, Data)</c>.
+ </p>
+ <p>
+ In the following example, function <c>terminate/3</c>
+ locks the door if it is open, so we do not accidentally leave the door
+ open when the supervision tree terminates:
+ </p>
+ <code type="erl"><![CDATA[
+terminate(_Reason, State, _Data) ->
+ State =/= locked andalso do_lock(),
+ ok.
+ ]]></code>
+ </section>
+
+ <section>
+ <title>Standalone gen_statem</title>
+ <p>
+ If the <c>gen_statem</c> is not part of a supervision tree,
+ it can be stopped using
+ <seealso marker="stdlib:gen_statem#stop/1"><c>gen_statem:stop</c></seealso>,
+ preferably through an API function:
+ </p>
+ <code type="erl"><![CDATA[
+...
+-export([start_link/1,stop/0]).
+
+...
+stop() ->
+ gen_statem:stop(?NAME).
+ ]]></code>
+ <p>
+ This makes the <c>gen_statem</c> call callback function
+ <c>terminate/3</c> just like for a supervised server
+ and waits for the process to terminate.
+ </p>
+ </section>
+ </section>
+
+<!-- =================================================================== -->
+
+ <section>
+ <title>Actions</title>
+ <p>
+ In the first sections actions were mentioned as a part of
+ the general state machine model. These general actions
+ are implemented with the code that callback module
+ <c>gen_statem</c> executes in an event-handling
+ callback function before returning
+ to the <c>gen_statem</c> engine.
+ </p>
+ <p>
+ There are more specific state-transition actions
+ that a callback function can order the <c>gen_statem</c>
+ engine to do after the callback function return.
+ These are ordered by returning a list of
+ <seealso marker="stdlib:gen_statem#type-action">actions</seealso>
+ in the
+ <seealso marker="stdlib:gen_statem#type-state_function_result">return tuple</seealso>
+ from the
+ <seealso marker="stdlib:gen_statem#Module:StateName/3">callback function</seealso>.
+ These state transition actions affect the <c>gen_statem</c>
+ engine itself and can do the following:
+ </p>
+ <list type="bulleted">
+ <item>Postpone the current event</item>
+ <item>Hibernate the <c>gen_statem</c></item>
+ <item>Start an event time-out</item>
+ <item>Reply to a caller</item>
+ <item>Generate the next event to handle</item>
+ </list>
+ <p>
+ In the example earlier was mentioned the event time-out
+ and replying to a caller.
+ An example of event postponing is included later in this chapter.
+ For details, see the
+ <seealso marker="stdlib:gen_statem#type-action"><c>gen_statem(3)</c></seealso>
+ manual page.
+ You can, for example, reply to many callers
+ and generate multiple next events to handle.
+ </p>
+ </section>
+
+<!-- =================================================================== -->
+
+ <section>
+ <title>Event Types</title>
+ <p>
+ The previous sections mentioned a few
+ <seealso marker="stdlib:gen_statem#type-event_type">event types</seealso>.
+ Events of all types are handled in the same callback function,
+ for a given state, and the function gets
+ <c>EventType</c> and <c>EventContent</c> as arguments.
+ </p>
+ <p>
+ The following is a complete list of event types and where
+ they come from:
+ </p>
+ <taglist>
+ <tag><c>cast</c></tag>
+ <item>
+ Generated by
+ <seealso marker="stdlib:gen_statem#cast/2"><c>gen_statem:cast</c></seealso>.
+ </item>
+ <tag><c>{call,From}</c></tag>
+ <item>
+ Generated by
+ <seealso marker="stdlib:gen_statem#call/2"><c>gen_statem:call</c></seealso>,
+ where <c>From</c> is the reply address to use
+ when replying either through the state transition action
+ <c>{reply,From,Msg}</c> or by calling
+ <seealso marker="stdlib:gen_statem#reply/1"><c>gen_statem:reply</c></seealso>.
+ </item>
+ <tag><c>info</c></tag>
+ <item>
+ Generated by any regular process message sent to
+ the <c>gen_statem</c> process.
+ </item>
+ <tag><c>timeout</c></tag>
+ <item>
+ Generated by state transition action
+ <c>{timeout,Time,EventContent}</c> (or its short form <c>Time</c>)
+ timer timing out.
+ </item>
+ <tag><c>internal</c></tag>
+ <item>
+ Generated by state transition action
+ <c>{next_event,internal,EventContent}</c>.
+ All event types above can also be generated using
+ <c>{next_event,EventType,EventContent}</c>.
+ </item>
+ </taglist>
+ </section>
+
+<!-- =================================================================== -->
+
+ <section>
+ <title>State Time-Outs</title>
+ <p>
+ The time-out event generated by state transition action
+ <c>{timeout,Time,EventContent}</c> is an event time-out,
+ that is, if an event arrives the timer is cancelled.
+ You get either an event or a time-out, but not both.
+ </p>
+ <p>
+ Often you want a timer not to be cancelled by any event
+ or you want to start a timer in one state and respond
+ to the time-out in another. This can be accomplished
+ with a regular Erlang timer:
+ <seealso marker="erts:erlang#start_timer/4"><c>erlang:start_timer</c></seealso>.
+ </p>
+ <p>
+ For the example so far in this chapter: using the
+ <c>gen_statem</c> event timer has the consequence that
+ if a button event is generated while in the <c>open</c> state,
+ the time-out is cancelled and the button event is delivered.
+ So, we choose to lock the door if this occurred.
+ </p>
+ <p>
+ Suppose that we do not want a button to lock the door,
+ instead we want to ignore button events in the <c>open</c> state.
+ Then we start a timer when entering the <c>open</c> state
+ and waits for it to expire while ignoring button events:
+ </p>
+ <code type="erl"><![CDATA[
+...
+locked(
+ cast, {button,Digit},
+ #{code := Code, remaining := Remaining} = Data) ->
+ case Remaining of
+ [Digit] ->
+ do_unlock(),
+ Tref = erlang:start_timer(10000, self(), lock),
+ {next_state,open,Data#{remaining := Code, timer := Tref}};
+...
+
+open(info, {timeout,Tref,lock}, #{timer := Tref} = Data) ->
+ do_lock(),
+ {next_state,locked,Data};
+open(cast, {button,_}, Data) ->
+ {keep_state,Data};
+...
+ ]]></code>
+ <p>
+ If you need to cancel a timer because of some other event, you can use
+ <seealso marker="erts:erlang#cancel_timer/2"><c>erlang:cancel_timer(Tref)</c></seealso>.
+ Notice that a time-out message cannot arrive after this,
+ unless you have postponed it (see the next section) before,
+ so ensure that you do not accidentally postpone such messages.
+ </p>
+ <p>
+ Another way to cancel a timer is not to cancel it,
+ but to ignore it if it arrives in a state
+ where it is known to be late.
+ </p>
+ </section>
+
+<!-- =================================================================== -->
+
+ <section>
+ <title>Postponing Events</title>
+ <p>
+ If you want to ignore a particular event in the current state
+ and handle it in a future state, you can postpone the event.
+ A postponed event is retried after the state has
+ changed, that is, <c>OldState =/= NewState</c>.
+ </p>
+ <p>
+ Postponing is ordered by the state transition
+ <seealso marker="stdlib:gen_statem#type-action">action</seealso>
+ <c>postpone</c>.
+ </p>
+ <p>
+ In this example, instead of ignoring button events
+ while in the <c>open</c> state, we can postpone them
+ and they are queued and later handled in the <c>locked</c> state:
+ </p>
+ <code type="erl"><![CDATA[
+...
+open(cast, {button,_}, Data) ->
+ {keep_state,Data,[postpone]};
+...
+ ]]></code>
+ <p>
+ The fact that a postponed event is only retried after a state change
+ translates into a requirement on the event and state space.
+ If you have a choice between storing a state data item
+ in the <c>State</c> or in the <c>Data</c>:
+ if a change in the item value affects which events that
+ are handled, then this item is to be part of the state.
+ </p>
+ <p>
+ You want to avoid that you maybe much later decide
+ to postpone an event in one state and by misfortune it is never retried,
+ as the code only changes the <c>Data</c> but not the <c>State</c>.
+ </p>
+
+ <section>
+ <title>Fuzzy State Diagrams</title>
+ <p>
+ It is not uncommon that a state diagram does not specify
+ how to handle events that are not illustrated
+ in a particular state in the diagram.
+ Hopefully this is described in an associated text
+ or from the context.
+ </p>
+ <p>
+ Possible actions: ignore as in drop the event
+ (maybe log it) or deal with the event in some other state
+ as in postpone it.
+ </p>
+ </section>
+
+ <section>
+ <title>Selective Receive</title>
+ <p>
+ Erlang's selective receive statement is often used to
+ describe simple state machine examples in straightforward
+ Erlang code. The following is a possible implementation of
+ the first example:
+ </p>
+ <code type="erl"><![CDATA[
+-module(code_lock).
+-define(NAME, code_lock_1).
+-export([start_link/1,button/1]).
+
+start_link(Code) ->
+ spawn(
+ fun () ->
+ true = register(?NAME, self()),
+ do_lock(),
+ locked(Code, Code)
+ end).
+
+button(Digit) ->
+ ?NAME ! {button,Digit}.
+
+locked(Code, [Digit|Remaining]) ->
+ receive
+ {button,Digit} when Remaining =:= [] ->
+ do_unlock(),
+ open(Code);
+ {button,Digit} ->
+ locked(Code, Remaining);
+ {button,_} ->
+ locked(Code, Code)
+ end.
+
+open(Code) ->
+ receive
+ after 10000 ->
+ do_lock(),
+ locked(Code, Code)
+ end.
+
+do_lock() ->
+ io:format("Locked~n", []).
+do_unlock() ->
+ io:format("Open~n", []).
+ ]]></code>
+ <p>
+ The selective receive in this case causes implicitly <c>open</c>
+ to postpone any events to the <c>locked</c> state.
+ </p>
+ <p>
+ A selective receive cannot be used from a <c>gen_statem</c>
+ behavior as for any <c>gen_*</c> behavior,
+ as the receive statement is within the <c>gen_*</c> engine itself.
+ It must be there because all
+ <seealso marker="stdlib:sys"><c>sys</c></seealso>
+ compatible behaviors must respond to system messages and therefore
+ do that in their engine receive loop,
+ passing non-system messages to the callback module.
+ </p>
+ <p>
+ The state transition
+ <seealso marker="stdlib:gen_statem#type-action">action</seealso>
+ <c>postpone</c> is designed to model
+ selective receives. A selective receive implicitly postpones
+ any not received events, but the <c>postpone</c>
+ state transition action explicitly postpones one received event.
+ </p>
+ <p>
+ Both mechanisms have the same theoretical
+ time and memory complexity, while the selective receive
+ language construct has smaller constant factors.
+ </p>
+ </section>
+ </section>
+
+<!-- =================================================================== -->
+
+ <section>
+ <title>Self-Generated Events</title>
+ <p>
+ It can sometimes be beneficial to be able to generate events
+ to your own state machine.
+ This can be done with the state transition
+ <seealso marker="stdlib:gen_statem#type-action">action</seealso>
+ <c>{next_event,EventType,EventContent}</c>.
+ </p>
+ <p>
+ You can generate events of any existing
+ <seealso marker="stdlib:gen_statem#type-action">type</seealso>,
+ but the <c>internal</c> type can only be generated through action
+ <c>next_event</c>. Hence, it cannot come from an external source,
+ so you can be certain that an <c>internal</c> event is an event
+ from your state machine to itself.
+ </p>
+ <p>
+ One example of using self-generated events can be when you have
+ a state machine specification that uses state entry actions.
+ You can code that using a dedicated function
+ to do the state transition. But if you want that code to be
+ visible besides the other state logic, you can insert
+ an <c>internal</c> event that does the entry actions.
+ This has the same unfortunate consequence as using
+ state transition functions: everywhere you go to
+ the state, you must explicitly
+ insert the <c>internal</c> event
+ or use a state transition function.
+ </p>
+ <p>
+ The following is an implementation of entry actions
+ using <c>internal</c> events with content <c>enter</c>
+ using a helper function <c>enter/3</c> for state entry:
+ </p>
+ <code type="erl"><![CDATA[
+...
+-define(CALLBACK_MODE, state_functions).
+
+...
+
+init(Code) ->
+ process_flag(trap_exit, true),
+ Data = #{code => Code},
+ enter(?CALLBACK_MODE, locked, Data).
+
+...
+
+locked(internal, enter, _Data) ->
+ do_lock(),
+ {keep_state,Data#{remaining => Code}};
+locked(
+ cast, {button,Digit},
+ #{code := Code, remaining := Remaining} = Data) ->
+ case Remaining of
+ [Digit] ->
+ enter(next_state, open, Data);
+...
+
+open(internal, enter, _Data) ->
+ Tref = erlang:start_timer(10000, self(), lock),
+ do_unlock(),
+ {keep_state,Data#{timer => Tref}};
+open(info, {timeout,Tref,lock}, #{timer := Tref} = Data) ->
+ enter(next_state, locked, Data);
+...
+
+enter(Tag, State, Data) ->
+ {Tag,State,Data,[{next_event,internal,enter}]}.
+ ]]></code>
+ </section>
+
+<!-- =================================================================== -->
+
+ <section>
+ <title>Example Revisited</title>
+ <p>
+ This section includes the example after all mentioned modifications
+ and some more using the entry actions,
+ which deserves a new state diagram:
+ </p>
+ <image file="../design_principles/code_lock_2.png">
+ <icaption>Code Lock State Diagram Revisited</icaption>
+ </image>
+ <p>
+ Notice that this state diagram does not specify how to handle
+ a button event in the state <c>open</c>. So, you need to
+ read somewhere else that unspecified events
+ must be ignored as in not consumed but handled in some other state.
+ Also, the state diagram does not show that the <c>code_length/0</c>
+ call must be handled in every state.
+ </p>
+
+ <section>
+ <title>Callback Mode: state_functions</title>
+ <p>
+ Using state functions:
+ </p>
+ <code type="erl"><![CDATA[
+-module(code_lock).
+-behaviour(gen_statem).
+-define(NAME, code_lock_2).
+-define(CALLBACK_MODE, state_functions).
+
+-export([start_link/1,stop/0]).
+-export([button/1,code_length/0]).
+-export([init/1,terminate/3,code_change/4]).
+-export([locked/3,open/3]).
+
+start_link(Code) ->
+ gen_statem:start_link({local,?NAME}, ?MODULE, Code, []).
+stop() ->
+ gen_statem:stop(?NAME).
+
+button(Digit) ->
+ gen_statem:cast(?NAME, {button,Digit}).
+code_length() ->
+ gen_statem:call(?NAME, code_length).
+
+init(Code) ->
+ process_flag(trap_exit, true),
+ Data = #{code => Code},
+ enter(?CALLBACK_MODE, locked, Data).
+
+locked(internal, enter, #{code := Code} = Data) ->
+ do_lock(),
+ {keep_state,Data#{remaining => Code}};
+locked(
+ cast, {button,Digit},
+ #{code := Code, remaining := Remaining} = Data) ->
+ case Remaining of
+ [Digit] -> % Complete
+ enter(next_state, open, Data);
+ [Digit|Rest] -> % Incomplete
+ {keep_state,Data#{remaining := Rest}};
+ [_|_] -> % Wrong
+ {keep_state,Data#{remaining := Code}}
+ end;
+locked(EventType, EventContent, Data) ->
+ handle_event(EventType, EventContent, Data).
+
+open(internal, enter, Data) ->
+ Tref = erlang:start_timer(10000, self(), lock),
+ do_unlock(),
+ {keep_state,Data#{timer => Tref}};
+open(info, {timeout,Tref,lock}, #{timer := Tref} = Data) ->
+ enter(next_state, locked, Data);
+open(cast, {button,_}, _) ->
+ {keep_state_and_data,[postpone]};
+open(EventType, EventContent, Data) ->
+ handle_event(EventType, EventContent, Data).
+
+handle_event({call,From}, code_length, #{code := Code}) ->
+ {keep_state_and_data,[{reply,From,length(Code)}]}.
+enter(Tag, State, Data) ->
+ {Tag,State,Data,[{next_event,internal,enter}]}.
+
+do_lock() ->
+ io:format("Locked~n", []).
+do_unlock() ->
+ io:format("Open~n", []).
+
+terminate(_Reason, State, _Data) ->
+ State =/= locked andalso do_lock(),
+ ok.
+code_change(_Vsn, State, Data, _Extra) ->
+ {?CALLBACK_MODE,State,Data}.
+ ]]></code>
+ </section>
+
+ <section>
+ <title>Callback Mode: handle_event_function</title>
+ <p>
+ This section describes what to change in the example
+ to use one <c>handle_event/4</c> function.
+ The previously used clean first-dispatch-on-event approach
+ does not work that well here because of the generated
+ entry actions so this example dispatches on state first:
+ </p>
+ <code type="erl"><![CDATA[
+...
+-define(CALLBACK_MODE, handle_event_function).
+
+...
+-export([handle_event/4]).
+
+...
+
+%% State: locked
+handle_event(internal, enter, locked, #{code := Code} = Data) ->
+ do_lock(),
+ {keep_state,Data#{remaining => Code}};
+handle_event(
+ cast, {button,Digit}, locked,
+ #{code := Code, remaining := Remaining} = Data) ->
+ case Remaining of
+ [Digit] -> % Complete
+ enter(next_state, open, Data);
+ [Digit|Rest] -> % Incomplete
+ {keep_state,Data#{remaining := Rest}};
+ [_|_] -> % Wrong
+ {keep_state,Data#{remaining := Code}}
+ end;
+%%
+%% State: open
+handle_event(internal, enter, open, Data) ->
+ Tref = erlang:start_timer(10000, self(), lock),
+ do_unlock(),
+ {keep_state,Data#{timer => Tref}};
+handle_event(info, {timeout,Tref,lock}, open, #{timer := Tref} = Data) ->
+ enter(next_state, locked, Data);
+handle_event(cast, {button,_}, open, _) ->
+ {keep_state_and_data,[postpone]};
+%%
+%% Any state
+handle_event({call,From}, code_length, _State, #{code := Code}) ->
+ {keep_state_and_data,[{reply,From,length(Code)}]}.
+
+...
+ ]]></code>
+ </section>
+ <p>
+ Notice that postponing buttons from the <c>locked</c> state
+ to the <c>open</c> state feels like the wrong thing to do
+ for a code lock, but it at least illustrates event postponing.
+ </p>
+ </section>
+
+<!-- =================================================================== -->
+
+ <section>
+ <title>Filter the State</title>
+ <p>
+ The example servers so far in this chapter
+ print the full internal state in the error log, for example,
+ when killed by an exit signal or because of an internal error.
+ This state contains both the code lock code
+ and which digits that remain to unlock.
+ </p>
+ <p>
+ This state data can be regarded as sensitive,
+ and maybe not what you want in the error log
+ because of some unpredictable event.
+ </p>
+ <p>
+ Another reason to filter the state can be
+ that the state is too large to print, as it fills
+ the error log with uninteresting details.
+ </p>
+ <p>
+ To avoid this, you can format the internal state
+ that gets in the error log and gets returned from
+ <seealso marker="stdlib:sys#get_status/1"><c>sys:get_status/1,2</c></seealso>
+ by implementing function
+ <seealso marker="stdlib:gen_statem#Module:format_status/2"><c>Module:format_status/2</c></seealso>,
+ for example like this:
+ </p>
+ <code type="erl"><![CDATA[
+...
+-export([init/1,terminate/3,code_change/4,format_status/2]).
+...
+
+format_status(Opt, [_PDict,State,Data]) ->
+ StateData =
+ {State,
+ maps:filter(
+ fun (code, _) -> false;
+ (remaining, _) -> false;
+ (_, _) -> true
+ end,
+ Data)},
+ case Opt of
+ terminate ->
+ StateData;
+ normal ->
+ [{data,[{"State",StateData}]}]
+ end.
+ ]]></code>
+ <p>
+ It is not mandatory to implement a
+ <seealso marker="stdlib:gen_statem#Module:format_status/2"><c>Module:format_status/2</c></seealso>
+ function. If you do not, a default implementation is used that
+ does the same as this example function without filtering
+ the <c>Data</c> term, that is, <c>StateData = {State,Data}</c>.
+ </p>
+ </section>
+
+<!-- =================================================================== -->
+
+ <section>
+ <title>Complex State</title>
+ <p>
+ The callback mode
+ <seealso marker="stdlib:gen_statem#type-callback_mode"><c>handle_event_function</c></seealso>
+ enables using a non-atom state as described in section
+ <seealso marker="#callback_modes">Callback Modes</seealso>,
+ for example, a complex state term like a tuple.
+ </p>
+ <p>
+ One reason to use this is when you have
+ a state item that affects the event handling,
+ in particular in combination with postponing events.
+ We complicate the previous example
+ by introducing a configurable lock button
+ (this is the state item in question),
+ which in the <c>open</c> state immediately locks the door,
+ and an API function <c>set_lock_button/1</c> to set the lock button.
+ </p>
+ <p>
+ Suppose now that we call <c>set_lock_button</c>
+ while the door is open,
+ and have already postponed a button event
+ that until now was not the lock button.
+ The sensible thing can be to say that
+ the button was pressed too early so it is
+ not to be recognized as the lock button.
+ However, then it can be surprising that a button event
+ that now is the lock button event arrives (as retried postponed)
+ immediately after the state transits to <c>locked</c>.
+ </p>
+ <p>
+ So we make the <c>button/1</c> function synchronous
+ by using
+ <seealso marker="stdlib:gen_statem#call/2"><c>gen_statem:call</c></seealso>
+ and still postpone its events in the <c>open</c> state.
+ Then a call to <c>button/1</c> during the <c>open</c>
+ state does not return until the state transits to <c>locked</c>,
+ as it is there the event is handled and the reply is sent.
+ </p>
+ <p>
+ If a process now calls <c>set_lock_button/1</c>
+ to change the lock button while another process
+ hangs in <c>button/1</c> with the new lock button,
+ it can be expected that the hanging lock button call
+ immediately takes effect and locks the lock.
+ Therefore, we make the current lock button a part of the state,
+ so that when we change the lock button, the state changes
+ and all postponed events are retried.
+ </p>
+ <p>
+ We define the state as <c>{StateName,LockButton}</c>,
+ where <c>StateName</c> is as before
+ and <c>LockButton</c> is the current lock button:
+ </p>
+ <code type="erl"><![CDATA[
+-module(code_lock).
+-behaviour(gen_statem).
+-define(NAME, code_lock_3).
+-define(CALLBACK_MODE, handle_event_function).
+
+-export([start_link/2,stop/0]).
+-export([button/1,code_length/0,set_lock_button/1]).
+-export([init/1,terminate/3,code_change/4,format_status/2]).
+-export([handle_event/4]).
+
+start_link(Code, LockButton) ->
+ gen_statem:start_link(
+ {local,?NAME}, ?MODULE, {Code,LockButton}, []).
+stop() ->
+ gen_statem:stop(?NAME).
+
+button(Digit) ->
+ gen_statem:call(?NAME, {button,Digit}).
+code_length() ->
+ gen_statem:call(?NAME, code_length).
+set_lock_button(LockButton) ->
+ gen_statem:call(?NAME, {set_lock_button,LockButton}).
+
+init({Code,LockButton}) ->
+ process_flag(trap_exit, true),
+ Data = #{code => Code, remaining => undefined, timer => undefined},
+ enter(?CALLBACK_MODE, {locked,LockButton}, Data, []).
+
+handle_event(
+ {call,From}, {set_lock_button,NewLockButton},
+ {StateName,OldLockButton}, Data) ->
+ {next_state,{StateName,NewLockButton},Data,
+ [{reply,From,OldLockButton}]};
+handle_event(
+ {call,From}, code_length,
+ {_StateName,_LockButton}, #{code := Code}) ->
+ {keep_state_and_data,
+ [{reply,From,length(Code)}]};
+handle_event(
+ EventType, EventContent,
+ {locked,LockButton}, #{code := Code, remaining := Remaining} = Data) ->
+ case {EventType,EventContent} of
+ {internal,enter} ->
+ do_lock(),
+ {keep_state,Data#{remaining := Code}};
+ {{call,From},{button,Digit}} ->
+ case Remaining of
+ [Digit] -> % Complete
+ next_state(
+ {open,LockButton}, Data,
+ [{reply,From,ok}]);
+ [Digit|Rest] -> % Incomplete
+ {keep_state,Data#{remaining := Rest},
+ [{reply,From,ok}]};
+ [_|_] -> % Wrong
+ {keep_state,Data#{remaining := Code},
+ [{reply,From,ok}]}
+ end
+ end;
+handle_event(
+ EventType, EventContent,
+ {open,LockButton}, #{timer := Timer} = Data) ->
+ case {EventType,EventContent} of
+ {internal,enter} ->
+ Tref = erlang:start_timer(10000, self(), lock),
+ do_unlock(),
+ {keep_state,Data#{timer := Tref}};
+ {info,{timeout,Timer,lock}} ->
+ next_state({locked,LockButton}, Data, []);
+ {{call,From},{button,Digit}} ->
+ if
+ Digit =:= LockButton ->
+ erlang:cancel_timer(Timer),
+ next_state(
+ {locked,LockButton}, Data,
+ [{reply,From,locked}]);
+ true ->
+ {keep_state_and_data,
+ [postpone]}
+ end
+ end.
+
+next_state(State, Data, Actions) ->
+ enter(next_state, State, Data, Actions).
+enter(Tag, State, Data, Actions) ->
+ {Tag,State,Data,[{next_event,internal,enter}|Actions]}.
+
+do_lock() ->
+ io:format("Locked~n", []).
+do_unlock() ->
+ io:format("Open~n", []).
+
+terminate(_Reason, State, _Data) ->
+ State =/= locked andalso do_lock(),
+ ok.
+code_change(_Vsn, State, Data, _Extra) ->
+ {?CALLBACK_MODE,State,Data}.
+format_status(Opt, [_PDict,State,Data]) ->
+ StateData =
+ {State,
+ maps:filter(
+ fun (code, _) -> false;
+ (remaining, _) -> false;
+ (_, _) -> true
+ end,
+ Data)},
+ case Opt of
+ terminate ->
+ StateData;
+ normal ->
+ [{data,[{"State",StateData}]}]
+ end.
+ ]]></code>
+ <p>
+ It can be an ill-fitting model for a physical code lock
+ that the <c>button/1</c> call can hang until the lock
+ is locked. But for an API in general it is not that strange.
+ </p>
+ </section>
+
+<!-- =================================================================== -->
+
+ <section>
+ <title>Hibernation</title>
+ <p>
+ If you have many servers in one node
+ and they have some state(s) in their lifetime in which
+ the servers can be expected to idle for a while,
+ and the amount of heap memory all these servers need
+ is a problem, then the memory footprint of a server
+ can be mimimized by hibernating it through
+ <seealso marker="stdlib:proc_lib#hibernate/3"><c>proc_lib:hibernate/3</c></seealso>.
+ </p>
+ <note>
+ <p>
+ It is rather costly to hibernate a process; see
+ <seealso marker="erts:erlang#hibernate/3"><c>erlang:hibernate/3</c></seealso>.
+ It is not something you want to do after every event.
+ </p>
+ </note>
+ <p>
+ We can in this example hibernate in the <c>{open,_}</c> state,
+ because what normally occurs in that state is that
+ the state time-out after a while
+ triggers a transition to <c>{locked,_}</c>:
+ </p>
+ <code type="erl"><![CDATA[
+...
+handle_event(
+ EventType, EventContent,
+ {open,LockButton}, #{timer := Timer} = Data) ->
+ case {EventType,EventContent} of
+ {internal,enter} ->
+ Tref = erlang:start_timer(10000, self(), lock),
+ do_unlock(),
+ {keep_state,Data#{timer := Tref},[hibernate]};
+...
+ ]]></code>
+ <p>
+ The
+ <seealso marker="stdlib:gen_statem#type-hibernate"><c>[hibernate]</c></seealso>
+ action list on the last line
+ when entering the <c>{open,_}</c> state is the only change.
+ If any event arrives in the <c>{open,_},</c> state, we
+ do not bother to rehibernate, so the server stays
+ awake after any event.
+ </p>
+ <p>
+ To change that we would need to insert
+ action <c>hibernate</c> in more places.
+ For example, for the state-independent <c>set_lock_button</c>
+ and <c>code_length</c> operations that then would have to
+ be aware of using <c>hibernate</c> while in the
+ <c>{open,_}</c> state, which would clutter the code.
+ </p>
+ <p>
+ This server probably does not use
+ heap memory worth hibernating for.
+ To gain anything from hibernation, your server would
+ have to produce some garbage during callback execution,
+ for which this example server can serve as a bad example.
+ </p>
+ </section>
+
+</chapter>
diff --git a/system/doc/design_principles/sup_princ.xml b/system/doc/design_principles/sup_princ.xml
index 5e2f6ba9cb..a77b3964fc 100644
--- a/system/doc/design_principles/sup_princ.xml
+++ b/system/doc/design_principles/sup_princ.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2014</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -213,6 +213,7 @@ child_spec() = #{id => child_id(), % mandatory
<item><c>supervisor:start_link</c></item>
<item><c>gen_server:start_link</c></item>
<item><c>gen_fsm:start_link</c></item>
+ <item><c>gen_statem:start_link</c></item>
<item><c>gen_event:start_link</c></item>
<item>A function compliant with these functions. For details,
see the <c>supervisor(3)</c> manual page.</item>
@@ -229,7 +230,7 @@ child_spec() = #{id => child_id(), % mandatory
is <c>rest_for_one</c> or <c>one_for_all</c> and a sibling
death causes the temporary process to be terminated).</item>
<item>A <c>transient</c> child process is restarted only if it
- terminates abnormally, that is, with another exit reason than
+ terminates abnormally, that is, with an exit reason other than
<c>normal</c>, <c>shutdown</c>, or <c>{shutdown,Term}</c>.</item>
</list>
<p>The <c>restart</c> key is optional. If it is not given, the
@@ -276,7 +277,8 @@ child_spec() = #{id => child_id(), % mandatory
<p><c>modules</c> are to be a list with one element
<c>[Module]</c>, where <c>Module</c> is the name of
the callback module, if the child process is a supervisor,
- gen_server or gen_fsm. If the child process is a gen_event,
+ gen_server, gen_fsm or gen_statem.
+ If the child process is a gen_event,
the value shall be <c>dynamic</c>.</p>
<p>This information is used by the release handler during
upgrades and downgrades, see
@@ -400,8 +402,8 @@ supervisor:delete_child(Sup, Id)</code>
restarts.</p>
</section>
- <marker id="simple"/>
<section>
+ <marker id="simple"/>
<title>Simplified one_for_one Supervisors</title>
<p>A supervisor with restart strategy <c>simple_one_for_one</c> is
a simplified <c>one_for_one</c> supervisor, where all child
diff --git a/system/doc/design_principles/xmlfiles.mk b/system/doc/design_principles/xmlfiles.mk
index 3032ac3ab9..e476255d62 100644
--- a/system/doc/design_principles/xmlfiles.mk
+++ b/system/doc/design_principles/xmlfiles.mk
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@ DESIGN_PRINCIPLES_CHAPTER_FILES = \
distributed_applications.xml \
events.xml \
fsm.xml \
+ statem.xml \
gen_server_concepts.xml \
included_applications.xml \
release_handling.xml \
diff --git a/system/doc/efficiency_guide/Makefile b/system/doc/efficiency_guide/Makefile
index 0665bb91f7..36e4cd00df 100644
--- a/system/doc/efficiency_guide/Makefile
+++ b/system/doc/efficiency_guide/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2012. All Rights Reserved.
+# Copyright Ericsson AB 2001-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/efficiency_guide/advanced.xml b/system/doc/efficiency_guide/advanced.xml
index d4e47f4f10..3609b8d88e 100644
--- a/system/doc/efficiency_guide/advanced.xml
+++ b/system/doc/efficiency_guide/advanced.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/efficiency_guide/appendix.xml b/system/doc/efficiency_guide/appendix.xml
index 1e2e906515..225c8c4e2f 100644
--- a/system/doc/efficiency_guide/appendix.xml
+++ b/system/doc/efficiency_guide/appendix.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2002</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/efficiency_guide/binaryhandling.xml b/system/doc/efficiency_guide/binaryhandling.xml
index 0964b759d8..0295d18644 100644
--- a/system/doc/efficiency_guide/binaryhandling.xml
+++ b/system/doc/efficiency_guide/binaryhandling.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2007</year>
- <year>2014</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/efficiency_guide/book.xml b/system/doc/efficiency_guide/book.xml
index 76f0ad24d3..e3d6fd5fc2 100644
--- a/system/doc/efficiency_guide/book.xml
+++ b/system/doc/efficiency_guide/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/efficiency_guide/commoncaveats.xml b/system/doc/efficiency_guide/commoncaveats.xml
index c1d71e745a..ecfeff0349 100644
--- a/system/doc/efficiency_guide/commoncaveats.xml
+++ b/system/doc/efficiency_guide/commoncaveats.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/efficiency_guide/drivers.xml b/system/doc/efficiency_guide/drivers.xml
index 202551ab8e..c99701eeba 100644
--- a/system/doc/efficiency_guide/drivers.xml
+++ b/system/doc/efficiency_guide/drivers.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2009</year><year>2013</year>
+ <year>2009</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/efficiency_guide/functions.xml b/system/doc/efficiency_guide/functions.xml
index 9616df554e..4a8248e65c 100644
--- a/system/doc/efficiency_guide/functions.xml
+++ b/system/doc/efficiency_guide/functions.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/efficiency_guide/introduction.xml b/system/doc/efficiency_guide/introduction.xml
index 121ce3af21..ca4a41c798 100644
--- a/system/doc/efficiency_guide/introduction.xml
+++ b/system/doc/efficiency_guide/introduction.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/efficiency_guide/listhandling.xml b/system/doc/efficiency_guide/listhandling.xml
index c7b5cf9a9a..2ebc877820 100644
--- a/system/doc/efficiency_guide/listhandling.xml
+++ b/system/doc/efficiency_guide/listhandling.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/efficiency_guide/myths.xml b/system/doc/efficiency_guide/myths.xml
index 651d909834..5d3ad78b23 100644
--- a/system/doc/efficiency_guide/myths.xml
+++ b/system/doc/efficiency_guide/myths.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2007</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/efficiency_guide/part.xml b/system/doc/efficiency_guide/part.xml
index 2862058bf2..6e10a0c031 100644
--- a/system/doc/efficiency_guide/part.xml
+++ b/system/doc/efficiency_guide/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/efficiency_guide/processes.xml b/system/doc/efficiency_guide/processes.xml
index 2d486ef7ff..f2d9712f51 100644
--- a/system/doc/efficiency_guide/processes.xml
+++ b/system/doc/efficiency_guide/processes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/efficiency_guide/profiling.xml b/system/doc/efficiency_guide/profiling.xml
index 4fbec927f4..1f3d503170 100644
--- a/system/doc/efficiency_guide/profiling.xml
+++ b/system/doc/efficiency_guide/profiling.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/efficiency_guide/tablesDatabases.xml b/system/doc/efficiency_guide/tablesDatabases.xml
index 865c46bc33..3f77151e55 100644
--- a/system/doc/efficiency_guide/tablesDatabases.xml
+++ b/system/doc/efficiency_guide/tablesDatabases.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2013</year>
+ <year>2001</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/efficiency_guide/xmlfiles.mk b/system/doc/efficiency_guide/xmlfiles.mk
index e3373d545a..88df9417f5 100644
--- a/system/doc/efficiency_guide/xmlfiles.mk
+++ b/system/doc/efficiency_guide/xmlfiles.mk
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/embedded/Makefile b/system/doc/embedded/Makefile
index c1134dd62c..40a1b1fb23 100644
--- a/system/doc/embedded/Makefile
+++ b/system/doc/embedded/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/embedded/book.xml b/system/doc/embedded/book.xml
index 5a414152d0..7737da7d2e 100644
--- a/system/doc/embedded/book.xml
+++ b/system/doc/embedded/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/embedded/embedded_nt.xml b/system/doc/embedded/embedded_nt.xml
index b35a5edf36..a1a4b90f3c 100644
--- a/system/doc/embedded/embedded_nt.xml
+++ b/system/doc/embedded/embedded_nt.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/embedded/embedded_solaris.xml b/system/doc/embedded/embedded_solaris.xml
index ade5ad344e..f8febcc546 100644
--- a/system/doc/embedded/embedded_solaris.xml
+++ b/system/doc/embedded/embedded_solaris.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/embedded/intro.xml b/system/doc/embedded/intro.xml
index 7fea2eeb82..2b9d35d24c 100644
--- a/system/doc/embedded/intro.xml
+++ b/system/doc/embedded/intro.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/embedded/part.xml b/system/doc/embedded/part.xml
index 7bac643be7..d359a888e7 100644
--- a/system/doc/embedded/part.xml
+++ b/system/doc/embedded/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/embedded/starting.xml b/system/doc/embedded/starting.xml
index f9454f1021..720383e8ac 100644
--- a/system/doc/embedded/starting.xml
+++ b/system/doc/embedded/starting.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/embedded/target.xml b/system/doc/embedded/target.xml
index 20ef6b0fc6..754269aa2f 100644
--- a/system/doc/embedded/target.xml
+++ b/system/doc/embedded/target.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/embedded/vme_problems.xml b/system/doc/embedded/vme_problems.xml
index 54618935cd..ac276ce9d3 100644
--- a/system/doc/embedded/vme_problems.xml
+++ b/system/doc/embedded/vme_problems.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/embedded/xmlfiles.mk b/system/doc/embedded/xmlfiles.mk
index 4446aa1516..1e0c71c726 100644
--- a/system/doc/embedded/xmlfiles.mk
+++ b/system/doc/embedded/xmlfiles.mk
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2013. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/embedded/xntp.xml b/system/doc/embedded/xntp.xml
index 2f4dc9a534..46213c7865 100644
--- a/system/doc/embedded/xntp.xml
+++ b/system/doc/embedded/xntp.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2013</year>
+ <year>2016</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/getting_started/Makefile b/system/doc/getting_started/Makefile
index f16dc0dde1..1fe3d39e4e 100644
--- a/system/doc/getting_started/Makefile
+++ b/system/doc/getting_started/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2012. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/getting_started/book.xml b/system/doc/getting_started/book.xml
index 8dfca19480..1d92105429 100644
--- a/system/doc/getting_started/book.xml
+++ b/system/doc/getting_started/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/getting_started/conc_prog.xml b/system/doc/getting_started/conc_prog.xml
index 9f13ee4802..f3136898ad 100644
--- a/system/doc/getting_started/conc_prog.xml
+++ b/system/doc/getting_started/conc_prog.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/getting_started/intro.xml b/system/doc/getting_started/intro.xml
index 6ac4f912fe..afae4e8c18 100644
--- a/system/doc/getting_started/intro.xml
+++ b/system/doc/getting_started/intro.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/getting_started/part.xml b/system/doc/getting_started/part.xml
index 4b902f4c63..71e551a404 100644
--- a/system/doc/getting_started/part.xml
+++ b/system/doc/getting_started/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/getting_started/records_macros.xml b/system/doc/getting_started/records_macros.xml
index dd2441b64e..3fcdb10088 100644
--- a/system/doc/getting_started/records_macros.xml
+++ b/system/doc/getting_started/records_macros.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/getting_started/robustness.xml b/system/doc/getting_started/robustness.xml
index abd5892b80..6932f0ca0f 100644
--- a/system/doc/getting_started/robustness.xml
+++ b/system/doc/getting_started/robustness.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/getting_started/seq_prog.xml b/system/doc/getting_started/seq_prog.xml
index 5698405ed2..6b7e1cd24f 100644
--- a/system/doc/getting_started/seq_prog.xml
+++ b/system/doc/getting_started/seq_prog.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/getting_started/xmlfiles.mk b/system/doc/getting_started/xmlfiles.mk
index 892db0e8de..d5a41121d6 100644
--- a/system/doc/getting_started/xmlfiles.mk
+++ b/system/doc/getting_started/xmlfiles.mk
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/installation_guide/Makefile b/system/doc/installation_guide/Makefile
index 52485382d5..673c203422 100644
--- a/system/doc/installation_guide/Makefile
+++ b/system/doc/installation_guide/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2014. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/installation_guide/book.xml b/system/doc/installation_guide/book.xml
index 92a64345c0..a7686252c6 100644
--- a/system/doc/installation_guide/book.xml
+++ b/system/doc/installation_guide/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/installation_guide/install-binary.xml b/system/doc/installation_guide/install-binary.xml
index 43f5a57077..b070c02633 100644
--- a/system/doc/installation_guide/install-binary.xml
+++ b/system/doc/installation_guide/install-binary.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2014</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/installation_guide/part.xml b/system/doc/installation_guide/part.xml
index 0aacd0f49b..7e51e6ae84 100644
--- a/system/doc/installation_guide/part.xml
+++ b/system/doc/installation_guide/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2014</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/installation_guide/xmlfiles.mk b/system/doc/installation_guide/xmlfiles.mk
index 05effe1534..3f720e1ee5 100644
--- a/system/doc/installation_guide/xmlfiles.mk
+++ b/system/doc/installation_guide/xmlfiles.mk
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2014. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/oam/Makefile b/system/doc/oam/Makefile
index 0638a4dbd6..9095744423 100644
--- a/system/doc/oam/Makefile
+++ b/system/doc/oam/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/oam/book.xml b/system/doc/oam/book.xml
index 93f5fe344a..05aa2334a5 100644
--- a/system/doc/oam/book.xml
+++ b/system/doc/oam/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/oam/oam_intro.xml b/system/doc/oam/oam_intro.xml
index 22a2080fd9..cdcb6e3111 100644
--- a/system/doc/oam/oam_intro.xml
+++ b/system/doc/oam/oam_intro.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/oam/part.xml b/system/doc/oam/part.xml
index efbaa05b94..817b70751c 100644
--- a/system/doc/oam/part.xml
+++ b/system/doc/oam/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/oam/xmlfiles.mk b/system/doc/oam/xmlfiles.mk
index 5876243466..b2351c661c 100644
--- a/system/doc/oam/xmlfiles.mk
+++ b/system/doc/oam/xmlfiles.mk
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/programming_examples/Makefile b/system/doc/programming_examples/Makefile
index e5f7a330f4..237076d770 100644
--- a/system/doc/programming_examples/Makefile
+++ b/system/doc/programming_examples/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2012. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/programming_examples/book.xml b/system/doc/programming_examples/book.xml
index c6eb4fec97..0f0fca5874 100644
--- a/system/doc/programming_examples/book.xml
+++ b/system/doc/programming_examples/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/programming_examples/funs.xmlsrc b/system/doc/programming_examples/funs.xmlsrc
index 8469f0871c..bb519be612 100644
--- a/system/doc/programming_examples/funs.xmlsrc
+++ b/system/doc/programming_examples/funs.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -212,7 +212,7 @@ f(...) ->
...
end, ...)
...</code>
- <p>instead of writng the following code:</p>
+ <p>instead of writing the following code:</p>
<code type="none">
f(...) ->
Y = ...
diff --git a/system/doc/programming_examples/list_comprehensions.xml b/system/doc/programming_examples/list_comprehensions.xml
index 5667571ec5..706cb337ad 100644
--- a/system/doc/programming_examples/list_comprehensions.xml
+++ b/system/doc/programming_examples/list_comprehensions.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/programming_examples/part.xml b/system/doc/programming_examples/part.xml
index e1f8cc5d57..930646ff4b 100644
--- a/system/doc/programming_examples/part.xml
+++ b/system/doc/programming_examples/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/programming_examples/records.xml b/system/doc/programming_examples/records.xml
index 6bda6dc0fd..da346dd0b3 100644
--- a/system/doc/programming_examples/records.xml
+++ b/system/doc/programming_examples/records.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/programming_examples/xmlfiles.mk b/system/doc/programming_examples/xmlfiles.mk
index cc77f48253..5129e488f4 100644
--- a/system/doc/programming_examples/xmlfiles.mk
+++ b/system/doc/programming_examples/xmlfiles.mk
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/reference_manual/Makefile b/system/doc/reference_manual/Makefile
index 30febb1ade..e14a056979 100644
--- a/system/doc/reference_manual/Makefile
+++ b/system/doc/reference_manual/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2012. All Rights Reserved.
+# Copyright Ericsson AB 2003-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/reference_manual/book.xml b/system/doc/reference_manual/book.xml
index 6b7306fb77..590d3580a4 100644
--- a/system/doc/reference_manual/book.xml
+++ b/system/doc/reference_manual/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/reference_manual/code_loading.xml b/system/doc/reference_manual/code_loading.xml
index e9da40e02f..f6fd2911fa 100644
--- a/system/doc/reference_manual/code_loading.xml
+++ b/system/doc/reference_manual/code_loading.xml
@@ -130,26 +130,6 @@ loop() ->
<marker id="on_load"></marker>
<title>Running a Function When a Module is Loaded</title>
- <warning>
- <p>The <c>on_load</c> feature is to be considered experimental
- as there are a number of known weak points in current semantics,
- which therefore might change in future Erlang/OTP releases:</p>
- <list>
- <item><p>Doing external call in <c>on_load</c> to the module itself
- leads to deadlock.</p></item>
- <item><p>At module upgrade, other processes calling the module
- get suspended waiting for <c>on_load</c> to finish. This can be very bad
- for applications with demands on realtime characteristics.</p></item>
- <item><p>At module upgrade, no rollback is done if the
- <c>on_load</c> function fails.
- The system is left in a bad limbo state without any working
- and reachable instance of the module.</p></item>
- </list>
- <p>The problems with module upgrade described above can be fixed in future
- Erlang/OTP releases by changing the behaviour to not make the module reachable until
- after the <c>on_load</c> function has successfully returned.</p>
- </warning>
-
<p>The <c>-on_load()</c> directive names a function that is to
be run automatically when a module is loaded.</p>
<p>Its syntax is as follows:</p>
@@ -159,20 +139,35 @@ loop() ->
<p>It is not necessary to export the function. It is called in a
freshly spawned process (which terminates as soon as the function
- returns). The function must return <c>ok</c> if the module is to
- remain loaded and become callable, or any other value if the module
- is to be unloaded. Generating an exception also causes the
- module to be unloaded. If the return value is not an atom,
- a warning error report is sent to the error logger.</p>
-
- <p>A process that calls any function in a module whose <c>on_load</c>
- function has not yet returned, is suspended until the <c>on_load</c>
- function has returned.</p>
+ returns).</p>
+
+ <p>The function must return <c>ok</c> if the module is to
+ become the new current code for the module and become
+ callable.</p>
+
+ <p>Returning any other value or generating an exception
+ causes the new code to be unloaded. If the return value is not an
+ atom, a warning error report is sent to the error logger.</p>
+
+ <p>If there already is current code for the module, that code will
+ remain current and can be called until the <c>on_load</c> function
+ has returned. If the <c>on_load</c> function fails, the current
+ code (if any) will remain current. If there is no current code for
+ a module, any process that makes an external call to the module
+ before the <c>on_load</c> function has finished will be suspended
+ until the <c>on_load</c> function have finished.</p>
+
+ <note>
+ <p>Before OTP 19, if the <c>on_load</c> function failed, any
+ previously current code would become old, essentially leaving
+ the system without any working and reachable instance of the
+ module. That problem has been eliminated in OTP 19.</p>
+ </note>
<p>In embedded mode, first all modules are loaded.
Then all <c>on_load</c> functions are called. The system is
terminated unless all of the <c>on_load</c> functions return
- <c>ok</c></p>.
+ <c>ok</c>.</p>
<p><em>Example:</em></p>
diff --git a/system/doc/reference_manual/expressions.xml b/system/doc/reference_manual/expressions.xml
index 75486488e9..355fd3cfef 100644
--- a/system/doc/reference_manual/expressions.xml
+++ b/system/doc/reference_manual/expressions.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2015</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/reference_manual/macros.xml b/system/doc/reference_manual/macros.xml
index 42ea639b54..350bb1d123 100644
--- a/system/doc/reference_manual/macros.xml
+++ b/system/doc/reference_manual/macros.xml
@@ -234,6 +234,53 @@ or
</section>
<section>
+ <title>-error() and -warning() directives</title>
+
+ <p>The directive <c>-error(Term)</c> causes a compilation error.</p>
+
+ <p><em>Example:</em></p>
+ <code type="none">
+-module(t).
+-export([version/0]).
+
+-ifdef(VERSION).
+version() -> ?VERSION.
+-else.
+-error("Macro VERSION must be defined.").
+version() -> "".
+-endif.</code>
+
+ <p>The error message will look like this:</p>
+
+ <pre>
+% <input>erlc t.erl</input>
+t.erl:7: -error("Macro VERSION must be defined.").</pre>
+
+ <p>The directive <c>-warning(Term)</c> causes a compilation warning.</p>
+
+ <p><em>Example:</em></p>
+ <code type="none">
+-module(t).
+-export([version/0]).
+
+-ifndef(VERSION).
+-warning("Macro VERSION not defined -- using default version.").
+-define(VERSION, "0").
+-endif.
+version() -> ?VERSION.</code>
+
+ <p>The warning message will look like this:</p>
+
+ <pre>
+% <input>erlc t.erl</input>
+t.erl:5: Warning: -warning("Macro VERSION not defined -- using default version.").</pre>
+
+ <p>The <c>-error()</c> and <c>-warning()</c> directives were added
+ in OTP 19.</p>
+
+ </section>
+
+ <section>
<title>Stringifying Macro Arguments</title>
<p>The construction <c>??Arg</c>, where <c>Arg</c> is a macro
argument, is expanded to a string containing the tokens of
@@ -253,5 +300,6 @@ io:format("Call ~s: ~w~n",["you : function ( 2 , 1 )",you:function(2,1)]).</code
<p>That is, a trace output, with both the function called and
the resulting value.</p>
</section>
+
</chapter>
diff --git a/system/doc/reference_manual/modules.xml b/system/doc/reference_manual/modules.xml
index 5f2ac2a67d..96968b547e 100644
--- a/system/doc/reference_manual/modules.xml
+++ b/system/doc/reference_manual/modules.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2015</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -144,6 +144,7 @@ fact(0) -> % |
<list type="bulleted">
<item><c>gen_server</c></item>
<item><c>gen_fsm</c></item>
+ <item><c>gen_statem</c></item>
<item><c>gen_event</c></item>
<item><c>supervisor</c></item>
</list>
diff --git a/system/doc/reference_manual/part.xml b/system/doc/reference_manual/part.xml
index 58483b099a..3d31157973 100644
--- a/system/doc/reference_manual/part.xml
+++ b/system/doc/reference_manual/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2003</year><year>2014</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/reference_manual/patterns.xml b/system/doc/reference_manual/patterns.xml
index 043d282de7..57b84b4dfc 100644
--- a/system/doc/reference_manual/patterns.xml
+++ b/system/doc/reference_manual/patterns.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/reference_manual/typespec.xml b/system/doc/reference_manual/typespec.xml
index c5d24a96b5..9e26e9058d 100644
--- a/system/doc/reference_manual/typespec.xml
+++ b/system/doc/reference_manual/typespec.xml
@@ -132,15 +132,18 @@
| nonempty_list(Type) %% Proper non-empty list
Map :: map() %% stands for a map of any size
- | #{} %% stands for a map of any size
+ | #{} %% stands for the empty map
| #{PairList}
Tuple :: tuple() %% stands for a tuple of any size
| {}
| {TList}
- PairList :: Type => Type
- | Type => Type, PairList
+ PairList :: Pair
+ | Pair, PairList
+
+ Pair :: Type := Type %% notes a pair that must be present
+ | Type => Type
TList :: Type
| Type, TList
@@ -170,6 +173,23 @@
The notation <c>[]</c> specifies the singleton type for the empty list.
</p>
<p>
+ The general form of maps is <c>#{PairList}</c>. The key types in
+ <c>PairList</c> are allowed to overlap, and if they do, the leftmost pair
+ takes precedence. A map value does not belong to this type if contains a key
+ that is not in <c>PairList</c>.
+ </p>
+ <p>
+ Because it is common to end a map type with <c>any() =&gt; any()</c> to denote
+ that keys that do not belong to any other pair in <c>PairList</c> are
+ allowed, and may map to any value, the shorthand notation <c>...</c> is
+ allowed as the last pair of a map type.
+ </p>
+ <p>
+ Notice that the syntactic representation of <c>map()</c> is <c>#{...}</c>
+ (or <c>#{_ =&gt; _}</c>, or <c>#{any() =&gt; any()}</c>), not <c>#{}</c>.
+ The notation <c>#{}</c> specifies the singleton type for the empty map.
+ </p>
+ <p>
For convenience, the following types are also built-in.
They can be thought as predefined aliases for the type unions also shown in
the table.
@@ -302,12 +322,6 @@
This is described in <seealso marker="#typeinrecords">
Type Information in Record Declarations</seealso>.
</p>
- <note>
- <p>Map types, both <c>map()</c> and <c>#{...}</c>,
- are considered experimental during OTP 17.</p>
- <p>No type information of maps pairs, only the containing map types,
- are used by Dialyzer in OTP 17.</p>
- </note>
</section>
<section>
diff --git a/system/doc/reference_manual/xmlfiles.mk b/system/doc/reference_manual/xmlfiles.mk
index 323b94c0de..61637ae701 100644
--- a/system/doc/reference_manual/xmlfiles.mk
+++ b/system/doc/reference_manual/xmlfiles.mk
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/system_architecture_intro/Makefile b/system/doc/system_architecture_intro/Makefile
index 8bc86ab312..446e66205c 100644
--- a/system/doc/system_architecture_intro/Makefile
+++ b/system/doc/system_architecture_intro/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/system_architecture_intro/book.xml b/system/doc/system_architecture_intro/book.xml
index 318f940a18..4b9f03c7f9 100644
--- a/system/doc/system_architecture_intro/book.xml
+++ b/system/doc/system_architecture_intro/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/system_architecture_intro/part.xml b/system/doc/system_architecture_intro/part.xml
index eb0f9e0ba6..c000892449 100644
--- a/system/doc/system_architecture_intro/part.xml
+++ b/system/doc/system_architecture_intro/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/system_architecture_intro/sys_arch_intro.xml b/system/doc/system_architecture_intro/sys_arch_intro.xml
index b9535f66f8..cf75e1f100 100644
--- a/system/doc/system_architecture_intro/sys_arch_intro.xml
+++ b/system/doc/system_architecture_intro/sys_arch_intro.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/system_architecture_intro/xmlfiles.mk b/system/doc/system_architecture_intro/xmlfiles.mk
index 6e7e712703..60c2047796 100644
--- a/system/doc/system_architecture_intro/xmlfiles.mk
+++ b/system/doc/system_architecture_intro/xmlfiles.mk
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/system_principles/Makefile b/system/doc/system_principles/Makefile
index 2bb84474df..77edea8f58 100644
--- a/system/doc/system_principles/Makefile
+++ b/system/doc/system_principles/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2012. All Rights Reserved.
+# Copyright Ericsson AB 1996-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/system_principles/book.xml b/system/doc/system_principles/book.xml
index 11eacba578..cd84d4cf6b 100644
--- a/system/doc/system_principles/book.xml
+++ b/system/doc/system_principles/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1996</year><year>2013</year>
+ <year>1996</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/system_principles/create_target.xmlsrc b/system/doc/system_principles/create_target.xmlsrc
index ccc26081c3..8a463076f5 100644
--- a/system/doc/system_principles/create_target.xmlsrc
+++ b/system/doc/system_principles/create_target.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2014</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/system_principles/error_logging.xml b/system/doc/system_principles/error_logging.xml
index 024137a430..c99d59ddb7 100644
--- a/system/doc/system_principles/error_logging.xml
+++ b/system/doc/system_principles/error_logging.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2013</year>
+ <year>2003</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/system_principles/part.xml b/system/doc/system_principles/part.xml
index 1557b5ff62..1b87ecd350 100644
--- a/system/doc/system_principles/part.xml
+++ b/system/doc/system_principles/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2014</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/system_principles/upgrade.xml b/system/doc/system_principles/upgrade.xml
index 173e46185c..c491bd855e 100644
--- a/system/doc/system_principles/upgrade.xml
+++ b/system/doc/system_principles/upgrade.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2014</year>
+ <year>2014</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/system_principles/versions.xml b/system/doc/system_principles/versions.xml
index ee104a8302..3772d773fc 100644
--- a/system/doc/system_principles/versions.xml
+++ b/system/doc/system_principles/versions.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2014</year>
+ <year>2014</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/system_principles/xmlfiles.mk b/system/doc/system_principles/xmlfiles.mk
index fcc1fc886f..c3c3bb4731 100644
--- a/system/doc/system_principles/xmlfiles.mk
+++ b/system/doc/system_principles/xmlfiles.mk
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2014. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/top/Makefile b/system/doc/top/Makefile
index 7e3041ce1e..caae19a8d1 100644
--- a/system/doc/top/Makefile
+++ b/system/doc/top/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2013. All Rights Reserved.
+# Copyright Ericsson AB 1999-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/top/book.xml b/system/doc/top/book.xml
index 7bbeb38472..c94b0f24d6 100644
--- a/system/doc/top/book.xml
+++ b/system/doc/top/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/top/src/erl_html_tools.erl b/system/doc/top/src/erl_html_tools.erl
index dddf025020..ab58fdf666 100644
--- a/system/doc/top/src/erl_html_tools.erl
+++ b/system/doc/top/src/erl_html_tools.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/system/doc/top/src/erlresolvelinks.erl b/system/doc/top/src/erlresolvelinks.erl
index 7946fd4bea..cfe8d0fa0b 100644
--- a/system/doc/top/src/erlresolvelinks.erl
+++ b/system/doc/top/src/erlresolvelinks.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/system/doc/top/src/otp_man_index.erl b/system/doc/top/src/otp_man_index.erl
index 753e952ecb..12aaba1423 100644
--- a/system/doc/top/src/otp_man_index.erl
+++ b/system/doc/top/src/otp_man_index.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/system/doc/top/templates/applications.html.src b/system/doc/top/templates/applications.html.src
index 4be969f9d1..1f73c44d69 100644
--- a/system/doc/top/templates/applications.html.src
+++ b/system/doc/top/templates/applications.html.src
@@ -2,7 +2,7 @@
<!--
%CopyrightBegin%
-Copyright Ericsson AB 2009-2010. All Rights Reserved.
+Copyright Ericsson AB 2009-2016. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/system/doc/top/templates/index.html.src b/system/doc/top/templates/index.html.src
index bdac3895b0..9637685946 100644
--- a/system/doc/top/templates/index.html.src
+++ b/system/doc/top/templates/index.html.src
@@ -2,7 +2,7 @@
<!--
%CopyrightBegin%
-Copyright Ericsson AB 2009-2014. All Rights Reserved.
+Copyright Ericsson AB 2009-2016. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -145,10 +145,10 @@ verification, comment support including paragraph filling, skeletons,
tags support and more. See the <a href="#tools#/index.html">
Tools</a> application for details.
<p>
-There is also an
-<a href="http://erlide.org/index.html">
-Erlang plugin (ErlIDE) for Eclipse</a> if you prefer a more graphical
-environment. ErlIDE is under active development with new features in almost every release.
+There are also Erlang plugins for
+<a href="http://erlide.org/index.html">Eclipse (ErlIDE)</a> and
+<a href="http://ignatov.github.io/intellij-erlang/">IntelliJ IDEA</a>
+if you prefer a more graphical environment, which are both under active development.
<li>When developing with Erlang/OTP you usually test your programs
from the interactive shell (see <a href="getting_started/users_guide.html">
Getting Started With Erlang</a>) where you can call individual
diff --git a/system/doc/tutorial/Makefile b/system/doc/tutorial/Makefile
index 868e79cd83..5deea41f0a 100644
--- a/system/doc/tutorial/Makefile
+++ b/system/doc/tutorial/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2012. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/system/doc/tutorial/appendix.xmlsrc b/system/doc/tutorial/appendix.xmlsrc
index 52c24c1b67..4be6c91fe9 100644
--- a/system/doc/tutorial/appendix.xmlsrc
+++ b/system/doc/tutorial/appendix.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/tutorial/book.xml b/system/doc/tutorial/book.xml
index 81530f25eb..1841a2df60 100644
--- a/system/doc/tutorial/book.xml
+++ b/system/doc/tutorial/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/tutorial/distribution.xml b/system/doc/tutorial/distribution.xml
index 40d60acb3a..b489410841 100644
--- a/system/doc/tutorial/distribution.xml
+++ b/system/doc/tutorial/distribution.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/tutorial/part.xml b/system/doc/tutorial/part.xml
index 5216d1653d..4a66f0cb22 100644
--- a/system/doc/tutorial/part.xml
+++ b/system/doc/tutorial/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2000</year><year>2013</year>
+ <year>2000</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/tutorial/xmlfiles.mk b/system/doc/tutorial/xmlfiles.mk
index 28b66f232d..f8ed7be064 100644
--- a/system/doc/tutorial/xmlfiles.mk
+++ b/system/doc/tutorial/xmlfiles.mk
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2010. All Rights Reserved.
+# Copyright Ericsson AB 2009-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.